diff mbox

[02/10] clk: uniphier: use devm_get_addr() to get base address

Message ID 1458826368-2159-3-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit 45a3b1fd6ca524bebf5b9ce771ad1fb12f3514ce
Headers show

Commit Message

Masahiro Yamada March 24, 2016, 1:32 p.m. UTC
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>

---

 drivers/clk/uniphier/clk-uniphier-core.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

-- 
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox

Patch

diff --git a/drivers/clk/uniphier/clk-uniphier-core.c b/drivers/clk/uniphier/clk-uniphier-core.c
index e79e0ff..25c163b 100644
--- a/drivers/clk/uniphier/clk-uniphier-core.c
+++ b/drivers/clk/uniphier/clk-uniphier-core.c
@@ -8,13 +8,12 @@ 
 #include <mapmem.h>
 #include <linux/bitops.h>
 #include <linux/io.h>
+#include <linux/sizes.h>
 #include <clk.h>
 #include <dm/device.h>
 
 #include "clk-uniphier.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int uniphier_clk_enable(struct udevice *dev, int index)
 {
 	struct uniphier_clk_priv *priv = dev_get_priv(dev);
@@ -133,14 +132,12 @@  int uniphier_clk_probe(struct udevice *dev)
 {
 	struct uniphier_clk_priv *priv = dev_get_priv(dev);
 	fdt_addr_t addr;
-	fdt_size_t size;
 
-	addr = fdtdec_get_addr_size(gd->fdt_blob, dev->of_offset, "reg",
-				    &size);
+	addr = dev_get_addr(dev);
 	if (addr == FDT_ADDR_T_NONE)
 		return -EINVAL;
 
-	priv->base = map_sysmem(addr, size);
+	priv->base = map_sysmem(addr, SZ_4K);
 	if (!priv->base)
 		return -ENOMEM;