Other Parts Discussed in Thread: AM5708
Hello,
I'm working on a custom board using AM5708 and DP82826E. The Ethernet PHY is connected to the Processor with RMII signals (TxD0, TxD1, TxEN, MDIO, MDC, RxD0, RxD1, RxDV, RxCLK, RxER).
I'm using processor SDK 06_03_00_106 which is based on kernel 4.19. DP82826E is not available so I created a patch to update the driver (attached to this post).
Device tree is setup to have the Ethernet PHY and seems to be properly working according to the following logs during kernel boot:
root@machine:~# dmesg | grep davinci [ 1.531659] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000 [ 1.539357] davinci_mdio 48485000.mdio: detected phy mask fffffffd [ 1.552000] davinci_mdio 48485000.mdio: phy[1]: device 48485000.mdio:01, driver TI DP83826NC
I have a warning during the boot because no reset is defined (it's not connected to the PHY), not sure it will be relevant:
root@machine:~# dmesg | grep mdio [ 1.464289] mdio_bus fixed-0: GPIO lookup for consumer reset [ 1.464298] mdio_bus fixed-0: using lookup tables for GPIO lookup [ 1.464306] mdio_bus fixed-0: No GPIO consumer reset found [ 1.472095] mdio_bus 48485000.mdio: GPIO lookup for consumer reset [ 1.472104] mdio_bus 48485000.mdio: using device tree for GPIO lookup [ 1.472122] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/ethernet@48484000/mdio@48485000[0]' [ 1.472138] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/ethernet@48484000/mdio@48485000[0]'
PHY is probed:
[ 20.949652] TI DP83826NC 48485000.mdio:01: attached PHY driver [TI DP83826NC] (mii_bus:phy_addr=48485000.mdio:01, irq=POLL)
However, IMPOSSIBLE to get a working Ethernet connection, it looks like the link is not ready.
root@machine:~# ip link set dev eth0 down
root@machine:~# ip link set dev eth0 up
[ 516.315388] net eth0: initializing cpsw version 1.15 (0)
[ 516.346137] TI DP83826NC 48485000.mdio:01: attached PHY driver [TI DP83826NC] (mii_bus:phy_addr=48485000.mdio:01, irq=POLL)
[ 516.364306] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
root@machine:~# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq qlen 1000
link/ether 68:47:49:d5:c6:d6 brd ff:ff:ff:ff:ff:ff
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
I don't exclude a hardware issue but it has been carefully checked and looks good according to ref design found on TI website.
I will be very happy to have feedback or any ideas about this :-) Thanks for sharing !!
Joel
--- a/drivers/net/phy/dp83822.c 2022-02-09 14:29:02.469787000 +0100
+++ b/drivers/net/phy/dp83822.c 2022-02-16 13:43:57.496428590 +0100
@@ -22,7 +22,14 @@
#include <linux/phy.h>
#include <linux/netdevice.h>
-#define DP83822_PHY_ID 0x2000a240
+#define DP83822_PHY_ID 0x2000a240
+#define DP83825S_PHY_ID 0x2000a140
+#define DP83825I_PHY_ID 0x2000a150
+#define DP83825CM_PHY_ID 0x2000a160
+#define DP83825CS_PHY_ID 0x2000a170
+#define DP83826C_PHY_ID 0x2000a130
+#define DP83826NC_PHY_ID 0x2000a110
+
#define DP83822_DEVADDR 0x1f
#define MII_DP83822_PHYSCR 0x11
@@ -312,27 +319,42 @@
return 0;
}
+#define DP8382X_PHY_DRIVER(_id, _name) \
+ { \
+ .phy_id = (_id), \
+ .phy_id_mask = 0xfffffff0, \
+ .name = (_name), \
+ .features = PHY_BASIC_FEATURES, \
+ .flags = PHY_HAS_INTERRUPT, \
+ .config_init = dp83822_config_init, \
+ .soft_reset = dp83822_phy_reset, \
+ .get_wol = dp83822_get_wol, \
+ .set_wol = dp83822_set_wol, \
+ .ack_interrupt = dp83822_ack_interrupt, \
+ .config_intr = dp83822_config_intr, \
+ .suspend = dp83822_suspend, \
+ .resume = dp83822_resume, \
+ }
+
static struct phy_driver dp83822_driver[] = {
- {
- .phy_id = DP83822_PHY_ID,
- .phy_id_mask = 0xfffffff0,
- .name = "TI DP83822",
- .features = PHY_BASIC_FEATURES,
- .flags = PHY_HAS_INTERRUPT,
- .config_init = dp83822_config_init,
- .soft_reset = dp83822_phy_reset,
- .get_wol = dp83822_get_wol,
- .set_wol = dp83822_set_wol,
- .ack_interrupt = dp83822_ack_interrupt,
- .config_intr = dp83822_config_intr,
- .suspend = dp83822_suspend,
- .resume = dp83822_resume,
- },
+ DP8382X_PHY_DRIVER(DP83822_PHY_ID, "TI DP83822"),
+ DP8382X_PHY_DRIVER(DP83825I_PHY_ID, "TI DP83825I"),
+ DP8382X_PHY_DRIVER(DP83826C_PHY_ID, "TI DP83826C"),
+ DP8382X_PHY_DRIVER(DP83826NC_PHY_ID, "TI DP83826NC"),
+ DP8382X_PHY_DRIVER(DP83825S_PHY_ID, "TI DP83825S"),
+ DP8382X_PHY_DRIVER(DP83825CM_PHY_ID, "TI DP83825M"),
+ DP8382X_PHY_DRIVER(DP83825CS_PHY_ID, "TI DP83825CS"),
};
module_phy_driver(dp83822_driver);
static struct mdio_device_id __maybe_unused dp83822_tbl[] = {
{ DP83822_PHY_ID, 0xfffffff0 },
+ { DP83825I_PHY_ID, 0xfffffff0 },
+ { DP83826C_PHY_ID, 0xfffffff0 },
+ { DP83826NC_PHY_ID, 0xfffffff0 },
+ { DP83825S_PHY_ID, 0xfffffff0 },
+ { DP83825CM_PHY_ID, 0xfffffff0 },
+ { DP83825CS_PHY_ID, 0xfffffff0 },
{ },
};
MODULE_DEVICE_TABLE(mdio, dp83822_tbl);