pinmux: configure logport via exosphere
This commit is contained in:
3 files changed
+33
-45
No files matched your search
@@ -89,6 +89,12 @@ namespace ams::spl {
|
|||||||
return ::ams::spl::GetConfigBool(::ams::spl::ConfigItem::ExosphereForceEnableUsb30);
|
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 SetBootReason(BootReasonValue boot_reason);
|
||||||
Result GetBootReason(BootReasonValue *out);
|
Result GetBootReason(BootReasonValue *out);
|
||||||
|
|
||||||
|
|||||||
+27
-25
@@ -17,7 +17,6 @@
|
|||||||
#include "pinmux_pad_index.hpp"
|
#include "pinmux_pad_index.hpp"
|
||||||
#include "pinmux_board_driver_api.hpp"
|
#include "pinmux_board_driver_api.hpp"
|
||||||
#include "pinmux_platform_pads.hpp"
|
#include "pinmux_platform_pads.hpp"
|
||||||
#include "pinmux_build_config.hpp"
|
|
||||||
|
|
||||||
namespace ams::pinmux::driver::board::nintendo::nx {
|
namespace ams::pinmux::driver::board::nintendo::nx {
|
||||||
|
|
||||||
@@ -101,30 +100,33 @@ namespace ams::pinmux::driver::board::nintendo::nx {
|
|||||||
UpdateSinglePinmuxPad({ PinmuxPadIndex_Sdmmc2Dat7, 0x2000, 0x2000 });
|
UpdateSinglePinmuxPad({ PinmuxPadIndex_Sdmmc2Dat7, 0x2000, 0x2000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(AMS_PINMUX_CONFIG_RIGHT_RAIL_AS_UART)
|
auto [log_port, log_baud_rate] = spl::GetLogConfiguration();
|
||||||
UpdateSinglePinmuxPad({
|
AMS_UNUSED(log_baud_rate);
|
||||||
.index = PinmuxPadIndex_Uart2Tx,
|
|
||||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Output,
|
if (log_port == 1) {
|
||||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
UpdateSinglePinmuxPad({
|
||||||
});
|
.index = PinmuxPadIndex_Uart2Tx,
|
||||||
UpdateSinglePinmuxPad({
|
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Output,
|
||||||
.index = PinmuxPadIndex_Uart2Cts,
|
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Input,
|
});
|
||||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
UpdateSinglePinmuxPad({
|
||||||
});
|
.index = PinmuxPadIndex_Uart2Cts,
|
||||||
#endif
|
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Input,
|
||||||
#if defined(AMS_PINMUX_CONFIG_LEFT_RAIL_AS_UART)
|
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||||
UpdateSinglePinmuxPad({
|
});
|
||||||
.index = PinmuxPadIndex_Uart3Tx,
|
}
|
||||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Output,
|
if (log_port == 2) {
|
||||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
UpdateSinglePinmuxPad({
|
||||||
});
|
.index = PinmuxPadIndex_Uart3Tx,
|
||||||
UpdateSinglePinmuxPad({
|
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Output,
|
||||||
.index = PinmuxPadIndex_Uart3Cts,
|
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||||
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Input,
|
});
|
||||||
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
UpdateSinglePinmuxPad({
|
||||||
});
|
.index = PinmuxPadIndex_Uart3Cts,
|
||||||
#endif
|
.option = (u32)PinmuxPadPm_Pm0 | PinmuxOpt_NoPupd | PinmuxOpt_Input,
|
||||||
|
.option_mask = (u32)PinmuxOptBitMask_Pm | PinmuxOptBitMask_Pupd | PinmuxOptBitMask_Dir,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetInitialDrivePadConfig() {
|
void SetInitialDrivePadConfig() {
|
||||||
|
|||||||
-20
@@ -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