Skip to contentSkip to conversation

Enable full UFS boot on Rockchip RK3576

PATCH Applied Alexey Charkov 4 participants 14 messages Jan 20 – Mar 11

Subsystems (6)

v5 of 6 Applied Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover Enable full UFS boot on Rockchip RK3576

Rockchip RK3576 can load its bootloader from UFS among other options, so this series adds the necessary bits and pieces to enable an end-to-end boot from UFS (boot ROM -> SPL -> U-boot proper -> kernel).

To achieve the above, this series goes through the following:
- Patch 1 introduces arch-independent code to enable SPL images to use UFS devices, including build system tweaks and a function to locate a U-boot image at a fixed UFS offset and LUN (SCSI device number)
- Patch 2 adds an option to build the Rockchip reset driver for SPL
- Patch 3 adds device-reset functionality to the Rockchip UFS glue code, which is required for (at least some) UFS modules to respond to controller commands upon initial enumeration
- Patch 4 ties it all together for Rockchip RK3576

This has been tested on a FriendlyElec NanoPi M5 board with a Biwin BWU3AKC46C256G UFS module. Note that booting directly from UFS masks the issue which patch 3 aims to address, because the boot ROM initializes the UFS module before handing over to U-boot. If, however, one boots SPL from FSPI1 with the same driver code, the module fails to respond unless patch 3 is applied.

This depends on Jonas' recent series [3] enabling DMA writes to PMU SRAM, without which the UFS controller will fail to load ATF and end up in an unrecoverable error state requiring a hard reset.

Note that in my experience none of the RK3576 boards actually boot current mainline U-boot versions without a single-word SRAM write before jumping to DDR initialization, as done in Kwiboo's commit at [1]. Therefore, to test this series I additionally applied commits 6b152999908b..d43031c4045e from Kwiboo's rk3576 branch [2] (including 6b152999908b), so any testers might want to:

git cherry-pick 6b152999908b^..d43031c4045e

from there before or after applying this series

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commit/d43031c4045ef8aaf29c467b910207e721dabce0
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576?ref_type=heads
[3] https://lore.kernel.org/all/[email protected]/

---
Changes in v5:
- Reverse X-mas tree in spl_ufs:spl_ufs_load_image (thanks Quentin)
- Explicit "depends on UFS" from CONFIG_SPL_UFS_SUPPORT (thanks Quentin). This also pulls in SCSI to avoid compilation errors.
- Split out the patch enabling the Rockchip reset driver for SPL builds (thanks Quentin)
- Reworded the error message when requesting the UFS reset GPIO fails (thanks Quentin)
- Added a note in the commit message about reset-gpios being required by the DT binding (thanks Quentin)
- Dropped the redundant check of GPIO validity in the reset function (thanks Quentin)
- Added a note about GPIO4_D0 being the only GPIO usable for UFS reset
on RK3576 (thanks Shawn)
- Dropped "imply" symbols from the arch Kconfig, now that both GPIO
and RESET drivers are explicitly depended on from the UFS driver (thanks Quentinq)
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Added a dependency in b4 metadata on Jonas' new series enabling DMA writes to PMU SRAM (thanks Jonas)
- Dropped the bounce buffer quirk altogether, as it now works as-is
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Added a UFSHC quirk to use the SCSI bounce buffer for addresses outside SDRAM, and enabled it on Rockchip (thanks Neil and Tom)
- Dropped the open-coded bounce buffer from spl_ufs.c, now unneeded
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rename the SPL UFS read helper function more self-descriptively (thanks Neil)
- Add an option to configure the UFS LUN used to look for the U-boot image in raw offset mode - or rather the SCSI device number, which most of the time coincides with the UFS LUN as long as the UFS device is the only SCSI block device the SPL sees (thanks Neil)
- Add an option to use a bounce buffer in RAM while loading U-boot from UFS, which helps avoid changes to common spl_fit.c code which in v1 achieved a similar result at a performance cost to unrelated platforms (thanks Jonas)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexey Charkov (4):
spl: Make UFS available for SPL builds
reset: rockchip: make device resets available in SPL
ufs: rockchip: Add device reset support
rockchip: spl: Add support for booting from UFS

 MAINTAINERS                                  |  1 +
 arch/arm/dts/rk3576-u-boot.dtsi              | 16 ++++++++-
 arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
 arch/arm/include/asm/spl.h                   |  1 +
 arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
 arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++
 common/spl/Kconfig                           | 30 +++++++++++++++++
 common/spl/Makefile                          |  1 +
 common/spl/spl_ufs.c                         | 49 ++++++++++++++++++++++++++++
 drivers/Makefile                             |  1 +
 drivers/reset/Kconfig                        |  9 +++++
 drivers/reset/Makefile                       |  2 +-
 drivers/scsi/Makefile                        |  3 ++
 drivers/ufs/Kconfig                          |  4 +++
 drivers/ufs/ufs-rockchip.c                   | 22 +++++++++++++
 drivers/ufs/ufs-rockchip.h                   |  1 +
 lib/Makefile                                 |  1 +
 17 files changed, 155 insertions(+), 2 deletions(-)

---
base-commit: 6cdd7597a2fbfc1572c1b0af23d3daf1cefa2de7
change-id: 20251210-rk3576-ufs-ac3bf4e87156
prerequisite-message-id: [email protected]
prerequisite-patch-id: 3748e3880ac841dc25628911608140ebb4d4382f
prerequisite-patch-id: 671586e63ec9021b624d6cdc3b75aef53ed84972

Best regards,

Signature · 1 line
Alexey Charkov <[email protected]>
#1 lore raw

PATCH v5 1/4 spl: Make UFS available for SPL builds

Add minimal infrastructure to build SPL images with support for UFS storage devices. This also pulls in SCSI support and charset functions, which are dependencies of the UFS code.

With this, only a fixed offset is supported for loading the next image, which should be specified in CONFIG_SPL_UFS_RAW_U_BOOT_SECTOR as the number of 4096-byte sectors into the UFS block device.

---
 MAINTAINERS                |  1 +
 arch/arm/include/asm/spl.h |  1 +
 common/spl/Kconfig         | 30 ++++++++++++++++++++++++++++
 common/spl/Makefile        |  1 +
 common/spl/spl_ufs.c       | 49 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/Makefile           |  1 +
 drivers/scsi/Makefile      |  3 +++
 lib/Makefile               |  1 +
 8 files changed, 87 insertions(+)
MAINTAINERS +1 -0
index 27ce73d83f48..ca31e57f018a 100644
@@ -1861,6 +1861,7 @@ M:	Neil Armstrong <[email protected]>
 M:	Bhupesh Sharma <[email protected]>
 M:	Neha Malcom Francis <[email protected]>
 S:	Maintained
+F:	common/spl/spl_ufs.c
 F:	drivers/ufs/
 
 UPL
arch/arm/include/asm/spl.h +1 -0
index ee79a19c05c9..dd462ea6ad82 100644
@@ -30,6 +30,7 @@ enum {
 	BOOT_DEVICE_XIP,
 	BOOT_DEVICE_BOOTROM,
 	BOOT_DEVICE_SMH,
+	BOOT_DEVICE_UFS,
 	BOOT_DEVICE_NONE
 };
 #endif
common/spl/Kconfig +30 -0
index 4f4119f5806c..68f475717663 100644
@@ -1612,6 +1612,36 @@ config SPL_THERMAL
 	  automatic power-off when the temperature gets too high or low. Other
 	  devices may be discrete but connected on a suitable bus.
 
+config SPL_UFS_SUPPORT
+	bool "Support loading from UFS"
+	depends on UFS
+	select SPL_LOAD_BLOCK
+	help
+	  Enable support for UFS in SPL. This allows
+	  use of UFS devices such as hard drives and flash drivers for
+	  loading U-Boot.
+
+config SPL_UFS_RAW_U_BOOT_DEVNUM
+	int "SCSI device number of the UFS device to load U-Boot from"
+	depends on SPL_UFS_SUPPORT
+	default 0
+	help
+	  UFS devices are usually configured with multiple LUNs, which present
+	  themselves as sequentially numbered SCSI devices. Usually one would
+	  get a default LUN 0 taking up most of the space on the device, with
+	  a number of smaller LUNs following it. This option controls which of
+	  them the SPL will attempt to load U-Boot from. Note that this is the
+	  SCSI device number, which might differ from the UFS LUN if you have
+	  multiple SCSI devices attached and recognized by the SPL.
+
+config SPL_UFS_RAW_U_BOOT_SECTOR
+	hex "Address on the UFS to load U-Boot from"
+	depends on SPL_UFS_SUPPORT
+	default 0x800 if ARCH_ROCKCHIP
+	help
+	  Address on the block device to load U-Boot from.
+	  Units: UFS sectors (1 sector = 4096 bytes).
+
 config SPL_WATCHDOG
 	bool "Support watchdog drivers"
 	imply SPL_WDT if !HW_WATCHDOG
common/spl/Makefile +1 -0
index 4c9482bd3096..e18f3cf09484 100644
@@ -37,6 +37,7 @@ obj-$(CONFIG_$(PHASE_)DFU) += spl_dfu.o
 obj-$(CONFIG_$(PHASE_)SPI_LOAD) += spl_spi.o
 obj-$(CONFIG_$(PHASE_)RAM_SUPPORT) += spl_ram.o
 obj-$(CONFIG_$(PHASE_)USB_SDP_SUPPORT) += spl_sdp.o
+obj-$(CONFIG_$(PHASE_)UFS_SUPPORT) += spl_ufs.o
 endif
 
 obj-$(CONFIG_$(PHASE_)UPL) += spl_upl.o
common/spl/spl_ufs.c new file +49 -0

49 lines not on this page · raw message

drivers/Makefile +1 -0
index de993ae42ac7..43d0ba332818 100644
@@ -73,6 +73,7 @@ obj-$(CONFIG_SPL_USB_HOST) += usb/host/
 obj-$(CONFIG_SPL_SATA) += ata/ scsi/
 obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
 obj-$(CONFIG_SPL_THERMAL) += thermal/
+obj-$(CONFIG_SPL_UFS_SUPPORT) += scsi/ ufs/
 
 endif
 endif
drivers/scsi/Makefile +3 -0
index b76de1b22a8b..c9af60d5d03c 100644
@@ -16,4 +16,7 @@ ifdef CONFIG_XPL_BUILD
 ifdef CONFIG_SPL_SATA
 obj-$(CONFIG_SCSI) += scsi.o scsi-uclass.o
 endif
+ifdef CONFIG_SPL_UFS_SUPPORT
+obj-$(CONFIG_SCSI) += scsi.o scsi-uclass.o
+endif
 endif
lib/Makefile +1 -0
index 70667f3728c2..d0ffabc2b476 100644
@@ -147,6 +147,7 @@ else
 obj-$(CONFIG_$(PHASE_)SPRINTF) += vsprintf.o
 endif
 obj-$(CONFIG_$(PHASE_)STRTO) += strto.o
+obj-$(CONFIG_$(PHASE_)UFS_SUPPORT) += charset.o
 else
 # Main U-Boot always uses the full printf support
 obj-y += vsprintf.o strto.o
Signature · 1 line
2.52.0
#2 lore raw

PATCH v5 2/4 reset: rockchip: make device resets available in SPL

In reply to Alexey Charkov

Enable the Rockchip reset controller driver in SPL to allow resetting attached devices like UFS during early boot.

---
 drivers/reset/Kconfig  | 9 +++++++++
 drivers/reset/Makefile | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/reset/Kconfig +9 -0
index 74c267dfc4e5..d35f3904e404 100644
@@ -99,6 +99,15 @@ config RESET_ROCKCHIP
 	  though is that some reset signals, like I2C or MISC reset multiple
 	  devices.
 
+config SPL_RESET_ROCKCHIP
+	bool "SPL reset controller driver for Rockchip SoCs"
+	depends on SPL_DM_RESET && ARCH_ROCKCHIP && CLK
+	default y
+	help
+	  Support for the reset controller on Rockchip SoCs in SPL. Select this
+	  if you observe any reset-related warnings or errors when booting SPL,
+	  such as when using UFS storage
+
 config RESET_HSDK
 	bool "Synopsys HSDK Reset Driver"
 	depends on DM_RESET && TARGET_HSDK
drivers/reset/Makefile +1 -1
index ee5b009d1341..dc7d3b610e6e 100644
@@ -16,7 +16,7 @@ obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
 obj-$(CONFIG_RESET_AST2500) += reset-ast2500.o
 obj-$(CONFIG_RESET_AST2600) += reset-ast2600.o
-obj-$(CONFIG_RESET_ROCKCHIP) += reset-rockchip.o rst-rk3528.o rst-rk3576.o rst-rk3588.o
+obj-$(CONFIG_$(PHASE_)RESET_ROCKCHIP) += reset-rockchip.o rst-rk3528.o rst-rk3576.o rst-rk3588.o
 obj-$(CONFIG_RESET_MESON) += reset-meson.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_MEDIATEK) += reset-mediatek.o
Signature · 1 line
2.52.0
Reviewed-by on v5 2/4
#3 lore raw

Re: [PATCH v5 2/4] reset: rockchip: make device resets available in SPL

Hi Alexey,

Quoted 14 lines · Alexey Charkov

Enable the Rockchip reset controller driver in SPL to allow resetting attached devices like UFS during early boot.

---
 drivers/reset/Kconfig  | 9 +++++++++
 drivers/reset/Makefile | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/reset/Kconfig +0 -0
index 74c267dfc4e5..d35f3904e404 100644

drivers/reset/Kconfig config RESET_ROCKCHIP · line 104

Quoted 6 lines
drivers/reset/Kconfig +3 -0
@@ -99,6 +99,15 @@ config RESET_ROCKCHIP
 	  though is that some reset signals, like I2C or MISC reset multiple
 	  devices.
 
+config SPL_RESET_ROCKCHIP
+	bool "SPL reset controller driver for Rockchip SoCs"
+	depends on SPL_DM_RESET && ARCH_ROCKCHIP && CLK

This should probably depend on SPL_CLK not CLK.

Quoted 14 lines
drivers/reset/Kconfig +6 -0
+	default y
+	help
+	  Support for the reset controller on Rockchip SoCs in SPL. Select this
+	  if you observe any reset-related warnings or errors when booting SPL,
+	  such as when using UFS storage
+
 config RESET_HSDK
 	bool "Synopsys HSDK Reset Driver"
 	depends on DM_RESET && TARGET_HSDK
drivers/reset/Makefile +0 -0
index ee5b009d1341..dc7d3b610e6e 100644

drivers/reset/Makefile obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o · line 19

Quoted 5 lines
drivers/reset/Makefile +1 -1
@@ -16,7 +16,7 @@ obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
 obj-$(CONFIG_RESET_AST2500) += reset-ast2500.o
 obj-$(CONFIG_RESET_AST2600) += reset-ast2600.o
-obj-$(CONFIG_RESET_ROCKCHIP) += reset-rockchip.o rst-rk3528.o rst-rk3576.o rst-rk3588.o
+obj-$(CONFIG_$(PHASE_)RESET_ROCKCHIP) += reset-rockchip.o rst-rk3528.o rst-rk3576.o rst-rk3588.o

Please rebase on next, this line now include rst-rk3506.o.

With both fixed this is:

Regards,
Jonas

Quoted 4 lines
drivers/reset/Makefile +0 -0
 obj-$(CONFIG_RESET_MESON) += reset-meson.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_MEDIATEK) += reset-mediatek.o
#4 lore raw

PATCH v5 3/4 ufs: rockchip: Add device reset support

In reply to Alexey Charkov

Wire up the GPIO line which Rockchip RK3576 UFS controller uses to reset the connected UFS device.

This seems necessary at least for some UFS modules and fixes the following error while enumerating UFS storage:

ufshcd-rockchip ufshc@2a2d0000: ufshcd_link_startup: Device not present ufshcd-rockchip ufshc@2a2d0000: link startup failed -6 ufshcd-rockchip ufshc@2a2d0000: ufshcd_pltfrm_init() failed -6

Note that the GPIO descriptor for device resets is already required by the DT binding (link enclosed).

---
 drivers/ufs/Kconfig        |  4 ++++
 drivers/ufs/ufs-rockchip.c | 22 ++++++++++++++++++++++
 drivers/ufs/ufs-rockchip.h |  1 +
 3 files changed, 27 insertions(+)
drivers/ufs/Kconfig +4 -0
index 6c75bb2a0790..49472933de36 100644
@@ -76,6 +76,10 @@ config UFS_RENESAS_GEN5
 config UFS_ROCKCHIP
 	bool "Rockchip specific hooks to UFS controller platform driver"
 	depends on UFS
+	depends on DM_GPIO
+	depends on RESET_ROCKCHIP
+	depends on SPL_DM_GPIO || !SPL_UFS_SUPPORT
+	depends on SPL_RESET_ROCKCHIP || !SPL_UFS_SUPPORT
 	help
 	  This selects the Rockchip specific additions to UFSHCD platform driver.
 
drivers/ufs/ufs-rockchip.c +22 -0
index 0384244387da..3576f6e7a2b6 100644
@@ -5,6 +5,7 @@
  * Copyright (C) 2025 Rockchip Electronics Co.Ltd.
  */
 
+#include <asm/gpio.h>
 #include <asm/io.h>
 #include <clk.h>
 #include <dm.h>
@@ -153,11 +154,31 @@ static int ufs_rockchip_common_init(struct ufs_hba *hba)
 		return err;
 	}
 
+	err = gpio_request_by_name(dev, "reset-gpios", 0, &host->device_reset,
+				   GPIOD_IS_OUT | GPIOD_ACTIVE_LOW);
+	if (err) {
+		dev_err(dev, "Cannot get reset GPIO\n");
+		return err;
+	}
+
 	host->hba = hba;
 
 	return 0;
 }
 
+static int ufs_rockchip_device_reset(struct ufs_hba *hba)
+{
+	struct ufs_rockchip_host *host = dev_get_priv(hba->dev);
+
+	dm_gpio_set_value(&host->device_reset, true);
+	udelay(20);
+
+	dm_gpio_set_value(&host->device_reset, false);
+	udelay(20);
+
+	return 0;
+}
+
 static int ufs_rockchip_rk3576_init(struct ufs_hba *hba)
 {
 	int ret = 0;
@@ -175,6 +196,7 @@ static struct ufs_hba_ops ufs_hba_rk3576_vops = {
 	.init = ufs_rockchip_rk3576_init,
 	.phy_initialization = ufs_rockchip_rk3576_phy_init,
 	.hce_enable_notify = ufs_rockchip_hce_enable_notify,
+	.device_reset = ufs_rockchip_device_reset,
 };
 
 static const struct udevice_id ufs_rockchip_of_match[] = {
drivers/ufs/ufs-rockchip.h +1 -0
index 3dcb80f57020..50c2539da78a 100644
@@ -72,6 +72,7 @@ struct ufs_rockchip_host {
 	void __iomem *ufs_sys_ctrl;
 	void __iomem *mphy_base;
 	struct reset_ctl_bulk rsts;
+	struct gpio_desc device_reset;
 	struct clk ref_out_clk;
 	uint64_t caps;
 	uint32_t phy_config_mode;
Signature · 1 line
2.52.0
#5 lore raw

PATCH v5 4/4 rockchip: spl: Add support for booting from UFS

In reply to Alexey Charkov

Add the required architecture-specific lookups to enable U-boot SPL to load images from UFS storage devices on Rockchip RK3576, which has a boot ROM capable of loading the SPL image from UFS.

---
 arch/arm/dts/rk3576-u-boot.dtsi              | 16 +++++++++++++++-
 arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
 arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
 arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)
arch/arm/dts/rk3576-u-boot.dtsi +15 -1
index dc3771b556a3..e442e94f7132 100644
@@ -12,7 +12,7 @@
 	};
 
 	chosen {
-		u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
+		u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci, &ufshc;
 	};
 
 	dmc {
@@ -81,6 +81,15 @@
 	bootph-some-ram;
 };
 
+&gpio4 {
+	/* This is specifically for GPIO4_D0, which is the only 1.2V capable
+	 * pin on RK3576 available for use as the UFS device reset, thus
+	 * &gpio4 is required for booting from UFS on RK3576.
+	 */
+	bootph-pre-ram;
+	bootph-some-ram;
+};
+
 &ioc_grf {
 	bootph-all;
 };
@@ -176,6 +185,11 @@
 	bootph-pre-ram;
 };
 
+&ufshc {
+	bootph-pre-ram;
+	bootph-some-ram;
+};
+
 &xin24m {
 	bootph-all;
 };
arch/arm/include/asm/arch-rockchip/bootrom.h +1 -0
index b15938c021d6..f9ecb6858f04 100644
@@ -51,6 +51,7 @@ enum {
 	BROM_BOOTSOURCE_SPINOR = 3,
 	BROM_BOOTSOURCE_SPINAND = 4,
 	BROM_BOOTSOURCE_SD = 5,
+	BROM_BOOTSOURCE_UFS = 7,
 	BROM_BOOTSOURCE_I2C = 8,
 	BROM_BOOTSOURCE_SPI = 9,
 	BROM_BOOTSOURCE_USB = 10,
arch/arm/mach-rockchip/rk3576/rk3576.c +1 -0
index a1e8a7572fa4..46cf60dc77c7 100644
@@ -46,6 +46,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
 	[BROM_BOOTSOURCE_FSPI0] = "/soc/spi@2a340000/flash@0",
 	[BROM_BOOTSOURCE_FSPI1_M1] = "/soc/spi@2a300000/flash@0",
 	[BROM_BOOTSOURCE_SD] = "/soc/mmc@2a310000",
+	[BROM_BOOTSOURCE_UFS] = "/soc/ufshc@2a2d0000",
 };
 
 static struct mm_region rk3576_mem_map[] = {
arch/arm/mach-rockchip/spl-boot-order.c +14 -0
index 6572dde29f65..d2dd5e10935f 100644
@@ -76,6 +76,9 @@ static int spl_node_to_boot_device(int node)
 	if (!uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
 		return BOOT_DEVICE_SPI;
 
+	if (!uclass_find_device_by_of_offset(UCLASS_UFS, node, &parent))
+		return BOOT_DEVICE_UFS;
+
 	return -1;
 }
 
@@ -231,6 +234,17 @@ int spl_decode_boot_device(u32 boot_device, char *buf, size_t buflen)
 		return -ENODEV;
 	}
 
+	if (boot_device == BOOT_DEVICE_UFS) {
+		ret = uclass_find_device(UCLASS_UFS, 0, &dev);
+		if (ret) {
+			debug("%s: could not find device for UFS: %d\n",
+			      __func__, ret);
+			return ret;
+		}
+
+		return ofnode_get_path(dev_ofnode(dev), buf, buflen);
+	}
+
 #if CONFIG_IS_ENABLED(BLK)
 	dev_num = (boot_device == BOOT_DEVICE_MMC1) ? 0 : 1;
 
Signature · 1 line
2.52.0
Reviewed-by on v5 4/4
#6 lore raw

Re: [PATCH v5 4/4] rockchip: spl: Add support for booting from UFS

Hi Alexey,

Quoted 27 lines · Alexey Charkov

Add the required architecture-specific lookups to enable U-boot SPL to load images from UFS storage devices on Rockchip RK3576, which has a boot ROM capable of loading the SPL image from UFS.

---
 arch/arm/dts/rk3576-u-boot.dtsi              | 16 +++++++++++++++-
 arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
 arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
 arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)
arch/arm/dts/rk3576-u-boot.dtsi +1 -1
index dc3771b556a3..e442e94f7132 100644
@@ -12,7 +12,7 @@
 	};
 
 	chosen {
-		u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
+		u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci, &ufshc;
 	};
 
 	dmc {
@@ -81,6 +81,15 @@
 	bootph-some-ram;

arch/arm/dts/rk3576-u-boot.dtsi line 91

Quoted 10 lines
arch/arm/dts/rk3576-u-boot.dtsi +8 -0
 };
 
+&gpio4 {
+	/* This is specifically for GPIO4_D0, which is the only 1.2V capable
+	 * pin on RK3576 available for use as the UFS device reset, thus
+	 * &gpio4 is required for booting from UFS on RK3576.
+	 */
+	bootph-pre-ram;
+	bootph-some-ram;
+};

Please wrap this in a #ifdef CONFIG_SPL_UFS_SUPPORT or similar, we only need to include gpio4 in spl/u-boot-spl.dtb when SPL_UFS_SUPPORT is enabled.

arch/arm/dts/rk3576-u-boot.dtsi line 95

Quoted 4 lines
arch/arm/dts/rk3576-u-boot.dtsi +1 -0
+
 &ioc_grf {
 	bootph-all;
 };

Please add following UFS related pinconf node to SPL, it is referenced by ufs_rstgpio:

&pcfg_pull_down {
	bootph-pre-ram;
	bootph-some-ram;
};

arch/arm/dts/rk3576-u-boot.dtsi line 191

Quoted 8 lines
arch/arm/dts/rk3576-u-boot.dtsi +4 -0
@@ -176,6 +185,11 @@
 	bootph-pre-ram;
 };
 
+&ufshc {
+	bootph-pre-ram;
+	bootph-some-ram;
+};

Please add following UFS related pinctrl nodes to SPL:

&ufs_refclk {
	bootph-pre-ram;
	bootph-some-ram;
};
&ufs_rstgpio {
	bootph-pre-ram;
	bootph-some-ram;
};

Above changes depends on the 438f1fe833e0 from devicetree-rebasing, please pick and include that in a v6.

With above fixed this is:

Also feel free to pick "rockchip: rk3576-rock-4d: Enable UFS support" from my rk3576 branch [1] in a v6. That branch also include FIXUPs with the changes I have requested and tested on a ROCK 4D.

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576

Regards,
Jonas

Quoted 61 lines
arch/arm/dts/rk3576-u-boot.dtsi +1 -0
+
 &xin24m {
 	bootph-all;
 };
arch/arm/include/asm/arch-rockchip/bootrom.h +1 -0
index b15938c021d6..f9ecb6858f04 100644
@@ -51,6 +51,7 @@ enum {
 	BROM_BOOTSOURCE_SPINOR = 3,
 	BROM_BOOTSOURCE_SPINAND = 4,
 	BROM_BOOTSOURCE_SD = 5,
+	BROM_BOOTSOURCE_UFS = 7,
 	BROM_BOOTSOURCE_I2C = 8,
 	BROM_BOOTSOURCE_SPI = 9,
 	BROM_BOOTSOURCE_USB = 10,
arch/arm/mach-rockchip/rk3576/rk3576.c +1 -0
index a1e8a7572fa4..46cf60dc77c7 100644
@@ -46,6 +46,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
 	[BROM_BOOTSOURCE_FSPI0] = "/soc/spi@2a340000/flash@0",
 	[BROM_BOOTSOURCE_FSPI1_M1] = "/soc/spi@2a300000/flash@0",
 	[BROM_BOOTSOURCE_SD] = "/soc/mmc@2a310000",
+	[BROM_BOOTSOURCE_UFS] = "/soc/ufshc@2a2d0000",
 };
 
 static struct mm_region rk3576_mem_map[] = {
arch/arm/mach-rockchip/spl-boot-order.c +14 -0
index 6572dde29f65..d2dd5e10935f 100644
@@ -76,6 +76,9 @@ static int spl_node_to_boot_device(int node)
 	if (!uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
 		return BOOT_DEVICE_SPI;
 
+	if (!uclass_find_device_by_of_offset(UCLASS_UFS, node, &parent))
+		return BOOT_DEVICE_UFS;
+
 	return -1;
 }
 
@@ -231,6 +234,17 @@ int spl_decode_boot_device(u32 boot_device, char *buf, size_t buflen)
 		return -ENODEV;
 	}
 
+	if (boot_device == BOOT_DEVICE_UFS) {
+		ret = uclass_find_device(UCLASS_UFS, 0, &dev);
+		if (ret) {
+			debug("%s: could not find device for UFS: %d\n",
+			      __func__, ret);
+			return ret;
+		}
+
+		return ofnode_get_path(dev_ofnode(dev), buf, buflen);
+	}
+
 #if CONFIG_IS_ENABLED(BLK)
 	dev_num = (boot_device == BOOT_DEVICE_MMC1) ? 0 : 1;
 
#7 lore raw

Re: [PATCH v5 4/4] rockchip: spl: Add support for booting from UFS

Quoted 85 lines · Jonas Karlman

Hi Alexey,

Quoted 27 lines · Alexey Charkov

Add the required architecture-specific lookups to enable U-boot SPL to load images from UFS storage devices on Rockchip RK3576, which has a boot ROM capable of loading the SPL image from UFS.

---
 arch/arm/dts/rk3576-u-boot.dtsi              | 16 +++++++++++++++-
 arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
 arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
 arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)
arch/arm/dts/rk3576-u-boot.dtsi +1 -1
index dc3771b556a3..e442e94f7132 100644
@@ -12,7 +12,7 @@
      };
 
      chosen {
-             u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
+             u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci, &ufshc;
      };
 
      dmc {
@@ -81,6 +81,15 @@
      bootph-some-ram;

arch/arm/dts/rk3576-u-boot.dtsi line 91

Quoted 10 lines
arch/arm/dts/rk3576-u-boot.dtsi +8 -0
 };
 
+&gpio4 {
+     /* This is specifically for GPIO4_D0, which is the only 1.2V capable
+      * pin on RK3576 available for use as the UFS device reset, thus
+      * &gpio4 is required for booting from UFS on RK3576.
+      */
+     bootph-pre-ram;
+     bootph-some-ram;
+};

Please wrap this in a #ifdef CONFIG_SPL_UFS_SUPPORT or similar, we only need to include gpio4 in spl/u-boot-spl.dtb when SPL_UFS_SUPPORT is enabled.

arch/arm/dts/rk3576-u-boot.dtsi line 95

Quoted 4 lines
arch/arm/dts/rk3576-u-boot.dtsi +1 -0
+
 &ioc_grf {
      bootph-all;
 };

Please add following UFS related pinconf node to SPL, it is referenced by ufs_rstgpio:

&pcfg_pull_down {
        bootph-pre-ram;
        bootph-some-ram;
};

arch/arm/dts/rk3576-u-boot.dtsi line 191

Quoted 8 lines
arch/arm/dts/rk3576-u-boot.dtsi +4 -0
@@ -176,6 +185,11 @@
      bootph-pre-ram;
 };
 
+&ufshc {
+     bootph-pre-ram;
+     bootph-some-ram;
+};

Please add following UFS related pinctrl nodes to SPL:

&ufs_refclk {
        bootph-pre-ram;
        bootph-some-ram;
};
&ufs_rstgpio {
        bootph-pre-ram;
        bootph-some-ram;
};

Above changes depends on the 438f1fe833e0 from devicetree-rebasing, please pick and include that in a v6.

With above fixed this is:

Quoted 7 lines

Also feel free to pick "rockchip: rk3576-rock-4d: Enable UFS support" from my rk3576 branch [1] in a v6. That branch also include FIXUPs with the changes I have requested and tested on a ROCK 4D.

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576

Thanks a lot Jonas! Applied the above (and your suggested fix from the other thread). Will also cherry-pick the DTS change enabling UFSHC on NanoPi M5 and add the respective defconfig change for completeness, then resend this without the two patches which Neil has already applied to his tree, so that Kever could pull the remainder.

Best regards,
Alexey

#8 lore raw
In reply to Alexey Charkov
Quoted 110 lines · Alexey Charkov

Rockchip RK3576 can load its bootloader from UFS among other options, so this series adds the necessary bits and pieces to enable an end-to-end boot from UFS (boot ROM -> SPL -> U-boot proper -> kernel).

To achieve the above, this series goes through the following:
- Patch 1 introduces arch-independent code to enable SPL images to use UFS devices, including build system tweaks and a function to locate a U-boot image at a fixed UFS offset and LUN (SCSI device number)
- Patch 2 adds an option to build the Rockchip reset driver for SPL
- Patch 3 adds device-reset functionality to the Rockchip UFS glue code, which is required for (at least some) UFS modules to respond to controller commands upon initial enumeration
- Patch 4 ties it all together for Rockchip RK3576

This has been tested on a FriendlyElec NanoPi M5 board with a Biwin BWU3AKC46C256G UFS module. Note that booting directly from UFS masks the issue which patch 3 aims to address, because the boot ROM initializes the UFS module before handing over to U-boot. If, however, one boots SPL from FSPI1 with the same driver code, the module fails to respond unless patch 3 is applied.

This depends on Jonas' recent series [3] enabling DMA writes to PMU SRAM, without which the UFS controller will fail to load ATF and end up in an unrecoverable error state requiring a hard reset.

Note that in my experience none of the RK3576 boards actually boot current mainline U-boot versions without a single-word SRAM write before jumping to DDR initialization, as done in Kwiboo's commit at [1]. Therefore, to test this series I additionally applied commits 6b152999908b..d43031c4045e from Kwiboo's rk3576 branch [2] (including 6b152999908b), so any testers might want to:

git cherry-pick 6b152999908b^..d43031c4045e

from there before or after applying this series

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commit/d43031c4045ef8aaf29c467b910207e721dabce0
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576?ref_type=heads
[3] https://lore.kernel.org/all/[email protected]/

---
Changes in v5:
- Reverse X-mas tree in spl_ufs:spl_ufs_load_image (thanks Quentin)
- Explicit "depends on UFS" from CONFIG_SPL_UFS_SUPPORT (thanks Quentin). This also pulls in SCSI to avoid compilation errors.
- Split out the patch enabling the Rockchip reset driver for SPL builds (thanks Quentin)
- Reworded the error message when requesting the UFS reset GPIO fails (thanks Quentin)
- Added a note in the commit message about reset-gpios being required by the DT binding (thanks Quentin)
- Dropped the redundant check of GPIO validity in the reset function (thanks Quentin)
- Added a note about GPIO4_D0 being the only GPIO usable for UFS reset
on RK3576 (thanks Shawn)
- Dropped "imply" symbols from the arch Kconfig, now that both GPIO
and RESET drivers are explicitly depended on from the UFS driver (thanks Quentinq)
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Added a dependency in b4 metadata on Jonas' new series enabling DMA writes to PMU SRAM (thanks Jonas)
- Dropped the bounce buffer quirk altogether, as it now works as-is
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Added a UFSHC quirk to use the SCSI bounce buffer for addresses outside SDRAM, and enabled it on Rockchip (thanks Neil and Tom)
- Dropped the open-coded bounce buffer from spl_ufs.c, now unneeded
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rename the SPL UFS read helper function more self-descriptively (thanks Neil)
- Add an option to configure the UFS LUN used to look for the U-boot image in raw offset mode - or rather the SCSI device number, which most of the time coincides with the UFS LUN as long as the UFS device is the only SCSI block device the SPL sees (thanks Neil)
- Add an option to use a bounce buffer in RAM while loading U-boot from UFS, which helps avoid changes to common spl_fit.c code which in v1 achieved a similar result at a performance cost to unrelated platforms (thanks Jonas)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexey Charkov (4):
spl: Make UFS available for SPL builds
reset: rockchip: make device resets available in SPL
ufs: rockchip: Add device reset support
rockchip: spl: Add support for booting from UFS

 MAINTAINERS                                  |  1 +
 arch/arm/dts/rk3576-u-boot.dtsi              | 16 ++++++++-
 arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
 arch/arm/include/asm/spl.h                   |  1 +
 arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
 arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++
 common/spl/Kconfig                           | 30 +++++++++++++++++
 common/spl/Makefile                          |  1 +
 common/spl/spl_ufs.c                         | 49 ++++++++++++++++++++++++++++
 drivers/Makefile                             |  1 +
 drivers/reset/Kconfig                        |  9 +++++
 drivers/reset/Makefile                       |  2 +-
 drivers/scsi/Makefile                        |  3 ++
 drivers/ufs/Kconfig                          |  4 +++
 drivers/ufs/ufs-rockchip.c                   | 22 +++++++++++++
 drivers/ufs/ufs-rockchip.h                   |  1 +
 lib/Makefile                                 |  1 +
 17 files changed, 155 insertions(+), 2 deletions(-)
Quoted 6 lines

---
base-commit: 6cdd7597a2fbfc1572c1b0af23d3daf1cefa2de7
change-id: 20251210-rk3576-ufs-ac3bf4e87156
prerequisite-message-id: [email protected]
prerequisite-patch-id: 3748e3880ac841dc25628911608140ebb4d4382f
prerequisite-patch-id: 671586e63ec9021b624d6cdc3b75aef53ed84972

Hi Neil, Kever,

Now that Kever has applied the patch from Jonas [1] which lets this one work without bounce buffers on Rockchip RK3576, would you mind giving this series another look?

Please let me know if I should rebase / resubmit / adjust in any way. Would be great to have it merged.

Thanks a lot,
Alexey

[1] https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/commit/4015faa32342fd9c494c318c21de106f98dd4674

#9 lore raw

Hi Alexey,

Quoted 118 lines · Alexey Charkov
Quoted 110 lines · Alexey Charkov

Rockchip RK3576 can load its bootloader from UFS among other options, so this series adds the necessary bits and pieces to enable an end-to-end boot from UFS (boot ROM -> SPL -> U-boot proper -> kernel).

To achieve the above, this series goes through the following:
- Patch 1 introduces arch-independent code to enable SPL images to use UFS devices, including build system tweaks and a function to locate a U-boot image at a fixed UFS offset and LUN (SCSI device number)
- Patch 2 adds an option to build the Rockchip reset driver for SPL
- Patch 3 adds device-reset functionality to the Rockchip UFS glue code, which is required for (at least some) UFS modules to respond to controller commands upon initial enumeration
- Patch 4 ties it all together for Rockchip RK3576

This has been tested on a FriendlyElec NanoPi M5 board with a Biwin BWU3AKC46C256G UFS module. Note that booting directly from UFS masks the issue which patch 3 aims to address, because the boot ROM initializes the UFS module before handing over to U-boot. If, however, one boots SPL from FSPI1 with the same driver code, the module fails to respond unless patch 3 is applied.

This depends on Jonas' recent series [3] enabling DMA writes to PMU SRAM, without which the UFS controller will fail to load ATF and end up in an unrecoverable error state requiring a hard reset.

Note that in my experience none of the RK3576 boards actually boot current mainline U-boot versions without a single-word SRAM write before jumping to DDR initialization, as done in Kwiboo's commit at [1]. Therefore, to test this series I additionally applied commits 6b152999908b..d43031c4045e from Kwiboo's rk3576 branch [2] (including 6b152999908b), so any testers might want to:

git cherry-pick 6b152999908b^..d43031c4045e

from there before or after applying this series

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commit/d43031c4045ef8aaf29c467b910207e721dabce0
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576?ref_type=heads
[3] https://lore.kernel.org/all/[email protected]/

---
Changes in v5:
- Reverse X-mas tree in spl_ufs:spl_ufs_load_image (thanks Quentin)
- Explicit "depends on UFS" from CONFIG_SPL_UFS_SUPPORT (thanks Quentin). This also pulls in SCSI to avoid compilation errors.
- Split out the patch enabling the Rockchip reset driver for SPL builds (thanks Quentin)
- Reworded the error message when requesting the UFS reset GPIO fails (thanks Quentin)
- Added a note in the commit message about reset-gpios being required by the DT binding (thanks Quentin)
- Dropped the redundant check of GPIO validity in the reset function (thanks Quentin)
- Added a note about GPIO4_D0 being the only GPIO usable for UFS reset
on RK3576 (thanks Shawn)
- Dropped "imply" symbols from the arch Kconfig, now that both GPIO
and RESET drivers are explicitly depended on from the UFS driver (thanks Quentinq)
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Added a dependency in b4 metadata on Jonas' new series enabling DMA writes to PMU SRAM (thanks Jonas)
- Dropped the bounce buffer quirk altogether, as it now works as-is
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Added a UFSHC quirk to use the SCSI bounce buffer for addresses outside SDRAM, and enabled it on Rockchip (thanks Neil and Tom)
- Dropped the open-coded bounce buffer from spl_ufs.c, now unneeded
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rename the SPL UFS read helper function more self-descriptively (thanks Neil)
- Add an option to configure the UFS LUN used to look for the U-boot image in raw offset mode - or rather the SCSI device number, which most of the time coincides with the UFS LUN as long as the UFS device is the only SCSI block device the SPL sees (thanks Neil)
- Add an option to use a bounce buffer in RAM while loading U-boot from UFS, which helps avoid changes to common spl_fit.c code which in v1 achieved a similar result at a performance cost to unrelated platforms (thanks Jonas)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexey Charkov (4):
spl: Make UFS available for SPL builds
reset: rockchip: make device resets available in SPL
ufs: rockchip: Add device reset support
rockchip: spl: Add support for booting from UFS

 MAINTAINERS                                  |  1 +
 arch/arm/dts/rk3576-u-boot.dtsi              | 16 ++++++++-
 arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
 arch/arm/include/asm/spl.h                   |  1 +
 arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
 arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++
 common/spl/Kconfig                           | 30 +++++++++++++++++
 common/spl/Makefile                          |  1 +
 common/spl/spl_ufs.c                         | 49 ++++++++++++++++++++++++++++
 drivers/Makefile                             |  1 +
 drivers/reset/Kconfig                        |  9 +++++
 drivers/reset/Makefile                       |  2 +-
 drivers/scsi/Makefile                        |  3 ++
 drivers/ufs/Kconfig                          |  4 +++
 drivers/ufs/ufs-rockchip.c                   | 22 +++++++++++++
 drivers/ufs/ufs-rockchip.h                   |  1 +
 lib/Makefile                                 |  1 +
 17 files changed, 155 insertions(+), 2 deletions(-)
Quoted 6 lines

---
base-commit: 6cdd7597a2fbfc1572c1b0af23d3daf1cefa2de7
change-id: 20251210-rk3576-ufs-ac3bf4e87156
prerequisite-message-id: [email protected]
prerequisite-patch-id: 3748e3880ac841dc25628911608140ebb4d4382f
prerequisite-patch-id: 671586e63ec9021b624d6cdc3b75aef53ed84972

Quoted 8 lines

Hi Neil, Kever,

Now that Kever has applied the patch from Jonas [1] which lets this one work without bounce buffers on Rockchip RK3576, would you mind giving this series another look?

Please let me know if I should rebase / resubmit / adjust in any way. Would be great to have it merged.

I will test and review this later today, I think we may need to include the gpio/pinctrl fix in u-boot.dtsi until it has fully landed i dts/upstream, or possible add a bootph props in soc u-boot.dtsi.

Maybe it would make sense to also enable UFS booting on a board as part of this series? E.g. on the NanoPi M5 and/or ROCK 4D?

Regards,
Jonas

Quoted 5 lines

Thanks a lot,
Alexey

[1] https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/commit/4015faa32342fd9c494c318c21de106f98dd4674

#10 lore raw
Quoted 128 lines · Jonas Karlman

Hi Alexey,

Quoted 124 lines · Alexey Charkov
Quoted 110 lines · Alexey Charkov

Rockchip RK3576 can load its bootloader from UFS among other options, so this series adds the necessary bits and pieces to enable an end-to-end boot from UFS (boot ROM -> SPL -> U-boot proper -> kernel).

To achieve the above, this series goes through the following:
- Patch 1 introduces arch-independent code to enable SPL images to use UFS devices, including build system tweaks and a function to locate a U-boot image at a fixed UFS offset and LUN (SCSI device number)
- Patch 2 adds an option to build the Rockchip reset driver for SPL
- Patch 3 adds device-reset functionality to the Rockchip UFS glue code, which is required for (at least some) UFS modules to respond to controller commands upon initial enumeration
- Patch 4 ties it all together for Rockchip RK3576

This has been tested on a FriendlyElec NanoPi M5 board with a Biwin BWU3AKC46C256G UFS module. Note that booting directly from UFS masks the issue which patch 3 aims to address, because the boot ROM initializes the UFS module before handing over to U-boot. If, however, one boots SPL from FSPI1 with the same driver code, the module fails to respond unless patch 3 is applied.

This depends on Jonas' recent series [3] enabling DMA writes to PMU SRAM, without which the UFS controller will fail to load ATF and end up in an unrecoverable error state requiring a hard reset.

Note that in my experience none of the RK3576 boards actually boot current mainline U-boot versions without a single-word SRAM write before jumping to DDR initialization, as done in Kwiboo's commit at [1]. Therefore, to test this series I additionally applied commits 6b152999908b..d43031c4045e from Kwiboo's rk3576 branch [2] (including 6b152999908b), so any testers might want to:

git cherry-pick 6b152999908b^..d43031c4045e

from there before or after applying this series

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commit/d43031c4045ef8aaf29c467b910207e721dabce0
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576?ref_type=heads
[3] https://lore.kernel.org/all/[email protected]/

---
Changes in v5:
- Reverse X-mas tree in spl_ufs:spl_ufs_load_image (thanks Quentin)
- Explicit "depends on UFS" from CONFIG_SPL_UFS_SUPPORT (thanks Quentin). This also pulls in SCSI to avoid compilation errors.
- Split out the patch enabling the Rockchip reset driver for SPL builds (thanks Quentin)
- Reworded the error message when requesting the UFS reset GPIO fails (thanks Quentin)
- Added a note in the commit message about reset-gpios being required by the DT binding (thanks Quentin)
- Dropped the redundant check of GPIO validity in the reset function (thanks Quentin)
- Added a note about GPIO4_D0 being the only GPIO usable for UFS reset
on RK3576 (thanks Shawn)
- Dropped "imply" symbols from the arch Kconfig, now that both GPIO
and RESET drivers are explicitly depended on from the UFS driver (thanks Quentinq)
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Added a dependency in b4 metadata on Jonas' new series enabling DMA writes to PMU SRAM (thanks Jonas)
- Dropped the bounce buffer quirk altogether, as it now works as-is
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Added a UFSHC quirk to use the SCSI bounce buffer for addresses outside SDRAM, and enabled it on Rockchip (thanks Neil and Tom)
- Dropped the open-coded bounce buffer from spl_ufs.c, now unneeded
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rename the SPL UFS read helper function more self-descriptively (thanks Neil)
- Add an option to configure the UFS LUN used to look for the U-boot image in raw offset mode - or rather the SCSI device number, which most of the time coincides with the UFS LUN as long as the UFS device is the only SCSI block device the SPL sees (thanks Neil)
- Add an option to use a bounce buffer in RAM while loading U-boot from UFS, which helps avoid changes to common spl_fit.c code which in v1 achieved a similar result at a performance cost to unrelated platforms (thanks Jonas)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexey Charkov (4):
spl: Make UFS available for SPL builds
reset: rockchip: make device resets available in SPL
ufs: rockchip: Add device reset support
rockchip: spl: Add support for booting from UFS

 MAINTAINERS                                  |  1 +
 arch/arm/dts/rk3576-u-boot.dtsi              | 16 ++++++++-
 arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
 arch/arm/include/asm/spl.h                   |  1 +
 arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
 arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++
 common/spl/Kconfig                           | 30 +++++++++++++++++
 common/spl/Makefile                          |  1 +
 common/spl/spl_ufs.c                         | 49 ++++++++++++++++++++++++++++
 drivers/Makefile                             |  1 +
 drivers/reset/Kconfig                        |  9 +++++
 drivers/reset/Makefile                       |  2 +-
 drivers/scsi/Makefile                        |  3 ++
 drivers/ufs/Kconfig                          |  4 +++
 drivers/ufs/ufs-rockchip.c                   | 22 +++++++++++++
 drivers/ufs/ufs-rockchip.h                   |  1 +
 lib/Makefile                                 |  1 +
 17 files changed, 155 insertions(+), 2 deletions(-)
Quoted 6 lines

---
base-commit: 6cdd7597a2fbfc1572c1b0af23d3daf1cefa2de7
change-id: 20251210-rk3576-ufs-ac3bf4e87156
prerequisite-message-id: [email protected]
prerequisite-patch-id: 3748e3880ac841dc25628911608140ebb4d4382f
prerequisite-patch-id: 671586e63ec9021b624d6cdc3b75aef53ed84972

Hi Neil, Kever,

Now that Kever has applied the patch from Jonas [1] which lets this one work without bounce buffers on Rockchip RK3576, would you mind giving this series another look?

Quoted 6 lines
Quoted 2 lines

Please let me know if I should rebase / resubmit / adjust in any way. Would be great to have it merged.

I will test and review this later today, I think we may need to include the gpio/pinctrl fix in u-boot.dtsi until it has fully landed i dts/upstream, or possible add a bootph props in soc u-boot.dtsi.

Thanks Jonas!

The pinctrl fix is already in Linus' tree [1], so I think we can just cherry-pick it via ./tools/update-subtree.sh? Then overwrite it seamlessly at the next rebase of dts/upstream.

It isn't strictly required to make it boot though, because the boot ROM will leave the UFS controller in a magically-working state if it uses UFS to load the TPL+SPL. It's only needed if you load TPL+SPL from e.g. FSPI and then want to jump to U-boot proper from UFS (which is a more niche use case).

Quoted 2 lines

Maybe it would make sense to also enable UFS booting on a board as part of this series? E.g. on the NanoPi M5 and/or ROCK 4D?

Any board which enables &ufshc in its DTS should only need a config change to make use of this stuff. Happy to add it to defconfigs. The required bits are (based on my local changes to the NanoPi M5 defconfig):

+CONFIG_SPL_GPIO=y
+CONFIG_SPL_DM_RESET=y
+CONFIG_SPL_UFS_SUPPORT=y
+CONFIG_CMD_UFS=y
+CONFIG_SCSI=y
+CONFIG_UFS=y
+CONFIG_UFS_ROCKCHIP=y

Best regards,
Alexey

[1] https://github.com/torvalds/linux/commit/79a3286e61829fc43abdd6e3beb31b24930c7af6

#11 lore raw
In reply to Alexey Charkov

Hi,

Quoted 118 lines · Alexey Charkov
Quoted 110 lines · Alexey Charkov

Rockchip RK3576 can load its bootloader from UFS among other options, so this series adds the necessary bits and pieces to enable an end-to-end boot from UFS (boot ROM -> SPL -> U-boot proper -> kernel).

To achieve the above, this series goes through the following:
- Patch 1 introduces arch-independent code to enable SPL images to use UFS devices, including build system tweaks and a function to locate a U-boot image at a fixed UFS offset and LUN (SCSI device number)
- Patch 2 adds an option to build the Rockchip reset driver for SPL
- Patch 3 adds device-reset functionality to the Rockchip UFS glue code, which is required for (at least some) UFS modules to respond to controller commands upon initial enumeration
- Patch 4 ties it all together for Rockchip RK3576

This has been tested on a FriendlyElec NanoPi M5 board with a Biwin BWU3AKC46C256G UFS module. Note that booting directly from UFS masks the issue which patch 3 aims to address, because the boot ROM initializes the UFS module before handing over to U-boot. If, however, one boots SPL from FSPI1 with the same driver code, the module fails to respond unless patch 3 is applied.

This depends on Jonas' recent series [3] enabling DMA writes to PMU SRAM, without which the UFS controller will fail to load ATF and end up in an unrecoverable error state requiring a hard reset.

Note that in my experience none of the RK3576 boards actually boot current mainline U-boot versions without a single-word SRAM write before jumping to DDR initialization, as done in Kwiboo's commit at [1]. Therefore, to test this series I additionally applied commits 6b152999908b..d43031c4045e from Kwiboo's rk3576 branch [2] (including 6b152999908b), so any testers might want to:

git cherry-pick 6b152999908b^..d43031c4045e

from there before or after applying this series

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commit/d43031c4045ef8aaf29c467b910207e721dabce0
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576?ref_type=heads
[3] https://lore.kernel.org/all/[email protected]/

---
Changes in v5:
- Reverse X-mas tree in spl_ufs:spl_ufs_load_image (thanks Quentin)
- Explicit "depends on UFS" from CONFIG_SPL_UFS_SUPPORT (thanks Quentin). This also pulls in SCSI to avoid compilation errors.
- Split out the patch enabling the Rockchip reset driver for SPL builds (thanks Quentin)
- Reworded the error message when requesting the UFS reset GPIO fails (thanks Quentin)
- Added a note in the commit message about reset-gpios being required by the DT binding (thanks Quentin)
- Dropped the redundant check of GPIO validity in the reset function (thanks Quentin)
- Added a note about GPIO4_D0 being the only GPIO usable for UFS reset
on RK3576 (thanks Shawn)
- Dropped "imply" symbols from the arch Kconfig, now that both GPIO
and RESET drivers are explicitly depended on from the UFS driver (thanks Quentinq)
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Added a dependency in b4 metadata on Jonas' new series enabling DMA writes to PMU SRAM (thanks Jonas)
- Dropped the bounce buffer quirk altogether, as it now works as-is
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Added a UFSHC quirk to use the SCSI bounce buffer for addresses outside SDRAM, and enabled it on Rockchip (thanks Neil and Tom)
- Dropped the open-coded bounce buffer from spl_ufs.c, now unneeded
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rename the SPL UFS read helper function more self-descriptively (thanks Neil)
- Add an option to configure the UFS LUN used to look for the U-boot image in raw offset mode - or rather the SCSI device number, which most of the time coincides with the UFS LUN as long as the UFS device is the only SCSI block device the SPL sees (thanks Neil)
- Add an option to use a bounce buffer in RAM while loading U-boot from UFS, which helps avoid changes to common spl_fit.c code which in v1 achieved a similar result at a performance cost to unrelated platforms (thanks Jonas)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexey Charkov (4):
spl: Make UFS available for SPL builds
reset: rockchip: make device resets available in SPL
ufs: rockchip: Add device reset support
rockchip: spl: Add support for booting from UFS

  MAINTAINERS                                  |  1 +
  arch/arm/dts/rk3576-u-boot.dtsi              | 16 ++++++++-
  arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
  arch/arm/include/asm/spl.h                   |  1 +
  arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
  arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++
  common/spl/Kconfig                           | 30 +++++++++++++++++
  common/spl/Makefile                          |  1 +
  common/spl/spl_ufs.c                         | 49 ++++++++++++++++++++++++++++
  drivers/Makefile                             |  1 +
  drivers/reset/Kconfig                        |  9 +++++
  drivers/reset/Makefile                       |  2 +-
  drivers/scsi/Makefile                        |  3 ++
  drivers/ufs/Kconfig                          |  4 +++
  drivers/ufs/ufs-rockchip.c                   | 22 +++++++++++++
  drivers/ufs/ufs-rockchip.h                   |  1 +
  lib/Makefile                                 |  1 +
  17 files changed, 155 insertions(+), 2 deletions(-)
Quoted 6 lines

---
base-commit: 6cdd7597a2fbfc1572c1b0af23d3daf1cefa2de7
change-id: 20251210-rk3576-ufs-ac3bf4e87156
prerequisite-message-id: [email protected]
prerequisite-patch-id: 3748e3880ac841dc25628911608140ebb4d4382f
prerequisite-patch-id: 671586e63ec9021b624d6cdc3b75aef53ed84972

Quoted 5 lines

Hi Neil, Kever,

Now that Kever has applied the patch from Jonas [1] which lets this one work without bounce buffers on Rockchip RK3576, would you mind giving this series another look?

Applied patches 1 & 3 and passing it to CI, but seems without #2 UFS will probably probe error so who is supposed to pick #2 ?

Quoted 8 lines

Please let me know if I should rebase / resubmit / adjust in any way. Would be great to have it merged.

Thanks a lot,
Alexey

[1] https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/commit/4015faa32342fd9c494c318c21de106f98dd4674

#12 lore raw
Quoted 122 lines · Neil Armstrong

Hi,

Quoted 118 lines · Alexey Charkov
Quoted 116 lines · Alexey Charkov

Rockchip RK3576 can load its bootloader from UFS among other options, so this series adds the necessary bits and pieces to enable an end-to-end boot from UFS (boot ROM -> SPL -> U-boot proper -> kernel).

To achieve the above, this series goes through the following:
- Patch 1 introduces arch-independent code to enable SPL images to use UFS devices, including build system tweaks and a function to locate a U-boot image at a fixed UFS offset and LUN (SCSI device number)
- Patch 2 adds an option to build the Rockchip reset driver for SPL
- Patch 3 adds device-reset functionality to the Rockchip UFS glue code, which is required for (at least some) UFS modules to respond to controller commands upon initial enumeration
- Patch 4 ties it all together for Rockchip RK3576

This has been tested on a FriendlyElec NanoPi M5 board with a Biwin BWU3AKC46C256G UFS module. Note that booting directly from UFS masks the issue which patch 3 aims to address, because the boot ROM initializes the UFS module before handing over to U-boot. If, however, one boots SPL from FSPI1 with the same driver code, the module fails to respond unless patch 3 is applied.

This depends on Jonas' recent series [3] enabling DMA writes to PMU SRAM, without which the UFS controller will fail to load ATF and end up in an unrecoverable error state requiring a hard reset.

Note that in my experience none of the RK3576 boards actually boot current mainline U-boot versions without a single-word SRAM write before jumping to DDR initialization, as done in Kwiboo's commit at [1]. Therefore, to test this series I additionally applied commits 6b152999908b..d43031c4045e from Kwiboo's rk3576 branch [2] (including 6b152999908b), so any testers might want to:

git cherry-pick 6b152999908b^..d43031c4045e

from there before or after applying this series

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commit/d43031c4045ef8aaf29c467b910207e721dabce0
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576?ref_type=heads
[3] https://lore.kernel.org/all/[email protected]/

---
Changes in v5:
- Reverse X-mas tree in spl_ufs:spl_ufs_load_image (thanks Quentin)
- Explicit "depends on UFS" from CONFIG_SPL_UFS_SUPPORT (thanks Quentin). This also pulls in SCSI to avoid compilation errors.
- Split out the patch enabling the Rockchip reset driver for SPL builds (thanks Quentin)
- Reworded the error message when requesting the UFS reset GPIO fails (thanks Quentin)
- Added a note in the commit message about reset-gpios being required by the DT binding (thanks Quentin)
- Dropped the redundant check of GPIO validity in the reset function (thanks Quentin)
- Added a note about GPIO4_D0 being the only GPIO usable for UFS reset
on RK3576 (thanks Shawn)
- Dropped "imply" symbols from the arch Kconfig, now that both GPIO
and RESET drivers are explicitly depended on from the UFS driver (thanks Quentinq)
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Added a dependency in b4 metadata on Jonas' new series enabling DMA writes to PMU SRAM (thanks Jonas)
- Dropped the bounce buffer quirk altogether, as it now works as-is
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Added a UFSHC quirk to use the SCSI bounce buffer for addresses outside SDRAM, and enabled it on Rockchip (thanks Neil and Tom)
- Dropped the open-coded bounce buffer from spl_ufs.c, now unneeded
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rename the SPL UFS read helper function more self-descriptively (thanks Neil)
- Add an option to configure the UFS LUN used to look for the U-boot image in raw offset mode - or rather the SCSI device number, which most of the time coincides with the UFS LUN as long as the UFS device is the only SCSI block device the SPL sees (thanks Neil)
- Add an option to use a bounce buffer in RAM while loading U-boot from UFS, which helps avoid changes to common spl_fit.c code which in v1 achieved a similar result at a performance cost to unrelated platforms (thanks Jonas)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexey Charkov (4):
spl: Make UFS available for SPL builds
reset: rockchip: make device resets available in SPL
ufs: rockchip: Add device reset support
rockchip: spl: Add support for booting from UFS

  MAINTAINERS                                  |  1 +
  arch/arm/dts/rk3576-u-boot.dtsi              | 16 ++++++++-
  arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
  arch/arm/include/asm/spl.h                   |  1 +
  arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
  arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++
  common/spl/Kconfig                           | 30 +++++++++++++++++
  common/spl/Makefile                          |  1 +
  common/spl/spl_ufs.c                         | 49 ++++++++++++++++++++++++++++
  drivers/Makefile                             |  1 +
  drivers/reset/Kconfig                        |  9 +++++
  drivers/reset/Makefile                       |  2 +-
  drivers/scsi/Makefile                        |  3 ++
  drivers/ufs/Kconfig                          |  4 +++
  drivers/ufs/ufs-rockchip.c                   | 22 +++++++++++++
  drivers/ufs/ufs-rockchip.h                   |  1 +
  lib/Makefile                                 |  1 +
  17 files changed, 155 insertions(+), 2 deletions(-)

---
base-commit: 6cdd7597a2fbfc1572c1b0af23d3daf1cefa2de7
change-id: 20251210-rk3576-ufs-ac3bf4e87156
prerequisite-message-id: [email protected]
prerequisite-patch-id: 3748e3880ac841dc25628911608140ebb4d4382f
prerequisite-patch-id: 671586e63ec9021b624d6cdc3b75aef53ed84972

Quoted 8 lines
Quoted 5 lines

Hi Neil, Kever,

Now that Kever has applied the patch from Jonas [1] which lets this one work without bounce buffers on Rockchip RK3576, would you mind giving this series another look?

Applied patches 1 & 3 and passing it to CI, but seems without #2 UFS will probably probe error so who is supposed to pick #2 ?

#2 and #4 are both Rockchip specific, so maybe Kever could take them?

#3 should still work in U-boot proper without #2, and to get UFS in SPL all four patches are required, so the ordering of #2 vs #3 shouldn't matter much.

Thanks a lot,
Alexey

#13 lore raw

Hi Alexey,

Quoted 121 lines · Alexey Charkov
Quoted 119 lines · Neil Armstrong

Hi,

Quoted 116 lines · Alexey Charkov
Quoted 115 lines · Alexey Charkov

Rockchip RK3576 can load its bootloader from UFS among other options, so this series adds the necessary bits and pieces to enable an end-to-end boot from UFS (boot ROM -> SPL -> U-boot proper -> kernel).

To achieve the above, this series goes through the following:
- Patch 1 introduces arch-independent code to enable SPL images to use UFS devices, including build system tweaks and a function to locate a U-boot image at a fixed UFS offset and LUN (SCSI device number)
- Patch 2 adds an option to build the Rockchip reset driver for SPL
- Patch 3 adds device-reset functionality to the Rockchip UFS glue code, which is required for (at least some) UFS modules to respond to controller commands upon initial enumeration
- Patch 4 ties it all together for Rockchip RK3576

This has been tested on a FriendlyElec NanoPi M5 board with a Biwin BWU3AKC46C256G UFS module. Note that booting directly from UFS masks the issue which patch 3 aims to address, because the boot ROM initializes the UFS module before handing over to U-boot. If, however, one boots SPL from FSPI1 with the same driver code, the module fails to respond unless patch 3 is applied.

This depends on Jonas' recent series [3] enabling DMA writes to PMU SRAM, without which the UFS controller will fail to load ATF and end up in an unrecoverable error state requiring a hard reset.

Note that in my experience none of the RK3576 boards actually boot current mainline U-boot versions without a single-word SRAM write before jumping to DDR initialization, as done in Kwiboo's commit at [1]. Therefore, to test this series I additionally applied commits 6b152999908b..d43031c4045e from Kwiboo's rk3576 branch [2] (including 6b152999908b), so any testers might want to:

git cherry-pick 6b152999908b^..d43031c4045e

from there before or after applying this series

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commit/d43031c4045ef8aaf29c467b910207e721dabce0
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3576?ref_type=heads
[3] https://lore.kernel.org/all/[email protected]/

---
Changes in v5:
- Reverse X-mas tree in spl_ufs:spl_ufs_load_image (thanks Quentin)
- Explicit "depends on UFS" from CONFIG_SPL_UFS_SUPPORT (thanks Quentin). This also pulls in SCSI to avoid compilation errors.
- Split out the patch enabling the Rockchip reset driver for SPL builds (thanks Quentin)
- Reworded the error message when requesting the UFS reset GPIO fails (thanks Quentin)
- Added a note in the commit message about reset-gpios being required by the DT binding (thanks Quentin)
- Dropped the redundant check of GPIO validity in the reset function (thanks Quentin)
- Added a note about GPIO4_D0 being the only GPIO usable for UFS reset
on RK3576 (thanks Shawn)
- Dropped "imply" symbols from the arch Kconfig, now that both GPIO
and RESET drivers are explicitly depended on from the UFS driver (thanks Quentinq)
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Added a dependency in b4 metadata on Jonas' new series enabling DMA writes to PMU SRAM (thanks Jonas)
- Dropped the bounce buffer quirk altogether, as it now works as-is
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Added a UFSHC quirk to use the SCSI bounce buffer for addresses outside SDRAM, and enabled it on Rockchip (thanks Neil and Tom)
- Dropped the open-coded bounce buffer from spl_ufs.c, now unneeded
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rename the SPL UFS read helper function more self-descriptively (thanks Neil)
- Add an option to configure the UFS LUN used to look for the U-boot image in raw offset mode - or rather the SCSI device number, which most of the time coincides with the UFS LUN as long as the UFS device is the only SCSI block device the SPL sees (thanks Neil)
- Add an option to use a bounce buffer in RAM while loading U-boot from UFS, which helps avoid changes to common spl_fit.c code which in v1 achieved a similar result at a performance cost to unrelated platforms (thanks Jonas)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexey Charkov (4):
spl: Make UFS available for SPL builds
reset: rockchip: make device resets available in SPL
ufs: rockchip: Add device reset support
rockchip: spl: Add support for booting from UFS

   MAINTAINERS                                  |  1 +
   arch/arm/dts/rk3576-u-boot.dtsi              | 16 ++++++++-
   arch/arm/include/asm/arch-rockchip/bootrom.h |  1 +
   arch/arm/include/asm/spl.h                   |  1 +
   arch/arm/mach-rockchip/rk3576/rk3576.c       |  1 +
   arch/arm/mach-rockchip/spl-boot-order.c      | 14 ++++++++
   common/spl/Kconfig                           | 30 +++++++++++++++++
   common/spl/Makefile                          |  1 +
   common/spl/spl_ufs.c                         | 49 ++++++++++++++++++++++++++++
   drivers/Makefile                             |  1 +
   drivers/reset/Kconfig                        |  9 +++++
   drivers/reset/Makefile                       |  2 +-
   drivers/scsi/Makefile                        |  3 ++
   drivers/ufs/Kconfig                          |  4 +++
   drivers/ufs/ufs-rockchip.c                   | 22 +++++++++++++
   drivers/ufs/ufs-rockchip.h                   |  1 +
   lib/Makefile                                 |  1 +
   17 files changed, 155 insertions(+), 2 deletions(-)

---
base-commit: 6cdd7597a2fbfc1572c1b0af23d3daf1cefa2de7
change-id: 20251210-rk3576-ufs-ac3bf4e87156
prerequisite-message-id: [email protected]
prerequisite-patch-id: 3748e3880ac841dc25628911608140ebb4d4382f
prerequisite-patch-id: 671586e63ec9021b624d6cdc3b75aef53ed84972

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

Hi Neil, Kever,

Now that Kever has applied the patch from Jonas [1] which lets this one work without bounce buffers on Rockchip RK3576, would you mind giving this series another look?

Applied patches 1 & 3 and passing it to CI, but seems without #2 UFS will probably probe error so who is supposed to pick #2 ?

#2 and #4 are both Rockchip specific, so maybe Kever could take them?

Sure, I can take them.

Is it possible to split this patch in to two parts in new patch set?

One set for rockchip platform and one set for Neil?

Thanks,
- Kever

Quoted 8 lines

#3 should still work in U-boot proper without #2, and to get UFS in SPL all four patches are required, so the ordering of #2 vs #3 shouldn't matter much.

Thanks a lot,
Alexey