summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@linaro.org>2019-02-06 11:43:49 +0100
committerThierry Escande <thierry.escande@linaro.org>2019-02-07 11:14:10 +0100
commit0cb51faae2ceecc563a241ee4dd1ad784e89adc3 (patch)
treeca0f311c7765616cbb77750f73cb2612ab40b1c2
parent208211dd3910bb6bec00af68cb9009e05ea309c1 (diff)
fastrpc: Use DSP_DOMAIN for device and firwmare filename
DSP_DOMAIN is defined at build time to be ADSP or CDSP. It is then used to open the corresponding device and firwmare for the domain. Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
-rw-r--r--include/fastrpc_internal.h8
-rw-r--r--src/lib/fastrpc_apps_user.c6
-rw-r--r--src/lib/rpcmem.c2
3 files changed, 9 insertions, 7 deletions
diff --git a/include/fastrpc_internal.h b/include/fastrpc_internal.h
index 0e42595..2a0548c 100644
--- a/include/fastrpc_internal.h
+++ b/include/fastrpc_internal.h
@@ -107,6 +107,14 @@ struct fastrpc_ioctl_mmap
#define FASTRPC_SMD_GUID "fastrpcsmd-apps-dsp"
+#if defined CDSP_DOMAIN
+#define FASTRPC_DEVICE "/dev/fastrpc-cdsp"
+#define FASTRPC_SHELL "fastrpc_shell_3"
+#else /* Defaults to ADSP */
+#define FASTRPC_DEVICE "/dev/fastrpc-adsp"
+#define FASTRPC_SHELL "fastrpc_shell_0"
+#endif
+
struct smq_null_invoke32
{
uint32_t ctx; //! invoke caller context
diff --git a/src/lib/fastrpc_apps_user.c b/src/lib/fastrpc_apps_user.c
index 4886f16..c772d7a 100644
--- a/src/lib/fastrpc_apps_user.c
+++ b/src/lib/fastrpc_apps_user.c
@@ -64,10 +64,6 @@
#define INT_MAX (int)(-1)
#endif
-#ifndef FASTRPC_DEVICE
-#define FASTRPC_DEVICE "/dev/fastrpc-adsp"
-#endif
-
#define EVENT_SIZE ( sizeof (struct inotify_event) )
#define EVENT_BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )
@@ -244,7 +240,7 @@ static void create_dev(void)
dev = open(FASTRPC_DEVICE, O_NONBLOCK);
VERIFY(dev >= 0);
gdev = dev;
- VERIFY(!apps_std_fopen_with_env("ADSP_LIBRARY_PATH", ";", "fastrpc_shell_0", "r", &fh));
+ VERIFY(!apps_std_fopen_with_env("ADSP_LIBRARY_PATH", ";", FASTRPC_SHELL, "r", &fh));
VERIFY(!apps_std_flen(fh, &len));
VERIFY(len < INT_MAX);
ginit.file = (__u64)rpcmem_alloc(0, RPCMEM_HEAP_DEFAULT, (int)len);
diff --git a/src/lib/rpcmem.c b/src/lib/rpcmem.c
index a2504eb..b192551 100644
--- a/src/lib/rpcmem.c
+++ b/src/lib/rpcmem.c
@@ -45,8 +45,6 @@
#include <sys/mman.h>
#include <errno.h>
-#define FASTRPC_DEVICE "/dev/fastrpc-adsp"
-
#define PAGE_SIZE 4096
#define PAGE_MASK ~((uintptr_t)PAGE_SIZE - 1)