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 2022/08/23 18:35:05 UTC

[incubator-nuttx] branch master updated: risc-v/mpfs: ihc: update vq ids

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/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new d940d55ee4 risc-v/mpfs: ihc: update vq ids
d940d55ee4 is described below

commit d940d55ee4e8eee58f0518290b7dee6ca052193e
Author: Eero Nurkkala <ee...@offcode.fi>
AuthorDate: Tue Aug 23 15:04:06 2022 +0300

    risc-v/mpfs: ihc: update vq ids
    
    Since the commit cf22dd8 (related to OpenAMP update), the notifyid
    is no longer NOTIFY_ALL, but the vq id.
    
    Utilize the vq id now properly as it's being provided. However,
    vq id 0 generates action.
    
    Signed-off-by: Eero Nurkkala <ee...@offcode.fi>
---
 arch/risc-v/src/mpfs/mpfs_ihc.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/arch/risc-v/src/mpfs/mpfs_ihc.c b/arch/risc-v/src/mpfs/mpfs_ihc.c
index a3390afc74..a4aaa21178 100644
--- a/arch/risc-v/src/mpfs/mpfs_ihc.c
+++ b/arch/risc-v/src/mpfs/mpfs_ihc.c
@@ -969,7 +969,7 @@ mpfs_rptun_get_resource(struct rptun_dev_s *dev)
       rsc->rpmsg_vring1.align       = VRING_ALIGN;
       rsc->rpmsg_vring1.num         = VRING_NR;
       rsc->rpmsg_vring1.da          = VRING1_DESCRIPTORS;
-      rsc->rpmsg_vring0.notifyid    = 1;
+      rsc->rpmsg_vring1.notifyid    = 1;
       rsc->config.r2h_buf_size      = VRING_SIZE;
       rsc->config.h2r_buf_size      = VRING_SIZE;
     }
@@ -1084,23 +1084,17 @@ static int mpfs_rptun_notify(struct rptun_dev_s *dev, uint32_t notifyid)
 {
   uint32_t tx_msg[IHC_MAX_MESSAGE_SIZE];
 
-  /* We're looking for the id, but currently it's just RPTUN_NOTIFY_ALL. It's
-   * OK, the remote end doesn't really care about the id, but that might
-   * change in the future.
-   */
+  /* We only care about the queue with id 0 */
 
-  if (notifyid == RPTUN_NOTIFY_ALL)
+  if (notifyid == 0)
     {
-      tx_msg[0] = 0;
-      tx_msg[1] = 0;
-    }
-  else
-    {
-      tx_msg[0] = (notifyid << 16);
+      tx_msg[0] = 0; /* (notifyid << 16) which is zero */
       tx_msg[1] = 0;
+
+      return mpfs_ihc_tx_message(IHC_CHANNEL_TO_CONTEXTA, tx_msg);
     }
 
-  return mpfs_ihc_tx_message(IHC_CHANNEL_TO_CONTEXTA, tx_msg);
+  return OK;
 }
 
 /****************************************************************************