diff options
author | tang yuantian <Yuantian.Tang@freescale.com> | 2014-12-17 12:58:04 +0800 |
---|---|---|
committer | York Sun <yorksun@freescale.com> | 2015-01-23 22:29:14 -0600 |
commit | 5699274373e9bf569ffb4001a3d2ee0ebf1b6b03 (patch) | |
tree | c2edd616c1b4318639366330a7defdb82d3ddf9c | |
parent | dd04832d522918cad1d3ae894f94c5e59c04d567 (diff) | |
download | u-boot-imx-5699274373e9bf569ffb4001a3d2ee0ebf1b6b03.zip u-boot-imx-5699274373e9bf569ffb4001a3d2ee0ebf1b6b03.tar.gz u-boot-imx-5699274373e9bf569ffb4001a3d2ee0ebf1b6b03.tar.bz2 |
ARM: HYP/non-sec: Make variable gic_dist_addr as a local one
Defining variable gic_dist_addr as a globe one prevents some
functions, which use it, from being used before relocation
which is the case in the deep sleep resume process on Freescale
SoC platforms.
Besides, we can always get the GIC base address by calling
get_gicd_base_address() without referring gic_dist_addr.
Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
-rw-r--r-- | arch/arm/cpu/armv7/virt-v7.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv7/virt-v7.c b/arch/arm/cpu/armv7/virt-v7.c index 651ca40..b69fd37 100644 --- a/arch/arm/cpu/armv7/virt-v7.c +++ b/arch/arm/cpu/armv7/virt-v7.c @@ -15,8 +15,6 @@ #include <asm/io.h> #include <asm/secure.h> -unsigned long gic_dist_addr; - static unsigned int read_id_pfr1(void) { unsigned int reg; @@ -68,6 +66,12 @@ static void kick_secondary_cpus_gic(unsigned long gicdaddr) void __weak smp_kick_all_cpus(void) { + unsigned long gic_dist_addr; + + gic_dist_addr = get_gicd_base_address(); + if (gic_dist_addr == -1) + return; + kick_secondary_cpus_gic(gic_dist_addr); } @@ -75,6 +79,7 @@ int armv7_init_nonsec(void) { unsigned int reg; unsigned itlinesnr, i; + unsigned long gic_dist_addr; /* check whether the CPU supports the security extensions */ reg = read_id_pfr1(); |