[U-Boot] [PATCH] mx7: Allow selection of secure or non-secure mode

Commit be1a17ff689 ("mx7_common: use Kconfig for ARMv7 non-secure mode") breaks the boot of a NXP 4.1.15 kernel using mx7dsabresd_secure_defconfig target.
This problem happens because after this commit non-secure mode is always selected at CPU level.
Fix this by only selecting CPU_V7_HAS_NONSEC if the MX7_SEC board option is unset.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- arch/arm/cpu/armv7/mx7/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/mx7/Kconfig b/arch/arm/cpu/armv7/mx7/Kconfig index dd51384..d1a8f50 100644 --- a/arch/arm/cpu/armv7/mx7/Kconfig +++ b/arch/arm/cpu/armv7/mx7/Kconfig @@ -4,7 +4,7 @@ config MX7 bool select ROM_UNIFIED_SECTIONS select CPU_V7_HAS_VIRT - select CPU_V7_HAS_NONSEC + select CPU_V7_HAS_NONSEC if !MX7_SEC default y
config MX7D

Hi Fabio,
On 22.07.2016 07:06, Fabio Estevam wrote:
Commit be1a17ff689 ("mx7_common: use Kconfig for ARMv7 non-secure mode") breaks the boot of a NXP 4.1.15 kernel using mx7dsabresd_secure_defconfig target.
This problem happens because after this commit non-secure mode is always selected at CPU level.
Fix this by only selecting CPU_V7_HAS_NONSEC if the MX7_SEC board option is unset.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
arch/arm/cpu/armv7/mx7/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/mx7/Kconfig b/arch/arm/cpu/armv7/mx7/Kconfig index dd51384..d1a8f50 100644 --- a/arch/arm/cpu/armv7/mx7/Kconfig +++ b/arch/arm/cpu/armv7/mx7/Kconfig @@ -4,7 +4,7 @@ config MX7 bool select ROM_UNIFIED_SECTIONS select CPU_V7_HAS_VIRT
- select CPU_V7_HAS_NONSEC
- select CPU_V7_HAS_NONSEC if !MX7_SEC
Wha, so we have a config option (MX7_SEC) which controls a config helper (CPU_V7_HAS_NONSEC) which is used to control whether a user config option is available or not (ARMV7_NONSEC).
I don't understand why we need to have the MX7_SEC config options in imx-common. There are already config options for all the secure/non-secure boot stuff in arch/arm/cpu/armv7/Kconfig.
I suggest to remove MX7_SEC, and add "default y if ARCH_MX7" for the existing config option ARMV7_BOOT_SEC_DEFAULT in arch/arm/cpu/armv7/Kconfig.
-- Stefan

Hi Stefan,
On Fri, Jul 22, 2016 at 2:34 PM, Stefan Agner stefan.agner@toradex.com wrote:
Wha, so we have a config option (MX7_SEC) which controls a config helper (CPU_V7_HAS_NONSEC) which is used to control whether a user config option is available or not (ARMV7_NONSEC).
I don't understand why we need to have the MX7_SEC config options in imx-common. There are already config options for all the secure/non-secure boot stuff in arch/arm/cpu/armv7/Kconfig.
I suggest to remove MX7_SEC, and add "default y if ARCH_MX7" for the existing config option ARMV7_BOOT_SEC_DEFAULT in arch/arm/cpu/armv7/Kconfig.
Yes, I was not aware of the ARMV7_BOOT_SEC_DEFAULT option. I sent a new version as suggested, thanks.
participants (3)
-
Fabio Estevam
-
Fabio Estevam
-
Stefan Agner