[PATCH v1 0/5] Convert recently merged T30 boards to use DM PMIC

Tom Rini trini at konsulko.com
Tue Dec 12 13:42:07 CET 2023


On Mon, Dec 11, 2023 at 12:55:32PM +0100, Thierry Reding wrote:
> On Wed, Nov 15, 2023 at 02:11:49PM -0500, Tom Rini wrote:
> > On Wed, Nov 15, 2023 at 04:51:08PM +0100, Thierry Reding wrote:
> > > On Mon, Nov 06, 2023 at 04:04:07PM -0500, Tom Rini wrote:
> > > > On Mon, Nov 06, 2023 at 02:11:16PM +0000, Peter Robinson wrote:
> > > > > On Mon, Nov 6, 2023 at 1:28 PM Svyatoslav Ryhel <clamor95 at gmail.com> wrote:
> > > > > >
> > > > > > пн, 6 лист. 2023 р. о 15:13 Peter Robinson <pbrobinson at gmail.com> пише:
> > > > > > >
> > > > > > > On Mon, Nov 6, 2023 at 11:58 AM Svyatoslav Ryhel <clamor95 at gmail.com> wrote:
> > > > > > > >
> > > > > > > > пн, 6 лист. 2023 р. о 13:46 Peter Robinson <pbrobinson at gmail.com> пише:
> > > > > > > > >
> > > > > > > > > Hi Svyatoslav,
> > > > > > > > >
> > > > > > > > > > Since the proposed PMIC patches have been accepted, I see the need
> > > > > > > > > > to convert boards which I maintain to use DM drivers instead of board hacks.
> > > > > > > > > >
> > > > > > > > > > Svyatoslav Ryhel (5):
> > > > > > > > > >   board: lg-x3: convert LG Optimus 4X and Vu to use DM PMIC
> > > > > > > > > >   board: endeavoru: convert HTC One X to use DM PMIC
> > > > > > > > >
> > > > > > > > > Is there a reason why the two above devices don't appear to have their
> > > > > > > > > .dts files in the upstream kernel?
> > > > > > > > >
> > > > > > > >
> > > > > > > > Yes, there is a reason. Linux maintainers treat submitters as
> > > > > > > > existential enemies or as dirt at least. I was trying to work with
> > > > > > > > linux but I have no desire to spend any time to upstream endeavoru or
> > > > > > > > lg_x3.
> > > > > > >
> > > > > > > The usual policy for acceptance into U-Boot is to have upstream review
> > > > > > > in the kernel first.
> > > > > > >
> > > > > >
> > > > > > May you point to a policy which clearly and explicitly states this as
> > > > > > a mandatory condition?
> > > > > 
> > > > > There have been a number of devices rejected in the past until their
> > > > > DT are upstream but I'll leave Tom, who I've explicitly added on cc:,
> > > > > to clarify the exact policy.
> > > > 
> > > > Well, here is where it's tricky. I brought this up for one of the
> > > > Broadcom MIPS platforms a week or two back, and Linus Walleij's point
> > > > (and I'm paraphrasing) is there's not really an upstream for it to go.
> > > > 
> > > > What we cannot have is device tree bindings[1] that aren't upstream or
> > > > worse yet conflict with the official bindings.
> > > > 
> > > > So the general way to resolve that is have device tree file be drop-in
> > > > from the linux kernel, and what additions we must have be done via
> > > > -u-boot.dtsi files. And in turn, some SoCs are better about keeping in
> > > > sync with the kernel than other SoCs are.
> > > > 
> > > > Now, upstream being actively hostile to dts files, especially for older
> > > > platforms? That's unfortunate. So long as we aren't violating the rules
> > > > about bindings, the intention is that we don't have device trees that
> > > > are either (a) massively out of sync with the kernel[2] or (b) kept
> > > > intentionally mismatched from the kernel.
> > > > 
> > > > -- 
> > > > Tom
> > > > 
> > > > [1]: There are both examples like binman that Simon is working on at
> > > > least but this is more exception than intentional rule.
> > > > [2]: Per our other conversions, I know the tegra ones are in this
> > > > unfortunate state in general
> > > 
> > > On the Tegra side we've been fairly lax about the device trees in
> > > U-Boot, I suppose. The assumption had always been that U-Boot would load
> > > an external DTB and pass it to the kernel on boot, so keeping them both
> > > in sync was never a high priority.
> > > 
> > > U-Boot does only a very tiny amount of what Linux does, so dropping in
> > > the kernel DTB always seemed a bit overkill.
> > > 
> > > In either case, if this is problematic, it's something that I could take
> > > a look at. Again, it's expected that the device trees are different, for
> > > historical reasons, but I'd be surprised if they actually conflict with
> > > one another. U-Boot's DTB was always supposed to be a subset of the
> > > Linux DTB.
> > 
> > So, the issue with U-Boot and kernel device trees being out of sync is
> > that we then can't support the model of "just pass the current DT to the
> > OS". This in general is good to support because it means that even if a
> > given platform isn't formally SystemReady IR certified it's still likely
> > to be functional.
> 
> This is certainly not something that we ever strived for with Tegra. It
> was always very clear that we needed to get the DTB from the same source
> as the kernel. The vast majority of what's in the DTB is completely
> useless for U-Boot because it simply doesn't support (and doesn't have
> to support) a lot of the hardware that Linux supports.
> 
> One concern that I have with this policy is that for certain devices we
> may just not be able to do this. Especially with some early OEM devices
> I recall that they had limited storage for the bootloader. Since the DTB
> needs to be embedded, a full-blown DTB from Linux might inflate the size
> significantly. Comparing to what we have today, the Linux DTB can be
> anywhere from 2 to 3 times as big as the U-Boot DTB.

As I noted in a different thread, I will be unhappy if U-Boot is unable
to still be useful on a platform (tbs2910) that has just shy of 384kB of
space for the binary, so still being somewhat small is a feature I want
us to keep.

That said, most of the common community distributions want to be able to
not ship device trees at least some day. At least one today requires
being passed the right / valid device tree. And U-Boot will pass along
the tree we're using if no override is presented. So yes, passing along
the full real device tree to U-Boot and then being able to pass it
further along is generally desired. If you can't you can't. If you want
to take on the headache of keeping them separate, well, OK. But as this
series shows we also make use of more of the tree than we used to as
well, so just doing the drop-in and occasional resync is good.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231212/a46a7ab9/attachment.sig>


More information about the U-Boot mailing list