All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Create meta-arm-autonomy Layer
@ 2020-03-27 10:50 Bertrand Marquis
  2020-03-27 10:50 ` [PATCH 1/7] arm-autonomy: Create meta-arm-autonomy layer Bertrand Marquis
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Bertrand Marquis @ 2020-03-27 10:50 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

This patch serie is introducing meta-arm-autonomy layer.
This layer can be used to create Xen based virtualized system suitable
for embedded systems.
It is providing a BSP arm64-autonomy-guest and 2 DISTRO_FEATURES
"arm-autonomy-host" and "arm-autonomy-guest".

Bertrand Marquis (7):
  arm-autonomy: Create meta-arm-autonomy layer
  arm-autonomy: Create arm-autonomy-host feature
  arm-autonomy: Create arm-autonomy-host image
  arm-autonomy: Create arm-autonomy-guest feature
  arm-autonomy: Create arm64-autonomy-guest machine
  arm-autonomy: Create quick start documentation
  arm-autonomy: Create xen-devicetree recipe

 README.md                                     |   3 +
 meta-arm-autonomy/README.md                   |  79 ++++++++++++
 .../classes/arm-autonomy-features.bbclass     |   5 +
 .../distro/include/arm-autonomy-guest.inc     |   5 +
 .../conf/distro/include/arm-autonomy-host.inc |   5 +
 meta-arm-autonomy/conf/layer.conf             |  31 +++++
 .../conf/machine/arm64-autonomy-guest.conf    |  17 +++
 .../documentation/arm-autonomy-quickstart.md  | 116 ++++++++++++++++++
 .../documentation/xen-devicetree.md           | 104 ++++++++++++++++
 .../images/arm-autonomy-host-image-minimal.bb |  30 +++++
 .../sysvinit/sysvinit-inittab_2.%.bbappend    |  16 +++
 .../xen-devicetree/files/xen-juno.dtsi        |  11 ++
 .../xen-devicetree/files/xen.dtsi.in          |  17 +++
 .../xen-devicetree/xen-devicetree.bb          |  68 ++++++++++
 .../xen-devicetree/xen-devicetree.bbappend    |  18 +++
 .../arm64-autonomy-guest-standard.scc         |   5 +
 .../bsp/arm-autonomy/arm64-autonomy-guest.cfg |   2 +
 .../bsp/arm-autonomy/arm64-autonomy-guest.scc |   6 +
 .../features/arm-autonomy/xen-guest.cfg       |  54 ++++++++
 .../features/arm-autonomy/xen-guest.scc       |   4 +
 .../features/arm-autonomy/xen-host.cfg        |  35 ++++++
 .../features/arm-autonomy/xen-host.scc        |   4 +
 .../recipes-kernel/linux/linux-%.bbappend     |   3 +
 .../linux/linux-arm-autonomy.inc              |  21 ++++
 24 files changed, 659 insertions(+)
 create mode 100644 meta-arm-autonomy/README.md
 create mode 100644 meta-arm-autonomy/classes/arm-autonomy-features.bbclass
 create mode 100644 meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc
 create mode 100644 meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc
 create mode 100644 meta-arm-autonomy/conf/layer.conf
 create mode 100644 meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf
 create mode 100644 meta-arm-autonomy/documentation/arm-autonomy-quickstart.md
 create mode 100644 meta-arm-autonomy/documentation/xen-devicetree.md
 create mode 100644 meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb
 create mode 100644 meta-arm-autonomy/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend
 create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen-juno.dtsi
 create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen.dtsi.in
 create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bb
 create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bbappend
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest-standard.scc
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.cfg
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.scc
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.cfg
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.scc
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.scc
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc

-- 
2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/7] arm-autonomy: Create meta-arm-autonomy layer
  2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
@ 2020-03-27 10:50 ` Bertrand Marquis
  2020-03-27 15:20   ` [meta-arm] " Diego Sueiro
  2020-03-27 10:50 ` [PATCH 2/7] arm-autonomy: Create arm-autonomy-host feature Bertrand Marquis
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Bertrand Marquis @ 2020-03-27 10:50 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

Create a meta-arm-autonomy layer in meta-arm.
Add layer configuration file and Readme.

Change-Id: Idf3411edc21f3d13fdc7146fcf34700d2aab1c41
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 README.md                         |  3 ++
 meta-arm-autonomy/README.md       | 51 +++++++++++++++++++++++++++++++
 meta-arm-autonomy/conf/layer.conf | 25 +++++++++++++++
 3 files changed, 79 insertions(+)
 create mode 100644 meta-arm-autonomy/README.md
 create mode 100644 meta-arm-autonomy/conf/layer.conf

diff --git a/README.md b/README.md
index 20b106a..04c641d 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,9 @@ meta-arm-iota:
 meta-arm-toolchain:
 	This layer provides support for Arm's GNU-A toolset releases
 
+meta-arm-autonomy:
+    This layer provides a reference stack for autonomous systems.
+
 Contributing
 ------------
 Currently, we only accept patches from the meta-arm mailing list.  For general
diff --git a/meta-arm-autonomy/README.md b/meta-arm-autonomy/README.md
new file mode 100644
index 0000000..f8a1404
--- /dev/null
+++ b/meta-arm-autonomy/README.md
@@ -0,0 +1,51 @@
+meta-arm-autonomy Yocto Layer
+=============================
+
+Introduction
+------------
+This layer provides an hypervisor based solution (currently based on Xen) for
+autonomous system. It contains recipes and classes to build host and guests
+systems.
+
+Dependencies
+------------
+This layer depends on several other Yocto layers:
+* meta-openembedded (https://git.openembedded.org/meta-openembedded)
+* poky (https://git.yoctoproject.org/poky)
+* meta-virtualization (https://git.yoctoproject.org/meta-virtualization)
+
+Distribution Features
+---------------------
+This layer is adding the following Yocto DISTRO_FEATURES:
+
+Bitbake variables
+-----------------
+Some recipes and classes in this layer are introducing variables which can be
+modified by the user in local.conf.
+Each recipe introducing such variables has a chapter "Bitbake parameters" in
+its documentation.
+
+Those documentation files should be checked for variables:
+
+BSPs
+----
+This layer is adding the following machines:
+
+Images
+------
+This layer is adding the following images:
+
+Recipes and classes
+-------------------
+This layer is adding the following recipes and classes:
+
+Contributing
+------------
+This project has not put in place a process for contributions currently. If you
+would like to contribute, please contact the maintainers
+
+
+Maintainer(s)
+-------------
+* Bertrand Marquis <bertrand.marquis@arm.com>
+* Filipe Rinaldi <filipe.rinaldi@arm.com>
diff --git a/meta-arm-autonomy/conf/layer.conf b/meta-arm-autonomy/conf/layer.conf
new file mode 100644
index 0000000..2dc24a2
--- /dev/null
+++ b/meta-arm-autonomy/conf/layer.conf
@@ -0,0 +1,25 @@
+# Add layer to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# Add recipes-* directories to BBFILES
+BBFILES += " \
+    ${LAYERDIR}/recipes-*/*/*.bb \
+    ${LAYERDIR}/recipes-*/*/*.bbappend \
+    "
+
+BBFILE_COLLECTIONS += "meta-arm-autonomy"
+BBFILE_PATTERN_meta-arm-autonomy = "^${LAYERDIR}/"
+BBFILE_PRIORITY_meta-arm-autonomy = "6"
+LAYERDEPENDS_meta-arm-autonomy = " \
+   core \
+   yocto \
+   openembedded-layer \
+   virtualization-layer \
+"
+LAYERSERIES_COMPAT_meta-arm-autonomy = "zeus"
+
+# We don't activate virtualization feature from meta-virtualization as it
+# brings in lots of stuff we don't need. We need to disable the sanity check
+# otherwise the user will see a warning on each build.
+SKIP_META_VIRT_SANITY_CHECK = "1"
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/7] arm-autonomy: Create arm-autonomy-host feature
  2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
  2020-03-27 10:50 ` [PATCH 1/7] arm-autonomy: Create meta-arm-autonomy layer Bertrand Marquis
@ 2020-03-27 10:50 ` Bertrand Marquis
  2020-03-27 15:21   ` [meta-arm] " Diego Sueiro
  2020-03-27 10:50 ` [PATCH 3/7] arm-autonomy: Create arm-autonomy-host image Bertrand Marquis
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Bertrand Marquis @ 2020-03-27 10:50 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

Create a new distribution feature to enable functionalities for autonomy
host systems:
- enable xen and ipv4 in distribution features
- enable xen backend drivers in Linux kernel using a kmeta feature

For the feature to work properly, create a class inherited when the
layer is included to enable required parameters

Change-Id: Ia0cdaa2b69bc030515ea16d67c47fec6b1ea0897
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 meta-arm-autonomy/README.md                   |  5 +++
 .../classes/arm-autonomy-features.bbclass     |  4 +++
 .../conf/distro/include/arm-autonomy-host.inc |  5 +++
 meta-arm-autonomy/conf/layer.conf             |  6 ++++
 .../features/arm-autonomy/xen-host.cfg        | 35 +++++++++++++++++++
 .../features/arm-autonomy/xen-host.scc        |  4 +++
 .../recipes-kernel/linux/linux-%.bbappend     |  3 ++
 .../linux/linux-arm-autonomy.inc              | 13 +++++++
 8 files changed, 75 insertions(+)
 create mode 100644 meta-arm-autonomy/classes/arm-autonomy-features.bbclass
 create mode 100644 meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.scc
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc

diff --git a/meta-arm-autonomy/README.md b/meta-arm-autonomy/README.md
index f8a1404..1f80a05 100644
--- a/meta-arm-autonomy/README.md
+++ b/meta-arm-autonomy/README.md
@@ -18,6 +18,11 @@ Distribution Features
 ---------------------
 This layer is adding the following Yocto DISTRO_FEATURES:
 
+* arm-autonomy-host: this feature activates functionalities required to build
+  an autonomy host system. It is doing the following:
+  - add 'xen' and 'ipv4' to DISTRO_FEATURES.
+  - add xen backend drivers to linux kernel configuration.
+
 Bitbake variables
 -----------------
 Some recipes and classes in this layer are introducing variables which can be
diff --git a/meta-arm-autonomy/classes/arm-autonomy-features.bbclass b/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
new file mode 100644
index 0000000..38441e4
--- /dev/null
+++ b/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
@@ -0,0 +1,4 @@
+# Include arm-autonomy distro config files if the distro features are set
+
+require ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', '${ARM_AUTONOMY_DISTRO_CFGDIR}/arm-autonomy-host.inc', '', d)}
+
diff --git a/meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc b/meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc
new file mode 100644
index 0000000..236fbe9
--- /dev/null
+++ b/meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc
@@ -0,0 +1,5 @@
+# This files is added when DISTRO_FEATURES contains arm-autonomy-host
+
+# We need to have xen and ipv4 activated
+DISTRO_FEATURES_append = " xen ipv4"
+
diff --git a/meta-arm-autonomy/conf/layer.conf b/meta-arm-autonomy/conf/layer.conf
index 2dc24a2..19f24ad 100644
--- a/meta-arm-autonomy/conf/layer.conf
+++ b/meta-arm-autonomy/conf/layer.conf
@@ -23,3 +23,9 @@ LAYERSERIES_COMPAT_meta-arm-autonomy = "zeus"
 # otherwise the user will see a warning on each build.
 SKIP_META_VIRT_SANITY_CHECK = "1"
 
+# Directory of our distro config files
+ARM_AUTONOMY_DISTRO_CFGDIR = "${LAYERDIR}/conf/distro/include/"
+
+# Add class to handle arm-autonomy distro extensions
+USER_CLASSES_append = " arm-autonomy-features"
+
diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg
new file mode 100644
index 0000000..2affab9
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg
@@ -0,0 +1,35 @@
+CONFIG_PARAVIRT=y
+CONFIG_XEN=y
+
+CONFIG_BLOCK=y
+CONFIG_XEN_BLKDEV_BACKEND=y
+
+CONFIG_SCSI=y
+CONFIG_TARGET_CORE=y
+CONFIG_XEN_SCSI_BACKEND=y
+
+CONFIG_NET=y
+CONFIG_XEN_NETDEV_BACKEND=y
+
+CONFIG_HVC_IRQ=y
+
+CONFIG_HVC_XEN=y
+
+CONFIG_WATCHDOG=y
+CONFIG_XEN_WDT=y
+
+CONFIG_XEN_BALLOON=y
+
+CONFIG_XEN_DEV_EVTCHN=y
+
+CONFIG_XENFS=y
+CONFIG_XEN_COMPAT_XENFS=y
+
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GRANT_DEV_ALLOC=y
+CONFIG_SWIOTLB_XEN=y
+
+CONFIG_XEN_EFI=y
+CONFIG_XEN_AUTO_XLATE=y
+
diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.scc b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.scc
new file mode 100644
index 0000000..6fdbabc
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.scc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable XEN Host Drivers on autonomy systems"
+
+kconf non-hardware xen-host.cfg
+
diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend b/meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend
new file mode 100644
index 0000000..add7042
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend
@@ -0,0 +1,3 @@
+# Add arm-autonomy kernel support
+require linux-arm-autonomy.inc
+
diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
new file mode 100644
index 0000000..0332387
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
@@ -0,0 +1,13 @@
+# Add arm-autonomy specific features to the kernel
+
+FILESEXTRAPATHS_prepend := "${THISDIR}:"
+
+#
+# arm-autonomy kmeta
+#
+SRC_URI_append = " file://arm-autonomy-kmeta;type=kmeta;name=arm-autonomy-kmeta;destsuffix=arm-autonomy-kmeta"
+
+# Add xen host drivers to kernel if arm-autonomy-host is activated
+KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
+        'arm-autonomy-host', 'features/arm-autonomy/xen-host.scc', '', d)}"
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/7] arm-autonomy: Create arm-autonomy-host image
  2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
  2020-03-27 10:50 ` [PATCH 1/7] arm-autonomy: Create meta-arm-autonomy layer Bertrand Marquis
  2020-03-27 10:50 ` [PATCH 2/7] arm-autonomy: Create arm-autonomy-host feature Bertrand Marquis
@ 2020-03-27 10:50 ` Bertrand Marquis
  2020-03-27 15:21   ` [meta-arm] " Diego Sueiro
  2020-03-27 10:50 ` [PATCH 4/7] arm-autonomy: Create arm-autonomy-guest feature Bertrand Marquis
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Bertrand Marquis @ 2020-03-27 10:50 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

Create minimal image suitable for an arm-autonomy-host containing:
- the boot packagegroup
- the ssh server packagegroup
- xen base tools
- qemu (required to start xen guests)

Change-Id: If864fc6b768cbe4ca19bfe24753c008146b7550c
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 meta-arm-autonomy/README.md                   |  5 ++++
 .../images/arm-autonomy-host-image-minimal.bb | 27 +++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb

diff --git a/meta-arm-autonomy/README.md b/meta-arm-autonomy/README.md
index 1f80a05..d0c6181 100644
--- a/meta-arm-autonomy/README.md
+++ b/meta-arm-autonomy/README.md
@@ -40,6 +40,11 @@ Images
 ------
 This layer is adding the following images:
 
+* arm-autonomy-host-image-minimal: this image includes all elements required
+  to create a minimal arm-autonomy-host system. This includes xen and tools to
+  manage xen guests. This image depends on 'arm-autonomy-host' distribution
+  feature.
+
 Recipes and classes
 -------------------
 This layer is adding the following recipes and classes:
diff --git a/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb b/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb
new file mode 100644
index 0000000..fb0a0b7
--- /dev/null
+++ b/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb
@@ -0,0 +1,27 @@
+# Recipe to create a minimal Arm Autonomy stack host image
+
+DESCRIPTION = "Arm Autonomy stack host minimal image"
+
+inherit core-image
+
+LICENSE = "MIT"
+
+# Includes minimal set required to start and manage guest. The xen specific
+# modules are not explicitly included as they are built as part of the kernel
+# image for performance reasons. Includes all kernel modules anyway as it makes
+# life easier and does not cost that much in size.
+IMAGE_INSTALL += " \
+    packagegroup-core-boot \
+    packagegroup-core-ssh-openssh \
+    kernel-modules \
+    xen-base \
+    qemu \
+    "
+
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True, d):
+        raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'arm-autonomy-host'")
+
+    if bb.utils.contains('DISTRO_FEATURES', 'xen', False, True, d):
+        raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'xen'")
+}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/7] arm-autonomy: Create arm-autonomy-guest feature
  2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
                   ` (2 preceding siblings ...)
  2020-03-27 10:50 ` [PATCH 3/7] arm-autonomy: Create arm-autonomy-host image Bertrand Marquis
@ 2020-03-27 10:50 ` Bertrand Marquis
  2020-03-27 15:22   ` [meta-arm] " Diego Sueiro
  2020-03-27 10:50 ` [PATCH 5/7] arm-autonomy: Create arm64-autonomy-guest machine Bertrand Marquis
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Bertrand Marquis @ 2020-03-27 10:50 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

Introduce DISTRO_FEATURE arm-autonomy-guest which is:
- enabling ipv4 in distro features
- enabling xen frontend driver in the linux kernel using a kernel
feature
- enabling console over hvc0

Change-Id: Idd9a708799b35e483dbba22279ce677d9674ef09
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 meta-arm-autonomy/README.md                   |  6 +++
 .../classes/arm-autonomy-features.bbclass     |  1 +
 .../distro/include/arm-autonomy-guest.inc     |  5 ++
 .../sysvinit/sysvinit-inittab_2.%.bbappend    | 16 ++++++
 .../features/arm-autonomy/xen-guest.cfg       | 54 +++++++++++++++++++
 .../features/arm-autonomy/xen-guest.scc       |  4 ++
 .../linux/linux-arm-autonomy.inc              |  3 ++
 7 files changed, 89 insertions(+)
 create mode 100644 meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc
 create mode 100644 meta-arm-autonomy/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.cfg
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.scc

diff --git a/meta-arm-autonomy/README.md b/meta-arm-autonomy/README.md
index d0c6181..e5ad6ed 100644
--- a/meta-arm-autonomy/README.md
+++ b/meta-arm-autonomy/README.md
@@ -23,6 +23,12 @@ This layer is adding the following Yocto DISTRO_FEATURES:
   - add 'xen' and 'ipv4' to DISTRO_FEATURES.
   - add xen backend drivers to linux kernel configuration.
 
+* arm-autonomy-guest: this feature activates functionalities to run as guest
+  of an autonomy system. It is doing the following:
+  - add 'ipv4' to DISTRO_FEATURES.
+  - add xen frontend drivers to linux kernel configuration.
+  - add console on hvc0 during init.
+
 Bitbake variables
 -----------------
 Some recipes and classes in this layer are introducing variables which can be
diff --git a/meta-arm-autonomy/classes/arm-autonomy-features.bbclass b/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
index 38441e4..15549d8 100644
--- a/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
+++ b/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
@@ -1,4 +1,5 @@
 # Include arm-autonomy distro config files if the distro features are set
 
 require ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', '${ARM_AUTONOMY_DISTRO_CFGDIR}/arm-autonomy-host.inc', '', d)}
+require ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-guest', '${ARM_AUTONOMY_DISTRO_CFGDIR}/arm-autonomy-guest.inc', '', d)}
 
diff --git a/meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc b/meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc
new file mode 100644
index 0000000..d961b40
--- /dev/null
+++ b/meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc
@@ -0,0 +1,5 @@
+# This files is added when DISTRO_FEATURES contains arm-autonomy-guest
+
+# We need to have ipv4 activated
+DISTRO_FEATURES_append = " ipv4"
+
diff --git a/meta-arm-autonomy/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend b/meta-arm-autonomy/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend
new file mode 100644
index 0000000..7b0c647
--- /dev/null
+++ b/meta-arm-autonomy/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend
@@ -0,0 +1,16 @@
+# if arm-autonomy-guest is activated, we are running as a xen guest so we must
+# have a console on hvc0
+# This is normally done in meta-virtualization if xen is activated but here
+# we don't have xen activated.
+#
+
+SYSVINIT_ADDHVC0 = "${@bb.utils.contains('DISTRO_FEATURES', \
+    'arm-autonomy-guest', 'true', 'false', d)}"
+
+do_install_append() {
+    if ${SYSVINIT_ADDHVC0}; then
+        echo "" >> ${D}${sysconfdir}/inittab
+        echo "X0:12345:respawn:/sbin/getty 115200 hvc0" >> \
+            ${D}${sysconfdir}/inittab
+    fi
+}
diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.cfg b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.cfg
new file mode 100644
index 0000000..e4e44a9
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.cfg
@@ -0,0 +1,54 @@
+CONFIG_PARAVIRT=y
+CONFIG_XEN=y
+
+CONFIG_BLOCK=y
+CONFIG_XEN_BLKDEV_FRONTEND=y
+
+CONFIG_SCSI=y
+CONFIG_XEN_SCSI_FRONTEND=y
+
+CONFIG_NET=y
+CONFIG_XEN_NETDEV_FRONTEND=y
+
+CONFIG_INPUT=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
+
+CONFIG_HVC_IRQ=y
+
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
+
+CONFIG_WATCHDOG=y
+CONFIG_XEN_WDT=y
+
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_IMAGEBLIT=y
+CONFIG_FB_SYS_FOPS=y
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+
+CONFIG_XEN_BALLOON=y
+
+CONFIG_XEN_DEV_EVTCHN=y
+
+CONFIG_XENFS=y
+CONFIG_XEN_COMPAT_XENFS=y
+
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GRANT_DEV_ALLOC=y
+CONFIG_SWIOTLB_XEN=y
+
+CONFIG_XEN_EFI=y
+CONFIG_XEN_AUTO_XLATE=y
+
+CONFIG_DRM=y
+CONFIG_DRM_XEN=y
+CONFIG_DRM_XEN_FRONTEND=y
+
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_XEN_FRONTEND=y
diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.scc b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.scc
new file mode 100644
index 0000000..935e78f
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.scc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable XEN Guest Frontend Drivers"
+
+kconf non-hardware xen-guest.cfg
+
diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
index 0332387..b2245a5 100644
--- a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
+++ b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
@@ -11,3 +11,6 @@ SRC_URI_append = " file://arm-autonomy-kmeta;type=kmeta;name=arm-autonomy-kmeta;
 KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
         'arm-autonomy-host', 'features/arm-autonomy/xen-host.scc', '', d)}"
 
+# Add xen guest drivers to kernel if arm-autonomy-guest is activated
+KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
+        'arm-autonomy-guest', 'features/arm-autonomy/xen-guest.scc', '', d)}"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/7] arm-autonomy: Create arm64-autonomy-guest machine
  2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
                   ` (3 preceding siblings ...)
  2020-03-27 10:50 ` [PATCH 4/7] arm-autonomy: Create arm-autonomy-guest feature Bertrand Marquis
@ 2020-03-27 10:50 ` Bertrand Marquis
  2020-03-27 15:22   ` [meta-arm] " Diego Sueiro
  2020-03-27 10:50 ` [PATCH 6/7] arm-autonomy: Create quick start documentation Bertrand Marquis
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Bertrand Marquis @ 2020-03-27 10:50 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

Create a minimalistic BSP to be used as an arm-autonomy-guest on ARM64.
The BSP is enabling ARM64 and SMP in the kernel configuration and is
enabling the arm-autonomy-guest in DISTRO_FEATURES.
Rework README.md file.

Change-Id: I7ef0176a3426748c4b66cdec5801aa34229187ba
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 meta-arm-autonomy/README.md                     |  5 +++++
 .../conf/machine/arm64-autonomy-guest.conf      | 17 +++++++++++++++++
 .../arm64-autonomy-guest-standard.scc           |  5 +++++
 .../bsp/arm-autonomy/arm64-autonomy-guest.cfg   |  2 ++
 .../bsp/arm-autonomy/arm64-autonomy-guest.scc   |  6 ++++++
 .../recipes-kernel/linux/linux-arm-autonomy.inc |  5 +++++
 6 files changed, 40 insertions(+)
 create mode 100644 meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest-standard.scc
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.cfg
 create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.scc

diff --git a/meta-arm-autonomy/README.md b/meta-arm-autonomy/README.md
index e5ad6ed..ed9d6c9 100644
--- a/meta-arm-autonomy/README.md
+++ b/meta-arm-autonomy/README.md
@@ -42,6 +42,11 @@ BSPs
 ----
 This layer is adding the following machines:
 
+* arm64-autonomy-guest: this machines creates a minimal BSP suitable to be used
+  as an autonomy guest. It is in fact only activating ARM64 architecture and
+  SMP in the linux kernel and is enabling the DISTRO_FEATURE
+  arm-autonomy-guest.
+
 Images
 ------
 This layer is adding the following images:
diff --git a/meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf b/meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf
new file mode 100644
index 0000000..cb72c60
--- /dev/null
+++ b/meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf
@@ -0,0 +1,17 @@
+#@TYPE: Machine
+#@NAME: Autonomy Guest ARM64 machine
+#@DESCRIPTION: Machine configuration for ARM64 Autonomy Guest
+
+TUNE_FEATURES = "aarch64"
+
+require conf/machine/include/arm/arch-armv8a.inc
+
+KERNEL_IMAGETYPE = "Image"
+
+IMAGE_FSTYPES += "tar.bz2"
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
+PREFERRED_VERSION_linux-yocto ?= "4.19%"
+
+DISTRO_FEATURES += "arm-autonomy-guest"
+
diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest-standard.scc b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest-standard.scc
new file mode 100644
index 0000000..7c75d99
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest-standard.scc
@@ -0,0 +1,5 @@
+define KMACHINE arm64-autonomy-guest
+define KTYPE standard
+define KARCH arm64
+
+include arm64-autonomy-guest.scc
diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.cfg b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.cfg
new file mode 100644
index 0000000..fcdad98
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.cfg
@@ -0,0 +1,2 @@
+CONFIG_ARM64=y
+CONFIG_SMP=y
diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.scc b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.scc
new file mode 100644
index 0000000..e887b4e
--- /dev/null
+++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.scc
@@ -0,0 +1,6 @@
+include ktypes/standard/standard.scc
+include features/input/input.scc
+include features/net/net.scc
+include cfg/timer/no_hz.scc
+
+kconf hardware arm64-autonomy-guest.cfg
diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
index b2245a5..8191079 100644
--- a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
+++ b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
@@ -14,3 +14,8 @@ KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
 # Add xen guest drivers to kernel if arm-autonomy-guest is activated
 KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
         'arm-autonomy-guest', 'features/arm-autonomy/xen-guest.scc', '', d)}"
+
+# Add support for arm64-autonomy-guest machine
+COMPATIBLE_MACHINE_arm64-autonomy-guest = "arm64-autonomy-guest"
+KMACHINE_arm64-autonomy-guest = "arm64-autonomy-guest"
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 6/7] arm-autonomy: Create quick start documentation
  2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
                   ` (4 preceding siblings ...)
  2020-03-27 10:50 ` [PATCH 5/7] arm-autonomy: Create arm64-autonomy-guest machine Bertrand Marquis
@ 2020-03-27 10:50 ` Bertrand Marquis
  2020-03-27 15:23   ` [meta-arm] " Diego Sueiro
  2020-03-27 10:50 ` [PATCH 7/7] arm-autonomy: Create xen-devicetree recipe Bertrand Marquis
  2020-04-08  3:34 ` [meta-arm] [PATCH 0/7] Create meta-arm-autonomy Layer Jon Mason
  7 siblings, 1 reply; 16+ messages in thread
From: Bertrand Marquis @ 2020-03-27 10:50 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

Add a quick start documentation to help user to start using the layer.

Change-Id: I3aea950d2dfdcae41bbdb8f3df4f29196048338b
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 meta-arm-autonomy/README.md                   |   3 +
 .../documentation/arm-autonomy-quickstart.md  | 116 ++++++++++++++++++
 2 files changed, 119 insertions(+)
 create mode 100644 meta-arm-autonomy/documentation/arm-autonomy-quickstart.md

diff --git a/meta-arm-autonomy/README.md b/meta-arm-autonomy/README.md
index ed9d6c9..9b12993 100644
--- a/meta-arm-autonomy/README.md
+++ b/meta-arm-autonomy/README.md
@@ -7,6 +7,9 @@ This layer provides an hypervisor based solution (currently based on Xen) for
 autonomous system. It contains recipes and classes to build host and guests
 systems.
 
+To start using this layer, please check the
+[Quick Start Guide](documentation/arm-autonomy-quickstart.md).
+
 Dependencies
 ------------
 This layer depends on several other Yocto layers:
diff --git a/meta-arm-autonomy/documentation/arm-autonomy-quickstart.md b/meta-arm-autonomy/documentation/arm-autonomy-quickstart.md
new file mode 100644
index 0000000..2b92996
--- /dev/null
+++ b/meta-arm-autonomy/documentation/arm-autonomy-quickstart.md
@@ -0,0 +1,116 @@
+arm-autonomy Quick Start
+==================
+
+This documentation is explaining how to quickly start with arm-autonomy layer
+and the main features provided.
+You will find in the documentation directory some more detailed documentation
+for each of the functionalites provided by this layer.
+
+What to use this layer for?
+---------------------------
+Using this layer, you can easily and rapidly create a system based on Xen with
+one or more guests created using Yocto.
+
+For this you will need to create at least 2 Yocto projects:
+- a host project: This one will compile Xen and create a Linux system to be
+  used as Xen Dom0. The Linux system will contain all functionalities required
+  to start and manage guests.
+- one or several guest projects: Those will create Linux systems with the
+  required Linux kernel configuration to run as Xen DomU.
+
+Prepare your system
+-------------------
+
+First you must download the Yocto layers needed:
+ - [meta-openembedded](https://git.openembedded.org/meta-openembedded)
+ - [poky](https://git.yoctoproject.org/poky)
+ - [meta-virtualization](https://git.yoctoproject.org/meta-virtualization)
+ - [meta-arm](https://git.yoctoproject.org/meta-arm)
+ - all other layers you might want to use
+
+For each of the downloaded layer make sure you checkout the release of Yocto
+you want to use (for example zeus using `git checkout zeus`).
+
+Please follow [Yocto documentation](https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html)
+in order to have the required dependencies.
+
+
+Create a project
+----------------
+
+Here are the main steps to create an arm-autonomy project:
+
+1. create a new Yocto project using `oe-init-build-env` in a new directory:
+  ```
+  oe-init-build-env my-project
+  ```
+
+2. edit the file `conf/bblayers.conf` and add `meta-arm/meta-arm-autonomy`
+  layer to the list of layers of your project. Also add any other layers you
+  might need (for example `meta-arm/meta-arm-bsp` and `meta-arm/meta-arm` to
+  use Arm boards like Juno or FVP emulator).
+  For example:
+  ```
+  BBLAYERS ?= " \
+    /home/user/arm-autonomy/poky/meta \
+    /home/user/arm-autonomy/poky/meta-poky \
+    /home/user/arm-autonomy/poky/meta-yocto-bsp \
+    /home/user/arm-autonomy/meta-openembedded/meta-oe \
+    /home/user/arm-autonomy/meta-openembedded/meta-python \
+    /home/user/arm-autonomy/meta-openembedded/meta-filesystems \
+    /home/user/arm-autonomy/meta-openembedded/meta-networking \
+    /home/user/arm-autonomy/meta-arm/meta-arm \
+    /home/user/arm-autonomy/meta-arm/meta-arm-bsp \
+    /home/user/arm-autonomy/meta-virtualization \
+    /home/user/arm-autonomy/meta-arm/meta-arm-autonomy \
+    "
+  ```
+
+Those steps will have to be done for each project you will have to create.
+
+Host project
+------------
+The host project will build Xen and the Dom0 Linux. It will be the only project
+that will be specific to the board (MACHINE) you will be running on.
+
+To create a host project:
+1. Follow the steps of "Create a project"
+
+2. Add the layers in `bblayers.conf` required to build a Yocto project for the
+   board you want to use.
+   For example to use Arm FVP Base emulator, add `meta-arm/meta-arm` and
+   `meta-arm/meta-arm-bsp`.
+
+3. edit conf/local.conf to add `arm-autonomy-host` to the DISTRO_FEATURES and
+   set MACHINE to the board you want to use.
+   For example, add the following lines:
+  ```
+  MACHINE = "fvp-base"
+  DISTRO_FEATURES += "arm-autonomy-host"
+  ```
+
+4. build the image using `bitbake arm-autonomy-host-image-minimal`
+
+Guest project
+-------------
+The guest projects are not target specific and will use a Yocto MACHINE defined
+in meta-arm-autonomy to include only the Linux configuration required to run
+a xen guest.
+
+To create a guest project:
+
+1. Follow the steps of "Create a project"
+
+2. Optionaly add layers required to build the image and features you need.
+
+3. edit conf/local.conf to add `arm-autonomy-guest` to the DISTRO_FEATURES and
+   set MACHINE to `arm64-autonomy-guest`:
+  ```
+  MACHINE = "arm64-autonomy-guest"
+  DISTRO_FEATURES += "arm-autonomy-guest"
+  ```
+
+4. build the image you want.
+   For example `bitbake core-image-minimal`
+
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 7/7] arm-autonomy: Create xen-devicetree recipe
  2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
                   ` (5 preceding siblings ...)
  2020-03-27 10:50 ` [PATCH 6/7] arm-autonomy: Create quick start documentation Bertrand Marquis
@ 2020-03-27 10:50 ` Bertrand Marquis
  2020-03-27 15:24   ` [meta-arm] " Diego Sueiro
  2020-04-08  3:34 ` [meta-arm] [PATCH 0/7] Create meta-arm-autonomy Layer Jon Mason
  7 siblings, 1 reply; 16+ messages in thread
From: Bertrand Marquis @ 2020-03-27 10:50 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

Create a xen-devicetree recipe to add entries required to boot Xen and a
Dom0 inside a DTB.
The recipe is introducing XEN_DEVICETREE_* parameters to define the xen
command line, the dom0 command line, the dom0 memory size, the dom0
kernel load address and size.
The recipe can also be extended using bbappend to adapt the device tree
and the parameters.
Adaptation are provided to support Juno, fvp-base and foundation-armv8
boards from meta-arm-bsp.
Add xen-devicetree as EXTRA_IMAGEDEPENDS to
arm-autonomy-host-image-minimal

Change-Id: Ibcfbd02c2377a9abcbd20caa47ea833b5308fbac
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 meta-arm-autonomy/README.md                   |   4 +
 .../documentation/xen-devicetree.md           | 104 ++++++++++++++++++
 .../images/arm-autonomy-host-image-minimal.bb |   3 +
 .../xen-devicetree/files/xen-juno.dtsi        |  11 ++
 .../xen-devicetree/files/xen.dtsi.in          |  17 +++
 .../xen-devicetree/xen-devicetree.bb          |  68 ++++++++++++
 .../xen-devicetree/xen-devicetree.bbappend    |  18 +++
 7 files changed, 225 insertions(+)
 create mode 100644 meta-arm-autonomy/documentation/xen-devicetree.md
 create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen-juno.dtsi
 create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen.dtsi.in
 create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bb
 create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bbappend

diff --git a/meta-arm-autonomy/README.md b/meta-arm-autonomy/README.md
index 9b12993..78a7281 100644
--- a/meta-arm-autonomy/README.md
+++ b/meta-arm-autonomy/README.md
@@ -40,6 +40,7 @@ Each recipe introducing such variables has a chapter "Bitbake parameters" in
 its documentation.
 
 Those documentation files should be checked for variables:
+- [xen-devicetree](documentation/xen-devicetree.md)
 
 BSPs
 ----
@@ -63,6 +64,9 @@ Recipes and classes
 -------------------
 This layer is adding the following recipes and classes:
 
+* [xen-devicetree](documentation/xen-devicetree.md): this is a recipe to modify
+  a device tree blob to add information required to boot xen and a Dom0 linux.
+
 Contributing
 ------------
 This project has not put in place a process for contributions currently. If you
diff --git a/meta-arm-autonomy/documentation/xen-devicetree.md b/meta-arm-autonomy/documentation/xen-devicetree.md
new file mode 100644
index 0000000..a44dca7
--- /dev/null
+++ b/meta-arm-autonomy/documentation/xen-devicetree.md
@@ -0,0 +1,104 @@
+Xen device tree
+===============
+
+Introduction
+------------
+
+xen-devicetree recipe can be used to modify an existing Device Tree Blob,
+produced by Linux kernel or another recipe, to include in it entries required
+to start Xen and a Dom0 Linux on top of it.
+
+The recipe will do the following processing:
+- generate a xen.dtsi file with entries required for xen based on parameters
+- turn DTBs in ${XEN_DEVICETREE_DTBS} back to dts
+- include in xen.dtsi and all other dtsi from
+  ${XEN_DEVICETREE_DTSI_MERGE} (check Bitbake parameters for more information
+  on this).
+- use dtc to create a new DTB file
+
+The recipe will generate new files in deploy/images and name them with the
+extension "-xen.dtb".
+For example **machine.dtb** will generate **machine-xen.dtb**.
+
+Entries added to the DTBs
+-------------------------
+
+When a DTB is processed by the recipe, the following block is added:
+```
+    chosen {
+        xen,dom0-bootargs = "VAL";
+        xen,xen-bootargs = "VAL";
+
+        modules {
+            #size-cells = <0x00000001>;
+            #address-cells = <0x00000001>;
+
+            module@0 {
+                reg = <VAL VAL>;
+                compatible = "multiboot,module";
+            };
+        };
+    };
+```
+Each occurence of **VAL** is replaced by the content of the variables listed in
+this documentation.
+
+Bitbake parameters
+------------------
+
+Several parameters are available to configure the xen-devicetree during Yocto
+project compilation (those can be set in your project local.conf, for exmple).
+
+The following parameters are available:
+
+- XEN_DEVICETREE_DEPEND: This variable can be used to indicate which recipe
+  task is generating the DTBs that xen-devicetree will modify. This makes sure
+  the xen devicetrees are properly regenerated if the source DTBs are changed.
+  This variable is set by default to "virtual/kernel:do_deploy" to use DTBs
+  generated during the compilation of the Linux kernel. This must be changed
+  if the machine your are using is not using a DTB listed in KERNEL_DEVICETREE.
+
+- XEN_DEVICETREE_DTBS: This should be set to the list of DTBs you want to be
+  modified by xen-devicetree. Those must be files that xen-devicetree can find
+  in the ${DEPLOY_DIR_IMAGE} directory using only the basename of the entries.
+  For example "mydir/board.dtb" will make the recipe look for
+  ${DEPLOY_DIR_IMAGE}/board.dtb.
+  This variable is set by default to "${KERNEL_DEVICETREE}" to process the DTBs
+  generated by the Linux kernel.
+
+- XEN_DEVICETREE_DOM0_MEM: Memory size to allocate to Dom0.
+  This variable is only used if XEN_DEVICETREE_XEN_BOOTARGS has a value
+  containing "dom0_mem=${XEN_DEVICETREE_DOM0_MEM}" as the memory assigned to
+  dom0 is defined using Xen boot arguments.
+  This variable is set by default to "1024M".
+
+- XEN_DEVICETREE_DOM0_BOOTARGS: Boot arguments to pass to Dom0 Linux when
+  booting it.
+  This variable is set by default to "console=hvc0 earlycon=xen".
+
+- XEN_DEVICETREE_XEN_BOOTARGS: this variable should be set with the boot
+  arguments to be passed to Xen on boot.
+  This variable is set by default to
+  "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}".
+
+- XEN_DEVICETREE_DOM0_ADDR: This is the address from which the Linux kernel to
+  be used for Dom0 will be copied. When using u-boot, this is the address at
+  which you will load the kernel Image before starting Xen.
+  This variable is set by default to "0x80080000".
+
+- XEN_DEVICETREE_DOM0_SIZE: This is the size of the kernel loaded at
+  ${XEN_DEVICETREE_DOM0_ADDR}. Xen will copy this amount of data inside the
+  guest before starting it so the size must be at least equal to the kernel
+  size but can be bigger. You must be careful not to have a value too big as it
+  could slow down boot or copy other parts with it (like the DTB).
+  You might need to increase this if you use a kernel with a bundled initramfs.
+  This variable is set by default to "0x01000000".
+
+- XEN_DEVICETREE_DTSI_MERGE: This variable contains the list of dtsi files that
+  must be included inside the generated DTB file. By default the only one
+  include is the "xen.dtsi" generated by the recipe.
+  If your board or project needs to include more fixes or entries in the DTB,
+  this variable can be appended from a bbappend file to include other dtsi. The
+  files must be inside the recipe workspace during Yocto compilation.
+  You can check xen-devicetree.bbappend for an example.
+
diff --git a/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb b/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb
index fb0a0b7..5e09eac 100644
--- a/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb
+++ b/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb
@@ -18,6 +18,9 @@ IMAGE_INSTALL += " \
     qemu \
     "
 
+# Build xen-devicetree to produce a xen ready devicetree
+EXTRA_IMAGEDEPENDS += "xen-devicetree"
+
 python __anonymous() {
     if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True, d):
         raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'arm-autonomy-host'")
diff --git a/meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen-juno.dtsi b/meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen-juno.dtsi
new file mode 100644
index 0000000..0f9af21
--- /dev/null
+++ b/meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen-juno.dtsi
@@ -0,0 +1,11 @@
+/*
+ * Disable IOMMU on juno board when Xen is used
+ */
+
+/ {
+
+	/* turn off iommu */
+	iommu@2b600000 {
+		status = "disabled";
+	};
+};
diff --git a/meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen.dtsi.in b/meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen.dtsi.in
new file mode 100644
index 0000000..42d12fa
--- /dev/null
+++ b/meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen.dtsi.in
@@ -0,0 +1,17 @@
+/ {
+    chosen {
+        xen,dom0-bootargs = "###XEN_DOM0_BOOTARGS###";
+        xen,xen-bootargs = "###XEN_XEN_BOOTARGS###";
+
+        modules {
+            #size-cells = <0x00000001>;
+            #address-cells = <0x00000001>;
+
+            module@0 {
+                reg = <###XEN_DOM0_ADDR### ###XEN_DOM0_SIZE###>;
+                compatible = "multiboot,module";
+            };
+        };
+    };
+};
+
diff --git a/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bb b/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bb
new file mode 100644
index 0000000..0bb9def
--- /dev/null
+++ b/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bb
@@ -0,0 +1,68 @@
+# This recipe can be used to modify one or several DTBS to add
+# entries required to declare and boot Linux as Dom0 from Xen
+
+SRC_URI = "file://xen.dtsi.in"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "\
+    file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \
+    "
+
+S = "${WORKDIR}"
+
+DESCRIPTION = "Add entries in DTB for Xen and Dom0"
+
+# Please refer to documentation/xen-devicetree.md for documentation on those
+# parameters
+XEN_DEVICETREE_DEPEND ?= "virtual/kernel:do_deploy"
+XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
+XEN_DEVICETREE_XEN_BOOTARGS ?= "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}"
+XEN_DEVICETREE_DOM0_MEM ?= "1024M"
+XEN_DEVICETREE_DOM0_BOOTARGS ?= "console=hvc0 earlycon=xen"
+XEN_DEVICETREE_DOM0_ADDR ?= "0x80080000"
+XEN_DEVICETREE_DOM0_SIZE ?= "0x01000000"
+XEN_DEVICETREE_DTSI_MERGE ?= "xen.dtsi"
+
+# Our package does not generate any package for the rootfs but contributes to
+# deploy
+inherit nopackages deploy
+
+DEPENDS += "dtc-native"
+
+do_compile() {
+    cat ${WORKDIR}/xen.dtsi.in \
+        | sed -e "s,###XEN_DOM0_BOOTARGS###,${XEN_DEVICETREE_DOM0_BOOTARGS}," \
+        | sed -e "s,###XEN_XEN_BOOTARGS###,${XEN_DEVICETREE_XEN_BOOTARGS}," \
+        | sed -e "s,###XEN_DOM0_ADDR###,${XEN_DEVICETREE_DOM0_ADDR}," \
+        | sed -e "s,###XEN_DOM0_SIZE###,${XEN_DEVICETREE_DOM0_SIZE}," \
+        > ${WORKDIR}/xen.dtsi
+
+    # Generate final dtbs
+    for dtbf in ${XEN_DEVICETREE_DTBS}; do
+        rdtb=`basename $dtbf`
+        if [ ! -f ${DEPLOY_DIR_IMAGE}/$rdtb ]; then
+            die "Wrong file in XEN_DEVICETREE_DTBS: ${DEPLOY_DIR_IMAGE}/$rdtb does not exist"
+        fi
+        dtc -I dtb -O dts -o ${WORKDIR}/dom0-linux.dts ${DEPLOY_DIR_IMAGE}/$rdtb
+
+        # Add external includes
+        for inc in ${XEN_DEVICETREE_DTSI_MERGE}; do
+            echo "/include/ \"$inc\"" >> ${WORKDIR}/dom0-linux.dts
+        done
+
+        rdtbnoextn=`basename $dtbf ".dtb"`
+        dtc -I dts -O dtb \
+            -o ${WORKDIR}/${rdtbnoextn}-xen.dtb ${WORKDIR}/dom0-linux.dts
+    done
+}
+do_compile[depends] += "${XEN_DEVICETREE_DEPEND}"
+
+do_deploy() {
+    # install generated dtbs
+    for dtbf in ${XEN_DEVICETREE_DTBS}; do
+        rdtbnoextn=`basename $dtbf ".dtb"`
+        install -m 644 ${rdtbnoextn}-xen.dtb ${DEPLOYDIR}/.
+    done
+}
+
+addtask deploy before do_build after do_compile
diff --git a/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bbappend b/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bbappend
new file mode 100644
index 0000000..191cb13
--- /dev/null
+++ b/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bbappend
@@ -0,0 +1,18 @@
+# Platform dependent parameters
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+# Add a dtb snippet to turn off iommu in dom0 on Juno board
+SRC_URI_append_juno = " file://xen-juno.dtsi"
+XEN_DEVICETREE_DTSI_MERGE_append_juno = " xen-juno.dtsi"
+
+# Board specific configs
+XEN_DEVICETREE_DOM0_BOOTARGS_append_juno = " root=/dev/sda1 rootwait"
+XEN_DEVICETREE_XEN_BOOTARGS_append_juno = " console=dtuart dtuart=serial0 bootscrub=0 iommu=no"
+
+XEN_DEVICETREE_DOM0_BOOTARGS_append_fvp-base = " root=/dev/vda2"
+XEN_DEVICETREE_XEN_BOOTARGS_append_fvp-base = " console=dtuart dtuart=serial0 bootscrub=0"
+
+XEN_DEVICETREE_DOM0_BOOTARGS_append_foundation-armv8 = " root=/dev/vda2"
+XEN_DEVICETREE_XEN_BOOTARGS_append_foundation-armv8 = " console=dtuart dtuart=serial0 bootscrub=0"
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [meta-arm] [PATCH 1/7] arm-autonomy: Create meta-arm-autonomy layer
  2020-03-27 10:50 ` [PATCH 1/7] arm-autonomy: Create meta-arm-autonomy layer Bertrand Marquis
@ 2020-03-27 15:20   ` Diego Sueiro
  0 siblings, 0 replies; 16+ messages in thread
From: Diego Sueiro @ 2020-03-27 15:20 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Bertrand Marquis via Lists.Yoctoproject.Org
> Sent: 27 March 2020 10:50
> To: meta-arm@lists.yoctoproject.org
> Cc: nd <nd@arm.com>
> Subject: [meta-arm] [PATCH 1/7] arm-autonomy: Create meta-arm-autonomy
> layer
> 
> Create a meta-arm-autonomy layer in meta-arm.
> Add layer configuration file and Readme.
> 
> Change-Id: Idf3411edc21f3d13fdc7146fcf34700d2aab1c41
> Issue-Id: SCM-767
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  README.md                         |  3 ++
>  meta-arm-autonomy/README.md       | 51
> +++++++++++++++++++++++++++++++
>  meta-arm-autonomy/conf/layer.conf | 25 +++++++++++++++
>  3 files changed, 79 insertions(+)
>  create mode 100644 meta-arm-autonomy/README.md  create mode 100644
> meta-arm-autonomy/conf/layer.conf
> 
> diff --git a/README.md b/README.md
> index 20b106a..04c641d 100644
> --- a/README.md
> +++ b/README.md
> @@ -16,6 +16,9 @@ meta-arm-iota:
>  meta-arm-toolchain:
>  	This layer provides support for Arm's GNU-A toolset releases
> 
> +meta-arm-autonomy:
> +    This layer provides a reference stack for autonomous systems.
> +
>  Contributing
>  ------------
>  Currently, we only accept patches from the meta-arm mailing list.  For general
> diff --git a/meta-arm-autonomy/README.md b/meta-arm-
> autonomy/README.md new file mode 100644 index 0000000..f8a1404
> --- /dev/null
> +++ b/meta-arm-autonomy/README.md
> @@ -0,0 +1,51 @@
> +meta-arm-autonomy Yocto Layer
> +=============================
> +
> +Introduction
> +------------
> +This layer provides an hypervisor based solution (currently based on
> +Xen) for autonomous system. It contains recipes and classes to build
> +host and guests systems.
> +
> +Dependencies
> +------------
> +This layer depends on several other Yocto layers:
> +* meta-openembedded (https://git.openembedded.org/meta-
> openembedded)
> +* poky (https://git.yoctoproject.org/poky)
> +* meta-virtualization
> +(https://git.yoctoproject.org/meta-virtualization)
> +
> +Distribution Features
> +---------------------
> +This layer is adding the following Yocto DISTRO_FEATURES:
> +
> +Bitbake variables
> +-----------------
> +Some recipes and classes in this layer are introducing variables which
> +can be modified by the user in local.conf.
> +Each recipe introducing such variables has a chapter "Bitbake
> +parameters" in its documentation.
> +
> +Those documentation files should be checked for variables:
> +
> +BSPs
> +----
> +This layer is adding the following machines:
> +
> +Images
> +------
> +This layer is adding the following images:
> +
> +Recipes and classes
> +-------------------
> +This layer is adding the following recipes and classes:
> +
> +Contributing
> +------------
> +This project has not put in place a process for contributions
> +currently. If you would like to contribute, please contact the
> +maintainers
> +
> +
> +Maintainer(s)
> +-------------
> +* Bertrand Marquis <bertrand.marquis@arm.com>
> +* Filipe Rinaldi <filipe.rinaldi@arm.com>
> diff --git a/meta-arm-autonomy/conf/layer.conf b/meta-arm-
> autonomy/conf/layer.conf
> new file mode 100644
> index 0000000..2dc24a2
> --- /dev/null
> +++ b/meta-arm-autonomy/conf/layer.conf
> @@ -0,0 +1,25 @@
> +# Add layer to BBPATH
> +BBPATH .= ":${LAYERDIR}"
> +
> +# Add recipes-* directories to BBFILES
> +BBFILES += " \
> +    ${LAYERDIR}/recipes-*/*/*.bb \
> +    ${LAYERDIR}/recipes-*/*/*.bbappend \
> +    "
> +
> +BBFILE_COLLECTIONS += "meta-arm-autonomy"
> +BBFILE_PATTERN_meta-arm-autonomy = "^${LAYERDIR}/"
> +BBFILE_PRIORITY_meta-arm-autonomy = "6"
> +LAYERDEPENDS_meta-arm-autonomy = " \
> +   core \
> +   yocto \
> +   openembedded-layer \
> +   virtualization-layer \
> +"
> +LAYERSERIES_COMPAT_meta-arm-autonomy = "zeus"
> +
> +# We don't activate virtualization feature from meta-virtualization as
> +it # brings in lots of stuff we don't need. We need to disable the
> +sanity check # otherwise the user will see a warning on each build.
> +SKIP_META_VIRT_SANITY_CHECK = "1"
> +
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-arm] [PATCH 2/7] arm-autonomy: Create arm-autonomy-host feature
  2020-03-27 10:50 ` [PATCH 2/7] arm-autonomy: Create arm-autonomy-host feature Bertrand Marquis
@ 2020-03-27 15:21   ` Diego Sueiro
  0 siblings, 0 replies; 16+ messages in thread
From: Diego Sueiro @ 2020-03-27 15:21 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Bertrand Marquis via Lists.Yoctoproject.Org
> Sent: 27 March 2020 10:50
> To: meta-arm@lists.yoctoproject.org
> Cc: nd <nd@arm.com>
> Subject: [meta-arm] [PATCH 2/7] arm-autonomy: Create arm-autonomy-host
> feature
> 
> Create a new distribution feature to enable functionalities for autonomy host
> systems:
> - enable xen and ipv4 in distribution features
> - enable xen backend drivers in Linux kernel using a kmeta feature
> 
> For the feature to work properly, create a class inherited when the layer is
> included to enable required parameters
> 
> Change-Id: Ia0cdaa2b69bc030515ea16d67c47fec6b1ea0897
> Issue-Id: SCM-767
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  meta-arm-autonomy/README.md                   |  5 +++
>  .../classes/arm-autonomy-features.bbclass     |  4 +++
>  .../conf/distro/include/arm-autonomy-host.inc |  5 +++
>  meta-arm-autonomy/conf/layer.conf             |  6 ++++
>  .../features/arm-autonomy/xen-host.cfg        | 35 +++++++++++++++++++
>  .../features/arm-autonomy/xen-host.scc        |  4 +++
>  .../recipes-kernel/linux/linux-%.bbappend     |  3 ++
>  .../linux/linux-arm-autonomy.inc              | 13 +++++++
>  8 files changed, 75 insertions(+)
>  create mode 100644 meta-arm-autonomy/classes/arm-autonomy-
> features.bbclass
>  create mode 100644 meta-arm-autonomy/conf/distro/include/arm-
> autonomy-host.inc
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-
> autonomy-kmeta/features/arm-autonomy/xen-host.cfg
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-
> autonomy-kmeta/features/arm-autonomy/xen-host.scc
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/linux-
> %.bbappend
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/linux-arm-
> autonomy.inc
> 
> diff --git a/meta-arm-autonomy/README.md b/meta-arm-
> autonomy/README.md index f8a1404..1f80a05 100644
> --- a/meta-arm-autonomy/README.md
> +++ b/meta-arm-autonomy/README.md
> @@ -18,6 +18,11 @@ Distribution Features
>  ---------------------
>  This layer is adding the following Yocto DISTRO_FEATURES:
> 
> +* arm-autonomy-host: this feature activates functionalities required to
> +build
> +  an autonomy host system. It is doing the following:
> +  - add 'xen' and 'ipv4' to DISTRO_FEATURES.
> +  - add xen backend drivers to linux kernel configuration.
> +
>  Bitbake variables
>  -----------------
>  Some recipes and classes in this layer are introducing variables which can be
> diff --git a/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
> b/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
> new file mode 100644
> index 0000000..38441e4
> --- /dev/null
> +++ b/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
> @@ -0,0 +1,4 @@
> +# Include arm-autonomy distro config files if the distro features are
> +set
> +
> +require ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host',
> +'${ARM_AUTONOMY_DISTRO_CFGDIR}/arm-autonomy-host.inc', '', d)}
> +
> diff --git a/meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc
> b/meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc
> new file mode 100644
> index 0000000..236fbe9
> --- /dev/null
> +++ b/meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc
> @@ -0,0 +1,5 @@
> +# This files is added when DISTRO_FEATURES contains arm-autonomy-host
> +
> +# We need to have xen and ipv4 activated DISTRO_FEATURES_append = " xen
> +ipv4"
> +
> diff --git a/meta-arm-autonomy/conf/layer.conf b/meta-arm-
> autonomy/conf/layer.conf
> index 2dc24a2..19f24ad 100644
> --- a/meta-arm-autonomy/conf/layer.conf
> +++ b/meta-arm-autonomy/conf/layer.conf
> @@ -23,3 +23,9 @@ LAYERSERIES_COMPAT_meta-arm-autonomy = "zeus"
>  # otherwise the user will see a warning on each build.
>  SKIP_META_VIRT_SANITY_CHECK = "1"
> 
> +# Directory of our distro config files
> +ARM_AUTONOMY_DISTRO_CFGDIR = "${LAYERDIR}/conf/distro/include/"
> +
> +# Add class to handle arm-autonomy distro extensions
> +USER_CLASSES_append = " arm-autonomy-features"
> +
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/features/arm-autonomy/xen-host.cfg b/meta-arm-autonomy/recipes-
> kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg
> new file mode 100644
> index 0000000..2affab9
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/features
> +++ /arm-autonomy/xen-host.cfg
> @@ -0,0 +1,35 @@
> +CONFIG_PARAVIRT=y
> +CONFIG_XEN=y
> +
> +CONFIG_BLOCK=y
> +CONFIG_XEN_BLKDEV_BACKEND=y
> +
> +CONFIG_SCSI=y
> +CONFIG_TARGET_CORE=y
> +CONFIG_XEN_SCSI_BACKEND=y
> +
> +CONFIG_NET=y
> +CONFIG_XEN_NETDEV_BACKEND=y
> +
> +CONFIG_HVC_IRQ=y
> +
> +CONFIG_HVC_XEN=y
> +
> +CONFIG_WATCHDOG=y
> +CONFIG_XEN_WDT=y
> +
> +CONFIG_XEN_BALLOON=y
> +
> +CONFIG_XEN_DEV_EVTCHN=y
> +
> +CONFIG_XENFS=y
> +CONFIG_XEN_COMPAT_XENFS=y
> +
> +CONFIG_XEN_SYS_HYPERVISOR=y
> +CONFIG_XEN_GNTDEV=y
> +CONFIG_XEN_GRANT_DEV_ALLOC=y
> +CONFIG_SWIOTLB_XEN=y
> +
> +CONFIG_XEN_EFI=y
> +CONFIG_XEN_AUTO_XLATE=y
> +
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/features/arm-autonomy/xen-host.scc b/meta-arm-autonomy/recipes-
> kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.scc
> new file mode 100644
> index 0000000..6fdbabc
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/features
> +++ /arm-autonomy/xen-host.scc
> @@ -0,0 +1,4 @@
> +define KFEATURE_DESCRIPTION "Enable XEN Host Drivers on autonomy
> systems"
> +
> +kconf non-hardware xen-host.cfg
> +
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend
> b/meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend
> new file mode 100644
> index 0000000..add7042
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend
> @@ -0,0 +1,3 @@
> +# Add arm-autonomy kernel support
> +require linux-arm-autonomy.inc
> +
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> new file mode 100644
> index 0000000..0332387
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> @@ -0,0 +1,13 @@
> +# Add arm-autonomy specific features to the kernel
> +
> +FILESEXTRAPATHS_prepend := "${THISDIR}:"
> +
> +#
> +# arm-autonomy kmeta
> +#
> +SRC_URI_append = " file://arm-autonomy-kmeta;type=kmeta;name=arm-
> autonomy-kmeta;destsuffix=arm-autonomy-kmeta"
> +
> +# Add xen host drivers to kernel if arm-autonomy-host is activated
> +KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
> +        'arm-autonomy-host', 'features/arm-autonomy/xen-host.scc', '', d)}"
> +
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-arm] [PATCH 3/7] arm-autonomy: Create arm-autonomy-host image
  2020-03-27 10:50 ` [PATCH 3/7] arm-autonomy: Create arm-autonomy-host image Bertrand Marquis
@ 2020-03-27 15:21   ` Diego Sueiro
  0 siblings, 0 replies; 16+ messages in thread
From: Diego Sueiro @ 2020-03-27 15:21 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Bertrand Marquis via Lists.Yoctoproject.Org
> Sent: 27 March 2020 10:50
> To: meta-arm@lists.yoctoproject.org
> Cc: nd <nd@arm.com>
> Subject: [meta-arm] [PATCH 3/7] arm-autonomy: Create arm-autonomy-host
> image
> 
> Create minimal image suitable for an arm-autonomy-host containing:
> - the boot packagegroup
> - the ssh server packagegroup
> - xen base tools
> - qemu (required to start xen guests)
> 
> Change-Id: If864fc6b768cbe4ca19bfe24753c008146b7550c
> Issue-Id: SCM-767
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  meta-arm-autonomy/README.md                   |  5 ++++
>  .../images/arm-autonomy-host-image-minimal.bb | 27 +++++++++++++++++++
>  2 files changed, 32 insertions(+)
>  create mode 100644 meta-arm-autonomy/recipes-core/images/arm-
> autonomy-host-image-minimal.bb
> 
> diff --git a/meta-arm-autonomy/README.md b/meta-arm-
> autonomy/README.md index 1f80a05..d0c6181 100644
> --- a/meta-arm-autonomy/README.md
> +++ b/meta-arm-autonomy/README.md
> @@ -40,6 +40,11 @@ Images
>  ------
>  This layer is adding the following images:
> 
> +* arm-autonomy-host-image-minimal: this image includes all elements
> +required
> +  to create a minimal arm-autonomy-host system. This includes xen and
> +tools to
> +  manage xen guests. This image depends on 'arm-autonomy-host'
> +distribution
> +  feature.
> +
>  Recipes and classes
>  -------------------
>  This layer is adding the following recipes and classes:
> diff --git a/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-
> image-minimal.bb b/meta-arm-autonomy/recipes-core/images/arm-
> autonomy-host-image-minimal.bb
> new file mode 100644
> index 0000000..fb0a0b7
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-
> mini
> +++ mal.bb
> @@ -0,0 +1,27 @@
> +# Recipe to create a minimal Arm Autonomy stack host image
> +
> +DESCRIPTION = "Arm Autonomy stack host minimal image"
> +
> +inherit core-image
> +
> +LICENSE = "MIT"
> +
> +# Includes minimal set required to start and manage guest. The xen
> +specific # modules are not explicitly included as they are built as
> +part of the kernel # image for performance reasons. Includes all kernel
> +modules anyway as it makes # life easier and does not cost that much in size.
> +IMAGE_INSTALL += " \
> +    packagegroup-core-boot \
> +    packagegroup-core-ssh-openssh \
> +    kernel-modules \
> +    xen-base \
> +    qemu \
> +    "
> +
> +python __anonymous() {
> +    if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True,
> d):
> +        raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain
> +'arm-autonomy-host'")
> +
> +    if bb.utils.contains('DISTRO_FEATURES', 'xen', False, True, d):
> +        raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain
> +'xen'") }
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-arm] [PATCH 4/7] arm-autonomy: Create arm-autonomy-guest feature
  2020-03-27 10:50 ` [PATCH 4/7] arm-autonomy: Create arm-autonomy-guest feature Bertrand Marquis
@ 2020-03-27 15:22   ` Diego Sueiro
  0 siblings, 0 replies; 16+ messages in thread
From: Diego Sueiro @ 2020-03-27 15:22 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Bertrand Marquis via Lists.Yoctoproject.Org
> Sent: 27 March 2020 10:50
> To: meta-arm@lists.yoctoproject.org
> Cc: nd <nd@arm.com>
> Subject: [meta-arm] [PATCH 4/7] arm-autonomy: Create arm-autonomy-guest
> feature
> 
> Introduce DISTRO_FEATURE arm-autonomy-guest which is:
> - enabling ipv4 in distro features
> - enabling xen frontend driver in the linux kernel using a kernel feature
> - enabling console over hvc0
> 
> Change-Id: Idd9a708799b35e483dbba22279ce677d9674ef09
> Issue-Id: SCM-767
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  meta-arm-autonomy/README.md                   |  6 +++
>  .../classes/arm-autonomy-features.bbclass     |  1 +
>  .../distro/include/arm-autonomy-guest.inc     |  5 ++
>  .../sysvinit/sysvinit-inittab_2.%.bbappend    | 16 ++++++
>  .../features/arm-autonomy/xen-guest.cfg       | 54 +++++++++++++++++++
>  .../features/arm-autonomy/xen-guest.scc       |  4 ++
>  .../linux/linux-arm-autonomy.inc              |  3 ++
>  7 files changed, 89 insertions(+)
>  create mode 100644 meta-arm-autonomy/conf/distro/include/arm-
> autonomy-guest.inc
>  create mode 100644 meta-arm-autonomy/recipes-core/sysvinit/sysvinit-
> inittab_2.%.bbappend
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-
> autonomy-kmeta/features/arm-autonomy/xen-guest.cfg
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-
> autonomy-kmeta/features/arm-autonomy/xen-guest.scc
> 
> diff --git a/meta-arm-autonomy/README.md b/meta-arm-
> autonomy/README.md index d0c6181..e5ad6ed 100644
> --- a/meta-arm-autonomy/README.md
> +++ b/meta-arm-autonomy/README.md
> @@ -23,6 +23,12 @@ This layer is adding the following Yocto
> DISTRO_FEATURES:
>    - add 'xen' and 'ipv4' to DISTRO_FEATURES.
>    - add xen backend drivers to linux kernel configuration.
> 
> +* arm-autonomy-guest: this feature activates functionalities to run as
> +guest
> +  of an autonomy system. It is doing the following:
> +  - add 'ipv4' to DISTRO_FEATURES.
> +  - add xen frontend drivers to linux kernel configuration.
> +  - add console on hvc0 during init.
> +
>  Bitbake variables
>  -----------------
>  Some recipes and classes in this layer are introducing variables which can be
> diff --git a/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
> b/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
> index 38441e4..15549d8 100644
> --- a/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
> +++ b/meta-arm-autonomy/classes/arm-autonomy-features.bbclass
> @@ -1,4 +1,5 @@
>  # Include arm-autonomy distro config files if the distro features are set
> 
>  require ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host',
> '${ARM_AUTONOMY_DISTRO_CFGDIR}/arm-autonomy-host.inc', '', d)}
> +require ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-guest',
> +'${ARM_AUTONOMY_DISTRO_CFGDIR}/arm-autonomy-guest.inc', '', d)}
> 
> diff --git a/meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc
> b/meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc
> new file mode 100644
> index 0000000..d961b40
> --- /dev/null
> +++ b/meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc
> @@ -0,0 +1,5 @@
> +# This files is added when DISTRO_FEATURES contains arm-autonomy-guest
> +
> +# We need to have ipv4 activated
> +DISTRO_FEATURES_append = " ipv4"
> +
> diff --git a/meta-arm-autonomy/recipes-core/sysvinit/sysvinit-
> inittab_2.%.bbappend b/meta-arm-autonomy/recipes-core/sysvinit/sysvinit-
> inittab_2.%.bbappend
> new file mode 100644
> index 0000000..7b0c647
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-core/sysvinit/sysvinit-inittab_2.%.bbapp
> +++ end
> @@ -0,0 +1,16 @@
> +# if arm-autonomy-guest is activated, we are running as a xen guest so
> +we must # have a console on hvc0 # This is normally done in
> +meta-virtualization if xen is activated but here # we don't have xen
> +activated.
> +#
> +
> +SYSVINIT_ADDHVC0 = "${@bb.utils.contains('DISTRO_FEATURES', \
> +    'arm-autonomy-guest', 'true', 'false', d)}"
> +
> +do_install_append() {
> +    if ${SYSVINIT_ADDHVC0}; then
> +        echo "" >> ${D}${sysconfdir}/inittab
> +        echo "X0:12345:respawn:/sbin/getty 115200 hvc0" >> \
> +            ${D}${sysconfdir}/inittab
> +    fi
> +}
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/features/arm-autonomy/xen-guest.cfg b/meta-arm-autonomy/recipes-
> kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.cfg
> new file mode 100644
> index 0000000..e4e44a9
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/features
> +++ /arm-autonomy/xen-guest.cfg
> @@ -0,0 +1,54 @@
> +CONFIG_PARAVIRT=y
> +CONFIG_XEN=y
> +
> +CONFIG_BLOCK=y
> +CONFIG_XEN_BLKDEV_FRONTEND=y
> +
> +CONFIG_SCSI=y
> +CONFIG_XEN_SCSI_FRONTEND=y
> +
> +CONFIG_NET=y
> +CONFIG_XEN_NETDEV_FRONTEND=y
> +
> +CONFIG_INPUT=y
> +CONFIG_INPUT_MISC=y
> +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
> +
> +CONFIG_HVC_IRQ=y
> +
> +CONFIG_HVC_XEN=y
> +CONFIG_HVC_XEN_FRONTEND=y
> +
> +CONFIG_WATCHDOG=y
> +CONFIG_XEN_WDT=y
> +
> +CONFIG_FB_SYS_FILLRECT=y
> +CONFIG_FB_SYS_COPYAREA=y
> +CONFIG_FB_SYS_IMAGEBLIT=y
> +CONFIG_FB_SYS_FOPS=y
> +CONFIG_FB_DEFERRED_IO=y
> +CONFIG_XEN_FBDEV_FRONTEND=y
> +
> +CONFIG_XEN_BALLOON=y
> +
> +CONFIG_XEN_DEV_EVTCHN=y
> +
> +CONFIG_XENFS=y
> +CONFIG_XEN_COMPAT_XENFS=y
> +
> +CONFIG_XEN_SYS_HYPERVISOR=y
> +CONFIG_XEN_XENBUS_FRONTEND=y
> +CONFIG_XEN_GNTDEV=y
> +CONFIG_XEN_GRANT_DEV_ALLOC=y
> +CONFIG_SWIOTLB_XEN=y
> +
> +CONFIG_XEN_EFI=y
> +CONFIG_XEN_AUTO_XLATE=y
> +
> +CONFIG_DRM=y
> +CONFIG_DRM_XEN=y
> +CONFIG_DRM_XEN_FRONTEND=y
> +
> +CONFIG_SOUND=y
> +CONFIG_SND=y
> +CONFIG_SND_XEN_FRONTEND=y
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/features/arm-autonomy/xen-guest.scc b/meta-arm-autonomy/recipes-
> kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.scc
> new file mode 100644
> index 0000000..935e78f
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/features
> +++ /arm-autonomy/xen-guest.scc
> @@ -0,0 +1,4 @@
> +define KFEATURE_DESCRIPTION "Enable XEN Guest Frontend Drivers"
> +
> +kconf non-hardware xen-guest.cfg
> +
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> index 0332387..b2245a5 100644
> --- a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> +++ b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> @@ -11,3 +11,6 @@ SRC_URI_append = " file://arm-autonomy-
> kmeta;type=kmeta;name=arm-autonomy-kmeta;
>  KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
>          'arm-autonomy-host', 'features/arm-autonomy/xen-host.scc', '', d)}"
> 
> +# Add xen guest drivers to kernel if arm-autonomy-guest is activated
> +KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
> +        'arm-autonomy-guest', 'features/arm-autonomy/xen-guest.scc', '', d)}"
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-arm] [PATCH 5/7] arm-autonomy: Create arm64-autonomy-guest machine
  2020-03-27 10:50 ` [PATCH 5/7] arm-autonomy: Create arm64-autonomy-guest machine Bertrand Marquis
@ 2020-03-27 15:22   ` Diego Sueiro
  0 siblings, 0 replies; 16+ messages in thread
From: Diego Sueiro @ 2020-03-27 15:22 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Bertrand Marquis via Lists.Yoctoproject.Org
> Sent: 27 March 2020 10:50
> To: meta-arm@lists.yoctoproject.org
> Cc: nd <nd@arm.com>
> Subject: [meta-arm] [PATCH 5/7] arm-autonomy: Create arm64-autonomy-
> guest machine
> 
> Create a minimalistic BSP to be used as an arm-autonomy-guest on ARM64.
> The BSP is enabling ARM64 and SMP in the kernel configuration and is
> enabling the arm-autonomy-guest in DISTRO_FEATURES.
> Rework README.md file.
> 
> Change-Id: I7ef0176a3426748c4b66cdec5801aa34229187ba
> Issue-Id: SCM-767
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  meta-arm-autonomy/README.md                     |  5 +++++
>  .../conf/machine/arm64-autonomy-guest.conf      | 17 +++++++++++++++++
>  .../arm64-autonomy-guest-standard.scc           |  5 +++++
>  .../bsp/arm-autonomy/arm64-autonomy-guest.cfg   |  2 ++
>  .../bsp/arm-autonomy/arm64-autonomy-guest.scc   |  6 ++++++
>  .../recipes-kernel/linux/linux-arm-autonomy.inc |  5 +++++
>  6 files changed, 40 insertions(+)
>  create mode 100644 meta-arm-autonomy/conf/machine/arm64-autonomy-
> guest.conf
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-
> autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest-standard.scc
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-
> autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.cfg
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-
> autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.scc
> 
> diff --git a/meta-arm-autonomy/README.md b/meta-arm-
> autonomy/README.md index e5ad6ed..ed9d6c9 100644
> --- a/meta-arm-autonomy/README.md
> +++ b/meta-arm-autonomy/README.md
> @@ -42,6 +42,11 @@ BSPs
>  ----
>  This layer is adding the following machines:
> 
> +* arm64-autonomy-guest: this machines creates a minimal BSP suitable to
> +be used
> +  as an autonomy guest. It is in fact only activating ARM64
> +architecture and
> +  SMP in the linux kernel and is enabling the DISTRO_FEATURE
> +  arm-autonomy-guest.
> +
>  Images
>  ------
>  This layer is adding the following images:
> diff --git a/meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf
> b/meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf
> new file mode 100644
> index 0000000..cb72c60
> --- /dev/null
> +++ b/meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf
> @@ -0,0 +1,17 @@
> +#@TYPE: Machine
> +#@NAME: Autonomy Guest ARM64 machine
> +#@DESCRIPTION: Machine configuration for ARM64 Autonomy Guest
> +
> +TUNE_FEATURES = "aarch64"
> +
> +require conf/machine/include/arm/arch-armv8a.inc
> +
> +KERNEL_IMAGETYPE = "Image"
> +
> +IMAGE_FSTYPES += "tar.bz2"
> +
> +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
> +PREFERRED_VERSION_linux-yocto ?= "4.19%"
> +
> +DISTRO_FEATURES += "arm-autonomy-guest"
> +
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/bsp/arm-autonomy/arm64-autonomy-guest-standard.scc b/meta-arm-
> autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-
> autonomy/arm64-autonomy-guest-standard.scc
> new file mode 100644
> index 0000000..7c75d99
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/bsp/arm-
> +++ autonomy/arm64-autonomy-guest-standard.scc
> @@ -0,0 +1,5 @@
> +define KMACHINE arm64-autonomy-guest
> +define KTYPE standard
> +define KARCH arm64
> +
> +include arm64-autonomy-guest.scc
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/bsp/arm-autonomy/arm64-autonomy-guest.cfg b/meta-arm-
> autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-
> autonomy/arm64-autonomy-guest.cfg
> new file mode 100644
> index 0000000..fcdad98
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/bsp/arm-
> +++ autonomy/arm64-autonomy-guest.cfg
> @@ -0,0 +1,2 @@
> +CONFIG_ARM64=y
> +CONFIG_SMP=y
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/bsp/arm-autonomy/arm64-autonomy-guest.scc b/meta-arm-
> autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-
> autonomy/arm64-autonomy-guest.scc
> new file mode 100644
> index 0000000..e887b4e
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-
> kmeta/bsp/arm-
> +++ autonomy/arm64-autonomy-guest.scc
> @@ -0,0 +1,6 @@
> +include ktypes/standard/standard.scc
> +include features/input/input.scc
> +include features/net/net.scc
> +include cfg/timer/no_hz.scc
> +
> +kconf hardware arm64-autonomy-guest.cfg
> diff --git a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> index b2245a5..8191079 100644
> --- a/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> +++ b/meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> @@ -14,3 +14,8 @@ KERNEL_FEATURES +=
> "${@bb.utils.contains('DISTRO_FEATURES', \  # Add xen guest drivers to kernel
> if arm-autonomy-guest is activated  KERNEL_FEATURES +=
> "${@bb.utils.contains('DISTRO_FEATURES', \
>          'arm-autonomy-guest', 'features/arm-autonomy/xen-guest.scc', '', d)}"
> +
> +# Add support for arm64-autonomy-guest machine
> +COMPATIBLE_MACHINE_arm64-autonomy-guest = "arm64-autonomy-guest"
> +KMACHINE_arm64-autonomy-guest = "arm64-autonomy-guest"
> +
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-arm] [PATCH 6/7] arm-autonomy: Create quick start documentation
  2020-03-27 10:50 ` [PATCH 6/7] arm-autonomy: Create quick start documentation Bertrand Marquis
@ 2020-03-27 15:23   ` Diego Sueiro
  0 siblings, 0 replies; 16+ messages in thread
From: Diego Sueiro @ 2020-03-27 15:23 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Bertrand Marquis via Lists.Yoctoproject.Org
> Sent: 27 March 2020 10:50
> To: meta-arm@lists.yoctoproject.org
> Cc: nd <nd@arm.com>
> Subject: [meta-arm] [PATCH 6/7] arm-autonomy: Create quick start
> documentation
> 
> Add a quick start documentation to help user to start using the layer.
> 
> Change-Id: I3aea950d2dfdcae41bbdb8f3df4f29196048338b
> Issue-Id: SCM-767
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  meta-arm-autonomy/README.md                   |   3 +
>  .../documentation/arm-autonomy-quickstart.md  | 116 ++++++++++++++++++
>  2 files changed, 119 insertions(+)
>  create mode 100644 meta-arm-autonomy/documentation/arm-autonomy-
> quickstart.md
> 
> diff --git a/meta-arm-autonomy/README.md b/meta-arm-
> autonomy/README.md index ed9d6c9..9b12993 100644
> --- a/meta-arm-autonomy/README.md
> +++ b/meta-arm-autonomy/README.md
> @@ -7,6 +7,9 @@ This layer provides an hypervisor based solution (currently
> based on Xen) for  autonomous system. It contains recipes and classes to build
> host and guests  systems.
> 
> +To start using this layer, please check the [Quick Start
> +Guide](documentation/arm-autonomy-quickstart.md).
> +
>  Dependencies
>  ------------
>  This layer depends on several other Yocto layers:
> diff --git a/meta-arm-autonomy/documentation/arm-autonomy-quickstart.md
> b/meta-arm-autonomy/documentation/arm-autonomy-quickstart.md
> new file mode 100644
> index 0000000..2b92996
> --- /dev/null
> +++ b/meta-arm-autonomy/documentation/arm-autonomy-quickstart.md
> @@ -0,0 +1,116 @@
> +arm-autonomy Quick Start
> +==================
> +
> +This documentation is explaining how to quickly start with arm-autonomy
> +layer and the main features provided.
> +You will find in the documentation directory some more detailed
> +documentation for each of the functionalites provided by this layer.
> +
> +What to use this layer for?
> +---------------------------
> +Using this layer, you can easily and rapidly create a system based on
> +Xen with one or more guests created using Yocto.
> +
> +For this you will need to create at least 2 Yocto projects:
> +- a host project: This one will compile Xen and create a Linux system
> +to be
> +  used as Xen Dom0. The Linux system will contain all functionalities
> +required
> +  to start and manage guests.
> +- one or several guest projects: Those will create Linux systems with
> +the
> +  required Linux kernel configuration to run as Xen DomU.
> +
> +Prepare your system
> +-------------------
> +
> +First you must download the Yocto layers needed:
> + - [meta-openembedded](https://git.openembedded.org/meta-
> openembedded)
> + - [poky](https://git.yoctoproject.org/poky)
> + -
> +[meta-virtualization](https://git.yoctoproject.org/meta-virtualization)
> + - [meta-arm](https://git.yoctoproject.org/meta-arm)
> + - all other layers you might want to use
> +
> +For each of the downloaded layer make sure you checkout the release of
> +Yocto you want to use (for example zeus using `git checkout zeus`).
> +
> +Please follow [Yocto
> +documentation](https://www.yoctoproject.org/docs/latest/brief-yoctoproj
> +ectqs/brief-yoctoprojectqs.html) in order to have the required
> +dependencies.
> +
> +
> +Create a project
> +----------------
> +
> +Here are the main steps to create an arm-autonomy project:
> +
> +1. create a new Yocto project using `oe-init-build-env` in a new directory:
> +  ```
> +  oe-init-build-env my-project
> +  ```
> +
> +2. edit the file `conf/bblayers.conf` and add
> +`meta-arm/meta-arm-autonomy`
> +  layer to the list of layers of your project. Also add any other
> +layers you
> +  might need (for example `meta-arm/meta-arm-bsp` and
> +`meta-arm/meta-arm` to
> +  use Arm boards like Juno or FVP emulator).
> +  For example:
> +  ```
> +  BBLAYERS ?= " \
> +    /home/user/arm-autonomy/poky/meta \
> +    /home/user/arm-autonomy/poky/meta-poky \
> +    /home/user/arm-autonomy/poky/meta-yocto-bsp \
> +    /home/user/arm-autonomy/meta-openembedded/meta-oe \
> +    /home/user/arm-autonomy/meta-openembedded/meta-python \
> +    /home/user/arm-autonomy/meta-openembedded/meta-filesystems \
> +    /home/user/arm-autonomy/meta-openembedded/meta-networking \
> +    /home/user/arm-autonomy/meta-arm/meta-arm \
> +    /home/user/arm-autonomy/meta-arm/meta-arm-bsp \
> +    /home/user/arm-autonomy/meta-virtualization \
> +    /home/user/arm-autonomy/meta-arm/meta-arm-autonomy \
> +    "
> +  ```
> +
> +Those steps will have to be done for each project you will have to create.
> +
> +Host project
> +------------
> +The host project will build Xen and the Dom0 Linux. It will be the only
> +project that will be specific to the board (MACHINE) you will be running on.
> +
> +To create a host project:
> +1. Follow the steps of "Create a project"
> +
> +2. Add the layers in `bblayers.conf` required to build a Yocto project for the
> +   board you want to use.
> +   For example to use Arm FVP Base emulator, add `meta-arm/meta-arm` and
> +   `meta-arm/meta-arm-bsp`.
> +
> +3. edit conf/local.conf to add `arm-autonomy-host` to the DISTRO_FEATURES
> and
> +   set MACHINE to the board you want to use.
> +   For example, add the following lines:
> +  ```
> +  MACHINE = "fvp-base"
> +  DISTRO_FEATURES += "arm-autonomy-host"
> +  ```
> +
> +4. build the image using `bitbake arm-autonomy-host-image-minimal`
> +
> +Guest project
> +-------------
> +The guest projects are not target specific and will use a Yocto MACHINE
> +defined in meta-arm-autonomy to include only the Linux configuration
> +required to run a xen guest.
> +
> +To create a guest project:
> +
> +1. Follow the steps of "Create a project"
> +
> +2. Optionaly add layers required to build the image and features you need.
> +
> +3. edit conf/local.conf to add `arm-autonomy-guest` to the
> DISTRO_FEATURES and
> +   set MACHINE to `arm64-autonomy-guest`:
> +  ```
> +  MACHINE = "arm64-autonomy-guest"
> +  DISTRO_FEATURES += "arm-autonomy-guest"
> +  ```
> +
> +4. build the image you want.
> +   For example `bitbake core-image-minimal`
> +
> +
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-arm] [PATCH 7/7] arm-autonomy: Create xen-devicetree recipe
  2020-03-27 10:50 ` [PATCH 7/7] arm-autonomy: Create xen-devicetree recipe Bertrand Marquis
@ 2020-03-27 15:24   ` Diego Sueiro
  0 siblings, 0 replies; 16+ messages in thread
From: Diego Sueiro @ 2020-03-27 15:24 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Bertrand Marquis via Lists.Yoctoproject.Org
> Sent: 27 March 2020 10:50
> To: meta-arm@lists.yoctoproject.org
> Cc: nd <nd@arm.com>
> Subject: [meta-arm] [PATCH 7/7] arm-autonomy: Create xen-devicetree recipe
> 
> Create a xen-devicetree recipe to add entries required to boot Xen and a
> Dom0 inside a DTB.
> The recipe is introducing XEN_DEVICETREE_* parameters to define the xen
> command line, the dom0 command line, the dom0 memory size, the dom0
> kernel load address and size.
> The recipe can also be extended using bbappend to adapt the device tree and
> the parameters.
> Adaptation are provided to support Juno, fvp-base and foundation-armv8
> boards from meta-arm-bsp.
> Add xen-devicetree as EXTRA_IMAGEDEPENDS to arm-autonomy-host-image-
> minimal
> 
> Change-Id: Ibcfbd02c2377a9abcbd20caa47ea833b5308fbac
> Issue-Id: SCM-767
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  meta-arm-autonomy/README.md                   |   4 +
>  .../documentation/xen-devicetree.md           | 104 ++++++++++++++++++
>  .../images/arm-autonomy-host-image-minimal.bb |   3 +
>  .../xen-devicetree/files/xen-juno.dtsi        |  11 ++
>  .../xen-devicetree/files/xen.dtsi.in          |  17 +++
>  .../xen-devicetree/xen-devicetree.bb          |  68 ++++++++++++
>  .../xen-devicetree/xen-devicetree.bbappend    |  18 +++
>  7 files changed, 225 insertions(+)
>  create mode 100644 meta-arm-autonomy/documentation/xen-devicetree.md
>  create mode 100644 meta-arm-autonomy/recipes-extended/xen-
> devicetree/files/xen-juno.dtsi
>  create mode 100644 meta-arm-autonomy/recipes-extended/xen-
> devicetree/files/xen.dtsi.in
>  create mode 100644 meta-arm-autonomy/recipes-extended/xen-
> devicetree/xen-devicetree.bb
>  create mode 100644 meta-arm-autonomy/recipes-extended/xen-
> devicetree/xen-devicetree.bbappend
> 
> diff --git a/meta-arm-autonomy/README.md b/meta-arm-
> autonomy/README.md index 9b12993..78a7281 100644
> --- a/meta-arm-autonomy/README.md
> +++ b/meta-arm-autonomy/README.md
> @@ -40,6 +40,7 @@ Each recipe introducing such variables has a chapter
> "Bitbake parameters" in  its documentation.
> 
>  Those documentation files should be checked for variables:
> +- [xen-devicetree](documentation/xen-devicetree.md)
> 
>  BSPs
>  ----
> @@ -63,6 +64,9 @@ Recipes and classes
>  -------------------
>  This layer is adding the following recipes and classes:
> 
> +* [xen-devicetree](documentation/xen-devicetree.md): this is a recipe
> +to modify
> +  a device tree blob to add information required to boot xen and a Dom0 linux.
> +
>  Contributing
>  ------------
>  This project has not put in place a process for contributions currently. If you
> diff --git a/meta-arm-autonomy/documentation/xen-devicetree.md b/meta-
> arm-autonomy/documentation/xen-devicetree.md
> new file mode 100644
> index 0000000..a44dca7
> --- /dev/null
> +++ b/meta-arm-autonomy/documentation/xen-devicetree.md
> @@ -0,0 +1,104 @@
> +Xen device tree
> +===============
> +
> +Introduction
> +------------
> +
> +xen-devicetree recipe can be used to modify an existing Device Tree
> +Blob, produced by Linux kernel or another recipe, to include in it
> +entries required to start Xen and a Dom0 Linux on top of it.
> +
> +The recipe will do the following processing:
> +- generate a xen.dtsi file with entries required for xen based on
> +parameters
> +- turn DTBs in ${XEN_DEVICETREE_DTBS} back to dts
> +- include in xen.dtsi and all other dtsi from
> +  ${XEN_DEVICETREE_DTSI_MERGE} (check Bitbake parameters for more
> +information
> +  on this).
> +- use dtc to create a new DTB file
> +
> +The recipe will generate new files in deploy/images and name them with
> +the extension "-xen.dtb".
> +For example **machine.dtb** will generate **machine-xen.dtb**.
> +
> +Entries added to the DTBs
> +-------------------------
> +
> +When a DTB is processed by the recipe, the following block is added:
> +```
> +    chosen {
> +        xen,dom0-bootargs = "VAL";
> +        xen,xen-bootargs = "VAL";
> +
> +        modules {
> +            #size-cells = <0x00000001>;
> +            #address-cells = <0x00000001>;
> +
> +            module@0 {
> +                reg = <VAL VAL>;
> +                compatible = "multiboot,module";
> +            };
> +        };
> +    };
> +```
> +Each occurence of **VAL** is replaced by the content of the variables
> +listed in this documentation.
> +
> +Bitbake parameters
> +------------------
> +
> +Several parameters are available to configure the xen-devicetree during
> +Yocto project compilation (those can be set in your project local.conf, for
> exmple).
> +
> +The following parameters are available:
> +
> +- XEN_DEVICETREE_DEPEND: This variable can be used to indicate which
> +recipe
> +  task is generating the DTBs that xen-devicetree will modify. This
> +makes sure
> +  the xen devicetrees are properly regenerated if the source DTBs are changed.
> +  This variable is set by default to "virtual/kernel:do_deploy" to use
> +DTBs
> +  generated during the compilation of the Linux kernel. This must be
> +changed
> +  if the machine your are using is not using a DTB listed in
> KERNEL_DEVICETREE.
> +
> +- XEN_DEVICETREE_DTBS: This should be set to the list of DTBs you want
> +to be
> +  modified by xen-devicetree. Those must be files that xen-devicetree
> +can find
> +  in the ${DEPLOY_DIR_IMAGE} directory using only the basename of the
> entries.
> +  For example "mydir/board.dtb" will make the recipe look for
> +  ${DEPLOY_DIR_IMAGE}/board.dtb.
> +  This variable is set by default to "${KERNEL_DEVICETREE}" to process
> +the DTBs
> +  generated by the Linux kernel.
> +
> +- XEN_DEVICETREE_DOM0_MEM: Memory size to allocate to Dom0.
> +  This variable is only used if XEN_DEVICETREE_XEN_BOOTARGS has a value
> +  containing "dom0_mem=${XEN_DEVICETREE_DOM0_MEM}" as the
> memory
> +assigned to
> +  dom0 is defined using Xen boot arguments.
> +  This variable is set by default to "1024M".
> +
> +- XEN_DEVICETREE_DOM0_BOOTARGS: Boot arguments to pass to Dom0
> Linux
> +when
> +  booting it.
> +  This variable is set by default to "console=hvc0 earlycon=xen".
> +
> +- XEN_DEVICETREE_XEN_BOOTARGS: this variable should be set with the
> +boot
> +  arguments to be passed to Xen on boot.
> +  This variable is set by default to
> +  "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}".
> +
> +- XEN_DEVICETREE_DOM0_ADDR: This is the address from which the Linux
> +kernel to
> +  be used for Dom0 will be copied. When using u-boot, this is the
> +address at
> +  which you will load the kernel Image before starting Xen.
> +  This variable is set by default to "0x80080000".
> +
> +- XEN_DEVICETREE_DOM0_SIZE: This is the size of the kernel loaded at
> +  ${XEN_DEVICETREE_DOM0_ADDR}. Xen will copy this amount of data inside
> +the
> +  guest before starting it so the size must be at least equal to the
> +kernel
> +  size but can be bigger. You must be careful not to have a value too
> +big as it
> +  could slow down boot or copy other parts with it (like the DTB).
> +  You might need to increase this if you use a kernel with a bundled initramfs.
> +  This variable is set by default to "0x01000000".
> +
> +- XEN_DEVICETREE_DTSI_MERGE: This variable contains the list of dtsi
> +files that
> +  must be included inside the generated DTB file. By default the only
> +one
> +  include is the "xen.dtsi" generated by the recipe.
> +  If your board or project needs to include more fixes or entries in
> +the DTB,
> +  this variable can be appended from a bbappend file to include other
> +dtsi. The
> +  files must be inside the recipe workspace during Yocto compilation.
> +  You can check xen-devicetree.bbappend for an example.
> +
> diff --git a/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-
> image-minimal.bb b/meta-arm-autonomy/recipes-core/images/arm-
> autonomy-host-image-minimal.bb
> index fb0a0b7..5e09eac 100644
> --- a/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-
> minimal.bb
> +++ b/meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-
> mini
> +++ mal.bb
> @@ -18,6 +18,9 @@ IMAGE_INSTALL += " \
>      qemu \
>      "
> 
> +# Build xen-devicetree to produce a xen ready devicetree
> +EXTRA_IMAGEDEPENDS += "xen-devicetree"
> +
>  python __anonymous() {
>      if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True,
> d):
>          raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'arm-
> autonomy-host'") diff --git a/meta-arm-autonomy/recipes-extended/xen-
> devicetree/files/xen-juno.dtsi b/meta-arm-autonomy/recipes-extended/xen-
> devicetree/files/xen-juno.dtsi
> new file mode 100644
> index 0000000..0f9af21
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen-juno.d
> +++ tsi
> @@ -0,0 +1,11 @@
> +/*
> + * Disable IOMMU on juno board when Xen is used  */
> +
> +/ {
> +
> +	/* turn off iommu */
> +	iommu@2b600000 {
> +		status = "disabled";
> +	};
> +};
> diff --git a/meta-arm-autonomy/recipes-extended/xen-
> devicetree/files/xen.dtsi.in b/meta-arm-autonomy/recipes-extended/xen-
> devicetree/files/xen.dtsi.in
> new file mode 100644
> index 0000000..42d12fa
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen.dtsi.i
> +++ n
> @@ -0,0 +1,17 @@
> +/ {
> +    chosen {
> +        xen,dom0-bootargs = "###XEN_DOM0_BOOTARGS###";
> +        xen,xen-bootargs = "###XEN_XEN_BOOTARGS###";
> +
> +        modules {
> +            #size-cells = <0x00000001>;
> +            #address-cells = <0x00000001>;
> +
> +            module@0 {
> +                reg = <###XEN_DOM0_ADDR### ###XEN_DOM0_SIZE###>;
> +                compatible = "multiboot,module";
> +            };
> +        };
> +    };
> +};
> +
> diff --git a/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-
> devicetree.bb b/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-
> devicetree.bb
> new file mode 100644
> index 0000000..0bb9def
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.b
> +++ b
> @@ -0,0 +1,68 @@
> +# This recipe can be used to modify one or several DTBS to add #
> +entries required to declare and boot Linux as Dom0 from Xen
> +
> +SRC_URI = "file://xen.dtsi.in"
> +
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "\
> +
> file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f
> 302 \
> +    "
> +
> +S = "${WORKDIR}"
> +
> +DESCRIPTION = "Add entries in DTB for Xen and Dom0"
> +
> +# Please refer to documentation/xen-devicetree.md for documentation on
> +those # parameters XEN_DEVICETREE_DEPEND ?= "virtual/kernel:do_deploy"
> +XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
> +XEN_DEVICETREE_XEN_BOOTARGS ?= "noreboot
> dom0_mem=${XEN_DEVICETREE_DOM0_MEM}"
> +XEN_DEVICETREE_DOM0_MEM ?= "1024M"
> +XEN_DEVICETREE_DOM0_BOOTARGS ?= "console=hvc0 earlycon=xen"
> +XEN_DEVICETREE_DOM0_ADDR ?= "0x80080000"
> +XEN_DEVICETREE_DOM0_SIZE ?= "0x01000000"
> +XEN_DEVICETREE_DTSI_MERGE ?= "xen.dtsi"
> +
> +# Our package does not generate any package for the rootfs but
> +contributes to # deploy inherit nopackages deploy
> +
> +DEPENDS += "dtc-native"
> +
> +do_compile() {
> +    cat ${WORKDIR}/xen.dtsi.in \
> +        | sed -e
> "s,###XEN_DOM0_BOOTARGS###,${XEN_DEVICETREE_DOM0_BOOTARGS}," \
> +        | sed -e
> "s,###XEN_XEN_BOOTARGS###,${XEN_DEVICETREE_XEN_BOOTARGS}," \
> +        | sed -e
> "s,###XEN_DOM0_ADDR###,${XEN_DEVICETREE_DOM0_ADDR}," \
> +        | sed -e "s,###XEN_DOM0_SIZE###,${XEN_DEVICETREE_DOM0_SIZE}," \
> +        > ${WORKDIR}/xen.dtsi
> +
> +    # Generate final dtbs
> +    for dtbf in ${XEN_DEVICETREE_DTBS}; do
> +        rdtb=`basename $dtbf`
> +        if [ ! -f ${DEPLOY_DIR_IMAGE}/$rdtb ]; then
> +            die "Wrong file in XEN_DEVICETREE_DTBS:
> ${DEPLOY_DIR_IMAGE}/$rdtb does not exist"
> +        fi
> +        dtc -I dtb -O dts -o ${WORKDIR}/dom0-linux.dts
> + ${DEPLOY_DIR_IMAGE}/$rdtb
> +
> +        # Add external includes
> +        for inc in ${XEN_DEVICETREE_DTSI_MERGE}; do
> +            echo "/include/ \"$inc\"" >> ${WORKDIR}/dom0-linux.dts
> +        done
> +
> +        rdtbnoextn=`basename $dtbf ".dtb"`
> +        dtc -I dts -O dtb \
> +            -o ${WORKDIR}/${rdtbnoextn}-xen.dtb ${WORKDIR}/dom0-linux.dts
> +    done
> +}
> +do_compile[depends] += "${XEN_DEVICETREE_DEPEND}"
> +
> +do_deploy() {
> +    # install generated dtbs
> +    for dtbf in ${XEN_DEVICETREE_DTBS}; do
> +        rdtbnoextn=`basename $dtbf ".dtb"`
> +        install -m 644 ${rdtbnoextn}-xen.dtb ${DEPLOYDIR}/.
> +    done
> +}
> +
> +addtask deploy before do_build after do_compile
> diff --git a/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-
> devicetree.bbappend b/meta-arm-autonomy/recipes-extended/xen-
> devicetree/xen-devicetree.bbappend
> new file mode 100644
> index 0000000..191cb13
> --- /dev/null
> +++ b/meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.b
> +++ bappend
> @@ -0,0 +1,18 @@
> +# Platform dependent parameters
> +
> +FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> +
> +# Add a dtb snippet to turn off iommu in dom0 on Juno board
> +SRC_URI_append_juno = " file://xen-juno.dtsi"
> +XEN_DEVICETREE_DTSI_MERGE_append_juno = " xen-juno.dtsi"
> +
> +# Board specific configs
> +XEN_DEVICETREE_DOM0_BOOTARGS_append_juno = " root=/dev/sda1
> rootwait"
> +XEN_DEVICETREE_XEN_BOOTARGS_append_juno = " console=dtuart
> dtuart=serial0 bootscrub=0 iommu=no"
> +
> +XEN_DEVICETREE_DOM0_BOOTARGS_append_fvp-base = " root=/dev/vda2"
> +XEN_DEVICETREE_XEN_BOOTARGS_append_fvp-base = " console=dtuart
> dtuart=serial0 bootscrub=0"
> +
> +XEN_DEVICETREE_DOM0_BOOTARGS_append_foundation-armv8 = "
> root=/dev/vda2"
> +XEN_DEVICETREE_XEN_BOOTARGS_append_foundation-armv8 = "
> console=dtuart dtuart=serial0 bootscrub=0"
> +
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [meta-arm] [PATCH 0/7] Create meta-arm-autonomy Layer
  2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
                   ` (6 preceding siblings ...)
  2020-03-27 10:50 ` [PATCH 7/7] arm-autonomy: Create xen-devicetree recipe Bertrand Marquis
@ 2020-04-08  3:34 ` Jon Mason
  7 siblings, 0 replies; 16+ messages in thread
From: Jon Mason @ 2020-04-08  3:34 UTC (permalink / raw)
  To: meta-arm

On Fri, Mar 27, 2020 at 10:50:03AM +0000, Bertrand Marquis wrote:
> This patch serie is introducing meta-arm-autonomy layer.
> This layer can be used to create Xen based virtualized system suitable
> for embedded systems.
> It is providing a BSP arm64-autonomy-guest and 2 DISTRO_FEATURES
> "arm-autonomy-host" and "arm-autonomy-guest".

Pull in to the master branch

Thanks,
Jon

> 
> Bertrand Marquis (7):
>   arm-autonomy: Create meta-arm-autonomy layer
>   arm-autonomy: Create arm-autonomy-host feature
>   arm-autonomy: Create arm-autonomy-host image
>   arm-autonomy: Create arm-autonomy-guest feature
>   arm-autonomy: Create arm64-autonomy-guest machine
>   arm-autonomy: Create quick start documentation
>   arm-autonomy: Create xen-devicetree recipe
> 
>  README.md                                     |   3 +
>  meta-arm-autonomy/README.md                   |  79 ++++++++++++
>  .../classes/arm-autonomy-features.bbclass     |   5 +
>  .../distro/include/arm-autonomy-guest.inc     |   5 +
>  .../conf/distro/include/arm-autonomy-host.inc |   5 +
>  meta-arm-autonomy/conf/layer.conf             |  31 +++++
>  .../conf/machine/arm64-autonomy-guest.conf    |  17 +++
>  .../documentation/arm-autonomy-quickstart.md  | 116 ++++++++++++++++++
>  .../documentation/xen-devicetree.md           | 104 ++++++++++++++++
>  .../images/arm-autonomy-host-image-minimal.bb |  30 +++++
>  .../sysvinit/sysvinit-inittab_2.%.bbappend    |  16 +++
>  .../xen-devicetree/files/xen-juno.dtsi        |  11 ++
>  .../xen-devicetree/files/xen.dtsi.in          |  17 +++
>  .../xen-devicetree/xen-devicetree.bb          |  68 ++++++++++
>  .../xen-devicetree/xen-devicetree.bbappend    |  18 +++
>  .../arm64-autonomy-guest-standard.scc         |   5 +
>  .../bsp/arm-autonomy/arm64-autonomy-guest.cfg |   2 +
>  .../bsp/arm-autonomy/arm64-autonomy-guest.scc |   6 +
>  .../features/arm-autonomy/xen-guest.cfg       |  54 ++++++++
>  .../features/arm-autonomy/xen-guest.scc       |   4 +
>  .../features/arm-autonomy/xen-host.cfg        |  35 ++++++
>  .../features/arm-autonomy/xen-host.scc        |   4 +
>  .../recipes-kernel/linux/linux-%.bbappend     |   3 +
>  .../linux/linux-arm-autonomy.inc              |  21 ++++
>  24 files changed, 659 insertions(+)
>  create mode 100644 meta-arm-autonomy/README.md
>  create mode 100644 meta-arm-autonomy/classes/arm-autonomy-features.bbclass
>  create mode 100644 meta-arm-autonomy/conf/distro/include/arm-autonomy-guest.inc
>  create mode 100644 meta-arm-autonomy/conf/distro/include/arm-autonomy-host.inc
>  create mode 100644 meta-arm-autonomy/conf/layer.conf
>  create mode 100644 meta-arm-autonomy/conf/machine/arm64-autonomy-guest.conf
>  create mode 100644 meta-arm-autonomy/documentation/arm-autonomy-quickstart.md
>  create mode 100644 meta-arm-autonomy/documentation/xen-devicetree.md
>  create mode 100644 meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb
>  create mode 100644 meta-arm-autonomy/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend
>  create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen-juno.dtsi
>  create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/files/xen.dtsi.in
>  create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bb
>  create mode 100644 meta-arm-autonomy/recipes-extended/xen-devicetree/xen-devicetree.bbappend
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest-standard.scc
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.cfg
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/bsp/arm-autonomy/arm64-autonomy-guest.scc
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.cfg
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-guest.scc
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.scc
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/linux-%.bbappend
>  create mode 100644 meta-arm-autonomy/recipes-kernel/linux/linux-arm-autonomy.inc
> 
> -- 
> 2.17.1
> 

> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-04-08  3:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 10:50 [PATCH 0/7] Create meta-arm-autonomy Layer Bertrand Marquis
2020-03-27 10:50 ` [PATCH 1/7] arm-autonomy: Create meta-arm-autonomy layer Bertrand Marquis
2020-03-27 15:20   ` [meta-arm] " Diego Sueiro
2020-03-27 10:50 ` [PATCH 2/7] arm-autonomy: Create arm-autonomy-host feature Bertrand Marquis
2020-03-27 15:21   ` [meta-arm] " Diego Sueiro
2020-03-27 10:50 ` [PATCH 3/7] arm-autonomy: Create arm-autonomy-host image Bertrand Marquis
2020-03-27 15:21   ` [meta-arm] " Diego Sueiro
2020-03-27 10:50 ` [PATCH 4/7] arm-autonomy: Create arm-autonomy-guest feature Bertrand Marquis
2020-03-27 15:22   ` [meta-arm] " Diego Sueiro
2020-03-27 10:50 ` [PATCH 5/7] arm-autonomy: Create arm64-autonomy-guest machine Bertrand Marquis
2020-03-27 15:22   ` [meta-arm] " Diego Sueiro
2020-03-27 10:50 ` [PATCH 6/7] arm-autonomy: Create quick start documentation Bertrand Marquis
2020-03-27 15:23   ` [meta-arm] " Diego Sueiro
2020-03-27 10:50 ` [PATCH 7/7] arm-autonomy: Create xen-devicetree recipe Bertrand Marquis
2020-03-27 15:24   ` [meta-arm] " Diego Sueiro
2020-04-08  3:34 ` [meta-arm] [PATCH 0/7] Create meta-arm-autonomy Layer Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.