]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/h87i.c
configs: Clean up PIO bitmaps
[jailhouse.git] / configs / h87i.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Test configuration for Asus H87I-PLUS, 4 GB RAM, 64 MB hypervisor
5  *
6  * Copyright (c) Siemens AG, 2013
7  *
8  * Authors:
9  *  Jan Kiszka <jan.kiszka@siemens.com>
10  *
11  * This work is licensed under the terms of the GNU GPL, version 2.  See
12  * the COPYING file in the top-level directory.
13  */
14
15 #include <linux/types.h>
16 #include <jailhouse/cell-config.h>
17
18 #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
19
20 struct {
21         struct jailhouse_system header;
22         __u64 cpus[1];
23         struct jailhouse_memory mem_regions[9];
24         struct jailhouse_irqchip irqchips[1];
25         __u8 pio_bitmap[0x2000];
26         struct jailhouse_pci_device pci_devices[13];
27 } __attribute__((packed)) config = {
28         .header = {
29                 .hypervisor_memory = {
30                         .phys_start = 0x3c000000,
31                         .size = 0x4000000,
32                 },
33                 .config_memory = {
34                         .phys_start = 0xcca64000,
35                         .size = 0x15000,
36                 },
37                 .platform_info.x86 = {
38                         .pm_timer_address = 0x1808,
39                 },
40                 .root_cell = {
41                         .name = "H87I-PLUS",
42
43                         .cpu_set_size = sizeof(config.cpus),
44                         .num_memory_regions = ARRAY_SIZE(config.mem_regions),
45                         .num_irqchips = ARRAY_SIZE(config.irqchips),
46                         .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
47                         .num_pci_devices = ARRAY_SIZE(config.pci_devices),
48                 },
49         },
50
51         .cpus = {
52                 0xff,
53         },
54
55         .mem_regions = {
56                 /* RAM */ {
57                         .phys_start = 0x0,
58                         .virt_start = 0x0,
59                         .size = 0x3c000000,
60                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
61                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
62                 },
63                 /* RAM */ {
64                         .phys_start = 0x40000000,
65                         .virt_start = 0x40000000,
66                         .size = 0x8ca64000,
67                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
68                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
69                 },
70                 /* ACPI */ {
71                         .phys_start = 0xcca64000,
72                         .virt_start = 0xcca64000,
73                         .size = 0x15000,
74                         .flags = JAILHOUSE_MEM_READ,
75                 },
76                 /* RAM */ {
77                         .phys_start = 0xcca79000,
78                         .virt_start = 0xcca79000,
79                         .size = 0x12787000,
80                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
81                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
82                 },
83                 /* RAM */ {
84                         .phys_start = 0xcf200000,
85                         .virt_start = 0xcf200000,
86                         .size = 0x10000000,
87                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
88                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
89                 },
90                 /* PCI */ {
91                         .phys_start = 0xdf200000,
92                         .virt_start = 0xdf200000,
93                         .size = 0x1fa00000,
94                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
95                 },
96                 /* not safe until we catch MSIs via interrupt remapping */
97                 /* HPET */ {
98                         .phys_start = 0xfed00000,
99                         .virt_start = 0xfed00000,
100                         .size = 0x1000,
101                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
102                 },
103                 /* RAM */ {
104                         .phys_start = 0x100000000,
105                         .virt_start = 0x100000000,
106                         .size = 0x20000000,
107                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
108                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
109                 },
110         },
111
112         .irqchips = {
113                 /* IOAPIC */ {
114                         .address = 0xfec00000,
115                         .pin_bitmap = 0xffffff,
116                 },
117         },
118
119         .pio_bitmap = {
120                 [     0/8 ...   0x3f/8] = -1,
121                 [  0x40/8 ...   0x47/8] = 0xf0, /* PIT */
122                 [  0x48/8 ...   0x5f/8] = -1,
123                 [  0x60/8 ...   0x67/8] = 0x0, /* HACK: 8042, and more? */
124                 [  0x68/8 ...   0x6f/8] = -1,
125                 [  0x70/8 ...   0x77/8] = 0xfc, /* rtc */
126                 [  0x78/8 ...  0x3af/8] = -1,
127                 [ 0x3b0/8 ...  0x3df/8] = 0, /* VGA */
128                 [ 0x3e0/8 ...  0xcff/8] = -1,
129                 [ 0xd00/8 ... 0xffff/8] = 0, /* HACK: full PCI */
130         },
131
132         .pci_devices = {
133                 {
134                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
135                         .domain = 0x0000,
136                         .bus = 0x00,
137                         .devfn = 0x00,
138                 },
139                 {
140                         .type = JAILHOUSE_PCI_TYPE_BRIDGE,
141                         .domain = 0x0000,
142                         .bus = 0x00,
143                         .devfn = 0x08,
144                 },
145                 {
146                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
147                         .domain = 0x0000,
148                         .bus = 0x00,
149                         .devfn = 0x10,
150                 },
151                 {
152                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
153                         .domain = 0x0000,
154                         .bus = 0x00,
155                         .devfn = 0x18,
156                 },
157                 {
158                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
159                         .domain = 0x0000,
160                         .bus = 0x00,
161                         .devfn = 0xa0,
162                 },
163                 {
164                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
165                         .domain = 0x0000,
166                         .bus = 0x00,
167                         .devfn = 0xb0,
168                 },
169                 {
170                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
171                         .domain = 0x0000,
172                         .bus = 0x00,
173                         .devfn = 0xc8,
174                 },
175                 {
176                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
177                         .domain = 0x0000,
178                         .bus = 0x00,
179                         .devfn = 0xd0,
180                 },
181                 {
182                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
183                         .domain = 0x0000,
184                         .bus = 0x00,
185                         .devfn = 0xd8,
186                 },
187                 {
188                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
189                         .domain = 0x0000,
190                         .bus = 0x00,
191                         .devfn = 0xe8,
192                 },
193                 {
194                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
195                         .domain = 0x0000,
196                         .bus = 0x00,
197                         .devfn = 0xf8,
198                 },
199                 {
200                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
201                         .domain = 0x0000,
202                         .bus = 0x00,
203                         .devfn = 0xfa,
204                 },
205                 {
206                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
207                         .domain = 0x0000,
208                         .bus = 0x00,
209                         .devfn = 0xfb,
210                 },
211         },
212 };