ops-r7780rp.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Author: Ian DaSilva (idasilva@mvista.com)
  3. *
  4. * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
  5. *
  6. * May be copied or modified under the terms of the GNU General Public
  7. * License. See linux/COPYING for more information.
  8. *
  9. * PCI initialization for the Renesas SH7780 Highlander R7780RP-1 board
  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 <asm/r7780rp.h>
  17. #include <asm/io.h>
  18. #include "pci-sh4.h"
  19. static char r7780rp_irq_tab[] __initdata = {
  20. 0, 1, 2, 3,
  21. };
  22. static char r7780mp_irq_tab[] __initdata = {
  23. 65, 66, 67, 68,
  24. };
  25. int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
  26. {
  27. if (mach_is_r7780rp())
  28. return r7780rp_irq_tab[slot];
  29. if (mach_is_r7780mp() || mach_is_r7785rp())
  30. return r7780mp_irq_tab[slot];
  31. printk(KERN_ERR "PCI: Bad IRQ mapping "
  32. "request for slot %d, func %d\n", slot, pin-1);
  33. return -1;
  34. }
  35. static struct resource sh7780_io_resource = {
  36. .name = "SH7780_IO",
  37. .start = 0x2000,
  38. .end = 0x2000 + SH7780_PCI_IO_SIZE - 1,
  39. .flags = IORESOURCE_IO
  40. };
  41. static struct resource sh7780_mem_resource = {
  42. .name = "SH7780_mem",
  43. .start = SH7780_PCI_MEMORY_BASE,
  44. .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1,
  45. .flags = IORESOURCE_MEM
  46. };
  47. extern struct pci_ops sh7780_pci_ops;
  48. struct pci_channel board_pci_channels[] = {
  49. { &sh4_pci_ops, &sh7780_io_resource, &sh7780_mem_resource, 0, 0xff },
  50. { NULL, NULL, NULL, 0, 0 },
  51. };
  52. EXPORT_SYMBOL(board_pci_channels);
  53. static struct sh4_pci_address_map sh7780_pci_map = {
  54. .window0 = {
  55. .base = SH7780_CS2_BASE_ADDR,
  56. .size = 0x04000000,
  57. },
  58. .window1 = {
  59. .base = SH7780_CS3_BASE_ADDR,
  60. .size = 0x04000000,
  61. },
  62. .flags = SH4_PCIC_NO_RESET,
  63. };
  64. int __init pcibios_init_platform(void)
  65. {
  66. return sh7780_pcic_init(&sh7780_pci_map);
  67. }