All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Jagan Teki <jagan@amarulasolutions.com>
Cc: Samuel Holland <samuel@sholland.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	u-boot@lists.denx.de, linux-sunxi@lists.linux.dev
Subject: [PATCH 0/3] sunxi: H616: SPI boot support
Date: Tue,  6 Jul 2021 00:04:42 +0100	[thread overview]
Message-ID: <20210705230445.14834-1-andre.przywara@arm.com> (raw)

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


             reply	other threads:[~2021-07-05 23:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 23:04 Andre Przywara [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210705230445.14834-1-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=samuel@sholland.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.