Hi Sachin, On Thursday 17 of October 2013 17:33:12 Sachin Kamat wrote: > L2x0 cache controller is present only in Cortex-A9 based Exynos4 SoCs. > Thus move this function to Exynos4 early init call to avoid non-Exynos4 > SoCs from calling this function in multi-platform support. I believe that at the time .init_early() is called there is no ioremap() infrastructure working yet and so L2 cache initialization which needs it will cause a kernel panic. This patch worked only because currently there is no L2X0 controller defined in device tree sources of Exynos 4. Other than that, it will be required to register firmware operations before L2X0 initialization, because on some boards it is needed to initialize the L2 cache through secure firmware. Please let me handle this by the way of patches adding firmware based L2X0 initialization. Best regards, Tomasz > Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> > Signed-off-by: Tushar Behera <tushar.behera@xxxxxxxxxx> > --- > Tested on Origen(4210), Arndale(5250) and 5420 boards. > --- > arch/arm/mach-exynos/common.c | 3 +-- > arch/arm/mach-exynos/common.h | 2 +- > arch/arm/mach-exynos/mach-exynos4-dt.c | 9 ++++++++- > 3 files changed, 10 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c > index 1510436..f822b226 100644 > --- a/arch/arm/mach-exynos/common.c > +++ b/arch/arm/mach-exynos/common.c > @@ -396,7 +396,7 @@ static int __init exynos_core_init(void) > } > core_initcall(exynos_core_init); > > -static int __init exynos4_l2x0_cache_init(void) > +int __init exynos4_l2x0_cache_init(void) > { > int ret; > > @@ -408,7 +408,6 @@ static int __init exynos4_l2x0_cache_init(void) > clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long)); > return 0; > } > -early_initcall(exynos4_l2x0_cache_init); > > static int __init exynos_init(void) > { > diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h > index 3f03334..3031321 100644 > --- a/arch/arm/mach-exynos/common.h > +++ b/arch/arm/mach-exynos/common.h > @@ -24,7 +24,7 @@ void exynos5_restart(enum reboot_mode mode, const char *cmd); > void exynos_cpuidle_init(void); > void exynos_cpufreq_init(void); > void exynos_init_late(void); > - > +int exynos4_l2x0_cache_init(void); > void exynos_firmware_init(void); > > #ifdef CONFIG_PM_GENERIC_DOMAINS > diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c > index ffd19a0..2e6f51c 100644 > --- a/arch/arm/mach-exynos/mach-exynos4-dt.c > +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c > @@ -49,11 +49,18 @@ static void __init exynos4_reserve(void) > mfc_mem.lsize); > #endif > } > + > +static void __init exynos4_early_init(void) > +{ > + exynos4_l2x0_cache_init(); > + exynos_firmware_init(); > +} > + > DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") > /* Maintainer: Thomas Abraham <thomas.abraham@xxxxxxxxxx> */ > .smp = smp_ops(exynos_smp_ops), > .map_io = exynos_init_io, > - .init_early = exynos_firmware_init, > + .init_early = exynos4_early_init, > .init_machine = exynos4_dt_machine_init, > .init_late = exynos_init_late, > .dt_compat = exynos4_dt_compat, > -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html