[MTD] XIP: Use generic xip_iprefetch() instead of asm volatile (...)
authorPaulius Zaleckas <paulius.zaleckas@teltonika.lt>
Tue, 26 Feb 2008 23:42:39 +0000 (01:42 +0200)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 22 Apr 2008 18:47:42 +0000 (19:47 +0100)
Untested, but shouldn't break anything... Makes MTD_XIP arch
independent. I guess this is why xip_iprefetch() was made for.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/chips/cfi_cmdset_0001.c
drivers/mtd/chips/cfi_cmdset_0002.c
drivers/mtd/chips/cfi_probe.c
drivers/mtd/chips/cfi_util.c

index 81b7767a665aa053ebffd4c716da847d40edc01a..eb0e30824ddbf623681d52bfbd38305e060d85b2 100644 (file)
@@ -1071,10 +1071,10 @@ static int __xipram xip_wait_for_operation(
                        chip->state = newstate;
                        map_write(map, CMD(0xff), adr);
                        (void) map_read(map, adr);
-                       asm volatile (".rep 8; nop; .endr");
+                       xip_iprefetch();
                        local_irq_enable();
                        spin_unlock(chip->mutex);
-                       asm volatile (".rep 8; nop; .endr");
+                       xip_iprefetch();
                        cond_resched();
 
                        /*
index 458d477614d680c0fb718e20e16ee6692fc71a8a..5cd657322bc4c1b72b8887f80a000c30f6d77047 100644 (file)
@@ -723,10 +723,10 @@ static void __xipram xip_udelay(struct map_info *map, struct flchip *chip,
                        chip->erase_suspended = 1;
                        map_write(map, CMD(0xf0), adr);
                        (void) map_read(map, adr);
-                       asm volatile (".rep 8; nop; .endr");
+                       xip_iprefetch();
                        local_irq_enable();
                        spin_unlock(chip->mutex);
-                       asm volatile (".rep 8; nop; .endr");
+                       xip_iprefetch();
                        cond_resched();
 
                        /*
index f651b6ef1c5d6c44805b066fab343eb965f952d0..b03d43ef910832a22031c21fc36b9b1177d304a0 100644 (file)
@@ -39,7 +39,7 @@ struct mtd_info *cfi_probe(struct map_info *map);
 #define xip_allowed(base, map) \
 do { \
        (void) map_read(map, base); \
-       asm volatile (".rep 8; nop; .endr"); \
+       xip_iprefetch(); \
        local_irq_enable(); \
 } while (0)
 
index 2e51496c248e0b718273ec3715d5c16b2c689ff8..72e0022a47bf50e360686068b66e6d52dbe895a6 100644 (file)
@@ -65,7 +65,7 @@ __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* n
 
 #ifdef CONFIG_MTD_XIP
        (void) map_read(map, base);
-       asm volatile (".rep 8; nop; .endr");
+       xip_iprefetch();
        local_irq_enable();
 #endif