at91/image/sama5.mk: check for sama5d4_xplained device
[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       $(if $(findstring sama5d4_xplained, $@), \
27           mcopy -i $@.boot \
28               $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot_secure/at91bootstrap.bin \
29               ::BOOT.bin,
30           mcopy -i $@.boot \
31               $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot/at91bootstrap.bin \
32               ::BOOT.bin))
33
34   $(CP) uboot-env.txt $@-uboot-env.txt
35   sed -i '2d;3d' $@-uboot-env.txt
36   sed -i '2i board='"$(DEVICE_NAME:at91-%=%)"'' $@-uboot-env.txt
37   sed -i '3i board_name='"$(DEVICE_NAME:at91-%=%)"'' $@-uboot-env.txt
38
39   mkenvimage -s 0x4000 -o $@-uboot.env $@-uboot-env.txt
40
41   mcopy -i $@.boot $@-uboot.env ::uboot.env
42
43   ./gen_at91_sdcard_img.sh \
44       $@.img \
45       $@.boot \
46       $(KDIR)/root.ext4 \
47       $(AT91_SD_BOOT_PARTSIZE) \
48       $(CONFIG_TARGET_ROOTFS_PARTSIZE)
49
50   gzip -nc9 $@.img > $@
51
52   rm -f $@.img $@.boot $@-uboot.env $@-uboot-env.txt)
53 endef
54
55 define Device/at91-sama5d2_xplained
56   $(Device/evaluation-dtb)
57   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained
58   KERNEL_SIZE := 6144k
59   $(Device/evaluation-sdimage)
60 endef
61 TARGET_DEVICES += at91-sama5d2_xplained
62
63 define Device/at91-sama5d27_som1_ek
64   $(Device/evaluation-dtb)
65   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D27 SOM1 Ek
66   KERNEL_SIZE := 6144k
67   $(Device/evaluation-sdimage)
68 endef
69 TARGET_DEVICES += at91-sama5d27_som1_ek
70
71 define Device/at91-sama5d2_ptc_ek
72   $(Device/evaluation-dtb)
73   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 PTC Ek
74   KERNEL_SIZE := 6144k
75   $(Device/evaluation-sdimage)
76 endef
77 TARGET_DEVICES += at91-sama5d2_ptc_ek
78
79
80 define Device/at91-sama5d3_xplained
81   $(Device/evaluation-dtb)
82   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained
83   KERNEL_SIZE := 6144k
84   $(Device/evaluation-sdimage)
85 endef
86 TARGET_DEVICES += at91-sama5d3_xplained
87
88 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
89  ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
90   define Device/wb50n
91     $(Device/evaluation-fit)
92     DEVICE_TITLE := Laird WB50N
93     DEVICE_PACKAGES := \
94           kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \
95           kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \
96           kmod-leds-gpio
97     BLOCKSIZE := 128k
98     PAGESIZE := 2048
99     SUBPAGESIZE := 2048
100     MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955
101   endef
102   TARGET_DEVICES += wb50n
103  endif
104 endif
105
106
107 define Device/at91-sama5d4_xplained
108   $(Device/evaluation-dtb)
109   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained
110   KERNEL_SIZE := 6144k
111   BLOCKSIZE := 256k
112   PAGESIZE := 4096
113   SUBPAGESIZE := 2048
114   MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082
115   $(Device/evaluation-sdimage)
116 endef
117 TARGET_DEVICES += at91-sama5d4_xplained