public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] arm: Allow u32 as addrs for readX/writeX
Date: Tue, 29 Mar 2016 17:46:14 +0200	[thread overview]
Message-ID: <56FAA346.10002@redhat.com> (raw)
In-Reply-To: <1459265351-19812-4-git-send-email-agraf@suse.de>

Hi,

On 03/29/2016 05:29 PM, Alexander Graf wrote:
> Gcc warns when you try to cast a u32 value into a pointer directly. When someone
> calls functions like readl or writel, he's pretty sure the parameter he passes
> is an address though, so we can as well cast it for him.
>
> This makes porting 32bit code to armv8 easier, as it means we don't have to
> touch common board code with explicit casts or UL redefines.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>

Albert can we have your ack for this please ? It is probably
easiest if I take the entire series upstream through the u-boot-sunxi
tree.

Regards,

Hans


> ---
>   arch/arm/include/asm/io.h | 18 +++++++++---------
>   1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index 75773bd..b85f4d7 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -67,15 +67,15 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
>    * read/writes.  We define __arch_*[bl] here, and leave __arch_*w
>    * to the architecture specific code.
>    */
> -#define __arch_getb(a)			(*(volatile unsigned char *)(a))
> -#define __arch_getw(a)			(*(volatile unsigned short *)(a))
> -#define __arch_getl(a)			(*(volatile unsigned int *)(a))
> -#define __arch_getq(a)			(*(volatile unsigned long long *)(a))
> -
> -#define __arch_putb(v,a)		(*(volatile unsigned char *)(a) = (v))
> -#define __arch_putw(v,a)		(*(volatile unsigned short *)(a) = (v))
> -#define __arch_putl(v,a)		(*(volatile unsigned int *)(a) = (v))
> -#define __arch_putq(v,a)		(*(volatile unsigned long long *)(a) = (v))
> +#define __arch_getb(a)			(*(volatile unsigned char *)(long)(a))
> +#define __arch_getw(a)			(*(volatile unsigned short *)(long)(a))
> +#define __arch_getl(a)			(*(volatile unsigned int *)(long)(a))
> +#define __arch_getq(a)			(*(volatile unsigned long long *)(long)(a))
> +
> +#define __arch_putb(v,a)		(*(volatile unsigned char *)(long)(a) = (v))
> +#define __arch_putw(v,a)		(*(volatile unsigned short *)(long)(a) = (v))
> +#define __arch_putl(v,a)		(*(volatile unsigned int *)(long)(a) = (v))
> +#define __arch_putq(v,a)		(*(volatile unsigned long long *)(long)(a) = (v))
>
>   static inline void __raw_writesb(unsigned long addr, const void *data,
>   				 int bytelen)
>

  reply	other threads:[~2016-03-29 15:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 15:29 [U-Boot] [PATCH 0/6] Add Pine64 support Alexander Graf
2016-03-29 15:29 ` [U-Boot] [PATCH 1/6] sunxi: Move cpu independent code to mach directory Alexander Graf
2016-03-29 15:29 ` [U-Boot] [PATCH 2/6] sunxi: Depend SPL configs on SUPPORT_SPL Alexander Graf
2016-03-29 15:29 ` [U-Boot] [PATCH 3/6] arm: Allow u32 as addrs for readX/writeX Alexander Graf
2016-03-29 15:46   ` Hans de Goede [this message]
2016-03-29 15:29 ` [U-Boot] [PATCH 4/6] sunxi: Explicitly cast u32 pointer conversions Alexander Graf
2016-03-29 15:29 ` [U-Boot] [PATCH 5/6] sunxi: Add support for Allwinner A64 SoCs Alexander Graf
2016-03-29 15:29 ` [U-Boot] [PATCH 6/6] sunxi: Add Pine64+ support Alexander Graf
2016-03-29 15:45 ` [U-Boot] [PATCH 0/6] Add Pine64 support Hans de Goede
2016-03-29 16:08   ` Alexander Graf
2016-03-30  7:35     ` Hans de Goede
2016-03-31 18:53     ` Hans de Goede
2016-03-31 19:15       ` Alexander Graf
2016-03-31 19:22         ` Hans de Goede
2016-03-31 19:23           ` Hans de Goede
2016-03-30 15:53 ` [U-Boot] [PATCH 7/6] sunxi: Reserve ATF memory space on A64 Alexander Graf
2016-04-01 11:06   ` Ian Campbell
2016-04-01 11:08     ` Alexander Graf
2016-04-01 11:12       ` Ian Campbell
2016-04-01 11:23         ` Alexander Graf
2016-04-13 19:46   ` Andre Przywara
2016-04-13 19:48     ` Alexander Graf
2016-04-13 20:10       ` André Przywara
2016-04-13 21:26         ` Alexander Graf

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=56FAA346.10002@redhat.com \
    --to=hdegoede@redhat.com \
    --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