[U-Boot] [U-Boot,6/6] Pine64: rename defconfig

André Przywara andre.przywara at arm.com
Sun May 15 14:49:23 CEST 2016


On 15/05/16 11:30, Hans de Goede wrote:
> Hi,
> 
> On 04-05-16 23:15, Andre Przywara wrote:
>> Rename the defconfig file for the Pine64 from pine64_plus_defconfig to
>> pine64_defconfig.
>> The differences between the two versions (more RAM and a different
>> Ethernet PHY) don't justify two board versions, so lets stick with the
>> generic name and try to differentiate between the versions at runtime
>> if this is needed later.
>>
>> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
> 
> So further down the thread there is some good discussion on
> autodetection.
> 
> I would prefer to keep the name as is (and matching the dts name)
> for now until this is sorted out.
> 
> As for the auto-detect discussion I'm all in favor of doing
> auto-detect and having only one pine64 target in u-boot.

I fully agree. Hence I was proposing a more generic name (Pine64), as
this is what people usually say, implying the plus variants of it as well.
I found this several times when I was typing "make pine64_defconfig" and
wondering why it didn't work. Typing pine64_plus_defconfig when everyone
talks about those "Pine64" boards is just a bit counterintuitive - an
also this pine64_plus config would cover the none-plus boards as well -
which is just confusing.
So my proposal was really about just a name change.
But then again it's just a configuration name, so I don't have a strong
opinion on this.

> But I'm against the idea to pass the u-boot dtb into the kernel.
> 
> People will typically only install u-boot once and then get
> kernel upgrades, including major version updates (Fedora does
> this within a release, Debian on dist-upgrade) from their
> distro, so we really want to stick with using the
> dtb from the fdtdir entry in extlinux.conf
> 
> The way this sofar works for sunxi boards is that the chosen
> entry in extlinux.conf sets the fdtdir and then u-boot determines
> the dtb name to use, since it knows which board it is booting
> from.
> 
> So when we do autodetection, the thing todo would be for the
> autodetect code to update the fdtfile environment variable
> to be one of: "sun50i-a64-pine64-plus", "sun50i-a64-pine64",
> "sun50i-a64-pine64-other-variant" (*).
> 
> And then upon booting u-boot will load $fdtdir/$fdtfile.
> 
> Let me give one example where this will be beneficial over
> using a u-boot supplied dtb:
> 
> 1) User installs u-boot today, using boot0 and other closed
> bits + say Fedora 24.
> 2) In the future we add support for the csi camera
> 3) User gets newer kernel from Fedora, this comes with
> an updated "sun50i-a64-pine64-plus.dtb" which includes the
> necessary changes to enable the csi interface, csi interface
> just works.
> 
> If u-boot where to supply the dtb, then the user would also
> need to update u-boot, which is not part of the standard
> yum / dnf / apt-get update process. Same for later enabling
> hdmi output support, audio in/out, etc.

I understand and support all of these arguments (and hope you didn't
spend too much time in writing this down ;-)

My idea was to have some kind of fallback DT in case there is none
provided by the distribution. For many cases it would be good enough to
just use U-Boot's DT, so I am looking for an easy way to set U-Boot's
"externally-facing" DT addr to the internal one - something like "fdt
internal" or having the internal DT address in a variable or just making
it the default unless the user or boot script loads a custom one.
So from a technical side this is probably not a challenging request and
orthogonal to the rest of the DT discussion.
I see that one of the beauties of the DT is to be easily "hackable", so
I fully support the option of loading a new DT and passing that on to
the kernel.

But: on ARM64 most boards I am aware of provide a DT as part of the
firmware and it sits in some kind of onboard storage - so distributions
don't need to care about shipping DTs.
I see that those SBCs are different here, but frankly - in contrast to
ARM(32) boards - there are not the majority. It may even be that DT
boards (in contrast to ones using ACPI only) become a niche in the
mid-term future (not that I am happy about that).
I am not sure those SBCs have a strong enough audience to push
distributions to deviate from that single-kernel-file-only approach for
arm64. Also all those boards - and their firmware - are in their early
infancy, so why not rather push for a unified approach here, possibly
deviating from the (legacy) ARM one (explicitly supporting certain
boards and shipping DTs for it)?

So: the DT becomes part of the firmware. In the beginning of the support
era (and I calculate with something like a year here) I expect firmware
to improve significantly - even U-Boot, for that matter (USB, Ethernet,
EFI support, you name it ...). So there is a strong incentive to upgrade
your firmware anyway.
But also I see that the kernel support evolves quickly, so putting a new
DT in your /boot directory is probably a good idea - at least for a start.
But when the board support has matured - say to a level the A20 SoC sees
today - I would expect the DT to become very stable and only minor
features requiring an update, something that many people just may not
care about. Those new DTs could then come as part of a firmware update -
which may fix other issues as well. So for instance ARM Trusted Firmware
is part of the Pine64 firmware stack, which gets regular updates with
new features and security fixes (for silicon erratas, for instance). As
part of such an update, a DT update would be included.

To compare this: if I don't miss anything and I don't have issues, I
wouldn't upgrade my Thinkpad firmware either - definitely not for
something like added IR support, which I just don't need (just an example).

> Note I'm not advocating to have different dtb-s, all sunxi
> boards use the same dts files in u-boot and the kernel,
> but the _kernel_ is considered the canonical source, and
> for u-boot we simply sync the included dts files with the
> kernel every now and then.

Yes, that makes sense and I support this.

> As an added advantage this keeps the ABI part of the dtb
> between u-boot and the kernel really small, it basically
> is just the $fdtfile name. Which means that if we mess up
> some bindings we can chose to change them, we try to avoid
> this but always using the dtb file bundled with the kernel
> allows this.

But U-Boot does not use the DT from the disk (or from PXE), instead it
will always use the one embedded in the binary, won't it?
So every time there is a DT issue and/or we update U-Boot's DT, we could
just adjust U-Boot's _drivers_ to cope with that new reference DT
(whether that comes from the kernel or from the vendor). So for U-Boot
itself we don't need to provide backward compatibility of say older
U-Boot binaries with newer DTs. At least this is my perception, please
correct me if I miss something here.

> The main argument for always using the dtb file bundled with
> the kernel is to always get the latest new features (think
> extended hw support) and bugfixes, without the user needing
> to update the bootlader (which is something which is not
> done automatically by the distro, unlike the kernel).

I see that - and that makes some sense especially during the beginning
of the board support.

But also I would like to see a bit beyond Linux - there are other OSes,
think the BSDs, for instance.
So everything that forces people to agree on _one_ single DT for a board
is helpful - the fact that we currently get away with changing the DT
_just for Linux_ is not a good argument to drag on with this in the future.

And frankly, the support level required for those ARM SBCs is quite high
at the moment. Everything that pushes people - board vendors and kernel
hackers - into a simpler approach - more towards providing better
firmware, which helps abstracting things and for shipping one "golden"
DT with the board - is helpful and we should look into this.
Frankly I don't see why a distribution would need to ship support files
for certain boards when there would be one canonical firmware source -
be that the vendor or a community like linux-sunxi.

Cheers,
Andre.

> 
> *) Note we will likely need something more then just that, since
> e.g. some variants have an emmc and others do not and this is
> relevant for u-boot itself
> 



More information about the U-Boot mailing list