]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/h87i.c
configs: Specify PM timer addresses
[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 ...   0x1f/8] = -1,
121                 [  0x20/8 ...   0x27/8] = 0xfc, /* HACK: PIC */
122                 [  0x28/8 ...   0x3f/8] = -1,
123                 [  0x40/8 ...   0x47/8] = 0xf0, /* PIT */
124                 [  0x48/8 ...   0x5f/8] = -1,
125                 [  0x60/8 ...   0x67/8] = 0x0, /* HACK: 8042, and more? */
126                 [  0x68/8 ...   0x6f/8] = -1,
127                 [  0x70/8 ...   0x77/8] = 0xfc, /* rtc */
128                 [  0x78/8 ...   0x7f/8] = -1,
129                 [  0x80/8 ...   0x8f/8] = 0, /* dma */
130                 [  0x90/8 ...  0x3af/8] = -1,
131                 [ 0x3b0/8 ...  0x3df/8] = 0, /* VGA */
132                 [ 0x3e0/8 ...  0xcff/8] = -1,
133                 [ 0xd00/8 ... 0xffff/8] = 0, /* HACK: full PCI */
134         },
135
136         .pci_devices = {
137                 {
138                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
139                         .domain = 0x0000,
140                         .bus = 0x00,
141                         .devfn = 0x00,
142                 },
143                 {
144                         .type = JAILHOUSE_PCI_TYPE_BRIDGE,
145                         .domain = 0x0000,
146                         .bus = 0x00,
147                         .devfn = 0x08,
148                 },
149                 {
150                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
151                         .domain = 0x0000,
152                         .bus = 0x00,
153                         .devfn = 0x10,
154                 },
155                 {
156                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
157                         .domain = 0x0000,
158                         .bus = 0x00,
159                         .devfn = 0x18,
160                 },
161                 {
162                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
163                         .domain = 0x0000,
164                         .bus = 0x00,
165                         .devfn = 0xa0,
166                 },
167                 {
168                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
169                         .domain = 0x0000,
170                         .bus = 0x00,
171                         .devfn = 0xb0,
172                 },
173                 {
174                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
175                         .domain = 0x0000,
176                         .bus = 0x00,
177                         .devfn = 0xc8,
178                 },
179                 {
180                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
181                         .domain = 0x0000,
182                         .bus = 0x00,
183                         .devfn = 0xd0,
184                 },
185                 {
186                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
187                         .domain = 0x0000,
188                         .bus = 0x00,
189                         .devfn = 0xd8,
190                 },
191                 {
192                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
193                         .domain = 0x0000,
194                         .bus = 0x00,
195                         .devfn = 0xe8,
196                 },
197                 {
198                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
199                         .domain = 0x0000,
200                         .bus = 0x00,
201                         .devfn = 0xf8,
202                 },
203                 {
204                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
205                         .domain = 0x0000,
206                         .bus = 0x00,
207                         .devfn = 0xfa,
208                 },
209                 {
210                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
211                         .domain = 0x0000,
212                         .bus = 0x00,
213                         .devfn = 0xfb,
214                 },
215         },
216 };