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