Skip to contentSkip to conversation

ARM: Rockchip: rk3568: add tsadc and spi

PATCH In review Frank Wunderlich 3 participants 3 messages Feb 11, 2022 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Rockchip: rk3568: add tsadc and spi

From: Frank Wunderlich <[email protected]>

Add tsadc and spi node from linux.

---
 arch/arm/dts/rk3568-pinctrl.dtsi |  9 ++++++++
 arch/arm/dts/rk3568.dtsi         | 35 ++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
arch/arm/dts/rk3568-pinctrl.dtsi +9 -0
index a588ca95ace2..8f90c66dd9e9 100644
@@ -3108,4 +3108,13 @@
 				<4 RK_PA0 3 &pcfg_pull_none_drv_level_2>;
 		};
 	};
+
+	tsadc {
+		/omit-if-no-ref/
+		tsadc_pin: tsadc-pin {
+			rockchip,pins =
+				/* tsadc_pin */
+				<0 RK_PA1 0 &pcfg_pull_none>;
+		};
+	};
 };
arch/arm/dts/rk3568.dtsi +35 -0
index 0f19d3f0c0c3..6afd95b01c0c 100644
@@ -772,6 +772,21 @@
 		clock-names = "tclk", "pclk";
 	};
 
+	spi3: spi@fe640000 {
+		compatible = "rockchip,rk3568-spi", "rockchip,rk3066-spi";
+		reg = <0x0 0xfe640000 0x0 0x1000>;
+		interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru CLK_SPI3>, <&cru PCLK_SPI3>;
+		clock-names = "spiclk", "apb_pclk";
+		dmas = <&dmac0 26>, <&dmac0 27>;
+		dma-names = "tx", "rx";
+		pinctrl-names = "default";
+		pinctrl-0 = <&spi3m0_cs0 &spi3m0_cs1 &spi3m0_pins>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
 	uart1: serial@fe650000 {
 		compatible = "rockchip,rk3568-uart", "snps,dw-apb-uart";
 		reg = <0x0 0xfe650000 0x0 0x100>;
@@ -1030,6 +1045,26 @@
 		status = "disabled";
 	};
 
+	tsadc: tsadc@fe710000 {
+		compatible = "rockchip,rk3568-tsadc";
+		reg = <0x0 0xfe710000 0x0 0x100>;
+		interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
+		assigned-clocks = <&cru CLK_TSADC_TSEN>, <&cru CLK_TSADC>;
+		assigned-clock-rates = <17000000>, <700000>;
+		clocks = <&cru CLK_TSADC>, <&cru PCLK_TSADC>;
+		clock-names = "tsadc", "apb_pclk";
+		resets = <&cru SRST_P_TSADC>, <&cru SRST_TSADC>,
+			 <&cru SRST_TSADCPHY>;
+		rockchip,grf = <&grf>;
+		rockchip,hw-tshut-temp = <95000>;
+		pinctrl-names = "init", "default", "sleep";
+		pinctrl-0 = <&tsadc_pin>;
+		pinctrl-1 = <&tsadc_shutorg>;
+		pinctrl-2 = <&tsadc_pin>;
+		#thermal-sensor-cells = <1>;
+		status = "disabled";
+	};
+
 	saradc: saradc@fe720000 {
 		compatible = "rockchip,rk3568-saradc";
 		reg = <0x0 0xfe720000 0x0 0x100>;
Signature · 7 lines
2.25.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

Hi Frank,

Quoted 40 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add tsadc and spi node from linux.

---
 arch/arm/dts/rk3568-pinctrl.dtsi |  9 ++++++++
 arch/arm/dts/rk3568.dtsi         | 35 ++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
arch/arm/dts/rk3568-pinctrl.dtsi +9 -0
index a588ca95ace2..8f90c66dd9e9 100644
@@ -3108,4 +3108,13 @@
 				<4 RK_PA0 3 &pcfg_pull_none_drv_level_2>;
 		};
 	};
+
+	tsadc {
+		/omit-if-no-ref/
+		tsadc_pin: tsadc-pin {
+			rockchip,pins =
+				/* tsadc_pin */
+				<0 RK_PA1 0 &pcfg_pull_none>;
+		};
+	};
 };
arch/arm/dts/rk3568.dtsi +4 -0
index 0f19d3f0c0c3..6afd95b01c0c 100644
@@ -772,6 +772,21 @@
 		clock-names = "tclk", "pclk";
 	};
 
+	spi3: spi@fe640000 {
+		compatible = "rockchip,rk3568-spi", "rockchip,rk3066-spi";
+		reg = <0x0 0xfe640000 0x0 0x1000>;
+		interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;

arch/arm/dts/rk3568.dtsi line 788

Quoted 10 lines
arch/arm/dts/rk3568.dtsi +10 -0
+		clocks = <&cru CLK_SPI3>, <&cru PCLK_SPI3>;
+		clock-names = "spiclk", "apb_pclk";
+		dmas = <&dmac0 26>, <&dmac0 27>;
+		dma-names = "tx", "rx";
+		pinctrl-names = "default";
+		pinctrl-0 = <&spi3m0_cs0 &spi3m0_cs1 &spi3m0_pins>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};

When you asked me if you should keep tsadc/spi3 in your board dts I didn't understand that these are missing in rk3568.dtsi. Adding these nodes when barebox doesn't use them has no gain for us. I won't take this patch and removed references to spi3/tsadc from your board patch while applying.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Am 11. Februar 2022 11:43:44 MEZ schrieb Sascha Hauer <[email protected]>:

Quoted 62 lines

Hi Frank,

Quoted 8 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add tsadc and spi node from linux.

---
 arch/arm/dts/rk3568-pinctrl.dtsi |  9 ++++++++
 arch/arm/dts/rk3568.dtsi         | 35

++++++++++++++++++++++++++++++++

Review

Quoted 3 lines
 2 files changed, 44 insertions(+)
(quoted diff) +0 -0

b/arch/arm/dts/rk3568-pinctrl.dtsi

Quoted 29 lines

index a588ca95ace2..8f90c66dd9e9 100644

arch/arm/dts/rk3568-pinctrl.dtsi +9 -0
@@ -3108,4 +3108,13 @@
 				<4 RK_PA0 3 &pcfg_pull_none_drv_level_2>;
 		};
 	};
+
+	tsadc {
+		/omit-if-no-ref/
+		tsadc_pin: tsadc-pin {
+			rockchip,pins =
+				/* tsadc_pin */
+				<0 RK_PA1 0 &pcfg_pull_none>;
+		};
+	};
 };
arch/arm/dts/rk3568.dtsi +4 -0
index 0f19d3f0c0c3..6afd95b01c0c 100644
@@ -772,6 +772,21 @@
 		clock-names = "tclk", "pclk";
 	};
 
+	spi3: spi@fe640000 {
+		compatible = "rockchip,rk3568-spi", "rockchip,rk3066-spi";
+		reg = <0x0 0xfe640000 0x0 0x1000>;
+		interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;

arch/arm/dts/rk3568.dtsi line 788

Quoted 10 lines
arch/arm/dts/rk3568.dtsi +10 -0
+		clocks = <&cru CLK_SPI3>, <&cru PCLK_SPI3>;
+		clock-names = "spiclk", "apb_pclk";
+		dmas = <&dmac0 26>, <&dmac0 27>;
+		dma-names = "tx", "rx";
+		pinctrl-names = "default";
+		pinctrl-0 = <&spi3m0_cs0 &spi3m0_cs1 &spi3m0_pins>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};

When you asked me if you should keep tsadc/spi3 in your board dts I didn't understand that these are missing in rk3568.dtsi. Adding these nodes when barebox doesn't use them has no gain for us. I won't take this patch and removed references to spi3/tsadc from your board patch while applying.

Quoted 1 line

Sascha

Hi,

I understood it,that when you take the mainline-linux dts it will not find spi3 and tsadc in rk3568.dtsi. Or do you plan to sync this too? regards Frank

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox