02-cr660x.patch 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. --- a/target/linux/ramips/image/mt7621.mk
  2. +++ b/target/linux/ramips/image/mt7621.mk
  3. @@ -157,6 +157,65 @@ define Device/nand
  4. IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  5. endef
  6. +define Device/phicomm_k2p-32m
  7. + IMAGE_SIZE := 32128k
  8. + DEVICE_VENDOR := Phicomm
  9. + DEVICE_MODEL := K2P
  10. + DEVICE_VARIANT := 32M
  11. + SUPPORTED_DEVICES += k2p-32M
  12. + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
  13. +endef
  14. +TARGET_DEVICES += phicomm_k2p-32m
  15. +
  16. +define Device/jdcloud_re-sp-01b
  17. + $(Device/dsa-migration)
  18. + $(Device/uimage-lzma-loader)
  19. + IMAGE_SIZE := 32448k
  20. + DEVICE_VENDOR := JDCloud
  21. + DEVICE_MODEL := RE-SP-01B
  22. + DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-sdhci-mt7620 kmod-usb3
  23. + endef
  24. + TARGET_DEVICES += jdcloud_re-sp-01b
  25. +
  26. +define Device/jdcloud_luban
  27. + $(Device/dsa-migration)
  28. + $(Device/uimage-lzma-loader)
  29. + IMAGE_SIZE := 15808k
  30. + DEVICE_VENDOR := JDCloud
  31. + DEVICE_MODEL := Luban 鲁班
  32. + DEVICE_PACKAGES += kmod-mt7915e uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
  33. +endef
  34. +TARGET_DEVICES += jdcloud_luban
  35. +
  36. +define Device/zte_e8820s
  37. + $(Device/dsa-migration)
  38. + $(Device/uimage-lzma-loader)
  39. + BLOCKSIZE := 128k
  40. + PAGESIZE := 2048
  41. + KERNEL_SIZE := 4096k
  42. + UBINIZE_OPTS := -E 5
  43. + IMAGE_SIZE := 130304k
  44. + IMAGES += factory.bin
  45. + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  46. + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  47. + check-size
  48. + DEVICE_VENDOR := ZTE
  49. + DEVICE_MODEL := E8820S
  50. + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 uboot-envtools
  51. +endef
  52. +TARGET_DEVICES += zte_e8820s
  53. +
  54. +define Device/zte_e8820v2
  55. + $(Device/dsa-migration)
  56. + $(Device/uimage-lzma-loader)
  57. + IMAGE_SIZE := 16064k
  58. + DEVICE_VENDOR := ZTE
  59. + DEVICE_MODEL := E8820V2
  60. + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb2 \
  61. + kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
  62. +endef
  63. +TARGET_DEVICES += zte_e8820v2
  64. +
  65. define Device/adslr_g7
  66. $(Device/dsa-migration)
  67. IMAGE_SIZE := 16064k
  68. @@ -2427,7 +2486,6 @@ define Device/xiaomi_nand_separate
  69. $(Device/nand)
  70. $(Device/uimage-lzma-loader)
  71. DEVICE_VENDOR := Xiaomi
  72. - IMAGES += kernel1.bin rootfs0.bin
  73. IMAGE/kernel1.bin := append-kernel
  74. IMAGE/rootfs0.bin := append-ubi | check-size
  75. endef
  76. @@ -2511,30 +2569,14 @@ define Device/xiaomi_mi-router-cr660x
  77. $(Device/nand)
  78. $(Device/uimage-lzma-loader)
  79. DEVICE_VENDOR := Xiaomi
  80. + DEVICE_MODEL := Mi Router CR660X / TR60X
  81. IMAGE_SIZE := 128512k
  82. - IMAGES += firmware.bin
  83. - IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  84. + IMAGES += factory.bin
  85. + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  86. check-size
  87. DEVICE_PACKAGES += kmod-mt7915-firmware
  88. endef
  89. -
  90. -define Device/xiaomi_mi-router-cr6606
  91. - $(Device/xiaomi_mi-router-cr660x)
  92. - DEVICE_MODEL := Mi Router CR6606
  93. -endef
  94. -TARGET_DEVICES += xiaomi_mi-router-cr6606
  95. -
  96. -define Device/xiaomi_mi-router-cr6608
  97. - $(Device/xiaomi_mi-router-cr660x)
  98. - DEVICE_MODEL := Mi Router CR6608
  99. -endef
  100. -TARGET_DEVICES += xiaomi_mi-router-cr6608
  101. -
  102. -define Device/xiaomi_mi-router-cr6609
  103. - $(Device/xiaomi_mi-router-cr660x)
  104. - DEVICE_MODEL := Mi Router CR6609
  105. -endef
  106. -TARGET_DEVICES += xiaomi_mi-router-cr6609
  107. +TARGET_DEVICES += xiaomi_mi-router-cr660x
  108. define Device/xiaomi_redmi-router-ac2100
  109. $(Device/xiaomi_nand_separate)
  110. --- /dev/null
  111. +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts
  112. @@ -0,0 +1,8 @@
  113. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  114. +
  115. +#include "mt7621_xiaomi_mi-router-cr660x.dtsi"
  116. +
  117. +/ {
  118. + compatible = "xiaomi,mi-router-cr660x", "mediatek,mt7621-soc";
  119. + model = "Xiaomi Mi Router CR6606 / CR6608 / CR6609";
  120. +};
  121. --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
  122. +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
  123. @@ -131,9 +131,7 @@ tplink,tl-wpa8631p-v3)
  124. xiaomi,mi-router-ac2100)
  125. ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan"
  126. ;;
  127. -xiaomi,mi-router-cr6606|\
  128. -xiaomi,mi-router-cr6608|\
  129. -xiaomi,mi-router-cr6609)
  130. +xiaomi,mi-router-cr660x)
  131. ucidef_set_led_netdev "internet" "Internet" "blue:net" "wan"
  132. ;;
  133. xiaomi,redmi-router-ac2100)
  134. --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
  135. +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
  136. @@ -48,9 +48,7 @@ ramips_setup_interfaces()
  137. sim,simax1800t|\
  138. xiaomi,mi-router-3-pro|\
  139. xiaomi,mi-router-ac2100|\
  140. - xiaomi,mi-router-cr6606|\
  141. - xiaomi,mi-router-cr6608|\
  142. - xiaomi,mi-router-cr6609|\
  143. + xiaomi,mi-router-cr660x|\
  144. xiaomi,redmi-router-ac2100|\
  145. zyxel,wsm20)
  146. ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
  147. @@ -68,6 +66,7 @@ ramips_setup_interfaces()
  148. iptime,a3002mesh|\
  149. jcg,q20|\
  150. lenovo,newifi-d1|\
  151. + jdcloud,re-sp-01b|\
  152. mikrotik,routerboard-m33g|\
  153. mts,wg430223|\
  154. oraybox,x3a|\
  155. --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
  156. +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
  157. @@ -109,9 +109,8 @@ platform_do_upgrade() {
  158. xiaomi,mi-router-3-pro|\
  159. xiaomi,mi-router-4|\
  160. xiaomi,mi-router-ac2100|\
  161. - xiaomi,mi-router-cr6606|\
  162. - xiaomi,mi-router-cr6608|\
  163. - xiaomi,mi-router-cr6609|\
  164. + xiaomi,mi-router-cr660x|\
  165. + zte,e8820s|\
  166. xiaomi,redmi-router-ac2100|\
  167. zyxel,nwa50ax|\
  168. zyxel,nwa55axe)
  169. --- a/package/boot/uboot-envtools/files/ramips
  170. +++ b/package/boot/uboot-envtools/files/ramips
  171. @@ -73,9 +73,7 @@ zyxel,nr7101)
  172. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  173. ;;
  174. bolt,arion|\
  175. -xiaomi,mi-router-cr6606|\
  176. -xiaomi,mi-router-cr6608|\
  177. -xiaomi,mi-router-cr6609)
  178. +xiaomi,mi-router-cr660x)
  179. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  180. ;;
  181. esac
  182. --- /dev/null
  183. +++ b/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts
  184. @@ -0,0 +1,150 @@
  185. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  186. +
  187. +#include "mt7621.dtsi"
  188. +
  189. +#include <dt-bindings/gpio/gpio.h>
  190. +#include <dt-bindings/input/input.h>
  191. +
  192. +/ {
  193. + compatible = "jdcloud,re-sp-01b", "mediatek,mt7621-soc";
  194. + model = "JDCloud RE-SP-01B";
  195. +
  196. + aliases {
  197. + led-boot = &led_red;
  198. + led-failsafe = &led_red;
  199. + led-running = &led_green;
  200. + led-upgrade = &led_blue;
  201. + label-mac-device = &gmac0;
  202. + };
  203. +
  204. + chosen {
  205. + bootargs = "console=ttyS0,115200";
  206. + };
  207. +
  208. + keys {
  209. + compatible = "gpio-keys";
  210. +
  211. + reset {
  212. + label = "reset";
  213. + gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
  214. + linux,code = <KEY_RESTART>;
  215. + };
  216. + };
  217. +
  218. + leds {
  219. + compatible = "gpio-leds";
  220. +
  221. + led_red: red {
  222. + label = "red:sys";
  223. + gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
  224. + panic-indicator;
  225. + };
  226. +
  227. + led_green: green {
  228. + label = "green:sys";
  229. + gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
  230. + };
  231. +
  232. + led_blue: blue {
  233. + label = "blue:sys";
  234. + gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
  235. + };
  236. + };
  237. +};
  238. +
  239. +&sdhci {
  240. + status = "okay";
  241. +};
  242. +
  243. +&spi0 {
  244. + status = "okay";
  245. +
  246. + flash@0 {
  247. + compatible = "jedec,spi-nor";
  248. + reg = <0>;
  249. + spi-max-frequency = <50000000>;
  250. +
  251. + partitions {
  252. + compatible = "fixed-partitions";
  253. + #address-cells = <1>;
  254. + #size-cells = <1>;
  255. +
  256. + partition@0 {
  257. + label = "u-boot";
  258. + reg = <0x0 0x30000>;
  259. + read-only;
  260. + };
  261. +
  262. + config: partition@30000 {
  263. + label = "config";
  264. + reg = <0x30000 0x10000>;
  265. + read-only;
  266. + };
  267. +
  268. + factory: partition@40000 {
  269. + label = "factory";
  270. + reg = <0x40000 0x10000>;
  271. + read-only;
  272. + };
  273. +
  274. + partition@50000 {
  275. + compatible = "denx,uimage";
  276. + label = "firmware";
  277. + reg = <0x50000 0x1fb0000>;
  278. + };
  279. + };
  280. + };
  281. +};
  282. +
  283. +&gmac0 {
  284. + mtd-mac-address-ascii = <&config 0x4429>;
  285. +};
  286. +
  287. +&switch0 {
  288. + ports {
  289. + port@0 {
  290. + status = "okay";
  291. + label = "wan";
  292. + };
  293. +
  294. + port@1 {
  295. + status = "okay";
  296. + label = "lan1";
  297. + };
  298. +
  299. + port@2 {
  300. + status = "okay";
  301. + label = "lan2";
  302. + };
  303. + };
  304. +};
  305. +
  306. +&pcie {
  307. + status = "okay";
  308. +};
  309. +
  310. +&pcie0 {
  311. + wifi@0,0 {
  312. + reg = <0x0000 0 0 0 0>;
  313. + mtd-mac-address-ascii = <&config 0x4429>;
  314. + mediatek,mtd-eeprom = <&factory 0x0>;
  315. + };
  316. +};
  317. +
  318. +&pcie1 {
  319. + wifi@0,0 {
  320. + reg = <0x0000 0 0 0 0>;
  321. + mtd-mac-address-ascii = <&config 0x4429>;
  322. + mtd-mac-address-increment = <0x80>;
  323. + mtd-mac-address-increment-byte = <3>;
  324. + mediatek,mtd-eeprom = <&factory 0x8000>;
  325. + ieee80211-freq-limit = <5000000 6000000>;
  326. + };
  327. +};
  328. +
  329. +&state_default {
  330. + gpio {
  331. + groups = "uart2", "uart3", "wdt";
  332. + function = "gpio";
  333. + };
  334. +};