From: Scott Wood <oss@buserror.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3][v3] Data types defined for 64 bit physical address
Date: Tue, 09 Feb 2016 23:10:33 -0600 [thread overview]
Message-ID: <1455081033.2463.2.camel@buserror.net> (raw)
In-Reply-To: <AM4PR0401MB17322280B3070FF1D1C8FB089AD70@AM4PR0401MB1732.eurprd04.prod.outlook.com>
On Wed, 2016-02-10 at 02:30 +0000, york sun wrote:
> On 09/17/2015 03:48 AM, Aneesh Bansal wrote:
> > Data types and I/O functions have been defined for
> > 64 bit physical addresses in arm.
> >
> > Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
> > ---
> > Changes in v3:
> > Corrected the definition of virt_to_phys() and definition of phys_addr_t.
> >
> > arch/arm/include/asm/io.h | 4 ++--
> > arch/arm/include/asm/types.h | 10 +++++++---
> > 2 files changed, 9 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> > index bfbe0a0..75773bd 100644
> > --- a/arch/arm/include/asm/io.h
> > +++ b/arch/arm/include/asm/io.h
> > @@ -46,7 +46,7 @@ static inline void sync(void)
> > static inline void *
> > map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
> > {
> > - return (void *)paddr;
> > + return (void *)((unsigned long)paddr);
> > }
> >
> > /*
> > @@ -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);
> > }
> >
> > /*
> > diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
> > index ee77c41..388058e 100644
> > --- a/arch/arm/include/asm/types.h
> > +++ b/arch/arm/include/asm/types.h
> > @@ -45,12 +45,16 @@ typedef unsigned long long u64;
> > #define BITS_PER_LONG 32
> > #endif /* CONFIG_ARM64 */
> >
> > -/* Dma addresses are 32-bits wide. */
> > -
> > +#ifdef CONFIG_PHYS_64BIT
> > +typedef unsigned long long dma_addr_t;
> > +typedef unsigned long long phys_addr_t;
> > +typedef unsigned long long phys_size_t;
> > +#else
> > +/* DMA addresses are 32-bits wide */
> > typedef u32 dma_addr_t;
> > -
> > typedef unsigned long phys_addr_t;
> > typedef unsigned long phys_size_t;
> > +#endif
> >
> > #endif /* __KERNEL__ */
> >
> >
>
> Aneesh and Scott,
>
> I need to revisit this patch. Would it be better to change it as below?
>
> +#if defined(CONFIG_PHYS_64BIT) && !defined(CONFIG_ARM64)
> +typedef unsigned long long dma_addr_t;
> +typedef unsigned long long phys_addr_t;
> +typedef unsigned long long phys_size_t;
> +#else
> +/* DMA addresses are 32-bits wide */
> typedef u32 dma_addr_t;
> -
> typedef unsigned long phys_addr_t;
> typedef unsigned long phys_size_t;
> +#endif
>
> I am debugging another patch and found changing phys_addr_t makes some
> trouble
> for ARM64, especially to mix with ulong.
What sort of trouble is it causing? And why would you mix it with ulong?
-Scott
next prev parent reply other threads:[~2016-02-10 5:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 10:46 [U-Boot] [PATCH 1/3][v3] Pointers in ESBC header made 32 bit Aneesh Bansal
2015-09-17 10:46 ` [U-Boot] [PATCH 2/3][v3] Data types defined for 64 bit physical address Aneesh Bansal
2015-10-30 16:15 ` York Sun
2016-02-10 2:30 ` york sun
2016-02-10 5:10 ` Scott Wood [this message]
2016-02-10 5:20 ` york sun
2016-02-11 5:53 ` Aneesh Bansal
2016-02-23 1:38 ` Scott Wood
2016-02-23 2:05 ` york sun
2015-09-17 10:46 ` [U-Boot] [PATCH 3/3][v3] crypto/fsl: SEC driver cleanup for 64 bit and endianness Aneesh Bansal
2015-10-15 16:49 ` York Sun
2015-10-16 6:20 ` Bansal Aneesh
2015-10-30 16:14 ` [U-Boot] [PATCH 1/3][v3] Pointers in ESBC header made 32 bit York Sun
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=1455081033.2463.2.camel@buserror.net \
--to=oss@buserror.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.