Skip to contentSkip to conversation

ARM: S5PV310: Move and Update L2 cache init code

PATCH New Kukjin Kim 3 participants 8 messages Oct 21, 2010

Subsystems (3)
lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

v3 cover ARM: S5PV310: Move and Update L2 cache init code

This patch moves L2X0 cache init code from each machine to ARCH_S5PV310's cpu.c for common usage and updates its feature such as L2X0 Prefetch and Power control configuration.

Changes since v1 and v2:
- updated L2 cache init function's features.

[PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register [PATCH V3 2/3] ARM: S5PV310: Remove L2 cache init in machine [PATCH V3 3/3] ARM: S5PV310: Add L2 cache init function in cpu.c

author
#1 lore raw

PATCH v3 1/3 ARM: Add L2X0 PREFETCH and POWER control register

From: Kyungmin Park <[email protected]>

This patch adds L2X0 Prefetch and Power control register.

---
 arch/arm/include/asm/hardware/cache-l2x0.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/include/asm/hardware/cache-l2x0.h +4 -0
index 6bcba48..351ca8d 100644
@@ -53,6 +53,10 @@
 #define L2X0_LINE_DATA			0xF10
 #define L2X0_LINE_TAG			0xF30
 #define L2X0_DEBUG_CTRL			0xF40
+#define L2X0_PREFETCH_CTRL		0xF60
+#define L2X0_POWER_CTRL			0xF80
+#define   L2X0_DYNAMIC_CLK_GATING_EN	(1 << 1)
+#define   L2X0_STNDBY_MODE_EN		(1 << 0)
 
 #ifndef __ASSEMBLY__
 extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask);
Signature · 1 line
1.6.2.5
author
#3 lore raw

PATCH v3 1/3 ARM: Add L2X0 PREFETCH and POWER control register

Quoted 11 lines · Catalin Marinas
Quoted 7 lines · Kukjin Kim

From: Kyungmin Park <[email protected]>

This patch adds L2X0 Prefetch and Power control register.

Catalin, thanks for your ack :-)

Russell,
May I handle this patch in my tree?..other patch needs this. (of course, the tree will be pulled to you after requesting pull...soon)

If any problems or opinions, please let me know.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#4 lore raw

PATCH v3 2/3 ARM: S5PV310: Remove L2 cache init in machine

In reply to Kukjin Kim

From: Kyungmin Park <[email protected]>

Basically, need L2 cache initialize function in ARCH_S5PV310. So it would be better to move it into ARCH_S5PV310 common part. This patch removes L2 cache initialization code at the each board file.

---
 arch/arm/mach-s5pv310/mach-smdkc210.c       |    4 ----
 arch/arm/mach-s5pv310/mach-smdkv310.c       |    4 ----
 arch/arm/mach-s5pv310/mach-universal_c210.c |    4 ----
 3 files changed, 0 insertions(+), 12 deletions(-)
arch/arm/mach-s5pv310/mach-smdkc210.c +0 -4
index 93d537b..3cde5ed 100644
@@ -129,10 +129,6 @@ static void __init smdkc210_machine_init(void)
 	s3c_sdhci2_set_platdata(&smdkc210_hsmmc2_pdata);
 	s3c_sdhci3_set_platdata(&smdkc210_hsmmc3_pdata);
 
-#ifdef CONFIG_CACHE_L2X0
-	l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
-#endif
-
 	platform_add_devices(smdkc210_devices, ARRAY_SIZE(smdkc210_devices));
 }
 
arch/arm/mach-s5pv310/mach-smdkv310.c +0 -4
index 10f8056..d9a17b8 100644
@@ -129,10 +129,6 @@ static void __init smdkv310_machine_init(void)
 	s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
 	s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata);
 
-#ifdef CONFIG_CACHE_L2X0
-	l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
-#endif
-
 	platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
 }
 
arch/arm/mach-s5pv310/mach-universal_c210.c +0 -4
index deffeb1..f78890f 100644
@@ -141,10 +141,6 @@ static void __init universal_map_io(void)
 
 static void __init universal_machine_init(void)
 {
-#ifdef CONFIG_CACHE_L2X0
-	l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
-#endif
-
 	i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
 	i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
 
Signature · 1 line
1.6.2.5
#5 lore raw

PATCH v3 2/3 ARM: S5PV310: Remove L2 cache init in machine

Quoted 21 lines · Kukjin Kim

From: Kyungmin Park <[email protected]>

Basically, need L2 cache initialize function in ARCH_S5PV310. So it would be better to move it into ARCH_S5PV310 common part. This patch removes L2 cache initialization code at the each board file.

---
 arch/arm/mach-s5pv310/mach-smdkc210.c       |    4 ----
 arch/arm/mach-s5pv310/mach-smdkv310.c       |    4 ----
 arch/arm/mach-s5pv310/mach-universal_c210.c |    4 ----
 3 files changed, 0 insertions(+), 12 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-s5pv310/mach-smdkc210.c +0 -0

s5pv310/mach-smdkc210.c
index 93d537b..3cde5ed 100644

arch/arm/mach-s5pv310/mach-smdkc210.c static void __init smdkc210_machine_init(void) · line 135

Quoted 7 lines
arch/arm/mach-s5pv310/mach-smdkc210.c +0 -4
@@ -129,10 +129,6 @@ static void __init smdkc210_machine_init(void)
 	s3c_sdhci2_set_platdata(&smdkc210_hsmmc2_pdata);
 	s3c_sdhci3_set_platdata(&smdkc210_hsmmc3_pdata);
 
-#ifdef CONFIG_CACHE_L2X0
-	l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
-#endif
-

Hi,

If L2 cache init is removed, including header file "asm/hardware/cache-l2x0.h" isn't needed.

Best regards,
Daein Moon

Quoted 45 lines
arch/arm/mach-s5pv310/mach-smdkc210.c +0 -0
 	platform_add_devices(smdkc210_devices,
 ARRAY_SIZE(smdkc210_devices));
 }
arch/arm/mach- renamed from arch/arm/mach-s5pv310/mach-smdkv310.c +0 -0

s5pv310/mach-smdkv310.c
index 10f8056..d9a17b8 100644

arch/arm/mach-s5pv310/mach-smdkv310.c +0 -4
@@ -129,10 +129,6 @@ static void __init smdkv310_machine_init(void)
 	s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
 	s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata);
 
-#ifdef CONFIG_CACHE_L2X0
-	l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
-#endif
-
 	platform_add_devices(smdkv310_devices,
 ARRAY_SIZE(smdkv310_devices));
 }
arch/arm/mach- renamed from arch/arm/mach-s5pv310/mach-universal_c210.c +0 -0

s5pv310/mach-universal_c210.c
index deffeb1..f78890f 100644

arch/arm/mach-s5pv310/mach-universal_c210.c +0 -5
@@ -141,10 +141,6 @@ static void __init universal_map_io(void)
 
 static void __init universal_machine_init(void)
 {
-#ifdef CONFIG_CACHE_L2X0
-	l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
-#endif
-
 	i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
 	i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
 
--

1.6.2.5

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#6 lore raw

PATCH v3 2/3 ARM: S5PV310: Remove L2 cache init in machine

Quoted 5 lines · Daein Moon
Quoted 3 lines · Kukjin Kim

From: Kyungmin Park <[email protected]>

Basically, need L2 cache initialize function in ARCH_S5PV310. So it

would

Quoted 1 line
Quoted 1 line

be better to move it into ARCH_S5PV310 common part. This patch removes

L2

Quoted 20 lines
Quoted 20 lines

cache initialization code at the each board file.

---
 arch/arm/mach-s5pv310/mach-smdkc210.c       |    4 ----
 arch/arm/mach-s5pv310/mach-smdkv310.c       |    4 ----
 arch/arm/mach-s5pv310/mach-universal_c210.c |    4 ----
 3 files changed, 0 insertions(+), 12 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-s5pv310/mach-smdkc210.c +0 -0

s5pv310/mach-smdkc210.c
index 93d537b..3cde5ed 100644

arch/arm/mach-s5pv310/mach-smdkc210.c +0 -0
@@ -129,10 +129,6 @@ static void __init smdkc210_machine_init(void)
 	s3c_sdhci2_set_platdata(&smdkc210_hsmmc2_pdata);
 	s3c_sdhci3_set_platdata(&smdkc210_hsmmc3_pdata);
 
Quoted 9 lines

arch/arm/mach-s5pv310/mach-smdkc210.c static void __init smdkc210_machine_init(void) · line 135

Quoted 4 lines
arch/arm/mach-s5pv310/mach-smdkc210.c +0 -4
-#ifdef CONFIG_CACHE_L2X0
-	l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
-#endif
-

Hi,

If L2 cache init is removed, including header file "asm/hardware/cache-l2x0.h" isn't needed.

Yes, you're right...will be removed.

Thanks for your pointing out.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#7 lore raw

PATCH v3 3/3 ARM: S5PV310: Add L2 cache init function in cpu.c

In reply to Kukjin Kim

From: Kyungmin Park <[email protected]>

This patch adds L2 cache initialization code in cpu.c of ARCH_S5PV310. It includes TAG and Data latency, Prefetch, and Power configurations.

---
 arch/arm/mach-s5pv310/cpu.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv310/cpu.c +23 -0
index 5b97900..4e3f5be 100644
@@ -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>
@@ -148,6 +149,28 @@ static int __init s5pv310_core_init(void)
 
 core_initcall(s5pv310_core_init);
 
+#ifdef CONFIG_CACHE_L2X0
+static int __init s5pv310_l2x0_cache_init(void)
+{
+	/* TAG, Data Latency Control: 2cycle */
+	__raw_writel(0x110, S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
+	__raw_writel(0x110, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
+
+	/* L2X0 Prefetch Control */
+	__raw_writel(0x30000007, S5P_VA_L2CC + L2X0_PREFETCH_CTRL);
+
+	/* L2X0 Power Control */
+	__raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN,
+		     S5P_VA_L2CC + L2X0_POWER_CTRL);
+
+	l2x0_init(S5P_VA_L2CC, 0x7C070001, 0xC200ffff);
+
+	return 0;
+}
+
+early_initcall(s5pv310_l2x0_cache_init);
+#endif
+
 int __init s5pv310_init(void)
 {
 	printk(KERN_INFO "S5PV310: Initializing architecture\n");
Signature · 1 line
1.6.2.5