On Tue, Mar 26, 2024 at 4:29 PM Daniel Golle <daniel(a)makrotopia.org> wrote:
>
> Hi Rob,
>
> On Tue, Mar 26, 2024 at 03:24:49PM -0500, Rob Herring wrote:
> > +boot-architecture list
>
> Good idea, thank you :)
Now really adding it. :(
Will reply to rest later.
> >
> > On Mon, Mar 25, 2024 at 03:38:19PM +0000, Daniel Golle wrote:
> > > On Mon, Mar 25, 2024 at 10:10:46AM -0500, Rob Herring wrote:
> > > > On Thu, Mar 21, 2024 at 07:31:48PM +0000, Daniel Golle wrote:
> > > > > On embedded devices using an eMMC it is common that one or more (hw/sw)
> > > > > partitions on the eMMC are used to store MAC addresses and Wi-Fi
> > > > > calibration EEPROM data.
> > > > >
> > > > > Implement an NVMEM provider backed by a block device as typically the
> > > > > NVMEM framework is used to have kernel drivers read and use binary data
> > > > > from EEPROMs, efuses, flash memory (MTD), ...
> > > > >
> > > > > In order to be able to reference hardware partitions on an eMMC, add code
> > > > > to bind each hardware partition to a specific firmware subnode.
> > > > >
> > > > > Overall, this enables uniform handling across practially all flash
> > > > > storage types used for this purpose (MTD, UBI, and now also MMC).
> > > > >
> > > > > As part of this series it was necessary to define a device tree schema
> > > > > for block devices and partitions on them, which (similar to how it now
> > > > > works also for UBI volumes) can be matched by one or more properties.
> > > > >
> > > > > ---
> > > > > This series has previously been submitted as RFC on July 19th 2023[1]
> > > > > and most of the basic idea did not change since. Another round of RFC
> > > > > was submitted on March 5th 2024[2] which has received overall positive
> > > > > feedback and only minor corrections have been done since (see
> > > > > changelog below).
> > > >
> > > > I don't recall giving positive feedback.
> > > >
> > > > I still think this should use offsets rather than partition specific
> > > > information. Not wanting to have to update the offsets if they change is
> > > > not reason enough to not use them.
> > >
> > > Using raw offsets on the block device (rather than the partition)
> > > won't work for most existing devices and boot firmware out there. They
> > > always reference the partition, usually by the name of a GPT
> > > partition (but sometimes also PARTUUID or even PARTNO) which is then
> > > used in the exact same way as an MTD partition or UBI volume would be
> > > on devices with NOR or NAND flash.
> >
> > MTD normally uses offsets hence why I'd like some alignment. UBI is
> > special because raw NAND is, well, special.
>
> I get the point and in a way this is also already intended and
> supported by this series. You can already just add an 'nvmem-layout'
> node directly to a disk device rather than to a partition and define a
> layout in this way.
>
> Making this useful in practice will require some improvements to the
> nvmem system in Linux though, because that currently uses signed 32-bit
> integers as addresses which is not sufficient for the size of the
> user-part of an eMMC. However, that needs to be done then and should
> of course not be read as an excuse.
>
> >
> > > Just on eMMC we usually use a GPT
> > > or MBR partition table rather than defining partitions in DT or cmdline,
> > > which is rather rare (for historic reasons, I suppose, but it is what it
> > > is now).
> >
> > Yes, I understand how eMMC works. I don't understand why if you have
> > part #, uuid, or name you can't get to the offset or vice-versa. You
> > need only 1 piece of identification to map partition table entries to DT
> > nodes.
>
> Yes, either of them (or a combination) is fine. In practise I've mostly
> seen PARTNAME as identifier used in userland scripts, and only adding
> this for now will probably cover most devices (and existing boot firmware)
> out there. Notable exceptions are devices which are using MBR partitions
> because the BootROM expects the bootloader to be at the same block as
> we would usually have the primary GPT. In this case we can only use the
> PARTNO, of course, and it stinks.
> MediaTek's MT7623A/N is such an example, but it's a slingly outdated
> and pretty weird niche SoC I admit.
>
> > Sure, offsets can change, but surely the firmware can handle
> > adjusting the DT?
>
> Future firmware may be able to do this, of course. Current existing
> firmware already out there on devices such as the quite popular
> GL.iNet MT-6000, Netgear's Orbi and Orbi Pro series as well as all
> Adtran SmartRG devices does not. Updating or changing the boot
> firmware of devices already out there is not intended and quite
> challenging, and will make the device incompatible with its vendor
> firmware. Hence it would be better to support replacing only the
> Linux-based firmware (eg. with OpenWrt or even Debian or any
> general-purpose Linux, the eMMC is large enough...) while not having
> to touch the boot firmware (and risking to brick the device if that
> goes wrong).
>
> Personally, I'm rather burdened and unhappy with vendor attempts to
> have the boot firmware mess around too much in (highly customized,
> downstream) DT, it may look like a good solution at the moment, but
> can totally become an obstacle in an unpredictable future (no offense
> ASUS...)
>
> >
> > An offset would also work for the case of random firmware data on the
> > disk that may or may not have a partition associated with it. There are
> > certainly cases of that. I don't think we have much of a solution for
> > that other than trying to educate vendors to not do that or OS
> > installers only supporting installing to something other than eMMC. This
> > is something EBBR[1] is trying to address.
>
> Absolutely. Actually *early* GL-iNet devices did exactly that: Use the
> eMMC boot hw-partitions to store boot firmware as well as MAC
> addresses and potentially also Wi-Fi calibration data.
>
> The MT-2500 is the example I'm aware of and got sitting on my desk for
> testing with this very series (which allows to also reference eMMC
> hardware partitions, see "[7/8] mmc: block: set fwnode of disk
> devices").
> Unfortunately later devices such the the flag-ship MT-6000 moved MAC
> addresses and WiFi-EEPROMs into a GPT partition on the user-part of
> the eMMC.
>
> >
> > > Depending on the eMMC chip used, that partition may not even be at the
> > > same offset for different batches of the same device and hence I'd
> > > like to just do it in the same way vendor firmware does it as well.
> >
> > Often vendor firmware is not a model to follow...
>
> I totally agree. However, I don't see a good reason for not supporting
> those network-appliance-type embedded devices which even ship with
> (outdated, downstream) Linux by default while going through great
> lengths for things like broken ACPI tables in many laptops which
> require lots of work-arounds to have features like suspend-to-disk
> working, or even be able to run Linux at all.
>
> >
> > > Chad of Adtran has previously confirmed that [1], which was the
> > > positive feedback I was refering to. Other vendors like GL-iNet or
> > > Netgear are doing the exact same thing.
> > >
> > > As of now, we support this in OpenWrt by adding a lot of
> > > board-specific knowledge to userland, which is ugly and also prevents
> > > using things like PXE-initiated nfsroot on those devices.
> > >
> > > The purpose of this series is to be able to properly support such devices
> > > (ie. practially all consumer-grade routers out there using an eMMC for
> > > storing firmware).
> > >
> > > Also, those devices have enough resources to run a general purpose
> > > distribution like Debian instead of OpenWrt, and all the userland
> > > hacks to set MAC addresses and extract WiFi-EEPROM-data in a
> > > board-specific ways will most certainly never find their way into
> > > Debian. It's just not how embedded Linux works, unless you are looking
> > > only at the RaspberryPi which got that data stored in a textfile
> > > which is shipped by the distribution -- something very weird and very
> > > different from literally all of-the-shelf routers, access-points or
> > > switches I have ever seen (and I've seen many). Maybe Felix who has
> > > seen even more of them can tell us more about that.
> >
> > General purpose distros want to partition the disk themselves. Adding
> > anything to the DT for disk partitions would require the installer to be
> > aware of it. There's various distro folks on the boot-arch list, so
> > maybe one of them can comment.
>
> Usually the installers are already aware to not touch partitions when
> unaware of their purpose. Repartitioning the disk from scratch is not
> what (modern) distributions are doing, at least the EFI System
> partition is kept, as well as typical rescue/recovery partitions many
> vendors put on their (Windows, Mac) laptops to allow to "factory
> reset" them.
>
> Installers usually offer to replace (or resize) the "large" partition
> used by the currently installed OS instead.
>
> And well, the DT reference to a partition holding e.g. MAC addresses
> does make the installer aware of it, obviously.
>
>
> Thank you for the constructive debate!
>
>
> Cheers
>
>
> Daniel
>
>
> >
> > Rob
> >
> > [1] https://arm-software.github.io/ebbr/index.html#document-chapter4-firmware-m…
Hi,
I would be inclined to cancel today's EBBR call, as we have nothing on the
agenda [1] and there has been no recent activity on the pull requests, the
issues or the ML.
If you have an urgent topic to discuss today, please let us know before 1pm UTC,
otherwise we will adjourn the call.
Best regards,
Vincent Stehlé
System Architect - Arm
[1]: https://github.com/ARM-software/ebbr/wiki/EBBR-Meetings
Hi,
Happy new year!
This is a kind reminder that we will have our next EBBR call on Jan 15.
Feel free to add to the agenda, directly on the wiki page[1] or by e-mail.
A big thank you to Ilias, Heinrich and Etienne for continuing the EBBR calls
while I could not.
Best regards,
Vincent Stehlé
System Architect - Arm
[1]: https://github.com/ARM-software/ebbr/wiki/EBBR-Meetings
Hi Tom,
On Sun, 10 Dec 2023 at 03:33, Tom Rini <trini(a)konsulko.com> wrote:
>
> On Mon, Dec 04, 2023 at 11:02:57AM +0530, Sumit Garg wrote:
>
> [snip]
> > But currently u-boot doesn't have a proper way to validate those DTS
> > against DT bindings (maintained in Linux kernel). Although there are
> > Devicetree schema tools available here [2], there isn't a versioned
> > release package of DT bindings which one should use to validate DTS
> > files.
>
> I will have more / other things to say but I want to chime in here. That
> U-Boot cannot validate the DTS files is a bug, not a feature. I would
> very much appreciate if someone(s) with time and skills to do so would
> re-sync us with the kernel Kbuild again so that we can both stay in sync
> again and have the validation targets / functionality available here
> too.
>
Agree, the Kbuild changes to add dtbs_check was the first thing I
implemented after importing devicetree-rebasing repo in u-boot (see
commit [1] for details). Usage with PR [2] included:
While building any u-boot target, just add make target: "dtbs_check"
and you will see the DT schema checks being performed. Steps:
$ make <target>_defconfig
$ make -j`nproc` dtbs_check
Currently there are a lot of incompatibility warnings I have seen for
the platforms I built. This shows how much difficult it has been to
keep DT in sync with upstream DT bindings.
TBH, this was the only motivation for me to get into discussion with
DT bindings maintainers for a separate repo. But since with
devicetree-rebasing, we get devictree files bundled along and then I
got into reusing them for building DTBs in u-boot. This has the other
benefit of reducing maintainer's pain to keep DT in sync with Linux
kernel major releases (see amlogic platforms to be the first migrator
[3]).
[1] https://github.com/u-boot/u-boot/pull/451/commits/7ea2dc2477992a603fa881d0d…
[2] https://github.com/u-boot/u-boot/pull/451
[3] https://github.com/u-boot/u-boot/pull/451/commits/38c2ac62e9134604d1a56179d…
-Sumit
> --
> Tom
Le 7 déc. 2023 à 21:31, Conor Dooley <conor(a)kernel.org> a écrit :
What on earth has happened here with quoting? Please fix your mail
client man, this mail is a mess to read.
Conor: Hopefully I have now fixed MacOS Mail configuration…
For all: please accept my apologies on past inconveniences.
On Thu, Dec 07, 2023 at 08:24:01PM +0000, ff wrote:
Le 7 déc. 2023 à 19:51, Rob Herring <robh+dt(a)kernel.org> a écrit :
On Thu, Dec 7, 2023 at 2:08 AM ff <ff(a)shokubai.tech> wrote:
Le 6 déc. 2023 à 21:42, Rob Herring <robh+dt(a)kernel.org> a écrit :
On Tue, Dec 5, 2023 at 11:05 PM Sumit Garg <sumit.garg(a)linaro.org> wrote:
On Tue, 5 Dec 2023 at 15:39, Krzysztof Kozlowski
<krzysztof.kozlowski(a)linaro.org> wrote:
On 05/12/2023 10:45, Sumit Garg wrote:
+ U-boot custodians list
On Tue, 5 Dec 2023 at 12:58, Krzysztof Kozlowski
<krzysztof.kozlowski(a)linaro.org> wrote:
On 05/12/2023 08:13, Sumit Garg wrote:
@DT bindings maintainers,
Given the ease of maintenance of DT bindings within Linux kernel
source tree, I don't have a specific objection there. But can we ease
DTS testing for firmware/bootloader projects by providing a versioned
release package for DT bindings? Or if someone else has a better idea
here please feel free to chime in.
This doesn't work for you?:
https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebas…
Thanks, this is certainly a good step which I wasn't aware of. Further
simplification can be done to decouple devicetree source files from DT
bindings.
Why?
I suppose you are already aware that Linux DTS files are a subset of
what could be supported by devicetree schemas. There can be
firmware/bootloader specific properties (one example being [1]) which
Linux kernel can simply ignore. Will you be willing to add all of
those DT properties to Linux DTS files and maintain them?
We already added them and we already maintain them. DTS describes the
hardware, not the OS-subset of the hardware.
Let look at some numbers if your statement is justified or not for the
example I gave:
u-boot$ git grep -nr bootph-* arch/arm* | wc -l
4079
linux$ git grep -nr bootph-* arch/arm* | wc -l
267
I have no control over whether anyone has submitted the other 3812 instances.
It looks like there is always going to be a catch up game regarding DT
properties which either Linux kernel or u-boot or any other
firmware/bootloader project don't care about.
As long as dts files in u-boot are manually sync'ed, yes. That is the
problem and it doesn't matter if we have a standalone repository or
not.
If you want to move in that direction, start automating what u-boot
imports. You need to do that for bindings if you want to run
validation, so why not dts files too?
However, DT bindings are something which should be common, the
hardware description of a device should be universal. IMO, splitting
Both DT bindings and DTS should be common. I don't see the difference.
If we really care about DTS to be common then the contribution model
has to change where there is a single repo hosting DT bindings and
DTS. All other projects whether it is Linux kernel or u-boot or any
other OS/firmware/bootloader are just consuming DTS files from that
single repo.
Really, only the kernel and u-boot matter. No, I don't mean I don't
care about other projects, but those are the 2 with the widest h/w
support by far and which have a major effort to sync copies of dts
files in both projects. The rest are just noise in terms of this
problem.
I suppose this is something that Linux DT maintainers
have objected to in the past for ease of maintenance. I am not sure if
you folks are willing to change that stance.
The issue is no one steps up to help maintain such a repository while
there is lots of review and maintainer work on what goes into the
kernel tree. I'm happy to direct my binding review attention to
wherever the majority of the bindings go. But the work on the DTS side
is mostly SoC tree maintainers and sub-maintainers.
Assume for a minute we have this standalone repo. What happens next?
We start with an empty repo and then merge and move platforms 1 by 1?
What about leveraging SystemReady-IR compliant board maintainers and start with a core of motivated people ?
I think there are 2 ATM. Synquacer and i.MX8 variants.
Based on https://www.arm.com/architecture/system-architectures/systemready-certifica…
roughly 30 boards.
Synquacer only
has a DT in u-boot, so not really anything to do there.
I'm pretty
sure the certified DTBs for i.MX8 don't match what's in u-boot or the
kernel tree. Hopefully, it's just a subset, but still, there's a gap.
I don't know that there is motivation there either.
Note that SystemReady currently only requires every node with
'compatible' have a schema. It does not yet require no schema
warnings. If we went with a 1 by 1 approach, I would push that
platforms have to be free of warnings.
How many years will that take?
Should all platforms following that organization be a goal?
You mean should all platforms be moved? Absolutely. I don't think we
want to solve the problem of having DTS files in 2 places by creating
a 3rd place.
I think this bit here is the only thing you actually wrote:
Actually, if we limit he DTS in the third place for SystemReady-IR,
there should be no DTB in the Linux distribution.
It would be the equivalent as ACPI boards . So is it still an issue ?
A reference to the the third repo may be hinted in a text file.
SystemReady is only for one architecture, why would using it as the
centralised point for devicetree files make sense?
SystemReady is an Arm certification but built on EBBR which is
the important part and also adopted by RISC-V.
So when I said SystemReady, one should read EBBR.
EBBR is promoting a DT life cycle that is in line with
having an out of OS/Firmware repos definitions.
I don't really think 1 by 1 is the right approach. I was just
enumerating how this could work. It's not that useful to say we need a
standalone repo without working thru the logistics of how exactly that
will work.
Rob