puts(" - must RESET the board to recover.\n");
}
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
static const image_header_t *image_get_fdt(ulong fdt_addr)
{
const image_header_t *fdt_hdr = map_sysmem(fdt_addr, 0);
}
return fdt_hdr;
}
+#endif
/**
* boot_fdt_add_mem_rsv_regions - Mark the memreserve sections as unusable
int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
bootm_headers_t *images, char **of_flat_tree, ulong *of_size)
{
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
const image_header_t *fdt_hdr;
+ ulong load, load_end;
+ ulong image_start, image_data, image_end;
+#endif
ulong fdt_addr;
char *fdt_blob = NULL;
- ulong image_start, image_data, image_end;
- ulong load, load_end;
void *buf;
#if defined(CONFIG_FIT)
const char *fit_uname_config = images->fit_uname_cfg;
*/
buf = map_sysmem(fdt_addr, 0);
switch (genimg_get_format(buf)) {
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
case IMAGE_FORMAT_LEGACY:
/* verify fdt_addr points to a valid image header */
printf("## Flattened Device Tree from Legacy Image at %08lx\n",
fdt_addr = load;
break;
+#endif
case IMAGE_FORMAT_FIT:
/*
* This case will catch both: new uImage format
ulong load, len;
fdt_noffset = fit_image_load(images,
- FIT_FDT_PROP,
fdt_addr, &fit_uname_fdt,
&fit_uname_config,
arch, IH_TYPE_FLATDT,
return 1;
}
-__weak int arch_fixup_memory_node(void *blob)
+__weak int arch_fixup_fdt(void *blob)
{
return 0;
}
ulong *initrd_end = &images->initrd_end;
int ret;
- if (fdt_chosen(blob, 1) < 0) {
+ if (fdt_chosen(blob) < 0) {
puts("ERROR: /chosen node create failed");
puts(" - must RESET the board to recover.\n");
return -1;
}
- arch_fixup_memory_node(blob);
- if (IMAAGE_OF_BOARD_SETUP)
+ if (arch_fixup_fdt(blob) < 0) {
+ puts("ERROR: arch specific fdt fixup failed");
+ return -1;
+ }
+ if (IMAGE_OF_BOARD_SETUP)
ft_board_setup(blob, gd->bd);
fdt_fixup_ethernet(blob);
lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
(phys_size_t)fdt_totalsize(blob));
- ret = fdt_resize(blob);
+ ret = fdt_shrink_to_minimum(blob);
if (ret < 0)
return ret;
of_size = ret;
/* Create a new LMB reservation */
lmb_reserve(lmb, (ulong)blob, of_size);
- fdt_initrd(blob, *initrd_start, *initrd_end, 1);
+ fdt_initrd(blob, *initrd_start, *initrd_end);
if (!ft_verify_fdt(blob))
return -1;
+#if defined(CONFIG_SOC_KEYSTONE)
+ if (IMAGE_OF_BOARD_SETUP)
+ ft_board_setup_ex(blob, gd->bd);
+#endif
+
return 0;
}