generic.mk 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. define Device/bsb
  2. BOARDNAME = BSB
  3. IMAGE_SIZE = 16000k
  4. CONSOLE = ttyATH0,115200
  5. MTDPARTS = spi0.0:128k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(art)ro
  6. endef
  7. TARGET_DEVICES += bsb
  8. define Device/carambola2
  9. BOARDNAME = CARAMBOLA2
  10. IMAGE_SIZE = 16000k
  11. CONSOLE = ttyATH0,115200
  12. MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
  13. endef
  14. TARGET_DEVICES += carambola2
  15. define Device/cf-e316n-v2
  16. BOARDNAME = CF-E316N-V2
  17. IMAGE_SIZE = 16192k
  18. CONSOLE = ttyS0,115200
  19. MTDPARTS = spi0.0:64k(u-boot)ro,64k(art)ro,16192k(firmware),64k(nvram)ro
  20. endef
  21. TARGET_DEVICES += cf-e316n-v2
  22. define Device/domywifi-dw33d
  23. BOARDNAME = DW33D
  24. IMAGE_SIZE = 16000k
  25. CONSOLE = ttyS0,115200
  26. MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware);ar934x-nfc:96m(rootfs_data),32m(backup)ro
  27. IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 14528k | append-kernel | check-size $$$$(IMAGE_SIZE)
  28. endef
  29. TARGET_DEVICES += domywifi-dw33d
  30. define Device/weio
  31. BOARDNAME = WEIO
  32. IMAGE_SIZE = 16000k
  33. CONSOLE = ttyATH0,115200
  34. MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
  35. endef
  36. TARGET_DEVICES += weio
  37. define Device/gl-ar150
  38. BOARDNAME = GL-AR150
  39. IMAGE_SIZE = 16000k
  40. CONSOLE = ttyATH0,115200
  41. MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
  42. endef
  43. TARGET_DEVICES += gl-ar150
  44. define Device/gl-ar300
  45. BOARDNAME = GL-AR300
  46. IMAGE_SIZE = 16000k
  47. CONSOLE = ttyS0,115200
  48. MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
  49. endef
  50. TARGET_DEVICES += gl-ar300
  51. define Device/gl-domino
  52. BOARDNAME = DOMINO
  53. IMAGE_SIZE = 16000k
  54. CONSOLE = ttyATH0,115200
  55. MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
  56. endef
  57. TARGET_DEVICES += gl-domino
  58. define Device/wndr3700
  59. BOARDNAME = WNDR3700
  60. NETGEAR_KERNEL_MAGIC = 0x33373030
  61. NETGEAR_BOARD_ID = WNDR3700
  62. IMAGE_SIZE = 7680k
  63. MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
  64. IMAGES := sysupgrade.bin factory.img factory-NA.img
  65. KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
  66. IMAGE/default = append-kernel $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
  67. IMAGE/sysupgrade.bin = $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
  68. IMAGE/factory.img = $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
  69. IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
  70. endef
  71. define Device/wndr3700v2
  72. $(Device/wndr3700)
  73. NETGEAR_BOARD_ID = WNDR3700v2
  74. NETGEAR_KERNEL_MAGIC = 0x33373031
  75. NETGEAR_HW_ID = 29763654+16+64
  76. IMAGE_SIZE = 15872k
  77. MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro
  78. IMAGES := sysupgrade.bin factory.img
  79. endef
  80. define Device/wndr3800
  81. $(Device/wndr3700v2)
  82. NETGEAR_BOARD_ID = WNDR3800
  83. NETGEAR_HW_ID = 29763654+16+128
  84. endef
  85. define Device/wndr3800ch
  86. $(Device/wndr3800)
  87. NETGEAR_BOARD_ID = WNDR3800CH
  88. endef
  89. define Device/wndrmac
  90. $(Device/wndr3700v2)
  91. NETGEAR_BOARD_ID = WNDRMAC
  92. endef
  93. define Device/wndrmacv2
  94. $(Device/wndr3800)
  95. NETGEAR_BOARD_ID = WNDRMACv2
  96. endef
  97. TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
  98. define Device/cap324
  99. BOARDNAME := CAP324
  100. DEVICE_PROFILE := CAP324
  101. IMAGE_SIZE = 15296k
  102. MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,15296k(firmware),640k(certs),64k(nvram),64k(art)
  103. endef
  104. TARGET_DEVICES += cap324
  105. define Device/cap324-nocloud
  106. BOARDNAME := CAP324
  107. DEVICE_PROFILE := CAP324
  108. IMAGE_SIZE = 16000k
  109. MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,16000k(firmware),64k(art)
  110. endef
  111. TARGET_DEVICES += cap324-nocloud
  112. define Device/cr3000
  113. BOARDNAME := CR3000
  114. DEVICE_PROFILE := CR3000
  115. IMAGE_SIZE = 7104k
  116. MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)
  117. endef
  118. TARGET_DEVICES += cr3000
  119. define Device/cr3000-nocloud
  120. BOARDNAME := CR3000
  121. DEVICE_PROFILE := CR3000
  122. IMAGE_SIZE = 7808k
  123. MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,7808k(firmware),64k(art)
  124. endef
  125. TARGET_DEVICES += cr3000-nocloud
  126. define Device/cr5000
  127. BOARDNAME := CR5000
  128. DEVICE_PROFILE := CR5000
  129. IMAGE_SIZE = 7104k
  130. MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)
  131. endef
  132. TARGET_DEVICES += cr5000
  133. define Device/cr5000-nocloud
  134. BOARDNAME := CR5000
  135. DEVICE_PROFILE := CR5000
  136. IMAGE_SIZE = 7808k
  137. MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,7808k(firmware),64k(art)
  138. endef
  139. TARGET_DEVICES += cr5000-nocloud
  140. define Device/antminer-s1
  141. $(Device/tplink-8mlzma)
  142. BOARDNAME := ANTMINER-S1
  143. DEVICE_PROFILE := ANTMINERS1
  144. TPLINK_HWID := 0x04440101
  145. CONSOLE := ttyATH0,115200
  146. endef
  147. define Device/antminer-s3
  148. $(Device/tplink-8mlzma)
  149. BOARDNAME := ANTMINER-S3
  150. DEVICE_PROFILE := ANTMINERS3
  151. TPLINK_HWID := 0x04440301
  152. CONSOLE := ttyATH0,115200
  153. endef
  154. define Device/antrouter-r1
  155. $(Device/tplink-8mlzma)
  156. BOARDNAME := ANTROUTER-R1
  157. DEVICE_PROFILE := ANTROUTERR1
  158. TPLINK_HWID := 0x44440101
  159. CONSOLE := ttyATH0,115200
  160. endef
  161. define Device/el-m150
  162. $(Device/tplink-8mlzma)
  163. BOARDNAME := EL-M150
  164. DEVICE_PROFILE := ELM150
  165. TPLINK_HWID := 0x01500101
  166. CONSOLE := ttyATH0,115200
  167. endef
  168. define Device/el-mini
  169. $(Device/tplink-8mlzma)
  170. BOARDNAME := EL-MINI
  171. DEVICE_PROFILE := ELMINI
  172. TPLINK_HWID := 0x01530001
  173. CONSOLE := ttyATH0,115200
  174. endef
  175. TARGET_DEVICES += antminer-s1 antminer-s3 antrouter-r1 el-m150 el-mini
  176. define Device/gl-inet-6408A-v1
  177. $(Device/tplink-8mlzma)
  178. BOARDNAME := GL-INET
  179. DEVICE_PROFILE := GLINET
  180. TPLINK_HWID := 0x08000001
  181. CONSOLE := ttyATH0,115200
  182. endef
  183. define Device/gl-inet-6416A-v1
  184. $(Device/tplink-16mlzma)
  185. BOARDNAME := GL-INET
  186. DEVICE_PROFILE := GLINET
  187. TPLINK_HWID := 0x08000001
  188. CONSOLE := ttyATH0,115200
  189. endef
  190. TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1
  191. define Device/rnx-n360rt
  192. $(Device/tplink-4m)
  193. BOARDNAME := TL-WR941ND
  194. DEVICE_PROFILE := RNXN360RT
  195. TPLINK_HWID := 0x09410002
  196. TPLINK_HWREV := 0x00420001
  197. endef
  198. TARGET_DEVICES += rnx-n360rt
  199. define Device/mc-mac1200r
  200. $(Device/tplink-8mlzma)
  201. BOARDNAME := MC-MAC1200R
  202. DEVICE_PROFILE := MAC1200R
  203. TPLINK_HWID := 0x12000001
  204. endef
  205. TARGET_DEVICES += mc-mac1200r
  206. define Device/minibox-v1
  207. $(Device/tplink-16mlzma)
  208. BOARDNAME := MINIBOX-V1
  209. DEVICE_PROFILE := MINIBOXV1
  210. TPLINK_HWID := 0x3C000201
  211. CONSOLE := ttyATH0,115200
  212. endef
  213. TARGET_DEVICES += minibox-v1
  214. define Device/omy-g1
  215. $(Device/tplink-16mlzma)
  216. BOARDNAME := OMY-G1
  217. DEVICE_PROFILE := OMYG1
  218. TPLINK_HWID := 0x06660101
  219. endef
  220. define Device/omy-x1
  221. $(Device/tplink-8mlzma)
  222. BOARDNAME := OMY-X1
  223. DEVICE_PROFILE := OMYX1
  224. TPLINK_HWID := 0x06660201
  225. endef
  226. TARGET_DEVICES += omy-g1 omy-x1
  227. define Device/onion-omega
  228. $(Device/tplink-16mlzma)
  229. BOARDNAME := ONION-OMEGA
  230. DEVICE_PROFILE := OMEGA
  231. TPLINK_HWID := 0x04700001
  232. CONSOLE := ttyATH0,115200
  233. endef
  234. TARGET_DEVICES += onion-omega
  235. define Device/smart-300
  236. $(Device/tplink-8mlzma)
  237. BOARDNAME := SMART-300
  238. DEVICE_PROFILE := SMART-300
  239. TPLINK_HWID := 0x93410001
  240. endef
  241. TARGET_DEVICES += smart-300
  242. define Device/som9331
  243. $(Device/tplink-8mlzma)
  244. BOARDNAME := SOM9331
  245. DEVICE_PROFILE := SOM9331
  246. TPLINK_HWID := 0x04800054
  247. CONSOLE := ttyATH0,115200
  248. endef
  249. TARGET_DEVICES += som9331
  250. define Device/tellstick-znet-lite
  251. $(Device/tplink-16mlzma)
  252. BOARDNAME := TELLSTICK-ZNET-LITE
  253. DEVICE_PROFILE := TELLSTICKZNETLITE
  254. TPLINK_HWID := 0x00726001
  255. CONSOLE := ttyATH0,115200
  256. endef
  257. TARGET_DEVICES += tellstick-znet-lite
  258. define Device/oolite
  259. $(Device/tplink-16mlzma)
  260. BOARDNAME := GS-OOLITE
  261. DEVICE_PROFILE := OOLITE
  262. TPLINK_HWID := 0x3C000101
  263. CONSOLE := ttyATH0,115200
  264. endef
  265. TARGET_DEVICES += oolite
  266. define Device/NBG6616
  267. BOARDNAME = NBG6616
  268. KERNEL_SIZE = 2048k
  269. IMAGE_SIZE = 15323k
  270. MTDPARTS = spi0.0:192k(u-boot)ro,64k(env)ro,64k(RFdata)ro,384k(zyxel_rfsd),384k(romd),64k(header),2048k(kernel),13184k(rootfs),15232k@0x120000(firmware)
  271. CMDLINE += mem=128M
  272. IMAGES := sysupgrade.bin
  273. KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot/vmlinux.lzma.uImage
  274. IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
  275. # We cannot currently build a factory image. It is the sysupgrade image
  276. # prefixed with a header (which is actually written into the MTD device).
  277. # The header is 2kiB and is filled with 0xff. The format seems to be:
  278. # 2 bytes: 0x0000
  279. # 2 bytes: checksum of the data partition (big endian)
  280. # 4 bytes: length of the contained image file (big endian)
  281. # 32 bytes: Firmware Version string (NUL terminated, 0xff padded)
  282. # 2 bytes: 0x0000
  283. # 2 bytes: checksum over the header partition (big endian)
  284. # 32 bytes: Model (e.g. "NBG6616", NUL termiated, 0xff padded)
  285. # rest: 0xff padding
  286. #
  287. # The checksums are calculated by adding up all bytes and if a 16bit
  288. # overflow occurs, one is added and the sum is masked to 16 bit:
  289. # csum = csum + databyte; if (csum > 0xffff) { csum += 1; csum &= 0xffff };
  290. # Should the file have an odd number of bytes then the byte len-0x800 is
  291. # used additionally.
  292. # The checksum for the header is calcualted over the first 2048 bytes with
  293. # the firmware checksum as the placeholder during calculation.
  294. #
  295. # The header is padded with 0xff to the erase block size of the device.
  296. endef
  297. TARGET_DEVICES += NBG6616
  298. define Device/c-55
  299. BOARDNAME = C-55
  300. KERNEL_SIZE = 2048k
  301. IMAGE_SIZE = 15872k
  302. MTDPARTS = spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,2048k(kernel),13824k(rootfs),13824k(opt)ro,2624k(failsafe)ro,64k(art)ro,15872k@0x60000(firmware)
  303. IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
  304. endef
  305. TARGET_DEVICES += c-55
  306. define Build/uImageHiWiFi
  307. # Field ih_name needs to start with "tw150v1"
  308. mkimage -A $(LINUX_KARCH) \
  309. -O linux -T kernel \
  310. -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
  311. -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new
  312. @mv $@.new $@
  313. endef
  314. define Device/hiwifi-hc6361
  315. BOARDNAME := HiWiFi-HC6361
  316. DEVICE_PROFILE := HIWIFI_HC6361
  317. IMAGE_SIZE := 16128k
  318. KERNEL := kernel-bin | patch-cmdline | lzma | uImageHiWiFi lzma
  319. CONSOLE := ttyATH0,115200
  320. MTDPARTS := spi0.0:64k(u-boot)ro,64k(bdinfo)ro,16128k(firmware),64k(backup)ro,64k(art)ro
  321. endef
  322. TARGET_DEVICES += hiwifi-hc6361