summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOla Redell <ola.redell@retotech.se>2017-10-26 22:08:20 +0200
committerOla Redell <ola.redell@retotech.se>2017-10-26 22:08:20 +0200
commitf6385bb27bde44099fe2b90dc05a42c8cd124361 (patch)
tree8b182d79f1f24ab25b4f19af2e3683bf38c34080
parent898b980a4dd50a6db88efba77f015225eda144c3 (diff)
downloadmeta-jailhouse-f6385bb27bde44099fe2b90dc05a42c8cd124361.tar.gz
added first set of recipe files for
-rw-r--r--recipes-jailhouse/jailhouse/files/0001-ldflags-for-tools.patch13
-rw-r--r--recipes-jailhouse/jailhouse/files/0002-no-ldflags-in-tools.patch13
-rw-r--r--recipes-jailhouse/jailhouse/files/0003-workaround-if-changed-problem-in-tools-makefile.patch18
-rw-r--r--recipes-jailhouse/jailhouse/files/0004-no-kbuild-of-tools.patch13
-rw-r--r--recipes-jailhouse/jailhouse/files/jailhouse-config-bpi.h9
-rw-r--r--recipes-jailhouse/jailhouse/files/plamics-bpi-root.c221
-rw-r--r--recipes-jailhouse/jailhouse/jailhouse.inc82
-rw-r--r--recipes-jailhouse/jailhouse/jailhouse_0.6.bb13
8 files changed, 382 insertions, 0 deletions
diff --git a/recipes-jailhouse/jailhouse/files/0001-ldflags-for-tools.patch b/recipes-jailhouse/jailhouse/files/0001-ldflags-for-tools.patch
new file mode 100644
index 0000000..47b79ed
--- /dev/null
+++ b/recipes-jailhouse/jailhouse/files/0001-ldflags-for-tools.patch
@@ -0,0 +1,13 @@
1diff --git a/tools/Makefile b/tools/Makefile
2index 4d91e7a..ecc5503 100644
3--- a/tools/Makefile
4+++ b/tools/Makefile
5@@ -19,7 +19,7 @@ LINUXINCLUDE := -I$(src)/../driver
6 KBUILD_CFLAGS := -g -O3 -DLIBEXECDIR=\"$(libexecdir)\" \
7 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
8 -DJAILHOUSE_VERSION=\"$(shell cat $(src)/../VERSION)\" $(EXTRA_CFLAGS)
9-LDFLAGS :=
10+LDFLAGS := $(EXTRA_LDLAGS)
11
12 BINARIES := jailhouse
13 HELPERS := \
diff --git a/recipes-jailhouse/jailhouse/files/0002-no-ldflags-in-tools.patch b/recipes-jailhouse/jailhouse/files/0002-no-ldflags-in-tools.patch
new file mode 100644
index 0000000..e94f69d
--- /dev/null
+++ b/recipes-jailhouse/jailhouse/files/0002-no-ldflags-in-tools.patch
@@ -0,0 +1,13 @@
1diff --git a/tools/Makefile b/tools/Makefile
2index 4d91e7a..ecc5503 100644
3--- a/tools/Makefile
4+++ b/tools/Makefile
5@@ -19,7 +19,7 @@ LINUXINCLUDE := -I$(src)/../driver
6 KBUILD_CFLAGS := -g -O3 -DLIBEXECDIR=\"$(libexecdir)\" \
7 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
8 -DJAILHOUSE_VERSION=\"$(shell cat $(src)/../VERSION)\" $(EXTRA_CFLAGS)
9-LDFLAGS :=
10+#LDFLAGS := $(EXTRA_LDLAGS)
11
12 BINARIES := jailhouse
13 HELPERS := \
diff --git a/recipes-jailhouse/jailhouse/files/0003-workaround-if-changed-problem-in-tools-makefile.patch b/recipes-jailhouse/jailhouse/files/0003-workaround-if-changed-problem-in-tools-makefile.patch
new file mode 100644
index 0000000..7d02b55
--- /dev/null
+++ b/recipes-jailhouse/jailhouse/files/0003-workaround-if-changed-problem-in-tools-makefile.patch
@@ -0,0 +1,18 @@
1Index: git/tools/Makefile
2===================================================================
3--- git.orig/tools/Makefile
4+++ git/tools/Makefile
5@@ -55,10 +55,11 @@ endef
6 targets += jailhouse.o
7
8 $(obj)/jailhouse: $(obj)/jailhouse.o
9- $(call if_changed,ld)
10+ $(LD) $(LDFLAGS) -o $@ $^
11
12 $(obj)/jailhouse-config-collect: $(src)/jailhouse-config-create $(src)/jailhouse-config-collect.tmpl
13- $(call if_changed,gen_collect)
14+ $< -g $@; \
15+ chmod +x $@
16
17 install-bin: $(BINARIES) $(DESTDIR)$(sbindir)
18 $(INSTALL_PROGRAM) $^
diff --git a/recipes-jailhouse/jailhouse/files/0004-no-kbuild-of-tools.patch b/recipes-jailhouse/jailhouse/files/0004-no-kbuild-of-tools.patch
new file mode 100644
index 0000000..4e0f337
--- /dev/null
+++ b/recipes-jailhouse/jailhouse/files/0004-no-kbuild-of-tools.patch
@@ -0,0 +1,13 @@
1Index: git/Kbuild
2===================================================================
3--- git.orig/Kbuild
4+++ git/Kbuild
5@@ -11,7 +11,7 @@
6 # the COPYING file in the top-level directory.
7 #
8
9-subdir-y := driver hypervisor configs inmates tools
10+subdir-y := driver hypervisor configs inmates
11
12 subdir-ccflags-y := -Werror
13
diff --git a/recipes-jailhouse/jailhouse/files/jailhouse-config-bpi.h b/recipes-jailhouse/jailhouse/files/jailhouse-config-bpi.h
new file mode 100644
index 0000000..91f651c
--- /dev/null
+++ b/recipes-jailhouse/jailhouse/files/jailhouse-config-bpi.h
@@ -0,0 +1,9 @@
1#define CONFIG_ARM_GIC_V2 1
2#define CONFIG_MACH_SUN7I 1
3
4/* Enable error tracing,
5 * c.f. https://github.com/siemens/jailhouse/blob/master/FAQ.md
6 * (Redefine macro:
7 * jailhouse/hypervisor/include/jailhouse/printk.h:trace_error(code)).
8 */
9#define CONFIG_TRACE_ERROR
diff --git a/recipes-jailhouse/jailhouse/files/plamics-bpi-root.c b/recipes-jailhouse/jailhouse/files/plamics-bpi-root.c
new file mode 100644
index 0000000..3d7b79f
--- /dev/null
+++ b/recipes-jailhouse/jailhouse/files/plamics-bpi-root.c
@@ -0,0 +1,221 @@
1/*
2 * Jailhouse, a Linux-based partitioning hypervisor
3 *
4 * Test configuration for Banana Pi board (A20 dual-core Cortex-A7, 1G RAM)
5 *
6 * Copyright (c) Siemens AG, 2014
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#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
19
20struct {
21 struct jailhouse_system header;
22 __u64 cpus[1];
23 struct jailhouse_memory mem_regions[18];
24 struct jailhouse_irqchip irqchips[1];
25 struct jailhouse_pci_device pci_devices[1];
26} __attribute__((packed)) config = {
27 .header = {
28 .signature = JAILHOUSE_SYSTEM_SIGNATURE,
29 .revision = JAILHOUSE_CONFIG_REVISION,
30 .hypervisor_memory = {
31 .phys_start = 0x7c000000,
32 .size = 0x4000000,
33 },
34 .debug_console = {
35 .address = 0x01c28000,
36 .size = 0x1000,
37 /* .clock_reg = 0x01c2006c, */
38 /* .gate_nr = 16 */
39 /* .divider = 0x0d, */
40 .flags = JAILHOUSE_CON_TYPE_8250 |
41 JAILHOUSE_CON_FLAG_MMIO,
42 },
43 .platform_info = {
44 .pci_mmconfig_base = 0x2000000,
45 .pci_mmconfig_end_bus = 0,
46 .pci_is_virtual = 1,
47 .arm = {
48 .gicd_base = 0x01c81000,
49 .gicc_base = 0x01c82000,
50 .gich_base = 0x01c84000,
51 .gicv_base = 0x01c86000,
52 .maintenance_irq = 25,
53 },
54 },
55 .root_cell = {
56 .name = "Banana-Pi",
57
58 .cpu_set_size = sizeof(config.cpus),
59 .num_memory_regions = ARRAY_SIZE(config.mem_regions),
60 .num_irqchips = ARRAY_SIZE(config.irqchips),
61 .num_pci_devices = ARRAY_SIZE(config.pci_devices),
62
63 .vpci_irq_base = 108,
64 },
65 },
66
67 .cpus = {
68 0x3,
69 },
70
71 .mem_regions = {
72 /* SPI */ {
73 .phys_start = 0x01c05000,
74 .virt_start = 0x01c05000,
75 .size = 0x00001000,
76 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
77 JAILHOUSE_MEM_IO,
78 },
79 /* MMC */ {
80 .phys_start = 0x01c0f000,
81 .virt_start = 0x01c0f000,
82 .size = 0x00001000,
83 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
84 JAILHOUSE_MEM_IO,
85 },
86 /* USB + PMU1 */ {
87 .phys_start = 0x01c14000,
88 .virt_start = 0x01c14000,
89 .size = 0x00001000,
90 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
91 JAILHOUSE_MEM_IO,
92 },
93 /* SATA */ {
94 .phys_start = 0x01c18000,
95 .virt_start = 0x01c18000,
96 .size = 0x00001000,
97 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
98 JAILHOUSE_MEM_IO,
99 },
100 /* USB + PMU2 */ {
101 .phys_start = 0x01c1c000,
102 .virt_start = 0x01c1c000,
103 .size = 0x00001000,
104 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
105 JAILHOUSE_MEM_IO,
106 },
107 /* CCU */ {
108 .phys_start = 0x01c20000,
109 .virt_start = 0x01c20000,
110 .size = 0x400,
111 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
112 JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_32,
113 },
114 /* Ints */ {
115 .phys_start = 0x01c20400,
116 .virt_start = 0x01c20400,
117 .size = 0x400,
118 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
119 JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_32,
120 },
121 /* GPIO: ports A-G */ {
122 .phys_start = 0x01c20800,
123 .virt_start = 0x01c20800,
124 .size = 0xfc,
125 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
126 JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_32,
127 },
128 /* GPIO: port H */ {
129 .phys_start = 0x01c208fc,
130 .virt_start = 0x01c208fc,
131 .size = 0x24,
132 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
133 JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_32,
134 },
135 /* GPIO: port I */ {
136 .phys_start = 0x01c20920,
137 .virt_start = 0x01c20920,
138 .size = 0x24,
139 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
140 JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_32,
141 },
142 /* GPIO: intr config */ {
143 .phys_start = 0x01c20a00,
144 .virt_start = 0x01c20a00,
145 .size = 0x1c,
146 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
147 JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_32,
148 },
149 /* Timer */ {
150 .phys_start = 0x01c20c00,
151 .virt_start = 0x01c20c00,
152 .size = 0x400,
153 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
154 JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_32,
155 },
156 /* UART0-3 */ {
157 .phys_start = 0x01c28000,
158 .virt_start = 0x01c28000,
159 .size = 0x1000,
160 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
161 JAILHOUSE_MEM_IO,
162 },
163 /* GMAC */ {
164 .phys_start = 0x01c50000,
165 .virt_start = 0x01c50000,
166 .size = 0x00010000,
167 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
168 JAILHOUSE_MEM_IO,
169 },
170 /* HSTIMER */ {
171 .phys_start = 0x01c60000,
172 .virt_start = 0x01c60000,
173 .size = 0x00001000,
174 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
175 JAILHOUSE_MEM_IO,
176 },
177 /* RAM */ {
178 .phys_start = 0x40000000,
179 .virt_start = 0x40000000,
180 .size = 0x3bf00000,
181 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
182 JAILHOUSE_MEM_EXECUTE,
183 },
184 /* IVSHMEM shared memory region */ {
185 .phys_start = 0x7bf00000,
186 .virt_start = 0x7bf00000,
187 .size = 0x100000,
188 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
189 },
190 /* Framebuffer */ {
191 .phys_start = 0x7f700000,
192 .virt_start = 0x7f700000,
193 .size = 9<<20,
194 .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
195 JAILHOUSE_MEM_IO,
196 },
197 },
198
199 .irqchips = {
200 /* GIC */ {
201 .address = 0x01c81000,
202 .pin_base = 32,
203 .pin_bitmap = {
204 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
205 },
206 },
207 },
208
209 .pci_devices = {
210 {
211 .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
212 .bdf = 0x00,
213 .bar_mask = {
214 0xffffff00, 0xffffffff, 0x00000000,
215 0x00000000, 0x00000000, 0x00000000,
216 },
217 .shmem_region = 16,
218 .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,
219 },
220 },
221};
diff --git a/recipes-jailhouse/jailhouse/jailhouse.inc b/recipes-jailhouse/jailhouse/jailhouse.inc
new file mode 100644
index 0000000..2c30725
--- /dev/null
+++ b/recipes-jailhouse/jailhouse/jailhouse.inc
@@ -0,0 +1,82 @@
1SUMMARY = "Jailhouse"
2HOMEPAGE = "https://github.com/siemens/jailhouse"
3SECTION = "jailhouse"
4LICENSE = "GPL-2.0 & BSD-2-Clause"
5LIC_FILES_CHKSUM = "file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \
6 file://tools/root-cell-config.c.tmpl;beginline=6;endline=33;md5=2825581c1666c44a17955dc574cfbfb3 \
7 file://hypervisor/include/jailhouse/hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
8 file://hypervisor/include/jailhouse/cell-config.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
9 file://hypervisor/arch/arm/include/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
10 file://hypervisor/arch/x86/include/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
11 file://driver/jailhouse.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3"
12
13DEPENDS = "virtual/kernel make-native python-mako-native dtc-native python-mako"
14
15S ="${WORKDIR}/git"
16
17JH_DATADIR="${datadir}/jailhouse"
18CELL_DIR ?= "${JH_DATADIR}/cells"
19CELLCONF_DIR ?= "${JH_DATADIR}/configs"
20INMATES_DIR ?= "${JH_DATADIR}/inmates"
21
22export PACKAGECONFIG_CONFARGS
23
24inherit module pythonnative bash-completion
25
26do_configure() {
27 # Copy all cell configs included through PACKAGECONFIG
28 for arg in $(echo $PACKAGECONFIG_CONFARGS); do
29 if conf=$(echo $arg | grep -o "with-.*$");
30 then
31 cp "${STAGING_DIR_HOST}/${CELLCONF_DIR}/${conf#with-}.c" ${S}/configs/
32 fi
33 done
34}
35
36USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
37 -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
38 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
39 -I../driver'
40
41TOOLS_SRC_DIR = "${S}/tools"
42TOOLS_OBJ_DIR = "${S}/tools"
43
44do_compile() {
45 oe_runmake V=1 \
46 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} \
47 KDIR=${STAGING_KERNEL_BUILDDIR}
48
49 cd ${TOOLS_SRC_DIR}
50 export JAILHOUSE_VERSION=$(cat ../VERSION)
51 oe_runmake V=1 \
52 CFLAGS="${USER_SPACE_CFLAGS}" \
53 src=${TOOLS_SRC_DIR} obj=${TOOLS_OBJ_DIR} \
54 ${TOOLS_OBJ_DIR}/jailhouse-config-collect ${TOOLS_OBJ_DIR}/jailhouse
55}
56
57do_install() {
58 oe_runmake \
59 ARCH=${TARGET_ARCH} \
60 CROSS_COMPILE=${TARGET_PREFIX} \
61 KDIR=${STAGING_KERNEL_BUILDDIR} \
62 DESTDIR=${D} install
63
64 install -d ${D}${CELL_DIR}
65 install ${B}/configs/*.cell ${D}${CELL_DIR}/
66
67 install -d ${D}${INMATES_DIR}
68 install ${B}/inmates/demos/${TARGET_ARCH}/*.bin ${D}${INMATES_DIR}
69}
70
71PACKAGE_BEFORE_PN = "kernel-module-jailhouse"
72FILES_${PN} = "${base_libdir}/firmware ${libexecdir} ${sbindir} ${JH_DATADIR}"
73
74PACKAGECONFIG ??= "freertos-cell freertos-demo1-cell freertos-demo3-cell freertos-ivshmem-demo"
75PACKAGECONFIG[freertos-cell] = \
76 "--with-freertos-cell,,freertos-cell,freertos-cell"
77PACKAGECONFIG[freertos-demo1-cell] = \
78 "--with-freertos-demo1-cell,,freertos-demo1-cell,freertos-demo1-cell"
79PACKAGECONFIG[freertos-demo3-cell] = \
80 "--with-freertos-demo3-cell,,freertos-demo3-cell,freertos-demo3-cell"
81PACKAGECONFIG[freertos-ivshmem-demo] = \
82 "--with-freertos-ivshmem-demo,,freertos-ivshmem-demo,freertos-ivshmem-demo"
diff --git a/recipes-jailhouse/jailhouse/jailhouse_0.6.bb b/recipes-jailhouse/jailhouse/jailhouse_0.6.bb
new file mode 100644
index 0000000..8a049d9
--- /dev/null
+++ b/recipes-jailhouse/jailhouse/jailhouse_0.6.bb
@@ -0,0 +1,13 @@
1require jailhouse.inc
2
3SRC_URI = "git://github.com/siemens/jailhouse.git;protocol=git \
4 file://0002-no-ldflags-in-tools.patch \
5 file://0003-workaround-if-changed-problem-in-tools-makefile.patch \
6 file://0004-no-kbuild-of-tools.patch \
7 "
8
9SRCREV = "81528e48763c8dfc10851c49968eb3d053d4b85c"
10
11#do_configure_append() {
12# cp -av ${S}/ci/jailhouse-config-banana-pi.h ${S}/hypervisor/include/jailhouse/config.h
13#}