2 # Copyright (C) 2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
10 #################################################
12 #################################################
14 # $(1): rootfs contents directory
15 define Image/mkfs/cpio
16 ( cd $(call mkfs_target_dir,$(1))/; find . | cpio -o -H newc | gzip -9n > $@ )
21 $(call Image/BuildDTB,$(DTS_DIR)/zynq-$(1).dts,$@.dtb)
25 # Create uboot cpio.gz
26 mkimage -A arm -T ramdisk -C gzip -n "$(PROFILE) OpenWRT rootfs" \
27 -d $(IMAGE_ROOTFS) $@.new
31 # $(1): FIT name/description
33 # create FIT image with rootfs
35 -D $(1) -o $@.its -k $(IMAGE_KERNEL) -d $(IMAGE_KERNEL).dtb \
36 -C none -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \
37 -A $(ARCH) -v $(LINUX_VERSION) -r $(IMAGE_ROOTFS) -z gzip
39 PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@
42 #################################################
44 #################################################
46 # default kernel load address
47 KERNEL_LOADADDR=0x8000
50 TARGET_FILESYSTEMS += cpio
52 # $(1): canonical device name
53 # $(2): lowercase device id
56 DEVICE_TITLE := $(1) development board
57 KERNEL := dtb $(2) | kernel-bin | uImage none
59 IMAGES := uramdisk.image.gz fit.itb
60 IMAGE/uramdisk.image.gz := uRamdisk
61 IMAGE/fit.itb := fit $(2)
62 IMAGE_NAME = $$$$(IMG_PREFIX)-$(2)-$$$$(2)
64 TARGET_DEVICES += $(1)
67 $(eval $(call ZynqDevice,ZC702,zc702))
68 $(eval $(call ZynqDevice,ZedBoard,zed))
69 $(eval $(call ZynqDevice,ZYBO,zybo))
71 $(eval $(call BuildImage))