summaryrefslogtreecommitdiffstats
path: root/src/drivers/bus/devtree.c
Commit message (Collapse)AuthorAgeFilesLines
* [fdt] Provide fdt_reg() for unsized single-entry regionsMichael Brown2025-08-071-7/+3Star
| | | | | | | | Many region types (e.g. I2C bus addresses) can only ever contain a single region with no size cells specified. Provide fdt_reg() to reduce boilerplate in this common use case. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dwgpio] Add driver for the DesignWare GPIO controllerMichael Brown2025-08-051-5/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Use phandle as device locationMichael Brown2025-08-041-0/+1
| | | | | | | | | | | | | Consumption of phandles will be in the form of locating a functional device (e.g. a GPIO device, or an I2C device, or a reset controller) by phandle, rather than locating the device tree node to which the phandle refers. Repurpose fdt_phandle() to obtain the phandle value (instead of searching by phandle), and record this value as the bus location within the generic device structure. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dt] Allow for creation of standalone devicesMichael Brown2025-06-111-59/+52Star
| | | | | | | | | | | | | | | | | 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>
* [dt] Locate parent node at point of use in dt_ioremap()Michael Brown2025-05-301-9/+15
| | | | | | | | | | | | We currently rely on the recursive nature of devicetree bus probing to obtain the region cell size specification from the parent device. This blocks the possibility of creating a standalone console device based on /chosen/stdout-path before probing the whole bus. Fix by using fdt_parent() to locate the parent device at the point of use within dt_ioremap(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Generalise access to "reg" propertyMichael Brown2025-05-091-16/+7Star
| | | | | | | | | | 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 <mcb30@ipxe.org>
* [uaccess] Remove redundant copy_from_user() and copy_to_user()Michael Brown2025-04-301-0/+1
| | | | | | | Remove the now-redundant copy_from_user() and copy_to_user() wrapper functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dt] Provide dt_ioremap() to map device registersMichael Brown2025-04-151-0/+75
| | | | | | | | | | | | | Devicetree devices encode register address ranges within the "reg" property, with the number of cells used for addresses and for sizes determined by the #address-cells and #size-cells properties of the immediate parent device. Record the number of address and size cells for each device, and provide a dt_ioremap() function to allow drivers to map a specified range without having to directly handle the "reg" property. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dt] Add basic concept of a devicetree busMichael Brown2025-04-141-0/+297
Add a basic model for devices instantiated by parsing the system flattened device tree, with drivers matched via the "compatible" property for any non-root node. Signed-off-by: Michael Brown <mcb30@ipxe.org>