From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 07/13] regmap: Add raw read/write functions
Date: Thu, 2 Aug 2018 00:01:27 +0200 [thread overview]
Message-ID: <20180802000127.0cd31200@crub> (raw)
In-Reply-To: <20180731100110.4852-7-mario.six@gdsys.cc>
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@gdsys.cc>
Reviewed-by: Anatolij Gustschin <agust@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
next prev parent reply other threads:[~2018-08-01 22:01 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-31 10:00 [U-Boot] [PATCH v3 01/13] test: regmap: Increase size of syscon0 memory Mario Six
2018-07-31 10:00 ` [U-Boot] [PATCH v3 02/13] regmap: Fix documentation Mario Six
2018-08-01 21:24 ` Anatolij Gustschin
2018-08-02 16:56 ` Simon Glass
2018-08-03 7:41 ` Mario Six
2018-07-31 10:01 ` [U-Boot] [PATCH v3 03/13] regmap: Add documentation Mario Six
2018-08-01 21:25 ` Anatolij Gustschin
2018-08-02 16:56 ` Simon Glass
2018-07-31 10:01 ` [U-Boot] [PATCH v3 04/13] regmap: Improve error handling Mario Six
2018-08-01 21:26 ` Anatolij Gustschin
2018-08-02 16:56 ` Simon Glass
2018-07-31 10:01 ` [U-Boot] [PATCH v3 05/13] regmap: Introduce init_range Mario Six
2018-08-01 21:36 ` Anatolij Gustschin
2018-08-02 12:21 ` Simon Glass
2018-08-03 7:21 ` Mario Six
2018-07-31 10:01 ` [U-Boot] [PATCH v3 06/13] regmap: Add error output Mario Six
2018-08-01 21:38 ` Anatolij Gustschin
2018-08-02 12:21 ` Simon Glass
2018-07-31 10:01 ` [U-Boot] [PATCH v3 07/13] regmap: Add raw read/write functions Mario Six
2018-08-01 22:01 ` Anatolij Gustschin [this message]
2018-08-03 7:02 ` Mario Six
2018-08-02 12:20 ` Simon Glass
2018-08-03 7:04 ` Mario Six
2018-07-31 10:01 ` [U-Boot] [PATCH v3 08/13] regmap: Support reading from specific range Mario Six
2018-08-01 22:10 ` Anatolij Gustschin
2018-07-31 10:01 ` [U-Boot] [PATCH v3 09/13] regmap: Define regmap_{get,set} Mario Six
2018-08-01 22:18 ` Anatolij Gustschin
2018-07-31 10:01 ` [U-Boot] [PATCH v3 10/13] test: regmap: Add test for regmap_{set, get} Mario Six
2018-08-01 22:20 ` Anatolij Gustschin
2018-08-02 12:20 ` Simon Glass
2018-07-31 10:01 ` [U-Boot] [PATCH v3 11/13] misc: Sort Makefile entries Mario Six
2018-08-01 22:26 ` Anatolij Gustschin
2018-08-02 12:20 ` Simon Glass
2018-07-31 10:01 ` [U-Boot] [PATCH v3 12/13] misc: Add gdsys_soc driver Mario Six
2018-08-02 16:56 ` Simon Glass
2018-07-31 10:01 ` [U-Boot] [PATCH v3 13/13] misc: Add IHS FPGA driver Mario Six
2018-08-02 16:56 ` Simon Glass
2018-08-03 7:32 ` Mario Six
2018-08-01 21:23 ` [U-Boot] [PATCH v3 01/13] test: regmap: Increase size of syscon0 memory Anatolij Gustschin
2018-08-02 16:56 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180802000127.0cd31200@crub \
--to=agust@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox