Skip to contentSkip to conversation

rockchip: rk35xx: Miscellaneous fixes and updates

PATCH Superseded Jonas Karlman 2 participants 34 messages Mar 29, 2024 – Apr 2, 2024

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover rockchip: rk35xx: Miscellaneous fixes and updates

This series include miscellaneous fixes and updates for RK356x and RK3588 boards.

Patch 1-2 adds support for reference clocks used by USB driver.

Patch 3-5 drops unnecessary Kconfig options.

Patch 6-9 sort and imply RNG, PHY_GIGE and BOOTSTD_FULL Kconfig options.

Patch 10-12 sort and update use of bootph properties.

Patch 13-16 fixes minor issues observed with newly added boards.

Patch 17 enables options on rk3588-edgeble-neu6 boards to closer match other RK35xx boards.

Patch 18-19 adds SPI flash and USB OTG support to the rk35xx-generic boards.

Jonas Karlman (19):
clk: rockchip: rk356x: Add CLK_USB3OTGx_REF support
clk: rockchip: rk3588: Add REF_CLK_USB3OTGx support
rockchip: rk35xx: Drop USB_GADGET_PRODUCT_NUM Kconfig option
rockchip: rk3588: Drop REGULATOR_PWM Kconfig option
rockchip: rk3566-anbernic-rgxx3: Remove SPL_ROCKCHIP_BACK_TO_BROM
option
rockchip: rk35xx: Sort imply statements alphabetically
rockchip: rk35xx: Enable random generator
rockchip: rk35xx: Imply support for GbE PHY
rockchip: rk356x: Imply enhanced features for standard boot
rockchip: rk35xx: Sort soc u-boot.dtsi alphabetically
rockchip: rk356x: Update bootph props
rockchip: rk3588: Update bootph props
rockchip: rk3566-pinetab2: Fix reading FIT from SPI flash
rockchip: rk3588-coolpi: Add boards to documentation
rockchip: rk3588-toybrick: Add missing Kconfig options
rockchip: rk3588-turing-rk1: Use dwc3-generic driver
rockchip: rk3588-edgeble-neu6: Enable FIT checksum validation
rockchip: rk356x-generic: Add support for SPI flash and USB OTG
rockchip: rk3588-generic: Add support for USB OTG

 arch/arm/dts/Makefile                         |   5 +-
 .../arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi |   6 -
 arch/arm/dts/rk3566-pinetab2-u-boot.dtsi      |  24 ++--
 arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi    |   8 +-
 arch/arm/dts/rk3566-quartz64-b-u-boot.dtsi    |   4 +-
 arch/arm/dts/rk3568-generic-u-boot.dtsi       |   7 +
 arch/arm/dts/rk3568-generic.dts               |  38 +++++-
 arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi     |   6 +-
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi       |   3 +-
 arch/arm/dts/rk356x-u-boot.dtsi               | 125 +++++++++---------
 .../arm/dts/rk3588-coolpi-cm5-evb-u-boot.dtsi |   5 +-
 arch/arm/dts/rk3588-generic-u-boot.dtsi       |  22 +++
 arch/arm/dts/rk3588-generic.dts               |   4 +-
 arch/arm/dts/rk3588-nanopc-t6-u-boot.dtsi     |   9 +-
 .../dts/rk3588-orangepi-5-plus-u-boot.dtsi    |   6 +-
 arch/arm/dts/rk3588-rock-5b-u-boot.dtsi       |   5 +-
 arch/arm/dts/rk3588-turing-rk1-u-boot.dtsi    |   6 +-
 arch/arm/dts/rk3588s-coolpi-4b-u-boot.dtsi    |   5 +-
 arch/arm/dts/rk3588s-orangepi-5-u-boot.dtsi   |   8 +-
 arch/arm/dts/rk3588s-u-boot.dtsi              |  98 +++++++-------
 arch/arm/mach-rockchip/Kconfig                |  31 +++--
 configs/anbernic-rgxx3-rk3566_defconfig       |   4 -
 configs/bpi-r2-pro-rk3568_defconfig           |   1 -
 configs/evb-rk3568_defconfig                  |   3 +-
 configs/evb-rk3588_defconfig                  |   5 +-
 configs/generic-rk3568_defconfig              |  31 +++++
 configs/generic-rk3588_defconfig              |  17 +++
 configs/neu6a-io-rk3588_defconfig             |   8 +-
 configs/neu6b-io-rk3588_defconfig             |   8 +-
 configs/pinetab2-rk3566_defconfig             |   2 +-
 configs/quartzpro64-rk3588_defconfig          |   1 -
 configs/rock5b-rk3588_defconfig               |   2 -
 configs/toybrick-rk3588_defconfig             |   6 +-
 configs/turing-rk1-rk3588_defconfig           |   6 +-
 doc/board/rockchip/rockchip.rst               |   2 +
 drivers/clk/rockchip/clk_rk3568.c             |   4 +
 drivers/clk/rockchip/clk_rk3588.c             |   6 +
 37 files changed, 332 insertions(+), 199 deletions(-)
Signature · 1 line
2.43.2
#1 lore raw

PATCH 1/19 clk: rockchip: rk356x: Add CLK_USB3OTGx_REF support

The CLK_USB3OTGx_REF clocks is used as reference clock for USB3 block.

Add simple support to get rate of CLK_USB3OTGx_REF clocks to fix reference clock period configuration.

---
 drivers/clk/rockchip/clk_rk3568.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/clk/rockchip/clk_rk3568.c +4 -0
index 57ef27dda893..999f48ea4b4e 100644
@@ -2417,6 +2417,8 @@ static ulong rk3568_clk_get_rate(struct clk *clk)
 	case BCLK_EMMC:
 		rate = rk3568_emmc_get_bclk(priv);
 		break;
+	case CLK_USB3OTG0_REF:
+	case CLK_USB3OTG1_REF:
 	case TCLK_EMMC:
 		rate = OSC_HZ;
 		break;
@@ -2596,6 +2598,8 @@ static ulong rk3568_clk_set_rate(struct clk *clk, ulong rate)
 	case BCLK_EMMC:
 		ret = rk3568_emmc_set_bclk(priv, rate);
 		break;
+	case CLK_USB3OTG0_REF:
+	case CLK_USB3OTG1_REF:
 	case TCLK_EMMC:
 		ret = OSC_HZ;
 		break;
Signature · 1 line
2.43.2
#2 lore raw

PATCH 2/19 clk: rockchip: rk3588: Add REF_CLK_USB3OTGx support

In reply to Jonas Karlman

The REF_CLK_USB3OTGx clocks is used as reference clock for USB3 block.

Add simple support to get rate of REF_CLK_USB3OTGx clocks to fix reference clock period configuration.

---
 drivers/clk/rockchip/clk_rk3588.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/clk/rockchip/clk_rk3588.c +6 -0
index 8f33843179b0..4c611a390499 100644
@@ -1569,6 +1569,9 @@ static ulong rk3588_clk_get_rate(struct clk *clk)
 	case DCLK_DECOM:
 		rate = rk3588_mmc_get_clk(priv, clk->id);
 		break;
+	case REF_CLK_USB3OTG0:
+	case REF_CLK_USB3OTG1:
+	case REF_CLK_USB3OTG2:
 	case TMCLK_EMMC:
 	case TCLK_WDT0:
 		rate = OSC_HZ;
@@ -1734,6 +1737,9 @@ static ulong rk3588_clk_set_rate(struct clk *clk, ulong rate)
 	case DCLK_DECOM:
 		ret = rk3588_mmc_set_clk(priv, clk->id, rate);
 		break;
+	case REF_CLK_USB3OTG0:
+	case REF_CLK_USB3OTG1:
+	case REF_CLK_USB3OTG2:
 	case TMCLK_EMMC:
 	case TCLK_WDT0:
 		ret = OSC_HZ;
Signature · 1 line
2.43.2
Reviewed-by on v1 2/19
#3 lore raw

Re: [PATCH 02/19] clk: rockchip: rk3588: Add REF_CLK_USB3OTGx support

Hi Jonas,

Quoted 6 lines · Jonas Karlman

The REF_CLK_USB3OTGx clocks is used as reference clock for USB3 block.

Add simple support to get rate of REF_CLK_USB3OTGx clocks to fix reference clock period configuration.

Thanks,
Quentin

#4 lore raw

PATCH 3/19 rockchip: rk35xx: Drop USB_GADGET_PRODUCT_NUM Kconfig option

In reply to Jonas Karlman

The commit 8c19275fdb13 ("rockchip: Update the default USB Product ID value") added default product id for all supported Rockchip SoCs.

Remove USB_GADGET_PRODUCT_NUM options that match default value from RK35xx boards.

---
 configs/pinetab2-rk3566_defconfig   | 1 -
 configs/rock5b-rk3588_defconfig     | 1 -
 configs/turing-rk1-rk3588_defconfig | 1 -
 3 files changed, 3 deletions(-)
configs/pinetab2-rk3566_defconfig +0 -1
index bc7a77aa52fd..edeb1d89b993 100644
@@ -99,7 +99,6 @@ CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_ASIX88179=y
 CONFIG_USB_ETHER_RTL8152=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_PRODUCT_NUM=0x350a
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_ROCKUSB=y
 CONFIG_ERRNO_STR=y
configs/rock5b-rk3588_defconfig +0 -1
index 58c7c44fb4f7..ac4f1ebb4c13 100644
@@ -102,7 +102,6 @@ CONFIG_USB_ETHER_MCS7830=y
 CONFIG_USB_ETHER_RTL8152=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_PRODUCT_NUM=0x350b
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_ROCKUSB=y
 CONFIG_ERRNO_STR=y
configs/turing-rk1-rk3588_defconfig +0 -1
index 07f7b848529e..e18ced721789 100644
@@ -109,7 +109,6 @@ CONFIG_USB_ETHER_MCS7830=y
 CONFIG_USB_ETHER_RTL8152=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_PRODUCT_NUM=0x350b
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_ROCKUSB=y
 CONFIG_ERRNO_STR=y
Signature · 1 line
2.43.2
#5 lore raw

PATCH 4/19 rockchip: rk3588: Drop REGULATOR_PWM Kconfig option

In reply to Jonas Karlman

RK3588 boards do not have any pwm-regulator compatible nodes in DT, drop the superfluous REGULATOR_PWM Kconfig options.

---
 configs/evb-rk3588_defconfig         | 1 -
 configs/neu6a-io-rk3588_defconfig    | 1 -
 configs/neu6b-io-rk3588_defconfig    | 1 -
 configs/quartzpro64-rk3588_defconfig | 1 -
 configs/rock5b-rk3588_defconfig      | 1 -
 configs/toybrick-rk3588_defconfig    | 1 -
 configs/turing-rk1-rk3588_defconfig  | 1 -
 7 files changed, 7 deletions(-)
configs/evb-rk3588_defconfig +0 -1
index c8db04c076ef..68ecbc54b807 100644
@@ -52,7 +52,6 @@ CONFIG_DWC_ETH_QOS_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
 CONFIG_PHY_ROCKCHIP_USBDP=y
-CONFIG_REGULATOR_PWM=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
configs/neu6a-io-rk3588_defconfig +0 -1
index 307a540f4249..bc2d70421ee9 100644
@@ -40,7 +40,6 @@ CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
-CONFIG_REGULATOR_PWM=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
configs/neu6b-io-rk3588_defconfig +0 -1
index 9ef2bb21fffa..8bc75a5f0dd9 100644
@@ -40,7 +40,6 @@ CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
-CONFIG_REGULATOR_PWM=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
configs/quartzpro64-rk3588_defconfig +0 -1
index b2a66d3f2db0..ee2521f87ae5 100644
@@ -64,7 +64,6 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
 CONFIG_PHY_ROCKCHIP_USBDP=y
 CONFIG_SPL_PINCTRL=y
-CONFIG_REGULATOR_PWM=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_SCSI=y
configs/rock5b-rk3588_defconfig +0 -1
index ac4f1ebb4c13..8af56baf04d7 100644
@@ -75,7 +75,6 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
 CONFIG_PHY_ROCKCHIP_USBDP=y
 CONFIG_SPL_PINCTRL=y
-CONFIG_REGULATOR_PWM=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_SCSI=y
configs/toybrick-rk3588_defconfig +0 -1
index 6ee92e943138..38fc7906eef2 100644
@@ -53,7 +53,6 @@ CONFIG_PHY_REALTEK=y
 CONFIG_DWC_ETH_QOS=y
 CONFIG_DWC_ETH_QOS_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
-CONFIG_REGULATOR_PWM=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
configs/turing-rk1-rk3588_defconfig +0 -1
index e18ced721789..77aacbc64b6c 100644
@@ -81,7 +81,6 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
 CONFIG_PHY_ROCKCHIP_USBDP=y
 CONFIG_SPL_PINCTRL=y
-CONFIG_REGULATOR_PWM=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_SCSI=y
Signature · 1 line
2.43.2
#6 lore raw

PATCH 5/19 rockchip: rk3566-anbernic-rgxx3: Remove SPL_ROCKCHIP_BACK_TO_BROM option

In reply to Jonas Karlman

SPL_ROCKCHIP_BACK_TO_BROM should normally only be enabled when BROM should load U-Boot binary. SPL on Anbernic RGxx3 devices load TF-A and U-Boot proper from FIT images and does never jump back to BROM from SPL.

Remove the superfluous Kconfig option from defconfig to align with other RK356x boards.

This patch have no intended change in boot behavior.

---
 configs/anbernic-rgxx3-rk3566_defconfig | 2 --
 1 file changed, 2 deletions(-)
configs/anbernic-rgxx3-rk3566_defconfig +0 -2
index c8c9238f96fc..24b050c59b53 100644
@@ -6,9 +6,7 @@ CONFIG_SPL_GPIO=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_DEFAULT_DEVICE_TREE="rk3566-anbernic-rgxx3"
 CONFIG_ROCKCHIP_RK3568=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON=y
-CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_TARGET_ANBERNIC_RGXX3_RK3566=y
 CONFIG_DEBUG_UART_BASE=0xFE660000
Signature · 1 line
2.43.2
#7 lore raw

PATCH 6/19 rockchip: rk35xx: Sort imply statements alphabetically

In reply to Jonas Karlman

Sort imply statements under ROCKCHIP_RK3568 and ROCKCHIP_RK3588 alphabetically.

---
 arch/arm/mach-rockchip/Kconfig | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
arch/arm/mach-rockchip/Kconfig +12 -12
index ae002aba0b42..416b59646042 100644
@@ -312,12 +312,12 @@ config ROCKCHIP_RK3568
 	select BOARD_LATE_INIT
 	select DM_REGULATOR_FIXED
 	select DM_RESET
-	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
-	imply ROCKCHIP_COMMON_BOARD
-	imply OF_LIBFDT_OVERLAY
-	imply ROCKCHIP_OTP
 	imply MISC_INIT_R
 	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
+	imply OF_LIBFDT_OVERLAY
+	imply ROCKCHIP_COMMON_BOARD
+	imply ROCKCHIP_OTP
+	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
 	imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT
 	help
 	  The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55,
@@ -339,16 +339,16 @@ config ROCKCHIP_RK3588
 	select BOARD_LATE_INIT
 	select DM_REGULATOR_FIXED
 	select DM_RESET
-	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
-	imply ROCKCHIP_COMMON_BOARD
-	imply OF_LIBFDT_OVERLAY
-	imply ROCKCHIP_OTP
-	imply MISC_INIT_R
-	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
-	imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT
+	imply BOOTSTD_FULL
 	imply CLK_SCMI
+	imply MISC_INIT_R
+	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
+	imply OF_LIBFDT_OVERLAY
+	imply ROCKCHIP_COMMON_BOARD
+	imply ROCKCHIP_OTP
 	imply SCMI_FIRMWARE
-	imply BOOTSTD_FULL
+	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
+	imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT
 	help
 	  The Rockchip RK3588 is a ARM-based SoC with quad-core Cortex-A76 and
 	  quad-core Cortex-A55 including NEON and GPU, 6TOPS NPU, Mali-G610 MP4,
Signature · 1 line
2.43.2
#8 lore raw

PATCH 7/19 rockchip: rk35xx: Enable random generator

In reply to Jonas Karlman

The RK35xx SoCs contain a crypto engine block that can generate random numbers.

Enable rng node in soc u-boot.dtsi and enable Kconfig options to take advantage of the random generator.

---
 arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi | 6 ------
 arch/arm/dts/rk356x-u-boot.dtsi                | 5 +++++
 arch/arm/dts/rk3588s-u-boot.dtsi               | 1 -
 arch/arm/mach-rockchip/Kconfig                 | 4 ++++
 configs/anbernic-rgxx3-rk3566_defconfig        | 2 --
 5 files changed, 9 insertions(+), 9 deletions(-)
arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi +0 -6
index 791f16b206f2..793ed4ae8ae0 100644
@@ -6,12 +6,6 @@
 	chosen {
 		u-boot,spl-boot-order = "same-as-spl", &sdmmc1, &sdmmc0;
 	};
-
-	rng: rng@fe388000 {
-		compatible = "rockchip,cryptov2-rng";
-		reg = <0x0 0xfe388000 0x0 0x2000>;
-		status = "okay";
-	};
 };
 
 &dsi_dphy0 {
arch/arm/dts/rk356x-u-boot.dtsi +5 -0
index d347080577d9..05367216e118 100644
@@ -21,6 +21,11 @@
 		bootph-all;
 	};
 
+	rng: rng@fe388000 {
+		compatible = "rockchip,cryptov2-rng";
+		reg = <0x0 0xfe388000 0x0 0x2000>;
+	};
+
 	otp: nvmem@fe38c000 {
 		compatible = "rockchip,rk3568-otp";
 		reg = <0x0 0xfe38c000 0x0 0x4000>;
arch/arm/dts/rk3588s-u-boot.dtsi +0 -1
index ac67c777adea..233eb79d9ba2 100644
@@ -91,7 +91,6 @@
 	rng: rng@fe378000 {
 		compatible = "rockchip,trngv1";
 		reg = <0x0 0xfe378000 0x0 0x200>;
-		status = "disabled";
 	};
 
 	usbdp_phy0: phy@fed80000 {
arch/arm/mach-rockchip/Kconfig +4 -0
index 416b59646042..d518913f8a37 100644
@@ -312,9 +312,11 @@ config ROCKCHIP_RK3568
 	select BOARD_LATE_INIT
 	select DM_REGULATOR_FIXED
 	select DM_RESET
+	imply DM_RNG
 	imply MISC_INIT_R
 	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
 	imply OF_LIBFDT_OVERLAY
+	imply RNG_ROCKCHIP
 	imply ROCKCHIP_COMMON_BOARD
 	imply ROCKCHIP_OTP
 	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
@@ -341,9 +343,11 @@ config ROCKCHIP_RK3588
 	select DM_RESET
 	imply BOOTSTD_FULL
 	imply CLK_SCMI
+	imply DM_RNG
 	imply MISC_INIT_R
 	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
 	imply OF_LIBFDT_OVERLAY
+	imply RNG_ROCKCHIP
 	imply ROCKCHIP_COMMON_BOARD
 	imply ROCKCHIP_OTP
 	imply SCMI_FIRMWARE
configs/anbernic-rgxx3-rk3566_defconfig +0 -2
index 24b050c59b53..110237e798f9 100644
@@ -68,8 +68,6 @@ CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 # CONFIG_RAM_ROCKCHIP_DEBUG is not set
-CONFIG_DM_RNG=y
-CONFIG_RNG_ROCKCHIP=y
 # CONFIG_RNG_SMCCC_TRNG is not set
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
Signature · 1 line
2.43.2
#9 lore raw

PATCH 8/19 rockchip: rk35xx: Imply support for GbE PHY

In reply to Jonas Karlman

Imply support for GbE PHY status parsing and configuration when support for onboard ethernet is enabled.

---
 arch/arm/mach-rockchip/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-rockchip/Kconfig +2 -0
index d518913f8a37..d85b59a92da2 100644
@@ -316,6 +316,7 @@ config ROCKCHIP_RK3568
 	imply MISC_INIT_R
 	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
 	imply OF_LIBFDT_OVERLAY
+	imply PHY_GIGE if DWC_ETH_QOS_ROCKCHIP
 	imply RNG_ROCKCHIP
 	imply ROCKCHIP_COMMON_BOARD
 	imply ROCKCHIP_OTP
@@ -347,6 +348,7 @@ config ROCKCHIP_RK3588
 	imply MISC_INIT_R
 	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
 	imply OF_LIBFDT_OVERLAY
+	imply PHY_GIGE if DWC_ETH_QOS_ROCKCHIP
 	imply RNG_ROCKCHIP
 	imply ROCKCHIP_COMMON_BOARD
 	imply ROCKCHIP_OTP
Signature · 1 line
2.43.2
#10 lore raw

Re: [PATCH 08/19] rockchip: rk35xx: Imply support for GbE PHY

Hi Jonas,

Quoted 13 lines · Jonas Karlman

Imply support for GbE PHY status parsing and configuration when support for onboard ethernet is enabled.

---
  arch/arm/mach-rockchip/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/mach-rockchip/Kconfig +0 -0
index d518913f8a37..d85b59a92da2 100644

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3568 · line 319

Quoted 4 lines
arch/arm/mach-rockchip/Kconfig +1 -0
@@ -316,6 +316,7 @@ config ROCKCHIP_RK3568
  	imply MISC_INIT_R
  	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
  	imply OF_LIBFDT_OVERLAY
+	imply PHY_GIGE if DWC_ETH_QOS_ROCKCHIP

Is this really something we expect most devices to use?

We have two products based on RK3588, none use it. If I'm not mistaken, Rock5B doesn't as well as Orange Pi 5 Plus, RK3588 EVB, Rock5A, (likely not the Edgeble as well since they have 2.5Gbps connectors), NanoPC T6, IndieDroid Nova, Cool Pi 4B, Cool Pi CM5 EVB, NanoPi R6S, Rockchip Toybrick TB-RK3588X.

So, I'm not sure it's worth it making it the default? (Even though we could remove it from the defconfig manually). Wouldn't this make more sense in your generic defconfigs?

Cheers,
Quentin

#11 lore raw

Re: [PATCH 08/19] rockchip: rk35xx: Imply support for GbE PHY

Hi Quentin,

Quoted 29 lines · Quentin Schulz

Hi Jonas,

Quoted 13 lines · Jonas Karlman

Imply support for GbE PHY status parsing and configuration when support for onboard ethernet is enabled.

---
  arch/arm/mach-rockchip/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/mach-rockchip/Kconfig +0 -0
index d518913f8a37..d85b59a92da2 100644

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3568 · line 319

Quoted 4 lines
arch/arm/mach-rockchip/Kconfig +1 -0
@@ -316,6 +316,7 @@ config ROCKCHIP_RK3568
  	imply MISC_INIT_R
  	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
  	imply OF_LIBFDT_OVERLAY
+	imply PHY_GIGE if DWC_ETH_QOS_ROCKCHIP

Is this really something we expect most devices to use?

We have two products based on RK3588, none use it. If I'm not mistaken, Rock5B doesn't as well as Orange Pi 5 Plus, RK3588 EVB, Rock5A, (likely not the Edgeble as well since they have 2.5Gbps connectors), NanoPC T6, IndieDroid Nova, Cool Pi 4B, Cool Pi CM5 EVB, NanoPi R6S, Rockchip Toybrick TB-RK3588X.

Quoted 3 lines

So, I'm not sure it's worth it making it the default? (Even though we could remove it from the defconfig manually). Wouldn't this make more sense in your generic defconfigs?

The PHY_GIGE option is only used to control if miiphy_speed() and miiphy_duplex() should use MII_STAT1000 reg to determine speed/duplex.

This patch only imply this option if a board use on-board gmac and have DWC_ETH_QOS_ROCKCHIP enabled.

Mostly this only help the "mii info" command to show 1000baseT instead of max 100baseT.

I can drop this if you think it will cause an issue for any board?

Regards,
Jonas

Quoted 3 lines

Cheers,
Quentin

Reviewed-by
#12 lore raw

Re: [PATCH 08/19] rockchip: rk35xx: Imply support for GbE PHY

Hi Jonas,

Quoted 39 lines · Jonas Karlman

Hi Quentin,

Quoted 29 lines · Quentin Schulz

Hi Jonas,

Quoted 13 lines · Jonas Karlman

Imply support for GbE PHY status parsing and configuration when support for onboard ethernet is enabled.

---
   arch/arm/mach-rockchip/Kconfig | 2 ++
   1 file changed, 2 insertions(+)
arch/arm/mach-rockchip/Kconfig +0 -0
index d518913f8a37..d85b59a92da2 100644

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3568 · line 319

Quoted 4 lines
arch/arm/mach-rockchip/Kconfig +1 -0
@@ -316,6 +316,7 @@ config ROCKCHIP_RK3568
   	imply MISC_INIT_R
   	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
   	imply OF_LIBFDT_OVERLAY
+	imply PHY_GIGE if DWC_ETH_QOS_ROCKCHIP

Is this really something we expect most devices to use?

We have two products based on RK3588, none use it. If I'm not mistaken, Rock5B doesn't as well as Orange Pi 5 Plus, RK3588 EVB, Rock5A, (likely not the Edgeble as well since they have 2.5Gbps connectors), NanoPC T6, IndieDroid Nova, Cool Pi 4B, Cool Pi CM5 EVB, NanoPi R6S, Rockchip Toybrick TB-RK3588X.

Quoted 3 lines

So, I'm not sure it's worth it making it the default? (Even though we could remove it from the defconfig manually). Wouldn't this make more sense in your generic defconfigs?

The PHY_GIGE option is only used to control if miiphy_speed() and miiphy_duplex() should use MII_STAT1000 reg to determine speed/duplex.

Quoted 8 lines

This patch only imply this option if a board use on-board gmac and have DWC_ETH_QOS_ROCKCHIP enabled.

Mostly this only help the "mii info" command to show 1000baseT instead of max 100baseT.

I can drop this if you think it will cause an issue for any board?

No no, this is fine thanks for the correction. I don't know what happened for my brain to read this as "enable support for integrated PHY by default" (c.f. the list of boards I listed not having integrated PHYs).

Sorry for the noise,

Thanks,
Quentin

#13 lore raw

PATCH 9/19 rockchip: rk356x: Imply enhanced features for standard boot

In reply to Jonas Karlman

Imply BOOTSTD_FULL for all RK356x boards to more closely follow RK3588.

---
 arch/arm/mach-rockchip/Kconfig      | 1 +
 configs/bpi-r2-pro-rk3568_defconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rockchip/Kconfig +1 -0
index d85b59a92da2..bc6426421b38 100644
@@ -312,6 +312,7 @@ config ROCKCHIP_RK3568
 	select BOARD_LATE_INIT
 	select DM_REGULATOR_FIXED
 	select DM_RESET
+	imply BOOTSTD_FULL
 	imply DM_RNG
 	imply MISC_INIT_R
 	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
configs/bpi-r2-pro-rk3568_defconfig +0 -1
index 5cc95241ba43..70837574462b 100644
@@ -15,7 +15,6 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_BOOTSTD_FULL=y
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-bpi-r2-pro.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
Signature · 1 line
2.43.2
#14 lore raw

PATCH 10/19 rockchip: rk35xx: Sort soc u-boot.dtsi alphabetically

In reply to Jonas Karlman

Sort nodes and props in RK356x/RK3588 u-boot.dtsi alphabetically, nodes is sorted by reg addr then by alphabetical order.

This has no intended change beside sorting existing nodes and removing a duplicated usbdpphy0_grf node.

---
 arch/arm/dts/rk356x-u-boot.dtsi  | 100 +++++++++++++++----------------
 arch/arm/dts/rk3588s-u-boot.dtsi |  71 ++++++++++------------
 2 files changed, 83 insertions(+), 88 deletions(-)
arch/arm/dts/rk356x-u-boot.dtsi +50 -50
index 05367216e118..a0c630326217 100644
@@ -17,8 +17,8 @@
 	};
 
 	dmc: dmc {
-		compatible = "rockchip,rk3568-dmc";
 		bootph-all;
+		compatible = "rockchip,rk3568-dmc";
 	};
 
 	rng: rng@fe388000 {
@@ -38,46 +38,10 @@
 	};
 };
 
-&xin24m {
-	bootph-all;
-};
-
 &cru {
 	bootph-all;
 };
 
-&pmucru {
-	bootph-all;
-};
-
-&grf {
-	bootph-all;
-};
-
-&pmugrf {
-	bootph-all;
-};
-
-&pinctrl {
-	bootph-all;
-};
-
-&pcfg_pull_none_smt {
-	bootph-all;
-};
-
-&pcfg_pull_none {
-	bootph-all;
-};
-
-&pcfg_pull_up_drv_level_2 {
-	bootph-all;
-};
-
-&pcfg_pull_up {
-	bootph-all;
-};
-
 &emmc_bus8 {
 	bootph-all;
 };
@@ -102,10 +66,51 @@
 	bootph-all;
 };
 
+&grf {
+	bootph-all;
+};
+
 &i2c0_xfer {
 	bootph-all;
 };
 
+&pcfg_pull_none {
+	bootph-all;
+};
+
+&pcfg_pull_none_smt {
+	bootph-all;
+};
+
+&pcfg_pull_up {
+	bootph-all;
+};
+
+&pcfg_pull_up_drv_level_2 {
+	bootph-all;
+};
+
+&pinctrl {
+	bootph-all;
+};
+
+&pmucru {
+	bootph-all;
+};
+
+&pmugrf {
+	bootph-all;
+};
+
+&sdhci {
+	bootph-pre-ram;
+	max-frequency = <200000000>;
+};
+
+&sdmmc0 {
+	bootph-pre-ram;
+};
+
 &sdmmc0_bus4 {
 	bootph-all;
 };
@@ -126,24 +131,19 @@
 	bootph-all;
 };
 
-&uart2m0_xfer {
-	bootph-all;
-};
-
-&sdhci {
-	bootph-pre-ram;
-	max-frequency = <200000000>;
-};
-
-&sdmmc0 {
-	bootph-pre-ram;
-};
-
 &uart2 {
 	bootph-pre-ram;
 	clock-frequency = <24000000>;
 };
 
+&uart2m0_xfer {
+	bootph-all;
+};
+
+&xin24m {
+	bootph-all;
+};
+
 #ifdef CONFIG_ROCKCHIP_SPI_IMAGE
 &binman {
 	simple-bin-spi {
arch/arm/dts/rk3588s-u-boot.dtsi +33 -38

139 lines not on this page · raw message

Signature · 1 line
2.43.2
#15 lore raw

Re: [PATCH 10/19] rockchip: rk35xx: Sort soc u-boot.dtsi alphabetically

Hi Jonas,

Quoted 17 lines · Jonas Karlman

Sort nodes and props in RK356x/RK3588 u-boot.dtsi alphabetically, nodes is sorted by reg addr then by alphabetical order.

This has no intended change beside sorting existing nodes and removing a duplicated usbdpphy0_grf node.

---
  arch/arm/dts/rk356x-u-boot.dtsi  | 100 +++++++++++++++----------------
  arch/arm/dts/rk3588s-u-boot.dtsi |  71 ++++++++++------------
  2 files changed, 83 insertions(+), 88 deletions(-)
arch/arm/dts/rk356x-u-boot.dtsi +0 -0
index 05367216e118..a0c630326217 100644

arch/arm/dts/rk356x-u-boot.dtsi line 21

Quoted 6 lines
arch/arm/dts/rk356x-u-boot.dtsi +1 -1
@@ -17,8 +17,8 @@
  	};
 
  	dmc: dmc {
-		compatible = "rockchip,rk3568-dmc";
  		bootph-all;
+		compatible = "rockchip,rk3568-dmc";

This doesn't follow the kernel's DT coding style:

https://www.kernel.org/doc/html/latest/devicetree/bindings/dts-coding-style.html#order-of-properties-in-device-node

[...]

arch/arm/dts/rk3588s-u-boot.dtsi line 19

Quoted 11 lines
arch/arm/dts/rk3588s-u-boot.dtsi +1 -1
index 233eb79d9ba2..e4171bd24d2a 100644
@@ -15,8 +15,8 @@
  	};
 
  	dmc {
-		compatible = "rockchip,rk3588-dmc";
  		bootph-all;
+		compatible = "rockchip,rk3588-dmc";

Ditto.

Cheers,
Quentin

#16 lore raw

Re: [PATCH 10/19] rockchip: rk35xx: Sort soc u-boot.dtsi alphabetically

Hi Quentin,

Quoted 22 lines · Quentin Schulz

Hi Jonas,

Quoted 19 lines · Jonas Karlman

Sort nodes and props in RK356x/RK3588 u-boot.dtsi alphabetically, nodes is sorted by reg addr then by alphabetical order.

This has no intended change beside sorting existing nodes and removing a duplicated usbdpphy0_grf node.

---
  arch/arm/dts/rk356x-u-boot.dtsi  | 100 +++++++++++++++----------------
  arch/arm/dts/rk3588s-u-boot.dtsi |  71 ++++++++++------------
  2 files changed, 83 insertions(+), 88 deletions(-)
arch/arm/dts/rk356x-u-boot.dtsi +0 -0
index 05367216e118..a0c630326217 100644
@@ -17,8 +17,8 @@
  	};
 
Quoted 6 lines

arch/arm/dts/rk356x-u-boot.dtsi line 21

Quoted 4 lines
arch/arm/dts/rk356x-u-boot.dtsi +1 -1
  	dmc: dmc {
-		compatible = "rockchip,rk3568-dmc";
  		bootph-all;
+		compatible = "rockchip,rk3568-dmc";

This doesn't follow the kernel's DT coding style:

I will resort these props, this also affects my two similar rk3308 and rk3328 series.

Regards,
Jonas

Quoted 21 lines

https://www.kernel.org/doc/html/latest/devicetree/bindings/dts-coding-style.html#order-of-properties-in-device-node

[...]

arch/arm/dts/rk3588s-u-boot.dtsi line 19

Quoted 11 lines
arch/arm/dts/rk3588s-u-boot.dtsi +1 -1
index 233eb79d9ba2..e4171bd24d2a 100644
@@ -15,8 +15,8 @@
  	};
 
  	dmc {
-		compatible = "rockchip,rk3588-dmc";
  		bootph-all;
+		compatible = "rockchip,rk3588-dmc";

Ditto.

Cheers,
Quentin

#17 lore raw

PATCH 11/19 rockchip: rk356x: Update bootph props

In reply to Jonas Karlman

After the commit aca95282c1b7 ("Makefile: Use the fdtgrep -u flag") bootph props is propagating to parent nodes.

Update bootph props to ensure eMMC, SD-card and SPI flash is available in SPL and U-Boot proper pre-reloc phase also remove unneeded bootph props that automatically is propagated to parent nodes.

Also adjust pinctrl nodes to only be included in boot phases where they are needed and add any missing pinctrl node needed in SPL.

---
 arch/arm/dts/rk3566-pinetab2-u-boot.dtsi   | 24 +++++++++-----
 arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi |  8 ++---
 arch/arm/dts/rk3566-quartz64-b-u-boot.dtsi |  4 +--
 arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi  |  6 ++--
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi    |  3 +-
 arch/arm/dts/rk356x-u-boot.dtsi            | 38 ++++++++++++----------
 configs/evb-rk3568_defconfig               |  3 +-
 7 files changed, 45 insertions(+), 41 deletions(-)
arch/arm/dts/rk3566-pinetab2-u-boot.dtsi +16 -8
index 4aa6ab1c848c..c89852be15bd 100644
@@ -3,20 +3,30 @@
 #include "rk356x-u-boot.dtsi"
 
 &fspi_dual_io_pins {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &gpio0 {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &i2c0 {
 	bootph-pre-ram;
 };
 
+&i2c0_xfer {
+	bootph-pre-ram;
+};
+
+&i2s1m0_mclk {
+	bootph-pre-ram;
+};
+
+&pmic_int_l {
+	bootph-pre-ram;
+};
+
 &rk817 {
-	bootph-pre-ram;
-
 	regulators {
 		bootph-pre-ram;
 	};
@@ -27,15 +37,13 @@
 };
 
 &sdmmc_pwren_l {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
-
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 	};
 };
 
arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi +3 -5
index 930d660868bb..0e25b7e108fc 100644
@@ -3,7 +3,7 @@
 #include "rk356x-u-boot.dtsi"
 
 &gpio0 {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdhci {
@@ -13,11 +13,9 @@
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
-
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 	};
 };
 
@@ -34,5 +32,5 @@
 };
 
 &vcc_sd_h {
-	bootph-all;
+	bootph-pre-ram;
 };
arch/arm/dts/rk3566-quartz64-b-u-boot.dtsi +1 -3
index c235b4357f7d..f2c9d8e167d5 100644
@@ -9,11 +9,9 @@
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
-
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 	};
 };
 
arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi +2 -4
index 1fc71faa9e07..2e317f6f6628 100644
@@ -3,7 +3,7 @@
 #include "rk356x-u-boot.dtsi"
 
 &fspi_dual_io_pins {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdhci {
@@ -15,10 +15,8 @@
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
-
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 	};
 };
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +1 -2
index 5b823fcca5fb..fc1117a6d80d 100644
@@ -26,14 +26,13 @@
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
 	#address-cells = <1>;
 	#size-cells = <0>;
 	status = "okay";
 
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 		spi-max-frequency = <24000000>;
arch/arm/dts/rk356x-u-boot.dtsi +20 -18
index a0c630326217..34ba8e45146b 100644
@@ -43,43 +43,39 @@
 };
 
 &emmc_bus8 {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &emmc_clk {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &emmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &emmc_datastrobe {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &emmc_rstnout {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &fspi_pins {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &grf {
 	bootph-all;
 };
 
-&i2c0_xfer {
-	bootph-all;
-};
-
 &pcfg_pull_none {
 	bootph-all;
 };
 
 &pcfg_pull_none_smt {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &pcfg_pull_up {
@@ -87,7 +83,7 @@
 };
 
 &pcfg_pull_up_drv_level_2 {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &pinctrl {
@@ -104,35 +100,41 @@
 
 &sdhci {
 	bootph-pre-ram;
+	bootph-some-ram;
 	max-frequency = <200000000>;
 };
 
 &sdmmc0 {
 	bootph-pre-ram;
+	bootph-some-ram;
 };
 
 &sdmmc0_bus4 {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdmmc0_clk {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdmmc0_cmd {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdmmc0_det {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdmmc0_pwren {
-	bootph-all;
+	bootph-pre-ram;
+};
+
+&sfc {
+	u-boot,spl-sfc-no-dma;
 };
 
 &uart2 {
-	bootph-pre-ram;
+	bootph-all;
 	clock-frequency = <24000000>;
 };
 
configs/evb-rk3568_defconfig +2 -1
index 6e8061f5f487..37b4c5955994 100644
@@ -32,7 +32,7 @@ CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
@@ -49,6 +49,7 @@ CONFIG_MMC_SDHCI_ROCKCHIP=y
 CONFIG_PHY_REALTEK=y
 CONFIG_DWC_ETH_QOS=y
 CONFIG_DWC_ETH_QOS_ROCKCHIP=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_RK8XX=y
Signature · 1 line
2.43.2
#18 lore raw

PATCH 12/19 rockchip: rk3588: Update bootph props

In reply to Jonas Karlman

After the commit aca95282c1b7 ("Makefile: Use the fdtgrep -u flag") bootph props is propagating to parent nodes.

Update bootph props to ensure eMMC, SD-card and SPI flash is available in SPL and U-Boot proper pre-reloc phase also remove unneeded bootph props that automatically is propagated to parent nodes.

Also adjust pinctrl nodes to only be included in boot phases where they are needed and add any missing pinctrl node needed in SPL.

---
 .../arm/dts/rk3588-coolpi-cm5-evb-u-boot.dtsi |  5 ++-
 arch/arm/dts/rk3588-generic.dts               |  1 +
 arch/arm/dts/rk3588-nanopc-t6-u-boot.dtsi     |  9 +++--
 .../dts/rk3588-orangepi-5-plus-u-boot.dtsi    |  6 ++--
 arch/arm/dts/rk3588-rock-5b-u-boot.dtsi       |  5 ++-
 arch/arm/dts/rk3588-turing-rk1-u-boot.dtsi    |  6 +++-
 arch/arm/dts/rk3588s-coolpi-4b-u-boot.dtsi    |  5 ++-
 arch/arm/dts/rk3588s-orangepi-5-u-boot.dtsi   |  8 ++---
 arch/arm/dts/rk3588s-u-boot.dtsi              | 36 ++++++++++++-------
 configs/evb-rk3588_defconfig                  |  4 ++-
 10 files changed, 48 insertions(+), 37 deletions(-)
arch/arm/dts/rk3588-coolpi-cm5-evb-u-boot.dtsi +2 -3
index ed15b14ea0ee..b1d1d79fdd1a 100644
@@ -3,7 +3,7 @@
 #include "rk3588-u-boot.dtsi"
 
 &fspim2_pins {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdhci {
@@ -12,14 +12,13 @@
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
 	pinctrl-names = "default";
 	pinctrl-0 = <&fspim2_pins>;
 	status = "okay";
 
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 		spi-max-frequency = <24000000>;
arch/arm/dts/rk3588-generic.dts +1 -0
index e4721d97a87d..baafe7463f1b 100644
@@ -40,5 +40,6 @@
 };
 
 &uart2 {
+	pinctrl-0 = <&uart2m0_xfer>;
 	status = "okay";
 };
arch/arm/dts/rk3588-nanopc-t6-u-boot.dtsi +4 -5
index 60494bb8485f..a2094aff7cca 100644
@@ -7,12 +7,10 @@
 #include "rk3588-u-boot.dtsi"
 
 &fspim1_pins {
-	bootph-all;
-};
-
-&sfc {
 	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
+};
+
+&sfc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&fspim1_pins>;
 	#address-cells = <1>;
@@ -21,6 +19,7 @@
 
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 		spi-max-frequency = <24000000>;
arch/arm/dts/rk3588-orangepi-5-plus-u-boot.dtsi +2 -4
index 5d5fa6ffb214..3f42d26517fd 100644
@@ -3,7 +3,7 @@
 #include "rk3588-u-boot.dtsi"
 
 &fspim1_pins {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdhci {
@@ -12,10 +12,8 @@
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
-
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 	};
 };
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +2 -3
index 9ee9dd051e32..448432bad4ff 100644
@@ -18,7 +18,7 @@
 };
 
 &fspim2_pins {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &pinctrl {
@@ -35,14 +35,13 @@
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
 	pinctrl-names = "default";
 	pinctrl-0 = <&fspim2_pins>;
 	status = "okay";
 
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 		spi-max-frequency = <24000000>;
arch/arm/dts/rk3588-turing-rk1-u-boot.dtsi +5 -1
index ca2a684f3541..a50bcc45f216 100644
@@ -12,6 +12,10 @@
 };
 
 &uart9 {
-	bootph-pre-ram;
+	bootph-all;
 	clock-frequency = <24000000>;
 };
+
+&uart9m0_xfer {
+	bootph-all;
+};
arch/arm/dts/rk3588s-coolpi-4b-u-boot.dtsi +2 -3
index 6e4b97028d7c..0f4b38f63d59 100644
@@ -3,7 +3,7 @@
 #include "rk3588s-u-boot.dtsi"
 
 &fspim2_pins {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdhci {
@@ -12,14 +12,13 @@
 };
 
 &sfc {
-	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
 	pinctrl-names = "default";
 	pinctrl-0 = <&fspim2_pins>;
 	status = "okay";
 
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 		spi-max-frequency = <24000000>;
arch/arm/dts/rk3588s-orangepi-5-u-boot.dtsi +3 -5
index 888d1b9c12d7..e0e9ddef0aec 100644
@@ -9,14 +9,12 @@
 };
 
 &fspim0_pins {
-	bootph-all;
-};
-
-&sfc {
 	bootph-pre-ram;
-	u-boot,spl-sfc-no-dma;
+};
 
+&sfc {
 	flash@0 {
 		bootph-pre-ram;
+		bootph-some-ram;
 	};
 };
arch/arm/dts/rk3588s-u-boot.dtsi +24 -12
index e4171bd24d2a..a502a82fae6a 100644
@@ -121,31 +121,35 @@
 };
 
 &cru {
-	bootph-pre-ram;
+	bootph-all;
 };
 
 &emmc_bus8 {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &emmc_clk {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &emmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &emmc_data_strobe {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &emmc_rstnout {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &ioc {
-	bootph-pre-ram;
+	bootph-all;
+};
+
+&pcfg_pull_down {
+	bootph-all;
 };
 
 &pcfg_pull_none {
@@ -157,6 +161,10 @@
 };
 
 &pcfg_pull_up_drv_level_2 {
+	bootph-pre-ram;
+};
+
+&php_grf {
 	bootph-all;
 };
 
@@ -189,19 +197,23 @@
 };
 
 &sdmmc_bus4 {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdmmc_clk {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdmmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
 };
 
 &sdmmc_det {
-	bootph-all;
+	bootph-pre-ram;
+};
+
+&sfc {
+	u-boot,spl-sfc-no-dma;
 };
 
 &sys_grf {
@@ -209,7 +221,7 @@
 };
 
 &uart2 {
-	bootph-pre-ram;
+	bootph-all;
 	clock-frequency = <24000000>;
 };
 
configs/evb-rk3588_defconfig +3 -1
index 68ecbc54b807..610a8d740fbb 100644
@@ -33,7 +33,8 @@ CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -52,6 +53,7 @@ CONFIG_DWC_ETH_QOS_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
 CONFIG_PHY_ROCKCHIP_USBDP=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
Signature · 1 line
2.43.2
#19 lore raw

Re: [PATCH 12/19] rockchip: rk3588: Update bootph props

Hi Jonas,

On 3/29/24 20:01, Jonas Karlman wrote:

[...]

Quoted 71 lines
arch/arm/dts/rk3588s-u-boot.dtsi +17 -9
index e4171bd24d2a..a502a82fae6a 100644
@@ -121,31 +121,35 @@
  };
 
  &cru {
-	bootph-pre-ram;
+	bootph-all;
  };
 
  &emmc_bus8 {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &emmc_clk {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &emmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &emmc_data_strobe {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &emmc_rstnout {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &ioc {
-	bootph-pre-ram;
+	bootph-all;
+};
+
+&pcfg_pull_down {
+	bootph-all;
  };
 
  &pcfg_pull_none {
@@ -157,6 +161,10 @@
  };
 
  &pcfg_pull_up_drv_level_2 {
+	bootph-pre-ram;
+};
+
+&php_grf {
  	bootph-all;
  };
 
@@ -189,19 +197,23 @@
  };
 
  &sdmmc_bus4 {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &sdmmc_clk {
-	bootph-all;
+	bootph-pre-ram;
  };
 

arch/arm/dts/rk3588s-u-boot.dtsi line 214

Quoted 10 lines
arch/arm/dts/rk3588s-u-boot.dtsi +4 -2
  &sdmmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &sdmmc_det {
-	bootph-all;
+	bootph-pre-ram;
+};
+

Please add bootph-some-ram to all nodes related to eMMC/SD card otherwise I assume some boards won't work anymore (e.g. the ones that need to find MMC devices through DT in arch_env_get_location, e.g. Theobroma's Jaguar (and soon Tiger)).

c.f. https://source.denx.de/u-boot/u-boot/-/commit/70f9212d61fe79c605b805c6eb0764b29f8ae3b6

It was not easy to have this merged, so I'd prefer to avoid having to go through it again to fix my board(s) :)

It'd be nice to split this into multiple commits so we can have some individual justification of why such a change is made, so that we know if we need to revert/update it in the future.

Cheers,
Quentin

#20 lore raw

Re: [PATCH 12/19] rockchip: rk3588: Update bootph props

Hi Quentin,

Quoted 82 lines · Quentin Schulz

Hi Jonas,

On 3/29/24 20:01, Jonas Karlman wrote:

[...]

Quoted 76 lines
arch/arm/dts/rk3588s-u-boot.dtsi +18 -10
index e4171bd24d2a..a502a82fae6a 100644
@@ -121,31 +121,35 @@
  };
 
  &cru {
-	bootph-pre-ram;
+	bootph-all;
  };
 
  &emmc_bus8 {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &emmc_clk {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &emmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &emmc_data_strobe {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &emmc_rstnout {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &ioc {
-	bootph-pre-ram;
+	bootph-all;
+};
+
+&pcfg_pull_down {
+	bootph-all;
  };
 
  &pcfg_pull_none {
@@ -157,6 +161,10 @@
  };
 
  &pcfg_pull_up_drv_level_2 {
+	bootph-pre-ram;
+};
+
+&php_grf {
  	bootph-all;
  };
 
@@ -189,19 +197,23 @@
  };
 
  &sdmmc_bus4 {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &sdmmc_clk {
-	bootph-all;
+	bootph-pre-ram;
  };
 
  &sdmmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
  };
 
Quoted 10 lines

arch/arm/dts/rk3588s-u-boot.dtsi line 214

Quoted 5 lines
arch/arm/dts/rk3588s-u-boot.dtsi +3 -1
  &sdmmc_det {
-	bootph-all;
+	bootph-pre-ram;
+};
+

Please add bootph-some-ram to all nodes related to eMMC/SD card otherwise I assume some boards won't work anymore (e.g. the ones that need to find MMC devices through DT in arch_env_get_location, e.g. Theobroma's Jaguar (and soon Tiger)).

Sure I will add them in a v2.

When I tested your arch_env_get_location() it did not seem to require any pinctrl nodes at pre-reloc stage.

Ideally we should be able to skip use of DM, env and serial at pre-reloc stage for Rockchip. Serial and pinctrl already gets configured in SPL, and use of DM slows down boot by 200-700ms, but that is for another series ;-)

Quoted 10 lines

c.f.
https://source.denx.de/u-boot/u-boot/-/commit/70f9212d61fe79c605b805c6eb0764b29f8ae3b6

It was not easy to have this merged, so I'd prefer to avoid having to go through it again to fix my board(s) :)

It'd be nice to split this into multiple commits so we can have some individual justification of why such a change is made, so that we know if we need to revert/update it in the future.

Will try to split this in v2.

In summary some pinctrl or nodes referenced was not enabled for SPL stage, and some was enabled for TPL that should never be needed in TPL, if U-Boot TPL will be used in future.

TPL: uart node + dmc/ram and any node required/referenced
SPL: TPL + sdmmc/sdhci/spi-flash nodes and related pinctrl
pre-reloc: TPL + sdmmc/sdhci/spi-flash nodes

I created a python script [1] that can check the built tpl/spl/proper dtb for missing nodes and some config options for all soc targets.

[1] https://gist.github.com/Kwiboo/34c099fb42eb6ae5ed515a04275a7ed7

Regards,
Jonas

Quoted 3 lines

Cheers,
Quentin

#21 lore raw

Re: [PATCH 12/19] rockchip: rk3588: Update bootph props

Hi Jonas,

Quoted 96 lines · Jonas Karlman

Hi Quentin,

Quoted 82 lines · Quentin Schulz

Hi Jonas,

On 3/29/24 20:01, Jonas Karlman wrote:

[...]

Quoted 76 lines
arch/arm/dts/rk3588s-u-boot.dtsi +18 -10
index e4171bd24d2a..a502a82fae6a 100644
@@ -121,31 +121,35 @@
   };
 
   &cru {
-	bootph-pre-ram;
+	bootph-all;
   };
 
   &emmc_bus8 {
-	bootph-all;
+	bootph-pre-ram;
   };
 
   &emmc_clk {
-	bootph-all;
+	bootph-pre-ram;
   };
 
   &emmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
   };
 
   &emmc_data_strobe {
-	bootph-all;
+	bootph-pre-ram;
   };
 
   &emmc_rstnout {
-	bootph-all;
+	bootph-pre-ram;
   };
 
   &ioc {
-	bootph-pre-ram;
+	bootph-all;
+};
+
+&pcfg_pull_down {
+	bootph-all;
   };
 
   &pcfg_pull_none {
@@ -157,6 +161,10 @@
   };
 
   &pcfg_pull_up_drv_level_2 {
+	bootph-pre-ram;
+};
+
+&php_grf {
   	bootph-all;
   };
 
@@ -189,19 +197,23 @@
   };
 
   &sdmmc_bus4 {
-	bootph-all;
+	bootph-pre-ram;
   };
 
   &sdmmc_clk {
-	bootph-all;
+	bootph-pre-ram;
   };
 
   &sdmmc_cmd {
-	bootph-all;
+	bootph-pre-ram;
   };
 
Quoted 10 lines

arch/arm/dts/rk3588s-u-boot.dtsi line 214

Quoted 5 lines
arch/arm/dts/rk3588s-u-boot.dtsi +3 -1
   &sdmmc_det {
-	bootph-all;
+	bootph-pre-ram;
+};
+

Please add bootph-some-ram to all nodes related to eMMC/SD card otherwise I assume some boards won't work anymore (e.g. the ones that need to find MMC devices through DT in arch_env_get_location, e.g. Theobroma's Jaguar (and soon Tiger)).

Quoted 5 lines

Sure I will add them in a v2.

When I tested your arch_env_get_location() it did not seem to require any pinctrl nodes at pre-reloc stage.

Mmmmmm... I assume it is because the device checked in arch_env_get_location() in U-Boot proper pre-reloc is necessarily the same as the one used to load U-Boot proper from SPL, which means the SPL will have set the mux correctly (because of bootph-pre-ram). I don't think U-Boot proper pre-reloc has a separate DTB from U-Boot proper, so I think it checks only for boopth-some-ram property in the MMC controller node, and maybe not for pinctrl nodes?

Quoted 4 lines

Ideally we should be able to skip use of DM, env and serial at pre-reloc stage for Rockchip. Serial and pinctrl already gets configured in SPL, and use of DM slows down boot by 200-700ms, but that is for another series ;-)

Agreed :)

Quoted 11 lines
Quoted 10 lines

c.f.
https://source.denx.de/u-boot/u-boot/-/commit/70f9212d61fe79c605b805c6eb0764b29f8ae3b6

It was not easy to have this merged, so I'd prefer to avoid having to go through it again to fix my board(s) :)

It'd be nice to split this into multiple commits so we can have some individual justification of why such a change is made, so that we know if we need to revert/update it in the future.

Quoted 8 lines

Will try to split this in v2.

In summary some pinctrl or nodes referenced was not enabled for SPL stage, and some was enabled for TPL that should never be needed in TPL, if U-Boot TPL will be used in future.

TPL: uart node + dmc/ram and any node required/referenced
SPL: TPL + sdmmc/sdhci/spi-flash nodes and related pinctrl

For the <soc>-u-boot.dtsi, I guess this is good enough, we may need more though for some boards (e.g. emmc-reset, gpios, etc...).

Quoted 7 lines

pre-reloc: TPL + sdmmc/sdhci/spi-flash nodes

I created a python script [1] that can check the built tpl/spl/proper dtb for missing nodes and some config options for all soc targets.

[1] https://gist.github.com/Kwiboo/34c099fb42eb6ae5ed515a04275a7ed7

Ooooooh this seems really neat. I'm always very careful when adding support for a new board and I'm always afraid to miss a few nodes, I'll try to not forget to have a look at this for adding support for Tiger RK3588 :)

Do you have any plan of submitting this on the ML? I think this could be beneficial to the project!

Cheers,
Quentin

#22 lore raw

PATCH 13/19 rockchip: rk3566-pinetab2: Fix reading FIT from SPI flash

In reply to Jonas Karlman

The SF_DEFAULT_SPEED Kconfig option got lost during merge and this prevent reading FIT from SPI flash.

Restore the SF_DEFAULT_SPEED option to fix this.

Fixes 8a94c376f6cb ("rockchip: Use common bss and stack addresses on RK356x")
---
 configs/pinetab2-rk3566_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/pinetab2-rk3566_defconfig +1 -0
index edeb1d89b993..525a002a21b8 100644
@@ -4,6 +4,7 @@ CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SPL_GPIO=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SF_DEFAULT_MODE=0x1000
 CONFIG_DEFAULT_DEVICE_TREE="rk3566-pinetab2-v2.0"
 CONFIG_ROCKCHIP_RK3568=y
Signature · 1 line
2.43.2
#23 lore raw

PATCH 14/19 rockchip: rk3588-coolpi: Add boards to documentation

In reply to Jonas Karlman

Add the CoolPi 4 Model B and CoolPi CM5 EVB board to the documentation. Also fix .dtb-file entries in Makefile.

Fixes 3e15dee38d45 ("board: rockchip: Add support for rk3588 based Cool Pi CM5 EVB")
---
 arch/arm/dts/Makefile           | 4 ++--
 doc/board/rockchip/rockchip.rst | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/dts/Makefile +2 -2
index b359259ab0fb..f49b7e5d251f 100644
@@ -194,8 +194,8 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
 	rk3568-rock-3a.dtb
 
 dtb-$(CONFIG_ROCKCHIP_RK3588) += \
-	rk3588s-coolpi-4b.dts \
-	rk3588-coolpi-cm5-evb.dts \
+	rk3588s-coolpi-4b.dtb \
+	rk3588-coolpi-cm5-evb.dtb \
 	rk3588-edgeble-neu6a-io.dtb \
 	rk3588-edgeble-neu6b-io.dtb \
 	rk3588-evb1-v10.dtb \
doc/board/rockchip/rockchip.rst +2 -0
index 5dd5ea7f1e29..9a726e9cde63 100644
@@ -131,6 +131,8 @@ List of mainline supported Rockchip boards:
      - Turing Machines RK1 (turing-rk1-rk3588)
      - Xunlong Orange Pi 5 (orangepi-5-rk3588s)
      - Xunlong Orange Pi 5 Plus (orangepi-5-plus-rk3588)
+     - Yanyi Tech CoolPi 4 Model B (coolpi-4b-rk3588s)
+     - Yanyi Tech CoolPi CM5 EVB (coolpi-cm5-evb-rk3588)
 
 * rv1108
      - Rockchip Evb-rv1108 (evb-rv1108)
Signature · 1 line
2.43.2
#24 lore raw

PATCH 15/19 rockchip: rk3588-toybrick: Add missing Kconfig options

In reply to Jonas Karlman

Add .dtb-file entry to Makefile and enable Kconfig options required to configure pinctrl in SPL. Also add missing PHY_ROCKCHIP_NANENG_COMBOPHY.

Fixes 9fdd9a546986 ("board: rockchip: add Rockchip Toybrick TB-RK3588X board")
---
 arch/arm/dts/Makefile             | 1 +
 configs/toybrick-rk3588_defconfig | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm/dts/Makefile +1 -0
index f49b7e5d251f..3e0bad8306b5 100644
@@ -207,6 +207,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3588) += \
 	rk3588-quartzpro64.dtb \
 	rk3588s-rock-5a.dtb \
 	rk3588-rock-5b.dtb \
+	rk3588-toybrick-x0.dts \
 	rk3588-turing-rk1.dtb
 
 dtb-$(CONFIG_ROCKCHIP_RV1108) += \
configs/toybrick-rk3588_defconfig +4 -1
index 38fc7906eef2..0168e014103e 100644
@@ -33,8 +33,9 @@ CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -53,6 +54,8 @@ CONFIG_PHY_REALTEK=y
 CONFIG_DWC_ETH_QOS=y
 CONFIG_DWC_ETH_QOS_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
Signature · 1 line
2.43.2
#25 lore raw

Re: [PATCH 15/19] rockchip: rk3588-toybrick: Add missing Kconfig options

Hi Jonas,

Quoted 15 lines · Jonas Karlman

Add .dtb-file entry to Makefile and enable Kconfig options required to configure pinctrl in SPL. Also add missing PHY_ROCKCHIP_NANENG_COMBOPHY.

Fixes 9fdd9a546986 ("board: rockchip: add Rockchip Toybrick TB-RK3588X board")
---
  arch/arm/dts/Makefile             | 1 +
  configs/toybrick-rk3588_defconfig | 5 ++++-
  2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm/dts/Makefile +0 -0
index f49b7e5d251f..3e0bad8306b5 100644

arch/arm/dts/Makefile dtb-$(CONFIG_ROCKCHIP_RK3588) += \ · line 210

Quoted 4 lines
arch/arm/dts/Makefile +1 -0
@@ -207,6 +207,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3588) += \
  	rk3588-quartzpro64.dtb \
  	rk3588s-rock-5a.dtb \
  	rk3588-rock-5b.dtb \
+	rk3588-toybrick-x0.dts \

Should be .dtb here I guess :)

Cheers,
Quentin

#26 lore raw

Re: [PATCH 15/19] rockchip: rk3588-toybrick: Add missing Kconfig options

Hi Quentin,

Quoted 13 lines · Quentin Schulz

Hi Jonas,

Quoted 10 lines · Jonas Karlman

Add .dtb-file entry to Makefile and enable Kconfig options required to configure pinctrl in SPL. Also add missing PHY_ROCKCHIP_NANENG_COMBOPHY.

Fixes 9fdd9a546986 ("board: rockchip: add Rockchip Toybrick TB-RK3588X board")
---
  arch/arm/dts/Makefile             | 1 +
  configs/toybrick-rk3588_defconfig | 5 ++++-
  2 files changed, 5 insertions(+), 1 deletion(-)
Quoted 11 lines

arch/arm/dts/Makefile dtb-$(CONFIG_ROCKCHIP_RK3588) += \ · line 210

Quoted 9 lines
arch/arm/dts/Makefile +1 -0
index f49b7e5d251f..3e0bad8306b5 100644
@@ -207,6 +207,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3588) += \
  	rk3588-quartzpro64.dtb \
  	rk3588s-rock-5a.dtb \
  	rk3588-rock-5b.dtb \
+	rk3588-toybrick-x0.dts \

Should be .dtb here I guess :)

Hehe, my bad, will fix in v2 :-)

Regards,
Jonas

Quoted 3 lines

Cheers,
Quentin

#27 lore raw

PATCH 16/19 rockchip: rk3588-turing-rk1: Use dwc3-generic driver

In reply to Jonas Karlman

RK35xx boards are expected to use the dwc3-generic driver and not the xhci-dwc3 driver.

Remove the USB_XHCI_DWC3 option to ensure that the dwc3-generic driver is used. Also enable DWC_AHCI to support on-board SATA.

Fixes 153ac950a599 ("board: rockchip: Add the Turing RK1 SoM")
---
 configs/turing-rk1-rk3588_defconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
configs/turing-rk1-rk3588_defconfig +1 -3
index 77aacbc64b6c..e486f0597813 100644
@@ -52,9 +52,8 @@ CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigne
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
-CONFIG_SATA=y
-CONFIG_SCSI_AHCI=y
 CONFIG_AHCI_PCI=y
+CONFIG_DWC_AHCI=y
 CONFIG_SPL_CLK=y
 # CONFIG_USB_FUNCTION_FASTBOOT is not set
 CONFIG_ROCKCHIP_GPIO=y
@@ -90,7 +89,6 @@ CONFIG_ROCKCHIP_SFC=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
-CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_PCI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
Signature · 1 line
2.43.2
#28 lore raw

PATCH 17/19 rockchip: rk3588-edgeble-neu6: Enable FIT checksum validation

In reply to Jonas Karlman

Enable SPL_FIT_SIGNATURE=y and LEGACY_IMAGE_FORMAT=y to validate FIT images checksum in SPL.

Change to SPL_MAX_SIZE=0x40000 to allow SPL up to 256 KiB in size.

Enable SPL_DM_SEQ_ALIAS=y and SPL_PINCTRL=y to ensure eMMC and SD-card pinctrl is configured in SPL.

Enable SYS_NS16550_MEM32=y to use readl/writel in serial driver.

---
 configs/neu6a-io-rk3588_defconfig | 7 ++++++-
 configs/neu6b-io-rk3588_defconfig | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
configs/neu6a-io-rk3588_defconfig +6 -1
index bc2d70421ee9..050f1e5700b1 100644
@@ -13,11 +13,13 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-edgeble-neu6a-io.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
 CONFIG_SPL_PAD_TO=0x7f8000
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_ATF=y
@@ -28,6 +30,7 @@ CONFIG_CMD_MMC=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
 CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -40,9 +43,11 @@ CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
 CONFIG_ERRNO_STR=y
configs/neu6b-io-rk3588_defconfig +6 -1
index 8bc75a5f0dd9..dabb59afe687 100644
@@ -13,11 +13,13 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-edgeble-neu6b-io.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
 CONFIG_SPL_PAD_TO=0x7f8000
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_ATF=y
@@ -28,6 +30,7 @@ CONFIG_CMD_MMC=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
 CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -40,9 +43,11 @@ CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
 CONFIG_ERRNO_STR=y
Signature · 1 line
2.43.2
#29 lore raw

PATCH 18/19 rockchip: rk356x-generic: Add support for SPI flash and USB OTG

In reply to Jonas Karlman

Extend the Generic RK3566/RK3568 target to also include support for SPI flash, USB OTG, RockUSB and UMS.

Also fix sdmmc alias, include missing pinctrl and add broken-cd prop to fix use of SD-card in linux.

---
 arch/arm/dts/rk3568-generic-u-boot.dtsi |  7 +++++
 arch/arm/dts/rk3568-generic.dts         | 38 ++++++++++++++++++++++---
 configs/generic-rk3568_defconfig        | 31 ++++++++++++++++++++
 3 files changed, 72 insertions(+), 4 deletions(-)
arch/arm/dts/rk3568-generic-u-boot.dtsi +7 -0
index 6e8307e3bdf6..fd7f5367b759 100644
@@ -1,3 +1,10 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 
 #include "rk356x-u-boot.dtsi"
+
+&sfc {
+	flash@0 {
+		bootph-pre-ram;
+		bootph-some-ram;
+	};
+};
arch/arm/dts/rk3568-generic.dts +34 -4
index 88eb1bfd2aab..494bfd7449d5 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * Minimal generic DT for RK3566/RK3568 with eMMC and SD-card enabled
+ * Minimal generic DT for RK3566/RK3568 with eMMC, SD-card, SPI flash and USB OTG enabled
  */
 
 /dts-v1/;
@@ -12,7 +12,7 @@
 
 	aliases {
 		mmc0 = &sdhci;
-		mmc1 = &sdmmc;
+		mmc1 = &sdmmc0;
 	};
 
 	chosen {
@@ -28,21 +28,51 @@
 	no-sdio;
 	non-removable;
 	pinctrl-names = "default";
-	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>;
+	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
 	status = "okay";
 };
 
 &sdmmc0 {
+	broken-cd;
 	bus-width = <4>;
 	cap-sd-highspeed;
 	disable-wp;
 	no-mmc;
 	no-sdio;
 	pinctrl-names = "default";
-	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd>;
+	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
 	status = "okay";
 };
 
+&sfc {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;
+	};
+};
+
 &uart2 {
 	status = "okay";
 };
+
+&usb_host0_xhci {
+	dr_mode = "peripheral";
+	extcon = <&usb2phy0>;
+	maximum-speed = "high-speed";
+	phys = <&usb2phy0_otg>;
+	phy-names = "usb2-phy";
+	status = "okay";
+};
+
+&usb2phy0 {
+	status = "okay";
+};
+
+&usb2phy0_otg {
+	status = "okay";
+};
configs/generic-rk3568_defconfig +31 -0
index e7d5e55bbfd8..b458080cd539 100644
@@ -3,17 +3,22 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_DEFAULT_DEVICE_TREE="rk3568-generic"
 CONFIG_ROCKCHIP_RK3568=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
 CONFIG_SPL_SERIAL=y
 CONFIG_DEBUG_UART_BASE=0xFE660000
 CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
 CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
+# CONFIG_BOOTMETH_VBE is not set
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-generic.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
@@ -21,32 +26,58 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x40000
 CONFIG_SPL_PAD_TO=0x7f8000
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
 CONFIG_SPL_ATF=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
 CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+# CONFIG_NET is not set
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
+# CONFIG_ADC is not set
 CONFIG_SPL_CLK=y
+# CONFIG_USB_FUNCTION_FASTBOOT is not set
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_MISC=y
 # CONFIG_ROCKCHIP_IODOMAIN is not set
 CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SF_DEFAULT_BUS=4
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_GIGADEVICE=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_SILICONKAISER=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_XMC=y
+CONFIG_SPI_FLASH_XTX=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
 CONFIG_SYSRESET=y
+CONFIG_SYSRESET_PSCI=y
+CONFIG_USB=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_FUNCTION_ROCKUSB=y
 CONFIG_ERRNO_STR=y
Signature · 1 line
2.43.2
#30 lore raw

Re: [PATCH 18/19] rockchip: rk356x-generic: Add support for SPI flash and USB OTG

Hi Jonas,

Quoted 6 lines · Jonas Karlman

Extend the Generic RK3566/RK3568 target to also include support for SPI flash, USB OTG, RockUSB and UMS.

Also fix sdmmc alias, include missing pinctrl and add broken-cd prop to fix use of SD-card in linux.

I think we would have benefit with more and smaller commits there, but since you're the one mainly maintaining those generic devices, up to you.

[...]

arch/arm/dts/rk3568-generic.dts line 43

Quoted 10 lines
  &sdmmc0 {
arch/arm/dts/rk3568-generic.dts +2 -1
+	broken-cd;
  	bus-width = <4>;
  	cap-sd-highspeed;
  	disable-wp;
  	no-mmc;
  	no-sdio;
  	pinctrl-names = "default";
-	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd>;
+	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;

This is... surprising.

broken-cd but we still mux the SDMMC_DET pin in the SD card detect function?

According to the dt binding, if broken-cd is provided, we should do polling. If neither cd-gpios nor broken-cd is passed, host native card detect will be used (which I assume means the SD card controller handles this internally).

c.f. https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/mmc/mmc-controller.yaml#L33

What are we supposed to do there actually, because this seems to be contradicting itself?

arch/arm/dts/rk3568-generic.dts line 55

Quoted 12 lines
  	status = "okay";
  };

+&sfc {

arch/arm/dts/rk3568-generic.dts +8 -0
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;

Random thought, but shouldn't we update common/spl/spl_spi.c to read this value instead of using CONFIG_SF_DEFAULT_SPEED? (Nothing to do in this patch series though :) ).

[...]

Quoted 36 lines
configs/generic-rk3568_defconfig +7 -0
index e7d5e55bbfd8..b458080cd539 100644
@@ -3,17 +3,22 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
  CONFIG_COUNTER_FREQUENCY=24000000
  CONFIG_ARCH_ROCKCHIP=y
  CONFIG_NR_DRAM_BANKS=2
+CONFIG_SF_DEFAULT_SPEED=24000000
  CONFIG_DEFAULT_DEVICE_TREE="rk3568-generic"
  CONFIG_ROCKCHIP_RK3568=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
  CONFIG_SPL_SERIAL=y
  CONFIG_DEBUG_UART_BASE=0xFE660000
  CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
  CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
  CONFIG_SPL_FIT_SIGNATURE=y
  CONFIG_SPL_LOAD_FIT=y
+# CONFIG_BOOTMETH_VBE is not set
  CONFIG_LEGACY_IMAGE_FORMAT=y
  CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-generic.dtb"
  # CONFIG_DISPLAY_CPUINFO is not set
@@ -21,32 +26,58 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
  CONFIG_SPL_MAX_SIZE=0x40000
  CONFIG_SPL_PAD_TO=0x7f8000
  # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
  CONFIG_SPL_ATF=y
  CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y

configs/generic-rk3568_defconfig CONFIG_DISPLAY_BOARDINFO_LATE=y · line 43

Quoted 10 lines
configs/generic-rk3568_defconfig +4 -0
  CONFIG_CMD_MMC=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
  # CONFIG_CMD_SETEXPR is not set
  # CONFIG_SPL_DOS_PARTITION is not set
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
  CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+# CONFIG_NET is not set

This seems surprising, do you really want to get rid of network support for the generic board defconfig?

Cheers,
Quentin

#31 lore raw

Re: [PATCH 18/19] rockchip: rk356x-generic: Add support for SPI flash and USB OTG

Hi Quentin,

Quoted 6 lines · Quentin Schulz

Hi Jonas,

Quoted 3 lines · Jonas Karlman

Extend the Generic RK3566/RK3568 target to also include support for SPI flash, USB OTG, RockUSB and UMS.

Quoted 6 lines
Quoted 3 lines

Also fix sdmmc alias, include missing pinctrl and add broken-cd prop to fix use of SD-card in linux.

I think we would have benefit with more and smaller commits there, but since you're the one mainly maintaining those generic devices, up to you.

I can try to split it in a v2.

Quoted 24 lines

[...]

arch/arm/dts/rk3568-generic.dts line 43

Quoted 10 lines
  &sdmmc0 {
arch/arm/dts/rk3568-generic.dts +2 -1
+	broken-cd;
  	bus-width = <4>;
  	cap-sd-highspeed;
  	disable-wp;
  	no-mmc;
  	no-sdio;
  	pinctrl-names = "default";
-	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd>;
+	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;

This is... surprising.

broken-cd but we still mux the SDMMC_DET pin in the SD card detect function?

According to the dt binding, if broken-cd is provided, we should do polling. If neither cd-gpios nor broken-cd is passed, host native card detect will be used (which I assume means the SD card controller handles this internally).

Quoted 5 lines

c.f.
https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/mmc/mmc-controller.yaml#L33

What are we supposed to do there actually, because this seems to be contradicting itself?

The generic DTs is intended to be able to be use as control FDT in U-Boot with any board that mostly follows reference hw dedign as close as possible.

broken-cd was added to fool U-Boot (and possible Linux) into thinking a card is present. And the sdmmc0_det pinctrl was added to satisfy the controller logic and auto jtag.

When I tried to boot into linux with the control FDT prior to this, only eMMC was detected and working, after these changes SD-card was working.

Will re-try without broken-cd for v2.

Quoted 4 lines
Quoted 4 lines
  	status = "okay";
  };
Quoted 13 lines

arch/arm/dts/rk3568-generic.dts line 55

Quoted 9 lines

+&sfc {

arch/arm/dts/rk3568-generic.dts +8 -0
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;

Random thought, but shouldn't we update common/spl/spl_spi.c to read this value instead of using CONFIG_SF_DEFAULT_SPEED? (Nothing to do in this patch series though :) ).

For U-Boot proper the value from this prop is used, SF_DEFAULT_SPEED is only used in SPL.

Quoted 44 lines

[...]

Quoted 41 lines
configs/generic-rk3568_defconfig +9 -0
index e7d5e55bbfd8..b458080cd539 100644
@@ -3,17 +3,22 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
  CONFIG_COUNTER_FREQUENCY=24000000
  CONFIG_ARCH_ROCKCHIP=y
  CONFIG_NR_DRAM_BANKS=2
+CONFIG_SF_DEFAULT_SPEED=24000000
  CONFIG_DEFAULT_DEVICE_TREE="rk3568-generic"
  CONFIG_ROCKCHIP_RK3568=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
  CONFIG_SPL_SERIAL=y
  CONFIG_DEBUG_UART_BASE=0xFE660000
  CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
  CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
  CONFIG_SPL_FIT_SIGNATURE=y
  CONFIG_SPL_LOAD_FIT=y
+# CONFIG_BOOTMETH_VBE is not set
  CONFIG_LEGACY_IMAGE_FORMAT=y
  CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-generic.dtb"
  # CONFIG_DISPLAY_CPUINFO is not set
@@ -21,32 +26,58 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
  CONFIG_SPL_MAX_SIZE=0x40000
  CONFIG_SPL_PAD_TO=0x7f8000
  # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
  CONFIG_SPL_ATF=y
  CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y
  CONFIG_CMD_MMC=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
  # CONFIG_CMD_SETEXPR is not set
  # CONFIG_SPL_DOS_PARTITION is not set
Quoted 8 lines

configs/generic-rk3568_defconfig CONFIG_DISPLAY_BOARDINFO_LATE=y · line 43

Quoted 5 lines
configs/generic-rk3568_defconfig +2 -0
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
  CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+# CONFIG_NET is not set

This seems surprising, do you really want to get rid of network support for the generic board defconfig?

My intention with the generic targets is that they only contain bare minimum to boot from emmc/sd-card/spi flash. And a future possible use could be to replace vendor usbplug blob and/or for other flashing or recovery purposes. So network support should not be needed, also saves a little on binary size and boot speed.

Regards,
Jonas

Quoted 3 lines

Cheers,
Quentin

#32 lore raw

Re: [PATCH 18/19] rockchip: rk356x-generic: Add support for SPI flash and USB OTG

Hi Jonas,

Quoted 48 lines · Jonas Karlman

Hi Quentin,

Quoted 6 lines · Quentin Schulz

Hi Jonas,

Quoted 3 lines · Jonas Karlman

Extend the Generic RK3566/RK3568 target to also include support for SPI flash, USB OTG, RockUSB and UMS.

Quoted 6 lines
Quoted 3 lines

Also fix sdmmc alias, include missing pinctrl and add broken-cd prop to fix use of SD-card in linux.

I think we would have benefit with more and smaller commits there, but since you're the one mainly maintaining those generic devices, up to you.

I can try to split it in a v2.

Quoted 24 lines

[...]

arch/arm/dts/rk3568-generic.dts line 43

Quoted 10 lines
   &sdmmc0 {
arch/arm/dts/rk3568-generic.dts +2 -1
+	broken-cd;
   	bus-width = <4>;
   	cap-sd-highspeed;
   	disable-wp;
   	no-mmc;
   	no-sdio;
   	pinctrl-names = "default";
-	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd>;
+	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;

This is... surprising.

broken-cd but we still mux the SDMMC_DET pin in the SD card detect function?

According to the dt binding, if broken-cd is provided, we should do polling. If neither cd-gpios nor broken-cd is passed, host native card detect will be used (which I assume means the SD card controller handles this internally).

Quoted 5 lines

c.f.
https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/mmc/mmc-controller.yaml#L33

What are we supposed to do there actually, because this seems to be contradicting itself?

Quoted 8 lines

The generic DTs is intended to be able to be use as control FDT in U-Boot with any board that mostly follows reference hw dedign as close as possible.

broken-cd was added to fool U-Boot (and possible Linux) into thinking a card is present. And the sdmmc0_det pinctrl was added to satisfy the controller logic and auto jtag.

You shouldn't need to fool auto jtag anymore on RK3588 since https://source.denx.de/u-boot/u-boot/-/commit/5d710738bb1e0ff2bb93ce7baf4c9691ce919b53 since it would be disabled except if you enable it by hand via the symbol.

I assume you need a similar patch for RK3568.

Linux disables auto jtag automatically for RK3588 since https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/soc/rockchip/grf.c?id=6f6878ec6faf16a5f36761c93da6ea9cf09adb33. I guess you need a similar patch for RK3568?

Quoted 5 lines

When I tried to boot into linux with the control FDT prior to this, only eMMC was detected and working, after these changes SD-card was working.

Will re-try without broken-cd for v2.

I think it'd make sense to properly patch this by disabling autojtag feature instead :)

Quoted 18 lines
Quoted 4 lines
Quoted 4 lines
   	status = "okay";
   };
Quoted 13 lines

arch/arm/dts/rk3568-generic.dts line 55

Quoted 9 lines

+&sfc {

arch/arm/dts/rk3568-generic.dts +8 -0
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;

Random thought, but shouldn't we update common/spl/spl_spi.c to read this value instead of using CONFIG_SF_DEFAULT_SPEED? (Nothing to do in this patch series though :) ).

Quoted 3 lines

For U-Boot proper the value from this prop is used, SF_DEFAULT_SPEED is only used in SPL.

Yup, but I assume we have DM support for SPI flashes in SPL, so we could do this instead of having to rely on a defconfig symbol :)

Quoted 53 lines
Quoted 44 lines

[...]

Quoted 41 lines
configs/generic-rk3568_defconfig +9 -0
index e7d5e55bbfd8..b458080cd539 100644
@@ -3,17 +3,22 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
   CONFIG_COUNTER_FREQUENCY=24000000
   CONFIG_ARCH_ROCKCHIP=y
   CONFIG_NR_DRAM_BANKS=2
+CONFIG_SF_DEFAULT_SPEED=24000000
   CONFIG_DEFAULT_DEVICE_TREE="rk3568-generic"
   CONFIG_ROCKCHIP_RK3568=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
   CONFIG_SPL_SERIAL=y
   CONFIG_DEBUG_UART_BASE=0xFE660000
   CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
   CONFIG_SYS_LOAD_ADDR=0xc00800
   CONFIG_DEBUG_UART=y
   CONFIG_FIT=y
   CONFIG_FIT_VERBOSE=y
   CONFIG_SPL_FIT_SIGNATURE=y
   CONFIG_SPL_LOAD_FIT=y
+# CONFIG_BOOTMETH_VBE is not set
   CONFIG_LEGACY_IMAGE_FORMAT=y
   CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-generic.dtb"
   # CONFIG_DISPLAY_CPUINFO is not set
@@ -21,32 +26,58 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
   CONFIG_SPL_MAX_SIZE=0x40000
   CONFIG_SPL_PAD_TO=0x7f8000
   # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
   CONFIG_SPL_ATF=y
   CONFIG_CMD_GPIO=y
   CONFIG_CMD_GPT=y
   CONFIG_CMD_MMC=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
   # CONFIG_CMD_SETEXPR is not set
   # CONFIG_SPL_DOS_PARTITION is not set
Quoted 8 lines

configs/generic-rk3568_defconfig CONFIG_DISPLAY_BOARDINFO_LATE=y · line 43

Quoted 5 lines
configs/generic-rk3568_defconfig +2 -0
   CONFIG_SPL_OF_CONTROL=y
   CONFIG_OF_LIVE=y
   CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+# CONFIG_NET is not set

This seems surprising, do you really want to get rid of network support for the generic board defconfig?

Quoted 6 lines

My intention with the generic targets is that they only contain bare minimum to boot from emmc/sd-card/spi flash. And a future possible use could be to replace vendor usbplug blob and/or for other flashing or recovery purposes. So network support should not be needed, also saves a little on binary size and boot speed.

netboot/pxe/tftp is nice for debugging, but I understand :)

Cheers,
Quentin

#33 lore raw

PATCH 19/19 rockchip: rk3588-generic: Add support for USB OTG

In reply to Jonas Karlman

Extend the Generic RK3588S/RK3588 target to also include support for USB OTG, RockUSB and UMS.

---
 arch/arm/dts/rk3588-generic-u-boot.dtsi | 22 ++++++++++++++++++++++
 arch/arm/dts/rk3588-generic.dts         |  3 ++-
 configs/generic-rk3588_defconfig        | 17 +++++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)
arch/arm/dts/rk3588-generic-u-boot.dtsi +22 -0
index 853ed58cfe58..225dfa0b682a 100644
@@ -1,3 +1,25 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 
 #include "rk3588s-u-boot.dtsi"
+
+&u2phy0 {
+	status = "okay";
+};
+
+&u2phy0_otg {
+	status = "okay";
+};
+
+&usbdp_phy0 {
+	status = "okay";
+};
+
+&usbdp_phy0_u3 {
+	status = "okay";
+};
+
+&usb_host0_xhci {
+	dr_mode = "peripheral";
+	maximum-speed = "high-speed";
+	status = "okay";
+};
arch/arm/dts/rk3588-generic.dts +2 -1
index baafe7463f1b..6fc5892d4219 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * Minimal generic DT for RK3588S/RK3588 with eMMC and SD-card enabled
+ * Minimal generic DT for RK3588S/RK3588 with eMMC, SD-card and USB OTG enabled
  */
 
 /dts-v1/;
@@ -31,6 +31,7 @@
 };
 
 &sdmmc {
+	broken-cd;
 	bus-width = <4>;
 	cap-sd-highspeed;
 	disable-wp;
configs/generic-rk3588_defconfig +17 -0
index b50f4f8b8008..c465b4af66a8 100644
@@ -15,6 +15,7 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
+# CONFIG_BOOTMETH_VBE is not set
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-generic.dtb"
@@ -27,27 +28,43 @@ CONFIG_SPL_ATF=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
 CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+# CONFIG_NET is not set
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
+# CONFIG_ADC is not set
 CONFIG_SPL_CLK=y
+# CONFIG_USB_FUNCTION_FASTBOOT is not set
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_MISC=y
 CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_USBDP=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
+CONFIG_SYSRESET_PSCI=y
+CONFIG_USB=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_FUNCTION_ROCKUSB=y
 CONFIG_ERRNO_STR=y
Signature · 1 line
2.43.2