Skip to contentSkip to conversation

Add support for Sonoff iHost RV1126 Smart Home Gateway

PATCH Superseded Tim Lunn 6 participants 33 messages Nov 22, 2023 – Dec 12, 2023

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tim Lunn

author
#0 lore raw

v2 cover Add support for Sonoff iHost RV1126 Smart Home Gateway

Sonoff iHost is gateway device designed to provide a Smart Home Hub, most notably it includes builtin radios for Wifi, BT and Zigbee, which make it suitable SBC for use with many of the open home automation platforms. It is availabe in two versions, first is based on Rockchip RV1126 and 4GB DDR4 RAM. There is a second version based off the RV1109 dual core SoC and 2GB RAM.

Features:
- Rockchip RV1126 (or RV1109)
- 4GB DDR4
- 8GB eMMC
- microSD slot
- RMII Ethernet PHY
- 1x USB 2.0 Host
- 1x USB 2.0 OTG
- Realtek RTL8723DS WiFi/BT
- EFR32MG21 Silabs Zigbee radio
- Speaker/Microphone

This patch series adds the various device tree nodes required to support this device. It also adds the initial dts for this device, This work was largely based off the device trees for mainline Edgeble Neu2 and downstream Rockchip rv1126-evb-v13 configs. It has been adapted with relevant peripherals and GPIO pins for the iHost.

Implemented in this series are most of the core periperhals including Ethernet, Wifi, BT, Zigbee and RTC. Sound and USB will be added in a later series.

Changes in v2:
- i2c: clarify commit message
- Address review comments from Heiko
- Split out rv1109.dtsi to new patch
- Collect Robh Ack for dt-bindings patch

Tim Lunn (9):
ARM: dts: rockchip: rv1126: Add alternate UART pins
ARM: dts: rockchip: rv1126: Serial aliases
i2c: rk3x: Adjust offset for i2c2 on rv1126
ARM: dts: rockchip: rv1126: Add i2c2 nodes
ARM: dts: rockchip: rv1126: Split up rgmii1 pinctrl
ARM: dts: rockchip: rv1126: Add ethernet alias
ARM: dts: rockchip: Add rv1109 SoC
ARM: dts: Add Sonoff iHost Smart Home Hub
dt-bindings: arm: rockchip: Add Sonoff iHost

 .../devicetree/bindings/arm/rockchip.yaml     |   7 +
 arch/arm/boot/dts/rockchip/Makefile           |   2 +
 .../boot/dts/rockchip/rv1109-sonoff-ihost.dts |  13 +
 arch/arm/boot/dts/rockchip/rv1109.dtsi        |  23 +
 .../dts/rockchip/rv1126-edgeble-neu2-io.dts   |   2 +-
 .../arm/boot/dts/rockchip/rv1126-pinctrl.dtsi |  72 +++-
 .../boot/dts/rockchip/rv1126-sonoff-ihost.dts |  13 +
 .../dts/rockchip/rv1126-sonoff-ihost.dtsi     | 407 ++++++++++++++++++
 arch/arm/boot/dts/rockchip/rv1126.dtsi        |  21 +
 drivers/i2c/busses/i2c-rk3x.c                 |   7 +-
 10 files changed, 551 insertions(+), 16 deletions(-)
 create mode 100644 arch/arm/boot/dts/rockchip/rv1109-sonoff-ihost.dts
 create mode 100644 arch/arm/boot/dts/rockchip/rv1109.dtsi
 create mode 100644 arch/arm/boot/dts/rockchip/rv1126-sonoff-ihost.dts
 create mode 100644 arch/arm/boot/dts/rockchip/rv1126-sonoff-ihost.dtsi
Signature · 1 line
2.40.1
author
#1 lore raw

PATCH v2 1/9 ARM: dts: rockchip: rv1126: Add alternate UART pins

Add uart3m2_xfer and uart4m2_xfer pins for Rockchip RV1126. These are used as serial ports for the indicator and Zigbee radio on the iHost.

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +16 -0
index bb34b0c9cb4a..4f85b7b3fc4c 100644
@@ -263,6 +263,14 @@ uart3m0_xfer: uart3m0-xfer {
 				/* uart3_tx_m0 */
 				<3 RK_PC6 4 &pcfg_pull_up>;
 		};
+		/omit-if-no-ref/
+		uart3m2_xfer: uart3m2-xfer {
+			rockchip,pins =
+				/* uart3_rx_m2 */
+				<3 RK_PA1 4 &pcfg_pull_up>,
+				/* uart3_tx_m2 */
+				<3 RK_PA0 4 &pcfg_pull_up>;
+		};
 	};
 	uart4 {
 		/omit-if-no-ref/
@@ -273,6 +281,14 @@ uart4m0_xfer: uart4m0-xfer {
 				/* uart4_tx_m0 */
 				<3 RK_PA4 4 &pcfg_pull_up>;
 		};
+		/omit-if-no-ref/
+		uart4m2_xfer: uart4m2-xfer {
+			rockchip,pins =
+				/* uart4_rx_m2 */
+				<1 RK_PD4 3 &pcfg_pull_up>,
+				/* uart4_tx_m2 */
+				<1 RK_PD5 3 &pcfg_pull_up>;
+		};
 	};
 	uart5 {
 		/omit-if-no-ref/
Signature · 1 line
2.40.1
author
#2 lore raw

PATCH v2 2/9 ARM: dts: rockchip: rv1126: Serial aliases

In reply to Tim Lunn

Add serial aliases for uart nodes so that serial devices are created

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rv1126.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/rockchip/rv1126.dtsi +5 -0
index 9ccd1bad6229..6c5c928f06c7 100644
@@ -21,6 +21,11 @@ / {
 
 	aliases {
 		i2c0 = &i2c0;
+		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	cpus {
Signature · 1 line
2.40.1
#3 lore raw

Re: [PATCH v2 2/9] ARM: dts: rockchip: rv1126: Serial aliases

Quoted 1 line · Tim Lunn

Add serial aliases for uart nodes so that serial devices are created

Why?

Aliases are per-board, not per DTSI.

Best regards,
Krzysztof

author
#4 lore raw

PATCH v2 3/9 i2c: rk3x: Adjust offset for i2c2 on rv1126

In reply to Tim Lunn

Rockchip RV1126 has special case mask bits for i2c2.

i2c2 wasnt previously enabled in rv1126.dtsi, adding DT node alone is not sufficient to enable i2c2. This patch fixes the i2c2 bus.

---

Changes in v2:
- i2c: clarify commit message

 drivers/i2c/busses/i2c-rk3x.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +5 -2
index a044ca0c35a1..151927466d1d 100644
@@ -1288,8 +1288,11 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
 			return -EINVAL;
 		}
 
-		/* 27+i: write mask, 11+i: value */
-		value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
+		if (i2c->soc_data == &rv1126_soc_data && bus_nr == 2)
+			value = BIT(20) | BIT(4);
+		else
+			/* 27+i: write mask, 11+i: value */
+			value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
 
 		ret = regmap_write(grf, i2c->soc_data->grf_offset, value);
 		if (ret != 0) {
Signature · 1 line
2.40.1
maintainer
#5 lore raw

Re: [PATCH v2 3/9] i2c: rk3x: Adjust offset for i2c2 on rv1126

Hi Tim,

Quoted 4 lines · Tim Lunn

Rockchip RV1126 has special case mask bits for i2c2.

i2c2 wasnt previously enabled in rv1126.dtsi, adding DT node alone is not sufficient to enable i2c2. This patch fixes the i2c2 bus.

If I don't have sufficient information about the hardware this description is completely meaningless to me.

Quoted 14 lines

---

Changes in v2:
- i2c: clarify commit message

 drivers/i2c/busses/i2c-rk3x.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +0 -0
index a044ca0c35a1..151927466d1d 100644

drivers/i2c/busses/i2c-rk3x.c static int rk3x_i2c_probe(struct platform_device *pdev) · line 1292

Quoted 7 lines
drivers/i2c/busses/i2c-rk3x.c +2 -2
@@ -1288,8 +1288,11 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
 			return -EINVAL;
 		}
 
-		/* 27+i: write mask, 11+i: value */
-		value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
+		if (i2c->soc_data == &rv1126_soc_data && bus_nr == 2)
+			value = BIT(20) | BIT(4);

Any chance to put a comment here as it is in the other assignment?

Are the two assignment mutually exclusive?

Heiko, any chance to take a look here?

Thanks,
Andi

Quoted 9 lines
drivers/i2c/busses/i2c-rk3x.c +3 -0
+		else
+			/* 27+i: write mask, 11+i: value */
+			value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
 
 		ret = regmap_write(grf, i2c->soc_data->grf_offset, value);
 		if (ret != 0) {
Signature · 1 line
2.40.1
maintainer Acked-by
#6 lore raw

Re: [PATCH v2 3/9] i2c: rk3x: Adjust offset for i2c2 on rv1126

Hi Andi,

Am Sonntag, 26. November 2023, 20:43:11 CET schrieb Andi Shyti:

Quoted 36 lines

Hi Tim,

Quoted 4 lines · Tim Lunn

Rockchip RV1126 has special case mask bits for i2c2.

i2c2 wasnt previously enabled in rv1126.dtsi, adding DT node alone is not sufficient to enable i2c2. This patch fixes the i2c2 bus.

If I don't have sufficient information about the hardware this description is completely meaningless to me.

Quoted 14 lines

---

Changes in v2:
- i2c: clarify commit message

 drivers/i2c/busses/i2c-rk3x.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +0 -0
index a044ca0c35a1..151927466d1d 100644

drivers/i2c/busses/i2c-rk3x.c static int rk3x_i2c_probe(struct platform_device *pdev) · line 1292

Quoted 7 lines
drivers/i2c/busses/i2c-rk3x.c +2 -2
@@ -1288,8 +1288,11 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
 			return -EINVAL;
 		}
 
-		/* 27+i: write mask, 11+i: value */
-		value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
+		if (i2c->soc_data == &rv1126_soc_data && bus_nr == 2)
+			value = BIT(20) | BIT(4);

Any chance to put a comment here as it is in the other assignment?

Quoted 3 lines

Are the two assignment mutually exclusive?

Heiko, any chance to take a look here?

So the background is, that on some SoCs Rockchip implemented to different variants for the i2c controller. One new-style controller that they started using in rk3066 and are using even today.

For these old socs they kept the "old" controller block as a sort of fallback if the new thing didn't work out, and the bit above is switching between the

Hence that is limited to rk3066, rk3188 and seemingly the rv1126. And while the bits controlling the i2c controllers on the original socs are order sequentially in the grf register, the rv1126 seems to have those bits in non-consequtive places.

So TL;DR the change itself is likely good, and hopefully there won't be any more of those, as all the new socs don't need this anymore.

I do agree with the request for a comment describing the issue in the code, but otherwise

author
#7 lore raw

Re: [PATCH v2 3/9] i2c: rk3x: Adjust offset for i2c2 on rv1126

Quoted 38 lines · Heiko Stübner

Hi Andi,

Am Sonntag, 26. November 2023, 20:43:11 CET schrieb Andi Shyti:

Quoted 35 lines

Hi Tim,

Quoted 4 lines · Tim Lunn

Rockchip RV1126 has special case mask bits for i2c2.

i2c2 wasnt previously enabled in rv1126.dtsi, adding DT node alone is not sufficient to enable i2c2. This patch fixes the i2c2 bus.

If I don't have sufficient information about the hardware this description is completely meaningless to me.

Quoted 14 lines

---

Changes in v2:
- i2c: clarify commit message

  drivers/i2c/busses/i2c-rk3x.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +0 -0
index a044ca0c35a1..151927466d1d 100644

drivers/i2c/busses/i2c-rk3x.c static int rk3x_i2c_probe(struct platform_device *pdev) · line 1292

Quoted 7 lines
drivers/i2c/busses/i2c-rk3x.c +2 -2
@@ -1288,8 +1288,11 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
  			return -EINVAL;
  		}
 
-		/* 27+i: write mask, 11+i: value */
-		value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
+		if (i2c->soc_data == &rv1126_soc_data && bus_nr == 2)
+			value = BIT(20) | BIT(4);

Any chance to put a comment here as it is in the other assignment?

Are the two assignment mutually exclusive?

Yes they are mutually exclusive, and its only i2c2 that is non-sequential (as per Heikos description below).

Quoted 10 lines
Quoted 2 lines

Heiko, any chance to take a look here?

So the background is, that on some SoCs Rockchip implemented to different variants for the i2c controller. One new-style controller that they started using in rk3066 and are using even today.

For these old socs they kept the "old" controller block as a sort of fallback if the new thing didn't work out, and the bit above is switching between the

Quoted 8 lines

Hence that is limited to rk3066, rk3188 and seemingly the rv1126. And while the bits controlling the i2c controllers on the original socs are order sequentially in the grf register, the rv1126 seems to have those bits in non-consequtive places.

So TL;DR the change itself is likely good, and hopefully there won't be any more of those, as all the new socs don't need this anymore.

rv1108 is also similar but different bits again (only going off the BSP sources). I dont have hardware or the TRM to validate this on rv1108.

Quoted 3 lines

I do agree with the request for a comment describing the issue in the code, but otherwise

I will fix this.

Quoted 3 lines
maintainer
#8 lore raw

Re: [PATCH v2 3/9] i2c: rk3x: Adjust offset for i2c2 on rv1126

Hi Heiko and Tim,

Quoted 54 lines · Tim Lunn
Quoted 33 lines · Heiko Stübner

Am Sonntag, 26. November 2023, 20:43:11 CET schrieb Andi Shyti:

Quoted 32 lines · Tim Lunn
Quoted 4 lines

Rockchip RV1126 has special case mask bits for i2c2.

i2c2 wasnt previously enabled in rv1126.dtsi, adding DT node alone is not sufficient to enable i2c2. This patch fixes the i2c2 bus.

If I don't have sufficient information about the hardware this description is completely meaningless to me.

Quoted 14 lines

---

Changes in v2:
- i2c: clarify commit message

  drivers/i2c/busses/i2c-rk3x.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +0 -0
index a044ca0c35a1..151927466d1d 100644

drivers/i2c/busses/i2c-rk3x.c static int rk3x_i2c_probe(struct platform_device *pdev) · line 1291

Quoted 6 lines
drivers/i2c/busses/i2c-rk3x.c +2 -2
@@ -1288,8 +1288,11 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
  			return -EINVAL;
  		}
-		/* 27+i: write mask, 11+i: value */
-		value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
+		if (i2c->soc_data == &rv1126_soc_data && bus_nr == 2)
+			value = BIT(20) | BIT(4);

Any chance to put a comment here as it is in the other assignment?

Are the two assignment mutually exclusive?

Yes they are mutually exclusive, and its only i2c2 that is non-sequential (as per Heikos description below).

Quoted 10 lines
Quoted 2 lines

Heiko, any chance to take a look here?

So the background is, that on some SoCs Rockchip implemented to different variants for the i2c controller. One new-style controller that they started using in rk3066 and are using even today.

For these old socs they kept the "old" controller block as a sort of fallback if the new thing didn't work out, and the bit above is switching between the

Quoted 8 lines

Hence that is limited to rk3066, rk3188 and seemingly the rv1126. And while the bits controlling the i2c controllers on the original socs are order sequentially in the grf register, the rv1126 seems to have those bits in non-consequtive places.

So TL;DR the change itself is likely good, and hopefully there won't be any more of those, as all the new socs don't need this anymore.

Quoted 10 lines

rv1108 is also similar but different bits again (only going off the BSP sources).
I dont have hardware or the TRM to validate this on rv1108.

Quoted 3 lines

I do agree with the request for a comment describing the issue in the code, but otherwise

I will fix this.

Quoted 1 line

Thanks for your ack and answer. Will wait, then for Tim's v2.

Andi

author
#9 lore raw

PATCH v2 4/9 ARM: dts: rockchip: rv1126: Add i2c2 nodes

In reply to Tim Lunn

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
 arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
 2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
 				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
 		};
 	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
 	pwm2 {
 		/omit-if-no-ref/
 		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +15 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
 	aliases {
 		i2c0 = &i2c0;
+		i2c2 = &i2c2;
 		serial0 = &uart0;
 		serial1 = &uart1;
 		serial2 = &uart2;
@@ -236,6 +237,20 @@ i2c0: i2c@ff3f0000 {
 		status = "disabled";
 	};
 
+	i2c2: i2c@ff400000 {
+		compatible = "rockchip,rv1126-i2c", "rockchip,rk3399-i2c";
+		reg = <0xff400000 0x1000>;
+		interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+		rockchip,grf = <&pmugrf>;
+		clocks = <&pmucru CLK_I2C2>, <&pmucru PCLK_I2C2>;
+		clock-names = "i2c", "pclk";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2c2_xfer>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
 	uart1: serial@ff410000 {
 		compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart";
 		reg = <0xff410000 0x100>;
Signature · 1 line
2.40.1
#10 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Quoted 37 lines · Tim Lunn

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
 arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
 2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
 				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
 		};
 	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
 	pwm2 {
 		/omit-if-no-ref/
 		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 4 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
@@ -21,6 +21,7 @@ / {
 
 	aliases {
 		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

Best regards,
Krzysztof

author
#11 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Hi Krzysztof

Quoted 39 lines · Krzysztof Kozlowski
Quoted 38 lines · Tim Lunn

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

  arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
  arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
  2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
  				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
  		};
  	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
  	pwm2 {
  		/omit-if-no-ref/
  		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 5 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
  	aliases {
  		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

I was just following what seemed to be done in some other Rockchip <SoC>.dtsi files. I will move this alias and the other ones for serial and ethernet into the board file instead then.

Regards
  Tim

Quoted 4 lines

Best regards,
Krzysztof

maintainer
#12 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

In reply to Krzysztof Kozlowski

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
 arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
 2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
 				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
 		};
 	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
 	pwm2 {
 		/omit-if-no-ref/
 		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 5 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
 	aliases {
 		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

Heiko

#13 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Quoted 48 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
 arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
 2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
 				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
 		};
 	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
 	pwm2 {
 		/omit-if-no-ref/
 		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 5 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
 	aliases {
 		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

Quoted 8 lines

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

If you do not list here all aliases, it is already board-specific, isn't it?

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

Best regards,
Krzysztof

author
#14 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Hi

Quoted 52 lines · Krzysztof Kozlowski
Quoted 51 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

  arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
  arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
  2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
  				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
  		};
  	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
  	pwm2 {
  		/omit-if-no-ref/
  		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 4 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
  	aliases {
  		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

Quoted 6 lines
Quoted 3 lines

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

If you do not list here all aliases, it is already board-specific, isn't it?

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

I had only added aliases for nodes that are implemented. RV1126 has 6 i2c busses but so far not all these exist in the soc.dtsi.

Regards
   Tim

Quoted 3 lines

Best regards,
Krzysztof

#15 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Quoted 55 lines · Tim Lunn

Hi

Quoted 52 lines · Krzysztof Kozlowski
Quoted 51 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

  arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
  arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
  2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
  				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
  		};
  	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
  	pwm2 {
  		/omit-if-no-ref/
  		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 4 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
  	aliases {
  		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

If you do not list here all aliases, it is already board-specific, isn't it?

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

I had only added aliases for nodes that are implemented. RV1126 has 6 i2c busses but so far not all these exist in the soc.dtsi.

OK, that would explain why you have only two. Anyway, it is just generic guideline, so up to Heiko what to do with it.

Best regards,
Krzysztof

maintainer
#16 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Am Montag, 27. November 2023, 10:27:41 CET schrieb Krzysztof Kozlowski:

Quoted 61 lines · Tim Lunn
Quoted 60 lines

Hi

Quoted 57 lines · Krzysztof Kozlowski
Quoted 46 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

  arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
  arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
  2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
  				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
  		};
  	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
  	pwm2 {
  		/omit-if-no-ref/
  		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 4 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
  	aliases {
  		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

Quoted 8 lines

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

If you do not list here all aliases, it is already board-specific, isn't it?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

I had only added aliases for nodes that are implemented. RV1126 has 6 i2c busses but so far not all these exist in the soc.dtsi.

OK, that would explain why you have only two. Anyway, it is just generic guideline, so up to Heiko what to do with it.

People see "uart2-tx" on their pin-header description and then of course want to use ttyS2 ... same with reading i2c2-sda on the pin-header and then running i2cdetect on said i2c2 dev node.

And even if i2c1 is not populated (would even be very rare), then people would still expect i2c2 to be named that way.

As this is the same for _every_ board, it doesn't really make sense to duplicate it every time. Which I guess is similar to what I wrote in reply to the mail you linked above :-) .

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

Thanks
Heiko

author
#17 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Quoted 72 lines · Heiko Stübner

Am Montag, 27. November 2023, 10:27:41 CET schrieb Krzysztof Kozlowski:

Quoted 59 lines · Tim Lunn
Quoted 58 lines

Hi

Quoted 55 lines · Krzysztof Kozlowski
Quoted 54 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

   arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
   arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
   2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
   				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
   		};
   	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
   	pwm2 {
   		/omit-if-no-ref/
   		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 4 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
   	aliases {
   		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

If you do not list here all aliases, it is already board-specific, isn't it?

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

I had only added aliases for nodes that are implemented. RV1126 has 6 i2c busses but so far not all these exist in the soc.dtsi.

OK, that would explain why you have only two. Anyway, it is just generic guideline, so up to Heiko what to do with it.

People see "uart2-tx" on their pin-header description and then of course want to use ttyS2 ... same with reading i2c2-sda on the pin-header and then running i2cdetect on said i2c2 dev node.

Quoted 6 lines

And even if i2c1 is not populated (would even be very rare), then people would still expect i2c2 to be named that way.

As this is the same for _every_ board, it doesn't really make sense to duplicate it every time. Which I guess is similar to what I wrote in reply to the mail you linked above :-) .

So I will leave the i2c and serial aliases as they are in rv1126.dtsi then?

Quoted 3 lines

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

What about the ethernet alias,   the MAC is part of the SoC, should this stay as it is in patch 6 from this series, or move to board dtsi?

Regards
  Tim

maintainer
#18 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Am Montag, 27. November 2023, 10:58:43 CET schrieb Tim Lunn:

Quoted 74 lines · Heiko Stübner
Quoted 72 lines

Am Montag, 27. November 2023, 10:27:41 CET schrieb Krzysztof Kozlowski:

Quoted 59 lines · Tim Lunn
Quoted 58 lines

Hi

Quoted 55 lines · Krzysztof Kozlowski
Quoted 54 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

   arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
   arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
   2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
   				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
   		};
   	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
   	pwm2 {
   		/omit-if-no-ref/
   		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 4 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
   	aliases {
   		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

If you do not list here all aliases, it is already board-specific, isn't it?

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

I had only added aliases for nodes that are implemented. RV1126 has 6 i2c busses but so far not all these exist in the soc.dtsi.

OK, that would explain why you have only two. Anyway, it is just generic guideline, so up to Heiko what to do with it.

People see "uart2-tx" on their pin-header description and then of course want to use ttyS2 ... same with reading i2c2-sda on the pin-header and then running i2cdetect on said i2c2 dev node.

Quoted 7 lines
Quoted 6 lines

And even if i2c1 is not populated (would even be very rare), then people would still expect i2c2 to be named that way.

As this is the same for _every_ board, it doesn't really make sense to duplicate it every time. Which I guess is similar to what I wrote in reply to the mail you linked above :-) .

So I will leave the i2c and serial aliases as they are in rv1126.dtsi then?

correct

Quoted 6 lines
Quoted 2 lines

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

What about the ethernet alias, the MAC is part of the SoC, should this
stay as it is
in patch 6 from this series, or move to board dtsi?

I think judging from everything above (and the other modern boards like all rk3588 ones) the ethernet0 alias should move to the board dts(i).

The gmac generally does not have this numbering scheme like i2c or uarts.

Heiko

#19 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Quoted 5 lines · Heiko Stübner

Am Montag, 27. November 2023, 10:58:43 CET schrieb Tim Lunn:

Quoted 4 lines · Heiko Stübner
Quoted 2 lines

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

Quoted 7 lines
Quoted 2 lines

What about the ethernet alias, the MAC is part of the SoC, should this stay as it is in patch 6 from this series, or move to board dtsi?

I think judging from everything above (and the other modern boards like all rk3588 ones) the ethernet0 alias should move to the board dts(i).

The gmac generally does not have this numbering scheme like i2c or uarts.

Please note there's already an Ethernet alias defined in rk3399.dtsi, even despite not all RK3399-based devices using the GMAC, for example the Pinebook Pro. Perhaps that's something to be fixed as well.

maintainer
#20 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Am Montag, 27. November 2023, 11:43:05 CET schrieb Dragan Simic:

Quoted 14 lines · Heiko Stübner
Quoted 13 lines

Am Montag, 27. November 2023, 10:58:43 CET schrieb Tim Lunn:

Quoted 7 lines · Heiko Stübner
Quoted 3 lines

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

What about the ethernet alias, the MAC is part of the SoC, should this stay as it is in patch 6 from this series, or move to board dtsi?

I think judging from everything above (and the other modern boards like all rk3588 ones) the ethernet0 alias should move to the board dts(i).

Quoted 6 lines
Quoted 2 lines

The gmac generally does not have this numbering scheme like i2c or uarts.

Please note there's already an Ethernet alias defined in rk3399.dtsi, even despite not all RK3399-based devices using the GMAC, for example the Pinebook Pro. Perhaps that's something to be fixed as well.

possibly :-)

I guess for starters we shouldn't introduce new instances for it.

All the newer SoCs already have their ethernet alias in the board dts (rk356x, rk3568) which came after we also moved the mmc aliases.

Heiko

#21 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Quoted 18 lines · Heiko Stübner

Am Montag, 27. November 2023, 11:43:05 CET schrieb Dragan Simic:

Quoted 17 lines · Heiko Stübner
Quoted 15 lines

Am Montag, 27. November 2023, 10:58:43 CET schrieb Tim Lunn:

Quoted 7 lines · Heiko Stübner
Quoted 3 lines

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

What about the ethernet alias, the MAC is part of the SoC, should this stay as it is in patch 6 from this series, or move to board dtsi?

I think judging from everything above (and the other modern boards like all rk3588 ones) the ethernet0 alias should move to the board dts(i).

The gmac generally does not have this numbering scheme like i2c or uarts.

Quoted 7 lines
Quoted 3 lines

Please note there's already an Ethernet alias defined in rk3399.dtsi, even despite not all RK3399-based devices using the GMAC, for example the Pinebook Pro. Perhaps that's something to be fixed as well.

possibly :-)

I guess for starters we shouldn't introduce new instances for it.

Totally agreed.

Quoted 2 lines

All the newer SoCs already have their ethernet alias in the board dts (rk356x, rk3568) which came after we also moved the mmc aliases.

The base rk3399.dtsi file and the RK3399-based board/device dts(i) files are fine when it comes to the mmc aliases. I can move forward and clean up the Ethernet alias as well, if you agree?

maintainer
#22 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Am Montag, 27. November 2023, 11:55:21 CET schrieb Dragan Simic:

Quoted 27 lines · Heiko Stübner
Quoted 18 lines

Am Montag, 27. November 2023, 11:43:05 CET schrieb Dragan Simic:

Quoted 17 lines · Heiko Stübner
Quoted 15 lines

Am Montag, 27. November 2023, 10:58:43 CET schrieb Tim Lunn:

Quoted 7 lines · Heiko Stübner
Quoted 3 lines

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

What about the ethernet alias, the MAC is part of the SoC, should this stay as it is in patch 6 from this series, or move to board dtsi?

I think judging from everything above (and the other modern boards like all rk3588 ones) the ethernet0 alias should move to the board dts(i).

The gmac generally does not have this numbering scheme like i2c or uarts.

Quoted 7 lines
Quoted 3 lines

Please note there's already an Ethernet alias defined in rk3399.dtsi, even despite not all RK3399-based devices using the GMAC, for example the Pinebook Pro. Perhaps that's something to be fixed as well.

possibly :-)

I guess for starters we shouldn't introduce new instances for it.

Quoted 8 lines

Totally agreed.

Quoted 2 lines

All the newer SoCs already have their ethernet alias in the board dts (rk356x, rk3568) which came after we also moved the mmc aliases.

The base rk3399.dtsi file and the RK3399-based board/device dts(i) files are fine when it comes to the mmc aliases. I can move forward and clean up the Ethernet alias as well, if you agree?

Yep, we moved mmc aliases a while ago.

So moving the ethernet sounds like the right way forward. So if you have the time for it, then I'd be quite happy to take patches for that change.

Thanks
Heiko

#23 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Quoted 33 lines · Heiko Stübner

Am Montag, 27. November 2023, 11:55:21 CET schrieb Dragan Simic:

Quoted 32 lines · Heiko Stübner
Quoted 18 lines

Am Montag, 27. November 2023, 11:43:05 CET schrieb Dragan Simic:

Quoted 17 lines · Heiko Stübner
Quoted 15 lines

Am Montag, 27. November 2023, 10:58:43 CET schrieb Tim Lunn:

Quoted 7 lines · Heiko Stübner
Quoted 3 lines

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

What about the ethernet alias, the MAC is part of the SoC, should this stay as it is in patch 6 from this series, or move to board dtsi?

I think judging from everything above (and the other modern boards like all rk3588 ones) the ethernet0 alias should move to the board dts(i).

The gmac generally does not have this numbering scheme like i2c or uarts.

Quoted 7 lines
Quoted 3 lines

Please note there's already an Ethernet alias defined in rk3399.dtsi, even despite not all RK3399-based devices using the GMAC, for example the Pinebook Pro. Perhaps that's something to be fixed as well.

possibly :-)

I guess for starters we shouldn't introduce new instances for it.

Totally agreed.

Quoted 2 lines

All the newer SoCs already have their ethernet alias in the board dts (rk356x, rk3568) which came after we also moved the mmc aliases.

Quoted 8 lines
Quoted 3 lines

The base rk3399.dtsi file and the RK3399-based board/device dts(i) files are fine when it comes to the mmc aliases. I can move forward and clean up the Ethernet alias as well, if you agree?

Yep, we moved mmc aliases a while ago.

So moving the ethernet sounds like the right way forward. So if you have the time for it, then I'd be quite happy to take patches for that change.

Great, thanks. I'll prepare the patches in the next couple of days, and send them over.

#24 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Quoted 21 lines · Dragan Simic
Quoted 20 lines · Heiko Stübner

Am Montag, 27. November 2023, 11:55:21 CET schrieb Dragan Simic:

Quoted 18 lines · Heiko Stübner
Quoted 8 lines

Am Montag, 27. November 2023, 11:43:05 CET schrieb Dragan Simic:

Quoted 3 lines

Please note there's already an Ethernet alias defined in rk3399.dtsi, even despite not all RK3399-based devices using the GMAC, for example the Pinebook Pro. Perhaps that's something to be fixed as well.

possibly :-)

I guess for starters we shouldn't introduce new instances for it.

Totally agreed.

Quoted 2 lines

All the newer SoCs already have their ethernet alias in the board dts (rk356x, rk3568) which came after we also moved the mmc aliases.

The base rk3399.dtsi file and the RK3399-based board/device dts(i) files are fine when it comes to the mmc aliases. I can move forward and clean up the Ethernet alias as well, if you agree?

Quoted 7 lines
Quoted 4 lines

Yep, we moved mmc aliases a while ago.

So moving the ethernet sounds like the right way forward. So if you have the time for it, then I'd be quite happy to take patches for that change.

Great, thanks. I'll prepare the patches in the next couple of days, and send them over.

I apologize for the delay, I finally got around to implementing and verifying these patches for the RK3399, RK3368, RK3328 and PX30 SoC dts(i) files. [1] The way I verified them was to compare the compiled dtb files before and after applying the patches.

Also, I went ahead and implemented the patches that add ethernet aliases to the RK356x and RK3588 dts board files. [2] With these patches in place, together with the other patches that have already been accepted, we should have a rather clean situation when it comes to the Rockchip arm64 DT aliases.

[1] https://lore.kernel.org/linux-rockchip/[email protected]/T/#u
[2] https://lore.kernel.org/linux-rockchip/[email protected]/T/#u

author
#25 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

In reply to Heiko Stübner

Hi Heiko,

Quoted 86 lines · Heiko Stübner

Am Montag, 27. November 2023, 10:58:43 CET schrieb Tim Lunn:

Quoted 73 lines · Heiko Stübner
Quoted 72 lines

Am Montag, 27. November 2023, 10:27:41 CET schrieb Krzysztof Kozlowski:

Quoted 59 lines · Tim Lunn
Quoted 58 lines

Hi

Quoted 55 lines · Krzysztof Kozlowski
Quoted 54 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

    arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
    arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
    2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
    				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
    		};
    	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
    	pwm2 {
    		/omit-if-no-ref/
    		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 4 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
    	aliases {
    		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

If you do not list here all aliases, it is already board-specific, isn't it?

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

I had only added aliases for nodes that are implemented. RV1126 has 6 i2c busses but so far not all these exist in the soc.dtsi.

OK, that would explain why you have only two. Anyway, it is just generic guideline, so up to Heiko what to do with it.

People see "uart2-tx" on their pin-header description and then of course want to use ttyS2 ... same with reading i2c2-sda on the pin-header and then running i2cdetect on said i2c2 dev node.

Quoted 7 lines
Quoted 6 lines

And even if i2c1 is not populated (would even be very rare), then people would still expect i2c2 to be named that way.

As this is the same for _every_ board, it doesn't really make sense to duplicate it every time. Which I guess is similar to what I wrote in reply to the mail you linked above :-) .

So I will leave the i2c and serial aliases as they are in rv1126.dtsi then?

correct

Quoted 2 lines
Quoted 2 lines

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

Quoted 7 lines
Quoted 3 lines

What about the ethernet alias, the MAC is part of the SoC, should this
stay as it is
in patch 6 from this series, or move to board dtsi?

I think judging from everything above (and the other modern boards like all rk3588 ones) the ethernet0 alias should move to the board dts(i).

The gmac generally does not have this numbering scheme like i2c or uarts.

Noted, I will prepare these changes in a v3 series

Regards
   Tim.

#26 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

In reply to Heiko Stübner

Hi Heiko,
Am 27.11.23 um 10:45 schrieb Heiko Stübner:

Quoted 67 lines

Am Montag, 27. November 2023, 10:27:41 CET schrieb Krzysztof Kozlowski:

Quoted 66 lines · Tim Lunn
Quoted 64 lines

Hi

Quoted 52 lines · Krzysztof Kozlowski
Quoted 51 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

   arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
   arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
   2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
   				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
   		};
   	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
   	pwm2 {
   		/omit-if-no-ref/
   		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 4 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
   	aliases {
   		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

Quoted 6 lines
Quoted 3 lines

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

If you do not list here all aliases, it is already board-specific, isn't it?

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

I had only added aliases for nodes that are implemented. RV1126 has 6 i2c busses but so far not all these exist in the soc.dtsi.

Quoted 7 lines
Quoted 2 lines

OK, that would explain why you have only two. Anyway, it is just generic guideline, so up to Heiko what to do with it.

People see "uart2-tx" on their pin-header description and then of course want to use ttyS2 ... same with reading i2c2-sda on the pin-header and then running i2cdetect on said i2c2 dev node.

If that's "the" rule, why was rk3128.dtsi merged after similar complaints came up [0] without having aliases for the core buses defined? It's pretty strange to have to define them on board-level there as well. I'm happy to submit a patch which changes that.

[0] https://lore.kernel.org/all/22076018.EfDdHjke4D@diego/

Regards,
Alex

Quoted 20 lines

And even if i2c1 is not populated (would even be very rare), then people would still expect i2c2 to be named that way.

As this is the same for _every_ board, it doesn't really make sense to duplicate it every time. Which I guess is similar to what I wrote in reply to the mail you linked above :-) .

It's different for mmc, where this naming scheme isn't normally used, so we (mostly?) migrated to them being in the board-specific alias section.

Thanks
Heiko

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

maintainer
#27 lore raw

Re: [PATCH v2 4/9] ARM: dts: rockchip: rv1126: Add i2c2 nodes

Hi Alex,

Am Dienstag, 28. November 2023, 00:11:37 CET schrieb Alex Bee:

Quoted 72 lines

Hi Heiko,
Am 27.11.23 um 10:45 schrieb Heiko Stübner:

Quoted 70 lines

Am Montag, 27. November 2023, 10:27:41 CET schrieb Krzysztof Kozlowski:

Quoted 68 lines · Tim Lunn
Quoted 55 lines

Hi

Quoted 52 lines · Krzysztof Kozlowski
Quoted 51 lines · Heiko Stübner

Hi Krzysztof,

Am Mittwoch, 22. November 2023, 13:29:47 CET schrieb Krzysztof Kozlowski:

Quoted 39 lines · Tim Lunn
Quoted 38 lines

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

(no changes since v1)

   arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 10 ++++++++++
   arch/arm/boot/dts/rockchip/rv1126.dtsi         | 15 +++++++++++++++
   2 files changed, 25 insertions(+)
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +10 -0
index 4f85b7b3fc4c..167a48afa3a4 100644
@@ -87,6 +87,16 @@ i2c0_xfer: i2c0-xfer {
   				<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
   		};
   	};
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2_xfer: i2c2-xfer {
+			rockchip,pins =
+				/* i2c2_scl */
+				<0 RK_PC2 1 &pcfg_pull_none_drv_level_0_smt>,
+				/* i2c2_sda */
+				<0 RK_PC3 1 &pcfg_pull_none_drv_level_0_smt>;
+		};
+	};
   	pwm2 {
   		/omit-if-no-ref/
   		pwm2m0_pins: pwm2m0-pins {
arch/arm/boot/dts/rockchip/rv1126.dtsi +0 -0
index 6c5c928f06c7..cf1df75df418 100644
@@ -21,6 +21,7 @@ / {
 
Quoted 4 lines

arch/arm/boot/dts/rockchip/rv1126.dtsi / { · line 24

Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
   	aliases {
   		i2c0 = &i2c0;
+		i2c2 = &i2c2;

No, this should be per-board to match board labeling/schematics.

At least for i2c, uarts and i.e. spi ... Rockchip manuals, pin namings and also all board schematics I've seen so far are very consistent for these ... i2c2 for example is labled i2c2 both in the pins in the socs and also in the board-schematics using them.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

So while I can agree that things like mmc-aliases might be board-specific, I do think aliases for the core busses should be able to live in the soc dtsi as for all Rockchip SoCs so far?

If you do not list here all aliases, it is already board-specific, isn't it?

https://lore.kernel.org/linux-rockchip/CAK8P3a25iYksubCnQb1-e5yj=crEsK37RB9Hn4ZGZMwcVVrG7g@mail.gmail.com/

I had only added aliases for nodes that are implemented. RV1126 has 6 i2c busses but so far not all these exist in the soc.dtsi.

OK, that would explain why you have only two. Anyway, it is just generic guideline, so up to Heiko what to do with it.

Quoted 7 lines
Quoted 4 lines

People see "uart2-tx" on their pin-header description and then of course want to use ttyS2 ... same with reading i2c2-sda on the pin-header and then running i2cdetect on said i2c2 dev node.

If that's "the" rule, why was rk3128.dtsi merged after similar complaints came up [0] without having aliases for the core buses defined?

probably because it slipped through or so. At least in my argument in the mail you linked I'm consistent to here ;-)

Quoted 4 lines

It's pretty strange to have to define them on board-level there as well.

I'm happy to submit a patch which changes that.

Yep and rk3128 really is the only outlier there, so sure, go ahead with moving the core ones.

Heiko

Quoted 1 line

[0] https://lore.kernel.org/all/22076018.EfDdHjke4D@diego/

author
#28 lore raw

PATCH v2 5/9 ARM: dts: rockchip: rv1126: Split up rgmii1 pinctrl

In reply to Tim Lunn

Split up the pinctrl definitions for rgmii1 so it can be shared with devices using an RMII PHY.

---

(no changes since v1)

 .../dts/rockchip/rv1126-edgeble-neu2-io.dts   |  2 +-
 .../arm/boot/dts/rockchip/rv1126-pinctrl.dtsi | 46 +++++++++++++------
 2 files changed, 34 insertions(+), 14 deletions(-)
arch/arm/boot/dts/rockchip/rv1126-edgeble-neu2-io.dts +1 -1
index f09be8405964..0c2396b8f8db 100644
@@ -61,7 +61,7 @@ &gmac {
 	phy-mode = "rgmii";
 	phy-supply = <&vcc_3v3>;
 	pinctrl-names = "default";
-	pinctrl-0 = <&rgmiim1_pins &clk_out_ethernetm1_pins>;
+	pinctrl-0 = <&rgmiim1_miim &rgmiim1_bus2 &rgmiim1_bus4 &clk_out_ethernetm1_pins>;
 	tx_delay = <0x2a>;
 	rx_delay = <0x1a>;
 	status = "okay";
arch/arm/boot/dts/rockchip/rv1126-pinctrl.dtsi +33 -13

69 lines not on this page · raw message

Signature · 1 line
2.40.1
author
#29 lore raw

PATCH v2 6/9 ARM: dts: rockchip: rv1126: Add ethernet alias

In reply to Tim Lunn

Add alias for ethernet0 to pick up mac address from u-boot/DT

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/rv1126.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/rockchip/rv1126.dtsi +1 -0
index cf1df75df418..bfbd4918e745 100644
@@ -20,6 +20,7 @@ / {
 	interrupt-parent = <&gic>;
 
 	aliases {
+		ethernet0 = &gmac;
 		i2c0 = &i2c0;
 		i2c2 = &i2c2;
 		serial0 = &uart0;
Signature · 1 line
2.40.1
author
#30 lore raw

PATCH v2 7/9 ARM: dts: rockchip: Add rv1109 SoC

In reply to Tim Lunn

The Rockchip rv1109 SoC is a dual core version of the rv1126. It is otherwise identical and shares the same device tree config.

This patch introduces a dtsi file to drop the additional cpu nodes. Taken from Rockchip BSP kernel.

---

Changes in v2:
- new patch

 arch/arm/boot/dts/rockchip/rv1109.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 arch/arm/boot/dts/rockchip/rv1109.dtsi
arch/arm/boot/dts/rockchip/rv1109.dtsi new file +23 -0
new file mode 100644
index 000000000000..9cbaa08ab1b8
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd.
+ */
+
+/dts-v1/;
+
+#include "rv1126.dtsi"
+
+/ {
+	compatible = "rockchip,rv1109";
+
+	cpus {
+		/delete-node/ cpu@f02;
+		/delete-node/ cpu@f03;
+	};
+
+	arm-pmu {
+		interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-affinity = <&cpu0>, <&cpu1>;
+	};
+};
Signature · 1 line
2.40.1
author
#31 lore raw

PATCH v2 8/9 ARM: dts: Add Sonoff iHost Smart Home Hub

In reply to Tim Lunn

Sonoff iHost is gateway device designed to provide a Smart Home Hub, it is based on Rockchip RV1126. There is also a version with 2GB RAM based off the RV1109 dual core SoC.

Features:
- Rockchip RV1126
- 4GB DDR4
- 8GB eMMC
- microSD slot
- RMII Ethernet PHY
- 1x USB 2.0 Host
- 1x USB 2.0 OTG
- Realtek RTL8723DS WiFi/BT
- EFR32MG21 Silabs Zigbee radio
- Speaker/Microphone

This patch adds the initial device tree for this device, it is largely based off the device trees for mainline Edgeble Neu2 and downstream Rockchip rv1126-evb-v13 configs. It has been adapted with relevant peripheral and GPIO pins for the iHost.

---

Changes in v2:
- Address review comments from Heiko
- Split out rv1109.dtsi to new patch

 arch/arm/boot/dts/rockchip/Makefile           |   2 +
 .../boot/dts/rockchip/rv1109-sonoff-ihost.dts |  13 +
 .../boot/dts/rockchip/rv1126-sonoff-ihost.dts |  13 +
 .../dts/rockchip/rv1126-sonoff-ihost.dtsi     | 407 ++++++++++++++++++
 4 files changed, 435 insertions(+)
 create mode 100644 arch/arm/boot/dts/rockchip/rv1109-sonoff-ihost.dts
 create mode 100644 arch/arm/boot/dts/rockchip/rv1126-sonoff-ihost.dts
 create mode 100644 arch/arm/boot/dts/rockchip/rv1126-sonoff-ihost.dtsi
arch/arm/boot/dts/rockchip/Makefile +2 -0
index 0f46e18fe275..4d4533d6f407 100644
@@ -2,7 +2,9 @@
 dtb-$(CONFIG_ARCH_ROCKCHIP) += \
 	rv1108-elgin-r1.dtb \
 	rv1108-evb.dtb \
+	rv1109-sonoff-ihost.dtb \
 	rv1126-edgeble-neu2-io.dtb \
+	rv1126-sonoff-ihost.dtb \
 	rk3036-evb.dtb \
 	rk3036-kylin.dtb \
 	rk3066a-bqcurie2.dtb \
arch/arm/boot/dts/rockchip/rv1109-sonoff-ihost.dts new file +13 -0
new file mode 100644
index 000000000000..3bfdb00ac8e1
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
+ */
+
+/dts-v1/;
+#include "rv1109.dtsi"
+#include "rv1126-sonoff-ihost.dtsi"
+
+/ {
+	model = "Sonoff iHost 2G";
+	compatible = "itead,sonoff-ihost", "rockchip,rv1109";
+};
arch/arm/boot/dts/rockchip/rv1126-sonoff-ihost.dts new file +13 -0
new file mode 100644
index 000000000000..106d1e42f285
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
+ */
+
+/dts-v1/;
+#include "rv1126.dtsi"
+#include "rv1126-sonoff-ihost.dtsi"
+
+/ {
+	model = "Sonoff iHost 4G";
+	compatible = "itead,sonoff-ihost", "rockchip,rv1126";
+};
arch/arm/boot/dts/rockchip/rv1126-sonoff-ihost.dtsi new file +407 -0

407 lines not on this page · raw message

Signature · 1 line
2.40.1
author
#32 lore raw

PATCH v2 9/9 dt-bindings: arm: rockchip: Add Sonoff iHost

In reply to Tim Lunn

Sonoff iHost is a smart home hub with built in radios for wifi/bt and Zigbee. It is based off the Rockchip RV1126 (or RV1109) SoC.

---

Changes in v2:
- Collect Robh Ack for dt-bindings patch

 Documentation/devicetree/bindings/arm/rockchip.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +7 -0
index 5f7c6c4aad8f..a26bbcd00deb 100644
@@ -922,6 +922,13 @@ properties:
           - const: rockchip,rk3568-bpi-r2pro
           - const: rockchip,rk3568
 
+      - description: Sonoff iHost Smart Home Hub
+        items:
+          - const: itead,sonoff-ihost
+          - enum:
+              - rockchip,rv1126
+              - rockchip,rv1109
+
 additionalProperties: true
 
 ...
Signature · 1 line
2.40.1