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.

TDA4VM: CPSW9 IOCTL Failed to lookup for event: -14

Part Number: TDA4VM

Hello,

We are experiencing some difficulties with the setup for CPSW9 Ethernet switch.

When using a static IP address we get the following IOCTL error messages from the MCU2_0:

This is our log with everything related to CPSW9:

[MCU2_0]     71.282897 s: ETHFW: Init ... !!!
[MCU2_0]     71.315488 s: CPSW_9G Test on MAIN NAVSS
[MCU2_0]     71.336677 s: EnetPhy_bindDriver: PHY 0: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK
[MCU2_0]     71.336752 s: PHY 0 is alive
[MCU2_0]     71.338479 s: ETHFW: Version   : 0.01.01
[MCU2_0]     71.338533 s: ETHFW: Build Date: Oct 29, 2021
[MCU2_0]     71.338561 s: ETHFW: Build Time: 14:37:24
[MCU2_0]     71.338586 s: ETHFW: Commit SHA: 6838be63
[MCU2_0]     71.338612 s: ETHFW: Init ... DONE !!!
[MCU2_0]     71.338638 s: ETHFW: Remove server Init ... !!!
[MCU2_0]     71.339864 s: Remote demo device (core : mcu2_0) .....
[MCU2_0]     71.339925 s: ETHFW: Remove server Init ... DONE !!!
[MCU2_0]     71.364492 s: Host MAC address: 70:ff:76:1d:92:c2
[MCU2_0]     71.365154 s: [NIMU_NDK] ENET has been started successfully
[MCU2_0]     71.365678 s:
[MCU2_0] CPSW NIMU application, IP address I/F 1: 192.168.1.10
[MCU2_0]     71.391916 s: EthFw: TimeSync PTP enabled
[MCU2_0]     72.851084 s: Function:CpswProxyServer_attachExtHandlerCb,HostId:0,CpswType:6

root@j7-evm:/opt/vision_apps# ifconfig eth1 up
[  129.147248] j721e-cpsw-virt-mac main_r5fss_cpsw9g_virt_mac0: virt_cpsw_nuss mac started
[MCU2_0]    167.496002 s: Function:CpswProxyServer_registerMacHandlerCb,HostId:0,Handle:a21d09fc,CoreKey:38acb7e6, MacAddress:70:ff:76:1d:92:c2, FlowIdx:172, FlowIdxOffset:0
[MCU2_0]    167.496192 s: Cpsw_ioctlInternal: CPSW: Registered MAC address.ALE entry:10, Policer Entry:2
root@j7-evm:/opt/vision_apps# ifconfig eth1 192.168.1.9 up
[MCU2_0]    177.624739 s: Function:CpswProxyServer_registerIpv4MacHandlerCb,HostId:0,Handle:a21d09fc,CoreKey:38acb7e6, MacAddress:70:ff:76:1d:92:c2 IPv4Addr:192.168.1.9
[MCU2_0]    177.624999 s:
[MCU2_0] ================LLI Table entries===========
[MCU2_0]    177.625044 s:
[MCU2_0] Number of Static ARP Entries: 1
[MCU2_0]    177.625068 s:
[MCU2_0] SNo.      IP Address         MAC Address
[MCU2_0]    177.625094 s: ------    -------------      ---------------
[MCU2_0]    177.625127 s: 1
[MCU2_0]    177.625141 s:         192.168.1.9
[MCU2_0]    177.625181 s:   70:FF:76:1D:92:C2
[MCU2_0]    177.625208 s:

root@j7-evm:/opt/vision_apps# [MCU2_0]    200.759673 s: Cpsw_handleLinkUp: Port 6: Link up: 100-Mbps Full-Duplex

[MCU2_0]    208.857530 s: CpswCpts_ioctl: Failed to lookup for event: -14
[MCU2_0]    208.857589 s: EnetMod_ioctl: cpsw9g.cpts: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    208.857632 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    208.857669 s: Enet_ioctl: cpsw9g: IOCTL 0x0101030c failed: -14
[MCU2_0]    209.067514 s: CpswCpts_ioctl: Failed to lookup for event: -14
[MCU2_0]    209.067572 s: EnetMod_ioctl: cpsw9g.cpts: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    209.067616 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    209.067654 s: Enet_ioctl: cpsw9g: IOCTL 0x0101030c failed: -14
[MCU2_0]    209.277521 s: CpswCpts_ioctl: Failed to lookup for event: -14
[MCU2_0]    209.277578 s: EnetMod_ioctl: cpsw9g.cpts: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    209.277622 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    209.277659 s: Enet_ioctl: cpsw9g: IOCTL 0x0101030c failed: -14

root@j7-evm:/opt/vision_apps# [MCU2_0]    217.487514 s: CpswCpts_ioctl: Failed to lookup for event: -14
[MCU2_0]    217.487574 s: EnetMod_ioctl: cpsw9g.cpts: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    217.487618 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    217.487655 s: Enet_ioctl: cpsw9g: IOCTL 0x0101030c failed: -14
[MCU2_0]    217.697497 s: CpswCpts_ioctl: Failed to lookup for event: -14
[MCU2_0]    217.697555 s: EnetMod_ioctl: cpsw9g.cpts: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    217.697600 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    217.697637 s: Enet_ioctl: cpsw9g: IOCTL 0x0101030c failed: -14
[MCU2_0]    217.907505 s: CpswCpts_ioctl: Failed to lookup for event: -14
[MCU2_0]    217.907563 s: EnetMod_ioctl: cpsw9g.cpts: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    217.907609 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x0101030c: -14
[MCU2_0]    217.907648 s: Enet_ioctl: cpsw9g: IOCTL 0x0101030c failed: -14
 

It seems to me that everything is configured as expected but from comparing with Logs from this post: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1034435/dra821u-ethernet-firmware-app_remoteswitchcfg_server-log-uart-port

we are missing this callback function regarding IOCTL handler: Function:CpswProxyServer_ioctlHandlerCb

We have a custom board based on TDA4 and our ETH phy "DP83867" is connected with RGMII6. In order for this to work we needed to modify your ENET code.

These are the changes we made for our PHY connection:

1. enet_board_pinmux_j721_data.c

We add pinmux for RGMII6 and MDIO.

2. enet_appboardutils_j721e_evm.c

Modified phyAddr for Port6 = 

case ENET_MAC_PORT_6:
             /* RGMII port */
-            phyAddr = 41U;
+           phyAddr = 0U;
             break;

Removed all unnecessary calls in EnetBoard_init for GESI and expansion board that you have for EVM. 

3. enet_board_j7xevm.c

Changed this variable: static const EnetBoard_PortCfg gEnetCpbBoard_j7xEthPort[] =

Removed RGMII5, added RGMII6:

- {     /* "RGMII_5" */
-      .enetType = ENET_CPSW_9G,
-      .instId = 0U,
-      .macPort = ENET_MAC_PORT_5,
-      .mii = { ENET_MAC_LAYER_GMII, ENET_MAC_SUBLAYER_REDUCED },
-      .phyCfg =
-      {
-          .phyAddr = 40U,
-          .isStrapped = false,
-          .skipExtendedCfg = false,
-          .extendedCfg = &gEnetGesiBoard_dp83867PhyCfg,
-          .extendedCfgSize = sizeof(gEnetGesiBoard_dp83867PhyCfg),
-      },
-     .flags = 0,
- },

+ {    /* "RGMII_6" */
+     .enetType = ENET_CPSW_9G,
+     .instId = 0U,
+     .macPort = ENET_MAC_PORT_6,
+     .mii = { ENET_MAC_LAYER_GMII, ENET_MAC_SUBLAYER_REDUCED },
+     .phyCfg =
+     {
+         .phyAddr = 0U,
+         .isStrapped = false,
+         .skipExtendedCfg = false,
+         .extendedCfg = &gEnetCpbBoard_dp83867PhyCfg,
+         .extendedCfgSize = sizeof(gEnetCpbBoard_dp83867PhyCfg),
+     },
+.    flags = 0,
+ },

4. app_ethfw.c (vision_apps/utils/ethfw/src)

static EthFw_Port gEthAppPorts[] =
{
    {
        .portNum = ENET_MAC_PORT_6,
        .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U },
    },

};

Are we missing some changes in the ENET driver for our usecase and that's why we don't get Function:CpswProxyServer_ioctlHandlerCb?

Best regards,

Ogi

  • Hi,

    You did everything right and, from your log, the EthFW and virtual client has both started correctly.

    The error messages you are getting is from PTP stack on MCU2_0.

    Timesync PTP stack is trying to use MAC PORT 3 by default but it is not enabled on your board.

    You can just disable PTP in app_ethfw.c. Please comment out the function EthFw_initTimeSyncPtp() call.

    Regards,
    Stanley

  • Hi Stanley,

    Thank you very much for the answer.

    This solved the issue with the IOCTL errors.

    Best regards,

    Ogi