2 * Copyright (c) 2017, Impinj, Inc.
4 * Designware PCIe IP block emulation
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see
18 * <http://www.gnu.org/licenses/>.
24 #include "hw/sysbus.h"
25 #include "hw/pci/pci.h"
26 #include "hw/pci/pci_bus.h"
27 #include "hw/pci/pcie_host.h"
28 #include "hw/pci/pci_bridge.h"
30 #define TYPE_DESIGNWARE_PCIE_HOST "designware-pcie-host"
31 #define DESIGNWARE_PCIE_HOST(obj) \
32 OBJECT_CHECK(DesignwarePCIEHost, (obj), TYPE_DESIGNWARE_PCIE_HOST)
34 #define TYPE_DESIGNWARE_PCIE_ROOT "designware-pcie-root"
35 #define DESIGNWARE_PCIE_ROOT(obj) \
36 OBJECT_CHECK(DesignwarePCIERoot, (obj), TYPE_DESIGNWARE_PCIE_ROOT)
38 struct DesignwarePCIERoot
;
39 typedef struct DesignwarePCIERoot DesignwarePCIERoot
;
41 typedef struct DesignwarePCIEViewport
{
42 DesignwarePCIERoot
*root
;
53 } DesignwarePCIEViewport
;
55 typedef struct DesignwarePCIEMSIBank
{
59 } DesignwarePCIEMSIBank
;
61 typedef struct DesignwarePCIEMSI
{
65 #define DESIGNWARE_PCIE_NUM_MSI_BANKS 1
67 DesignwarePCIEMSIBank intr
[DESIGNWARE_PCIE_NUM_MSI_BANKS
];
70 struct DesignwarePCIERoot
{
73 uint32_t atu_viewport
;
75 #define DESIGNWARE_PCIE_VIEWPORT_OUTBOUND 0
76 #define DESIGNWARE_PCIE_VIEWPORT_INBOUND 1
77 #define DESIGNWARE_PCIE_NUM_VIEWPORTS 4
79 DesignwarePCIEViewport viewports
[2][DESIGNWARE_PCIE_NUM_VIEWPORTS
];
80 DesignwarePCIEMSI msi
;
83 typedef struct DesignwarePCIEHost
{
84 PCIHostState parent_obj
;
86 DesignwarePCIERoot root
;
89 AddressSpace address_space
;
90 MemoryRegion address_space_root
;
101 #endif /* DESIGNWARE_H */