diff --git a/exosphere/src/bootup.c b/exosphere/src/bootup.c index cb19a6b90..e967d3332 100644 --- a/exosphere/src/bootup.c +++ b/exosphere/src/bootup.c @@ -238,10 +238,11 @@ void setup_4x_mmio(void) { AHB_ARBITRATION_DISABLE_0 |= 2; /* Set SMMU for BPMP/APB-DMA to point to TZRAM. */ - MC_SMMU_PTB_ASID_0 = 1; - MC_SMMU_PTB_DATA_0 = 0x70012; - MC_SMMU_AVPC_ASID_0 = 0x80000001; - MC_SMMU_PPCS1_ASID_0 = 0x80000001; + mc_register->SMMU_PTB_ASID_0 = 1; + mc_register->SMMU_PTB_DATA_0 = 0x70012; + mc_register->SMMU_AVPC_ASID_0 = 0x80000001; + mc_register->SMMU_PPCS1_ASID_0 = 0x80000001; + /* Wait for the BPMP to halt. */ while ((FLOW_CTLR_HALT_COP_EVENTS_0 >> 29) != 5) { wait(1); diff --git a/exosphere/src/mc.h b/exosphere/src/mc.h index 68d8f291e..f044c915d 100644 --- a/exosphere/src/mc.h +++ b/exosphere/src/mc.h @@ -14,16 +14,6 @@ static inline uintptr_t get_mc_base(void) { #define MAKE_MC_REG(n) MAKE_REG32(MC_BASE + n) -#define MC_SMMU_PTB_ASID_0 MAKE_MC_REG(MC_REGISTER_SMMU_PTB_ASID_0) -#define MC_SMMU_PTB_DATA_0 MAKE_MC_REG(MC_REGISTER_SMMU_PTB_DATA_0) -#define MC_SMMU_AVPC_ASID_0 MAKE_MC_REG(MC_REGISTER_SMMU_AVPC_ASID_0) -#define MC_SMMU_PPCS1_ASID_0 MAKE_MC_REG(MC_REGISTER_SMMU_PPCS1_ASID_0) - -#define MC_SECURITY_CFG0_0 MAKE_MC_REG(MC_REGISTER_SECURITY_BOM) -#define MC_SECURITY_CFG1_0 MAKE_MC_REG(MC_REGISTER_SECURITY_SIZE_MB) -#define MC_SECURITY_CFG3_0 MAKE_MC_REG(MC_REGISTER_SECURITY_BOM_HI) - - #define CARVEOUT_ID_MIN 1 #define CARVEOUT_ID_MAX 5 diff --git a/exosphere/src/warmboot_main.c b/exosphere/src/warmboot_main.c index 8c5103dbb..0323bbe9f 100644 --- a/exosphere/src/warmboot_main.c +++ b/exosphere/src/warmboot_main.c @@ -30,7 +30,7 @@ void __attribute__((noreturn)) warmboot_main(void) { identity_unmap_iram_cd_tzram(); /* On warmboot (not cpu_on) only */ - if (MC_SECURITY_CFG3_0 == 0) { + if (get_mc_reg()->SECURITY_BOM_HI == 0) { if (!configitem_is_retail()) { /* TODO: uart_log("OHAYO"); */ } @@ -60,7 +60,8 @@ void __attribute__((noreturn)) warmboot_main(void) { clear_user_smc_in_progress(); if (exosphere_get_target_firmware() >= EXOSPHERE_TARGET_FIRMWARE_400) { - setup_4x_mmio(); } + setup_4x_mmio(); + } } setup_current_core_state();