[U-Boot] [PATCH v2 0/2] WaRP7 unify secure and non-secure defconfigs

Maintaining a secure and non-secure defconfig is a PITA. Having discussed an observed bug with the non-secure boot-path with Fabio and undertaken to ensure both upstream and NXP BSP kernels would work - this patchset does two things.
1. Switches on CONFIG_ARMV7_BOOT_SEC_DEFAULT for warp7_defconfig 2. Removes warp7_secure_defconfig in its entirety
I have an upcoming set of patches that uses the secure defconfig which I've already verified can simply be merged into mainline WaRP7 as-is so, in this context there appears to be no justification for keeping separate configuration files.
Fix the bug and zap the fat !
Bryan O'Donoghue (2): warp7: defconfig: Fix CAAM on boot with tip-of-tree warp7: secure_defconfig: Remove secure_defconfig
configs/warp7_defconfig | 1 + configs/warp7_secure_defconfig | 42 ------------------------------------------ 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 configs/warp7_secure_defconfig

Booting the following image with tip-of-tree we get a CAAM DECO error (and subsequent crash due to a kernel bug in 4.1).
http://freescale.github.io/#download -> BoardsWaRPboard community - WaRP - Wearable Reference PlatformFSL Community BSP 2.3fsl-image-multimediawayland
Image: fsl-image-multimedia-imx7s-warp-20180323-90.rootfs.sdcard
Error: caam 30900000.caam: Entropy delay = 3200 caam 30900000.caam: failed to acquire DECO 0 <snip> caam 30900000.caam: failed to acquire DECO 0 caam 30900000.caam: Entropy delay = 12400 caam 30900000.caam: failed to acquire DECO 0 caam 30900000.caam: failed to instantiate RNG ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at /home/jenkins/workspace/fsl-community-bsp-pyro_xwayland_2/build/tmp/work-shared/imx7s-warp/kernel-source/mm/vmalloc.c:1465 caam_remove+0x6) Trying to vfree() nonexistent vm area (88047000) Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.36-4.1-1.0.x-imx-warp7+ga543d1b #1 Hardware name: Freescale i.MX7 Dual (Device Tree) [<80015d54>] (unwind_backtrace) from [<80012688>] (show_stack+0x10/0x14) [<80012688>] (show_stack) from [<8076e810>] (dump_stack+0x78/0x8c) [<8076e810>] (dump_stack) from [<800346a0>] (warn_slowpath_common+0x80/0xb0) [<800346a0>] (warn_slowpath_common) from [<80034700>] (warn_slowpath_fmt+0x30/0x40) [<80034700>] (warn_slowpath_fmt) from [<8054c278>] (caam_remove+0x6c/0x3f4) [<8054c278>] (caam_remove) from [<8054ce74>] (caam_probe+0x874/0xfa8) [<8054ce74>] (caam_probe) from [<80382a7c>] (platform_drv_probe+0x48/0xa4) [<80382a7c>] (platform_drv_probe) from [<80381328>] (driver_probe_device+0x174/0x2a8) [<80381328>] (driver_probe_device) from [<8038152c>] (__driver_attach+0x8c/0x90) [<8038152c>] (__driver_attach) from [<8037f9d4>] (bus_for_each_dev+0x68/0x9c) [<8037f9d4>] (bus_for_each_dev) from [<80380a68>] (bus_add_driver+0xf4/0x1e8) [<80380a68>] (bus_add_driver) from [<80381b38>] (driver_register+0x78/0xf4) [<80381b38>] (driver_register) from [<80009738>] (do_one_initcall+0x8c/0x1d0) [<80009738>] (do_one_initcall) from [<80a66dac>] (kernel_init_freeable+0x140/0x1d0) [<80a66dac>] (kernel_init_freeable) from [<8076aa38>] (kernel_init+0x8/0xe8) [<8076aa38>] (kernel_init) from [<8000f468>] (ret_from_fork+0x14/0x2c) ---[ end trace d5f941204ed8cb28 ]--- caam: probe of 30900000.caam failed with error -11 Unable to handle kernel NULL pointer dereference at virtual address 00000004 pgd = 80004000 [00000004] *pgd=00000000 Internal error: Oops: 805 [#1] PREEMPT SMP ARM <snip> [<8055cdf8>] (caam_sm_startup) from [<80aa83c8>] (caam_sm_init+0x50/0x58) [<80aa83c8>] (caam_sm_init) from [<80009738>] (do_one_initcall+0x8c/0x1d0) [<80009738>] (do_one_initcall) from [<80a66dac>] (kernel_init_freeable+0x140/0x1d0) [<80a66dac>] (kernel_init_freeable) from [<8076aa38>] (kernel_init+0x8/0xe8) [<8076aa38>] (kernel_init) from [<8000f468>] (ret_from_fork+0x14/0x2c) Code: e59d300c e2832010 e5843008 e5834068 (e58a2004) ---[ end trace d5f941204ed8cb29 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
Fix: Enable the CAAM correctly by setting CONFIG_ARMV7_BOOT_SEC_DEFAULT=y in the upstream defconfig.
Signed-off-by: Bryan O'Donoghue bryan.odonoghue@linaro.org Cc: Fabio Estevam fabio.estevam@nxp.com Cc: Breno Lima breno.lima@nxp.com --- configs/warp7_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index 29c4512..228f7d9 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_MX7=y CONFIG_SYS_TEXT_BASE=0x87800000 CONFIG_TARGET_WARP7=y +CONFIG_ARMV7_BOOT_SEC_DEFAULT=y # CONFIG_ARMV7_VIRT is not set CONFIG_IMX_RDC=y CONFIG_IMX_BOOTAUX=y

Hi Bryan,
On Sat, Mar 31, 2018 at 2:49 PM, Bryan O'Donoghue bryan.odonoghue@linaro.org wrote:
Booting the following image with tip-of-tree we get a CAAM DECO error (and subsequent crash due to a kernel bug in 4.1).
http://freescale.github.io/#download -> BoardsWaRPboard community - WaRP - Wearable Reference PlatformFSL Community BSP 2.3fsl-image-multimediawayland
Image: fsl-image-multimedia-imx7s-warp-20180323-90.rootfs.sdcard
Error: caam 30900000.caam: Entropy delay = 3200 caam 30900000.caam: failed to acquire DECO 0
<snip> caam 30900000.caam: failed to acquire DECO 0 caam 30900000.caam: Entropy delay = 12400 caam 30900000.caam: failed to acquire DECO 0 caam 30900000.caam: failed to instantiate RNG ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at /home/jenkins/workspace/fsl-community-bsp-pyro_xwayland_2/build/tmp/work-shared/imx7s-warp/kernel-source/mm/vmalloc.c:1465 caam_remove+0x6) Trying to vfree() nonexistent vm area (88047000) Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.36-4.1-1.0.x-imx-warp7+ga543d1b #1 Hardware name: Freescale i.MX7 Dual (Device Tree) [<80015d54>] (unwind_backtrace) from [<80012688>] (show_stack+0x10/0x14) [<80012688>] (show_stack) from [<8076e810>] (dump_stack+0x78/0x8c) [<8076e810>] (dump_stack) from [<800346a0>] (warn_slowpath_common+0x80/0xb0) [<800346a0>] (warn_slowpath_common) from [<80034700>] (warn_slowpath_fmt+0x30/0x40) [<80034700>] (warn_slowpath_fmt) from [<8054c278>] (caam_remove+0x6c/0x3f4) [<8054c278>] (caam_remove) from [<8054ce74>] (caam_probe+0x874/0xfa8) [<8054ce74>] (caam_probe) from [<80382a7c>] (platform_drv_probe+0x48/0xa4) [<80382a7c>] (platform_drv_probe) from [<80381328>] (driver_probe_device+0x174/0x2a8) [<80381328>] (driver_probe_device) from [<8038152c>] (__driver_attach+0x8c/0x90) [<8038152c>] (__driver_attach) from [<8037f9d4>] (bus_for_each_dev+0x68/0x9c) [<8037f9d4>] (bus_for_each_dev) from [<80380a68>] (bus_add_driver+0xf4/0x1e8) [<80380a68>] (bus_add_driver) from [<80381b38>] (driver_register+0x78/0xf4) [<80381b38>] (driver_register) from [<80009738>] (do_one_initcall+0x8c/0x1d0) [<80009738>] (do_one_initcall) from [<80a66dac>] (kernel_init_freeable+0x140/0x1d0) [<80a66dac>] (kernel_init_freeable) from [<8076aa38>] (kernel_init+0x8/0xe8) [<8076aa38>] (kernel_init) from [<8000f468>] (ret_from_fork+0x14/0x2c) ---[ end trace d5f941204ed8cb28 ]--- caam: probe of 30900000.caam failed with error -11 Unable to handle kernel NULL pointer dereference at virtual address 00000004 pgd = 80004000 [00000004] *pgd=00000000 Internal error: Oops: 805 [#1] PREEMPT SMP ARM <snip> [<8055cdf8>] (caam_sm_startup) from [<80aa83c8>] (caam_sm_init+0x50/0x58) [<80aa83c8>] (caam_sm_init) from [<80009738>] (do_one_initcall+0x8c/0x1d0) [<80009738>] (do_one_initcall) from [<80a66dac>] (kernel_init_freeable+0x140/0x1d0) [<80a66dac>] (kernel_init_freeable) from [<8076aa38>] (kernel_init+0x8/0xe8) [<8076aa38>] (kernel_init) from [<8000f468>] (ret_from_fork+0x14/0x2c) Code: e59d300c e2832010 e5843008 e5834068 (e58a2004) ---[ end trace d5f941204ed8cb29 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
Fix: Enable the CAAM correctly by setting CONFIG_ARMV7_BOOT_SEC_DEFAULT=y in the upstream defconfig.
Signed-off-by: Bryan O'Donoghue bryan.odonoghue@linaro.org Cc: Fabio Estevam fabio.estevam@nxp.com Cc: Breno Lima breno.lima@nxp.com
Reviewed-by: Fabio Estevam fabio.estevam@nxp.com

This patch removes warp7_secure_defconfig. A previous patch set CONFIG_ARMV7_BOOT_SEC_DEFAULT=y on the unsecure WaRP7 config. Fabio asked if I could confirm that the NXP and upstream kernels will boot on the WaRP7 with CONFIG_ARMV7_BOOT_SEC_DEFAULT=y. I can confirm that this is the case, so there's no need to support the secure defconfig - drop it now.
Signed-off-by: Bryan O'Donoghue bryan.odonoghue@linaro.org Suggested-by: Fabio Estevam fabio.estevam@nxp.com --- configs/warp7_secure_defconfig | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 configs/warp7_secure_defconfig
diff --git a/configs/warp7_secure_defconfig b/configs/warp7_secure_defconfig deleted file mode 100644 index 7310855..0000000 --- a/configs/warp7_secure_defconfig +++ /dev/null @@ -1,42 +0,0 @@ -CONFIG_ARM=y -CONFIG_ARCH_MX7=y -CONFIG_SYS_TEXT_BASE=0x87800000 -CONFIG_TARGET_WARP7=y -CONFIG_ARMV7_BOOT_SEC_DEFAULT=y -# CONFIG_ARMV7_VIRT is not set -CONFIG_IMX_RDC=y -CONFIG_IMX_BOOTAUX=y -# CONFIG_CMD_BMODE is not set -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_XIMG is not set -CONFIG_CMD_MEMTEST=y -CONFIG_CMD_DFU=y -CONFIG_CMD_GPIO=y -CONFIG_CMD_MMC=y -CONFIG_CMD_PART=y -CONFIG_CMD_USB=y -CONFIG_CMD_USB_MASS_STORAGE=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_DFU_MMC=y -CONFIG_USB=y -CONFIG_USB_EHCI_HCD=y -CONFIG_MXC_USB_OTG_HACTIVE=y -CONFIG_USB_GADGET=y -CONFIG_USB_GADGET_MANUFACTURER="FSL" -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 -CONFIG_CI_UDC=y -CONFIG_USB_GADGET_DOWNLOAD=y -CONFIG_USB_ETHER=y -CONFIG_USB_ETH_CDC=y -CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" -CONFIG_OF_LIBFDT=y

Hi Bryan,
On Sat, Mar 31, 2018 at 2:50 PM, Bryan O'Donoghue bryan.odonoghue@linaro.org wrote:
This patch removes warp7_secure_defconfig. A previous patch set CONFIG_ARMV7_BOOT_SEC_DEFAULT=y on the unsecure WaRP7 config. Fabio asked if I could confirm that the NXP and upstream kernels will boot on the WaRP7 with CONFIG_ARMV7_BOOT_SEC_DEFAULT=y. I can confirm that this is the case, so there's no need to support the secure defconfig - drop it now.
Signed-off-by: Bryan O'Donoghue bryan.odonoghue@linaro.org Suggested-by: Fabio Estevam fabio.estevam@nxp.com
configs/warp7_secure_defconfig | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 configs/warp7_secure_defconfig
Please also remove the warp7_secure_defconfig entry from board/warp7/MAINTAINERS.
With that change applied you can add:
Reviewed-by: Fabio Estevam fabio.estevam@nxp.com
Thanks
participants (2)
-
Bryan O'Donoghue
-
Fabio Estevam