meta-agl-jailhouse: Added inmates for jailhouse on agl
[AGL/meta-agl-devel.git] / meta-agl-jailhouse / recipes-extended / jailhouse / files / agl-apic-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Minimal configuration for demo inmates, 1 CPU, 1 MB RAM, 1 serial port
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 <jailhouse/types.h>
16 #include <jailhouse/cell-config.h>
17
18 struct {
19         struct jailhouse_cell_desc cell;
20         __u64 cpus[1];
21         struct jailhouse_memory mem_regions[2];
22         struct jailhouse_cache cache_regions[1];
23         struct jailhouse_pio pio_regions[1];//[2]->[1]  stop @0x3f8
24 } __attribute__((packed)) config = {
25         .cell = {
26                 .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
27                 .revision = JAILHOUSE_CONFIG_REVISION,
28                 .name = "agl-apic-demo",
29                 .flags = JAILHOUSE_CELL_VIRTUAL_CONSOLE_PERMITTED,
30
31                 .cpu_set_size = sizeof(config.cpus),
32                 .num_memory_regions = ARRAY_SIZE(config.mem_regions),
33                 .num_cache_regions = ARRAY_SIZE(config.cache_regions),
34                 .num_irqchips = 0,
35                 .num_pio_regions = ARRAY_SIZE(config.pio_regions),
36                 .num_pci_devices = 0,
37
38                 .console = {
39                         .type = JAILHOUSE_CON_TYPE_8250,
40                         .flags = JAILHOUSE_CON_ACCESS_PIO,
41                         .address = 0x2f8,    /* ######## ttyS0 is host -> ttyS1 */
42                 },
43         },
44
45         .cpus = {
46                 0x8,
47         },
48
49         .mem_regions = {
50                 /* RAM */ { /* JH_memory: 0x22600000-0x271fffff */
51                         .phys_start = 0x26e00000 ,   /* agl-linux-x86: 0x22600000-0x26e00000 */
52                         .virt_start = 0,             /* agl-ivshmem: 0x26e00000- (end of ivshmem cell) */
53                         .size = 0x00100000,
54                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
55                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
56                 },
57                 /* communication region */ {
58                         .virt_start = 0x00100000,
59                         .size = 0x00001000,
60                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
61                                 JAILHOUSE_MEM_COMM_REGION,
62                 },
63         },
64
65         .cache_regions = {
66                 {
67                         .start = 0,
68                         .size = 2,
69                         .type = JAILHOUSE_CACHE_L3,
70                 },
71         },
72
73         .pio_regions = {
74                 PIO_RANGE(0x2f8, 8), /* serial 2 */
75 //              PIO_RANGE(0x3f8, 8), /* serial 1 */
76                 PIO_RANGE(0xe010, 8), /* OXPCIe952 serial */
77         },
78 };