This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DP83849C: PHY not getting detected in driver

Part Number: DP83849C
Other Parts Discussed in Thread: DP83848C, DP83849I, DP83620

Hi,

     We are using Linux LTS v6.1.58 on i.MX6Solo where we have SJA1105Q Switch connected to Dual-port DP83849C PHY.

Switch, SJA1105Q is configured in DTS with DP83849C PHY via port@2, @3, and Enabled Linux Net PHY driver CONFIG_DP83848_PHY.

 Configured DT:

https://gist.github.com/openedev/01d96917118de24e9e42c33649422367


We thought DP83848 was a compatible driver for DP83849 IC but, we are unable to detect the PHY

Log as below : 
[   21.783450] sja1105 spi1.0: Probed switch chip: SJA1105Q
[   21.914146] sja1105 spi1.0: configuring for fixed/mii link mode
[   21.928109] sja1105 spi1.0: Link is Up - 100Mbps/Full - flow control off
[   21.954012] sja1105 spi1.0 ethphy0 (uninitialized): failed to connect to PHY: -ENODEV
[   21.962173] sja1105 spi1.0 ethphy0 (uninitialized): error -19 setting up PHY for tree 0, switch 0, port 2
[   22.004246] sja1105 spi1.0 ethphy1 (uninitialized): failed to connect to PHY: -ENODEV
[   22.012127] sja1105 spi1.0 ethphy1 (uninitialized): error -19 setting up PHY for tree 0, switch 0, port 3
[   22.079503] device eth0 entered promiscuous mode

Let us know if DP83848 is a compatible driver for DP83849 IC or need to write a new driver DP83849.

Please help us to resolve this issue.

Regards,

Bitesh

  • Hi Bitesh,

    I do not believe the DP83848 driver would be compatible with the Dual port DP83849. I believe you would need to create a new driver. Please allow me another day to confirm.

    Regards,

    Alvaro

  • Hi Alvaro,

                  Thanks for your response. Can you please let me know where I can get ready to use driver for  DP83849 ? 

    Regards,

    Bitesh

  • Hi Bitesh,

    Unfortunately we do not currently have one.

    Regards,

    Alvaro

  • Hi,

       We are using DP83848 with some modifications and have got some progress. However when we are doing ethernet testing we are getting phy0 power-down. following is the log for PHY register read using MDIO tool.

    $ mdio

    $ mdio 2188000.ethernet-1 phy 0 raw 0x0

    0x3900

    $ mdio 2188000.ethernet-1 phy 1 raw 0x0

    0x3100

    For proper operation content should be 0x3100 but for Phy0 we re getting 0x3900.

    Can you please let us know how to solve this problem ?

    I have raised a separate thread for this problem. 

    https://e2e.ti.com/support/interface-group/interface/f/interface-forum/1299303/dp83849i-phy0-power-down---schematic-review

    Regards,

    Bitesh

  • Hi Biteshnath,

    Someone else is currently looking over your new E2E thread regarding the schematic. I will close this thread and allow my teammate to continue on the new thread you linked.

    Regards,

    Alvaro

  • Hi,

          Can you see below link where Nikhil from TI has replied that DP83848 is compatible with DP83849 ?

    DP83849I: Availability of Ethernet Phy chip device driver - Interface forum - Interface - TI E2E support forums

    Please let me know if I can directly use DP83848. Or let me know what changes I need to do in following driver.

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/dp83848.c

    Regards,

    Bitesh

  • Hi Bitesh,

    Right now we don't have the necessary hardware to test the driver. I'm not sure how the 848 driver initialization will handle the dual port function.

    At the moment we cannot support this query.

    Regards,

    Alvaro 

  • Hi,

        Can you please let me know if TI is selling the DP83849 part to customers what they expect the customers to do for driver ?

    Why on TI website driver is not available and TI is not supporting for related queries ?

    Regards,

    Bitesh 

  • Hi Bitesh.

    I'm afraid that this is an old part with limited support. The team members who originally worked on this part are no longer here.

    We currently don't have a driver solution but if you are trying to do edit the DP83848 driver for the DP83849, I can do my best to assist. I want to reiterate that we don't have the hardware to test it. 

    Regards,

    Alvaro

  • Hi Alvaro ,

                    Thanks for your response. Can you please let me know What changes are required in following DP83848 driver given on TI website to make it work for DP83849 ?

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/dp83848.c

    Regards,

    Bitesh

  • Hi Bitesh,

    The first step would be to define the DP83849_PHY_ID, this can be done by reading Reg 02 & 0x3.

    Search for all instances of DP83848C_PHY_ID and add the DP83849_PHY_ID after completing the steps below.

    Example:

    In lab I grabbed a DP83849IFVS-EVK to check the Register Values.

    • Reg 0x2 = 2000
    • Reg 0x3 = 5CA2
    • PHY_ID = 20005CA2

    Please note that the value I read does not match the current datasheet's default value, meaning I have an older version of the part. Please read these registers and verify the model you have.

    Please reference Section 4.3 of this document for some basic commands and outputs to try to verify if the driver is being recognized.

    Regards,

    Alvaro

  • Hi,

        I used the same DP83848 driver and After initializing I'm getting following log. Ports have PHYSICAL Address as 0x00 and 0x01

    DEV    PHY-ID           LINK
    0x00    0x20005ca2   up
    0x01    0x20005ca2   up

    Is it correct that Phy-ID shall be same for both the ports as 0x20005ca2 ?

    Also I tried to ping from PC to my board but it is showing Destination host unreachable as log.

    I have connected PC to my board with ethernet cable and setting IP settings correctly on both side.

    Then I connected 2 boards ethernet port via cable and tried to ping each other but still ping not working.

    Board sl#1 log : 

    root@ltts-imx6solo:~# ip addr add dev ethphy1 192.168.1.5/16
    root@ltts-imx6solo:~# ip link set dev eth0 up
    [ 207.911113] (null): ret 0
    [ 207.914056] TI DP83849I 10/100 Mbps PHY 2188000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL)
    root@ltts-imx6solo:~# ip link set dev ethphy0 up
    [ 216.250001] sja1105 spi1.0 ethphy0: configuring for phy/mii link mode
    [ 216.261025] ------------[ cut here ]------------
    [ 216.265962] WARNING: CPU: 0 PID: 321 at drivers/net/phy/phy.c:1157 phy_start+0x58/0xb4
    [ 216.274115] called from state NOLINK
    [ 216.277712] Modules linked in: mdio_netlink(O) bnep tag_sja1105 sja1105 pcs_xpcs brcmfmac brcmutil imx_sdma coda_vpu v4l2_jpeg imx_vdoa evbug
    [ 216.290622] CPU: 0 PID: 321 Comm: ip Tainted: G O 6.1.58 #1
    [ 216.297605] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    [ 216.304148] unwind_backtrace from show_stack+0x10/0x14
    [ 216.309405] show_stack from dump_stack_lvl+0x58/0x70
    [ 216.314486] dump_stack_lvl from __warn+0x70/0x1a4
    [ 216.319306] __warn from warn_slowpath_fmt+0x1bc/0x270
    [ 216.324463] warn_slowpath_fmt from phy_start+0x58/0xb4
    [ 216.329712] phy_start from dsa_port_enable_rt+0x54/0x9c
    [ 216.335047] dsa_port_enable_rt from dsa_slave_open+0xb8/0x17c
    [ 216.340907] dsa_slave_open from __dev_open+0xec/0x1ac
    [ 216.346069] __dev_open from __dev_change_flags+0x18c/0x224
    [ 216.351659] __dev_change_flags from dev_change_flags+0x14/0x44
    [ 216.357594] dev_change_flags from do_setlink+0x254/0xe4c
    [ 216.363018] do_setlink from rtnl_newlink+0x598/0x80c
    [ 216.368091] rtnl_newlink from rtnetlink_rcv_msg+0x168/0x574
    [ 216.373767] rtnetlink_rcv_msg from netlink_rcv_skb+0xb8/0x11c
    [ 216.379617] netlink_rcv_skb from netlink_unicast+0x1a8/0x2dc
    [ 216.385387] netlink_unicast from netlink_sendmsg+0x1d8/0x450
    [ 216.391160] netlink_sendmsg from ____sys_sendmsg+0x188/0x258
    [ 216.396932] ____sys_sendmsg from ___sys_sendmsg+0x6c/0xa4
    [ 216.402438] ___sys_sendmsg from sys_sendmsg+0x50/0x98
    [ 216.407597] sys_sendmsg from ret_fast_syscall+0x0/0x1c
    [ 216.412842] Exception stack(0xf1145fa8 to 0xf1145ff0)
    [ 216.417909] 5fa0: 00000000 00000001 00000003 beedc710 00000000 00000000
    [ 216.426100] 5fc0: 00000000 00000001 b6fb75a0 00000128 626adb9a 00000000 00561cc0 00561cc0
    [ 216.434288] 5fe0: 00000128 beedc6b0 b6ebf6d3 b6e31ae6
    [ 216.439419] irq event stamp: 3265
    [ 216.442803] hardirqs last enabled at (3275): [<c0195dbc>] __up_console_sem+0x50/0x60
    [ 216.450666] hardirqs last disabled at (3282): [<c0195da8>] __up_console_sem+0x3c/0x60
    [ 216.458576] softirqs last enabled at (3162): [<c01017d0>] __do_softirq+0x2c0/0x57c
    [ 216.466313] softirqs last disabled at (3123): [<c012f204>] __irq_exit_rcu+0x138/0x17c
    [ 216.474229] ---[ end trace 0000000000000000 ]---
    root@ltts-imx6solo:~# ip link set dev ethphy1 up
    [ 223.997870] sja1105 spi1.0 ethphy1: configuring for phy/mii link mode
    root@ltts-imx6solo:~# [ 226.081937] sja1105 spi1.0 ethphy1: Link is Up - 100Mbps/Full - flow control off
    [ 226.089444] IPv6: ADDRCONF(NETDEV_CHANGE): ethphy1: link becomes ready

    root@ltts-imx6solo:~# [ 331.121283] sja1105 spi1.0 ethphy1: Link is Down
    [ 333.201772] sja1105 spi1.0 ethphy1: Link is Up - 100Mbps/Full - flow control off
    [ 344.641192] sja1105 spi1.0 ethphy1: Link is Down
    [ 348.321311] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
    [ 348.329630] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

    root@ltts-imx6solo:~# mdio 2188000.ethernet-1
    DEV PHY-ID LINK
    0x00 0x20005ca2 up
    0x01 0x20005ca2 down
    root@ltts-imx6solo:~# ifconfig
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1504
    inet6 fe80::5019:f0ff:fe3f:e61a prefixlen 64 scopeid 0x20<link>
    ether 52:19:f0:3f:e6:1a txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    ethphy0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
    inet 192.168.1.1 netmask 255.255.0.0 broadcast 0.0.0.0
    ether 00:11:22:33:44:55 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    ethphy1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
    inet 192.168.1.5 netmask 255.255.0.0 broadcast 0.0.0.0
    inet6 fe80::211:22ff:fe33:4466 prefixlen 64 scopeid 0x20<link>
    ether 00:11:22:33:44:66 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 42 bytes 5164 (5.0 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 1000 (Local Loopback)
    RX packets 89 bytes 7675 (7.4 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 89 bytes 7675 (7.4 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    root@ltts-imx6solo:~# ping 192.168.1.6
    PING 192.168.1.6 (192.168.1.6): 56 data bytes
    ^C
    --- 192.168.1.6 ping statistics ---
    4 packets transmitted, 0 packets received, 100% packet loss
    root@ltts-imx6solo:~# ^C
    root@ltts-imx6solo:~#

    Board sl#2 log : 

    ltts-imx6solo login: root
    root@ltts-imx6solo:~# mdio
    [ 94.648231] mdio_netlink: loading out-of-tree module taints kernel.
    2188000.ethernet-1
    fixed-0
    root@ltts-imx6solo:~# ip link set dev eth0 down
    root@ltts-imx6solo:~# ip link set dev ethphy0 down
    root@ltts-imx6solo:~# ip link set dev ethphy1 down
    root@ltts-imx6solo:~# ip link set dev ethphy0 address 00:11:22:33:44:77
    root@ltts-imx6solo:~# ip link set dev ethphy1 address 00:11:22:33:44:88
    root@ltts-imx6solo:~# ip addr add dev ethphy0 192.168.1.2/16
    root@ltts-imx6solo:~# ip addr add dev ethphy1 192.168.1.6/16
    root@ltts-imx6solo:~# ip link set dev eth0 up
    [ 297.602363] dp83848_config_init: BMCR 0x3100
    [ 297.606710] dp83848_config_init: STATUS 0x0
    [ 297.610985] dp83848_config_init: BMCR 0x3100
    [ 297.622350] dp83848_config_init: STATUS 0x0
    [ 297.626609] dp83848_config_intr: STATUS 0x0
    [ 297.631150] TI DP83848C 10/100 Mbps PHY 2188000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL)
    root@ltts-imx6solo:~# ip link set dev ethphy0 up
    [ 307.220431] sja1105 spi1.0 ethphy0: configuring for phy/mii link mode
    [ 307.232338] ------------[ cut here ]------------
    [ 307.237280] WARNING: CPU: 0 PID: 320 at drivers/net/phy/phy.c:1157 phy_start+0x58/0xb4
    [ 307.245440] called from state NOLINK
    [ 307.249036] Modules linked in: mdio_netlink(O) bnep tag_sja1105 sja1105 pcs_xpcs brcmfmac brcmutil imx_sdma coda_vpu v4l2_jpeg imx_vdoa evbug
    [ 307.261946] CPU: 0 PID: 320 Comm: ip Tainted: G O 6.1.58 #1
    [ 307.268927] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    [ 307.275469] unwind_backtrace from show_stack+0x10/0x14
    [ 307.280726] show_stack from dump_stack_lvl+0x58/0x70
    [ 307.285806] dump_stack_lvl from __warn+0x70/0x1a4
    [ 307.290626] __warn from warn_slowpath_fmt+0x1bc/0x270
    [ 307.295783] warn_slowpath_fmt from phy_start+0x58/0xb4
    [ 307.301029] phy_start from dsa_port_enable_rt+0x54/0x9c
    [ 307.306367] dsa_port_enable_rt from dsa_slave_open+0xb8/0x17c
    [ 307.312226] dsa_slave_open from __dev_open+0xec/0x1ac
    [ 307.317390] __dev_open from __dev_change_flags+0x18c/0x224
    [ 307.322978] __dev_change_flags from dev_change_flags+0x14/0x44
    [ 307.328914] dev_change_flags from do_setlink+0x254/0xe4c
    [ 307.334339] do_setlink from rtnl_newlink+0x598/0x80c
    [ 307.339414] rtnl_newlink from rtnetlink_rcv_msg+0x168/0x574
    [ 307.345089] rtnetlink_rcv_msg from netlink_rcv_skb+0xb8/0x11c
    [ 307.350940] netlink_rcv_skb from netlink_unicast+0x1a8/0x2dc
    [ 307.356709] netlink_unicast from netlink_sendmsg+0x1d8/0x450
    [ 307.362483] netlink_sendmsg from ____sys_sendmsg+0x188/0x258
    [ 307.368256] ____sys_sendmsg from ___sys_sendmsg+0x6c/0xa4
    [ 307.373763] ___sys_sendmsg from sys_sendmsg+0x50/0x98
    [ 307.378923] sys_sendmsg from ret_fast_syscall+0x0/0x1c
    [ 307.384168] Exception stack(0xf1129fa8 to 0xf1129ff0)
    [ 307.389235] 9fa0: 00000000 00000001 00000003 be91f740 00000000 00000000
    [ 307.397425] 9fc0: 00000000 00000001 b6eff5a0 00000128 65806370 00000000 004b1cc0 004b1cc0
    [ 307.405614] 9fe0: 00000128 be91f6e0 b6dff6d3 b6d71ae6
    [ 307.410745] irq event stamp: 3409
    [ 307.414124] hardirqs last enabled at (3419): [<c0195dbc>] __up_console_sem+0x50/0x60
    [ 307.421989] hardirqs last disabled at (3426): [<c0195da8>] __up_console_sem+0x3c/0x60
    [ 307.429898] softirqs last enabled at (3306): [<c01017d0>] __do_softirq+0x2c0/0x57c
    [ 307.437634] softirqs last disabled at (3263): [<c012f204>] __irq_exit_rcu+0x138/0x17c
    [ 307.445550] ---[ end trace 0000000000000000 ]---
    root@ltts-imx6solo:~# ip link set dev ethphy1 up
    [ 320.439141] sja1105 spi1.0 ethphy1: configuring for phy/mii link mode
    root@ltts-imx6solo:~# [ 322.563253] sja1105 spi1.0 ethphy1: Link is Up - 100Mbps/Full - flow control off
    [ 322.570766] IPv6: ADDRCONF(NETDEV_CHANGE): ethphy1: link becomes ready

    root@ltts-imx6solo:~# [ 335.042538] sja1105 spi1.0 ethphy1: Link is Down
    [ 338.163096] sja1105 spi1.0 ethphy1: Link is Up - 100Mbps/Full - flow control off

    root@ltts-imx6solo:~# mdio 2188000.ethernet-1
    DEV PHY-ID LINK
    0x00 0x20005ca2 down
    0x01 0x20005ca2 up
    root@ltts-imx6solo:~# ifocnfig
    -sh: ifocnfig: command not found
    root@ltts-imx6solo:~# ifconfig
    eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1504
    ether 16:5f:0a:5c:d1:ca txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    ethphy0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
    inet 192.168.1.2 netmask 255.255.0.0 broadcast 0.0.0.0
    ether 00:11:22:33:44:77 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    ethphy1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.1.6 netmask 255.255.0.0 broadcast 0.0.0.0
    inet6 fe80::211:22ff:fe33:4488 prefixlen 64 scopeid 0x20<link>
    ether 00:11:22:33:44:88 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 41 bytes 5094 (4.9 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 1000 (Local Loopback)
    RX packets 89 bytes 7675 (7.4 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 89 bytes 7675 (7.4 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    root@ltts-imx6solo:~# ping 192.168.1.1
    PING 192.168.1.1 (192.168.1.1): 56 data bytes
    ^C
    --- 192.168.1.1 ping statistics ---
    7 packets transmitted, 0 packets received, 100% packet loss
    root@ltts-imx6solo:~#

    Link is UP but ping is not working so What I can look into to debug this problem ?

    Regards,

    Bitesh

  • Hi Bitesh,

    Alvaro is currently out of office. He will reach back to you right after he get back to the office.

    --

    Regards,

    Hillman Lin

  • Hi Hillman Lin,

                          Can you please help to resolve this query ?

    Regards,

    Bitesh

  • Hi Bitesh,

    Currently Alvaro Reyes is OoO for Christmas vacation and will be returning after the holidays. Our team can help in the interim, but as Alvaro had said this is an older device with support limited to datasheet and common knowledge. Please also be aware that US offices will be closed starting next Monday and Tuesday as well as the following Monday for holidays. As people start to take off for vacation, support will be limited.

    My understanding is that you have DP83849 on a custom board and are having ping issues? If you are able to confirm linkup (via Reg 0x1[2]), I would suspect there is an issue on the MAC interface. You can try generating packets using the MAC and looping back using MII loopback (Reg 0x0[14]) and confirm that this interface is the issue.

    Sincerely,

    Gerome

  • Hi Gerome Cacho,

                                  Thanks for your response. Link is going up and we can confirm it from log.

    Alvaro in the previous reply mentioned about PHYID change. We modified but no success.

    Please find our code below :

    Code:

     

    diff --git a/drivers/net/phy/dp83848.c b/drivers/net/phy/dp83848.c index c38d33fd3706..c2c82ce5bb41 100644

    --- a/drivers/net/phy/dp83848.c

    +++ b/drivers/net/phy/dp83848.c

    @@ -8,6 +8,7 @@

     #include <linux/module.h>

     #include <linux/phy.h>

     

    +#define TI_DP83849I_PHY_ID             0x20005ca2

     #define TI_DP83848C_PHY_ID             0x20005ca0

     #define TI_DP83620_PHY_ID              0x20005ce0

     #define NS_DP83848C_PHY_ID             0x20005c90

    @@ -173,6 +174,8 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl);

            }

     

     static struct phy_driver dp83848_driver[] = {

    +       DP83848_PHY_DRIVER(TI_DP83849I_PHY_ID, "TI DP83849I 10/100 Mbps PHY",

    +                          NULL),

            DP83848_PHY_DRIVER(TI_DP83848C_PHY_ID, "TI DP83848C 10/100 Mbps PHY",

                               NULL),

            DP83848_PHY_DRIVER(NS_DP83848C_PHY_ID, "NS DP83848C 10/100 Mbps PHY",

    Log on the custom board :

    Log:

    root@ltts-imx6solo:~# dmesg | grep sja

    [   23.765086] sja1105 spi1.0: spi_imx_setup: mode 1, 8 bpw, 4000000 hz

    [   23.765164] sja1105 spi1.0: setup mode 1, 8 bits/w, 4000000 Hz max --> 0

    [   23.766160] sja1105 spi1.0: Probed switch chip: SJA1105Q

    [   24.037103] sja1105 spi1.0: configuring for fixed/mii link mode

    [   24.119891] sja1105 spi1.0 ethphy0 (uninitialized): PHY

    [2188000.ethernet-1:00] driver [TI DP83849I 10/100 Mbps PHY]

    (irq=POLL)

    [   24.279129] sja1105 spi1.0 ethphy1 (uninitialized): PHY

    [2188000.ethernet-1:01] driver [TI DP83849I 10/100 Mbps PHY]

    (irq=POLL)

    [   26.406998] sja1105 spi1.0: Link is Up - 100Mbps/Full - flow control off

     

    The PHY0 link does not bring up it is showing NOLINK at the beginning.

     

    Here is MDIO reg set and link configurations.

    root@ltts-imx6solo:~# cat /usr/phy.sh

    #!/bin/sh

     

    echo ======= MDIO: PHY0 ========

    mdio 2188000.ethernet-1 phy 0 raw 0x0

    mdio 2188000.ethernet-1 phy 0 raw 0x1

    mdio 2188000.ethernet-1 phy 0 raw 0x2

    mdio 2188000.ethernet-1 phy 0 raw 0x3

    mdio 2188000.ethernet-1 phy 0 raw 0x4

    mdio 2188000.ethernet-1 phy 0 raw 0x5

    mdio 2188000.ethernet-1 phy 0 raw 0x6

    mdio 2188000.ethernet-1 phy 0 raw 0x7

    mdio 2188000.ethernet-1 phy 0 raw 0x10

    mdio 2188000.ethernet-1 phy 0 raw 0x19

     

    echo ======= MDIO: PHY1 ========

    mdio 2188000.ethernet-1 phy 1 raw 0x0

    mdio 2188000.ethernet-1 phy 1 raw 0x1

    mdio 2188000.ethernet-1 phy 1 raw 0x2

    mdio 2188000.ethernet-1 phy 1 raw 0x3

    mdio 2188000.ethernet-1 phy 1 raw 0x4

    mdio 2188000.ethernet-1 phy 1 raw 0x5

    mdio 2188000.ethernet-1 phy 1 raw 0x6

    mdio 2188000.ethernet-1 phy 1 raw 0x7

    mdio 2188000.ethernet-1 phy 1 raw 0x10

    mdio 2188000.ethernet-1 phy 1 raw 0x19

     

    ip link set dev eth0 down

    ip link set dev ethphy0 down

    ip link set dev ethphy1 down

     

    ip link set dev ethphy0 address 00:11:22:33:44:55 ip link set dev ethphy1 address 00:11:22:33:44:66

     

    ip addr add dev ethphy0 169.254.178.1/16 ip addr add dev ethphy1 169.253.178.2/16

     

    ip link set dev eth0 up

    ip link set dev ethphy0 up

    ip link set dev ethphy1 up

     

    echo ########## MDIO: PHY0 ###########

    mdio 2188000.ethernet-1 phy 0 raw 0x0

    mdio 2188000.ethernet-1 phy 0 raw 0x1

    mdio 2188000.ethernet-1 phy 0 raw 0x2

    mdio 2188000.ethernet-1 phy 0 raw 0x3

    mdio 2188000.ethernet-1 phy 0 raw 0x4

    mdio 2188000.ethernet-1 phy 0 raw 0x5

    mdio 2188000.ethernet-1 phy 0 raw 0x6

    mdio 2188000.ethernet-1 phy 0 raw 0x7

    mdio 2188000.ethernet-1 phy 0 raw 0x10

    mdio 2188000.ethernet-1 phy 0 raw 0x19

     

    echo ########## MDIO: PHY1 ###########

    mdio 2188000.ethernet-1 phy 1 raw 0x0

    mdio 2188000.ethernet-1 phy 1 raw 0x1

    mdio 2188000.ethernet-1 phy 1 raw 0x2

    mdio 2188000.ethernet-1 phy 1 raw 0x3

    mdio 2188000.ethernet-1 phy 1 raw 0x4

    mdio 2188000.ethernet-1 phy 1 raw 0x5

    mdio 2188000.ethernet-1 phy 1 raw 0x6

    mdio 2188000.ethernet-1 phy 1 raw 0x7

    mdio 2188000.ethernet-1 phy 1 raw 0x10

    mdio 2188000.ethernet-1 phy 1 raw 0x19

     

     

    root@ltts-imx6solo:~# mdio 2188000.ethernet-1 phy 0 raw 0x0

    0x3900

    root@ltts-imx6solo:~# mdio 2188000.ethernet-1 phy 1 raw 0x0

    0x3100

    root@ltts-imx6solo:~# bash /usr/phy.sh

    ======= MDIO: PHY0 ========

    0x3900

    0x7849

    0x2000

    0x5ca2

    0x01e1

    0x45e1

    0x0006

    0x2001

    0x0000

    0x8020

    ======= MDIO: PHY1 ========

    0x3100

    0x786d

    0x2000

    0x5ca2

    0x01e1

    0x45e1

    0x0007

    0x2801

    0x0015

    0x8021

    [ 1254.925153] dp83848_config_init: ret 0 [ 1254.929229] TI DP83849I 10/100 Mbps PHY 2188000.ethernet-1:00:

    attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL) [ 1254.993819] sja1105 spi1.0 ethphy0: configuring for phy/mii link mode [ 1255.005027] ------------[ cut here ]------------ [ 1255.009962] WARNING: CPU: 0 PID: 374 at drivers/net/phy/phy.c:1157

    phy_start+0x58/0xb4

    [ 1255.018062] called from state NOLINK

    [ 1255.021656] Modules linked in: mdio_netlink(O) bnep tag_sja1105

    sja1105 pcs_xpcs brcmfmac brcmutil imx_sdma coda_vpu v4l2_jpeg imx_vdoa evbug

    [ 1255.034578] CPU: 0 PID: 374 Comm: ip Tainted: G           O       6.1.58 #1

    [ 1255.041560] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 1255.048103]  unwind_backtrace from show_stack+0x10/0x14 [ 1255.053361]  show_stack from dump_stack_lvl+0x58/0x70 [ 1255.058441]  dump_stack_lvl from __warn+0x70/0x1a4 [ 1255.063258]  __warn from warn_slowpath_fmt+0x1bc/0x270 [ 1255.068416]  warn_slowpath_fmt from phy_start+0x58/0xb4 [ 1255.073662]  phy_start from dsa_port_enable_rt+0x54/0x9c [ 1255.079000]  dsa_port_enable_rt from dsa_slave_open+0xb8/0x17c [ 1255.084860]  dsa_slave_open from __dev_open+0xec/0x1ac [ 1255.090024]  __dev_open from __dev_change_flags+0x18c/0x224 [ 1255.095613]  __dev_change_flags from dev_change_flags+0x14/0x44 [ 1255.101549]  dev_change_flags from do_setlink+0x254/0xe4c [ 1255.106974]  do_setlink from rtnl_newlink+0x598/0x80c [ 1255.112048]  rtnl_newlink from rtnetlink_rcv_msg+0x168/0x574 [ 1255.117722]  rtnetlink_rcv_msg from netlink_rcv_skb+0xb8/0x11c [ 1255.123572]  netlink_rcv_skb from netlink_unicast+0x1a8/0x2dc [ 1255.129343]  netlink_unicast from netlink_sendmsg+0x1d8/0x450 [ 1255.135117]  netlink_sendmsg from ____sys_sendmsg+0x188/0x258 [ 1255.140891]  ____sys_sendmsg from ___sys_sendmsg+0x6c/0xa4 [ 1255.146397]  ___sys_sendmsg from sys_sendmsg+0x50/0x98 [ 1255.151556]  sys_sendmsg from ret_fast_syscall+0x0/0x1c [ 1255.156801] Exception stack(0xf10c9fa8 to 0xf10c9ff0)

    [ 1255.161867] 9fa0:                   00000000 00000001 00000003

    beef2730 00000000 00000000

    [ 1255.170057] 9fc0: 00000000 00000001 b6f9e5a0 00000128 626adc51

    00000000 004d1cc0 004d1cc0

    [ 1255.178244] 9fe0: 00000128 beef26d0 b6e9f6d3 b6e11ae6 [ 1255.183469] irq event stamp: 3345 [ 1255.186852] hardirqs last  enabled at (3355): [<c0195dbc>]

    __up_console_sem+0x50/0x60

    [ 1255.194715] hardirqs last disabled at (3362): [<c0195da8>]

    __up_console_sem+0x3c/0x60

    [ 1255.202628] softirqs last  enabled at (3344): [<c01017d0>] __do_softirq+0x2c0/0x57c [ 1255.210365] softirqs last disabled at (3325): [<c012f204>] __irq_exit_rcu+0x138/0x17c [ 1255.218281] ---[ end trace 0000000000000000 ]--- [ 1255.293759] sja1105 spi1.0 ethphy1: configuring for phy/mii link mode

     

    0x3100

    0x7849

    0x2000

    0x5ca2

    0x05e1

    0x0000

    0x0004

    0x2001

    0x0000

    0x8020

     

    0x3100

    0x7849

    0x2000

    0x5ca2

    0x0141

    0x0000

    0x0005

    0x2801

    0x0000

    0x8021

    root@ltts-imx6solo:~# [ 1257.045875] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx [ 1257.054008] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 1257.365971] sja1105 spi1.0 ethphy1: Link is Up - 100Mbps/Full - flow control off [ 1257.373455] IPv6: ADDRCONF(NETDEV_CHANGE): ethphy1: link becomes ready

     

    root@ltts-imx6solo:~# ifconfig -a

    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1504

            inet6 fe80::7c4c:1aff:fe5e:cbf0  prefixlen 64  scopeid 0x20<link>

            ether 7e:4c:1a:5e:cb:f0  txqueuelen 1000  (Ethernet)

            RX packets 0  bytes 0 (0.0 B)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 0  bytes 0 (0.0 B)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    ethphy0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

            inet 169.254.178.1  netmask 255.255.0.0  broadcast 0.0.0.0

            ether 00:11:22:33:44:55  txqueuelen 1000  (Ethernet)

            RX packets 0  bytes 0 (0.0 B)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 0  bytes 0 (0.0 B)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    ethphy1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

            inet 169.253.178.2  netmask 255.255.0.0  broadcast 0.0.0.0

            inet6 fe80::211:22ff:fe33:4466  prefixlen 64  scopeid 0x20<link>

            ether 00:11:22:33:44:66  txqueuelen 1000  (Ethernet)

            RX packets 0  bytes 0 (0.0 B)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 32  bytes 4211 (4.1 KiB)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

            inet 127.0.0.1  netmask 255.0.0.0

            inet6 ::1  prefixlen 128  scopeid 0x10<host>

            loop  txqueuelen 1000  (Local Loopback)

            RX packets 91  bytes 7801 (7.6 KiB)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 91  bytes 7801 (7.6 KiB)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    sit0: flags=128<NOARP>  mtu 1480

            unspec 00-00-00-00-31-00-00-4A-00-00-00-00-00-00-00-00

    txqueuelen 1000  (UNSPEC)

            RX packets 0  bytes 0 (0.0 B)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 0  bytes 0 (0.0 B)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    wlan0: flags=4098<BROADCAST,MULTICAST>  mtu 1500

            ether c0:ee:40:82:2f:fc  txqueuelen 1000  (Ethernet)

            RX packets 0  bytes 0 (0.0 B)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 0  bytes 0 (0.0 B)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    root@ltts-imx6solo:~# mdio 2188000.ethernet-1

     DEV      PHY-ID  LINK

    0x00  0x20005ca2  up

    0x01  0x20005ca2  up

     

    Can you see the log and let us know why we are getting warning and Phy 0 not going up at the beginning. Let me know if you find any abnormalities in log.

    Regards,

    Bitesh

  • Hi Bitesh,

    Unfortunately, I am not an expert in SW, more HW, so I wouldn't be able to do a complete analysis. However, I do see PHY0 link not going up until the last portion, while PHY1 link is intermittent. While I am unsure what is going on in the interim during the log, as the PHYs links are up in the last segment, can you please confirm link is up then? 

    Sincerely,

    Gerome

  • 5226.ethernet section schematic.pdfHi Gerome Cacho,

                                   Thanks for your response. Link is going up for Phy 0 and Phy 1 but not during initialization. Phy 0 throws warning.

    When we power up the board and read address 0x00 of Phy 0 register we are reading 0x3900 ( This indicates power down bit high)

    but contents at  address 0x00 of Phy 1 register is 0x3100  ( Normal operation ).

    We have left PWRDOWN_INT_A (pin 18) and PWRDOWN_INT_B (pin 44) floating in schematic. As explained above, is variation in the contents at address 0x00 of  Phy 0 and Phy 1 is because of it ? OR there is something in SW driver we have to take care. 

    When we are giving Phy 0  up command we get warning log as follows - 

    root@ltts-imx6solo:~# ip link set dev ethphy0 up
    [ 216.250001] sja1105 spi1.0 ethphy0: configuring for phy/mii link mode
    [ 216.261025] ------------[ cut here ]------------
    [ 216.265962] WARNING: CPU: 0 PID: 321 at drivers/net/phy/phy.c:1157 phy_start+0x58/0xb4
    [ 216.274115] called from state NOLINK
    [ 216.277712] Modules linked in: mdio_netlink(O) bnep tag_sja1105 sja1105 pcs_xpcs brcmfmac brcmutil imx_sdma coda_vpu v4l2_jpeg imx_vdoa evbug
    [ 216.290622] CPU: 0 PID: 321 Comm: ip Tainted: G O 6.1.58 #1
    [ 216.297605] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    [ 216.304148] unwind_backtrace from show_stack+0x10/0x14
    [ 216.309405] show_stack from dump_stack_lvl+0x58/0x70
    [ 216.314486] dump_stack_lvl from __warn+0x70/0x1a4
    [ 216.319306] __warn from warn_slowpath_fmt+0x1bc/0x270
    [ 216.324463] warn_slowpath_fmt from phy_start+0x58/0xb4
    [ 216.329712] phy_start from dsa_port_enable_rt+0x54/0x9c
    [ 216.335047] dsa_port_enable_rt from dsa_slave_open+0xb8/0x17c
    [ 216.340907] dsa_slave_open from __dev_open+0xec/0x1ac
    [ 216.346069] __dev_open from __dev_change_flags+0x18c/0x224
    [ 216.351659] __dev_change_flags from dev_change_flags+0x14/0x44
    [ 216.357594] dev_change_flags from do_setlink+0x254/0xe4c
    [ 216.363018] do_setlink from rtnl_newlink+0x598/0x80c
    [ 216.368091] rtnl_newlink from rtnetlink_rcv_msg+0x168/0x574
    [ 216.373767] rtnetlink_rcv_msg from netlink_rcv_skb+0xb8/0x11c
    [ 216.379617] netlink_rcv_skb from netlink_unicast+0x1a8/0x2dc
    [ 216.385387] netlink_unicast from netlink_sendmsg+0x1d8/0x450
    [ 216.391160] netlink_sendmsg from ____sys_sendmsg+0x188/0x258
    [ 216.396932] ____sys_sendmsg from ___sys_sendmsg+0x6c/0xa4
    [ 216.402438] ___sys_sendmsg from sys_sendmsg+0x50/0x98
    [ 216.407597] sys_sendmsg from ret_fast_syscall+0x0/0x1c
    [ 216.412842] Exception stack(0xf1145fa8 to 0xf1145ff0)
    [ 216.417909] 5fa0: 00000000 00000001 00000003 beedc710 00000000 00000000
    [ 216.426100] 5fc0: 00000000 00000001 b6fb75a0 00000128 626adb9a 00000000 00561cc0 00561cc0
    [ 216.434288] 5fe0: 00000128 beedc6b0 b6ebf6d3 b6e31ae6
    [ 216.439419] irq event stamp: 3265
    [ 216.442803] hardirqs last enabled at (3275): [<c0195dbc>] __up_console_sem+0x50/0x60
    [ 216.450666] hardirqs last disabled at (3282): [<c0195da8>] __up_console_sem+0x3c/0x60
    [ 216.458576] softirqs last enabled at (3162): [<c01017d0>] __do_softirq+0x2c0/0x57c
    [ 216.466313] softirqs last disabled at (3123): [<c012f204>] __irq_exit_rcu+0x138/0x17c
    [ 216.474229] ---[ end trace 0000000000000000 ]---

    Can you let us know from your SW colleague why we are getting this warning and how to fix it ?

    When we  give command to Phy 1 up, it is not giving any warning in logs and going perfectly up as mentioned below. 

    root@ltts-imx6solo:~# ip link set dev ethphy1 up
    [ 223.997870] sja1105 spi1.0 ethphy1: configuring for phy/mii link mode
    root@ltts-imx6solo:~# [ 226.081937] sja1105 spi1.0 ethphy1: Link is Up - 100Mbps/Full - flow control off
    [ 226.089444] IPv6: ADDRCONF(NETDEV_CHANGE): ethphy1: link becomes read

    Also can you please review our schematic specially transformer section and let us know if there is any error ? We have added the pullup 50 ohm on TPTDP, TPTDM,TPRDP,TPRDM lines to 3.3V which is not mentioned in schematic . Please check if any other connection is missed.

    Thanks in advance.

    Regards,

    Bitesh

  • Hi Bitesh,

    With holidays coming up, there will not be SW support until beginning of next year at earliest. I would advise checking in with SoC to debug these log-based issues to see if they are better equipped in general to handle this sort of query. 

    Regarding transformer selection, the only support here is comparing the given transformer to the ones in datasheet. Based off of comparison of H1174 vs H1102, the return loss at high frequencies is lower than 1102. However, as datasheet had stated, it is best to validate to see whether or not this discrepancy is critical to operation or not.

    What is U36 and 37? Are these ESD Diodes?

    Center tap of transformer should also be pulled up to VCC.

    Sincerely,

    Gerome