pcie-iproc.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) 2014-2015 Broadcom Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation version 2.
  7. *
  8. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  9. * kind, whether express or implied; without even the implied warranty
  10. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _PCIE_IPROC_H
  14. #define _PCIE_IPROC_H
  15. /**
  16. * iProc PCIe outbound mapping
  17. * @set_oarr_size: indicates the OARR size bit needs to be set
  18. * @axi_offset: offset from the AXI address to the internal address used by
  19. * the iProc PCIe core
  20. * @window_size: outbound window size
  21. */
  22. struct iproc_pcie_ob {
  23. bool set_oarr_size;
  24. resource_size_t axi_offset;
  25. resource_size_t window_size;
  26. };
  27. /**
  28. * iProc PCIe device
  29. * @dev: pointer to device data structure
  30. * @base: PCIe host controller I/O register base
  31. * @sysdata: Per PCI controller data (ARM-specific)
  32. * @root_bus: pointer to root bus
  33. * @phy: optional PHY device that controls the Serdes
  34. * @irqs: interrupt IDs
  35. * @map_irq: function callback to map interrupts
  36. * @need_ob_cfg: indidates SW needs to configure the outbound mapping window
  37. * @ob: outbound mapping parameters
  38. */
  39. struct iproc_pcie {
  40. struct device *dev;
  41. void __iomem *base;
  42. #ifdef CONFIG_ARM
  43. struct pci_sys_data sysdata;
  44. #endif
  45. struct pci_bus *root_bus;
  46. struct phy *phy;
  47. int (*map_irq)(const struct pci_dev *, u8, u8);
  48. bool need_ob_cfg;
  49. struct iproc_pcie_ob ob;
  50. };
  51. int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res);
  52. int iproc_pcie_remove(struct iproc_pcie *pcie);
  53. #endif /* _PCIE_IPROC_H */