Hi,
I have been trying to off-load the initialization- and configuration-related functions to DDR3 in my project. Most of the time simply adding this to the code
#pragma CODE_SECTION(the_function_name, ".big_mem");
is enough to free up some space in L2SRAM, which is where .text is placed, according to my .cmd file:
SECTIONS
{
.init_array > L2SRAM
.text > L2SRAM
.stack > L2SRAM
.bss > L2SRAM
.cinit > L2SRAM
.cio > L2SRAM
.const > L2SRAM
.data > L2SRAM
.switch > L2SRAM
.sysmem > L2SRAM
.far > L2SRAM
.ppdata > L2SRAM
.big_mem: load >> DDR3
}
However, inspecting the memory map file when doing the above for the SrioDevice_init() function available in pdk_C6670_1_1_2_6/packages/ti/drv/srio/device/device_srio_loopback.c I see a lot of trampoline calls which seem to be eating a big chunk of my L2SRAM memory:
FAR CALL TRAMPOLINES
callee name trampoline name
callee addr tramp addr call addr call info
-------------- ----------- --------- ----------------
$.text:device_srio_loopback.obj$0x1c74 $Tramp$S$$CSL_PSC_isModuleResetIsolationEnabled
0089ac74 802b7810 802b6828 device_srio_loopback.obj (.big_mem)
$.text:device_srio_loopback.obj$0x1c44 $Tramp$S$$CSL_PSC_disableModuleResetIsolation
0089ac44 802b7820 802b6834 device_srio_loopback.obj (.big_mem)
$.text:device_srio_loopback.obj$0x160 $Tramp$S$$CSL_SRIO_GlobalDisable
00899160 802b7830 802b6840 device_srio_loopback.obj (.big_mem)
$.text:device_srio_loopback.obj$0x1c8 $Tramp$S$$CSL_SRIO_DisableBlock
008991c8 802b7840 802b6858 device_srio_loopback.obj (.big_mem)
$.text:device_srio_loopback.obj$0x28 $Tramp$S$$CSL_SRIO_SetBootComplete
00899028 802b7850 802b6874 device_srio_loopback.obj (.big_mem)
802b6de8 device_srio_loopback.obj (.big_mem)
Most, if not all of these trampoline calls are for CSL_xxx_xxx functions, which are declared static inline in their corresponding .h files, so I don't understand how could they be placed in L2SRAM instead of DDR3.
Is there a way to get this code to load in DDR3 without having to add #pragma's to the entire CSL library? I must be missing something.
Maybe the reverse path would be to specify that .stack and .text are to be placed in DDR3 instead, and then use #pragma's only for speed-critical code, placing them in L2SRAM. How should I do it in this case? Should I put any other sections in DDR3 too?