summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2018-04-08 19:14:22 +0300
committerMarek Vasut <marek.vasut+renesas@gmail.com>2018-04-12 00:11:57 +0300
commit7cf7ef81ed8b57194b5c4408c05963b664d44229 (patch)
tree8743f8a2d0c90bb97fdb335217bdd0d8d7e953dd /drivers
parentc769e609907ccf838801433cdb89e73972f5550b (diff)
downloadu-boot-7cf7ef81ed8b57194b5c4408c05963b664d44229.tar.xz
mmc: renesas-sdhi: Handle 16bit IP
The Renesas RCar Gen2 chips have a mix of 32bit and 16bit variants of the IP. There is no DT property which allows discerning those, so what Linux does is it checks the size of the register area and if it is 0x100, the IP is 16bit, otherwise the IP is 32bit. Handle the distinction the same way. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/renesas-sdhi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c
index d6b3bfbadc..521574387b 100644
--- a/drivers/mmc/renesas-sdhi.c
+++ b/drivers/mmc/renesas-sdhi.c
@@ -41,6 +41,19 @@ static const struct udevice_id renesas_sdhi_match[] = {
static int renesas_sdhi_probe(struct udevice *dev)
{
u32 quirks = dev_get_driver_data(dev);
+ struct fdt_resource reg_res;
+ DECLARE_GLOBAL_DATA_PTR;
+ int ret;
+
+ ret = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
+ 0, &reg_res);
+ if (ret < 0) {
+ dev_err(dev, "\"reg\" resource not found, ret=%i\n", ret);
+ return ret;
+ }
+
+ if (quirks == 0 && fdt_resource_size(&reg_res) == 0x100)
+ quirks = MATSU_SD_CAP_16BIT;
return matsu_sd_probe(dev, quirks);
}