aboutsummaryrefslogtreecommitdiff
path: root/drivers/ram
diff options
context:
space:
mode:
authorBin Meng <bin.meng@windriver.com>2020-09-15 16:05:07 +0800
committerAndes <uboot@andestech.com>2020-09-30 08:54:38 +0800
commit9981a8009e17fd51b74a4a58ba436998ebbf81ed (patch)
treed7aff2d59a8550c15982b3b57bfccb22eb1c93cd /drivers/ram
parentf8c9660bfe17100a27ca4cf28f957a25cb420255 (diff)
downloadu-boot-9981a8009e17fd51b74a4a58ba436998ebbf81ed.zip
u-boot-9981a8009e17fd51b74a4a58ba436998ebbf81ed.tar.gz
u-boot-9981a8009e17fd51b74a4a58ba436998ebbf81ed.tar.bz2
ram: sifive: Remove regmap dependency
The usage of regmap API in the SiFive RAM driver is not correct. The reg address should be obtained via dev_read_addr_index() API. Signed-off-by: Bin Meng <bin.meng@windriver.com>
Diffstat (limited to 'drivers/ram')
-rw-r--r--drivers/ram/sifive/fu540_ddr.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/ram/sifive/fu540_ddr.c b/drivers/ram/sifive/fu540_ddr.c
index f5b2873..60d4945 100644
--- a/drivers/ram/sifive/fu540_ddr.c
+++ b/drivers/ram/sifive/fu540_ddr.c
@@ -11,7 +11,6 @@
#include <fdtdec.h>
#include <init.h>
#include <ram.h>
-#include <regmap.h>
#include <syscon.h>
#include <asm/io.h>
#include <clk.h>
@@ -339,17 +338,12 @@ static int fu540_ddr_probe(struct udevice *dev)
priv->info.size = gd->ram_size;
#if defined(CONFIG_SPL_BUILD)
- struct regmap *map;
int ret;
u32 clock = 0;
debug("FU540 DDR probe\n");
priv->dev = dev;
- ret = regmap_init_mem(dev_ofnode(dev), &map);
- if (ret)
- return ret;
-
ret = clk_get_by_index(dev, 0, &priv->ddr_clk);
if (ret) {
debug("clk get failed %d\n", ret);
@@ -374,9 +368,9 @@ static int fu540_ddr_probe(struct udevice *dev)
return ret;
}
- priv->ctl = regmap_get_range(map, 0);
- priv->phy = regmap_get_range(map, 1);
- priv->physical_filter_ctrl = regmap_get_range(map, 2);
+ priv->ctl = (struct fu540_ddrctl *)dev_read_addr_index(dev, 0);
+ priv->phy = (struct fu540_ddrphy *)dev_read_addr_index(dev, 1);
+ priv->physical_filter_ctrl = (u32 *)dev_read_addr_index(dev, 2);
return fu540_ddr_setup(dev);
#endif