[U-Boot] [PATCH v10 08/16] regmap: Add raw read/write functions

Mario Six mario.six at gdsys.cc
Mon Oct 15 07:17:27 UTC 2018


Hi Simon,
On Sat, Oct 13, 2018 at 3:52 PM Simon Glass <sjg at chromium.org> wrote:
>
> Hi Mario,
>
> On 4 October 2018 at 01:00, 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.
> >
> > Reviewed-by: Anatolij Gustschin <agust at denx.de>
> > Signed-off-by: Mario Six <mario.six at gdsys.cc>
> >
> > ---
> >
> > v9 -> v10:
> > * Switched to the read{b,w,l,q} and write{b,w,l,q} functions for
> >   register map access
> >
> > v8 -> v9:
> > * Removed forgotten "fpgamap" in documentation
> >
> > v7 -> v8:
> > No changes
> >
> > v6 -> v7:
> > * Fixed wrong variable type in 64-bit read (u32 -> u64)
> > * Added 64-bit case in write function
> >
> > v5 -> v6:
> > * Corrected format specifier
> > * Added support for 64-bit reads/writes
> >
> > v4 -> v5:
> > No changes
> >
> > v3 -> v4:
> > * Switched 'ranges[0] + offset' to 'ranges[0].start + offset'
> > * Explained the difference between the raw and non-raw read/write
> >   functions better in the docs
> >
> > v2 -> v3:
> > * Implement the "raw" functions from Linux instead of adding a size
> >   parameter to the regmap_{read,write} functions
> > * Fixed style violation
> > * Improved error handling
> >
> > v1 -> v2:
> > New in v2
> >
> > ---
> >  drivers/core/regmap.c | 64 +++++++++++++++++++++++++++++++++++++++++++++------
> >  include/regmap.h      | 58 ++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 115 insertions(+), 7 deletions(-)
>
> When applying this series I get various errors. Can you please take a look?
>
> https://travis-ci.org/sglass68/u-boot/builds/440419659
>
It seems that some architectures that implement readq/writeq do not implement
{in,out}_{be,le}64. I'll add some "#if defined" checks to resolve this, but I
think I'll have a closer look at that later, since I think every platform that
implements readq/writeq should also implement the in/out 64-bit macros.

> Regards,
> Simon
>
Best regards,
Mario


More information about the U-Boot mailing list