From: Jeff Brasen <jbrasen@nvidia.com>
To: <edk2-devel@lists.01.org>
Cc: Jeff Brasen <jbrasen@nvidia.com>
Subject: [PATCH v2 1/2] MdeModulePkg/SdMmcPciHcDxe: Add controller version defines
Date: Tue, 9 Oct 2018 11:50:36 -0600 [thread overview]
Message-ID: <e593136da67b7c1cebe98d92f5a5ac62d26b638f.1539107179.git.jbrasen@nvidia.com> (raw)
In-Reply-To: <cover.1539107179.git.jbrasen@nvidia.com>
Add SDHCI controller defines, this is useful as the version in the
register does not explictly map to a specification version. For example
vesion 4.10 of the specification is version 0x04.
https://bugzilla.tianocore.org/show_bug.cgi?id=1233
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
---
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 4 ++--
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +-
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h | 10 ++++++++++
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
index 8c93933..d3f77ed 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
@@ -978,9 +978,9 @@ SdCardIdentification (
return Status;
}
- if ((ControllerVer & 0xFF) == 2) {
+ if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {
S18r = TRUE;
- } else if (((ControllerVer & 0xFF) == 0) || ((ControllerVer & 0xFF) == 1)) {
+ } else if (((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_100) || ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_200)) {
S18r = FALSE;
} else {
ASSERT (FALSE);
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index 25771dc..3b9a184 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -782,7 +782,7 @@ SdMmcHcClockSupply (
//
// Set SDCLK Frequency Select and Internal Clock Enable fields in Clock Control register.
//
- if ((ControllerVer & 0xFF) == 2) {
+ if ((ControllerVer & 0xFF) == SD_MMC_HC_CTRL_VER_300) {
ASSERT (Divisor <= 0x3FF);
ClockCtrl = ((Divisor & 0xFF) << 8) | ((Divisor & 0x300) >> 2);
} else if (((ControllerVer & 0xFF) == 0) || ((ControllerVer & 0xFF) == 1)) {
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
index e389d52..7e3f588 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
@@ -135,6 +135,16 @@ typedef struct {
UINT32 Hs400:1; // bit 63
} SD_MMC_HC_SLOT_CAP;
+//
+// SD Host controller version
+//
+#define SD_MMC_HC_CTRL_VER_100 0x00
+#define SD_MMC_HC_CTRL_VER_200 0x01
+#define SD_MMC_HC_CTRL_VER_300 0x02
+#define SD_MMC_HC_CTRL_VER_400 0x03
+#define SD_MMC_HC_CTRL_VER_410 0x04
+#define SD_MMC_HC_CTRL_VER_420 0x05
+
/**
Dump the content of SD/MMC host controller's Capability Register.
--
2.7.4
next prev parent reply other threads:[~2018-10-09 17:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-09 17:50 [PATCH v2 0/2] [SdMmcPciDxe] SDHCI v4+ support Jeff Brasen
2018-10-09 17:50 ` Jeff Brasen [this message]
2018-10-09 17:50 ` [PATCH v2 2/2] MdeModulePkg/SdMmcPciHcDxe: Allow additional SDHCI versions Jeff Brasen
2018-10-12 7:49 ` [PATCH v2 0/2] [SdMmcPciDxe] SDHCI v4+ support Wu, Hao A
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=e593136da67b7c1cebe98d92f5a5ac62d26b638f.1539107179.git.jbrasen@nvidia.com \
--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