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 DEVICE_VARS := SUNXI_DTS SUNXI_DTS_DIR
15 KERNEL_LOADADDR:=0x40008000
17 define Build/sunxi-sdcard
19 mkfs.fat $@.boot -C $(FAT32_BLOCKS)
21 mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
22 mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
23 mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
24 ./gen_sunxi_sdcard_img.sh $@ \
27 $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
28 $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
29 $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot-with-spl.bin
33 # why \x00\x00\x00\x00 for zImage-initramfs
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))