[PR] Ipq806x: kernel 5.4 bump code propose

I suspect you have already seen output similar to that below... but just in case it helps here it is on the r7500v2.

We want to enable "TP" as a supported port or make MII work?

I suspect I need to "think harder" about @robimarko's "limkmode" and "populated properly" remarks above...

4.19

r7500v2 # ethtool eth1                                        
Settings for eth1:                                                              
        Supported ports: [ TP AUI BNC MII FIBRE ]                               
        Supported link modes:   1000baseT/Half 1000baseT/Full                   
        Supported pause frame use: Symmetric Receive-only                       
        Supports auto-negotiation: Yes                                          
        Supported FEC modes: Not reported                                       
        Advertised link modes:  1000baseT/Half 1000baseT/Full                   
        Advertised pause frame use: No                                          
        Advertised auto-negotiation: Yes                                        
        Advertised FEC modes: Not reported                                      
        Link partner advertised link modes:  1000baseT/Full                     
        Link partner advertised pause frame use: No                             
        Link partner advertised auto-negotiation: No                            
        Link partner advertised FEC modes: Not reported                         
        Speed: 1000Mb/s                                                         
        Duplex: Full                                                            
        Port: MII                                                               
        PHYAD: 1                                                                
        Transceiver: internal                                                   
        Auto-negotiation: on                                                    
        Supports Wake-on: ug                                                    
        Wake-on: d                                                              
        Current message level: 0x0000003f (63)                                  
                               drv probe link timer ifdown ifup                 
        Link detected: yes                                                      

5.4.14

root@OpenWrt:/etc/config# ethtool eth0
Settings for eth1:                                                              
        Supported ports: [ MII ]                                                
        Supported link modes:   1000baseKX/Full                                 
        Supported pause frame use: Symmetric Receive-only                       
        Supports auto-negotiation: No                                           
        Supported FEC modes: Not reported                                       
        Advertised link modes:  1000baseKX/Full                                 
        Advertised pause frame use: Symmetric Receive-only                      
        Advertised auto-negotiation: No                                         
        Advertised FEC modes: Not reported                                      
        Speed: 1000Mb/s                                                         
        Duplex: Full                                                            
        Port: MII                                                               
        PHYAD: 0                                                                
        Transceiver: internal                                                   
        Auto-negotiation: on                                                    
        Supports Wake-on: ug                                                    
        Wake-on: d                                                              
        Current message level: 0x0000003f (63)                                  
                               drv probe link timer ifdown ifup                 
        Link detected: yes                                                      

yes i have the exact output...

So it's and error that we don't have the same supported ports?
Also i see that auto-negotiation is not supported, but it should.
Suspect they changed something in the config set in newer kernel and the phy driver needs to respect that.
Also i notice that some upstream phy driver use auto discover feature... (i wonder if we need to use them too... )

Some example

also

As I just learned that TP = Twisted Pair (i.e. rj45) and MII = Media Independent Interface I'm going have to do some reading/learning before being of much use.

ethtool -i eth1 did tell me the driver is st_gmac so that helps know where to look (and thank you for the auto discover links).

don't do the same mistake i have done in the past...

The problem is here

target/linux/generic/files/drivers/net/phy/

the ar drivers

ours is ar8327

1 Like

Yeah, it gotta be that something has changed.
@Ansuel Where the hell did 1000baseKX appear from?

I can suggest that you remove linkmode_zero, as I don't know why the used it.
You are not supposed to clear linkmodes unless you really have to.

Also, in the end ethernet driver needs to correctly pickup and edit linkmodes.

Also, @Ansuel do you know of a reason why IPQ806x bitbangs the MDIO instead of having a proper driver?
Its a relly simple thing to write a driver for

Actually i'm using a dedicated mdio driver created by chuckeey. Since the tester were 2 (me and chuckeey i never upstreamed/included in openwrt) so...
that's why we use the bitbang generic driver...

Ok, because I was thinking of writing one.
It would be good to push that upstream to Linux, with MDIO it either read/writes correctly or it doesnt.
Thats all the testing.

mh ok...

Anyway i tried your suggestion but still i have 1000kx

Hm, 1000kx is a weird one, thats standard designed for backplanes.
I have no idea from where is that picked from, have you tried using qca8k instead?

This is with dsa

But doesn't work for some reason... (data received in ifconfig but i can't connect)

Settings for lan3:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 2
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: d
	Wake-on: d
	Link detected: yes

my router is in use until tomorrow so I can't "try it and see" myself

but if I could I would remove "snps,dwmac" from

compatible = "qcom,ipq806x-gmac", "snps,dwmac"; 

this is related to the bitbang mdio driver you are referring to above?

fwiw the 1000kx shows up in drivers/net/mdio.c, phy.c and a few other places

anyway this is beyond my current level of familiarity... apologies for the noise

@Ansuel Ok, so it clearly the PHY/driver issue with the OpenWrt custom AR8216 drivers.
Do you see both RX/TX counters going up with DSA?

@anon98444528 You can remove snps, because its required by the driver.
You can see it in bindings:
https://www.kernel.org/doc/Documentation/devicetree/bindings/net/ipq806x-dwmac.txt

Yeah, it will show up in core drivers because Linux supports it but it should not show in anything related to IPQ806X.
All you want to see is BaseT

yes rx tx counters goes up but no traffic...

Did you apply this patch?
https://git.openwrt.org/?p=openwrt/staging/chunkeey.git;a=blob;f=target/linux/ipq806x/patches-4.19/701-net-dsa-qca8k-implement-DT-based-ports-phy-translati.patch;h=7c904abe357d03bfe2e18ad601bcf3b8d308ba32;hb=1034741b8735608b022d55b08df34d4cff423b46

merged upstream

Do you maybe know when?
I cant find it in git history for qca8k

Also, you cant use PHY_BASIC_FEATURES anymore and advertise gigabit on PHY.
It must be PHY_GIGABIT_FEATURES, that is why PHY drivers are meant to be per PHY instead of this mess that hacks everything based on original AR8216 switch
https://git.openwrt.org/?p=openwrt/staging/xback.git;a=blob;f=target/linux/generic/files/drivers/net/phy/ar8216.c;h=031efe61816c9b7bc3d01671bcb4f1e44c40dd48;hb=b228a55dc48c2779aefbf517b09c8efbe9c6eccf#l2742

1 Like

Hard to write a new driver? Think we should be able to use the other upstream ar driver as a mask...

Anyway i think that for now we should find a way to fix this...

Yeah, its hard, but since qca8k support this switch it actually makes more sense to use it instead of writing a new driver in the old way of pretending that switch is just a collection of PHY-s.

Can you try changing PHY_BASIC_FEATURES to PHY_GIGABIT_FEATURES just for testing?

My TP Link VR2600v should arrive tommorow, so I will finally be able to help you.

1 Like

Doing some search i find this...
https://patchwork.ozlabs.org/patch/1036309/

Last message was from chuckeey that describe my problem with qca8k....

Will try revert that patch... Now i'm trying your suggestion.

Ok, so essentially you can do what that patch was doing somewhat like IPQ40xx does it.
You have a separated MDIO node with all of the attached PHY as subnodes and simply reference to them in qca8k port subnodes.