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.

TDA4VMXEVM: Seek for HowTo to get the linux system working with the built in ethernet switch

Part Number: TDA4VMXEVM

Hi,

I'm a little bit lost in the moment. :-) I'm starting with the linux SDK and the RTOS SDK on my linux instance. Goal for the moment is to know, how I get the ethernet switch working and be able to transfer data over the switch from the linux system.

I start with the eval board and - in the moment - with the software out of the box on the SD card.

I know in the moment, that the ethernet switch have to be controlled over main R5F core 0. Also I need too some kernel drivers, which - as I have seen - are already available on SD card. And with loading/starting the kernel drivers the R5F core will be load with the software to control the ethernet switch. (which SW or FW?) After that I should have a ethX interface. (really "ethX", to check for example with commandline "ip a")

But in the moment I'm a little bin unsync ... :-)

Questions:

a) Am I right with my assumptions about the software on the SD card (see above), delivered with the SOM board?

b) Which drivers have to be load (for example with modprobe) to get the swith and interface on linux system running?

c) I have found something about PRU RPMSG to communicate between cores, the example software in linux SDK use a pru-cgt compiler, but is this right for the TDA4VM, especially for the R5F cores? (readelf says, it's a image for TI PRU I/o processor!)

Thanks for answers, cu Thomas

  • Hello Thomas,

    You are right about the kernel driver to get Ethernet switch data on the Linux. 

    Can you please refer to below developer notes and relevant documentation about Ethernet firmware?

    psdk_rtos_auto_j7_06_01_01_06/psdk_rtos_auto/docs/user_guide/developer_notes_ethfw.html

    This has section about virtual mac driver which details about adding the interface on Linux.  

    If any clarifications in the documentation, we should be able to resolve here. Let us know.

    Also I am checking internally if we enable cpsw9g virtual mac with Linux prebuilt images shipped as a part of EVM. Will let you know tomorrow.

    Regards,

    Prasad

  • Hello Prasad,

    thanks for answer. Your link completes my information. Inbetween I have also got a video, (the available PDF from PDK with some explanation by audio) which explains the ethernet switch in TDA4. So, I think I have now a better view on it.

    And maybe, I can't solve it in the moment! In the video was explained, that to use the ethernet switch is only possible together with the GESI expansion board, which I haven't in the moment. On base board 4 ethernet physics are mounted but, as the video explained, with a MAC chip, which isn't supported by SDK 1.0 (and I have ti-processor-sdk-linux-automotive-j7-evm-06_01_01_02-Linux-x86-Install.bin together with psdk_rtos_auto_j7_06_01_01_12.tar.gz)

    So, first question is: is this correct for my currently used sdk? (and if Yes, is there a rough timeline, when it could be available?)

    And I have a second question: If I look on the boot messages I see (snipped):

    Trying to boot from MMC2
    Loading Environment from MMC... *** Warning - No MMC card found, using default environment

    Remoteproc 2 started successfully
    ** File not found /lib/firmware/j7-mcu-r5f0_0-fw **
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.1(release):ti2019.03

    In /lib/firmware such file isn't available, only a file j7-main-r5f0_0-fw! (which is a softlink to app-remoteswitchcfg_...) Maybe this could be a reason for not working? (software, I use, is the original content of SD card, which is delivered with SOM board, uname -a brings "Linux j7-evm 4.19.59-g50ceb3c6e7 #1 SMP PREEMPT Thu Sep 12 09:13:59 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux")

    cu, Thomas

  • Hello Thomas,

    Glad to know that the developer notes and training video helped in understanding the EthFw architecture.

    Please find below replies for open questions -  

    Thomas Klepp said:

    So, first question is: is this correct for my currently used sdk? (and if Yes, is there a rough timeline, when it could be available?)

    Yes, your understanding is correct. SDK1.0 supported only GESI board. SDK6.2 which is recently released supports QSGMII daughterboard so you should be able to proceed without GESI board with SDK6.2

    Thomas Klepp said:
    In /lib/firmware such file isn't available, only a file j7-main-r5f0_0-fw! (which is a softlink to app-remoteswitchcfg_...) Maybe this could be a reason for not working?

    j7-mcu-r5f0_0-fw is for MCU domain R5 where AUTOSAR would run. We don't support it as a part of default SD-card.

    j7-main-r5f0_0-fw is soft link to Ethernet firmware binary which controls Ethernet switch (CPSW9G).

    You can connect Main UART2 and confirm the EthFw logs to see it is being loaded and run.

  • Hello Prasad,

    thanks for answering my questions. In the time between I had loaded new SDK 6.2.0 and tried it:

    I start with the system from original SD card (maybe this is my mistake, I haven't build the system completely new, I'll try it next time)

    I have copied the *server.xer5f from original out/../release directory below psdk/ethfw directory to /lib/firmware and set the softlink to *r0_0-fw (I have also tried to set rights for the *.xer5f file to 755 instead of 644, but same result)

    Then reboot linux system

    Logs from linux system (snipped), e.g. ttyUSB0:

    [ 15.785323] k3_r5_rproc interconnect@100000:interconnect@28380000:r5fss@41000000: creating child devices for R5F cores
    [ 15.870606] platform 41000000.r5f: configured R5F for remoteproc mode
    [ 15.891287] platform 41000000.r5f: assigned reserved memory node r5f-dma-memory@a0000000
    [ 15.903283] remoteproc remoteproc3: 41000000.r5f is available
    [ 15.914424] remoteproc remoteproc3: Direct firmware load for j7-mcu-r5f0_0-fw failed with error -2
    [ 15.925724] remoteproc remoteproc3: powering up 41000000.r5f
    [ 15.934457] remoteproc remoteproc3: Direct firmware load for j7-mcu-r5f0_0-fw failed with error -2
    [ 15.943738] asoc-simple-card sound@0: pcm3168a-dac <-> 2ba0000.mcasp mapping ok
    [ 15.947493] remoteproc remoteproc3: request_firmware failed: -2

    On ttyUSB2 I can see:

    QSGMII board detected
    Enabling clocks for CPSW_9G!
    =======================================================
    CPSW Ethernet Firmware Demo
    =======================================================
    ETHFW Version: 0. 1. 1
    ETHFW Build Date (YYYY/MMM/DD):2020/Feb/17
    ETHFW Commit SHA:ETHFW PermissionFlag:0x1ffffff, UART Connected:true,UART Id:2[UDMA] IPC_echo_test (core : mcu2_0) .....
    [Error] SciClient Set proxy config failed!!!
    Remote demo device (core : mcu2_0) .....
    Assertion @ Line: 142 in cpsw_apputils.c: UDMA_SOK == retVal : failed !!!

    And, as to see, no new interface:

    Arago Project http://arago-project.org j7-evm ttyS2

    Arago 2019.07 j7-evm ttyS2

    j7-evm login: root
    root@j7-evm:~# ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 50:51:a9:fc:1d:2b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.10/24 brd 192.168.1.255 scope global dynamic eth0
    valid_lft 86197sec preferred_lft 86197sec
    inet6 fe80::5251:a9ff:fefc:1d2b/64 scope link
    valid_lft forever preferred_lft forever

    Maybe I have to do some additional configuration for that? Or the problem is, that I have to rebuild the kernel and to replace in rootfs partition with the new kernel / modules etc.

    One finding more - maybe connected with the SD card content, which comes with the SOM - after set (e.g. replace) the softlink in /lib/firmware for *r0_0-fw to ethfw image, the (warm) reboot works, but on cold start (switch off/on power switch) boot stops and the linux system doesn't come up. If I later replace then the softlink to the original image, which was set, it works again.

  • Hello Thomas,

    The EthFw failure logs tells that you are not using latest System firmware image in your test.

    Can you please use latest images and board config file and retry?

  • Hello Prasad,

    thanks for answer. And we have made one step in the right direction ... :-) ethfw log looks now better, I see also on linux system a new interface but next step to get IP addresses by DHCP doesn't work:

    First path ethfw log is:

    Enabling clocks for CPSW_9G!
    =======================================================
    CPSW Ethernet Firmware Demo
    =======================================================
    ETHFW Version: 0. 1. 1
    ETHFW Build Date (YYYY/MMM/DD):2020/Feb/17
    ETHFW Commit SHA:ETHFW PermissionFlag:0x1ffffff, UART Connected:true,UART Id:2IPC_echo_test (core : mcu2_0) .....
    CPSW_9G Test on MAIN NAVSS
    Remote demo device (core : mcu2_0) .....
    PHY 16 is alive
    PHY 17 is alive
    PHY 18 is alive
    PHY 19 is alive
    Host MAC address: 70:ff:76:1d:8f:39
    [NIMU_NDK] CPSW has been started successfully
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!

    That looks good. Then we have 2 different cases, one, if I have set the softlink for r5f0_1-fw to ethfw client:

    Function:CpswProxyServer_attachExtHandlerCb,HostId:4,CpswType:1
    Function:CpswProxyServer_attachExtHandlerCb,HostId:0,CpswType:1
    Function:CpswProxyServer_ioctlHandlerCb,HostId:4,Handle:a2cee3f4,CoreKey:38acb976, Cmd:5000d,InArgsLen:0, OutArgsLen:4
    Function:CpswProxyServer_ioctlHandlerCb,HostId:4,Handle:a2cee3f4,CoreKey:38acb976, Cmd:20000,InArgsLen:24, OutArgsLen:4
    Function:CpswProxyServer_registerMacHandlerCb,HostId:4,Handle:a2cee3f4,CoreKey:38acb976, MacAddress:70:ff:76:1d:8f:3a, FlowIdx:178, FlowIdxOffset:6
    Cpsw_ioctlInternal: CPSW: Registered MAC address.ALE entry:10, Policer Entry:0Function:CpswProxyServer_registerMacHandlerCb,HostId:0,Handle:a2cee3f4,CoreKey:38acb7e6, MacAddress:70:ff:76:1d:8f:38, FlowIdx:172, FlowIdxOffset:0
    Cpsw_ioctlInternal: CPSW: Registered MAC address.ALE entry:11, Policer Entry:1Function:CpswProxyServer_ioctlHandlerCb,HostId:4,Handle:a2cee3f4,CoreKey:38acb976, Cmd:10003,InArgsLen:1, OutArgsLen:1
    Function:CpswProxyServer_ioctlHandlerCb,HostId:4,Handle:a2cee3f4,CoreKey:38acb976, Cmd:10003,InArgsLen:1, OutArgsLen:1

    The last line is then repeated without stop.

    Second case, if I have reset softlink for *r5f0_1-fw to ipc-echo... image:

    Function:CpswProxyServer_attachExtHandlerCb,HostId:0,CpswType:1
    Function:CpswProxyServer_registerMacHandlerCb,HostId:0,Handle:a2cee3f4,CoreKey:38acb7e6, MacAddress:70:ff:76:1d:8f:38, FlowIdx:172, FlowIdxOffset:0
    Cpsw_ioctlInternal: CPSW: Registered MAC address.ALE entry:10, Policer Entry:0DHCP client timed out. Retrying.....
    DHCP client timed out. Retrying.....

    Other behaviour, but I can't see any DHCP packages on my ubuntu host. (dhcp works on single ethernet port without any problems! I was connected to P2 on QSGMII-Board)

    On linux system with command "ip a" I can see the new interface, but with link status UNKNOWN:

    3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 70:ff:76:1d:8f:38 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::72ff:76ff:fe1d:8f38/64 scope link
    valid_lft forever preferred_lft forever

    Thanks for answer, cu, Thomas

  • Hello Thomas,

    Thanks for sharing detailed log.

    I don't see any port link message in the UART like below. Have you connected LAN cables to port 2 and port 3? Please note, there should be link on these ports in you are using SDK1.0. For SDK6.2, link on any port is fine.

    GESI board detected
    Enabling clocks for CPSW_9G!
    =======================================================
    CPSW Ethernet Firmware Demo
    =======================================================
    ETHFW Version: 0. 1. 1
    ETHFW Build Date (YYYY/MMM/DD):2020/Mar/16
    ETHFW Commit SHA:714fe962
    ETHFW PermissionFlag:0x1ffffff, UART Connected:true,UART Id:2IPC_echo_test (core : mcu2_0) .....
    CPSW_9G Test on MAIN NAVSS
    Remote demo device (core : mcu2_0) .....
    CpswPhy_bindDriver: PHY 12: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK
    CpswPhy_bindDriver: PHY 0: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK
    CpswPhy_bindDriver: PHY 3: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK
    CpswPhy_bindDriver: PHY 15: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK
    PHY 0 is alive
    PHY 3 is alive
    PHY 10 is alive
    PHY 12 is alive
    PHY 15 is alive
    PHY 23 is alive
    Host MAC address: 70:ff:76:1d:87:96
    [NIMU_NDK] CPSW has been started successfully
    Cpsw_handleLinkUp: port 3: Link up: 1-Gbps Full-Duplex
    Cpsw_handleLinkUp: port 2: Link up: 1-Gbps Full-Duplex

    For DHCP, you have two options

    1. Enable static IP by changing enableStatic flag in in below file

    \ethfw\apps\bios_cfg\ndk.cfg

    2. Configure DHCP server on your Ubuntu system.This is quite simple.

    https://graspingtech.com/configure-dhcp-server/

  • Hello Prasad,

    thanks for answer. Hold in mind, that I haven't GESI board. (as your log output shows) And I have tried it just now. Same log output as in my posting before. And I had too a link cable connected to P3 (the upper ones) right from start.

    Because I use a dhcp server  on my ubuntu dev. platform I should see at least some dhcp requests, but nothing. (dhcp server works, I use this also, if I connect to the single port MCU_ENET, also both leds on P3 are on - orange and yellow)

     Thanks for answers.

    cu, Thomas

  • Hello Thomas,

    Have you got GESI board now?

    Also Which SDK version you are on?

    For SDK6.1, please connect port 2 and 3 and see link is detected. You can try connecting each port and see if link is detected.

  • Hello Prasad,

    thanks for answer.

    Unfortunately we haven't GESI-board. And it will take time - because of current situation - to get one! (assuming 2 or 3 month!) This is the reason, why I have tried to get it working with the QSGMII-ports on base board direct.

    SDK versions (both, PSDKLA and PSDKRA) are 6.2.0.

    Thanks for answers!

    cu, Thomas

  • Hello Prasad,

    I tried several strategies here and sadly none of them work, like Thomas I dont have access to GESI board.

    1) This happens when I build the firmware myself and use the following option as described in the documentation.

    """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""

    Note: If building the Ethernet Firmware for integration in Linux, please uncomment below in CPSW LLD's makefile located at <PDK_PATH>/packages/ti/drv/cpsw/cpsw_component.mk:

    #CPSW_CFLAGS += -DSDK_6_2_CORE_SDK_IMAGE
    

    This change is required to avoid board-level settings conflicts with Linux bootloader.

    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

    Enabling clocks for CPSW_9G!
    =======================================================
               CPSW Ethernet Firmware Demo             
    =======================================================
    ETHFW Version: 0. 1. 1
    ETHFW Build Date (YYYY/MMM/DD):2020/Mar/23
    ETHFW Commit SHA:ETHFW PermissionFlag:0x1ffffff, UART Connected:true,UART Id:2CpswAppBoardUtils_getMacAddrList Failed - GESI/ENET board not present
    IPC_echo_test (core : mcu2_0) .....
    Assertion @ Line: 691 in V1/cpsw_appboardutils_j721e_evm.c: false : failed !!!

    2) Running the precompiled library I get the following error:

    Enabling clocks for CPSW_9G!
    =======================================================
               CPSW Ethernet Firmware Demo             
    =======================================================
    ETHFW Version: 0. 1. 1
    ETHFW Build Date (YYYY/MMM/DD):2020/Feb/17
    ETHFW Commit SHA:ETHFW PermissionFlag:0x1ffffff, UART Connected:true,UART Id:2IPC_echo_test (core : mcu2_0) .....
    CPSW_9G Test on MAIN NAVSS
    Remote demo device (core : mcu2_0) .....
    PHY 16 is alive
    PHY 17 is alive
    PHY 18 is alive
    PHY 19 is alive
    Host MAC address: 70:ff:76:1d:8e:11
    [NIMU_NDK] CPSW has been started successfully
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
    Function:CpswProxyServer_attachExtHandlerCb,HostId:0,CpswType:1
    Function:CpswProxyServer_registerMacHandlerCb,HostId:0,Handle:a2cee3f4,CoreKey:38acb7e6, MacAddress:70:ff:76:1d:8e:10, FlowIdx:172, FlowIdxOffset:0
    Cpsw_ioctlInternal: CPSW: Registered MAC address.ALE entry:10, Policer Entry:0Function:CpswProxyServer_registerIpv4MacHandlerCb,HostId:0,Handle:a2cee3f4,CoreKey:38acb7e6, MacAddress:70:ff:76:1d:8e:10 IPv4Addr:192.168.2.120
    Failed to add Static ARP Entry

    ================LLI Table entries===========

    Number of Static ARP Entries: 0

    SNo.      IP Address         MAC Address  
    ------    -------------      ---------------

    And also no connection. Can you help me with this. Thanks

    Pouyan

  • Hello Pouyan,

    As mentioned earlier Linux + EthFw QSGMII is not possible with SDK6.2 due to resource conflict.

    Is it possible for you to do your development on standalone EthFw mode? Basically no Linux?