ops-lboxre2.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 <mach/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. { sh7751_pci_init, &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
  37. { NULL, NULL, NULL, 0, 0 },
  38. };
  39. static struct sh4_pci_address_map sh7751_pci_map = {
  40. .window0 = {
  41. .base = SH7751_CS3_BASE_ADDR,
  42. .size = 0x04000000,
  43. },
  44. };
  45. int __init pcibios_init_platform(void)
  46. {
  47. return sh7751_pcic_init(&board_pci_channels[0], &sh7751_pci_map);
  48. }