I'm trying to add support for Sagemcom F@st3864OP, which has a BCM63168 dual-core CPU with a built-in switch and an external switch BCM53124S.
I'm targeting the latest tag (), as its new BMIPS branch adds support for the external MDIO. The external MDIO is required to recognize BCM53124S. I have made the following changes:
$ git status
On branch 22.03.0-rc5-fast3864op
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
(use "git add <file>..." to include in what will be committed)
More details and the repo can be found at:
However, the internal switch does not work at all, also the mdio command can show the port status of both the internal and the external switch. The boot log shows:
[ 2.332493] b53-switch 10700000.switch: found switch QwQ: BCM63xx, rev 0
[ 2.339592] b53-switch 10700000.switch: QwQ dsa_register_switch()=-22
[ 2.346306] b53-switch: probe of 10700000.switch failed with error -22
I added some printk to assist debugging, starting with "QwQ". It turns out that the dsa_register_switch in b53_common.h failed. The error code -22 suggests "Invalid Argument": #define EINVAL 22 /* Invalid argument */ .
Anyone has any idea on this? Should I insert more printk inside dsa_register_switch?
After inserting a whole bunch of "printk", for the external switch, it shows that the call to "dsa_port_parse_of(dp, port);" returns -517 in function "dsa_switch_parse_ports_of()" of "net/dsa/dsa2.c". "-517" is EPROBE_DEFER, which indicates "Driver requests probe retry". Here is my DTS for the external switch:
According to my debug "printk", "ds->num_ports" is 5, which does not seem to be correct. According to the code in the "BCM63xx" target, "ds->num_ports" should be 9: 3 x FE PHY, 1 x GE PHY, 4 x RGMII MAC-PHY interface, and 1 internal CPU port. I will try to patch it.
I tried the master branch (as of 2022 07 20), which has fixed "B53_CPU_PORT" problem. Without specifying the external switch in the dts, the image boots, the wan port works but the LAN ports don't. Then, I attempted to add the external switch to the dts, and the image doesn't boot anymore. The following is the boot log:
[ 2.086792] bcm6368-mdio-mux 107000b0.mdio: Broadcom BCM6368 MDIO mux bus
[ 2.095453] bcm53xx 0.1:1e: found switch: BCM53125, rev 4
[ 2.101076] bcm53xx 0.1:1e: failed to register switch: -517
[ 2.107601] b53-switch 10700000.switch: found switch: BCM63xx, rev 0
[ 2.118387] bcm6368-enetsw 1000d800.ethernet: mtd mac d8:d7:75:13:03:72
[ 2.248248] bcm7038-wdt 1000009c.watchdog: Registered BCM7038 Watchdog
[ 2.261817] NET: Registered PF_INET6 protocol family
[ 2.298322] Segment Routing with IPv6
[ 2.302295] In-situ OAM (IOAM) with IPv6
[ 2.306643] NET: Registered PF_PACKET protocol family
[ 2.312635] 8021q: 802.1Q VLAN Support v1.8
[ 2.349723] bcm53xx 0.1:1e: found switch: BCM53125, rev 4
[ 2.355488] bcm53xx 0.1:1e: failed to register switch: -517
[ 2.361827] b53-switch 10700000.switch: found switch: BCM63xx, rev 0
^ Stucked at this line
I also tried to disable the internal switch, that image boots with the external switch identified. It seems that the b53 driver cannot have two different switches... Needs more printk...