public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [Patch v4 1/5] Added 64-bit MMIO accessors for ARMv8
@ 2014-05-29 20:49 York Sun
  2014-05-29 20:49 ` [U-Boot] [Patch v4 2/5] ARMv8: Adjust MMU setup York Sun
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: York Sun @ 2014-05-29 20:49 UTC (permalink / raw)
  To: u-boot

From: "J. German Rivera" <German.Rivera@freescale.com>

This is needed for accessing peripherals with 64-bit MMIO registers,
from ARMv8 processors.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
---
Change log
 v4: no change
 v3: no change

 arch/arm/include/asm/io.h |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 6a1f05a..95528dd 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -70,10 +70,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 #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))
 
 extern inline void __raw_writesb(unsigned long addr, const void *data,
 				 int bytelen)
@@ -123,10 +125,12 @@ extern inline void __raw_readsl(unsigned long addr, void *data, int longlen)
 #define __raw_writeb(v,a)	__arch_putb(v,a)
 #define __raw_writew(v,a)	__arch_putw(v,a)
 #define __raw_writel(v,a)	__arch_putl(v,a)
+#define __raw_writeq(v,a)	__arch_putq(v,a)
 
 #define __raw_readb(a)		__arch_getb(a)
 #define __raw_readw(a)		__arch_getw(a)
 #define __raw_readl(a)		__arch_getl(a)
+#define __raw_readq(a)		__arch_getq(a)
 
 /*
  * TODO: The kernel offers some more advanced versions of barriers, it might
@@ -139,10 +143,12 @@ extern inline void __raw_readsl(unsigned long addr, void *data, int longlen)
 #define writeb(v,c)	({ u8  __v = v; __iowmb(); __arch_putb(__v,c); __v; })
 #define writew(v,c)	({ u16 __v = v; __iowmb(); __arch_putw(__v,c); __v; })
 #define writel(v,c)	({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; })
+#define writeq(v,c)	({ u64 __v = v; __iowmb(); __arch_putq(__v,c); __v; })
 
 #define readb(c)	({ u8  __v = __arch_getb(c); __iormb(); __v; })
 #define readw(c)	({ u16 __v = __arch_getw(c); __iormb(); __v; })
 #define readl(c)	({ u32 __v = __arch_getl(c); __iormb(); __v; })
+#define readq(c)	({ u64 __v = __arch_getq(c); __iormb(); __v; })
 
 /*
  * The compiler seems to be incapable of optimising constants
@@ -168,9 +174,11 @@ extern inline void __raw_readsl(unsigned long addr, void *data, int longlen)
 #define out_arch(type,endian,a,v)	__raw_write##type(cpu_to_##endian(v),a)
 #define in_arch(type,endian,a)		endian##_to_cpu(__raw_read##type(a))
 
+#define out_le64(a,v)	out_arch(q,le64,a,v)
 #define out_le32(a,v)	out_arch(l,le32,a,v)
 #define out_le16(a,v)	out_arch(w,le16,a,v)
 
+#define in_le64(a)	in_arch(q,le64,a)
 #define in_le32(a)	in_arch(l,le32,a)
 #define in_le16(a)	in_arch(w,le16,a)
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2014-06-18 15:44 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-29 20:49 [U-Boot] [Patch v4 1/5] Added 64-bit MMIO accessors for ARMv8 York Sun
2014-05-29 20:49 ` [U-Boot] [Patch v4 2/5] ARMv8: Adjust MMU setup York Sun
2014-06-02 11:34   ` Mark Rutland
2014-06-02 16:06     ` York Sun
2014-06-02 18:01       ` Mark Rutland
2014-06-04 16:27         ` York Sun
2014-06-05 10:09           ` Mark Rutland
2014-06-05 15:07             ` York Sun
2014-06-05 17:41               ` Mark Rutland
2014-06-05 18:34                 ` York Sun
2014-06-06 12:33                   ` Mark Rutland
2014-06-06 14:54                     ` York Sun
2014-06-06 17:32                       ` Mark Rutland
2014-06-06 17:37                         ` York Sun
2014-06-06 20:17                         ` York Sun
2014-06-06 22:14                           ` York Sun
2014-06-10  9:15                             ` Mark Rutland
2014-06-10 16:04                               ` York Sun
2014-06-13 19:41                               ` York Sun
2014-06-18 14:09                                 ` fenghua at phytium.com.cn
2014-06-18 15:44                                   ` York Sun
2014-06-06 13:34                   ` Rob Herring
2014-06-06 14:52                     ` York Sun
2014-06-06 16:09                       ` Tom Rini
2014-05-29 20:49 ` [U-Boot] [Patch v4 3/5] ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC York Sun
2014-06-11 14:05   ` fenghua at phytium.com.cn
2014-06-11 14:55     ` York Sun
2014-05-29 20:49 ` [U-Boot] [Patch v4 4/5] armv8/fsl-lsch3: Add support to load and start MC Firmware York Sun
2014-05-29 20:49 ` [U-Boot] [Patch v4 5/5] ARMv8/ls2100a_emu: Add LS2100A emulator and simulator board support York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox