d33a3986511e12c765eb2c00d94861aeb0dc4e5f
[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 $(BIN_DIR)/BOOT.bin; \
20 mcopy -i $@.boot $(BIN_DIR)/BOOT.bin ::BOOT.bin;)
21
22 ./gen_at91_sdcard_img.sh \
23 $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \
24 $@.boot \
25 $(KDIR)/root.ext4 \
26 $(AT91_SD_BOOT_PARTSIZE) \
27 $(CONFIG_TARGET_ROOTFS_PARTSIZE)
28
29 gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \
30 > $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz
31
32 $(CP) $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz \
33 $(BIN_DIR)/
34
35 rm -f $(BIN_DIR)/BOOT.bin
36 rm -f $@.boot
37 endef
38
39 define Device/evaluation-sdimage
40 IMAGES += sdcard.img.gz
41 IMAGE/sdcard.img.gz := at91-sdcard
42 endef
43
44 define Device/default-nand
45 BLOCKSIZE := 128k
46 PAGESIZE := 2048
47 SUBPAGESIZE := 2048
48 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048
49 endef
50
51 define Device/at91-sama5d3_xplained
52 $(Device/evaluation-dtb)
53 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained
54 KERNEL_SIZE := 6144k
55 $(Device/evaluation-sdimage)
56 endef
57 TARGET_DEVICES += at91-sama5d3_xplained
58
59 define Device/at91-sama5d2_xplained
60 $(Device/evaluation-dtb)
61 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained
62 KERNEL_SIZE := 6144k
63 $(Device/evaluation-sdimage)
64 endef
65 TARGET_DEVICES += at91-sama5d2_xplained
66
67 define Device/at91-sama5d4_xplained
68 $(Device/evaluation-dtb)
69 DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained
70 KERNEL_SIZE := 6144k
71 BLOCKSIZE := 256k
72 PAGESIZE := 4096
73 SUBPAGESIZE := 2048
74 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 -x lzo
75 $(Device/evaluation-sdimage)
76 endef
77 TARGET_DEVICES += at91-sama5d4_xplained
78
79 define Device/wb50n
80 $(Device/evaluation-fit)
81 DEVICE_TITLE := Laird WB50N
82 DEVICE_PACKAGES := \
83 kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \
84 kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \
85 kmod-leds-gpio
86 BLOCKSIZE := 128k
87 PAGESIZE := 2048
88 SUBPAGESIZE := 2048
89 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955
90 endef
91 TARGET_DEVICES += wb50n