[U-Boot] [PATCH v7 01/17] ARM: Clean up CONFIG_ARMV7_NONSEC/VIRT/PSCI conditions
Andre Przywara
osp at andrep.de
Wed Apr 22 16:03:37 CEST 2015
On Tue, 21 Apr 2015 07:18:24 +0200
Jan Kiszka <jan.kiszka at siemens.com> wrote:
Hi Jan,
> CONFIG_ARMV7_VIRT depends on CONFIG_ARMV7_NONSEC,
Is this Kconfig rule always enforced these days? Or can one get away
without it by using stuff from include/configs/*.h?
> thus doesn't need to
> be taken into account additionally. CONFIG_ARMV7_PSCI is only set on
> boards that support CONFIG_ARMV7_NONSEC, and it only works on those.
Shouldn't this be also modelled in Kconfig then?
...
> CC: Tang Yuantian <Yuantian.Tang at freescale.com>
> CC: York Sun <yorksun at freescale.com>
> CC: Steve Rae <srae at broadcom.com>
> CC: Andre Przywara <andre.przywara at linaro.org>
> Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
> ---
> arch/arm/cpu/armv7/Makefile | 2 +-
> arch/arm/cpu/armv7/ls102xa/cpu.c | 2 +-
> arch/arm/cpu/armv7/virt-dt.c | 2 +-
> arch/arm/cpu/u-boot.lds | 2 +-
> arch/arm/include/asm/armv7.h | 4 ++--
> arch/arm/lib/bootm-fdt.c | 2 +-
> arch/arm/lib/bootm.c | 6 +++---
> board/armltd/vexpress/vexpress_common.c | 2 +-
> board/broadcom/bcm_ep/board.c | 2 +-
> board/freescale/common/arm_sleep.c | 2 +-
> 10 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
> index 21fc03b..fbd0bf3 100644
> --- a/arch/arm/cpu/armv7/Makefile
> +++ b/arch/arm/cpu/armv7/Makefile
> @@ -18,7 +18,7 @@ obj-y += lowlevel_init.o
> endif
> endif
>
> -ifneq ($(CONFIG_ARMV7_NONSEC)$(CONFIG_ARMV7_VIRT),)
> +ifneq ($(CONFIG_ARMV7_NONSEC),)
> obj-y += nonsec_virt.o
> obj-y += virt-v7.o
> obj-y += virt-dt.o
> diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c
> index 1a640bb..75f0d8c 100644
> --- a/arch/arm/cpu/armv7/ls102xa/cpu.c
> +++ b/arch/arm/cpu/armv7/ls102xa/cpu.c
> @@ -329,7 +329,7 @@ int arch_cpu_init(void)
> return 0;
> }
>
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
> /* Set the address at which the secondary core starts from.*/
> void smp_set_core_boot_addr(unsigned long addr, int corenr)
> {
> diff --git a/arch/arm/cpu/armv7/virt-dt.c b/arch/arm/cpu/armv7/virt-dt.c
> index 9408e33..caaaaab 100644
> --- a/arch/arm/cpu/armv7/virt-dt.c
> +++ b/arch/arm/cpu/armv7/virt-dt.c
> @@ -90,7 +90,7 @@ static int fdt_psci(void *fdt)
>
> int psci_update_dt(void *fdt)
> {
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
This is redundant now, isn't it? We compile this file only if
CONFIG_ARMV7_NONSEC is defined (see above).
The rest of the patch looks OK to me.
Cheers,
Andre.
> if (!armv7_boot_nonsec())
> return 0;
> #endif
> diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
> index 7336162..03cd9f6 100644
> --- a/arch/arm/cpu/u-boot.lds
> +++ b/arch/arm/cpu/u-boot.lds
> @@ -25,7 +25,7 @@ SECTIONS
> *(.text*)
> }
>
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT) || defined(CONFIG_ARMV7_PSCI)
> +#ifdef CONFIG_ARMV7_NONSEC
>
> #ifndef CONFIG_ARMV7_SECURE_BASE
> #define CONFIG_ARMV7_SECURE_BASE
> diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
> index 58d8b16..2bb1253 100644
> --- a/arch/arm/include/asm/armv7.h
> +++ b/arch/arm/include/asm/armv7.h
> @@ -121,7 +121,7 @@ void v7_outer_cache_inval_all(void);
> void v7_outer_cache_flush_range(u32 start, u32 end);
> void v7_outer_cache_inval_range(u32 start, u32 end);
>
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
>
> int armv7_init_nonsec(void);
> bool armv7_boot_nonsec(void);
> @@ -135,7 +135,7 @@ void _smp_pen(void);
> extern char __secure_start[];
> extern char __secure_end[];
>
> -#endif /* CONFIG_ARMV7_NONSEC || CONFIG_ARMV7_VIRT */
> +#endif /* CONFIG_ARMV7_NONSEC */
>
> void v7_arch_cp15_set_l2aux_ctrl(u32 l2auxctrl, u32 cpu_midr,
> u32 cpu_rev_comb, u32 cpu_variant,
> diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
> index 665a3bc..49ba691 100644
> --- a/arch/arm/lib/bootm-fdt.c
> +++ b/arch/arm/lib/bootm-fdt.c
> @@ -34,7 +34,7 @@ int arch_fixup_fdt(void *blob)
> }
>
> ret = fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
> if (ret)
> return ret;
>
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index b1bff8c..ee56d74 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -26,7 +26,7 @@
> #include <bootm.h>
> #include <vxworks.h>
>
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
> #include <asm/armv7.h>
> #endif
>
> @@ -238,7 +238,7 @@ static void boot_prep_linux(bootm_headers_t *images)
> }
> }
>
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
> bool armv7_boot_nonsec(void)
> {
> char *s = getenv("bootm_boot_mode");
> @@ -305,7 +305,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
> r2 = gd->bd->bi_boot_params;
>
> if (!fake) {
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
> if (armv7_boot_nonsec()) {
> armv7_init_nonsec();
> secure_ram_addr(_do_nonsec_entry)(kernel_entry,
> diff --git a/board/armltd/vexpress/vexpress_common.c b/board/armltd/vexpress/vexpress_common.c
> index cb2de2f..d3b3b31 100644
> --- a/board/armltd/vexpress/vexpress_common.c
> +++ b/board/armltd/vexpress/vexpress_common.c
> @@ -181,7 +181,7 @@ ulong get_board_rev(void){
> return readl((u32 *)SYS_ID);
> }
>
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
> /* Setting the address at which secondary cores start from.
> * Versatile Express uses one address for all cores, so ignore corenr
> */
> diff --git a/board/broadcom/bcm_ep/board.c b/board/broadcom/bcm_ep/board.c
> index 6a70a2e..eaad0b3 100644
> --- a/board/broadcom/bcm_ep/board.c
> +++ b/board/broadcom/bcm_ep/board.c
> @@ -54,7 +54,7 @@ int board_early_init_f(void)
> return status;
> }
>
> -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +#ifdef CONFIG_ARMV7_NONSEC
> void smp_set_core_boot_addr(unsigned long addr, int corenr)
> {
> }
> diff --git a/board/freescale/common/arm_sleep.c b/board/freescale/common/arm_sleep.c
> index 8edf878..30d9c7b 100644
> --- a/board/freescale/common/arm_sleep.c
> +++ b/board/freescale/common/arm_sleep.c
> @@ -6,7 +6,7 @@
>
> #include <common.h>
> #include <asm/io.h>
> -#if !defined(CONFIG_ARMV7_NONSEC) || !defined(CONFIG_ARMV7_VIRT)
> +#ifndef CONFIG_ARMV7_NONSEC
> #error " Deep sleep needs non-secure mode support. "
> #else
> #include <asm/secure.h>
More information about the U-Boot
mailing list