Re: [RFC] Best practices for hardware shipping device trees

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, Aug 20, 2013 at 7:02 AM, Nicolas Pitre <nicolas.pitre@xxxxxxxxxx> wrote:
> On Tue, 20 Aug 2013, Alexander Graf wrote:
>
>
>> > And if your bootloader produces a bad DTB and you cannot let end users
>> > upgrade the bootloader then this is certainly against best practice.
>>
>> But that's exactly how everyone else works. On x86 you get your ACPI
>> tables from firmware, on PPC you get your device tree from firmware
>> and you really don't update your firmware just because your OS thinks
>> the tables are wrong.
>
> And everyone, except maybe yourself, despise that state of affair.
>
> Sorry but we ought to push for something better when we can.  As device
> tree is being established on ARM, now is the time to learn from past
> mistakes and break away from the broken legacy methods.

Well, provide support for real OpenFirmware or firmware-provided DTB,
and allow people to append DTBs to their kernels if they need to
update them.

The better state of affairs is that vendors who wish to support Linux
on the systems they ship would allow the firmware to be upgraded and
collaborate in the process. If they do not wish this or wish to
cooperate with this procedure, you can vote with your wallet; don't
buy their systems.

The idea that you could say "we accept some device trees but not all"
even if they follow standards at the time and the standards changed is
not going to fly, simply because what you're pushing is device trees,
and yes.. sometimes things change, and bindings move on, and they may
not be compatible.

In the case of a real OpenFirmware implementation it is ridiculously
easy to either patch the device tree in the firmware (load a Forth
script - I can point at two examples for this) or do it in the kernel
via CIF.

In the case of other bootloaders like U-Boot, libfdt provides the
ability to modify and insert loaded device trees to match (in which
case, the DTB bundled in the flash of some board is just a starting
point).

The worst case scenario is that it would be completely hosed, and in
this case an appended (or overridden by loading from filesystem or
other flash location) DTB is the solution - just like you can load
ACPI tables for some systems where the vendor shipped version is
totally broken.

There isn't a way around this, it's a fact of life in an imperfect
world. What you can do is keep Linux clean and move all device tree
modification/fixup crap to the vendor/bootloader responsibility where
it should be. If any of the above is not possible then it's going to
be incredibly difficult - to the point that insisting on complete
simplification and standardization of bootloader configurations and
"sanity" of device trees doesn't apply anyway. Sometimes vendors will
do what they want to do and not what you want to do; Linux no work,
and that is that.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux