MLK-18129-2 imx8qm/qxp: Add secure boot environment
authorYe Li <ye.li@nxp.com>
Wed, 25 Apr 2018 09:45:32 +0000 (02:45 -0700)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 07:56:22 +0000 (00:56 -0700)
Add the secure boot relevant environment variables to MEK.
When CONFIG_AHAB_BOOT is enabled, we will switch to boot in this
new way:
1. Load the OS container to address 0x98000000
2. Using auth_cntr to authenticate the OS container. It will load the
   kernel and FDT to destination address.
3. Using booti to boot kernel.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 545c8fe112244f20377e97921389c86eacc8551f)
(cherry picked from commit cba5acebbe6be0736f229ef719b1a1e5835e1a5f)
(cherry picked from commit 07b9850354b27dafa4cc774c59770931af2ac898)
(cherry picked from commit 149006de99c9c214232d30cc2e9795401766fe4b)

board/freescale/imx8qm_mek/imx8qm_mek.c
board/freescale/imx8qxp_mek/imx8qxp_mek.c
include/configs/imx8qm_mek.h
include/configs/imx8qxp_mek.h

index 9543017..b71a753 100644 (file)
@@ -357,6 +357,11 @@ int board_late_init(void)
        env_set("board_rev", "iMX8QM");
 #endif
 
+       env_set("sec_boot", "no");
+#ifdef CONFIG_AHAB_BOOT
+       env_set("sec_boot", "yes");
+#endif
+
        fdt_file = env_get("fdt_file");
        m4_booted = m4_parts_booted();
 
index 0b33b1e..fdea685 100644 (file)
@@ -366,6 +366,10 @@ int board_late_init(void)
        env_set("board_name", "MEK");
        env_set("board_rev", "iMX8QXP");
 #endif
+       env_set("sec_boot", "no");
+#ifdef CONFIG_AHAB_BOOT
+       env_set("sec_boot", "yes");
+#endif
 
        fdt_file = env_get("fdt_file");
        m4_booted = m4_parts_booted();
index 8a3c16f..f66bae6 100644 (file)
        "console=ttyLP0\0" \
        "fdt_addr=0x83000000\0"                 \
        "fdt_high=0xffffffffffffffff\0"         \
+       "cntr_addr=0x98000000\0"                        \
+       "cntr_file=os_cntr_signed.bin\0" \
        "boot_fdt=try\0" \
        "fdt_file=undefined\0" \
        "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
index 83d41aa..cf1b58a 100644 (file)
        "console=ttyLP0\0" \
        "fdt_addr=0x83000000\0"                 \
        "fdt_high=0xffffffffffffffff\0"         \
+       "cntr_addr=0x98000000\0"                        \
+       "cntr_file=os_cntr_signed.bin\0" \
        "boot_fdt=try\0" \
        "fdt_file=undefined\0" \
        "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \