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.

Linux/TDA2PXEVM: How to get physical address of IPU memory space in hlos usecase

Part Number: TDA2PXEVM

Tool/software: Linux

Hi,

I could not find the api of virtual2phy of IPU FW in Linux platform or IPU MMU mapping table.

I assume that it can be ChainsCommon_Osal_getPhysAddr(), but its return value is the same as virtual address.

What can the IPU memory address 0x9a5b2160 be mapped to physical address?

 Thanks.

  • Hi Kim,

    You are right, you can use ChainsCommon_Osal_getPhysAddr () to get physical address. On IPU both physical and virtual will be same.

    Regards,
    Sujith
  • Hi Kim,

    On IPU, we typically use one to one mapping. this might be reason why you are getting same address. Are you seeing any issue with this?

    Typically we use Osal_getPhys API on Linue, since there is difference in userspace virtual address and physical address.. 

    Regards,

    Brijesh 

  • Hi All,

    The problem is that IPU FW memory which has ldc mesh table is NOT updated at physical memory?
    Mesh table was filled with 0x00 and output was 0x00 when printf by IPU. But memory dump by DCC tuning tool was NOT 0x00.

    There is SMMU (io mmu) or address offset in ISS bus, or there is cache sync issues in IPU?

    Thanks.
  • Hi Kim,

    How are you transferring table from Tuning tool? There is a reserved memory for Ldc Lut.
    The other way you could do is, copy the lut into existing table and use it. Please note that this requires rebuilding vision sdk.

    Rgds,
    Brijesh
  • Hi Brijesh,

    There was addressing offset of 0x30_0000 in IPU. It worked well after modifying as below.

    ldcCfg->lutCfg.address = (UInt32)&gChainsCommonIssLdcTable_1920x1080[0] + 0x300000;

    I found it by scanning whole physical memory space. I could not find related source code.
    I assume that linear MMU mapping was used with some offset to remove adressing halls between internal SRAM of IPU and other memories such as external DDR or SRAMs of other subsystems.

    Can you explain the reason of 0x30_0000 and where the code is?

    Thanks.
  • Hi Kim,

    The Lut is for the 1080p resolution, but for smaller resolution, we actually use the center portion from this Lut. So it finds offset into the Lut and then assigns it to LDC.
    You could this code in VSDK_3_2\vision_sdk\apps\src\rtos\iss\src\common\iss_utils.c in IssUtils_InitSimcopConfig API

    Rgds,
    Brijesh
  • Hi Brijesh,

    Thanks a lot for your support.

    I assume that you mentioned below code in iss_utils.c. It uses only 1280x720 from 1920x1080 table for 1280x720 resolution camera.
    But my case is 1920x1080 camera and it's nothing to do with addressing offset.

    /* Using LDC Lut table of 1920x1080 size with 4x down scaling factor
    Using LDC table from the offset ((1920x1080) - (1280x720))/2 */
    ldcCfg->lutCfg.address = (UInt32)&gChainsCommonIssLdcTable_1920x1080
    [
    (ISS_UTILS_MESH_TABLE_PITCH(1920,
    (1 <<VPS_ISS_LDC_LUT_DOWN_SCALE_FACTOR_4)) * 15) + 320
    ];

    Thanks.
  • Hi Kim,

    If you have different Lut, you could allocate memory and assign it to address variable of lutCfg. But if you are using same Lut, then currently it is assigned at the offset..
    Either you could copy your Lut to the address of gChainsCommonIssLdcTable_1920x1080 and move lut address to the start of this array or allocate a new memory and copy into it..

    Rgds,
    Brijesh
  • Hi Brijesh,

    LDC is working well after adding addressing offset 0x30_0000 nevertheless changing IPU code size. I could not find the reason of this offset, but I think it should be related with MMU configuration of IPU2.

    Anyway it works, I will clear this ticket.

    Thanks