[BPI-R2] Porting 2nd gmac to 4.19

(Frank W.) #1


i tried porting 2nd gmac from 4.14 to 4.19.

for compare here is the version for 4.14:

it compiles without errors, boots without crash/oops, but it still does not work…i only see eth0 and eth1, but none of the external (USER-) ports in “ip a”

also nothing obviously in dmesg

root@bpi-r2-ubuntu:~# dmesg | grep -i 'dsa\|net'                                                                                                                                   
[    0.195904] NET: Registered protocol family 16                                                                                                                                  
[    0.468627] NET: Registered protocol family 2                                                                                                                                   
[    0.513491] NET: Registered protocol family 1                                                                                                                                   
[    1.068059] drivers/net/ethernet/mediatek/mtk_eth_soc.c:mtk_mdio_init[413]0 237bf14f                                                                                            
[    1.075784] mtk_soc_eth 1b100000.ethernet: generated random MAC address 5e:32:b8:eb:72:9b                                                                                       
[    1.084466] mtk_soc_eth 1b100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]                                                              
[    1.095246] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xe14c0000, irq 228                                                                                    
[    1.103682] mtk_soc_eth 1b100000.ethernet: generated random MAC address 12:a6:6c:0e:bd:20                                                                                       
[    1.112250] mtk_soc_eth 1b100000.ethernet: connected mac 1 to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]                                                              
[    1.122983] mtk_soc_eth 1b100000.ethernet eth1: mediatek frame engine at 0xe14c0000, irq 228                                                                                    
[    1.489242] NET: Registered protocol family 17
[    3.678471] NET: Registered protocol family 10

i also wrote to john crispin he will look over it…but maybe anyone here see’s the problem. main challenge was that dsa2.c changes too much for 4.15 (not only functionnames or parameters changed). here i’m unsure if i included new code in right context…

some documentation i used:



net: dsa: setup and teardown ports (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/dsa/dsa2.c?h=v4.19-rc2&id=1d27732f411d57f0168af30be2adb504b8b7749d)

port_apply=> setup

port_unapply => teardown

net: dsa: setup and teardown ports https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/dsa/dsa2.c?h=v4.19-rc2&id=1d27732f411d57f0168af30be2adb504b8b7749d

dsa_ds_parse => dsa_tree_setup_default_cpu

net: dsa: setup and teardown default CPU port https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/dsa/dsa2.c?h=v4.19-rc2&id=f070464cf000131928b2c3fd592efd1946610eea