fdt_get_by_name can be used to get some of the content of the 'reg' property
based on one of the 'reg-names' values.
When the 'reg' property have multiple values, sometimes a 'reg-names'
property is also present to represent the values.
Details
Details
- Reviewers
- None
- Group Reviewers
ARM
Tested on Pine64 with the usbphy node having reg-names for the different phys.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
I'm confused about how this function might be used. Device drivers don't directly access reg= properties in freebsd; the properties are managed by the bus and rman code. That is, if you have
reg-names = "phy_ctrl", "pmu0", "pmu1"
and you need the pmu0 registers in a driver, then you would need code something like:
int rid; if (ofw_bus_find_string_index(node, "reg-names", name, &rid) != 0) return (EINVAL); res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
Comment Actions
I didn't know that you could use rid for that. The man page isn't really clear on how it work for FDT system but now that you pointed that out it make sense.
I don't need my code now. Thanks Ian.