pylibfdt: expose address cells, size cells and memory reservation add/delete accessors - #190
Closed
alchark wants to merge 2 commits into
Closed
pylibfdt: expose address cells, size cells and memory reservation add/delete accessors#190alchark wants to merge 2 commits into
alchark wants to merge 2 commits into
Conversation
Finding out how many cells a node's children use for addresses and sizes currently requires calling the raw fdt_address_cells()/fdt_size_cells() wrappers with the private FdtRo._fdt buffer, as the class exposes no methods for them. Add them to FdtRo alongside the other node accessors, and test them. Signed-off-by: Alexey Charkov <alchark@flipper.net>
The memory reserve map can be read through num_mem_rsv() and get_mem_rsv(), but changing it requires calling the raw fdt_* wrappers with the private Fdt._fdt buffer, as the class exposes no methods for the write side. Add them next to the existing accessors, and test them. Signed-off-by: Alexey Charkov <alchark@flipper.net>
Owner
|
Merged, thanks (it will show as closed, not merged in github, because I merged via my private tree, not via github). |
alchark
added a commit
to flipperdevices/u-boot
that referenced
this pull request
Aug 11, 2026
Finding out how many cells a node's children use for addresses and sizes currently requires calling the raw fdt_address_cells()/fdt_size_cells() wrappers with the private FdtRo._fdt buffer, as the class exposes no methods for them. Add them to FdtRo alongside the other node accessors. This is a local addition to the imported copy of pylibfdt, to be dropped on the next resync once it lands upstream. Link: dgibson/dtc#190 Signed-off-by: Alexey Charkov <alchark@flipper.net>
alchark
added a commit
to flipperdevices/u-boot
that referenced
this pull request
Aug 11, 2026
The memory reserve map can be read through num_mem_rsv() and get_mem_rsv(), but changing it requires calling the raw fdt_* wrappers with the private Fdt._fdt buffer, as the class exposes no methods for the write side. Add them next to the existing accessors. This is a local addition to the imported copy of pylibfdt, to be dropped on the next resync once it lands upstream. Link: dgibson/dtc#190 Signed-off-by: Alexey Charkov <alchark@flipper.net>
alchark
added a commit
to flipperdevices/u-boot
that referenced
this pull request
Aug 11, 2026
When a generated FIT is used to boot Linux directly, bypassing U-Boot proper (Falcon mode), there is no runtime code to discover the kernel command line and (optional) initrd location and include them in a FDT. To facilitate easier preparation of a ready-to-boot FIT, add support for pre-patching the FDTs in a FIT with a preconfigured /chosen node including the bootargs and initrd location. Note that the initrd part needs a pylibfdt providing address_cells() and add_mem_rsv(), which the in-tree copy does, but a system one only will once the respective pull request [1] lands and gets released. Link: dgibson/dtc#190 [1] Signed-off-by: Alexey Charkov <alchark@flipper.net>
alchark
added a commit
to flipperdevices/u-boot
that referenced
this pull request
Aug 11, 2026
Finding out how many cells a node's children use for addresses and sizes currently requires calling the raw fdt_address_cells()/fdt_size_cells() wrappers with the private FdtRo._fdt buffer, as the class exposes no methods for them. Add them to FdtRo alongside the other node accessors. This is a local addition to the imported copy of pylibfdt, to be dropped on the next resync once it lands upstream. Link: dgibson/dtc#190 Signed-off-by: Alexey Charkov <alchark@flipper.net>
alchark
added a commit
to flipperdevices/u-boot
that referenced
this pull request
Aug 11, 2026
The memory reserve map can be read through num_mem_rsv() and get_mem_rsv(), but changing it requires calling the raw fdt_* wrappers with the private Fdt._fdt buffer, as the class exposes no methods for the write side. Add them next to the existing accessors. This is a local addition to the imported copy of pylibfdt, to be dropped on the next resync once it lands upstream. Link: dgibson/dtc#190 Signed-off-by: Alexey Charkov <alchark@flipper.net>
alchark
added a commit
to flipperdevices/u-boot
that referenced
this pull request
Aug 11, 2026
When a generated FIT is used to boot Linux directly, bypassing U-Boot proper (Falcon mode), there is no runtime code to discover the kernel command line and (optional) initrd location and include them in a FDT. To facilitate easier preparation of a ready-to-boot FIT, add support for pre-patching the FDTs in a FIT with a preconfigured /chosen node including the bootargs and initrd location. Note that the initrd part needs a pylibfdt providing address_cells() and add_mem_rsv(), which the in-tree copy does, but a system one only will once the respective pull request [1] lands and gets released. Link: dgibson/dtc#190 [1] Signed-off-by: Alexey Charkov <alchark@flipper.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the access to address-cells/size cells requires poking into the FdtRo._fdt private buffer. Similarly, adding or deleting memory reservations requires poking into the Fdt._fdt private buffer.
This complicates things such as inserting a /chosen node with a pre-set kernel command line and initrd location/size properties into an existing device tree (as is required for preparing a device tree blob for booting with no runtime patching by a bootloader, e.g. using U-Boot's Falcon mode), so add public accessors for these.