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

Stefan Agner stefan.agner at toradex.com
Fri Jul 22 19:34:21 CEST 2016


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 at 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


More information about the U-Boot mailing list