Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1242970 > unrolled thread
| Started by | Marcin Wojtas <mw@semihalf.com> |
|---|---|
| First post | 2015-10-09 03:00 +0200 |
| Last post | 2015-10-09 03:00 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 5/5] mmc: sdhci-pxav3: enable modifying MMC_CARD bit during card initialization Marcin Wojtas <mw@semihalf.com> - 2015-10-09 03:00 +0200
| From | Marcin Wojtas <mw@semihalf.com> |
|---|---|
| Date | 2015-10-09 03:00 +0200 |
| Subject | [PATCH v2 5/5] mmc: sdhci-pxav3: enable modifying MMC_CARD bit during card initialization |
| Message-ID | <qhucr-3d3-25@gated-at.bofh.it> |
On Marvell Armada 38x SoC's the MMC_CARD bit in SD_CE_ATA_1 register must
be set to 0x1 when a MMC card is supposed to work in DDR mode, or when
commands CMD11, CMD14 and CMD20 are used.
This commit enables the above for all MMC cards by modifying the host
registers during card initialization. It is done by using init_card()
callback.
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
drivers/mmc/host/sdhci-pxav3.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 352c5eb..9bdeeb1 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -57,6 +57,7 @@
#define SD_SPI_MODE 0x108
#define SD_CE_ATA_1 0x10C
+#define SDCE_MMC_CARD BIT(28)
#define SD_CE_ATA_2 0x10E
#define SDCE_MISC_INT (1<<2)
@@ -221,6 +222,22 @@ static void pxav3_reset(struct sdhci_host *host, u8 mask)
}
}
+static void pxav3_init_card(struct sdhci_host *host, struct mmc_card *card)
+{
+ struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc));
+ struct device_node *np = pdev->dev.of_node;
+ u32 reg_val;
+
+ if (of_device_is_compatible(np, "marvell,armada-380-sdhci")) {
+ reg_val = sdhci_readl(host, SD_CE_ATA_1);
+ if (mmc_card_mmc(card))
+ reg_val |= SDCE_MMC_CARD;
+ else
+ reg_val &= ~SDCE_MMC_CARD;
+ sdhci_writel(host, reg_val, SD_CE_ATA_1);
+ }
+}
+
#define MAX_WAIT_COUNT 5
static void pxav3_gen_init_74_clocks(struct sdhci_host *host, u8 power_mode)
{
@@ -338,6 +355,7 @@ static const struct sdhci_ops pxav3_sdhci_ops = {
.set_bus_width = sdhci_set_bus_width,
.reset = pxav3_reset,
.set_uhs_signaling = pxav3_set_uhs_signaling,
+ .init_card = pxav3_init_card,
};
static struct sdhci_pltfm_data sdhci_pxav3_pdata = {
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top | Article view | linux.kernel
csiph-web