Hasivo switches

I'm not sure on the LED configuration, as I can't find a picture of it.

It's got 3 LEDs per port. Two Green on the RJ45s themselves, Link and Activity.
Then it's got an Orange LED under each RJ45 for the PoE status (when PoE is being supplied).

Also, I don't see (m)any hasvio switches with 2 leds, yet you documented two

I might be wrong on the 'power' one actually being controlled. But I was pretty sure that I'd had it 'off' whilst there was power on to the board, and I was in a terminal. So I 'think' it's controllable. SYS LED does indeed flash during normal operation, and PWR LED is normally just on however (so I might be wrong on the PWR LED).

Also, You mentioned 'RTL8221 and RTL8226 PHYs' in your DTS, but then list 8 entries. So which one is it? I'll read your wiki page to see if I can learn more

There are 8x RTL8221B PHYs at 2.5Gb (one per physical RJ45 port). I'm not up to speed on how the PHY/Port/SMI/SerDes mapping is however. From the OEM boot it looks to be:

RJ45 #1 = SW Port 0 = SMI 0, ?? = SDS 2 (from datasheet)
RJ45 #2 = SW Port 8 = SMI 0, ?? = SDS 3 (from datasheet)
RJ45 #3 = SW Port 16 = SMI 0, ?? = SDS 4 (from datasheet)
RJ45 #4 = SW Port 20 = SMI 0, ?? = SDS 5 (from datasheet)
RJ45 #5 = SW Port 24 = SMI 1, ?? = SDS 6 (from datasheet)
RJ45 #6 = SW Port 25 = SMI 1, ?? = SDS 7 (from datasheet)
RJ45 #7 = SW Port 26 = SMI 1, ?? = SDS 8 (from datasheet)
RJ45 #8 = SW Port 27 = SMI 1, ?? = SDS 9 (from datasheet)

If I'm reading this right

unit=0 port=0 smi=0 C45=1 C22=1
unit=0 port=8 smi=0 C45=1 C22=1
unit=0 port=16 smi=0 C45=1 C22=1
unit=0 port=20 smi=0 C45=1 C22=1
unit=0 port=24 smi=1 C45=1 C22=1
unit=0 port=25 smi=1 C45=1 C22=1
unit=0 port=26 smi=1 C45=1 C22=1
unit=0 port=27 smi=1 C45=1 C22=1

And it seems both clause 22 and clause 45 polling are supported

The 8226 comes about from the Board Model RTL9303_8X8226

Ah, ok, I wonder how it's driven though; because the DTS now assumes drives it based on link-status. I see I may have used an older commit from you initially, as I see you did set the led_set appropriately here: https://github.com/bevanweiss/openwrt/commit/1fbfb220e79d7e891563a960ad3529baf68b21d7#diff-dd89828065504250f010d6ac2b718ead6ef23749e6d7821b9a09e3238ec22949R27 so I'll go with that.

I am a bit confused however as to what you defined there. LED0 is set to 10G, which obviously this switch can't do. The leds are driven like a shift-register. So if 3 leds are defined, 3 led values are being pumped out. If only 2 leds are connected, well then you end up with incorrect leds lightening up.

Since your board doesn't have a POE MCU like some switches do, I wonder if they somehow 'fake' 10G to indicate the POE status?

I suppose I'd ask next, how do you know it's gpio 1 then :slight_smile:

If you can reproduce it's 'off-ness' we can investigate which GPIO is controlling it.

I should have looked at the boot log :slight_smile: I just guessed the sds numbers, which usually is a bad idea :smiley: not setting them basically relies on u-boot on setting things up properly, which is something we of course wish to avoid.

But, good to know it's only RTL8221B and not what you had in the comments initially :slight_smile: much more clear now.

Yeah, that's just the 'default config' they use. My guess is, while we don't have a datasheet for the 8226 available, the 8221 and 8226 are VERY similar to eachother, from the switches pov, they are the same.

Yep, but afaik, every C45 device always supports C22 access, but I could be wrong of course. I'll check the source code/other references to see if both should be set in that case, we don't do this now, so that might be an omission on other platforms actually. edit: Checked, in the linux kernel tree, everybody mentions just one, never both.

Btw, how much RAM does your switch have?

but this list helps a lot, thanks.

btw, do they really print 'from datasheet' in the log? i wonder who wrote that :smiley:

I haven't gotten LEDs to work at all yet. The OEM indicates 8231 'detected'.. but there's no such chip on the board. So I think they're just using the 3x hc595 shift register chips like a set of 8231 chips. Not sure how the latch for the hc595 is driven yet.. that's probably why the LEDs aren't yet working (so I've still got something configured wrong).

This was based purely on GPOI 0 and GPIO1 being configured as outputs in the OEM logs. I assumed (badly) two adjacent GPIO, two LEDs... maybe GPIO 1 is actually the LED HC595 latch signal.

256MB (I did include chip details up in an earlier post :wink:)

That was me writing, not the OEM. OEM only had the block shown afterwards.

I've only just tonight actually gotten it to work for ethernet. And even then it's a bit strange. From switch I can ping my laptop. But the laptop is unable to ping the switch. Reporting:
192.168.1.1 reports: Destination protocol unreachable.
I tried putting the laptop adapter onto VLAN 1, and got the same result.

There's still a few more things to sort out for this device.

  • LEDs
  • PoE
  • Ethernet actually working

There is actually a small custom 8051 MCU on the main board also. And I've just belled out the SDA/SCK from the HS104 chips to two pins on that MCU :frowning:

Well, there's a rtl8231 controller integrated into our switch. the whole 'led-set' bit, that's all the 8231 controller. The 8231 doesn't actually control leds though; it controls what an rtl8231 can control. Since you can daisychain rtl8231, I expect that whats inside the SoC, is a '0 sized' led driver, so you always daisy chain it with an external one. the rlt8231 can be daisy-chained with shift registers as well afaik. See https://svanheule.net/realtek/longan/register/led_glb_ctrl#LED_MOD but @svanheule knows much more about the rtl831 and its operating ways, with using shift-registers.

That said, Have you inspected the PCB to see where the LED traces are actually going? probably to the shift-register. But is the shift register connected via SPI or otherwise? Since you have an SPI shift-register in your dts ...

thanks :slight_smile:

For POE, I bet they use the same protocol that is used on all these POE swtiches.

ethernet/networking, is a generic rtl93xx issue, see our main thread; but pinging should work ... unless I broke something :stuck_out_tongue:

Good thinking on the PCB tracing.
I had already traced the RJ45 LEDs back to the HC595 chips, although I hadn't really taken a close look at the back of the PCB, and with 3x HC595 this is 24 outputs, 3 LEDs for each port.. so I'd assumed the 2x RJ45 + 1x PoE... but...

It looks like each RJ45 port actually has three LEDs on the RJ45 housing itself.
Two on the left (I've only seen Green 1Gb?.. but maybe there is Orange for 2.5Gb also), and one (Green) on the right.

The Orange LEDs for PoE active under the RJ45 go to the 8051 MCU. So I've got the mapping from those LEDs to Port pins on the 8051 now.

These Hasivo switches appear to use proprietary Hasivo PoE chips however (HS104).
So I'm not yet convinced it'll be the same protocol to the 8051.
It's possible that the 8051 is a slave on the I2C bus still.. I haven't yet traced many of these to the RTL9303.

Tomorrow I'll see if I can work out what drives the latch signal on the HC595s.
That might then give LEDs working..

With Ghira help I write down a small utility to extract from rtkcore.ko - what I think - are the correct port definition that actually match what is observed from the bootlog. The various hwp structures are the same in the u-boot binary so I assume this should be corrcet.
I am quite sure the serdes are starting at 2 both on the 8 and 5 ports version, but I am unable to make the ethernet work. I am quite sure - with the same dts - I was able to make it work.

Here what I have extracted from the binary

:Hasivo 5 ports
Searching for [RTL9303_5X8226] in [../rtcore.ko]
Looking for pattern [x00x00x00x00x52x54x4cx39x33x30x33x5fx35x58x38x32x32x36x00]...found at 0x670a4

Profile name: RTL9303_5X8226
Switch chip id : 0x93036810
Core supported : 0x1
Core access : 0x0
Nic supported : 0x0

Switch ports descrption:
.mac_id = 0, .phyIdx=0 smi=0 phy_addr=1 sds_idx=0
.mac_id = 8, .phyIdx=1 smi=0 phy_addr=2 sds_idx=1
.mac_id = 16, .phyIdx=2 smi=0 phy_addr=3 sds_idx=2
.mac_id = 20, .phyIdx=3 smi=0 phy_addr=4 sds_idx=3
.mac_id = 24, .phyIdx=4 smi=1 phy_addr=1 sds_idx=4
.mac_id = 25, .phyIdx=255 smi=255 phy_addr=255 sds_idx=5
.mac_id = 26, .phyIdx=255 smi=255 phy_addr=255 sds_idx=6
.mac_id = 27, .phyIdx=255 smi=255 phy_addr=255 sds_idx=7
.mac_id = 28, .phyIdx=255 smi=255 phy_addr=255 sds_idx=255

Serdes descrption:
.sds_idx=2, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=3, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=4, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=5, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=6, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=7, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=8, .mode=8, .rx_polarity=0, .tx_polarity=0
.sds_idx=9, .mode=8, .rx_polarity=0, .tx_polarity=0

Phy descrption:
.chip=19, .phy_max=1, .mac_id=0
.chip=19, .phy_max=1, .mac_id=8
.chip=19, .phy_max=1, .mac_id=16
.chip=19, .phy_max=1, .mac_id=20
.chip=19, .phy_max=1, .mac_id=24



::Hasivo 8 ports
Searching for [RTL9303_8X8226] in [../rtcore.ko]
Looking for pattern [x00x00x00x00x52x54x4cx39x33x30x33x5fx38x58x38x32x32x36x00]...found at 0x67e24

Profile name: RTL9303_8X8226
Switch chip id : 0x93036810
Core supported : 0x1
Core access : 0x0
Nic supported : 0x0

Switch ports descrption:
.mac_id = 0, .phyIdx=0 smi=0 phy_addr=1 sds_idx=0
.mac_id = 8, .phyIdx=1 smi=0 phy_addr=2 sds_idx=1
.mac_id = 16, .phyIdx=2 smi=0 phy_addr=3 sds_idx=2
.mac_id = 20, .phyIdx=3 smi=0 phy_addr=4 sds_idx=3
.mac_id = 24, .phyIdx=4 smi=1 phy_addr=1 sds_idx=4
.mac_id = 25, .phyIdx=5 smi=1 phy_addr=2 sds_idx=5
.mac_id = 26, .phyIdx=6 smi=1 phy_addr=3 sds_idx=6
.mac_id = 27, .phyIdx=7 smi=1 phy_addr=4 sds_idx=7
.mac_id = 28, .phyIdx=255 smi=255 phy_addr=255 sds_idx=255

Serdes descrption:
.sds_idx=2, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=3, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=4, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=5, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=6, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=7, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=8, .mode=28, .rx_polarity=1, .tx_polarity=0
.sds_idx=9, .mode=28, .rx_polarity=1, .tx_polarity=0

Phy descrption:
.chip=19, .phy_max=1, .mac_id=0
.chip=19, .phy_max=1, .mac_id=8
.chip=19, .phy_max=1, .mac_id=16
.chip=19, .phy_max=1, .mac_id=20
.chip=19, .phy_max=1, .mac_id=24
.chip=19, .phy_max=1, .mac_id=25
.chip=19, .phy_max=1, .mac_id=26
.chip=19, .phy_max=1, .mac_id=27

And here the relevant dts section I am using. Please note the smi-address I matched to what we see in the bin starting with <0 1> uop to <0 4> and then <1 1>. I am also trying to use the mac_ids aas port numbers but I am under the impression there is no initialization (if I bypass the the rtk network on in u-boot). Any ideas?

&ethernet0 {
	mdio: mdio-bus {
		compatible = "realtek,rtl9303-mdio", "realtek,rtl930x-mdio", "realtek,rtl838x-mdio";
		regmap = <&ethernet0>;
		#address-cells = <1>;
		#size-cells = <0>;

		/* External RTL8226 2.5G phy */
		phy0: ethernet-phy@0 {
			reg = <0>;
			compatible = "ethernet-phy-ieee802.3-c45";
			rtl9300,smi-address = <0 1>;
			sds = < 2 >;
			//max-speed = <2500>;
		};
		phy8: ethernet-phy@8 {
			reg = <8>;
			compatible = "ethernet-phy-ieee802.3-c45";
			rtl9300,smi-address = <0 2>;
			sds = < 3 >;
			//max-speed = <2500>;
		};
		phy16: ethernet-phy@16 {
			reg = <16>;
			compatible = "ethernet-phy-ieee802.3-c45";
			rtl9300,smi-address = <0 3>;
			sds = < 4 >;
			//max-speed = <2500>;
		};
		phy20: ethernet-phy@20 {
			reg = <20>;
			compatible = "ethernet-phy-ieee802.3-c45";
			rtl9300,smi-address = <0 4>;
			sds = < 5 >;
			//max-speed = <2500>;
		};
		phy24: ethernet-phy@24 {
			reg = <24>;
			compatible = "ethernet-phy-ieee802.3-c45";
			rtl9300,smi-address = <1 1>;
			sds = < 6 >;
			//max-speed = <2500>;
		};
	};
};

witch0_ports {
	port@0 {
		reg = <0>;
		label = "lan1";
		led-num = <(
			RTL93XX_LED_NUM0 | /* Orange */
			RTL93XX_LED_NUM1 | /* Lime */
			RTL93XX_LED_NUM2   /* Lime */
		)>;
		led-set = <0>;
		phy-mode = "hsgmii";
		phy-handle = <&phy0>;
	};

	port@8 {
		reg = <8>;
		label = "lan2";
		led-num = <(
			RTL93XX_LED_NUM0 | /* Orange */
			RTL93XX_LED_NUM1 | /* Lime */
			RTL93XX_LED_NUM2   /* Lime */
		)>;
		led-set = <0>;
		phy-mode = "hsgmii";
		phy-handle = <&phy8>;
	};

	port@16 {
		reg = <16>;
		label = "lan3";
		led-num = <(
			RTL93XX_LED_NUM0 | /* Orange */
			RTL93XX_LED_NUM1 | /* Lime */
			RTL93XX_LED_NUM2   /* Lime */
		)>;
		led-set = <0>;
		phy-mode = "hsgmii";
		phy-handle = <&phy16>;
	};

	port@20 {
		reg = <20>;
		label = "lan4";
		led-num = <(
			RTL93XX_LED_NUM0 | /* Orange */
			RTL93XX_LED_NUM1 | /* Lime */
			RTL93XX_LED_NUM2   /* Lime */
		)>;
		led-set = <0>;
		phy-mode = "hsgmii";
		phy-handle = <&phy20>;
	};

	port@24 {
		reg = <24>;
		label = "lan5";
		led-num = <(
			RTL93XX_LED_NUM0 | /* Orange */
			RTL93XX_LED_NUM1 | /* Lime */
			RTL93XX_LED_NUM2   /* Lime */
		)>;
		led-set = <0>;
		phy-mode = "hsgmii";
		phy-handle = <&phy24>;
	};
};

1 Like

That looks like I've got, and I'm now getting link up/down correctly. And was able to ping out of the switch to laptop. Inbound is still a bit problematic.

I did need to pick up a tweak to the ethernet driver which was in one of the other githubs

Does your device actually have the rtl8226 chips? or is it rtl8221b like mine?

And do you have PoE?
LED configuration would be the other thing that would be great to confirm.
Does your device use HC595 for the LEDs?

You wouldn't happen to have a link to hand of that Protocol?
I've hooked up a serial sniffer onto the 8051 serial port lines, and I'm seeing data.
So ideally I could match it up against existing knowledge of the protocol to see if it does align.

If so, I think I'd just need to add in the second UART into the DTS, and then start mimicking the existing conversation.

I have 4 poe out of 5 ports and it claim to have 5 8226. If we look at the hwp_phyDescp (under Phy description above) we have the same chip id - 19 - if I remember correctly the enum was mentioning RTL8226.

I have made tons of test via tftpboot with the network initialized by u-boot to realize now the system behave differently if booted from the flash bypassing u-boot initialization!

I will look at the driver too

Can you take a high-res pic of the bottom of the PCB? Also if possible remove the POE module for a overview pic.

What often helps me, is to trace things out, make a pseudo schematic even if needed. That helps a lot with understanding.

Right, so as to leds, so you have 4 leds per port, 1 green one on the right, one dual-color, green + amber is my guess on the left and 1 for POE purposes. Can you take a photo of the front? I have not found your exact model on hasivo.com; but serve the home seems to have some pics :slight_smile: https://www.servethehome.com/the-ultimate-cheap-2-5gbe-poe-unmanaged-switch-hasivo-s1100p-8gt/
Though I only see 1 power led there ... so your 'SE' is different?

The silk-screen on the front mentions above the left led '2G5/1G' so Amber/Lime; and on the right it says 100M/10M which is lime. So the dts is currently wrong so I'll go with this assumption :slight_smile:

You know what's funny though; the RTL8221B has also 3 led outputs, that they could have used instead :slight_smile:

that makes sense and matches other implementations :wink: so no surprise there.

oh for sure not; but to the 8051, from the RTLSOC it probably. This is most likely a uart link (or i2c/spi maybe). The protocol over the uart; probably standard stuff for all these chips. As then it is easy to hook up to the rtl SDk, just do the same messages ...

8226 and 8221 are very similar, but not exactly the same. There's a few bits that can be tested though ..

I saw that one too. Not sure why they didn't use that instead. Possibly they wanted to stay open to using other PHYs (maybe they had originally intended for it to just use the 8226 PHYs).

It looks like it's Qa of the first hc595 going to the Port 8 Amber, then Qb to the 1Gbps Green, Qc to the 10M/100M Green. I imagine it then goes to Port 7 Amber and so on. I'll find out once I've got the latch thing sorted.

I've uploaded some more photos to the wiki page (https://svanheule.net/switches/s1100wp-8gt_se)

@bevanweiss
I am not suing th esame version of the driver - I have the last one from oliver realtek-wip - and the case seems to be handle

Now what bother me is the mdio bus. The function you point out is the mdio_reset and when I boo I always have error -5 as per

[    1.061975] RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY: probe of mdio-bus:00 failed with error -5
[    1.076403] RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY: probe of mdio-bus:01 failed with error -5
[    1.106498] RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY: probe of mdio-bus:02 failed with error -5
[    1.121494] RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY: probe of mdio-bus:03 failed with error -5
[    1.136011] RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY: probe of mdio-bus:04 failed with error -5

Furthermore when I am using mdio from mdio-tools package I also got a -5 error. I assume we should be able to see the connected devices. Are we sure we properly define it in the DTS? Do you have the same failures?

In the early stage of kernel boot I get the same.

[    1.227106] RTL8221B-VB-CG 2.5Gbps PHY: probe of mdio-bus:00 failed with error -5
[    1.321411] RTL8221B-VB-CG 2.5Gbps PHY: probe of mdio-bus:08 failed with error -5
[    1.415878] RTL8221B-VB-CG 2.5Gbps PHY: probe of mdio-bus:10 failed with error -5
[    1.510146] RTL8221B-VB-CG 2.5Gbps PHY: probe of mdio-bus:14 failed with error -5
[    1.604673] RTL8221B-VB-CG 2.5Gbps PHY: probe of mdio-bus:18 failed with error -5
[    1.698875] RTL8221B-VB-CG 2.5Gbps PHY: probe of mdio-bus:19 failed with error -5
[    1.793544] RTL8221B-VB-CG 2.5Gbps PHY: probe of mdio-bus:1a failed with error -5
[    1.888016] RTL8221B-VB-CG 2.5Gbps PHY: probe of mdio-bus:1b failed with error -5

But then a little later (after CPU port is setup), things seem to recover

[    3.253455] rtl930x_phylink_mac_config port 28, mode 1, phy-mode: internal, speed 1000, link 0
[    3.263369] rtl83xx-switch switch@1b000000 lan1 (uninitialized): PHY [mdio-bus:00] driver [REALTEK RTL8221B] (irq=POLL)
[    3.277683] rtl83xx-switch switch@1b000000 lan2 (uninitialized): PHY [mdio-bus:08] driver [REALTEK RTL8221B] (irq=POLL)
[    3.292349] rtl83xx-switch switch@1b000000 lan3 (uninitialized): PHY [mdio-bus:10] driver [REALTEK RTL8221B] (irq=POLL)
[    3.306958] rtl83xx-switch switch@1b000000 lan4 (uninitialized): PHY [mdio-bus:14] driver [REALTEK RTL8221B] (irq=POLL)
[    3.321579] rtl83xx-switch switch@1b000000 lan5 (uninitialized): PHY [mdio-bus:18] driver [REALTEK RTL8221B] (irq=POLL)
[    3.336174] rtl83xx-switch switch@1b000000 lan6 (uninitialized): PHY [mdio-bus:19] driver [REALTEK RTL8221B] (irq=POLL)
[    3.350859] rtl83xx-switch switch@1b000000 lan7 (uninitialized): PHY [mdio-bus:1a] driver [REALTEK RTL8221B] (irq=POLL)
[    3.365517] rtl83xx-switch switch@1b000000 lan8 (uninitialized): PHY [mdio-bus:1b] driver [REALTEK RTL8221B] (irq=POLL)
...
[    6.200254] RESETTING 9300, CPU_PORT 28
[    6.445370] rtl838x-eth 1b00a300.ethernet eth0: configuring for fixed/internal link mode
[    6.454535] In rtl838x_mac_config, mode 1
[    6.460889] rtl83xx-switch switch@1b000000 lan1: configuring for phy/hsgmii link mode
[    6.469695] rtl930x_phylink_mac_config port 0, mode 0, phy-mode: hsgmii, speed -1, link 0
[    6.478866] rtl930x_phylink_mac_config SDS is 2
[    6.483972] rtl930x_phylink_mac_config: Unsupported speed: -1
[    6.490474] In rtl838x_mac_link_up, mode 1
[    6.495122] rtl838x-eth 1b00a300.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[    6.512990] rtl930x_phylink_mac_config CURRENT FORCED MODE 18
[    6.519408] rtl9300_rtl8226_mode_set setting serdes 2 to mode sgmii +++++
[    6.562969] rtl9300_force_sds_mode: SDS: 2, mode 0
[    6.568331] rtl9300_force_sds_mode --------------------- serdes 2 forcing to 1f ...
[    6.812963] rtl9300_serdes_mac_link_config: registers before 00000000 00001403
[    6.932962] rtl9300_serdes_mac_link_config: registers after 00000000 00001403
[    9.482967] rtl9300_force_sds_mode: SDS: 2, mode 4
[    9.488329] rtl9300_force_sds_mode --------------------- serdes 2 forcing to 2 ...
[   10.382960] rtl9300_force_sds_mode toggling LC or Ring for 10gr, round 0
[   10.652964] rtl9300_force_sds_mode end power 0x20 0 30
[   10.658708] rtl9300_force_sds_mode --------------------- serdes 2 forced to 2 DONE
[   11.033153] 8021q: adding VLAN 0 to HW filter on device lan1

which gets me

root@OpenWrt:/# ping 192.168.1.111
PING 192.168.1.111 (192.168.1.111): 56 data bytes
64 bytes from 192.168.1.111: seq=0 ttl=128 time=1.334 ms
64 bytes from 192.168.1.111: seq=1 ttl=128 time=1.879 ms
64 bytes from 192.168.1.111: seq=2 ttl=128 time=1.851 ms
64 bytes from 192.168.1.111: seq=3 ttl=128 time=2.101 ms
64 bytes from 192.168.1.111: seq=4 ttl=128 time=1.370 ms
64 bytes from 192.168.1.111: seq=5 ttl=128 time=1.487 ms
64 bytes from 192.168.1.111: seq=6 ttl=128 time=1.729 ms
64 bytes from 192.168.1.111: seq=7 ttl=128 time=1.648 ms
64 bytes from 192.168.1.111: seq=8 ttl=128 time=1.773 ms
64 bytes from 192.168.1.111: seq=9 ttl=128 time=1.626 ms

Ok - I understand you number the ether-phy with what we see in the bootlog i.e. 0,8,16,.. but did you do for the switch? You use the name numbering or you use 0,1,2,3...?

I do note your logic is a bit different than mine. I found it wasn't working when the polling flag was being set (the v |= RTL930X_SMI_MAC_TYPE_CTRL... stuff).
Perhaps my PHY is only in 1Gbps 'mode' however. I haven't tested with any 2.5Gbps link (I'll do this tomorrow though, with just a loop-back).

I just had the PHY labelling the same as the port labelling. So phy0=>port0, phy27=>port27 etc.
The labels aligned with the physical position on the hardware however. So lan1 is the left most RJ45, then lan2 etc.

Are you relying on tftpboot or you boot from the flash?

I'm very heavily re-working the mdio bus stuff today :slight_smile: so things could be working and breaking.

I just pushed something, that should be better though, but haven't tested it just yet.

generally, we don't do that, the label, is what you see on the outside of the switch, so that if you do 'ip link' those labels match. The phy and port numbers ,you did initially correct :slight_smile: