fixups-dreamcast.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * arch/sh/pci/fixups-dreamcast.c
  3. *
  4. * PCI fixups for the Sega Dreamcast
  5. *
  6. * Copyright (C) 2001, 2002 M. R. Brown
  7. * Copyright (C) 2002, 2003 Paul Mundt
  8. *
  9. * This file originally bore the message (with enclosed-$):
  10. * Id: pci.c,v 1.3 2003/05/04 19:29:46 lethal Exp
  11. * Dreamcast PCI: Supports SEGA Broadband Adaptor only.
  12. *
  13. * This file is subject to the terms and conditions of the GNU General Public
  14. * License. See the file "COPYING" in the main directory of this archive
  15. * for more details.
  16. */
  17. #include <linux/sched.h>
  18. #include <linux/kernel.h>
  19. #include <linux/param.h>
  20. #include <linux/interrupt.h>
  21. #include <linux/init.h>
  22. #include <linux/irq.h>
  23. #include <linux/pci.h>
  24. #include <asm/io.h>
  25. #include <asm/irq.h>
  26. #include <asm/mach/pci.h>
  27. static void __init gapspci_fixup_resources(struct pci_dev *dev)
  28. {
  29. struct pci_channel *p = board_pci_channels;
  30. printk(KERN_NOTICE "PCI: Fixing up device %s\n", pci_name(dev));
  31. switch (dev->device) {
  32. case PCI_DEVICE_ID_SEGA_BBA:
  33. /*
  34. * We also assume that dev->devfn == 0
  35. */
  36. dev->resource[1].start = p->io_resource->start + 0x100;
  37. dev->resource[1].end = dev->resource[1].start + 0x200 - 1;
  38. break;
  39. default:
  40. printk("PCI: Failed resource fixup\n");
  41. }
  42. }
  43. DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, gapspci_fixup_resources);
  44. void __init pcibios_fixup_bus(struct pci_bus *bus)
  45. {
  46. /*
  47. * We don't have any sub bus to fix up, and this is a rather
  48. * stupid place to put general device fixups. Don't do it.
  49. * Use the pcibios_fixups table or suffer the consequences.
  50. */
  51. }
  52. void __init pcibios_fixup_irqs(void)
  53. {
  54. struct pci_dev *dev = 0;
  55. for_each_pci_dev(dev) {
  56. /*
  57. * The interrupt routing semantics here are quite trivial.
  58. *
  59. * We basically only support one interrupt, so we only bother
  60. * updating a device's interrupt line with this single shared
  61. * interrupt. Keeps routing quite simple, doesn't it?
  62. */
  63. printk(KERN_NOTICE "PCI: Fixing up IRQ routing for device %s\n",
  64. pci_name(dev));
  65. dev->irq = GAPSPCI_IRQ;
  66. pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
  67. }
  68. }