diff options
author | Simon Glass <sjg@chromium.org> | 2022-09-06 20:27:25 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-29 22:43:43 -0400 |
commit | 41b65d68ec324d9c75dcfe6e1b34fef077b4b87a (patch) | |
tree | b13489945c63cc85fbeb5ca03382524eeed8e8af /drivers/core | |
parent | b7bd94f1a8a63cd4f947036e0d42ee2e23852d64 (diff) | |
download | u-boot-41b65d68ec324d9c75dcfe6e1b34fef077b4b87a.tar.gz u-boot-41b65d68ec324d9c75dcfe6e1b34fef077b4b87a.tar.bz2 u-boot-41b65d68ec324d9c75dcfe6e1b34fef077b4b87a.zip |
dm: core: Add definitions for multiple ofnode trees
At present, unless OF_LIVE is enabled, ofnode only supports access to one
device tree, the control FDT. This is because only the node offset is
encoded in ofnode, with the tree being implicit.
This makes ofnode (without OF_LIVE) unsuitable for device tree fixups, as
implemented by ft_board_setup() and other such functions.
To solve this, we can use the top bits of the node offset to hold a tree
ID.
Add the definitions for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r-- | drivers/core/Kconfig | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 007dc6a1de..c9bf5de433 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -400,6 +400,30 @@ config DM_DEV_READ_INLINE bool default y if !OF_LIVE +config OFNODE_MULTI_TREE + bool "Allow the ofnode interface to access any tree" + default y if EVENT && !DM_DEV_READ_INLINE && !DM_INLINE_OFNODE + help + Normally U-Boot makes use of its control FDT, the one used to bind + devices and provide options. In some cases, U-Boot must also process + a separate FDT, e.g. one provided by the operating system, which + needs additions to the /chosen node. + + This works fine with live tree (OF_LIVE), but with flat tree the + offset provided in ofnode is only useful with the control FDT. This + option adds a 'tree ID' to the offset, so that multiple trees can + be used. Call oftree_from_fdt() to register a new tree. + +config OFNODE_MULTI_TREE_MAX + int "Maximum number of FDTs" + range 2 8 + depends on OFNODE_MULTI_TREE + default 4 + help + Sets the maximum number of device trees which can be used with the + ofnode interface when using flat trees (OF_LIVE). This is only + available in U-Boot proper and only after relocation. + config ACPIGEN bool "Support ACPI table generation in driver model" default y if SANDBOX || (GENERATE_ACPI_TABLE && !QEMU) |