Skip to contentSkip to conversation

Add support for Sonoff iHost RV1126 Smart Home Gateway

PATCH Superseded Tim Lunn 3 participants 14 messages Nov 13, 2023 – Nov 19, 2023

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tim Lunn

author
#0 lore raw

cover Add support for Sonoff iHost RV1126 Smart Home Gateway

Sonoff iHost is gateway device designed to provide a Smart Home Hub, it notably 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 with 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.

Tim Lunn (8):
ARM: dts: rockchip: rv1126: Add alternate UART pins
ARM: dts: rockchip: rv1126: Serial aliases
i2c: rk3x: Adjust grf 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: 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     | 409 ++++++++++++++++++
 arch/arm/boot/dts/rockchip/rv1126.dtsi        |  21 +
 drivers/i2c/busses/i2c-rk3x.c                 |   8 +-
 10 files changed, 554 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 1/8 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.

---

 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 2/8 ARM: dts: rockchip: rv1126: Serial aliases

In reply to Tim Lunn

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

---

 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
author
#3 lore raw

PATCH 3/8 i2c: rk3x: Adjust grf offset for i2c2 on rv1126

In reply to Tim Lunn

Rockchip RV1126 has a special case grf offset/mask for i2c2

---

 drivers/i2c/busses/i2c-rk3x.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +6 -2
index a044ca0c35a1..83b7bf7b48a7 100644
@@ -1288,8 +1288,12 @@ 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)
+			/* rv1126 i2c2 set pmugrf offset-0x118, bit-4 */
+			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
#4 lore raw

Re: [PATCH 3/8] i2c: rk3x: Adjust grf offset for i2c2 on rv1126

Hi,

Am Montag, 13. November 2023, 13:07:00 CET schrieb Tim Lunn:

Quoted 1 line

Rockchip RV1126 has a special case grf offset/mask for i2c2

This sounds misleading. When looking at the soc-data, the grf offset seems to be the same for all busses of the rv1126, only the offset seems to be different for i2c2.

Sadly I don't have (and didn't find any) rv1126 TRM, so couldn't verify.

Change itself looks nice. As it's only this one bus of one soc so far, we likely won't need a more involved solution just now.

Quoted 11 lines

---

 drivers/i2c/busses/i2c-rk3x.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +0 -0
index a044ca0c35a1..83b7bf7b48a7 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,12 @@ 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)
+			/* rv1126 i2c2 set pmugrf offset-0x118, bit-4 */

same here, comment could drop the offset reference I guess.

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

Quoted 8 lines
drivers/i2c/busses/i2c-rk3x.c +4 -0
+			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) {

Heiko

author
#5 lore raw

Re: [PATCH 3/8] i2c: rk3x: Adjust grf offset for i2c2 on rv1126

Hi Heiko,

Quoted 4 lines · Heiko Stuebner

Hi,

Am Montag, 13. November 2023, 13:07:00 CET schrieb Tim Lunn:

Quoted 1 line

Rockchip RV1126 has a special case grf offset/mask for i2c2

Quoted 9 lines

This sounds misleading. When looking at the soc-data, the grf offset seems to be the same for all busses of the rv1126, only the offset seems to be different for i2c2.

Sadly I don't have (and didn't find any) rv1126 TRM, so couldn't verify.

Change itself looks nice. As it's only this one bus of one soc so far, we likely won't need a more involved solution just now.

Thanks for your comments. I agree it sounds a bit misleading, I will clarify
the commit message and comments in v2 of this series.

Unfortunately I dont have access to the TRM either, however I have validated
that this fixes i2c2 on actual hardware.

Quoted 33 lines
Quoted 12 lines

---

  drivers/i2c/busses/i2c-rk3x.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +0 -0
index a044ca0c35a1..83b7bf7b48a7 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,12 @@ 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)
+			/* rv1126 i2c2 set pmugrf offset-0x118, bit-4 */

same here, comment could drop the offset reference I guess.

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

Quoted 8 lines
drivers/i2c/busses/i2c-rk3x.c +4 -0
+			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) {

Heiko

author
#6 lore raw

PATCH 4/8 ARM: dts: rockchip: rv1126: Add i2c2 nodes

In reply to Tim Lunn

Add i2c2 node and i2c2_xfer pinctrl for Rockchip RV1126

---

 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
author
#7 lore raw

PATCH 5/8 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.

---

 .../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
#8 lore raw

PATCH 6/8 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

---

 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
#9 lore raw

PATCH 7/8 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.

---

 arch/arm/boot/dts/rockchip/Makefile           |   2 +
 .../boot/dts/rockchip/rv1109-sonoff-ihost.dts |  13 +
 arch/arm/boot/dts/rockchip/rv1109.dtsi        |  23 +
 .../boot/dts/rockchip/rv1126-sonoff-ihost.dts |  13 +
 .../dts/rockchip/rv1126-sonoff-ihost.dtsi     | 409 ++++++++++++++++++
 5 files changed, 460 insertions(+)
 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
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/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>;
+	};
+};
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 +409 -0

409 lines not on this page · raw message

Signature · 1 line
2.40.1
maintainer
#10 lore raw

Re: [PATCH 7/8] ARM: dts: Add Sonoff iHost Smart Home Hub

Hi Tim,

Am Montag, 13. November 2023, 13:07:04 CET schrieb Tim Lunn:

Quoted 43 lines

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.

arch/arm/boot/dts/rockchip/rv1109.dtsi new file +13 -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 {

arch/arm/boot/dts/rockchip/rv1109.dtsi line 23

Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1109.dtsi new file +10 -0
+		/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>;
+	};
+};

this definitly wants to be its own patch ;-) .

I.e. you add support for the rv1109, which seems to be the same as rv1126, just with 2 instead of 4 cpu cores.

Quoted 7 lines

+&sdio {

arch/arm/boot/dts/rockchip/rv1109.dtsi new file +6 -0
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	keep-power-in-suspend;
+	max-frequency = <100000000>;
+	mmc-pwrseq = <&sdio_pwrseq>;

arch/arm/boot/dts/rockchip/rv1109.dtsi

Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1109.dtsi new file +10 -0
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc1_clk &sdmmc1_cmd &sdmmc1_bus4>;
+	rockchip,default-sample-phase = <90>;
+	sd-uhs-sdr104;
+	vmmc-supply = <&vcc3v3_sys>;
+	vqmmc-supply = <&vcc_1v8>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;

I don't think the *-cells are needed here

Thanks
Heiko

author
#11 lore raw

Re: [PATCH 7/8] ARM: dts: Add Sonoff iHost Smart Home Hub

Hi Heiko,

Quoted 57 lines · Heiko Stübner

Hi Tim,

Am Montag, 13. November 2023, 13:07:04 CET schrieb Tim Lunn:

Quoted 42 lines

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.

arch/arm/boot/dts/rockchip/rv1109.dtsi new file +13 -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 {

arch/arm/boot/dts/rockchip/rv1109.dtsi line 23

Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1109.dtsi new file +10 -0
+		/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>;
+	};
+};

this definitly wants to be its own patch ;-) .

Quoted 2 lines

I.e. you add support for the rv1109, which seems to be the same as rv1126, just with 2 instead of 4 cpu cores.

I will split this out. Yes, rv1109 is identical to the rv1126 apart from the number of cores.

I initially hoped rv1109 could just use the same device tree, but having the extra cores enabled ends up causing panics.

Quoted 13 lines
Quoted 13 lines

+&sdio {

arch/arm/boot/dts/rockchip/rv1109.dtsi new file +9 -0
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	keep-power-in-suspend;
+	max-frequency = <100000000>;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc1_clk &sdmmc1_cmd &sdmmc1_bus4>;
Quoted 9 lines

arch/arm/boot/dts/rockchip/rv1109.dtsi

Quoted 7 lines
arch/arm/boot/dts/rockchip/rv1109.dtsi new file +7 -0
+	rockchip,default-sample-phase = <90>;
+	sd-uhs-sdr104;
+	vmmc-supply = <&vcc3v3_sys>;
+	vqmmc-supply = <&vcc_1v8>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;

I don't think the *-cells are needed here

Ok, i will check and remove.

Regards
Tim

Quoted 5 lines

Thanks
Heiko

author
#12 lore raw

PATCH 8/8 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.

---

 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
maintainer Acked-by on v1 8/8
#13 lore raw

Re: [PATCH 8/8] dt-bindings: arm: rockchip: Add Sonoff iHost

Quoted 10 lines · 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.

---

 Documentation/devicetree/bindings/arm/rockchip.yaml | 7 +++++++
 1 file changed, 7 insertions(+)