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.

Compiler: Secondary ethernet not working in linux on K2H14

Tool/software: TI C/C++ Compiler

Hi experts.

In our custom board we have a quad 1G ethernet module 88E1548, the first couple work without any problem,
instead the second couple (port 2 and 3) only the autoneg works.
I have configured the PHY that emulating a supported device (88E1545).

I have added the following lines to support my quad device:

...
    {
        .phy_id = MARVELL_PHY_ID_88E1545,
        .phy_id_mask = MARVELL_PHY_ID_MASK,
        .name = "Marvell 88E1545",
        .probe = m88e1510_probe,
        .features = PHY_GBIT_FEATURES,
        .flags = PHY_HAS_INTERRUPT,
        .config_init = &marvell_config_init,
        .config_aneg = &m88e1510_config_aneg,
        .read_status = &marvell_read_status,
        .ack_interrupt = &marvell_ack_interrupt,
        .config_intr = &marvell_config_intr,
        .did_interrupt = &m88e1121_did_interrupt,
        .resume = &genphy_resume,
        .suspend = &genphy_suspend,
        .get_sset_count = marvell_get_sset_count,
        .get_strings = marvell_get_strings,
        .get_stats = marvell_get_stats,
    },
    {
        .phy_id = MARVELL_PHY_ID_88E1548,
        .phy_id_mask = MARVELL_PHY_ID_MASK,
        .name = "Marvell 88E1548",
        .probe = m88e1510_probe,
        .features = PHY_GBIT_FEATURES,
        .flags = PHY_HAS_INTERRUPT,
        .config_init = &marvell_config_init,
        .config_aneg = &m88e1510_config_aneg,
        .read_status = &marvell_read_status,
        .ack_interrupt = &marvell_ack_interrupt,
        .config_intr = &marvell_config_intr,
        .did_interrupt = &m88e1121_did_interrupt,
        .resume = &genphy_resume,
        .suspend = &genphy_suspend,
        .get_sset_count = marvell_get_sset_count,
        .get_strings = marvell_get_strings,
        .get_stats = marvell_get_stats,
    },
    {
        .phy_id = MARVELL_PHY_ID_88E3016,
        .phy_id_mask = MARVELL_PHY_ID_MASK,
        .name = "Marvell 88E3016",
...

static struct mdio_device_id __maybe_unused marvell_tbl[] = {
....
    { MARVELL_PHY_ID_88E1548, MARVELL_PHY_ID_MASK },
....
    { }
};

The environment used is :
   ti-processor-sdk-linux-k2hk-evm-05.02.00.10-Linux-x86-Install.bin


The following section are some part of dts files:

1) keystone-k2hk.dtsi (no changes)

        mdio: mdio@02090300 {
            compatible    = "ti,keystone_mdio", "ti,davinci_mdio";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0x02090300 0x100>;
            status = "ok";
            clocks = <&clkcpgmac>;
            clock-names = "fck";
            bus_freq    = <2500000>; //2.5MHz
        };


2) keystone-k2hk-evm.dts

&mdio {
    status = "ok";
    ethphy0: ethernet-phy@0 {
        compatible = "marvell,88E1548", "ethernet-phy-ieee802.3-c22";
        reg = <0>;
    };
    ethphy1: ethernet-phy@1 {
        compatible = "marvell,88E1548", "ethernet-phy-ieee802.3-c22";
        reg = <1>;
    };

    ethphy2: ethernet-phy@2 {
        compatible = "marvell,88E1548", "ethernet-phy-ieee802.3-c22";
        reg = <2>;
    };
    ethphy3: ethernet-phy@3 {
        compatible = "marvell,88E1548", "ethernet-phy-ieee802.3-c22";
        reg = <3>;
    };
};

3) keystone-k2hk-netcp.dtsi

gbe_serdes: phy@232a000 {
    compatible        = "ti,keystone-serdes-gbe";
    reg            = <0x0232a000 0x2000>;
    status        = "ok";
    link-rate-kbps    = <1250000>;
    num-lanes        = <4>;
    #address-cells    = <1>;
    #size-cells        = <0>;

    clocks =  <&clkcpgmac>;
    clock-names = "fck";

    serdes_lane0: lane@0 {
        #phy-cells    = <0>;
        reg        = <0>;
        status    = "ok";
        control-rate = <2>;
        rx-start    = <7 5>;
        rx-force    = <1 1>;
        tx-coeff    = <0 0 0 12 4>;
    };
    serdes_lane1: lane@1 {
        #phy-cells    = <0>;
        reg        = <1>;
        status    = "ok";
        control-rate = <2>;
        rx-start    = <7 5>;
        rx-force    = <1 1>;
        tx-coeff    = <0 0 0 12 4>;
    };

    serdes_lane2: lane@2 {
        #phy-cells    = <0>;
        reg        = <2>;
        status    = "ok";
        control-rate = <2>;
        rx-start    = <7 5>;
        rx-force    = <1 1>;
        tx-coeff    = <0 0 0 12 4>;
    };
    serdes_lane3: lane@3 {
        #phy-cells    = <0>;
        reg        = <3>;
        status    = "ok";
        control-rate = <2>;
        rx-start    = <7 5>;
        rx-force    = <1 1>;
        tx-coeff    = <0 0 0 12 4>;
    };
};

netcp: netcp@2000000 {
    reg = <0x2620110 0x8>;
    reg-names = "efuse";
    compatible = "ti,netcp-1.0";
    #address-cells = <1>;
    #size-cells = <1>;

    ranges  = <0 0x2000000 0x100000>;

    clocks = <&clkpa>, <&clkcpgmac>, <&chipclk12>;
    clock-names = "pa_clk", "ethss_clk", "cpts";
    dma-coherent;

    ti,navigator-dmas = <&dma_gbe 22>, <&dma_gbe 23>,
                  <&dma_gbe 24>, <&dma_gbe 25>,
                  <&dma_gbe 8>, <&dma_gbe 0>;
    ti,navigator-dma-names = "netrx0", "netrx1",
                     "netrx2", "netrx3",
                     "nettx", "netrx0-pa";

    netcp-devices {
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;

        gbe@90000 {
            #address-cells = <1>;
            #size-cells = <1>;
            label = "netcp-gbe";
            compatible = "ti,netcp-gbe";
            syscon-subsys = <&gbe_subsys>;
            reg = <0x90100 0x200>, <0x90400 0x200>, <0x90800 0x700>;
            tx-queue = <648>;
            tx-channel = "nettx";

            interfaces {
                gbe0: interface-0 {
                    phys           = <&serdes_lane0>;
                    slave-port     = <0>;
                    link-interface = <1>; //SGMII_LINK_MAC_PHY
                    phy-handle     = <&ethphy0>;
                };
                gbe1: interface-1 {
                    phys           = <&serdes_lane1>;
                    slave-port     = <1>;
                    link-interface = <1>; //SGMII_LINK_MAC_PHY
                    phy-handle     = <&ethphy1>;
                };

                gbe2: interface-2 {
                    phys           = <&serdes_lane2>;
                    slave-port     = <2>;
                    link-interface = <1>;//SGMII_LINK_MAC_PHY
                    phy-handle     = <&ethphy2>;
                };
                gbe3: interface-3 {
                    phys           = <&serdes_lane3>;
                    slave-port     = <3>;
                    link-interface = <1>;//SGMII_LINK_MAC_PHY
                    phy-handle     = <&ethphy3>;
                };
            };
        };
    };

    netcp-interfaces {
        interface-0 {
            rx-channel = "netrx0";
            rx-pool = <1024 12>;
            tx-pool = <1024 12>;
            rx-queue-depth = <128 128 0 0>;
            rx-buffer-size = <1518 4096 0 0>;
            rx-queue = <8704>;
            tx-completion-queue = <8708>;
            efuse-mac = <1>;
            netcp-gbe = <&gbe0>;
        };
        interface-1 {
            rx-channel = "netrx1";
            rx-pool = <1024 12>;
            tx-pool = <1024 12>;
            rx-queue-depth = <128 128 0 0>;
            rx-buffer-size = <1518 4096 0 0>;
            rx-queue = <8705>;
            tx-completion-queue = <8709>;
            efuse-mac = <0>;
            local-mac-address = [50 33 8b 6b 79 6f];
            netcp-gbe = <&gbe1>;
        };

        interface-2 {
            rx-channel = "netrx2";
            rx-pool = <1024 12>;
            tx-pool = <1024 12>;
            rx-queue-depth = <128 128 0 0>;
            rx-buffer-size = <1518 4096 0 0>;
            rx-queue = <8706>;
            tx-completion-queue = <8710>;
            efuse-mac = <0>;
            local-mac-address = [50 33 8b 6b 79 6e];
            netcp-gbe = <&gbe3>;
        };
        interface-3 {
            rx-channel = "netrx3";
            rx-pool = <1024 12>;
            tx-pool = <1024 12>;
            rx-queue-depth = <128 128 0 0>;
            rx-buffer-size = <1518 4096 0 0>;
            rx-queue = <8707>;
            tx-completion-queue = <8711>;
            efuse-mac = <0>;
            local-mac-address = [50 33 8b 6b 79 6d];
            netcp-gbe = <&gbe2>;
        };
    };
};

In console after to load linux drivers:

keystone_netcp_ethss    77824  0
cpsw_ale               28672  1 keystone_netcp_ethss
cpts                   20480  1 keystone_netcp_ethss
keystone_netcp         32768  1 keystone_netcp_ethss
knav_dma               20480  1 keystone_netcp
knav_qmss              32768  1 keystone_netcp
phy_keystone_serdes    36864  8
marvell                20480  4
davinci_mdio           16384  0
uio                    20480  1 keystone_remoteproc

Follows the dmesg result:

[cut].....
[    9.913751] mdio_bus 2090300.mdio: GPIO lookup for consumer reset

[    9.913756] mdio_bus 2090300.mdio: using device tree for GPIO lookup
[    9.913763] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/soc/mdio@02090300[0]'
[    9.913769] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/soc/mdio@02090300[0]'
[    9.913773] mdio_bus 2090300.mdio: using lookup tables for GPIO lookup
[    9.913778] mdio_bus 2090300.mdio: lookup for GPIO reset failed
[    9.953032] davinci_mdio 2090300.mdio: davinci mdio revision 1.5, bus freq 2500000
[    9.977082] libphy: 2090300.mdio: probed
[    9.993037] get_phy_device@601: *******Called addr=0*******
[   10.009876] get_phy_id@553: Called
[   10.026355] get_phy_id@558: Continue
[   10.041335] get_phy_id@568: Continue phy_id=1410000
[   10.074446] get_phy_id@580: Leave phy_id=1410ec0
[   10.106561] get_phy_device@611: Request for phy_id=1410EC0
[   10.134037] phy_device_create@385: Search phyId=1410EC0 is_c45=NO
[   10.206838] get_phy_device@601: *******Called addr=1*******
[   10.239690] get_phy_id@553: Called
[   10.265154] get_phy_id@558: Continue
[   10.290924] get_phy_id@568: Continue phy_id=1410000
[   10.325445] get_phy_id@580: Leave phy_id=1410ec0
[   10.351423] get_phy_device@611: Request for phy_id=1410EC0
[   10.383906] phy_device_create@385: Search phyId=1410EC0 is_c45=NO
[   10.419386] get_phy_device@601: *******Called addr=2*******
[   10.446355] get_phy_id@553: Called
[   10.461119] get_phy_id@558: Continue
[   10.478384] get_phy_id@568: Continue phy_id=1410000
[   10.501889] get_phy_id@580: Leave phy_id=1410ec0
[   10.525806] get_phy_device@611: Request for phy_id=1410EC0
[   10.564216] phy_device_create@385: Search phyId=1410EC0 is_c45=NO
[   10.608432] get_phy_device@601: *******Called addr=3*******
[   10.631284] get_phy_id@553: Called
[   10.648386] get_phy_id@558: Continue
[   10.670750] get_phy_id@568: Continue phy_id=1410000
[   10.703073] get_phy_id@580: Leave phy_id=1410ec0
[   10.721395] get_phy_device@611: Request for phy_id=1410EC0
[   10.763033] phy_device_create@385: Search phyId=1410EC0 is_c45=NO
[   10.799053] random: crng init done
[   10.799056] random: 7 urandom warning(s) missed due to ratelimiting
[   10.898048] mdiobus_get_phy@74: Called
[   10.913344] davinci_mdio 2090300.mdio: phy[0]: device 2090300.mdio:00, phy_id=01410EC0 driver Marvell 88E1548
[   10.972412] mdiobus_get_phy@74: Called
[   10.997586] davinci_mdio 2090300.mdio: phy[1]: device 2090300.mdio:01, phy_id=01410EC0 driver Marvell 88E1548
[   11.093544] mdiobus_get_phy@74: Called
[   11.129490] davinci_mdio 2090300.mdio: phy[2]: device 2090300.mdio:02, phy_id=01410EC0 driver Marvell 88E1548
[   11.205291] mdiobus_get_phy@74: Called
[   11.240346] davinci_mdio 2090300.mdio: phy[3]: device 2090300.mdio:03, phy_id=01410EC0 driver Marvell 88E1548
[   11.290275] mdiobus_get_phy@74: Called
[   11.316453] mdiobus_get_phy@74: Called
[   11.337229] mdiobus_get_phy@74: Called
[   11.354489] mdiobus_get_phy@74: Called
[   11.376939] mdiobus_get_phy@74: Called
[   11.391331] mdiobus_get_phy@74: Called
[   11.416374] mdiobus_get_phy@74: Called
[   11.435472] mdiobus_get_phy@74: Called
[   11.450900] mdiobus_get_phy@74: Called
[   11.469175] mdiobus_get_phy@74: Called
[   11.483464] mdiobus_get_phy@74: Called
[   11.500131] mdiobus_get_phy@74: Called
[   11.514251] mdiobus_get_phy@74: Called
[   11.533020] mdiobus_get_phy@74: Called
[   11.544266] mdiobus_get_phy@74: Called
[   11.559565] mdiobus_get_phy@74: Called
[   11.576372] mdiobus_get_phy@74: Called
[   11.593463] mdiobus_get_phy@74: Called
[   11.607991] mdiobus_get_phy@74: Called
[   11.621702] mdiobus_get_phy@74: Called
[   11.635791] mdiobus_get_phy@74: Called
[   11.653022] mdiobus_get_phy@74: Called
[   11.663030] mdiobus_get_phy@74: Called
[   11.676354] mdiobus_get_phy@74: Called
[   11.686365] mdiobus_get_phy@74: Called
[   11.699698] mdiobus_get_phy@74: Called
[   11.709716] mdiobus_get_phy@74: Called
[   11.723052] mdiobus_get_phy@74: Called
[   11.734592] of_get_named_gpiod_flags: parsed 'kick-gpios' property of node '/soc/dsp@11800000[0]' - status (0)
[   11.734633] keystone-rproc 11800000.dsp: assigned reserved memory node dsp-common-memory@81f800000
[   11.759761] remoteproc remoteproc1: 11800000.dsp is available
[   11.779975] davinci-wdt 22f0080.wdt: heartbeat 60 sec
[   11.793305] mdio_bus 2f00500.mdio: GPIO lookup for consumer reset
[   11.793310] mdio_bus 2f00500.mdio: using device tree for GPIO lookup
[   11.793316] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/soc/mdio@02f00500[0]'
[   11.793322] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/soc/mdio@02f00500[0]'
[   11.793326] mdio_bus 2f00500.mdio: using lookup tables for GPIO lookup
[   11.793331] mdio_bus 2f00500.mdio: lookup for GPIO reset failed
[   11.833031] davinci_mdio 2f00500.mdio: davinci mdio revision 1.5, bus freq 2500000
[cut]....
[   12.612155] ti,keystone-serdes 232a000.phy: init fw ks2_gbe_serdes.bin: version 3.3.0.2c

[cut]....
[   12.934285] keystone-navigator-qmss soc:qmss@2a40000: qmgr start queue 0, number of queues 8192
[   12.966530] keystone-navigator-qmss soc:qmss@2a40000: added qmgr start queue 0, num of queues 8192, reg_peek e5c20000, reg_status e57fd000, reg_config e5905000, reg_region 0
[   13.065999] keystone-navigator-qmss soc:qmss@2a40000: qmgr start queue 8192, number of queues 8192
[   13.138605] keystone-navigator-qmss soc:qmss@2a40000: added qmgr start queue 8192, num of queues 8192, reg_peek e60a0000, reg_status e5921400, reg_config e592e000, reg_regi0
[   13.256780] keystone-navigator-qmss soc:qmss@2a40000: firmware file ks2_qmss_pdsp_acc48.bin downloaded for PDSP
[   13.331637] keystone-navigator-dma soc:knav_dmas@0: DMA dma_gbe registered 41 logical channels, flows 32, tx chans: 9, rx chans: 24
[   13.405721] keystone-navigator-dma soc:knav_dmas@0: DMA dma_xgbe registered 48 logical channels, flows 32, tx chans: 16, rx chans: 16
[  445.459735] systemd-journald[66]: Received SIGTERM from PID 1 (systemd).
[  445.466738] systemd[1]: Stopping Journal Service...
[  445.475916] systemd[1]: Stopped Journal Service.
[  445.483802] systemd[1]: Closed Journal Socket.
[  445.557972] systemd[1]: Stopped Create Static Device Nodes in /dev.
[  445.633121] systemd[1]: Stopping Update UTMP about System Boot/Shutdown...
[  445.657928] systemd[1]: Stopped Update UTMP about System Boot/Shutdown.
[  445.691289] systemd[1]: Stopped Daily Cleanup of Temporary Directories.
[  445.872471] ******ss_version: 0x4ed21104
[  445.878171] ******gbe_probe@3687: set_gbe_ethss14_priv Called
[  445.884126] set_gbe_ethss14_priv@3414:****sgmii_port_regs=e5c6e100  sgmii_port34_regs=e5c70400****
[  445.893408] netcp-1.0 2620110.netcp: initialized cpsw ale version 1.3
[  445.899945] netcp-1.0 2620110.netcp: ALE Table size 1024
[  445.905366] netcp-1.0 2620110.netcp: cpts: overflow check period 1050 (jiffies)
[  445.912771] netcp-1.0 2620110.netcp: CPTS: ref_clk_freq:600000000 calc_mult:3579139413 calc_shift:31 error:-1 nsec/sec
[  445.930171] netcp-1.0 2f00000.netcpx: module(netcp-gbe) not used for device
[  445.945133] systemd-udevd[591]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[  445.946210] systemd-udevd[590]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[  445.947362] systemd-udevd[592]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[  445.948375] systemd-udevd[589]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[  446.066072] phy_init_hw@888: Called
[  446.066080] davinci_mdio 2090300.mdio: resetting idled controller
[  446.103536] netcp-1.0 2620110.netcp: module(netcp-xgbe) not used for device
[  446.110847] netcp-1.0 2f00000.netcpx: Can't xlate xgbe of node(xgbe) sm address at 1
[  446.118687] netcp-1.0 2f00000.netcpx: Probe of module(netcp-xgbe) failed with -22
[  446.136689] phy_start@832: Called
[  446.140049] netcp-1.0 2620110.netcp eth3: Link is Down
[  446.665349] phy_init_hw@888: Called
[  446.733351] phy_start@832: Called
[  446.736700] netcp-1.0 2620110.netcp eth0: Link is Down
[  447.252579] phy_init_hw@888: Called
[  447.323351] phy_start@832: Called
[  447.326698] netcp-1.0 2620110.netcp eth2: Link is Down
[  447.843478] phy_init_hw@888: Called
[  447.913351] phy_start@832: Called
[  447.916697] netcp-1.0 2620110.netcp eth1: Link is Down
[  450.270853] Link is Up - 1Gbps/Full - flow control rx/tx
[ 1429.737327] Link is Up - 1Gbps/Full - flow control rx/tx
[ 1434.990654] Link is Up - 1Gbps/Full - flow control rx/tx
[ 1463.763981] Link is Up - 1Gbps/Full - flow control rx/tx

Then I have connected all eth cables and restart network daemon:

root@k2hk-evm:~# /etc/init.d/networking restart
Reconfiguring network interfaces... ifdown: interface eth4 not configured
ifdown: interface eth5 not configured
[ 1476.125200] phy_init_hw@888: Called
[ 1476.193149] phy_start@832: Called
[ 1476.196500] netcp-1.0 2620110.netcp eth0: Link is Down
[ 1476.740146] phy_init_hw@888: Called
[ 1476.809814] phy_start@832: Called
[ 1476.813162] netcp-1.0 2620110.netcp eth1: Link is Down
[ 1477.351821] phy_init_hw@888: Called
[ 1477.419814] phy_start@832: Called
[ 1477.423163] netcp-1.0 2620110.netcp eth2: Link is Down
[ 1477.961121] phy_init_hw@888: Called
[ 1478.029814] phy_start@832: Called
[ 1478.033163] netcp-1.0 2620110.netcp eth3: Link is Down
done.
root@k2hk-evm:~# [ 1479.310649] Link is Up - 1Gbps/Full - flow control rx/tx
[ 1479.923980] Link is Up - 1Gbps/Full - flow control rx/tx
[ 1480.537339] Link is Up - 1Gbps/Full - flow control rx/tx
[ 1483.177314] Link is Up - 1Gbps/Full - flow control rx/tx

All 4 eth ports are aligned. My desktop is configured with a secondary eth connection with 3 alias IP:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.111.150  netmask 255.255.255.0  broadcast 192.168.111.255
        inet6 fe80::6202:92ff:fe29:cb5c  prefixlen 64  scopeid 0x20<link>
        ether 60:02:92:29:cb:5c  txqueuelen 1000  (Ethernet)
        RX packets 189424  bytes 12144431 (12.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 189863  bytes 287428619 (287.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  

eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.112.150  netmask 255.255.255.0  broadcast 192.168.112.255
        ether 60:02:92:29:cb:5c  txqueuelen 1000  (Ethernet)
        device interrupt 19  

eth0:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.113.150  netmask 255.255.255.0  broadcast 192.168.113.255
        ether 60:02:92:29:cb:5c  txqueuelen 1000  (Ethernet)
        device interrupt 19  

eth0:3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.114.150  netmask 255.255.255.0  broadcast 192.168.114.255
        ether 60:02:92:29:cb:5c  txqueuelen 1000  (Ethernet)
        device interrupt 19 

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 6864  bytes 562437 (562.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6864  bytes 562437 (562.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Follows the PC routing table:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.99.1    0.0.0.0         UG        0 0          0 eth1
127.0.0.1       0.0.0.0         255.255.255.255 UH        0 0          0 lo
192.168.99.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1
192.168.111.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.112.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.113.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.114.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0

Then if from custom board I send  a simple ping at my desktop:

root@k2hk-evm:~# ping 192.168.111.150
PING 192.168.111.150 (192.168.111.150): 56 data bytes
64 bytes from 192.168.111.150: seq=0 ttl=64 time=1007.678 ms
64 bytes from 192.168.111.150: seq=1 ttl=64 time=7.625 ms
64 bytes from 192.168.111.150: seq=2 ttl=64 time=0.157 ms
64 bytes from 192.168.111.150: seq=3 ttl=64 time=0.203 ms
64 bytes from 192.168.111.150: seq=4 ttl=64 time=0.155 ms
64 bytes from 192.168.111.150: seq=5 ttl=64 time=0.203 ms
64 bytes from 192.168.111.150: seq=6 ttl=64 time=0.169 ms <<<< here I remove the eth0 cable
[ 1662.936019] netcp-1.0 2620110.netcp eth0: Link is Down
ping: sendto: Network is unreachable

root@k2hk-evm:~# ping 192.168.112.150
PING 192.168.112.150 (192.168.112.150): 56 data bytes
64 bytes from 192.168.112.150: seq=0 ttl=64 time=0.291 ms
64 bytes from 192.168.112.150: seq=1 ttl=64 time=0.176 ms
64 bytes from 192.168.112.150: seq=2 ttl=64 time=0.150 ms
64 bytes from 192.168.112.150: seq=3 ttl=64 time=0.187 ms
64 bytes from 192.168.112.150: seq=4 ttl=64 time=0.205 ms
64 bytes from 192.168.112.150: seq=5 ttl=64 time=0.154 ms <<<< here I remove the eth1 cable
[ 1698.402678] netcp-1.0 2620110.netcp eth1: Link is Down
ping: sendto: Network is unreachable

The ping on the two eth secondary ports not works (using tcpdump on my PC and on target board I
can see arp request and reply packet but in target the reply is not arrived).

root@k2hk-evm:~# ping 192.168.113.150
PING 192.168.113.150 (192.168.113.150): 56 data bytes <<<< after 10 about second I remove the eth2 cable
[ 1742.989336] netcp-1.0 2620110.netcp eth2: Link is Down
ping: sendto: Network is unreachable

root@k2hk-evm:~# ping 192.168.114.150
PING 192.168.114.150 (192.168.114.150): 56 data bytes
[ 1852.429315] netcp-1.0 2620110.netcp eth3: Link is Down <<<< after 10 about second I remove the eth3cable
ping: sendto: Network is unreachable

For boot I have used eth3 port, then it is a configuration error, but I can't see it.

Could you please help us?

Best Regards,
Dario.

  • Hi, Dario,

    If you haven't read the note for KS2 on enabling extra ethernet ports in the NetCP driver, there are info you may find helpful.

    http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/NetCP.html

    Rex

  • Hi Rex,

        I have read (too often) the netcp description document:


    http://software-dl.ti.com/processor-sdk-linux/esd/docs/05_02_00_10/linux/Foundational_Components_Kernel_Drivers.html#netcp


    this link should to be the correct one for my specific linux version environment, but the examples reported here are related at
    K2E and the some part is common for both SOCs seems similat at mine.

    Sometime your description are partially cut, then the modifications/adapting are a bit difficult.

    Eg:

    1) In keysyone-k2hk-netcp.dtsi for k2hk not exists pa sections, nor qos

    2) the rx-queue = <532> (I think it should to be correct for K2E is wrong for K2HK,
    infact in your dtsi we have rx-queue = <8704>;  for interface-0),

    3)  tx-pools in our k2hk is not present as vector in interface-1 K2E :

    +                        tx-pools = <1024 12 17 17
    +                                    64 12 17 17
    +                                    64 12 17 17
    +                                    64 12 17 17
    +                                    64 12 17 17
    +                                    64 12 17 17
    +                                    64 12 17 17>;
    in k2h a single line (I can give you show the variable name has a little differencem in red colour):

    tx-pool = <1024 12>;

    4) after tx-pools I can see a 10G configuration netcpx mixed in 1G configuration.

    Regards,
    Dario

  • Hi Rex,

      I have forgot to give you some informations.

    1) All eth interfaces are statically defined in /etc/network/interfaces:

    root@k2hk-evm:~# cat /etc/network/interfaces | grep -v \# | uniq
     
    auto lo
    iface lo inet loopback
       address 127.0.0.1
       netmask 255.0.0.0

    auto eth0
    iface eth0 inet static
       address 192.168.111.23
       netmask 255.255.255.0

    auto eth1
    iface eth1 inet static
       address 192.168.112.23
       netmask 255.255.255.0

    auto eth2
    iface eth2 inet static
       address 192.168.113.23
       netmask 255.255.255.0

    auto eth3
    iface eth3 inet static
       address 192.168.114.23
       netmask 255.255.255.0

    auto eth4
    iface eth4 inet static
       address 192.168.115.23
       netmask 255.255.255.0

    auto eth5
    iface eth5 inet static
       address 192.168.116.23
       netmask 255.255.255.0

    2) The MACs address are:
    root@k2hk-evm:~# ifconfig
    eth0      Link encap:Ethernet  HWaddr 50:33:8B:6B:79:4A  
              inet addr:192.168.111.23  Bcast:192.168.111.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:399 errors:0 dropped:2 overruns:0 frame:0
              TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:33798 (33.0 KiB)  TX bytes:4648 (4.5 KiB)

    eth1      Link encap:Ethernet  HWaddr 50:33:8B:6B:79:6F  
              inet addr:192.168.112.23  Bcast:192.168.112.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:404 errors:0 dropped:2 overruns:0 frame:0
              TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:35458 (34.6 KiB)  TX bytes:4648 (4.5 KiB)

    eth2      Link encap:Ethernet  HWaddr 50:33:8B:6B:79:6E  
              inet addr:192.168.113.23  Bcast:192.168.113.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:5188 (5.0 KiB)

    eth3      Link encap:Ethernet  HWaddr 50:33:8B:6B:79:6D  
              inet addr:192.168.114.23  Bcast:192.168.114.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:365 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:25708 (25.1 KiB)

    3) The routing table:

    root@k2hk-evm:~# route -ne
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
    192.168.111.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
    192.168.112.0   0.0.0.0         255.255.255.0   U         0 0          0 eth1
    192.168.113.0   0.0.0.0         255.255.255.0   U         0 0          0 eth2
    192.168.114.0   0.0.0.0         255.255.255.0   U         0 0          0 eth3

    root@k2hk-evm:~# arp
    ? (192.168.113.150) at <incomplete>  on eth2
    ? (192.168.114.150) at <incomplete>  on eth3

    On PC I can see the arp request from custom board and the reply, both MACs and IPs are correct:

    root@k2hk-evm:~# ping 192.168.111.150
    PING 192.168.111.150 (192.168.111.150): 56 data bytes
    64 bytes from 192.168.111.150: seq=0 ttl=64 time=0.335 ms
    64 bytes from 192.168.111.150: seq=1 ttl=64 time=0.208 ms
    64 bytes from 192.168.111.150: seq=2 ttl=64 time=0.155 ms
    ^C
    --- 192.168.111.150 ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max = 0.155/0.232/0.335 ms
    root@k2hk-evm:~# arp
    ? (192.168.111.150) at 60:02:92:29:cb:5c [ether]  on eth0
    ? (192.168.113.150) at <incomplete>  on eth2
    ? (192.168.114.150) at <incomplete>  on eth3

    on PC side:

    Address                  HWtype  HWaddress           Flags Mask            Iface
    192.168.113.23           ether   50:33:8b:6b:79:6e   C                     eth0
    192.168.112.23           ether   50:33:8b:6b:79:6f   C                     eth0
    192.168.114.23           ether   50:33:8b:6b:79:6d   C                     eth0
    192.168.111.23           ether   50:33:8b:6b:79:4a   C                     eth0

    Seems that reply message is not received from linux.

    I remember that also uboot 2018 has the same problem for all interfaces and to solve this problem I have used 2019
    version (contents in the next environment version), but I don't know if this is a generic bug of 5.2.0.10 version.

    Regards,
    Dario

  • Hi, Dario,

    The Note in NetCP driver was written based on older ProcSDK and K2E. Your configuration looks good. I don't think I get your (4) about you can see netcpx mixed in 1G configuration. Do you mean in the k2h-netcp.dtsi of 5.2 release or you "can't see" in your k2h-netcp.dtsi?

    The logs you showed, there is a broken insertion. before the ping from EVM. The ping 111 subnet from EVM is good. I thought you have issue with eth2, shouldn't you ping 113 subnet? On PC side, all 4 subnet go to eth0 interface. Shouldn't they have different interfaces?

    Rex 

  • Hi Rex,

        In attach you can see the couple of versions of keystone-k2hk-netcp.dtsi.
    In our custom board configuration I have added the 10G and eth2/eth3 (connected
    at serdes_lane2/serdes_lane3). I have tried to reconfigure in several times
    rx-queue/tx-completion-queue to attempt to solve the problem without any results
    (regarding ARP reply handling).

    During the ping at 111/112 subnets (eth0&eth1 ports) I have give ^C to break the
    ping, in eth2 (113 subnet) and eth3 (114 subnet) not have any ping reply after about
    10 sec I have removed the cable (on wireshark I have seen several ARP request&reply
    about one per second).


    ? (192.168.111.150) at 60:02:92:29:cb:5c [ether]  on eth0
    ? (192.168.113.150) at <incomplete>  on eth2
    ? (192.168.114.150) at <incomplete>  on eth3

    Note the status incomplete on eth2 and eth3 because the port not have received the ARP reply.

    I have also done a hw check to verify some "error", no problem found.

    I don't know what to check to find the problem. Have you any suggestions?

    Regards,
    Dario


  • Hi, Dario,

    Your zip file can't be accessed. Nonetheless, I re-examined yoour configuration in the original post. Do you purposely switch the netcp-gbe handles in interface-2 and interface-3? That should reflect the hardware layout. It that phandle is correct, then I can't understand why it doesn't work. All your configuration seems to be correct.

            interface-2 {
                rx-channel = "netrx2";
                rx-pool = <1024 12>;
                tx-pool = <1024 12>;
                rx-queue-depth = <128 128 0 0>;
                rx-buffer-size = <1518 4096 0 0>;
                rx-queue = <8706>;
                tx-completion-queue = <8710>;
                efuse-mac = <0>;
                local-mac-address = [50 33 8b 6b 79 6e];
                netcp-gbe = <&gbe3>;                              <== gbe3?
            };

    Rex

  • Hi Rex,

          I'm sorry for delay but I am several problems on this project. Anyway, yes that "incorrect value" was an atempt to solve an HW error, we have inverted eth2&3 connectors on PCB, I have tried to correct it, with any success. Now I have mapped one to one the four eth ports.

    For 10G problem we have decided to connect the phy devices on MDIO (1G), I hope to "solve" this other problem.

    For 1G problem I have tried to configure my dhcp server, no solution found.

    Follow the zip content, in green the differences (related eth2&3 and 10G).

    Original keystone-k2hk-netcp.dtsi file:

    qmss: qmss@2a40000 {
            compatible = "ti,keystone-navigator-qmss";
            dma-coherent;
            #address-cells = <1>;
            #size-cells = <1>;
            clocks = <&chipclk13>;
            ranges;
            queue-range     = <0 0x4000>;
            linkram0        = <0x100000 0x8000>;
            linkram1        = <0x0 0x10000>;
            qmgrs {
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges;
                    qmgr0 {
                            managed-queues = <0 0x2000>;
                            reg = <0x2a40000 0x20000>,
                                  <0x2a06000 0x400>,
                                  <0x2a02000 0x1000>,
                                  <0x2a03000 0x1000>,
                                  <0x23a80000 0x20000>,
                                  <0x2a80000 0x20000>;
                            reg-names = "peek", "status", "config",
                                        "region", "push", "pop";
                    };
                    qmgr1 {
                            managed-queues = <0x2000 0x2000>;
                            reg = <0x2a60000 0x20000>,
                                  <0x2a06400 0x400>,
                                  <0x2a04000 0x1000>,
                                  <0x2a05000 0x1000>,
                                  <0x23aa0000 0x20000>,
                                  <0x2aa0000 0x20000>;
                            reg-names = "peek", "status", "config",
                                        "region", "push", "pop";
                    };
            };
            queue-pools {
                    qpend {
                            qpend-0 {
                                    qrange = <658 8>;
                                    interrupts =<0 40 0xf04 0 41 0xf04 0 42 0xf04
                                                 0 43 0xf04 0 44 0xf04 0 45 0xf04
                                                 0 46 0xf04 0 47 0xf04>;
                            };
                            qpend-1 {
                                    qrange = <8704 16>;
                                    interrupts = <0 48 0xf04 0 49 0xf04 0 50 0xf04
                                                  0 51 0xf04 0 52 0xf04 0 53 0xf04
                                                  0 54 0xf04 0 55 0xf04 0 56 0xf04
                                                  0 57 0xf04 0 58 0xf04 0 59 0xf04
                                                  0 60 0xf04 0 61 0xf04 0 62 0xf04
                                                  0 63 0xf04>;
                                    qalloc-by-id;
                            };
                            qpend-2 {
                                    qrange = <8720 16>;
                                    interrupts = <0 64 0xf04 0 65 0xf04 0 66 0xf04
                                                  0 59 0xf04 0 68 0xf04 0 69 0xf04
                                                  0 70 0xf04 0 71 0xf04 0 72 0xf04
                                                  0 73 0xf04 0 74 0xf04 0 75 0xf04
                                                  0 76 0xf04 0 77 0xf04 0 78 0xf04
                                                  0 79 0xf04>;
                            };
                    };
                    general-purpose {
                            gp-0 {
                                    qrange = <4000 64>;
                            };
                            netcp-tx {
                                    qrange = <640 9>;
                                    qalloc-by-id;
                            };
                            netcpx-tx {
                                    qrange = <8752 8>;
                                    qalloc-by-id;
                            };
                    };
                    accumulator {
                            acc-low-0 {
                                    qrange = <480 32>;
                                    accumulator = <0 47 16 2 50>;
                                    interrupts = <0 226 0xf01>;
                                    multi-queue;
                                    qalloc-by-id;
                            };
                    };
            };
            descriptor-regions {
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges;
                    region-12 {
                            id = <12>;
                            region-spec = <8192 128>;       /* num_desc desc_size */
                            link-index = <0x4000>;
                    };
            };
            pdsps {
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges;
                    pdsp0@0x2a10000 {
                            reg = <0x2a10000 0x1000    /*iram */
                                   0x2a0f000 0x100     /*reg*/
                                   0x2a0c000 0x3c8     /*intd */
                                   0x2a20000 0x4000>;  /*cmd*/
                            id = <0>;
                    };
            };
    };
    knav_dmas: knav_dmas@0 {
            compatible = "ti,keystone-navigator-dma";
            clocks = <&papllclk>;
            #address-cells = <1>;
            #size-cells = <1>;
            ranges;
            ti,navigator-cloud-address = <0x23a80000 0x23a90000
                                       0x23aa0000 0x23ab0000>;
            dma_gbe: dma_gbe@0 {
                    reg = <0x2004000 0x100>,
                              <0x2004400 0x120>,
                              <0x2004800 0x300>,
                              <0x2004c00 0x120>,
                              <0x2005000 0x400>;
                    reg-names = "global", "txchan", "rxchan",
                                    "txsched", "rxflow";
                    ti,enable-all;
            };
    };
    gbe_subsys: subsys@2090000 {
            compatible = "syscon";
            reg = <0x02090000 0x100>;
    };
    gbe_serdes: phy@232a000 {
            compatible              = "ti,keystone-serdes-gbe";
            reg                     = <0x0232a000 0x2000>;
            status                  = "disabled";
            link-rate-kbps          = <1250000>;
            num-lanes               = <4>;
            #address-cells  = <1>;
            #size-cells     = <0>;

            serdes_lane0: lane@0 {
                    #phy-cells      = <0>;
                    reg             = <0>;
                    status          = "ok";
                    control-rate    = <2>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <0 0 0 12 4>;
            };
            serdes_lane1: lane@1 {
                    #phy-cells      = <0>;
                    reg             = <1>;
                    status          = "ok";
                    control-rate    = <2>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <0 0 0 12 4>;
            };
            serdes_lane2: lane@2 {
                    #phy-cells      = <0>;
                    reg             = <2>;
                    status          = "disabled";
                    control-rate    = <2>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <0 0 0 12 4>;
            };
            serdes_lane3: lane@3 {
                    #phy-cells      = <0>;
                    reg             = <3>;
                    status          = "disabled";
                    control-rate    = <2>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <0 0 0 12 4>;
            };
    };
    netcp: netcp@2000000 {
            reg = <0x2620110 0x8>;
            reg-names = "efuse";
            compatible = "ti,netcp-1.0";
            #address-cells = <1>;
            #size-cells = <1>;

            /* NetCP address range */
            ranges  = <0 0x2000000 0x100000>;
            clocks = <&clkpa>, <&clkcpgmac>, <&chipclk12>;
            clock-names = "pa_clk", "ethss_clk", "cpts";
            dma-coherent;
            ti,navigator-dmas = <&dma_gbe 22>,
                            <&dma_gbe 23>,
                            <&dma_gbe 8>;
            ti,navigator-dma-names = "netrx0", "netrx1", "nettx";
            netcp-devices {
                    ranges;
                    #address-cells = <1>;
                    #size-cells = <1>;
                    gbe@90000 { /* ETHSS */
                            #address-cells = <1>;
                            #size-cells = <1>;
                            label = "netcp-gbe";
                            compatible = "ti,netcp-gbe";
                            syscon-subsys = <&gbe_subsys>;
                            reg = <0x90100 0x200>, <0x90400 0x200>, <0x90800 0x700>;
                            tx-queue = <648>;
                            tx-channel = "nettx";
                            interfaces {
                                    gbe0: interface-0 {
                                            phys = <&serdes_lane0>;
                                            slave-port = <0>;
                                            link-interface = <1>;
                                            phy-handle = <&ethphy0>;
                                    };
                                    gbe1: interface-1 {
                                            phys = <&serdes_lane1>;
                                            slave-port = <1>;
                                            link-interface = <1>;
                                            phy-handle = <&ethphy1>;
                                    };
                            };
                            secondary-slave-ports {
                                    port-2 {
                                            phys = <&serdes_lane2>;
                                            slave-port = <2>;
                                            link-interface  = <2>;
                                    };
                                    port-3 {
                                            phys = <&serdes_lane3>;
                                            slave-port = <3>;
                                            link-interface  = <2>;
                                    };
                            };
                    };
            };
            netcp-interfaces {
                    interface-0 {
                            rx-channel = "netrx0";
                            rx-pool = <1024 12>;
                            tx-pool = <1024 12>;
                            rx-queue-depth = <128 128 0 0>;
                            rx-buffer-size = <1518 4096 0 0>;
                            rx-queue = <8704>;
                            tx-completion-queue = <8706>;
                            efuse-mac = <1>;
                            netcp-gbe = <&gbe0>;
                    };
                    interface-1 {
                            rx-channel = "netrx1";
                            rx-pool = <1024 12>;
                            tx-pool = <1024 12>;
                            rx-queue-depth = <128 128 0 0>;
                            rx-buffer-size = <1518 4096 0 0>;
                            rx-queue = <8705>;
                            tx-completion-queue = <8707>;
                            efuse-mac = <0>;
                            local-mac-address = [02 18 31 7e 3e 6f];
                            netcp-gbe = <&gbe1>;
                    };
            };
    };

    sa_subsys: subsys@20c0000 {
            compatible = "simple-bus";
            #address-cells = <1>;
            #size-cells = <1>;
            ranges = <0 0x20c0000 0x40000>;
            dma-coherent;
            dma-ranges;
            sa_config: subsys@0 {
                    compatible = "syscon";
                    reg = <0x0 0x100>;
            };
            rng@24000 {
                    compatible = "ti,keystone-rng";
                    reg = <0x24000 0x1000>;
                    ti,syscon-sa-cfg = <&sa_config>;
                    clocks = <&clksa>;
                    clock-names = "fck";
            };
            crypto@0 {
                    compatible = "ti,netcp-sa-crypto";
                    syscon-subsys = <&sa_config>;
                    clocks = <&clksa>;
                    clock-names = "fck";
                    ti,navigator-dmas = <&dma_gbe 26>, <&dma_gbe 6>;
                    ti,navigator-dma-names = "crypto-rx", "crypto-tx";
                    ti,rx-channel = "crypto-rx";
                    ti,rx-queue-depth = <256 64 0 0>;
                    ti,rx-compl-queue = <8712>;
                    ti,rx-pool      = <512 12>;
                    ti,tx-channel = "crypto-tx";
                    ti,tx-queue-depth = <256>;
                    ti,tx-completion-queue = <8713>;
                    ti,tx-pool = <512 12>;
                    ti,tx-submit-queue = <646>;
                    ti,sc-id = <0x7000 0x71ff>;
            };
    };

    Custom keystone-k2hk-netcp.dtsi file:

    qmss: qmss@2a40000 {
            compatible = "ti,keystone-navigator-qmss";
            dma-coherent;
            #address-cells = <1>;
            #size-cells = <1>;
            clocks = <&chipclk13>;
            ranges;
            queue-range     = <0 0x4000>;
            linkram0        = <0x100000 0x8000>;
            linkram1        = <0x0 0x10000>;
            qmgrs {
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges;
                    qmgr0 {
                            managed-queues = <0 0x2000>;
                            reg = <0x2a40000 0x20000>,
                                    <0x2a06000 0x400>,
                                    <0x2a02000 0x1000>,
                                    <0x2a03000 0x1000>,
                                    <0x23a80000 0x20000>,
                                    <0x2a80000 0x20000>;
                            reg-names = "peek", "status", "config",
                                            "region", "push", "pop";
                    };
                    qmgr1 {
                            managed-queues = <0x2000 0x2000>;
                            reg = <0x2a60000 0x20000>,
                                    <0x2a06400 0x400>,
                                    <0x2a04000 0x1000>,
                                    <0x2a05000 0x1000>,
                                    <0x23aa0000 0x20000>,
                                    <0x2aa0000 0x20000>;
                            reg-names = "peek", "status", "config",
                                            "region", "push", "pop";
                    };
            };
            queue-pools {
                    qpend {
                            qpend-0 {
                                    qrange = <658 8>;
                                    interrupts =<0 40 0xf04 0 41 0xf04 0 42 0xf04
                                                     0 43 0xf04 0 44 0xf04 0 45 0xf04
                                                     0 46 0xf04 0 47 0xf04>;
                            };
                            qpend-1 { // 1G netcp RX
                                    qrange = <8704 16>;
                                    interrupts = <0 48 0xf04 0 49 0xf04 0 50 0xf04
                                                      0 51 0xf04 0 52 0xf04 0 53 0xf04
                                                      0 54 0xf04 0 55 0xf04 0 56 0xf04
                                                      0 57 0xf04 0 58 0xf04 0 59 0xf04
                                                      0 60 0xf04 0 61 0xf04 0 62 0xf04
                                                      0 63 0xf04>;
                                    qalloc-by-id;
                            };
                            qpend-2 { // 10G xnetcp RX
                                    qrange = <8720 16>;
                                    interrupts = <0 64 0xf04 0 65 0xf04 0 66 0xf04
                                                      0 59/*67*/ 0xf04 0 68 0xf04 0 69 0xf04
                                                      0 70 0xf04 0 71 0xf04 0 72 0xf04
                                                      0 73 0xf04 0 74 0xf04 0 75 0xf04
                                                      0 76 0xf04 0 77 0xf04 0 78 0xf04
                                                      0 79 0xf04>;
                                    qalloc-by-id;
                            };
                    };
                    general-purpose {
                            gp-0 {
                                    qrange = <4000 64>;
                            };
                            netcp-tx { // 1G TX
                                    qrange = <640 9>;
                                    qalloc-by-id;
                            };
                            netcpx-tx { // 10G TX
                                    qrange = <8752 8>;
                                    qalloc-by-id;
                            };
                    };
                    accumulator {
                            acc-low-0 {
                                    qrange = <480 32>;
                                    accumulator = <0 47 16 2 50>;
                                    interrupts = <0 226 0xf01>;
                                    multi-queue;
                                    qalloc-by-id;
                            };
                    };
            };
            descriptor-regions {
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges;
                    region-12 {
                            id = <12>;
                            region-spec = <16384 128>;      /* num_desc desc_size */
                            link-index = <0x4000>;
                    };
            };
            pdsps {
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges;
                    pdsp0@0x2a10000 {
                            reg = <0x2a10000 0x1000    //iram
                                     0x2a0f000 0x100     //reg
                                     0x2a0c000 0x3c8           //intd
                                     0x2a20000 0x4000>;  //cmd
                            id = <0>;
                    };
            };
    };
    knav_dmas: knav_dmas@0 {
            compatible = "ti,keystone-navigator-dma";
            clocks = <&papllclk>, <&clkxge>;
            #address-cells = <1>;
            #size-cells = <1>;
            ranges;
            ti,navigator-cloud-address = <0x23a80000 0x23a90000
                                                    0x23aa0000 0x23ab0000>;
            dma_gbe: dma_gbe@0 {
                    reg = <0x2004000 0x100>,
                            <0x2004400 0x120>,
                            <0x2004800 0x300>,
                            <0x2004c00 0x120>,
                            <0x2005000 0x400>;
                    reg-names = "global", "txchan", "rxchan",
                                    "txsched", "rxflow";
                    ti,enable-all;
            };
            dma_xgbe: dma_xgbe@0 {
                    reg = <0x2fa1000 0x100>,
                            <0x2fa1400 0x200>,
                            <0x2fa1800 0x200>,
                            <0x2fa1c00 0x200>,
                            <0x2fa2000 0x400>;
                    reg-names = "global", "txchan", "rxchan",
                                    "txsched", "rxflow";
                    ti,enable-all;
            };
    };
    gbe_subsys: subsys@2090000 {
            compatible = "syscon";
            reg = <0x02090000 0x100>;
    };
    xgbe_subsys: subsys@2f00000 {
            status = "ok";
            compatible = "syscon";
            reg = <0x02f00000 0x100>;
    };
    xgbe_pcsr: pcsr@2f00600 {
            status  = "ok";
            compatible      = "syscon";
            reg             = <0x02f00600 0x100>;
    };
    gbe_serdes: phy@232a000 {
            compatible              = "ti,keystone-serdes-gbe";
            reg                     = <0x0232a000 0x2000>;
            status          = "ok";
            link-rate-kbps  = <1250000>;
            num-lanes               = <4>;
            #address-cells  = <1>;
            #size-cells             = <0>;
            clocks =  <&clkcpgmac>;
            clock-names = "fck";
            serdes_lane0: lane@0 {
                    #phy-cells      = <0>;
                    reg             = <0>;
                    status  = "ok";
                    control-rate = <2>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <0 0 0 12 4>;
            };
            serdes_lane1: lane@1 {
                    #phy-cells      = <0>;
                    reg             = <1>;
                    status  = "ok";
                    control-rate = <2>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <0 0 0 12 4>;
            };
            serdes_lane2: lane@2 {
                    #phy-cells      = <0>;
                    reg             = <2>;
                    status  = "ok";
                    control-rate = <2>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <0 0 0 12 4>;
            };
            serdes_lane3: lane@3 {
                    #phy-cells      = <0>;
                    reg             = <3>;
                    status  = "ok";
                    control-rate = <2>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <0 0 0 12 4>;
            };
    };
    netcp: netcp@2000000 {
            reg = <0x2620110 0x8>;
            reg-names = "efuse";
            compatible = "ti,netcp-1.0";
            #address-cells = <1>;
            #size-cells = <1>;
            ranges  = <0 0x2000000 0x100000>;
            clocks = <&clkpa>, <&clkcpgmac>, <&chipclk12>;
            clock-names = "pa_clk", "ethss_clk", "cpts";
            dma-coherent;
            ti,navigator-dmas = <&dma_gbe 22>, <&dma_gbe 23>,
                                      <&dma_gbe 24>, <&dma_gbe 25>,
                                      <&dma_gbe 8>, <&dma_gbe 0>;
            ti,navigator-dma-names = "netrx0", "netrx1",
                                             "netrx2", "netrx3",
                                             "nettx", "netrx0-pa";
            netcp-devices {
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges;
                    gbe@90000 {
                            #address-cells = <1>;
                            #size-cells = <1>;
                            label = "netcp-gbe";
                            compatible = "ti,netcp-gbe";
                            syscon-subsys = <&gbe_subsys>;
                            reg = <0x90100 0x200>, <0x90400 0x200>, <0x90800 0x700>;
                            tx-queue = <648>;
                            tx-channel = "nettx";
                            interfaces {
                                    gbe0: interface-0 {
                                            phys           = <&serdes_lane0>;
                                            slave-port     = <0>;
                                            link-interface = <1>;
                                            phy-handle     = <&ethphy0>;
                                    };
                                    gbe1: interface-1 {
                                            phys           = <&serdes_lane1>;
                                            slave-port     = <1>;
                                            link-interface = <1>;
                                            phy-handle     = <&ethphy1>;
                                    };
                                    gbe2: interface-2 {
                                            phys           = <&serdes_lane2>;
                                            slave-port     = <2>;
                                            link-interface = <1>;
                                            phy-handle     = <&ethphy2>;
                                    };
                                    gbe3: interface-3 {
                                            phys           = <&serdes_lane3>;
                                            slave-port     = <3>;
                                            link-interface = <1>;
                                            phy-handle     = <&ethphy3>;
                                    };
                            };
                    };
            };
            netcp-interfaces {
                    interface-0 {
                            rx-channel = "netrx0";
                            rx-pool = <1024 12>;
                            tx-pool = <1024 12>;
                            rx-queue-depth = <128 128 0 0>;
                            rx-buffer-size = <1518 4096 0 0>;
                            rx-queue = <8704>;
                            tx-completion-queue = <8708>;
                            efuse-mac = <1>;
                            netcp-gbe = <&gbe0>;
                    };
                    interface-1 {
                            rx-channel = "netrx1";
                            rx-pool = <1024 12>;
                            tx-pool = <1024 12>;
                            rx-queue-depth = <128 128 0 0>;
                            rx-buffer-size = <1518 4096 0 0>;
                            rx-queue = <8705>;
                            tx-completion-queue = <8709>;
                            efuse-mac = <0>;
                            local-mac-address = [50 33 8b 6b 79 6f];
                            netcp-gbe = <&gbe1>;
                    };
                    interface-2 {
                            rx-channel = "netrx3";
                            rx-pool = <1024 12>;
                            tx-pool = <1024 12>;
                            rx-queue-depth = <128 128 0 0>;
                            rx-buffer-size = <1518 4096 0 0>;
                            rx-queue = <8707>;
                            tx-completion-queue = <8711>;
                            efuse-mac = <0>;
                            local-mac-address = [50 33 8b 6b 79 6e];
                            netcp-gbe = <&gbe3>;
                    };
                    interface-3 {
                            rx-channel = "netrx2";
                            rx-pool = <1024 12>;
                            tx-pool = <1024 12>;
                            rx-queue-depth = <128 128 0 0>;
                            rx-buffer-size = <1518 4096 0 0>;
                            rx-queue = <8706>;
                            tx-completion-queue = <8710>;
                            efuse-mac = <0>;
                            local-mac-address = [50 33 8b 6b 79 6d];
                            netcp-gbe = <&gbe2>;
                    };
            };
    };
    /*
    sa_subsys: subsys@20c0000 {
            compatible = "simple-bus";
            #address-cells = <1>;
            #size-cells = <1>;
            ranges = <0 0x20c0000 0x40000>;
            dma-coherent;
            dma-ranges;
    status = "disabled";
            sa_config: subsys@0 {
                    compatible = "syscon";
                    reg = <0x0 0x100>;
            };
            rng@24000 {
                    compatible = "ti,keystone-rng";
                    reg = <0x24000 0x1000>;
                    ti,syscon-sa-cfg = <&sa_config>;
                    clocks = <&clksa>;
                    clock-names = "fck";
            };
            crypto@0 {
                    compatible = "ti,netcp-sa-crypto";
                    syscon-subsys = <&sa_config>;
                    clocks = <&clksa>;
                    clock-names = "fck";
                    ti,navigator-dmas = <&dma_gbe 26>, <&dma_gbe 6>;
                    ti,navigator-dma-names = "crypto-rx", "crypto-tx";
                    ti,rx-channel = "crypto-rx";
                    ti,rx-queue-depth = <256 64 0 0>;
                    ti,rx-compl-queue = <8712>;
                    ti,rx-pool      = <512 12>;
                    ti,tx-channel = "crypto-tx";
                    ti,tx-queue-depth = <256>;
                    ti,tx-completion-queue = <8713>;
                    ti,tx-pool = <512 12>;
                    ti,tx-submit-queue = <646>;
                    ti,sc-id = <0x7000 0x71ff>;
            };
    };
    */
    xgbe_serdes: phy@231e000 {
            status          = "okay";
            compatible              = "ti,keystone-serdes-xgbe";
            reg                     = <0x0231e000 0x2000>;
            link-rate-kbps  = <10312500>;
            num-lanes               = <2>;
            syscon-peripheral       = <&xgbe_subsys>;
            syscon-link             = <&xgbe_pcsr>;
            #address-cells  = <1>;
            #size-cells             = <0>;
            clocks = <&clkxge>;
            clock-names = "fck";
            xserdes_lane0: lane@0 {
                    status  = "okay";
                    #phy-cells      = <0>;
                    reg             = <0>;
                    control-rate = <0>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <2 0 0 12 4>;/* c1 c2 cm att vreg*/
            };
            xserdes_lane1: lane@1 {
                    status  = "okay";
                    #phy-cells      = <0>;
                    reg             = <1>;
                    control-rate = <0>;
                    rx-start        = <7 5>;
                    rx-force        = <1 1>;
                    tx-coeff        = <2 0 0 12 4>;/* c1 c2 cm att vreg */
            };
    };
    netcpx: netcpx@2f00000 {
            status  = "okay";
            compatible      = "ti,netcp-1.0";
            #address-cells  = <1>;
            #size-cells             = <1>;
            reg = <0x02f00000 0xFFFFF>;
            clocks  = <&clkxge>,  <&chipclk12>;
            clock-names     = "clk_xge", "cpts";
            dma-coherent;
            ti,navigator-dmas = <&dma_xgbe 0>, <&dma_xgbe 8>, <&dma_xgbe 0>;
            ti,navigator-dma-names = "xnetrx0", "xnetrx1", "xnettx";
            netcp-devices {
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges;
                    xgbe@2f00000 {
                            label = "netcp-xgbe";
                            compatible = "ti,netcp-xgbe";
                            syscon-subsys = <&xgbe_subsys>;
                            syscon-pcsr = <&xgbe_pcsr>;
                           reg = <0x02f00100 0x200>, <0x02f01000 0xFEFFF>;
                            tx-queue = <8752>;
                            tx-channel = "xnettx";
                            status = "okay";
                            cpts {
                                    status = "ok";
                                    rftclk_sel = <0x0>;
                                    ts_comp_length = <0x3>;
                                    ts_comp_polarity = <0x1>;
                            };
                            interfaces {
                                    status = "okay";
                                    xgbe0: interface-0 {
                                            phys = <&xserdes_lane0>;
                                            status ="okay";
                                            slave-port = <0>;
                                            link-interface  = <10>; /* XGMII_LINK_MAC_PHY*/
                                            phy-handle = <&xethphy0>;
                                    };
                                    xgbe1: interface-1 {
                                            phys = <&xserdes_lane1>;
                                            status = "okay";
                                            slave-port = <1>;
                                            link-interface  = <10>; /* XGMII_LINK_MAC_PHY*/
                                            phy-handle = <&xethphy1>;
                                    };
                            };
                    };
            };
            netcp-interfaces {
                    interface-0 {
                            rx-channel = "xnetrx0";
                            rx-pool = <2048 12>;
                            tx-pool = <1024 12>;
                            rx-queue-depth = <1024 1024 0 0>;
                            rx-buffer-size = <1536 4096 0 0>;
                            rx-queue = <8720>;
                            tx-completion-queue = <8722>;
                            efuse-mac = <0>;
                            local-mac-address = [02 18 31 7e 3e 50];
                            netcp-xgbe = <&xgbe0>;
                    };
                    interface-1 {
                            rx-channel = "xnetrx1";
                            rx-pool = <2048 12>;
                            tx-pool = <1024 12>;
                            rx-queue-depth = <1024 1024 0 0>;
                            rx-buffer-size = <1536 4096 0 0>;
                            rx-queue = <8721>;
                            tx-completion-queue = <8723>;
                            efuse-mac = <0>;
                            local-mac-address = [02 18 31 7e 3e 51];
                            netcp-xgbe = <&xgbe1>;
                    };
            };
    };

    Regards,

    Dario

  • Hi, Dario,

    There are a few places your gbe configuration aren't the same as TI's. I don't think you can change the order of nettx in navigator-dmas. Also, you have interface flip back but the rx-queue isn't. 

    For XGbE, the last working version is PLSDK 3.3 and has dropped XGbE support afterward. Besides, TI used retimer, not phy. We don't have experience with PHY and don't know what are involved using PHY for XGbE. 

    Rex

  • Hi Rex,

       I have found the real PROBLEM in uboot (almost), on linux I can check again, it was a code's problem. As I have supposed (some time ago) the DMA is not enabled on forth ethernet port.

    The file impatted is keystone_net.c, the easy solution follow:

    static int ks2_eth_parse_slave_interface(int netcp, int slave,
                         struct ks2_eth_priv *priv,
                         struct eth_pdata *pdata)
    {
        const void *fdt = gd->fdt_blob;
        int mdio;
        int phy;
        int dma_count;
        u32 dma_channel[8];
        const char *phy_mode;

        priv->slave_port = fdtdec_get_int(fdt, slave, "slave-port", -1);
        priv->net_rx_buffs.rx_flow = priv->slave_port * 8;

        /* U-Boot slave port number starts with 1 instead of 0 */
    //  priv->slave_port += 1; // <<<<<<<<<<<< this incremet is done too early

        dma_count = fdtdec_get_int_array_count(fdt, netcp,
                               "ti,navigator-dmas",
                               dma_channel, 8);

        if (dma_count > (2 * priv->slave_port)) {
            int dma_idx;

    //      dma_idx = priv->slave_port * 2 - 1; // <<<<<<<<<<<< replaced line wit follows
            dma_idx = priv->slave_port * 2 + 1;
            priv->net_rx_buffs.rx_flow = dma_channel[dma_idx];
        }

        priv->slave_port += 1;   // <<<<< moved here
    .....

    I hope this suggestion could to be used from other users.

    Regards,
    Dario

  • Hi, Dario,

    Thanks for finding the issue in the code. I'll feed it back to our development team. I'll consider your issue is resolved. Please submit new threads you have other issues.

    Rex

  • Hi, Dario,

    I took a look further on your suggested changes. TI U-boot doesn't expect the secondary ports enabled when u-boot comes up, and there isn't use case for the secondary ethernet ports at boot time. In linux, it seems to me that the dma should be configured in dts as you did. That's a bit odd to me.

    Rex