
On 13/12/2011 11:20, Simon Schwarz wrote:
From: Simon Schwarz simonschwarzcor@googlemail.com
This adds Linux booting to the SPL
This depends on CONFIG_MACH_TYPE patch by Igor Grinberg (http://article.gmane.org/gmane.comp.boot-loaders.u-boot/105809)
Related CONFIGs: CONFIG_SPL_OS_BOOT Activates/Deactivates the OS booting feature CONFIG_SPL_OS_BOOT_KEY defines the IO-pin number u-boot switch - if pressed u-boot is booted CONFIG_SYS_NAND_SPL_KERNEL_OFFS Offset in NAND of direct boot kernel image to use in SPL CONFIG_SYS_SPL_ARGS_ADDR Address where the kernel boot arguments are expected - this is normaly RAM-begin + 0x100
Signed-off-by: Simon Schwarz simonschwarzcor@gmail.com
Hi Simon and Myself (as I will continue Simon's work),
void spl_nand_load_image(void) { struct image_header *header; @@ -50,7 +49,7 @@ void spl_nand_load_image(void) /*use CONFIG_SYS_TEXT_BASE as temporary storage area */ header = (struct image_header *)(CONFIG_SYS_TEXT_BASE); #ifdef CONFIG_SPL_OS_BOOT
- if (!spl_uboot_key()) {
- if (!spl_start_uboot()) { /*
- load parameter image
- load to temp position since nand_spl_load_image reads
@@ -74,9 +73,17 @@ void spl_nand_load_image(void) nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS, CONFIG_SYS_NAND_PAGE_SIZE, (void *)header); spl_parse_image_header(header);
nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
spl_image.size, (void *)spl_image.load_addr);
- } else
if (header->ih_os == IH_OS_LINUX) {
/* happy - was a linux */
nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
spl_image.size, (void *)spl_image.load_addr);
From my test I found a bug here. The image is loaded, but because we do
not return from function, code goes on and loads u-boot, too. As result, u-boot instead of linux is always started.
If I am not overseeing something, I'll fix in next version.
} else {
printf("The Expected Linux image was not"
"found. Please check your NAND"
"configuration.\n");
printf("Trying to start u-boot now...\n");
}
- }
#endif {
in fact we have not anymore the "else" branch, and now u-boot is loaded.
Regards, Stefano