Re: [PATCH 0/6] Extend fdt_overlay_apply() to allow merge of overlay blobs

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



Hi,

On Fri, Mar 16, 2018 at 06:36:01PM +0530, Srivatsa Vaddagiri wrote:
> Hello,
>       I'd like comments on some changes to fdt_overlay_apply() that I have
> prototyped to allow merging of two or more overlay blobs (overlay blob is
> considered as a DT blob having unresolved external references listed in
> __fixups__ section).
> 
> fdt_overlay_apply() API currently allows for an overlay DT blob to be merged
> with a base blob. It assumes that all external symbols specified in overlay
> blob's __fixups__ section are found in base blob's __symbols__ section and
> aborts on the first instance where a symbol could not be found in base blob.
> 
> This is mostly fine as the primary use of overlay is on a target for its
> bootloader to merge various overlay blobs based on h/w configuration detected?
> 
> We are exploring an extended use of fdt_overlay_apply() for offline use, i.e on
> the host (build machine) side, which requires merging two overlay DT blobs i.e
> the base (overlay) blob will not resolve all the external node references found
> in overlay blob.
> 
> Currently all the device-tree (DT) code for a given soc is maintained in a
> common kernel repository. For example, this common DT code will have code for
> audio, video, fingerprint, bluetooth etc. Further this DT code is typically
> split into a base (soc-common) code and board specific code, with the soc code
> being compiled as soc.dtb and board specific code being compiled as respective
> overlay blobs (board1.dtbo, board2.dtbo etc). soc.dtb and boardX.dtbo files are
> flashed separately on target (besides improving the overall size of DT blobs
> flashed on target, Android Treble also requires separation of soc and board DT
> bits). Bootloader will pick one of the board overlay blobs and merge it with
> soc.dtb, before booting kernel which is presented a unified DT blob (soc + board
> overlay).
> 
> For ease of code maintenance and better control over release management, we are
> exploring allowing some of the tech teams (audio/fingerprint sensor etc) to
> maintain their kernel code (including their DT code) outside a common kernel
> repository. In our experience, this simplifies number of branches maintained in
> core kernel repo. New/experimental features in fingerprint sensor driver for
> example that needs to be on a separate branch will not result in unnecessary
> branching in core kenrel repo, affecting all other drivers. 
> 
> In addition to compiling DT code outside core kernel tree, we also want to merge
> the blobs back to respective blobs found in kernel build tree (soc.dtb or
> boardX.dtbo), as otherwise relying on bootloader to do all the overlay impacts
> boot-time.
> 
> This brings up the need to merge two overlay blobs (fingerprint-overlay.dtbo +
> boardX.dtbo), which currently doesn't seem to be supported and which this patch
> series aims to support.

If I understood you right, you want in your "feature" overlay to
depend on nodes that are only defined in your board overlay?

If so, why not simply merge the __symbols__ node when we apply an
overlay with the base tree, and just call fdt_apply_overlay as many
times as needed?

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux