2 # Copyright (C) 2006-2013 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 KERNEL_LOADADDR
:= 0x20008000
12 define Build
/at91-install-zImage
13 $(CP
) $(KDIR
)/zImage
$@
16 ifeq ($(SUBTARGET
),legacy
)
19 ifeq ($(SUBTARGET
),sama5d2
)
22 ifeq ($(SUBTARGET
),sama5d3
)
25 ifeq ($(SUBTARGET
),sama5d4
)
29 AT91_SD_BOOT_PARTSIZE
:=64
30 FAT32_BLOCK_SIZE
:=1024
31 FAT32_BLOCKS
:=$(shell echo \
32 $$(($(AT91_SD_BOOT_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
35 $(Device
/default-nand
)
37 FILESYSTEMS
:= squashfs ubifs ext4
41 KERNEL
:= kernel-bin | append-dtb | lzma | uImage lzma
46 KERNEL
:= kernel-bin | lzma | uImage lzma
49 define Build
/at91-sdcard
50 $(if
$(findstring ext4
,$@
), \
52 mkfs.fat
-C
$@.boot
$(FAT32_BLOCKS
)
54 mcopy
-i
$@.boot
$(KDIR
)/zImage
::zImage
56 $(foreach dts
,$(DEVICE_DTS
), \
57 mcopy
-i
$@.boot
$(DTS_DIR
)/$(dts
).dtb \
61 $(BIN_DIR
)/u-boot-
$(DEVICE_NAME
:at91-
%=%)_mmc
/u-boot.bin \
65 $(BIN_DIR
)/at91bootstrap-
$(DEVICE_NAME
:at91-
%=%)sd
*/at91bootstrap.bin \
68 .
/gen_at91_sdcard_img.sh \
72 $(AT91_SD_BOOT_PARTSIZE
) \
73 $(CONFIG_TARGET_ROOTFS_PARTSIZE
)
77 rm -f
$@.img
$@.boot
)
80 define Device
/evaluation-sdimage
81 IMAGES
+= sdcard.img.gz
82 IMAGE
/sdcard.img.gz
:= at91-sdcard
85 define Device
/evaluation
87 KERNEL_SUFFIX
:= -uImage
89 IMAGE
/root.ubi
:= append-ubi
92 define Device
/evaluation-zImage
94 IMAGE
/zImage
:= at91-install-zImage
97 define Device
/evaluation-dtb
100 $(Device
/evaluation-zImage
)
102 IMAGE
/dtb
:= install-dtb
105 define Device
/evaluation-fit
107 KERNEL_SUFFIX
:= -fit-uImage.itb
108 KERNEL
:= kernel-bin | lzma | fit lzma
$$(DTS_DIR
)/$$(DEVICE_DTS
).dtb
111 define Device
/production
113 IMAGES
:= factory.bin
114 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi
117 define Device
/production-dtb
120 IMAGE
/factory.bin
:= append-dtb | pad-to
$$$$(DTB_SIZE
) \
121 | append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi
124 $(eval
$(call BuildImage
))