Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== How to run from flash with U-Boot. ====== Keywords: U-Boot, embedded 1. Ask U-Boot: "what do you support to boot?" Normally, U-Boot use special image for kernel/ramfs packing. But we need to know which compression support U-Boot that fleshed to our target board. First way: use mkimage utility (/usr/ports/devel/u-boot) and make test images for all supported by mkimage compression types. <code> mkimage -A ${TARGET} -O linux -T kernel \ -C ${COMPRESSION_TYPE} \ -a ${RAM_START_ADDRESS} \ -e ${RAM_START_ADDRESS} \ -n 'FreeBSD Kernel Image' \ -d SOME_SMALL_FILE_NAME \ test.uboot </code> Then for each file, do transfer to board and run from image with `bootm' command. And check what U-Boot answer you, if answer like "Unimplemented compression type ?", then you know :). Second way: From running Linux or U-Boot get first 64k block from kernel partition in flash. Break your mkimage utility: avoid exit when we do "show info" (key -i) CRC failed. And check compression type of 64k file we get from device. Or just delete U-Boot image header from file <code> dd if=64k.file of=just_kern bs=64 skip=1 </code> and check with file(1) utility 2. Create image 2.1. More canonical way, we have mkimage, gzip or bz2 and compiled kernel, maybe kernel.bin also. <code> gzip --best --force vmlinux.bin </code> for ELF kernel: <code> mkimage -A mips -O linux -T kernel \ -C gzip \ -a ${LOAD_ADDRESS} \ -e ${START_ADDRESS} \ -n 'FreeBSD Kernel Image' \ -d kernel \ kernel.uboot </code> <code> LOAD_ADDRESS - in most cases this is RAM base address START_ADDRESS = LOAD_ADDRESS + ELF_HEADER_SIZE (0x1000 for ELF image) </code> for kernel.bin: <code> LOAD_ADDRESS = RAM_BASE_ADDRESS + 0x1000 START_ADDRESS = RAM_BASE_ADDRESS + 0x1000 </code> Don't forget to check/change KERNLOADADDR of kernel config file. KERNLOADADDR must be equal to START_ADDRESS. 2.2. Longest way, but have smallest footprint, used only if U-Boot support LZMA. Problem 1: Current version of mkimage from ports, don't support LZMA. So we need new: http://my.ddteam.net/files/u-boot.new.tar.gz Problem 2: Devices I know support only old LZMA. I use LZMA 4.17. Then mkimage, like in 2.2., but -C lzma. 3. Now we have kernel U-Boot image, so transfer it to device and try with `bootm' command. 4. If all fine, write image to flash kernel partition. aleksandrrybalko/run_from_flash_with_u-boot.txt Last modified: 2011/04/12 09:24by AleksandrRybalko