14 #include <linux/module.h>
15 #include <linux/kernel.h>
16 #include <linux/pci.h>
18 #include <linux/slab.h>
57 static void mtd_pci_copyfrom(
struct map_info *_map,
void *to,
unsigned long from,
ssize_t len)
63 static void mtd_pci_write8(
struct map_info *_map,
map_word val,
unsigned long ofs)
69 static void mtd_pci_write32(
struct map_info *_map,
map_word val,
unsigned long ofs)
75 static void mtd_pci_copyto(
struct map_info *_map,
unsigned long to,
const void *from,
ssize_t len)
81 static const struct map_info mtd_pci_map = {
83 .copy_from = mtd_pci_copyfrom,
84 .copy_to = mtd_pci_copyto,
96 map->
map.bankwidth = 1;
97 map->
map.read = mtd_pci_read8,
98 map->
map.write = mtd_pci_write8,
100 map->
map.size = 0x00800000;
111 pci_read_config_dword(dev, 0x44, &win_base);
112 pci_write_config_dword(dev, 0x44, 0);
114 map->
map.map_priv_2 = win_base;
124 pci_write_config_dword(dev, 0x44, map->
map.map_priv_2);
128 intel_iq80310_translate(
struct map_pci_info *map,
unsigned long ofs)
130 unsigned long page_addr = ofs & 0x00400000;
149 .init = intel_iq80310_init,
150 .exit = intel_iq80310_exit,
151 .translate = intel_iq80310_translate,
152 .map_name =
"cfi_probe",
162 unsigned long base, len;
185 printk(
"%s: enabling expansion ROM\n", pci_name(dev));
191 map->
map.bankwidth = 4;
192 map->
map.read = mtd_pci_read32,
193 map->
map.write = mtd_pci_write32,
216 intel_dc21285_translate(
struct map_pci_info *map,
unsigned long ofs)
218 return ofs & 0x00ffffc0 ? ofs : (ofs ^ (1 << 5));
222 .init = intel_dc21285_init,
223 .exit = intel_dc21285_exit,
224 .translate = intel_dc21285_translate,
225 .map_name =
"jedec_probe",
239 .class_mask = 0xffff00,
240 .driver_data = (
unsigned long)&intel_iq80310_info,
247 .driver_data = (
unsigned long)&intel_dc21285_info,
277 map->
map = mtd_pci_map;
278 map->
map.name = pci_name(dev);
296 pci_set_drvdata(dev, mtd);
312 mtd_pci_remove(
struct pci_dev *dev)
314 struct mtd_info *mtd = pci_get_drvdata(dev);
322 pci_set_drvdata(dev,
NULL);
328 .probe = mtd_pci_probe,
330 .id_table = mtd_pci_ids,