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

Mario Six mario.six at gdsys.cc
Fri Aug 3 07:02:49 UTC 2018


Hi Anatolij,

On Thu, Aug 2, 2018 at 12:01 AM, Anatolij Gustschin <agust at denx.de> wrote:
> 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.
>

Yes, better be explicit here. I'll have that fixed in v4.

> ...
>> +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 ?
>

Dito, will be fixed in v4.

Thanks for reviewing!

> --
> Anatolij
>

Best regards,
Mario


More information about the U-Boot mailing list