[OpenWrt-Devel] Xilinx Zynq zedboard integration

Javier Domingo Cansino javierdo1 at gmail.com
Tue Jan 20 19:24:56 EST 2015

​After hitting against this wall for a lot, I found a bug in my few lines
of code, I was creating the uImage file from vmlinux instead of from

I am still doing something wrong, because substituting the uImage generated
from buildroot in the SD card (and leaving the rest of the files), makes at
least the kernel boot, although crashes in sec 0.000000, at least prints

I have discovered that after "Starting kernel ..." there should be a
"Uncompressing Linux... done, booting the kernel." line. So I am still
doing something wrong on the uImage generation, and I don't know what.

Moreover, I have compiled the uImage like the following, and it get's to
the kernel panic at least:
make -j9 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=arm  CROSS_COMPILE="
LOADADDR="0x8000" uImage

If you could tell me which should be the Image/BuildKernel part, I would be
really appreciate it.


include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk

define Build/Compile
	$(call Build/Compile/Default, zynq_zed.dtb)

define Image/BuildKernel/Initramfs
	(cd $(TARGET_DIR); \
	 find . | cpio -o -H newc | gzip -9 >$(KDIR)/zedboard-rootfs.cpio.gz )
	mkimage -A arm -T ramdisk -C none -d $(KDIR)/zedboard-rootfs.cpio.gz \

define Image/BuildKernel
	mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 \
		-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
		-d $(LINUX_DIR)/arch/arm/boot/zImage $(BIN_DIR)/zedboard-uImage

define Image/Prepare
	$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
	 $(LINUX_DIR)/arch/arm/boot/dts/zynq-zed.dts > $(BIN_DIR)/zedboard.dtb

$(eval $(call BuildImage))


[1] Bug I should have found a lot of time ago:


On Sun, Jun 29, 2014 at 1:35 PM, Javier Domingo Cansino <javierdo1 at gmail.com
> wrote:

> ​I have manually executed the boot sequence in the uboot, and the result
> is that it fails on the command bootm loados. Any idea on how to debug what
> can be wrong?
> Cheers and I will keep searching,
> Javier Domingo Cansino
> zynq-uboot> fatload mmc 0 0x3000000 uImage
> reading uImage
> 4582152 bytes read in 405 ms (10.8 MiB/s)
> zynq-uboot> fatload mmc 0 0x2A00000 devicetree.dtb
> reading devicetree.dtb
> 2739 bytes read in 15 ms (177.7 KiB/s)
> zynq-uboot> fatload mmc 0 0x2000000 uramdisk.image.gz
> reading uramdisk.image.gz
> 796339 bytes read in 87 ms (8.7 MiB/s)
> zynq-uboot> help bootm
> bootm - boot application image from memory
> Usage:
> bootm [addr [arg ...]]
>     - boot application image stored in memory
>         passing arguments 'arg ...'; when booting a Linux kernel,
>         'arg' can be the address of an initrd image
>         When booting a Linux kernel which requires a flat device-tree
>         a third argument is required which is the address of the
>         device-tree blob. To boot that kernel without an initrd image,
>         use a '-' for the second argument. If you do not pass a third
>         a bd_info struct will be passed instead
> For the new multi component uImage format (FIT) addresses
>         must be extened to include component or configuration unit name:
>         addr:<subimg_uname> - direct component image specification
>         addr#<conf_uname>   - configuration specification
>         Use iminfo command to get the list of existing component
>         images and configurations.
> Sub-commands to do part of the bootm sequence.  The sub-commands must be
> issued in the order below (it's ok to not issue all sub-commands):
>         start [addr [arg ...]]
>         loados  - load OS image
>         ramdisk - relocate initrd, set env initrd_start/initrd_end
>         fdt     - relocate flat device tree
>         cmdline - OS specific command line processing/setup
>         bdt     - OS specific bd_t processing
>         prep    - OS specific prep before relocation or go
>         go      - start OS
> zynq-uboot> bootm start 0x3000000 0x2000000 0x2A00000
> ## Booting kernel from Legacy Image at 03000000 ...
>    Image Name:   ARM OpenWrt Linux-3.13.7
>    Image Type:   ARM Linux Kernel Image (uncompressed)
>    Data Size:    4582088 Bytes = 4.4 MiB
>    Load Address: 80000000
>    Entry Point:  80000000
>    Verifying Checksum ... OK
> ## Loading init Ramdisk from Legacy Image at 02000000 ...
>    Image Name:
>    Image Type:   ARM Linux RAMDisk Image (uncompressed)
>    Data Size:    796275 Bytes = 777.6 KiB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
> ## Flattened Device Tree blob at 02a00000
>    Booting using the fdt blob at 0x2a00000
> zynq-uboot> bootm loados
>    Loading Kernel Image ...

Javier Domingo Cansino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150121/ca76bd64/attachment.htm>
-------------- next part --------------
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list