]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - lib/fdtdec.c
linux_compat: handle __GFP_ZERO in kmalloc()
[karo-tx-uboot.git] / lib / fdtdec.c
index f03b231e17ac6db08e54685d8f970f061ecb0e25..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"),
@@ -56,7 +53,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(SAMSUNG_EXYNOS_DWMMC, "samsung,exynos-dwmmc"),
        COMPAT(SAMSUNG_EXYNOS_MMC, "samsung,exynos-mmc"),
        COMPAT(SAMSUNG_EXYNOS_SERIAL, "samsung,exynos4210-uart"),
-       COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686_pmic"),
+       COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686"),
        COMPAT(GENERIC_SPI_FLASH, "spi-flash"),
        COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),
        COMPAT(INFINEON_SLB9635_TPM, "infineon,slb9635-tpm"),
@@ -75,8 +72,10 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(AMS_AS3722, "ams,as3722"),
        COMPAT(INTEL_ICH_SPI, "intel,ich-spi"),
        COMPAT(INTEL_QRK_MRC, "intel,quark-mrc"),
+       COMPAT(INTEL_X86_PINCTRL, "intel,x86-pinctrl"),
        COMPAT(SOCIONEXT_XHCI, "socionext,uniphier-xhci"),
        COMPAT(COMPAT_INTEL_PCH, "intel,bd82x6x"),
+       COMPAT(COMPAT_INTEL_IRQ_ROUTER, "intel,irq-router"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
@@ -103,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);
                }
@@ -506,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);
@@ -518,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;
                }
        }
 
@@ -571,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;
        }