diff options
author | Thierry Reding <treding@nvidia.com> | 2014-08-26 17:33:54 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2014-10-11 01:07:06 +0200 |
commit | 6cdbbe34d7e3a76048cfe06f6578ed2b6ea30376 (patch) | |
tree | 840e06feb96fe4bc30bc25cb6a22d4831f5ff875 /include | |
parent | 40f1a5cf09b715af8dca1fa99419014ae44b8b2d (diff) |
fdt: Add a function to return PCI BDF triplet
The fdtdec_pci_get_bdf() function returns the bus, device, function
triplet of a PCI device by parsing the "reg" property according to the
PCI device tree binding.
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/fdtdec.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h index 8b24deb767d..99cb3538041 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -649,4 +649,15 @@ int fdt_get_named_resource(const void *fdt, int node, const char *property, const char *prop_names, const char *name, struct fdt_resource *res); +/** + * Look at the reg property of a device node that represents a PCI device + * and parse the bus, device and function number from it. + * + * @param fdt FDT blob + * @param node node to examine + * @param bdf returns bus, device, function triplet + * @return 0 if ok, negative on error + */ +int fdtdec_pci_get_bdf(const void *fdt, int node, int *bdf); + #endif |