diff options
author | Sumit Garg <sumit.garg@nxp.com> | 2017-08-29 16:01:00 (GMT) |
---|---|---|
committer | Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> | 2017-09-03 10:03:05 (GMT) |
commit | 1dfc472c93070be70eb00835d836070a8095b201 (patch) | |
tree | 4414cbb50182fd14f54e7ccbfb1ac272effe28fa /arch/arm/cpu/armv8/fsl-layerscape/ppa.c | |
parent | 66d6397fa50e3e65402116d082c128f25cb754b7 (diff) | |
download | u-boot-1dfc472c93070be70eb00835d836070a8095b201.tar.xz |
armv8: sec_firmware: Add support for loadables in FIT
Enable support for loadables in SEC firmware FIT image. Currently support
is added for single loadable image.
Brief description of implementation:
- Add two more address pointers (loadable_h, loadable_l) as arguments to
sec_firmware_init() api.
- Create new api: sec_firmware_checks_copy_loadable() to check if loadables
node is present in SEC firmware FIT image. If present, verify loadable
image and copies it to secure DDR memory.
- Populate address pointers with secure DDR memory addresses where loadable
is copied.
Example use-case could be trusted OS (tee.bin) as loadables node in SEC
firmware FIT image.
Signed-off-by: Sumit Garg <sumit.garg@nxp.com>
Diffstat (limited to 'arch/arm/cpu/armv8/fsl-layerscape/ppa.c')
-rw-r--r-- | arch/arm/cpu/armv8/fsl-layerscape/ppa.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ppa.c b/arch/arm/cpu/armv8/fsl-layerscape/ppa.c index 35c612d..87a0885 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/ppa.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/ppa.c @@ -35,6 +35,7 @@ int ppa_init(void) unsigned int el = current_el(); void *ppa_fit_addr; u32 *boot_loc_ptr_l, *boot_loc_ptr_h; + u32 *loadable_l, *loadable_h; int ret; #ifdef CONFIG_CHAIN_OF_TRUST @@ -252,9 +253,9 @@ int ppa_init(void) PPA_KEY_HASH, &ppa_img_addr); if (ret != 0) - printf("PPA validation failed\n"); + printf("SEC firmware(s) validation failed\n"); else - printf("PPA validation Successful\n"); + printf("SEC firmware(s) validation Successful\n"); } #if defined(CONFIG_SYS_LS_PPA_FW_IN_MMC) || \ defined(CONFIG_SYS_LS_PPA_FW_IN_NAND) @@ -266,15 +267,24 @@ int ppa_init(void) struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); boot_loc_ptr_l = &gur->bootlocptrl; boot_loc_ptr_h = &gur->bootlocptrh; + + /* Assign addresses to loadable ptrs */ + loadable_l = &gur->scratchrw[4]; + loadable_h = &gur->scratchrw[5]; #elif defined(CONFIG_FSL_LSCH2) struct ccsr_scfg __iomem *scfg = (void *)(CONFIG_SYS_FSL_SCFG_ADDR); boot_loc_ptr_l = &scfg->scratchrw[1]; boot_loc_ptr_h = &scfg->scratchrw[0]; + + /* Assign addresses to loadable ptrs */ + loadable_l = &scfg->scratchrw[2]; + loadable_h = &scfg->scratchrw[3]; #endif debug("fsl-ppa: boot_loc_ptr_l = 0x%p, boot_loc_ptr_h =0x%p\n", boot_loc_ptr_l, boot_loc_ptr_h); - ret = sec_firmware_init(ppa_fit_addr, boot_loc_ptr_l, boot_loc_ptr_h); + ret = sec_firmware_init(ppa_fit_addr, boot_loc_ptr_l, boot_loc_ptr_h, + loadable_l, loadable_h); #if defined(CONFIG_SYS_LS_PPA_FW_IN_MMC) || \ defined(CONFIG_SYS_LS_PPA_FW_IN_NAND) |