xref: /qemu/include/hw/pci/pcie_host.h (revision c702ddb8daece08b16fce9d6654b38304d385f93)
1a9f49946SIsaku Yamahata /*
2a9f49946SIsaku Yamahata  * pcie_host.h
3a9f49946SIsaku Yamahata  *
4a9f49946SIsaku Yamahata  * Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
5a9f49946SIsaku Yamahata  *                    VA Linux Systems Japan K.K.
6a9f49946SIsaku Yamahata  *
7a9f49946SIsaku Yamahata  * This program is free software; you can redistribute it and/or modify
8a9f49946SIsaku Yamahata  * it under the terms of the GNU General Public License as published by
9a9f49946SIsaku Yamahata  * the Free Software Foundation; either version 2 of the License, or
10a9f49946SIsaku Yamahata  * (at your option) any later version.
11a9f49946SIsaku Yamahata 
12a9f49946SIsaku Yamahata  * This program is distributed in the hope that it will be useful,
13a9f49946SIsaku Yamahata  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14a9f49946SIsaku Yamahata  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15a9f49946SIsaku Yamahata  * GNU General Public License for more details.
16a9f49946SIsaku Yamahata 
17a9f49946SIsaku Yamahata  * You should have received a copy of the GNU General Public License along
1870539e18SBlue Swirl  * with this program; if not, see <http://www.gnu.org/licenses/>.
19a9f49946SIsaku Yamahata  */
20a9f49946SIsaku Yamahata 
21a9f49946SIsaku Yamahata #ifndef PCIE_HOST_H
22a9f49946SIsaku Yamahata #define PCIE_HOST_H
23a9f49946SIsaku Yamahata 
24a9f49946SIsaku Yamahata #include "pci_host.h"
25c76f990eSAvi Kivity #include "memory.h"
26a9f49946SIsaku Yamahata 
27fb47a2e9SIsaku Yamahata struct PCIExpressHost {
28a9f49946SIsaku Yamahata     PCIHostState pci;
29a9f49946SIsaku Yamahata 
30a9f49946SIsaku Yamahata     /* express part */
31a9f49946SIsaku Yamahata 
32a9f49946SIsaku Yamahata     /* base address where MMCONFIG area is mapped. */
33a8170e5eSAvi Kivity     hwaddr  base_addr;
34a9f49946SIsaku Yamahata 
35a9f49946SIsaku Yamahata     /* the size of MMCONFIG area. It's host bridge dependent */
36a8170e5eSAvi Kivity     hwaddr  size;
37a9f49946SIsaku Yamahata 
38c76f990eSAvi Kivity     /* MMCONFIG mmio area */
39c76f990eSAvi Kivity     MemoryRegion mmio;
40fb47a2e9SIsaku Yamahata };
41a9f49946SIsaku Yamahata 
42*c702ddb8SJason Baron int pcie_host_init(PCIExpressHost *e);
43a9f49946SIsaku Yamahata void pcie_host_mmcfg_unmap(PCIExpressHost *e);
44*c702ddb8SJason Baron void pcie_host_mmcfg_map(PCIExpressHost *e, hwaddr addr, uint32_t size);
45a9f49946SIsaku Yamahata void pcie_host_mmcfg_update(PCIExpressHost *e,
46a9f49946SIsaku Yamahata                             int enable,
47*c702ddb8SJason Baron                             hwaddr addr,
48*c702ddb8SJason Baron                             uint32_t size);
49a9f49946SIsaku Yamahata 
50a9f49946SIsaku Yamahata #endif /* PCIE_HOST_H */
51