Re: [PATCH V5 5/5] ARM: exynos: Enable l2 configuration through device tree
On 5 January 2012 10:06, Olof Johansson wrote: > On Wed, Jan 4, 2012 at 8:25 PM, Amit Daniel Kachhap > wrote: >> This patch enables calling generic l2 setup functions if device tree is used. >> >> Signed-off-by: Amit Daniel Kachhap >> --- >> arch/arm/mach-exynos/common.c | 14 -- >> 1 files changed, 12 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c >> index f8bb808..e91b92d 100644 >> --- a/arch/arm/mach-exynos/common.c >> +++ b/arch/arm/mach-exynos/common.c >> @@ -47,6 +47,8 @@ >> #include >> >> #include "common.h" >> +#define L2_AUX_VAL 0x7C470001 >> +#define L2_AUX_MASK 0xC200 >> >> static const char name_exynos4210[] = "EXYNOS4210"; >> static const char name_exynos4212[] = "EXYNOS4212"; >> @@ -453,6 +455,15 @@ core_initcall(exynos4_core_init); >> #ifdef CONFIG_CACHE_L2X0 >> static int __init exynos4_l2x0_cache_init(void) >> { >> +#ifdef CONFIG_OF >> + int ret; >> + ret = l2x0_of_init(L2_AUX_VAL, L2_AUX_MASK); >> + if (!ret) { >> + l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs); >> + clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long)); >> + return 0; >> + } >> +#endif > > No need for ifdef here, if CONFIG_OF is off, then there's a static > inline version of l2x_of_init() that will return -ENODEV. Will accept your suggestion. Thanks > > > -Olof -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH V5 5/5] ARM: exynos: Enable l2 configuration through device tree
On Wed, Jan 4, 2012 at 8:25 PM, Amit Daniel Kachhap wrote: > This patch enables calling generic l2 setup functions if device tree is used. > > Signed-off-by: Amit Daniel Kachhap > --- > arch/arm/mach-exynos/common.c | 14 -- > 1 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c > index f8bb808..e91b92d 100644 > --- a/arch/arm/mach-exynos/common.c > +++ b/arch/arm/mach-exynos/common.c > @@ -47,6 +47,8 @@ > #include > > #include "common.h" > +#define L2_AUX_VAL 0x7C470001 > +#define L2_AUX_MASK 0xC200 > > static const char name_exynos4210[] = "EXYNOS4210"; > static const char name_exynos4212[] = "EXYNOS4212"; > @@ -453,6 +455,15 @@ core_initcall(exynos4_core_init); > #ifdef CONFIG_CACHE_L2X0 > static int __init exynos4_l2x0_cache_init(void) > { > +#ifdef CONFIG_OF > + int ret; > + ret = l2x0_of_init(L2_AUX_VAL, L2_AUX_MASK); > + if (!ret) { > + l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs); > + clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long)); > + return 0; > + } > +#endif No need for ifdef here, if CONFIG_OF is off, then there's a static inline version of l2x_of_init() that will return -ENODEV. -Olof -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V5 5/5] ARM: exynos: Enable l2 configuration through device tree
This patch enables calling generic l2 setup functions if device tree is used. Signed-off-by: Amit Daniel Kachhap --- arch/arm/mach-exynos/common.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index f8bb808..e91b92d 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -47,6 +47,8 @@ #include #include "common.h" +#define L2_AUX_VAL 0x7C470001 +#define L2_AUX_MASK 0xC200 static const char name_exynos4210[] = "EXYNOS4210"; static const char name_exynos4212[] = "EXYNOS4212"; @@ -453,6 +455,15 @@ core_initcall(exynos4_core_init); #ifdef CONFIG_CACHE_L2X0 static int __init exynos4_l2x0_cache_init(void) { +#ifdef CONFIG_OF + int ret; + ret = l2x0_of_init(L2_AUX_VAL, L2_AUX_MASK); + if (!ret) { + l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs); + clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long)); + return 0; + } +#endif if (!(__raw_readl(S5P_VA_L2CC + L2X0_CTRL) & 0x1)) { l2x0_saved_regs.phy_base = EXYNOS4_PA_L2CC; /* TAG, Data Latency Control: 2 cycles */ @@ -486,8 +497,7 @@ static int __init exynos4_l2x0_cache_init(void) clean_dcache_area(&l2x0_saved_regs, sizeof(struct l2x0_regs)); } - l2x0_init(S5P_VA_L2CC, 0x7C470001, 0xC200); - + l2x0_init(S5P_VA_L2CC, L2_AUX_VAL, L2_AUX_MASK); return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html