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
11 FAT32_BLOCKS=$(shell echo $$(($(CONFIG_TARGET_KERNEL_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
13 define Build/zynq-sdcard
15 mkfs.fat $@.boot -C $(FAT32_BLOCKS)
16 mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.bin ::boot.bin
17 mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot.img ::u-boot.img
18 mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-uEnv.txt ::uEnv.txt
19 mcopy -i $@.boot $(IMAGE_KERNEL) ::fit.itb
20 ./gen_zynq_sdcard_img.sh $@ \
23 $(CONFIG_TARGET_KERNEL_PARTSIZE) \
24 $(CONFIG_TARGET_ROOTFS_PARTSIZE)
28 #################################################
29 # Default and templates
30 #################################################
34 DEVICE_DTS := $(lastword $(subst _, ,$(1)))
35 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
36 KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
37 KERNEL_PREFIX := $$(IMAGE_PREFIX)
38 KERNEL_LOADADDR := 0x8000
39 IMAGES := sdcard.img.gz
40 IMAGE/sdcard.img.gz := zynq-sdcard | gzip
43 define Device/FitImageGzip
44 KERNEL_SUFFIX := -fit-uImage.itb
45 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
49 #################################################
51 #################################################
53 define Device/avnet_zynq-zed
54 $(call Device/FitImageGzip)
55 DEVICE_VENDOR := Avnet
56 DEVICE_MODEL := ZedBoard
58 TARGET_DEVICES += avnet_zynq-zed
60 define Device/digilent_zynq-zybo
61 $(call Device/FitImageGzip)
62 DEVICE_VENDOR := Digilent
65 TARGET_DEVICES += digilent_zynq-zybo
67 define Device/digilent_zynq-zybo-z7
68 $(call Device/FitImageGzip)
69 DEVICE_VENDOR := Digilent
70 DEVICE_MODEL := Zybo Z7
72 TARGET_DEVICES += digilent_zynq-zybo-z7
74 define Device/xlnx_zynq-zc702
75 $(call Device/FitImageGzip)
76 DEVICE_VENDOR := Xilinx
78 DEVICE_PACKAGES:=kmod-can kmod-can-xilinx-can
80 TARGET_DEVICES += xlnx_zynq-zc702
82 $(eval $(call BuildImage))