at91: fix image building with CONFIG_TARGET_MULTI_PROFILE
[openwrt/openwrt.git] / target / linux / at91 / image / sama5.mk
1 AT91_SD_BOOT_PARTSIZE:=64
2 FAT32_BLOCK_SIZE:=1024
3 FAT32_BLOCKS:=$(shell echo \
4 $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
5
6 define Build/at91-sdcard
7 rm -f $@.boot
8 mkfs.fat -C $@.boot $(FAT32_BLOCKS)
9
10 mcopy -i $@.boot $(KDIR)/zImage ::zImage
11
12 $(foreach dts,$(DEVICE_DTS), \
13 mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb \
14 ::$(dts).dtb; \
15 mcopy -i $@.boot \
16 $(BIN_DIR)/u-boot-$(dts:at91-%=%)_mmc/u-boot.bin \
17 ::u-boot.bin; \
18 $(CP) $(BIN_DIR)/at91bootstrap-$(dts:at91-%=%)sd_uboot*/*.bin \
19 $@.BOOT.bin; \
20 mcopy -i $@.boot $@.BOOT.bin ::BOOT.bin;)
21
22 ./gen_at91_sdcard_img.sh \
23 $@.img \
24 $@.boot \
25 $(KDIR)/root.ext4 \
26 $(AT91_SD_BOOT_PARTSIZE) \
27 $(CONFIG_TARGET_ROOTFS_PARTSIZE)
28
29 gzip -nc9 $@.img > $@
30
31 rm -f $@.img $@.boot $@.BOOT.bin
32 endef
33
34 define Device/evaluation-sdimage
35 IMAGES += sdcard.img.gz
36 IMAGE/sdcard.img.gz := at91-sdcard
37 endef
38
39 define Device/default-nand
40 BLOCKSIZE := 128k
41 PAGESIZE := 2048
42 SUBPAGESIZE := 2048
43 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048
44 endef
45
46 define Device/at91-sama5d3_xplained
47 $(Device/evaluation-dtb)
48 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained
49 KERNEL_SIZE := 6144k
50 $(Device/evaluation-sdimage)
51 endef
52 TARGET_DEVICES += at91-sama5d3_xplained
53
54 define Device/at91-sama5d2_xplained
55 $(Device/evaluation-dtb)
56 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained
57 KERNEL_SIZE := 6144k
58 $(Device/evaluation-sdimage)
59 endef
60 TARGET_DEVICES += at91-sama5d2_xplained
61
62 define Device/at91-sama5d4_xplained
63 $(Device/evaluation-dtb)
64 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained
65 KERNEL_SIZE := 6144k
66 BLOCKSIZE := 256k
67 PAGESIZE := 4096
68 SUBPAGESIZE := 2048
69 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 -x lzo
70 $(Device/evaluation-sdimage)
71 endef
72 TARGET_DEVICES += at91-sama5d4_xplained
73
74 define Device/wb50n
75 $(Device/evaluation-fit)
76 DEVICE_TITLE := Laird WB50N
77 DEVICE_PACKAGES := \
78 kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \
79 kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \
80 kmod-leds-gpio
81 BLOCKSIZE := 128k
82 PAGESIZE := 2048
83 SUBPAGESIZE := 2048
84 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955
85 endef
86 TARGET_DEVICES += wb50n