From e4c212efbdd4e286bc3defcddbab2c1e57ec75c3 Mon Sep 17 00:00:00 2001 From: David Vrabel Date: Thu, 8 Sep 2005 11:32:23 +0100 Subject: [MTD] maps/ixp4xx: remove platform specific bits - Intel chip driver has a reboot notifier so no need to reset the chip here. - Don't play with chip selects (platform code should do this if necessary). Signed-off-by: David Vrabel Signed-off-by: Thomas Gleixner --- drivers/mtd/maps/ixp4xx.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'drivers/mtd/maps/ixp4xx.c') diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c index 733a9297a56..58b477043f2 100644 --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c @@ -1,5 +1,5 @@ /* - * $Id: ixp4xx.c,v 1.7 2004/11/04 13:24:15 gleixner Exp $ + * $Id: ixp4xx.c,v 1.8 2005/09/08 10:32:20 dvrabel Exp $ * * drivers/mtd/maps/ixp4xx.c * @@ -111,12 +111,6 @@ static int ixp4xx_flash_remove(struct device *_dev) if(!info) return 0; - /* - * This is required for a soft reboot to work. - */ - d.x[0] = 0xff; - ixp4xx_write16(&info->map, d, 0x55 * 0x2); - if (info->mtd) { del_mtd_partitions(info->mtd); map_destroy(info->mtd); @@ -135,9 +129,6 @@ static int ixp4xx_flash_remove(struct device *_dev) if (plat->exit) plat->exit(); - /* Disable flash write */ - *IXP4XX_EXP_CS0 &= ~IXP4XX_FLASH_WRITABLE; - return 0; } @@ -166,12 +157,6 @@ static int ixp4xx_flash_probe(struct device *_dev) dev_set_drvdata(&dev->dev, info); - /* - * Enable flash write - * TODO: Move this out to board specific code - */ - *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; - /* * Tell the MTD layer we're not 1:1 mapped so that it does * not attempt to do a direct access on us. -- cgit v1.2.3 From 9090ed0b82f817bde471bdbb2e73278ab75f5fd3 Mon Sep 17 00:00:00 2001 From: David Vrabel Date: Tue, 1 Nov 2005 16:46:19 +0000 Subject: [MTD] maps/ixp4xx: kill some warnings - Use map.virt instead of map.map_priv_1 since it has the correct type. - Use readw/writew instead of dereferencing an ioremap'd cookie. - Remove an unused variable. Signed-off-by: David Vrabel Signed-off-by: Thomas Gleixner --- drivers/mtd/maps/ixp4xx.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'drivers/mtd/maps/ixp4xx.c') diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c index 58b477043f2..c510c736ed9 100644 --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c @@ -1,5 +1,5 @@ /* - * $Id: ixp4xx.c,v 1.8 2005/09/08 10:32:20 dvrabel Exp $ + * $Id: ixp4xx.c,v 1.11 2005/11/06 11:15:51 gleixner Exp $ * * drivers/mtd/maps/ixp4xx.c * @@ -45,7 +45,7 @@ static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs) { map_word val; - val.x[0] = *(__u16 *) (map->map_priv_1 + ofs); + val.x[0] = le16_to_cpu(readw(map->virt + ofs)); return val; } @@ -59,17 +59,17 @@ static void ixp4xx_copy_from(struct map_info *map, void *to, { int i; u8 *dest = (u8 *) to; - u16 *src = (u16 *) (map->map_priv_1 + from); + void __iomem *src = map->virt + from; u16 data; for (i = 0; i < (len / 2); i++) { - data = src[i]; + data = le16_to_cpu(readw(src + 2*i)); dest[i * 2] = BYTE0(data); dest[i * 2 + 1] = BYTE1(data); } if (len & 1) - dest[len - 1] = BYTE0(src[i]); + dest[len - 1] = BYTE0(le16_to_cpu(readw(src + 2*i))); } /* @@ -79,7 +79,7 @@ static void ixp4xx_copy_from(struct map_info *map, void *to, static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr) { if (!(adr & 1)) - *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; + writew(cpu_to_le16(d.x[0]), map->virt + adr); } /* @@ -87,7 +87,7 @@ static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long */ static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) { - *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; + writew(cpu_to_le16(d.x[0]), map->virt + adr); } struct ixp4xx_flash_info { @@ -104,7 +104,6 @@ static int ixp4xx_flash_remove(struct device *_dev) struct platform_device *dev = to_platform_device(_dev); struct flash_platform_data *plat = dev->dev.platform_data; struct ixp4xx_flash_info *info = dev_get_drvdata(&dev->dev); - map_word d; dev_set_drvdata(&dev->dev, NULL); @@ -115,8 +114,8 @@ static int ixp4xx_flash_remove(struct device *_dev) del_mtd_partitions(info->mtd); map_destroy(info->mtd); } - if (info->map.map_priv_1) - iounmap((void *) info->map.map_priv_1); + if (info->map.virt) + iounmap(info->map.virt); if (info->partitions) kfree(info->partitions); @@ -184,9 +183,9 @@ static int ixp4xx_flash_probe(struct device *_dev) goto Error; } - info->map.map_priv_1 = ioremap(dev->resource->start, - dev->resource->end - dev->resource->start + 1); - if (!info->map.map_priv_1) { + info->map.virt = ioremap(dev->resource->start, + dev->resource->end - dev->resource->start + 1); + if (!info->map.virt) { printk(KERN_ERR "IXP4XXFlash: Failed to ioremap region\n"); err = -EIO; goto Error; @@ -244,4 +243,3 @@ module_exit(ixp4xx_flash_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems"); MODULE_AUTHOR("Deepak Saxena"); - -- cgit v1.2.3 From 69f34c98c1416eb74c55e38a21dbf3e294966514 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 7 Nov 2005 11:15:40 +0000 Subject: [MTD] maps: Clean up trailing white spaces Signed-off-by: Thomas Gleixner --- drivers/mtd/maps/ixp4xx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/mtd/maps/ixp4xx.c') diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c index c510c736ed9..471553a3da6 100644 --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c @@ -1,5 +1,5 @@ /* - * $Id: ixp4xx.c,v 1.11 2005/11/06 11:15:51 gleixner Exp $ + * $Id: ixp4xx.c,v 1.12 2005/11/07 11:14:27 gleixner Exp $ * * drivers/mtd/maps/ixp4xx.c * @@ -72,7 +72,7 @@ static void ixp4xx_copy_from(struct map_info *map, void *to, dest[len - 1] = BYTE0(le16_to_cpu(readw(src + 2*i))); } -/* +/* * Unaligned writes are ignored, causing the 8-bit * probe to fail and proceed to the 16-bit probe (which succeeds). */ @@ -82,7 +82,7 @@ static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long writew(cpu_to_le16(d.x[0]), map->virt + adr); } -/* +/* * Fast write16 function without the probing check above */ static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) @@ -151,7 +151,7 @@ static int ixp4xx_flash_probe(struct device *_dev) if(!info) { err = -ENOMEM; goto Error; - } + } memzero(info, sizeof(struct ixp4xx_flash_info)); dev_set_drvdata(&dev->dev, info); @@ -174,8 +174,8 @@ static int ixp4xx_flash_probe(struct device *_dev) info->map.write = ixp4xx_probe_write16, info->map.copy_from = ixp4xx_copy_from, - info->res = request_mem_region(dev->resource->start, - dev->resource->end - dev->resource->start + 1, + info->res = request_mem_region(dev->resource->start, + dev->resource->end - dev->resource->start + 1, "IXP4XXFlash"); if (!info->res) { printk(KERN_ERR "IXP4XXFlash: Could not reserve memory region\n"); @@ -198,7 +198,7 @@ static int ixp4xx_flash_probe(struct device *_dev) goto Error; } info->mtd->owner = THIS_MODULE; - + /* Use the fast version */ info->map.write = ixp4xx_write16, -- cgit v1.2.3