[PATCH v3 03/11] core: remap: convert regmap_init_mem_plat() input to phys_addr_t

Simon Glass sjg at chromium.org
Fri Feb 17 03:54:58 CET 2023


Hi Johan,

On Thu, 16 Feb 2023 at 10:58, Johan Jonker <jbx6244 at gmail.com> wrote:
>
> 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 phys_addr_t in files
> that use this function.
>
> Signed-off-by: Johan Jonker <jbx6244 at gmail.com>
> Reviewed-by: Kever Yang <kever.yang at rock-chips.com>
> ---
>  drivers/core/regmap.c               | 2 +-
>  drivers/core/syscon-uclass.c        | 2 +-
>  drivers/ram/rockchip/sdram_rk3066.c | 2 +-
>  drivers/ram/rockchip/sdram_rk3188.c | 2 +-
>  drivers/ram/rockchip/sdram_rk322x.c | 2 +-
>  drivers/ram/rockchip/sdram_rk3288.c | 2 +-
>  drivers/ram/rockchip/sdram_rk3328.c | 2 +-
>  drivers/ram/rockchip/sdram_rk3399.c | 2 +-
>  include/regmap.h                    | 2 +-
>  9 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c
> index e33bb9d7..37da64b2 100644
> --- a/drivers/core/regmap.c
> +++ b/drivers/core/regmap.c
> @@ -79,7 +79,7 @@ static struct regmap *regmap_alloc(int count)
>  }
>
>  #if CONFIG_IS_ENABLED(OF_PLATDATA)
> -int regmap_init_mem_plat(struct udevice *dev, fdt_val_t *reg, int count,
> +int regmap_init_mem_plat(struct udevice *dev, phys_addr_t *reg, int count,
>                          struct regmap **mapp)
>  {
>         struct regmap_range *range;
> diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c
> index 25fdb66e..69b66773 100644
> --- a/drivers/core/syscon-uclass.c
> +++ b/drivers/core/syscon-uclass.c
> @@ -58,7 +58,7 @@ static int syscon_pre_probe(struct udevice *dev)
>  #if CONFIG_IS_ENABLED(OF_PLATDATA)
>         struct syscon_base_plat *plat = dev_get_plat(dev);
>
> -       return regmap_init_mem_plat(dev, plat->reg, ARRAY_SIZE(plat->reg),
> +       return regmap_init_mem_plat(dev, (phys_addr_t *)plat->reg, ARRAY_SIZE(plat->reg),
>                                         &priv->regmap);

That cast does not seem very safe. Should we add a new init function
with that type, instead?

Regards,
Simon


More information about the U-Boot mailing list