summaryrefslogtreecommitdiff
path: root/drivers/ram
diff options
context:
space:
mode:
authorJohan Jonker <jbx6244@gmail.com>2023-03-13 01:30:46 +0100
committerKever Yang <kever.yang@rock-chips.com>2023-05-06 17:28:18 +0800
commit0fbb96964b8574ca8012b2022cd0e431977fd340 (patch)
treee09485fee0bd6e656e655a72c7efe7396a9d3218 /drivers/ram
parentaecae81a35ddf24ae086a68f9c40836a1a174171 (diff)
downloadu-boot-0fbb96964b8574ca8012b2022cd0e431977fd340.tar.gz
u-boot-0fbb96964b8574ca8012b2022cd0e431977fd340.tar.bz2
u-boot-0fbb96964b8574ca8012b2022cd0e431977fd340.zip
core: remap: fix regmap_init_mem_plat() reg size handeling
The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so convert regmap_init_mem_plat() input to handel both. The syscon class driver also makes use of the regmap_init_mem_plat() function, but has no way of knowing the format of the device-specific platform data. In case of odd reg structures other then that the syscon class driver assumes the regmap must be filled in the individual syscon driver before pre-probe. Also fix the ARRAY_SIZE divider in the syscon class driver. Signed-off-by: Johan Jonker <jbx6244@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/ram')
-rw-r--r--drivers/ram/rockchip/sdram_rk3066.c2
-rw-r--r--drivers/ram/rockchip/sdram_rk3188.c2
-rw-r--r--drivers/ram/rockchip/sdram_rk322x.c2
-rw-r--r--drivers/ram/rockchip/sdram_rk3288.c2
-rw-r--r--drivers/ram/rockchip/sdram_rk3328.c2
-rw-r--r--drivers/ram/rockchip/sdram_rk3399.c2
6 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ram/rockchip/sdram_rk3066.c b/drivers/ram/rockchip/sdram_rk3066.c
index a2425f22e2..39c0be56a6 100644
--- a/drivers/ram/rockchip/sdram_rk3066.c
+++ b/drivers/ram/rockchip/sdram_rk3066.c
@@ -801,7 +801,7 @@ static int rk3066_dmc_conv_of_plat(struct udevice *dev)
memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
/* RK3066 supports dual-channel, set default channel num to 2. */
plat->num_channels = 1;
- ret = regmap_init_mem_plat(dev, of_plat->reg,
+ ret = regmap_init_mem_plat(dev, of_plat->reg, sizeof(of_plat->reg[0]),
ARRAY_SIZE(of_plat->reg) / 2, &plat->map);
if (ret)
return ret;
diff --git a/drivers/ram/rockchip/sdram_rk3188.c b/drivers/ram/rockchip/sdram_rk3188.c
index 272b1b2dce..ad9f936df5 100644
--- a/drivers/ram/rockchip/sdram_rk3188.c
+++ b/drivers/ram/rockchip/sdram_rk3188.c
@@ -867,7 +867,7 @@ static int conv_of_plat(struct udevice *dev)
memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
/* rk3188 supports dual-channel, set default channel num to 2 */
plat->num_channels = 1;
- ret = regmap_init_mem_plat(dev, of_plat->reg,
+ ret = regmap_init_mem_plat(dev, of_plat->reg, sizeof(of_plat->reg[0]),
ARRAY_SIZE(of_plat->reg) / 2, &plat->map);
if (ret)
return ret;
diff --git a/drivers/ram/rockchip/sdram_rk322x.c b/drivers/ram/rockchip/sdram_rk322x.c
index 1b204fb56e..892766a8b4 100644
--- a/drivers/ram/rockchip/sdram_rk322x.c
+++ b/drivers/ram/rockchip/sdram_rk322x.c
@@ -769,7 +769,7 @@ static int conv_of_plat(struct udevice *dev)
memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
plat->num_channels = 1;
- ret = regmap_init_mem_plat(dev, of_plat->reg,
+ ret = regmap_init_mem_plat(dev, of_plat->reg, sizeof(of_plat->reg[0]),
ARRAY_SIZE(of_plat->reg) / 2, &plat->map);
if (ret)
return ret;
diff --git a/drivers/ram/rockchip/sdram_rk3288.c b/drivers/ram/rockchip/sdram_rk3288.c
index 83778ad1c2..c99118fd61 100644
--- a/drivers/ram/rockchip/sdram_rk3288.c
+++ b/drivers/ram/rockchip/sdram_rk3288.c
@@ -1029,7 +1029,7 @@ static int conv_of_plat(struct udevice *dev)
memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
/* Rk3288 supports dual-channel, set default channel num to 2 */
plat->num_channels = 2;
- ret = regmap_init_mem_plat(dev, of_plat->reg,
+ ret = regmap_init_mem_plat(dev, of_plat->reg, sizeof(of_plat->reg[0]),
ARRAY_SIZE(of_plat->reg) / 2, &plat->map);
if (ret)
return ret;
diff --git a/drivers/ram/rockchip/sdram_rk3328.c b/drivers/ram/rockchip/sdram_rk3328.c
index 184c93f776..b5ca8ca436 100644
--- a/drivers/ram/rockchip/sdram_rk3328.c
+++ b/drivers/ram/rockchip/sdram_rk3328.c
@@ -54,7 +54,7 @@ static int conv_of_plat(struct udevice *dev)
struct dtd_rockchip_rk3328_dmc *dtplat = &plat->dtplat;
int ret;
- ret = regmap_init_mem_plat(dev, dtplat->reg,
+ ret = regmap_init_mem_plat(dev, dtplat->reg, sizeof(dtplat->reg[0]),
ARRAY_SIZE(dtplat->reg) / 2, &plat->map);
if (ret)
return ret;
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index 8993245252..2bf8d48d25 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -3050,7 +3050,7 @@ static int conv_of_plat(struct udevice *dev)
struct dtd_rockchip_rk3399_dmc *dtplat = &plat->dtplat;
int ret;
- ret = regmap_init_mem_plat(dev, dtplat->reg,
+ ret = regmap_init_mem_plat(dev, dtplat->reg, sizeof(dtplat->reg[0]),
ARRAY_SIZE(dtplat->reg) / 2, &plat->map);
if (ret)
return ret;