xref: /qemu/include/hw/cxl/cxl.h (revision 6e4e3ae936e6bc1501fc0d67444738cec7a1e78a)
1 /*
2  * QEMU CXL Support
3  *
4  * Copyright (c) 2020 Intel
5  *
6  * This work is licensed under the terms of the GNU GPL, version 2. See the
7  * COPYING file in the top-level directory.
8  */
9 
10 #ifndef CXL_H
11 #define CXL_H
12 
13 #include "hw/pci/pci_host.h"
14 #include "cxl_pci.h"
15 #include "cxl_component.h"
16 #include "cxl_device.h"
17 
18 #define CXL_COMPONENT_REG_BAR_IDX 0
19 #define CXL_DEVICE_REG_BAR_IDX 2
20 
21 #define CXL_WINDOW_MAX 10
22 
23 typedef struct CXLState {
24     bool is_enabled;
25     MemoryRegion host_mr;
26     unsigned int next_mr_idx;
27 } CXLState;
28 
29 struct CXLHost {
30     PCIHostState parent_obj;
31 
32     CXLComponentState cxl_cstate;
33 };
34 
35 #define TYPE_PXB_CXL_HOST "pxb-cxl-host"
36 OBJECT_DECLARE_SIMPLE_TYPE(CXLHost, PXB_CXL_HOST)
37 
38 #endif
39