public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Haojian Zhuang <haojian.zhuang@linaro.org>
To: ryan.harkin@linaro.org, edk2-devel@lists.01.org,
	leif.lindholm@linaro.org, ard.biesheuvel@linaro.org
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Subject: [PATCH v4 11/11] PL180: set variable length for CMD6 and ACMD51
Date: Tue,  8 Nov 2016 23:21:16 +0800	[thread overview]
Message-ID: <1478618476-12608-12-git-send-email-haojian.zhuang@linaro.org> (raw)
In-Reply-To: <1478618476-12608-1-git-send-email-haojian.zhuang@linaro.org>

Since CMD6 & ACMD51 needs to read data size less than 512, proper
variable length should be set.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
---
 ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
index 4d839e7..b2ba4c0 100644
--- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
+++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
@@ -63,11 +63,6 @@ MciIsReadOnly (
   return (MmioRead32 (FixedPcdGet32 (PcdPL180SysMciRegAddress)) & SYS_MCI_WPROT);
 }
 
-#if 0
-//Note: This function has been commented out because it is not used yet.
-//      This function could be used to remove the hardcoded BlockLen used
-//      in MciPrepareDataPath
-
 // Convert block size to 2^n
 STATIC
 UINT32
@@ -87,7 +82,6 @@ GetPow2BlockLen (
 
   return Pow2BlockLen;
 }
-#endif
 
 VOID
 MciPrepareDataPath (
@@ -129,12 +123,20 @@ MciSendCommand (
   } else if (MmcCmd == MMC_CMD6) {
     MmioWrite32 (MCI_DATA_TIMER_REG, 0xFFFFFFF);
     MmioWrite32 (MCI_DATA_LENGTH_REG, 64);
+#ifndef USE_STREAM
+    MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_CARD_TO_CONT | GetPow2BlockLen (64));
+#else
     MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_CARD_TO_CONT | MCI_DATACTL_STREAM_TRANS);
+#endif
   } else if (MmcCmd == MMC_ACMD51) {
     MmioWrite32 (MCI_DATA_TIMER_REG, 0xFFFFFFF);
     /* SCR register is 8 bytes long. */
     MmioWrite32 (MCI_DATA_LENGTH_REG, 8);
+#ifndef USE_STREAM
+    MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_CARD_TO_CONT | GetPow2BlockLen (8));
+#else
     MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_CARD_TO_CONT | MCI_DATACTL_STREAM_TRANS);
+#endif
   }
 
   // Create Command for PL180
-- 
2.7.4



  parent reply	other threads:[~2016-11-08 15:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 15:21 [PATCH v4 00/11] enhance MMC Haojian Zhuang
2016-11-08 15:21 ` [PATCH v4 01/11] MmcDxe: wait OCR busy bit free Haojian Zhuang
2016-11-08 19:27   ` Leif Lindholm
2016-11-08 15:21 ` [PATCH v4 02/11] MmcDxe: move ECSD into CardInfo structure Haojian Zhuang
2016-11-08 20:27   ` Leif Lindholm
2016-11-08 15:21 ` [PATCH v4 03/11] MmcDxe: add SPEC_VERS field in CSD structure Haojian Zhuang
2016-11-08 20:27   ` Leif Lindholm
2016-11-08 15:21 ` [PATCH v4 04/11] MmcDxe: add interface to change io width and speed Haojian Zhuang
2016-11-08 15:21 ` [PATCH v4 05/11] MmcDxe: declare ECSD structure Haojian Zhuang
2016-11-08 20:43   ` Leif Lindholm
2016-11-09  0:34     ` Haojian Zhuang
2016-11-08 15:21 ` [PATCH v4 06/11] MmcDxe: set io bus width before reading EXTCSD Haojian Zhuang
2016-11-08 15:21 ` [PATCH v4 07/11] MmcDxe: Fix uninitialized mediaid for SD Haojian Zhuang
2016-11-08 23:59   ` Leif Lindholm
2016-11-13  6:46     ` Haojian Zhuang
2016-11-08 15:21 ` [PATCH v4 08/11] MmcDxe: set iospeed and bus width in SD stack Haojian Zhuang
2016-11-08 15:21 ` [PATCH v4 09/11] MmcDxe: expand to support multiple blocks Haojian Zhuang
2016-11-09  0:14   ` Leif Lindholm
2016-11-08 15:21 ` [PATCH v4 10/11] PL180: update for indentifying SD Haojian Zhuang
2016-11-08 15:21 ` Haojian Zhuang [this message]
2016-11-08 17:32 ` [PATCH v4 00/11] enhance MMC Ryan Harkin
2016-11-09  0:30   ` Haojian Zhuang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478618476-12608-12-git-send-email-haojian.zhuang@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox