Skip to contentSkip to conversation

ARM: dts: Pull rk3066 and rk3188 along with recent rk3288 developments

PATCH New Heiko Stuebner 1 participant 7 messages Sep 10, 2014 Device tree bindings

lore
Share & tools
lore
#0 lore raw

cover ARM: dts: Pull rk3066 and rk3188 along with recent rk3288 developments

Some cleanups and enablement of dwc2, spi and emmc functionality, that recent got added to the rk3288, for the Cortex-A9 SoCs rk3066 and rk3188.

Heiko Stuebner (6):
ARM: dts: rockchip: remove rockchip,bus-index from rk3xxx i2c0
ARM: dts: rockchip: add dwc2 controllers for rk3066 and rk3188
ARM: dts: rockchip: enable usb ports on Radxa Rock
ARM: dts: rockchip: add Cortex-A9 SPI controller nodes
ARM: dts: rockchip: add emmc nodes for rk3066 and rk3188
ARM: dts: clean up mmc nodes

 arch/arm/boot/dts/rk3066a.dtsi         | 67 +++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/rk3188-radxarock.dts | 43 +++++++++++++++++++++
 arch/arm/boot/dts/rk3188.dtsi          | 69 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/rk3xxx.dtsi          | 61 +++++++++++++++++++++++++++---
 4 files changed, 235 insertions(+), 5 deletions(-)
Signature · 1 line
2.0.1
#1 lore raw

PATCH 1/6 ARM: dts: rockchip: remove rockchip, bus-index from rk3xxx i2c0

This is a remnant from the first i2c driver iteration that seems to have been forgotten and thus made its way into the dtsi. Remove it.

---
 arch/arm/boot/dts/rk3xxx.dtsi | 1 -
 1 file changed, 1 deletion(-)
arch/arm/boot/dts/rk3xxx.dtsi +0 -1
index cce4a07..c021df3 100644
@@ -135,7 +135,6 @@
 		#size-cells = <0>;
 
 		rockchip,grf = <&grf>;
-		rockchip,bus-index = <0>;
 
 		clock-names = "i2c";
 		clocks = <&cru PCLK_I2C0>;
Signature · 1 line
2.0.1
#2 lore raw

PATCH 2/6 ARM: dts: rockchip: add dwc2 controllers for rk3066 and rk3188

In reply to Heiko Stuebner

Add the two dwc2 controllers providing an otg and a designated host port.

---
 arch/arm/boot/dts/rk3xxx.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm/boot/dts/rk3xxx.dtsi +18 -0
index c021df3..c873624 100644
@@ -91,6 +91,24 @@
 		status = "disabled";
 	};
 
+	usb_otg: usb at 10180000 {
+		compatible = "rockchip,rk3066-usb", "snps,dwc2";
+		reg = <0x10180000 0x40000>;
+		interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru HCLK_OTG0>;
+		clock-names = "otg";
+		status = "disabled";
+	};
+
+	usb_host: usb at 101c0000 {
+		compatible = "snps,dwc2";
+		reg = <0x101c0000 0x40000>;
+		interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru HCLK_OTG1>;
+		clock-names = "otg";
+		status = "disabled";
+	};
+
 	mmc0: dwmmc at 10214000 {
 		compatible = "rockchip,rk2928-dw-mshc";
 		reg = <0x10214000 0x1000>;
Signature · 1 line
2.0.1
#3 lore raw

PATCH 3/6 ARM: dts: rockchip: enable usb ports on Radxa Rock

In reply to Heiko Stuebner

This enables both the otg and host port and adds the vbus regulators on the Radxa Rock board. As we don't have phy support yet, the vbus regulators are added in always-on mode.

---
 arch/arm/boot/dts/rk3188-radxarock.dts | 43 ++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/boot/dts/rk3188-radxarock.dts +43 -0
index ff35acfa..1be0c34 100644
@@ -65,6 +65,19 @@
 		pinctrl-0 = <&ir_recv_pin>;
 	};
 
+	vcc_otg: usb-otg-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio2 31 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&host_vbus_drv>;
+		regulator-name = "otg-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
 	vcc_sd0: sdmmc-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "sdmmc-supply";
@@ -74,6 +87,19 @@
 		startup-delay-us = <100000>;
 		vin-supply = <&vcc_io>;
 	};
+
+	vcc_host: usb-host-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio0 3 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&otg_vbus_drv>;
+		regulator-name = "host-pwr";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &i2c1 {
@@ -218,6 +244,15 @@
 			rockchip,pins = <RK_GPIO0 10 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	usb {
+		host_vbus_drv: host-vbus-drv {
+			rockchip,pins = <0 3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+		otg_vbus_drv: otg-vbus-drv {
+			rockchip,pins = <2 31 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &uart0 {
@@ -236,6 +271,14 @@
 	status = "okay";
 };
 
+&usb_host {
+	status = "okay";
+};
+
+&usb_otg {
+	status = "okay";
+};
+
 &wdt {
 	status = "okay";
 };
Signature · 1 line
2.0.1
#4 lore raw

PATCH 4/6 ARM: dts: rockchip: add Cortex-A9 SPI controller nodes

In reply to Heiko Stuebner

This adds basic spi nodes and pinctrl settings to the rk3066 and rk3188 devicetree files.

---
 arch/arm/boot/dts/rk3066a.dtsi | 46 ++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/rk3188.dtsi  | 48 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/rk3xxx.dtsi  | 24 +++++++++++++++++++++
 3 files changed, 118 insertions(+)
arch/arm/boot/dts/rk3066a.dtsi +46 -0
index 879a818..8021eed 100644
@@ -238,6 +238,42 @@
 			};
 		};
 
+		spi0 {
+			spi0_clk: spi0-clk {
+				rockchip,pins = <RK_GPIO1 5 RK_FUNC_2 &pcfg_pull_default>;
+			};
+			spi0_cs0: spi0-cs0 {
+				rockchip,pins = <RK_GPIO1 4 RK_FUNC_2 &pcfg_pull_default>;
+			};
+			spi0_tx: spi0-tx {
+				rockchip,pins = <RK_GPIO1 7 RK_FUNC_2 &pcfg_pull_default>;
+			};
+			spi0_rx: spi0-rx {
+				rockchip,pins = <RK_GPIO1 6 RK_FUNC_2 &pcfg_pull_default>;
+			};
+			spi0_cs1: spi0-cs1 {
+				rockchip,pins = <RK_GPIO4 15 RK_FUNC_1 &pcfg_pull_default>;
+			};
+		};
+
+		spi1 {
+			spi1_clk: spi1-clk {
+				rockchip,pins = <RK_GPIO2 19 RK_FUNC_2 &pcfg_pull_default>;
+			};
+			spi1_cs0: spi1-cs0 {
+				rockchip,pins = <RK_GPIO2 20 RK_FUNC_2 &pcfg_pull_default>;
+			};
+			spi1_rx: spi1-rx {
+				rockchip,pins = <RK_GPIO2 22 RK_FUNC_2 &pcfg_pull_default>;
+			};
+			spi1_tx: spi1-tx {
+				rockchip,pins = <RK_GPIO2 21 RK_FUNC_2 &pcfg_pull_default>;
+			};
+			spi1_cs1: spi1-cs1 {
+				rockchip,pins = <RK_GPIO2 23 RK_FUNC_2 &pcfg_pull_default>;
+			};
+		};
+
 		uart0 {
 			uart0_xfer: uart0-xfer {
 				rockchip,pins = <RK_GPIO1 0 RK_FUNC_1 &pcfg_pull_default>,
@@ -406,6 +442,16 @@
 	pinctrl-0 = <&pwm3_out>;
 };
 
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_clk &spi0_tx &spi0_rx &spi0_cs0>;
+};
+
+&spi1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_xfer>;
arch/arm/boot/dts/rk3188.dtsi +48 -0

60 lines not on this page · raw message

arch/arm/boot/dts/rk3xxx.dtsi +24 -0
index c873624..7bcd698 100644
@@ -26,6 +26,8 @@
 		i2c2 = &i2c2;
 		i2c3 = &i2c3;
 		i2c4 = &i2c4;
+		spi0 = &spi0;
+		spi1 = &spi1;
 	};
 
 	xin24m: oscillator {
@@ -291,4 +293,26 @@
 		clock-names = "saradc", "apb_pclk";
 		status = "disabled";
 	};
+
+	spi0: spi at 20070000 {
+		compatible = "rockchip,rk3066-spi";
+		clocks = <&cru SCLK_SPI0>, <&cru PCLK_SPI0>;
+		clock-names = "spiclk", "apb_pclk";
+		interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+		reg = <0x20070000 0x1000>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
+	spi1: spi at 20074000 {
+		compatible = "rockchip,rk3066-spi";
+		clocks = <&cru SCLK_SPI1>, <&cru PCLK_SPI1>;
+		clock-names = "spiclk", "apb_pclk";
+		interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+		reg = <0x20074000 0x1000>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
 };
Signature · 1 line
2.0.1
#5 lore raw

PATCH 5/6 ARM: dts: rockchip: add emmc nodes for rk3066 and rk3188

In reply to Heiko Stuebner

Add the controller node, pinctrl settings for the customizable pins and sort the controllers like on rk3288 as emmc, sdmmc, sdio for handling convenience.

---
 arch/arm/boot/dts/rk3066a.dtsi | 21 +++++++++++++++++++++
 arch/arm/boot/dts/rk3188.dtsi  | 21 +++++++++++++++++++++
 arch/arm/boot/dts/rk3xxx.dtsi  | 14 ++++++++++++++
 3 files changed, 56 insertions(+)
arch/arm/boot/dts/rk3066a.dtsi +21 -0
index 8021eed..ad9c2db 100644
@@ -179,6 +179,27 @@
 			bias-disable;
 		};
 
+		emmc {
+			emmc_clk: emmc-clk {
+				rockchip,pins = <RK_GPIO3 31 RK_FUNC_2 &pcfg_pull_default>;
+			};
+
+			emmc_cmd: emmc-cmd {
+				rockchip,pins = <RK_GPIO4 9 RK_FUNC_2 &pcfg_pull_default>;
+			};
+
+			emmc_rst: emmc-rst {
+				rockchip,pins = <RK_GPIO4 10 RK_FUNC_2 &pcfg_pull_default>;
+			};
+
+			/*
+			 * The data pins are shared between nandc and emmc and
+			 * not accessible through pinctrl. Also they should've
+			 * been already set correctly by firmware, as
+			 * flash/emmc is the boot-device.
+			 */
+		};
+
 		i2c0 {
 			i2c0_xfer: i2c0-xfer {
 				rockchip,pins = <RK_GPIO2 28 RK_FUNC_1 &pcfg_pull_none>,
arch/arm/boot/dts/rk3188.dtsi +21 -0
index 573ef61..9a1ff0b 100644
@@ -147,6 +147,27 @@
 			bias-disable;
 		};
 
+		emmc {
+			emmc_clk: emmc-clk {
+				rockchip,pins = <RK_GPIO0 24 RK_FUNC_2 &pcfg_pull_default>;
+			};
+
+			emmc_cmd: emmc-cmd {
+				rockchip,pins = <RK_GPIO0 26 RK_FUNC_2 &pcfg_pull_default>;
+			};
+
+			emmc_rst: emmc-rst {
+				rockchip,pins = <RK_GPIO0 27 RK_FUNC_2 &pcfg_pull_default>;
+			};
+
+			/*
+			 * The data pins are shared between nandc and emmc and
+			 * not accessible through pinctrl. Also they should've
+			 * been already set correctly by firmware, as
+			 * flash/emmc is the boot-device.
+			 */
+		};
+
 		i2c0 {
 			i2c0_xfer: i2c0-xfer {
 				rockchip,pins = <RK_GPIO1 24 RK_FUNC_1 &pcfg_pull_none>,
arch/arm/boot/dts/rk3xxx.dtsi +14 -0
index 7bcd698..c383f5c 100644
@@ -26,6 +26,9 @@
 		i2c2 = &i2c2;
 		i2c3 = &i2c3;
 		i2c4 = &i2c4;
+		mshc0 = &emmc;
+		mshc1 = &mmc0;
+		mshc2 = &mmc1;
 		spi0 = &spi0;
 		spi1 = &spi1;
 	};
@@ -137,6 +140,17 @@
 		status = "disabled";
 	};
 
+	emmc: dwmmc at 1021c000 {
+		compatible = "rockchip,rk2928-dw-mshc";
+		reg = <0x1021c000 0x1000>;
+		interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+
+		clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>;
+		clock-names = "biu", "ciu";
+
+		status = "disabled";
+	};
+
 	pmu: pmu at 20004000 {
 		compatible = "rockchip,rk3066-pmu", "syscon";
 		reg = <0x20004000 0x100>;
Signature · 1 line
2.0.1
#6 lore raw

PATCH 6/6 ARM: dts: rockchip: clean up rk3xxx mmc nodes

In reply to Heiko Stuebner

Commit 356649ab6d64 ("ARM: dts: rockchip: unuse the slot-node and deprecate the supports-highspeed for dw-mmc") removed the slots but not the #xx-cells properties describing the subnodes. Do this now.

---
 arch/arm/boot/dts/rk3xxx.dtsi | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/boot/dts/rk3xxx.dtsi +0 -4
index c383f5c..9945bb9 100644
@@ -118,8 +118,6 @@
 		compatible = "rockchip,rk2928-dw-mshc";
 		reg = <0x10214000 0x1000>;
 		interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
-		#address-cells = <1>;
-		#size-cells = <0>;
 
 		clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>;
 		clock-names = "biu", "ciu";
@@ -131,8 +129,6 @@
 		compatible = "rockchip,rk2928-dw-mshc";
 		reg = <0x10218000 0x1000>;
 		interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
-		#address-cells = <1>;
-		#size-cells = <0>;
 
 		clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>;
 		clock-names = "biu", "ciu";
Signature · 1 line
2.0.1