Makefile 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. include $(TOPDIR)/rules.mk
  2. include $(INCLUDE_DIR)/image.mk
  3. DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
  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. define Device/FitImage
  15. KERNEL_SUFFIX := -fit-uImage.itb
  16. KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  17. KERNEL_NAME := Image
  18. endef
  19. define Device/FitImageLzma
  20. KERNEL_SUFFIX := -fit-uImage.itb
  21. KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  22. KERNEL_NAME := Image
  23. endef
  24. define Device/FitzImage
  25. KERNEL_SUFFIX := -fit-zImage.itb
  26. KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  27. KERNEL_NAME := zImage
  28. endef
  29. define Device/UbiFit
  30. KERNEL_IN_UBI := 1
  31. IMAGES := nand-factory.ubi nand-sysupgrade.bin
  32. IMAGE/nand-factory.ubi := append-ubi
  33. IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
  34. endef
  35. define Device/DniImage
  36. KERNEL_SUFFIX := -fit-uImage.itb
  37. KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  38. KERNEL_NAME := Image
  39. NETGEAR_BOARD_ID :=
  40. NETGEAR_HW_ID :=
  41. IMAGES := factory.img sysupgrade.bin
  42. IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni
  43. IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | append-metadata
  44. endef
  45. DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
  46. define Device/8dev_jalapeno
  47. $(call Device/FitImage)
  48. $(call Device/UbiFit)
  49. DEVICE_DTS := qcom-ipq4018-jalapeno
  50. BLOCKSIZE := 128k
  51. PAGESIZE := 2048
  52. DEVICE_TITLE := 8devices Jalapeno
  53. endef
  54. TARGET_DEVICES += 8dev_jalapeno
  55. define Device/asus_map-ac2200
  56. $(call Device/FitImageLzma)
  57. DEVICE_DTS := qcom-ipq4019-map-ac2200
  58. DEVICE_TITLE := ASUS Lyra MAP-AC2200
  59. IMAGES := sysupgrade.bin
  60. DEVICE_PACKAGES := ipq-wifi-asus_map-ac2200 ath10k-firmware-qca9888-ct kmod-ath3k
  61. endef
  62. TARGET_DEVICES += asus_map-ac2200
  63. define Device/asus_rt-ac58u
  64. $(call Device/FitImageLzma)
  65. DEVICE_DTS := qcom-ipq4018-rt-ac58u
  66. BLOCKSIZE := 128k
  67. PAGESIZE := 2048
  68. DTB_SIZE := 65536
  69. DEVICE_TITLE := Asus RT-AC58U
  70. IMAGE_SIZE := 20439364
  71. FILESYSTEMS := squashfs
  72. # Someone - in their infinite wisdom - decided to put the firmware
  73. # version in front of the image name \03\00\00\04 => Version 3.0.0.4
  74. # Since u-boot works with strings we either need another fixup step
  75. # to add a version... or we are very careful not to add '\0' into that
  76. # string and call it a day.... Yeah, we do the latter!
  77. UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
  78. IMAGES := sysupgrade.bin
  79. DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
  80. endef
  81. TARGET_DEVICES += asus_rt-ac58u
  82. define Device/avm_fritzbox-4040
  83. $(call Device/FitImageLzma)
  84. DEVICE_DTS := qcom-ipq4018-fritz4040
  85. BOARD_NAME := fritz4040
  86. DEVICE_TITLE := AVM Fritz!Box 4040
  87. IMAGE_SIZE := 29753344
  88. UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin
  89. UBOOT_PARTITION_SIZE := 524288
  90. IMAGES = eva.bin sysupgrade.bin
  91. IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
  92. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  93. DEVICE_PACKAGES := fritz-tffs fritz-caldata
  94. endef
  95. TARGET_DEVICES += avm_fritzbox-4040
  96. define Device/compex_wpj428
  97. $(call Device/FitImage)
  98. DEVICE_DTS := qcom-ipq4028-wpj428
  99. DEVICE_DTS_CONFIG := config@4
  100. BLOCKSIZE := 64k
  101. DEVICE_TITLE := Compex WPJ428
  102. IMAGE_SIZE := 31232k
  103. KERNEL_SIZE := 4096k
  104. IMAGES = sysupgrade.bin
  105. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  106. DEVICE_PACKAGES := kmod-gpio-beeper
  107. endef
  108. TARGET_DEVICES += compex_wpj428
  109. define Device/engenius_eap1300
  110. $(call Device/FitImage)
  111. DEVICE_TITLE := EnGenius EAP1300
  112. DEVICE_DTS_CONFIG := config@4
  113. BOARD_NAME := eap1300
  114. DEVICE_DTS := qcom-ipq4018-eap1300
  115. KERNEL_SIZE := 5120k
  116. IMAGE_SIZE := 25344k
  117. IMAGES := sysupgrade.bin
  118. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  119. DEVICE_PACKAGES := ipq-wifi-engenius_eap1300
  120. endef
  121. TARGET_DEVICES += engenius_eap1300
  122. define Device/glinet_gl-b1300
  123. $(call Device/FitImage)
  124. DEVICE_TITLE := GL.iNet GL-B1300
  125. BOARD_NAME := gl-b1300
  126. DEVICE_DTS := qcom-ipq4029-gl-b1300
  127. KERNEL_SIZE := 4096k
  128. IMAGE_SIZE := 26624k
  129. IMAGES := sysupgrade.bin
  130. IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
  131. endef
  132. TARGET_DEVICES += glinet_gl-b1300
  133. define Device/linksys_ea6350v3
  134. # The Linksys EA6350v3 has a uboot bootloader that does not
  135. # support either booting lzma kernel images nor booting UBI
  136. # partitions. This uboot, however, supports raw kernel images and
  137. # gzipped images.
  138. #
  139. # As for the time of writing this, the device will boot the kernel
  140. # from a fixed address with a fixed length of 3MiB. Also, the
  141. # device has a hard-coded kernel command line that requieres the
  142. # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively.
  143. # Oh... and the kernel partition overlaps with the rootfs
  144. # partition (the same for alt_kernel and alt_rootfs).
  145. #
  146. # If you are planing re-partitioning the device, you may want to
  147. # keep those details in mind:
  148. # 1. The kernel adresses you should honor are 0x00000000 and
  149. # 0x02800000 respectively.
  150. # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size.
  151. # 3. You can use 'zImage', but not a raw 'Image' packed with lzma.
  152. # 4. The kernel command line from uboot is harcoded to boot with
  153. # rootfs either in mtd11 or mtd13.
  154. $(call Device/FitzImage)
  155. DEVICE_TITLE := Linksys EA6350v3
  156. DEVICE_DTS := qcom-ipq4018-ea6350v3
  157. BLOCKSIZE := 128k
  158. PAGESIZE := 2048
  159. KERNEL_SIZE := 3145728
  160. IMAGE_SIZE := 38797312
  161. UBINIZE_OPTS := -E 5
  162. IMAGES := factory.bin sysupgrade.bin
  163. IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA6350v3
  164. DEVICE_PACKAGES := ipq-wifi-linksys_ea6350v3 uboot-envtools
  165. endef
  166. TARGET_DEVICES += linksys_ea6350v3
  167. define Device/meraki_mr33
  168. $(call Device/FitImage)
  169. DEVICE_DTS := qcom-ipq4029-mr33
  170. BLOCKSIZE := 131072
  171. PAGESIZE := 2048
  172. DEVICE_TITLE := Cisco Meraki MR33
  173. IMAGES = sysupgrade.bin
  174. DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
  175. endef
  176. TARGET_DEVICES += meraki_mr33
  177. define Device/netgear_ex61x0v2
  178. $(call Device/DniImage)
  179. DEVICE_DTS_CONFIG := config@4
  180. NETGEAR_BOARD_ID := EX6150v2series
  181. NETGEAR_HW_ID := 29765285+16+0+128+2x2
  182. endef
  183. define Device/netgear_ex6100v2
  184. $(call Device/netgear_ex61x0v2)
  185. DEVICE_DTS := qcom-ipq4018-ex6100v2
  186. DEVICE_TITLE := Netgear EX6100v2
  187. endef
  188. TARGET_DEVICES += netgear_ex6100v2
  189. define Device/netgear_ex6150v2
  190. $(call Device/netgear_ex61x0v2)
  191. DEVICE_DTS := qcom-ipq4018-ex6150v2
  192. DEVICE_TITLE := Netgear EX6150v2
  193. endef
  194. TARGET_DEVICES += netgear_ex6150v2
  195. define Device/openmesh_a42
  196. $(call Device/FitImageLzma)
  197. DEVICE_DTS := qcom-ipq4018-a42
  198. DEVICE_DTS_CONFIG := [email protected]
  199. BLOCKSIZE := 64k
  200. DEVICE_TITLE := OpenMesh A42
  201. KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
  202. IMAGE_SIZE := 15616k
  203. IMAGES = factory.bin sysupgrade.bin
  204. IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
  205. IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
  206. DEVICE_PACKAGES := uboot-envtools
  207. endef
  208. TARGET_DEVICES += openmesh_a42
  209. define Device/openmesh_a62
  210. $(call Device/FitImageLzma)
  211. DEVICE_DTS := qcom-ipq4019-a62
  212. DEVICE_DTS_CONFIG := [email protected]
  213. BLOCKSIZE := 64k
  214. DEVICE_TITLE := OpenMesh A62
  215. KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
  216. IMAGE_SIZE := 15552k
  217. IMAGES = factory.bin sysupgrade.bin
  218. IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
  219. IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
  220. DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
  221. endef
  222. TARGET_DEVICES += openmesh_a62
  223. define Device/qcom_ap-dk01.1-c1
  224. DEVICE_TITLE := QCA AP-DK01.1-C1
  225. BOARD_NAME := ap-dk01.1-c1
  226. DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
  227. KERNEL_INSTALL := 1
  228. KERNEL_SIZE := 4096k
  229. IMAGE_SIZE := 26624k
  230. $(call Device/FitImage)
  231. IMAGES := sysupgrade.bin
  232. IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
  233. endef
  234. TARGET_DEVICES += qcom_ap-dk01.1-c1
  235. define Device/qcom_ap-dk04.1-c1
  236. $(call Device/FitImage)
  237. $(call Device/UbiFit)
  238. DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
  239. KERNEL_INSTALL := 1
  240. KERNEL_SIZE := 4048k
  241. BLOCKSIZE := 128k
  242. PAGESIZE := 2048
  243. BOARD_NAME := ap-dk04.1-c1
  244. DEVICE_TITLE := QCA AP-DK04.1-C1
  245. endef
  246. TARGET_DEVICES += qcom_ap-dk04.1-c1
  247. define Device/zyxel_nbg6617
  248. $(call Device/FitImageLzma)
  249. DEVICE_DTS := qcom-ipq4018-nbg6617
  250. DEVICE_TITLE := ZyXEL NBG6617
  251. ROOTFS_SIZE := 24960k
  252. RAS_BOARD := NBG6617
  253. RAS_ROOTFS_SIZE := 19840k
  254. RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
  255. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  256. IMAGES := sysupgrade.bin factory.bin
  257. # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
  258. # at least as large as the one of the initial firmware image (not the current
  259. # one on the device). This only applies to the Web-UI, the bootlaoder ignores
  260. # this minimum-size. However, the larger image can be flashed both ways.
  261. IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
  262. IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
  263. DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
  264. endef
  265. TARGET_DEVICES += zyxel_nbg6617
  266. define Device/zyxel_wre6606
  267. $(call Device/FitImage)
  268. DEVICE_TITLE := ZyXEL WRE6606
  269. DEVICE_DTS_CONFIG := config@4
  270. DEVICE_DTS := qcom-ipq4018-wre6606
  271. IMAGES := sysupgrade.bin
  272. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  273. endef
  274. TARGET_DEVICES += zyxel_wre6606
  275. $(eval $(call BuildImage))