[U-Boot] [PATCH v4 1/4] Introduce virt_to_phys()

Haavard Skinnemoen haavard.skinnemoen at atmel.com
Wed Dec 17 16:47:03 CET 2008


Kumar Gala wrote:
> diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
> index 06e52b1..d22cd35 100644
> --- a/include/asm-avr32/io.h
> +++ b/include/asm-avr32/io.h
> @@ -125,4 +125,9 @@ static inline void unmap_physmem(void *vaddr, unsigned long len)
>  
>  }
>  
> +static inline phys_addr_t virt_to_phys(void * vaddr)
> +{
> +	return (phys_addr_t)(vaddr);
> +}
> +

avr32 has already got one of those, so this breaks the build.

I'm going to apply the patch below to my 'fixes' branch if it looks ok
to you.

Haavard

From 92c78a3bbcb2ce508b4bf1c4a1e0940406a024bb Mon Sep 17 00:00:00 2001
From: Haavard Skinnemoen <haavard.skinnemoen at atmel.com>
Date: Wed, 17 Dec 2008 16:43:18 +0100
Subject: [PATCH] avr32: Remove second definition of virt_to_phys()

The second definition introduced by 65e43a1063 conflicts with the
existing one.

Also, convert the existing definition to use phys_addr_t. The volatile
qualifier is still needed due to brain damage elsewhere.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen at atmel.com>
---
 include/asm-avr32/io.h |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index d22cd35..50967ac 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -76,12 +76,12 @@ extern void __readwrite_bug(const char *fn);
 #include <asm/addrspace.h>
 
 /* virt_to_phys will only work when address is in P1 or P2 */
-static __inline__ unsigned long virt_to_phys(volatile void *address)
+static inline phys_addr_t virt_to_phys(volatile void *address)
 {
 	return PHYSADDR(address);
 }
 
-static __inline__ void * phys_to_virt(unsigned long address)
+static inline void *phys_to_virt(phys_addr_t address)
 {
 	return (void *)P1SEGADDR(address);
 }
@@ -125,9 +125,4 @@ static inline void unmap_physmem(void *vaddr, unsigned long len)
 
 }
 
-static inline phys_addr_t virt_to_phys(void * vaddr)
-{
-	return (phys_addr_t)(vaddr);
-}
-
 #endif /* __ASM_AVR32_IO_H */
-- 
1.5.6.3



More information about the U-Boot mailing list