Lines Matching +full:fail +full:- +full:fast
4 * MTD Map file for IXP4XX based systems. Please do not make per-board
6 * platform level code in arch/arm/mach-ixp4xx/board-setup.c
12 * Copyright (C) 2003-2004 MontaVista Software, Inc.
38 * When the cpu is in little-endian mode it swizzles the address lines
45 * +---+---+
47 * +---+---+
49 * +---+---+
52 * data and other flash commands which are always in D7-D0.
91 val.x[0] = flash_read16(map->virt + ofs); in ixp4xx_read16()
96 * The IXP4xx expansion bus only allows 16-bit wide acceses
97 * when attached to a 16-bit wide device (such as the 28F128J3A),
104 void __iomem *src = map->virt + from; in ixp4xx_copy_from()
110 *dest++ = BYTE1(flash_read16(src-1)); in ixp4xx_copy_from()
112 --len; in ixp4xx_copy_from()
120 len -= 2; in ixp4xx_copy_from()
128 * Unaligned writes are ignored, causing the 8-bit
129 * probe to fail and proceed to the 16-bit probe (which succeeds).
134 flash_write16(d.x[0], map->virt + adr); in ixp4xx_probe_write16()
138 * Fast write16 function without the probing check above
142 flash_write16(d.x[0], map->virt + adr); in ixp4xx_write16()
155 struct flash_platform_data *plat = dev->dev.platform_data; in ixp4xx_flash_remove()
163 if (info->mtd) { in ixp4xx_flash_remove()
164 mtd_device_unregister(info->mtd); in ixp4xx_flash_remove()
165 map_destroy(info->mtd); in ixp4xx_flash_remove()
167 if (info->map.virt) in ixp4xx_flash_remove()
168 iounmap(info->map.virt); in ixp4xx_flash_remove()
170 if (info->res) { in ixp4xx_flash_remove()
171 release_resource(info->res); in ixp4xx_flash_remove()
172 kfree(info->res); in ixp4xx_flash_remove()
175 if (plat->exit) in ixp4xx_flash_remove()
176 plat->exit(); in ixp4xx_flash_remove()
183 struct flash_platform_data *plat = dev->dev.platform_data; in ixp4xx_flash_probe()
185 int err = -1; in ixp4xx_flash_probe()
188 return -ENODEV; in ixp4xx_flash_probe()
190 if (plat->init) { in ixp4xx_flash_probe()
191 err = plat->init(); in ixp4xx_flash_probe()
198 err = -ENOMEM; in ixp4xx_flash_probe()
208 info->map.phys = NO_XIP; in ixp4xx_flash_probe()
209 info->map.size = resource_size(dev->resource); in ixp4xx_flash_probe()
212 * We only support 16-bit accesses for now. If and when in ixp4xx_flash_probe()
213 * any board use 8-bit access, we'll fixup the driver to in ixp4xx_flash_probe()
216 info->map.bankwidth = 2; in ixp4xx_flash_probe()
217 info->map.name = dev_name(&dev->dev); in ixp4xx_flash_probe()
218 info->map.read = ixp4xx_read16; in ixp4xx_flash_probe()
219 info->map.write = ixp4xx_probe_write16; in ixp4xx_flash_probe()
220 info->map.copy_from = ixp4xx_copy_from; in ixp4xx_flash_probe()
222 info->res = request_mem_region(dev->resource->start, in ixp4xx_flash_probe()
223 resource_size(dev->resource), in ixp4xx_flash_probe()
225 if (!info->res) { in ixp4xx_flash_probe()
227 err = -ENOMEM; in ixp4xx_flash_probe()
231 info->map.virt = ioremap(dev->resource->start, in ixp4xx_flash_probe()
232 resource_size(dev->resource)); in ixp4xx_flash_probe()
233 if (!info->map.virt) { in ixp4xx_flash_probe()
235 err = -EIO; in ixp4xx_flash_probe()
239 info->mtd = do_map_probe(plat->map_name, &info->map); in ixp4xx_flash_probe()
240 if (!info->mtd) { in ixp4xx_flash_probe()
242 err = -ENXIO; in ixp4xx_flash_probe()
245 info->mtd->owner = THIS_MODULE; in ixp4xx_flash_probe()
247 /* Use the fast version */ in ixp4xx_flash_probe()
248 info->map.write = ixp4xx_write16; in ixp4xx_flash_probe()
250 err = mtd_device_parse_register(info->mtd, probes, dev->resource->start, in ixp4xx_flash_probe()
251 plat->parts, plat->nr_parts); in ixp4xx_flash_probe()
268 .name = "IXP4XX-Flash",
278 MODULE_ALIAS("platform:IXP4XX-Flash");