Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

RTOS/AM5728: Mapping GPMC memory to DSP

Part Number: AM5728
Other Parts Discussed in Thread: TPIC2810

Tool/software: TI-RTOS

     I had a FPGA in my AM5728 board, it  was map to 0X01000000 by GPMC ,size 128k.  I can read regs in it correctly in the linux.

  But I want the dsp1 core to read/write the FPGA too. So ,I change the rsc_table_vayu_dsp.c, add a entry in ti_ipc_remoteproc_ResourceTable

I map the phy  0x01000000 to 0x01000000 virtual address (same), It can be seen in the pagetable.

{
TYPE_DEVMEM,
0x1000000, 0x1000000,
SZ_1M, 0, 0, "FPGA_MEM",
},

root@am57xx-evm:~# cat /sys/kernel/debug/omap_iommu/40d01000.mmu/pagetable
L: da: pte:
--------------------------
1: 0x01000000 0x01000002

But my dsp progam read this address , it case the linux some errors reported. It seem it was not maping it to the real address I want.

 What's wrong ? And what should I do.

  • The RTOS team have been notified. They will respond here.
  • Hello,

    Adding the entry to the resource table is the correct thing to do. Ensure that you have followed all of the steps here:
    processors.wiki.ti.com/.../IPC_Resource_customTable

    If you can share the errors reported by Linux that would be good too.
  • I found out that the error is not case by my dsp program reading the FPGA memory area. 

    Linux kernel report errors when I open the memory bowser in ccs to whatch 0x01000000. 

    Since GPMC of FPGA maping was set to only 128k. Is it memory bowser read more then 128 k that case the error ?

    my dsp program can read FPGA  memory area, but the return value is not the correct value, and is not equal to the memory bowser showing.

    here is the message in linux , testfpga show the correct value that read from FPGA.

    And then, I open the memory bowser in CCS case the kernel reaport the error.

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 


    root@am57xx-evm:~# ./testfpga
    r
    FPGA_ID = 0xA5
    FPGA_WHEELIO = 0xFFFF897F
    FPGA_IOIN = 0xFFFF8900
    FPGA_FKEY = 0xFFFFFFFF
    FPGA_SPLOW = 0x0
    FPGA_SPHIGH = 0x0
    FPGA_SPHIGH = 0
    FPGA_WENCODER = 0
    FPGA_IOOUT = 0xffff8900
    FPGA_CTRL = 0xffff893f
    0
    root@am57xx-evm:~# [ 511.359870] ------------[ cut here ]------------
    [ 511.364524] WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x25c/0x36c
    [ 511.373697] 44000000.ocp:L3 Standard Error: MASTER DSP1_CFG TARGET EVE1 (Read Link): At Address: 0x02620018 : Data Access in User mode during Functional access
    [ 511.388012] Modules linked in: fpga sha512_generic sha512_arm sha256_generic sha1_generic sha1_arm_neon sha1_arm md5 cbc xfrm_user xfrm4_tunnel ipcomp xfrm_ipcomp esp4 8188eu ah4 af_key xfrm_algo bc_example(O) xhci_plat_hcd xhci_hcd rpmsg_proto usbcore dwc3 udc_core usb_common rpmsg_rpc prueth pru_rproc pruss bluetooth snd_soc_omap_hdmi_audio pruss_intc pvrsrvkm(O) ti_vip ahci_platform omap_wdt libahci_platform libahci libata pruss_soc_bus scsi_mod ti_vpe ti_sc ti_csc ti_vpdma cfg80211 brcmutil dwc3_omap c_can_platform c_can can_dev rtc_omap gpio_pisosr rtc_palmas gpio_tpic2810 des_generic ov2659 crypto_engine extcon_palmas extcon_core omap_remoteproc virtio_rpmsg_bus rpmsg_core remoteproc sch_fq_codel uio_module_drv(O) uio gdbserverproxy(O) cryptodev(O) cmemk(O)
    [ 511.456513] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G O 4.9.28-geed43d1050 #1
    [ 511.464724] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 511.470841] Backtrace:
    [ 511.473316] [<c020b29c>] (dump_backtrace) from [<c020b558>] (show_stack+0x18/0x1c)
    [ 511.480921] r7:00000009 r6:600e0193 r5:00000000 r4:c1022450
    [ 511.486608] [<c020b540>] (show_stack) from [<c04c9f40>] (dump_stack+0x8c/0xa0)
    [ 511.493865] [<c04c9eb4>] (dump_stack) from [<c022dcf0>] (__warn+0xec/0x104)
    [ 511.500857] r7:00000009 r6:c0bbfe50 r5:00000000 r4:c1001d10
    [ 511.506543] [<c022dc04>] (__warn) from [<c022dd48>] (warn_slowpath_fmt+0x40/0x48)
    [ 511.514060] r9:00000007 r8:ef21c050 r7:c0bc0150 r6:00000004 r5:c0bbfd70 r4:c0bbfe20
    [ 511.521840] [<c022dd0c>] (warn_slowpath_fmt) from [<c04f9df0>] (l3_interrupt_handler+0x25c/0x36c)
    [ 511.530750] r3:ef216e80 r2:c0bbfe20
    [ 511.534339] r4:80080001
    [ 511.536888] [<c04f9b94>] (l3_interrupt_handler) from [<c027f270>] (__handle_irq_event_percpu+0xb4/0x138)
    [ 511.546412] r10:c101a33d r9:ef218b00 r8:00000016 r7:c1001e34 r6:00000000 r5:ef218b00
    [ 511.554273] r4:ef21c340
    [ 511.556820] [<c027f1bc>] (__handle_irq_event_percpu) from [<c027f318>] (handle_irq_event_percpu+0x24/0x60)
    [ 511.566516] r10:c10030ac r9:c1000000 r8:ef008000 r7:00000000 r6:c1022630 r5:ef218b00
    [ 511.574378] r4:ef218b00
    [ 511.576924] [<c027f2f4>] (handle_irq_event_percpu) from [<c027f394>] (handle_irq_event+0x40/0x64)
    [ 511.585833] r5:ef218b60 r4:ef218b00
    [ 511.589427] [<c027f354>] (handle_irq_event) from [<c0282a28>] (handle_fasteoi_irq+0xc0/0x190)
    [ 511.597989] r7:00000000 r6:c1022630 r5:ef218b60 r4:ef218b00
    [ 511.603676] [<c0282968>] (handle_fasteoi_irq) from [<c027e498>] (generic_handle_irq+0x2c/0x3c)
    [ 511.612325] r7:00000000 r6:00000000 r5:00000016 r4:c0e5bd88
    [ 511.618010] [<c027e46c>] (generic_handle_irq) from [<c027ea20>] (__handle_domain_irq+0x64/0xbc)
    [ 511.626748] [<c027e9bc>] (__handle_domain_irq) from [<c02014a0>] (gic_handle_irq+0x40/0x7c)
    [ 511.635137] r9:c1000000 r8:fa213000 r7:fa212000 r6:c1001ef0 r5:fa21200c r4:c1003424
    [ 511.642914] [<c0201460>] (gic_handle_irq) from [<c020c078>] (__irq_svc+0x58/0x8c)
    [ 511.650427] Exception stack(0xc1001ef0 to 0xc1001f38)
    [ 511.655500] 1ee0: 00000001 00000000 fe600000 00000000
    [ 511.663715] 1f00: c1000000 c100303c 00000001 c10030a4 00000000 00000000 c10030ac c1001f4c
    [ 511.671928] 1f20: c1001f2c c1001f40 c0220814 c02086f4 600e0013 ffffffff
    [ 511.678572] r9:c1000000 r8:00000000 r7:c1001f24 r6:ffffffff r5:600e0013 r4:c02086f4
    [ 511.686355] [<c02086cc>] (arch_cpu_idle) from [<c08cc4cc>] (default_idle_call+0x28/0x34)
    [ 511.694484] [<c08cc4a4>] (default_idle_call) from [<c026e170>] (cpu_startup_entry+0x1b4/0x230)
    [ 511.703141] [<c026dfbc>] (cpu_startup_entry) from [<c08c77f4>] (rest_init+0x8c/0x90)
    [ 511.710915] r7:ffffffff
    [ 511.713465] [<c08c7768>] (rest_init) from [<c0e00d80>] (start_kernel+0x3e0/0x3ec)
    [ 511.720979] r5:00000000 r4:c105004c
    [ 511.724571] [<c0e009a0>] (start_kernel) from [<80008090>] (0x80008090)
    [ 511.731124] ---[ end trace f39c0056a8705982 ]---

  • I fix the problem by chang the virtual address t0 0x11000000 (phy of GPMC is 0x01000000).
    Now I can read /write FPGA.
    why virtual address 0x0100000 is not use able?
  • Hi, Biao,

    I'm glad that your issue is resolved.

    The linux error of l3_noc traces only can print limited information based on the bus transactions. One cannot tell which peripheral exactly, but the initiator port and the destination port. If you see a Standard Error instead of a Custom error, you can at least see an offset of the address you are accessing. In this case, it is 0x02620018 from DSP1_CFG which causes a READ violation. It's possible that it read beyond the MMU allows.

    By looking at the DSP memory map, it could be that 0x0100 0000 is used by DSP internally.

    Please click "Resolved" if the issue is resolved. If you have other issues/questions, please open a new thread. Thanks!

    Rex