blob: c9e4c10a462e80897eafec3fbbf3ba119c2307e3 [file] [log] [blame]
Ray Jui1fb37a82015-04-08 11:21:35 -07001/*
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
14#ifndef _PCIE_IPROC_H
15#define _PCIE_IPROC_H
16
17#define IPROC_PCIE_MAX_NUM_IRQS 6
18
19/**
20 * iProc PCIe device
21 * @dev: pointer to device data structure
22 * @base: PCIe host controller I/O register base
23 * @resources: linked list of all PCI resources
Ray Jui8d9bfe32015-07-21 18:29:40 -070024 * @sysdata: Per PCI controller data (ARM-specific)
Ray Jui1fb37a82015-04-08 11:21:35 -070025 * @root_bus: pointer to root bus
26 * @phy: optional PHY device that controls the Serdes
27 * @irqs: interrupt IDs
28 */
29struct iproc_pcie {
30 struct device *dev;
31 void __iomem *base;
Ray Jui8d9bfe32015-07-21 18:29:40 -070032#ifdef CONFIG_ARM
Ray Jui1fb37a82015-04-08 11:21:35 -070033 struct pci_sys_data sysdata;
Ray Jui8d9bfe32015-07-21 18:29:40 -070034#endif
Ray Jui1fb37a82015-04-08 11:21:35 -070035 struct pci_bus *root_bus;
36 struct phy *phy;
37 int irqs[IPROC_PCIE_MAX_NUM_IRQS];
Hauke Mehrtensc1e02ce2015-05-12 23:23:00 +020038 int (*map_irq)(const struct pci_dev *, u8, u8);
Ray Jui1fb37a82015-04-08 11:21:35 -070039};
40
Hauke Mehrtens18c43422015-05-24 22:37:02 +020041int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res);
Ray Jui1fb37a82015-04-08 11:21:35 -070042int iproc_pcie_remove(struct iproc_pcie *pcie);
43
44#endif /* _PCIE_IPROC_H */