162be3934SPaul Burton /* 262be3934SPaul Burton * Xilinx PCIe host controller emulation. 362be3934SPaul Burton * 462be3934SPaul Burton * Copyright (c) 2016 Imagination Technologies 562be3934SPaul Burton * 662be3934SPaul Burton * This library is free software; you can redistribute it and/or 762be3934SPaul Burton * modify it under the terms of the GNU Lesser General Public 862be3934SPaul Burton * License as published by the Free Software Foundation; either 9*4a129ccdSChetan Pant * version 2.1 of the License, or (at your option) any later version. 1062be3934SPaul Burton * 1162be3934SPaul Burton * This library is distributed in the hope that it will be useful, 1262be3934SPaul Burton * but WITHOUT ANY WARRANTY; without even the implied warranty of 1362be3934SPaul Burton * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1462be3934SPaul Burton * Lesser General Public License for more details. 1562be3934SPaul Burton * 1662be3934SPaul Burton * You should have received a copy of the GNU Lesser General Public 1762be3934SPaul Burton * License along with this library; if not, see <http://www.gnu.org/licenses/>. 1862be3934SPaul Burton */ 1962be3934SPaul Burton 2062be3934SPaul Burton #ifndef HW_XILINX_PCIE_H 2162be3934SPaul Burton #define HW_XILINX_PCIE_H 2262be3934SPaul Burton 2362be3934SPaul Burton #include "hw/sysbus.h" 2462be3934SPaul Burton #include "hw/pci/pci.h" 25791bf3c8SDavid Gibson #include "hw/pci/pci_bridge.h" 2662be3934SPaul Burton #include "hw/pci/pcie_host.h" 27db1015e9SEduardo Habkost #include "qom/object.h" 2862be3934SPaul Burton 2962be3934SPaul Burton #define TYPE_XILINX_PCIE_HOST "xilinx-pcie-host" 308063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(XilinxPCIEHost, XILINX_PCIE_HOST) 3162be3934SPaul Burton 3262be3934SPaul Burton #define TYPE_XILINX_PCIE_ROOT "xilinx-pcie-root" 338063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(XilinxPCIERoot, XILINX_PCIE_ROOT) 3462be3934SPaul Burton 35db1015e9SEduardo Habkost struct XilinxPCIERoot { 3662be3934SPaul Burton PCIBridge parent_obj; 37db1015e9SEduardo Habkost }; 3862be3934SPaul Burton 3962be3934SPaul Burton typedef struct XilinxPCIEInt { 4062be3934SPaul Burton uint32_t fifo_reg1; 4162be3934SPaul Burton uint32_t fifo_reg2; 4262be3934SPaul Burton } XilinxPCIEInt; 4362be3934SPaul Burton 44db1015e9SEduardo Habkost struct XilinxPCIEHost { 4562be3934SPaul Burton PCIExpressHost parent_obj; 4662be3934SPaul Burton 4762be3934SPaul Burton char name[16]; 4862be3934SPaul Burton 4962be3934SPaul Burton uint32_t bus_nr; 5062be3934SPaul Burton uint64_t cfg_base, cfg_size; 5162be3934SPaul Burton uint64_t mmio_base, mmio_size; 5262be3934SPaul Burton bool link_up; 5362be3934SPaul Burton qemu_irq irq; 5462be3934SPaul Burton 5562be3934SPaul Burton MemoryRegion mmio, io; 5662be3934SPaul Burton 5762be3934SPaul Burton XilinxPCIERoot root; 5862be3934SPaul Burton 5962be3934SPaul Burton uint32_t intr; 6062be3934SPaul Burton uint32_t intr_mask; 6162be3934SPaul Burton XilinxPCIEInt intr_fifo[16]; 6262be3934SPaul Burton unsigned int intr_fifo_r, intr_fifo_w; 6362be3934SPaul Burton uint32_t rpscr; 64db1015e9SEduardo Habkost }; 6562be3934SPaul Burton 6662be3934SPaul Burton #endif /* HW_XILINX_PCIE_H */ 67