On Sat, 2010-10-09 at 03:41 +0100, Nicolas Pitre wrote:
We could be a bit more flexible as a temporary solution. But that's a
hack and doesn't guarantee the attributes that the driver requested. If
the driver would use writel/readl, that's not too bad since we pushed
explicit barriers in these macros.
It would need to be improved to invalidate the corresponding cache lines
(using the DMA API?) but it would look even worse.
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 6bdf42c..082bbd0 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -204,10 +204,13 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
#endif
/*
- * Don't allow RAM to be mapped - this causes problems with ARMv6+
+ * Don't allow RAM to be mapped as Device memory - this causes
+ * problems with ARMv6+
*/
if (WARN_ON(pfn_valid(pfn)))
- return NULL;
+ if (__LINUX_ARM_ARCH__ >= 6 &&
+ (mtype != MT_DEVICE_CACHED || mtype != MT_DEVICE_WC))
+ mtype = MT_DEVICE_WC;
type = get_mem_type(mtype);
if (!type)
--
Catalin
--