diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-03 13:49:45 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-03 13:49:45 -0400 |
commit | 026477c1141b67e98e3bd8bdedb7d4b88a3ecd09 (patch) | |
tree | 2624a44924c625c367f3cebf937853b9da2de282 /drivers/ide/legacy | |
parent | 9f2fa466383ce100b90fe52cb4489d7a26bf72a9 (diff) | |
parent | 29454dde27d8e340bb1987bad9aa504af7081eba (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'drivers/ide/legacy')
-rw-r--r-- | drivers/ide/legacy/ali14xx.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/dtc2278.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/gayle.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/hd.c | 4 | ||||
-rw-r--r-- | drivers/ide/legacy/ht6560b.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/ide-cs.c | 81 | ||||
-rw-r--r-- | drivers/ide/legacy/macide.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/qd65xx.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/umc8672.c | 1 |
9 files changed, 73 insertions, 19 deletions
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c index fb88711812e6..9c544467cb74 100644 --- a/drivers/ide/legacy/ali14xx.c +++ b/drivers/ide/legacy/ali14xx.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | 40 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ |
41 | 41 | ||
42 | #include <linux/module.h> | 42 | #include <linux/module.h> |
43 | #include <linux/config.h> | ||
44 | #include <linux/types.h> | 43 | #include <linux/types.h> |
45 | #include <linux/kernel.h> | 44 | #include <linux/kernel.h> |
46 | #include <linux/delay.h> | 45 | #include <linux/delay.h> |
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c index 20eb5b872ca9..3b1d33baaa2f 100644 --- a/drivers/ide/legacy/dtc2278.c +++ b/drivers/ide/legacy/dtc2278.c | |||
@@ -7,7 +7,6 @@ | |||
7 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | 7 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ |
8 | 8 | ||
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/config.h> | ||
11 | #include <linux/types.h> | 10 | #include <linux/types.h> |
12 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
13 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c index 3fac3e9ec47d..64d42619ab06 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c | |||
@@ -8,7 +8,6 @@ | |||
8 | * more details. | 8 | * more details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/config.h> | ||
12 | #include <linux/types.h> | 11 | #include <linux/types.h> |
13 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
14 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c index 6439dec66881..aebecd8f51cc 100644 --- a/drivers/ide/legacy/hd.c +++ b/drivers/ide/legacy/hd.c | |||
@@ -691,7 +691,7 @@ static struct block_device_operations hd_fops = { | |||
691 | }; | 691 | }; |
692 | 692 | ||
693 | /* | 693 | /* |
694 | * This is the hard disk IRQ description. The SA_INTERRUPT in sa_flags | 694 | * This is the hard disk IRQ description. The IRQF_DISABLED in sa_flags |
695 | * means we run the IRQ-handler with interrupts disabled: this is bad for | 695 | * means we run the IRQ-handler with interrupts disabled: this is bad for |
696 | * interrupt latency, but anything else has led to problems on some | 696 | * interrupt latency, but anything else has led to problems on some |
697 | * machines. | 697 | * machines. |
@@ -806,7 +806,7 @@ static int __init hd_init(void) | |||
806 | p->cyl, p->head, p->sect); | 806 | p->cyl, p->head, p->sect); |
807 | } | 807 | } |
808 | 808 | ||
809 | if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd", NULL)) { | 809 | if (request_irq(HD_IRQ, hd_interrupt, IRQF_DISABLED, "hd", NULL)) { |
810 | printk("hd: unable to get IRQ%d for the hard disk driver\n", | 810 | printk("hd: unable to get IRQ%d for the hard disk driver\n", |
811 | HD_IRQ); | 811 | HD_IRQ); |
812 | goto out1; | 812 | goto out1; |
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index a77fb249d5cf..c48e87e512d3 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | 39 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ |
40 | 40 | ||
41 | #include <linux/module.h> | 41 | #include <linux/module.h> |
42 | #include <linux/config.h> | ||
43 | #include <linux/types.h> | 42 | #include <linux/types.h> |
44 | #include <linux/kernel.h> | 43 | #include <linux/kernel.h> |
45 | #include <linux/delay.h> | 44 | #include <linux/delay.h> |
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 602797a44208..b7e459e4f284 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
@@ -146,7 +146,16 @@ static void ide_detach(struct pcmcia_device *link) | |||
146 | kfree(link->priv); | 146 | kfree(link->priv); |
147 | } /* ide_detach */ | 147 | } /* ide_detach */ |
148 | 148 | ||
149 | static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) | 149 | static void idecs_mmio_fixup(ide_hwif_t *hwif) |
150 | { | ||
151 | default_hwif_mmiops(hwif); | ||
152 | hwif->mmio = 2; | ||
153 | |||
154 | ide_undecoded_slave(hwif); | ||
155 | } | ||
156 | |||
157 | static int idecs_register(unsigned long io, unsigned long ctl, | ||
158 | unsigned long irq, struct pcmcia_device *handle, int is_mmio) | ||
150 | { | 159 | { |
151 | hw_regs_t hw; | 160 | hw_regs_t hw; |
152 | memset(&hw, 0, sizeof(hw)); | 161 | memset(&hw, 0, sizeof(hw)); |
@@ -154,7 +163,19 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq | |||
154 | hw.irq = irq; | 163 | hw.irq = irq; |
155 | hw.chipset = ide_pci; | 164 | hw.chipset = ide_pci; |
156 | hw.dev = &handle->dev; | 165 | hw.dev = &handle->dev; |
157 | return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); | 166 | |
167 | if(is_mmio) | ||
168 | return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup); | ||
169 | else | ||
170 | return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); | ||
171 | } | ||
172 | |||
173 | void outb_io(unsigned char value, unsigned long port) { | ||
174 | outb(value, port); | ||
175 | } | ||
176 | |||
177 | void outb_mem(unsigned char value, unsigned long port) { | ||
178 | writeb(value, (void __iomem *) port); | ||
158 | } | 179 | } |
159 | 180 | ||
160 | /*====================================================================== | 181 | /*====================================================================== |
@@ -180,7 +201,8 @@ static int ide_config(struct pcmcia_device *link) | |||
180 | } *stk = NULL; | 201 | } *stk = NULL; |
181 | cistpl_cftable_entry_t *cfg; | 202 | cistpl_cftable_entry_t *cfg; |
182 | int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; | 203 | int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; |
183 | unsigned long io_base, ctl_base; | 204 | unsigned long io_base, ctl_base, is_mmio, try_slave; |
205 | void (*my_outb)(unsigned char, unsigned long); | ||
184 | 206 | ||
185 | DEBUG(0, "ide_config(0x%p)\n", link); | 207 | DEBUG(0, "ide_config(0x%p)\n", link); |
186 | 208 | ||
@@ -210,7 +232,7 @@ static int ide_config(struct pcmcia_device *link) | |||
210 | /* Not sure if this is right... look up the current Vcc */ | 232 | /* Not sure if this is right... look up the current Vcc */ |
211 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); | 233 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); |
212 | 234 | ||
213 | pass = io_base = ctl_base = 0; | 235 | pass = io_base = ctl_base = is_mmio = try_slave = 0; |
214 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 236 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
215 | tuple.Attributes = 0; | 237 | tuple.Attributes = 0; |
216 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 238 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
@@ -258,11 +280,45 @@ static int ide_config(struct pcmcia_device *link) | |||
258 | goto next_entry; | 280 | goto next_entry; |
259 | io_base = link->io.BasePort1; | 281 | io_base = link->io.BasePort1; |
260 | ctl_base = link->io.BasePort1 + 0x0e; | 282 | ctl_base = link->io.BasePort1 + 0x0e; |
283 | |||
284 | if (io->win[0].len >= 0x20) | ||
285 | try_slave = 1; | ||
286 | |||
261 | } else goto next_entry; | 287 | } else goto next_entry; |
262 | /* If we've got this far, we're done */ | 288 | /* If we've got this far, we're done */ |
263 | break; | 289 | break; |
264 | } | 290 | } |
265 | 291 | ||
292 | if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) { | ||
293 | win_req_t req; | ||
294 | memreq_t map; | ||
295 | cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem; | ||
296 | |||
297 | if (mem->win[0].len < 16) | ||
298 | goto next_entry; | ||
299 | |||
300 | req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; | ||
301 | req.Attributes |= WIN_ENABLE; | ||
302 | req.Base = mem->win[0].host_addr; | ||
303 | req.Size = 0; | ||
304 | |||
305 | req.AccessSpeed = 0; | ||
306 | if (pcmcia_request_window(&link, &req, &link->win) != 0) | ||
307 | goto next_entry; | ||
308 | map.Page = 0; map.CardOffset = mem->win[0].card_addr; | ||
309 | if (pcmcia_map_mem_page(link->win, &map) != 0) | ||
310 | goto next_entry; | ||
311 | |||
312 | io_base = (unsigned long) ioremap(req.Base, req.Size); | ||
313 | ctl_base = io_base + 0x0e; | ||
314 | is_mmio = 1; | ||
315 | |||
316 | if (mem->win[0].len >= 0x20) | ||
317 | try_slave = 1; | ||
318 | |||
319 | break; | ||
320 | } | ||
321 | |||
266 | next_entry: | 322 | next_entry: |
267 | if (cfg->flags & CISTPL_CFTABLE_DEFAULT) | 323 | if (cfg->flags & CISTPL_CFTABLE_DEFAULT) |
268 | memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); | 324 | memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); |
@@ -278,21 +334,26 @@ static int ide_config(struct pcmcia_device *link) | |||
278 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 334 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); |
279 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 335 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); |
280 | 336 | ||
337 | if(is_mmio) | ||
338 | my_outb = outb_mem; | ||
339 | else | ||
340 | my_outb = outb_io; | ||
341 | |||
281 | /* disable drive interrupts during IDE probe */ | 342 | /* disable drive interrupts during IDE probe */ |
282 | outb(0x02, ctl_base); | 343 | my_outb(0x02, ctl_base); |
283 | 344 | ||
284 | /* special setup for KXLC005 card */ | 345 | /* special setup for KXLC005 card */ |
285 | if (is_kme) | 346 | if (is_kme) |
286 | outb(0x81, ctl_base+1); | 347 | my_outb(0x81, ctl_base+1); |
287 | 348 | ||
288 | /* retry registration in case device is still spinning up */ | 349 | /* retry registration in case device is still spinning up */ |
289 | for (hd = -1, i = 0; i < 10; i++) { | 350 | for (hd = -1, i = 0; i < 10; i++) { |
290 | hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); | 351 | hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio); |
291 | if (hd >= 0) break; | 352 | if (hd >= 0) break; |
292 | if (link->io.NumPorts1 == 0x20) { | 353 | if (try_slave) { |
293 | outb(0x02, ctl_base + 0x10); | 354 | my_outb(0x02, ctl_base + 0x10); |
294 | hd = idecs_register(io_base + 0x10, ctl_base + 0x10, | 355 | hd = idecs_register(io_base + 0x10, ctl_base + 0x10, |
295 | link->irq.AssignedIRQ, link); | 356 | link->irq.AssignedIRQ, link, is_mmio); |
296 | if (hd >= 0) { | 357 | if (hd >= 0) { |
297 | io_base += 0x10; | 358 | io_base += 0x10; |
298 | ctl_base += 0x10; | 359 | ctl_base += 0x10; |
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index 90cac609d9cf..d655da749144 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c | |||
@@ -11,7 +11,6 @@ | |||
11 | * more details. | 11 | * more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/config.h> | ||
15 | #include <linux/types.h> | 14 | #include <linux/types.h> |
16 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
17 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index 563fab0098be..d3c3bc2640e7 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | 28 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ |
29 | 29 | ||
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/config.h> | ||
32 | #include <linux/types.h> | 31 | #include <linux/types.h> |
33 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
34 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c index cdbdb2ff9f15..6e2c58c5f6a2 100644 --- a/drivers/ide/legacy/umc8672.c +++ b/drivers/ide/legacy/umc8672.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #define REALLY_SLOW_IO /* some systems can safely undef this */ | 40 | #define REALLY_SLOW_IO /* some systems can safely undef this */ |
41 | 41 | ||
42 | #include <linux/module.h> | 42 | #include <linux/module.h> |
43 | #include <linux/config.h> | ||
44 | #include <linux/types.h> | 43 | #include <linux/types.h> |
45 | #include <linux/kernel.h> | 44 | #include <linux/kernel.h> |
46 | #include <linux/delay.h> | 45 | #include <linux/delay.h> |