ARM: imx6q: Remove static memory mapping for SCU
Subsystems (3)
PATCH 1/1 ARM: imx6q: Remove static memory mapping for SCU
Signed-off-by Alexander Shiyan <[email protected]>
---
Completely untested.
--- arch/arm/mach-imx/common.h | 1 - arch/arm/mach-imx/mach-imx6q.c | 8 +------- arch/arm/mach-imx/platsmp.c | 30 +++++++----------------------- 3 files changed, 8 insertions(+), 31 deletions(-)
arch/arm/mach-imx/common.h +0 -1
@@ -96,7 +96,6 @@ u32 imx_get_cpu_arg(int cpu);void imx_set_cpu_arg (int cpu,u32 arg);#ifdef CONFIG_SMP void v7_secondary_startup (void ); -void imx_scu_map_io (void );void imx_smp_prepare (void );void imx_scu_standby_enable (void );#else
arch/arm/mach-imx/mach-imx6q.c +1 -7
@@ -381,12 +381,6 @@ static void __init imx6q_init_late(void) } } -static void __init imx6q_map_io (void ) -{ -debug_ll_io_init (); -imx_scu_map_io (); -} -static void __init imx6q_init_irq (void ) {imx_init_revision_from_anatop ();
@@ -404,7 +398,7 @@ static const char *imx6q_dt_compat[] __initconst = {DT_MACHINE_START (IMX6Q ,"Freescale i.MX6 Quad/DualLite (Device Tree)" ) .smp = smp_ops(imx_smp_ops), - .map_io = imx6q_map_io, + .map_io = debug_ll_io_init, .init_irq = imx6q_init_irq, .init_machine = imx6q_init_machine, .init_late = imx6q_init_late,
arch/arm/mach-imx/platsmp.c +7 -23
@@ -11,40 +11,18 @@*/ #include <linux/init.h> +#include <linux/io.h> #include <linux/smp.h> #include <asm/cacheflush.h> -#include <asm/page.h> #include <asm/smp_scu.h> -#include <asm/mach/map.h> #include "common.h" -#include "hardware.h" #define SCU_STANDBY_ENABLE (1 << 5)u32 g_diag_reg;static void __iomem *scu_base; -static struct map_desc scu_io_desc__initdata = { -/* .virtual and .pfn are run-time assigned */ - .length =SZ_4K , - .type =MT_DEVICE , -}; - -void __init imx_scu_map_io (void ) -{ -unsigned long base; - -/* Get SCU base */ - asm("mrc p15, 4, %0, c15, c0, 0" :"=r" (base)); - - scu_io_desc.virtual =IMX_IO_P2V (base); - scu_io_desc.pfn =__phys_to_pfn (base); -iotable_init (&scu_io_desc,1 ); - - scu_base =IMX_IO_ADDRESS (base); -} -void imx_scu_standby_enable (void ) {u32 val =readl_relaxed (scu_base);
@@ -66,8 +44,14 @@ static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle)*/ static void __init imx_smp_init_cpus (void ) { +unsigned long base;int i, ncores; +/* Get SCU base */ + asm("mrc p15, 4, %0, c15, c0, 0" :"=r" (base)); + + scu_base =ioremap (base,SZ_4K ); + ncores =scu_get_core_count (scu_base);for (i = ncores; i <NR_CPUS ; i++)
Signature · 1 line
1.8.5.5
PATCH 1/1 ARM: imx6q: Remove static memory mapping for SCU
Quoted 94 lines · Alexander Shiyan
Signed-off-by Alexander Shiyan <[email protected]>---
Completely untested.--- arch/arm/mach-imx/common.h | 1 - arch/arm/mach-imx/mach-imx6q.c | 8 +------- arch/arm/mach-imx/platsmp.c | 30 +++++++----------------------- 3 files changed, 8 insertions(+), 31 deletions(-)arch/arm/mach-imx/common.h +0
-1@@ -96,7 +96,6 @@ u32 imx_get_cpu_arg(int cpu);void imx_set_cpu_arg (int cpu,u32 arg);#ifdef CONFIG_SMP void v7_secondary_startup (void ); -void imx_scu_map_io (void );void imx_smp_prepare (void );void imx_scu_standby_enable (void );#else arch/arm/mach-imx/mach-imx6q.c +1
-7@@ -381,12 +381,6 @@ static void __init imx6q_init_late(void) } } -static void __init imx6q_map_io (void ) -{ -debug_ll_io_init (); -imx_scu_map_io (); -} -static void __init imx6q_init_irq (void ) {imx_init_revision_from_anatop ();@@ -404,7 +398,7 @@ static const char *imx6q_dt_compat[] __initconst = {DT_MACHINE_START (IMX6Q ,"Freescale i.MX6 Quad/DualLite (Device Tree)" ) .smp = smp_ops(imx_smp_ops), - .map_io = imx6q_map_io, + .map_io = debug_ll_io_init, .init_irq = imx6q_init_irq, .init_machine = imx6q_init_machine, .init_late = imx6q_init_late,arch/arm/mach-imx/platsmp.c +1
-23@@ -11,40 +11,18 @@*/ #include <linux/init.h> +#include <linux/io.h> #include <linux/smp.h> #include <asm/cacheflush.h> -#include <asm/page.h> #include <asm/smp_scu.h> -#include <asm/mach/map.h> #include "common.h" -#include "hardware.h" #define SCU_STANDBY_ENABLE (1 << 5)u32 g_diag_reg;static void __iomem *scu_base; -static struct map_desc scu_io_desc__initdata = { -/* .virtual and .pfn are run-time assigned */ - .length =SZ_4K , - .type =MT_DEVICE , -}; - -void __init imx_scu_map_io (void ) -{ -unsigned long base; - -/* Get SCU base */ - asm("mrc p15, 4, %0, c15, c0, 0" :"=r" (base)); - - scu_io_desc.virtual =IMX_IO_P2V (base); - scu_io_desc.pfn =__phys_to_pfn (base); -iotable_init (&scu_io_desc,1 ); - - scu_base =IMX_IO_ADDRESS (base); -} -void imx_scu_standby_enable (void ) {u32 val =readl_relaxed (scu_base);
arch/arm/mach-imx/platsmp.c static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle) · line 53
Quoted 10 lines
arch/arm/mach-imx/platsmp.c +5
-0@@ -66,8 +44,14 @@ static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle)*/ static void __init imx_smp_init_cpus (void ) { +unsigned long base;int i, ncores; +/* Get SCU base */ + asm("mrc p15, 4, %0, c15, c0, 0" :"=r" (base)); + + scu_base =ioremap (base,SZ_4K );
No. I do not think that ioremap() is ready at this point.
Shawn
Quoted 7 lines
arch/arm/mach-imx/platsmp.c +1
-0+ ncores =scu_get_core_count (scu_base);for (i = ncores; i <NR_CPUS ; i++)Signature · 1 line
1.8.5.5