Add OpenWrt support for Ubiquity EdgeRouter 4 (UBNT ER4)


i managed to bring the target up and patch in vsc8504 phy support for 5.4 kernel but 2 of 4 ports are not working.

device specs:

  • octeon 7130 soc
  • 4gb emmc
  • 4mb spi flash (is irrelevant since it only stores uboot and we do not touch it)
  • 3x rj45 and 1x sfp gbe ports. they run by vsc8504 phy and i have trouble getting it up correctly up (only first ethernet and sfp port work)
  • 1x usb3.0 port

it has two SGMII (QSGMII?) from a SOC.
as far as i see first SGMII is connected to VSC8504 and have 4 (4, 5, 6, 7) ports populated as described in table bellow.

Which MII it is |	Which MD | Which mdio |	Mac |	Physical port name
mdio-octeon0	octeth0	4	fc:ec:da:03:bf:17	eth3
mdio-octeon0	octeth1	5	fc:ec:da:03:bf:18	eth0
mdio-octeon0	octeth2	6	fc:ec:da:03:bf:19	eth1
mdio-octeon0	octeth3	7	fc:ec:da:03:bf:1a	eth2
mdio-octeon1	-	-	-
Octeon ubnt_e300(ram)# mii device
MII devices: 'mdio-octeon0' 'mdio-octeon1' 
Current device: 'mdio-octeon0'
Octeon ubnt_e300(ram)# mdio list 
4 - Vitesse VSC8504 <--> octeth0
5 - Vitesse VSC8504 <--> octeth1
6 - Vitesse VSC8504 <--> octeth2
7 - Vitesse VSC8504 <--> octeth3

VSC8504 phy is compatible with either Vitesse or Microchip kernel module when patched in.
In later kernels there is just Microchip since Vitesse is superseeded by Microchip due to acquision in 2015.
Patching to 5.4 as Vitesse does not require external firmware but patching as Microchip does require one.

root@OpenWrt:/# ls -1 /sys/bus/mdio_bus/drivers/Vitesse\ VSC8504/
root@OpenWrt:/# cat /sys/bus/mdio_bus/drivers/Vitesse\ VSC8504/8001180000001800:0*/phy_interface 

stock firmware same command:

root@er4:/home/damex# cat /sys/bus/mdio_bus/drivers/Vitesse\ VSC8504/8001180000001800:0*/phy_interface

Interfaces that is detected as sgmii have working network but ones that is detected as gmii is not.

any idea where to proceed?

working tree:

how to run openwrt to try/test (runs completely from memory):

  • build and copy openwrt-octeon-ubnt_edgerouter4-initramfs-kernel.bin to fat32 formatted usb flash drive
  • connect usb flash drive
  • connect serial cable
  • reboot to uboot
  • run 'usb start' to bring usb flash drive up
  • run 'fatload usb 0:1 0x20000000 openwrt-octeon-ubnt_edgerouter4-initramfs-kernel.bin' to load kernel+initramfs from usb flash drive to memory
  • run 'bootoctlinux 0 numcores=4 endbootargs mem=0' to actually boot that kernel+initramfs.


extracted dts from openwrt:
extracted dts from uboot:
uboot boot log:
stock firmware boot log:
openwrt boot log:


got it working.

  • all ethernet and sfp ports work but out of order and reported as external phys
  • leds work
  • usb work
  • hw button for reset work
  • flashing/reset/config preserve/etc work as expected
  • uses more optimal octeon3 target which has approximately 5% higher performance compared to regular octeon (octeonplus)

what needs to be done:

  • add support for sfp cage... if possible
  • find a way to reorder ports to match physical
  • make universal root device selection with image config

so device is capable of routing its full gigabit. completely software without any offload.
if you enable SQM with cake and use (for lan?) interface without bridge (default config) - it is capable of routing up to 600Mbs after testing with iperf. bottleneck is single mips64 core.


all support for device is merged and it is officially supported by openwrt


FYI git commit incl. installation instructions;a=commit;h=dd651e54cc5eadba480a56a7d2c18471e560f491

Since official OpenWrt images are available now, I will set a timer for this topic to close.

Please open new topics for any open issues with this device.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.