* [PATCH v2 1/5] ARM: shmobile: r8a7740 dtsi: Add cache-controller node
2015-02-04 14:15 [PATCH v2 0/5] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
@ 2015-02-04 14:15 ` Geert Uytterhoeven
2015-02-04 14:15 ` [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization Geert Uytterhoeven
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2015-02-04 14:15 UTC (permalink / raw)
To: linux-arm-kernel
Add the missing cache-controller node. This will allow migration to the
generic l2c OF initialization.
The L2 cache is an ARM L2C-310 (r3p1-150rel0), of size 256 KiB (32 KiB x
8 ways).
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "ARM: shmobile: r8a7740 dtsi: Add PM domain support"
due to the pd_a3sm reference.
v2:
- Fix interrupt (should be 3 cells, not 1),
- Describe cache better.
---
arch/arm/boot/dts/r8a7740.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi
index 83c1c3ca1b8f1400..c84a99931e30304c 100644
--- a/arch/arm/boot/dts/r8a7740.dtsi
+++ b/arch/arm/boot/dts/r8a7740.dtsi
@@ -37,6 +37,21 @@
<0xc2000000 0x1000>;
};
+ L2: cache-controller {
+ compatible = "arm,pl310-cache";
+ reg = <0xf0100000 0x1000>;
+ interrupts = <0 84 IRQ_TYPE_LEVEL_HIGH>;
+ power-domains = <&pd_a3sm>;
+ arm,data-latency = <3 3 3>;
+ arm,tag-latency = <2 2 2>;
+ cache-unified;
+ cache-level = <2>;
+ cache-size = <0x40000>;
+ cache-sets = <1024>;
+ cache-block-size = <32>;
+ cache-line-size = <32>;
+ };
+
dbsc3: memory-controller@fe400000 {
compatible = "renesas,dbsc3-r8a7740";
reg = <0xfe400000 0x400>;
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
2015-02-04 14:15 [PATCH v2 0/5] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
2015-02-04 14:15 ` [PATCH v2 1/5] ARM: shmobile: r8a7740 dtsi: Add cache-controller node Geert Uytterhoeven
@ 2015-02-04 14:15 ` Geert Uytterhoeven
2015-02-04 14:34 ` Arnd Bergmann
2015-02-04 14:15 ` [PATCH v2 3/5] ARM: shmobile: armadillo legacy: " Geert Uytterhoeven
` (2 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Geert Uytterhoeven @ 2015-02-04 14:15 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>
---
v2
- Keep only {,~}L2C_AUX_CTRL_SHARED_OVERRIDE
---
arch/arm/mach-shmobile/setup-r8a7740.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index d191cf4197313482..3ebd4dfc8e853a9b 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -835,10 +835,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);
}
@@ -855,6 +851,8 @@ static const char *r8a7740_boards_compat_dt[] __initdata = {
};
DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
+ .l2c_aux_val = L2C_AUX_CTRL_SHARED_OVERRIDE,
+ .l2c_aux_mask = ~L2C_AUX_CTRL_SHARED_OVERRIDE,
.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] 12+ messages in thread* Re: [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
2015-02-04 14:15 ` [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization Geert Uytterhoeven
@ 2015-02-04 14:34 ` Arnd Bergmann
2015-02-04 14:43 ` Geert Uytterhoeven
0 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2015-02-04 14:34 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 04 February 2015 15:15:12 Geert Uytterhoeven wrote:
> DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
> + .l2c_aux_val = L2C_AUX_CTRL_SHARED_OVERRIDE,
> + .l2c_aux_mask = ~L2C_AUX_CTRL_SHARED_OVERRIDE,
> .map_io = r8a7740_map_io,
> .init_early = shmobile_init_delay,
> .init_irq = r8a7740_init_irq_of,
+Russell
I'd hope we could avoid having any overrides in here that are not
specified in DT. I can never remember what we discussed about particular
bits in the past though. Is this bit something we could add a binding
for, or could we make it enabled by default?
I assume you have to add it because the boot loader sets the wrong
default, right?
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
2015-02-04 14:34 ` Arnd Bergmann
@ 2015-02-04 14:43 ` Geert Uytterhoeven
2015-02-04 16:36 ` Arnd Bergmann
0 siblings, 1 reply; 12+ messages in thread
From: Geert Uytterhoeven @ 2015-02-04 14:43 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
On Wed, Feb 4, 2015 at 3:34 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 04 February 2015 15:15:12 Geert Uytterhoeven wrote:
>> DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
>> + .l2c_aux_val = L2C_AUX_CTRL_SHARED_OVERRIDE,
>> + .l2c_aux_mask = ~L2C_AUX_CTRL_SHARED_OVERRIDE,
>> .map_io = r8a7740_map_io,
>> .init_early = shmobile_init_delay,
>> .init_irq = r8a7740_init_irq_of,
>
> +Russell
>
> I'd hope we could avoid having any overrides in here that are not
> specified in DT. I can never remember what we discussed about particular
> bits in the past though. Is this bit something we could add a binding
> for, or could we make it enabled by default?
>
> I assume you have to add it because the boot loader sets the wrong
> default, right?
Indeed. 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?
The previous version was in thread
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-January/318328.html
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 12+ messages in thread* Re: [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
2015-02-04 14:43 ` Geert Uytterhoeven
@ 2015-02-04 16:36 ` Arnd Bergmann
2015-02-04 17:04 ` Geert Uytterhoeven
0 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2015-02-04 16:36 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 04 February 2015 15:43:43 Geert Uytterhoeven wrote:
>
> Indeed. 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?
Have you checked what the hardware/bootloader actually sets in that bit?
Maybe you can remove that override completely and the initial Linux
default was just set to the same that is already set on powerup?
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
2015-02-04 16:36 ` Arnd Bergmann
@ 2015-02-04 17:04 ` Geert Uytterhoeven
2015-02-04 18:33 ` Arnd Bergmann
0 siblings, 1 reply; 12+ messages in thread
From: Geert Uytterhoeven @ 2015-02-04 17:04 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
On Wed, Feb 4, 2015 at 5:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 04 February 2015 15:43:43 Geert Uytterhoeven wrote:
>>
>> Indeed. 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?
>
> Have you checked what the hardware/bootloader actually sets in that bit?
Yes, it boots with 0x02040000, i.e. L2C_AUX_CTRL_SHARED_OVERRIDE
(bit 22) is not set.
After the l2c driver is finished with it, it contains 0x46440001.
> Maybe you can remove that override completely and the initial Linux
> default was just set to the same that is already set on powerup?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 12+ messages in thread* Re: [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
2015-02-04 17:04 ` Geert Uytterhoeven
@ 2015-02-04 18:33 ` Arnd Bergmann
2015-02-04 18:40 ` Geert Uytterhoeven
0 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2015-02-04 18:33 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 04 February 2015 18:04:57 Geert Uytterhoeven wrote:
> On Wed, Feb 4, 2015 at 5:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Wednesday 04 February 2015 15:43:43 Geert Uytterhoeven wrote:
> >>
> >> Indeed. 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?
> >
> > Have you checked what the hardware/bootloader actually sets in that bit?
>
> Yes, it boots with 0x02040000, i.e. L2C_AUX_CTRL_SHARED_OVERRIDE
> (bit 22) is not set.
>
> After the l2c driver is finished with it, it contains 0x46440001.
I see. I guess someone understand the effect of this flag.
Does it make a difference on the machine you are looking at?
I've read the spec at http://infocenter.arm.com/help/topic/com.arm.doc.ddi0246a/DDI0246A_l2cc_pl310_r0p0_trm.pdf
on the topic but couldn't make sense of it to understand whether a
particular setting might be required for specific hardware or might
be a performance optimization.
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization
2015-02-04 18:33 ` Arnd Bergmann
@ 2015-02-04 18:40 ` Geert Uytterhoeven
0 siblings, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2015-02-04 18:40 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
On Wed, Feb 4, 2015 at 7:33 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 04 February 2015 18:04:57 Geert Uytterhoeven wrote:
>> On Wed, Feb 4, 2015 at 5:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Wednesday 04 February 2015 15:43:43 Geert Uytterhoeven wrote:
>> >>
>> >> Indeed. 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?
>> >
>> > Have you checked what the hardware/bootloader actually sets in that bit?
>>
>> Yes, it boots with 0x02040000, i.e. L2C_AUX_CTRL_SHARED_OVERRIDE
>> (bit 22) is not set.
>>
>> After the l2c driver is finished with it, it contains 0x46440001.
>
> I see. I guess someone understand the effect of this flag.
> Does it make a difference on the machine you are looking at?
Nope. I booted it without, too. No obvious differences.
> I've read the spec at http://infocenter.arm.com/help/topic/com.arm.doc.ddi0246a/DDI0246A_l2cc_pl310_r0p0_trm.pdf
> on the topic but couldn't make sense of it to understand whether a
> particular setting might be required for specific hardware or might
> be a performance optimization.
Thanks! Ah, so I'm not alone...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 12+ messages in thread
* [PATCH v2 3/5] ARM: shmobile: armadillo legacy: Migrate to generic l2c OF initialization
2015-02-04 14:15 [PATCH v2 0/5] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
2015-02-04 14:15 ` [PATCH v2 1/5] ARM: shmobile: r8a7740 dtsi: Add cache-controller node Geert Uytterhoeven
2015-02-04 14:15 ` [PATCH v2 2/5] ARM: shmobile: r8a7740: Migrate to generic l2c OF initialization Geert Uytterhoeven
@ 2015-02-04 14:15 ` Geert Uytterhoeven
2015-02-04 14:15 ` [PATCH v2 4/5] ARM: shmobile: r8a7740: Remove mapping of L2 cache controller registers Geert Uytterhoeven
2015-02-04 14:15 ` [PATCH v2 5/5] ARM: shmobile: r8a7740: Add L1 cache information to CPU node Geert Uytterhoeven
4 siblings, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2015-02-04 14:15 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>
---
v2
- Keep only {,~}L2C_AUX_CTRL_SHARED_OVERRIDE
---
arch/arm/mach-shmobile/board-armadillo800eva.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 6d949f1c850bda8b..c3261dc2fc009db5 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -1309,12 +1309,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 +1349,8 @@ static const char *eva_boards_compat_dt[] __initdata = {
};
DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
+ .l2c_aux_val = L2C_AUX_CTRL_SHARED_OVERRIDE,
+ .l2c_aux_mask = ~L2C_AUX_CTRL_SHARED_OVERRIDE,
.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] 12+ messages in thread* [PATCH v2 4/5] ARM: shmobile: r8a7740: Remove mapping of L2 cache controller registers
2015-02-04 14:15 [PATCH v2 0/5] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
` (2 preceding siblings ...)
2015-02-04 14:15 ` [PATCH v2 3/5] ARM: shmobile: armadillo legacy: " Geert Uytterhoeven
@ 2015-02-04 14:15 ` Geert Uytterhoeven
2015-02-04 14:15 ` [PATCH v2 5/5] ARM: shmobile: r8a7740: Add L1 cache information to CPU node Geert Uytterhoeven
4 siblings, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2015-02-04 14:15 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>
---
v2:
- No changes.
---
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 3ebd4dfc8e853a9b..ab005e2a0cde6892 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -51,18 +51,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] 12+ messages in thread* [PATCH v2 5/5] ARM: shmobile: r8a7740: Add L1 cache information to CPU node
2015-02-04 14:15 [PATCH v2 0/5] ARM: shmobile: r8a7740/armadillo: Migrate to generic l2c OF Geert Uytterhoeven
` (3 preceding siblings ...)
2015-02-04 14:15 ` [PATCH v2 4/5] ARM: shmobile: r8a7740: Remove mapping of L2 cache controller registers Geert Uytterhoeven
@ 2015-02-04 14:15 ` Geert Uytterhoeven
4 siblings, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2015-02-04 14:15 UTC (permalink / raw)
To: linux-arm-kernel
Describe the L1 cache in the CPU node:
- L1 instruction cache: 32 KiB (8 KiB x 4 ways),
- L1 data cache: 32 KiB (8 KiB x 4 ways).
Add a link to the L2 cache.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
- New.
---
arch/arm/boot/dts/r8a7740.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi
index c84a99931e30304c..81c26cf63ba0e78d 100644
--- a/arch/arm/boot/dts/r8a7740.dtsi
+++ b/arch/arm/boot/dts/r8a7740.dtsi
@@ -26,6 +26,15 @@
reg = <0x0>;
clock-frequency = <800000000>;
power-domains = <&pd_a3sm>;
+ i-cache-size = <0x8000>;
+ i-cache-sets = <256>;
+ i-cache-block-size = <32>;
+ i-cache-line-size = <32>;
+ d-cache-size = <0x8000>;
+ d-cache-sets = <256>;
+ d-cache-block-size = <32>;
+ d-cache-line-size = <32>;
+ next-level-cache = <&L2>;
};
};
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread