]> git.ipfire.org Git - thirdparty/u-boot.git/commit
rockchip: rock-pi-4-rk3399: enable booting from SPI flash
authorChristopher Obbard <chris.obbard@collabora.com>
Fri, 15 Mar 2024 12:01:19 +0000 (12:01 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 26 Apr 2024 07:47:05 +0000 (15:47 +0800)
commitfb891eeeb7bc1b4d5ebed8cabb9d88302743e0bb
tree9cbf22283c6326127555aaa4e73c7e005c83872d
parentd17f965410650065ea213d7a71a45619323e527e
rockchip: rock-pi-4-rk3399: enable booting from SPI flash

Some variants of the ROCK Pi 4 series have an SPI flash chip populated
which can be booted from. This patch enables support in U-Boot for
building the image for the SPI flash, support for booting U-Boot from the
SPI flash chip and support in U-Boot for accessing the SPI flash using
`sf` commands.

Not all variants (e.g. ROCK Pi 4B, ROCK 4 Model C Plus, ROCK 4SE) come
populated with an SPI flash chip, but have the footprint on the board so
a user could solder their own to the board. With this patchset applied,
these board variants without an SPI flash chip still boot from MMC.

I have enabled support for both Winbond and XTX SPI flash devices since
different hardware variants have different devices populated:

 - `rockpi4_v13_sch_20181112.pdf` contains a Winbond part `W25Q64FWZPIG`
 - `rockpi4_v14_sch_20210114.pdf` contains an XTX part `XT25F32BWOIGT`

The ROCK Pi 4 I have is marked as "ROCK PI 4 v1.48" and contains an SPI
flash chip from XTX:

    => sf probe
    SF: Detected xt25f32 with page size 256 Bytes, erase size 4 KiB, total 4 MiB

In the interest of supporting all board variants and not regressing
existing users who boot from MMC, I have enabled support for booting from
both SPI flash chip variants in the defconfig and left the environment
storage location as MMC to not break existing users who have the
environment stored on MMC.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
arch/arm/dts/rk3399-rock-pi-4a-u-boot.dtsi
configs/rock-pi-4-rk3399_defconfig