[U-Boot] [RFC PATCH] ARM: Update phys_addr_t depending on CONFIG_PHYS_64BIT

Lokesh Vutla lokeshvutla at ti.com
Thu Oct 22 16:29:37 CEST 2015


Introduce CONFIG_PHYS_64BIT on ARM to deal with 32 bit ARM platforms
with large physical addresses.
This is inspired from commit e99ccb488181d0
("Introduce phys_size_t and move phys_addr_t into asm/types.h") done on
powerpc.

Signed-off-by: Lokesh Vutla <lokeshvutla at ti.com>
---
- This is needed for platforms like TI's DRA7 which support memory upto 4GB

 arch/arm/include/asm/io.h    | 4 ++--
 arch/arm/include/asm/types.h | 5 +++++
 2 files changed, 7 insertions(+), 2 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..58dfada 100644
--- a/arch/arm/include/asm/types.h
+++ b/arch/arm/include/asm/types.h
@@ -49,8 +49,13 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
+#ifdef CONFIG_PHYS_64BIT
+typedef unsigned long long phys_addr_t;
+typedef unsigned long long phys_size_t;
+#else
 typedef unsigned long phys_addr_t;
 typedef unsigned long phys_size_t;
+#endif
 
 #endif /* __KERNEL__ */
 
-- 
2.1.4



More information about the U-Boot mailing list