Skip to contentSkip to conversation

rockchip: rk3568: Device Tree updates

PATCH New Jonas Karlman 1 participant 5 messages Jul 28, 2023 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v2 cover rockchip: rk3568: Device Tree updates

This series sync rk356x.dtsi and rk3566-radxa-cm3-io.dts from linux v6.4, add bootph-all to common pinctrl nodes and relax FIT load order in rk356x-u-boot.dtsi.

Patch 1-2 sync rk356x device tree from linux v6.4.
Patch 3 move common pinctrl nodes to rk356x-u-boot.dtsi. Patch 4 change to try and load FIT from SD-card before eMMC when loading FIT from TPL+SPL media fails.

Changes in v2:
- Rebase on u-boot-rockchip/master
- Collect r-b tags

Jonas Karlman (4):
rockchip: rk356x: Sync dtsi from linux v6.4
rockchip: rk3566-radxa-cm3-io: Sync dts from linux v6.4
rockchip: rk356x-u-boot: Add bootph-all to common pinctrl nodes
rockchip: rk356x-u-boot: Use relaxed u-boot,spl-boot-order

 arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 56 ------------
 arch/arm/dts/rk3566-radxa-cm3-io.dts         |  8 ++
 arch/arm/dts/rk3568-pinctrl.dtsi             | 94 ++++++++++++++++++++
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi      | 54 -----------
 arch/arm/dts/rk356x-u-boot.dtsi              | 66 +++++++++++++-
 arch/arm/dts/rk356x.dtsi                     | 14 +--
 6 files changed, 175 insertions(+), 117 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/4 rockchip: rk356x: Sync dtsi from linux v6.4

Sync rk356x.dtsi from linux v6.4.

---
v2:
- No change

 arch/arm/dts/rk3568-pinctrl.dtsi | 94 ++++++++++++++++++++++++++++++++
 arch/arm/dts/rk356x.dtsi         | 14 +++--
 2 files changed, 102 insertions(+), 6 deletions(-)
arch/arm/dts/rk3568-pinctrl.dtsi +94 -0
index 8f90c66dd9e9..0a979bfb63d9 100644
@@ -3117,4 +3117,98 @@
 				<0 RK_PA1 0 &pcfg_pull_none>;
 		};
 	};
+
+	lcdc {
+		/omit-if-no-ref/
+		lcdc_clock: lcdc-clock {
+			rockchip,pins =
+				/* lcdc_clk */
+				<3 RK_PA0 1 &pcfg_pull_none>,
+				/* lcdc_den */
+				<3 RK_PC3 1 &pcfg_pull_none>,
+				/* lcdc_hsync */
+				<3 RK_PC1 1 &pcfg_pull_none>,
+				/* lcdc_vsync */
+				<3 RK_PC2 1 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		lcdc_data16: lcdc-data16 {
+			rockchip,pins =
+				/* lcdc_d3 */
+				<2 RK_PD3 1 &pcfg_pull_none>,
+				/* lcdc_d4 */
+				<2 RK_PD4 1 &pcfg_pull_none>,
+				/* lcdc_d5 */
+				<2 RK_PD5 1 &pcfg_pull_none>,
+				/* lcdc_d6 */
+				<2 RK_PD6 1 &pcfg_pull_none>,
+				/* lcdc_d7 */
+				<2 RK_PD7 1 &pcfg_pull_none>,
+				/* lcdc_d10 */
+				<3 RK_PA3 1 &pcfg_pull_none>,
+				/* lcdc_d11 */
+				<3 RK_PA4 1 &pcfg_pull_none>,
+				/* lcdc_d12 */
+				<3 RK_PA5 1 &pcfg_pull_none>,
+				/* lcdc_d13 */
+				<3 RK_PA6 1 &pcfg_pull_none>,
+				/* lcdc_d14 */
+				<3 RK_PA7 1 &pcfg_pull_none>,
+				/* lcdc_d15 */
+				<3 RK_PB0 1 &pcfg_pull_none>,
+				/* lcdc_d19 */
+				<3 RK_PB4 1 &pcfg_pull_none>,
+				/* lcdc_d20 */
+				<3 RK_PB5 1 &pcfg_pull_none>,
+				/* lcdc_d21 */
+				<3 RK_PB6 1 &pcfg_pull_none>,
+				/* lcdc_d22 */
+				<3 RK_PB7 1 &pcfg_pull_none>,
+				/* lcdc_d23 */
+				<3 RK_PC0 1 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		lcdc_data18: lcdc-data18 {
+			rockchip,pins =
+				/* lcdc_d2 */
+				<2 RK_PD2 1 &pcfg_pull_none>,
+				/* lcdc_d3 */
+				<2 RK_PD3 1 &pcfg_pull_none>,
+				/* lcdc_d4 */
+				<2 RK_PD4 1 &pcfg_pull_none>,
+				/* lcdc_d5 */
+				<2 RK_PD5 1 &pcfg_pull_none>,
+				/* lcdc_d6 */
+				<2 RK_PD6 1 &pcfg_pull_none>,
+				/* lcdc_d7 */
+				<2 RK_PD7 1 &pcfg_pull_none>,
+				/* lcdc_d10 */
+				<3 RK_PA3 1 &pcfg_pull_none>,
+				/* lcdc_d11 */
+				<3 RK_PA4 1 &pcfg_pull_none>,
+				/* lcdc_d12 */
+				<3 RK_PA5 1 &pcfg_pull_none>,
+				/* lcdc_d13 */
+				<3 RK_PA6 1 &pcfg_pull_none>,
+				/* lcdc_d14 */
+				<3 RK_PA7 1 &pcfg_pull_none>,
+				/* lcdc_d15 */
+				<3 RK_PB0 1 &pcfg_pull_none>,
+				/* lcdc_d18 */
+				<3 RK_PB3 1 &pcfg_pull_none>,
+				/* lcdc_d19 */
+				<3 RK_PB4 1 &pcfg_pull_none>,
+				/* lcdc_d20 */
+				<3 RK_PB5 1 &pcfg_pull_none>,
+				/* lcdc_d21 */
+				<3 RK_PB6 1 &pcfg_pull_none>,
+				/* lcdc_d22 */
+				<3 RK_PB7 1 &pcfg_pull_none>,
+				/* lcdc_d23 */
+				<3 RK_PC0 1 &pcfg_pull_none>;
+		};
+	};
+
 };
arch/arm/dts/rk356x.dtsi +8 -6
index e0591c194bec..61680c7ac489 100644
@@ -422,8 +422,9 @@
 		clock-names = "xin24m";
 		#clock-cells = <1>;
 		#reset-cells = <1>;
-		assigned-clocks = <&cru PLL_GPLL>, <&pmucru PLL_PPLL>;
-		assigned-clock-rates = <1200000000>, <200000000>;
+		assigned-clocks = <&pmucru CLK_RTC_32K>, <&cru PLL_GPLL>, <&pmucru PLL_PPLL>;
+		assigned-clock-rates = <32768>, <1200000000>, <200000000>;
+		assigned-clock-parents = <&pmucru CLK_RTC32K_FRAC>;
 		rockchip,grf = <&grf>;
 	};
 
@@ -743,8 +744,8 @@
 		compatible = "rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi";
 		reg = <0x00 0xfe060000 0x00 0x10000>;
 		interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
-		clock-names = "pclk", "hclk";
-		clocks = <&cru PCLK_DSITX_0>, <&cru HCLK_VO>;
+		clock-names = "pclk";
+		clocks = <&cru PCLK_DSITX_0>;
 		phy-names = "dphy";
 		phys = <&dsi_dphy0>;
 		power-domains = <&power RK3568_PD_VO>;
@@ -771,8 +772,8 @@
 		compatible = "rockchip,rk3568-mipi-dsi", "snps,dw-mipi-dsi";
 		reg = <0x0 0xfe070000 0x0 0x10000>;
 		interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
-		clock-names = "pclk", "hclk";
-		clocks = <&cru PCLK_DSITX_1>, <&cru HCLK_VO>;
+		clock-names = "pclk";
+		clocks = <&cru PCLK_DSITX_1>;
 		phy-names = "dphy";
 		phys = <&dsi_dphy1>;
 		power-domains = <&power RK3568_PD_VO>;
@@ -966,6 +967,7 @@
 		clock-names = "aclk_mst", "aclk_slv",
 			      "aclk_dbi", "pclk", "aux";
 		device_type = "pci";
+		#interrupt-cells = <1>;
 		interrupt-map-mask = <0 0 0 7>;
 		interrupt-map = <0 0 0 1 &pcie_intc 0>,
 				<0 0 0 2 &pcie_intc 1>,
Signature · 1 line
2.41.0
#2 lore raw

PATCH v2 2/4 rockchip: rk3566-radxa-cm3-io: Sync dts from linux v6.4

In reply to Jonas Karlman

Sync rk3566-radxa-cm3-io.dts from linux v6.4.

---
v2:
- No change

 arch/arm/dts/rk3566-radxa-cm3-io.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/dts/rk3566-radxa-cm3-io.dts +8 -0
index d89d5263cb5e..5e4236af4fcb 100644
@@ -254,6 +254,14 @@
 	status = "okay";
 };
 
+&usb2phy0_otg {
+	status = "okay";
+};
+
+&usb_host0_xhci {
+	status = "okay";
+};
+
 &vop {
 	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
 	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
Signature · 1 line
2.41.0
#3 lore raw

PATCH v2 3/4 rockchip: rk356x-u-boot: Add bootph-all to common pinctrl nodes

In reply to Jonas Karlman

Add bootph-all prop to common pinctrl nodes for eMMC, FSPI, SD-card and UART2 that are typically used by multiple boards. Unreferenced nodes are removed from the SPL device tree during a normal build.

---
v2:
- Rebase on u-boot-rockchip/master
- Collect r-b tag

 arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 56 -----------------
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi      | 54 -----------------
 arch/arm/dts/rk356x-u-boot.dtsi              | 64 ++++++++++++++++++++
 3 files changed, 64 insertions(+), 110 deletions(-)
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +0 -56
index f91740c1c0c8..a8c31fecafd8 100644
@@ -11,67 +11,11 @@
 	};
 };
 
-&emmc_bus8 {
-	bootph-all;
-};
-
-&emmc_clk {
-	bootph-all;
-};
-
-&emmc_cmd {
-	bootph-all;
-};
-
-&emmc_datastrobe {
-	bootph-all;
-};
-
-&pinctrl {
-	bootph-all;
-};
-
-&pcfg_pull_none {
-	bootph-all;
-};
-
-&pcfg_pull_up_drv_level_2 {
-	bootph-all;
-};
-
-&pcfg_pull_up {
-	bootph-all;
-};
-
-&sdmmc0_bus4 {
-	bootph-all;
-};
-
-&sdmmc0_clk {
-	bootph-all;
-};
-
-&sdmmc0_cmd {
-	bootph-all;
-};
-
-&sdmmc0_det {
-	bootph-all;
-};
-
-&sdmmc0_pwren {
-	bootph-all;
-};
-
 &sdhci {
 	cap-mmc-highspeed;
 	mmc-ddr-1_8v;
 };
 
-&uart2m0_xfer {
-	bootph-all;
-};
-
 &uart2 {
 	clock-frequency = <24000000>;
 	bootph-all;
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +0 -54

78 lines not on this page · raw message

arch/arm/dts/rk356x-u-boot.dtsi +64 -0

70 lines not on this page · raw message

Signature · 1 line
2.41.0
#4 lore raw

PATCH v2 4/4 rockchip: rk356x-u-boot: Use relaxed u-boot,spl-boot-order

In reply to Jonas Karlman

BootRom will try to load TPL+SPL from media in the following order:
- SPI NOR Flash
- SPI NAND Flash
- NAND Flash
- eMMC
- SDMMC

SPL will try to load FIT from media in the order defined in the device tree u-boot,spl-boot-order property.

Change the default order to load FIT from to:
- same media as TPL+SPL
- SDMMC
- eMMC

Boards with strict load order requirements should override the u-boot,spl-boot-order property in the board specific u-boot.dtsi.

Fixes 42f67fb51cb4 ("rockchip: rk3568: Fix boot device detection")

---
v2:
- No change

 arch/arm/dts/rk356x-u-boot.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/rk356x-u-boot.dtsi +1 -1
index 89c0d830b632..5644f78ec774 100644
@@ -12,7 +12,7 @@
 	};
 
 	chosen {
-		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc0;
+		u-boot,spl-boot-order = "same-as-spl", &sdmmc0, &sdhci;
 	};
 
 	dmc: dmc {
Signature · 1 line
2.41.0