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 <eero.nurkkala@offcode.fi>
This commit is contained in:
Eero Nurkkala 2022-06-22 07:50:20 +03:00 committed by Petro Karashchenko
parent 881c896c06
commit 92760f89eb
2 changed files with 3 additions and 3 deletions

View File

@ -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 */

View File

@ -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 */