From: Avri Altman <avri.altman@wdc.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, linux-mmc@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Shawn Lin <shawn.lin@rock-chips.com>,
Avi Shchislowski <avi.shchislowski@wdc.com>,
Alex Lemberg <alex.lemberg@wdc.com>,
linux-kernel@vger.kernel.org, Avri Altman <avri.altman@wdc.com>
Subject: [PATCH 2/3] mmc: core: Indicate SD specs higher than 4.0
Date: Sun, 3 Feb 2019 10:50:27 +0200 [thread overview]
Message-ID: <1549183828-17316-3-git-send-email-avri.altman@wdc.com> (raw)
In-Reply-To: <1549183828-17316-1-git-send-email-avri.altman@wdc.com>
SD specs version 4.x and 5.x have a dedicated slices in the SCR register.
Higher versions will rely on a combination of the existing fields.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
drivers/mmc/core/sd.c | 5 +++++
include/linux/mmc/card.h | 2 ++
2 files changed, 7 insertions(+)
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index d0d9f90..44f4cbc 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -209,6 +209,11 @@ static int mmc_decode_scr(struct mmc_card *card)
/* Check if Physical Layer Spec v3.0 is supported */
scr->sda_spec3 = UNSTUFF_BITS(resp, 47, 1);
+ if (scr->sda_spec3) {
+ scr->sda_spec4 = UNSTUFF_BITS(resp, 42, 1);
+ scr->sda_specx = UNSTUFF_BITS(resp, 38, 4);
+ }
+
if (UNSTUFF_BITS(resp, 55, 1))
card->erased_byte = 0xFF;
else
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 447648b..919e644 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -133,6 +133,8 @@ struct mmc_ext_csd {
struct sd_scr {
unsigned char sda_vsn;
unsigned char sda_spec3;
+ unsigned char sda_spec4;
+ unsigned char sda_specx;
unsigned char bus_widths;
#define SD_SCR_BUS_WIDTH_1 (1<<0)
#define SD_SCR_BUS_WIDTH_4 (1<<2)
--
1.9.1
next prev parent reply other threads:[~2019-02-03 8:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-03 8:50 [PATCH 0/3] mmc: core: Add SD Discard support Avri Altman
2019-02-03 8:50 ` [PATCH 1/3] mmc: core: Calculate the discard arg only once Avri Altman
2019-02-05 13:33 ` Ulf Hansson
2019-02-05 14:06 ` Avri Altman
2019-02-03 8:50 ` Avri Altman [this message]
2019-02-03 8:50 ` [PATCH 3/3] mmc: core: Add discard support to sd Avri Altman
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-all 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=1549183828-17316-3-git-send-email-avri.altman@wdc.com \
--to=avri.altman@wdc.com \
--cc=adrian.hunter@intel.com \
--cc=alex.lemberg@wdc.com \
--cc=avi.shchislowski@wdc.com \
--cc=jh80.chung@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.com \
/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;
as well as URLs for NNTP newsgroup(s).