Hi Jonas,

> I am trying to talk to the switch of the RouterStation Pro. I wrote a
> simple phy driver, and its probe() gets called for all 5 phy
> addresses.
> 
> But the config_init() only gets called for the first mac, not the
> second mac, which is a problem, since the cpu port is connected to the
> second mac.
> 
> It seems the ag71xx only tries to attach a driver if there is exactly
> one phy, is this intentional?

Yes, it is intentional. The main purpose of the PHY driver that to inform the
ethernet driver when the link attributes have been changed. Additionally, the
current PHYLIB code does not allow to connect one network device to multiple
PHYs. The attributes of the link between the second mac and the switch is fixed,
so you don't really need to connect it to a PHY device.

> If so, what would be the best way attach the driver to the correct
> mac? Using a plattform_device?

You can use only one phy address in the phy_mask, and your phy driver have to
return the same fixed link parameters when an ethernet device is attached to
this phy address. This is not the perfect solution, but it should be working.
You can see the WRT160NL [1] + RTL8306 [2] code for example.

Alternatively, you can can create a platform driver. This solution is used with
the WZR-HP-G300NH [3] + RTL8366SR [4].

Regards,
Gabor

1.
https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c#L129
2.
https://dev.openwrt.org/browser/trunk/target/linux/generic-2.6/files/drivers/net/phy/rtl8306.c

3.
https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c#L234
4.
https://dev.openwrt.org/browser/trunk/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to