ipq40xx: copy Fritz4040 UBoot to STAGING_DIR_IMAGE
[openwrt/openwrt.git] / target / linux / ipq40xx / image / Makefile
1 include $(TOPDIR)/rules.mk
2 include $(INCLUDE_DIR)/image.mk
3
4 define Device/Default
5 PROFILES := Default
6 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
7 KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
8 KERNEL_PREFIX := $$(IMAGE_PREFIX)
9 KERNEL_LOADADDR := 0x80208000
10 SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
11 IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
12 IMAGE/sysupgrade.bin/squashfs :=
13 endef
14
15 define Device/FitImage
16 KERNEL_SUFFIX := -fit-uImage.itb
17 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
18 KERNEL_NAME := Image
19 endef
20
21 define Device/FitImageLzma
22 KERNEL_SUFFIX := -fit-uImage.itb
23 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
24 KERNEL_NAME := Image
25 endef
26
27 define Device/UbiFit
28 KERNEL_IN_UBI := 1
29 IMAGES := nand-factory.ubi nand-sysupgrade.bin
30 IMAGE/nand-factory.ubi := append-ubi
31 IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
32 endef
33
34 define Device/DniImage
35 KERNEL_SUFFIX := -fit-uImage.itb
36 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
37 KERNEL_NAME := Image
38 NETGEAR_BOARD_ID :=
39 NETGEAR_HW_ID :=
40 IMAGES := factory.img sysupgrade.bin
41 IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | netgear-dni
42 IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata
43 endef
44 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
45
46
47 define Device/8dev_jalapeno
48 $(call Device/FitImage)
49 $(call Device/UbiFit)
50 DEVICE_DTS := qcom-ipq4018-jalapeno
51 BLOCKSIZE := 128k
52 PAGESIZE := 2048
53 DEVICE_TITLE := 8devices Jalapeno
54 endef
55 TARGET_DEVICES += 8dev_jalapeno
56
57 define Device/asus_rt-ac58u
58 $(call Device/FitImageLzma)
59 DEVICE_DTS := qcom-ipq4018-rt-ac58u
60 BLOCKSIZE := 128k
61 PAGESIZE := 2048
62 DTB_SIZE := 65536
63 DEVICE_TITLE := Asus RT-AC58U
64 IMAGE_SIZE := 20439364
65 FILESYSTEMS := squashfs
66 # Someone - in their infinite wisdom - decided to put the firmware
67 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
68 # Since u-boot works with strings we either need another fixup step
69 # to add a version... or we are very careful not to add '\0' into that
70 # string and call it a day.... Yeah, we do the latter!
71 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
72 IMAGES := sysupgrade.bin
73 DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
74 endef
75 TARGET_DEVICES += asus_rt-ac58u
76
77 define Device/avm_fritzbox-4040
78 $(call Device/FitImageLzma)
79 DEVICE_DTS := qcom-ipq4018-fritz4040
80 BOARD_NAME := fritz4040
81 DEVICE_TITLE := AVM Fritz!Box 4040
82 IMAGE_SIZE := 29753344
83 UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin
84 UBOOT_PARTITION_SIZE := 524288
85 IMAGES = eva.bin sysupgrade.bin
86 IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
87 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
88 DEVICE_PACKAGES := fritz-tffs fritz-caldata
89 endef
90 TARGET_DEVICES += avm_fritzbox-4040
91
92 define Device/compex_wpj428
93 $(call Device/FitImage)
94 DEVICE_DTS := qcom-ipq4028-wpj428
95 DEVICE_DTS_CONFIG := config@4
96 BLOCKSIZE := 64k
97 DEVICE_TITLE := Compex WPJ428
98 IMAGE_SIZE := 31232k
99 KERNEL_SIZE := 4096k
100 IMAGES = sysupgrade.bin
101 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
102 DEVICE_PACKAGES := kmod-gpio-beeper
103 endef
104 TARGET_DEVICES += compex_wpj428
105
106 define Device/glinet_gl-b1300
107 $(call Device/FitImage)
108 DEVICE_TITLE := GL.iNet GL-B1300
109 BOARD_NAME := gl-b1300
110 DEVICE_DTS := qcom-ipq4029-gl-b1300
111 KERNEL_SIZE := 4096k
112 IMAGE_SIZE := 26624k
113 IMAGES := sysupgrade.bin
114 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
115 endef
116 TARGET_DEVICES += glinet_gl-b1300
117
118 define Device/meraki_mr33
119 $(call Device/FitImage)
120 DEVICE_DTS := qcom-ipq4029-mr33
121 BLOCKSIZE := 131072
122 PAGESIZE := 2048
123 DEVICE_TITLE := Cisco Meraki MR33
124 IMAGES = sysupgrade.bin
125 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887
126 endef
127 TARGET_DEVICES += meraki_mr33
128
129 define Device/netgear_ex61x0v2
130 $(call Device/DniImage)
131 KERNEL_SIZE := 3080192
132 DEVICE_DTS_CONFIG := config@4
133 NETGEAR_BOARD_ID := EX6150v2series
134 NETGEAR_HW_ID := 29765285+16+0+128+2x2
135 endef
136
137 define Device/netgear_ex6100v2
138 $(call Device/netgear_ex61x0v2)
139 DEVICE_DTS := qcom-ipq4018-ex6100v2
140 DEVICE_TITLE := Netgear EX6100v2
141 endef
142 TARGET_DEVICES += netgear_ex6100v2
143
144 define Device/netgear_ex6150v2
145 $(call Device/netgear_ex61x0v2)
146 DEVICE_DTS := qcom-ipq4018-ex6150v2
147 DEVICE_TITLE := Netgear EX6150v2
148 endef
149 TARGET_DEVICES += netgear_ex6150v2
150
151 define Device/openmesh_a42
152 $(call Device/FitImageLzma)
153 DEVICE_DTS := qcom-ipq4018-a42
154 DEVICE_DTS_CONFIG := config@om.a42
155 BLOCKSIZE := 64k
156 DEVICE_TITLE := OpenMesh A42
157 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
158 IMAGE_SIZE := 15616k
159 IMAGES = factory.bin sysupgrade.bin
160 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
161 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
162 DEVICE_PACKAGES := uboot-envtools
163 endef
164 TARGET_DEVICES += openmesh_a42
165
166 define Device/openmesh_a62
167 $(call Device/FitImageLzma)
168 DEVICE_DTS := qcom-ipq4019-a62
169 DEVICE_DTS_CONFIG := config@om.a62
170 BLOCKSIZE := 64k
171 DEVICE_TITLE := OpenMesh A62
172 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
173 IMAGE_SIZE := 15552k
174 IMAGES = factory.bin sysupgrade.bin
175 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
176 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
177 DEVICE_PACKAGES := ath10k-firmware-qca9888 uboot-envtools
178 endef
179
180 TARGET_DEVICES += openmesh_a62
181
182 define Device/qcom_ap-dk01.1-c1
183 DEVICE_TITLE := QCA AP-DK01.1-C1
184 BOARD_NAME := ap-dk01.1-c1
185 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
186 KERNEL_INSTALL := 1
187 KERNEL_SIZE := 4096k
188 IMAGE_SIZE := 26624k
189 $(call Device/FitImage)
190 IMAGES := sysupgrade.bin
191 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
192 endef
193 TARGET_DEVICES += qcom_ap-dk01.1-c1
194
195 define Device/qcom_ap-dk04.1-c1
196 $(call Device/FitImage)
197 $(call Device/UbiFit)
198 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
199 KERNEL_INSTALL := 1
200 KERNEL_SIZE := 4048k
201 BLOCKSIZE := 128k
202 PAGESIZE := 2048
203 BOARD_NAME := ap-dk04.1-c1
204 DEVICE_TITLE := QCA AP-DK04.1-C1
205 endef
206 TARGET_DEVICES += qcom_ap-dk04.1-c1
207
208 define Device/zyxel_wre6606
209 $(call Device/FitImage)
210 DEVICE_TITLE := ZyXEL WRE6606
211 DEVICE_DTS_CONFIG := config@4
212 DEVICE_DTS := qcom-ipq4018-wre6606
213 DEVICE_PACKAGES := ipq-wifi-zyxel_wre6606
214 IMAGES := sysupgrade.bin
215 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
216 endef
217 TARGET_DEVICES += zyxel_wre6606
218
219 $(eval $(call BuildImage))