summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/devtree.h
diff options
context:
space:
mode:
authorMichael Brown2025-06-11 13:51:56 +0200
committerMichael Brown2025-06-11 14:02:20 +0200
commitc4a3d438e642e8692e6a94e7d4db75d75744e73f (patch)
tree54f216ad2468de4416251f827ed10f003f8e6714 /src/include/ipxe/devtree.h
parent[ipv4] Add support for classless static routes (diff)
downloadipxe-c4a3d438e642e8692e6a94e7d4db75d75744e73f.tar.gz
ipxe-c4a3d438e642e8692e6a94e7d4db75d75744e73f.tar.xz
ipxe-c4a3d438e642e8692e6a94e7d4db75d75744e73f.zip
[dt] Allow for creation of standalone devices
We will want to be able to create the console device as early as possible. Refactor devicetree probing to remove the assumption that a devicetree device must have a devicetree parent, and expose functions to allow a standalone device to be created given only the offset of a node within the tree. The full device path is no longer trivial to construct with this assumption removed. The full path is currently used only for debug messages. Remove the stored full path, use just the node name for debug messages, and ensure that the topology information previously visible in the full path is reconstructible from the combined debug output if needed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/devtree.h')
-rw-r--r--src/include/ipxe/devtree.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/ipxe/devtree.h b/src/include/ipxe/devtree.h
index 46d8b5d86..cdf173938 100644
--- a/src/include/ipxe/devtree.h
+++ b/src/include/ipxe/devtree.h
@@ -15,12 +15,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/** A devicetree device */
struct dt_device {
+ /** Device name */
+ const char *name;
/** Generic device */
struct device dev;
/** DMA device */
struct dma_device dma;
- /** Device path */
- const char *path;
/** Driver for this device */
struct dt_driver *driver;
/** Driver-private data */
@@ -79,5 +79,7 @@ static inline void * dt_get_drvdata ( struct dt_device *dt ) {
extern void * dt_ioremap ( struct dt_device *dt, unsigned int offset,
unsigned int index, size_t len );
+extern int dt_probe_node ( struct device *parent, unsigned int offset );
+extern void dt_remove_node ( struct device *parent );
#endif /* _IPXE_DEVTREE_H */