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:
@@ -12,6 +12,8 @@
|
|||||||
struct platform_stage2_args {
|
struct platform_stage2_args {
|
||||||
void *boot_tgz_data;
|
void *boot_tgz_data;
|
||||||
uint32 boot_tgz_size;
|
uint32 boot_tgz_size;
|
||||||
|
void *fdt_data;
|
||||||
|
uint32 fdt_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* KERNEL_BOOT_PLATFORM_UBOOT_STAGE2_H */
|
#endif /* KERNEL_BOOT_PLATFORM_UBOOT_STAGE2_H */
|
||||||
|
|||||||
@@ -172,11 +172,33 @@ start_raw(int argc, const char **argv)
|
|||||||
args.arguments = NULL;
|
args.arguments = NULL;
|
||||||
args.platform.boot_tgz_data = NULL;
|
args.platform.boot_tgz_data = NULL;
|
||||||
args.platform.boot_tgz_size = 0;
|
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);
|
serial_init(gFDT);
|
||||||
console_init();
|
console_init();
|
||||||
cpu_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 we get passed an FDT, check /chosen for initrd
|
||||||
if (gFDT != NULL) {
|
if (gFDT != NULL) {
|
||||||
int node = fdt_path_offset(gFDT, "/chosen");
|
int node = fdt_path_offset(gFDT, "/chosen");
|
||||||
|
|||||||
Reference in New Issue
Block a user