linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] sunxi: H616: SPI boot support
@ 2021-07-05 23:04 Andre Przywara
  2021-07-05 23:04 ` [PATCH 1/3] sunxi: SPL SPI: Allow larger SPL Andre Przywara
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andre Przywara @ 2021-07-05 23:04 UTC (permalink / raw)
  To: Jagan Teki; +Cc: Samuel Holland, Jernej Skrabec, u-boot, linux-sunxi

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(-)

-- 
2.17.5


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-06 14:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 23:04 [PATCH 0/3] sunxi: H616: SPI boot support Andre Przywara
2021-07-05 23:04 ` [PATCH 1/3] sunxi: SPL SPI: Allow larger SPL Andre Przywara
2021-07-06 14:22   ` Jagan Teki
2021-07-05 23:04 ` [PATCH 2/3] sunxi: SPL SPI: Add SPI boot support for the Allwinner H616 SoC Andre Przywara
2021-07-06 14:22   ` Jagan Teki
2021-07-05 23:04 ` [PATCH 3/3] sunxi: OrangePi Zero 2: Enable SPI booting Andre Przywara
2021-07-06 14:23   ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).