Merge branch '2021-10-12-assorted-fixes-and-updates'
[platform/kernel/u-boot.git] / lib / fdtdec.c
index 337c444..af92e65 100644 (file)
@@ -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)
@@ -864,50 +870,6 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int node,
        return cell;
 }
 
-int fdtdec_get_config_int(const void *blob, const char *prop_name,
-                         int default_val)
-{
-       int config_node;
-
-       debug("%s: %s\n", __func__, prop_name);
-       config_node = fdt_path_offset(blob, "/config");
-       if (config_node < 0)
-               return default_val;
-       return fdtdec_get_int(blob, config_node, prop_name, default_val);
-}
-
-int fdtdec_get_config_bool(const void *blob, const char *prop_name)
-{
-       int config_node;
-       const void *prop;
-
-       debug("%s: %s\n", __func__, prop_name);
-       config_node = fdt_path_offset(blob, "/config");
-       if (config_node < 0)
-               return 0;
-       prop = fdt_get_property(blob, config_node, prop_name, NULL);
-
-       return prop != NULL;
-}
-
-char *fdtdec_get_config_string(const void *blob, const char *prop_name)
-{
-       const char *nodep;
-       int nodeoffset;
-       int len;
-
-       debug("%s: %s\n", __func__, prop_name);
-       nodeoffset = fdt_path_offset(blob, "/config");
-       if (nodeoffset < 0)
-               return NULL;
-
-       nodep = fdt_getprop(blob, nodeoffset, prop_name, &len);
-       if (!nodep)
-               return NULL;
-
-       return (char *)nodep;
-}
-
 u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells)
 {
        u64 number = 0;