public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] mmc: davinci: drop support for ti,dm6441-mmc
Date: Thu, 14 Nov 2019 16:10:28 +0100	[thread overview]
Message-ID: <20191114151031.25309-2-brgl@bgdev.pl> (raw)
In-Reply-To: <20191114151031.25309-1-brgl@bgdev.pl>

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

The DM family of DaVinci SoCs is no longer supported. Drop the
irrelevant code from the driver.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 .../mach-davinci/include/mach/sdmmc_defs.h    |  6 ---
 board/davinci/da8xxevm/omapl138_lcdk.c        |  1 -
 drivers/mmc/davinci_mmc.c                     | 42 +++----------------
 3 files changed, 5 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-davinci/include/mach/sdmmc_defs.h b/arch/arm/mach-davinci/include/mach/sdmmc_defs.h
index 5755c45f91..46f6391aa2 100644
--- a/arch/arm/mach-davinci/include/mach/sdmmc_defs.h
+++ b/arch/arm/mach-davinci/include/mach/sdmmc_defs.h
@@ -149,15 +149,9 @@ struct davinci_mmc {
 	uint input_clk;		/* Input clock to MMC controller */
 	uint host_caps;		/* Host capabilities */
 	uint voltages;		/* Host supported voltages */
-	uint version;		/* MMC Controller version */
 	struct mmc_config cfg;
 };
 
-enum {
-	MMC_CTLR_VERSION_1 = 0,	/* DM644x and DM355 */
-	MMC_CTLR_VERSION_2,	/* DA830 */
-};
-
 int davinci_mmc_init(bd_t *bis, struct davinci_mmc *host);
 
 #endif /* _SDMMC_DEFS_H */
diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c
index 27a51d6a78..d4cda0a8a7 100644
--- a/board/davinci/da8xxevm/omapl138_lcdk.c
+++ b/board/davinci/da8xxevm/omapl138_lcdk.c
@@ -342,7 +342,6 @@ static struct davinci_mmc mmc_sd0 = {
 	.reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
 	.host_caps = MMC_MODE_4BIT,     /* DA850 supports only 4-bit SD/MMC */
 	.voltages = MMC_VDD_32_33 | MMC_VDD_33_34,
-	.version = MMC_CTLR_VERSION_2,
 };
 
 int board_mmc_init(bd_t *bis)
diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c
index 0d63279db0..370b18cc78 100644
--- a/drivers/mmc/davinci_mmc.c
+++ b/drivers/mmc/davinci_mmc.c
@@ -26,16 +26,10 @@
 #define clear_bit(addr, val)	set_val((addr), (get_val(addr) & ~(val)))
 
 #ifdef CONFIG_DM_MMC
-struct davinci_of_data {
-	const char *name;
-	u8 version;
-};
-
 /* Davinci MMC board definitions */
 struct davinci_mmc_priv {
 	struct davinci_mmc_regs *reg_base;	/* Register base address */
 	uint input_clk;		/* Input clock to MMC controller */
-	uint version;		/* MMC Controller version */
 	struct gpio_desc cd_gpio;       /* Card Detect GPIO */
 	struct gpio_desc wp_gpio;       /* Write Protect GPIO */
 };
@@ -173,7 +167,7 @@ davinci_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, struct mmc_data *
 
 	/* Clear status registers */
 	mmcstatus = get_val(&regs->mmcst0);
-	fifo_words = (host->version == MMC_CTLR_VERSION_2) ? 16 : 8;
+	fifo_words = 16;
 	fifo_bytes = fifo_words << 2;
 
 	/* Wait for any previous busy signal to be cleared */
@@ -211,8 +205,7 @@ davinci_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, struct mmc_data *
 		set_val(&regs->mmcfifoctl,
 				(MMCFIFOCTL_FIFOLEV | MMCFIFOCTL_FIFORST));
 
-		if (host->version == MMC_CTLR_VERSION_2)
-			cmddata |= MMCCMD_DMATRIG;
+		cmddata |= MMCCMD_DMATRIG;
 
 		cmddata |= MMCCMD_WDATX;
 		if (data->flags == MMC_DATA_READ) {
@@ -494,18 +487,13 @@ static int davinci_mmc_probe(struct udevice *dev)
 	struct davinci_mmc_plat *plat = dev_get_platdata(dev);
 	struct davinci_mmc_priv *priv = dev_get_priv(dev);
 	struct mmc_config *cfg = &plat->cfg;
-	struct davinci_of_data *data =
-			(struct davinci_of_data *)dev_get_driver_data(dev);
+
 	cfg->f_min = 200000;
 	cfg->f_max = 25000000;
 	cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34,
 	cfg->host_caps = MMC_MODE_4BIT, /* DA850 supports only 4-bit SD/MMC */
 	cfg->b_max = DAVINCI_MAX_BLOCKS;
-
-	if (data) {
-		cfg->name = data->name;
-		priv->version = data->version;
-	}
+	cfg->name = "da830-mmc";
 
 	priv->reg_base = (struct davinci_mmc_regs *)dev_read_addr(dev);
 	priv->input_clk = clk_get(DAVINCI_MMCSD_CLKID);
@@ -528,28 +516,8 @@ static int davinci_mmc_bind(struct udevice *dev)
 	return mmc_bind(dev, &plat->mmc, &plat->cfg);
 }
 
-
-const struct davinci_of_data davinci_mmc_host_info[] = {
-	{
-		.name	= "dm6441-mmc",
-		.version = MMC_CTLR_VERSION_1,
-	},
-	{
-		.name	= "da830-mmc",
-		.version = MMC_CTLR_VERSION_2,
-	},
-	{},
-};
-
 static const struct udevice_id davinci_mmc_ids[] = {
-	{
-		.compatible = "ti,dm6441-mmc",
-		.data = (ulong) &davinci_mmc_host_info[MMC_CTLR_VERSION_1]
-	},
-	{
-		.compatible = "ti,da830-mmc",
-		.data = (ulong) &davinci_mmc_host_info[MMC_CTLR_VERSION_2]
-	},
+	{ .compatible = "ti,da830-mmc" },
 	{},
 };
 
-- 
2.23.0

  reply	other threads:[~2019-11-14 15:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 15:10 [U-Boot] [PATCH 0/4] omapl138_lcdk: fix MMC boot Bartosz Golaszewski
2019-11-14 15:10 ` Bartosz Golaszewski [this message]
2019-12-04  4:01   ` [U-Boot] [PATCH 1/4] mmc: davinci: drop support for ti, dm6441-mmc Tom Rini
2019-11-14 15:10 ` [U-Boot] [PATCH 2/4] mmc: davinci: drop struct davinci_mmc_plat Bartosz Golaszewski
2019-12-04  4:01   ` Tom Rini
2020-01-03 16:01   ` Adam Ford
2020-01-03 16:50     ` Bartosz Golaszewski
2020-01-03 16:59       ` Tom Rini
2020-01-03 17:26         ` Adam Ford
2019-11-14 15:10 ` [U-Boot] [PATCH 3/4] board: omapl138_lcdk: add the mmc device to SPL Bartosz Golaszewski
2019-12-04  4:02   ` Tom Rini
2019-11-14 15:10 ` [U-Boot] [PATCH 4/4] mmc: davinci: fix mmc boot in SPL Bartosz Golaszewski
2019-12-04  4:02   ` Tom Rini
2019-12-02  9:32 ` [U-Boot] [PATCH 0/4] omapl138_lcdk: fix MMC boot Bartosz Golaszewski
2019-12-02 11:54   ` Adam Ford

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=20191114151031.25309-2-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --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