From d17afc8a0239e9919659ad7db1042e6adf836fbb Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Tue, 1 Nov 2011 23:44:51 +0000 Subject: ArmPlaformPkg/ArmVExpressPkg: Move initialization of SP810 at the early stage of the platform initialization (SEC) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12644 6f19259b-4bc3-4df7-8a09-765794883524 --- .../ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSM.c | 11 +---------- .../ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMSec.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSM.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSM.c index 8aeedda929..6cb5501ae7 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSM.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSM.c @@ -17,8 +17,6 @@ #include #include -#include - #include #include @@ -114,14 +112,7 @@ ArmPlatformInitializeSystemMemory ( VOID ) { - // Configure periodic timer (TIMER0) for 1MHz operation - MmioOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER0_TIMCLK); - // Configure 1MHz clock - MmioOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER1_TIMCLK); - // configure SP810 to use 1MHz clock and disable - MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER2_EN, SP810_SYS_CTRL_TIMER2_TIMCLK); - // Configure SP810 to use 1MHz clock and disable - MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER3_EN, SP810_SYS_CTRL_TIMER3_TIMCLK); + // Nothing to do here } EFI_STATUS diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMSec.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMSec.c index 76a8bc1ba0..a4eee5ca0c 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMSec.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMSec.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include /** Initialize the Secure peripherals and memory regions @@ -46,6 +48,14 @@ ArmPlatformSecInitialize ( VOID ) { + // Configure periodic timer (TIMER0) for 1MHz operation + MmioOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER0_TIMCLK); + // Configure 1MHz clock + MmioOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER1_TIMCLK); + // Configure SP810 to use 1MHz clock and disable + MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER2_EN, SP810_SYS_CTRL_TIMER2_TIMCLK); + // Configure SP810 to use 1MHz clock and disable + MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER3_EN, SP810_SYS_CTRL_TIMER3_TIMCLK); } /** -- cgit v1.2.3