b305ea096090c8689ebf8da00a42edbe5e6f697b
[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 DEVICE_PACKAGES := ipq-wifi-8dev_jalapeno
55 endef
56 TARGET_DEVICES += 8dev_jalapeno
57
58 define Device/asus_rt-ac58u
59 $(call Device/FitImageLzma)
60 DEVICE_DTS := qcom-ipq4018-rt-ac58u
61 BLOCKSIZE := 128k
62 PAGESIZE := 2048
63 DTB_SIZE := 65536
64 DEVICE_TITLE := Asus RT-AC58U
65 IMAGE_SIZE := 20439364
66 FILESYSTEMS := squashfs
67 # Someone - in their infinite wisdom - decided to put the firmware
68 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
69 # Since u-boot works with strings we either need another fixup step
70 # to add a version... or we are very careful not to add '\0' into that
71 # string and call it a day.... Yeah, we do the latter!
72 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
73 IMAGES := sysupgrade.bin
74 DEVICE_PACKAGES := ipq-wifi-asus_rt-ac58u kmod-usb-ledtrig-usbport
75 endef
76 TARGET_DEVICES += asus_rt-ac58u
77
78 define Device/avm_fritzbox-4040
79 $(call Device/FitImageLzma)
80 DEVICE_DTS := qcom-ipq4018-fritz4040
81 BOARD_NAME := fritz4040
82 DEVICE_TITLE := AVM Fritz!Box 4040
83 IMAGE_SIZE := 29753344
84 IMAGES = sysupgrade.bin
85 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
86 DEVICE_PACKAGES := ipq-wifi-avm_fritzbox-4040 fritz-tffs fritz-caldata u-boot-fritz4040
87 endef
88 TARGET_DEVICES += avm_fritzbox-4040
89
90 define Device/compex_wpj428
91 $(call Device/FitImage)
92 DEVICE_DTS := qcom-ipq4028-wpj428
93 DEVICE_DTS_CONFIG := config@4
94 BLOCKSIZE := 64k
95 DEVICE_TITLE := Compex WPJ428
96 IMAGE_SIZE := 31232k
97 KERNEL_SIZE := 4096k
98 IMAGES = sysupgrade.bin
99 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
100 DEVICE_PACKAGES := kmod-gpio-beeper
101 endef
102 TARGET_DEVICES += compex_wpj428
103
104 define Device/glinet_gl-b1300
105 $(call Device/FitImage)
106 DEVICE_TITLE := GL.iNet GL-B1300
107 BOARD_NAME := gl-b1300
108 DEVICE_DTS := qcom-ipq4029-gl-b1300
109 KERNEL_SIZE := 4096k
110 IMAGE_SIZE := 26624k
111 IMAGES := sysupgrade.bin
112 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
113 DEVICE_PACKAGES := ipq-wifi-glinet_gl-b1300
114 endef
115 TARGET_DEVICES += glinet_gl-b1300
116
117 define Device/meraki_mr33
118 $(call Device/FitImage)
119 DEVICE_DTS := qcom-ipq4029-mr33
120 BLOCKSIZE := 131072
121 PAGESIZE := 2048
122 DEVICE_TITLE := Cisco Meraki MR33
123 IMAGES = sysupgrade.bin
124 DEVICE_PACKAGES := -swconfig ipq-wifi-meraki_mr33 ath10k-firmware-qca9887
125 endef
126 TARGET_DEVICES += meraki_mr33
127
128 define Device/netgear_ex61x0v2
129 $(call Device/DniImage)
130 KERNEL_SIZE := 3080192
131 DEVICE_DTS_CONFIG := config@4
132 DEVICE_PACKAGES := ipq-wifi-netgear_ex61x0v2
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/qcom_ap-dk01.1-c1
167 DEVICE_TITLE := QCA AP-DK01.1-C1
168 BOARD_NAME := ap-dk01.1-c1
169 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
170 KERNEL_INSTALL := 1
171 KERNEL_SIZE := 4096k
172 IMAGE_SIZE := 26624k
173 $(call Device/FitImage)
174 IMAGES := sysupgrade.bin
175 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
176 endef
177 TARGET_DEVICES += qcom_ap-dk01.1-c1
178
179 define Device/qcom_ap-dk04.1-c1
180 $(call Device/FitImage)
181 $(call Device/UbiFit)
182 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
183 KERNEL_INSTALL := 1
184 KERNEL_SIZE := 4048k
185 BLOCKSIZE := 128k
186 PAGESIZE := 2048
187 BOARD_NAME := ap-dk04.1-c1
188 DEVICE_TITLE := QCA AP-DK04.1-C1
189 endef
190 TARGET_DEVICES += qcom_ap-dk04.1-c1
191
192 $(eval $(call BuildImage))