pinmux: configure logport via exosphere
This commit is contained in:
@@ -89,6 +89,12 @@ namespace ams::spl {
|
||||
return ::ams::spl::GetConfigBool(::ams::spl::ConfigItem::ExosphereForceEnableUsb30);
|
||||
}
|
||||
|
||||
inline std::pair<u8, u32> GetLogConfiguration() {
|
||||
u64 v;
|
||||
R_ABORT_UNLESS(::ams::spl::GetConfig(std::addressof(v), ::ams::spl::ConfigItem::ExosphereLogConfiguration));
|
||||
return std::make_pair(static_cast<u8>(v >> 32), static_cast<u32>(v));
|
||||
}
|
||||
|
||||
Result SetBootReason(BootReasonValue boot_reason);
|
||||
Result GetBootReason(BootReasonValue *out);
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "pinmux_pad_index.hpp"
|
||||
#include "pinmux_board_driver_api.hpp"
|
||||
#include "pinmux_platform_pads.hpp"
|
||||
#include "pinmux_build_config.hpp"
|
||||
|
||||
namespace ams::pinmux::driver::board::nintendo::nx {
|
||||
|
||||
@@ -101,30 +100,33 @@ namespace ams::pinmux::driver::board::nintendo::nx {
|
||||
UpdateSinglePinmuxPad({ PinmuxPadIndex_Sdmmc2Dat7, 0x2000, 0x2000 });
|
||||
}
|
||||
|
||||
#if defined(AMS_PINMUX_CONFIG_RIGHT_RAIL_AS_UART)
|
||||
UpdateSinglePinmuxPad({
|
||||
.index = PinmuxPadIndex_Uart2Tx,
|
||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Output,
|
||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||
});
|
||||
UpdateSinglePinmuxPad({
|
||||
.index = PinmuxPadIndex_Uart2Cts,
|
||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Input,
|
||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||
});
|
||||
#endif
|
||||
#if defined(AMS_PINMUX_CONFIG_LEFT_RAIL_AS_UART)
|
||||
UpdateSinglePinmuxPad({
|
||||
.index = PinmuxPadIndex_Uart3Tx,
|
||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Output,
|
||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||
});
|
||||
UpdateSinglePinmuxPad({
|
||||
.index = PinmuxPadIndex_Uart3Cts,
|
||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Input,
|
||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||
});
|
||||
#endif
|
||||
auto [log_port, log_baud_rate] = spl::GetLogConfiguration();
|
||||
AMS_UNUSED(log_baud_rate);
|
||||
|
||||
if (log_port == 1) {
|
||||
UpdateSinglePinmuxPad({
|
||||
.index = PinmuxPadIndex_Uart2Tx,
|
||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Output,
|
||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||
});
|
||||
UpdateSinglePinmuxPad({
|
||||
.index = PinmuxPadIndex_Uart2Cts,
|
||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Input,
|
||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||
});
|
||||
}
|
||||
if (log_port == 2) {
|
||||
UpdateSinglePinmuxPad({
|
||||
.index = PinmuxPadIndex_Uart3Tx,
|
||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Output,
|
||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||
});
|
||||
UpdateSinglePinmuxPad({
|
||||
.index = PinmuxPadIndex_Uart3Cts,
|
||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Input,
|
||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void SetInitialDrivePadConfig() {
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
// #define AMS_PINMUX_CONFIG_RIGHT_RAIL_AS_UART
|
||||
// #define AMS_PINMUX_CONFIG_LEFT_RAIL_AS_UART
|
||||
Reference in New Issue
Block a user