Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

u-boot multi image

Altera_Forum
Honored Contributor II
1,472 Views

Hello, 

 

Has anyone successfully used a u-boot Multi image to boot into Linux? 

 

I have zImage, initrd, and dtb that I want put into the image. My attempts so far have always resulted in: 

 

SOCFPGA_CYCLONE5# fatload mmc 0 0x2000000 zzzmultiimage 

reading zzzmultiimage 

31098855 bytes read in 2718 ms (10.9 MiB/s) 

SOCFPGA_CYCLONE5# bootm 0x2000000 

## Booting kernel from Legacy Image at 02000000 ... 

Image Name: Multi image 

Image Type: ARM Linux Multi-File Image (gzip compressed) 

Data Size: 31098791 Bytes = 29.7 MiB 

Load Address: 00008000 

Entry Point: 00008000 

Contents: 

Image 0: 3407918 Bytes = 3.3 MiB 

Image 1: 27671672 Bytes = 26.4 MiB 

Image 2: 19183 Bytes = 18.7 KiB 

## Loading init Ramdisk from multi component Legacy Image at 02000000 ... 

## Flattened Device Tree from multi component Image at 02000000 

Booting using the fdt at 0x03da3cf8 

Uncompressing Multi-File Image ... Error: Bad gzipped data 

GUNZIP: uncompress, out-of-mem or overwrite error - must RESET board to recover 

resetting .. 

 

 

I have tried a range of load addresses (0x2000000 pictured above), all get the same message. 

 

I build the multi-image on the workstation using: 

 

mkimage -A arm -O linux -T multi -a 0x8000 -e 0x8000 -C gzip -n 'Multi image' -d uImage:uRamdiskExt3ARM:socfpga_cyclone5_sockit.dtb zzzMultiImage 

 

The .dtb comes straight from the kernel build.  

 

For the uImage I have tried: 

 

  • using the zImage straight from the kernel build, 

  • the zImage wrapped by mkimage with: 

 

mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux kernel" -d zImage uImage 

 

  • the Image straight from the kernel build, compressed with gzip -9, and then wrapped by mkimage with: 

 

mkimage -n 'Linux' -A arm -O linux -T kernel -C gzip -a 0x80008000 -e 0x80008000 -d Image.gz uImage 

 

The uRamdisk is a compressed ext3, wrapped by mkimage with: 

mkimage -n "ModulesAdded,Compressed" -A arm -O linux -T ramdisk -C gzip -d rootfs.ext3.gz uRamdiskExt3ARM 

 

 

If I use the components separately (zImage, uRamdiskExt3ARM, sockit.dtb) along with bootz, then all boots fine. 

 

If anyone has gotten multi-image to work, please give me hint or some details about what you did to get it working. 

 

 

Thanks!!! 

--George Broz 

Moog Industrial Group
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
449 Views

Solution for anyone else down this path: 

 

None of the components inside the multi-image are wrapped with mkImage. 

* The Linux kernel image is just the plain 'Image' generated by the kernel build, zipped with gzip -v9 Image. 

* The initrd is just a plain ol' ext3.gz 

* The dtb is also that generated by the kernel build. 

 

Put them together with: 

mkimage -A arm -O linux -T multi -a 0x8000 -e 0x8000 -C gzip -n 'Multi image: kernel, initrd, dtb' -d Image.gz:rootfs.ext3.gz:socfpga_cyclone5_sockit.dtb mxImage 

 

And to boot this on the target: 

# fatload mmc 0 0x2000000 mxImage 

# env set initrd_high 20000000 

# env set bootargs console=ttyS0,115200 root=/dev/ram rw rootwait ramdisk_size=262144  

# bootm 0x2000000 

 

and you are off and running.... 

 

Environment size: 2124/4092 bytes 

SOCFPGA_CYCLONE5# bootm 0x2000000 

# # Booting kernel from Legacy Image at 02000000 ... 

Image Name: Multi image 

Image Type: ARM Linux Multi-File Image (gzip compressed) 

Data Size: 31098663 Bytes = 29.7 MiB 

Load Address: 00008000 

Entry Point: 00008000 

Contents: 

Image 0: 3407854 Bytes = 3.2 MiB 

Image 1: 27671608 Bytes = 26.4 MiB 

Image 2: 19183 Bytes = 18.7 KiB 

# # Loading init Ramdisk from multi component Legacy Image at 02000000 ... 

# # Flattened Device Tree from multi component Image at 02000000 

Booting using the fdt at 0x03da3c78 

Uncompressing Multi-File Image ... OK 

reserving fdt memory region: addr=0 size=1000 

Loading Ramdisk to 1e59c000, end 1ffffc38 ... OK 

Loading Device Tree to 03ff8000, end 03fffaee ... OK 

 

Starting kernel ... <snip> 

 

 

Have fun! 

--George
Reply