From: Jason Lai <jasonlai.genesyslogic@gmail.com>
To: ulf.hansson@linaro.org, takahiro.akashi@linaro.org,
adrian.hunter@intel.com
Cc: linux-mmc@vger.kernel.org, ben.chuang@genesyslogic.com.tw,
greg.tu@genesyslogic.com.tw, jason.lai@genesyslogic.com.tw,
otis.wu@genesyslogic.com.tw, benchuanggli@gmail.com,
Jason Lai <jasonlai.genesyslogic@gmail.com>
Subject: [PATCH 7/7] mmc: core: Support UHS-II card access
Date: Fri, 3 Dec 2021 18:51:03 +0800 [thread overview]
Message-ID: <20211203105103.11306-8-jasonlai.genesyslogic@gmail.com> (raw)
In-Reply-To: <20211203105103.11306-1-jasonlai.genesyslogic@gmail.com>
From: Jason Lai <jason.lai@genesyslogic.com.tw>
Embed the UHS-II access function into the MMC request processing flow.
Signed-off-by: Jason Lai <jason.lai@genesyslogic.com.tw>
---
drivers/mmc/core/core.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 19b409179..d4d873971 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -31,6 +31,7 @@
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include <linux/mmc/slot-gpio.h>
+#include <linux/mmc/sd_uhs2.h>
#define CREATE_TRACE_POINTS
#include <trace/events/mmc.h>
@@ -42,6 +43,7 @@
#include "host.h"
#include "sdio_bus.h"
#include "pwrseq.h"
+#include "sd_uhs2.h"
#include "mmc_ops.h"
#include "sd_ops.h"
@@ -335,6 +337,8 @@ static int mmc_mrq_prep(struct mmc_host *host, struct mmc_request *mrq)
int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
{
+ struct uhs2_command uhs2_cmd;
+ u32 payload[4]; /* for maximum size */
int err;
init_completion(&mrq->cmd_completion);
@@ -352,6 +356,13 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
if (err)
return err;
+ if (host->flags & MMC_UHS2_SUPPORT &&
+ host->flags & MMC_UHS2_INITIALIZED) {
+ uhs2_cmd.payload = payload;
+ mrq->cmd->uhs2_cmd = &uhs2_cmd;
+ sd_uhs2_prepare_cmd(host, mrq);
+ }
+
led_trigger_event(host->led, LED_FULL);
__mmc_start_request(host, mrq);
@@ -431,6 +442,8 @@ EXPORT_SYMBOL(mmc_wait_for_req_done);
*/
int mmc_cqe_start_req(struct mmc_host *host, struct mmc_request *mrq)
{
+ struct uhs2_command uhs2_cmd;
+ u32 payload[4]; /* for maximum size */
int err;
/*
@@ -451,6 +464,13 @@ int mmc_cqe_start_req(struct mmc_host *host, struct mmc_request *mrq)
if (err)
goto out_err;
+ if (host->flags & MMC_UHS2_SUPPORT &&
+ host->flags & MMC_UHS2_INITIALIZED) {
+ uhs2_cmd.payload = payload;
+ mrq->cmd->uhs2_cmd = &uhs2_cmd;
+ sd_uhs2_prepare_cmd(host, mrq);
+ }
+
err = host->cqe_ops->cqe_request(host, mrq);
if (err)
goto out_err;
@@ -899,8 +919,10 @@ static inline void mmc_set_ios(struct mmc_host *host)
*/
void mmc_set_chip_select(struct mmc_host *host, int mode)
{
- host->ios.chip_select = mode;
- mmc_set_ios(host);
+ if (!(host->flags & MMC_UHS2_INITIALIZED)) {
+ host->ios.chip_select = mode;
+ mmc_set_ios(host);
+ }
}
/*
--
2.34.0
next prev parent reply other threads:[~2021-12-03 10:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 10:50 [PATCH 0/7] Preparations to support SD UHS-II cards Jason Lai
2021-12-03 10:50 ` [PATCH 1/7] mmc: core: Cleanup printing of speed mode at card insertion Jason Lai
2021-12-03 10:50 ` [PATCH 2/7] mmc: core: Prepare to support SD UHS-II cards Jason Lai
2021-12-03 10:50 ` [PATCH 3/7] mmc: core: Announce successful insertion of an SD UHS-II card Jason Lai
2021-12-03 10:51 ` [PATCH 4/7] mmc: core: Extend support for mmc regulators with a vqmmc2 Jason Lai
2021-12-03 10:51 ` [PATCH 5/7] mmc: add UHS-II related definitions in headers Jason Lai
2021-12-14 13:37 ` Ulf Hansson
2022-01-06 8:37 ` Lai Jason
2022-01-07 16:49 ` Ulf Hansson
2022-01-14 3:01 ` Lai Jason
2021-12-03 10:51 ` [PATCH 6/7] mmc: Implement content of UHS-II card initialization functions Jason Lai
2021-12-14 20:28 ` Ulf Hansson
2022-01-06 10:31 ` Lai Jason
2022-01-07 17:08 ` Ulf Hansson
2022-01-14 3:18 ` Lai Jason
2021-12-03 10:51 ` Jason Lai [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-08-31 11:02 [PATCH 7/7] mmc: core: Support UHS-II card access Jason Lai
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=20211203105103.11306-8-jasonlai.genesyslogic@gmail.com \
--to=jasonlai.genesyslogic@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=ben.chuang@genesyslogic.com.tw \
--cc=benchuanggli@gmail.com \
--cc=greg.tu@genesyslogic.com.tw \
--cc=jason.lai@genesyslogic.com.tw \
--cc=linux-mmc@vger.kernel.org \
--cc=otis.wu@genesyslogic.com.tw \
--cc=takahiro.akashi@linaro.org \
--cc=ulf.hansson@linaro.org \
/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).