ops-titan.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * arch/sh/drivers/pci/ops-titan.c
  3. *
  4. * Ported to new API by Paul Mundt <lethal@linux-sh.org>
  5. *
  6. * Modified from ops-snapgear.c written by David McCullough
  7. * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
  8. *
  9. * May be copied or modified under the terms of the GNU General Public
  10. * License. See linux/COPYING for more information.
  11. *
  12. * PCI initialization for the Titan boards
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/types.h>
  16. #include <linux/init.h>
  17. #include <linux/pci.h>
  18. #include <linux/io.h>
  19. #include <mach/titan.h>
  20. #include "pci-sh4.h"
  21. static char titan_irq_tab[] __initdata = {
  22. TITAN_IRQ_WAN,
  23. TITAN_IRQ_LAN,
  24. TITAN_IRQ_MPCIA,
  25. TITAN_IRQ_MPCIB,
  26. TITAN_IRQ_USB,
  27. };
  28. int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
  29. {
  30. int irq = titan_irq_tab[slot];
  31. printk("PCI: Mapping TITAN IRQ for slot %d, pin %c to irq %d\n",
  32. slot, pin - 1 + 'A', irq);
  33. return irq;
  34. }
  35. static struct resource sh7751_io_resource = {
  36. .name = "SH7751_IO",
  37. .start = SH7751_PCI_IO_BASE,
  38. .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
  39. .flags = IORESOURCE_IO
  40. };
  41. static struct resource sh7751_mem_resource = {
  42. .name = "SH7751_mem",
  43. .start = SH7751_PCI_MEMORY_BASE,
  44. .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
  45. .flags = IORESOURCE_MEM
  46. };
  47. struct pci_channel board_pci_channels[] = {
  48. { sh7751_pci_init, &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
  49. { NULL, NULL, NULL, 0, 0 },
  50. };
  51. static struct sh4_pci_address_map sh7751_pci_map = {
  52. .window0 = {
  53. .base = SH7751_CS2_BASE_ADDR,
  54. .size = SH7751_MEM_REGION_SIZE*2, /* cs2 and cs3 */
  55. },
  56. .window1 = {
  57. .base = SH7751_CS2_BASE_ADDR,
  58. .size = SH7751_MEM_REGION_SIZE*2,
  59. },
  60. };
  61. int __init pcibios_init_platform(void)
  62. {
  63. return sh7751_pcic_init(&board_pci_channels[0], &sh7751_pci_map);
  64. }