Commit 2efd72af authored by Geoff Levand's avatar Geoff Levand Committed by Benjamin Herrenschmidt

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: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 60c0c598
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/io.h> #include <linux/io.h>
#include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/list.h> #include <linux/list.h>
...@@ -69,7 +70,7 @@ struct ps3vram_priv { ...@@ -69,7 +70,7 @@ struct ps3vram_priv {
u64 context_handle; u64 context_handle;
u32 *ctrl; u32 *ctrl;
u32 *reports; u32 *reports;
u8 *base; u8 __iomem *ddr_base;
u8 *xdr_buf; u8 *xdr_buf;
u32 *fifo_base; u32 *fifo_base;
...@@ -425,7 +426,7 @@ static int ps3vram_erase(struct mtd_info *mtd, struct erase_info *instr) ...@@ -425,7 +426,7 @@ static int ps3vram_erase(struct mtd_info *mtd, struct erase_info *instr)
ps3vram_cache_flush(mtd); ps3vram_cache_flush(mtd);
/* Set bytes to 0xFF */ /* Set bytes to 0xFF */
memset(priv->base + instr->addr, 0xFF, instr->len); memset_io(priv->ddr_base + instr->addr, 0xFF, instr->len);
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
...@@ -628,8 +629,9 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) ...@@ -628,8 +629,9 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
goto out_free_context; goto out_free_context;
} }
priv->base = ioremap(ddr_lpar, ddr_size); priv->ddr_base = ioremap_flags(ddr_lpar, ddr_size, _PAGE_NO_CACHE);
if (!priv->base) {
if (!priv->ddr_base) {
dev_err(&dev->core, "%s:%d: ioremap failed\n", __func__, dev_err(&dev->core, "%s:%d: ioremap failed\n", __func__,
__LINE__); __LINE__);
ret = -ENOMEM; ret = -ENOMEM;
...@@ -702,7 +704,7 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) ...@@ -702,7 +704,7 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
out_unmap_ctrl: out_unmap_ctrl:
iounmap(priv->ctrl); iounmap(priv->ctrl);
out_unmap_vram: out_unmap_vram:
iounmap(priv->base); iounmap(priv->ddr_base);
out_free_context: out_free_context:
lv1_gpu_context_free(priv->context_handle); lv1_gpu_context_free(priv->context_handle);
out_free_memory: out_free_memory:
...@@ -728,7 +730,7 @@ static int ps3vram_shutdown(struct ps3_system_bus_device *dev) ...@@ -728,7 +730,7 @@ static int ps3vram_shutdown(struct ps3_system_bus_device *dev)
ps3vram_cache_cleanup(&ps3vram_mtd); ps3vram_cache_cleanup(&ps3vram_mtd);
iounmap(priv->reports); iounmap(priv->reports);
iounmap(priv->ctrl); iounmap(priv->ctrl);
iounmap(priv->base); iounmap(priv->ddr_base);
lv1_gpu_context_free(priv->context_handle); lv1_gpu_context_free(priv->context_handle);
lv1_gpu_memory_free(priv->memory_handle); lv1_gpu_memory_free(priv->memory_handle);
ps3_close_hv_device(dev); ps3_close_hv_device(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment