You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/06/22 06:50:38 UTC
[incubator-nuttx] branch master updated: risc-v/mpfs: emmcsd: fix two issues
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko 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 92760f89eb risc-v/mpfs: emmcsd: fix two issues
92760f89eb is described below
commit 92760f89eb56658882d6f64711147c68f716746f
Author: Eero Nurkkala <ee...@offcode.fi>
AuthorDate: Wed Jun 22 07:50:20 2022 +0300
risc-v/mpfs: emmcsd: fix two issues
This patch fixes the following issues:
1. MPFS_EMMCSD_HRS06_EMM bitmask had to be 0x7, not 0x03
2. putreg32() caused outright memory corruption as the
arguments were in wrong order
Signed-off-by: Eero Nurkkala <ee...@offcode.fi>
---
arch/risc-v/src/mpfs/hardware/mpfs_emmcsd.h | 2 +-
arch/risc-v/src/mpfs/mpfs_emmcsd.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/risc-v/src/mpfs/hardware/mpfs_emmcsd.h b/arch/risc-v/src/mpfs/hardware/mpfs_emmcsd.h
index 6cf6cdf2e0..c9a6a99feb 100755
--- a/arch/risc-v/src/mpfs/hardware/mpfs_emmcsd.h
+++ b/arch/risc-v/src/mpfs/hardware/mpfs_emmcsd.h
@@ -145,7 +145,7 @@
#define MPFS_EMMCSD_HRS06_ETR (1 << 15)
#define MPFS_EMMCSD_HRS06_ETV (0x3f << 8)
-#define MPFS_EMMCSD_HRS06_EMM (0x3 << 0)
+#define MPFS_EMMCSD_HRS06_EMM (0x7 << 0)
/* HRS07 register */
diff --git a/arch/risc-v/src/mpfs/mpfs_emmcsd.c b/arch/risc-v/src/mpfs/mpfs_emmcsd.c
index 49cf058ca9..7227d9df3e 100755
--- a/arch/risc-v/src/mpfs/mpfs_emmcsd.c
+++ b/arch/risc-v/src/mpfs/mpfs_emmcsd.c
@@ -996,8 +996,8 @@ static void mpfs_endtransfer(struct mpfs_dev_s *priv,
/* Clear Buffer Read Ready (BRR), BWR and DMA statuses */
- putreg32(MPFS_EMMCSD_SRS12, MPFS_EMMCSD_SRS12_BRR |
- MPFS_EMMCSD_SRS12_BWR | MPFS_EMMCSD_SRS12_DMAINT);
+ putreg32(MPFS_EMMCSD_SRS12_BRR | MPFS_EMMCSD_SRS12_BWR |
+ MPFS_EMMCSD_SRS12_DMAINT, MPFS_EMMCSD_SRS12);
/* Mark the transfer finished */