]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/pci-demo.c
core/configs/tools: Report IOMMU association of devices via config file
[jailhouse.git] / configs / pci-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Minimal configuration for PCI demo inmate:
5  * 1 CPU, 1 MB RAM, 1 serial port, 1 Intel HDA PCI device
6  *
7  * Copyright (c) Siemens AG, 2014
8  *
9  * Authors:
10  *  Jan Kiszka <jan.kiszka@siemens.com>
11  *
12  * This work is licensed under the terms of the GNU GPL, version 2.  See
13  * the COPYING file in the top-level directory.
14  */
15
16 #include <linux/types.h>
17 #include <jailhouse/cell-config.h>
18
19 #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
20
21 struct {
22         struct jailhouse_cell_desc cell;
23         __u64 cpus[1];
24         struct jailhouse_memory mem_regions[3];
25         __u8 pio_bitmap[0x2000];
26         struct jailhouse_pci_device pci_devices[1];
27         struct jailhouse_pci_capability pci_caps[1];
28 } __attribute__((packed)) config = {
29         .cell = {
30                 .name = "pci-demo",
31                 .flags = JAILHOUSE_CELL_PASSIVE_COMMREG,
32
33                 .cpu_set_size = sizeof(config.cpus),
34                 .num_memory_regions = ARRAY_SIZE(config.mem_regions),
35                 .num_irqchips = 0,
36                 .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
37                 .num_pci_devices = ARRAY_SIZE(config.pci_devices),
38                 .num_pci_caps = ARRAY_SIZE(config.pci_caps),
39         },
40
41         .cpus = {
42                 0x4,
43         },
44
45         .mem_regions = {
46                 /* RAM */ {
47                         .phys_start = 0x3be00000,
48                         .virt_start = 0,
49                         .size = 0x00100000,
50                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
51                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
52                 },
53                 /* communication region */ {
54                         .virt_start = 0x00100000,
55                         .size = 0x00001000,
56                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
57                                 JAILHOUSE_MEM_COMM_REGION,
58                 },
59                 /* HDA BAR0 */ {
60                         .phys_start = 0xfebf0000,
61                         .virt_start = 0xfebf0000,
62                         .size = 0x00004000,
63                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
64                 },
65         },
66
67         .pio_bitmap = {
68                 [     0/8 ...  0x2f7/8] = -1,
69                 [ 0x2f8/8 ...  0x2ff/8] = 0, /* serial2 */
70                 [ 0x300/8 ... 0xdfff/8] = -1,
71                 [0xe000/8 ... 0xe007/8] = 0, /* OXPCIe952 serial2 */
72                 [0xe008/8 ... 0xffff/8] = -1,
73         },
74
75         .pci_devices = {
76                 { /* Intel HDA @00:1b.0 */
77                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
78                         .domain = 0x0000,
79                         .bdf = 0x00d8,
80                         .caps_start = 0,
81                         .num_caps = 1,
82                         .num_msi_vectors = 1,
83                         .msi_64bits = 1,
84                 },
85         },
86
87         .pci_caps = {
88                 { /* Intel HDA @00:1b.0 */
89                         .id = 0x5,
90                         .start = 0x60,
91                         .len = 14,
92                         .flags = JAILHOUSE_PCICAPS_WRITE,
93                 },
94         },
95 };