blob: 09f3fa0a55d7d019367e940367fc4012c317222b [file] [log] [blame]
David Daney7149b9f2016-03-11 15:18:38 -06001/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program. If not, see <http://www.gnu.org/licenses/>.
13 *
14 * Copyright (C) 2014 ARM Limited
15 *
16 * Author: Will Deacon <will.deacon@arm.com>
17 */
18
19#ifndef _PCI_HOST_COMMON_H
20#define _PCI_HOST_COMMON_H
21
22#include <linux/kernel.h>
23#include <linux/platform_device.h>
24
25struct gen_pci_cfg_bus_ops {
26 u32 bus_shift;
27 struct pci_ops ops;
28};
29
30struct gen_pci_cfg_windows {
31 struct resource res;
32 struct resource *bus_range;
33 void __iomem **win;
34
35 struct gen_pci_cfg_bus_ops *ops;
36};
37
38struct gen_pci {
39 struct pci_host_bridge host;
40 struct gen_pci_cfg_windows cfg;
41 struct list_head resources;
42};
43
David Daney4e64dbe2016-03-11 15:35:55 -060044int pci_host_common_probe(struct platform_device *pdev,
45 struct gen_pci *pci);
46
David Daney7149b9f2016-03-11 15:18:38 -060047#endif /* _PCI_HOST_COMMON_H */