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

Alexey Charkov alchark at gmail.com
Wed Mar 11 11:12:49 CET 2026


On Wed, Mar 11, 2026 at 3:18 AM Jonas Karlman <jonas at kwiboo.se> wrote:
>
> Hi Alexey,
>
> On 1/20/2026 7:09 PM, Alexey Charkov wrote:
> > 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.
> >
> > Signed-off-by: Alexey Charkov <alchark at gmail.com>
> > ---
> >  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(-)
> >
> > diff --git a/arch/arm/dts/rk3576-u-boot.dtsi b/arch/arm/dts/rk3576-u-boot.dtsi
> > index dc3771b556a3..e442e94f7132 100644
> > --- a/arch/arm/dts/rk3576-u-boot.dtsi
> > +++ b/arch/arm/dts/rk3576-u-boot.dtsi
> > @@ -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;
> > +};
>
> 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.
>
> > +
> >  &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;
> };
>
> > @@ -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:
>
> Reviewed-by: Jonas Karlman <jonas at kwiboo.se>
>
> 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


More information about the U-Boot mailing list