[PATCH 00/12] 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/20230228213822.3583989-1-jo...
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(-)

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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se --- 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(-)
diff --git a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi index a27a3adc082b..27735c49ddc0 100644 --- a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi +++ b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi @@ -11,7 +11,7 @@ };
&uart0 { - bootph-all; + u-boot,dm-pre-reloc; clock-frequency = <24000000>; status = "okay"; }; diff --git a/arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi b/arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi index 4e791738335f..589332503e72 100644 --- a/arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +++ b/arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi @@ -13,6 +13,6 @@
&uart2 { clock-frequency = <24000000>; - bootph-all; + u-boot,dm-pre-reloc; status = "okay"; }; diff --git a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi index ed47efa44bf9..b5ca23a82a20 100644 --- a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +++ b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi @@ -19,6 +19,6 @@
&uart2 { clock-frequency = <24000000>; - bootph-all; + u-boot,dm-pre-reloc; status = "okay"; }; diff --git a/arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi b/arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi index 3235bd36e4c8..612966492b02 100644 --- a/arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi +++ b/arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi @@ -18,7 +18,7 @@
&sdmmc { bus-width = <4>; - bootph-all; + u-boot,dm-pre-reloc; u-boot,spl-fifo-mode; status = "okay"; }; diff --git a/arch/arm/dts/rk3588s-u-boot.dtsi b/arch/arm/dts/rk3588s-u-boot.dtsi index 1e225d71efc2..f880f4a16741 100644 --- a/arch/arm/dts/rk3588s-u-boot.dtsi +++ b/arch/arm/dts/rk3588s-u-boot.dtsi @@ -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; };

Hi Jonas,
On 2023/3/14 08:38, Jonas Karlman wrote:
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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
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.
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
[0] https://patchwork.ozlabs.org/project/uboot/cover/20230213155641.1208774-1-sj...
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(-)
diff --git a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi index a27a3adc082b..27735c49ddc0 100644 --- a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi +++ b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi @@ -11,7 +11,7 @@ };
&uart0 {
- bootph-all;
- u-boot,dm-pre-reloc; clock-frequency = <24000000>; status = "okay"; };
diff --git a/arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi b/arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi index 4e791738335f..589332503e72 100644 --- a/arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +++ b/arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi @@ -13,6 +13,6 @@
&uart2 { clock-frequency = <24000000>;
- bootph-all;
- u-boot,dm-pre-reloc; status = "okay"; };
diff --git a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi index ed47efa44bf9..b5ca23a82a20 100644 --- a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +++ b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi @@ -19,6 +19,6 @@
&uart2 { clock-frequency = <24000000>;
- bootph-all;
- u-boot,dm-pre-reloc; status = "okay"; };
diff --git a/arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi b/arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi index 3235bd36e4c8..612966492b02 100644 --- a/arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi +++ b/arch/arm/dts/rk3588-edgeble-neu6a-io-u-boot.dtsi @@ -18,7 +18,7 @@
&sdmmc { bus-width = <4>;
- bootph-all;
- u-boot,dm-pre-reloc; u-boot,spl-fifo-mode; status = "okay"; };
diff --git a/arch/arm/dts/rk3588s-u-boot.dtsi b/arch/arm/dts/rk3588s-u-boot.dtsi index 1e225d71efc2..f880f4a16741 100644 --- a/arch/arm/dts/rk3588s-u-boot.dtsi +++ b/arch/arm/dts/rk3588s-u-boot.dtsi @@ -8,12 +8,12 @@ / { dmc { compatible = "rockchip,rk3588-dmc";
bootph-all;
u-boot,dm-pre-reloc;
status = "okay"; };
pmu1_grf: syscon@fd58a000 {
bootph-all;
compatible = "rockchip,rk3588-pmu1-grf", "syscon"; reg = <0x0 0xfd58a000 0x0 0x2000>; };u-boot,dm-pre-reloc;
@@ -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; };

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") Signed-off-by: Jonas Karlman jonas@kwiboo.se --- arch/arm/dts/rk356x-u-boot.dtsi | 2 +- arch/arm/mach-rockchip/rk3568/rk3568.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk356x-u-boot.dtsi b/arch/arm/dts/rk356x-u-boot.dtsi index 23316410496d..04a7b0a0f668 100644 --- a/arch/arm/dts/rk356x-u-boot.dtsi +++ b/arch/arm/dts/rk356x-u-boot.dtsi @@ -12,7 +12,7 @@ };
chosen { - u-boot,spl-boot-order = &sdhci, &sdmmc0; + u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc0; };
dmc: dmc { diff --git a/arch/arm/mach-rockchip/rk3568/rk3568.c b/arch/arm/mach-rockchip/rk3568/rk3568.c index 4a08820a0937..69ef19cc85af 100644 --- a/arch/arm/mach-rockchip/rk3568/rk3568.c +++ b/arch/arm/mach-rockchip/rk3568/rk3568.c @@ -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", };

On 2023/3/14 08:38, Jonas Karlman wrote:
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") Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
arch/arm/dts/rk356x-u-boot.dtsi | 2 +- arch/arm/mach-rockchip/rk3568/rk3568.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk356x-u-boot.dtsi b/arch/arm/dts/rk356x-u-boot.dtsi index 23316410496d..04a7b0a0f668 100644 --- a/arch/arm/dts/rk356x-u-boot.dtsi +++ b/arch/arm/dts/rk356x-u-boot.dtsi @@ -12,7 +12,7 @@ };
chosen {
u-boot,spl-boot-order = &sdhci, &sdmmc0;
u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc0;
};
dmc: dmc {
diff --git a/arch/arm/mach-rockchip/rk3568/rk3568.c b/arch/arm/mach-rockchip/rk3568/rk3568.c index 4a08820a0937..69ef19cc85af 100644 --- a/arch/arm/mach-rockchip/rk3568/rk3568.c +++ b/arch/arm/mach-rockchip/rk3568/rk3568.c @@ -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", };

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") Signed-off-by: Jonas Karlman jonas@kwiboo.se --- 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(-)
diff --git a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi index b5ca23a82a20..04bbb01b5d51 100644 --- a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +++ b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi @@ -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 { diff --git a/arch/arm/dts/rk3568-rock-3a.dts b/arch/arm/dts/rk3568-rock-3a.dts index a2f2baa4ea91..917f5b2b8aab 100644 --- a/arch/arm/dts/rk3568-rock-3a.dts +++ b/arch/arm/dts/rk3568-rock-3a.dts @@ -1,22 +1,37 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) -/* - * Copyright (c) 2021 Rockchip Electronics Co., Ltd. - * Copyright (c) 2023 Akash Gajjar gajjar04akash@gmail.com - */
/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>; + }; +};

On 2023/3/14 08:38, Jonas Karlman wrote:
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") Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
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(-)
diff --git a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi index b5ca23a82a20..04bbb01b5d51 100644 --- a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +++ b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi @@ -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 {
diff --git a/arch/arm/dts/rk3568-rock-3a.dts b/arch/arm/dts/rk3568-rock-3a.dts index a2f2baa4ea91..917f5b2b8aab 100644 --- a/arch/arm/dts/rk3568-rock-3a.dts +++ b/arch/arm/dts/rk3568-rock-3a.dts @@ -1,22 +1,37 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) -/*
- Copyright (c) 2021 Rockchip Electronics Co., Ltd.
- Copyright (c) 2023 Akash Gajjar gajjar04akash@gmail.com
*/
/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";
regulator-name = "vcc5v0_usb_otg"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>;pinctrl-0 = <&vcc5v0_usb_otg_en>;
@@ -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>;
- };
+};

From: Peter Geis pgwipeout@gmail.com
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") Signed-off-by: Peter Geis pgwipeout@gmail.com Reviewed-by: Kever Yang kever.yang@rock-chips.com Reviewed-by: Jagan Teki jagan@amarulasolutions.com Tested-by: Jagan Teki jagan@amarulasolutions.com # radxa-cm3 Signed-off-by: Jonas Karlman jonas@kwiboo.se --- Link: https://patchwork.ozlabs.org/project/uboot/patch/20220222013131.3114990-2-pg...
drivers/clk/rockchip/clk_rk3568.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/clk/rockchip/clk_rk3568.c b/drivers/clk/rockchip/clk_rk3568.c index 99c195b3afe3..253b69504f93 100644 --- a/drivers/clk/rockchip/clk_rk3568.c +++ b/drivers/clk/rockchip/clk_rk3568.c @@ -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)

The rate and error value is not returned for aux16m clocks, fix this.
Fixes: 7a474df74023 ("clk: rockchip: Add rk3588 clk support") Signed-off-by: Jonas Karlman jonas@kwiboo.se --- drivers/clk/rockchip/clk_rk3588.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/rockchip/clk_rk3588.c b/drivers/clk/rockchip/clk_rk3588.c index 5271d9434831..a7df553e8750 100644 --- a/drivers/clk/rockchip/clk_rk3588.c +++ b/drivers/clk/rockchip/clk_rk3588.c @@ -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:

On 2023/3/14 08:38, Jonas Karlman wrote:
The rate and error value is not returned for aux16m clocks, fix this.
Fixes: 7a474df74023 ("clk: rockchip: Add rk3588 clk support") Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
drivers/clk/rockchip/clk_rk3588.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/rockchip/clk_rk3588.c b/drivers/clk/rockchip/clk_rk3588.c index 5271d9434831..a7df553e8750 100644 --- a/drivers/clk/rockchip/clk_rk3588.c +++ b/drivers/clk/rockchip/clk_rk3588.c @@ -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);
break; case ACLK_VOP_ROOT: case ACLK_VOP:rate = rk3588_aux16m_get_clk(priv, clk->id);
@@ -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);
break; case ACLK_VOP_ROOT: case ACLK_VOP:ret = rk3588_aux16m_set_clk(priv, clk->id, rate);

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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se --- arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 3 ++- configs/rock5b-rk3588_defconfig | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi b/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi index 2386edf90deb..36d557b4934d 100644 --- a/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +++ b/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi @@ -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"; }; diff --git a/configs/rock5b-rk3588_defconfig b/configs/rock5b-rk3588_defconfig index 66199387195a..3fcc6a26bb51 100644 --- a/configs/rock5b-rk3588_defconfig +++ b/configs/rock5b-rk3588_defconfig @@ -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

On 2023/3/14 08:38, Jonas Karlman wrote:
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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 3 ++- configs/rock5b-rk3588_defconfig | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi b/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi index 2386edf90deb..36d557b4934d 100644 --- a/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +++ b/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi @@ -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"; };
diff --git a/configs/rock5b-rk3588_defconfig b/configs/rock5b-rk3588_defconfig index 66199387195a..3fcc6a26bb51 100644 --- a/configs/rock5b-rk3588_defconfig +++ b/configs/rock5b-rk3588_defconfig @@ -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

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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se --- arch/arm/mach-rockchip/rk3588/rk3588.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3588/rk3588.c b/arch/arm/mach-rockchip/rk3588/rk3588.c index 2ee1db47671f..18e67b5ca9b2 100644 --- a/arch/arm/mach-rockchip/rk3588/rk3588.c +++ b/arch/arm/mach-rockchip/rk3588/rk3588.c @@ -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,

On 2023/3/14 08:38, Jonas Karlman wrote:
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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
arch/arm/mach-rockchip/rk3588/rk3588.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3588/rk3588.c b/arch/arm/mach-rockchip/rk3588/rk3588.c index 2ee1db47671f..18e67b5ca9b2 100644 --- a/arch/arm/mach-rockchip/rk3588/rk3588.c +++ b/arch/arm/mach-rockchip/rk3588/rk3588.c @@ -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,

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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se --- include/configs/tinker_rk3288.h | 9 --------- 1 file changed, 9 deletions(-)
diff --git a/include/configs/tinker_rk3288.h b/include/configs/tinker_rk3288.h index 269ec529a340..053c9032e2da 100644 --- a/include/configs/tinker_rk3288.h +++ b/include/configs/tinker_rk3288.h @@ -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

On 2023/3/14 08:38, Jonas Karlman wrote:
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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
include/configs/tinker_rk3288.h | 9 --------- 1 file changed, 9 deletions(-)
diff --git a/include/configs/tinker_rk3288.h b/include/configs/tinker_rk3288.h index 269ec529a340..053c9032e2da 100644 --- a/include/configs/tinker_rk3288.h +++ b/include/configs/tinker_rk3288.h @@ -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

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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se --- drivers/mmc/rockchip_dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index 3661ce33143e..72c820ee6330 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -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;

On 2023/3/14 08:38, Jonas Karlman wrote:
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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
drivers/mmc/rockchip_dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index 3661ce33143e..72c820ee6330 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -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;

This removes dangling comments that no longer serve a purpose and has been left after conversion of defines to Kconfig option.
Signed-off-by: Jonas Karlman jonas@kwiboo.se --- 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(-)
diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h index 8aa17bfbd364..8736b14d1015 100644 --- a/include/configs/rk3128_common.h +++ b/include/configs/rk3128_common.h @@ -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" \ diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index ac9195672fb7..ebb421c69297 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -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" \ diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 5f29432be10b..fa409c70c931 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -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 diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index 24b21c024dee..e565ccff8979 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -10,7 +10,6 @@
#define CFG_IRAM_BASE 0xff090000
-/* FAT sd card locations. */ #define CFG_SYS_SDRAM_BASE 0 #define SDRAM_MAX_SIZE 0xff000000
diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index 3ef9ffa2e9c4..04dcbf20bcb5 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -10,7 +10,6 @@
#define CFG_IRAM_BASE 0xff8c0000
-/* FAT sd card locations. */ #define CFG_SYS_SDRAM_BASE 0 #define SDRAM_MAX_SIZE 0xf8000000
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index b7c5c6634394..18544d75acc6 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -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) */ diff --git a/include/configs/rv1108_common.h b/include/configs/rv1108_common.h index 63551b47e200..050d37bff0b5 100644 --- a/include/configs/rv1108_common.h +++ b/include/configs/rv1108_common.h @@ -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" \ diff --git a/include/configs/vyasa-rk3288.h b/include/configs/vyasa-rk3288.h index e8c1013a71a3..81ff61bf7a6a 100644 --- a/include/configs/vyasa-rk3288.h +++ b/include/configs/vyasa-rk3288.h @@ -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

On 2023/3/14 08:38, Jonas Karlman wrote:
This removes dangling comments that no longer serve a purpose and has been left after conversion of defines to Kconfig option.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
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(-)
diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h index 8aa17bfbd364..8736b14d1015 100644 --- a/include/configs/rk3128_common.h +++ b/include/configs/rk3128_common.h @@ -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" \
diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index ac9195672fb7..ebb421c69297 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -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" \ diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 5f29432be10b..fa409c70c931 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -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
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index 24b21c024dee..e565ccff8979 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -10,7 +10,6 @@
#define CFG_IRAM_BASE 0xff090000
-/* FAT sd card locations. */ #define CFG_SYS_SDRAM_BASE 0 #define SDRAM_MAX_SIZE 0xff000000
diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index 3ef9ffa2e9c4..04dcbf20bcb5 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -10,7 +10,6 @@
#define CFG_IRAM_BASE 0xff8c0000
-/* FAT sd card locations. */ #define CFG_SYS_SDRAM_BASE 0 #define SDRAM_MAX_SIZE 0xf8000000
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index b7c5c6634394..18544d75acc6 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -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) */
diff --git a/include/configs/rv1108_common.h b/include/configs/rv1108_common.h index 63551b47e200..050d37bff0b5 100644 --- a/include/configs/rv1108_common.h +++ b/include/configs/rv1108_common.h @@ -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" \
diff --git a/include/configs/vyasa-rk3288.h b/include/configs/vyasa-rk3288.h index e8c1013a71a3..81ff61bf7a6a 100644 --- a/include/configs/vyasa-rk3288.h +++ b/include/configs/vyasa-rk3288.h @@ -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

Remove unused SDRAM_BANK_SIZE define.
Signed-off-by: Jonas Karlman jonas@kwiboo.se --- 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(-)
diff --git a/include/configs/evb_rk3328.h b/include/configs/evb_rk3328.h index cac613d021a8..d10e5b1d2e03 100644 --- a/include/configs/evb_rk3328.h +++ b/include/configs/evb_rk3328.h @@ -8,6 +8,4 @@
#include <configs/rk3328_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) - #endif diff --git a/include/configs/evb_rk3399.h b/include/configs/evb_rk3399.h index b7e850370b31..70ab587795e2 100644 --- a/include/configs/evb_rk3399.h +++ b/include/configs/evb_rk3399.h @@ -13,6 +13,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) - #endif diff --git a/include/configs/pinebook-pro-rk3399.h b/include/configs/pinebook-pro-rk3399.h index 241dc39be008..141ffcd036bb 100644 --- a/include/configs/pinebook-pro-rk3399.h +++ b/include/configs/pinebook-pro-rk3399.h @@ -14,6 +14,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) - #endif diff --git a/include/configs/pinephone-pro-rk3399.h b/include/configs/pinephone-pro-rk3399.h index 78017d6bcc37..9cd444734392 100644 --- a/include/configs/pinephone-pro-rk3399.h +++ b/include/configs/pinephone-pro-rk3399.h @@ -14,6 +14,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) - #endif diff --git a/include/configs/puma_rk3399.h b/include/configs/puma_rk3399.h index 23de326e7208..969acc89b937 100644 --- a/include/configs/puma_rk3399.h +++ b/include/configs/puma_rk3399.h @@ -8,6 +8,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) - #endif diff --git a/include/configs/px30_common.h b/include/configs/px30_common.h index c0896e5f6281..8df481b09788 100644 --- a/include/configs/px30_common.h +++ b/include/configs/px30_common.h @@ -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" \ diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index ebb421c69297..fcb274565e9e 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -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 \ diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h index fcaf9c52c4be..39a40f4e2d10 100644 --- a/include/configs/rk322x_common.h +++ b/include/configs/rk322x_common.h @@ -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 \ diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index fa409c70c931..71d2426d72a4 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -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 \ diff --git a/include/configs/rk3308_common.h b/include/configs/rk3308_common.h index 55a0dfecb21b..ba9ee112e2df 100644 --- a/include/configs/rk3308_common.h +++ b/include/configs/rk3308_common.h @@ -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" \ diff --git a/include/configs/roc-pc-rk3399.h b/include/configs/roc-pc-rk3399.h index 59fe22289cff..f99871cb9fc5 100644 --- a/include/configs/roc-pc-rk3399.h +++ b/include/configs/roc-pc-rk3399.h @@ -13,6 +13,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) - #endif diff --git a/include/configs/rock960_rk3399.h b/include/configs/rock960_rk3399.h index 6099d2fa55a6..b85978115f5b 100644 --- a/include/configs/rock960_rk3399.h +++ b/include/configs/rock960_rk3399.h @@ -13,5 +13,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) #endif diff --git a/include/configs/rockpro64_rk3399.h b/include/configs/rockpro64_rk3399.h index 9195b9b99e41..5381efac3f63 100644 --- a/include/configs/rockpro64_rk3399.h +++ b/include/configs/rockpro64_rk3399.h @@ -13,5 +13,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) #endif

On 2023/3/14 08:38, Jonas Karlman wrote:
Remove unused SDRAM_BANK_SIZE define.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
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(-)
diff --git a/include/configs/evb_rk3328.h b/include/configs/evb_rk3328.h index cac613d021a8..d10e5b1d2e03 100644 --- a/include/configs/evb_rk3328.h +++ b/include/configs/evb_rk3328.h @@ -8,6 +8,4 @@
#include <configs/rk3328_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30)
- #endif
diff --git a/include/configs/evb_rk3399.h b/include/configs/evb_rk3399.h index b7e850370b31..70ab587795e2 100644 --- a/include/configs/evb_rk3399.h +++ b/include/configs/evb_rk3399.h @@ -13,6 +13,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30)
- #endif
diff --git a/include/configs/pinebook-pro-rk3399.h b/include/configs/pinebook-pro-rk3399.h index 241dc39be008..141ffcd036bb 100644 --- a/include/configs/pinebook-pro-rk3399.h +++ b/include/configs/pinebook-pro-rk3399.h @@ -14,6 +14,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30)
- #endif
diff --git a/include/configs/pinephone-pro-rk3399.h b/include/configs/pinephone-pro-rk3399.h index 78017d6bcc37..9cd444734392 100644 --- a/include/configs/pinephone-pro-rk3399.h +++ b/include/configs/pinephone-pro-rk3399.h @@ -14,6 +14,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30)
- #endif
diff --git a/include/configs/puma_rk3399.h b/include/configs/puma_rk3399.h index 23de326e7208..969acc89b937 100644 --- a/include/configs/puma_rk3399.h +++ b/include/configs/puma_rk3399.h @@ -8,6 +8,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30)
- #endif
diff --git a/include/configs/px30_common.h b/include/configs/px30_common.h index c0896e5f6281..8df481b09788 100644 --- a/include/configs/px30_common.h +++ b/include/configs/px30_common.h @@ -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" \ diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index ebb421c69297..fcb274565e9e 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -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 \ diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h index fcaf9c52c4be..39a40f4e2d10 100644 --- a/include/configs/rk322x_common.h +++ b/include/configs/rk322x_common.h @@ -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 \ diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index fa409c70c931..71d2426d72a4 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -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 \ diff --git a/include/configs/rk3308_common.h b/include/configs/rk3308_common.h index 55a0dfecb21b..ba9ee112e2df 100644 --- a/include/configs/rk3308_common.h +++ b/include/configs/rk3308_common.h @@ -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" \ diff --git a/include/configs/roc-pc-rk3399.h b/include/configs/roc-pc-rk3399.h index 59fe22289cff..f99871cb9fc5 100644 --- a/include/configs/roc-pc-rk3399.h +++ b/include/configs/roc-pc-rk3399.h @@ -13,6 +13,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30)
- #endif
diff --git a/include/configs/rock960_rk3399.h b/include/configs/rock960_rk3399.h index 6099d2fa55a6..b85978115f5b 100644 --- a/include/configs/rock960_rk3399.h +++ b/include/configs/rock960_rk3399.h @@ -13,5 +13,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) #endif diff --git a/include/configs/rockpro64_rk3399.h b/include/configs/rockpro64_rk3399.h index 9195b9b99e41..5381efac3f63 100644 --- a/include/configs/rockpro64_rk3399.h +++ b/include/configs/rockpro64_rk3399.h @@ -13,5 +13,4 @@
#include <configs/rk3399_common.h>
-#define SDRAM_BANK_SIZE (2UL << 30) #endif

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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se --- 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(-)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index e5ac58ae60b5..5e8aacc2ea14 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -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 diff --git a/include/configs/rk3568_common.h b/include/configs/rk3568_common.h index a5e1dde50888..164c123d9490 100644 --- a/include/configs/rk3568_common.h +++ b/include/configs/rk3568_common.h @@ -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 diff --git a/include/configs/rk3588_common.h b/include/configs/rk3588_common.h index abd20139aaf3..7ff0481a69fd 100644 --- a/include/configs/rk3588_common.h +++ b/include/configs/rk3588_common.h @@ -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 */

On Mon, 13 Mar 2023 at 18:38, Jonas Karlman jonas@kwiboo.se wrote:
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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
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(-)
Reviewed-by: Simon Glass sjg@chromium.org

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/20230302033930.2546548-7-sj...
On 2023/3/14 08:38, Jonas Karlman wrote:
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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
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(-)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index e5ac58ae60b5..5e8aacc2ea14 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -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
diff --git a/include/configs/rk3568_common.h b/include/configs/rk3568_common.h index a5e1dde50888..164c123d9490 100644 --- a/include/configs/rk3568_common.h +++ b/include/configs/rk3568_common.h @@ -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
diff --git a/include/configs/rk3588_common.h b/include/configs/rk3588_common.h index abd20139aaf3..7ff0481a69fd 100644 --- a/include/configs/rk3588_common.h +++ b/include/configs/rk3588_common.h @@ -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 */

Hi Kever, On 2023-03-19 07:16, Kever Yang wrote:
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/20230228213822.3583989-1-jo...
rockchip: rk3588-rock-5b: Fix sdmmc boot (06/12 of fixes series) - https://patchwork.ozlabs.org/project/uboot/patch/20230314003755.512696-7-jon...
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
Thanks,
- Kever
https://patchwork.ozlabs.org/project/uboot/patch/20230302033930.2546548-7-sj... On 2023/3/14 08:38, Jonas Karlman wrote:
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.
Signed-off-by: Jonas Karlman jonas@kwiboo.se
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(-)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index e5ac58ae60b5..5e8aacc2ea14 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -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
diff --git a/include/configs/rk3568_common.h b/include/configs/rk3568_common.h index a5e1dde50888..164c123d9490 100644 --- a/include/configs/rk3568_common.h +++ b/include/configs/rk3568_common.h @@ -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
diff --git a/include/configs/rk3588_common.h b/include/configs/rk3588_common.h index abd20139aaf3..7ff0481a69fd 100644 --- a/include/configs/rk3588_common.h +++ b/include/configs/rk3588_common.h @@ -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 */
participants (3)
-
Jonas Karlman
-
Kever Yang
-
Simon Glass