]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/fiasco-demo.c
configs: fiasco: Allow memory region 0xfec00000-0xfeefffff.
[jailhouse.git] / configs / fiasco-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Configuration for linux inmate, 1 CPU, ~60 MB RAM, 1 serial port
5  *
6  * Copyright (c) Siemens AG, 2013-2015
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_cell_desc cell;
22         __u64 cpus[1];
23         struct jailhouse_memory mem_regions[2]; 
24         struct jailhouse_irqchip irqchips[1];
25         __u8 pio_bitmap[0x2000];
26         struct jailhouse_pci_device pci_devices[0];
27 } __attribute__((packed)) config = {
28         .cell = {
29                 .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
30                 .name = "fiasco-demo",
31                 .flags = 0/*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 = ARRAY_SIZE(config.pci_devices),
38                 .num_pci_caps = 0,
39         },
40
41         .cpus = {
42                 0x1,
43         },
44
45         .mem_regions = {
46                 /* low RAM */ {
47                         .phys_start = 0x3b600000,
48                         .virt_start = 0,
49                         .size = 0x3bff000,
50                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
51                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
52                                 JAILHOUSE_MEM_LOADABLE,
53                 },
54                 ///* communication region */ {
55                 //      .virt_start = 0x00100000,
56                 //      .size = 0x00001000,
57                 //      .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
58                 //              JAILHOUSE_MEM_COMM_REGION,
59                 //},
60                 // /* high RAM */ {
61                 //      .phys_start = 0x3b700000,
62                 //      .virt_start = 0x00200000,
63                 //      .size = 0x3aff000,
64                 //      .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
65                 //              JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
66                 //              JAILHOUSE_MEM_LOADABLE,
67                 // },
68                 // /* IVSHMEM shared memory region */
69                 // {
70                 //      .phys_start = 0x3f1ff000,
71                 //      .virt_start = 0x3f1ff000,
72                 //      .size = 0x1000,
73                 //      .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
74                 //              JAILHOUSE_MEM_ROOTSHARED,
75                 // },
76                 /* MemRegion: fec00000-feefffff : PNP0103:00 */
77                 {
78                         .phys_start = 0xfec00000,
79                         .virt_start = 0xfec00000,
80                         .size = 0x300000,
81                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_DMA,
82                 },
83         },
84
85         .irqchips = {
86                 // lAPIC
87                 {
88                         .address = 0xfec00000,
89                         .id = 0xff01,
90                         .pin_bitmap = 0xffffffff,
91                 },
92         },
93
94         .pio_bitmap = {
95                 
96                 [     0/8 ...   0x3f/8] = -1,
97                 [  0x20/8 ...   0x28/8] = 0xfc, /* PIC Master 0x20 0x21 */
98                 [  0x29/8 ...   0x3f/8] = -1,                   
99                 [  0x40/8 ...   0x47/8] = 0xf0, /* PIT */
100                 [  0x48/8 ...   0x5f/8] = -1,
101                 [  0x60/8 ...   0x67/8] = 0,
102                 [  0x68/8 ...   0x7f/8] = -1,
103                 [  0x80/8 ...   0x88/8] = 0xfe, //delay
104                 [  0x89/8 ...   0x99/8] = -1,
105                 [  0xA0/8 ...   0xA8/8] = 0xfc, /* PIC Slave 0xA0 0xA1 */
106                 [ 0xA9/8  ...  0x3f7/8] = -1,
107                 [ 0x3f8/8 ...  0x3ff/8] = 0, /* serial1 */
108                 [ 0x400/8 ... 0xe00f/8] = -1,
109                 [0xe010/8 ... 0xe017/8] = 0, /* OXPCIe952 serial1 */
110                 [0xe018/8 ... 0xffff/8] = -1,
111         },
112
113
114         // .pci_devices = {
115         //      {
116         //              .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
117         //              .domain = 0x0,
118         //              .bdf = (0x0f<<3),
119         //              .bar_mask = {
120         //                      0xffffff00, 0xffffffff, 0x00000000,
121         //                      0x00000000, 0xffffffe0, 0xffffffff,
122         //              },
123         //              .shmem_region = 3,
124         //              .num_msix_vectors = 1,
125         //      },
126         // },
127 };