ops-lboxre2.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * linux/arch/sh/drivers/pci/ops-lboxre2.c
  3. *
  4. * Copyright (C) 2007 Nobuhiro Iwamatsu
  5. *
  6. * PCI initialization for the NTT COMWARE L-BOX RE2
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/types.h>
  10. #include <linux/init.h>
  11. #include <linux/pci.h>
  12. #include <linux/io.h>
  13. #include <asm/lboxre2.h>
  14. #include "pci-sh4.h"
  15. static char lboxre2_irq_tab[] __initdata = {
  16. IRQ_ETH0, IRQ_ETH1, IRQ_INTA, IRQ_INTD,
  17. };
  18. int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
  19. {
  20. return lboxre2_irq_tab[slot];
  21. }
  22. static struct resource sh7751_io_resource = {
  23. .name = "SH7751_IO",
  24. .start = SH7751_PCI_IO_BASE ,
  25. .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
  26. .flags = IORESOURCE_IO
  27. };
  28. static struct resource sh7751_mem_resource = {
  29. .name = "SH7751_mem",
  30. .start = SH7751_PCI_MEMORY_BASE,
  31. .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
  32. .flags = IORESOURCE_MEM
  33. };
  34. extern struct pci_ops sh7751_pci_ops;
  35. struct pci_channel board_pci_channels[] = {
  36. { &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
  37. { NULL, NULL, NULL, 0, 0 },
  38. };
  39. EXPORT_SYMBOL(board_pci_channels);
  40. static struct sh4_pci_address_map sh7751_pci_map = {
  41. .window0 = {
  42. .base = SH7751_CS3_BASE_ADDR,
  43. .size = 0x04000000,
  44. },
  45. .window1 = {
  46. .base = 0x00000000, /* Unused */
  47. .size = 0x00000000, /* Unused */
  48. },
  49. .flags = SH4_PCIC_NO_RESET,
  50. };
  51. int __init pcibios_init_platform(void)
  52. {
  53. return sh7751_pcic_init(&sh7751_pci_map);
  54. }