powerpc/mpc85xx: SECURE BOOT- Enable chain of trust in SPL
As part of Chain of Trust for Secure boot, the SPL U-Boot will validate the next level U-boot image. Add a new function spl_validate_uboot to perform the validation. Enable hardware crypto operations in SPL using SEC block. In case of Secure Boot, PAMU is not bypassed. For allowing SEC block access to CPC configured as SRAM, configure PAMU. Reviewed-by: Ruchika Gupta <ruchika.gupta@nxp.com> Signed-off-by: Aneesh Bansal <aneesh.bansal@nxp.com> Signed-off-by: Sumit Garg <sumit.garg@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <york.sun@nxp.com>
This commit is contained in:
@@ -239,15 +239,23 @@ int pamu_init(void)
|
||||
spaact_size = sizeof(struct paace) * NUM_SPAACT_ENTRIES;
|
||||
|
||||
/* Allocate space for Primary PAACT Table */
|
||||
#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_PPAACT_ADDR))
|
||||
ppaact = (void *)CONFIG_SPL_PPAACT_ADDR;
|
||||
#else
|
||||
ppaact = memalign(PAMU_TABLE_ALIGNMENT, ppaact_size);
|
||||
if (!ppaact)
|
||||
return -1;
|
||||
#endif
|
||||
memset(ppaact, 0, ppaact_size);
|
||||
|
||||
/* Allocate space for Secondary PAACT Table */
|
||||
#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_SPAACT_ADDR))
|
||||
sec = (void *)CONFIG_SPL_SPAACT_ADDR;
|
||||
#else
|
||||
sec = memalign(PAMU_TABLE_ALIGNMENT, spaact_size);
|
||||
if (!sec)
|
||||
return -1;
|
||||
#endif
|
||||
memset(sec, 0, spaact_size);
|
||||
|
||||
ppaact_phys = virt_to_phys((void *)ppaact);
|
||||
|
||||
@@ -28,6 +28,14 @@ void construct_pamu_addr_table(struct pamu_addr_tbl *tbl, int *num_entries)
|
||||
|
||||
i++;
|
||||
#endif
|
||||
#if (defined(CONFIG_SPL_BUILD) && (CONFIG_SYS_INIT_L3_VADDR))
|
||||
tbl->start_addr[i] =
|
||||
(uint64_t)virt_to_phys((void *)CONFIG_SYS_INIT_L3_VADDR);
|
||||
tbl->size[i] = 256 * 1024; /* 256K CPC flash */
|
||||
tbl->end_addr[i] = tbl->start_addr[i] + tbl->size[i] - 1;
|
||||
|
||||
i++;
|
||||
#endif
|
||||
debug("PAMU address\t\t\tsize\n");
|
||||
for (j = 0; j < i ; j++)
|
||||
debug("%llx \t\t\t%llx\n", tbl->start_addr[j], tbl->size[j]);
|
||||
|
||||
Reference in New Issue
Block a user