[U-Boot] [PATCH v2 22/51] x86: Allow I/O functions to use pointers

Bin Meng bmeng.cn at gmail.com
Mon Mar 14 06:38:46 CET 2016


On Sat, Mar 12, 2016 at 1:07 PM, Simon Glass <sjg at chromium.org> wrote:
> It is common with memory-mapped I/O to use the address of a structure member
> to access memory, as in:
>
>    struct some_regs {
>       u32 ctrl;
>       u32 data;
>    }
>
>    struct some_regs *regs = (struct some_regs *)BASE_ADDRESS;
>
>    writel(1, &reg->ctrl);
>    writel(2, &reg->data);
>
> This does not currently work with inl(), outl(), etc. Add a cast to permit
> this.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
> ---
>
> Changes in v2: None
>
>  arch/x86/include/asm/io.h | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>

applied to u-boot-x86/next, thanks!


More information about the U-Boot mailing list