Other Parts Discussed in Thread: OMAP-L138, DA8XX
Tool/software: Linux
Hi,
I'm trying to load DSP firmware from Linux where the DSP memory uses L2RAM/IRAM for it's memory locations.
If the memory is placed into DDR it will work, but if any memory is placed within the L2RAM then remoteproc.0 won't load the firmware.
Here is my config.bld
/* * ======== config.bld ======== * */ var Build = xdc.useModule('xdc.bld.BuildEnvironment'); var Pkg = xdc.useModule('xdc.bld.PackageContents'); /* when constructing a release, release everything */ Pkg.attrs.exportAll = true; /* Uncomment this to build the app with debug support */ Pkg.attrs.profile = "debug"; /* bin/ is a generated directory that 'xdc clean' should remove */ Pkg.generatedFiles.$add("bin/"); Build.platformTable["ti.platforms.evmOMAPL138:dsp"] = { externalMemoryMap: [ [ "DDR", { name: "DDR", space: "code/data", access: "RWX", base: 0xC3100000, len: 0x800000, comment: "DSP Program Memory (8 MB)" }] ], codeMemory: "DDR", dataMemory: "DDR", stackMemory: "DDR", l1DMode: "32k", l1PMode: "32k", l2Mode: "0k" }; /* * ======== ti.targets.elf.C674 ======== */ var C674 = xdc.useModule('ti.targets.elf.C674'); C674.ccOpts.suffix += " -mi10 -mo ";
Settings any of the Memory regions to be in the IRAM doesn't work when trying to load the firmware.
Address of the IRAM is 0x18000000 and the size is 0x40000
I have tried the following:
1. Tried adding DEVMEM to the resource table.
{ TYPE_DEVMEM, IRAM_DA, IRAM_DA, IRAM_SIZE, 0, 0, "DSP_IRAM", },
2. Adding a memory pool to the DTS and making a carveout instead in the resource table
reserved-memory { #address-cells = <1>; #size-cells = <1>; ranges; dsp_memory_region: dsp-memory@c3000000 { compatible = "shared-dma-pool"; reg = <0xc3000000 0x1000000>; reusable; status = "okay"; }; dsp_memory_region2: dsp-iram@18000000 { compatible = "shared-dma-pool"; reg = <0x18000000 0x00040000>; reusable; status = "okay"; }; };
{ TYPE_CARVEOUT, IRAM_DA, IRAM_DA, IRAM_SIZE, 0, 0, "DSP_IRAM", },
None of this worked.
I need my DSP memory to reside in IRAM/L2RAM.
Here is the full resource table:
/* * ======== rsc_table_omapl138.h ======== * * Include this table in each base image, which is read from remoteproc on * host side. * */ #ifndef _RSC_TABLE_OMAPL138_H_ #define _RSC_TABLE_OMAPL138_H_ #include "rsc_types.h" #define IRAM_DA 0x18000000 #define IRAM_SIZE SZ_256K #define DATA_DA 0xc3100000 #ifndef DATA_SIZE # define DATA_SIZE (SZ_8M) #endif #define RPMSG_VRING0_DA 0xc3000000 #define RPMSG_VRING1_DA 0xc3004000 #define CONSOLE_VRING0_DA 0xc3008000 #define CONSOLE_VRING1_DA 0xc300C000 #define BUFS0_DA 0xc3040000 #define BUFS1_DA 0xc3080000 /* * sizes of the virtqueues (expressed in number of buffers supported, * and must be power of 2) */ #define RPMSG_VQ0_SIZE 256 #define RPMSG_VQ1_SIZE 256 #define CONSOLE_VQ0_SIZE 256 #define CONSOLE_VQ1_SIZE 256 /* flip up bits whose indices represent features we support */ #define RPMSG_DSP_FEATURES 1 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 devmem entry */ struct fw_rsc_devmem iram; /* 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, iram), 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_DEVMEM, IRAM_DA, IRAM_DA, IRAM_SIZE, 0, 0, "DSP_IRAM", }, { TYPE_TRACE, TRACEBUFADDR, TRACEBUFSIZE, 0, "trace:dsp", }, }; #endif /* _RSC_TABLE_OMAPL138_H_ */
Declaring either the IRAM as a CARVEOUT or as a DEVMEM did not fix my issue.
This is the full log that Linux gives through dmesg:
[ 3128.896586] davinci-rproc davinci-rproc.0: pm_clk_notify() 6 [ 3128.897324] PM: Removing info for No Bus:remoteproc0 [ 3128.920801] firmware_class: fw_name_devm_release: fw_name-rproc-dsp-fw devm-c0ca0fb8 released [ 3128.920868] remoteproc remoteproc0: releasing dsp [ 3128.934502] platform davinci-rproc.0: pm_clk_notify() 7 [ 3128.936532] bus: 'platform': driver_probe_device: matched device davinci-rproc.0 with driver davinci-rproc [ 3128.936587] bus: 'platform': really_probe: probing driver davinci-rproc with device davinci-rproc.0 [ 3128.936681] davinci-rproc davinci-rproc.0: no pinctrl handle [ 3128.936756] davinci-rproc davinci-rproc.0: pm_clk_notify() 4 [ 3128.936922] devices_kset: Moving davinci-rproc.0 to end of list [ 3128.937193] davinci-rproc davinci-rproc.0: assigned reserved memory node dsp-memory@c3000000 [ 3128.997060] device: 'remoteproc0': device_add [ 3128.997340] PM: Adding info for No Bus:remoteproc0 [ 3129.005493] remoteproc remoteproc0: dsp is available [ 3129.009591] firmware_class: __allocate_fw_buf: fw-rproc-dsp-fw buf=c26ac5c0 [ 3129.009728] remoteproc remoteproc0: loading /lib/firmware/updates/4.14.40-g4796173fc5/rproc-dsp-fw failed with error -2 [ 3129.009808] remoteproc remoteproc0: loading /lib/firmware/updates/rproc-dsp-fw failed with error -2 [ 3129.009877] remoteproc remoteproc0: loading /lib/firmware/4.14.40-g4796173fc5/rproc-dsp-fw failed with error -2 [ 3129.053666] driver: 'davinci-rproc': driver_bound: bound to device 'davinci-rproc.0' [ 3129.053763] davinci-rproc davinci-rproc.0: pm_clk_notify() 5 [ 3129.054058] bus: 'platform': really_probe: bound device davinci-rproc.0 to driver davinci-rproc [ 3129.134009] remoteproc remoteproc0: direct-loading rproc-dsp-fw [ 3129.134100] firmware_class: fw_set_page_data: fw-rproc-dsp-fw buf=c26ac5c0 data=cbec1000 size=2845088 [ 3129.134138] remoteproc remoteproc0: powering up dsp [ 3129.137771] firmware_class: batched request - sharing the same struct firmware_buf and lookup for multiple requests [ 3129.137805] firmware_class: fw_set_page_data: fw-rproc-dsp-fw buf=c26ac5c0 data=cbec1000 size=2845088 [ 3129.137841] remoteproc remoteproc0: Booting fw image rproc-dsp-fw, size 2845088 [ 3129.232656] remoteproc remoteproc0: Failed to process resources: -22 [ 3129.262848] firmware_class: __fw_free_buf: fw-rproc-dsp-fw buf=c26ac5c0 data=cbec1000 size=2845088