re-cp-02.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. From 985af21123a02ff764156aafff2be4e9cc6e640e Mon Sep 17 00:00:00 2001
  2. From: Sheng Huang <[email protected]>
  3. Date: Mon, 6 May 2024 13:51:27 +0800
  4. Subject: [PATCH] ramips: add support for JDCloud RE-CP-02
  5. - Soc: MediaTek MT7621AT
  6. - RAM: 512 MB (DDR3)
  7. - Flash: 16 MB (SPI NOR)
  8. - WiFi: MediaTek MT7905DAN, MediaTek MT7975DN
  9. - Ethernet: 1 WAN, 3 LAN (Gigabit)
  10. - Buttons: Reset, Joylink
  11. - LEDs: (red, blue, green), routed to one indicator in the top of the
  12. device
  13. - Power: DC 12V 1A tip positive
  14. - 1 TF Card Slot
  15. The pins for the serial console are already labeled on the board
  16. J4(V, R, T, G). Serial settings: 3.3V, 115200
  17. MAC addresses:
  18. | | MAC | Algorithm |
  19. | ------- | ----------------- | --------- |
  20. | label | dc:d8:xx:xx:xx:01 | label |
  21. | LAN | dc:d8:xx:xx:xx:01 | label |
  22. | WAN | dc:d8:xx:xx:xx:02 | label+1 |
  23. | WLAN 2g | dc:d8:xx:xx:xx:03 | label+2 |
  24. | WLAN 5g | de:d8:xx:xx:xx:04 | label+3 |
  25. 1. rename the
  26. openwrt-ramips-mt7621-jdcloud_re-cp-02-squashfs-sysupgrade.bin
  27. to JDCOS.bin
  28. 2. start a TFTP server from IP address 192.168.68.10 and serve the
  29. image named JDCOS.bin
  30. 3. connect your device to the LAN port
  31. 4. power up the router and press any key on the console to interrupt
  32. the boot process.
  33. 5. enter the following commands on the router console
  34. 1. setenv bootcount 6
  35. 2. saveenv
  36. 3. reset
  37. > NOTE: wait for the restart, it will automatically fetch the
  38. > image named JDCOS.bin from the TFTP server and write it into
  39. > the flash. After the writing is completed, the router will be
  40. > automatically restarted.
  41. Unable to recognize large-capacity TF card, see #14042. But the patch
  42. https://github.com/openwrt/openwrt/issues/14042#issuecomment-1910769942
  43. works
  44. Co-Authored-By: Jianti Chen <[email protected]>
  45. Signed-off-by: Sheng Huang <[email protected]>
  46. ---
  47. .../ramips/dts/mt7621_jdcloud_re-cp-02.dts | 186 ++++++++++++++++++
  48. target/linux/ramips/image/mt7621.mk | 9 +
  49. .../mt7621/base-files/etc/init.d/bootcount | 3 +
  50. 3 files changed, 198 insertions(+)
  51. create mode 100644 target/linux/ramips/dts/mt7621_jdcloud_re-cp-02.dts
  52. diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
  53. index 4c6b7057d5a93..cbaf6a9c59941 100644
  54. --- a/target/linux/ramips/image/mt7621.mk
  55. +++ b/target/linux/ramips/image/mt7621.mk
  56. @@ -1534,6 +1534,15 @@ define Device/jcg_y2
  57. endef
  58. TARGET_DEVICES += jcg_y2
  59. +define Device/jdcloud_re-cp-02
  60. + $(Device/dsa-migration)
  61. + IMAGE_SIZE := 16000k
  62. + DEVICE_VENDOR := JD-Cloud
  63. + DEVICE_MODEL := RE-CP-02
  64. + DEVICE_PACKAGES := kmod-mt7915-firmware kmod-sdhci-mt7620
  65. +endef
  66. +TARGET_DEVICES += jdcloud_re-cp-02
  67. +
  68. define Device/keenetic_kn-3010
  69. $(Device/dsa-migration)
  70. $(Device/uimage-lzma-loader)
  71. diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
  72. index c558247341374..06846cd4ca40f 100755
  73. --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
  74. +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
  75. @@ -15,6 +15,9 @@ boot() {
  76. $((0xff)) ]] || printf '\xff' | dd of=/dev/mtdblock3 \
  77. count=1 bs=1 seek=$((0x20001))
  78. ;;
  79. + jdcloud,re-cp-02)
  80. + echo -e "bootcount 0\nbootlimit 5\nupgrade_available 1" | /usr/sbin/fw_setenv -s -
  81. + ;;
  82. linksys,e5600|\
  83. linksys,ea6350-v4|\
  84. linksys,ea7300-v1|\