[U-Boot] [PATCH v3 07/13] regmap: Add raw read/write functions

Anatolij Gustschin agust at denx.de
Wed Aug 1 22:01:27 UTC 2018


Hi Mario,

On Tue, 31 Jul 2018 12:01:04 +0200
Mario Six mario.six at gdsys.cc wrote:

> The regmap functions currently assume that all register map accesses
> have a data width of 32 bits, but there are maps that have different
> widths.
> 
> To rectify this, implement the regmap_raw_read and regmap_raw_write
> functions from the Linux kernel API that specify the width of a desired
> read or write operation on a regmap.
> 
> Implement the regmap_read and regmap_write functions using these raw
> functions in a backwards-compatible manner.
> 
> Signed-off-by: Mario Six <mario.six at gdsys.cc>

Reviewed-by: Anatolij Gustschin <agust at denx.de>

Please see some comments below.

...
> +int regmap_raw_read(struct regmap *map, uint offset, void *valp, size_t val_len)
> +{
> +	void *ptr;
> +
> +	ptr = map_physmem(map->ranges[0] + offset, val_len, MAP_NOCACHE);

shouldn't this be

       ptr = map_physmem(map->ranges[0].start + offset, val_len, MAP_NOCACHE);
?

It works as is, but it is better to be explicit about the start address.

...
> +int regmap_raw_write(struct regmap *map, uint offset, const void *val,
> +		     size_t val_len)
> +{
> +	void *ptr;
> +
> +	ptr = map_physmem(map->ranges[0] + offset, val_len, MAP_NOCACHE);

map->ranges[0].start + offset ?

--
Anatolij


More information about the U-Boot mailing list