I've managed to fix it copying some parts from Cudy DTS. Now LAN and WAN is working, Wifi also works fine. All MAC addresses are correct. The only thing I am still not sure if USB stuff is correct in this DTS. I don't know how to test it.
When I plug in my external SSD, I got this:
```
xhci-mtk 11200000.xhci: ERROR Transfer event for unknown stream ring slot 1 ep 2
```
I am not sure if it's related to missing kernel modules or DTS itself...
Also I've got this messages during the boot.
```
[ 49.268843] efuse_probe: efuse = deaddead
[ 49.272914] mt_rbus 0000:00:00.0: Direct firmware load for e2p failed with error -2
[ 49.280564] mt_rbus 0000:00:00.0: Falling back to sysfs fallback for: e2p
[ 49.293624] WiFi@C01L1,os_load_code_from_bin() 2999: fw not available(/lib/firmware/e2p)
[ 49.302582] Use default BIN from:/lib/firmware/MT7981_iPAiLNA_EEPROM.bin.
[ 49.309432] 7981@C02L1,rtmp_ee_flash_init() 444: The EEPROM in Flash is wrong, use default
[ 49.320246] 7981@C02L1,is_cal_free_ic() 830: [a-die version:1]
[ 51.823079] 7981@C17L1,RTMPReadTxPwrPerRate() 450: (450): Don't Support this now!
[ 51.830596] 7981@C01L1,AntCfgInit() 3118: Not support for HIF_MT yet!
```
**Huasifei WH3000**
Portable Wi-Fi 6 travel router based on MediaTek MT7981A SoC. MT7981B+MT7976CN+RTL8221B Dual Core 1.3-1.6GHZ
**Specifications**
SoC: Filogic 820 MT7981A (1.3GHz base could be overclocked to 1.6GHz by `unlockoc` in factory firmware it will change a BL image with an overclocked one. If you want to go back to 1.3Ghz, run `lockoc` in factory firmware once)
RAM: DDR4 1GB
Flash: eMMC 8GB
WiFi: 2.4GHz and 5GHz with 3 antennas
Ethernet:
1x WAN (10/100/1000M)
1x LAN (10/100/1000/2500M)
USB: 1x USB 3.0 port
Two buttons: power/reset and mode (BTN_0)
LEDS: blue, red, blue+red=pink
UART: 3.3V, TX, RX, GND / 115200 8N1 (no need to use 3.3V! Use only TX, RX, and GND)
**Installation via U-Boot rescue**
1. Set static IP 192.168.1.2 on your computer and default route as 192.168.1.1
2. Connect to the WAN port and hold the reset button while booting the device.
3. Wait for the LED to blink 5 times, and release the reset button.
4. Open `U-boot` web page on your browser at `192.168.1.1`
5. Select the OpenWRT `sysupgrade` image, upload it, and start the upgrade.
6. Wait for the router to flash the new firmware.
7. Wait for the router to reboot itself.
**Installation via sysupgrade**
Flash the `sysupgrade` file via [LuCI upgrade page](http://192.168.1.1/cgi-bin/luci/admin/system/flash) without saving the settings.
**Installation via SSH**
Upload the file to the router `/tmp` directory, `ssh root@192.168.1.1` and issue a command:
```
sysupgrade -n /tmp/openwrt-mediatek-filogic-huasifei_wh3000-emmc-squashfs-sysupgrade.bin
```
**MAC addresses**
You can find your Factory MAC, which is mentioned on the box at `/dev/mmcblck0p2` partition `factory` starting from `0x4`
```
dd if=/dev/mmcblk0p2 bs=1 skip=4 count=6 | hexdump -C
```
Factory MAC is on the label, e.g. `XX:XX:XX:XX:XX:A8`
LAN (eth0) is factory + 2, e.g. `XX:XX:XX:XX:XX:AA`
WAN (eth1) is factory + 3, e.g. `XX:XX:XX:XX:XX:AB`
WLAN (2.4G) is factory, e.g. `XX:XX:XX:XX:XX:A8`
WLAN (5G) is factory + 1, e.g. `XX:XX:XX:XX:XX:A9`
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Backport FORESEE NAND chip support from upstream Linux. The newly
introduced FORESEE F35SQA001G was found on the Xiaomi AX3000T.
Signed-off-by: Erik Servili <serverror@serverror.com>
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
(cherry picked from commit 302c717aa3a434676a32a4dde8b10ec2c03798b5)
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>
(cherry picked from commit 57f31cd5b11cb7e590c330845ec74ffa2d6eb13e)