Hello.

Cyril Chemparathy wrote:

This patch allows for a more flexible ioremap() interception based on iotable
contents.

SoCs that need ioremap() to fill up davinci_soc_info may directly call
davinci_io_init() and use ioremap() as needed.  Such SoCs must not fill
io_desc and io_desc_num entries in struct davinci_soc_info.

Signed-off-by: Cyril Chemparathy <[email protected]>
Tested-by: Sandeep Paulraj <[email protected]>
---
v4: removed __davinci_ioremap() and related infrastructure
v4: split davinci_io_init() out of davinci_common_init()

[...]

diff --git a/arch/arm/mach-davinci/io.c b/arch/arm/mach-davinci/io.c
index a1c0b6b..81862ec 100644
--- a/arch/arm/mach-davinci/io.c
+++ b/arch/arm/mach-davinci/io.c
[...]
@@ -36,3 +48,30 @@ void davinci_iounmap(volatile void __iomem *addr)
                __iounmap(addr);
 }
 EXPORT_SYMBOL(davinci_iounmap);
+
+void __init davinci_io_init(struct map_desc *desc, unsigned long desc_num)
+{
+       if (!desc || !desc_num)
+               return;
+
+       /* silently refuse to init twice ...*/
+       if (davinci_io_desc) {
+               /* ... unless things change */
+               BUG_ON(davinci_io_desc != desc ||
+                       davinci_io_desc_num != desc_num);
+               return;
+       }
+
+       davinci_io_desc = desc;
+       davinci_io_desc_num = desc_num;
+
+       iotable_init(desc, desc_num);
+
+       /*
+        * Normally devicemaps_init() would flush caches and tlb after
+        * mdesc->map_io(), but we must also do it here because of the CPU
+        * revision check below.

This comments needs fixing as there's no revision check below -- it's in different file now. :-)

+        */
+       local_flush_tlb_all();
+       flush_cache_all();
+}

WBR, Sergei

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to