01-cr660x.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. From 593d238ebf777c36c9ee819a1e20f59da5adc361 Mon Sep 17 00:00:00 2001
  2. From: kiddin9 <[email protected]>
  3. Date: Tue, 5 Jul 2022 17:54:53 +0800
  4. Subject: [PATCH] Update mt7621.mk
  5. Signed-off-by: kiddin9 <[email protected]>
  6. ---
  7. target/linux/ramips/image/mt7621.mk | 46 +++++++++--------------------
  8. 1 file changed, 14 insertions(+), 32 deletions(-)
  9. diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
  10. index bdaeac2cb16e..72fbd3930a80 100644
  11. --- a/target/linux/ramips/image/mt7621.mk
  12. +++ b/target/linux/ramips/image/mt7621.mk
  13. @@ -223,7 +223,7 @@ define Device/asus_rt-n56u-b1
  14. DEVICE_VARIANT := B1
  15. IMAGE_SIZE := 16064k
  16. DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
  17. - kmod-usb-ledtrig-usbport
  18. + kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  19. endef
  20. TARGET_DEVICES += asus_rt-n56u-b1
  21. @@ -984,7 +984,7 @@ define Device/jcg_y2
  22. JCG_MAXSIZE := 16064k
  23. DEVICE_VENDOR := JCG
  24. DEVICE_MODEL := Y2
  25. - DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3
  26. + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  27. endef
  28. TARGET_DEVICES += jcg_y2
  29. @@ -1000,6 +1000,16 @@ define Device/lenovo_newifi-d1
  30. endef
  31. TARGET_DEVICES += lenovo_newifi-d1
  32. +define Device/jdcloud_re-sp-01b
  33. + $(Device/dsa-migration)
  34. + $(Device/uimage-lzma-loader)
  35. + IMAGE_SIZE := 32448k
  36. + DEVICE_VENDOR := JDCloud
  37. + DEVICE_MODEL := RE-SP-01B
  38. + DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-sdhci-mt7620 kmod-usb3
  39. + endef
  40. + TARGET_DEVICES += jdcloud_re-sp-01b
  41. +
  42. define Device/linksys_e5600
  43. $(Device/dsa-migration)
  44. $(Device/uimage-lzma-loader)
  45. @@ -1369,7 +1379,7 @@ define Device/netgear_wndr3700-v5
  46. SERCOMM_SWVER := 0x1054
  47. SERCOMM_PAD := 320k
  48. DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
  49. - kmod-usb-ledtrig-usbport
  50. + kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  51. SUPPORTED_DEVICES += wndr3700v5
  52. endef
  53. TARGET_DEVICES += netgear_wndr3700-v5
  54. @@ -1400,7 +1410,7 @@ define Device/oraybox_x3a
  55. IMAGE_SIZE := 15360k
  56. DEVICE_VENDOR := OrayBox
  57. DEVICE_MODEL := X3A
  58. - DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
  59. + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  60. endef
  61. TARGET_DEVICES += oraybox_x3a
  62. @@ -1412,7 +1422,7 @@ define Device/phicomm_k2p
  63. DEVICE_ALT0_VENDOR := Phicomm
  64. DEVICE_ALT0_MODEL := KE 2P
  65. SUPPORTED_DEVICES += k2p
  66. - DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
  67. + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  68. endef
  69. TARGET_DEVICES += phicomm_k2p
  70. @@ -1533,7 +1543,7 @@ define Device/thunder_timecloud
  71. IMAGE_SIZE := 16064k
  72. DEVICE_VENDOR := Thunder
  73. DEVICE_MODEL := Timecloud
  74. - DEVICE_PACKAGES := kmod-usb3 -wpad-basic-wolfssl
  75. + DEVICE_PACKAGES := kmod-usb3 -wpad-basic-wolfssl -bash -openssh-sftp-server -coremark -htop
  76. SUPPORTED_DEVICES += timecloud
  77. endef
  78. TARGET_DEVICES += thunder_timecloud
  79. @@ -1843,7 +1853,6 @@ define Device/xiaomi_nand_separate
  80. PAGESIZE := 2048
  81. KERNEL_SIZE := 4096k
  82. UBINIZE_OPTS := -E 5
  83. - IMAGES += kernel1.bin rootfs0.bin
  84. IMAGE/kernel1.bin := append-kernel
  85. IMAGE/rootfs0.bin := append-ubi | check-size
  86. IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  87. @@ -1866,7 +1875,7 @@ define Device/xiaomi_mi-router-3g-v2
  88. DEVICE_VENDOR := Xiaomi
  89. DEVICE_MODEL := Mi Router 3G
  90. DEVICE_VARIANT := v2
  91. - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
  92. + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  93. SUPPORTED_DEVICES += xiaomi,mir3g-v2
  94. endef
  95. TARGET_DEVICES += xiaomi_mi-router-3g-v2
  96. @@ -1881,7 +1890,6 @@ define Device/xiaomi_mi-router-3-pro
  97. IMAGE_SIZE := 255488k
  98. DEVICE_VENDOR := Xiaomi
  99. DEVICE_MODEL := Mi Router 3 Pro
  100. - IMAGES += factory.bin
  101. IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  102. IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  103. check-size
  104. @@ -1927,30 +1935,14 @@ define Device/xiaomi_mi-router-cr660x
  105. KERNEL_SIZE := 4096k
  106. UBINIZE_OPTS := -E 5
  107. IMAGE_SIZE := 128512k
  108. - IMAGES += firmware.bin
  109. + IMAGES += factory.bin
  110. IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  111. - IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  112. + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  113. check-size
  114. DEVICE_PACKAGES += kmod-mt7915e uboot-envtools
  115. + DEVICE_MODEL := Mi Router CR660X / TR60X
  116. endef
  117. -
  118. -define Device/xiaomi_mi-router-cr6606
  119. - $(Device/xiaomi_mi-router-cr660x)
  120. - DEVICE_MODEL := Mi Router CR6606
  121. -endef
  122. -TARGET_DEVICES += xiaomi_mi-router-cr6606
  123. -
  124. -define Device/xiaomi_mi-router-cr6608
  125. - $(Device/xiaomi_mi-router-cr660x)
  126. - DEVICE_MODEL := Mi Router CR6608
  127. -endef
  128. -TARGET_DEVICES += xiaomi_mi-router-cr6608
  129. -
  130. -define Device/xiaomi_mi-router-cr6609
  131. - $(Device/xiaomi_mi-router-cr660x)
  132. - DEVICE_MODEL := Mi Router CR6609
  133. -endef
  134. -TARGET_DEVICES += xiaomi_mi-router-cr6609
  135. +TARGET_DEVICES += xiaomi_mi-router-cr660x
  136. define Device/xiaomi_redmi-router-ac2100
  137. $(Device/xiaomi_nand_separate)
  138. @@ -1985,7 +1977,7 @@ define Device/youhua_wr1200js
  139. DEVICE_VENDOR := YouHua
  140. DEVICE_MODEL := WR1200JS
  141. DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
  142. - kmod-usb-ledtrig-usbport
  143. + kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  144. endef
  145. TARGET_DEVICES += youhua_wr1200js
  146. @@ -1995,7 +1987,7 @@ define Device/youku_yk-l2
  147. DEVICE_VENDOR := Youku
  148. DEVICE_MODEL := YK-L2
  149. DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
  150. - kmod-usb-ledtrig-usbport
  151. + kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  152. UIMAGE_MAGIC := 0x12291000
  153. UIMAGE_NAME := 400000000000000000003000
  154. --- /dev/null
  155. +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts
  156. @@ -0,0 +1,8 @@
  157. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  158. +
  159. +#include "mt7621_xiaomi_mi-router-cr660x.dtsi"
  160. +
  161. +/ {
  162. + compatible = "xiaomi,mi-router-cr660x", "mediatek,mt7621-soc";
  163. + model = "Xiaomi Mi Router CR6606 / CR6608 / CR6609";
  164. +};
  165. --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
  166. +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
  167. @@ -131,9 +131,7 @@ tplink,tl-wpa8631p-v3)
  168. xiaomi,mi-router-ac2100)
  169. ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan"
  170. ;;
  171. -xiaomi,mi-router-cr6606|\
  172. -xiaomi,mi-router-cr6608|\
  173. -xiaomi,mi-router-cr6609)
  174. +xiaomi,mi-router-cr660x)
  175. ucidef_set_led_netdev "internet" "Internet" "blue:net" "wan"
  176. ;;
  177. xiaomi,redmi-router-ac2100)
  178. --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
  179. +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
  180. @@ -28,9 +28,7 @@ ramips_setup_interfaces()
  181. hiwifi,hc5962|\
  182. xiaomi,mi-router-3-pro|\
  183. xiaomi,mi-router-ac2100|\
  184. - xiaomi,mi-router-cr6606|\
  185. - xiaomi,mi-router-cr6608|\
  186. - xiaomi,mi-router-cr6609|\
  187. + xiaomi,mi-router-cr660x|\
  188. xiaomi,redmi-router-ac2100)
  189. ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
  190. ;;
  191. @@ -45,6 +43,7 @@ ramips_setup_interfaces()
  192. iptime,a3002mesh|\
  193. jcg,q20|\
  194. lenovo,newifi-d1|\
  195. + jdcloud,re-sp-01b|\
  196. mikrotik,routerboard-m33g|\
  197. oraybox,x3a|\
  198. renkforce,ws-wn530hp3-a|\
  199. --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
  200. +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
  201. @@ -92,9 +92,7 @@ platform_do_upgrade() {
  202. xiaomi,mi-router-3-pro|\
  203. xiaomi,mi-router-4|\
  204. xiaomi,mi-router-ac2100|\
  205. - xiaomi,mi-router-cr6606|\
  206. - xiaomi,mi-router-cr6608|\
  207. - xiaomi,mi-router-cr6609|\
  208. + xiaomi,mi-router-cr660x|\
  209. xiaomi,redmi-router-ac2100|\
  210. zyxel,nwa50ax|\
  211. zyxel,nwa55axe)
  212. --- a/package/boot/uboot-envtools/files/ramips
  213. +++ b/package/boot/uboot-envtools/files/ramips
  214. @@ -73,9 +73,7 @@ zyxel,nr7101)
  215. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  216. ;;
  217. bolt,arion|\
  218. -xiaomi,mi-router-cr6606|\
  219. -xiaomi,mi-router-cr6608|\
  220. -xiaomi,mi-router-cr6609)
  221. +xiaomi,mi-router-cr660x)
  222. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  223. ;;
  224. esac
  225. --- /dev/null
  226. +++ b/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts
  227. @@ -0,0 +1,150 @@
  228. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  229. +
  230. +#include "mt7621.dtsi"
  231. +
  232. +#include <dt-bindings/gpio/gpio.h>
  233. +#include <dt-bindings/input/input.h>
  234. +
  235. +/ {
  236. + compatible = "jdcloud,re-sp-01b", "mediatek,mt7621-soc";
  237. + model = "JDCloud RE-SP-01B";
  238. +
  239. + aliases {
  240. + led-boot = &led_red;
  241. + led-failsafe = &led_red;
  242. + led-running = &led_green;
  243. + led-upgrade = &led_blue;
  244. + label-mac-device = &gmac0;
  245. + };
  246. +
  247. + chosen {
  248. + bootargs = "console=ttyS0,115200";
  249. + };
  250. +
  251. + keys {
  252. + compatible = "gpio-keys";
  253. +
  254. + reset {
  255. + label = "reset";
  256. + gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
  257. + linux,code = <KEY_RESTART>;
  258. + };
  259. + };
  260. +
  261. + leds {
  262. + compatible = "gpio-leds";
  263. +
  264. + led_red: red {
  265. + label = "red:sys";
  266. + gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
  267. + panic-indicator;
  268. + };
  269. +
  270. + led_green: green {
  271. + label = "green:sys";
  272. + gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
  273. + };
  274. +
  275. + led_blue: blue {
  276. + label = "blue:sys";
  277. + gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
  278. + };
  279. + };
  280. +};
  281. +
  282. +&sdhci {
  283. + status = "okay";
  284. +};
  285. +
  286. +&spi0 {
  287. + status = "okay";
  288. +
  289. + flash@0 {
  290. + compatible = "jedec,spi-nor";
  291. + reg = <0>;
  292. + spi-max-frequency = <50000000>;
  293. +
  294. + partitions {
  295. + compatible = "fixed-partitions";
  296. + #address-cells = <1>;
  297. + #size-cells = <1>;
  298. +
  299. + partition@0 {
  300. + label = "u-boot";
  301. + reg = <0x0 0x30000>;
  302. + read-only;
  303. + };
  304. +
  305. + config: partition@30000 {
  306. + label = "config";
  307. + reg = <0x30000 0x10000>;
  308. + read-only;
  309. + };
  310. +
  311. + factory: partition@40000 {
  312. + label = "factory";
  313. + reg = <0x40000 0x10000>;
  314. + read-only;
  315. + };
  316. +
  317. + partition@50000 {
  318. + compatible = "denx,uimage";
  319. + label = "firmware";
  320. + reg = <0x50000 0x1fb0000>;
  321. + };
  322. + };
  323. + };
  324. +};
  325. +
  326. +&gmac0 {
  327. + mtd-mac-address-ascii = <&config 0x4429>;
  328. +};
  329. +
  330. +&switch0 {
  331. + ports {
  332. + port@0 {
  333. + status = "okay";
  334. + label = "wan";
  335. + };
  336. +
  337. + port@1 {
  338. + status = "okay";
  339. + label = "lan1";
  340. + };
  341. +
  342. + port@2 {
  343. + status = "okay";
  344. + label = "lan2";
  345. + };
  346. + };
  347. +};
  348. +
  349. +&pcie {
  350. + status = "okay";
  351. +};
  352. +
  353. +&pcie0 {
  354. + wifi@0,0 {
  355. + reg = <0x0000 0 0 0 0>;
  356. + mtd-mac-address-ascii = <&config 0x4429>;
  357. + mediatek,mtd-eeprom = <&factory 0x0>;
  358. + };
  359. +};
  360. +
  361. +&pcie1 {
  362. + wifi@0,0 {
  363. + reg = <0x0000 0 0 0 0>;
  364. + mtd-mac-address-ascii = <&config 0x4429>;
  365. + mtd-mac-address-increment = <0x80>;
  366. + mtd-mac-address-increment-byte = <3>;
  367. + mediatek,mtd-eeprom = <&factory 0x8000>;
  368. + ieee80211-freq-limit = <5000000 6000000>;
  369. + };
  370. +};
  371. +
  372. +&state_default {
  373. + gpio {
  374. + groups = "uart2", "uart3", "wdt";
  375. + function = "gpio";
  376. + };
  377. +};