From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5] mmc: uniphier-sd: Add support for quirks
Date: Fri, 21 Jul 2017 23:24:35 +0200 [thread overview]
Message-ID: <20170721212436.26073-4-marek.vasut+renesas@gmail.com> (raw)
In-Reply-To: <20170721212436.26073-1-marek.vasut+renesas@gmail.com>
Check if the OF match has any associated data and if so, use those
data as the controller quirks, otherwise fallback to the old method
of reading the controller version register to figure out the quirks.
This allows us to supply controller quirks on controllers which ie.
do not have version register.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/mmc/uniphier-sd.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c
index 07436f6ef6..c22c64cdfb 100644
--- a/drivers/mmc/uniphier-sd.c
+++ b/drivers/mmc/uniphier-sd.c
@@ -751,6 +751,7 @@ static int uniphier_sd_probe(struct udevice *dev)
struct uniphier_sd_plat *plat = dev_get_platdata(dev);
struct uniphier_sd_priv *priv = dev_get_priv(dev);
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
+ const u32 quirks = dev_get_driver_data(dev);
fdt_addr_t base;
struct clk clk;
int ret;
@@ -802,18 +803,22 @@ static int uniphier_sd_probe(struct udevice *dev)
return -EINVAL;
}
+ if (quirks) {
+ priv->caps = quirks;
+ } else {
+ priv->version = uniphier_sd_readl(priv, UNIPHIER_SD_VERSION) &
+ UNIPHIER_SD_VERSION_IP;
+ dev_dbg(dev, "version %x\n", priv->version);
+ if (priv->version >= 0x10) {
+ priv->caps |= UNIPHIER_SD_CAP_DMA_INTERNAL;
+ priv->caps |= UNIPHIER_SD_CAP_DIV1024;
+ }
+ }
+
if (fdt_get_property(gd->fdt_blob, dev_of_offset(dev), "non-removable",
NULL))
priv->caps |= UNIPHIER_SD_CAP_NONREMOVABLE;
- priv->version = uniphier_sd_readl(priv, UNIPHIER_SD_VERSION) &
- UNIPHIER_SD_VERSION_IP;
- dev_dbg(dev, "version %x\n", priv->version);
- if (priv->version >= 0x10) {
- priv->caps |= UNIPHIER_SD_CAP_DMA_INTERNAL;
- priv->caps |= UNIPHIER_SD_CAP_DIV1024;
- }
-
uniphier_sd_host_init(priv);
plat->cfg.voltages = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34;
@@ -828,7 +833,7 @@ static int uniphier_sd_probe(struct udevice *dev)
}
static const struct udevice_id uniphier_sd_match[] = {
- { .compatible = "socionext,uniphier-sdhc" },
+ { .compatible = "socionext,uniphier-sdhc", .data = 0 },
{ /* sentinel */ }
};
--
2.11.0
next prev parent reply other threads:[~2017-07-21 21:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170721212451epcas1p4f79a1439eee9bb5cba0b23204b9c8412@epcas1p4.samsung.com>
2017-07-21 21:24 ` [U-Boot] [PATCH 1/5] mmc: uniphier-sd: Factor out register IO Marek Vasut
2017-07-21 21:24 ` [U-Boot] [PATCH 2/5] mmc: uniphier-sd: Add support for 64bit controller Marek Vasut
2017-07-21 21:24 ` [U-Boot] [PATCH 3/5] mmc: uniphier-sd: Add support for 64bit FIFO Marek Vasut
2017-08-03 12:40 ` Masahiro Yamada
2017-07-21 21:24 ` Marek Vasut [this message]
2017-07-21 21:24 ` [U-Boot] [PATCH 5/5] mmc: uniphier-sd: Add support for R8A7795 and R7A7796 Marek Vasut
2017-08-03 12:36 ` [U-Boot] [PATCH 1/5] mmc: uniphier-sd: Factor out register IO Masahiro Yamada
2017-08-05 19:23 ` Marek Vasut
2017-08-07 2:30 ` Masahiro Yamada
2017-08-07 8:30 ` Marek Vasut
2017-08-10 7:49 ` Masahiro Yamada
2017-08-12 16:55 ` Marek Vasut
2017-08-17 6:39 ` Jaehoon Chung
2017-08-17 7:01 ` Masahiro Yamada
2017-08-17 11:56 ` Marek Vasut
2017-08-20 14:24 ` Masahiro Yamada
2017-08-17 6:55 ` Masahiro Yamada
2017-08-17 6:47 ` Jaehoon Chung
2017-08-07 9:24 [U-Boot] [PATCH V2 " Marek Vasut
2017-08-07 9:24 ` [U-Boot] [PATCH 4/5] mmc: uniphier-sd: Add support for quirks Marek Vasut
-- strict thread matches above, loose matches on Subject: below --
2017-08-20 15:11 [U-Boot] [PATCH V3 1/5] mmc: uniphier-sd: Factor out register IO Marek Vasut
2017-08-20 15:11 ` [U-Boot] [PATCH 4/5] mmc: uniphier-sd: Add support for quirks Marek Vasut
2017-08-20 15:45 ` Masahiro Yamada
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=20170721212436.26073-4-marek.vasut+renesas@gmail.com \
--to=marek.vasut@gmail.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