1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2015 Freescale Semiconductor, Inc.
6 #ifndef __CONFIG_FSL_CHAIN_TRUST_H
7 #define __CONFIG_FSL_CHAIN_TRUST_H
9 #include <linux/stringify.h>
11 #ifdef CONFIG_CHAIN_OF_TRUST
14 * Control should not reach back to uboot after validation of images
15 * for secure boot flow and therefore bootscript should have
16 * the bootm command. If control reaches back to uboot anyhow
17 * after validating images, core should just spin.
20 #ifdef CONFIG_USE_BOOTARGS
21 #define SET_BOOTARGS "setenv bootargs \'" CONFIG_BOOTARGS" \';"
23 #define SET_BOOTARGS "setenv bootargs \'root=/dev/ram " \
24 "rw console=ttyS0,115200 ramdisk_size=600000\';"
28 "setenv bs_hdraddr " __stringify(CONFIG_BOOTSCRIPT_HDR_ADDR)";" \
30 "esbc_validate $bs_hdraddr;" \
34 #ifdef CONFIG_BOOTSCRIPT_COPY_RAM
36 "setenv bs_hdr_ram " __stringify(CONFIG_BS_HDR_ADDR_RAM)";" \
37 "setenv bs_hdr_device " __stringify(CONFIG_BS_HDR_ADDR_DEVICE)";" \
38 "setenv bs_hdr_size " __stringify(CONFIG_BS_HDR_SIZE)";" \
39 "setenv bs_ram " __stringify(CONFIG_BS_ADDR_RAM)";" \
40 "setenv bs_device " __stringify(CONFIG_BS_ADDR_DEVICE)";" \
41 "setenv bs_size " __stringify(CONFIG_BS_SIZE)";"
43 /* For secure boot flow, default environment used will be used */
44 #if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_NAND_BOOT) || \
45 defined(CONFIG_SD_BOOT)
46 #if defined(CONFIG_NAND_BOOT)
48 "nand read $bs_hdr_ram $bs_hdr_device $bs_hdr_size ;" \
49 "nand read $bs_ram $bs_device $bs_size ;"
50 #elif defined(CONFIG_SD_BOOT)
52 "mmc read $bs_hdr_ram $bs_hdr_device $bs_hdr_size ;" \
53 "mmc read $bs_ram $bs_device $bs_size ;"
57 "cp.b $bs_hdr_device $bs_hdr_ram $bs_hdr_size ;" \
58 "cp.b $bs_device $bs_ram $bs_size ;"
60 #else /* !CONFIG_BOOTSCRIPT_COPY_RAM */
63 #endif /* CONFIG_BOOTSCRIPT_COPY_RAM */
65 #define CHAIN_BOOT_CMD BS_COPY_ENV \