diff options
author | Michael Tretter <m.tretter@pengutronix.de> | 2019-09-13 15:14:39 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-09-16 09:06:18 +0200 |
commit | bbd241efa5ae048cd7a96c5b232e729b9180e6f2 (patch) | |
tree | 90f8e634f9e40ef6dc3d2be4aec722afbe182399 /include | |
parent | fd72834fa74b604efc7b2af5f40ccab5796b79e7 (diff) | |
download | barebox-bbd241efa5ae048cd7a96c5b232e729b9180e6f2.tar.gz barebox-bbd241efa5ae048cd7a96c5b232e729b9180e6f2.tar.xz |
of: add support for devicetree overlays
The devicetree overlay support is based on the Linux driver for device
tree overlays, but many features that are not required in Barebox are
left out.
Unlike Linux, which applies the overlay to the live devicetree, Barebox
registers a fixup for the overlay which is applied with other fixups to
whatever tree is fixed. This is necessary to apply the overlay to
devicetrees that are passed to Linux, which might differ from the
devicetree that is currently live in Barebox.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/of.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/of.h b/include/of.h index b5f54dd4e5..1483c22db1 100644 --- a/include/of.h +++ b/include/of.h @@ -870,4 +870,31 @@ static inline struct device_node *of_find_root_node(struct device_node *node) return node; } + +#ifdef CONFIG_OF_OVERLAY +struct device_node *of_resolve_phandles(struct device_node *root, + const struct device_node *overlay); +int of_overlay_apply_tree(struct device_node *root, + struct device_node *overlay); +int of_register_overlay(struct device_node *overlay); +#else +static inline struct device_node *of_resolve_phandles(struct device_node *root, + const struct device_node *overlay) +{ + return NULL; +} + +static inline int of_overlay_apply_tree(struct device_node *root, + struct device_node *overlay) +{ + return -ENOSYS; +} + +static inline int of_register_overlay(struct device_node *overlay) +{ + return -ENOSYS; +} + +#endif + #endif /* __OF_H */ |