public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF
@ 2014-11-17 13:53 Geert Uytterhoeven
  2014-11-17 13:53 ` [PATCH 1/4] ARM: shmobile: r8a7740 dtsi: Add cache-controller node Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2014-11-17 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

	Hi Simon, Magnus,

This patch series migrates the DT-based generic r8a7740 platform and the
armadillo legacy platform from calling l2x0_of_init() to the generic l2c OF
initialization.

Dependencies:
  - The first patch depends on "[PATCH v5 7/8] ARM: shmobile: r8a7740 dtsi: Add
    PM domain support", due to the pd_a3sm reference.
    However, that line can just be removed if the dependency is postponed.
  - Although there are separate patches for dtsi, SoC code, and board code,
    there are dependencies among the individual patches: patches 2 and 3 depend
    on patch 1, and patch 4 depends on patches 2 and 3 (and thus 1).

Note that this conversion should be applied to sh73a0, r8a7778, and r8a7779,
too. More about sh73a0 later.

Thanks!
	    
Geert Uytterhoeven (4):
  ARM: shmobile: r8a7740 dtsi: Add cache-controller node
  ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
  ARM: shmobile: armadillo legacy: Migrate to generic l2c OF
    initialization
  ARM: shmobile: r8a7740: Remove mapping of L2 cache controller
    registers

 arch/arm/boot/dts/r8a7740.dtsi                 | 11 +++++++++++
 arch/arm/mach-shmobile/board-armadillo800eva.c | 10 +++-------
 arch/arm/mach-shmobile/setup-r8a7740.c         | 20 +++-----------------
 3 files changed, 17 insertions(+), 24 deletions(-)

-- 
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 1/4] ARM: shmobile: r8a7740 dtsi: Add cache-controller node
  2014-11-17 13:53 [PATCH 0/4] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
@ 2014-11-17 13:53 ` Geert Uytterhoeven
  2014-11-17 13:53 ` [PATCH 2/4] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization Geert Uytterhoeven
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2014-11-17 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

Add the missing cache-controller node. This will allow migration to the
generic l2c OF initialization.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: devicetree at vger.kernel.org
---
Note: This depends on "[PATCH v5 7/8] ARM: shmobile: r8a7740 dtsi: Add
      PM domain support" due to the pd_a3sm reference.
---
 arch/arm/boot/dts/r8a7740.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi
index e2c9496c2c325a1f..a9c7a986c0e9eca6 100644
--- a/arch/arm/boot/dts/r8a7740.dtsi
+++ b/arch/arm/boot/dts/r8a7740.dtsi
@@ -37,6 +37,17 @@
 		      <0xc2000000 0x1000>;
 	};
 
+	L2: cache-controller {
+		compatible = "arm,pl310-cache";
+		reg = <0xf0100000 0x1000>;
+		interrupts = <84>;
+		power-domains = <&pd_a3sm>;
+		arm,data-latency = <3 3 3>;
+		arm,tag-latency = <2 2 2>;
+		cache-unified;
+		cache-level = <2>;
+	};
+
 	pmu {
 		compatible = "arm,cortex-a9-pmu";
 		interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>;
-- 
1.9.1

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

* [PATCH 2/4] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
  2014-11-17 13:53 [PATCH 0/4] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
  2014-11-17 13:53 ` [PATCH 1/4] ARM: shmobile: r8a7740 dtsi: Add cache-controller node Geert Uytterhoeven
@ 2014-11-17 13:53 ` Geert Uytterhoeven
  2014-11-17 14:23   ` Arnd Bergmann
  2014-11-17 13:53 ` [PATCH 3/4] ARM: shmobile: armadillo legacy: " Geert Uytterhoeven
  2014-11-17 13:53 ` [PATCH 4/4] ARM: shmobile: r8a7740: Remove mapping of L2 cache controller registers Geert Uytterhoeven
  3 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2014-11-17 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

Migrate the generic r8a7740 platform from calling l2x0_of_init() to the
generic l2c OF initialization.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/setup-r8a7740.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 79ad93dfdae4ee70..f4a2997f55c0c4a4 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -32,7 +32,6 @@
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
-#include <asm/hardware/cache-l2x0.h>
 
 #include "common.h"
 #include "dma-register.h"
@@ -828,10 +827,6 @@ static void __init r8a7740_generic_init(void)
 {
 	r8a7740_meram_workaround();
 
-#ifdef CONFIG_CACHE_L2X0
-	/* Shared attribute override enable, 32K*8way */
-	l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff);
-#endif
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -848,6 +843,9 @@ static const char *r8a7740_boards_compat_dt[] __initdata = {
 };
 
 DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
+	/* Shared attribute override enable, 32K*8way */
+	.l2c_aux_val	= 0x00400000,
+	.l2c_aux_mask	= 0xc20f0fff,
 	.map_io		= r8a7740_map_io,
 	.init_early	= shmobile_init_delay,
 	.init_irq	= r8a7740_init_irq_of,
-- 
1.9.1

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

* [PATCH 3/4] ARM: shmobile: armadillo legacy: Migrate to generic l2c OF initialization
  2014-11-17 13:53 [PATCH 0/4] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
  2014-11-17 13:53 ` [PATCH 1/4] ARM: shmobile: r8a7740 dtsi: Add cache-controller node Geert Uytterhoeven
  2014-11-17 13:53 ` [PATCH 2/4] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization Geert Uytterhoeven
@ 2014-11-17 13:53 ` Geert Uytterhoeven
  2014-11-17 13:53 ` [PATCH 4/4] ARM: shmobile: r8a7740: Remove mapping of L2 cache controller registers Geert Uytterhoeven
  3 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2014-11-17 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

Migrate the generic r8a7740 platform from calling l2x0_of_init() to the
generic l2c OF initialization.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 6d949f1c850bda8b..11feea1da28a03b1 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -41,7 +41,6 @@
 #include <linux/usb/renesas_usbhs.h>
 #include <linux/videodev2.h>
 
-#include <asm/hardware/cache-l2x0.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -1309,12 +1308,6 @@ static void __init eva_init(void)
 		sdhi1 = &sdhi1_device;
 	}
 
-
-#ifdef CONFIG_CACHE_L2X0
-	/* Shared attribute override enable, 32K*8way */
-	l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff);
-#endif
-
 	i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
 	i2c_register_board_info(2, i2c2_devices, ARRAY_SIZE(i2c2_devices));
 
@@ -1355,6 +1348,9 @@ static const char *eva_boards_compat_dt[] __initdata = {
 };
 
 DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
+	/* Shared attribute override enable, 32K*8way */
+	.l2c_aux_val	= 0x00400000,
+	.l2c_aux_mask	= 0xc20f0fff,
 	.map_io		= r8a7740_map_io,
 	.init_early	= r8a7740_add_early_devices,
 	.init_irq	= r8a7740_init_irq_of,
-- 
1.9.1

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

* [PATCH 4/4] ARM: shmobile: r8a7740: Remove mapping of L2 cache controller registers
  2014-11-17 13:53 [PATCH 0/4] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2014-11-17 13:53 ` [PATCH 3/4] ARM: shmobile: armadillo legacy: " Geert Uytterhoeven
@ 2014-11-17 13:53 ` Geert Uytterhoeven
  3 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2014-11-17 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

Now all r8a7740-based platforms have been migrated to the generic l2c OF
initialization, it's no longer needed to map the L2 cache controller
registers from .map_io().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/setup-r8a7740.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index f4a2997f55c0c4a4..e872b8ea99badbce 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -50,18 +50,6 @@ static struct map_desc r8a7740_io_desc[] __initdata = {
 		.length		= 160 << 20,
 		.type		= MT_DEVICE_NONSHARED
 	},
-#ifdef CONFIG_CACHE_L2X0
-	/*
-	 * for l2x0_init()
-	 * 0xf0100000-0xf0101000 -> 0xf0002000-0xf0003000
-	 */
-	{
-		.virtual	= 0xf0002000,
-		.pfn		= __phys_to_pfn(0xf0100000),
-		.length		= PAGE_SIZE,
-		.type		= MT_DEVICE_NONSHARED
-	},
-#endif
 };
 
 void __init r8a7740_map_io(void)
-- 
1.9.1

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

* [PATCH 2/4] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
  2014-11-17 13:53 ` [PATCH 2/4] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization Geert Uytterhoeven
@ 2014-11-17 14:23   ` Arnd Bergmann
  2015-01-20 18:46     ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2014-11-17 14:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 17 November 2014 14:53:06 Geert Uytterhoeven wrote:
>  DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
> +       /* Shared attribute override enable, 32K*8way */
> +       .l2c_aux_val    = 0x00400000,
> +       .l2c_aux_mask   = 0xc20f0fff,
>         .map_io         = r8a7740_map_io,
>         .init_early     = shmobile_init_delay,
>         .init_irq       = r8a7740_init_irq_of,

You are only now adding it to DT, so you should have enough freedom
to put the correct values in it.

Please use the 0/0xffffffff settings here and use the generic
code to set up the L2X0.

	Arnd

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

* [PATCH 2/4] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
  2014-11-17 14:23   ` Arnd Bergmann
@ 2015-01-20 18:46     ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2015-01-20 18:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

On Mon, Nov 17, 2014 at 3:23 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 17 November 2014 14:53:06 Geert Uytterhoeven wrote:
>>  DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
>> +       /* Shared attribute override enable, 32K*8way */
>> +       .l2c_aux_val    = 0x00400000,
>> +       .l2c_aux_mask   = 0xc20f0fff,
>>         .map_io         = r8a7740_map_io,
>>         .init_early     = shmobile_init_delay,
>>         .init_irq       = r8a7740_init_irq_of,
>
> You are only now adding it to DT, so you should have enough freedom
> to put the correct values in it.
>
> Please use the 0/0xffffffff settings here and use the generic
> code to set up the L2X0.

Thanks!

I looked into adding a proper cache-controller node in DT.
While l2c_aux_mask can indeed be ~0, we still need a non-zero l2c_aux_val
to set L2C_AUX_CTRL_SHARED_OVERRIDE.
Alternatively, should there be a DT property to set this flag?

Note that I only try to preserve the register value before and after
migrating to generic l2c OF initialization. I did read (part of) the pl310
documentation, but it's still not clear to me if we really need
L2C_AUX_CTRL_SHARED_OVERRIDE. Perhaps this was just copied from
somewhere else without much afterthought?

Note that OMAP2+ has just made the switch, too, keeping
L2C_AUX_CTRL_SHARED_OVERRIDE, in commit 944e9df1d4f71f94 ("ARM: 8257/1:
OMAP2+: use common l2cache initialization code").

Thanks again!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2015-01-20 18:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 13:53 [PATCH 0/4] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
2014-11-17 13:53 ` [PATCH 1/4] ARM: shmobile: r8a7740 dtsi: Add cache-controller node Geert Uytterhoeven
2014-11-17 13:53 ` [PATCH 2/4] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization Geert Uytterhoeven
2014-11-17 14:23   ` Arnd Bergmann
2015-01-20 18:46     ` Geert Uytterhoeven
2014-11-17 13:53 ` [PATCH 3/4] ARM: shmobile: armadillo legacy: " Geert Uytterhoeven
2014-11-17 13:53 ` [PATCH 4/4] ARM: shmobile: r8a7740: Remove mapping of L2 cache controller registers Geert Uytterhoeven

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