Skip to contentSkip to conversation

rockchip: Fixes for RK3568 and RK3588 and cleanup

PATCH Superseded Jonas Karlman 3 participants 26 messages Mar 14, 2023 – Mar 19, 2023

Subsystems (5)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover rockchip: Fixes for RK3568 and RK3588 and cleanup

This series includes fixes mainly targeted at RK3568 and RK3588:

Patch 1 reverts early use of new bootph props in master branch. Patch 2-3 fixes emmc boot on rk3568-rock-3a.
Patch 4 fixes reset handler on rk3568.
Patch 5 fixes missing return value in rk3588 clk driver. Patch 6-7 fixes sdmmc boot on rk3588-rock-5b.
Patch 8 fixes building of tinker-rk3288 with USB or NET disabled.

Remaining patches does not fix a real issue and mainly contains cleanup and converts RK35xx to use standard boot.

Patch 9 improves return value used when clk_set_rate fails. Patch 10-11 remove dangling comments and an unused define. Patch 12 converts RK3568 and RK3588 to use standard boot.

This series builds on top of "rockchip: Use an external TPL binary on RK3588" at [1] that fixes generation of bootable RK3588 firmware images.

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Jonas Karlman (11):
rockchip: Fix early use of bootph props
rockchip: rk3568: Fix boot device detection
rockchip: rk3568-rock-3a: Sync device tree from linux
clk: rockchip: rk3588: Fix clk_aux16m in clock driver
rockchip: rk3588-rock-5b: Fix sdmmc boot
rockchip: rk3588: Add boot device detection
rockchip: tinker-rk3288: Use common BOOT_TARGET_DEVICES
mmc: rockchip_dw_mmc: Fix get_mmc_clk return value
rockchip: include: configs: Remove dangling comments
rockchip: include: configs: Remove unused SDRAM_BANK_SIZE
rockchip: Convert rk35xx to use standard boot

Peter Geis (1):
clk: rockchip: rk3568: Fix reset handler

 arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi     |   2 +-
 arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi  |   2 +-
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi       |  12 +-
 arch/arm/dts/rk3568-rock-3a.dts               | 261 +++++++++++++++++-
 arch/arm/dts/rk356x-u-boot.dtsi               |   2 +-
 .../dts/rk3588-edgeble-neu6a-io-u-boot.dtsi   |   2 +-
 arch/arm/dts/rk3588-rock-5b-u-boot.dtsi       |   3 +-
 arch/arm/dts/rk3588s-u-boot.dtsi              |  14 +-
 arch/arm/mach-rockchip/Kconfig                |   6 +
 arch/arm/mach-rockchip/rk3568/rk3568.c        |   2 +-
 arch/arm/mach-rockchip/rk3588/rk3588.c        |   7 +
 configs/rock5b-rk3588_defconfig               |   1 -
 drivers/clk/rockchip/clk_rk3568.c             |   2 +
 drivers/clk/rockchip/clk_rk3588.c             |   4 +-
 drivers/mmc/rockchip_dw_mmc.c                 |   2 +-
 include/configs/evb_rk3328.h                  |   2 -
 include/configs/evb_rk3399.h                  |   2 -
 include/configs/pinebook-pro-rk3399.h         |   2 -
 include/configs/pinephone-pro-rk3399.h        |   2 -
 include/configs/puma_rk3399.h                 |   2 -
 include/configs/px30_common.h                 |   1 -
 include/configs/rk3128_common.h               |   4 -
 include/configs/rk3188_common.h               |   6 -
 include/configs/rk322x_common.h               |   1 -
 include/configs/rk3288_common.h               |   3 -
 include/configs/rk3308_common.h               |   1 -
 include/configs/rk3328_common.h               |   1 -
 include/configs/rk3399_common.h               |   1 -
 include/configs/rk3568_common.h               |   9 +-
 include/configs/rk3588_common.h               |   9 +-
 include/configs/roc-pc-rk3399.h               |   2 -
 include/configs/rock960_rk3399.h              |   1 -
 include/configs/rockchip-common.h             |   2 -
 include/configs/rockpro64_rk3399.h            |   1 -
 include/configs/rv1108_common.h               |   2 -
 include/configs/tinker_rk3288.h               |   9 -
 include/configs/vyasa-rk3288.h                |   6 -
 37 files changed, 309 insertions(+), 82 deletions(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/12 rockchip: Fix early use of bootph props

Running U-Boot on a ROCK 3 Model A result in the following:

No serial driver found
resetting ...
no sysreset
### ERROR ### Please RESET the board ###

Replace bootph- props with u-boot,dm- props to fix this.

---
 arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi        |  2 +-
 arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi     |  2 +-
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi          |  2 +-
 arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi |  2 +-
 arch/arm/dts/rk3588s-u-boot.dtsi                 | 14 +++++++-------
 5 files changed, 11 insertions(+), 11 deletions(-)
arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi +1 -1
index a27a3adc082b..27735c49ddc0 100644
@@ -11,7 +11,7 @@
 };
 
 &uart0 {
-	bootph-all;
+	u-boot,dm-pre-reloc;
 	clock-frequency = <24000000>;
 	status = "okay";
 };
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +1 -1
index 4e791738335f..589332503e72 100644
@@ -13,6 +13,6 @@
 
 &uart2 {
 	clock-frequency = <24000000>;
-	bootph-all;
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +1 -1
index ed47efa44bf9..b5ca23a82a20 100644
@@ -19,6 +19,6 @@
 
 &uart2 {
 	clock-frequency = <24000000>;
-	bootph-all;
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi +1 -1
index 3235bd36e4c8..612966492b02 100644
@@ -18,7 +18,7 @@
 
 &sdmmc {
 	bus-width = <4>;
-	bootph-all;
+	u-boot,dm-pre-reloc;
 	u-boot,spl-fifo-mode;
 	status = "okay";
 };
arch/arm/dts/rk3588s-u-boot.dtsi +7 -7
index 1e225d71efc2..f880f4a16741 100644
@@ -8,12 +8,12 @@
 / {
 	dmc {
 		compatible = "rockchip,rk3588-dmc";
-		bootph-all;
+		u-boot,dm-pre-reloc;
 		status = "okay";
 	};
 
 	pmu1_grf: syscon@fd58a000 {
-		bootph-all;
+		u-boot,dm-pre-reloc;
 		compatible = "rockchip,rk3588-pmu1-grf", "syscon";
 		reg = <0x0 0xfd58a000 0x0 0x2000>;
 	};
@@ -46,26 +46,26 @@
 };
 
 &xin24m {
-	bootph-all;
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
 
 &cru {
-	bootph-pre-ram;
+	u-boot,dm-spl;
 	status = "okay";
 };
 
 &sys_grf {
-	bootph-pre-ram;
+	u-boot,dm-spl;
 	status = "okay";
 };
 
 &uart2 {
 	clock-frequency = <24000000>;
-	bootph-pre-ram;
+	u-boot,dm-spl;
 	status = "okay";
 };
 
 &ioc {
-	bootph-pre-ram;
+	u-boot,dm-spl;
 };
Signature · 1 line
2.39.2
Reviewed-by on v1 1/12
#2 lore raw

Re: [PATCH 01/12] rockchip: Fix early use of bootph props

Hi Jonas,

Quoted 10 lines · Jonas Karlman

Running U-Boot on a ROCK 3 Model A result in the following:

No serial driver found
resetting ...
no sysreset
### ERROR ### Please RESET the board ###

Replace bootph- props with u-boot,dm- props to fix this.

Sorry, my mistake, I though the patch series [0] has been apply to master, but it's in next for now.

We may need another fix after next merge to master next month.

I will apply this frist for this release.

Thanks,
- Kever

[0] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

Quoted 109 lines
---
  arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi        |  2 +-
  arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi     |  2 +-
  arch/arm/dts/rk3568-rock-3a-u-boot.dtsi          |  2 +-
  arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi |  2 +-
  arch/arm/dts/rk3588s-u-boot.dtsi                 | 14 +++++++-------
  5 files changed, 11 insertions(+), 11 deletions(-)
arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi +1 -1
index a27a3adc082b..27735c49ddc0 100644
@@ -11,7 +11,7 @@
  };
 
  &uart0 {
-	bootph-all;
+	u-boot,dm-pre-reloc;
  	clock-frequency = <24000000>;
  	status = "okay";
  };
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +1 -1
index 4e791738335f..589332503e72 100644
@@ -13,6 +13,6 @@
 
  &uart2 {
  	clock-frequency = <24000000>;
-	bootph-all;
+	u-boot,dm-pre-reloc;
  	status = "okay";
  };
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +1 -1
index ed47efa44bf9..b5ca23a82a20 100644
@@ -19,6 +19,6 @@
 
  &uart2 {
  	clock-frequency = <24000000>;
-	bootph-all;
+	u-boot,dm-pre-reloc;
  	status = "okay";
  };
arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi +1 -1
index 3235bd36e4c8..612966492b02 100644
@@ -18,7 +18,7 @@
 
  &sdmmc {
  	bus-width = <4>;
-	bootph-all;
+	u-boot,dm-pre-reloc;
  	u-boot,spl-fifo-mode;
  	status = "okay";
  };
arch/arm/dts/rk3588s-u-boot.dtsi +7 -7
index 1e225d71efc2..f880f4a16741 100644
@@ -8,12 +8,12 @@
  / {
  	dmc {
  		compatible = "rockchip,rk3588-dmc";
-		bootph-all;
+		u-boot,dm-pre-reloc;
  		status = "okay";
  	};
 
  	pmu1_grf: syscon@fd58a000 {
-		bootph-all;
+		u-boot,dm-pre-reloc;
  		compatible = "rockchip,rk3588-pmu1-grf", "syscon";
  		reg = <0x0 0xfd58a000 0x0 0x2000>;
  	};
@@ -46,26 +46,26 @@
  };
 
  &xin24m {
-	bootph-all;
+	u-boot,dm-pre-reloc;
  	status = "okay";
  };
 
  &cru {
-	bootph-pre-ram;
+	u-boot,dm-spl;
  	status = "okay";
  };
 
  &sys_grf {
-	bootph-pre-ram;
+	u-boot,dm-spl;
  	status = "okay";
  };
 
  &uart2 {
  	clock-frequency = <24000000>;
-	bootph-pre-ram;
+	u-boot,dm-spl;
  	status = "okay";
  };
 
  &ioc {
-	bootph-pre-ram;
+	u-boot,dm-spl;
  };
#3 lore raw

PATCH 2/12 rockchip: rk3568: Fix boot device detection

In reply to Jonas Karlman

The boot source node path for emmc is using the old sdhci name. Replace with correct mmc name and also add same-as-spl to boot order.

Fixes 0d61f8e5f1c0 ("rockchip: rk3568: add boot device detection")
---
 arch/arm/dts/rk356x-u-boot.dtsi        | 2 +-
 arch/arm/mach-rockchip/rk3568/rk3568.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/rk356x-u-boot.dtsi +1 -1
index 23316410496d..04a7b0a0f668 100644
@@ -12,7 +12,7 @@
 	};
 
 	chosen {
-		u-boot,spl-boot-order = &sdhci, &sdmmc0;
+		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc0;
 	};
 
 	dmc: dmc {
arch/arm/mach-rockchip/rk3568/rk3568.c +1 -1
index 4a08820a0937..69ef19cc85af 100644
@@ -82,7 +82,7 @@ static struct mm_region rk3568_mem_map[] = {
 };
 
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
-	[BROM_BOOTSOURCE_EMMC] = "/sdhci@fe310000",
+	[BROM_BOOTSOURCE_EMMC] = "/mmc@fe310000",
 	[BROM_BOOTSOURCE_SPINOR] = "/spi@fe300000/flash@0",
 	[BROM_BOOTSOURCE_SD] = "/mmc@fe2b0000",
 };
Signature · 1 line
2.39.2
Reviewed-by on v1 2/12
#4 lore raw

Re: [PATCH 02/12] rockchip: rk3568: Fix boot device detection

Quoted 5 lines · Jonas Karlman

The boot source node path for emmc is using the old sdhci name. Replace with correct mmc name and also add same-as-spl to boot order.

Fixes 0d61f8e5f1c0 ("rockchip: rk3568: add boot device detection")

Thanks,
- Kever

Quoted 31 lines
---
  arch/arm/dts/rk356x-u-boot.dtsi        | 2 +-
  arch/arm/mach-rockchip/rk3568/rk3568.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/rk356x-u-boot.dtsi +1 -1
index 23316410496d..04a7b0a0f668 100644
@@ -12,7 +12,7 @@
  	};
 
  	chosen {
-		u-boot,spl-boot-order = &sdhci, &sdmmc0;
+		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc0;
  	};
 
  	dmc: dmc {
arch/arm/mach-rockchip/rk3568/rk3568.c +1 -1
index 4a08820a0937..69ef19cc85af 100644
@@ -82,7 +82,7 @@ static struct mm_region rk3568_mem_map[] = {
  };
 
  const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
-	[BROM_BOOTSOURCE_EMMC] = "/sdhci@fe310000",
+	[BROM_BOOTSOURCE_EMMC] = "/mmc@fe310000",
  	[BROM_BOOTSOURCE_SPINOR] = "/spi@fe300000/flash@0",
  	[BROM_BOOTSOURCE_SD] = "/mmc@fe2b0000",
  };
#5 lore raw

PATCH 3/12 rockchip: rk3568-rock-3a: Sync device tree from linux

In reply to Jonas Karlman

Running U-Boot from eMMC on a ROCK 3 Model A result in the following:

U-Boot SPL 2023.04-rc3 (Mar 11 2023 - 17:24:48 +0000) Trying to boot from MMC1
Card did not respond to voltage select! : -110
spl: mmc init failed with error: -95
SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ###

The sdhci node is missing in board device tree, sync device tree from linux v6.3-rc1 to fix booting from eMMC. Also disable sdmmc2 and uart1 nodes related to using a WiFi and BT module in the M2 slot.

Fixes b44c54f600ab ("arm64: dts: rockchip: rk3568: Add Radxa ROCK 3 Model A board support")
---
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi |  10 +-
 arch/arm/dts/rk3568-rock-3a.dts         | 261 +++++++++++++++++++++++-
 2 files changed, 262 insertions(+), 9 deletions(-)
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +7 -3
index b5ca23a82a20..04bbb01b5d51 100644
@@ -9,12 +9,16 @@
 / {
 	chosen {
 		stdout-path = &uart2;
-		u-boot,spl-boot-order = "same-as-spl", &sdmmc0;
+		u-boot,spl-boot-order = "same-as-spl", &sdmmc0, &sdhci;
 	};
 };
 
-&sdmmc0 {
-	status = "okay";
+&sdmmc2 {
+	status = "disabled";
+};
+
+&uart1 {
+	status = "disabled";
 };
 
 &uart2 {
arch/arm/dts/rk3568-rock-3a.dts +255 -6

324 lines not on this page · raw message

Signature · 1 line
2.39.2
Reviewed-by on v1 3/12
#6 lore raw

Re: [PATCH 03/12] rockchip: rk3568-rock-3a: Sync device tree from linux

Quoted 9 lines · Jonas Karlman

Running U-Boot from eMMC on a ROCK 3 Model A result in the following:

U-Boot SPL 2023.04-rc3 (Mar 11 2023 - 17:24:48 +0000) Trying to boot from MMC1
Card did not respond to voltage select! : -110
spl: mmc init failed with error: -95
SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ###

Quoted 6 lines

The sdhci node is missing in board device tree, sync device tree from linux v6.3-rc1 to fix booting from eMMC. Also disable sdmmc2 and uart1 nodes related to using a WiFi and BT module in the M2 slot.

Fixes b44c54f600ab ("arm64: dts: rockchip: rk3568: Add Radxa ROCK 3 Model A board support")

Thanks,
- Kever

Quoted 365 lines
---
  arch/arm/dts/rk3568-rock-3a-u-boot.dtsi |  10 +-
  arch/arm/dts/rk3568-rock-3a.dts         | 261 +++++++++++++++++++++++-
  2 files changed, 262 insertions(+), 9 deletions(-)
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +7 -3
index b5ca23a82a20..04bbb01b5d51 100644
@@ -9,12 +9,16 @@
  / {
  	chosen {
  		stdout-path = &uart2;
-		u-boot,spl-boot-order = "same-as-spl", &sdmmc0;
+		u-boot,spl-boot-order = "same-as-spl", &sdmmc0, &sdhci;
  	};
  };
 
-&sdmmc0 {
-	status = "okay";
+&sdmmc2 {
+	status = "disabled";
+};
+
+&uart1 {
+	status = "disabled";
  };
 
  &uart2 {
arch/arm/dts/rk3568-rock-3a.dts +255 -6
index a2f2baa4ea91..917f5b2b8aab 100644
@@ -1,22 +1,37 @@
  // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
-/*
- * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
- * Copyright (c) 2023 Akash Gajjar <[email protected]>
- */
 
  /dts-v1/;
  #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
  #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
  #include "rk3568.dtsi"
 
  / {
  	model = "Radxa ROCK3 Model A";
  	compatible = "radxa,rock3a", "rockchip,rk3568";
 
+	aliases {
+		ethernet0 = &gmac1;
+		mmc0 = &sdhci;
+		mmc1 = &sdmmc0;
+	};
+
  	chosen: chosen {
  		stdout-path = "serial2:1500000n8";
  	};
 
+	hdmi-con {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
  	gmac1_clkin: external-gmac1-clock {
  		compatible = "fixed-clock";
  		clock-frequency = <125000000>;
@@ -24,13 +39,93 @@
  		#clock-cells = <0>;
  	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		led_user: led-0 {
+			gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
+			function = LED_FUNCTION_HEARTBEAT;
+			color = <LED_COLOR_ID_BLUE>;
+			linux,default-trigger = "heartbeat";
+			pinctrl-names = "default";
+			pinctrl-0 = <&led_user_en>;
+		};
+	};
+
+	rk809-sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,name = "Analog RK809";
+		simple-audio-card,mclk-fs = <256>;
+
+		simple-audio-card,cpu {
+			sound-dai = <&i2s1_8ch>;
+		};
+
+		simple-audio-card,codec {
+			sound-dai = <&rk809>;
+		};
+	};
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk809 1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_enable>;
+		post-power-on-delay-ms = <100>;
+		power-off-delay-us = <5000000>;
+		reset-gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>;
+	};
+
  	vcc12v_dcin: vcc12v-dcin-regulator {
  		compatible = "regulator-fixed";
  		regulator-name = "vcc12v_dcin";
  		regulator-always-on;
  		regulator-boot-on;
-		regulator-min-microvolt = <12000000>;
-		regulator-max-microvolt = <12000000>;
+	};
+
+	pcie30_avdd0v9: pcie30-avdd0v9-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "pcie30_avdd0v9";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <900000>;
+		regulator-max-microvolt = <900000>;
+		vin-supply = <&vcc3v3_sys>;
+	};
+
+	pcie30_avdd1v8: pcie30-avdd1v8-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "pcie30_avdd1v8";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc3v3_sys>;
+	};
+
+	/* pi6c pcie clock generator */
+	vcc3v3_pi6c_03: vcc3v3-pi6c-03-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3_pi6c_03";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc5v0_sys>;
+	};
+
+	vcc3v3_pcie: vcc3v3-pcie-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pcie_enable_h>;
+		regulator-name = "vcc3v3_pcie";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc5v0_sys>;
  	};
 
  	vcc3v3_sys: vcc3v3-sys-regulator {
@@ -91,6 +186,7 @@
  		enable-active-high;
  		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
  		pinctrl-names = "default";
+		pinctrl-0 = <&vcc5v0_usb_otg_en>;
  		regulator-name = "vcc5v0_usb_otg";
  		regulator-min-microvolt = <5000000>;
  		regulator-max-microvolt = <5000000>;
@@ -164,7 +260,43 @@
  	clock_in_out = "input";
  	phy-handle = <&rgmii_phy1>;
  	phy-mode = "rgmii-id";
+	phy-supply = <&vcc_3v3>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac1m1_miim
+		     &gmac1m1_tx_bus2
+		     &gmac1m1_rx_bus2
+		     &gmac1m1_rgmii_clk
+		     &gmac1m1_clkinout
+		     &gmac1m1_rgmii_bus>;
+	status = "okay";
+};
+
+&gpu {
+	mali-supply = <&vdd_gpu>;
+	status = "okay";
+};
+
+&hdmi {
+	avdd-0v9-supply = <&vdda0v9_image>;
+	avdd-1v8-supply = <&vcca1v8_image>;
  	pinctrl-names = "default";
+	pinctrl-0 = <&hdmitx_scl &hdmitx_sda &hdmitxm1_cec>;
+	status = "okay";
+};
+
+&hdmi_in {
+	hdmi_in_vp0: endpoint {
+		remote-endpoint = <&vp0_out_hdmi>;
+	};
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
+&hdmi_sound {
  	status = "okay";
  };
 
@@ -441,6 +573,13 @@
  };
 
  &i2s1_8ch {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2s1m0_sclktx &i2s1m0_lrcktx &i2s1m0_sdi0 &i2s1m0_sdo0>;
+	rockchip,trcm-sync-tx-only;
+	status = "okay";
+};
+
+&i2s2_2ch {
  	rockchip,trcm-sync-tx-only;
  	status = "okay";
  };
@@ -457,6 +596,27 @@
  	};
  };
 
+&pcie2x1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie_reset_h>;
+	reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>;
+	vpcie3v3-supply = <&vcc3v3_pcie>;
+	status = "okay";
+};
+
+&pcie30phy {
+	phy-supply = <&vcc3v3_pi6c_03>;
+	status = "okay";
+};
+
+&pcie3x2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie30x2m1_pins>;
+	reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
+	vpcie3v3-supply = <&vcc3v3_pcie>;
+	status = "okay";
+};
+
  &pinctrl {
  	cam {
  		vcc_cam_en: vcc_cam_en {
@@ -551,6 +711,78 @@
  	status = "okay";
  };
 
+&saradc {
+	vref-supply = <&vcca_1v8>;
+	status = "okay";
+};
+
+&sdhci {
+	bus-width = <8>;
+	max-frequency = <200000000>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
+	vmmc-supply = <&vcc_3v3>;
+	vqmmc-supply = <&vcc_1v8>;
+	status = "okay";
+};
+
+&sdmmc0 {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
+	disable-wp;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
+	sd-uhs-sdr50;
+	vmmc-supply = <&vcc3v3_sd>;
+	vqmmc-supply = <&vccio_sd>;
+	status = "okay";
+};
+
+&sdmmc2 {
+	bus-width = <4>;
+	disable-wp;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc2m0_bus4 &sdmmc2m0_cmd &sdmmc2m0_clk>;
+	sd-uhs-sdr104;
+	vmmc-supply = <&vcc3v3_sys>;
+	vqmmc-supply = <&vcc_1v8>;
+	status = "okay";
+};
+
+&tsadc {
+	rockchip,hw-tshut-mode = <1>;
+	rockchip,hw-tshut-polarity = <0>;
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>;
+	uart-has-rtscts;
+	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		clocks = <&rk809 1>;
+		clock-names = "lpo";
+		device-wakeup-gpios = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;
+		host-wakeup-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpio4 RK_PB2 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_host_wake &bt_wake &bt_enable>;
+		vbat-supply = <&vcc3v3_sys>;
+		vddio-supply = <&vcc_1v8>;
+		/* vddio comes from regulator on module, use IO bank voltage instead */
+	};
+};
+
  &uart2 {
  	status = "okay";
  };
@@ -607,3 +839,20 @@
  	phy-supply = <&vcc5v0_usb_host>;
  	status = "okay";
  };
+
+&vop {
+	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+	status = "okay";
+};
+
+&vop_mmu {
+	status = "okay";
+};
+
+&vp0 {
+	vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+		remote-endpoint = <&hdmi_in_vp0>;
+	};
+};
#7 lore raw

PATCH 4/12 clk: rockchip: rk3568: Fix reset handler

In reply to Jonas Karlman

From: Peter Geis <[email protected]>

The reset handler for rk3568 is missing its private data. This leads to an abort when a reset is triggered.

=> reset
resetting ...
"Synchronous Abort" handler, esr 0x96000045
elr: 0000000000a2bc04 lr : 0000000000a2bbd4 (reloc)
elr: 00000000eff9bc04 lr : 00000000eff9bbd4 x0 : 00000000fdd20000 x1 : 0000000014000001 x2 : 000000000000fdb9 x3 : 00000000edf77e88 x4 : 00000000edf50e78 x5 : 00000000edf77530 x6 : 000000000000001d x7 : 00000000edf8a1d0 x8 : 00000000ffffffd8 x9 : 0000000000000008
x10: 000000000000000d x11: 0000000000000006
x12: 000000000001869f x13: 0000000086c290c5
x14: 000000009118e878 x15: 0000000000000000
x16: 00000000eff9bbb8 x17: 0000000012f8c119
x18: 00000000edf50dc0 x19: 0000000000000000
x20: 0000000000000001 x21: 0000000000000000
x22: 00000000edf85900 x23: 0000000000000001
x24: 00000000effe8bbc x25: 0000000000000000
x26: 00000000edf85940 x27: 0000000000000000
x28: 0000000000000000 x29: 00000000edf3c8e0

  Code: d65f03c0 d5033fbf b9400661 529d9502 (b8216802)
  Resetting CPU ...

Add the missing dev_set_priv to the rk3568 clk driver to fix this.

Fixes 4a262feba3a5 ("rockchip: rk3568: add clock driver")

---

 drivers/clk/rockchip/clk_rk3568.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/rockchip/clk_rk3568.c +2 -0
index 99c195b3afe3..253b69504f93 100644
@@ -14,6 +14,7 @@
 #include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/io.h>
+#include <dm/device-internal.h>
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3568-cru.h>
 
@@ -2937,6 +2938,7 @@ static int rk3568_clk_bind(struct udevice *dev)
 						    glb_srst_fst);
 		priv->glb_srst_snd_value = offsetof(struct rk3568_cru,
 						    glb_srsr_snd);
+		dev_set_priv(sys_child, priv);
 	}
 
 #if CONFIG_IS_ENABLED(RESET_ROCKCHIP)
Signature · 1 line
2.39.2
#8 lore raw

PATCH 5/12 clk: rockchip: rk3588: Fix clk_aux16m in clock driver

In reply to Jonas Karlman

The rate and error value is not returned for aux16m clocks, fix this.

Fixes 7a474df74023 ("clk: rockchip: Add rk3588 clk support")
---
 drivers/clk/rockchip/clk_rk3588.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk_rk3588.c +2 -2
index 5271d9434831..a7df553e8750 100644
@@ -1558,7 +1558,7 @@ static ulong rk3588_clk_get_rate(struct clk *clk)
 #ifndef CONFIG_SPL_BUILD
 	case CLK_AUX16M_0:
 	case CLK_AUX16M_1:
-		rk3588_aux16m_get_clk(priv, clk->id);
+		rate = rk3588_aux16m_get_clk(priv, clk->id);
 		break;
 	case ACLK_VOP_ROOT:
 	case ACLK_VOP:
@@ -1707,7 +1707,7 @@ static ulong rk3588_clk_set_rate(struct clk *clk, ulong rate)
 #ifndef CONFIG_SPL_BUILD
 	case CLK_AUX16M_0:
 	case CLK_AUX16M_1:
-		rk3588_aux16m_set_clk(priv, clk->id, rate);
+		ret = rk3588_aux16m_set_clk(priv, clk->id, rate);
 		break;
 	case ACLK_VOP_ROOT:
 	case ACLK_VOP:
Signature · 1 line
2.39.2
Reviewed-by on v1 5/12
#9 lore raw

Re: [PATCH 05/12] clk: rockchip: rk3588: Fix clk_aux16m in clock driver

Quoted 4 lines · Jonas Karlman

The rate and error value is not returned for aux16m clocks, fix this.

Fixes 7a474df74023 ("clk: rockchip: Add rk3588 clk support")

Thanks,
- Kever

Quoted 26 lines
---
  drivers/clk/rockchip/clk_rk3588.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk_rk3588.c +2 -2
index 5271d9434831..a7df553e8750 100644
@@ -1558,7 +1558,7 @@ static ulong rk3588_clk_get_rate(struct clk *clk)
  #ifndef CONFIG_SPL_BUILD
  	case CLK_AUX16M_0:
  	case CLK_AUX16M_1:
-		rk3588_aux16m_get_clk(priv, clk->id);
+		rate = rk3588_aux16m_get_clk(priv, clk->id);
  		break;
  	case ACLK_VOP_ROOT:
  	case ACLK_VOP:
@@ -1707,7 +1707,7 @@ static ulong rk3588_clk_set_rate(struct clk *clk, ulong rate)
  #ifndef CONFIG_SPL_BUILD
  	case CLK_AUX16M_0:
  	case CLK_AUX16M_1:
-		rk3588_aux16m_set_clk(priv, clk->id, rate);
+		ret = rk3588_aux16m_set_clk(priv, clk->id, rate);
  		break;
  	case ACLK_VOP_ROOT:
  	case ACLK_VOP:
#10 lore raw

PATCH 6/12 rockchip: rk3588-rock-5b: Fix sdmmc boot

In reply to Jonas Karlman

Running U-Boot from a SD-card on ROCK 5 Model B fails to load atf using DMA and prints debug_uart messages.

<debug_uart>

<debug_uart>

U-Boot SPL 2023.04-rc3 (Mar 12 2023 - 00:30:16 +0000) Trying to boot from MMC1
## Checking hash(es) for config config-1 ... OK ## Checking hash(es) for Image atf-1 ... sha256 error! Bad hash value for 'hash' hash node in 'atf-1' image node
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

Use fifo-mode to disable DMA in SPL, add same-as-spl to boot-order and remove DEBUG_UART_ANNOUNCE option to fix this.

---
 arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 3 ++-
 configs/rock5b-rk3588_defconfig         | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +2 -1
index 2386edf90deb..36d557b4934d 100644
@@ -11,12 +11,13 @@
 	};
 
 	chosen {
-		u-boot,spl-boot-order = &sdmmc;
+		u-boot,spl-boot-order = "same-as-spl", &sdmmc;
 	};
 };
 
 &sdmmc {
 	bus-width = <4>;
 	u-boot,dm-spl;
+	u-boot,spl-fifo-mode;
 	status = "okay";
 };
configs/rock5b-rk3588_defconfig +0 -1
index 66199387195a..3fcc6a26bb51 100644
@@ -66,6 +66,5 @@ CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
-CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_SYSRESET=y
 CONFIG_ERRNO_STR=y
Signature · 1 line
2.39.2
Reviewed-by on v1 6/12
#11 lore raw

Re: [PATCH 06/12] rockchip: rk3588-rock-5b: Fix sdmmc boot

Quoted 16 lines · Jonas Karlman

Running U-Boot from a SD-card on ROCK 5 Model B fails to load atf using DMA and prints debug_uart messages.

<debug_uart>

<debug_uart>

U-Boot SPL 2023.04-rc3 (Mar 12 2023 - 00:30:16 +0000) Trying to boot from MMC1
## Checking hash(es) for config config-1 ... OK ## Checking hash(es) for Image atf-1 ... sha256 error! Bad hash value for 'hash' hash node in 'atf-1' image node
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

Quoted 4 lines

Use fifo-mode to disable DMA in SPL, add same-as-spl to boot-order and remove DEBUG_UART_ANNOUNCE option to fix this.

Thanks,
- Kever

Quoted 35 lines
---
  arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 3 ++-
  configs/rock5b-rk3588_defconfig         | 1 -
  2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +2 -1
index 2386edf90deb..36d557b4934d 100644
@@ -11,12 +11,13 @@
  	};
 
  	chosen {
-		u-boot,spl-boot-order = &sdmmc;
+		u-boot,spl-boot-order = "same-as-spl", &sdmmc;
  	};
  };
 
  &sdmmc {
  	bus-width = <4>;
  	u-boot,dm-spl;
+	u-boot,spl-fifo-mode;
  	status = "okay";
  };
configs/rock5b-rk3588_defconfig +0 -1
index 66199387195a..3fcc6a26bb51 100644
@@ -66,6 +66,5 @@ CONFIG_PWM_ROCKCHIP=y
  CONFIG_SPL_RAM=y
  CONFIG_BAUDRATE=1500000
  CONFIG_DEBUG_UART_SHIFT=2
-CONFIG_DEBUG_UART_ANNOUNCE=y
  CONFIG_SYSRESET=y
  CONFIG_ERRNO_STR=y
#12 lore raw

PATCH 7/12 rockchip: rk3588: Add boot device detection

In reply to Jonas Karlman

Enable SPL on RK3588 to detect which device it was booted from. Fixes use of same-as-spl in u-boot,spl-boot-order prop.

---
 arch/arm/mach-rockchip/rk3588/rk3588.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-rockchip/rk3588/rk3588.c +7 -0
index 2ee1db47671f..18e67b5ca9b2 100644
@@ -8,6 +8,7 @@
 #include <spl.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
+#include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/ioc_rk3588.h>
 
@@ -36,6 +37,12 @@ DECLARE_GLOBAL_DATA_PTR;
 #define BUS_IOC_GPIO2D_IOMUX_SEL_H	0x5c
 #define BUS_IOC_GPIO3A_IOMUX_SEL_L	0x60
 
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+	[BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
+	[BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
+	[BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
+};
+
 static struct mm_region rk3588_mem_map[] = {
 	{
 		.virt = 0x0UL,
Signature · 1 line
2.39.2
Reviewed-by on v1 7/12
#13 lore raw

Re: [PATCH 07/12] rockchip: rk3588: Add boot device detection

Quoted 4 lines · Jonas Karlman

Enable SPL on RK3588 to detect which device it was booted from. Fixes use of same-as-spl in u-boot,spl-boot-order prop.

Thanks,
- Kever

Quoted 29 lines
---
  arch/arm/mach-rockchip/rk3588/rk3588.c | 7 +++++++
  1 file changed, 7 insertions(+)
arch/arm/mach-rockchip/rk3588/rk3588.c +7 -0
index 2ee1db47671f..18e67b5ca9b2 100644
@@ -8,6 +8,7 @@
  #include <spl.h>
  #include <asm/armv8/mmu.h>
  #include <asm/io.h>
+#include <asm/arch-rockchip/bootrom.h>
  #include <asm/arch-rockchip/hardware.h>
  #include <asm/arch-rockchip/ioc_rk3588.h>
 
@@ -36,6 +37,12 @@ DECLARE_GLOBAL_DATA_PTR;
  #define BUS_IOC_GPIO2D_IOMUX_SEL_H	0x5c
  #define BUS_IOC_GPIO3A_IOMUX_SEL_L	0x60
 
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+	[BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
+	[BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
+	[BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
+};
+
  static struct mm_region rk3588_mem_map[] = {
  	{
  		.virt = 0x0UL,
#14 lore raw

PATCH 8/12 rockchip: tinker-rk3288: Use common BOOT_TARGET_DEVICES

In reply to Jonas Karlman

Building U-Boot for Tinker Board with USB or NET Kconfig option disabled result in the following build error:

In file included from include/configs/rk3288_common.h:29,

                   from include/configs/tinker_rk3288.h:14,
                   from include/config.h:3,
                   from include/common.h:16,
                   from env/common.c:10:
  include/config_distro_bootcmd.h:302:9: error: expected '}' before 'BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB'
    302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  include/config_distro_bootcmd.h:302:9: note: in definition of macro 'BOOTENV_DEV_NAME_USB'
    302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  include/configs/tinker_rk3288.h:21:9: note: in expansion of macro 'BOOTENV_DEV_NAME'
     21 |         func(USB, usb, 0) \
        |         ^~~~
  include/config_distro_bootcmd.h:454:25: note: in expansion of macro 'BOOT_TARGET_DEVICES'
    454 |         "boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
        |                         ^~~~~~~~~~~~~~~~~~~
  include/config_distro_bootcmd.h:474:9: note: in expansion of macro 'BOOTENV_BOOT_TARGETS'
    474 |         BOOTENV_BOOT_TARGETS \
        |         ^~~~~~~~~~~~~~~~~~~~
  include/configs/rk3288_common.h:40:9: note: in expansion of macro 'BOOTENV'
     40 |         BOOTENV
        |         ^~~~~~~
  include/env_default.h:122:9: note: in expansion of macro 'CFG_EXTRA_ENV_SETTINGS'
    122 |         CFG_EXTRA_ENV_SETTINGS
        |         ^~~~~~~~~~~~~~~~~~~~~~
  In file included from env/common.c:32:
  include/env_default.h:29:36: note: to match this '{'
     29 | const char default_environment[] = {
        |                                    ^

make[2]: *** [scripts/Makefile.build:256: env/common.o] Error 1

The BOOT_TARGET_DEVICES defined in rockchip-common.h include the same devices as defined in tinker_rk3288.h, remove the board specific one to fix building with USB or NET option disabled.

---
 include/configs/tinker_rk3288.h | 9 ---------
 1 file changed, 9 deletions(-)
include/configs/tinker_rk3288.h +0 -9
index 269ec529a340..053c9032e2da 100644
@@ -13,13 +13,4 @@
 
 #include <configs/rk3288_common.h>
 
-#undef BOOT_TARGET_DEVICES
-
-#define BOOT_TARGET_DEVICES(func) \
-	func(MMC, mmc, 0) \
-	func(MMC, mmc, 1) \
-	func(USB, usb, 0) \
-	func(PXE, pxe, na) \
-	func(DHCP, dchp, na)
-
 #endif
Signature · 1 line
2.39.2
Reviewed-by on v1 8/12
#15 lore raw

Re: [PATCH 08/12] rockchip: tinker-rk3288: Use common BOOT_TARGET_DEVICES

Quoted 35 lines · Jonas Karlman

Building U-Boot for Tinker Board with USB or NET Kconfig option disabled result in the following build error:

In file included from include/configs/rk3288_common.h:29,

                    from include/configs/tinker_rk3288.h:14,
                    from include/config.h:3,
                    from include/common.h:16,
                    from env/common.c:10:
   include/config_distro_bootcmd.h:302:9: error: expected '}' before 'BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB'
     302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/config_distro_bootcmd.h:302:9: note: in definition of macro 'BOOTENV_DEV_NAME_USB'
     302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/configs/tinker_rk3288.h:21:9: note: in expansion of macro 'BOOTENV_DEV_NAME'
      21 |         func(USB, usb, 0) \
         |         ^~~~
   include/config_distro_bootcmd.h:454:25: note: in expansion of macro 'BOOT_TARGET_DEVICES'
     454 |         "boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
         |                         ^~~~~~~~~~~~~~~~~~~
   include/config_distro_bootcmd.h:474:9: note: in expansion of macro 'BOOTENV_BOOT_TARGETS'
     474 |         BOOTENV_BOOT_TARGETS \
         |         ^~~~~~~~~~~~~~~~~~~~
   include/configs/rk3288_common.h:40:9: note: in expansion of macro 'BOOTENV'
      40 |         BOOTENV
         |         ^~~~~~~
   include/env_default.h:122:9: note: in expansion of macro 'CFG_EXTRA_ENV_SETTINGS'
     122 |         CFG_EXTRA_ENV_SETTINGS
         |         ^~~~~~~~~~~~~~~~~~~~~~
   In file included from env/common.c:32:
   include/env_default.h:29:36: note: to match this '{'
      29 | const char default_environment[] = {
         |                                    ^
   make[2]: *** [scripts/Makefile.build:256: env/common.o] Error 1
Quoted 5 lines

The BOOT_TARGET_DEVICES defined in rockchip-common.h include the same devices as defined in tinker_rk3288.h, remove the board specific one to fix building with USB or NET option disabled.

Thanks,
- Kever

Quoted 22 lines
---
  include/configs/tinker_rk3288.h | 9 ---------
  1 file changed, 9 deletions(-)
include/configs/tinker_rk3288.h +0 -9
index 269ec529a340..053c9032e2da 100644
@@ -13,13 +13,4 @@
 
  #include <configs/rk3288_common.h>
 
-#undef BOOT_TARGET_DEVICES
-
-#define BOOT_TARGET_DEVICES(func) \
-	func(MMC, mmc, 0) \
-	func(MMC, mmc, 1) \
-	func(USB, usb, 0) \
-	func(PXE, pxe, na) \
-	func(DHCP, dchp, na)
-
  #endif
#16 lore raw

PATCH 9/12 mmc: rockchip_dw_mmc: Fix get_mmc_clk return value

In reply to Jonas Karlman

The get_mmc_clk ops is expected to set a clock rate and return the configured rate as an unsigned value. However, if clk_set_rate fails, e.g. using a fixed rate clock, a negative error value is returned.

The mmc core will treat this as a valid unsigned rate and tries to configure a divider based on this bogus clock rate.

Use 0 as the return value when setting clock rate fails, the mmc core will configure to use bypass mode instead of using a bogus divider.

---
 drivers/mmc/rockchip_dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/rockchip_dw_mmc.c +1 -1
index 3661ce33143e..72c820ee6330 100644
@@ -52,7 +52,7 @@ static uint rockchip_dwmmc_get_mmc_clk(struct dwmci_host *host, uint freq)
 	ret = clk_set_rate(&priv->clk, freq);
 	if (ret < 0) {
 		debug("%s: err=%d\n", __func__, ret);
-		return ret;
+		return 0;
 	}
 
 	return freq;
Signature · 1 line
2.39.2
Reviewed-by on v1 9/12
#17 lore raw

Re: [PATCH 09/12] mmc: rockchip_dw_mmc: Fix get_mmc_clk return value

Quoted 11 lines · Jonas Karlman

The get_mmc_clk ops is expected to set a clock rate and return the configured rate as an unsigned value. However, if clk_set_rate fails, e.g. using a fixed rate clock, a negative error value is returned.

The mmc core will treat this as a valid unsigned rate and tries to configure a divider based on this bogus clock rate.

Use 0 as the return value when setting clock rate fails, the mmc core will configure to use bypass mode instead of using a bogus divider.

Thanks,
- Kever

Quoted 17 lines
---
  drivers/mmc/rockchip_dw_mmc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/rockchip_dw_mmc.c +1 -1
index 3661ce33143e..72c820ee6330 100644
@@ -52,7 +52,7 @@ static uint rockchip_dwmmc_get_mmc_clk(struct dwmci_host *host, uint freq)
  	ret = clk_set_rate(&priv->clk, freq);
  	if (ret < 0) {
  		debug("%s: err=%d\n", __func__, ret);
-		return ret;
+		return 0;
  	}
 
  	return freq;
#18 lore raw

PATCH 10/12 rockchip: include: configs: Remove dangling comments

In reply to Jonas Karlman

This removes dangling comments that no longer serve a purpose and has been left after conversion of defines to Kconfig option.

---
 include/configs/rk3128_common.h   | 4 ----
 include/configs/rk3188_common.h   | 5 -----
 include/configs/rk3288_common.h   | 2 --
 include/configs/rk3328_common.h   | 1 -
 include/configs/rk3399_common.h   | 1 -
 include/configs/rockchip-common.h | 2 --
 include/configs/rv1108_common.h   | 2 --
 include/configs/vyasa-rk3288.h    | 6 ------
 8 files changed, 23 deletions(-)
include/configs/rk3128_common.h +0 -4
index 8aa17bfbd364..8736b14d1015 100644
@@ -12,13 +12,9 @@
 
 #define CFG_IRAM_BASE		0x10080000
 
-/* RAW SD card / eMMC locations. */
-
 #define CFG_SYS_SDRAM_BASE		0x60000000
 #define SDRAM_MAX_SIZE			0x80000000
 
-/* usb mass storage */
-
 #define ENV_MEM_LAYOUT_SETTINGS \
 	"scriptaddr=0x60500000\0" \
 	"pxefile_addr_r=0x60600000\0" \
include/configs/rk3188_common.h +0 -5
index ac9195672fb7..ebb421c69297 100644
@@ -11,15 +11,10 @@
 
 #define CFG_IRAM_BASE	0x10080000
 
-/* spl size 32kb sram - 2kb bootrom */
-
 #define CFG_SYS_SDRAM_BASE		0x60000000
 #define SDRAM_BANK_SIZE			(2UL << 30)
 #define SDRAM_MAX_SIZE			0x80000000
 
-/* usb otg */
-
-/* usb host support */
 #define ENV_MEM_LAYOUT_SETTINGS \
 	"scriptaddr=0x60000000\0" \
 	"pxefile_addr_r=0x60100000\0" \
include/configs/rk3288_common.h +0 -2
index 5f29432be10b..fa409c70c931 100644
@@ -13,8 +13,6 @@
 
 #define CFG_IRAM_BASE		0xff700000
 
-/* RAW SD card / eMMC locations. */
-
 #define CFG_SYS_SDRAM_BASE		0
 #define SDRAM_BANK_SIZE			(2UL << 30)
 #define SDRAM_MAX_SIZE			0xfe000000
include/configs/rk3328_common.h +0 -1
index 24b21c024dee..e565ccff8979 100644
@@ -10,7 +10,6 @@
 
 #define CFG_IRAM_BASE		0xff090000
 
-/* FAT sd card locations. */
 #define CFG_SYS_SDRAM_BASE		0
 #define SDRAM_MAX_SIZE			0xff000000
 
include/configs/rk3399_common.h +0 -1
index 3ef9ffa2e9c4..04dcbf20bcb5 100644
@@ -10,7 +10,6 @@
 
 #define CFG_IRAM_BASE		0xff8c0000
 
-/* FAT sd card locations. */
 #define CFG_SYS_SDRAM_BASE		0
 #define SDRAM_MAX_SIZE			0xf8000000
 
include/configs/rockchip-common.h +0 -2
index b7c5c6634394..18544d75acc6 100644
@@ -11,8 +11,6 @@
 #define CFG_CPUID_OFFSET	0x7
 #endif
 
-/* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */
-
 #ifndef CONFIG_SPL_BUILD
 
 /* First try to boot from SD (index 1), then eMMC (index 0) */
include/configs/rv1108_common.h +0 -2
index 63551b47e200..050d37bff0b5 100644
@@ -17,8 +17,6 @@
 
 #define CFG_SYS_SDRAM_BASE		0x60000000
 
-/* rockchip ohci host driver */
-
 #define ENV_MEM_LAYOUT_SETTINGS \
 	"scriptaddr=0x60000000\0" \
 	"fdt_addr_r=0x61f00000\0" \
include/configs/vyasa-rk3288.h +0 -6
index e8c1013a71a3..81ff61bf7a6a 100644
@@ -20,10 +20,4 @@
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 1) \
 
-#ifndef CONFIG_TPL_BUILD
-/* Falcon Mode */
-
-/* Falcon Mode - MMC support: args@16MB kernel@17MB */
-#endif
-
 #endif
Signature · 1 line
2.39.2
Reviewed-by on v1 10/12
#19 lore raw

Re: [PATCH 10/12] rockchip: include: configs: Remove dangling comments

Quoted 4 lines · Jonas Karlman

This removes dangling comments that no longer serve a purpose and has been left after conversion of defines to Kconfig option.

Thanks,
- Kever

Quoted 127 lines
---
  include/configs/rk3128_common.h   | 4 ----
  include/configs/rk3188_common.h   | 5 -----
  include/configs/rk3288_common.h   | 2 --
  include/configs/rk3328_common.h   | 1 -
  include/configs/rk3399_common.h   | 1 -
  include/configs/rockchip-common.h | 2 --
  include/configs/rv1108_common.h   | 2 --
  include/configs/vyasa-rk3288.h    | 6 ------
  8 files changed, 23 deletions(-)
include/configs/rk3128_common.h +0 -4
index 8aa17bfbd364..8736b14d1015 100644
@@ -12,13 +12,9 @@
 
  #define CFG_IRAM_BASE		0x10080000
 
-/* RAW SD card / eMMC locations. */
-
  #define CFG_SYS_SDRAM_BASE		0x60000000
  #define SDRAM_MAX_SIZE			0x80000000
 
-/* usb mass storage */
-
  #define ENV_MEM_LAYOUT_SETTINGS \
  	"scriptaddr=0x60500000\0" \
  	"pxefile_addr_r=0x60600000\0" \
include/configs/rk3188_common.h +0 -5
index ac9195672fb7..ebb421c69297 100644
@@ -11,15 +11,10 @@
 
  #define CFG_IRAM_BASE	0x10080000
 
-/* spl size 32kb sram - 2kb bootrom */
-
  #define CFG_SYS_SDRAM_BASE		0x60000000
  #define SDRAM_BANK_SIZE			(2UL << 30)
  #define SDRAM_MAX_SIZE			0x80000000
 
-/* usb otg */
-
-/* usb host support */
  #define ENV_MEM_LAYOUT_SETTINGS \
  	"scriptaddr=0x60000000\0" \
  	"pxefile_addr_r=0x60100000\0" \
include/configs/rk3288_common.h +0 -2
index 5f29432be10b..fa409c70c931 100644
@@ -13,8 +13,6 @@
 
  #define CFG_IRAM_BASE		0xff700000
 
-/* RAW SD card / eMMC locations. */
-
  #define CFG_SYS_SDRAM_BASE		0
  #define SDRAM_BANK_SIZE			(2UL << 30)
  #define SDRAM_MAX_SIZE			0xfe000000
include/configs/rk3328_common.h +0 -1
index 24b21c024dee..e565ccff8979 100644
@@ -10,7 +10,6 @@
 
  #define CFG_IRAM_BASE		0xff090000
 
-/* FAT sd card locations. */
  #define CFG_SYS_SDRAM_BASE		0
  #define SDRAM_MAX_SIZE			0xff000000
 
include/configs/rk3399_common.h +0 -1
index 3ef9ffa2e9c4..04dcbf20bcb5 100644
@@ -10,7 +10,6 @@
 
  #define CFG_IRAM_BASE		0xff8c0000
 
-/* FAT sd card locations. */
  #define CFG_SYS_SDRAM_BASE		0
  #define SDRAM_MAX_SIZE			0xf8000000
 
include/configs/rockchip-common.h +0 -2
index b7c5c6634394..18544d75acc6 100644
@@ -11,8 +11,6 @@
  #define CFG_CPUID_OFFSET	0x7
  #endif
 
-/* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */
-
  #ifndef CONFIG_SPL_BUILD
 
  /* First try to boot from SD (index 1), then eMMC (index 0) */
include/configs/rv1108_common.h +0 -2
index 63551b47e200..050d37bff0b5 100644
@@ -17,8 +17,6 @@
 
  #define CFG_SYS_SDRAM_BASE		0x60000000
 
-/* rockchip ohci host driver */
-
  #define ENV_MEM_LAYOUT_SETTINGS \
  	"scriptaddr=0x60000000\0" \
  	"fdt_addr_r=0x61f00000\0" \
include/configs/vyasa-rk3288.h +0 -6
index e8c1013a71a3..81ff61bf7a6a 100644
@@ -20,10 +20,4 @@
  #define BOOT_TARGET_DEVICES(func) \
  	func(MMC, mmc, 1) \
 
-#ifndef CONFIG_TPL_BUILD
-/* Falcon Mode */
-
-/* Falcon Mode - MMC support: args@16MB kernel@17MB */
-#endif
-
  #endif
#20 lore raw

PATCH 11/12 rockchip: include: configs: Remove unused SDRAM_BANK_SIZE

In reply to Jonas Karlman

Remove unused SDRAM_BANK_SIZE define.

---
 include/configs/evb_rk3328.h           | 2 --
 include/configs/evb_rk3399.h           | 2 --
 include/configs/pinebook-pro-rk3399.h  | 2 --
 include/configs/pinephone-pro-rk3399.h | 2 --
 include/configs/puma_rk3399.h          | 2 --
 include/configs/px30_common.h          | 1 -
 include/configs/rk3188_common.h        | 1 -
 include/configs/rk322x_common.h        | 1 -
 include/configs/rk3288_common.h        | 1 -
 include/configs/rk3308_common.h        | 1 -
 include/configs/roc-pc-rk3399.h        | 2 --
 include/configs/rock960_rk3399.h       | 1 -
 include/configs/rockpro64_rk3399.h     | 1 -
 13 files changed, 19 deletions(-)
include/configs/evb_rk3328.h +0 -2
index cac613d021a8..d10e5b1d2e03 100644
@@ -8,6 +8,4 @@
 
 #include <configs/rk3328_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
 #endif
include/configs/evb_rk3399.h +0 -2
index b7e850370b31..70ab587795e2 100644
@@ -13,6 +13,4 @@
 
 #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
 #endif
include/configs/pinebook-pro-rk3399.h +0 -2
index 241dc39be008..141ffcd036bb 100644
@@ -14,6 +14,4 @@
 
 #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
 #endif
include/configs/pinephone-pro-rk3399.h +0 -2
index 78017d6bcc37..9cd444734392 100644
@@ -14,6 +14,4 @@
 
 #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
 #endif
include/configs/puma_rk3399.h +0 -2
index 23de326e7208..969acc89b937 100644
@@ -8,6 +8,4 @@
 
 #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
 #endif
include/configs/px30_common.h +0 -1
index c0896e5f6281..8df481b09788 100644
@@ -15,7 +15,6 @@
 
 #define CFG_SYS_SDRAM_BASE		0
 #define SDRAM_MAX_SIZE			0xff000000
-#define SDRAM_BANK_SIZE			(2UL << 30)
 
 #define ENV_MEM_LAYOUT_SETTINGS \
 	"scriptaddr=0x00500000\0" \
include/configs/rk3188_common.h +0 -1
index ebb421c69297..fcb274565e9e 100644
@@ -12,7 +12,6 @@
 #define CFG_IRAM_BASE	0x10080000
 
 #define CFG_SYS_SDRAM_BASE		0x60000000
-#define SDRAM_BANK_SIZE			(2UL << 30)
 #define SDRAM_MAX_SIZE			0x80000000
 
 #define ENV_MEM_LAYOUT_SETTINGS \
include/configs/rk322x_common.h +0 -1
index fcaf9c52c4be..39a40f4e2d10 100644
@@ -13,7 +13,6 @@
 #define CFG_IRAM_BASE		0x10080000
 
 #define CFG_SYS_SDRAM_BASE		0x60000000
-#define SDRAM_BANK_SIZE			(512UL << 20UL)
 #define SDRAM_MAX_SIZE			0x80000000
 
 #define ENV_MEM_LAYOUT_SETTINGS \
include/configs/rk3288_common.h +0 -1
index fa409c70c931..71d2426d72a4 100644
@@ -14,7 +14,6 @@
 #define CFG_IRAM_BASE		0xff700000
 
 #define CFG_SYS_SDRAM_BASE		0
-#define SDRAM_BANK_SIZE			(2UL << 30)
 #define SDRAM_MAX_SIZE			0xfe000000
 
 #define ENV_MEM_LAYOUT_SETTINGS \
include/configs/rk3308_common.h +0 -1
index 55a0dfecb21b..ba9ee112e2df 100644
@@ -12,7 +12,6 @@
 
 #define CFG_SYS_SDRAM_BASE		0
 #define SDRAM_MAX_SIZE			0xff000000
-#define SDRAM_BANK_SIZE			(2UL << 30)
 
 #define ENV_MEM_LAYOUT_SETTINGS \
 	"scriptaddr=0x00500000\0" \
include/configs/roc-pc-rk3399.h +0 -2
index 59fe22289cff..f99871cb9fc5 100644
@@ -13,6 +13,4 @@
 
 #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
 #endif
include/configs/rock960_rk3399.h +0 -1
index 6099d2fa55a6..b85978115f5b 100644
@@ -13,5 +13,4 @@
 
 #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
 #endif
include/configs/rockpro64_rk3399.h +0 -1
index 9195b9b99e41..5381efac3f63 100644
@@ -13,5 +13,4 @@
 
 #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
 #endif
Signature · 1 line
2.39.2
Reviewed-by on v1 11/12
#21 lore raw

Re: [PATCH 11/12] rockchip: include: configs: Remove unused SDRAM_BANK_SIZE

Quoted 3 lines · Jonas Karlman

Remove unused SDRAM_BANK_SIZE define.

Thanks,
- Kever

Quoted 162 lines
---
  include/configs/evb_rk3328.h           | 2 --
  include/configs/evb_rk3399.h           | 2 --
  include/configs/pinebook-pro-rk3399.h  | 2 --
  include/configs/pinephone-pro-rk3399.h | 2 --
  include/configs/puma_rk3399.h          | 2 --
  include/configs/px30_common.h          | 1 -
  include/configs/rk3188_common.h        | 1 -
  include/configs/rk322x_common.h        | 1 -
  include/configs/rk3288_common.h        | 1 -
  include/configs/rk3308_common.h        | 1 -
  include/configs/roc-pc-rk3399.h        | 2 --
  include/configs/rock960_rk3399.h       | 1 -
  include/configs/rockpro64_rk3399.h     | 1 -
  13 files changed, 19 deletions(-)
include/configs/evb_rk3328.h +0 -2
index cac613d021a8..d10e5b1d2e03 100644
@@ -8,6 +8,4 @@
 
  #include <configs/rk3328_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
  #endif
include/configs/evb_rk3399.h +0 -2
index b7e850370b31..70ab587795e2 100644
@@ -13,6 +13,4 @@
 
  #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
  #endif
include/configs/pinebook-pro-rk3399.h +0 -2
index 241dc39be008..141ffcd036bb 100644
@@ -14,6 +14,4 @@
 
  #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
  #endif
include/configs/pinephone-pro-rk3399.h +0 -2
index 78017d6bcc37..9cd444734392 100644
@@ -14,6 +14,4 @@
 
  #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
  #endif
include/configs/puma_rk3399.h +0 -2
index 23de326e7208..969acc89b937 100644
@@ -8,6 +8,4 @@
 
  #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
  #endif
include/configs/px30_common.h +0 -1
index c0896e5f6281..8df481b09788 100644
@@ -15,7 +15,6 @@
 
  #define CFG_SYS_SDRAM_BASE		0
  #define SDRAM_MAX_SIZE			0xff000000
-#define SDRAM_BANK_SIZE			(2UL << 30)
 
  #define ENV_MEM_LAYOUT_SETTINGS \
  	"scriptaddr=0x00500000\0" \
include/configs/rk3188_common.h +0 -1
index ebb421c69297..fcb274565e9e 100644
@@ -12,7 +12,6 @@
  #define CFG_IRAM_BASE	0x10080000
 
  #define CFG_SYS_SDRAM_BASE		0x60000000
-#define SDRAM_BANK_SIZE			(2UL << 30)
  #define SDRAM_MAX_SIZE			0x80000000
 
  #define ENV_MEM_LAYOUT_SETTINGS \
include/configs/rk322x_common.h +0 -1
index fcaf9c52c4be..39a40f4e2d10 100644
@@ -13,7 +13,6 @@
  #define CFG_IRAM_BASE		0x10080000
 
  #define CFG_SYS_SDRAM_BASE		0x60000000
-#define SDRAM_BANK_SIZE			(512UL << 20UL)
  #define SDRAM_MAX_SIZE			0x80000000
 
  #define ENV_MEM_LAYOUT_SETTINGS \
include/configs/rk3288_common.h +0 -1
index fa409c70c931..71d2426d72a4 100644
@@ -14,7 +14,6 @@
  #define CFG_IRAM_BASE		0xff700000
 
  #define CFG_SYS_SDRAM_BASE		0
-#define SDRAM_BANK_SIZE			(2UL << 30)
  #define SDRAM_MAX_SIZE			0xfe000000
 
  #define ENV_MEM_LAYOUT_SETTINGS \
include/configs/rk3308_common.h +0 -1
index 55a0dfecb21b..ba9ee112e2df 100644
@@ -12,7 +12,6 @@
 
  #define CFG_SYS_SDRAM_BASE		0
  #define SDRAM_MAX_SIZE			0xff000000
-#define SDRAM_BANK_SIZE			(2UL << 30)
 
  #define ENV_MEM_LAYOUT_SETTINGS \
  	"scriptaddr=0x00500000\0" \
include/configs/roc-pc-rk3399.h +0 -2
index 59fe22289cff..f99871cb9fc5 100644
@@ -13,6 +13,4 @@
 
  #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
-
  #endif
include/configs/rock960_rk3399.h +0 -1
index 6099d2fa55a6..b85978115f5b 100644
@@ -13,5 +13,4 @@
 
  #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
  #endif
include/configs/rockpro64_rk3399.h +0 -1
index 9195b9b99e41..5381efac3f63 100644
@@ -13,5 +13,4 @@
 
  #include <configs/rk3399_common.h>
 
-#define SDRAM_BANK_SIZE			(2UL << 30)
  #endif
#22 lore raw

PATCH 12/12 rockchip: Convert rk35xx to use standard boot

In reply to Jonas Karlman

Imply use of BOOTSTD and OF_LIBFDT_OVERLAY on RK3568 and RK3588. Drop the use of scripts and rely on standard boot for all operation.

---
 arch/arm/mach-rockchip/Kconfig  | 6 ++++++
 include/configs/rk3568_common.h | 9 +++++++--
 include/configs/rk3588_common.h | 9 +++++++--
 3 files changed, 20 insertions(+), 4 deletions(-)
arch/arm/mach-rockchip/Kconfig +6 -0
index e5ac58ae60b5..5e8aacc2ea14 100644
@@ -289,6 +289,9 @@ config ROCKCHIP_RK3568
 	select DM_REGULATOR_FIXED
 	select DM_RESET
 	imply ROCKCHIP_COMMON_BOARD
+	imply BOOTSTD_BOOTCOMMAND
+	imply BOOTSTD_DEFAULTS
+	imply OF_LIBFDT_OVERLAY
 	imply ROCKCHIP_OTP
 	imply MISC_INIT_R
 	help
@@ -310,6 +313,9 @@ config ROCKCHIP_RK3588
 	select SYSCON
 	select BOARD_LATE_INIT
 	imply ROCKCHIP_COMMON_BOARD
+	imply BOOTSTD_BOOTCOMMAND
+	imply BOOTSTD_DEFAULTS
+	imply OF_LIBFDT_OVERLAY
 	imply ROCKCHIP_OTP
 	imply MISC_INIT_R
 	help
include/configs/rk3568_common.h +7 -2
index a5e1dde50888..164c123d9490 100644
@@ -17,10 +17,15 @@
 
 #define ENV_MEM_LAYOUT_SETTINGS		\
 	"scriptaddr=0x00c00000\0"	\
+	"script_offset_f=0xffe000\0"	\
+	"script_size_f=0x2000\0"	\
 	"pxefile_addr_r=0x00e00000\0"	\
 	"fdt_addr_r=0x0a100000\0"	\
+	"fdtoverlay_addr_r=0x02000000\0"	\
 	"kernel_addr_r=0x02080000\0"	\
-	"ramdisk_addr_r=0x0a200000\0"
+	"ramdisk_addr_r=0x0a200000\0"	\
+	"kernel_comp_addr_r=0x08000000\0"	\
+	"kernel_comp_size=0x2000000\0"
 
 #include <config_distro_bootcmd.h>
 #define CFG_EXTRA_ENV_SETTINGS		\
@@ -28,6 +33,6 @@
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"partitions=" PARTS_DEFAULT		\
 	ROCKCHIP_DEVICE_SETTINGS		\
-	BOOTENV
+	BOOTENV_BOOT_TARGETS
 
 #endif
include/configs/rk3588_common.h +7 -2
index abd20139aaf3..7ff0481a69fd 100644
@@ -16,10 +16,15 @@
 
 #define ENV_MEM_LAYOUT_SETTINGS		\
 	"scriptaddr=0x00c00000\0"	\
+	"script_offset_f=0xffe000\0"	\
+	"script_size_f=0x2000\0"	\
 	"pxefile_addr_r=0x00e00000\0"	\
 	"fdt_addr_r=0x0a100000\0"	\
+	"fdtoverlay_addr_r=0x02000000\0"	\
 	"kernel_addr_r=0x02080000\0"	\
-	"ramdisk_addr_r=0x0a200000\0"
+	"ramdisk_addr_r=0x0a200000\0"	\
+	"kernel_comp_addr_r=0x08000000\0"	\
+	"kernel_comp_size=0x2000000\0"
 
 #include <config_distro_bootcmd.h>
 #define CFG_EXTRA_ENV_SETTINGS \
@@ -27,6 +32,6 @@
 	"partitions=" PARTS_DEFAULT		\
 	ENV_MEM_LAYOUT_SETTINGS			\
 	ROCKCHIP_DEVICE_SETTINGS		\
-	BOOTENV
+	BOOTENV_BOOT_TARGETS
 
 #endif /* __CONFIG_RK3588_COMMON_H */
Signature · 1 line
2.39.2
Reviewed-by on v1 12/12
#23 lore raw

Re: [PATCH 12/12] rockchip: Convert rk35xx to use standard boot

Quoted 10 lines · Jonas Karlman

Imply use of BOOTSTD and OF_LIBFDT_OVERLAY on RK3568 and RK3588. Drop the use of scripts and rely on standard boot for all operation.

---
 arch/arm/mach-rockchip/Kconfig  | 6 ++++++
 include/configs/rk3568_common.h | 9 +++++++--
 include/configs/rk3588_common.h | 9 +++++++--
 3 files changed, 20 insertions(+), 4 deletions(-)
#24 lore raw

Re: [PATCH 12/12] rockchip: Convert rk35xx to use standard boot

In reply to Jonas Karlman

Hi Jonas,

    I will pick other patches for fix of this series, and leave this one after the patch set[0] from Simon get land.

Thanks,

- Kever

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 92 lines · Jonas Karlman

Imply use of BOOTSTD and OF_LIBFDT_OVERLAY on RK3568 and RK3588. Drop the use of scripts and rely on standard boot for all operation.

---
  arch/arm/mach-rockchip/Kconfig  | 6 ++++++
  include/configs/rk3568_common.h | 9 +++++++--
  include/configs/rk3588_common.h | 9 +++++++--
  3 files changed, 20 insertions(+), 4 deletions(-)
arch/arm/mach-rockchip/Kconfig +6 -0
index e5ac58ae60b5..5e8aacc2ea14 100644
@@ -289,6 +289,9 @@ config ROCKCHIP_RK3568
  	select DM_REGULATOR_FIXED
  	select DM_RESET
  	imply ROCKCHIP_COMMON_BOARD
+	imply BOOTSTD_BOOTCOMMAND
+	imply BOOTSTD_DEFAULTS
+	imply OF_LIBFDT_OVERLAY
  	imply ROCKCHIP_OTP
  	imply MISC_INIT_R
  	help
@@ -310,6 +313,9 @@ config ROCKCHIP_RK3588
  	select SYSCON
  	select BOARD_LATE_INIT
  	imply ROCKCHIP_COMMON_BOARD
+	imply BOOTSTD_BOOTCOMMAND
+	imply BOOTSTD_DEFAULTS
+	imply OF_LIBFDT_OVERLAY
  	imply ROCKCHIP_OTP
  	imply MISC_INIT_R
  	help
include/configs/rk3568_common.h +7 -2
index a5e1dde50888..164c123d9490 100644
@@ -17,10 +17,15 @@
 
  #define ENV_MEM_LAYOUT_SETTINGS		\
  	"scriptaddr=0x00c00000\0"	\
+	"script_offset_f=0xffe000\0"	\
+	"script_size_f=0x2000\0"	\
  	"pxefile_addr_r=0x00e00000\0"	\
  	"fdt_addr_r=0x0a100000\0"	\
+	"fdtoverlay_addr_r=0x02000000\0"	\
  	"kernel_addr_r=0x02080000\0"	\
-	"ramdisk_addr_r=0x0a200000\0"
+	"ramdisk_addr_r=0x0a200000\0"	\
+	"kernel_comp_addr_r=0x08000000\0"	\
+	"kernel_comp_size=0x2000000\0"
 
  #include <config_distro_bootcmd.h>
  #define CFG_EXTRA_ENV_SETTINGS		\
@@ -28,6 +33,6 @@
  	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
  	"partitions=" PARTS_DEFAULT		\
  	ROCKCHIP_DEVICE_SETTINGS		\
-	BOOTENV
+	BOOTENV_BOOT_TARGETS
 
  #endif
include/configs/rk3588_common.h +7 -2
index abd20139aaf3..7ff0481a69fd 100644
@@ -16,10 +16,15 @@
 
  #define ENV_MEM_LAYOUT_SETTINGS		\
  	"scriptaddr=0x00c00000\0"	\
+	"script_offset_f=0xffe000\0"	\
+	"script_size_f=0x2000\0"	\
  	"pxefile_addr_r=0x00e00000\0"	\
  	"fdt_addr_r=0x0a100000\0"	\
+	"fdtoverlay_addr_r=0x02000000\0"	\
  	"kernel_addr_r=0x02080000\0"	\
-	"ramdisk_addr_r=0x0a200000\0"
+	"ramdisk_addr_r=0x0a200000\0"	\
+	"kernel_comp_addr_r=0x08000000\0"	\
+	"kernel_comp_size=0x2000000\0"
 
  #include <config_distro_bootcmd.h>
  #define CFG_EXTRA_ENV_SETTINGS \
@@ -27,6 +32,6 @@
  	"partitions=" PARTS_DEFAULT		\
  	ENV_MEM_LAYOUT_SETTINGS			\
  	ROCKCHIP_DEVICE_SETTINGS		\
-	BOOTENV
+	BOOTENV_BOOT_TARGETS
 
  #endif /* __CONFIG_RK3588_COMMON_H */
#25 lore raw

Re: [PATCH 12/12] rockchip: Convert rk35xx to use standard boot

Hi Kever,

Quoted 4 lines · Kever Yang

Hi Jonas,

    I will pick other patches for fix of this series, and leave this
one after the patch set[0] from Simon get land.

Thanks, I noticed that you did not include the following two patches in your pull request.

Please consider them for next pull request to master to fix booting on RK3588 / Radxa ROCK 5 Model B.

rockchip: Use an external TPL binary on RK3588 (prerequisite to fixes series)
- https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

rockchip: rk3588-rock-5b: Fix sdmmc boot (06/12 of fixes series)
- https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

The generated u-boot-rockchip.bin will not contain rockchip TPL and is not bootable by default on RK3588 without the first patch.

Thanks,
Jonas

Quoted 100 lines

Thanks,

- Kever

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/>>

Quoted 92 lines · Jonas Karlman

Imply use of BOOTSTD and OF_LIBFDT_OVERLAY on RK3568 and RK3588. Drop the use of scripts and rely on standard boot for all operation.

---
  arch/arm/mach-rockchip/Kconfig  | 6 ++++++
  include/configs/rk3568_common.h | 9 +++++++--
  include/configs/rk3588_common.h | 9 +++++++--
  3 files changed, 20 insertions(+), 4 deletions(-)
arch/arm/mach-rockchip/Kconfig +6 -0
index e5ac58ae60b5..5e8aacc2ea14 100644
@@ -289,6 +289,9 @@ config ROCKCHIP_RK3568
  	select DM_REGULATOR_FIXED
  	select DM_RESET
  	imply ROCKCHIP_COMMON_BOARD
+	imply BOOTSTD_BOOTCOMMAND
+	imply BOOTSTD_DEFAULTS
+	imply OF_LIBFDT_OVERLAY
  	imply ROCKCHIP_OTP
  	imply MISC_INIT_R
  	help
@@ -310,6 +313,9 @@ config ROCKCHIP_RK3588
  	select SYSCON
  	select BOARD_LATE_INIT
  	imply ROCKCHIP_COMMON_BOARD
+	imply BOOTSTD_BOOTCOMMAND
+	imply BOOTSTD_DEFAULTS
+	imply OF_LIBFDT_OVERLAY
  	imply ROCKCHIP_OTP
  	imply MISC_INIT_R
  	help
include/configs/rk3568_common.h +7 -2
index a5e1dde50888..164c123d9490 100644
@@ -17,10 +17,15 @@
 
  #define ENV_MEM_LAYOUT_SETTINGS		\
  	"scriptaddr=0x00c00000\0"	\
+	"script_offset_f=0xffe000\0"	\
+	"script_size_f=0x2000\0"	\
  	"pxefile_addr_r=0x00e00000\0"	\
  	"fdt_addr_r=0x0a100000\0"	\
+	"fdtoverlay_addr_r=0x02000000\0"	\
  	"kernel_addr_r=0x02080000\0"	\
-	"ramdisk_addr_r=0x0a200000\0"
+	"ramdisk_addr_r=0x0a200000\0"	\
+	"kernel_comp_addr_r=0x08000000\0"	\
+	"kernel_comp_size=0x2000000\0"
 
  #include <config_distro_bootcmd.h>
  #define CFG_EXTRA_ENV_SETTINGS		\
@@ -28,6 +33,6 @@
  	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
  	"partitions=" PARTS_DEFAULT		\
  	ROCKCHIP_DEVICE_SETTINGS		\
-	BOOTENV
+	BOOTENV_BOOT_TARGETS
 
  #endif
include/configs/rk3588_common.h +7 -2
index abd20139aaf3..7ff0481a69fd 100644
@@ -16,10 +16,15 @@
 
  #define ENV_MEM_LAYOUT_SETTINGS		\
  	"scriptaddr=0x00c00000\0"	\
+	"script_offset_f=0xffe000\0"	\
+	"script_size_f=0x2000\0"	\
  	"pxefile_addr_r=0x00e00000\0"	\
  	"fdt_addr_r=0x0a100000\0"	\
+	"fdtoverlay_addr_r=0x02000000\0"	\
  	"kernel_addr_r=0x02080000\0"	\
-	"ramdisk_addr_r=0x0a200000\0"
+	"ramdisk_addr_r=0x0a200000\0"	\
+	"kernel_comp_addr_r=0x08000000\0"	\
+	"kernel_comp_size=0x2000000\0"
 
  #include <config_distro_bootcmd.h>
  #define CFG_EXTRA_ENV_SETTINGS \
@@ -27,6 +32,6 @@
  	"partitions=" PARTS_DEFAULT		\
  	ENV_MEM_LAYOUT_SETTINGS			\
  	ROCKCHIP_DEVICE_SETTINGS		\
-	BOOTENV
+	BOOTENV_BOOT_TARGETS
 
  #endif /* __CONFIG_RK3588_COMMON_H */