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_schizo.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_schizo.c')
-rw-r--r-- | arch/sparc64/kernel/pci_schizo.c | 104 |
1 files changed, 2 insertions, 102 deletions
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c index 7fe4de03ac2e..ca49ef08236d 100644 --- a/arch/sparc64/kernel/pci_schizo.c +++ b/arch/sparc64/kernel/pci_schizo.c | |||
@@ -232,101 +232,6 @@ static unsigned long schizo_iclr_offset(unsigned long ino) | |||
232 | return SCHIZO_ICLR_BASE + (ino * 8UL); | 232 | return SCHIZO_ICLR_BASE + (ino * 8UL); |
233 | } | 233 | } |
234 | 234 | ||
235 | /* PCI SCHIZO INO number to Sparc PIL level. This table only matters for | ||
236 | * INOs which will not have an associated PCI device struct, ie. onboard | ||
237 | * EBUS devices and PCI controller internal error interrupts. | ||
238 | */ | ||
239 | static unsigned char schizo_pil_table[] = { | ||
240 | /*0x00*/0, 0, 0, 0, /* PCI slot 0 Int A, B, C, D */ | ||
241 | /*0x04*/0, 0, 0, 0, /* PCI slot 1 Int A, B, C, D */ | ||
242 | /*0x08*/0, 0, 0, 0, /* PCI slot 2 Int A, B, C, D */ | ||
243 | /*0x0c*/0, 0, 0, 0, /* PCI slot 3 Int A, B, C, D */ | ||
244 | /*0x10*/0, 0, 0, 0, /* PCI slot 4 Int A, B, C, D */ | ||
245 | /*0x14*/0, 0, 0, 0, /* PCI slot 5 Int A, B, C, D */ | ||
246 | /*0x18*/5, /* SCSI */ | ||
247 | /*0x19*/5, /* second SCSI */ | ||
248 | /*0x1a*/0, /* UNKNOWN */ | ||
249 | /*0x1b*/0, /* UNKNOWN */ | ||
250 | /*0x1c*/8, /* Parallel */ | ||
251 | /*0x1d*/5, /* Ethernet */ | ||
252 | /*0x1e*/8, /* Firewire-1394 */ | ||
253 | /*0x1f*/9, /* USB */ | ||
254 | /*0x20*/13, /* Audio Record */ | ||
255 | /*0x21*/14, /* Audio Playback */ | ||
256 | /*0x22*/12, /* Serial */ | ||
257 | /*0x23*/5, /* EBUS I2C */ | ||
258 | /*0x24*/10, /* RTC Clock */ | ||
259 | /*0x25*/11, /* Floppy */ | ||
260 | /*0x26*/0, /* UNKNOWN */ | ||
261 | /*0x27*/0, /* UNKNOWN */ | ||
262 | /*0x28*/0, /* UNKNOWN */ | ||
263 | /*0x29*/0, /* UNKNOWN */ | ||
264 | /*0x2a*/10, /* UPA 1 */ | ||
265 | /*0x2b*/10, /* UPA 2 */ | ||
266 | /*0x2c*/0, /* UNKNOWN */ | ||
267 | /*0x2d*/0, /* UNKNOWN */ | ||
268 | /*0x2e*/0, /* UNKNOWN */ | ||
269 | /*0x2f*/0, /* UNKNOWN */ | ||
270 | /*0x30*/15, /* Uncorrectable ECC */ | ||
271 | /*0x31*/15, /* Correctable ECC */ | ||
272 | /*0x32*/15, /* PCI Bus A Error */ | ||
273 | /*0x33*/15, /* PCI Bus B Error */ | ||
274 | /*0x34*/15, /* Safari Bus Error */ | ||
275 | /*0x35*/0, /* Reserved */ | ||
276 | /*0x36*/0, /* Reserved */ | ||
277 | /*0x37*/0, /* Reserved */ | ||
278 | /*0x38*/0, /* Reserved for NewLink */ | ||
279 | /*0x39*/0, /* Reserved for NewLink */ | ||
280 | /*0x3a*/0, /* Reserved for NewLink */ | ||
281 | /*0x3b*/0, /* Reserved for NewLink */ | ||
282 | /*0x3c*/0, /* Reserved for NewLink */ | ||
283 | /*0x3d*/0, /* Reserved for NewLink */ | ||
284 | /*0x3e*/0, /* Reserved for NewLink */ | ||
285 | /*0x3f*/0, /* Reserved for NewLink */ | ||
286 | }; | ||
287 | |||
288 | static int schizo_ino_to_pil(struct pci_dev *pdev, unsigned int ino) | ||
289 | { | ||
290 | int ret; | ||
291 | |||
292 | if (pdev && | ||
293 | pdev->vendor == PCI_VENDOR_ID_SUN && | ||
294 | pdev->device == PCI_DEVICE_ID_SUN_RIO_USB) | ||
295 | return 9; | ||
296 | |||
297 | ret = schizo_pil_table[ino]; | ||
298 | if (ret == 0 && pdev == NULL) { | ||
299 | ret = 5; | ||
300 | } else if (ret == 0) { | ||
301 | switch ((pdev->class >> 16) & 0xff) { | ||
302 | case PCI_BASE_CLASS_STORAGE: | ||
303 | ret = 5; | ||
304 | break; | ||
305 | |||
306 | case PCI_BASE_CLASS_NETWORK: | ||
307 | ret = 6; | ||
308 | break; | ||
309 | |||
310 | case PCI_BASE_CLASS_DISPLAY: | ||
311 | ret = 9; | ||
312 | break; | ||
313 | |||
314 | case PCI_BASE_CLASS_MULTIMEDIA: | ||
315 | case PCI_BASE_CLASS_MEMORY: | ||
316 | case PCI_BASE_CLASS_BRIDGE: | ||
317 | case PCI_BASE_CLASS_SERIAL: | ||
318 | ret = 10; | ||
319 | break; | ||
320 | |||
321 | default: | ||
322 | ret = 5; | ||
323 | break; | ||
324 | }; | ||
325 | } | ||
326 | |||
327 | return ret; | ||
328 | } | ||
329 | |||
330 | static void tomatillo_wsync_handler(struct ino_bucket *bucket, void *_arg1, void *_arg2) | 235 | static void tomatillo_wsync_handler(struct ino_bucket *bucket, void *_arg1, void *_arg2) |
331 | { | 236 | { |
332 | unsigned long sync_reg = (unsigned long) _arg2; | 237 | unsigned long sync_reg = (unsigned long) _arg2; |
@@ -372,17 +277,12 @@ static unsigned int schizo_irq_build(struct pci_pbm_info *pbm, | |||
372 | struct ino_bucket *bucket; | 277 | struct ino_bucket *bucket; |
373 | unsigned long imap, iclr; | 278 | unsigned long imap, iclr; |
374 | unsigned long imap_off, iclr_off; | 279 | unsigned long imap_off, iclr_off; |
375 | int pil, ign_fixup; | 280 | int ign_fixup; |
376 | 281 | ||
377 | ino &= PCI_IRQ_INO; | 282 | ino &= PCI_IRQ_INO; |
378 | imap_off = schizo_imap_offset(ino); | 283 | imap_off = schizo_imap_offset(ino); |
379 | 284 | ||
380 | /* Now build the IRQ bucket. */ | 285 | /* Now build the IRQ bucket. */ |
381 | pil = schizo_ino_to_pil(pdev, ino); | ||
382 | |||
383 | if (PIL_RESERVED(pil)) | ||
384 | BUG(); | ||
385 | |||
386 | imap = pbm->pbm_regs + imap_off; | 286 | imap = pbm->pbm_regs + imap_off; |
387 | imap += 4; | 287 | imap += 4; |
388 | 288 | ||
@@ -405,7 +305,7 @@ static unsigned int schizo_irq_build(struct pci_pbm_info *pbm, | |||
405 | ign_fixup = (1 << 6); | 305 | ign_fixup = (1 << 6); |
406 | } | 306 | } |
407 | 307 | ||
408 | bucket = __bucket(build_irq(pil, ign_fixup, iclr, imap)); | 308 | bucket = __bucket(build_irq(ign_fixup, iclr, imap)); |
409 | bucket->flags |= IBF_PCI; | 309 | bucket->flags |= IBF_PCI; |
410 | 310 | ||
411 | if (pdev && pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO) { | 311 | if (pdev && pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO) { |