[U-Boot-Users] [PATCH] FIT: Fix handling of images without ramdisks

Michal Simek monstr at seznam.cz
Thu Aug 7 08:48:44 CEST 2008


Hi Peter,


> I've included my kernel_fdt.its below as well as 2 boot attempts with
> some debug enabled - the 1st on without the patch, the 2nd with the
> patch.  I'm using the mainline master (based on
> 1953d128fd07f07d1c3810a28c0863ea64dae1b6), not the 85xx repo, but I
> believe the problem exists in both repos.

OK. I will test it today and send you my result.

> Conceptually, I believe the patch makes sense.  I'm calling bootm with
> no arguments (as seen in the FIT howto.txt), so boot_get_ramdisk() is
> unconditionally called by do_bootm_linux().  With no command arguments
> and a FIT image this section of code in boot_get_ramdisk() gets called:
> 
> rd_noffset = fit_conf_get_ramdisk_node (fit_hdr, cfg_noffset);
> if (rd_noffset < 0) {
> 	debug ("*  ramdisk: no ramdisk in config\n");
> 	return 1;
> }
> 
> which returns 1 causing the calling code from do_bootm_linux() to error
> out:
> 
> /* find ramdisk */
> ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_PPC,
> 	&rd_data_start, &rd_data_end);
> if (ret)
> 	goto error;

I'll look at it in detail. Please wait some hours.


> Did you by chance try testing a PPC board?  I noticed the
> boot_get_ramdisk() call is not used for microblaze.

Sorry but I don't have any ppc board.
Yes, it is but this code is not in master or microblaze branch but I sent first
patch to mailing list some week ago.

Regards,
Michal

> Thanks!
> Peter
> 
> 
>>> Contents of kernel_fdt.its
>>>
> 
> / {
> 	description = "Basic image with single Linux kernel and FDT blob";
> 	#address-cells = <1>;
> 
> 	images {
> 		kernel at 1 {
> 			description = "X-ES MPC8572 Kernel v2.6.23";
> 			data = /incbin/("./vmlinux.bin.gz");
> 			type = "kernel";
> 			arch = "ppc";
> 			os = "linux";
> 			compression = "gzip";
> 			load = <00000000>;
> 			entry = <00000000>;
> 			hash at 1 {
> 				algo = "crc32";
> 			};
> 		};
> 		fdt at 1 {
> 			description = "Flattened Device Tree blob";
> 			data = /incbin/("./xpedite5370.dtb");
> 			type = "flat_dt";
> 			arch = "ppc";
> 			load = <00c00000>;
> 			compression = "none";
> 			hash at 1 {
> 				algo = "crc32";
> 			};
> 		};
> 	};
> 
> 	configurations {
> 		default = "conf at 1";
> 		conf at 1 {
> 			description = "Boot Linux kernel with FDT blob";
> 			kernel = "kernel at 1";
> 			fdt = "fdt at 1";
> 		};
> 	};
> };
> 
>>> Without the patch applied
>>>
> 
> => imi
> 
> ## Checking Image at 01000000 ...
>    FIT image found
>    FIT description: Basic image with single Linux kernel and FDT blob
>    Created:         2008-08-06  20:47:47 UTC
>     Image 0 (kernel at 1)
>      Description:  X-ES MPC8572 Kernel v2.6.23
>      Type:         Kernel Image
>      Compression:  gzip compressed
>      Data Start:   0x010000f0
>      Data Size:    3947406 Bytes =  3.8 MB
>      Architecture: PowerPC
>      OS:           Linux
>      Load Address: 0x00000000
>      Entry Point:  0x00000000
>      Hash node:    'hash at 1'
>      Hash algo:    crc32
>      Hash value:   10a29645
>      Hash len:     4
>     Image 1 (fdt at 1)
>      Description:  Flattened Device Tree blob
>      Type:         Flat Device Tree
>      Compression:  uncompressed
>      Data Start:   0x013c3d64
>      Data Size:    9628 Bytes =  9.4 kB
>      Architecture: PowerPC
>      Hash node:    'hash at 1'
>      Hash algo:    crc32
>      Hash value:   b351fc1d
>      Hash len:     4
>     Default Configuration: 'conf at 1'
>     Configuration 0 (conf at 1)
>      Description:  Boot Linux kernel with FDT blob
>      Kernel:       kernel at 1
>      FDT:          fdt at 1
> => bootm
> *  kernel: default image load address = 0x01000000
> ## Booting kernel from FIT Image at 01000000 ...
> No configuration specified, trying default...
> Found default configuration: 'conf at 1'
>    Using 'conf at 1' configuration
>    Trying 'kernel at 1' kernel subimage
>      Description:  X-ES MPC8572 Kernel v2.6.23
>      Type:         Kernel Image
>      Compression:  gzip compressed
>      Data Start:   0x010000f0
>      Data Size:    3947406 Bytes =  3.8 MB
>      Architecture: PowerPC
>      OS:           Linux
>      Load Address: 0x00000000
>      Entry Point:  0x00000000
>      Hash node:    'hash at 1'
>      Hash algo:    crc32
>      Hash value:   10a29645
>      Hash len:     4
>    Verifying Hash Integrity ... crc32+ OK
>    kernel data at 0x010000f0, len = 0x003c3b8e (3947406)
>    Uncompressing Kernel Image ... OK
>    kernel loaded at 0x00000000, end = 0x0060d55c
> WARNING: bootm_low + bootm_size exceed eff. memory
> WARNING: adjusting available memory to 10000000
> ## Current stack ends at 0x0fe97bf8
> *  fdt: using config 'conf at 1' from image at 0x01000000
> ## Checking for 'FDT'/'FDT Image' at 01000000
> ## Flattened Device Tree from FIT Image at 01000000
>    Using 'conf at 1' configuration
>    Trying 'fdt at 1' FDT blob subimage
>      Description:  Flattened Device Tree blob
>      Type:         Flat Device Tree
>      Compression:  uncompressed
>      Data Start:   0x013c3d64
>      Data Size:    9628 Bytes =  9.4 kB
>      Architecture: PowerPC
>      Hash node:    'hash at 1'
>      Hash algo:    crc32
>      Hash value:   b351fc1d
>      Hash len:     4
>    Verifying Hash Integrity ... crc32+ OK
>    Loading FDT from 0x013c3d64 to 0x00c00000
>    Booting using the fdt blob at 0xc00000
>    of_flat_tree at 0x00c00000 size 0x0000259c
> *  ramdisk: using config 'conf at 1' from image at 0x01000000
> *  ramdisk: no ramdisk in config
> 
> <<<< board resets here >>>>
> 
> U-Boot 1.3.4-xes_r1-dirty (Aug  6 2008 - 15:42:12)
> 
> 
> 
>>> After applying the patch
>>>
> 
> => bootm
> *  kernel: default image load address = 0x01000000
> ## Booting kernel from FIT Image at 01000000 ...
> No configuration specified, trying default...
> Found default configuration: 'conf at 1'
>    Using 'conf at 1' configuration
>    Trying 'kernel at 1' kernel subimage
>      Description:  X-ES MPC8572 Kernel v2.6.23
>      Type:         Kernel Image
>      Compression:  gzip compressed
>      Data Start:   0x010000f0
>      Data Size:    3947406 Bytes =  3.8 MB
>      Architecture: PowerPC
>      OS:           Linux
>      Load Address: 0x00000000
>      Entry Point:  0x00000000
>      Hash node:    'hash at 1'
>      Hash algo:    crc32
>      Hash value:   10a29645
>      Hash len:     4
>    Verifying Hash Integrity ... crc32+ OK
>    kernel data at 0x010000f0, len = 0x003c3b8e (3947406)
>    Uncompressing Kernel Image ... OK
>    kernel loaded at 0x00000000, end = 0x0060d55c
> WARNING: bootm_low + bootm_size exceed eff. memory
> WARNING: adjusting available memory to 10000000
> ## Current stack ends at 0x0fe97bf8
> *  fdt: using config 'conf at 1' from image at 0x01000000
> ## Checking for 'FDT'/'FDT Image' at 01000000
> ## Flattened Device Tree from FIT Image at 01000000
>    Using 'conf at 1' configuration
>    Trying 'fdt at 1' FDT blob subimage
>      Description:  Flattened Device Tree blob
>      Type:         Flat Device Tree
>      Compression:  uncompressed
>      Data Start:   0x013c3d64
>      Data Size:    9628 Bytes =  9.4 kB
>      Architecture: PowerPC
>      Hash node:    'hash at 1'
>      Hash algo:    crc32
>      Hash value:   b351fc1d
>      Hash len:     4
>    Verifying Hash Integrity ... crc32+ OK
>    Loading FDT from 0x013c3d64 to 0x00c00000
>    Booting using the fdt blob at 0xc00000
>    of_flat_tree at 0x00c00000 size 0x0000259c
> *  ramdisk: using config 'conf at 1' from image at 0x01000000
> *  ramdisk: no ramdisk in config
> calling ft_cpu_setup()
> ## initrd_high = 0xffffffff, copy_to_ram = 1
>    ramdisk load start = 0x00000000, ramdisk load end = 0x00000000
> ## Transferring control to Linux (at address 00000000) ...
>    Booting using OF flat tree...
> Using X-ES MPC85xx machine description
> 
> <<<< Linux boots normally >>>>
> 
> 
> 
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.138 / Virus Database: 270.5.12/1589 - Release Date: 3.8.2008 01:00
> 
> 
> 




More information about the U-Boot mailing list