I recently came across a very interesting device, the Comfast CF-E593AX. There's other devices with similar form factor but most have limited storage, such as from manufacturers like TP-Link.
I initially thought this would be a relatively painless port to Openwrt, but I didn't realize there was no support for the Airoha AN8801SB to get the LAN port working (as far as I know). Searched the web and found older drivers which still work flawlessly as far as I can tell. With the Generic PHY, it was able to detect link but unable to transmit any data.
Specifications:
SOC: MT7981B
RAM: 256MB DDR3
Flash: 128MB Winbond SPI NAND
Ports: 1 LAN (1G Airoha AN8801SB)
1 WAN (1G Mediatek MT7981)
WIFI: MT7976CN
LEDs: 1 (Red, Blue, Green)
Buttons: 1 (Reset)
UART: 3.3v, 115200n8, pins are labeled on PCB.
Form Factor: Standard 86mm in-wall panel design
I've added a PR and would love some reviews and/or advice:
I've created a device page as well.
main ← ses1er:comfast-cf-e593ax-v2
opened 06:43PM - 08 Mar 26 UTC
Specifications:
SOC: MT7981B
RAM: 256MB DDR3
Flash: 128MB Winbond SPI NAND
P… orts: 1 LAN (1G Airoha AN8801SB) & 1 WAN (1G Mediatek MT7981)
WIFI: MT7976CN
LEDs: 1 (Red, Blue, Green)
Buttons: 1 (Reset)
UART: 3.3v, 115200n8, pins are labeled on PCB.
Form Factor: Standard 86mm in-wall panel design
The Comfast CF-E593AX uses an unsupported (thus far) Airoha AN8801SB Gigabit PHY for the LAN port. This PR includes the drivers to make it work and installable as a kmod (`kmod-phy-airoha-an8801sb`).
```
[ 2.201354] Airoha AN8801 mdio-bus:1e: PHY-ID = c0ff0421
[ 2.206902] Airoha AN8801 mdio-bus:1e: Debugfs init start
[ 2.531117] Airoha AN8801 mdio-bus:1e: sgmii mode - AN
[ 2.536904] Airoha AN8801 mdio-bus:1e: Tx, Rx Polarity : 01a01502
[ 2.548705] Airoha AN8801 mdio-bus:1e: LED initialize OK !
[ 2.554578] Airoha AN8801 mdio-bus:1e: surge protection mode - 0R
[ 2.560784] Airoha AN8801 mdio-bus:1e: AN8801SB Initialize OK ! (1.1.7)
[ 2.568999] mtk_soc_eth 15100000.ethernet eth0: PHY [mdio-bus:1e] driver [Airoha AN8801] (irq=POLL)
```
Installation:
Gain SSH access:
1. Login into web interface (http://192.168.10.1/computer/login.html),
and download the configuration(http://192.168.10.1/computer/config.html).
2. Rename downloaded backup config - 'backup.file to backup.tar.gz',
Enter 'fakeroot' command then decompress the configuration:
tar -zxf backup.tar.gz
3. Edit 'etc/shadow', update (remove) root password:
With password =
`root:$1$xf7D0Hfg$5gkjmvgQe4qJbe1fi/VLy1:19362:0:99999:7:::`
`root:$1$xf7D0Hfg$5gkjmvgQe4qJbe1fi/VLy1:19362:0:99999:7:::`
to without password =
`root::0:99999:7:::`
`root::0:99999:7:::`
4. Repack 'etc' directory back to a new backup file:
`tar -zcf backup-ssh.tar.gz etc/`
5. Rename new config tar.gz file to 'backup-ssh.file'
Exit fakeroot - `exit`
6. Upload new configuration via web interface
7. Now you can SSH with the following:
`ssh -vv -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa root@192.168.10.1`.
8. Backup the mtd partitions:
```
cat /dev/mtd1 > /tmp/BL2.bin
cat /dev/mtd2 > /tmp/u-boot-env.bin
cat /dev/mtd3 > /tmp/Factory.bin
cat /dev/mtd4 > /tmp/FIP.bin
cat /dev/mtd5 > /tmp/ubi.bin
```
9. Transfer backup files to PC:
`ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa root@192.168.10.1:/tmp/*.bin ./`
10. Copy openwrt factory firmware to the tmp folder and install via ssh:
`scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa openwrt-mediatek-filogic-comfast_cf-e593ax-squashfs-factory.bin root@192.168.10.1:/tmp/`
`sysupgrade -n -F /tmp/openwrt-mediatek-filogic-comfast_cf-e593ax-squashfs-factory.bin`
11. Wait for LED to turn green, copy sysupgrade file to device at default
Openwrt IP (192.168.1.1):
`scp -O openwrt-mediatek-filogic-comfast_cf-e593ax-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/`
12. SSH into device and run sysupgrade to finish installation:
`ssh root@192.168.1.1`
`sysupgrade -n /tmp/openwrt-mediatek-filogic-comfast_cf-e593ax-squashfs-sysupgrade.bin`
Hi,
So one thing that is missing is the surge and polarity setting. The default driver is set to the correct setting for this device, but other devices will find their polarity will be incorrect.
&mdio_bus {
/* Airoha AN8801SB Gigabit PHY */
phy30: phy@30 {
compatible = "ethernet-phy-idc0ff.0421";
reg = <30>;
airoha,surge = <0>;
airoha,polarity = <2>;
reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <10000>;
eee-broken-100tx;
eee-broken-1000t;
};
};
Also, until upstream of this phy driver exists, this will not be added as it is.