4ab0c8e7b0463b589afc902b1d0cfa12af1b5a02
[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
35 define Device/asus_rt-ac58u
36 $(call Device/FitImageLzma)
37 DEVICE_DTS := qcom-ipq4018-rt-ac58u
38 BLOCKSIZE := 128k
39 PAGESIZE := 2048
40 DTB_SIZE := 65536
41 DEVICE_TITLE := Asus RT-AC58U
42 IMAGE_SIZE := 20439364
43 FILESYSTEMS := squashfs
44 # Someone - in their infinite wisdom - decided to put the firmware
45 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
46 # Since u-boot works with strings we either need another fixup step
47 # to add a version... or we are very careful not to add '\0' into that
48 # string and call it a day.... Yeah, we do the latter!
49 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
50 IMAGES := sysupgrade.bin
51 DEVICE_PACKAGES := ipq-wifi-asus_rt-ac58u kmod-usb-ledtrig-usbport
52 endef
53 TARGET_DEVICES += asus_rt-ac58u
54
55 define Device/avm_fritzbox-4040
56 $(call Device/FitImageLzma)
57 DEVICE_DTS := qcom-ipq4019-fritz4040
58 BOARD_NAME := fritz4040
59 DEVICE_TITLE := AVM Fritz!Box 4040
60 IMAGE_SIZE := 29753344
61 IMAGES = sysupgrade.bin
62 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
63 DEVICE_PACKAGES := ipq-wifi-avm_fritzbox-4040 fritz-tffs fritz-caldata u-boot-fritz4040
64 endef
65 TARGET_DEVICES += avm_fritzbox-4040
66
67 define Device/compex_wpj428
68 $(call Device/FitImage)
69 DEVICE_DTS := qcom-ipq4028-wpj428
70 DEVICE_DTS_CONFIG := config@4
71 BLOCKSIZE := 64k
72 DEVICE_TITLE := Compex WPJ428
73 IMAGE_SIZE := 31232k
74 KERNEL_SIZE := 4096k
75 IMAGES = sysupgrade.bin
76 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
77 DEVICE_PACKAGES := ath10k-firmware-qca4019 kmod-gpio-beeper
78 endef
79 TARGET_DEVICES += compex_wpj428
80
81 define Device/glinet_gl-b1300
82 $(call Device/FitImage)
83 DEVICE_TITLE := GL.iNet GL-B1300
84 BOARD_NAME := gl-b1300
85 DEVICE_DTS := qcom-ipq4029-gl-b1300
86 KERNEL_SIZE := 4096k
87 IMAGE_SIZE := 26624k
88 IMAGES := sysupgrade.bin
89 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
90 DEVICE_PACKAGES := ipq-wifi-glinet_gl-b1300
91 endef
92 TARGET_DEVICES += glinet_gl-b1300
93
94 define Device/meraki_mr33
95 $(call Device/FitImage)
96 DEVICE_DTS := qcom-ipq4029-mr33
97 BLOCKSIZE := 131072
98 PAGESIZE := 2048
99 DEVICE_TITLE := Cisco Meraki MR33
100 IMAGES = sysupgrade.bin
101 DEVICE_PACKAGES := -swconfig ipq-wifi-meraki_mr33 ath10k-firmware-qca9887
102 endef
103 TARGET_DEVICES += meraki_mr33
104
105 define Device/openmesh_a42
106 $(call Device/FitImageLzma)
107 DEVICE_DTS := qcom-ipq4018-a42
108 BLOCKSIZE := 64k
109 SUPPORTED_DEVICES := openmesh,a42
110 DEVICE_TITLE := OpenMesh A42
111 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
112 IMAGE_SIZE := 15616k
113 IMAGES = factory.bin sysupgrade.bin
114 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
115 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
116 DEVICE_PACKAGES := ath10k-firmware-qca4019 uboot-envtools
117 endef
118 TARGET_DEVICES += openmesh_a42
119
120 define Device/qcom_ap-dk01.1-c1
121 DEVICE_TITLE := QCA AP-DK01.1-C1
122 BOARD_NAME := ap-dk01.1-c1
123 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
124 KERNEL_INSTALL := 1
125 KERNEL_SIZE := 4096k
126 IMAGE_SIZE := 26624k
127 $(call Device/FitImage)
128 IMAGES := sysupgrade.bin
129 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
130 DEVICE_PACKAGES := ath10k-firmware-qca4019
131 endef
132 TARGET_DEVICES += qcom_ap-dk01.1-c1
133
134 define Device/qcom_ap-dk04.1-c1
135 $(call Device/FitImage)
136 $(call Device/UbiFit)
137 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
138 KERNEL_INSTALL := 1
139 KERNEL_SIZE := 4048k
140 BLOCKSIZE := 128k
141 PAGESIZE := 2048
142 BOARD_NAME := ap-dk04.1-c1
143 DEVICE_TITLE := QCA AP-DK04.1-C1
144 endef
145 TARGET_DEVICES += qcom_ap-dk04.1-c1
146
147 $(eval $(call BuildImage))