summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorEric Sun <jian.sun@freescale.com>2012-08-01 12:57:24 +0800
committerJustin Waters <justin.waters@timesys.com>2012-09-12 11:05:53 -0400
commit3f432182664021c11f90f1fe288ea50b75f23a06 (patch)
tree10c150b639be76b5caa4a8b549fc31fbaad4cb53 /board
parent1a8e5c25a5cc1982ec794e6bd9e331df5347dd0c (diff)
ENGR00218972 MX6 Secure Boot, Change to dynamic HAB data authentication
The original secure boot implementation make a consumption that u-boot.bin will not exceed 0x2F000. With this consumption, the hab data is hard coded in linker script file to relative address 0x2F000 without causing any problem. But when this consumption don't hold, the hard coded way will cause memory region overlap and break build. So we need to change to a dynamic way of allocating hab_data. The new implementation put hab data at the next 0x1000 alignment after u-boot data and text section, instead of hard coded to 0x2F000. Similar changes is made to uImage authentication implementation. Changes in U-Boot includes: - in u-boot.lds file, change "__hab_data" to dynamic align to 0x1000 - change authenticate_image implementation, originally the uImage parameters are hard coded, now they are retrived from the "load_addr" and the image_hdr The new secure image layout: U-Boot +-------------------+ DDR_START | | | U-Boot Image | | | +-------------------+ DDR_START + UBOOT_SIZE | PADDING | +-------------------+ align to 0x1000 | CSF Data | - +-------------------+ +-- CSF + Pad, Size : 0x2000 | PADDING | - +-------------------+ uImage +-------------------+ DDR_START | | | uImage | | | +-------------------+ DDR_START + UIMAGE_SIZE | PADDING | +-------------------+ align to 0x1000 | IVT | ---- Size : 0x20 +-------------------+ | CSF Data | - +-------------------+ +-- CSF + Pad, Size : 0x2000 | PADDING | - +-------------------+ Signed-off-by: Eric Sun <jian.sun@freescale.com>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/mx6q_arm2/u-boot.lds4
-rw-r--r--board/freescale/mx6sl_arm2/u-boot.lds4
2 files changed, 4 insertions, 4 deletions
diff --git a/board/freescale/mx6q_arm2/u-boot.lds b/board/freescale/mx6q_arm2/u-boot.lds
index a6bcebb4a9f..8f16b26166e 100644
--- a/board/freescale/mx6q_arm2/u-boot.lds
+++ b/board/freescale/mx6q_arm2/u-boot.lds
@@ -69,8 +69,8 @@ SECTIONS
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code when HAB is not enabled */
- /* Original Size is 0x27..., enlarge to 0x3F000 */
- . = TEXT_BASE + 0x3F000;
+ /* Extend to align to 0x1000, then put the Hab Data */
+ . = ALIGN(0x1000);
__hab_data = .;
. = . + 0x2000;
__hab_data_end = .;
diff --git a/board/freescale/mx6sl_arm2/u-boot.lds b/board/freescale/mx6sl_arm2/u-boot.lds
index e60df09e2bf..d17b8627d8b 100644
--- a/board/freescale/mx6sl_arm2/u-boot.lds
+++ b/board/freescale/mx6sl_arm2/u-boot.lds
@@ -69,8 +69,8 @@ SECTIONS
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code when HAB is not enabled */
- /* Original Size is 0x27..., enlarge to 0x2F000 */
- . = TEXT_BASE + 0x2F000;
+ /* Extend to align to 0x1000, then put the Hab Data */
+ . = ALIGN(0x1000);
__hab_data = .;
. = . + 0x2000;
__hab_data_end = .;