Support for RTL838x based managed switches

Thanks to your post the 1Gbit ports are now working as non generic. I followed this thread to get the three 2.5/5/10Gbit ports to work. I included the rtl8261n driver and changed the smi-addresses acording to your earlier post. now I'm getting the following output:

Sun Apr 27 09:08:44 2025 kern.info kernel: [    2.470670] Realtek RTL8261N mdio-bus:18: rtkphy_config_init:69 [RTL8261N/RTL826XB] phy_id: 0x1CCAF3 PHYAD:24
Sun Apr 27 09:08:44 2025 kern.info kernel: [    3.896696] rtl83xx-switch switch@1b000000 lan9 (uninitialized): PHY [mdio-bus:18] driver [Realtek RTL8261N] (irq=POLL)
Sun Apr 27 09:08:44 2025 kern.info kernel: [    3.910160] Realtek RTL8261N mdio-bus:19: rtkphy_config_init:69 [RTL8261N/RTL826XB] phy_id: 0x1CCAF3 PHYAD:25
Sun Apr 27 09:08:44 2025 kern.info kernel: [    5.335013] rtl83xx-switch switch@1b000000 lan10 (uninitialized): PHY [mdio-bus:19] driver [Realtek RTL8261N] (irq=POLL)
Sun Apr 27 09:08:44 2025 kern.info kernel: [    5.348539] Realtek RTL8261N mdio-bus:1a: rtkphy_config_init:69 [RTL8261N/RTL826XB] phy_id: 0x1CCAF3 PHYAD:26
Sun Apr 27 09:08:44 2025 kern.info kernel: [    6.766633] rtl83xx-switch switch@1b000000 lan11 (uninitialized): PHY [mdio-bus:1a] driver [Realtek RTL8261N] (irq=POLL)

The Port lights up and the output of the OpenWRT log shows this:

Sun Apr 27 09:44:50 2025 kern.info kernel: [ 2110.135714] rtl83xx-switch switch@1b000000 lan9: Link is Up - 1Gbps/Full - flow control rx/tx
Sun Apr 27 09:44:50 2025 kern.info kernel: [ 2110.145331] switch: port 10(lan9) entered blocking state
Sun Apr 27 09:44:50 2025 kern.info kernel: [ 2110.151318] switch: port 10(lan9) entered forwarding state
Sun Apr 27 09:44:50 2025 daemon.notice netifd: Network device 'lan9' link is up

I added the ports to the switch bridge interface like this:

root@Switchian:~# cat /etc/config/network 

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option packet_steering '1'

config device 'switch'
	option name 'switch'
	option type 'bridge'
	option macaddr 'XX:XX:XX:XX:XX:XX'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'
	list ports 'lan5'
	list ports 'lan6'
	list ports 'lan7'
	list ports 'lan8'
	list ports 'lan9'
	list ports 'lan10'
	list ports 'lan11'
	list ports 'lan12'

config bridge-vlan 'lan_vlan'
	option device 'switch'
	option vlan '1'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'
	list ports 'lan5'
	list ports 'lan6'
	list ports 'lan7'
	list ports 'lan8'
	list ports 'lan9'
	list ports 'lan10'
	list ports 'lan11'
	list ports 'lan12'

config device
	option name 'switch.1'
	option macaddr 'XX:XX:XX:XX:XX:XX'

config interface 'lan'
	option device 'switch.1'
	option proto 'static'
	option ipaddr '192.168.1.10'
	option gateway '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	list dns '192.168.1.1'

However the connection is not working. Is it because this driver is not made to work with rtl8261be?

Here are two pictures showing the light on the port and the luci overview:


If anyone wants to know here's the output of the mdio command above:

root@Switchian:~# mdio mdio-bus mmd 24:1
CTRL1(0x00): 0x2040
  flags: -reset -low-power -remote-loopback -local-loopback
  speed: 10g

STAT1(0x01): 0x0002
  capabilities: -pias -peas +low-power
  flags:        -fault -link

DEVID(0x02/0x03): 0x001ccaf3

SPEED(0x04): 0x6071
  capabilities: -400g +5g +2.5g -200g -25g -10g-xr -100g -40g -10g/1g +10 +100
                +1000 -10-ts -2-tl +10g

DEVS(0x06/0x05): 0x8000008a
  devices: +vendor2 -vendor1 -c22-ext -power-unit -ofdm -pma4 -pma3 -pma2 -pma1
           +aneg -tc -dte-xs -phy-xs +pcs -wis +pma/pmd -c22

CTRL2(0x07): 0x0009
  flags: -pias -peas
  type:  10g-t

STAT2(0x08): 0x8200
  capabilities: -tx-fault -rx-fault +ext-register -tx-disable -local-loopback
                -10g-sr -10g-lr -10g-er -10g-lx4 -10g-sw -10g-lw -10g-ew
  flags:        +present -tx-fault -rx-fault

EXTABLE(0x0B): 0x41a4
  capabilities: -10g-cx4 -10g-lrm +10g-t -10g-kx4 -10g-kr +1000-t -1000-kx
                +100-tx +10-t -p2mp -40g/100g -1000/100-t1 -25g -200g/400g
                +2.5g/5g -1000-h

PKGID(0x0E/0x0F): 0x001ccaf3

3 Likes