Writing DSPLink Application using PROC read and write APIs

From Texas Instruments Wiki
Jump to: navigation, search

END OF LIFE

DSP Link is still available for download, but no further releases or updates are planned. Please see IPC Software Options for details and alternatives.

Writing a DSPLink application using PROC_read and PROC_write APIs

An extremely simple way of transferring data between the GPP and DSP is using the PROC_read and PROC_write APIs. The ProgrammersGuide.pdf document (Getting started with writing applications) contains information useful for applications to choose the appropriate DSPLink modules for their application scenarios. The section on Static buffer system with minimal control communication with the DSP gives an application scenario for which PROC_read & PROC_write would be useful.

To use this method, the steps detailed below need to be followed. The details below refer to the DM6446 platform for DSPLink release 1.6x, but they are applicable to other platforms also. When using below instructions for other platforms, please ensure that the entry number does not overlap with an existing entry and the memory address is platform specific. Also, please note that instructions related to location and changes in the configuration file will differ when DSPLink is used within Codec Engine. These instructions are applicable when using DSPLink 'raw'.

  • Modify the configuration file in DSPLink directly: $(DSPLINK)/config/all/CFG_Davinci_DM6446.c

Reserve two regions of memory in LINKCFG_memTable_00 (add two more entries). For example, to transfer 1MB data to and fro between ARM and DSP, add the following entries:

    {
        6,                     /* ENTRY          : Entry number */
        "WRITEMEM",            /* NAME           : Name of the memory region */
        0x8FC00000,            /* ADDRPHYS       : Physical address */
        0x8FC00000,            /* ADDRDSPVIRT    : DSP virtual address */
        (Uint32) -1,           /* ADDRGPPVIRT    : GPP virtual address (if known) */
        0x100000,              /* SIZE           : Size of the memory region */
        FALSE,                 /* SHARED         : Shared access memory? */
        FALSE,                 /* SYNCD          : Synchornized? */
 
    },
    {
        7,                     /* ENTRY          : Entry number */
        "READMEM",             /* NAME           : Name of the memory region */
        0x8FD00000,            /* ADDRPHYS       : Physical address */
        0x8FD00000,            /* ADDRDSPVIRT    : DSP virtual address */
        (Uint32) -1,           /* ADDRGPPVIRT    : GPP virtual address (if known) */
        0x100000,              /* SIZE           : Size of the memory region */
        FALSE,                 /* SHARED         : Shared access memory? */
        FALSE,                 /* SYNCD          : Synchornized? */
    }
  • In your Linux bootargs, reserve further 2 MB for this. So, if you were specifying mem=254M earlier, now specify mem=252M.
  • In the DSP-side TCI file, reserve these two regions of memory, to ensure that they are not used by anything else.

In $(DSPLINK)/dsp/inc/DspBios/Davinci/DM6446/dsplink-davinci-base.tci, add:

/* MEM : WRITEMEM */
var WRITEMEM = prog.module("MEM").create("WRITEMEM");
WRITEMEM.base             = 0x8FC00000;
WRITEMEM.len              = 0x100000;
WRITEMEM.createHeap       = false;
WRITEMEM.comment          = "WRITEMEM";
 
/* MEM : READMEM */
var READMEM = prog.module("MEM").create("READMEM");
READMEM.base             = 0x8FD00000;
READMEM.len              = 0x100000;
READMEM.createHeap       = false;
READMEM.comment          = "READMEM";
  • Finally, in your application, use PROC_read() and PROC_write() to directly write to and read from these addresses. For example, ARM can send data to DSP by using buffer WRITEMEM, and DSP can send data to ARM by using buffer READMEM.
  • To send notification of available buffer, if it is infrequently required, the NOTIFY module can be used, which can send a 32-bit value with the notification.
  • To be able to send frequent messages of variable size, the MSGQ module can be used.