summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-08-25 10:24:40 -0400
committerTom Rini <trini@konsulko.com>2020-08-25 13:38:29 -0400
commit9f9ecd3e4d7839e24c182fb7b24937e19b670f1b (patch)
tree4250ad58dba47ae6127d4129b9a19dc648fd064d /lib
parentec54217ddc6f52f3b7dad7a3fd6d8a3abd64ab7e (diff)
parent6944937f9c4d21f39dd257bce7b677a0f6849cea (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
- Add basic Marvell/Cavium OcteonTX/TX2 support (Suneel) - Infrastructure changes to PCI uclass to support these SoC's (Suneel) - Add PCI, MMC & watchdog driver drivers for OcteonTX/TX2 (Suneel) - Increase CONFIG_SYS_MALLOC_F_LEN for qemu-x86 (Stefan)
Diffstat (limited to 'lib')
-rw-r--r--lib/fdtdec.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 30a1c6a217..d3b22ec323 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -243,6 +243,22 @@ int fdtdec_get_pci_bar32(const struct udevice *dev, struct fdt_pci_addr *addr,
return 0;
}
+
+int fdtdec_get_pci_bus_range(const void *blob, int node,
+ struct fdt_resource *res)
+{
+ const u32 *values;
+ int len;
+
+ values = fdt_getprop(blob, node, "bus-range", &len);
+ if (!values || len < sizeof(*values) * 2)
+ return -EINVAL;
+
+ res->start = fdt32_to_cpu(*values++);
+ res->end = fdt32_to_cpu(*values);
+
+ return 0;
+}
#endif
uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name,