public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH V3 0/3] ARM: S5PV310: Move and Update L2 cache init code
@ 2010-10-21  6:44 Kukjin Kim
  2010-10-21  6:44 ` [PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register Kukjin Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kukjin Kim @ 2010-10-21  6:44 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register
  2010-10-21  6:44 [PATCH V3 0/3] ARM: S5PV310: Move and Update L2 cache init code Kukjin Kim
@ 2010-10-21  6:44 ` Kukjin Kim
  2010-10-21  8:44   ` Catalin Marinas
  2010-10-21  6:44 ` [PATCH V3 2/3] ARM: S5PV310: Remove L2 cache init in machine Kukjin Kim
  2010-10-21  6:44 ` [PATCH V3 3/3] ARM: S5PV310: Add L2 cache init function in cpu.c Kukjin Kim
  2 siblings, 1 reply; 8+ messages in thread
From: Kukjin Kim @ 2010-10-21  6:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kyungmin Park <kyungmin.park@samsung.com>

This patch adds L2X0 Prefetch and Power control register.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/include/asm/hardware/cache-l2x0.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 6bcba48..351ca8d 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -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);
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V3 2/3] ARM: S5PV310: Remove L2 cache init in machine
  2010-10-21  6:44 [PATCH V3 0/3] ARM: S5PV310: Move and Update L2 cache init code Kukjin Kim
  2010-10-21  6:44 ` [PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register Kukjin Kim
@ 2010-10-21  6:44 ` Kukjin Kim
  2010-10-21  7:23   ` Daein Moon
  2010-10-21  6:44 ` [PATCH V3 3/3] ARM: S5PV310: Add L2 cache init function in cpu.c Kukjin Kim
  2 siblings, 1 reply; 8+ messages in thread
From: Kukjin Kim @ 2010-10-21  6:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kyungmin Park <kyungmin.park@samsung.com>

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.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 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(-)

diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-s5pv310/mach-smdkc210.c
index 93d537b..3cde5ed 100644
--- a/arch/arm/mach-s5pv310/mach-smdkc210.c
+++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
@@ -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));
 }
 
diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-s5pv310/mach-smdkv310.c
index 10f8056..d9a17b8 100644
--- a/arch/arm/mach-s5pv310/mach-smdkv310.c
+++ b/arch/arm/mach-s5pv310/mach-smdkv310.c
@@ -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));
 }
 
diff --git a/arch/arm/mach-s5pv310/mach-universal_c210.c b/arch/arm/mach-s5pv310/mach-universal_c210.c
index deffeb1..f78890f 100644
--- a/arch/arm/mach-s5pv310/mach-universal_c210.c
+++ b/arch/arm/mach-s5pv310/mach-universal_c210.c
@@ -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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V3 3/3] ARM: S5PV310: Add L2 cache init function in cpu.c
  2010-10-21  6:44 [PATCH V3 0/3] ARM: S5PV310: Move and Update L2 cache init code Kukjin Kim
  2010-10-21  6:44 ` [PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register Kukjin Kim
  2010-10-21  6:44 ` [PATCH V3 2/3] ARM: S5PV310: Remove L2 cache init in machine Kukjin Kim
@ 2010-10-21  6:44 ` Kukjin Kim
  2 siblings, 0 replies; 8+ messages in thread
From: Kukjin Kim @ 2010-10-21  6:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kyungmin Park <kyungmin.park@samsung.com>

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

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s5pv310/cpu.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
index 5b97900..4e3f5be 100644
--- a/arch/arm/mach-s5pv310/cpu.c
+++ b/arch/arm/mach-s5pv310/cpu.c
@@ -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");
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V3 2/3] ARM: S5PV310: Remove L2 cache init in machine
  2010-10-21  6:44 ` [PATCH V3 2/3] ARM: S5PV310: Remove L2 cache init in machine Kukjin Kim
@ 2010-10-21  7:23   ` Daein Moon
  2010-10-21  7:28     ` Kukjin Kim
  0 siblings, 1 reply; 8+ messages in thread
From: Daein Moon @ 2010-10-21  7:23 UTC (permalink / raw)
  To: linux-arm-kernel

Kukjin Kim wrote:
> From: Kyungmin Park <kyungmin.park@samsung.com>
> 
> 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.
> 
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
>  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(-)
> 
> diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-
> s5pv310/mach-smdkc210.c
> index 93d537b..3cde5ed 100644
> --- a/arch/arm/mach-s5pv310/mach-smdkc210.c
> +++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
> @@ -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

>  	platform_add_devices(smdkc210_devices,
> ARRAY_SIZE(smdkc210_devices));
>  }
> 
> diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-
> s5pv310/mach-smdkv310.c
> index 10f8056..d9a17b8 100644
> --- a/arch/arm/mach-s5pv310/mach-smdkv310.c
> +++ b/arch/arm/mach-s5pv310/mach-smdkv310.c
> @@ -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));
>  }
> 
> diff --git a/arch/arm/mach-s5pv310/mach-universal_c210.c b/arch/arm/mach-
> s5pv310/mach-universal_c210.c
> index deffeb1..f78890f 100644
> --- a/arch/arm/mach-s5pv310/mach-universal_c210.c
> +++ b/arch/arm/mach-s5pv310/mach-universal_c210.c
> @@ -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
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V3 2/3] ARM: S5PV310: Remove L2 cache init in machine
  2010-10-21  7:23   ` Daein Moon
@ 2010-10-21  7:28     ` Kukjin Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Kukjin Kim @ 2010-10-21  7:28 UTC (permalink / raw)
  To: linux-arm-kernel

Daein Moon wrote:
> 
> Kukjin Kim wrote:
> > From: Kyungmin Park <kyungmin.park@samsung.com>
> >
> > 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.
> >
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> > ---
> >  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(-)
> >
> > diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-
> > s5pv310/mach-smdkc210.c
> > index 93d537b..3cde5ed 100644
> > --- a/arch/arm/mach-s5pv310/mach-smdkc210.c
> > +++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
> > @@ -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.
> 
Yes, you're right...will be removed.

Thanks for your pointing out.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register
  2010-10-21  6:44 ` [PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register Kukjin Kim
@ 2010-10-21  8:44   ` Catalin Marinas
  2010-10-21  8:55     ` Kukjin Kim
  0 siblings, 1 reply; 8+ messages in thread
From: Catalin Marinas @ 2010-10-21  8:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2010-10-21 at 07:44 +0100, Kukjin Kim wrote:
> From: Kyungmin Park <kyungmin.park@samsung.com>
> 
> This patch adds L2X0 Prefetch and Power control register.
> 
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register
  2010-10-21  8:44   ` Catalin Marinas
@ 2010-10-21  8:55     ` Kukjin Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Kukjin Kim @ 2010-10-21  8:55 UTC (permalink / raw)
  To: linux-arm-kernel

Catalin Marinas wrote:
> 
> On Thu, 2010-10-21 at 07:44 +0100, Kukjin Kim wrote:
> > From: Kyungmin Park <kyungmin.park@samsung.com>
> >
> > This patch adds L2X0 Prefetch and Power control register.
> >
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> 
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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 <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-10-21  8:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-21  6:44 [PATCH V3 0/3] ARM: S5PV310: Move and Update L2 cache init code Kukjin Kim
2010-10-21  6:44 ` [PATCH V3 1/3] ARM: Add L2X0 PREFETCH and POWER control register Kukjin Kim
2010-10-21  8:44   ` Catalin Marinas
2010-10-21  8:55     ` Kukjin Kim
2010-10-21  6:44 ` [PATCH V3 2/3] ARM: S5PV310: Remove L2 cache init in machine Kukjin Kim
2010-10-21  7:23   ` Daein Moon
2010-10-21  7:28     ` Kukjin Kim
2010-10-21  6:44 ` [PATCH V3 3/3] ARM: S5PV310: Add L2 cache init function in cpu.c Kukjin Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox