Skip to contentSkip to conversation

ARM: dts: r8a7793: add CAN to device tree

PATCH Superseded Simon Horman 4 participants 7 messages Mar 15, 2016 – Mar 16, 2016

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

v2 cover ARM: dts: r8a7793: add CAN to device tree

Hi,

this short series adds CAN clocks and nodes to the r8a7794 device tree.

I am not aware of an r8a7794 board that exposes CAN - neither the alt nor the silk board appear to - and thus am unsure of a way to test these changes. However, they are based on what is present for the r8a7791 SoC and I am unable to find a difference in the SoC documentation.

This series is similar to a similar series I posted for the r8a7794 in January.

Based on renesas-devel-20160311-v4.5-rc7.

Changes in v2
* Correct clock node names
* Add MSTP9 clocks
* Omit clock-output-names property from new nodes

Simon Horman (2):
ARM: dts: r8a7794: add CAN clocks to device tree
ARM: dts: r8a7794: add CAN nodes to device tree

 arch/arm/boot/dts/r8a7794.dtsi            | 55 +++++++++++++++++++++++++++----
 include/dt-bindings/clock/r8a7794-clock.h |  3 ++
 2 files changed, 51 insertions(+), 7 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/2 ARM: dts: r8a7794: add CAN clocks to device tree

Add CAN nodes to r8a7794 device tree.
Based on work by Sergei Shtylyov for the r8a7791 SoC.

Cc Sergei Shtylyov <[email protected]>

---
v2
* As suggested by Geert Uytterhoeven:
- Name clock nodes can and usb_extal
- Do not add clock-output-names property to new nodes
- Add MSTP9 clocks

---
 arch/arm/boot/dts/r8a7794.dtsi            | 33 ++++++++++++++++++++++++-------
 include/dt-bindings/clock/r8a7794-clock.h |  3 +++
 2 files changed, 29 insertions(+), 7 deletions(-)
arch/arm/boot/dts/r8a7794.dtsi +26 -7
index eacb2b291361..e7a3c792c97c 100644
@@ -844,6 +844,22 @@
 			clock-output-names = "extal";
 		};
 
+		/* External USB clock - can be overridden by the board */
+		usb_extal_clk: usb_extal {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <48000000>;
+		};
+
+		/* External CAN clock */
+		can_clk: can {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			/* This value must be overridden by the board. */
+			clock-frequency = <0>;
+			status = "disabled";
+		};
+
 		/* External SCIF clock */
 		scif_clk: scif {
 			compatible = "fixed-clock";
@@ -858,10 +874,11 @@
 			compatible = "renesas,r8a7794-cpg-clocks",
 				     "renesas,rcar-gen2-cpg-clocks";
 			reg = <0 0xe6150000 0 0x1000>;
-			clocks = <&extal_clk>;
+			clocks = <&extal_clk &usb_extal_clk>;
 			#clock-cells = <1>;
 			clock-output-names = "main", "pll0", "pll1", "pll3",
-					     "lb", "qspi", "sdh", "sd0", "z";
+					     "lb", "qspi", "sdh", "sd0", "z",
+					     "rcan";
 			#power-domain-cells = <0>;
 		};
 		/* Variable factor clocks */
@@ -1137,20 +1154,22 @@
 			compatible = "renesas,r8a7794-mstp-clocks", "renesas,cpg-mstp-clocks";
 			reg = <0 0xe6150994 0 4>, <0 0xe61509a4 0 4>;
 			clocks = <&cp_clk>, <&cp_clk>, <&cp_clk>, <&cp_clk>,
-				 <&cp_clk>, <&cp_clk>, <&cp_clk>,
-				 <&cpg_clocks R8A7794_CLK_QSPI>, <&hp_clk>, <&hp_clk>,
-				 <&hp_clk>, <&hp_clk>, <&hp_clk>, <&hp_clk>;
+				 <&cp_clk>, <&cp_clk>, <&cp_clk>, <&p_clk>,
+				 <&p_clk>, <&cpg_clocks R8A7794_CLK_QSPI>,
+				 <&hp_clk>, <&hp_clk>, <&hp_clk>, <&hp_clk>,
+				 <&hp_clk>, <&hp_clk>;
 			#clock-cells = <1>;
 			clock-indices = <R8A7794_CLK_GPIO6 R8A7794_CLK_GPIO5
 					 R8A7794_CLK_GPIO4 R8A7794_CLK_GPIO3
 					 R8A7794_CLK_GPIO2 R8A7794_CLK_GPIO1
-					 R8A7794_CLK_GPIO0 R8A7794_CLK_QSPI_MOD
+					 R8A7794_CLK_GPIO0 R8A7794_CLK_RCAN1
+					 R8A7794_CLK_RCAN0 R8A7794_CLK_QSPI_MOD
 					 R8A7794_CLK_I2C5 R8A7794_CLK_I2C4
 					 R8A7794_CLK_I2C3 R8A7794_CLK_I2C2
 					 R8A7794_CLK_I2C1 R8A7794_CLK_I2C0>;
 			clock-output-names =
 				"gpio6", "gpio5", "gpio4", "gpio3", "gpio2",
-				"gpio1", "gpio0", "qspi_mod",
+				"gpio1", "gpio0", "rcan1", "rcan0", "qspi_mod",
 				"i2c5", "i2c4", "i2c3", "i2c2", "i2c1", "i2c0";
 		};
 		mstp11_clks: mstp11_clks at e615099c {
include/dt-bindings/clock/r8a7794-clock.h +3 -0
index f843de6bf377..9703fbdb81c8 100644
@@ -21,6 +21,7 @@
 #define R8A7794_CLK_SDH			6
 #define R8A7794_CLK_SD0			7
 #define R8A7794_CLK_Z			8
+#define R8A7794_CLK_RCAN		9
 
 /* MSTP0 */
 #define R8A7794_CLK_MSIOF0		0
@@ -95,6 +96,8 @@
 #define R8A7794_CLK_GPIO2		10
 #define R8A7794_CLK_GPIO1		11
 #define R8A7794_CLK_GPIO0		12
+#define R8A7794_CLK_RCAN1		15
+#define R8A7794_CLK_RCAN0		16
 #define R8A7794_CLK_QSPI_MOD		17
 #define R8A7794_CLK_I2C5		25
 #define R8A7794_CLK_I2C4		27
Signature · 1 line
2.1.4
#2 lore raw

PATCH v2 1/2 ARM: dts: r8a7794: add CAN clocks to device tree

Quoted 5 lines · Simon Horman

Add CAN nodes to r8a7794 device tree.
Based on work by Sergei Shtylyov for the r8a7791 SoC.

Cc Sergei Shtylyov <[email protected]>

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

#3 lore raw

PATCH v2 2/2 ARM: dts: r8a7794: add CAN nodes to device tree

In reply to Simon Horman

Add CAN nodes to r8a7794 device tree.

Based on work by Sergei Shtylyov for the r8a7791 SoC.

---
v2
* Added Reviewed-by from Geert Uytterhoeven

---
 arch/arm/boot/dts/r8a7794.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm/boot/dts/r8a7794.dtsi +22 -0
index e7a3c792c97c..97181b228aa3 100644
@@ -830,6 +830,28 @@
 		};
 	};
 
+	can0: can at e6e80000 {
+		compatible = "renesas,can-r8a7794", "renesas,rcar-gen2-can";
+		reg = <0 0xe6e80000 0 0x1000>;
+		interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7794_CLK_RCAN0>,
+			 <&cpg_clocks R8A7794_CLK_RCAN>, <&can_clk>;
+		clock-names = "clkp1", "clkp2", "can_clk";
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	can1: can at e6e88000 {
+		compatible = "renesas,can-r8a7794", "renesas,rcar-gen2-can";
+		reg = <0 0xe6e88000 0 0x1000>;
+		interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7794_CLK_RCAN1>,
+			 <&cpg_clocks R8A7794_CLK_RCAN>, <&can_clk>;
+		clock-names = "clkp1", "clkp2", "can_clk";
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
 	clocks {
 		#address-cells = <2>;
 		#size-cells = <2>;
Signature · 1 line
2.1.4
#4 lore raw

v2 cover ARM: dts: r8a7793: add CAN to device tree

In reply to Simon Horman

Hi Simon,

Quoted 1 line

Subject: [PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree

r8a7794?

Quoted 13 lines

Hi,

this short series adds CAN clocks and nodes to the r8a7794 device tree.

I am not aware of an r8a7794 board that exposes CAN - neither the alt nor the silk board appear to - and thus am unsure of a way to test these changes. However, they are based on what is present for the r8a7791 SoC and I am unable to find a difference in the SoC documentation.

This series is similar to a similar series I posted for the r8a7794 in January.

Quoted 6 lines

Based on renesas-devel-20160311-v4.5-rc7.

Changes in v2
* Correct clock node names
* Add MSTP9 clocks
* Omit clock-output-names property from new nodes

for this series.

Thanks,
Ramesh

#5 lore raw

v2 cover ARM: dts: r8a7793: add CAN to device tree

Quoted 5 lines · Ramesh Shanmugasundaram

Hi Simon,

Quoted 1 line

Subject: [PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree

r8a7794?

Yes, my bad.

Quoted 15 lines
Quoted 15 lines

Hi,

this short series adds CAN clocks and nodes to the r8a7794 device tree.

I am not aware of an r8a7794 board that exposes CAN - neither the alt nor the silk board appear to - and thus am unsure of a way to test these changes. However, they are based on what is present for the r8a7791 SoC and I am unable to find a difference in the SoC documentation.

This series is similar to a similar series I posted for the r8a7794 in January.

Based on renesas-devel-20160311-v4.5-rc7.

Quoted 8 lines
Quoted 4 lines

Changes in v2
* Correct clock node names
* Add MSTP9 clocks
* Omit clock-output-names property from new nodes

for this series.

Thanks

#6 lore raw

v2 cover ARM: dts: r8a7793: add CAN to device tree

Quoted 29 lines · Simon Horman
Quoted 5 lines · Ramesh Shanmugasundaram

Hi Simon,

Quoted 1 line

Subject: [PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree

r8a7794?

Yes, my bad.

Quoted 20 lines
Quoted 19 lines

Hi,

this short series adds CAN clocks and nodes to the r8a7794 device tree.

I am not aware of an r8a7794 board that exposes CAN - neither the alt nor the silk board appear to - and thus am unsure of a way to test these changes. However, they are based on what is present for the r8a7791 SoC and I am unable to find a difference in the SoC documentation.

This series is similar to a similar series I posted for the r8a7794 in January.

Based on renesas-devel-20160311-v4.5-rc7.

Changes in v2
* Correct clock node names
* Add MSTP9 clocks
* Omit clock-output-names property from new nodes

Quoted 5 lines
Quoted 3 lines

for this series.

Thanks

I have gone ahead and queued up this series.