30 #include <linux/module.h>
31 #include <linux/kernel.h>
32 #include <linux/slab.h>
33 #include <linux/pci.h>
41 #define DRV_NAME "vr_nor"
51 #define EXP_CSR_MBAR 0
53 #define EXP_WIN_MBAR 1
55 #define CS0_SIZE 0x04000000
59 #define EXP_TIMING_CS0 0x00
60 #define TIMING_CS_EN (1 << 31)
61 #define TIMING_BOOT_ACCEL_DIS (1 << 8)
62 #define TIMING_WR_EN (1 << 1)
63 #define TIMING_BYTE_EN (1 << 0)
64 #define TIMING_MASK 0x3FFF0000
85 static const char *probe_types[] =
86 {
"cfi_probe",
"jedec_probe",
NULL };
89 for (type = probe_types; !p->
info && *
type; type++)
101 unsigned int exp_timing_cs0;
121 unsigned long csr_phys, csr_len;
122 unsigned long win_phys, win_len;
123 unsigned int exp_timing_cs0;
131 if (!csr_phys || !csr_len || !win_phys || !win_len)
143 dev_warn(&p->
dev->dev,
"Expansion Bus Chip Select 0 "
148 if ((exp_timing_cs0 &
TIMING_MASK) == TIMING_MASK) {
149 dev_warn(&p->
dev->dev,
"Expansion Bus Chip Select 0 "
150 "is configured for maximally slow access times.\n");
183 pci_set_drvdata(dev,
NULL);
184 vr_nor_destroy_partitions(p);
185 vr_nor_destroy_mtd_setup(p);
186 vr_nor_destroy_maps(p);
196 unsigned int exp_timing_cs0;
214 err = vr_nor_init_maps(p);
218 err = vr_nor_mtd_setup(p);
222 err = vr_nor_init_partitions(p);
224 goto destroy_mtd_setup;
226 pci_set_drvdata(dev, p);
256 static struct pci_driver vr_nor_pci_driver = {
258 .probe = vr_nor_pci_probe,
260 .id_table = vr_nor_pci_ids,