public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] Data types defined for 64 bit physical address
Date: Fri, 31 Jul 2015 12:20:45 -0500	[thread overview]
Message-ID: <1438363245.19345.16.camel@freescale.com> (raw)
In-Reply-To: <1438336405-9640-1-git-send-email-aneesh.bansal@freescale.com>

On Fri, 2015-07-31 at 15:23 +0530, Aneesh Bansal wrote:
> Data types and I/O functions have been defined for
> 64 bit physical addresses in arm and powerpc
> 
> Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
> ---
>  arch/arm/include/asm/io.h     |  4 +++-
>  arch/arm/include/asm/types.h  | 13 ++++++++-----
>  arch/powerpc/include/asm/io.h | 13 +++++++++++++
>  3 files changed, 24 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index bfbe0a0..09d192d 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -59,7 +59,7 @@ static inline void unmap_physmem(void *vaddr, unsigned 
> long flags)
>  
>  static inline phys_addr_t virt_to_phys(void * vaddr)
>  {
> -     return (phys_addr_t)(vaddr);
> +     return (phys_addr_t)((unsigned long)vaddr);
>  }

Unnecessary parens.

>  
>  /*
> @@ -183,9 +183,11 @@ static inline void __raw_readsl(unsigned long addr, 
> void *data, int longlen)
>  #define in_le32(a)   in_arch(l,le32,a)
>  #define in_le16(a)   in_arch(w,le16,a)
>  
> +#define out_be64(a, v)       out_arch(q, be64, a, v)
>  #define out_be32(a,v)        out_arch(l,be32,a,v)
>  #define out_be16(a,v)        out_arch(w,be16,a,v)
>  
> +#define in_be64(a)   in_arch(q, be64, a)
>  #define in_be32(a)   in_arch(l,be32,a)
>  #define in_be16(a)   in_arch(w,be16,a)

Inconsistent whitespace.

> diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
> index a5257e9..8c6f47e 100644
> --- a/arch/powerpc/include/asm/io.h
> +++ b/arch/powerpc/include/asm/io.h
> @@ -246,6 +246,19 @@ extern inline void out_be32(volatile unsigned __iomem 
> *addr, u32 val)
>       __asm__ __volatile__("sync; stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
>  }
>  
> +extern inline u64 in_be64(const u64 *addr)
> +{
> +     return ((u64)in_be32((u32 *)addr) << 32) |
> +     (in_be32((u32 *)addr + 1));
> +}
> +
> +extern inline void out_be64(u64 *addr, u64 val)
> +{
> +     out_be32((u32 *)addr, (u32)(val >> 32));
> +     out_be32((u32 *)addr + 1, (u32)val);
> +}

What do you need these for?  I don't think it's a good idea to have I/O 
accessors that look atomic but aren't (same goes for arm32).

-Scott

  reply	other threads:[~2015-07-31 17:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31  9:53 [U-Boot] [PATCH 2/3] Data types defined for 64 bit physical address Aneesh Bansal
2015-07-31 17:20 ` Scott Wood [this message]
2015-07-31 17:28   ` Bansal Aneesh
2015-07-31 17:37     ` Scott Wood
2015-07-31 18:32       ` Bansal Aneesh
2015-07-31 18:56         ` Scott Wood

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=1438363245.19345.16.camel@freescale.com \
    --to=scottwood@freescale.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