The WIKI gives an account of how the CMEM area is allocated:
The DSP side memory layout can be found in the file host_linux/simple_buffer_example/shared/<platform>/config.bld.
Also note the addition of the following section in host_linux/simple_buffer_example/shared/<platform>/rsc_table_dsp.h.
Please note the reserved carve-out in the DSP resource table:
/* NOTE: Make sure this matches what is configured in the linux device tree */
define DSP_CMEM_IOBUFS 0xA0000000
define PHYS_CMEM_IOBUFS 0xA0000000
define DSP_CMEM_IOBUFS_SIZE (SZ_1M * 192)
The CMEM area allocated from this region is used for the big data buffers.
Also...
NOTE: The size of the big data buffer is configurable compile time by changing value of the define BIGDATA_SIZE in shared/AppCommon.h
In troubleshooting this, my question at the moment is - is there any way I can see how this reserved carved-out is configured in the linux device tree as per the WIKI recommendation on the 3rd line? I guess the WIKI assumes I have that know-how already which, sadly, I don't.
I haven't changed anything in the config.bld or rsc_table_dsp.h yet so the values correspond to the WIKI.
The config.bld shows both EXT_CODE and EXT_DATA being allocated a length of 0x1000000 so I'm not sure which one is causing my error. It probably doesn't matter too much at this point:
var evmDRA7XX_ExtMemMapDsp = {
EXT_CODE: {
name: "EXT_CODE",
base: 0x95000000,
len: 0x00100000,
space: "code",
access: "RWX"
},
EXT_DATA: {
name: "EXT_DATA",
base: 0x95100000,
len: 0x00100000,
space: "data",
access: "RW"
},
Any help much appreciated.
Thanks,
Dermot
The physical location where the M4 code/data will actually reside is defined by the CMA carveout. To change this location, you must change the definition of the carveout. The M4 carveouts are defined in the Linux dts file. For example for the AM57xx EVM:
linux/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
ipu2_cma_pool: ipu2_cma@95800000 { compatible = "shared-dma-pool"; reg = <0x0 95800000 0x0 0x3800000>; reusable; status = "okay"; }; ipu1_cma_pool: ipu1_cma@9d000000 { compatible = "shared-dma-pool"; reg = <0x0 9d000000 0x0 0x2000000>; reusable; status = "okay"; }; };
You are able to change both the size and location. Be careful not to overlap any other carveouts!
Note: The two location entries for a given carveout must be identical!
Additionally, when you change the carveout location, there is a corresponding change that must be made to the resource table. For starters, if you're making a memory change you will need a custom resource table. The resource table is a large structure that is the "bridge" between physical memory and virtual memory. This structure is utilized for configuring the IPUx_MMU (not the Unicache MMU). There is detailed information available in the article IPC Resource customTable.
Once you've created your custom resource table, you must update the address of PHYS_MEM_IPC_VRING to be the same base address as your corresponding CMA.
#if defined(VAYU_IPU_1) #define PHYS_MEM_IPC_VRING 0x9D000000 #elif defined (VAYU_IPU_2) #define PHYS_MEM_IPC_VRING 0x95800000 #endif
Note: The PHYS_MEM_IPC_VRING definition from the resource table must match the address of the associated CMA carveout!
dsp1_cma_pool: dsp1_cma@99000000 {
compatible = "shared-dma-pool";
reg = <0x0 0x99000000 0x0 0x4000000>;
reusable;
status = "okay";
};