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/AM5728: ICSS_EMAC example with IPC

Part Number: AM5728

Tool/software: TI C/C++ Compiler

i want to use the dsp icss_emac example in pdk, with ipc communication for ARM.

the ARM running with linux, DSP running with RTOS, the dsp fireware in arm linux(/lib/fireware/) ,

but in example the ARM was not running with linux, there are many differents form my needs.

how can i do this function? i need the details!  i do the steps below but it not works.

1)   disable the pru_eth in the device tree for linux

2)   modify the cfg flag int the board_init (in TI document of led_blink example with IPC , it do not need board_init)

3)  Cache_setMar((xdc_Ptr)0x4b000000U, 0x10000U, 0);

     Cache_setMar((xdc_Ptr)0x40000000U, 0x10000U, 0);

4)   PRUICSS_create return PRUICSS_Handle 

5)  CSL_xbarDspIrqConfigure(1, CSL_XBAR_INST_DSP1_IRQ_76, CSL_XBAR_PRUSS2_IRQ_HOST8); 

     CSL_xbarDspIrqConfigure(1, CSL_XBAR_INST_DSP1_IRQ_77, CSL_XBAR_PRUSS2_IRQ_HOST2);
     CSL_xbarDspIrqConfigure(1, CSL_XBAR_INST_DSP1_IRQ_78, CSL_XBAR_PRUSS2_IRQ_HOST4);

6)  init  ICSS_EmacHandle and ICSS_EmacObject

7)  ICSS_EmacInit

8)  ICSS_EmacRegisterHwIntRx

9)  PRUICSS_pruDisable

10)  PRUICSS_pruWriteMemory for DMEM

11)  PRUICSS_pruWriteMemory for IMEM

12) PRUICSS_pruEnable

13 ) ICSS_EmacTxPacket to send the ethernet packets

14) ICSS_EmacPollControl to recv the ethernet packets with ICSS_EMAC_POLL_MODE_RX_PKT flag

  • i do board_init with BOARD_INIT_ICSS_ETH_PHY flag, i get this erros:

    remoteproc remoteproc2: bad phdr da 0x40300000 mem 0x1d20
    remoteproc remoteproc2: Failed to load program segments: -22

    it means that we can not use BOARD_IO_DELAY_xxx with ARM linux 

    did we not need do something with pinmux setting  Board_pruEthClockConfig   Board_mdioInit  Board_phySetup for the PRU ICSS_EMAC ?

  • when i  do the below steps ant try to create a pruicss_handle for PRU2 eth0,  then i got these errors:

    i realy have no idea how to do the demo that dsp's  icss_emac device driver with arm linux.

    source code :

    PRUICSS_Config *icss_config;

    PRUICSS_Handle icss_handle;

    ret = PRUICSS_socGetInitCfg(&icss_config);
    if (ret != PRUICSS_RETURN_SUCCESS) {
        Log_print1(Diags_EXIT, "<-- ncx_icss_emac init: %d\n", __LINE__);
        return -1;
    }

    icss_handle = PRUICSS_create( (PRUICSS_Config*)icss_config, PRUICCSS_INSTANCE_TWO);

    the error message :

    [ 197.777709] remoteproc remoteproc2: crash detected in 40800000.dsp: type mmufault
    [ 197.777716] omap-iommu 40d01000.mmu: 40d01000.mmu: errs:0x00000002 da:0x4b2a6000 pgd:0xedb212c8 *pgd:px00000000
    [ 197.814671] remoteproc remoteproc2: registered virtio1 (type 7)
    [ 197.820626] remoteproc remoteproc2: remote processor 40800000.dsp is now up
    [ 197.831650] virtio_rpmsg_bus virtio1: creating channel rpmsg-proto addr 0x3d
    [ 289.523418] remoteproc remoteproc2: crash detected in 40800000.dsp: type watchdog
    [ 289.532600] remoteproc remoteproc2: handling crash #7 in 40800000.dsp
    [ 289.539076] remoteproc remoteproc2: recovering 40800000.dsp
    [ 289.578840] remoteproc remoteproc2: stopped remote processor 40800000.dsp
    [ 289.585891] remoteproc remoteproc2: powering up 40800000.dsp
    [ 289.599760] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 4705384
    [ 289.615426] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
    [ 289.621393] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
    [ 289.658896] virtio_rpmsg_bus virtio1: rpmsg host is online
    [ 289.664444] omap-iommu 40d01000.mmu: iommu fault: da 0x4b2a6000 flags 0x0

  • i modify the resource table file,    PRUICSS_create is OK, 

    but when linux booting, there are many error message.

    [ 9.168177] virtio_rpmsg_bus virtio2: rpmsg host is online
    [ 9.173732] ------------[ cut here ]------------
    [ 9.173746] WARNING: CPU: 0 PID: 74 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x24c/0x350
    [ 9.173751] 44000000.ocp:L3 Standard Error: MASTER DSP1_MDMA TARGET PRUSS2 (Read Link): At Address: 0x00026000 : Data Access in User mode during Functional access
    [ 9.173818] Modules linked in: ti_prueth pru_rproc pruss pruss_intc snd_soc_omap_hdmi_audio pvrsrvkm(O) c_can_platform omap_sham omap_aes_driver c_can can_dev omap_wdt ti_vpe ti_sc ti_csc dwc3_omap ti_vpdma extcon_core omap_des des_generic crypto_engine omap_remoteproc virtio_rpmsg_bus rpmsg_core remoteproc sch_fq_codel uio_module_drv(O) uio ftdi_sio usbserial usbcore usb_common gdbserverproxy(O) cryptodev(O) cmemk(O)
    [ 9.173826] CPU: 0 PID: 74 Comm: kworker/0:3 Tainted: G W O 4.9.69-g9ce43c71ae #1
    [ 9.173828] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 9.173839] Workqueue: events request_firmware_work_func
    [ 9.173843] Backtrace:
    [ 9.173856] [<c020b278>] (dump_backtrace) from [<c020b528>] (show_stack+0x18/0x1c)
    [ 9.173862] r7:00000009 r6:60010193 r5:c10227a8 r4:00000000
    [ 9.173872] [<c020b510>] (show_stack) from [<c04cb534>] (dump_stack+0x9c/0xb0)
    [ 9.173880] [<c04cb498>] (dump_stack) from [<c022e0a4>] (__warn+0xec/0x104)
    [ 9.173885] r7:00000009 r6:c0bc356c r5:00000000 r4:eeb776f8
    [ 9.173891] [<c022dfb8>] (__warn) from [<c022e0fc>] (warn_slowpath_fmt+0x40/0x48)
    [ 9.173896] r9:ef1c2210 r8:00000000 r7:c0bc3860 r6:00000004 r5:c0bc348c r4:c0bc353c
    [ 9.173905] [<c022e0c0>] (warn_slowpath_fmt) from [<c04fb370>] (l3_interrupt_handler+0x24c/0x350)
    [ 9.173908] r3:ef1c2080 r2:c0bc353c
    [ 9.173910] r4:80080001
    [ 9.173919] [<c04fb124>] (l3_interrupt_handler) from [<c027f374>] (__handle_irq_event_percpu+0x90/0x120)
    [ 9.173925] r10:c104c06f r9:ef1b5200 r8:00000017 r7:eeb7780c r6:00000000 r5:ef1b5200
    [ 9.173927] r4:ef1c2580
    [ 9.173934] [<c027f2e4>] (__handle_irq_event_percpu) from [<c027f428>] (handle_irq_event_percpu+0x24/0x60)
    [ 9.173939] r10:c1072ff0 r9:eeb76000 r8:ef006000 r7:00000000 r6:c1008c34 r5:ef1b5200
    [ 9.173941] r4:ef1b5200
    [ 9.173948] [<c027f404>] (handle_irq_event_percpu) from [<c027f4a4>] (handle_irq_event+0x40/0x64)
    [ 9.173951] r5:ef1b5260 r4:ef1b5200
    [ 9.173959] [<c027f464>] (handle_irq_event) from [<c0282ad4>] (handle_fasteoi_irq+0xc0/0x190)
    [ 9.173962] r7:00000000 r6:c1008c34 r5:ef1b5260 r4:ef1b5200
    [ 9.173970] [<c0282a14>] (handle_fasteoi_irq) from [<c027e5f8>] (generic_handle_irq+0x2c/0x3c)
    [ 9.173974] r7:00000000 r6:eeb779d8 r5:00000017 r4:c0e5dde0
    [ 9.173980] [<c027e5cc>] (generic_handle_irq) from [<c027eb64>] (__handle_domain_irq+0x64/0xbc)
    [ 9.173986] [<c027eb00>] (__handle_domain_irq) from [<c0201484>] (gic_handle_irq+0x40/0x7c)
    [ 9.173991] r9:eeb76000 r8:fa213000 r7:fa212000 r6:eeb778c8 r5:fa21200c r4:c100342c
    [ 9.173997] [<c0201444>] (gic_handle_irq) from [<c020bfb8>] (__irq_svc+0x58/0x8c)
    [ 9.174000] Exception stack(0xeeb778c8 to 0xeeb77910)
    [ 9.174005] 78c0: c0a03458 00000000 c1050340 00000000 00000202 00000013
    [ 9.174011] 78e0: 00000000 00000000 ef006000 eeb76000 c1072ff0 eeb77974 04208060 eeb77918
    [ 9.174015] 7900: c02330fc c0232c18 60010113 ffffffff
    [ 9.174020] r9:eeb76000 r8:ef006000 r7:eeb778fc r6:ffffffff r5:60010113 r4:c0232c18
    [ 9.174028] [<c0232b6c>] (__do_softirq) from [<c02330fc>] (irq_exit+0xec/0x148)
    [ 9.174034] r10:c1072ff0 r9:eeb76000 r8:ef006000 r7:00000000 r6:00000000 r5:00000013
    [ 9.174036] r4:c0e5dde0
    [ 9.174042] [<c0233010>] (irq_exit) from [<c027eb68>] (__handle_domain_irq+0x68/0xbc)
    [ 9.174048] [<c027eb00>] (__handle_domain_irq) from [<c0201484>] (gic_handle_irq+0x40/0x7c)
    [ 9.174053] r9:eeb76000 r8:fa213000 r7:fa212000 r6:eeb779d8 r5:fa21200c r4:c100342c
    [ 9.174058] [<c0201444>] (gic_handle_irq) from [<c020bfb8>] (__irq_svc+0x58/0x8c)
    [ 9.174061] Exception stack(0xeeb779d8 to 0xeeb77a20)
    [ 9.174065] 79c0: 00000000 00000000
    [ 9.174070] 79e0: 00000001 60010013 c105c1dc 00000000 0000003e 00000000 00000000 00000192
    [ 9.174075] 7a00: c1072ff0 eeb77a94 eeb77960 eeb77a28 c05a2e3c c027cce8 60010013 ffffffff
    [ 9.174080] r9:eeb76000 r8:00000000 r7:eeb77a0c r6:ffffffff r5:60010013 r4:c027cce8
    [ 9.174086] [<c027c9a8>] (console_unlock) from [<c027d310>] (vprintk_emit+0x2e8/0x4c0)
    [ 9.174091] r10:00000000 r9:c1053070 r8:c1017220 r7:00000006 r6:00000006 r5:00000000
    [ 9.174093] r4:0000002e
    [ 9.174101] [<c027d028>] (vprintk_emit) from [<c061e510>] (dev_vprintk_emit+0xa8/0x1c4)
    [ 9.174107] r10:eeb77bd4 r9:c0be2394 r8:00000006 r7:c0bd0924 r6:00000010 r5:eeb77b08
    [ 9.174109] r4:ee1c1c38
    [ 9.174116] [<c061e468>] (dev_vprintk_emit) from [<c061e654>] (dev_printk_emit+0x28/0x30)
    [ 9.174121] r10:00000000 r9:d9040000 r8:024000c0 r7:ee1c1c28 r6:00000100 r5:eeb77c08
    [ 9.174123] r4:00000006
    [ 9.174130] [<c061e630>] (dev_printk_emit) from [<c061e6b8>] (__dev_printk+0x5c/0x90)
    [ 9.174133] r3:bf0b584c r2:c0be2394
    [ 9.174140] [<c061e65c>] (__dev_printk) from [<c061e97c>] (_dev_info+0x40/0x48)
    [ 9.174143] r5:ee2cfb40 r4:00000001
    [ 9.174158] [<c061e940>] (_dev_info) from [<bf0b4d70>] (rpmsg_probe+0x2b8/0x41c [virtio_rpmsg_bus])
    [ 9.174162] r3:00000000 r2:00000000 r1:bf0b5770
    [ 9.174175] [<bf0b4ab8>] (rpmsg_probe [virtio_rpmsg_bus]) from [<c056ab9c>] (virtio_dev_probe+0x20c/0x2f0)
    [ 9.174181] r10:00000001 r9:00000020 r8:bf0b5874 r7:ee1c1c28 r6:ee1c1c38 r5:00000000
    [ 9.174183] r4:00000000
    [ 9.174190] [<c056a990>] (virtio_dev_probe) from [<c0622c6c>] (driver_probe_device+0x240/0x2e0)
    [ 9.174195] r10:00000000 r9:00000013 r8:bf0b5874 r7:00000000 r6:00000000 r5:c108e7fc
    [ 9.174197] r4:ee1c1c38
    [ 9.174202] [<c0622a2c>] (driver_probe_device) from [<c0622ea0>] (__device_attach_driver+0x9c/0xb4)
    [ 9.174208] r9:00000000 r8:c108e7d8 r7:00000001 r6:ee1c1c38 r5:eeb77d58 r4:bf0b5874
    [ 9.174215] [<c0622e04>] (__device_attach_driver) from [<c0620ebc>] (bus_for_each_drv+0x68/0x9c)
    [ 9.174219] r7:00000001 r6:c0622e04 r5:eeb77d58 r4:00000000
    [ 9.174228] [<c0620e54>] (bus_for_each_drv) from [<c0622908>] (__device_attach+0xb8/0x11c)
    [ 9.174231] r6:c1028040 r5:ee1c1c6c r4:ee1c1c38
    [ 9.174238] [<c0622850>] (__device_attach) from [<c0622ecc>] (device_initial_probe+0x14/0x18)
    [ 9.174242] r7:00000000 r6:c1028040 r5:ee1c1c38 r4:ee1c1c40
    [ 9.174249] [<c0622eb8>] (device_initial_probe) from [<c0621f28>] (bus_probe_device+0x8c/0x94)
    [ 9.174256] [<c0621e9c>] (bus_probe_device) from [<c0620098>] (device_add+0x3f8/0x580)
    [ 9.174260] r7:00000000 r6:ee172020 r5:ee1c1c38 r4:ee1c1c40
    [ 9.174268] [<c061fca0>] (device_add) from [<c062023c>] (device_register+0x1c/0x20)
    [ 9.174273] r10:ee17221c r9:ee1c1c04 r8:ee172020 r7:ee1c1c28 r6:ee1c1c38 r5:bf0a29e8
    [ 9.174275] r4:ee1c1c38
    [ 9.174283] [<c0620220>] (device_register) from [<c056a778>] (register_virtio_device+0xb4/0x104)
    [ 9.174286] r5:bf0a29e8 r4:ee1c1c28
    [ 9.174306] [<c056a6c4>] (register_virtio_device) from [<bf0a2f40>] (rproc_add_virtio_dev+0x78/0xfc [remoteproc])
    [ 9.174310] r7:ee1c1c28 r6:00000007 r5:ee172020 r4:ee1c1c00
    [ 9.174337] [<bf0a2ec8>] (rproc_add_virtio_dev [remoteproc]) from [<bf0a02f4>] (rproc_vdev_do_probe+0x18/0x1c [remoteproc])
    [ 9.174342] r7:00000000 r6:ee1721cc r5:ee1721c4 r4:ee172000
    ***************************************************************[ 9.174369] [<bf0a02dc>] (rproc_vdev_do_probe [remoteproc]) from [<bf0a1fa4>] (__rproc_boot+0x4bc/0x5bc [remoteproc])

    root@am57xx-evm:/opt/ipc# lsmod
    Module Size Used by
    sha512_generic 10031 0
    sha512_arm 12316 0
    sha256_generic 10178 0
    sha1_generic 2928 0
    sha1_arm_neon 6325 0
    sha1_arm 3926 1 sha1_arm_neon
    md5 2219 0
    cbc 2388 0
    xfrm_user 23076 2
    xfrm4_tunnel 2040 0
    ipcomp 2473 0
    xfrm_ipcomp 4631 1 ipcomp
    esp4 6401 0
    ah4 5729 0
    af_key 28188 0
    xfrm_algo 6989 5 xfrm_user,esp4,ah4,af_key,xfrm_ipcomp
    bc_example 7326 0
    bluetooth 335528 2
    xhci_plat_hcd 6411 0
    xhci_hcd 109101 1 xhci_plat_hcd
    rpmsg_proto 6934 0
    dwc3 71573 0
    rpmsg_rpc 19898 0
    udc_core 19450 1 dwc3
    ti_prueth 56895 0
    pru_rproc 10520 1 ti_prueth
    pruss 9774 2 pru_rproc,ti_prueth
    pruss_intc 7227 1 pru_rproc
    snd_soc_omap_hdmi_audio 4737 0
    pvrsrvkm 409225 1 bc_example
    c_can_platform 6604 0
    c_can 9654 1 c_can_platform
    omap_aes_driver 19101 0
    can_dev 13163 1 c_can
    omap_sham 21602 0
    omap_wdt 4634 0
    ti_vpe 18826 0
    ti_sc 24305 1 ti_vpe
    dwc3_omap 5196 0
    ti_csc 2351 1 ti_vpe
    ti_vpdma 15102 1 ti_vpe
    extcon_core 16896 2 dwc3_omap,dwc3
    omap_des 11525 0
    des_generic 17608 1 omap_des
    crypto_engine 6458 2 omap_des,omap_aes_driver
    omap_remoteproc 12888 0
    virtio_rpmsg_bus 9674 2 rpmsg_rpc,rpmsg_proto
    rpmsg_core 7252 3 rpmsg_rpc,rpmsg_proto,virtio_rpmsg_bus
    remoteproc 29043 5 pru_rproc,ti_prueth,rpmsg_rpc,omap_remoteproc,rpmsg_proto
    sch_fq_codel 8975 2
    uio_module_drv 7417 0
    uio 9201 1 uio_module_drv
    ftdi_sio 32168 0
    usbserial 25667 1 ftdi_sio
    usbcore 201322 4 ftdi_sio,usbserial,xhci_plat_hcd,xhci_hcd
    usb_common 4737 3 udc_core,usbcore,dwc3
    gdbserverproxy 4667 0
    cryptodev 37775 1
    cmemk 35419 2

  • Hello Roger,

    Let's focus on getting PRU Ethernet working on the DSP first. We can look at IPC questions later.

    1) Which Processor SDK version are you using?

    2) Have you taken a look at our RTOS documentation for the ICSS_EMAC driver?

    3) In the Linux device tree, make sure you disable all the PRU Ethernet related nodes and subnodes. Sometimes I see customers only disabling some of the nodes. Take a look at the post PRU Ethernet Driver Error for an example of the different nodes that you will need to disable.

    Regards,

    Nick

  • 1.   Processor SDK version

         ti-processor-sdk-rtos-am57xx-evm-04.03.00.05-Linux-x86-Install

         ti-processor-sdk-linux-am57xx-evm-04.03.00.05-Linux-x86-Install

    2.  the icss_emac codes int my project

    int
    ncx_ect_drv_tidsp_board_init(void)
    {

    Board_STATUS status;
    Board_initCfg emac_config;

    ncx_ect_drv_tidsp_pinmux_config();

    emac_config = BOARD_INIT_ICSS_ETH_PHY; 
    status = Board_init(emac_config);

    #ifdef _TMS320C6X
    /* Clear pre-fetch bit in MAR to make OCMC un-cacheable */
    Cache_setMar((xdc_Ptr)0x4b000000U, 0x10000U, 0);
    Cache_setMar((xdc_Ptr)0x40000000U, 0x10000U, 0);
    #endif

    return (status !=0) ? (-1) : 0; 
    }

    static int32_t
    ncx_ect_drv_tidsp_emac_init_pur2eth0(ncx_ect_drv_tidsp_emac_t *thiz)
    {
    uint32_t promis_flag;
    ICSS_EmacHandle emac_handle;
    ICSS_EmacObject *emac_object;
    ICSS_EmacHwAttrs *emac_hwattrs;
    ICSS_EmacInitConfig *emac_init_config;
    ICSS_EmacCallBackObject *emac_callback_object;
    ICSS_EmacBaseAddressHandle_T emac_baseaddr;
    ICSSEMAC_IoctlCmd ioctl_params;
    PRUICSS_IntcInitData intc_initdata = PRUSS_INTC_INITDATA;

    thiz->emac_handle = &thiz->emac_config;

    CSL_xbarDspIrqConfigure(1, CSL_XBAR_INST_DSP1_IRQ_76, CSL_XBAR_PRUSS2_IRQ_HOST8); 
    CSL_xbarDspIrqConfigure(1, CSL_XBAR_INST_DSP1_IRQ_77, CSL_XBAR_PRUSS2_IRQ_HOST2); 
    CSL_xbarDspIrqConfigure(1, CSL_XBAR_INST_DSP1_IRQ_78, CSL_XBAR_PRUSS2_IRQ_HOST4); 

    /* 获取本地的MAC Address信息 */
    ncx_ect_drv_tidsp_emac_get_adderss(thiz, 0);

    emac_init_config = &thiz->emac_init_config;
    emac_init_config->phyAddr[0] = BOARD_ICSS_EMAC_PORT0_PHY_ADDR;
    emac_init_config->portMask = ICSS_EMAC_MODE_MAC1;
    emac_init_config->ethPrioQueue = ICSS_EMAC_QUEUE1;
    emac_init_config->halfDuplexEnable = 1;
    emac_init_config->enableIntrPacing = ICSS_EMAC_DISABLE_PACING;
    emac_init_config->ICSS_EmacIntrPacingMode = ICSS_EMAC_INTR_PACING_MODE1;
    emac_init_config->pacingThreshold = 100;
    emac_init_config->learningEn = 0;
    emac_init_config->macId = thiz->emac_adderss;
    emac_init_config->linkIntNum = 76;
    emac_init_config->rxIntNum = 77;
    emac_init_config->txIntNum = 78;
    emac_init_config->ICSS_EmacTTSEnableCycPktInterrupt = 0;

    emac_callback_object = &thiz->emac_callback_object; 
    emac_callback_object->learningExCallBack = &thiz->emac_callback_learning;
    emac_callback_object->rxRTCallBack = &thiz->emac_callback_rxrt;
    emac_callback_object->rxCallBack = &thiz->emac_callback_rx;
    emac_callback_object->txCallBack = &thiz->emac_callback_tx;

    emac_object = &thiz->emac_object;
    emac_object->pruIcssHandle = thiz->icss_handle;
    emac_object->emacInitcfg = &thiz->emac_init_config;
    emac_object->callBackHandle = &thiz->emac_callback_object;
    emac_object->macTablePtr = thiz->hash_table;
    emac_object->pruStat = thiz->pru_statistics;
    emac_object->hostStat = thiz->host_statistics;
    emac_object->stormPrevPtr = thiz->storm_prevention;

    emac_hwattrs = &thiz->emac_hwattrs;
    emac_baseaddr = &thiz->emac_baseaddr_config;
    emac_hwattrs->emacBaseAddrCfg = emac_baseaddr;

    /* 获取EMAC的基地址信息 */
    ICSS_EmacSocGetInitCfg(1, emac_baseaddr);

    /* 初始化网卡 */
    emac_handle = &thiz->emac_config;
    emac_handle->object = emac_object;
    emac_handle->hwAttrs = emac_hwattrs;
    ICSS_EmacInit(emac_handle, &intc_initdata, ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);

    /* 设置网卡的接收函数 */
    ICSS_EmacRegisterHwIntRx( emac_handle, 
    (ICSS_EmacCallBack)ncx_ect_drv_tidsp_emac_pktrx_cb
    );

    /* 设置网卡为混杂模式 */
    promis_flag = 1; 
    ioctl_params.command = 0;
    ioctl_params.ioctlVal = (void *)(&promis_flag);

    ICSS_EmacIoctl( emac_handle, 
    ICSS_EMAC_IOCTL_PROMISCUOUS_CTRL, 
    ICSS_EMAC_PORT_1, 
    &ioctl_params
    );

    ICSS_EmacIoctl( emac_handle, 
    ICSS_EMAC_IOCTL_PROMISCUOUS_CTRL, 
    ICSS_EMAC_PORT_2, 
    &ioctl_params
    );

    return 0;
    }


    int 
    ncx_ect_drv_tidsp_emac_init(ncx_ect_drv_tidsp_emac_t *thiz)
    {
    int ret;
    PRUICSS_Config *icss_config;

    /* 获取ICSS配置信息的地址 */
    ret = PRUICSS_socGetInitCfg(&icss_config);
    if (ret != PRUICSS_RETURN_SUCCESS) {
    Log_print1(Diags_EXIT, "<-- ncx_icss_emac init: %d\n", __LINE__);
    return -1;
    }

    /* 根据ICSS配置信息, 创建ICSS的对象实例句柄 */
    thiz->icss_handle = PRUICSS_create( (PRUICSS_Config*)icss_config, 
    PRUICCSS_INSTANCE_TWO);

    /* 初始化PRU2的Eth0 */
    ncx_ect_drv_tidsp_emac_init_pur2eth0(thiz);

    /* 停止PRU */
    PRUICSS_pruDisable(thiz->icss_handle, ICSS_EMAC_PORT_1-1);
    PRUICSS_pruDisable(thiz->icss_handle, ICSS_EMAC_PORT_2-1);

    /* 写PRU的数据区内存 */
    if (ncx_ect_drv_tidsp_emac_init_dmem(thiz) == 0)
    return -1;

    /* 检查PRU的版本 */
    if (ncx_ect_drv_tidsp_emac_test_fwver(thiz) == 0)
    return -1;

    /* 写PUR的指令区内存 */
    if (ncx_ect_drv_tidsp_emac_init_imem(thiz) == 0)
    return -1;

    /* 开启PRU功能 */
    PRUICSS_pruEnable(thiz->icss_handle, ICSS_EMAC_PORT_1-1);
    PRUICSS_pruEnable(thiz->icss_handle, ICSS_EMAC_PORT_2-1);

    return 0;
    }

    my project and test codes file

    0435.dsp1-icss-emac.rar

    3. the device tree that i using

    pruss2_eth: pruss2_eth {
    status = "disabled";

    pruss2_emac0: ethernet-mii0 {
    status = "disabled";
    };

    pruss2_emac1: ethernet-mii1 {
    status = "disabled";
    };
    };

    &pruss_soc_bus2 {
    status = "disabled";

    pruss2: pruss@4b280000 {
    status = "disabled";

    pru2_0: pru@4b2b4000 {
    status = "disabled";
    };

    pru2_1: pru@4b2b8000 {
    status = "disabled";
    };
    };
    };

    &pruss2_mdio {
    status = "disabled";

    pruss2_eth0_phy: ethernet-phy@1 {
    status = "disabled";
    };

    pruss2_eth1_phy: ethernet-phy@3 {
    status = "disabled";
    };
    };

    3250.dts.rar

  • Roger,

    Are you able to run your ICSS_EMAC project on DSP alone, i.e. without Linux running on ARM? Or are you able to run icss_emac RTOS loopback unit test ICSS_EMAC_BasicExample_idkAM572x_wSoCLib_C66Testproject from PDK?

    Any reason you have to stick with the old PLSDK v4.3?

    Regards,

    Garrett

  • the pru2_eth0 can run great in ARM with linux;  so the hardware is ok;

    because of the ARM linux was platform SDK 4.3, if update to latest PDK, i have to do many things on ARM linux.

    but the flow and steps of  dsp ICSS_EMAC are the similar as latest PDk, 

    the focus is that :

    [ 9.173746] WARNING: CPU: 0 PID: 74 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x24c/0x350
    [ 9.173751] 44000000.ocp:L3 Standard Error: MASTER DSP1_MDMA TARGET PRUSS2 (Read Link): At Address: 0x00026000 : Data Access in User mode during Functional access

    it must be some mistake in device tree, the ARM and DSP are interconect the pruicss mem  0x4B2A6000 

  • Hi Roger,

    >>the pru2_eth0 can run great in ARM with linux;

    Can you please confirm if your pru2_eth0 DSP application runs fine without Linux on ARM? And you are having difficulty to get pru2_eth0 up while ARM is running Linux. If this is the case, you may need check if MMU is setup properly, see the note at bottom - http://processors.wiki.ti.com/index.php/IPC_Resource_customTable

    Regards,

    Garrett

  • could you  help me to read the reg(0x4b2A6000---PRUICSS2_CFG) in dsp rtos application.

    when i use HWREG function to read PRUICSS2 CFG REG, there is a warring message occurred additionally.

    so i can not access any PRUICSS CFG REG;

    1. the warring message :

    [ 9.173746] WARNING: CPU: 0 PID: 74 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x24c/0x350
    [ 9.173751] 44000000.ocp:L3 Standard Error: MASTER DSP1_MDMA TARGET PRUSS2 (Read Link): At Address: 0x00026000 : Data Access in User mode during Functional access

    2 . the dsp main.c source :

    Int main(Int argc, Char* argv[])
    {
         unsigned int version;
         Error_Block eb;

         Error_init(&eb);

         version = HWREG(0x4B2A6000) & 0x7ffU;
         

         BIOS_start();

         return (0);
    }

    dsp1.rar

  • Hi

    Do you have issue to  read the reg(0x4b2A6000---PRUICSS2_CFG) in dsp rtos application when Linux is not running?

    Regards,

    Garrett

  • i do not understand why dsp can not read the reg(0x4b2A6000), it is the pruicss cfg register in am57xx;

    what is the means of reading it in dsp rtos application when linux is not running?

    what you want to verification?

  • To access the PRU register (0x4b2A6000) from a standalone DSP application without Linux running in host/ARM (i.e. load/run the application from CCS/JTAG) can help isolate the issue if it's caused by MMU or any mis-configuration in Linux side. Prior to integrating with IPC, the DSP application should be able to run independently.

    Regards,
    Garrett

  • thanks for reply!  the result of test were below:

    1.   the icss_emac example with CCS/JTAG can access the 0x4b2A600;

    2.   it got a mmfault when access  adress 0x4b2A6000 without pruss registers mapping in resource table, the dsp fireware can not run; 

    3.   when pruss registers mapping  in resource table, the dsp can access 0x4b2A600,  the dsp still running, but linux got a warring.

          I guess there were mistakes with configures of crossbar / interconnect / irq / dsp_mdma in the device tree.

    the warring message :

    [ 7.469580] remoteproc remoteproc2: remote processor 40800000.dsp is now up
    [ 7.470378] ------------[ cut here ]------------
    [ 7.470393] WARNING: CPU: 0 PID: 313 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x24c/0x350
    [ 7.470398] 44000000.ocp:L3 Standard Error: MASTER DSP1_MDMA TARGET PRUSS2 (Read Link): At Address: 0x00026000 : Data Access in User mode during Functional access

  • is there a example like this instead of  icss_emac in dsp;

  • Hello Roger,

    We do not currently have an example of IPC between an RTOS DSP and PRU.

    Regards,

    Nick