diff options
author | Simon Glass <sjg@chromium.org> | 2021-08-01 18:54:18 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-09-13 18:23:13 -0400 |
commit | b717f2f2d18e630f276cce524d4d22152ada501b (patch) | |
tree | 43033b4414539f8947508b624ca65ce62ddff24d | |
parent | 26543cc6fa69adb65cd40657d4ddb8ea9b1ba9d5 (diff) | |
download | u-boot-b717f2f2d18e630f276cce524d4d22152ada501b.zip u-boot-b717f2f2d18e630f276cce524d4d22152ada501b.tar.gz u-boot-b717f2f2d18e630f276cce524d4d22152ada501b.tar.bz2 |
pci: Drop DM_PCI check from fdtdec
We don't need this check anymore since when PCI is enabled, driver model
is always used.
Sadly this doesn't work with nds32 for some reason to do with the
toolchain. Add a work-around for that.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | lib/fdtdec.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 337c444..7358cb6 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -190,7 +190,6 @@ fdt_addr_t fdtdec_get_addr(const void *blob, int node, const char *prop_name) return fdtdec_get_addr_size(blob, node, prop_name, NULL); } -#if CONFIG_IS_ENABLED(PCI) && defined(CONFIG_DM_PCI) int fdtdec_get_pci_vendev(const void *blob, int node, u16 *vendor, u16 *device) { const char *list, *end; @@ -238,7 +237,15 @@ int fdtdec_get_pci_bar32(const struct udevice *dev, struct fdt_pci_addr *addr, return -EINVAL; barnum = (barnum - PCI_BASE_ADDRESS_0) / 4; + + /* + * There is a strange toolchain bug with nds32 which complains about + * an undefined reference here, even if fdtdec_get_pci_bar32() is never + * called. An #ifdef seems to be the only fix! + */ +#if !IS_ENABLED(CONFIG_NDS32) *bar = dm_pci_read_bar32(dev, barnum); +#endif return 0; } @@ -258,7 +265,6 @@ int fdtdec_get_pci_bus_range(const void *blob, int node, return 0; } -#endif uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name, uint64_t default_val) |