]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/h700-8G.c
configs: Clean up PIO bitmaps
[jailhouse.git] / configs / h700-8G.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Test configuration for Celsius H700, 8 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[25];
27 } __attribute__((packed)) config = {
28         .header = {
29                 .hypervisor_memory = {
30                         .phys_start = 0x3c000000,
31                         .size = 0x4000000,
32                 },
33                 .config_memory = {
34                         .phys_start = 0xbf7de000,
35                         .size = 0x21000,
36                 },
37                 .platform_info.x86 = {
38                         .pm_timer_address = 0x408,
39                 },
40                 .root_cell = {
41                         .name = "Celsius H700",
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                 0xf,
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 = 0x7f7de000,
67                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
68                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
69                 },
70                 /* ACPI */ {
71                         .phys_start = 0xbf7de000,
72                         .virt_start = 0xbf7de000,
73                         .size = 0x21000,
74                         .flags = JAILHOUSE_MEM_READ,
75                 },
76                 /* RAM */ {
77                         .phys_start = 0xbf7ff000,
78                         .virt_start = 0xbf7ff000,
79                         .size = 0x801000,
80                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
81                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
82                 },
83                 /* PCI */ {
84                         .phys_start = 0xc0000000,
85                         .virt_start = 0xc0000000,
86                         .size = 0x3eb00000,
87                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
88                 },
89                 /* not safe until we catch MSIs via interrupt remapping */
90                 /* HPET */ {
91                         .phys_start = 0xfed00000,
92                         .virt_start = 0xfed00000,
93                         .size = 0x1000,
94                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
95                 },
96                 /* RAM */ {
97                         .phys_start = 0x100000000,
98                         .virt_start = 0x100000000,
99                         .size = 0xfc000000,
100                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
101                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
102                 },
103                 /* RAM */ {
104                         .phys_start = 0x200000000,
105                         .virt_start = 0x200000000,
106                         .size = 0x3c000000,
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 ...  0x2f7/8] = -1,
127                 [ 0x2f8/8 ...  0x2ff/8] = 0, /* serial2 */
128                 [ 0x300/8 ...  0x36f/8] = -1,
129                 [ 0x370/8 ...  0x377/8] = 0xbf, /* ide */
130                 [ 0x378/8 ...  0x3af/8] = -1,
131                 [ 0x3b0/8 ...  0x3df/8] = 0, /* VGA */
132                 [ 0x3e0/8 ...  0x3f7/8] = -1,
133                 [ 0x3f8/8 ...  0x3ff/8] = 0, /* serial 1 */
134                 [ 0x400/8 ...  0x47f/8] = 0, /* ACPI...? */
135                 [ 0x480/8 ...  0xcff/8] = -1,
136                 [ 0xd00/8 ... 0xffff/8] = 0, /* HACK: full PCI */
137         },
138
139         .pci_devices = {
140                 {
141                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
142                         .domain = 0x0000,
143                         .bus = 0x00,
144                         .devfn = 0x00,
145                 },
146                 {
147                         .type = JAILHOUSE_PCI_TYPE_BRIDGE,
148                         .domain = 0x0000,
149                         .bus = 0x00,
150                         .devfn = 0x08,
151                 },
152                 {
153                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
154                         .domain = 0x0000,
155                         .bus = 0x00,
156                         .devfn = 0xb0,
157                 },
158                 {
159                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
160                         .domain = 0x0000,
161                         .bus = 0x00,
162                         .devfn = 0xb2,
163                 },
164                 {
165                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
166                         .domain = 0x0000,
167                         .bus = 0x00,
168                         .devfn = 0xb3,
169                 },
170                 {
171                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
172                         .domain = 0x0000,
173                         .bus = 0x00,
174                         .devfn = 0xc8,
175                 },
176                 {
177                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
178                         .domain = 0x0000,
179                         .bus = 0x00,
180                         .devfn = 0xd0,
181                 },
182                 {
183                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
184                         .domain = 0x0000,
185                         .bus = 0x00,
186                         .devfn = 0xd8,
187                 },
188                 {
189                         .type = JAILHOUSE_PCI_TYPE_BRIDGE,
190                         .domain = 0x0000,
191                         .bus = 0x00,
192                         .devfn = 0xe0,
193                 },
194                 {
195                         .type = JAILHOUSE_PCI_TYPE_BRIDGE,
196                         .domain = 0x0000,
197                         .bus = 0x00,
198                         .devfn = 0xe1,
199                 },
200                 {
201                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
202                         .domain = 0x0000,
203                         .bus = 0x00,
204                         .devfn = 0xe8,
205                 },
206                 {
207                         .type = JAILHOUSE_PCI_TYPE_BRIDGE,
208                         .domain = 0x0000,
209                         .bus = 0x00,
210                         .devfn = 0xf0,
211                 },
212                 {
213                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
214                         .domain = 0x0000,
215                         .bus = 0x00,
216                         .devfn = 0xf8,
217                 },
218                 {
219                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
220                         .domain = 0x0000,
221                         .bus = 0x00,
222                         .devfn = 0xfa,
223                 },
224                 {
225                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
226                         .domain = 0x0000,
227                         .bus = 0x00,
228                         .devfn = 0xfb,
229                 },
230                 {
231                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
232                         .domain = 0x0000,
233                         .bus = 0x00,
234                         .devfn = 0xfe,
235                 },
236                 {
237                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
238                         .domain = 0x0000,
239                         .bus = 0x01,
240                         .devfn = 0x00,
241                 },
242                 {
243                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
244                         .domain = 0x0000,
245                         .bus = 0x01,
246                         .devfn = 0x01,
247                 },
248                 {
249                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
250                         .domain = 0x0000,
251                         .bus = 0x10,
252                         .devfn = 0x00,
253                 },
254                 {
255                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
256                         .domain = 0x0000,
257                         .bus = 0xff,
258                         .devfn = 0x00,
259                 },
260                 {
261                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
262                         .domain = 0x0000,
263                         .bus = 0xff,
264                         .devfn = 0x01,
265                 },
266                 {
267                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
268                         .domain = 0x0000,
269                         .bus = 0xff,
270                         .devfn = 0x10,
271                 },
272                 {
273                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
274                         .domain = 0x0000,
275                         .bus = 0xff,
276                         .devfn = 0x11,
277                 },
278                 {
279                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
280                         .domain = 0x0000,
281                         .bus = 0xff,
282                         .devfn = 0x12,
283                 },
284                 {
285                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
286                         .domain = 0x0000,
287                         .bus = 0xff,
288                         .devfn = 0x13,
289                 },
290         },
291 };