]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/ioapic-demo.c
fix of a bad merge.
[jailhouse.git] / configs / ioapic-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Minimal configuration for IOAPIC demo inmate:
5  * 1 CPU, 1 MB RAM, 1 serial port, 1 ACPI IRQ pin
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[2];
25         struct jailhouse_irqchip irqchips[1];
26         __u8 pio_bitmap[0x2000];
27 } __attribute__((packed)) config = {
28         .cell = {
29                 .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
30                 .name = "ioapic-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 = ARRAY_SIZE(config.irqchips),
36                 .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
37                 .num_pci_devices = 0,
38         },
39
40         .cpus = {
41                 0x4,
42         },
43
44         .mem_regions = {
45                 /* RAM */ {
46                         .phys_start = 0x3f100000,
47                         .virt_start = 0,
48                         .size = 0x00100000,
49                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
50                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
51                 },
52                 /* communication region */ {
53                         .virt_start = 0x00100000,
54                         .size = 0x00001000,
55                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
56                                 JAILHOUSE_MEM_COMM_REGION,
57                 },
58         },
59
60         .irqchips = {
61                 /* IOAPIC */ {
62                         .address = 0xfec00000,
63                         .id = 0xff01,
64                         .pin_bitmap = 0x000200, /* ACPI IRQ */
65                 },
66         },
67
68         .pio_bitmap = {
69                 [     0/8 ...  0x2f7/8] = -1,
70                 [ 0x2f8/8 ...  0x2ff/8] = 0, /* serial2 */
71                 [ 0x300/8 ...  0x5ff/8] = -1,
72                 [ 0x600/8 ...  0x607/8] = 0xf0, /* acpi-evt */
73                 [ 0x608/8 ...  0x7ff/8] = -1,
74                 [ 0x800/8 ...  0x807/8] = 0xf0 /* apci-pm1a */,
75                 [ 0x808/8 ... 0xdfff/8] = -1,
76                 [0xe000/8 ... 0xe007/8] = 0, /* OXPCIe952 serial2 */
77                 [0xe008/8 ... 0xffff/8] = -1,
78         },
79 };