xref: /openbmc/qemu/include/hw/pci-host/astro.h (revision 806f71ee)
1 /*
2  * HP-PARISC Astro Bus connector with Elroy PCI host bridges
3  */
4 
5 #ifndef ASTRO_H
6 #define ASTRO_H
7 
8 #include "hw/pci/pci_host.h"
9 
10 #define ASTRO_HPA               0xfed00000
11 
12 #define ROPES_PER_IOC           8       /* per Ike half or Pluto/Astro */
13 
14 #define TYPE_ASTRO_CHIP "astro-chip"
15 OBJECT_DECLARE_SIMPLE_TYPE(AstroState, ASTRO_CHIP)
16 
17 #define TYPE_ELROY_PCI_HOST_BRIDGE "elroy-pcihost"
18 OBJECT_DECLARE_SIMPLE_TYPE(ElroyState, ELROY_PCI_HOST_BRIDGE)
19 
20 #define ELROY_NUM               4 /* # of Elroys */
21 #define ELROY_IRQS              8 /* IOSAPIC IRQs */
22 
23 /* ASTRO Memory and I/O regions */
24 #define LMMIO_DIST_BASE_ADDR      0xf4000000ULL
25 #define LMMIO_DIST_BASE_SIZE       0x4000000ULL
26 
27 #define IOS_DIST_BASE_ADDR      0xfffee00000ULL
28 #define IOS_DIST_BASE_SIZE           0x10000ULL
29 
30 struct AstroState;
31 
32 struct ElroyState {
33     PCIHostState parent_obj;
34 
35     /* parent Astro device */
36     struct AstroState *astro;
37 
38     /* HPA of this Elroy */
39     hwaddr hpa;
40 
41     /* PCI bus number (Elroy number) */
42     unsigned int pci_bus_num;
43 
44     uint64_t config_address;
45     uint64_t config_reg_elroy;
46 
47     uint64_t status_control;
48     uint64_t arb_mask;
49     uint64_t mmio_base[(0x0250 - 0x200) / 8];
50     uint64_t error_config;
51 
52     uint32_t iosapic_reg_select;
53     uint64_t iosapic_reg[0x20];
54 
55     uint32_t ilr;
56 
57     MemoryRegion this_mem;
58 
59     MemoryRegion pci_mmio;
60     MemoryRegion pci_mmio_alias;
61     MemoryRegion pci_hole;
62     MemoryRegion pci_io;
63 };
64 
65 struct AstroState {
66     PCIHostState parent_obj;
67 
68     uint64_t ioc_ctrl;
69     uint64_t ioc_status_ctrl;
70     uint64_t ioc_ranges[(0x03d8 - 0x300) / 8];
71     uint64_t ioc_rope_config;
72     uint64_t ioc_status_control;
73     uint64_t ioc_flush_control;
74     uint64_t ioc_rope_control[8];
75     uint64_t tlb_ibase;
76     uint64_t tlb_imask;
77     uint64_t tlb_pcom;
78     uint64_t tlb_tcnfg;
79     uint64_t tlb_pdir_base;
80 
81     struct ElroyState *elroy[ELROY_NUM];
82 
83     MemoryRegion this_mem;
84 
85     MemoryRegion pci_mmio;
86     MemoryRegion pci_io;
87 
88     IOMMUMemoryRegion iommu;
89     AddressSpace iommu_as;
90 };
91 
92 #endif
93