Skip to contentSkip to conversation

ARM: Update phys_addr_t depending on CONFIG_PHYS_64BIT

RFC PATCH New Lokesh Vutla 2 participants 2 messages Oct 22, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ARM: Update phys_addr_t depending on CONFIG_PHYS_64BIT

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.

---
- 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(-)
arch/arm/include/asm/io.h +2 -2
index bfbe0a0..75773bd 100644
@@ -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);
 }
 
 /*
arch/arm/include/asm/types.h +5 -0
index ee77c41..58dfada 100644
@@ -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__ */
 
Signature · 1 line
2.1.4
#1 lore raw

RFC PATCH 1/1 ARM: Update phys_addr_t depending on CONFIG_PHYS_64BIT

Quoted 7 lines · Lokesh Vutla

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.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151022/dc4756c1/attachment.sig>