summaryrefslogtreecommitdiffstats
path: root/src/tests/fdt_test.c
Commit message (Collapse)AuthorAgeFilesLines
* [fdt] Use phandle as device locationMichael Brown2025-08-041-9/+10
| | | | | | | | | | | | | 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>
* [fdt] Add ability to locate node by phandleMichael Brown2025-07-221-65/+78
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Allow paths and aliases to be terminated with separator charactersMichael Brown2025-06-111-0/+7
| | | | | | | | | | | | | | Non-permitted name characters such as a colon are sometimes used to separate alias names or paths from additional metadata, such as the baud rate for a UART in the "/chosen/stdout-path" property. Support the use of such alias names and paths by allowing any character not permitted in a property name to terminate a property or node name match. (This is a very relaxed matching rule that will produce false positive matches on invalid input, but this is unlikely to cause problems in practice.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Provide ability to locate the parent device nodeMichael Brown2025-05-301-0/+12
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Add tests for device tree creationMichael Brown2025-05-301-0/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Add fdt_cells() to read cell-based properties such as "reg"Michael Brown2025-04-151-33/+61
| | | | | | | | Add fdt_cells() to read scalar values encoded within a cell array, reimplement fdt_u64() as a wrapper around this, and add fdt_u32() for completeness. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Remove concept of a device tree cursorMichael Brown2025-04-141-0/+14
| | | | | | | | Refactor device tree traversal to operate on the basis of describing the token at a given offset, with no separate notion of a device tree cursor. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fdt] Add basic tests for reading values from a flattened device treeMichael Brown2025-04-141-0/+227
Signed-off-by: Michael Brown <mcb30@ipxe.org>