[U-Boot] [PATCH 1/3] warp7: Add a secure mode target

From: Fabio Estevam fabio.estevam@nxp.com
NXP kernel expects to boot in secure mode, so introduce warp7_secure_defconfig target which selects CONFIG_ARMV7_BOOT_SEC_DEFAULT.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- configs/warp7_secure_defconfig | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 configs/warp7_secure_defconfig
diff --git a/configs/warp7_secure_defconfig b/configs/warp7_secure_defconfig new file mode 100644 index 0000000..34fcdea --- /dev/null +++ b/configs/warp7_secure_defconfig @@ -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

From: Fabio Estevam fabio.estevam@nxp.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- include/configs/warp7.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/configs/warp7.h b/include/configs/warp7.h index e59b16c..f089247 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -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

From: Fabio Estevam fabio.estevam@nxp.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- board/warp7/warp7.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 27e31f3..d3d2a0e 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -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; }

On Thu, Aug 25, 2016 at 5:57 PM, Fabio Estevam festevam@gmail.com wrote:
From: Fabio Estevam fabio.estevam@nxp.com
NXP kernel expects to boot in secure mode, so introduce warp7_secure_defconfig target which selects CONFIG_ARMV7_BOOT_SEC_DEFAULT.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
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.

Hi Otavio,
On Thu, Aug 25, 2016 at 6:02 PM, Otavio Salvador otavio.salvador@ossystems.com.br wrote:
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.
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.
participants (2)
-
Fabio Estevam
-
Otavio Salvador