ops-r7780rp.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 <mach/highlander.h>
  17. #include <asm/io.h>
  18. #include "pci-sh4.h"
  19. static char irq_tab[] __initdata = {
  20. 65, 66, 67, 68,
  21. };
  22. int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
  23. {
  24. return irq_tab[slot];
  25. }
  26. static struct resource sh7780_io_resource = {
  27. .name = "SH7780_IO",
  28. .start = SH7780_PCI_IO_BASE,
  29. .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1,
  30. .flags = IORESOURCE_IO
  31. };
  32. static struct resource sh7780_mem_resource = {
  33. .name = "SH7780_mem",
  34. .start = SH7780_PCI_MEMORY_BASE,
  35. .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1,
  36. .flags = IORESOURCE_MEM
  37. };
  38. extern struct pci_ops sh7780_pci_ops;
  39. struct pci_channel board_pci_channels[] = {
  40. { &sh4_pci_ops, &sh7780_io_resource, &sh7780_mem_resource, 0, 0xff },
  41. { NULL, NULL, NULL, 0, 0 },
  42. };
  43. EXPORT_SYMBOL(board_pci_channels);
  44. static struct sh4_pci_address_map sh7780_pci_map = {
  45. .window0 = {
  46. .base = SH7780_CS2_BASE_ADDR,
  47. .size = 0x04000000,
  48. },
  49. .window1 = {
  50. .base = SH7780_CS3_BASE_ADDR,
  51. .size = 0x04000000,
  52. },
  53. .flags = SH4_PCIC_NO_RESET,
  54. };
  55. int __init pcibios_init_platform(void)
  56. {
  57. return sh7780_pcic_init(&sh7780_pci_map);
  58. }