at91: move at91-sdcard command to sama5.mk
[oweals/openwrt.git] / target / linux / at91 / image / sama5.mk
1
2 define Device/default-nand
3   BLOCKSIZE := 128k
4   PAGESIZE := 2048
5   SUBPAGESIZE := 2048
6   MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048
7 endef
8
9 define Build/at91-sdcard
10   $(if $(findstring ext4,$@), \
11   rm -f $@.boot
12   mkfs.fat -C $@.boot $(FAT32_BLOCKS)
13
14   mcopy -i $@.boot $(KDIR)/zImage ::zImage
15
16   $(if $(findstring at91-sama5d27_som1_ek,$@), \
17       mcopy -i $@.boot \
18           $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc1/u-boot.bin \
19           ::u-boot.bin
20       mcopy -i $@.boot \
21           $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd1_uboot/at91bootstrap.bin \
22           ::BOOT.bin,
23       mcopy -i $@.boot \
24           $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc/u-boot.bin \
25           ::u-boot.bin
26       mcopy -i $@.boot \
27           $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot/at91bootstrap.bin \
28           ::BOOT.bin)
29
30   ./gen_at91_sdcard_img.sh \
31       $@.img \
32       $@.boot \
33       $(KDIR)/root.ext4 \
34       $(AT91_SD_BOOT_PARTSIZE) \
35       $(CONFIG_TARGET_ROOTFS_PARTSIZE)
36
37   gzip -nc9 $@.img > $@
38
39   rm -f $@.img $@.boot )
40 endef
41
42 define Device/at91-sama5d2_xplained
43   $(Device/evaluation-dtb)
44   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained
45   KERNEL_SIZE := 6144k
46   $(Device/evaluation-sdimage)
47 endef
48 TARGET_DEVICES += at91-sama5d2_xplained
49
50 define Device/at91-sama5d27_som1_ek
51   $(Device/evaluation-dtb)
52   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D27 SOM1 Ek
53   KERNEL_SIZE := 6144k
54   $(Device/evaluation-sdimage)
55 endef
56 TARGET_DEVICES += at91-sama5d27_som1_ek
57
58 define Device/at91-sama5d2_ptc_ek
59   $(Device/evaluation-dtb)
60   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 PTC Ek
61   KERNEL_SIZE := 6144k
62   $(Device/evaluation-sdimage)
63 endef
64 TARGET_DEVICES += at91-sama5d2_ptc_ek
65
66
67 define Device/at91-sama5d3_xplained
68   $(Device/evaluation-dtb)
69   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained
70   KERNEL_SIZE := 6144k
71   $(Device/evaluation-sdimage)
72 endef
73 TARGET_DEVICES += at91-sama5d3_xplained
74
75 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
76  ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
77   define Device/wb50n
78     $(Device/evaluation-fit)
79     DEVICE_TITLE := Laird WB50N
80     DEVICE_PACKAGES := \
81           kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \
82           kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \
83           kmod-leds-gpio
84     BLOCKSIZE := 128k
85     PAGESIZE := 2048
86     SUBPAGESIZE := 2048
87     MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955
88   endef
89   TARGET_DEVICES += wb50n
90  endif
91 endif
92
93
94 define Device/at91-sama5d4_xplained
95   $(Device/evaluation-dtb)
96   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained
97   KERNEL_SIZE := 6144k
98   BLOCKSIZE := 256k
99   PAGESIZE := 4096
100   SUBPAGESIZE := 2048
101   MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082
102   $(Device/evaluation-sdimage)
103 endef
104 TARGET_DEVICES += at91-sama5d4_xplained