Skip to contentSkip to conversation

riscv: eswin: eic7700: Add support for clocks, resets, pinctrl, HSP bus, I2C and watchdog

PATCH New Pinkesh Vaghela 1 participant 8 messages Dec 1

Subsystems (4)
lore
Share & tools
lore

Pinkesh Vaghela

author maintainer
#0 lore raw

v6 cover riscv: eswin: eic7700: Add support for clocks, resets, pinctrl, HSP bus, I2C and watchdog

Changes in v6:
- Rebased the patches to master branch of linux-next tree having
latest tag: next-20261130.
- Patch 3/7: include eic7700-pinctrl.dtsi from eic7700.dtsi (instead of
from the board dts) so the SoC dtsi is self-contained, since the I2C
nodes reference pin states defined there. Also remove
eic7700-pinctrl.dtsi from board dts file.
- Removed stray new line after aon_i2c1 node in SoC dtsi file.
- Added "Tested-by" tag of "Mervyn Pretorius" for Patch 1, 2, 4 and 7.
- Link to v5: https://lore.kernel.org/all/[email protected]/

Pinkesh Vaghela (1):
riscv: dts: eswin: add hsp bus node

Pritesh Patel (5):
riscv: dts: eswin: add reset generator for EIC7700 SoC
riscv: dts: eswin: add clock generator for EIC7700 SoC
dt-bindings: i2c: dw: add ESWIN EIC7700 SoC I2C controller
riscv: dts: eswin: add I2C controller support
riscv: dts: eswin: add watchdog support

Yulin Lu (1):
riscv: dts: eswin: eic7700: add pinctrl support

 .../bindings/i2c/snps,designware-i2c.yaml     |    1 +
 .../dts/eswin/eic7700-hifive-premier-p550.dts |   90 ++
 .../riscv/boot/dts/eswin/eic7700-pinctrl.dtsi | 1065 +++++++++++++++++
 arch/riscv/boot/dts/eswin/eic7700.dtsi        |  256 ++++
 4 files changed, 1412 insertions(+)
 create mode 100644 arch/riscv/boot/dts/eswin/eic7700-pinctrl.dtsi
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH v6 1/7 riscv: dts: eswin: add reset generator for EIC7700 SoC

From: Pritesh Patel <[email protected]>

Add reset generator node for EIC7700 SoC

---
 arch/riscv/boot/dts/eswin/eic7700.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/riscv/boot/dts/eswin/eic7700.dtsi +7 -0
index c3ed93008bca..430a210f01e6 100644
@@ -4,6 +4,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/reset/eswin,eic7700-reset.h>
 
 / {
 	#address-cells = <2>;
@@ -341,5 +342,11 @@ gpioD: gpio-port@3 {
 				#gpio-cells = <2>;
 			};
 		};
+
+		reset: reset-controller@51828300 {
+			compatible = "eswin,eic7700-reset";
+			reg = <0x0 0x51828300 0x0 0x200>;
+			#reset-cells = <1>;
+		};
 	};
 };
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH v6 2/7 riscv: dts: eswin: add clock generator for EIC7700 SoC

In reply to Pinkesh Vaghela

From: Pritesh Patel <[email protected]>

Add clock generator node for EIC7700 SoC.
HiFive Premier P550 boards have 24MHz crystal oscillator to provide the input clock.

---
 .../boot/dts/eswin/eic7700-hifive-premier-p550.dts  |  5 +++++
 arch/riscv/boot/dts/eswin/eic7700.dtsi              | 13 +++++++++++++
 2 files changed, 18 insertions(+)
arch/riscv/boot/dts/eswin/eic7700-hifive-premier-p550.dts +5 -0
index 131ed1fc6b2e..a5c76b14a38f 100644
@@ -20,6 +20,11 @@ chosen {
 	};
 };
 
+&osc {
+	clock-frequency = <24000000>;
+	clock-output-names = "osc_24m";
+};
+
 &uart0 {
 	status = "okay";
 };
arch/riscv/boot/dts/eswin/eic7700.dtsi +13 -0
index 430a210f01e6..b3a230870315 100644
@@ -4,6 +4,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/clock/eswin,eic7700-clock.h>
 #include <dt-bindings/reset/eswin,eic7700-reset.h>
 
 / {
@@ -203,6 +204,11 @@ pmu {
 				<0x00000000 0x0000000f 0xfffffffc 0x000000ff 0x00000078>;
 	};
 
+	osc: oscillator {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+	};
+
 	soc {
 		compatible = "simple-bus";
 		ranges;
@@ -343,6 +349,13 @@ gpioD: gpio-port@3 {
 			};
 		};
 
+		clk: clock-controller@51828000 {
+			compatible = "eswin,eic7700-clock";
+			reg = <0x0 0x51828000 0x0 0x300>;
+			clocks = <&osc>;
+			#clock-cells = <1>;
+		};
+
 		reset: reset-controller@51828300 {
 			compatible = "eswin,eic7700-reset";
 			reg = <0x0 0x51828300 0x0 0x200>;
Signature · 1 line
2.34.1
author maintainer
#3 lore raw

PATCH v6 3/7 riscv: dts: eswin: eic7700: add pinctrl support

In reply to Pinkesh Vaghela

From: Yulin Lu <[email protected]>

Add pinctrl node and related pin configuration for EIC7700 SoC

---
 .../dts/eswin/eic7700-hifive-premier-p550.dts |   33 +
 .../riscv/boot/dts/eswin/eic7700-pinctrl.dtsi | 1065 +++++++++++++++++
 arch/riscv/boot/dts/eswin/eic7700.dtsi        |    7 +
 3 files changed, 1105 insertions(+)
 create mode 100644 arch/riscv/boot/dts/eswin/eic7700-pinctrl.dtsi
arch/riscv/boot/dts/eswin/eic7700-hifive-premier-p550.dts +33 -0
index a5c76b14a38f..fd005b6b5e09 100644
@@ -6,6 +6,7 @@
 /dts-v1/;
 
 #include "eic7700.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	compatible = "sifive,hifive-premier-p550", "eswin,eic7700";
@@ -18,6 +19,30 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio84_pins>;
+
+		led-0 {
+			gpios = <&gpioC 20 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	vcc_1v8: regulator-vcc1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc1v8";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+};
+
+&gpio84_pins {
+	bias-disable;
+	input-disable;
 };
 
 &osc {
@@ -25,10 +50,18 @@ &osc {
 	clock-output-names = "osc_24m";
 };
 
+&pinctrl {
+	vrgmii-supply = <&vcc_1v8>;
+};
+
 &uart0 {
 	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins>;
 };
 
 &uart2 {
 	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins>;
 };
arch/riscv/boot/dts/eswin/eic7700-pinctrl.dtsi new file +1065 -0

1,065 lines not on this page · raw message

arch/riscv/boot/dts/eswin/eic7700.dtsi +7 -0
index b3a230870315..4288def33b8e 100644
@@ -349,6 +349,11 @@ gpioD: gpio-port@3 {
 			};
 		};
 
+		pinctrl: pinctrl@51600080 {
+			compatible = "eswin,eic7700-pinctrl";
+			reg = <0x0 0x51600080 0x0 0x1fff80>;
+		};
+
 		clk: clock-controller@51828000 {
 			compatible = "eswin,eic7700-clock";
 			reg = <0x0 0x51828000 0x0 0x300>;
@@ -363,3 +368,5 @@ reset: reset-controller@51828300 {
 		};
 	};
 };
+
+#include "eic7700-pinctrl.dtsi"
Signature · 1 line
2.34.1
author maintainer
#4 lore raw

PATCH v6 4/7 riscv: dts: eswin: add hsp bus node

In reply to Pinkesh Vaghela

Add an HSP bus node to manage the HSP CFG clock used by HSP peripherals. This clock is required for accessing both the HSP CSR registers and the register spaces of HSP peripheral devices.

---
 arch/riscv/boot/dts/eswin/eic7700.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/riscv/boot/dts/eswin/eic7700.dtsi +13 -0
index 4288def33b8e..4ebffe52a34f 100644
@@ -252,6 +252,19 @@ plic: interrupt-controller@c000000 {
 			#interrupt-cells = <1>;
 		};
 
+		hsp: bus@50400000 {
+			compatible = "simple-pm-bus";
+			ranges = <0x0 0x50400000 0x0 0x50400000 0x0 0xa0000>;
+			clocks = <&clk EIC7700_CLK_GATE_HSP_CFG_CLK>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+
+			syscon: syscon@50440000 {
+				compatible = "eswin,eic7700-syscfg", "syscon";
+				reg = <0x0 0x50440000 0x0 0x2000>;
+			};
+		};
+
 		uart0: serial@50900000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x0 0x50900000 0x0 0x10000>;
Signature · 1 line
2.34.1
author maintainer
#5 lore raw

PATCH v6 5/7 dt-bindings: i2c: dw: add ESWIN EIC7700 SoC I2C controller

In reply to Pinkesh Vaghela

From: Pritesh Patel <[email protected]>

Add compatible string for the DesignWare-based I2C controllers present in ESWIN EIC7700 SoC.

---
 Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml +1 -0
index 56430a35e5d5..553b4f865ea7 100644
@@ -54,6 +54,7 @@ properties:
           - const: snps,designware-i2c
       - items:
           - enum:
+              - eswin,eic7700-i2c
               - mobileye,eyeq6lplus-i2c
               - mscc,ocelot-i2c
               - sophgo,sg2044-i2c
Signature · 1 line
2.34.1
author maintainer
#6 lore raw

PATCH v6 6/7 riscv: dts: eswin: add I2C controller support

In reply to Pinkesh Vaghela

From: Pritesh Patel <[email protected]>

Add I2C nodes for EIC7700 SoC.
Also add nodes for corresponding slave devices in dts file and enable them for HiFive Premier P550 board

---
 .../dts/eswin/eic7700-hifive-premier-p550.dts |  52 +++++
 arch/riscv/boot/dts/eswin/eic7700.dtsi        | 180 ++++++++++++++++++
 2 files changed, 232 insertions(+)
arch/riscv/boot/dts/eswin/eic7700-hifive-premier-p550.dts +52 -0
index fd005b6b5e09..037802281393 100644
@@ -40,6 +40,58 @@ vcc_1v8: regulator-vcc1v8 {
 	};
 };
 
+&aon_i2c0 {
+	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c02";
+		reg = <0x50>;
+	};
+};
+
+&aon_i2c1 {
+	status = "okay";
+
+	adc@10 {
+		compatible = "microchip,pac1934";
+		reg = <0x10>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		channel@1 {
+			reg = <0x1>;
+			shunt-resistor-micro-ohms = <1000>;
+			label = "VDD_SOM";
+		};
+
+		channel@2 {
+			reg = <0x2>;
+			shunt-resistor-micro-ohms = <1000>;
+			label = "VDD_SOC";
+		};
+
+		channel@3 {
+			reg = <0x3>;
+			shunt-resistor-micro-ohms = <1000>;
+			label = "VDD_CPU";
+		};
+
+		channel@4 {
+			reg = <0x4>;
+			shunt-resistor-micro-ohms = <1000>;
+			label = "VDD_LPDDR";
+		};
+	};
+
+	power-sensor@44 {
+		compatible = "ti,ina226";
+		reg = <0x44>;
+		#io-channel-cells = <1>;
+		label = "sys_power";
+		shunt-resistor = <1000>;
+	};
+};
+
 &gpio84_pins {
 	bias-disable;
 	input-disable;
arch/riscv/boot/dts/eswin/eic7700.dtsi +180 -0

192 lines not on this page · raw message

Signature · 1 line
2.34.1
author maintainer
#7 lore raw

PATCH v6 7/7 riscv: dts: eswin: add watchdog support

In reply to Pinkesh Vaghela

From: Pritesh Patel <[email protected]>

EIC7700 have four DesignWare watchdog controllers that are integrated to SoC.

The controllers use only SoC-internal register, interrupt, clock and reset resources and have no board-level dependencies, so describe them as available in the SoC DTSI.

Each watchdog counter is driven by its corresponding LSP APB clock. The NOC_WDREF clock belongs to the separate NoC watchdog and is not used by these controller instances.

---
 arch/riscv/boot/dts/eswin/eic7700.dtsi | 36 ++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/riscv/boot/dts/eswin/eic7700.dtsi +36 -0
index a1575d1ef226..30497f838884 100644
@@ -265,6 +265,42 @@ syscon: syscon@50440000 {
 			};
 		};
 
+		wdt0: watchdog@50800000 {
+			compatible = "snps,dw-wdt";
+			reg = <0x0 0x50800000 0x0 0x4000>;
+			interrupts = <87>;
+			clocks = <&clk EIC7700_CLK_GATE_LSP_WDT0_PCLK>;
+			clock-names = "tclk";
+			resets = <&reset EIC7700_RESET_WDT0>;
+		};
+
+		wdt1: watchdog@50804000 {
+			compatible = "snps,dw-wdt";
+			reg = <0x0 0x50804000 0x0 0x4000>;
+			interrupts = <88>;
+			clocks = <&clk EIC7700_CLK_GATE_LSP_WDT1_PCLK>;
+			clock-names = "tclk";
+			resets = <&reset EIC7700_RESET_WDT1>;
+		};
+
+		wdt2: watchdog@50808000 {
+			compatible = "snps,dw-wdt";
+			reg = <0x0 0x50808000 0x0 0x4000>;
+			interrupts = <89>;
+			clocks = <&clk EIC7700_CLK_GATE_LSP_WDT2_PCLK>;
+			clock-names = "tclk";
+			resets = <&reset EIC7700_RESET_WDT2>;
+		};
+
+		wdt3: watchdog@5080c000 {
+			compatible = "snps,dw-wdt";
+			reg = <0x0 0x5080c000 0x0 0x4000>;
+			interrupts = <90>;
+			clocks = <&clk EIC7700_CLK_GATE_LSP_WDT3_PCLK>;
+			clock-names = "tclk";
+			resets = <&reset EIC7700_RESET_WDT3>;
+		};
+
 		uart0: serial@50900000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x0 0x50900000 0x0 0x10000>;
Signature · 1 line
2.34.1