ARM/u-boot: Add support for FDTs passed in the uImage

Since we're using multi-part uImage format, we can add the FDT as
a seperate "blob" in the uImage, if the used U-Boot version is not
"FDT enabled".

This is used for example for our Verdex target. Currently I've got
a local hack in the platform/u-boot/Jamfile, looking into pulling
in the FDT files and a proper Jam setup to do that properly...
This commit is contained in:
Ithamar R. Adema
2012-11-13 12:27:11 +01:00
parent 6645e68bb0
commit 344b3218d4
2 changed files with 24 additions and 0 deletions
@@ -12,6 +12,8 @@
struct platform_stage2_args {
void *boot_tgz_data;
uint32 boot_tgz_size;
void *fdt_data;
uint32 fdt_size;
};
#endif /* KERNEL_BOOT_PLATFORM_UBOOT_STAGE2_H */
+22
View File
@@ -172,11 +172,33 @@ start_raw(int argc, const char **argv)
args.arguments = NULL;
args.platform.boot_tgz_data = NULL;
args.platform.boot_tgz_size = 0;
args.platform.fdt_data = NULL;
args.platform.fdt_size = 0;
// if we get passed a uimage, try to find the third blob only if we do not have FDT data yet
if (gUImage != NULL
&& !gFDT
&& image_multi_getimg(gUImage, 2,
(uint32*)&args.platform.fdt_data,
&args.platform.fdt_size)) {
// found a blob, assume it is FDT data, when working on a platform
// which does not have an FDT enabled U-Boot
gFDT = args.platform.fdt_data;
}
serial_init(gFDT);
console_init();
cpu_init();
if (args.platform.fdt_data) {
dprintf("Found FDT from uimage @ %p, %" B_PRIu32 " bytes\n",
args.platform.fdt_data, args.platform.fdt_size);
} else if (gFDT) {
/* Fixup args so we can pass the gFDT on to the kernel */
args.platform.fdt_data = gFDT;
args.platform.fdt_size = fdt_totalsize(gFDT);
}
// if we get passed an FDT, check /chosen for initrd
if (gFDT != NULL) {
int node = fdt_path_offset(gFDT, "/chosen");