at91: add support for sama5d27-wlsom1-ek board
[openwrt/staging/wigyori.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 \
15 $(KDIR)/$(DEVICE_NAME)-fit-zImage.itb \
16 ::$(DEVICE_NAME)-fit.itb
17
18 $(if $(findstring sama5d27-som1-ek,$@), \
19 mcopy -i $@.boot \
20 $(BIN_DIR)/u-boot-$(DEVICE_DTS:at91-%=%)_mmc1/u-boot.bin \
21 ::u-boot.bin
22 mcopy -i $@.boot \
23 $(BIN_DIR)/at91bootstrap-$(DEVICE_DTS:at91-%=%)sd1_uboot/at91bootstrap.bin \
24 ::BOOT.bin,
25 mcopy -i $@.boot \
26 $(BIN_DIR)/u-boot-$(DEVICE_DTS:at91-%=%)_mmc/u-boot.bin \
27 ::u-boot.bin
28 $(if $(findstring sama5d4-xplained,$@), \
29 mcopy -i $@.boot \
30 $(BIN_DIR)/at91bootstrap-$(DEVICE_DTS:at91-%=%)sd_uboot_secure/at91bootstrap.bin \
31 ::BOOT.bin,
32 mcopy -i $@.boot \
33 $(BIN_DIR)/at91bootstrap-$(DEVICE_DTS:at91-%=%)sd_uboot/at91bootstrap.bin \
34 ::BOOT.bin))
35
36 $(CP) uboot-env.txt $@-uboot-env.txt
37 sed -i '2d;3d' $@-uboot-env.txt
38 sed -i '2i board='"$(DEVICE_NAME)"'' $@-uboot-env.txt
39 sed -i '3i board_name='"$(firstword $(SUPPORTED_DEVICES))"'' $@-uboot-env.txt
40
41 mkenvimage -s 0x4000 -o $@-uboot.env $@-uboot-env.txt
42
43 mcopy -i $@.boot $@-uboot.env ::uboot.env
44
45 ./gen_at91_sdcard_img.sh \
46 $@.img \
47 $@.boot \
48 $(KDIR)/root.ext4 \
49 $(AT91_SD_BOOT_PARTSIZE) \
50 $(CONFIG_TARGET_ROOTFS_PARTSIZE)
51
52 gzip -nc9 $@.img > $@
53
54 rm -f $@.img $@.boot $@-uboot.env $@-uboot-env.txt)
55 endef
56
57 define Device/microchip_sama5d2-icp
58 $(Device/evaluation-dtb)
59 DEVICE_VENDOR := Microchip
60 DEVICE_MODEL := SAMA5D2 ICP
61 DEVICE_DTS := at91-sama5d2_icp
62 SUPPORTED_DEVICES := microchip,sama5d2-icp
63 KERNEL_SIZE := 6144k
64 $(Device/evaluation-sdimage)
65 endef
66 TARGET_DEVICES += microchip_sama5d2-icp
67
68 define Device/microchip_sama5d2-xplained
69 $(Device/evaluation-dtb)
70 DEVICE_VENDOR := Microchip
71 DEVICE_MODEL := SAMA5D2 Xplained
72 DEVICE_DTS := at91-sama5d2_xplained
73 SUPPORTED_DEVICES := atmel,sama5d2-xplained
74 KERNEL_SIZE := 6144k
75 $(Device/evaluation-sdimage)
76 endef
77 TARGET_DEVICES += microchip_sama5d2-xplained
78
79 define Device/microchip_sama5d27-som1-ek
80 $(Device/evaluation-dtb)
81 DEVICE_VENDOR := Microchip
82 DEVICE_MODEL := SAMA5D27 SOM1 Ek
83 DEVICE_DTS := at91-sama5d27_som1_ek
84 SUPPORTED_DEVICES := atmel,sama5d27-som1-ek
85 KERNEL_SIZE := 6144k
86 $(Device/evaluation-sdimage)
87 endef
88 TARGET_DEVICES += microchip_sama5d27-som1-ek
89
90 define Device/microchip_sama5d27-wlsom1-ek
91 $(Device/evaluation-dtb)
92 DEVICE_VENDOR := Microchip
93 DEVICE_MODEL := SAMA5D27 WSOM1 Ek
94 DEVICE_DTS := at91-sama5d27_wlsom1_ek
95 SUPPORTED_DEVICES := microchip,sama5d27-wlsom1-ek
96 KERNEL_SIZE := 6144k
97 $(Device/evaluation-sdimage)
98 endef
99 TARGET_DEVICES += microchip_sama5d27-wlsom1-ek
100
101 define Device/microchip_sama5d2-ptc-ek
102 $(Device/evaluation-dtb)
103 DEVICE_VENDOR := Microchip
104 DEVICE_MODEL := SAMA5D2 PTC Ek
105 DEVICE_DTS := at91-sama5d2_ptc_ek
106 SUPPORTED_DEVICES := atmel,sama5d2-ptc_ek
107 KERNEL_SIZE := 6144k
108 $(Device/evaluation-sdimage)
109 endef
110 TARGET_DEVICES += microchip_sama5d2-ptc-ek
111
112 define Device/microchip_sama5d3-xplained
113 $(Device/evaluation-dtb)
114 DEVICE_VENDOR := Microchip
115 DEVICE_MODEL := SAMA5D3 Xplained
116 DEVICE_DTS := at91-sama5d3_xplained
117 SUPPORTED_DEVICES := atmel,sama5d3-xplained
118 KERNEL_SIZE := 6144k
119 $(Device/evaluation-sdimage)
120 endef
121 TARGET_DEVICES += microchip_sama5d3-xplained
122
123 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
124 ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
125 define Device/laird_wb50n
126 $(Device/evaluation-fit)
127 DEVICE_VENDOR := Laird
128 DEVICE_MODEL := WB50N
129 DEVICE_DTS := at91-wb50n
130 DEVICE_PACKAGES := \
131 kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \
132 kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \
133 kmod-leds-gpio
134 BLOCKSIZE := 128k
135 PAGESIZE := 2048
136 SUBPAGESIZE := 2048
137 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955
138 endef
139 TARGET_DEVICES += laird_wb50n
140 endif
141 endif
142
143 define Device/microchip_sama5d4-xplained
144 $(Device/evaluation-dtb)
145 DEVICE_VENDOR := Microchip
146 DEVICE_MODEL := SAMA5D4 Xplained
147 DEVICE_DTS := at91-sama5d4_xplained
148 SUPPORTED_DEVICES := atmel,sama5d4-xplained
149 KERNEL_SIZE := 6144k
150 BLOCKSIZE := 256k
151 PAGESIZE := 4096
152 SUBPAGESIZE := 2048
153 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082
154 $(Device/evaluation-sdimage)
155 endef
156 TARGET_DEVICES += microchip_sama5d4-xplained