X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FArmVExpressPkg%2FLibrary%2FArmVExpressLibCTA9x4%2FCTA9x4.c;h=b314f51b01ac87a6f8f1d4eb3c5b29b54cb4c4b4;hp=2b6238bc76d45372ba3f7717e3a8b9b6c4c353f4;hb=0db25ccc6cf1d05dc6b8fd9b07d033b40c387c88;hpb=44788bae6f0ac5519764651d732a7c12b1f398c4 diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c index 2b6238bc76..b314f51b01 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011, ARM Limited. All rights reserved. +* Copyright (c) 2011-2012, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -13,7 +13,6 @@ **/ #include -#include #include #include #include @@ -105,25 +104,6 @@ PL341_DMC_CONFIG DDRTimings = { .ExtModeReg = DDR_EMR_RTT_50R | (DDR_EMR_ODS_VAL << DDR_EMR_ODS_MASK), }; -/** - Return if Trustzone is supported by your platform - - A non-zero value must be returned if you want to support a Secure World on your platform. - ArmVExpressTrustzoneInit() will later set up the secure regions. - This function can return 0 even if Trustzone is supported by your processor. In this case, - the platform will continue to run in Secure World. - - @return A non-zero value if Trustzone supported. - -**/ -UINTN -ArmPlatformTrustzoneSupported ( - VOID - ) -{ - return (MmioRead32(ARM_VE_SYS_CFGRW1_REG) & ARM_VE_CFGRW1_TZASC_EN_BIT_MASK); -} - /** Return the current Boot Mode @@ -137,29 +117,10 @@ ArmPlatformGetBootMode ( VOID ) { - return BOOT_WITH_FULL_CONFIGURATION; -} - -/** - Remap the memory at 0x0 - - Some platform requires or gives the ability to remap the memory at the address 0x0. - This function can do nothing if this feature is not relevant to your platform. - -**/ -VOID -ArmPlatformBootRemapping ( - VOID - ) -{ - UINT32 Value; - - if (FeaturePcdGet(PcdNorFlashRemapping)) { - SerialPrint ("Secure ROM at 0x0\n\r"); + if (MmioRead32(ARM_VE_SYS_FLAGS_NV_REG) == 0) { + return BOOT_WITH_FULL_CONFIGURATION; } else { - Value = MmioRead32(ARM_VE_SYS_CFGRW1_REG); //Scc - CFGRW1 - // Remap the DRAM to 0x0 - MmioWrite32(ARM_VE_SYS_CFGRW1_REG, (Value & 0x0FFFFFFF) | ARM_VE_CFGRW1_REMAP_DRAM); + return BOOT_ON_S2_RESUME; } } @@ -196,6 +157,17 @@ ArmPlatformInitializeSystemMemory ( VOID ) { + UINT32 Value; + + // Memory Map remapping + if (FeaturePcdGet(PcdNorFlashRemapping)) { + SerialPrint ("Secure ROM at 0x0\n\r"); + } else { + Value = MmioRead32(ARM_VE_SYS_CFGRW1_REG); //Scc - CFGRW1 + // Remap the DRAM to 0x0 + MmioWrite32(ARM_VE_SYS_CFGRW1_REG, (Value & 0x0FFFFFFF) | ARM_VE_CFGRW1_REMAP_DRAM); + } + PL341DmcInit(ARM_VE_DMC_BASE, &DDRTimings); PL301AxiInit(ARM_VE_FAXI_BASE); }