aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/esb2rom.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c
index 0bc013fd66a3..aa64a4752781 100644
--- a/drivers/mtd/maps/esb2rom.c
+++ b/drivers/mtd/maps/esb2rom.c
@@ -30,7 +30,7 @@
30 30
31#define ROM_PROBE_STEP_SIZE (64*1024) /* 64KiB */ 31#define ROM_PROBE_STEP_SIZE (64*1024) /* 64KiB */
32 32
33#define BIOS_CNTL 0xDC 33#define BIOS_CNTL 0xDC
34#define BIOS_LOCK_ENABLE 0x02 34#define BIOS_LOCK_ENABLE 0x02
35#define BIOS_WRITE_ENABLE 0x01 35#define BIOS_WRITE_ENABLE 0x01
36 36
@@ -145,7 +145,7 @@ static void esb2rom_cleanup(struct esb2rom_window *window)
145} 145}
146 146
147static int __devinit esb2rom_init_one(struct pci_dev *pdev, 147static int __devinit esb2rom_init_one(struct pci_dev *pdev,
148 const struct pci_device_id *ent) 148 const struct pci_device_id *ent)
149{ 149{
150 static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL }; 150 static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
151 struct esb2rom_window *window = &esb2rom_window; 151 struct esb2rom_window *window = &esb2rom_window;
@@ -185,7 +185,7 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev,
185 /* Find a region continuous to the end of the ROM window */ 185 /* Find a region continuous to the end of the ROM window */
186 window->phys = 0; 186 window->phys = 0;
187 pci_read_config_word(pdev, FWH_DEC_EN1, &word); 187 pci_read_config_word(pdev, FWH_DEC_EN1, &word);
188 printk(KERN_DEBUG "pci_read_config_byte : %x\n", word); 188 printk(KERN_DEBUG "pci_read_config_word : %x\n", word);
189 189
190 if ((word & FWH_8MiB) == FWH_8MiB) 190 if ((word & FWH_8MiB) == FWH_8MiB)
191 window->phys = 0xff400000; 191 window->phys = 0xff400000;
@@ -212,6 +212,11 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev,
212 else if ((word & FWH_0_5MiB) == FWH_0_5MiB) 212 else if ((word & FWH_0_5MiB) == FWH_0_5MiB)
213 window->phys = 0xfff80000; 213 window->phys = 0xfff80000;
214 214
215 if (window->phys == 0) {
216 printk(KERN_ERR MOD_NAME ": Rom window is closed\n");
217 goto out;
218 }
219
215 /* reserved 0x0020 and 0x0010 */ 220 /* reserved 0x0020 and 0x0010 */
216 window->phys -= 0x400000UL; 221 window->phys -= 0x400000UL;
217 window->size = (0xffffffffUL - window->phys) + 1UL; 222 window->size = (0xffffffffUL - window->phys) + 1UL;