2 # Copyright (C) 2013-2016 OpenWrt.org
3 # Copyright (C) 2016 Yousong Zhou
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/image.mk
12 FAT32_BLOCKS
=$(shell echo
$$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
14 KERNEL_LOADADDR
:=0x40008000
16 define Build
/sunxi-sdcard
18 mkfs.fat
$@.boot
-C
$(FAT32_BLOCKS
)
20 mcopy
-i
$@.boot
$(STAGING_DIR_IMAGE
)/$(DEVICE_NAME
)-boot.scr
::boot.scr
21 mcopy
-i
$@.boot
$(DTS_DIR
)/$(SUNXI_DTS
).dtb
::dtb
22 mcopy
-i
$@.boot
$(IMAGE_KERNEL
) ::uImage
23 .
/gen_sunxi_sdcard_img.sh
$@ \
26 $(CONFIG_SUNXI_SD_BOOT_PARTSIZE
) \
27 $(CONFIG_TARGET_ROOTFS_PARTSIZE
) \
28 $(STAGING_DIR_IMAGE
)/$(DEVICE_NAME
)-u-boot-with-spl.bin
32 # why \x00\x00\x00\x00 for zImage-initramfs
35 DEVICE_VARS
:= SUNXI_DTS SUNXI_DTS_DIR
37 KERNEL
:= kernel-bin | uImage none
38 IMAGES
:= sdcard.img.gz
39 IMAGE
/sdcard.img.gz
:= sunxi-sdcard | append-metadata | gzip
40 SUPPORTED_DEVICES
:= $(subst _
,$(comma
),$(1))
42 SUNXI_DTS
= $$(SUNXI_DTS_DIR
)$$(SOC
)-$(lastword
$(subst _
, ,$(1)))
45 ifeq ($(SUBTARGET
),cortexa7
)
49 ifeq ($(SUBTARGET
),cortexa8
)
53 ifeq ($(SUBTARGET
),cortexa53
)
57 $(eval
$(call BuildImage
))