ops-sdk7780.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * linux/arch/sh/drivers/pci/ops-sdk7780.c
  3. *
  4. * Copyright (C) 2006 Nobuhiro Iwamatsu
  5. *
  6. * PCI initialization for the SDK7780SE03
  7. *
  8. * May be copied or modified under the terms of the GNU General Public
  9. * License. See linux/COPYING for more information.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/types.h>
  13. #include <linux/init.h>
  14. #include <linux/delay.h>
  15. #include <linux/pci.h>
  16. #include <mach/sdk7780.h>
  17. #include <asm/io.h>
  18. #include "pci-sh4.h"
  19. /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */
  20. static char sdk7780_irq_tab[4][16] __initdata = {
  21. /* INTA */
  22. { 65, 68, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
  23. /* INTB */
  24. { 66, 65, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
  25. /* INTC */
  26. { 67, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
  27. /* INTD */
  28. { 68, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
  29. };
  30. int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
  31. {
  32. return sdk7780_irq_tab[pin-1][slot];
  33. }
  34. static struct resource sdk7780_io_resource = {
  35. .name = "SH7780_IO",
  36. .start = SH7780_PCI_IO_BASE,
  37. .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1,
  38. .flags = IORESOURCE_IO
  39. };
  40. static struct resource sdk7780_mem_resource = {
  41. .name = "SH7780_mem",
  42. .start = SH7780_PCI_MEMORY_BASE,
  43. .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1,
  44. .flags = IORESOURCE_MEM
  45. };
  46. struct pci_channel board_pci_channels[] = {
  47. { &sh4_pci_ops, &sdk7780_io_resource, &sdk7780_mem_resource, 0, 0xff },
  48. { NULL, NULL, NULL, 0, 0 },
  49. };
  50. EXPORT_SYMBOL(board_pci_channels);
  51. static struct sh4_pci_address_map sdk7780_pci_map = {
  52. .window0 = {
  53. .base = SH7780_CS2_BASE_ADDR,
  54. .size = 0x04000000,
  55. },
  56. .window1 = {
  57. .base = SH7780_CS3_BASE_ADDR,
  58. .size = 0x04000000,
  59. },
  60. .flags = SH4_PCIC_NO_RESET,
  61. };
  62. int __init pcibios_init_platform(void)
  63. {
  64. printk(KERN_INFO "SH7780 PCI: Finished initializing PCI controller\n");
  65. return sh7780_pcic_init(&sdk7780_pci_map);
  66. }