|
@@ -25,9 +25,12 @@
|
|
|
|
|
|
#ifdef CONFIG_MMU
|
|
#ifdef CONFIG_MMU
|
|
|
|
|
|
|
|
+void __iomem *xtensa_ioremap_nocache(unsigned long addr, unsigned long size);
|
|
|
|
+void __iomem *xtensa_ioremap_cache(unsigned long addr, unsigned long size);
|
|
|
|
+void xtensa_iounmap(volatile void __iomem *addr);
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Return the virtual address for the specified bus memory.
|
|
* Return the virtual address for the specified bus memory.
|
|
- * Note that we currently don't support any address outside the KIO segment.
|
|
|
|
*/
|
|
*/
|
|
static inline void __iomem *ioremap_nocache(unsigned long offset,
|
|
static inline void __iomem *ioremap_nocache(unsigned long offset,
|
|
unsigned long size)
|
|
unsigned long size)
|
|
@@ -36,7 +39,7 @@ static inline void __iomem *ioremap_nocache(unsigned long offset,
|
|
&& offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
|
|
&& offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
|
|
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
|
|
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
|
|
else
|
|
else
|
|
- BUG();
|
|
|
|
|
|
+ return xtensa_ioremap_nocache(offset, size);
|
|
}
|
|
}
|
|
|
|
|
|
static inline void __iomem *ioremap_cache(unsigned long offset,
|
|
static inline void __iomem *ioremap_cache(unsigned long offset,
|
|
@@ -46,7 +49,7 @@ static inline void __iomem *ioremap_cache(unsigned long offset,
|
|
&& offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
|
|
&& offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
|
|
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
|
|
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
|
|
else
|
|
else
|
|
- BUG();
|
|
|
|
|
|
+ return xtensa_ioremap_cache(offset, size);
|
|
}
|
|
}
|
|
#define ioremap_cache ioremap_cache
|
|
#define ioremap_cache ioremap_cache
|
|
|
|
|
|
@@ -60,6 +63,13 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
|
|
|
|
|
|
static inline void iounmap(volatile void __iomem *addr)
|
|
static inline void iounmap(volatile void __iomem *addr)
|
|
{
|
|
{
|
|
|
|
+ unsigned long va = (unsigned long) addr;
|
|
|
|
+
|
|
|
|
+ if (!(va >= XCHAL_KIO_CACHED_VADDR &&
|
|
|
|
+ va - XCHAL_KIO_CACHED_VADDR < XCHAL_KIO_SIZE) &&
|
|
|
|
+ !(va >= XCHAL_KIO_BYPASS_VADDR &&
|
|
|
|
+ va - XCHAL_KIO_BYPASS_VADDR < XCHAL_KIO_SIZE))
|
|
|
|
+ xtensa_iounmap(addr);
|
|
}
|
|
}
|
|
|
|
|
|
#define virt_to_bus virt_to_phys
|
|
#define virt_to_bus virt_to_phys
|