ARM platforms: Initialize cntfrq for BL1 Firmware update
authorSoby Mathew <[email protected]>
Mon, 11 Jun 2018 15:40:36 +0000 (16:40 +0100)
committerSoby Mathew <[email protected]>
Tue, 26 Jun 2018 14:55:46 +0000 (15:55 +0100)
Currenly the CNTFRQ register and system timer is initialized in BL31 for
use by the normal world. During firmware update, the NS-BL1 or NS-BL2U
may need to access the system timer. Hence this patch duplicates the
CNTFRQ and system timer initialization in BL1 as well.

Signed-off-by: Soby Mathew <[email protected]>
Change-Id: I1ede78b4ae64080fb418cb93f3e48b26d7b724dc

docs/firmware-design.rst
plat/arm/common/arm_bl1_setup.c

index e3500c27b084c303b515dd289144a993c64e6a46..8aa762278396ecf961f3f851a727fe5b00dbca9d 100644 (file)
@@ -306,6 +306,8 @@ On Arm platforms, BL1 performs the following platform initializations:
 -  If the BL1 dynamic configuration file, ``TB_FW_CONFIG``, is available, then
    load it to the platform defined address and make it available to BL2 via
    ``arg0``.
+-  Configure the system timer and program the `CNTFRQ_EL0` for use by NS-BL1U
+   and NS-BL2U firmware update images.
 
 Firmware Update detection and execution
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index e5e73041753c811ef3a41274aab3cd0736724c02..d141f647ec02d977355fae966e06fc4228e0d96a 100644 (file)
@@ -118,6 +118,12 @@ void arm_bl1_platform_setup(void)
 #if LOAD_IMAGE_V2
        arm_load_tb_fw_config();
 #endif
+       /*
+        * Allow access to the System counter timer module and program
+        * counter frequency for non secure images during FWU
+        */
+       arm_configure_sys_timer();
+       write_cntfrq_el0(plat_get_syscnt_freq2());
 }
 
 void bl1_platform_setup(void)