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.

Hyperlink virtual address support

Hi everyone

I have worked on Hyperlink and I use exmpl project from pdk keystone.  I added exmpl project to my own project. 

Current exmpl work in internal oddress of dsp and all variables are mapped in internal ram.

But when I add exmpl to my project, All varables value is mapped in external DDR memory and it should be there. But in this situation, hyperlink example doesnt work because of control that at below

#ifndef _VIRTUAL_ADDR_SUPPORT
if ((globalAddr >= 0x800000) && (globalAddr < 0xa00000)) {
/* Address is in L2 */
globalAddr |= 0x10000000 | (DNUM << 24);
} else {
System_printf ("Don't know how to make global address for 0x%08x\n", globalAddr);
}
#endif

I tried to open _VIRTUAL_ADDR_SUPPORT but some funtions and variable such as mmap, munmap,sysconf ,_SC_PAGE_SIZE havent any sour code.

#ifdef _VIRTUAL_ADDR_SUPPORT
uint32_t virt_addr;
uint32_t page_size;
page_size = sysconf(_SC_PAGE_SIZE);
if (size%page_size)
{
printf("Size does not align with page size. Size given: %d\n", size);
return 0;
}
if ((uint32_t)addr % page_size)
{
printf("Address does not align with page size. Address given: 0x%08x\n", (uint32_t) addr);
return 0;
}
virt_addr = (uint32_t) mmap(0, size, (PROT_READ|PROT_WRITE), MAP_SHARED, dev_mem_fd, (off_t)addr);
if (virt_addr == -1)
{
printf("mmap failed!\n");
return 0;
}
return virt_addr;

 

I searched that variables and functions in runtime directory but I cant find it.

Are there any source code in pdk keystone?

Thanks

  • Hi,

    I think these variables(such as mmap, munmap,sysconf ,_SC_PAGE_SIZE) are support only on linux envireonment. TI not provide linux based hyperlink example.

    If the remote device wants to access the semaphore module, the HyperLink configuration register must be appropriately configured, so the remote device can send transactions with the desired privID value to the local semaphore module.

    Better to use L2 memory for your project.

    Thanks,

  • Thanks but I have to use DDR memory because of L2SRAM is full I dont have access to L2SRAM.

    I changed conf of tx and rx side like below

    /* This is "my side" */
    TXAddrOvly.txSecOvl = 0; /* Ignore the secure bit */
    TXAddrOvly.txPrivIDOvl = 12; /* Put privid in the MS 4 bits of address */
    TXAddrOvly.txIgnMask = 11; /* Open 128MB window (which is common on all hyperlinks on all devices) */
    /* This is the "other side" (but it is me, because of loopback) */
    RXAddrSel.rxSecHi = 0; /* Don't care about secure */
    RXAddrSel.rxSecLo = 0; /* Don't care about secure */
    RXAddrSel.rxSecSel = 0; /* Don't care about secure */
    RXAddrSel.rxPrivIDSel = 12; /* Symmetric with TXAddrOvly.txPrivIDOvl */
    RXAddrSel.rxSegSel = 12 ; /* Make segments of 256MB each */
    /* Make PrivID transparent */
    for (i = 0; i < hyplnk_RX_PRIVID_TBL_ENTS; i++) {
    RXPrivIDs[i].rxPrivIDVal = i;
    }
    /* Make one segment which can see dataBuffer */
    #ifndef _VIRTUAL_ADDR_SUPPORT
    if ((globalAddr >= 0x800000) && (globalAddr < 0xa00000)) {
    /* Address is in L2 */
    globalAddr |= 0x10000000 | (DNUM << 24);
    } else {
    System_printf ("Don't know how to make global address for 0x%08x\n", globalAddr);
    }
    #endif

    /* Align to 4MB */
    globalAddrBase = globalAddr & ~0xfffffff;
    globalAddrOffset = globalAddr & 0xfffffff;
    RXSegs[0].rxSegVal = globalAddrBase >> 28; /* 256MB */
    RXSegs[0].rxLenVal = 27; /*256*/

    In couclusiion dataBuffer of tx side is mapped 0xA5895C18 in DDR memory and remote side is mapped 0x45895C18

    But I cant write "token"  value to remote->srcRem2Loc.value. There should be confg problem. 

    Have you any suggestion about verify configration ?

    Thanks

  • Also I realized that I should set some regs for using DDR memory regions

    * If this is placed in MSMC or DDR RAM, then the SMS
    * or SES MPAX must be configured to allow the access.

     

    How can I set that for this problem?

     


    Thanks