pci.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Include file for NEC VR4100 series PCI Control Unit.
  3. *
  4. * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #ifndef __NEC_VR41XX_PCI_H
  21. #define __NEC_VR41XX_PCI_H
  22. #define PCI_MASTER_ADDRESS_MASK 0x7fffffffU
  23. struct pci_master_address_conversion {
  24. uint32_t bus_base_address;
  25. uint32_t address_mask;
  26. uint32_t pci_base_address;
  27. };
  28. struct pci_target_address_conversion {
  29. uint32_t address_mask;
  30. uint32_t bus_base_address;
  31. };
  32. typedef enum {
  33. CANNOT_LOCK_FROM_DEVICE,
  34. CAN_LOCK_FROM_DEVICE,
  35. } pci_exclusive_access_t;
  36. struct pci_mailbox_address {
  37. uint32_t base_address;
  38. };
  39. struct pci_target_address_window {
  40. uint32_t base_address;
  41. };
  42. typedef enum {
  43. PCI_ARBITRATION_MODE_FAIR,
  44. PCI_ARBITRATION_MODE_ALTERNATE_0,
  45. PCI_ARBITRATION_MODE_ALTERNATE_B,
  46. } pci_arbiter_priority_control_t;
  47. typedef enum {
  48. PCI_TAKE_AWAY_GNT_DISABLE,
  49. PCI_TAKE_AWAY_GNT_ENABLE,
  50. } pci_take_away_gnt_mode_t;
  51. struct pci_controller_unit_setup {
  52. struct pci_master_address_conversion *master_memory1;
  53. struct pci_master_address_conversion *master_memory2;
  54. struct pci_target_address_conversion *target_memory1;
  55. struct pci_target_address_conversion *target_memory2;
  56. struct pci_master_address_conversion *master_io;
  57. pci_exclusive_access_t exclusive_access;
  58. uint32_t pci_clock_max;
  59. uint8_t wait_time_limit_from_irdy_to_trdy; /* Only VR4122 is supported */
  60. struct pci_mailbox_address *mailbox;
  61. struct pci_target_address_window *target_window1;
  62. struct pci_target_address_window *target_window2;
  63. uint8_t master_latency_timer;
  64. uint8_t retry_limit;
  65. pci_arbiter_priority_control_t arbiter_priority_control;
  66. pci_take_away_gnt_mode_t take_away_gnt_mode;
  67. struct resource *mem_resource;
  68. struct resource *io_resource;
  69. };
  70. extern void vr41xx_pciu_setup(struct pci_controller_unit_setup *setup);
  71. #endif /* __NEC_VR41XX_PCI_H */