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 define Image
/boot-imgs
15 # Copy zImage to BIN_DIR
16 $(CP
) $(KDIR
)/zImage
$(BIN_DIR
)/$(IMG_PREFIX
)-zImage
18 $(call Image
/BuildKernel
/MkuImage
, none
, $(KERNEL_LOADADDR
), \
19 $(KERNEL_ENTRY_POINT
), $(KDIR
)/zImage
, \
20 $(BIN_DIR
)/$(IMG_PREFIX
)-uImage
)
22 $(call Image
/BuildDTB
,$(DTS_DIR
)/$(DEVICE_DTS
).dts
,\
23 $(BIN_DIR
)/$(IMG_PREFIX
)-system.dtb
)
25 # Create uboot cpio.gz
26 mkimage
-A arm
-T ramdisk
-C gzip
-n
"$(PROFILE) OpenWRT rootfs" \
27 -d
$(BIN_DIR
)/$(IMG_PREFIX
)-rootfs.cpio.gz \
28 $(BIN_DIR
)/$(IMG_PREFIX
)-uramdisk.image.gz
30 # create FIT image with rootfs
32 -D
$(DEVICE_LC
) -o
$(KDIR
)/fit-
$(DEVICE_LC
).its
-k
$(KDIR
)/zImage \
33 -d
$(BIN_DIR
)/$(IMG_PREFIX
)-system.dtb \
34 -C none
-a
$(KERNEL_LOADADDR
) -e
$(KERNEL_ENTRY_POINT
) \
35 -A
$(ARCH
) -v
$(LINUX_VERSION
) \
36 -r
$(BIN_DIR
)/$(IMG_PREFIX
)-rootfs.cpio.gz
-z gzip
37 PATH
=$(LINUX_DIR
)/scripts
/dtc
:$(PATH
) mkimage
-f
$(KDIR
)/fit-
$(DEVICE_LC
).its
$(KDIR
)/fit-
$(DEVICE_LC
).itb
38 $(CP
) $(KDIR
)/fit-
$(DEVICE_LC
).itb
$(BIN_DIR
)/$(IMG_PREFIX
)-fit.itb
39 ln
-fs
$(IMG_PREFIX
)-fit.itb
$(BIN_DIR
)/fit.itb
43 #################################################
45 #################################################
47 # default kernel load address
48 KERNEL_LOADADDR
=0x8000
49 KERNEL_ENTRY_POINT
=0x8000
57 define Device
/DefaultConfig
59 IMG_PREFIX
= zynq-
$(1)
60 DEVICE_DTS
= zynq-
$(1)
65 $(call Device
/DefaultConfig
,zc702
)
69 $(call Device
/DefaultConfig
,zed
)
73 $(call Device
/DefaultConfig
,zybo
)
76 define Image
/BuildKernel
77 $(eval
$(call Device
/$(PROFILE
)))
78 $(call Image
/boot-imgs
)
81 $(eval
$(call BuildImage
))