From cbaa61385cca38e5a045ed2412ab3ec13fab2468 Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Thu, 27 Aug 2026 16:31:41 -0400 Subject: [PATCH] Revert "refuse to adhere to SMMU for BPMP-FW" This reverts commit fc10a53bda81810b4693a1f729b88b34f94440d5. --- .../Atmosphere-Patches/diff/secmon_setup.diff | 22 ++++++------------- Source/Atmosphere-Patches/secmon_setup.cpp | 4 ++-- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Source/Atmosphere-Patches/diff/secmon_setup.diff b/Source/Atmosphere-Patches/diff/secmon_setup.diff index c6626484..5b796e03 100644 --- a/Source/Atmosphere-Patches/diff/secmon_setup.diff +++ b/Source/Atmosphere-Patches/diff/secmon_setup.diff @@ -1,21 +1,18 @@ -903c903 -< void EnableBpmpSmmu() { ---- -> [[maybe_unused]] void EnableBpmpSmmu() { -1200c1200 -< EnableBpmpSmmu(); ---- -> // EnableBpmpSmmu(); I REFUSE 1221c1221 < const auto target_fw = GetTargetFirmware(); --- > // const auto target_fw = GetTargetFirmware(); -1223,1233c1223,1234 +1223,1226c1223,1226 < if (target_fw >= TargetFirmware_2_0_0) { < /* Set the PMC secure. */ < reg::ReadWrite(APB_MISC + APB_MISC_SECURE_REGS_APB_SLAVE_SECURITY_ENABLE_REG0_0, SLAVE_SECURITY_REG_BITS_ENUM(0, PMC, ENABLE)); < } -< +--- +> // if (target_fw >= TargetFirmware_2_0_0) { +> // /* Set the PMC secure. */ I REFUSE +> // reg::ReadWrite(APB_MISC + APB_MISC_SECURE_REGS_APB_SLAVE_SECURITY_ENABLE_REG0_0, SLAVE_SECURITY_REG_BITS_ENUM(0, PMC, ENABLE)); +> // } +1228,1233c1228,1234 < if (target_fw >= TargetFirmware_4_0_0) { < /* Set the MC secure. */ < reg::ReadWrite(APB_MISC + APB_MISC_SECURE_REGS_APB_SLAVE_SECURITY_ENABLE_REG1_0, SLAVE_SECURITY_REG_BITS_ENUM(1, MC0, ENABLE), @@ -23,11 +20,6 @@ < SLAVE_SECURITY_REG_BITS_ENUM(1, MCB, ENABLE)); < } --- -> // if (target_fw >= TargetFirmware_2_0_0) { -> // /* Set the PMC secure. */ I REFUSE -> // reg::ReadWrite(APB_MISC + APB_MISC_SECURE_REGS_APB_SLAVE_SECURITY_ENABLE_REG0_0, SLAVE_SECURITY_REG_BITS_ENUM(0, PMC, ENABLE)); -> // } -> > // if (target_fw >= TargetFirmware_4_0_0) { > // /* Set the MC secure. */ I REFUSE > // reg::ReadWrite(APB_MISC + APB_MISC_SECURE_REGS_APB_SLAVE_SECURITY_ENABLE_REG1_0, SLAVE_SECURITY_REG_BITS_ENUM(1, MC0, ENABLE), diff --git a/Source/Atmosphere-Patches/secmon_setup.cpp b/Source/Atmosphere-Patches/secmon_setup.cpp index 60949a4f..af6c3ed8 100644 --- a/Source/Atmosphere-Patches/secmon_setup.cpp +++ b/Source/Atmosphere-Patches/secmon_setup.cpp @@ -900,7 +900,7 @@ namespace ams::secmon { reg::ReadWrite(PMC + APBDEV_PMC_SECURE_SCRATCH39, REG_BITS_VALUE(0, 27, WarmbootCarveoutConfig)); } - [[maybe_unused]] void EnableBpmpSmmu() { + void EnableBpmpSmmu() { /* Define the ASID contents. */ constexpr int BpmpAsid = 1; constexpr uintptr_t BpmpAsidPde = MemoryRegionPhysicalDeviceSecurityEngine.GetAddress(); @@ -1197,7 +1197,7 @@ namespace ams::secmon { reg::ReadWrite(SYSTEM + AHB_ARBITRATION_DISABLE, AHB_REG_BITS_ENUM(ARBITRATION_DISABLE_COP, DISABLE)); /* Turn on the SMMU for the BPMP. */ - // EnableBpmpSmmu(); I REFUSE + EnableBpmpSmmu(); /* Wait until the flow controller reports that the BPMP is halted. */ while (!reg::HasValue(FLOW_CTLR + FLOW_CTLR_HALT_COP_EVENTS, FLOW_REG_BITS_ENUM(HALT_COP_EVENTS_MODE, FLOW_MODE_STOP))) {