ramips: set blocksize for 4MB devices
[openwrt/openwrt.git] / target / linux / ramips / image / mt7621.mk
1 #
2 # MT7621 Profiles
3 #
4
5 define Build/seama
6 $(STAGING_DIR_HOST)/bin/seama -i $@ $(1)
7 mv $@.seama $@
8 endef
9
10 define Build/seama-seal
11 $(call Build/seama,-s $@.seama $(1))
12 endef
13
14 define Build/ubnt-erx-factory-image
15 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
16 echo '21001:6' > $(1).compat; \
17 $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
18 \
19 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
20 md5sum --binary $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) | awk '{print $$1}'> $(1).md5; \
21 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \
22 \
23 echo "dummy" > $(1).rootfs; \
24 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \
25 \
26 md5sum --binary $(1).rootfs | awk '{print $$1}'> $(1).md5; \
27 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \
28 \
29 echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \
30 $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
31 \
32 $(CP) $(1) $(BIN_DIR)/; \
33 else \
34 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
35 fi
36 endef
37
38 define Device/mt7621
39 DTS := MT7621
40 BLOCKSIZE := 64k
41 IMAGE_SIZE := $(ralink_default_fw_size_4M)
42 DEVICE_TITLE := MediaTek MT7621 EVB
43 endef
44 TARGET_DEVICES += mt7621
45
46 define Device/wsr-600
47 DTS := WSR-600
48 IMAGE_SIZE := $(ralink_default_fw_size_16M)
49 DEVICE_TITLE := Buffalo WSR-600
50 endef
51 TARGET_DEVICES += wsr-600
52
53 define Device/re6500
54 DTS := RE6500
55 DEVICE_TITLE := Linksys RE6500
56 endef
57 TARGET_DEVICES += re6500
58
59 define Device/wsr-1166
60 DTS := WSR-1166
61 IMAGE/sysupgrade.bin := trx | pad-rootfs
62 IMAGE_SIZE := $(ralink_default_fw_size_16M)
63 DEVICE_TITLE := Buffalo WSR-1166
64 endef
65 TARGET_DEVICES += wsr-1166
66
67 define Device/dir-860l-b1
68 DTS := DIR-860L-B1
69 BLOCKSIZE := 4k
70 IMAGES += factory.bin
71 KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
72 IMAGE_SIZE := $(ralink_default_fw_size_16M)
73 IMAGE/sysupgrade.bin := \
74 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
75 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
76 pad-rootfs | check-size $$$$(IMAGE_SIZE)
77 IMAGE/factory.bin := \
78 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
79 append-rootfs | pad-rootfs -x 64 | \
80 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
81 seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
82 check-size $$$$(IMAGE_SIZE)
83 DEVICE_TITLE := D-Link DIR-860L B1
84 endef
85 TARGET_DEVICES += dir-860l-b1
86
87 define Device/firewrt
88 DTS := FIREWRT
89 IMAGE_SIZE := $(ralink_default_fw_size_16M)
90 DEVICE_TITLE := Firefly FireWRT
91 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
92 endef
93 TARGET_DEVICES += firewrt
94
95 define Device/pbr-m1
96 DTS := PBR-M1
97 IMAGE_SIZE := $(ralink_default_fw_size_16M)
98 DEVICE_TITLE := PBR-M1
99 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
100 kmod-rtc-pcf8563 kmod-i2c-mt7621
101 endef
102 TARGET_DEVICES += pbr-m1
103
104 define Device/sap-g3200u3
105 DTS := SAP-G3200U3
106 DEVICE_TITLE := STORYLiNK SAP-G3200U3
107 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
108 endef
109 TARGET_DEVICES += sap-g3200u3
110
111 define Device/timecloud
112 DTS := Timecloud
113 DEVICE_TITLE := Thunder Timecloud
114 DEVICE_PACKAGES := kmod-usb3
115 endef
116 TARGET_DEVICES += timecloud
117
118 define Device/witi
119 DTS := WITI
120 IMAGE_SIZE := $(ralink_default_fw_size_16M)
121 DEVICE_TITLE := MQmaker WiTi
122 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
123 kmod-rtc-pcf8563 kmod-i2c-mt7621
124 endef
125 TARGET_DEVICES += witi
126
127 define Device/wndr3700v5
128 DTS := WNDR3700V5
129 IMAGE_SIZE := $(ralink_default_fw_size_16M)
130 DEVICE_TITLE := Netgear WNDR3700v5
131 DEVICE_PACKAGES := kmod-usb3
132 endef
133 TARGET_DEVICES += wndr3700v5
134
135 define Device/zbt-wg2626
136 DTS := ZBT-WG2626
137 IMAGE_SIZE := $(ralink_default_fw_size_16M)
138 DEVICE_TITLE := ZBT WG2626
139 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci
140 endef
141 TARGET_DEVICES += zbt-wg2626
142
143 define Device/zbt-wg3526
144 DTS := ZBT-WG3526
145 IMAGE_SIZE := $(ralink_default_fw_size_16M)
146 DEVICE_TITLE := ZBT WG3526
147 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci
148 endef
149 TARGET_DEVICES += zbt-wg3526
150
151 define Device/wf-2881
152 DTS := WF-2881
153 BLOCKSIZE := 128k
154 PAGESIZE := 2048
155 FILESYSTEMS := squashfs
156 IMAGE_SIZE := 129280k
157 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
158 IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
159 DEVICE_TITLE := NETIS WF-2881
160 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
161 endef
162 TARGET_DEVICES += wf-2881
163
164 define Device/ubnt-erx
165 DTS := UBNT-ERX
166 FILESYSTEMS := squashfs
167 KERNEL_SIZE := 3145728
168 KERNEL := $(KERNEL_DTB) | uImage lzma
169 IMAGES := sysupgrade.tar
170 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
171 IMAGE/sysupgrade.tar := sysupgrade-tar
172 DEVICE_TITLE := Ubiquiti EdgeRouter X
173 DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2800-pci -kmod-cfg80211 -wpad-mini -iwinfo
174 endef
175 TARGET_DEVICES += ubnt-erx
176
177 define Device/sk-wb8
178 DTS := SK-WB8
179 IMAGE_SIZE := $(ralink_default_fw_size_16M)
180 DEVICE_TITLE := SamKnows Whitebox 8
181 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev uboot-envtools
182 endef
183 TARGET_DEVICES += sk-wb8
184
185 # FIXME: is this still needed?
186 define Image/Prepare
187 #define Build/Compile
188 rm -rf $(KDIR)/relocate
189 $(CP) ../../generic/image/relocate $(KDIR)
190 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
191 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
192 endef