powerpc/mpc85xx: Correct CONFIG_USB_MAX_CONTROLLER_COUNT for p1025
[oweals/u-boot.git] / lib / fdtdec.c
index 46dfcb675ccc54c454fe9661425c970bf2c7892d..232ca7471215aa08e47fd52b7b9d472b57f25cb7 100644 (file)
@@ -22,9 +22,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define COMPAT(id, name) name
 static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(UNKNOWN, "<none>"),
-       COMPAT(NVIDIA_TEGRA20_USB, "nvidia,tegra20-ehci"),
-       COMPAT(NVIDIA_TEGRA30_USB, "nvidia,tegra30-ehci"),
-       COMPAT(NVIDIA_TEGRA114_USB, "nvidia,tegra114-ehci"),
        COMPAT(NVIDIA_TEGRA20_EMC, "nvidia,tegra20-emc"),
        COMPAT(NVIDIA_TEGRA20_EMC_TABLE, "nvidia,tegra20-emc-table"),
        COMPAT(NVIDIA_TEGRA20_KBC, "nvidia,tegra20-kbc"),
@@ -105,8 +102,8 @@ fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
                        size = (fdt_size_t *)((char *)cell +
                                        sizeof(fdt_addr_t));
                        *sizep = fdt_size_to_cpu(*size);
-                       debug("addr=%08lx, size=%08x\n",
-                             (ulong)addr, *sizep);
+                       debug("addr=%08lx, size=%llx\n",
+                             (ulong)addr, (u64)*sizep);
                } else {
                        debug("%08lx\n", (ulong)addr);
                }
@@ -508,8 +505,7 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int offset,
                const char *prop;
                const char *name;
                const char *slash;
-               const char *p;
-               int len;
+               int len, val;
 
                prop = fdt_getprop_by_offset(blob, prop_offset, &name, &len);
                debug("   - %s, %s\n", name, prop);
@@ -520,12 +516,11 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int offset,
                slash = strrchr(prop, '/');
                if (strcmp(slash + 1, find_name))
                        continue;
-               for (p = name + strlen(name) - 1; p > name; p--) {
-                       if (!isdigit(*p)) {
-                               *seqp = simple_strtoul(p + 1, NULL, 10);
-                               debug("Found seq %d\n", *seqp);
-                               return 0;
-                       }
+               val = trailing_strtol(name);
+               if (val != -1) {
+                       *seqp = val;
+                       debug("Found seq %d\n", *seqp);
+                       return 0;
                }
        }
 
@@ -573,6 +568,13 @@ int fdtdec_prepare_fdt(void)
                puts("Missing DTB\n");
 #else
                puts("No valid device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>\n");
+# ifdef DEBUG
+               if (gd->fdt_blob) {
+                       printf("fdt_blob=%p\n", gd->fdt_blob);
+                       print_buffer((ulong)gd->fdt_blob, gd->fdt_blob, 4,
+                                    32, 0);
+               }
+# endif
 #endif
                return -1;
        }