Other Parts Discussed in Thread: SYSBIOS
您好,
我想问一下CMEM shared memory的问题,我的 DTS,CMEM_allocPool(64kBytes)代码如下:
问题1. 我用DDR 0xa0000000 ~ 0x0c000000,CMEM_allocPool 都成功,CMEM_NONCACHED也设了,只是我host arm端分配好后,将指针传递到DSP,未通过MessageQ put给DSP,DSP写操作后,ARM一直未看到实际的data,感觉有Cache,没有更新。
设置了CMEM_NONCACHED属性的这种情况下,还需要做cache_wb, cache_invalidate操作吗?
还是,必需通过MessageQ put给DSP?也就是MessageQ put除了pass 指针,传递拥有权的同时,也刷了cache吗?
问题2. CMEM 使用了reg = <0x0 0x40500000 0x0 0x100000>;(ARM linux reserved memory)同样设CMEM_NONCACHED了,CMEM_allocPool 都成功。
load DSP firmware正常,但是加载ARM app_host程序时,出现remsg之类的问题,
[ 7965.898889] virtio_rpmsg_bus virtio0: msg received with no recipient
想知道,OCMC_RAM3区域有被IPC主件隐式使用吗?还是说,只要可以Linux reserved了,CMEM_allocPool 指定成功,就肯定可以作为共享内存用?
问题3. 如果设置CMEM_NONCACHED属性有效,是使用CMEM_NONCACHED,还是CACHED后再cache_wb, cache_invalidate操作,性能高一些?应用场景,在一个处理器上RAM分批小块写入后,在另一个处理器上大块读走。
问题4. BIGDATA_BUF_SIZE > 512bytes, 都需要用BIGDATA的user case吗? CMEM_allocPool, HeapMem_alloc的应用本质区别是什么?
问题5. 如果只使用一个以太网口,ARM连PC需要用,可以将此网口用于DSP EMAC的应用吗?
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x0c000000>;
no-map;
status = "okay";
};
cmem_block_mem_1_ocmc3: cmem_block_mem@40500000 {
reg = <0x0 0x40500000 0x0 0x100000>;
no-map;
status = "okay";
};
cmem_block_mem_2_gpmc: cmem_block_mem@01000000 {
reg = <0x0 0x01000000 0x0 0x100000>;
no-map;
status = "okay";
};
};
-------------------------------------------
CMEM_AllocParams cmemAttrs;
cmemAttrs.type = CMEM_HEAP;
cmemAttrs.flags = CMEM_NONCACHED;
cmemAttrs.alignment = 0;
printf("--> App_exec:\n");
/* fill process pipeline */
printf("App_exec: sending message\n");
/* allocate message */
msg = (App_Msg *)MessageQ_alloc(Module.heapId, Module.msgSize);
if (msg == NULL) {
status = -1;
goto leave;
}
/* set data size */
msg->dataByteSize = PAYLOADSIZE;
/* alloc cmem memory for input data */
msg->dataIn = CMEM_allocPool(CMEM_getPool(PAYLOADSIZE * sizeof(float)), &cmemAttrs);