Page MenuHomeFreeBSD

stand/fdt: Consolidate overlay handling a little further
ClosedPublic

Authored by kevans on Jan 20 2018, 1:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 11 2024, 9:21 AM
Unknown Object (File)
Mar 11 2024, 9:20 AM
Unknown Object (File)
Mar 11 2024, 9:20 AM
Unknown Object (File)
Mar 11 2024, 9:20 AM
Unknown Object (File)
Mar 7 2024, 11:10 PM
Unknown Object (File)
Jan 28 2024, 12:16 AM
Unknown Object (File)
Jan 9 2024, 9:33 AM
Unknown Object (File)
Jan 6 2024, 11:57 PM
Subscribers
None

Details

Summary

This should have been done as part of rS327350, but due to lack of foresight it came later. In the different places we apply overlays, we duplicate the bits that check for fdt_overlays in the environment and supplement that with any other places we need to check for overlays to load. These "other places" will be loader specific and are not candidates for consolidation.

Provide an fdt_load_dtb_overlays to capture the common logic, allow passing in a callback that can be used to obtain additional overlays to be loaded. The callback is used in practice for ubldr to pull in any fdt_overlays passed to it from U-Boot environment, but it can be used for any other source of overlays.

These additional overlays supplement loader.conf(5) fdt_overlays, rather than replace, so that we're not restricted to specifying overlays in only one place. This is a change from previous behavior where loader.conf(5) supplied fdt_overlays would cause us to ignore U-Boot environment, and this seems nonsensical- user should have sufficient control over both of these aspects, or lack of control for good reasons.

A knob could be considered in the future to ignore U-Boot supplied overlays, but the supplemental treatment seems like a good start.

Diff Detail

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

Event Timeline

i see nothing obviously wrong here.

This revision is now accepted and ready to land.Jan 28 2018, 12:13 AM

Simplify; the callback was not necessary, just take a const char * and use that if it's usable.

This revision now requires review to proceed.Jan 28 2018, 12:45 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 28 2018, 1:22 AM
This revision was automatically updated to reflect the committed changes.