From f988ec09e01b54d21d1b1fa0e2b3121d926ed7df Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 9 May 2025 16:26:41 +0100 Subject: [fdt] Generalise access to "reg" property The "reg" property is also used by non-device nodes, such as the nodes describing the system memory map. Provide generalised functionality for parsing the "#address-cells", "#size-cells", and "reg" properties. Signed-off-by: Michael Brown --- src/include/ipxe/devtree.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/include/ipxe/devtree.h') diff --git a/src/include/ipxe/devtree.h b/src/include/ipxe/devtree.h index 04414f370..6e9286af4 100644 --- a/src/include/ipxe/devtree.h +++ b/src/include/ipxe/devtree.h @@ -11,6 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include #include +#include /** A devicetree device */ struct dt_device { @@ -25,18 +26,10 @@ struct dt_device { /** Driver-private data */ void *priv; - /** Number of address cells for child devices */ - uint32_t address_cells; - /** Number of size cells for child devices */ - uint32_t size_cells; + /** Register cell size specification */ + struct fdt_reg_cells regs; }; -/** Default number of address cells, if not specified */ -#define DT_DEFAULT_ADDRESS_CELLS 2 - -/** Default number of size cells, if not specified */ -#define DT_DEFAULT_SIZE_CELLS 1 - /** A devicetree driver */ struct dt_driver { /** Driver name */ -- cgit v1.2.3-55-g7522