Page MenuHomeFreeBSD

libfdt: Update to 1.4.6, switch stand/fdt over to using libfdt for overlay support
ClosedPublic

Authored by kevans on Jan 12 2018, 10:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 19, 3:21 PM
Unknown Object (File)
Apr 30 2024, 1:48 AM
Unknown Object (File)
Apr 30 2024, 1:45 AM
Unknown Object (File)
Mar 11 2024, 8:41 AM
Unknown Object (File)
Mar 11 2024, 8:41 AM
Unknown Object (File)
Mar 11 2024, 8:41 AM
Unknown Object (File)
Mar 11 2024, 8:39 AM
Unknown Object (File)
Mar 7 2024, 10:51 PM
Subscribers

Details

Summary

libfdt highlights since 1.4.3:

  • fdt_property_placeholder added to create a property without specifying its value at creation time
  • Improved overlay support
  • Various internal cleanup

While here, switch stand/fdt over to using libfdt for overlay support. Our current overlay implementation works only for limited use cases with overlays generated only by some specific versions of our dtc(1). Swap it out for the libfdt implementation, which supports any properly generated overlay being applied to a properly generated base. This will be followed up with an update to dtc(1) to properly generate overlays.

MFC note: the <stdlib.h> include this update introduces in libfdt_env.h is apparently not necessary in the context we use this in. It's not immediately clear to me the motivation for it being introduced, but it came in with overlay support. I've left it in for the sake of accuracy and because it's not harmful here, but MFC'ing this to stable/11 will require wrapping the #include in an #ifndef _STANDALONE block or else it will cause build failures.

Some side notes:

1.) I don't really expect this to break anything, but I'm told testing is a good idea.

2.) I have a universe build going with this, and things are looking good so far, build-testing at least is covered.

3.) I chose to go ahead and swap us over to libfdt's overlay support with this update, but that was an arbitrary update. If it seems desired, I can go ahead and separate that out. My reasoning was as follows:

a.) I'm probably the only user of overlays right now.

b.) There won't be any fallout from this that requires backout. Our current implementation of overlay support doesn't correctly merge symbols and only supported more than one overlay as of recent. If this commit needs backout, it won't be from this part.

c.) Separating it out won't really be of any use for bisecting any problems following this commit.

d.) That change was small enough that it's hard to screw up, since I already made our fdt_overlay_apply compatible with libfdt's. This part of the change is essentially just removing our fdt_overlay.{c,h} and the associated include in fdt_loader_cmd.c.

Test Plan

Bug a bunch of people into testing on platforms I don't have hardware for

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans retitled this revision from libfdt: Update to 1.4.6, switch stand over to using libfdt for overlay support to libfdt: Update to 1.4.6, switch stand/fdt over to using libfdt for overlay support.
kevans edited the summary of this revision. (Show Details)
kevans edited the test plan for this revision. (Show Details)
kevans added reviewers: ARM, arm64, PowerPC.

Fix diff; a couple files were left around by mistake.

nwhitehorn added a subscriber: nwhitehorn.

Works just fine on PowerPC.

This revision is now accepted and ready to land.Jan 13 2018, 11:04 PM

Tested on: Banana Pi-M3 (ARMv7)
Tested on: Pine64 (aarch64)

This revision was automatically updated to reflect the committed changes.