refactor ramaining #define access

This commit is contained in:
Resaec 2018-04-26 18:26:23 +02:00
parent 33824b51f4
commit 0674839e89
3 changed files with 8 additions and 16 deletions

View file

@ -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);

View file

@ -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

View file

@ -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();