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: two pcs tda4 communicate with sgmii (mac to mac)

Part Number: TDA4VM

hi

Ask for help

we use tda4 make a custom board ,the board have two pcs tda4 ,then i debug driver have trouble。

the sdk  is rtos + qnx   0703

1.my custom board only have two uart 1.A72 UART0(AB2 AB3) 2.MCU UART0(G29 H28),how can i changed the mcu2-0 debug uart to G29 H28

2.i reference resources https://e2e.ti.com/support/processors/f/processors-forum/936840/faq-dra829vxevm-is-it-possible-to-connect-two-dra829-evms-via-sgmii to debug the driver

bug it's does not have any log when i run /ti_fs/vision_app/vision_app_init.sh only print 5.184868 s: CPSW_9G Test on MAIN NAVSS   ,,,,No other information



  • Hi,

    Regarding (1), can a separate thread please be created for this topic. 

    Regarding (2), could you please provide the full boot log, and commands being run.   

    Thanks,

    kb

  • hi KB

    thanks for your  replay

    i change configuration parameters exactly the same as the example provided by ti “MAC_MAC_SGMII_1G_Linux.zip 

    beause of the sdk7.0 and sdk 7.3 have some different i make some change

    1.CPSW_MAC_PORT_2 TO ENET_MAC_PORT_3

    2.disable the define in the file enet_appboardutils_j721e_evm.c  #if !defined(ENETAPPUTILS_BYPASS_QSMII)&&defined(BUILD_MCU2_0)

    and then the MCU2_0 for ethfw log message is

    [MCU2_0]      4.941821 s: ETHFW: Init ... !!!
    [MCU2_0]      5.065536 s: CPSW_9G Test on MAIN NAVSS test
    [MCU2_0]      5.065596 s: #init osalcfg done
    [MCU2_0]      5.070520 s: #enet init done
    [MCU2_0]      5.077150 s: #enet open done
    [MCU2_0]      5.077205 s: #Semaphore init done
    [MCU2_0]      5.077432 s: #enet enable Port begin done
    [MCU2_0]      5.077490 s: Enet  port link cfg 0
    [MCU2_0]      5.077523 s: Enet ioctl open port link begin done
    [MCU2_0]      5.077636 s: Enet ioctl open port link finish done
    [MCU2_0]      5.077680 s: Enet  port link cfg 2
    [MCU2_0]      5.077707 s: Enet ioctl open port link begin done
    [MCU2_0]      5.077787 s: Enet ioctl open port link finish done
    [MCU2_0]      5.228854 s: Enet  port link cfg 3
    [MCU2_0]      5.228903 s: Enet ioctl open port link begin done
    [MCU2_1]      4.536774 s: CIO: Init ... Done !!!
    [MCU2_1]      4.536843 s: ### CPU Frequency <ORG = 1000000000 Hz>, <NEW = 1000000000 Hz>
    [MCU2_1]      4.536884 s: APP: Init ... !!!
    [MCU2_1]      4.536903 s: SCICLIENT: Init ... !!!

    before i add the print debug message the log for mcu2_0 is  over at CPSW_9G Test on MAIN NAVSS test

    and then i add some debug message i found that the program is running to function EnetMcm_enablePorts();

    stop at Enet_ioctl  which  ENET_MAC_PORT set up to sgmii mode。

    it is have the same log in EVM BOARD

    What should i do next step

    Thanks

     

  • Thanks Hongrun,

    To my knowledge this setup has not been tested on PSDK 7.3 QNX.   I will check with team for next steps.

    Please help me understand the request. 

    • Is this request only to get a debug interface running while UART is under debug?  Or is this request a feature that is required for production

    There is a related thread here, with some possible debug steps to look at.

    Regards,

    kb

  • hi kb

    thanks for your replay

    the log message was add by myself .the custom board's log message end at the line CPSW_9G Test on MAIN NAVSS

    and i found  if i configure the sgmii with ENET_MAC_SGMIIMODE_SGMII_WITH_PHY mode the board is ok

    the loginfo is like next

    but if SGMII SET TO AUTONEG_MASTET OR AUTONEG_SLAVE OR FORCEDLINK the loginfo is the same link I asked

    [MCU2_0]      4.849220 s: ETHFW: Init ... !!!
    [MCU2_0]      4.977972 s: CPSW_9G Test on MAIN NAVSS for test
    [MCU2_0]      4.978031 s: #init osalcfg done
    [MCU2_0]      4.982951 s: #enet init done
    [MCU2_0]      4.990039 s: #enet open done
    [MCU2_0]      4.990091 s: #Semaphore init done
    [MCU2_0]      4.990326 s: #enet enable Port begin done
    [MCU2_0]      4.990382 s: setportlinkCfg 0:
    [MCU2_0]      4.990409 s: EnetMcm  port link cfg 0
    [MCU2_0]      4.990430 s: EnetMcm ioctl open port link begin done
    [MCU2_0]      4.990542 s: EnetMcm ioctl open port link finish done
    [MCU2_0]      5.121776 s: setportlinkCfg 2:
    [MCU2_0]      5.121821 s: EnetMcm  port link cfg 2
    [MCU2_0]      5.121845 s: EnetMcm ioctl open port link begin done
    [MCU2_0]      5.121954 s: EnetMcm ioctl open port link finish done
    [MCU2_0]      5.122003 s: setportlinkCfg 3:
    [MCU2_0]      5.122028 s: EnetMcm  port link cfg 3
    [MCU2_0]      5.122049 s: EnetMcm ioctl open port link begin done
    [MCU2_0]      5.122134 s: EnetMcm ioctl open port link finish done
    [MCU2_0]      5.122174 s: setportlinkCfg 7:
    [MCU2_0]      5.122197 s: EnetMcm  port link cfg 7
    [MCU2_0]      5.122217 s: EnetMcm ioctl open port link begin done
    [MCU2_0]      5.122291 s: EnetMcm ioctl open port link finish done
    [MCU2_0]      5.122322 s: #running here 788 done
    [MCU2_0]      5.122353 s: #enet ioctl 2 start
    [MCU2_0]      5.122380 s: #running here 820 done
    [MCU2_0]      5.122425 s: #enet ioctl 3 done
    [MCU2_0]      5.122446 s: #enet enable Port finished done
    [MCU2_0]      5.122467 s: #enet enable Port ok
    [MCU2_0]      5.124156 s: ETHFW: Version   : 0.01.01
    [MCU2_0]      5.124213 s: ETHFW: Build Date: Apr 22, 2021
    [MCU2_0]      5.124241 s: ETHFW: Build Time: 16:27:50
    [MCU2_0]      5.124262 s: ETHFW: Commit SHA:
    [MCU2_0]      5.124286 s: ETHFW: Init ... DONE !!!
    [MCU2_0]      5.124308 s: ETHFW: Remove server Init ... !!!
    [MCU2_0]      5.125520 s: Remote demo device (core : mcu2_0) .....
    [MCU2_0]      5.125579 s: ETHFW: Remove server Init ... DONE !!!
    [MCU2_0]      5.133015 s: Host MAC address: 70:ff:76:1d:92:c2
    [MCU2_0]      5.174776 s: FVID2: Init ... !!!
    [MCU2_0]      5.174871 s: FVID2: Init ... Done !!!
    [MCU2_0]      5.174914 s: VHWA: VPAC Init ... !!!
    [MCU2_0]      5.174938 s: SCICLIENT: Sciclient_pmSetModuleState module=290 sta

    Regards,

    kb

  • hi kb.

    is there any progress in the case?

    what should i do next steps?

    What else do I need to provide

  • Hi,

    Can you take a look at this FAQ on making the relevant changes to Ethernet FW and ENET LLD ? I believe you will have to re-compile the Ethernet FW and then load R5F with it.

    Regards

    Vineet

  • hi,

    thanks for your replay

    i look at the FAQ and changed Ethernet FW and ENET LLD  ,i reference the patch mac to mac on port 4 ,then i found that the patch is rgmii 

    and I think that the patch purpose is to use the application layer to initialize。

    i change configuration parameters  reference the patch mac to mac on port 4 then the log is

    [MCU2_0] 4.959548 s: ETHFW: Init ... done!!!
    [MCU2_0] 4.959571 s: ETHFW: Init ... done!!!
    [MCU2_0] 5.130537 s: CPSW_9G Test on MAIN NAVSS66
    [MCU2_0] 5.227861 s: CpswMacPort_open: MAC 4: MII mismatch with SoC settings
    [MCU2_0] 5.227918 s: EnetMod_open: cpsw9g.macport4: Failed to open: -3
    [MCU2_0] 5.227955 s: Cpsw_openPortLinkNoPhy: Port 4: Failed to open MAC: -3
    [MCU2_0] 5.227991 s: Cpsw_handleLinkDown: Port 4: Link down
    [MCU2_0] 5.228021 s: EnetMod_ioctl: cpsw9g.macport4: Module is not open
    [MCU2_0] 5.228054 s: Cpsw_handleLinkDown: Port 4: Failed to disable MAC port: -1
    [MCU2_0] 5.228091 s: Cpsw_ioctlInternal: Port 4: Failed to open port link: -3
    [MCU2_0] 5.228126 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -3
    [MCU2_0] 5.228161 s: Enet_ioctl: cpsw9g: IOCTL 0x01000102 failed: -3
    [MCU2_0] 5.228186 s: EnetMcm_enablePorts() failed to open MAC port: -3
    [MCU2_0] 5.268611 s: ETHFW: Version : 0.01.01
    [MCU2_0] 5.268669 s: ETHFW: Build Date: May 6, 2021
    [MCU2_0] 5.268694 s: ETHFW: Build Time: 13:47:44
    [MCU2_0] 5.268715 s: ETHFW: Commit SHA:
    [MCU2_0] 5.268736 s: ETHFW: Init ... DONE !!!
    [MCU2_0] 5.268757 s: ETHFW: Remove server Init ... !!!
    [MCU2_0] 5.269886 s: Remote demo device (core : mcu2_0) .....
    [MCU2_0] 5.269944 s: ETHFW: Remove server Init ... DONE !!!
    [MCU2_0] 5.275938 s: Host MAC address: 70:ff:76:1d:92:c2
    [MCU2_0] 5.319828 s: FVID2: Init ... !!!

    it looks like the changes doesn‘t take effect 

  • Hi,

    1. Did you modify the patch for SGMII and your port ?

    2. Can you post the output of Ethernet Firmware ?

    Regards

    Vineet

  • hi,

    thanks for your replay

     1.I modify the patch for SGMII ,the patch disable ENET_MAC_3 and ENET_MAC_8, i didn't modify it .then i found if i disable ENET_MAC3,4,8 and setup ENET_MAC_4 for SGMII the log changed like next,i didn’t enable mac port 8,and  if i use EnetBoard_setPhyConfigSgmii the serdes pll is ok What parameters did I miss?the  serdeslane's  params i reference MAC_MAC_SGMII_1G_Linux 

    serdesLane0EnableParams.serdesInstance = (CSL_SerdesInstance)CSL_SIERRA_SERDES1;
    serdesLane0EnableParams.baseAddr = CSL_SERDES_16G1_BASE;

    CSL_serdesIPSelect(CSL_CTRL_MMR0_CFG0_BASE,
    serdesLane0EnableParams.phyType,
    serdesLane0EnableParams.phyInstanceNum,
    serdesLane0EnableParams.serdesInstance,
    3U);


    [MCU2_0] 3.705156 s: MEM: Init ... Done !!!
    [MCU2_0] 3.705175 s: IPC: Init ... !!!
    [MCU2_0] 3.705202 s: IPC: 7 CPUs participating in IPC !!!
    [MCU2_0] 3.711588 s: IPC: Init ... Done !!!
    [MCU2_0] 3.711646 s: APP: Syncing with 6 CPUs ... !!!
    [MCU2_0] 4.205875 s: APP: Syncing with 6 CPUs ... Done !!!
    [MCU2_0] 4.205913 s: REMOTE_SERVICE: Init ... !!!
    [MCU2_0] 4.207800 s: REMOTE_SERVICE: Init ... Done !!!
    [MCU2_0] 4.207866 s: ETHFW: Init ... done!!!
    [MCU2_0] 4.207891 s: ETHFW: Init ... done!!!
    [MCU2_0] 4.331315 s: CPSW_9G Test on MAIN NAVSS66
    [MCU2_0] 4.414642 s: CpswMacPort_setSgmiiInterface: MAC 4: SERDES PLL is not locked
    [MCU2_0] 4.414700 s: CpswMacPort_setSgmiiInterface: MAC 4: Failed to set SGMII interface: -9
    [MCU2_0] 4.414743 s: CpswMacPort_open: MAC 4: failed to set Q/SGMII interface: -9
    [MCU2_0] 4.414782 s: EnetMod_open: cpsw9g.macport4: Failed to open: -9
    [MCU2_0] 4.414816 s: Cpsw_openPortLinkNoPhy: Port 4: Failed to open MAC: -9
    [MCU2_0] 4.414850 s: Cpsw_handleLinkDown: Port 4: Link down
    [MCU2_0] 4.414878 s: EnetMod_ioctl: cpsw9g.macport4: Module is not open
    [MCU2_0] 4.414912 s: Cpsw_handleLinkDown: Port 4: Failed to disable MAC port: -1
    [MCU2_0] 4.414950 s: Cpsw_ioctlInternal: Port 4: Failed to open port link: -9
    [MCU2_0] 4.414985 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -9
    [MCU2_0] 4.415022 s: Enet_ioctl: cpsw9g: IOCTL 0x01000102 failed: -9
    [MCU2_0] 4.415048 s: EnetMcm_enablePorts() failed to open MAC port: -9
    [MCU2_0] 4.453622 s: CpswMacPort_open: MAC 8: MII mismatch with SoC settings
    [MCU2_0] 4.453667 s: EnetMod_open: cpsw9g.macport8: Failed to open: -3
    [MCU2_0] 4.453704 s: Cpsw_openPortLinkNoPhy: Port 8: Failed to open MAC: -3
    [MCU2_0] 4.453737 s: Cpsw_handleLinkDown: Port 8: Link down
    [MCU2_0] 4.453765 s: EnetMod_ioctl: cpsw9g.macport8: Module is not open
    [MCU2_0] 4.453797 s: Cpsw_handleLinkDown: Port 8: Failed to disable MAC port: -1
    [MCU2_0] 4.453833 s: Cpsw_ioctlInternal: Port 8: Failed to open port link: -3
    [MCU2_0] 4.453870 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -3
    [MCU2_0] 4.453905 s: Enet_ioctl: cpsw9g: IOCTL 0x01000102 failed: -3
    [MCU2_0] 4.453932 s: EnetMcm_enablePorts() failed to open MAC port: -3
    [MCU2_1] 3.806506 s: CIO: Init ... Done !!!
    [MCU2_1] 3.806576 s: ### CPU Frequency <ORG = 1000000000 Hz>, <NEW = 1000000000 Hz>
    [MCU2_1] 3.806614 s: APP: Init ... !!!
    [MCU2_1] 3.806633 s: SCICLIENT: Init ... !!!
    [MCU2_1] 3.806847 s: SCICLIENT: DMSC FW version [21.1.1--v2021.01a (Terrific Lla]
    [MCU2_1] 3.806884 s: SCICLIENT: DMSC FW revision 0x15
    [MCU2_1] 3.806909 s: SCICLIENT: DMSC FW ABI revision 3.1
    [MCU2_1] 3.806936 s: SCICLIENT: Init ... Done !!!
    [MCU2_1] 3.806958 s: UDMA: Init ... !!!
    [MCU2_1] 3.808163 s: UDMA: Init ... Done !!!

     2.how can i output the ethernet firmware?

  • Hi,

    What parameters did I miss?the  serdeslane's  params i reference MAC_MAC_SGMII_1G_Linux 

    TI > Let me check this internally. Can you attach the changes you have done to Ethernet FW as a patch ?

    2. how can i output the ethernet firmware?

    TI > Can you take a look at this FAQ and the related threads ? this is for Linux but the changes in Ethernet Firmware should be similar. You need to make changes to route Ethernet firmware output to MCU UART.

    Regards

    Vineet

  • hi,

    thanks for your replay

    1.In order to test whether the hardware is correct, I changed the SDK version from sdk7.3  (rtos + qnx )to sdk7.0 (linux + rtos)

    2.all files were changed as the same as the patch package MAC_MAC_SGMII_1G_Linux

    3.i found if i set SGMII MODE is SGMII_AUTONEG_SLAVE or SGMII_AUTONEG_MASTER the status is not incorrect ,it's only have three line logs like next 

    Enabling clocks for CPSW_9G!
    CPSW_9G Test on MAIN NAVSS
    CpswMacPort_configSgmii: MAC 2: Configuring SGMII in SGMII_AUTONEG_SLAVE mode

    Enabling clocks for CPSW_9G!
    CPSW_9G Test on MAIN NAVSS
    CpswMacPort_configSgmii: MAC 2: Configuring SGMII in SGMII_AUTONEG_MASTER mode

    4.if i set SGMII MODE  is FORCEDLINK it's ok 
    Enabling clocks for CPSW_9G!
    CPSW_9G Test on MAIN NAVSS
    CpswMacPort_configSgmii: MAC 2: Configuring SGMII in SGMII_FORCEDLINK mode
    Remote demo device (core : mcu2_0) .....
    Host MAC address: 70:ff:76:1d:92:c2
    Host MAC address: 70:ff:76:1d:92:c2
    [NIMU_NDK] CPSW has been started successfully

    CPSW NIMU application, IP address I/F 1: 192.168.1.203

    Function:CpswProxyServer_attachExtHandlerCb,HostId:0,CpswType:1
    Function:CpswProxyServer_registerMacHandlerCb,HostId:0,Handle:a212c53c,CoreKey:38acb7e6, MacAddress:70:ff:76:1d:92:c1, FlowIdx:172, FlowIdxOffset:0
    Cpsw_ioctlInternal: CPSW: Registered MAC address.ALE entry:11, Policer Entry:0

    5.I did the same test on the official EVM board,SGMII_AUTONEG_SLAVE or SGMII_AUTONEG_MASTER can‘t be set

    6.after I verify the hardware  in sdk7.0(rtos+linux), I will continue to verify it in sdk7.3(rtos+linux),and finally verify it in sdk7.3(qnx+rtos)

  • hi,Vineet Roy

    i test SGMII MAC2MAC use EVM board with SDK7.0 RTOS + linux it is ok

    but then i test SGMII MAC2MAC use EVM board with sdk 7.3 rtos + linux it is has some problem 。

    I set SGMII with ENET_MAC_SGMIIMODE_SGMII_FORCELINK buf if i used patch of  0001-utils-MAC-to-MAC-on-Port-4 the SGMII  0x0c000410 ,the register 0x0c000410 all data is 0

    bit 5 MASTER mode DESCRIPTION 1 is MASTER 0 is slave 

     the register 0x00104050 data is 3 

    the log is 

    [MCU2_0] 17.884838 s: APP: Syncing with 5 CPUs ... !!!
    [MCU2_0] 18.068485 s: APP: Syncing with 5 CPUs ... Done !!!
    [MCU2_0] 18.068658 s: REMOTE_SERVICE: Init ... !!!
    [MCU2_0] 18.070333 s: REMOTE_SERVICE: Init ... Done !!!
    [MCU2_0] 18.070394 s: ETHFW: Init ... !!!
    [MCU2_0] 18.189145 s: CPSW_9G Test on MAIN NAVSS
    [MCU2_0] 18.200872 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -1
    [MCU2_0] 18.200925 s: EnetPer_ioctl: cpsw9g: Do IOCTL 0x01000102 prms a2a97288
    [MCU2_0] 18.201045 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: 0
    [MCU2_0] 18.201087 s: EnetPer_ioctl: cpsw9g: Do IOCTL 0x01000102 prms a2a97288
    [MCU2_0] 18.201133 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -1
    [MCU2_0] 18.201168 s: EnetPer_ioctl: cpsw9g: Do IOCTL 0x01000102 prms a2a97288
    [MCU2_0] 18.201260 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: 0
    [MCU2_0] 18.201299 s: EnetPer_ioctl: cpsw9g: Do IOCTL 0x01000102 prms a2a97288
    [MCU2_0] 18.251601 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -1
    [MCU2_0] 18.251646 s: EnetPer_ioctl: cpsw9g: Do IOCTL 0x01000102 prms a2a97288
    [MCU2_0] 18.251725 s: CpswMacPort_setSgmiiInterface: MAC 4: SERDES PLL is not locked
    [MCU2_0] 18.251766 s: CpswMacPort_setSgmiiInterface: MAC 4: Failed to set SGMII interface: -9
    [MCU2_0] 18.251804 s: CpswMacPort_open: MAC 4: failed to set Q/SGMII interface: -9
    [MCU2_0] 18.251838 s: EnetMod_open: cpsw9g.macport4: Failed to open: -9
    [MCU2_0] 18.251870 s: Cpsw_openPortLinkNoPhy: Port 4: Failed to open MAC: -9
    [MCU2_0] 18.251903 s: Cpsw_handleLinkDown: Port 4: Link down
    [MCU2_0] 18.251929 s: EnetMod_ioctl: cpsw9g.macport4: Module is not open
    [MCU2_0] 18.251959 s: Cpsw_handleLinkDown: Port 4: Failed to disable MAC port: -1
    [MCU2_0] 18.251995 s: Cpsw_ioctlInternal: Port 4: Failed to open port link: -9
    [MCU2_0] 18.252027 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -9
    [MCU2_0] 18.252059 s: EnetPer_ioctl: cpsw9g: Do IOCTL 0x01000102 prms a2a97288
    [MCU2_0] 18.252091 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -9
    [MCU2_0] 18.252125 s: Enet_ioctl: cpsw9g: IOCTL 0x01000102 failed: -9
    [MCU2_0] 18.252149 s: EnetMcm_enablePorts() failed to open MAC port: -9
    [MCU2_0] 18.252191 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: -1
    [MCU2_0] 18.252224 s: EnetPer_ioctl: cpsw9g: Do IOCTL 0x01000102 prms a2a97288
    [MCU2_0] 18.252319 s: EnetPer_ioctl: cpsw9g: Failed to do IOCTL cmd 0x01000102: 0

    Enabling clocks!
    #use Function EnetAppUtils_serNoPhyCfgSgmii init
    [NIMU_NDK] ENET has been started successfully

  • Hi,

    I got an offline message that issue is closed. Can you confirm ?

    Regards

    Vineet

  • hi vineet 

    this case is closed 

    sdk 7.3 have a bug in mac2mac mode

    Ti Chinese helped solve the problem

  • Hi,

    Glad to know it's fixed.

    Can you mention the bug you found ? so we can fix at our end officially.

    Regards

    Vineet

  • the file cpsw_macprot.c

    line 2209 while (sgmiiStatus.bIsLinkUp != 1U);

    the init process stop in here ,sdk 7.0 is 0U

  • Thanks. I have filed an internal ticket. Closing this

    Regards

    Vineet