public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sam Edwards <cfsworks@gmail.com>
To: Icenowy Zheng <uwu@icenowy.me>, u-boot@lists.denx.de
Cc: Andre Przywara <andre.przywara@arm.com>
Subject: Re: [PATCH 0/8] SUNIV SPI NAND support in SPL
Date: Sat, 17 Jun 2023 14:59:42 -0600	[thread overview]
Message-ID: <8034158c-03ab-7488-6afa-a67f04264705@gmail.com> (raw)
In-Reply-To: <574e7234-b3a7-3e25-06bf-76902c802275@gmail.com>

Hi again Icenowy,

On 6/6/23 17:09, Sam Edwards wrote:
> Still, I believe it's sensible that, when we know for sure we're coming 
> from SPI-NAND (because it's a newer sunxi that reports 0x04, or we know 
> from the suniv stack-checking hack), we should call that its own SPL 
> load method, which does not fall back to SPI-NOR. The SPI(-NOR) load 
> method naturally has to implement the try-NAND-first logic for some of 
> these SoCs, but perhaps we could call it a "quirk" and only do that for 
> chips that aren't known to report SPI-NAND directly?

Since other methods that care about flash type (e.g. env_get_location) 
don't understand BOOT_DEVICE_SPI to mean "SPI, but the actual flash type 
is ambiguous," I'm starting to think we need to resolve the ambiguity 
*before* the load method runs.

What are your thoughts on this:
1. Introduce SUNXI_BOOTED_FROM_SPI_NAND, value 4 (matching the value 
used by Allwinner's newer BROMs).
2. Map SUNIV_BOOTED_FROM_NAND to SUNXI_BOOTED_FROM_SPI_NAND.
3. Map SUNXI_BOOTED_FROM_SPI_NAND to BOOT_DEVICE_NAND (and not _SPI).
4. Implement the SPI-NAND stuff to provide `nand_spl_load_image` (so 
that the common SPL framework's NAND loader can take care of it). 
Possibly go even further and implement the methods needed by the UBI 
loader too.
5. On sunxis (e.g. V3s) which are known to report SUNXI_BOOTED_FROM_SPI 
for SPI-NAND, add a small check to sunxi_get_boot_device() which 
disambiguates this situation by probing for SPI-NAND.

If #4 isn't really feasible, we might instead want to introduce a 
BOOT_DEVICE_SPI_NAND, but I don't know if adding sunxi to the list of 
platforms that have their own BOOT_DEVICE_ names is a great call.

In any case, I'd hope also to see some kind of bad block handling in 
here -- a simple check for a bad block each time we get to page 0 (which 
skips to the next block) should be pretty easy, don't you think?

Any thoughts? Any other way I can be of service? (Feel free to delegate 
some of these ideas to me if you think they're good but don't have the 
time to execute them!)

Warm regards,
Sam

  reply	other threads:[~2023-06-17 20:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14  3:05 [PATCH 0/8] SUNIV SPI NAND support in SPL Icenowy Zheng
2022-10-14  3:05 ` [PATCH 1/8] sunxi: SPL SPI: extract code for doing SPI transfer Icenowy Zheng
2023-01-14 19:32   ` Samuel Holland
2023-12-12 18:12   ` Andre Przywara
2022-10-14  3:05 ` [PATCH 2/8] sunxi: SPL SPI: add support for read command with 2 byte address Icenowy Zheng
2023-01-14 19:35   ` Samuel Holland
2022-10-14  3:05 ` [PATCH 3/8] sunxi: SPL SPI: allow multiple boot attempt Icenowy Zheng
2023-01-14 19:56   ` Samuel Holland
2023-01-15  0:26     ` Icenowy Zheng
2022-10-14  3:05 ` [PATCH 4/8] sunxi: SPL SPI: add initial support for booting from SPI NAND Icenowy Zheng
2023-01-14 20:08   ` Samuel Holland
2022-10-14  3:05 ` [PATCH 5/8] sunxi: enable support for SPI NAND booting on SUNIV Icenowy Zheng
2023-01-14 20:18   ` Samuel Holland
2022-10-14  3:05 ` [PATCH 6/8] [DO NOT MERGE] sunxi: sync DT from my tree for PopStick Icenowy Zheng
2022-10-14  3:05 ` [PATCH 7/8] [DO NOT MERGE, DIRTY HACK] sunxi: use UBI for environement storage Icenowy Zheng
2023-01-15 17:19   ` Icenowy Zheng
2022-10-14  3:05 ` [PATCH 8/8] [DO NOT MERGE] sunxi: add a defconfig for PopStick Icenowy Zheng
2023-06-05 21:03 ` [PATCH 0/8] SUNIV SPI NAND support in SPL Sam Edwards
2023-06-06  6:39   ` Icenowy Zheng
2023-06-06 23:09     ` Sam Edwards
2023-06-17 20:59       ` Sam Edwards [this message]
2024-04-11  4:32 ` John Watts

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=8034158c-03ab-7488-6afa-a67f04264705@gmail.com \
    --to=cfsworks@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=u-boot@lists.denx.de \
    --cc=uwu@icenowy.me \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox