spl: Init proper struct driver member (platdata_auto_alloc_size) for mxs_spi
[oweals/u-boot.git] / lib / fdtdec.c
index ef5e54875c948629c7d8b5ab8a93bb3015c448ec..74430c8b2ffd219fd0b1099177f4ca4503eecaac 100644 (file)
@@ -217,7 +217,7 @@ int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type,
                        if ((fdt32_to_cpu(*cell) & type) == type) {
                                addr->phys_hi = fdt32_to_cpu(cell[0]);
                                addr->phys_mid = fdt32_to_cpu(cell[1]);
-                               addr->phys_lo = fdt32_to_cpu(cell[1]);
+                               addr->phys_lo = fdt32_to_cpu(cell[2]);
                                break;
                        }
 
@@ -1535,16 +1535,14 @@ int fdtdec_setup(void)
                puts("Failed to read control FDT\n");
                return -1;
        }
+# elif defined(CONFIG_OF_PRIOR_STAGE)
+       gd->fdt_blob = (void *)prior_stage_fdt_address;
 # endif
 # ifndef CONFIG_SPL_BUILD
        /* Allow the early environment to override the fdt address */
-#  if CONFIG_IS_ENABLED(OF_PRIOR_STAGE)
-       gd->fdt_blob = (void *)prior_stage_fdt_address;
-#  else
        gd->fdt_blob = map_sysmem
                (env_get_ulong("fdtcontroladdr", 16,
                               (unsigned long)map_to_sysmem(gd->fdt_blob)), 0);
-#  endif
 # endif
 
 # if CONFIG_IS_ENABLED(MULTI_DTB_FIT)