summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-03-24 22:32:42 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-04-01 00:17:19 +0900
commit4f80501b91c06b215e66db12ee778c767124cb13 (patch)
treeb668c0dd3899c55c7272166e64b4a3f8deab7052 /drivers/mmc
parentbc82a1310fd00f18c1f68596751540459acafb8c (diff)
downloadtalos-obmc-uboot-4f80501b91c06b215e66db12ee778c767124cb13.tar.gz
talos-obmc-uboot-4f80501b91c06b215e66db12ee778c767124cb13.zip
mmc: uniphier: use devm_get_addr() to get base address
Currently, fdtdec_get_addr_size() does not support the address translation, so it cannot handle device trees with non-straight "ranges" properties. (This would be a problem with DTS for UniPhier ARMv8 SoCs.) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/uniphier-sd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c
index 3bc4d942a0..81a80cdbc2 100644
--- a/drivers/mmc/uniphier-sd.c
+++ b/drivers/mmc/uniphier-sd.c
@@ -12,6 +12,7 @@
#include <dm/device.h>
#include <linux/compat.h>
#include <linux/io.h>
+#include <linux/sizes.h>
#include <asm/unaligned.h>
#include <asm/dma-mapping.h>
@@ -650,15 +651,17 @@ int uniphier_sd_probe(struct udevice *dev)
struct uniphier_sd_priv *priv = dev_get_priv(dev);
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
fdt_addr_t base;
- fdt_size_t size;
struct udevice *clk_dev;
int clk_id;
int ret;
priv->dev = dev;
- base = fdtdec_get_addr_size(gd->fdt_blob, dev->of_offset, "reg", &size);
- priv->regbase = map_sysmem(base, size);
+ base = dev_get_addr(dev);
+ if (base == FDT_ADDR_T_NONE)
+ return -EINVAL;
+
+ priv->regbase = map_sysmem(base, SZ_2K);
if (!priv->regbase)
return -ENOMEM;
OpenPOWER on IntegriCloud