ipq807x: image: fix eMMC flashing/recovery from within initramfs
[openwrt/staging/pepe2k.git] / target / linux / ipq807x / image / generic.mk
1 define Device/FitImage
2 KERNEL_SUFFIX := -uImage.itb
3 KERNEL = kernel-bin | libdeflate-gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
4 KERNEL_NAME := Image
5 endef
6
7 define Device/FitImageLzma
8 KERNEL_SUFFIX := -uImage.itb
9 KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
10 KERNEL_NAME := Image
11 endef
12
13 define Device/EmmcImage
14 IMAGES += factory.bin sysupgrade.bin
15 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
16 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
17 endef
18
19 define Device/UbiFit
20 KERNEL_IN_UBI := 1
21 IMAGES := factory.ubi sysupgrade.bin
22 IMAGE/factory.ubi := append-ubi
23 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
24 endef
25
26 define Device/buffalo_wxr-5950ax12
27 $(call Device/FitImage)
28 DEVICE_VENDOR := Buffalo
29 DEVICE_MODEL := WXR-5950AX12
30 BLOCKSIZE := 128k
31 PAGESIZE := 2048
32 DEVICE_DTS_CONFIG := config@hk01
33 SOC := ipq8074
34 IMAGES := sysupgrade.bin
35 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
36 DEVICE_PACKAGES := ipq-wifi-buffalo_wxr-5950ax12
37 endef
38 TARGET_DEVICES += buffalo_wxr-5950ax12
39
40 define Device/dynalink_dl-wrx36
41 $(call Device/FitImage)
42 $(call Device/UbiFit)
43 DEVICE_VENDOR := Dynalink
44 DEVICE_MODEL := DL-WRX36
45 BLOCKSIZE := 128k
46 PAGESIZE := 2048
47 DEVICE_DTS_CONFIG := config@rt5010w-d350-rev0
48 SOC := ipq8072
49 DEVICE_PACKAGES := ipq-wifi-dynalink_dl-wrx36
50 endef
51 TARGET_DEVICES += dynalink_dl-wrx36
52
53 define Device/edgecore_eap102
54 $(call Device/FitImage)
55 $(call Device/UbiFit)
56 DEVICE_VENDOR := Edgecore
57 DEVICE_MODEL := EAP102
58 BLOCKSIZE := 128k
59 PAGESIZE := 2048
60 DEVICE_DTS_CONFIG := config@ac02
61 SOC := ipq8071
62 DEVICE_PACKAGES := ipq-wifi-edgecore_eap102
63 IMAGE/factory.ubi := append-ubi | qsdk-ipq-factory-nand
64 endef
65 TARGET_DEVICES += edgecore_eap102
66
67 define Device/edimax_cax1800
68 $(call Device/FitImage)
69 $(call Device/UbiFit)
70 DEVICE_VENDOR := Edimax
71 DEVICE_MODEL := CAX1800
72 BLOCKSIZE := 128k
73 PAGESIZE := 2048
74 DEVICE_DTS_CONFIG := config@ac03
75 SOC := ipq8070
76 DEVICE_PACKAGES := ipq-wifi-edimax_cax1800
77 endef
78 TARGET_DEVICES += edimax_cax1800
79
80 define Device/netgear_wax218
81 $(call Device/FitImage)
82 $(call Device/UbiFit)
83 ARTIFACTS := web-ui-factory.fit
84 DEVICE_VENDOR := Netgear
85 DEVICE_MODEL := WAX218
86 DEVICE_DTS_CONFIG := config@hk07
87 BLOCKSIZE := 128k
88 PAGESIZE := 2048
89 SOC := ipq8072
90 ARTIFACT/web-ui-factory.fit := append-image initramfs-uImage.itb | \
91 ubinize-kernel | qsdk-ipq-factory-nand
92 DEVICE_PACKAGES := kmod-spi-gpio kmod-spi-bitbang kmod-gpio-nxp-74hc164 \
93 ipq-wifi-netgear_wax218
94 endef
95 TARGET_DEVICES += netgear_wax218
96
97 define Device/prpl_haze
98 $(call Device/FitImage)
99 $(call Device/EmmcImage)
100 DEVICE_VENDOR := prpl Foundation
101 DEVICE_MODEL := Haze
102 DEVICE_DTS_CONFIG := config@hk09
103 SOC := ipq8072
104 DEVICE_PACKAGES += ath11k-firmware-qcn9074 ipq-wifi-prpl_haze kmod-ath11k-pci
105 endef
106 TARGET_DEVICES += prpl_haze
107
108 define Device/qnap_301w
109 $(call Device/FitImage)
110 $(call Device/EmmcImage)
111 DEVICE_VENDOR := QNAP
112 DEVICE_MODEL := 301w
113 DEVICE_DTS_CONFIG := config@hk01
114 KERNEL_SIZE := 16384k
115 SOC := ipq8072
116 DEVICE_PACKAGES += ipq-wifi-qnap_301w
117 endef
118 TARGET_DEVICES += qnap_301w
119
120 define Device/redmi_ax6
121 $(call Device/xiaomi_ax3600)
122 DEVICE_VENDOR := Redmi
123 DEVICE_MODEL := AX6
124 DEVICE_PACKAGES := ipq-wifi-redmi_ax6
125 endef
126 TARGET_DEVICES += redmi_ax6
127
128 define Device/xiaomi_ax3600
129 $(call Device/FitImage)
130 $(call Device/UbiFit)
131 DEVICE_VENDOR := Xiaomi
132 DEVICE_MODEL := AX3600
133 BLOCKSIZE := 128k
134 PAGESIZE := 2048
135 DEVICE_DTS_CONFIG := config@ac04
136 SOC := ipq8071
137 KERNEL_SIZE := 36608k
138 DEVICE_PACKAGES := ipq-wifi-xiaomi_ax3600 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9887-ct
139 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
140 ARTIFACTS := initramfs-factory.ubi
141 ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
142 endif
143 endef
144 TARGET_DEVICES += xiaomi_ax3600
145
146 define Device/xiaomi_ax9000
147 $(call Device/FitImage)
148 $(call Device/UbiFit)
149 DEVICE_VENDOR := Xiaomi
150 DEVICE_MODEL := AX9000
151 BLOCKSIZE := 128k
152 PAGESIZE := 2048
153 DEVICE_DTS_CONFIG := config@hk14
154 SOC := ipq8072
155 KERNEL_SIZE := 57344k
156 DEVICE_PACKAGES := ipq-wifi-xiaomi_ax9000 kmod-ath11k-pci ath11k-firmware-qcn9074 \
157 kmod-ath10k-ct ath10k-firmware-qca9887-ct
158 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
159 ARTIFACTS := initramfs-factory.ubi
160 ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
161 endif
162 endef
163 TARGET_DEVICES += xiaomi_ax9000
164
165 define Device/zyxel_nbg7815
166 $(call Device/FitImage)
167 $(call Device/EmmcImage)
168 DEVICE_VENDOR := ZYXEL
169 DEVICE_MODEL := NBG7815
170 DEVICE_DTS_CONFIG := config@nbg7815
171 SOC := ipq8074
172 DEVICE_PACKAGES += ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci kmod-hwmon-tmp103 \
173 kmod-bluetooth
174 endef
175 TARGET_DEVICES += zyxel_nbg7815