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.

Linux/AM5728: DP83822HF FX Mode problem.

Part Number: AM5728
Other Parts Discussed in Thread: DP83822HF, DP83849IF,

Tool/software: Linux

Hi.

I'm using AM572x custom board

and, DP 83822HF is connected to RPU2 ETH0/ETH1

 

DP83822HF Phy chip is used in two Fx modes.
But there is a problem.

The problem is that two ports can not communicate at the same time.

1. B port is not used when A port is used, and there is no reverse case.
2. If you disconnect the A port and connect to the B port, communication can not be performed.

this is phy chip regster log

==== DP83822HF_config_intr 246===
BMCR(0x0): 0x2100
BMSR(0x1): 0x784d
BMSR(0x1): 0x784d
PHYIDR1(0x2): 0x2000
PHYIDR2(0x3): 0xa240
CR1(0x9): 0x0
CR2(0xa): 0x4100
FLDSTS(0xF): 0x0
PHYSTS(0x10): 0x205
PHYSCR(0x11): 0x109
RCSR(0x17): 0x41
LEDCR(0x18): 0x400
PHYCR(0x19): 0x21
GENCFG(0x465): 0xff00
=================

this is schematic

Best Regards,

John Kim

  • I found a new thing.
    In FX-mode, Flow control is off as shown below.
    "Eth 2: Link is Up - 100 Mbps / Full - flow control off"
    "Eth 3: Link is Up - 100 Mbps / Full - flow control off"

    However, in TX-mode, Flow control is On as shown below.
    "Eth 2: Link is Up - 100 Mbps / Full - flow control rx / tx"
    "Eth 3: Link is Up - 100 Mbps / Full - flow control rx / tx"

    So I used "ethtool" to forcibly turn on flow control,
    However, when setting it using "ethtool", an error occurs as follows.
    "# Ethtool-A eth3 rx on tx on
    Can not get device pause settings: Operation not supported "

    Why is Flow control off in FX-mode? "
    Is there a way to turn Flow control on in FX-mode?

    Best Regards,
    John Kim
  • Hi,

    We're looking into this. Feedback will be posted here.

    Best Regards,
    Yordan
  • Hi, Yordan.

    We found the same problem in other Phy chip DP83849IF used in FX Mode.

    Best Regards,
    John Kim
  • Hi,

    Sorry for the late reply.

    Are you enabling both eth ports first, as described here:
    processors.wiki.ti.com/.../PRU-ICSS_Ethernet

    Can you share your dts?

    Best Regards,
    Yordan
  • Hi, Yordan


    I am using the default DTS settings of the AM5728.
    The DP83822HF is defined and in use in the DP83848.c file.


    I tryed dual mac bonding connection.
    the problem was not solved.

    # Ethernet Binding
    ifconfig eth2 down;
    ifconfig eth3 down;
    echo 1 > /sys/class/net/bond0/bonding/mode;
    echo 100 > /sys/class/net/bond0/bonding/miimon;
    ifconfig bond0 192.168.0.100 netmask 255.255.254.0 up;
    echo +eth2 > /sys/class/net/bond0/bonding/slaves;
    echo +eth3 > /sys/class/net/bond0/bonding/slaves;

    Best Regards,
    John Kim
  • I was posting the same issue on the Ethernet Forum, but the problem was not resolved.

    I was informed by the forum to contact the Linux Driver team.

    e2e.ti.com/.../617314

    Best Regards,
    John Kim
  • Hi,

    I have found the cause of the link up / drop problem.



    In the case of FX mode with "phy_state_machine" function of phy.c code
    Problem that does not read Phy chip state by "phy_interrupt_is_valid" function
    visited.

    In this code, "phy_interrupt_is_valid" function If you delete the part to check,
    It will judge Link Up / Drop well.

    in phy.c

    -------------------------------------------------------------------------------------------------------------------------------------

    case PHY_NOLINK:
    //if (phy_interrupt_is_valid(phydev))
    // break;

    err = phy_read_status(phydev);
    if (err)
    break;

    if (phydev->link) {
    if (AUTONEG_ENABLE == phydev->autoneg) {
    err = phy_aneg_done(phydev);
    if (err < 0)
    break;

    if (!err) {
    phydev->state = PHY_AN;
    phydev->link_timeout = PHY_AN_TIMEOUT;
    break;
    }
    }
    phydev->state = PHY_RUNNING;
    netif_carrier_on(phydev->attached_dev);
    phydev->adjust_link(phydev->attached_dev);
    }
    break;

    ..

    ..

    ..

    case PHY_RUNNING:
    /* Only register a CHANGE if we are polling or ignoring
    * interrupts and link changed since latest checking.
    */
    //if (!phy_interrupt_is_valid(phydev)) {
    old_link = phydev->link;
    err = phy_read_status(phydev);
    if (err)
    break;

    if (old_link != phydev->link)
    phydev->state = PHY_CHANGELINK;
    //}
    break;

    -------------------------------------------------------------------------------------------------------------------------------------

    I suspect DP83822HF related driver code problem.

    Best Regards,
    John Kim

  • Hi,

    Thanks for sharing your solution.

    Best Regards,
    Yordan