From: Peter Geis <pgwipeout@gmail.com>
To: Peng Fan <peng.fan@nxp.com>, Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peter Geis <pgwipeout@gmail.com>, u-boot@lists.denx.de
Subject: [PATCH v1 02/11] mmc: sdhci: allow disabling sdma in spl
Date: Mon, 21 Feb 2022 20:31:21 -0500 [thread overview]
Message-ID: <20220222013131.3114990-3-pgwipeout@gmail.com> (raw)
In-Reply-To: <20220222013131.3114990-1-pgwipeout@gmail.com>
Rockchip emmc devices have a similar issue to Rockchip dwmmc devices,
where performing dma to sram causes errors with suspend/resume.
Allow us to toggle sdma in spl for sdhci similar to adma support, so we
can ensure dma is not used when loading the sram code.
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
drivers/mmc/Kconfig | 7 +++++++
drivers/mmc/sdhci.c | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index f04cc44e1973..1e4342285ce7 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -468,6 +468,13 @@ config MMC_SDHCI_SDMA
This enables support for the SDMA (Single Operation DMA) defined
in the SD Host Controller Standard Specification Version 1.00 .
+config SPL_MMC_SDHCI_SDMA
+ bool "Support SDHCI SDMA in SPL"
+ depends on MMC_SDHCI
+ help
+ This enables support for the SDMA (Single Operation DMA) defined
+ in the SD Host Controller Standard Specification Version 1.00 in SPL.
+
config MMC_SDHCI_ADMA
bool "Support SDHCI ADMA2"
depends on MMC_SDHCI
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 766e4a6b0c5e..6285e53d12a2 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -70,7 +70,7 @@ static void sdhci_transfer_pio(struct sdhci_host *host, struct mmc_data *data)
}
}
-#if (defined(CONFIG_MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA))
+#if (CONFIG_IS_ENABLED(MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA))
static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
int *is_aligned, int trans_bytes)
{
@@ -177,7 +177,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data)
}
} while (!(stat & SDHCI_INT_DATA_END));
-#if (defined(CONFIG_MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA))
+#if (CONFIG_IS_ENABLED(MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA))
dma_unmap_single(host->start_addr, data->blocks * data->blocksize,
mmc_get_dma_dir(data));
#endif
@@ -836,7 +836,7 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
#endif
debug("%s, caps: 0x%x\n", __func__, caps);
-#ifdef CONFIG_MMC_SDHCI_SDMA
+#if CONFIG_IS_ENABLED(MMC_SDHCI_SDMA)
if ((caps & SDHCI_CAN_DO_SDMA)) {
host->flags |= USE_SDMA;
} else {
--
2.25.1
next prev parent reply other threads:[~2022-02-22 1:32 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 1:31 [PATCH v1 00/11] rockchip fixes and extend rk3568 support Peter Geis
2022-02-22 1:31 ` [PATCH v1 01/11] clk: rockchip: rk3568: fix reset handler Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:32 ` Peter Geis
2022-03-12 5:02 ` Simon Glass
2022-03-14 8:51 ` Kever Yang
2023-01-04 18:30 ` Jagan Teki
2022-02-22 1:31 ` Peter Geis [this message]
2022-02-25 1:46 ` [PATCH v1 02/11] mmc: sdhci: allow disabling sdma in spl Jaehoon Chung
2022-03-14 8:41 ` Kever Yang
2022-02-22 1:31 ` [PATCH v1 03/11] spi: rockchip-sfc: fix building rockchip-sfc Peter Geis
2022-03-14 8:45 ` Kever Yang
2022-03-14 11:36 ` Peter Geis
2022-02-22 1:31 ` [PATCH v1 04/11] spi: rockchip-sfc: sanity check minimum freq Peter Geis
2022-03-14 8:53 ` Kever Yang
2022-03-15 2:10 ` Jon Lin
2022-02-22 1:31 ` [PATCH v1 05/11] spl: support adc drivers in spl Peter Geis
2022-02-22 1:31 ` [PATCH v1 06/11] rockchip: handle bootrom recovery mode " Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:37 ` Peter Geis
2022-03-14 9:08 ` Kever Yang
2022-03-14 11:51 ` Peter Geis
2022-03-14 11:59 ` Philipp Tomsich
2022-03-14 12:34 ` Peter Geis
2022-02-22 1:31 ` [PATCH v1 07/11] rockchip: rk3568: add boot device detection Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:34 ` Peter Geis
2022-02-22 1:31 ` [PATCH v1 08/11] rockchip: rk3568: enable automatic clock gating Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-14 8:52 ` Kever Yang
2022-02-22 1:31 ` [PATCH v1 09/11] rockchip: move dwc3 config to chip specific handler Peter Geis
2022-03-12 2:24 ` Simon Glass
2023-02-27 7:10 ` Jagan Teki
2022-02-22 1:31 ` [PATCH v1 10/11] rockchip: rk3568: add dwc3 otg support Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:38 ` Peter Geis
2022-02-22 1:31 ` [PATCH v1 11/11] [RFC] rockchip: rk356x: attempt to fix ram detection Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:54 ` Peter Geis
2022-03-12 5:02 ` Simon Glass
2022-03-12 14:46 ` [PATCH v1 00/11] rockchip fixes and extend rk3568 support Kever Yang
2022-03-14 8:56 ` Kever Yang
2022-03-14 11:42 ` Peter Geis
2022-03-14 9:06 ` Jagan Teki
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=20220222013131.3114990-3-pgwipeout@gmail.com \
--to=pgwipeout@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=peng.fan@nxp.com \
--cc=u-boot@lists.denx.de \
/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).