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.

MPAX Initialization



Hi

On Keystone II how do we initialize the MPAX registers before we run a DSP image? I am using mpmcl to load and run the DSP image.

All our code will be placed in DDR3B, however I need to reconfigure MPAX Section 1 before I can even start to execute any code in DDR3B.

  • Hi,

    MPAX is explained in http://www.ti.com/lit/ug/sprugw7a/sprugw7a.pdf section 2.2. Could you look at it?

    Regards, Eric

  • Hi Eric,

    I have read section 2.2 about MPAX so I know what values I want to put into the registers. I have also created a small test program that is loaded purly into L2SRAM to verify the MPAX register configuration. In this test program I have created a function which configures the MPAX registers. This all works fine when everything is in L2SRAM, the problem comes when you create a dsp image where everything is loaded into DDR3B memory.

    When everything is loaded into DDR3B memory even the ELF entry point, then I need to configure the MPAX register even before the DSP reaches the entry point. Is this possible?

    Or do I have to make sure that the entry point is always loaded in L2SRAM and somehow run my MPAX configuration function before jumping to the rest of the code which is located in DDR3B?

  • I have found a solution to the mpax register configuration now. These are the steps I needed to do.

    1. Create a function that configures the mpax registers

    void mpax_init(void)
    {
      ... set the correct registers ...
    }

    2. Create a section for the function so we can place it where we want with a linker script.

    #pragma CODE_SECTION(mpax_init, ".init")

    3. Add the xdc.runtime.Startup module and hook in the function as early as possible using the resetFxn variable.

    var Startup = xdc.useModule('xdc.runtime.Startup');
    Startup.resetFxn = "&mpax_init";

    4. Make sure the initial stack is located in L2SRAM

    Program.sectMap[".stack"] = "L2SRAM";

    5. Make sure that the entry point as well as our function are placed in L2SRAM by using a linker cmd file

    SECTIONS
    {
        .text:_c_int00         >    L2SRAM
        .text:xdc_runtime_Startup_reset__I > L2SRAM
        .init                  >    L2SRAM
    }

    With all these steps in place I get a DSP elf image with an entry point in L2SRAM and the code path will not leave L2SRAM until after the mpax registers are initialized. The overall goal of all this is to load all the DSP code into DDR3B on the Keystone II platform.