Commit 62277d7e authored by Peng Fan's avatar Peng Fan

MLK-16753-5 imx: mx6qsabreauto: add optee support

Add defconfigs.
Enable Trustzone.
Update env to runtime boot OP-TEE.
To 6QP AUTO, TZASC not enabled now.
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
parent d868e093
......@@ -51,6 +51,11 @@ CSF CONFIG_CSF_SIZE
* Address absolute address of the register
* value value to be stored in the register
*/
#ifdef CONFIG_IMX_OPTEE
SET_BIT 4 0x20c4070 0x3c00000
DATA 4 0x20e0024 0x00000003
CHECK_BITS_SET 4 0x20e0024 0x3
#endif
DATA 4 0x020e0798 0x000C0000
DATA 4 0x020e0758 0x00000000
DATA 4 0x020e0588 0x00000030
......
......@@ -52,6 +52,11 @@ CSF CONFIG_CSF_SIZE
* Address absolute address of the register
* value value to be stored in the register
*/
#ifdef CONFIG_IMX_OPTEE
SET_BIT 4 0x20c4070 0x3c00000
DATA 4 0x20e0024 0x00000003
CHECK_BITS_SET 4 0x20e0024 0x3
#endif
DATA 4 0x020e0774 0x000C0000
DATA 4 0x020e0754 0x00000000
DATA 4 0x020e04ac 0x00000030
......
......@@ -1098,6 +1098,11 @@ int board_late_init(void)
add_board_boot_modes(board_boot_modes);
#endif
setenv("tee", "no");
#ifdef CONFIG_IMX_OPTEE
setenv("tee", "yes");
#endif
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
setenv("board_name", "SABREAUTO");
......
......@@ -52,6 +52,11 @@ CSF CONFIG_CSF_SIZE
* Address absolute address of the register
* value value to be stored in the register
*/
#ifdef CONFIG_IMX_OPTEE
SET_BIT 4 0x20c4070 0x3c00000
DATA 4 0x20e0024 0x00000003
CHECK_BITS_SET 4 0x20e0024 0x3
#endif
DATA 4, 0x020e0774, 0x000C0000
DATA 4, 0x020e0754, 0x00000000
DATA 4, 0x020e04ac, 0x00000030
......
......@@ -631,6 +631,14 @@
str r1, [r0, #0x07c]
ldr r1, =0x00000FFF
str r1, [r0, #0x080]
#ifdef CONFIG_IMX_OPTEE
#ifndef CONFIG_MX6QP
ldr r0, =0x20e0024
ldr r1, =0x3
str r1, [r0]
#endif
#endif
.endm
.macro imx6_qos_setting
......
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6QSABREAUTO=y
CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qsabreauto/mx6dl.cfg,MX6DL"
CONFIG_IMX_OPTEE=y
CONFIG_BOOTDELAY=3
# CONFIG_CONSOLE_MUX is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_MMC=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
CONFIG_CMD_DFU=y
CONFIG_CMD_USB_MASS_STORAGE=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_DFU_MMC=y
CONFIG_USB=y
CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y
CONFIG_CI_UDC=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_G_DNL_MANUFACTURER="FSL"
CONFIG_G_DNL_VENDOR_NUM=0x0525
CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
# CONFIG_VIDEO_SW_CURSOR is not set
# CONFIG_OF_LIBFDT=y
CONFIG_DEFAULT_DEVICE_TREE="imx6dl-sabreauto"
CONFIG_OF_CONTROL=y
# CONFIG_BLK is not set
CONFIG_DM_GPIO=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
CONFIG_DM_MMC=y
# CONFIG_DM_MMC_OPS is not set
CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y
CONFIG_DM_PMIC=y
CONFIG_DM_PMIC_PFUZE100=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_PFUZE100=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_ETH=y
CONFIG_DM_USB=y
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6QSABREAUTO=y
CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qsabreauto/mx6qp.cfg,MX6QP"
CONFIG_IMX_OPTEE=y
CONFIG_BOOTDELAY=3
# CONFIG_CONSOLE_MUX is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_MMC=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
CONFIG_CMD_DFU=y
CONFIG_CMD_USB_MASS_STORAGE=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_DFU_MMC=y
CONFIG_USB=y
CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y
CONFIG_CI_UDC=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_G_DNL_MANUFACTURER="FSL"
CONFIG_G_DNL_VENDOR_NUM=0x0525
CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
# CONFIG_VIDEO_SW_CURSOR is not set
# CONFIG_OF_LIBFDT=y
CONFIG_DEFAULT_DEVICE_TREE="imx6qp-sabreauto"
CONFIG_OF_CONTROL=y
# CONFIG_BLK is not set
CONFIG_DM_GPIO=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
CONFIG_DM_MMC=y
# CONFIG_DM_MMC_OPS is not set
CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y
CONFIG_DM_PMIC=y
CONFIG_DM_PMIC_PFUZE100=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_PFUZE100=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_ETH=y
CONFIG_DM_USB=y
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6QSABREAUTO=y
CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qsabreauto/imximage.cfg,MX6Q"
CONFIG_IMX_OPTEE=y
CONFIG_BOOTDELAY=3
# CONFIG_CONSOLE_MUX is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_MMC=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
CONFIG_CMD_DFU=y
CONFIG_CMD_USB_MASS_STORAGE=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_DFU_MMC=y
CONFIG_USB=y
CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y
CONFIG_CI_UDC=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_G_DNL_MANUFACTURER="FSL"
CONFIG_G_DNL_VENDOR_NUM=0x0525
CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
# CONFIG_VIDEO_SW_CURSOR is not set
# CONFIG_OF_LIBFDT=y
CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabreauto"
CONFIG_OF_CONTROL=y
# CONFIG_BLK is not set
CONFIG_DM_GPIO=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
CONFIG_DM_MMC=y
# CONFIG_DM_MMC_OPS is not set
CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y
CONFIG_DM_PMIC=y
CONFIG_DM_PMIC_PFUZE100=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_PFUZE100=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_ETH=y
CONFIG_DM_USB=y
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6QSABREAUTO=y
CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qsabreauto/mx6solo.cfg,MX6S"
CONFIG_IMX_OPTEE=y
CONFIG_BOOTDELAY=3
# CONFIG_CONSOLE_MUX is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_MMC=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
CONFIG_CMD_DFU=y
CONFIG_CMD_USB_MASS_STORAGE=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_DFU_MMC=y
CONFIG_USB=y
CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y
CONFIG_CI_UDC=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_G_DNL_MANUFACTURER="FSL"
CONFIG_G_DNL_VENDOR_NUM=0x0525
CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
# CONFIG_VIDEO_SW_CURSOR is not set
# CONFIG_OF_LIBFDT=y
CONFIG_DEFAULT_DEVICE_TREE="imx6dl-sabreauto"
CONFIG_OF_CONTROL=y
# CONFIG_BLK is not set
CONFIG_DM_GPIO=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
CONFIG_DM_MMC=y
# CONFIG_DM_MMC_OPS is not set
CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y
CONFIG_DM_PMIC=y
CONFIG_DM_PMIC_PFUZE100=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_PFUZE100=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_ETH=y
CONFIG_DM_USB=y
......@@ -23,7 +23,11 @@
#undef MFG_NAND_PARTITION
#ifdef CONFIG_NAND_BOOT
#ifdef CONFIG_IMX_OPTEE
#define MFG_NAND_PARTITION "mtdparts=8000000.nor:1m(boot),-(rootfs)\\\\;gpmi-nand:64m(boot),16m(tee),16m(kernel),16m(dtb),1m(misc),-(rootfs) "
#else
#define MFG_NAND_PARTITION "mtdparts=8000000.nor:1m(boot),-(rootfs)\\\\;gpmi-nand:64m(boot),16m(kernel),16m(dtb),1m(misc),-(rootfs) "
#endif
#else
#define MFG_NAND_PARTITION ""
#endif
......
......@@ -62,7 +62,11 @@
"\0" \
"initrd_addr=0x12C00000\0" \
"initrd_high=0xffffffff\0" \
"bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};\0" \
"bootcmd_mfg=run mfgtool_args; " \
"if test ${tee} = yes; then " \
"bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; " \
"else " \
"bootz ${loadaddr} ${initrd_addr} ${fdt_addr};\0" \
#ifdef CONFIG_SUPPORT_EMMC_BOOT
......@@ -102,10 +106,16 @@
"fdt_high=0xffffffff\0" \
"bootargs=console=" CONSOLE_DEV ",115200 ubi.mtd=5 " \
"root=ubi0:rootfs rootfstype=ubifs " \
"mtdparts=gpmi-nand:64m(boot),16m(kernel),16m(dtb),1m(misc),-(rootfs)\0"\
"bootcmd=nand read ${loadaddr} 0x4000000 0x800000;"\
"nand read ${fdt_addr} 0x5000000 0x100000;"\
"bootz ${loadaddr} - ${fdt_addr}\0"
MFG_NAND_PARTITION \
"\0" \
"bootcmd=nand read ${loadaddr} 0x5000000 0x800000;"\
"nand read ${fdt_addr} 0x6000000 0x100000;"\
"if test ${tee} = yes; then " \
"nand read ${tee_addr} 0x4000000 0x400000;"\
"bootm ${teeaddr} - ${fdt_addr};" \
"else " \
"bootz ${loadaddr} - ${fdt_addr};" \
"fi\0"
#elif defined(CONFIG_SATA_BOOT)
......@@ -119,7 +129,11 @@
"bootcmd_sata=run bootargs_sata; sata init; " \
"sata read ${loadaddr} 0x800 0x4000; " \
"sata read ${fdt_addr} 0x8000 0x800; " \
"bootz ${loadaddr} - ${fdt_addr} \0" \
"if test ${tee} = yes; then " \
"sata read ${tee_addr} 0x9000 0x2000; " \
"else " \
"bootz ${loadaddr} - ${fdt_addr}; " \
"fi \0"\
"bootcmd=run bootcmd_sata \0"
#else
......@@ -131,6 +145,8 @@
"image=zImage\0" \
"fdt_file=undefined\0" \
"fdt_addr=0x18000000\0" \
"tee_addr=0x20000000\0" \
"tee_file=undefined\0" \
"boot_fdt=try\0" \
"ip_dyn=yes\0" \
"console=" CONSOLE_DEV "\0" \
......@@ -167,20 +183,25 @@
"source\0" \
"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
"loadtee=fatload mmc ${mmcdev}:${mmcpart} ${tee_addr} ${tee_file}\0" \
"mmcboot=echo Booting from mmc ...; " \
"run mmcargs; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
"bootz ${loadaddr} - ${fdt_addr}; " \
"else " \
"if test ${boot_fdt} = try; then " \
"bootz; " \
"if test ${tee} = yes; then " \
"run loadfdt; run loadtee; bootm ${tee_addr} - ${fdt_addr}; " \
"else " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
"bootz ${loadaddr} - ${fdt_addr}; " \
"else " \
"echo WARN: Cannot load the DT; " \
"if test ${boot_fdt} = try; then " \
"bootz; " \
"else " \
"echo WARN: Cannot load the DT; " \
"fi; " \
"fi; " \
"fi; " \
"else " \
"bootz; " \
"else " \
"bootz; " \
"fi;" \
"fi;\0" \
"netargs=setenv bootargs console=${console},${baudrate} ${smp} " \
"root=/dev/nfs " \
......@@ -193,18 +214,24 @@
"setenv get_cmd tftp; " \
"fi; " \
"${get_cmd} ${image}; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
"bootz ${loadaddr} - ${fdt_addr}; " \
"else " \
"if test ${boot_fdt} = try; then " \
"bootz; " \
"if test ${tee} = yes; then " \
"${get_cmd} ${tee_addr} ${tee_file}; " \
"${get_cmd} ${fdt_addr} ${fdt_file}; " \
"bootm ${tee_addr} - ${fdt_addr}; " \
"else " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
"bootz ${loadaddr} - ${fdt_addr}; " \
"else " \
"echo WARN: Cannot load the DT; " \
"if test ${boot_fdt} = try; then " \
"bootz; " \
"else " \
"echo WARN: Cannot load the DT; " \
"fi; " \
"fi; " \
"else " \
"bootz; " \
"fi; " \
"else " \
"bootz; " \
"fi;\0" \
"findfdt="\
"if test $fdt_file = undefined; then " \
......@@ -223,9 +250,27 @@
"if test $fdt_file = undefined; then " \
"echo WARNING: Could not determine dtb to use; fi; " \
"fi;\0" \
"findtee="\
"if test $tee_file = undefined; then " \
"if test $board_name = SABREAUTO && test $board_rev = MX6QP; then " \
"setenv tee_file uTee-6qpauto; fi; " \
"if test $board_name = SABREAUTO && test $board_rev = MX6Q; then " \
"setenv tee_file uTee-6qauto; fi; " \
"if test $board_name = SABREAUTO && test $board_rev = MX6DL; then " \
"setenv tee_file uTee-6dlauto; fi; " \
"if test $board_name = SABRESD && test $board_rev = MX6QP; then " \
"setenv tee_file uTee-6qpsdb; fi; " \
"if test $board_name = SABRESD && test $board_rev = MX6Q; then " \
"setenv tee_file uTee-6qsdb; fi; " \
"if test $board_name = SABRESD && test $board_rev = MX6DL; then " \
"setenv tee_file uTee-6dlsdb; fi; " \
"if test $tee_file = undefined; then " \
"echo WARNING: Could not determine tee to use; fi; " \
"fi;\0" \
#define CONFIG_BOOTCOMMAND \
"run findfdt;" \
"run findtee;" \
"mmc dev ${mmcdev};" \
"if mmc rescan; then " \
"if run loadbootscript; then " \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment