Skip to contentSkip to conversation

ARM: shmobile: sh73a0: Enable CMT1 device using DT

PATCH New Simon Horman 3 participants 7 messages Sep 8, 2014 – Sep 9, 2014

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v3 cover ARM: shmobile: sh73a0: Enable CMT1 device using DT

Hi,

this is a slightly modified version of this change which was previously available in
"[PATCH v2 00/10] sh73a0 common clock framework implementation"

The purpose of breaking or this change is to allow it to
be applied independently of the changes in the above mentioned series.

The changes are as follows:
- Don't use DT clocks as they are added by the above mentioned series and thus not present yet.
- Add patch to use SoC-specific 48-bit CMT compat string.

Simon Horman (1):
ARM: shmobile: sh73a0: Use SoC-specific 48-bit CMT compat string

Ulrich Hecht (2):
ARM: shmobile: sh73a0: Add CMT1 device to DT
ARM: shmobile: kzm9g-reference: Enable CMT1 in device tree

 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts |  4 ++++
 arch/arm/boot/dts/sh73a0.dtsi                | 10 ++++++++++
 arch/arm/mach-shmobile/setup-sh73a0.c        | 11 +----------
 3 files changed, 15 insertions(+), 10 deletions(-)
Signature · 1 line
2.0.1
#1 lore raw

PATCH v3 1/3 ARM: shmobile: sh73a0: Add CMT1 device to DT

From: Ulrich Hecht <[email protected]>

---
v3 [Simon Horman]
* Dropped use of clocks that are not present in DT yet

---
 arch/arm/boot/dts/sh73a0.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/sh73a0.dtsi +10 -0
index 0d001eb..6cb29cd 100644
@@ -48,6 +48,16 @@
 			     <0 56 IRQ_TYPE_LEVEL_HIGH>;
 	};
 
+	cmt1: timer at e6138000 {
+		compatible = "renesas,cmt-48";
+		reg = <0xe6138000 0x200>;
+		interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>;
+
+		renesas,channels-mask = <0x3f>;
+
+		status = "disabled";
+	};
+
 	irqpin0: irqpin at e6900000 {
 		compatible = "renesas,intc-irqpin-sh73a0", "renesas,intc-irqpin";
 		#interrupt-cells = <2>;
Signature · 1 line
2.0.1
#2 lore raw

PATCH v3 2/3 ARM: shmobile: sh73a0: Use SoC-specific 48-bit CMT compat string

In reply to Simon Horman

In general Renesas hardware is not documented to the extent where the relationship between IP blocks on different SoCs can be assumed although they may appear to operate the same way. Furthermore the documentation typically does not specify a version for individual IP blocks. For these reasons a convention of using the SoC name in place of a version and providing SoC-specific compat strings has been adopted.

Although not universally liked this convention is used in the bindings for a number of drivers for Renesas hardware. The purpose of this patch is to make use of the SoC-specific CMT compat string for the sh73a0 48-bit CMT clock source.

---
v3
* First post

---
 arch/arm/boot/dts/sh73a0.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/sh73a0.dtsi +1 -1
index 6cb29cd..030a592 100644
@@ -49,7 +49,7 @@
 	};
 
 	cmt1: timer at e6138000 {
-		compatible = "renesas,cmt-48";
+		compatible = "renesas,cmt-48-sh73a0", "renesas,cmt-48";
 		reg = <0xe6138000 0x200>;
 		interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>;
 
Signature · 1 line
2.0.1
#3 lore raw

PATCH v3 3/3 ARM: shmobile: kzm9g-reference: Enable CMT1 in device tree

In reply to Simon Horman

From: Ulrich Hecht <[email protected]>

---
v3
* No change

---
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts |  4 ++++
 arch/arm/mach-shmobile/setup-sh73a0.c        | 11 +----------
 2 files changed, 5 insertions(+), 10 deletions(-)
arch/arm/boot/dts/sh73a0-kzm9g-reference.dts +4 -0
index 477f815..30ef97e 100644
@@ -173,6 +173,10 @@
 	};
 };
 
+&cmt1 {
+	status = "ok";
+};
+
 &i2c0 {
 	status = "okay";
 	as3711 at 40 {
arch/arm/mach-shmobile/setup-sh73a0.c +1 -10
index 0085305..b7bd8e5 100644
@@ -697,10 +697,6 @@ static struct platform_device irqpin3_device = {
 	},
 };
 
-static struct platform_device *sh73a0_devices_dt[] __initdata = {
-	&cmt1_device,
-};
-
 static struct platform_device *sh73a0_early_devices[] __initdata = {
 	&scif0_device,
 	&scif1_device,
@@ -713,6 +709,7 @@ static struct platform_device *sh73a0_early_devices[] __initdata = {
 	&scif8_device,
 	&tmu0_device,
 	&ipmmu_device,
+	&cmt1_device,
 };
 
 static struct platform_device *sh73a0_late_devices[] __initdata = {
@@ -737,8 +734,6 @@ void __init sh73a0_add_standard_devices(void)
 	/* Clear software reset bit on SY-DMAC module */
 	__raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2);
 
-	platform_add_devices(sh73a0_devices_dt,
-			    ARRAY_SIZE(sh73a0_devices_dt));
 	platform_add_devices(sh73a0_early_devices,
 			    ARRAY_SIZE(sh73a0_early_devices));
 	platform_add_devices(sh73a0_late_devices,
@@ -763,8 +758,6 @@ void __init sh73a0_earlytimer_init(void)
 
 void __init sh73a0_add_early_devices(void)
 {
-	early_platform_add_devices(sh73a0_devices_dt,
-				   ARRAY_SIZE(sh73a0_devices_dt));
 	early_platform_add_devices(sh73a0_early_devices,
 				   ARRAY_SIZE(sh73a0_early_devices));
 
@@ -779,8 +772,6 @@ void __init sh73a0_add_standard_devices_dt(void)
 	/* clocks are setup late during boot in the case of DT */
 	sh73a0_clock_init();
 
-	platform_add_devices(sh73a0_devices_dt,
-			     ARRAY_SIZE(sh73a0_devices_dt));
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
Signature · 1 line
2.0.1
maintainer
#4 lore raw

v3 cover ARM: shmobile: sh73a0: Enable CMT1 device using DT

In reply to Simon Horman

Hi Simon,

Quoted 14 lines · Simon Horman

Hi,

this is a slightly modified version of this change which was previously available in
"[PATCH v2 00/10] sh73a0 common clock framework implementation"

The purpose of breaking or this change is to allow it to
be applied independently of the changes in the above mentioned series.

The changes are as follows:
- Don't use DT clocks as they are added by the above mentioned series and thus not present yet.
- Add patch to use SoC-specific 48-bit CMT compat string.

Quoted 6 lines

Simon Horman (1):
ARM: shmobile: sh73a0: Use SoC-specific 48-bit CMT compat string

Ulrich Hecht (2):
ARM: shmobile: sh73a0: Add CMT1 device to DT
ARM: shmobile: kzm9g-reference: Enable CMT1 in device tree

Looking good, thanks for doing this!

Cheers,

/ magnus

#5 lore raw

v3 cover ARM: shmobile: sh73a0: Enable CMT1 device using DT

Quoted 20 lines · Magnus Damm

Hi Simon,

Quoted 17 lines · Simon Horman

Hi,

this is a slightly modified version of this change which was previously available in
"[PATCH v2 00/10] sh73a0 common clock framework implementation"

The purpose of breaking or this change is to allow it to
be applied independently of the changes in the above mentioned series.

The changes are as follows:
- Don't use DT clocks as they are added by the above mentioned series and thus not present yet.
- Add patch to use SoC-specific 48-bit CMT compat string.

Simon Horman (1):
ARM: shmobile: sh73a0: Use SoC-specific 48-bit CMT compat string

Quoted 7 lines
Quoted 3 lines

Ulrich Hecht (2):
ARM: shmobile: sh73a0: Add CMT1 device to DT
ARM: shmobile: kzm9g-reference: Enable CMT1 in device tree

Looking good, thanks for doing this!

Thanks, I plan to leave them open for review a little bit longer and if all goes well queue them up tomorrow.

#6 lore raw

v3 cover ARM: shmobile: sh73a0: Enable CMT1 device using DT

Quoted 25 lines · Simon Horman
Quoted 24 lines · Magnus Damm

Hi Simon,

Quoted 20 lines · Simon Horman

Hi,

this is a slightly modified version of this change which was previously available in
"[PATCH v2 00/10] sh73a0 common clock framework implementation"

The purpose of breaking or this change is to allow it to
be applied independently of the changes in the above mentioned series.

The changes are as follows:
- Don't use DT clocks as they are added by the above mentioned series and thus not present yet.
- Add patch to use SoC-specific 48-bit CMT compat string.

Simon Horman (1):
ARM: shmobile: sh73a0: Use SoC-specific 48-bit CMT compat string

Ulrich Hecht (2):
ARM: shmobile: sh73a0: Add CMT1 device to DT
ARM: shmobile: kzm9g-reference: Enable CMT1 in device tree

Quoted 6 lines
Quoted 3 lines

Looking good, thanks for doing this!

Thanks, I plan to leave them open for review a little bit longer and if all goes well queue them up tomorrow.

Thanks, I have queued these up after squashing the first two patches together.