xx_vv_immortalwrt/target/linux/mediatek/dts/mt7981b-cmcc-rax3000me.dts
Tianling Shen 57f31cd5b1
mediatek: add CMCC RAX3000Me support
Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: 64GB eMMC or 128 MB SPI-NAND
  RAM: 512MB DDR3 or DDR4
  Ethernet: 4x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset, Mesh
  Power: DC 12V 1A

Gain SSH access:
1. Login into web interface, and download the configuration.
2. Get the SN of the device from web interface or the label on the back of the device.
3. Calculate configuration decryption password:
   Command "eval" is necessary here as the encryption implentation treats '$...' as (empty) variables.
   decpwd="$(eval echo $(openssl passwd -1 -salt aV6dW8bD "your_device_sn"))"
4. Decrypt the configuration:
   openssl aes-256-cbc -d -pbkdf2 -k "$decpwd" -in cfg_export_config_file.conf -out cfg_export_config_file.conf.dec
5. Enter fakeroot, decompress the configuration:
   tar -zxf cfg_export_config_file.conf.dec
6. Edit 'etc/shadow', update (remove) root password: 'root::19179:0:99999:7:::'
7. Edit 'etc/rc.local', insert telnetd command before 'exit 0':
   ( sleep 3s; telnetd; ) &
8. Repack the configuration:
   tar -zc etc/ | openssl aes-256-cbc -pbkdf2 -k "$decpwd" -out cfg_export_config_file.conf
   * If you find an error about 'etc/wireless/mediatek/DBDC_card0.dat',
     just ignore it.
9. Upload new configuration via web interface, now you can connect to
   CMCC RAX3000Me via telnet.
(Big thanks to https://github.com/lyq1996 who reverse engineered the encryption method)

Check flash type:
If '/dev/mmcblk0' exists on the device, it's eMMC version.
If '/dev/mtd0' exists on the device, it's NAND version.

eMMC Flash instructions:
1. Connect to RAX3000Me, and backup everything, especially 'factory' part.
   ('data' partition can be ignored, it's useless.)
2. Write new GPT table:
   dd if=immortalwrt-mediatek-filogic-cmcc_rax3000me-emmc-gpt.bin of=/dev/mmcblk0 bs=512 seek=0 count=34 conv=fsync
3. Write new BL2:
   echo 0 > /sys/block/mmcblk0boot0/force_ro
   dd if=immortalwrt-mediatek-filogic-cmcc_rax3000me-emmc-preloader.bin of=/dev/mmcblk0boot0 bs=512 conv=fsync
4. Write new FIP:
   dd if=immortalwrt-mediatek-filogic-cmcc_rax3000me-emmc-bl31-uboot.fip of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync
5. Set static IP on your PC:
   IP 192.168.1.254/24, GW 192.168.1.1
6. Serve ImmortalWrt initramfs image using TFTP server.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After ImmortalWrt has booted, perform sysupgrade.

NAND Flash instructions:
1. Connect to RAX3000Me, and backup everything, especially 'Factory' part.
2. Write new BL2 and FIP:
   If your device HAS USB port, run:
     mtd write immortalwrt-mediatek-filogic-cmcc_rax3000me-nand-ddr3-preloader.bin BL2
     mtd write immortalwrt-mediatek-filogic-cmcc_rax3000me-nand-ddr3-bl31-uboot.fip FIP
   If your device DOES NOT have USB port, run:
     mtd write immortalwrt-mediatek-filogic-cmcc_rax3000me-nand-ddr4-preloader.bin BL2
     mtd write immortalwrt-mediatek-filogic-cmcc_rax3000me-nand-ddr4-bl31-uboot.fip FIP
4. Set static IP on your PC:
   IP 192.168.1.254/24, GW 192.168.1.1
5. Serve ImmortalWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. After ImmortalWrt has booted, perform sysupgrade.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-03-09 04:19:11 +08:00

10 lines
186 B
Plaintext

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7981b-cmcc-rax3000m.dts"
/ {
model = "CMCC RAX3000Me";
compatible = "cmcc,rax3000me", "mediatek,mt7981";
};