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
),sam9x
)
19 ifeq ($(SUBTARGET
),sama5
)
23 AT91_SD_BOOT_PARTSIZE
:=64
24 FAT32_BLOCK_SIZE
:=1024
25 FAT32_BLOCKS
:=$(shell echo \
26 $$(($(AT91_SD_BOOT_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
29 $(Device
/default-nand
)
31 FILESYSTEMS
:= squashfs ubifs ext4
35 KERNEL
:= kernel-bin | append-dtb | lzma | uImage lzma
40 KERNEL
:= kernel-bin | lzma | uImage lzma
43 define Build
/at91-sdcard
44 $(if
$(findstring ext4
,$@
), \
46 mkfs.fat
-C
$@.boot
$(FAT32_BLOCKS
)
48 mcopy
-i
$@.boot
$(KDIR
)/zImage
::zImage
50 $(foreach dts
,$(DEVICE_DTS
), \
51 mcopy
-i
$@.boot
$(DTS_DIR
)/$(dts
).dtb \
55 $(BIN_DIR
)/u-boot-
$(DEVICE_NAME
:at91-
%=%)_mmc
/u-boot.bin \
58 $(if
$(findstring at91-sama5d27_som1_ek
,$@
), \
60 $(BIN_DIR
)/at91bootstrap-
$(DEVICE_NAME
:at91-
%=%)sd1_uboot
/at91bootstrap.bin \
63 $(BIN_DIR
)/at91bootstrap-
$(DEVICE_NAME
:at91-
%=%)sd_uboot
/at91bootstrap.bin \
66 .
/gen_at91_sdcard_img.sh \
70 $(AT91_SD_BOOT_PARTSIZE
) \
71 $(CONFIG_TARGET_ROOTFS_PARTSIZE
)
75 rm -f
$@.img
$@.boot
)
78 define Device
/evaluation-sdimage
79 IMAGES
+= sdcard.img.gz
80 IMAGE
/sdcard.img.gz
:= at91-sdcard
83 define Device
/evaluation
85 KERNEL_SUFFIX
:= -uImage
87 IMAGE
/root.ubi
:= append-ubi
90 define Device
/evaluation-zImage
92 IMAGE
/zImage
:= at91-install-zImage
95 define Device
/evaluation-dtb
98 $(Device
/evaluation-zImage
)
100 IMAGE
/dtb
:= install-dtb
103 define Device
/evaluation-fit
105 KERNEL_SUFFIX
:= -fit-uImage.itb
106 KERNEL
:= kernel-bin | lzma | fit lzma
$$(DTS_DIR
)/$$(DEVICE_DTS
).dtb
109 define Device
/production
111 IMAGES
:= factory.bin
112 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi
115 define Device
/production-dtb
118 IMAGE
/factory.bin
:= append-dtb | pad-to
$$$$(DTB_SIZE
) \
119 | append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi
122 $(eval
$(call BuildImage
))