Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Linux: How to comms between DSP and Linux using the resource table on OMAPL138

$
0
0

Tool/software: Linux

Hi there, I am trying to create a design similar to the example shown in the IPC ipc_3_46_00_02

I have added the resource table file to the DSP app and I am able to run the ex02_messageq example.

I have installed the SDK 4.0.0.4 for Linux and also check the DTS filr for the CMA pool its set to 0xc3000000 and there are two buffers at location:

#define RPMSG_VRING0_DA 0xc3000000
#define RPMSG_VRING1_DA 0xc3004000

The problem I have is as follows:

The examples ex02 in the IPC disables the cache for location 0xc3000000 and the whole dsp application is located in the same heap. I want to use cache for DSP app and would like to create a new heap just for IPC comms.

I have modified the resource table with the following:

#define DATA_DA1                0xc5000000

#ifndef DATA_SIZE
# define DATA_SIZE (SZ_1M * 15)
#endif

struct my_resource_table {
struct resource_table base;

UInt32 offset[4];

/* rpmsg vdev entry */
struct fw_rsc_vdev rpmsg_vdev;
struct fw_rsc_vdev_vring rpmsg_vring0;
struct fw_rsc_vdev_vring rpmsg_vring1;

/* data carveout entry */
struct fw_rsc_carveout data_cout;

/* data carveout entry */
struct fw_rsc_carveout data_cout1;

/* trace entry */
struct fw_rsc_trace trace;
};
extern char xdc_runtime_SysMin_Module_State_0_outbuf__A;
#define TRACEBUFADDR (UInt32)&xdc_runtime_SysMin_Module_State_0_outbuf__A
#define TRACEBUFSIZE 0x8000

#pragma DATA_SECTION(ti_ipc_remoteproc_ResourceTable, ".resource_table")
#pragma DATA_ALIGN(ti_ipc_remoteproc_ResourceTable, 4096)

struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
1, /* we're the first version that implements this */
4, /* number of entries in the table */
0, 0, /* reserved, must be zero */
/* offsets to entries */
{
offsetof(struct my_resource_table, rpmsg_vdev),
offsetof(struct my_resource_table, data_cout),
offsetof(struct my_resource_table, data_cout1),
offsetof(struct my_resource_table, trace),
},

/* rpmsg vdev entry */
{
TYPE_VDEV, VIRTIO_ID_RPMSG, 0,
RPMSG_DSP_FEATURES, 0, 0, 0, 2, { 0, 0 },
/* no config data */
},
/* the two vrings */
{ RPMSG_VRING0_DA, 4096, RPMSG_VQ0_SIZE, 1, 0 },
{ RPMSG_VRING1_DA, 4096, RPMSG_VQ1_SIZE, 2, 0 },

{
TYPE_CARVEOUT, DATA_DA, DATA_DA, DATA_SIZE, 0, 0, "DSP_MEM_DATA",
},

{
TYPE_CARVEOUT, DATA_DA1, DATA_DA1, DATA_SIZE, 0, 0, "DSP_MEM_DATA1",
},

{
TYPE_TRACE, TRACEBUFADDR, TRACEBUFSIZE, 0, "trace:dsp",
},
};

That's added extra TYPE_CARVEOUT with address 0xc5000000

and also made similar changes in the DTS Linux file:

reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;

dsp_cma_pool: dsp_cma@c3000000 {
compatible = "shared-dma-pool";
reg = <0xc3000000 0x1000000>;
reusable;
status = "okay";
};
dsp_cma_pool1: dsp_cma_ipc@c5000000 {
compatible = "shared-dma-pool";
reg = <0xc5000000 0x1000000>;
reusable;
status = "okay";
};

};

In the DSP.cfg I have also added :

var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
Cache.MAR192_223 = 0x00000008;

to enable cache only for 0xc3000000 for DSP app and disabled cache for rest (0xc5000000).

When trying to boot DSP from remoteproc I get the following error:

root@omapl138-lcdk:/sys/bus/platform/drivers/davinci-rproc# echo davinci-rproc.0 > bind
davinci-rproc davinci-rproc.0: assigned reserved memory node dsp_cma@c3000000
remoteproc remoteproc0: dsp is available
root@omapl138-lcdk:/sys/bus/platform/drivers/davinci-rproc# remoteproc remoteproc0: powering up dsp
remoteproc remoteproc0: Booting fw image rproc-dsp-fw, size 5604612
davinci-rproc davinci-rproc.0: failed to allocate dma memory: len 0xf00000
remoteproc remoteproc0: Failed to process resources: -12

All I want to do is:

* Implement some heap buffer to be used to comms between DSP and Linux using MessageQ.

Thanks in advance.


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>