ops-sh7785lcr.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 R0P7785LC0011RL board
  10. * Based on arch/sh/drivers/pci/ops-r7780rp.c
  11. *
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/types.h>
  15. #include <linux/init.h>
  16. #include <linux/delay.h>
  17. #include <linux/pci.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 sh7785_io_resource = {
  27. .name = "SH7785_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 sh7785_mem_resource = {
  33. .name = "SH7785_mem",
  34. .start = SH7780_PCI_MEMORY_BASE,
  35. .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1,
  36. .flags = IORESOURCE_MEM
  37. };
  38. struct pci_channel board_pci_channels[] = {
  39. { &sh4_pci_ops, &sh7785_io_resource, &sh7785_mem_resource, 0, 0xff },
  40. { NULL, NULL, NULL, 0, 0 },
  41. };
  42. EXPORT_SYMBOL(board_pci_channels);
  43. static struct sh4_pci_address_map sh7785_pci_map = {
  44. .window0 = {
  45. .base = SH7780_CS2_BASE_ADDR,
  46. .size = 0x04000000,
  47. },
  48. .window1 = {
  49. .base = SH7780_CS3_BASE_ADDR,
  50. .size = 0x04000000,
  51. },
  52. .flags = SH4_PCIC_NO_RESET,
  53. };
  54. int __init pcibios_init_platform(void)
  55. {
  56. return sh7780_pcic_init(&sh7785_pci_map);
  57. }