diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2009-01-07 20:22:07 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-01-08 00:25:15 -0500 |
commit | 2efd72af0f18860927084df618f7419c82f69be3 (patch) | |
tree | 7409fa1d06a6463787c3cb5283c21243e95e6291 /drivers/mtd/devices | |
parent | 60c0c5987b0996a7c7c4c6d90f63ed413c368a71 (diff) |
mtd/ps3vram: Use _PAGE_NO_CACHE in memory ioremap
Use _PAGE_NO_CACHE for gpu memory ioremap. Also,
add __iomem attribute to gpu memory pointer and
change use of memset() to memset_io().
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/ps3vram.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/mtd/devices/ps3vram.c b/drivers/mtd/devices/ps3vram.c index d5924142d909..d21e9beb7ed2 100644 --- a/drivers/mtd/devices/ps3vram.c +++ b/drivers/mtd/devices/ps3vram.c | |||
@@ -6,6 +6,7 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/io.h> | 8 | #include <linux/io.h> |
9 | #include <linux/mm.h> | ||
9 | #include <linux/init.h> | 10 | #include <linux/init.h> |
10 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
11 | #include <linux/list.h> | 12 | #include <linux/list.h> |
@@ -69,7 +70,7 @@ struct ps3vram_priv { | |||
69 | u64 context_handle; | 70 | u64 context_handle; |
70 | u32 *ctrl; | 71 | u32 *ctrl; |
71 | u32 *reports; | 72 | u32 *reports; |
72 | u8 *base; | 73 | u8 __iomem *ddr_base; |
73 | u8 *xdr_buf; | 74 | u8 *xdr_buf; |
74 | 75 | ||
75 | u32 *fifo_base; | 76 | u32 *fifo_base; |
@@ -425,7 +426,7 @@ static int ps3vram_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
425 | ps3vram_cache_flush(mtd); | 426 | ps3vram_cache_flush(mtd); |
426 | 427 | ||
427 | /* Set bytes to 0xFF */ | 428 | /* Set bytes to 0xFF */ |
428 | memset(priv->base + instr->addr, 0xFF, instr->len); | 429 | memset_io(priv->ddr_base + instr->addr, 0xFF, instr->len); |
429 | 430 | ||
430 | mutex_unlock(&priv->lock); | 431 | mutex_unlock(&priv->lock); |
431 | 432 | ||
@@ -628,8 +629,9 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) | |||
628 | goto out_free_context; | 629 | goto out_free_context; |
629 | } | 630 | } |
630 | 631 | ||
631 | priv->base = ioremap(ddr_lpar, ddr_size); | 632 | priv->ddr_base = ioremap_flags(ddr_lpar, ddr_size, _PAGE_NO_CACHE); |
632 | if (!priv->base) { | 633 | |
634 | if (!priv->ddr_base) { | ||
633 | dev_err(&dev->core, "%s:%d: ioremap failed\n", __func__, | 635 | dev_err(&dev->core, "%s:%d: ioremap failed\n", __func__, |
634 | __LINE__); | 636 | __LINE__); |
635 | ret = -ENOMEM; | 637 | ret = -ENOMEM; |
@@ -702,7 +704,7 @@ out_unmap_reports: | |||
702 | out_unmap_ctrl: | 704 | out_unmap_ctrl: |
703 | iounmap(priv->ctrl); | 705 | iounmap(priv->ctrl); |
704 | out_unmap_vram: | 706 | out_unmap_vram: |
705 | iounmap(priv->base); | 707 | iounmap(priv->ddr_base); |
706 | out_free_context: | 708 | out_free_context: |
707 | lv1_gpu_context_free(priv->context_handle); | 709 | lv1_gpu_context_free(priv->context_handle); |
708 | out_free_memory: | 710 | out_free_memory: |
@@ -728,7 +730,7 @@ static int ps3vram_shutdown(struct ps3_system_bus_device *dev) | |||
728 | ps3vram_cache_cleanup(&ps3vram_mtd); | 730 | ps3vram_cache_cleanup(&ps3vram_mtd); |
729 | iounmap(priv->reports); | 731 | iounmap(priv->reports); |
730 | iounmap(priv->ctrl); | 732 | iounmap(priv->ctrl); |
731 | iounmap(priv->base); | 733 | iounmap(priv->ddr_base); |
732 | lv1_gpu_context_free(priv->context_handle); | 734 | lv1_gpu_context_free(priv->context_handle); |
733 | lv1_gpu_memory_free(priv->memory_handle); | 735 | lv1_gpu_memory_free(priv->memory_handle); |
734 | ps3_close_hv_device(dev); | 736 | ps3_close_hv_device(dev); |