From: Yixun Lan <dlan@kernel.org>
To: E Shattow <e@freeshell.de>
Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
spacemit@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/2] riscv: dts: spacemit: mark K1 boot nodes bootph-pre-ram
Date: Wed, 2 Dec 2026 12:59:40 +0000 [thread overview]
Message-ID: <20261202125940-GKA2058@kernel.org> (raw)
In-Reply-To: <485f9dc4-e958-4b7d-ba45-3ae0294c6f01@freeshell.de>
Hi E Shattow,
On 00:09 Wed 02 Dec , E Shattow wrote:
> Hi Yixun,
>
> On 12/1/26 18:31, Yixun Lan wrote:
> > Hi E Shattow,
> >
> > On 16:49 Tue 24 Nov , E Shattow wrote:
> >> Hi Yixun,
> >>
> >> On 11/24/26 15:19, Yixun Lan wrote:
> >>> Hi Hung-Chun,
> >>>
> >>> On 17:25 Sat 24 Oct , Hung-Chun Tseng wrote:
> >>>> On the SpacemiT K1 the BootROM loads the next boot stage into SRAM, and
> >>>> that stage sets up DRAM. This series marks the nodes it needs for that
> >>>> bootph-pre-ram: the SoC clocks, UART, boot media and the two I2C buses
> >>>> in k1.dtsi, and the board EEPROM (which holds the DRAM configuration),
> >>>> the PMIC rails and the SPI NOR in the board files.
> >>>>
> >>>> The vendor confirmed that the BootROM itself does not access the
> >>>> EEPROM [1]. It is tagged because bootph-pre-ram covers the phase that
> >>>> sets up SDRAM, and DRAM cannot be trained without it.
> >>>>
> >>>> Testing: all K1 DTBs build, and dtbs_check is clean for them with and
> >>>> without this series.
> >>>>
> >>>> I used Claude to help read the U-Boot SPL and the device trees. I
> >>>> checked the changes and ran dtbs_check myself.
> >>>>
> >>>> Changes in v3:
> >>>> - Reword both commit messages to describe the hardware instead of what
> >>>> an SPL does, and drop the U-Boot paragraph from patch 1 (E)
> >>>> - Tag i2c2 in k1.dtsi too, as every K1 board has the EEPROM there
> >>>> - Tag eeprom@50 on the OrangePi RV2 and R2S, missed in v2 (Sashiko)
> >>>> - Drop the Assisted-by tags, see commit 1e035297ffda
> >>>> - Keep E's Reviewed-by on both patches, as the changes are the ones
> >>>> discussed on v2
> >>>> - Link to v2: https://lore.kernel.org/all/20261017180141.3477743-1-alan.tseng.cs@gmail.com/
> >>>>
> >>>> Changes in v2:
> >>>> - Tag i2c8 in k1.dtsi instead of in every board file (Yixun)
> >>>> - Rebase onto the spacemit dt-for-next branch
> >>>> - Link to v1: https://lore.kernel.org/all/20261012235624.77993-1-alan.tseng.cs@gmail.com/
> >>>>
> >>>> [1] https://lore.kernel.org/all/20261021083425-GKA125937@kernel.org/
> >>>>
> >>>> Hung-Chun Tseng (2):
> >>>> riscv: dts: spacemit: k1: mark boot-critical SoC nodes bootph-pre-ram
> >>>> riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram
> >>>>
> >>> I'd not put this series on hold, we generally could address other
> >>> remains of issue/improvement later. so with
> >>>
> >>> Reviewed-by: Yixun Lan <dlan@kernel.org>
> >>
> >> With regard to mainline U-Boot use of devicetree-rebasing there is a
> >> robust method in U-Boot build system for overrides such that we may
> >> adopt these proposed changes there before they are accepted in Linux.
> >>
> > Yes, I'm aware of this, and that's fine by me
> >
> >> With changes-requested all addressed for v4 I expect the shape of this
> >> will be good and it is not holding back anything in Linux kernel. The
> >> hold is only due having to ask for what the closed-source BootROM is
> >> doing and waiting for this confirmation now instead of having access to
> >> see its code directly. There are intellectual property warnings
> >> published by SpacemiT prohibiting reverse-engineering the BootROM so it
> >> cannot be expected to proceed any more quickly than asking and waiting
> >> for a reply.
> >>
> > I don't fully understand your concern here, neither bootph-pre-ram nor
> > the Device Tree will be used by BootROM, there is no dependency between them..
> >
>
> There should be a confirmed description in device tree of everything
> that BootROM code is capable of interacting with. Much of it is already
> there and there is no "bootrom" hint as such to commit to the source
> tree. BootROM hardware is proprietary so we should prioritize this and
> get it done while we have access to SpacemiT vendor to answer these
> questions.
>
> Additionally, and not in-place-of, we tag all of these BootROM-adjacent
> nodes as pre-ram because that is an accurate description for peripherals
> configured by a SpacemiT K3 SoC BootROM which does not set up DRAM.
..
> Logically everything this BootROM touches at runtime is pre-ram hardware.
>
Ok, Now I see your point, but it's not correct! bootph-pre-ram tag is NOT
for devices touched by BootROM..
Just let me quote from U-Boot doc: doc/device-tree-bindings/bootph.yaml
Here says the goal of why introducing different bootph tags
"
Some programs run in memory-constrained environments yet want to make use
of device tree.
The full device tree is often quite large relative to the available memory
of a boot phase, so cannot fit into every phase of the boot process. Even
when memory is not a problem, some phases may wish to limit which device
nodes are present, so as to reduce execution time.
"
and from doc/develop/spl.rst
"
The U-Boot device tree is filtered by the fdtgrep tools during the build
process to generate a much smaller device tree used in SPL (spl/u-boot-spl.dtb)
with:
- the mandatory nodes (/alias, /chosen, /config)
- the nodes with one pre-relocation property:
'bootph-all' or 'bootph-pre-ram'
fdtgrep is also used to remove:
- the properties defined in CONFIG_OF_SPL_REMOVE_PROPS
- all the pre-relocation properties
('bootph-all', 'bootph-pre-ram' (SPL), 'bootph-pre-sram' (TPL) and
'bootph-verify' (VPL))
All the nodes remaining in the SPL devicetree are bound
(see :doc:`/develop/driver-model/design`).
NOTE: U-Boot migrated to a new schema for the u-boot,dm-* tags in 2023. Please
update to use the new bootph-* tags as described in the
doc/device-tree-bindings/bootph.yaml binding file.
"
To conclude, bootph-pre-ram is used for tagging nodes which used in SPL phase.
> I have made the mistake of describing this in the confusing view of what
> the SPL could expect:
>
> 1. It matters not at all if BootROM *uses* device tree, because *BootROM
> is hardware*.
>
> 2. It also does not matter *what* the initial SPL does actually, be it
> U-Boot or something else, or if it ever does things that BootROM does
> not (DRAM setup).
>
> 3. The application of bootph-pre-ram is *not limited to* the
> BootROM-affected configuration. However it is the starting point and we
> have access to a vendor willing to answer questions, let's do that now
> and get on with the rest of it.
>
> In the theoretical situation of unlimited SRAM and no need for DRAM then
> I would still want that all the peripherals that BootROM touches
> described with pre-DRAM hints, and a record of conversation on to the
> mailing lists or commit log and/or vendor documentation for a clear
> identification of what is possible to be touched by BootROM just prior
> to the initial SPL code execution.
>
..
> My concern (summarized) is we should identify clearly all of the
> potential peripherals, clocks, everything that BootROM might touch, and
> also as a matter of how this affects Linux source tree to then give this
> all the pre-DRAM hint for device tree description.
>
No, the goal of boot-pre-ram is to identify devices which used in SPL phase,
Could also include the media storage, like SPI nor flash, SD Card, eMMC..
while Linux Source can not rely any pre-configuration inherited from
BootROM, instead it should always assume booting from a clean environment.
> >> If you would like to abandon the approach I suggest of considering the
> >> effects of BootROM peripheral configuration as a hardware environment
> >> needing device tree description and bootph-pre-ram hints for
> >> constrained-memory SPL, then that topic can also be discussed. Please be
> >> clear what your expectations are, thanks!
> >>
> > As my knowledge, the bootph-pre-ram property is used by the filtering mechanism
> > (via fdtgrep) of U-Boot's Device Tree to retain necessary nodes in the SPL phase.
> > You can check final result spl/u-boot-spl.dtb.
> >
>
> -E
>
--
Yixun Lan (dlan)
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2026-12-02 12:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 9:25 [PATCH v3 0/2] riscv: dts: spacemit: mark K1 boot nodes bootph-pre-ram Hung-Chun Tseng
2026-10-24 9:25 ` [PATCH v3 1/2] riscv: dts: spacemit: k1: mark boot-critical SoC " Hung-Chun Tseng
2026-10-25 10:43 ` Anand Moon
2026-10-25 13:02 ` Hung-Chun Tseng
2026-10-26 5:38 ` Anand Moon
2026-10-26 5:44 ` Hung-Chun Tseng
2026-10-24 9:25 ` [PATCH v3 2/2] riscv: dts: spacemit: mark K1 board boot devices bootph-pre-ram Hung-Chun Tseng
2026-10-24 14:45 ` [PATCH v3 0/2] riscv: dts: spacemit: mark K1 boot nodes bootph-pre-ram E Shattow
2026-10-26 3:38 ` Hung-Chun Tseng
2026-10-26 16:26 ` E Shattow
2026-11-24 23:19 ` Yixun Lan
2026-11-25 0:49 ` E Shattow
2026-12-02 2:31 ` Yixun Lan
2026-12-02 8:09 ` E Shattow
2026-12-02 12:59 ` Yixun Lan [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-10-25 8:39 Hung-Chun Tseng
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=20261202125940-GKA2058@kernel.org \
--to=dlan@kernel.org \
--cc=alan.tseng.cs@gmail.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=e@freeshell.de \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=spacemit@lists.linux.dev \
/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