ARM: S5PC210: Set the common L2 cache configurations
Subsystems (3)
PATCH 3/3 ARM: S5PC210: Set the common L2 cache configurations
From: Kyungmin Park <[email protected]>
S5PC210 has PL310 1MiB L2 cache.
It uses the optimized data & tag latency and also enable the prefetch.
--- arch/arm/mach-s5pv310/cpu.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv310/cpu.c +19 -0
@@ -15,6 +15,7 @@#include <asm/mach/irq.h> #include <asm/proc-fns.h> +#include <asm/hardware/cache-l2x0.h> #include <plat/cpu.h> #include <plat/clock.h>
@@ -121,6 +122,24 @@ static int __init s5pv310_core_init(void)core_initcall (s5pv310_core_init); +static int __init s5pv310_init_cache (void ) +{ +#ifdef CONFIG_CACHE_L2X0 +void __iomem *p =S5P_VA_L2CC ; + +/* TAG, Data latency control */ +writel (0x110 , p +L2X0_TAG_LATENCY_CTRL ); +writel (0x110 , p +L2X0_DATA_LATENCY_CTRL ); + +/* L2 cache prefetch control */ +writel (0x6 , p +L2X0_PREFETCH_CTRL ); + +l2x0_init (p,0x3C070001 ,0xC200FFFF ); +#endif +return 0 ; +} +early_initcall (s5pv310_init_cache); +int __init s5pv310_init (void ) {printk (KERN_INFO "S5PV310: Initializing architecture\n" );
Signature · 1 line
1.5.3.3
PATCH 3/3 ARM: S5PC210: Set the common L2 cache configurations
Hello.
Quoted 32 lines · Kyungmin Park
From: Kyungmin Park<[email protected]>
S5PC210 has PL310 1MiB L2 cache.
It uses the optimized data& tag latency and also enable the prefetch.Signed-off-by Kyungmin Park<[email protected]>--- arch/arm/mach-s5pv310/cpu.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-)arch/arm/mach-s5pv310/cpu.c +7
-0@@ -15,6 +15,7 @@#include <asm/mach/irq.h> #include <asm/proc-fns.h> +#include <asm/hardware/cache-l2x0.h> #include <plat/cpu.h> #include <plat/clock.h> @@ -121,6 +122,24 @@ static int __init s5pv310_core_init(void)core_initcall (s5pv310_core_init); +static int __init s5pv310_init_cache (void ) +{ +#ifdef CONFIG_CACHE_L2X0 +void __iomem *p =S5P_VA_L2CC ; + +/* TAG, Data latency control */
arch/arm/mach-s5pv310/cpu.c static int __init s5pv310_core_init(void) · line 140
Quoted 10 lines
arch/arm/mach-s5pv310/cpu.c +10
-0+writel (0x110 , p +L2X0_TAG_LATENCY_CTRL ); +writel (0x110 , p +L2X0_DATA_LATENCY_CTRL ); + +/* L2 cache prefetch control */ +writel (0x6 , p +L2X0_PREFETCH_CTRL ); + +l2x0_init (p,0x3C070001 ,0xC200FFFF ); +#endif +return 0 ; +}
CodingStyle document forbids #ifdef's in the function bodies, so this
should better be:
#ifdef CONFIG_CACHE_L2X0
static int __init s5pv310_init_cache(void)
{
/* ... */
return 0;
}
#else
static int__init s5pv310_init_cache(void)
{
return 0;
}#endif
WBR, Sergei
PATCH 3/3 ARM: S5PC210: Set the common L2 cache configurations
In reply to Kyungmin ParkQuoted 24 lines · Kyungmin Park
From: Kyungmin Park <[email protected]>
S5PC210 has PL310 1MiB L2 cache.
It uses the optimized data & tag latency and also enable the prefetch.Signed-off-by Kyungmin Park <[email protected]>--- arch/arm/mach-s5pv310/cpu.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-)arch/arm/mach-s5pv310/cpu.c +1
-0@@ -15,6 +15,7 @@#include <asm/mach/irq.h> #include <asm/proc-fns.h> +#include <asm/hardware/cache-l2x0.h> #include <plat/cpu.h> #include <plat/clock.h>
arch/arm/mach-s5pv310/cpu.c static int __init s5pv310_core_init(void) · line 131
Quoted 10 lines
arch/arm/mach-s5pv310/cpu.c +7
-0@@ -121,6 +122,24 @@ static int __init s5pv310_core_init(void)core_initcall (s5pv310_core_init); +static int __init s5pv310_init_cache (void ) +{ +#ifdef CONFIG_CACHE_L2X0 +void __iomem *p =S5P_VA_L2CC ; + +/* TAG, Data latency control */ +writel (0x110 , p +L2X0_TAG_LATENCY_CTRL );
Please use '__raw_writel' instead of 'writel' here...
arch/arm/mach-s5pv310/cpu.c static int __init s5pv310_core_init(void) · line 135
Quoted 4 lines
arch/arm/mach-s5pv310/cpu.c +4
-0+writel (0x110 , p +L2X0_DATA_LATENCY_CTRL ); + +/* L2 cache prefetch control */ +writel (0x6 , p +L2X0_PREFETCH_CTRL );
As I know, there is more suitable value which has been tested. It means should be changed...but now it is under testing.
arch/arm/mach-s5pv310/cpu.c static int __init s5pv310_core_init(void)
Quoted 11 lines
arch/arm/mach-s5pv310/cpu.c +7
-1+ +l2x0_init (p,0x3C070001 ,0xC200FFFF ); +#endif +return 0 ; +} +early_initcall (s5pv310_init_cache); +int __init s5pv310_init (void ) {printk (KERN_INFO "S5PV310: Initializing architecture\n" ); --
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 3/3 ARM: S5PC210: Set the common L2 cache configurations
Quoted 28 lines · Kukjin Kim
Quoted 27 lines · Kyungmin Park
From: Kyungmin Park <[email protected]>
S5PC210 has PL310 1MiB L2 cache.
It uses the optimized data & tag latency and also enable the prefetch.Signed-off-by Kyungmin Park <[email protected]>---
?arch/arm/mach-s5pv310/cpu.c | ? 19 +++++++++++++++++++ ?1 files changed, 19 insertions(+), 0 deletions(-)arch/arm/mach-s5pv310/cpu.c +0
-0@@ -15,6 +15,7 @@?#include <
asm/mach/irq.h>?#include <
asm/proc-fns.h>
+#include <asm/hardware/cache-l2x0.h>?#include <
plat/cpu.h>
?#include <plat/clock.h>arch/arm/mach-s5pv310/cpu.c +0
-0@@ -121,6 +122,24 @@ static int __init s5pv310_core_init(void) ?core_initcall(s5pv310_core_init);
Quoted 9 lines
arch/arm/mach-s5pv310/cpu.c static int __init s5pv310_core_init(void)
Quoted 7 lines
arch/arm/mach-s5pv310/cpu.c +7
-0+static int __init s5pv310_init_cache (void ) +{ +#ifdef CONFIG_CACHE_L2X0 + ? ? void __iomem *p = S5P_VA_L2CC; + + ? ? /* TAG, ?Data latency control */ + ? ? writel(0x110, p + L2X0_TAG_LATENCY_CTRL);Please use '
__raw_writel' instead of 'writel' here...
why?
Quoted 8 lines
arch/arm/mach-s5pv310/cpu.c static int __init s5pv310_core_init(void) · line 135
Quoted 5 lines
arch/arm/mach-s5pv310/cpu.c +4
-0+ ? ? writel(0x110, p + L2X0_DATA_LATENCY_CTRL); + + ? ? /* L2 cache prefetch control */ + ? ? writel(0x6, p + L2X0_PREFETCH_CTRL);As I know, there is more suitable value which has been tested. It means should be changed...but now it is under testing.
I know but almost same effect. 0x3000'000x is set by at AUX_CTRL. and 0x7 is not fully tested.
I mean 0x3000'0006 and 0x6 is same.
Quoted 26 lines
arch/arm/mach-s5pv310/cpu.c static int __init s5pv310_core_init(void)
Quoted 12 lines
arch/arm/mach-s5pv310/cpu.c +7
-1+ + ? ? l2x0_init(p, 0x3C070001, 0xC200FFFF); +#endif + ? ? return 0; +} +early_initcall (s5pv310_init_cache); + ?int __init s5pv310_init(void) ?{ ? ? ? printk(KERN_INFO "S5PV310: Initializing architecture\n"); --Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html