summaryrefslogtreecommitdiffstats
path: root/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
diff options
context:
space:
mode:
authorParesh Bhagat <p-bhagat@ti.com>2024-02-21 16:52:18 +0530
committerRyan Eatmon <reatmon@ti.com>2024-02-21 14:27:33 -0600
commit474480951631a16c28ccfe675cb88a657f34d625 (patch)
tree9229e0d58bcde24c430f4ebe11ccdc86b375ff70 /meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
parent713ef2619a7a0db73ceccda655d3df087e0c0d15 (diff)
downloadmeta-ti-474480951631a16c28ccfe675cb88a657f34d625.tar.gz
Rework jailhouse recipe to support different image build
This patch moves the jailhouse recipe general variables to a ti-jailhouse.inc file along with fetch and compile task. Jailhouse repo also contains some demo applications which can be packaged alone in filesytem and does not require packaging jailhouse module, firmware and tool. So add a new recipe jailhouse-inmate which can be used to only package those demos. The existing jailhouse recipe will contain variables and other dependencies needed for do_install task for jailhouse module, tools, demos etc. The do_install of jailhouse inmate recipe will only package demo applications. This new recipe(jailhouse-inmate) will be added to a new image in meta-arago. The new image will be used for jailhouse second linux instance or cell. Signed-off-by: Paresh Bhagat <p-bhagat@ti.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc')
-rw-r--r--meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc87
1 files changed, 87 insertions, 0 deletions
diff --git a/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc b/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
new file mode 100644
index 00000000..a63891bf
--- /dev/null
+++ b/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
@@ -0,0 +1,87 @@
1SUMMARY = "Linux-based partitioning hypervisor"
2DESCRIPTION = "Jailhouse is a partitioning Hypervisor based on Linux. It is able to run bare-metal applications or (adapted) \
3operating systems besides Linux. For this purpose, it configures CPU and device virtualization features of the hardware \
4platform in a way that none of these domains, called 'cells' here, can interfere with each other in an unacceptable way."
5HOMEPAGE = "https://github.com/siemens/jailhouse"
6SECTION = "jailhouse"
7
8LICENSE = "GPL-2.0-only & BSD-2-Clause"
9
10LIC_FILES_CHKSUM = " \
11 file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \
12"
13
14COMPATIBLE_MACHINE = "am62xx|am62pxx"
15TARGET_CC_ARCH += "${LDFLAGS}"
16PV = "0.12+git${SRCPV}"
17SRCREV = "0b29ad90f6f54105b98d6bbf35cc47fb244f7799"
18BRANCH = "master"
19SRC_URI = " \
20 git://git.ti.com/git/jailhouse/ti-jailhouse.git;protocol=https;branch=${BRANCH} \
21"
22
23# Set jailhouse architecture JH_ARCH variable
24#
25# return value must match one of architectures supported by jailhouse
26#
27valid_jh_archs = "x86 arm"
28
29def map_jh_arch(a, d):
30 import re
31
32 valid_jh_archs = d.getVar('valid_jh_archs', True).split()
33
34 if re.match('(i.86|athlon|x86.64)$', a): return 'x86'
35 elif re.match('armeb$', a): return 'arm'
36 elif re.match('aarch64$', a): return 'arm64'
37 elif re.match('aarch64_be$', a): return 'arm64'
38 elif a in valid_jh_archs: return a
39 else:
40 bb.error("cannot map '%s' to a jailhouse supported architecture" % a)
41
42export JH_ARCH = "${@map_jh_arch(d.getVar('TARGET_ARCH', True), d)}"
43
44COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
45
46S = "${WORKDIR}/git"
47B = "${S}"
48
49DEPENDS = "virtual/kernel dtc-native python3-mako-native python3-mako make-native"
50
51inherit module python3native bash-completion deploy setuptools3
52
53PACKAGE_ARCH = "${MACHINE_ARCH}"
54COMPATIBLE_MACHINE = "(ti-soc)"
55
56JH_DATADIR ?= "${datadir}/jailhouse"
57JH_EXEC_DIR ?= "${libexecdir}/jailhouse"
58CELL_DIR ?= "${JH_DATADIR}/cells"
59CELLCONF_DIR ?= "${JH_DATADIR}/configs"
60INMATES_DIR ?= "${JH_DATADIR}/inmates"
61
62JH_SYSCONFIG_CELL ?= ""
63JH_SYSCONFIG_CELL:am62xx ?= "k3-am625-sk.cell"
64JH_SYSCONFIG_CELL:am65xx ?= "k3-am654-idk.cell"
65JH_SYSCONFIG_CELL:am62pxx ?= "k3-am62p5-sk.cell"
66JH_SYSCONFIG_CELL:j7 ?= "k3-j721e-evm.cell"
67JH_SYSCONFIG_CELL:j7200-evm ?= "k3-j7200-evm.cell"
68
69do_configure() {
70 if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ];
71 then
72 cp ${STAGING_DIR_HOST}/${CELLCONF_DIR}/*.c ${S}/configs/
73 fi
74}
75
76USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
77 -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
78 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
79 -I../driver'
80
81TOOLS_SRC_DIR = "${S}/tools"
82
83EXTRA_OEMAKE = "ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} CC="${CC}" KDIR=${STAGING_KERNEL_BUILDDIR}"
84
85do_compile() {
86 oe_runmake V=1
87}