You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/09/06 06:32:18 UTC
[nuttx] 02/06: risc-v/mpfs: ihc: Make Vring addresses configurable
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 3bd4bd61960339608479b046dcd3fdc7b1f27527
Author: Jani Paalijarvi <ja...@unikie.com>
AuthorDate: Fri Dec 2 13:01:00 2022 +0200
risc-v/mpfs: ihc: Make Vring addresses configurable
---
arch/risc-v/src/mpfs/Kconfig | 30 ++++++++++++++++++++++++++++++
arch/risc-v/src/mpfs/mpfs_ihc.c | 21 ++++++++++-----------
2 files changed, 40 insertions(+), 11 deletions(-)
diff --git a/arch/risc-v/src/mpfs/Kconfig b/arch/risc-v/src/mpfs/Kconfig
index 6405f81e79..534c1adba9 100644
--- a/arch/risc-v/src/mpfs/Kconfig
+++ b/arch/risc-v/src/mpfs/Kconfig
@@ -458,6 +458,36 @@ config MPFS_IHC_WITH_HSS
---help---
Set this to true if using IHC with HSS bootloader
+config MPFS_CH1_VRING_SHMEM_ADDR
+ hex "Channel 1 Vring shared memory start"
+ default 0xA2410000
+ depends on MPFS_IHC_CLIENT
+
+config MPFS_CH1_VRING0_DESC_ADDR
+ hex "Channel 1 Vring0 descriptor area"
+ default 0xA2400000
+ depends on MPFS_IHC_CLIENT
+
+config MPFS_CH1_VRING1_DESC_ADDR
+ hex "Channel 1 Vring1 descriptor area"
+ default 0xA2408000
+ depends on MPFS_IHC_CLIENT
+
+config MPFS_CH2_VRING_SHMEM_ADDR
+ hex "Channel 2 Vring shared memory start"
+ default 0xA2460000
+ depends on MPFS_IHC_CLIENT && MPFS_IHC_RPMSG_CH2
+
+config MPFS_CH2_VRING0_DESC_ADDR
+ hex "Channel 2 Vring0 descriptor area"
+ default 0xA2450000
+ depends on MPFS_IHC_CLIENT && MPFS_IHC_RPMSG_CH2
+
+config MPFS_CH2_VRING1_DESC_ADDR
+ hex "Channel 2 Vring1 descriptor area"
+ default 0xA2458000
+ depends on MPFS_IHC_CLIENT && MPFS_IHC_RPMSG_CH2
+
config MPFS_ETHMAC
bool
default n
diff --git a/arch/risc-v/src/mpfs/mpfs_ihc.c b/arch/risc-v/src/mpfs/mpfs_ihc.c
index a1833721a8..00e10beb96 100644
--- a/arch/risc-v/src/mpfs/mpfs_ihc.c
+++ b/arch/risc-v/src/mpfs/mpfs_ihc.c
@@ -91,19 +91,18 @@
#ifndef CONFIG_MPFS_IHC_RPMSG_CH2
/* This is the RPMSG default channel used with only one RPMSG channel */
-#define VRING_SHMEM 0xa2410000 /* Vring shared memory start */
-#define VRING0_DESCRIPTORS 0xa2400000 /* Vring0 descriptor area */
-#define VRING1_DESCRIPTORS 0xa2408000 /* Vring1 descriptor area */
-#define VRING0_NOTIFYID 0 /* Vring0 id */
-#define VRING1_NOTIFYID 1 /* Vring1 id */
+#define VRING_SHMEM CONFIG_MPFS_CH1_VRING_SHMEM_ADDR /* Vring shared memory start */
+#define VRING0_DESCRIPTORS CONFIG_MPFS_CH1_VRING0_DESC_ADDR /* Vring0 descriptor area */
+#define VRING1_DESCRIPTORS CONFIG_MPFS_CH1_VRING1_DESC_ADDR /* Vring1 descriptor area */
+#define VRING0_NOTIFYID 0 /* Vring0 id */
+#define VRING1_NOTIFYID 1 /* Vring1 id */
#else
/* This is the RPMSG channel 2, enabled separately */
-
-#define VRING_SHMEM 0xa2460000 /* Vring shared memory start */
-#define VRING0_DESCRIPTORS 0xa2450000 /* Vring0 descriptor area */
-#define VRING1_DESCRIPTORS 0xa2458000 /* Vring1 descriptor area */
-#define VRING0_NOTIFYID 2 /* Vring0 id */
-#define VRING1_NOTIFYID 3 /* Vring1 id */
+#define VRING_SHMEM CONFIG_MPFS_CH2_VRING_SHMEM_ADDR /* Vring shared memory start */
+#define VRING0_DESCRIPTORS CONFIG_MPFS_CH2_VRING0_DESC_ADDR /* Vring0 descriptor area */
+#define VRING1_DESCRIPTORS CONFIG_MPFS_CH2_VRING1_DESC_ADDR /* Vring1 descriptor area */
+#define VRING0_NOTIFYID 2 /* Vring0 id */
+#define VRING1_NOTIFYID 3 /* Vring1 id */
#endif
/****************************************************************************