cr660x.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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. @@ -1906,7 +1914,7 @@ define Device/xiaomi_mi-router-4a-gigabit
  105. DEVICE_VENDOR := Xiaomi
  106. DEVICE_MODEL := Mi Router 4A
  107. DEVICE_VARIANT := Gigabit Edition
  108. - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
  109. + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  110. endef
  111. TARGET_DEVICES += xiaomi_mi-router-4a-gigabit
  112. @@ -1927,30 +1935,14 @@ define Device/xiaomi_mi-router-cr660x
  113. KERNEL_SIZE := 4096k
  114. UBINIZE_OPTS := -E 5
  115. IMAGE_SIZE := 128512k
  116. - IMAGES += firmware.bin
  117. + IMAGES += factory.bin
  118. IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  119. - IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  120. + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  121. check-size
  122. DEVICE_PACKAGES += kmod-mt7915e uboot-envtools
  123. + DEVICE_MODEL := Mi Router CR6606 / CR6608 / CR6609
  124. endef
  125. -
  126. -define Device/xiaomi_mi-router-cr6606
  127. - $(Device/xiaomi_mi-router-cr660x)
  128. - DEVICE_MODEL := Mi Router CR6606
  129. -endef
  130. -TARGET_DEVICES += xiaomi_mi-router-cr6606
  131. -
  132. -define Device/xiaomi_mi-router-cr6608
  133. - $(Device/xiaomi_mi-router-cr660x)
  134. - DEVICE_MODEL := Mi Router CR6608
  135. -endef
  136. -TARGET_DEVICES += xiaomi_mi-router-cr6608
  137. -
  138. -define Device/xiaomi_mi-router-cr6609
  139. - $(Device/xiaomi_mi-router-cr660x)
  140. - DEVICE_MODEL := Mi Router CR6609
  141. -endef
  142. -TARGET_DEVICES += xiaomi_mi-router-cr6609
  143. +TARGET_DEVICES += xiaomi_mi-router-cr660x
  144. define Device/xiaomi_redmi-router-ac2100
  145. $(Device/xiaomi_nand_separate)
  146. @@ -1985,7 +1977,7 @@ define Device/youhua_wr1200js
  147. DEVICE_VENDOR := YouHua
  148. DEVICE_MODEL := WR1200JS
  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. endef
  153. TARGET_DEVICES += youhua_wr1200js
  154. @@ -1995,7 +1987,7 @@ define Device/youku_yk-l2
  155. DEVICE_VENDOR := Youku
  156. DEVICE_MODEL := YK-L2
  157. DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
  158. - kmod-usb-ledtrig-usbport
  159. + kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
  160. endef
  161. TARGET_DEVICES += youku_yk-l2
  162. --- /dev/null
  163. +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts
  164. @@ -0,0 +1,8 @@
  165. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  166. +
  167. +#include "mt7621_xiaomi_mi-router-cr660x.dtsi"
  168. +
  169. +/ {
  170. + compatible = "xiaomi,mi-router-cr660x", "mediatek,mt7621-soc";
  171. + model = "Xiaomi Mi Router CR6606 / CR6608 / CR6609";
  172. +};
  173. --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
  174. +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
  175. @@ -131,9 +131,7 @@ tplink,tl-wpa8631p-v3)
  176. xiaomi,mi-router-ac2100)
  177. ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan"
  178. ;;
  179. -xiaomi,mi-router-cr6606|\
  180. -xiaomi,mi-router-cr6608|\
  181. -xiaomi,mi-router-cr6609)
  182. +xiaomi,mi-router-cr660x)
  183. ucidef_set_led_netdev "internet" "Internet" "blue:net" "wan"
  184. ;;
  185. xiaomi,redmi-router-ac2100)
  186. --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
  187. +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
  188. @@ -28,9 +28,7 @@ ramips_setup_interfaces()
  189. hiwifi,hc5962|\
  190. xiaomi,mi-router-3-pro|\
  191. xiaomi,mi-router-ac2100|\
  192. - xiaomi,mi-router-cr6606|\
  193. - xiaomi,mi-router-cr6608|\
  194. - xiaomi,mi-router-cr6609|\
  195. + xiaomi,mi-router-cr660x|\
  196. xiaomi,redmi-router-ac2100)
  197. ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
  198. ;;
  199. @@ -45,6 +43,7 @@ ramips_setup_interfaces()
  200. iptime,a3002mesh|\
  201. jcg,q20|\
  202. lenovo,newifi-d1|\
  203. + jdcloud,re-sp-01b|\
  204. mikrotik,routerboard-m33g|\
  205. oraybox,x3a|\
  206. renkforce,ws-wn530hp3-a|\
  207. --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
  208. +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
  209. @@ -88,9 +88,7 @@ platform_do_upgrade() {
  210. xiaomi,mi-router-3-pro|\
  211. xiaomi,mi-router-4|\
  212. xiaomi,mi-router-ac2100|\
  213. - xiaomi,mi-router-cr6606|\
  214. - xiaomi,mi-router-cr6608|\
  215. - xiaomi,mi-router-cr6609|\
  216. + xiaomi,mi-router-cr660x|\
  217. xiaomi,redmi-router-ac2100)
  218. nand_do_upgrade "$1"
  219. ;;
  220. --- a/package/boot/uboot-envtools/files/ramips
  221. +++ b/package/boot/uboot-envtools/files/ramips
  222. @@ -73,9 +73,7 @@ zyxel,nr7101)
  223. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
  224. ;;
  225. bolt,arion|\
  226. -xiaomi,mi-router-cr6606|\
  227. -xiaomi,mi-router-cr6608|\
  228. -xiaomi,mi-router-cr6609)
  229. +xiaomi,mi-router-cr660x)
  230. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  231. ;;
  232. esac
  233. --- /dev/null
  234. +++ b/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts
  235. @@ -0,0 +1,150 @@
  236. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  237. +
  238. +#include "mt7621.dtsi"
  239. +
  240. +#include <dt-bindings/gpio/gpio.h>
  241. +#include <dt-bindings/input/input.h>
  242. +
  243. +/ {
  244. + compatible = "jdcloud,re-sp-01b", "mediatek,mt7621-soc";
  245. + model = "JDCloud RE-SP-01B";
  246. +
  247. + aliases {
  248. + led-boot = &led_red;
  249. + led-failsafe = &led_red;
  250. + led-running = &led_green;
  251. + led-upgrade = &led_blue;
  252. + label-mac-device = &gmac0;
  253. + };
  254. +
  255. + chosen {
  256. + bootargs = "console=ttyS0,115200";
  257. + };
  258. +
  259. + keys {
  260. + compatible = "gpio-keys";
  261. +
  262. + reset {
  263. + label = "reset";
  264. + gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
  265. + linux,code = <KEY_RESTART>;
  266. + };
  267. + };
  268. +
  269. + leds {
  270. + compatible = "gpio-leds";
  271. +
  272. + led_red: red {
  273. + label = "red:sys";
  274. + gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
  275. + panic-indicator;
  276. + };
  277. +
  278. + led_green: green {
  279. + label = "green:sys";
  280. + gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
  281. + };
  282. +
  283. + led_blue: blue {
  284. + label = "blue:sys";
  285. + gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
  286. + };
  287. + };
  288. +};
  289. +
  290. +&sdhci {
  291. + status = "okay";
  292. +};
  293. +
  294. +&spi0 {
  295. + status = "okay";
  296. +
  297. + flash@0 {
  298. + compatible = "jedec,spi-nor";
  299. + reg = <0>;
  300. + spi-max-frequency = <50000000>;
  301. +
  302. + partitions {
  303. + compatible = "fixed-partitions";
  304. + #address-cells = <1>;
  305. + #size-cells = <1>;
  306. +
  307. + partition@0 {
  308. + label = "u-boot";
  309. + reg = <0x0 0x30000>;
  310. + read-only;
  311. + };
  312. +
  313. + config: partition@30000 {
  314. + label = "config";
  315. + reg = <0x30000 0x10000>;
  316. + read-only;
  317. + };
  318. +
  319. + factory: partition@40000 {
  320. + label = "factory";
  321. + reg = <0x40000 0x10000>;
  322. + read-only;
  323. + };
  324. +
  325. + partition@50000 {
  326. + compatible = "denx,uimage";
  327. + label = "firmware";
  328. + reg = <0x50000 0x1fb0000>;
  329. + };
  330. + };
  331. + };
  332. +};
  333. +
  334. +&gmac0 {
  335. + mtd-mac-address-ascii = <&config 0x4429>;
  336. +};
  337. +
  338. +&switch0 {
  339. + ports {
  340. + port@0 {
  341. + status = "okay";
  342. + label = "wan";
  343. + };
  344. +
  345. + port@1 {
  346. + status = "okay";
  347. + label = "lan1";
  348. + };
  349. +
  350. + port@2 {
  351. + status = "okay";
  352. + label = "lan2";
  353. + };
  354. + };
  355. +};
  356. +
  357. +&pcie {
  358. + status = "okay";
  359. +};
  360. +
  361. +&pcie0 {
  362. + wifi@0,0 {
  363. + reg = <0x0000 0 0 0 0>;
  364. + mtd-mac-address-ascii = <&config 0x4429>;
  365. + mediatek,mtd-eeprom = <&factory 0x0>;
  366. + };
  367. +};
  368. +
  369. +&pcie1 {
  370. + wifi@0,0 {
  371. + reg = <0x0000 0 0 0 0>;
  372. + mtd-mac-address-ascii = <&config 0x4429>;
  373. + mtd-mac-address-increment = <0x80>;
  374. + mtd-mac-address-increment-byte = <3>;
  375. + mediatek,mtd-eeprom = <&factory 0x8000>;
  376. + ieee80211-freq-limit = <5000000 6000000>;
  377. + };
  378. +};
  379. +
  380. +&state_default {
  381. + gpio {
  382. + groups = "uart2", "uart3", "wdt";
  383. + function = "gpio";
  384. + };
  385. +};