ops-rts7751r2d.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * linux/arch/sh/drivers/pci/ops-rts7751r2d.c
  3. *
  4. * Author: Ian DaSilva (idasilva@mvista.com)
  5. *
  6. * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
  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. * PCI initialization for the Renesas SH7751R RTS7751R2D board
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/types.h>
  15. #include <linux/init.h>
  16. #include <linux/pci.h>
  17. #include <linux/io.h>
  18. #include <mach/r2d.h>
  19. #include "pci-sh4.h"
  20. static u8 rts7751r2d_irq_tab[] __initdata = {
  21. IRQ_PCI_INTA,
  22. IRQ_PCI_INTB,
  23. IRQ_PCI_INTC,
  24. IRQ_PCI_INTD,
  25. };
  26. int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
  27. {
  28. return rts7751r2d_irq_tab[slot];
  29. }
  30. static struct resource sh7751_io_resource = {
  31. .name = "SH7751_IO",
  32. .start = 0x4000,
  33. .end = SH7751_PCI_IO_SIZE - 1,
  34. .flags = IORESOURCE_IO
  35. };
  36. static struct resource sh7751_mem_resource = {
  37. .name = "SH7751_mem",
  38. .start = SH7751_PCI_MEMORY_BASE,
  39. .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
  40. .flags = IORESOURCE_MEM
  41. };
  42. extern struct pci_ops sh7751_pci_ops;
  43. struct pci_channel board_pci_channels[] = {
  44. { sh7751_pci_init, &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
  45. { NULL, NULL, NULL, 0, 0 },
  46. };
  47. static struct sh4_pci_address_map sh7751_pci_map = {
  48. .window0 = {
  49. .base = SH7751_CS3_BASE_ADDR,
  50. .size = 0x04000000,
  51. },
  52. };
  53. int __init pcibios_init_platform(void)
  54. {
  55. return sh7751_pcic_init(&board_pci_channels[0], &sh7751_pci_map);
  56. }