[U-Boot] [PATCH 0/3] sunxi: sun8i-emac: Update DT bindings

Andre Przywara andre.przywara at arm.com
Thu Feb 1 09:53:22 UTC 2018


Hi,

On 01/02/18 08:26, Maxime Ripard wrote:
> Hi Andre,
> 
> On Wed, Jan 31, 2018 at 01:40:23PM +0000, Andre Przywara wrote:
>>> Is this issue happening when you sync the whole DT, and would it break
>>> if you just convert the EMAC binding?
>>>
>>> Otherwise, we might try to revive the DTC garbage collection of unused
>>> nodes patches. This would prevent us from using the overlays on such a
>>> DT, but that doesn't like like an unfair tradeoff.
>>
>> Well, what's the point in updating the DT if we then deviate from it
>> again? I would rather suggest to postpone the DT update, until we ditch
>> the MMC environment. The whole reason I wanted the update is to pass it
>> on to Linux, so garbage collection will kill that purpose.
> 
> Not really, the garbage collection I had in mind is:
> https://patchwork.kernel.org/patch/3840371/

Ah, OK, sorry. Did miss that.

> ie, removing only nodes marked as such that are not referenced
> anywhere in your tree (typically pinctrl nodes). It should totally be
> usable from Linux, since the usable part of the DT will remain
> untouched.
> 
> As I was saying, the only noticeable "glitch" would be that you don't
> have nodes in the base DT anymore that used to be there, and overlays
> won't be able to apply properly if they depended on those nodes.
> 
> However, that's not really bad, because:
>   - U-Boot doesn't build its DT with the overlay support anyway
>   - Linux in itself is pretty dumb when it comes to applying overlays
>     at the moment, so there's not a lot of things you can do. The only
>     user in tree (as far as I'm aware) is the FPGA manager, but it
>     doesn't really apply to our SoCs.

Yeah, that makes sense and would be fine for me. However I am not sure
it will gain us enough to be significant.
My impression is that the DT growth is mostly due to the AXP803 nodes. A
lot of them are unreferenced as well, would that be covered by that
method also?

>> So what about this plan:
>> - We need to do something *now* about the breakage of the 64-bit sunxi
>> *_defconfigs, which do not build with origin/master (for me). I tried
>> GCC 7.1.0, 7.3.0 and 6.4.0, also the actual merge point of the sunxi
>> branch in addition to origin/master.
>> The fix I sent (remove the Pine64 "non-plus" .dtb from the FIT image)
>> was supposed do the trick, but in contrast to my test on Friday doesn't
>> work (anymore?). bananapi_m64_defconfig for instance fails also (with a
>> single .dtb).
> 
> Yes, we should definitely merge that patch.
> 
>> Can someone confirm this? Maybe it's worth to see what made U-Boot
>> proper grow in the last few days/weeks?
> 
> I guess I'm (at least partially) to blame with the introduction of the
> FAT environment...
> 
> How much size do we need?

I saw it being off by roughly 3KB, unfortunately. But that is my
particular setup here, I think that differs with compiler versions and
what not.
Plus I just realised that ATF is of course also part of the .itb, and
more or less by accident I had a slightly bigger version pointed to by
my bl31.bin link (being 5KB bigger than usual).
So sorry for the noise, with the standard 32K ATF image sunxi64 boards
with one .dtb build fine. Well, 936 bytes below the limit ;-).
It's just the Pine64 double .dtb that needs fixing immediately.

> I've looked at the gains we could have with the dtc patch mentionned
> above if we flag all the PIO nodes, and its roughly around 500-800
> bytes for an A64 DTS. Would it be enough?

So not for the issue I reported yesterday, but that seems to be moot now.
That's why I was originally suggesting SHA256, which gives us 8KB, so
some room for the inevitable growth here and there, even after the merge
window. We might keep that in mind for emergency cases ;-)

>> - Regardless of this we take the patches from this series, so U-Boot
>> *can* deal with both DTs.
> 
> We should merge those patches, but I don't get why we should maintain
> the compatibility with the old bindings. Yes, I know what you are
> going to say, but the deal that was made about those bindings when
> they were introduced was that we would simply update those bindings
> when Linux would have decided.
> 
> And not maintain any kind of compatibility. Apparently, that deal has
> changed without consulting or notifying anyone. Great.
> 
> And since most of that discussion has been around using the U-Boot DT
> from Linux, I'm not even sure what the pro would be to keep the old
> binding around.

You could have saved your breath ;-)
I am totally fine with removing support for the old binding. And (in
contrast to Linux!) I would like to consider U-Boot the source of the
.dtb, so we can do changes.
And indeed the old bindings were never agreed upon.

The reason I kept them in is simply to not break bisectability. The
moment you remove the support, you break the board's boot. This is
easily fixed with a follow up patch to update the DT, but unless you
want to squash code and DT changes into one patch, we should keep them,
at least for some commits.
This is especially true if we don't know yet when the DT will be updated.

Solutions I see:
1) We keep support for the old bindings in. Once we merged the DT update
(which could be months away, possibly, due to the size issue), we add a
patch to remove support for the old bindings.
2) We queue those patches, plus update just the nodes affected (EMAC +
respective pinctrl nodes) to the Linux ones *now*. This should not
increase the size of the DT. Then we can immediately add a patch to
remove support for the old binding. So we have this double support in
for just two commits or so.

I guess there is not much to say against 2), I am happy to send patches
for that.

>> - We wait with any DT updates until we remove the MMC environment
>> support, so that we have enough space to give U-Boot the proper .dts.
>>
>> What is the current plan for the MMC environment? Remove it (or not
>> enable it by default) in 2018.05?
> 
> Not enabling it by default in 2018.05, and removing the migration code
> later on seems like a good idea yes.
> 
>> Having the support for both DT bindings in the EMAC driver *now* would
>> allow people to build their own firmware, *configuring* out the MMC
>> environment already and not suffer from any limits anymore.
> 
> I understand your frustration, and honestly, it frustrates me even
> more to see that the hunt of config option and the discussion we had a
> month ago are already rendered useless, and we need to do it again.

I know what you mean!

So quick summary:
- I update this series to add one patch to update just the EMAC DT node,
plus one patch to remove support for the old binding.
- DT sync with Linux is postponed for now until we can afford the size.
- We queue the Pine64 non-plus .dtb patch, to fix the build for
pine64_plus_defconfig.
- We keep an eye on the build size for the next weeks, to spot
regressions, especially before the 2018.03 release.
- We start chilling the champagne for the day MMC env support gets disabled.

Thanks a lot for wading through this mess ;-)

Cheers,
Andre.

>> It would just be the _defconfig build which keeps compatibility, for
>> users who care.
> 
> We do agree on that :)
> Maxime
> 


More information about the U-Boot mailing list