diff options
author | David S. Miller <davem@davemloft.net> | 2006-06-20 04:21:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-20 04:21:57 -0400 |
commit | 37cdcd9e82108f9b899f1631f66ade2e45738a6e (patch) | |
tree | 452b4a106d767947664b99797640194c7483047e /arch/sparc64/kernel/pci_psycho.c | |
parent | c6387a48cf5958e43c201fc27a158c328927531a (diff) |
[SPARC64]: Kill ino_bucket->pil
And reuse that struct member for virt_irq, which will
be used in future changesets for the implementation of
mapping between real and virtual IRQ numbers.
This nicely kills off a ton of SBUS and PCI controller
PIL assignment code which is no longer necessary.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_psycho.c')
-rw-r--r-- | arch/sparc64/kernel/pci_psycho.c | 77 |
1 files changed, 2 insertions, 75 deletions
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c index d17878b145c2..5743e1316a93 100644 --- a/arch/sparc64/kernel/pci_psycho.c +++ b/arch/sparc64/kernel/pci_psycho.c | |||
@@ -276,74 +276,6 @@ static unsigned long __onboard_imap_off[] = { | |||
276 | ((ino & 0x20) ? (PSYCHO_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ | 276 | ((ino & 0x20) ? (PSYCHO_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ |
277 | (PSYCHO_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3))) | 277 | (PSYCHO_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3))) |
278 | 278 | ||
279 | /* PCI PSYCHO INO number to Sparc PIL level. */ | ||
280 | static unsigned char psycho_pil_table[] = { | ||
281 | /*0x00*/0, 0, 0, 0, /* PCI A slot 0 Int A, B, C, D */ | ||
282 | /*0x04*/0, 0, 0, 0, /* PCI A slot 1 Int A, B, C, D */ | ||
283 | /*0x08*/0, 0, 0, 0, /* PCI A slot 2 Int A, B, C, D */ | ||
284 | /*0x0c*/0, 0, 0, 0, /* PCI A slot 3 Int A, B, C, D */ | ||
285 | /*0x10*/0, 0, 0, 0, /* PCI B slot 0 Int A, B, C, D */ | ||
286 | /*0x14*/0, 0, 0, 0, /* PCI B slot 1 Int A, B, C, D */ | ||
287 | /*0x18*/0, 0, 0, 0, /* PCI B slot 2 Int A, B, C, D */ | ||
288 | /*0x1c*/0, 0, 0, 0, /* PCI B slot 3 Int A, B, C, D */ | ||
289 | /*0x20*/5, /* SCSI */ | ||
290 | /*0x21*/5, /* Ethernet */ | ||
291 | /*0x22*/8, /* Parallel Port */ | ||
292 | /*0x23*/13, /* Audio Record */ | ||
293 | /*0x24*/14, /* Audio Playback */ | ||
294 | /*0x25*/15, /* PowerFail */ | ||
295 | /*0x26*/5, /* second SCSI */ | ||
296 | /*0x27*/11, /* Floppy */ | ||
297 | /*0x28*/5, /* Spare Hardware */ | ||
298 | /*0x29*/9, /* Keyboard */ | ||
299 | /*0x2a*/5, /* Mouse */ | ||
300 | /*0x2b*/12, /* Serial */ | ||
301 | /*0x2c*/10, /* Timer 0 */ | ||
302 | /*0x2d*/11, /* Timer 1 */ | ||
303 | /*0x2e*/15, /* Uncorrectable ECC */ | ||
304 | /*0x2f*/15, /* Correctable ECC */ | ||
305 | /*0x30*/15, /* PCI Bus A Error */ | ||
306 | /*0x31*/15, /* PCI Bus B Error */ | ||
307 | /*0x32*/15, /* Power Management */ | ||
308 | }; | ||
309 | |||
310 | static int psycho_ino_to_pil(struct pci_dev *pdev, unsigned int ino) | ||
311 | { | ||
312 | int ret; | ||
313 | |||
314 | ret = psycho_pil_table[ino]; | ||
315 | if (ret == 0 && pdev == NULL) { | ||
316 | ret = 5; | ||
317 | } else if (ret == 0) { | ||
318 | switch ((pdev->class >> 16) & 0xff) { | ||
319 | case PCI_BASE_CLASS_STORAGE: | ||
320 | ret = 5; | ||
321 | break; | ||
322 | |||
323 | case PCI_BASE_CLASS_NETWORK: | ||
324 | ret = 6; | ||
325 | break; | ||
326 | |||
327 | case PCI_BASE_CLASS_DISPLAY: | ||
328 | ret = 9; | ||
329 | break; | ||
330 | |||
331 | case PCI_BASE_CLASS_MULTIMEDIA: | ||
332 | case PCI_BASE_CLASS_MEMORY: | ||
333 | case PCI_BASE_CLASS_BRIDGE: | ||
334 | case PCI_BASE_CLASS_SERIAL: | ||
335 | ret = 10; | ||
336 | break; | ||
337 | |||
338 | default: | ||
339 | ret = 5; | ||
340 | break; | ||
341 | }; | ||
342 | } | ||
343 | |||
344 | return ret; | ||
345 | } | ||
346 | |||
347 | static unsigned int psycho_irq_build(struct pci_pbm_info *pbm, | 279 | static unsigned int psycho_irq_build(struct pci_pbm_info *pbm, |
348 | struct pci_dev *pdev, | 280 | struct pci_dev *pdev, |
349 | unsigned int ino) | 281 | unsigned int ino) |
@@ -351,7 +283,7 @@ static unsigned int psycho_irq_build(struct pci_pbm_info *pbm, | |||
351 | struct ino_bucket *bucket; | 283 | struct ino_bucket *bucket; |
352 | unsigned long imap, iclr; | 284 | unsigned long imap, iclr; |
353 | unsigned long imap_off, iclr_off; | 285 | unsigned long imap_off, iclr_off; |
354 | int pil, inofixup = 0; | 286 | int inofixup = 0; |
355 | 287 | ||
356 | ino &= PCI_IRQ_INO; | 288 | ino &= PCI_IRQ_INO; |
357 | if (ino < PSYCHO_ONBOARD_IRQ_BASE) { | 289 | if (ino < PSYCHO_ONBOARD_IRQ_BASE) { |
@@ -367,11 +299,6 @@ static unsigned int psycho_irq_build(struct pci_pbm_info *pbm, | |||
367 | } | 299 | } |
368 | 300 | ||
369 | /* Now build the IRQ bucket. */ | 301 | /* Now build the IRQ bucket. */ |
370 | pil = psycho_ino_to_pil(pdev, ino); | ||
371 | |||
372 | if (PIL_RESERVED(pil)) | ||
373 | BUG(); | ||
374 | |||
375 | imap = pbm->controller_regs + imap_off; | 302 | imap = pbm->controller_regs + imap_off; |
376 | imap += 4; | 303 | imap += 4; |
377 | 304 | ||
@@ -382,7 +309,7 @@ static unsigned int psycho_irq_build(struct pci_pbm_info *pbm, | |||
382 | if ((ino & 0x20) == 0) | 309 | if ((ino & 0x20) == 0) |
383 | inofixup = ino & 0x03; | 310 | inofixup = ino & 0x03; |
384 | 311 | ||
385 | bucket = __bucket(build_irq(pil, inofixup, iclr, imap)); | 312 | bucket = __bucket(build_irq(inofixup, iclr, imap)); |
386 | bucket->flags |= IBF_PCI; | 313 | bucket->flags |= IBF_PCI; |
387 | 314 | ||
388 | return __irq(bucket); | 315 | return __irq(bucket); |