[U-Boot] [PATCH v2 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 --- Changes since v1: - None
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
warp7 can run different kernel versions, such as NXP 4.1 or mainline.
Currently the rootfs location is passed via mmcblk number and the problem with this approach is that the mmcblk number for the eMMC changes depending on the kernel version.
In order to avoid such issue, use UUID method to specify the rootfs location.
Succesfully tested booting a NXP 4.1 and also a mainline kernel.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- Changes since v1: - Use UUID method
include/configs/warp7.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 91009a8..a695507 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -29,6 +29,9 @@ #define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE #define CONFIG_SYS_MMC_IMG_LOAD_PART 1
+#define CONFIG_PARTITION_UUIDS +#define CONFIG_CMD_PART + #define CONFIG_DFU_ENV_SETTINGS \ "dfu_alt_info=boot raw 0x2 0x400 mmcpart 1\0" \
@@ -45,9 +48,9 @@ "ip_dyn=yes\0" \ "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ - "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ + "finduuid=part uuid mmc 0:2 uuid\0" \ "mmcargs=setenv bootargs console=${console},${baudrate} " \ - "root=${mmcroot}\0" \ + "root=PARTUUID=${uuid} rootwait rw\0" \ "loadbootscript=" \ "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ "bootscript=echo Running bootscript from mmc ...; " \ @@ -55,6 +58,7 @@ "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ "mmcboot=echo Booting from mmc ...; " \ + "run finduuid; " \ "run mmcargs; " \ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ "if run loadfdt; then " \ @@ -113,7 +117,6 @@
#define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_SYS_MMC_ENV_PART 0 -#define CONFIG_MMCROOT "/dev/mmcblk2p2"
/* USB Configs */ #define CONFIG_USB_STORAGE

Hi Stefano,
On Thu, Aug 25, 2016 at 9:07 PM, Fabio Estevam festevam@gmail.com wrote:
From: Fabio Estevam fabio.estevam@nxp.com
warp7 can run different kernel versions, such as NXP 4.1 or mainline.
Currently the rootfs location is passed via mmcblk number and the problem with this approach is that the mmcblk number for the eMMC changes depending on the kernel version.
In order to avoid such issue, use UUID method to specify the rootfs location.
Succesfully tested booting a NXP 4.1 and also a mainline kernel.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Are you happy with this series? Could it go to 2016.09?
Thanks

Hi Fabio,
On 02/09/2016 22:35, Fabio Estevam wrote:
Hi Stefano,
On Thu, Aug 25, 2016 at 9:07 PM, Fabio Estevam festevam@gmail.com wrote:
From: Fabio Estevam fabio.estevam@nxp.com
warp7 can run different kernel versions, such as NXP 4.1 or mainline.
Currently the rootfs location is passed via mmcblk number and the problem with this approach is that the mmcblk number for the eMMC changes depending on the kernel version.
In order to avoid such issue, use UUID method to specify the rootfs location.
Succesfully tested booting a NXP 4.1 and also a mainline kernel.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Are you happy with this series?
Yes.
Could it go to 2016.09?
I'll merge it.
Regards, Stefano

On 26/08/2016 02:07, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@nxp.com
warp7 can run different kernel versions, such as NXP 4.1 or mainline.
Currently the rootfs location is passed via mmcblk number and the problem with this approach is that the mmcblk number for the eMMC changes depending on the kernel version.
In order to avoid such issue, use UUID method to specify the rootfs location.
Succesfully tested booting a NXP 4.1 and also a mainline kernel.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

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 --- Changes since v1: - None
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 26/08/2016 02:07, Fabio Estevam 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
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

Hi Stefano,
On Tue, Sep 6, 2016 at 5:09 AM, Stefano Babic sbabic@denx.de wrote:
On 26/08/2016 02:07, Fabio Estevam 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
Applied to u-boot-imx, thanks !
I don't see this series applied in http://git.denx.de/?p=u-boot/u-boot-imx.git;a=shortlog
Are they missing?
Thanks

On 06/09/2016 12:58, Fabio Estevam wrote:
Hi Stefano,
On Tue, Sep 6, 2016 at 5:09 AM, Stefano Babic sbabic@denx.de wrote:
On 26/08/2016 02:07, Fabio Estevam 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
Applied to u-boot-imx, thanks !
I don't see this series applied in http://git.denx.de/?p=u-boot/u-boot-imx.git;a=shortlog
Are they missing?
You're right, strange, something went wrong. Now they are on the server.
Thanks for checking !
Stefano

On Tue, Sep 6, 2016 at 8:08 AM, Stefano Babic sbabic@denx.de wrote:
You're right, strange, something went wrong. Now they are on the server.
Ok, great. As these three patches didn't make into your pull request to Tom: will you submit another pull request which includes them?
Thanks
participants (2)
-
Fabio Estevam
-
Stefano Babic