Skip to content

sunxi: H616: SPI boot support

Andre Przywara linux-sunxi u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3sunxi: SPL SPI: Allow larger SPLarch/arm/mach-sunxi/spl_spi_sunxi.c+7 -31 reply
2/3sunxi: SPL SPI: Add SPI boot support for the Allwinner H616 SoCarch/arm/mach-sunxi/Kconfig arch/arm/mach-sunxi/spl_spi_sunxi.c+16 -131 reply
3/3sunxi: OrangePi Zero 2: Enable SPI bootingconfigs/orangepi_zero2_defconfig+1 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJagan Teki
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] sunxi: H616: SPI boot support

The Allwinner H616 supports booting from SPI NOR flash, for which we use our SPL specific SPI driver. Since this uses hardcoded values for clocks, resets and pins, we need to extend it to cover the H616 SoC as well.

Patch 1/3 extends the logic that determines the offset of the U-Boot payload, from a fixed value to actually observing the SPL size. Patch 2/3 piggy backs on the existing H6 SPI boot support, to cover the (very similar) H616 as well. The only actual difference between the two is one pin configuration.
Patch 3/3 enables SPI boot for the OrangePi Zero 2 board, which comes with a 2MiB SPI flash chip soldered.

In my experiments I couldn't actually convince the BROM to load the SPL, it always fell through to FEL mode. I post this series anyway, because:
1) We will need this code in any case, since it loads the rest of U-Boot (and TF-A) from SPI flash. By hacking sunxi-fel I could verify that this part works: the SPL code detected "SPI boot" and booted the rest of the firmware successfully from SPI flash.
2) I would encourage other people to try this, maybe it's just my board that is broken? (I dimly remember booting something some months ago.) The easiest way to flash U-Boot is via sunxi-fel:

   $ sunxi-fel -v -p spiflash-write 0 u-boot-sunxi-with-spl.bin

Cheers,
Andre

Andre Przywara (3):
sunxi: SPL SPI: Allow larger SPL
sunxi: SPL SPI: Add SPI boot support for the Allwinner H616 SoC
sunxi: OrangePi Zero 2: Enable SPI booting

 arch/arm/mach-sunxi/Kconfig         |  2 +-
 arch/arm/mach-sunxi/spl_spi_sunxi.c | 37 +++++++++++++++++------------
 configs/orangepi_zero2_defconfig    |  1 +
 3 files changed, 24 insertions(+), 16 deletions(-)
Signature · 1 line
2.17.5