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.

get physical address in dsp/ipc 3.x on AM572x

Dear all,

Does sys/bios provide any function to convert virtual address to physical address, if I want to accress physical address?

My platform is AM572x (GP board) and use ti-processor-sdk-linux-am57xx-evm-02.00.00.00-Linux-x86-Install.bin and ti-processor-sdk-rtos-am57xx-evm-02.00.00.00-Linux-x86-Install.bin.

I use ipc 3.x on dsp side.

I want to access io address and ddr ram address.

  • Hi,

    I will ask the RTOS team to look at this.
  • Hi Biser,

    Another method is that it can disable dsp mmu when load remoteproc kernel module.

    Disable dsp mmu or convert virtual address to physical address function can help me for my purpose.

    Thank you.

  • Hi descent,

    DSP has 1:1 virtual to physical memory translation defined in ./packages/ti/ipc/remoteproc/rsc_table_vayu_dsp.h. You can refer to
    processors.wiki.ti.com/.../IPC_Resource_customTable to add your own memory translation.

    The MMU pagetable can be dumped through debugfs - "cat /sys/kernel/debug/omap_iommu/<iommu_name>/pagetable"

    Regards,
    Garrett
  • Hi Garrett,


    If DSP has 1:1 virtual to physical memory translation, I can see the variable (that dsp wrote) in arm/linux side.

    I do the test:

    DSP code:

      UInt32 obj;
    
      obj=0x12345678;
      System_printf("&obj: %x, obj: %d\n", &obj, obj);
      while(1)
      {
        obj=0x12345678;
        System_printf("&obj: %x, obj: %x\n", &obj, obj);
      }
    

    Then I use devmem (busybox tool can access physical address) to watch the obj address (&obj is 0x95140b1c) value in arm/linux side, but it is not 0x12345678.

    Something wrong?

  • Hi descent,

    In your test case, the obj is cached in DSP L1/L2, so you need write back to DDR for ARM access.

    In addition, I think I should make it clear in my previous post that 1:1 mapping is valid for 0x4Axx_xxxx, 0x48xx_xxxx...as defined in rsc_table_vayu_dsp.h. For DDR adddress, the virt. to phys. addresses mapping is actually as:

    root@am57xx-evm:/sys/kernel/debug/omap_iommu# cat 40d01000.mmu/pagetable
    L:      da:     pte:
    --------------------------
    1: 0x80000000 0xba300002
    1: 0x80100000 0xba400002
    ....
    1: 0x95000000 0x99100002
    1: 0x95100000 0x99200002
    1: 0x95200000 0x99300002
    1: 0x95300000 0x99400002
    1: 0x95400000 0x99500002
    1: 0x9f000000 0x99600002

    The highest 12-bit is the base address, so to access 0x95140b1c, you need to check from ARM/Linux with "devmem2 0x99240b1c".

    Regards,
    Garrett