warp7: Add a secure mode target
PATCH 1/3 warp7: Add a secure mode target
From: Fabio Estevam <[email protected]>
NXP kernel expects to boot in secure mode, so introduce warp7_secure_defconfig target which selects CONFIG_ARMV7_BOOT_SEC_DEFAULT.
--- configs/warp7_secure_defconfig | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 configs/warp7_secure_defconfig
configs/warp7_secure_defconfig new file +36 -0
@@ -0,0 +1,36 @@ +CONFIG_ARM=y +CONFIG_ARCH_MX7=y +CONFIG_TARGET_WARP7=y +# CONFIG_ARMV7_VIRT is not set +CONFIG_IMX_RDC=y +CONFIG_IMX_BOOTAUX=y +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/warp7/imximage.cfg" +CONFIG_HUSH_PARSER=y +# CONFIG_CMD_BOOTD is not set +CONFIG_CMD_BOOTZ=y +# CONFIG_CMD_IMI is not set +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_XIMG is not set +CONFIG_CMD_MEMTEST=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_DFU=y +CONFIG_CMD_USB_MASS_STORAGE=y +CONFIG_CMD_GPIO=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_USB=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_USB_EHCI_HCD=y +CONFIG_MXC_USB_OTG_HACTIVE=y +CONFIG_OF_LIBFDT=y +CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
Signature · 1 line
1.9.1
PATCH 2/3 warp7: Handle mmcroot for mainline and NXP
From: Fabio Estevam <[email protected]>
The rootfs appears at mmcblk2 in the NXP kernel and at mmcblk1 in mainline kernel.
Load the correct mmcblk device depending on the selection of the CONFIG_ARMV7_BOOT_SEC_DEFAULT variable.
CONFIG_ARMV7_BOOT_SEC_DEFAULT is selected in warp7_secure_defconfig, which is used to boot a NXP kernel.
--- include/configs/warp7.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/configs/warp7.h +5 -1
@@ -113,7 +113,11 @@#define CONFIG_SYS_MMC_ENV_DEV 0#define CONFIG_SYS_MMC_ENV_PART 0 -#define CONFIG_MMCROOT "/dev/mmcblk2p2" +#ifdef CONFIG_ARMV7_BOOT_SEC_DEFAULT +#define CONFIG_MMCROOT "/dev/mmcblk2p2"/* NXP kernel */ +#else +#define CONFIG_MMCROOT "/dev/mmcblk1p2"/* Mainline kernel */ +#endif /* USB Configs */ #define CONFIG_USB_STORAGE
Signature · 1 line
1.9.1
PATCH 3/3 warp7: Print secure/non-secure mode info
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
warp7 has two targets:
- warp7_defconfig: boots in non-secure mode
- warp7_secure_defconfig: boots in secure mode
Print the mode that is being used to help users to easily identify which target is running on the board.
--- board/warp7/warp7.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
board/warp7/warp7.c +8 -1
@@ -95,7 +95,14 @@ int board_init(void)int checkboard (void ) { -puts ("Board: WARP7\n" ); +char *mode; + +if (IS_ENABLED (CONFIG_ARMV7_BOOT_SEC_DEFAULT )) + mode ="secure" ; +else + mode ="non-secure" ; + +printf ("Board: WARP7 in %s mode\n" , mode);return 0 ; }
Signature · 1 line
1.9.1
PATCH 1/3 warp7: Add a secure mode target
In reply to Fabio EstevamQuoted 6 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
NXP kernel expects to boot in secure mode, so introduce
warp7_secure_defconfigtarget which selectsCONFIG_ARMV7_BOOT_SEC_DEFAULT.Signed-off-by Fabio Estevam <[email protected]>
Breno has sent the patch to include this on the main config; being the official kernel using this enabled I think it makes sense to keep his patch.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 1/3 warp7: Add a secure mode target
Hi Otavio,
Quoted 1 line · Otavio Salvador
Breno has sent the patch to include this on the main config; being the
Breno's patch has not been submitted to the list. It has only being applied into u-boot-fslc.
Quoted 2 lines
official kernel using this enabled I think it makes sense to keep his patch.
There is no such thing as 'official kernel', sorry. User can choose whether booting mainline or NXP kernel. This patch series allows both kernel options to boot out of the box.
It is the same thing we did on mx7dsabresd, by the way.