All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <me@ziyao.cc>
To: Eric Chung <eric.chung@riscstar.com>, Yao Zi <me@ziyao.cc>
Cc: u-boot-spacemit@groups.io, u-boot@lists.u-boot-project.org,
	Tom Rini <trini@konsulko.com>, Tim Ouyang <tim609@andestech.com>,
	Leo Liang <leo.liang@sifive.com>, Peng Fan <peng.fan@nxp.com>,
	Huan Zhou <pericycle.cc@gmail.com>,
	Raymond Mao <raymond.mao@riscstar.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Bhimeswararao Matsa <bhimeswararao.matsa@gmail.com>,
	Tanmay Kathpalia <tanmay.kathpalia@altera.com>,
	Kaustabh Chakraborty <kauschluss@disroot.org>,
	Han Xu <han.xu@nxp.com>, Yanir Levin <yanir.levin@tandemg.com>,
	Christoph Stoidner <c.stoidner@phytec.de>,
	Balsundar Ponnusamy <balsundar.ponnusamy@altera.com>,
	Daniel Palmer <daniel@thingy.jp>, Anshul Dalal <anshuld@ti.com>,
	Bastien Curutchet <bastien.curutchet@bootlin.com>,
	Angelo Dureghello <angelo@kernel-space.org>,
	Johan Jonker <jbx6244@gmail.com>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Guodong Xu <guodong@riscstar.com>, Rick Chen <rick@andestech.com>,
	Leo <ycliang@andestech.com>
Subject: Re: [PATCH v6 09/11] doc: spacemit: flash on K1 SoC based boards
Date: Thu, 30 Jul 2026 15:20:52 +0000	[thread overview]
Message-ID: <amtr1G8oFZ9J64Uo@pie> (raw)
In-Reply-To: <CAH22mJzjH2d6bd+HQhhkCiOYSr9cqYFZDCpB7zECaFPMZHBdVQ@mail.gmail.com>

On Thu, Jul 30, 2026 at 02:25:31PM +0800, Eric Chung wrote:
> On Wed, Jul 29, 2026 at 11:33 PM Yao Zi <me@ziyao.cc> wrote:
> >
> > On Wed, Jul 29, 2026 at 09:49:26PM +0800, Eric Chung wrote:
> > > On Tue, Jul 28, 2026 at 5:45 PM Yao Zi <me@ziyao.cc> wrote:
> > > >
> > > > On Tue, Jul 28, 2026 at 08:53:02AM +0800, Eric Chung wrote:
> > > > > On Tue, Jul 28, 2026 at 1:26 AM Yao Zi <me@ziyao.cc> wrote:
> > > > > >
> > > > > > On Mon, Jul 27, 2026 at 02:59:11PM +0800, Eric Chung wrote:
> > > > > > > Add document on how to flash images into eMMC of K1 SoC based boards.
> > > > > > >
> > > > > > > Signed-off-by: Eric Chung <eric.chung@riscstar.com>
> > > > > > >
> > > > > > > ---
> > > > > > > v3:
> > > > > > > - Add document on how to flash images into SD card.
> > > > > > > ---
> > > > > > >  board/spacemit/k1/MAINTAINERS |   2 +-
> > > > > > >  doc/board/spacemit/index.rst  |   1 +
> > > > > > >  doc/board/spacemit/k1-mmc.rst | 320 ++++++++++++++++++++++++++++++++++++++++++
> > > > > > >  3 files changed, 322 insertions(+), 1 deletion(-)
> > > > > >
> > > > > > ...
> > > > > >
> > > > > > > diff --git a/doc/board/spacemit/k1-mmc.rst b/doc/board/spacemit/k1-mmc.rst
> > > > > > > new file mode 100644
> > > > > > > index 00000000000..b0fe78c75ce
> > > > > > > --- /dev/null
> > > > > > > +++ b/doc/board/spacemit/k1-mmc.rst
> > > > > > > @@ -0,0 +1,320 @@
> > > > > >
> > > > > > ...
> > > > > >
> > > > > > > +Chapter 2: SD Card Boot
> > > > > > > +=======================
> > > > > > > +
> > > > > > > +
> > > > > > > +SpacemiT K1 Bianbu SD Card Image Flashing and U-Boot Update Guide
> > > > > > > +==================================================================
> > > > > > > +
> > > > > > > +This guide explains how to prepare a bootable SD card with Bianbu OS for
> > > > > > > +SpacemiT K1 based boards and how to replace the U-Boot binary on the SD
> > > > > > > +card with a custom build.
> > > > > > > +
> > > > > > > +Prerequisites
> > > > > > > +~~~~~~~~~~~~~
> > > > > > > +
> > > > > > > +- A SpacemiT K1 based development board
> > > > > > > +- A microSD card (at least 8 GB capacity recommended)
> > > > > > > +- A card reader for your host computer
> > > > > > > +- A Linux host system (for ``dd``, ``fdisk``, ``lsblk`` commands)
> > > > > > > +- The Bianbu SD card image from
> > > > > > > +   <https://spacemit.com/community/resources-download/Images%20Collects/K1/Bianbu>
> > > > > > > +- A custom ``u-boot.itb`` file (device tree blob or U-Boot FIT image) to be
> > > > > > > +  written to the U-Boot partition
> > > > > > > +
> > > > > > > +Prepare the SD Card & the image
> > > > > > > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > > > +
> > > > > > > +**1. Download the image**
> > > > > > > +
> > > > > > > +Download the released package from the official SpacemiT website:
> > > > > > > +
> > > > > > > +<https://archive.spacemit.com/image/k1/version/bianbu/v2.3.5/Bianbu-Minimal-K1-sdcard-V2.3.5-20260601180942.img.zip>
> > > > > > > +
> > > > > > > +**2. Extract the image**
> > > > > > > +
> > > > > > > +.. code-block:: console
> > > > > > > +
> > > > > > > +   $ unzip Bianbu-Minimal-K1-sdcard-V2.3.5-20260601180942.img.zip
> > > > > > > +
> > > > > > > +**3. Identify the SD card device**
> > > > > > > +
> > > > > > > +Insert the microSD card into your card reader, then run:
> > > > > > > +
> > > > > > > +.. code-block:: console
> > > > > > > +
> > > > > > > +   $ lsblk
> > > > > > > +
> > > > > > > +Compare the output before and after inserting the card to identify
> > > > > > > +the new device. It will typically appear as ``/dev/sdb``, ``/dev/sdc``,
> > > > > > > +or ``/dev/mmcblk0``.
> > > > > > > +
> > > > > > > +**4. Write the image to the SD card**
> > > > > > > +
> > > > > > > +.. code-block:: console
> > > > > > > +
> > > > > > > +   $ sudo dd if=./Bianbu-Minimal-K1-sdcard-V2.3.5-20260601180942.img of=/dev/sdb bs=1M status=progress
> > > > > > > +
> > > > > > > +The SD card is now ready as a bootable Bianbu system disk.
> > > > > >
> > > > > > This looks out of scope of describing how to create a bootable SD card
> > > > > > with U-Boot. In my opinion, you'd better describe the requirements of
> > > > > > parition layout and image position for SD-card booting, to allow readers
> > > > > > to create their own images/bootable medium from scratch more easily,
> > > > > > instead of sticking to the vendored image.
> > > > > >
> > > > >
> > > > > Creating a bootable SD card from scratch would be valuable, but I'll address
> > > > > it later due to time constraints.
> > > >
> > > > In case I didn't make myself clear enough, the documentation *SHOULD*
> > > > describe how to create bootable devices from scratch, instead of
> > > > alternating an existing OS image to use mainline U-Boot. I don't think
> > > > the current documentation helps much for downstream users/distributions
> > > > to adapt U-Boot for their own use cases, or at least it could be written
> > > > in a much more clear, vendor-neutral way.
> > > >
> > > > So here's my NAK for this patch. I'm not sure what you mean by "time
> > > > constraints", but please keep submitted patches in a good shape.
> > > >
> >
> > In case that I still didn't make myself clear enough, by "bootable SD
> > card", I mean a minimal medium with only a bootable U-Boot, you could
> > refer to Rockchip or StarFive's documentation.
> >
> 
> I checked Rockchip or StarFive's documentation. And I can't find any mention of
> creating a bootable SD card.

Please grep SD in doc/rockchip/rockchip.rst. For StarFive, it seems
the process of creating bootable SDcards has been removed a little
earlier, but in section "Zero Stage BootLoader" of
doc/starfive/jh7110_common.rst, the BROM's behavior is still described.

> > > I’m not sure why the documentation insists on walking users through creating a
> > > bootable SD card from scratch, especially when, at this stage, it
> > > still depends on
> > > the vendor’s tools.
> >
> > Please explain which tools it depends on. Now U-Boot for your platform
> > already has its SPL ported, and according to your instructions of
> > replacing the vendor U-Boot, it seems no extra post-processing is
> > required for the SoC to identify it.
> 
> The flashing process must begin with a USB transfer. The vendor's
> proprietary tool is required to download the images to the target
> device. To maintain compatibility with this tool, I need to use the
> same partition table that it expects.

So please make it clear whether the proprietary tool is required for
creating SD-card images, or it's only required for downloading the image
to the SD card. The latter seems impossible since you described how to
flash an image to SD with dd in this documentation.

I'm really confused with your description.

> Currently, the SPL (Secondary Program Loader) only boots U-Boot; it
> has no other function in the boot flow.
> 
> >
> > And after re-reading the documentation, it seems you don't make use of
> > the upstream SPL when creating the SD-card image, is this intended, and
> > why?
> >
> 
> Oh, I missed it. I need to append SPL part.
> 
> > > In practice, we’re required to use the vendor’s
> > > flashing tool for
> > > both eMMC and SD devices,
> >
> > Please explain the constraints, it's okay to depend on vendor's tools,
> > but for creating a SD-card image, I couldn't come up with a reason to
> > do so, at least by inferring from the current documentation.
> >
> 
> I’m required to use the vendor’s flashing tool, flashserver, for
> programming SD card images — mainly because it’s the only way I can
> properly program the RPMB partition.

But you don't do so in the documentation, dd is used. This wouldn't
program the RPMB partition AFAIK. And does it mean that K1 requires a
SDcard with RPMB support to boot? This doesn't match my experience with
the platform.

> The tool supports both eMMC and SD boot modes, and environment
> variables (ENV) can be stored on either medium. However, it would be
> unusual to boot from an SD card while loading the ENV from eMMC.
> Therefore, the simplest and most consistent approach is to keep the
> same partition layout across all critical components — including FSBL,
> ENV, and OpenSBI partitions — regardless of the boot medium.
> 
> > > and we must adhere to the provided partition table.
> >
> > Thus please clearly describe which part of the partition table must be
> > preserved for the SoC to boot.
> >
> 
> Mentioned above.

Please quote the text, you do provide an example partition table, but
there's no note describing which partitions are mandatory, and whether
their offsets could be changed.

If a user could only create their own SDcard images by trial and error,
this documentation loses its purpose. Please describe what is mandatory,
or only describe the mandatory parts like Rockchip's documentation.

> > > If users prefer to define their own partition layout, nothing prevents
> > > them from doing
> > > so on their own. That’s entirely up to them.
> > >
> > > The default SD image already includes the vendor’s U-Boot. My
> > > instructions simply
> > > explain how to replace it with the upstream version—nothing more.
> >
> > Best regards,
> > Yao Zi

Frankly, I'm really tired of this discussion, I don't think you
understand much of my questions, even though I tried to explain myself
once and once again. And your replies are self-contradictory.

Please make sure you understand my questions and reply with reasonable
answers. I wouldn't continue to review your patches before you resolve
questions in this thread.

Best regards,
Yao Zi

  reply	other threads:[~2026-07-30 15:21 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27  6:59 [PATCH v6 00/11] spacemit mmc driver Eric Chung
2026-07-27  6:59 ` [PATCH v6 01/11] spacemit: k1: select boot device via config registers Eric Chung
2026-07-27  6:59 ` [PATCH v6 02/11] pinctrl: k1: fix drive strength configuration Eric Chung
2026-07-27  6:59 ` [PATCH v6 03/11] pinctrl: k1: fix pull-up/pull-down configuration Eric Chung
2026-07-27  8:20   ` Yao Zi
2026-07-27  8:24     ` Yao Zi
2026-07-27  6:59 ` [PATCH v6 04/11] pinctrl: k1: add IO power domain configuration support Eric Chung
2026-07-28 17:15   ` Junhui Liu
2026-07-27  6:59 ` [PATCH v6 05/11] mmc: k1: add sdhci platform driver Eric Chung
2026-07-27  6:59 ` [PATCH v6 06/11] dts: k1: add SD card support in u-boot overlay Eric Chung
2026-07-27 11:51   ` Yao Zi
2026-07-27 13:08     ` Eric Chung
2026-07-27 17:07       ` Yao Zi
2026-07-28  1:04         ` Eric Chung
2026-07-28  9:10           ` Yao Zi
2026-07-29 14:05             ` Eric Chung
2026-07-29 15:58               ` Yao Zi
2026-07-30  5:18                 ` Eric Chung
2026-07-27  6:59 ` [PATCH v6 07/11] configs: k1: enable SD and eMMC support Eric Chung
2026-07-27 17:15   ` Yao Zi
2026-07-27  6:59 ` [PATCH v6 08/11] MAINTAINER: update Spacemit K1 entry Eric Chung
2026-07-27  6:59 ` [PATCH v6 09/11] doc: spacemit: flash on K1 SoC based boards Eric Chung
2026-07-27 17:26   ` Yao Zi
2026-07-28  0:53     ` Eric Chung
2026-07-28  9:45       ` Yao Zi
2026-07-29 13:49         ` Eric Chung
2026-07-29 15:32           ` Yao Zi
2026-07-30  6:25             ` Eric Chung
2026-07-30 15:20               ` Yao Zi [this message]
2026-07-31  0:31                 ` Eric Chung
2026-07-27  6:59 ` [PATCH v6 10/11] config: k1: enable ENV support for eMMC Eric Chung
2026-07-27  6:59 ` [PATCH v6 11/11] spacemit: k1: load product name from environment variable Eric Chung
2026-07-27 17:41   ` Yao Zi

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=amtr1G8oFZ9J64Uo@pie \
    --to=me@ziyao.cc \
    --cc=angelo@kernel-space.org \
    --cc=anshuld@ti.com \
    --cc=balsundar.ponnusamy@altera.com \
    --cc=bastien.curutchet@bootlin.com \
    --cc=bhimeswararao.matsa@gmail.com \
    --cc=c.stoidner@phytec.de \
    --cc=daniel@thingy.jp \
    --cc=eric.chung@riscstar.com \
    --cc=guodong@riscstar.com \
    --cc=han.xu@nxp.com \
    --cc=jbx6244@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=kauschluss@disroot.org \
    --cc=leo.liang@sifive.com \
    --cc=peng.fan@nxp.com \
    --cc=pericycle.cc@gmail.com \
    --cc=raymond.mao@riscstar.com \
    --cc=rick@andestech.com \
    --cc=semen.protsenko@linaro.org \
    --cc=tanmay.kathpalia@altera.com \
    --cc=tim609@andestech.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-spacemit@groups.io \
    --cc=u-boot@lists.u-boot-project.org \
    --cc=yanir.levin@tandemg.com \
    --cc=ycliang@andestech.com \
    /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.