1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-07-18 16:37:08 +00:00

Compare commits

..

123 Commits

Author SHA1 Message Date
Denys Dmytriyenko fa9abd9a6e trusted-firmware-a: re-enable generation of packages
There is no need to inherit nopackages. Even when the output binaries are being
consumed from deploy or sysroot, and the main binary package is not meant to be
installed in the rootfs, package generation is still useful for SDK use cases
and as a way to distribute sources (e.g. src.rpm/SRPM) in Distros.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-19 13:40:10 -04:00
Denys Dmytriyenko 726e0b9618 trusted-firmware-a: provide symlinks for canonical names
Some platforms expect canonical names, like bl31.bin, instead of bl31-<plat>.bin
Provide symlinks for those as well.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-15 08:45:09 -04:00
Denys Dmytriyenko 01825739a4 trusted-firmware-a: install/deploy multiple variants of the target
Installing and deploying .bin and .elf shouldn't be mutually exclusive.
There are scenarios where both can be useful - .bin for booting and .elf
for debugging.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-15 08:45:09 -04:00
Denys Dmytriyenko 5c1a30e532 trusted-firmware-a: add support for SPD (Secure Payload Dispatcher) services
Some platforms use Secure Payload Dispatcher - allow selecting one with TFA_SPD.

Official SPD description:
/*******************************************************************************
 * This is the Secure Payload Dispatcher (SPD). The dispatcher is meant to be a
 * plug-in component to the Secure Monitor, registered as a runtime service. The
 * SPD is expected to be a functional extension of the Secure Payload (SP) that
 * executes in Secure EL1. The Secure Monitor will delegate all SMCs targeting
 * the Trusted OS/Applications range to the dispatcher. The SPD will either
 * handle the request locally or delegate it to the Secure Payload. It is also
 * responsible for initialising and maintaining communication with the SP.
 ******************************************************************************/

Clean other EXTRA_OEMAKE to remove leading space not needed with +=

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-15 08:45:09 -04:00
Denys Dmytriyenko 7b9f1155e1 trusted-firmware-a: support multi-board platforms
Some platforms can have multiple board configurations, passed as TARGET_BOARD=""
that also becomes an extra directory level in the build output hierarchy.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-15 08:44:55 -04:00
Joshua Watt abb036ee56 trusted-firmware-a: Install .elf file from subdirectory
The ELF files produced are in a subdirectory named by the build target
(e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-13 16:34:03 -04:00
Joshua Watt a4f15634db trusted-firmware-a: Build out of tree
Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates
the need to set the TFA_BUILD_DIR.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-13 16:29:38 -04:00
Bertrand Marquis c7bd7651c4 arm-bsp: Switch to gem5 20.0 staging version
Switch gem5 to use current HEAD version of the staging 20.0 branch to
solve compilation issues related to the move to python3

Create a link named python to python3 as some of gem5 python scripts
are looking for python and are compatible with both python2 and
python3.

Change-Id: I59256a8a6783a9614f5a2d5d760fada5bd6d0337
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-12 15:42:50 -04:00
Diego Sueiro 43f90f06ba arm-bsp: n1sdp: linux-linaro-arm: Disable CONFIG_EXTRA_FIRMWARE
We don't want to build firmware blobs into the kernel binary. Also,
add linux-firmware-rtl8168 package to MACHINE_ESSENTIAL_EXTRA_RDEPENDS
to have it installed in any image by default.

Change-Id: If8a88a4ccbc6d474438a2555498989695a4b19dc
Issue-Id: SCM-954
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-12 15:42:44 -04:00
Diego Sueiro f3b1ce69f3 arm-bsp: linux-linaro-arm: Set COMPATIBLE_MACHINE to "invalid"
To keep consistency with trusted-firmware-a and optee recipes we should
use softer assignment to "invalid" for COMPATIBLE_MACHINE.

Change-Id: I57d0b220d92c4546e0539f95a54d391935f995fc
Issue-Id: SCM-954
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-12 15:42:37 -04:00
Jon Mason 8ff8beb6e8 Add recipes for TF-A versions 2.2 and 2.3
Add basic recipes for TF-A versions 2.2 and 2.3.  Also, rearrange fields
in the various TF-A recipes to make them uniform and move the
do_compile_prepend to the inc file.

Change-Id: I85e4ac7bdc44ed85449e40fd2c94d73bf3e7d9e8
Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
2020-05-12 15:42:20 -04:00
Kamil Dziezyk 4447316896 arm-autonomy: xenguest-mgr: Add support for compressed partition images
xenguest-manager now can create guest partition
using compressed images like *.img.gz or *.img.bz2.

Change-Id: Ifaec0b7c301b2b316ebccdd0ca85083262f2714c
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-11 15:09:02 -04:00
Diego Sueiro f5075e9cd9 arm-autonomy: Add support for N1SDP
This patch includes the following changes for n1sdp:

* Add the Xen defconfig and early printk setting;
* Setting the proper Xen device-tree boot args;
* Remove some entries in xen devicetree (PM and SMMU) to make is
compatible with XEN and extra registers settings required for PCI
quirks to communicate with SCP.

Change-Id: Ic968728115787de8d9bfcaaf883fd8573ff6c9c9
Issue-Id: SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-11 15:08:57 -04:00
Diego Sueiro 898003dbe9 arm-autonomy: Add CONFIG_MD and CONFIG_BLK_DEV_DM in xen-host.cfg
The CONFIG_MD (Multiple Devices) and CONFIG_BLK_DEV_DM (Device Mapper)
kernel configs are needed for LVM2, so add them in xen-host.cfg to be
included in the kernel configuration for DOM0.

Change-Id: Ib5f4f4d767751615ee1239e95da7a7d56cbbc2dc
Issue-Id: SCM-996
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-11 15:08:36 -04:00
Diego Sueiro 8cf7f8eb31 arm-bsp: n1sdp: Add Linux kernel device-tree support
Update both machine configuration and kernel recipe to
support Linux Kernel device-tree compilation.

Change-Id: I01fa654bd88e0d2b7a4bfcc7cb60222c120a0473
Issue-Id: SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-09 08:11:41 -04:00
Diego Sueiro 86a01f1ee4 arm-bsp: linux-linaro-arm-5.4: Fix kernel menuconfig task
When calling `bitbake virtual/kernel -c menuconfig` it fails if the
ncurses-dev package is not installed on the host machine.

This patch makes usage of the ncurses library built by yocto if it
is present.

Change-Id: I261578f2934b225956e77ca4038a2df5603cc1b1
Issue-Id: SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-09 08:11:41 -04:00
Khasim Syed Mohammed 76748af24b arm-bsp: Introduce ARM N1SDP platform
- Add support for N1SDP platform.
- Build Linux 5.4 from linaro tree for N1SDP platform.

Change-Id: I12e5169da9c2bab946eb7e49fe6cc7bbb07d182b
Issue-Id: PLATFORMS-3134
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-09 08:11:32 -04:00
Khasim Syed Mohammed 6e9b0b295f arm-bsp: Add linaro-arm-linux 5.4 kernel support
- Add support to fetch and build linaro-arm linux version 5.4 for N1SDP platform
- Add addtional N1SDP specific changes as patches
- Include intree default config

Change-Id: I3b4cf4b1de509beaa3862e1cad37ec2d88b7054d
Issue-Id: PLATFORMS-3134
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-09 08:11:22 -04:00
Diego Sueiro 6d4c3484b3 arm-autonomy: arm-autonomy-host-image-minimal: Abort on copy fail
If the guest image copy fails we need to abort the do_image execution.

Change-Id: I3785a0828e271ed27eb7f9212804b5b9b39f79ac
Issue-Id: SCM-990
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Bertrand Marquis b5381e5a7b arm-autonomy: Fix missing xen binary in deploy image
Change Xen package to be machine specific.
This is solving issues encountered when building 2 projects with the
same xen configuration but different machines.
In that case one of the project did not have a xen binary in the deploy
directory.

Change-Id: I2575d91b57455ab690eec9c51e07415673242c06
Issue-Id: SCM-815
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Diego Sueiro fba2b7a05e arm-autonomy: arm-autonomy-host-image-minimal: Remove kernel-modules
To reduce final image size, remove the kernel-modules package from
IMAGE_INSTALL.

Change-Id: I61d7d2ea87c3007af1c8f7b4917e9692a1f9e001
Issue-Id: SCM-813
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Diego Sueiro 21b0af0319 arm-autonomy qemu: Don't build with audio support when Xen is present
When xen is in DISTRO_FEATURES no audio support is needed. This will
helps reducing the final image size.

Change-Id: I50d83cfe007c3f30a8303dcad66abb188559713c
Issue-Id: SCM-813
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Diego Sueiro e6029ccf12 arm-autonomy: Don't include kernels in arm-autonomy-host images
To reduce arm-autonomy-host images size we don't include the Kernel
image.

Change-Id: Ibcadf873fc71f3793b2824e5169a777ee8a0ece6
Issue-Id: SCM-813
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Diego Sueiro 0bd69e03df arm-autonomy: qemu: Split qemu into qemu and qemu-xen packages
When xen is in DISTRO_FEATURES we split the qemu package and install
only the qemu-xen with /usr/bin/qemu-system-i386 binary in the image
to reduce its size.

Change-Id: I460e959eb87a180b1baa5a11dbbe7df100d5e6a6
Issue-Id: SCM-813
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Diego Sueiro 09ed7fc673 arm-autonomy: Move meta-arm-bsp machines settings to BBFILES_DYNAMIC
All meta-arm-bsp machines specific settings should live at
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/ and only be included if
meta-arm-bsp layer is present.

Change-Id: Ice8a301db85b5186384d602d9e3bedb909183320
Issue-Id: SCM-984
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Bertrand Marquis 2ed1b36c56 arm-autonomy: rework initramfs support in xenguest FSTYPE
Rework the initramfs support in xenguest FSTYPE to be compatible with
Dunfell and remove an error with non existing recipeinfo during build.
- remove initramfs support in FSTYPE and do_deploy function
- create a KERNEL CLASS to create a xenguest image containing the kernel
bundle with initramfs during kernel compilation (only done if FSTYPE
contain xenguest and initramfs bundle is activated)
- add kernel-xenguest to KERNEL_CLASSES when autonomy-guest
DISTRO_FEATURE is activated
- remove unused parameters from xenguest-image class

Change-Id: If163aa74a2bbbd4f22651abefe8d2ab4677e82b0
Issue-Id: SCM-990
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Diego Sueiro ad58d4ea81 arm-autonomy: firmware-image-juno: Add xen-devicetree dependency
The do_deploy task depends on xen-devicetree:do_deploy in order to
include the generated xen dtbs in the firmware image.
To avoid dependency loop between firmware-image-juno:do_install,
xen:do_deploy and xen-devicetree:do_deploy when
INITRAMFS_IMAGE_BUNDLE = "1", we need to handle the xen and
xen-devicetree binaries copying in the do_deploy task.

Also Use OVERRIDES to minimize the usage of
"@bb.utils.contains('DISTRO_FEATURES', 'xen', ..."

Change-Id: I8da476435de73445fb6d895ec418d85861b8c46c
Issue-Id: SCM-990
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:29 -04:00
Vineeth Raveendran 6ebe1db92c arm-autonomy: Move to dunfell
- make xenguest-manage rdepend on xen-tools to adapt to recipe
modifications in meta-virtualization
- add xen to IMAGE_EXTRADEPENDS to build xen binary when build
autonomy-host-image
- switch arm64-autonomy-machine to use Linux 5.4
- remove trace patch for xen as meta-virtualization is now using a xen
release which has this fixed
- rework xen bbappends to adapt to changes done in xen recipes

Change-Id: I439bde0df2c0a16f529436b65f1a96af5a2981af
Issue-Id: SCM-833
Signed-off-by: Vineeth Raveendran <vineeth.raveendran@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:22:22 -04:00
Vineeth Raveendran 4338e38b8a arm-bsp: add dunfell support for fvps, juno and gem5
Make following machines compatible with dunfell:
- foundation-armv8
- fvp-base
- juno
- gem5

Major changes include moving kernel version to 5.4 and U-BOOT version
to v2020

Change-Id: Ia59ac874de4e4c4ea02c7a4f976e39a9b6996f75
Issue-Id: SCM-833
Signed-off-by: Vineeth Raveendran <vineeth.raveendran@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:21:20 -04:00
Diego Sueiro 03139a9324 arm-bsp: trusted-firmware-a-fvp: Fix dependency loop
When building with INITRAMFS_IMAGE_BUNDLE set, there is a dependency
loop between trusted-firmware-a:do_install and virtual/kernel:do_deploy
since the trusted-firmware-a:do_install depends on the kernel dtb to be
passed to the fiptool to generate the fip.bin binary.

The kernel dtb is not mandatory to generate the fip.bin if we compile
the "dtbs" and "fip" targets which will include the in-tree device-tree
used for the --hw-config (HW_CONFIG property) dynamic configuration
during the cold boot.

Change-Id: I7147cc1eeecb7c4b66f198562163438b7b663eba
Issue-Id: SCM-990
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:19:27 -04:00
Bertrand Marquis 56c245133b arm-bsp: Update gem5 and switch to python3
This patch includes several fixes for gem5-aarch64
- Switch to a new version of gem5 supporting python3 and use python3 to
 build it.
 We use a version in develop branch of gem5 for now and we will have to
 switch to release 20 once it is released mid of may.
- Remove scons python2 recipes which were used before by gem5 as a
 workaround until gem5 was updated to support python3
- make gem5-aarch64-bootloader only compatible with gem5-aarch64
- remove unnecessary FILESEXTRAPATHS_prepend in gem5-aarch64-bootloader

Change-Id: Iad9af4f2e6073ef63a51c2c33a05ed3855dd8f08
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-08 10:19:23 -04:00
Denys Dmytriyenko 0ff012ecb2 external-arm-toolchain: remove unused /usr/share/info/dir
Fixes following QA issue:

WARNING: external-arm-toolchain-2019.12-r0 do_package_qa: QA Issue: The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir]

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 12:03:43 -04:00
Denys Dmytriyenko 33cc242bbc external-arm-toolchain: remove empty libexecdir
Fixes following QA issue (normally a warning, but Poky and other distros
may treat it as fatal):

ERROR: external-arm-toolchain-2019.12-r0 do_package: QA Issue: external-arm-toolchain: Files/directories were installed but not shipped in any package:
  /usr/libexec
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
external-arm-toolchain: 1 installed and not shipped files. [installed-vs-shipped]
ERROR: external-arm-toolchain-2019.12-r0 do_package: Fatal QA errors found, failing task.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 12:03:43 -04:00
Denys Dmytriyenko c10a9a2d3b gcc-arm: remove extra binary aliases when TCMODE=external-arm
When TCMODE=external-arm, TARGET_SYS!=EAT_TARGET_SYS and gcc installs extra
binary aliases, which could lead to QA errors:

ERROR: gcc-arm-9.2-r2019.12 do_package: QA Issue: gcc: Files/directories were installed but not shipped in any package:
  /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-g++
  /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-gcc
  /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-gcc-ar
  /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-gcc-ranlib
  /usr/bin/arm-poky-linux-gnueabi-arm-none-linux-gnueabihf-gcc-nm
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
gcc: 5 installed and not shipped files. [installed-vs-shipped]
ERROR: gcc-arm-9.2-r2019.12 do_package: Fatal QA errors found, failing task.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 12:03:43 -04:00
Denys Dmytriyenko 198f96ed20 gcc-arm: add re-staging of unwind.h from external-arm-toolchain
gcc-target.inc expects unwind.h to come from and be staged by libgcc.
When TCMODE="external-arm" libgcc is provided by external-arm-toolchain.bb
And while it stages the necessary unwind.h file, it ends up in slightly
different location, so re-stage it. More details are in the comments.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 12:03:43 -04:00
Diego Sueiro 13535294f6 Have meta-arm-bsp specific bbappends as BBFILES_DYNAMIC
The boot-wrapper-aarch64_%.bbappend and firmware-image-juno.bbappend
should be only considered when meta-arm-bsp layer is present.

Change-Id: Id66a989820675a281946a26b9afec6d5b3d29bca
Issue-Id: SCM-984
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 11:33:49 -04:00
Diego Sueiro 3fc6b1e702 firmware-image-juno: Remove unnecessary machine override
Since firmware-image-juno main recipe is only compatible with juno
MACHINE, the _juno machine override are not needed.

Change-Id: If1b880ee2b6b854f83087005f7ae89f0d77aef7d
Issue-Id: SCM-889
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 11:33:44 -04:00
Diego Sueiro fc1b6dc835 firmware-image-juno: Fix dependency loop
Kernel binaries copying have to be performed in the do_deploy task to
avoid dependency loop between firmware-image-juno do_install and
virtual/kernel do_deploy when INITRAMFS_IMAGE_BUNDLE is set.

Also, copy the kernel image bundled with initramfs to the firmware
image when INITRAMFS_IMAGE_BUNDLE is set.

Change-Id: I66083d294ab4eb77c643ec33cc1333000373125b
Issue-Id: SCM-987
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 11:33:40 -04:00
Diego Sueiro 119d84b39e xenguest-manager: Wait longer for /dev/xvdaX creation
Implement a wait block of 20s with exit condition for checking
/dev/xvdaX creation.
For example, in cases where the rootfs is mounted via NFS, a longer
time is needed until the xvda device appears in the system.

Change-Id: I44cbcf2a43aeb476eae92d5b6d2cfd683e4bdf21
Issue-Id: SCM-929
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 11:33:35 -04:00
Diego Sueiro 23f2f3d180 documentation: Update arm-autonomy-quickstart.md
Suggest the usage of `bitbake-layers add-layer` command to add all
dependant layers.

Change-Id: I1f40f6218b2edc5267e04723c592c16a434f2e82
Issue-Id: SCM-986
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 11:33:30 -04:00
Diego Sueiro d42632b6b7 optee: Use softer assignment to "invalid" for COMPATIBLE_MACHINE
To keep consistency with trusted-firmware-a recipe we should use
softer assignment to "invalid" for COMPATIBLE_MACHINE.

Change-Id: Ib05afcd62b6b2104188b90bad4d952eb055ae443
Issue-Id: SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-06 11:32:54 -04:00
Denys Dmytriyenko d68e63b965 external-arm-toolchain: drop unnecessary RDEPENDS on bash
The 2 scripts that still have /bin/bash shebang are ldd and tzselect. But
it seems upstream had fixed all bashisms in those scripts in recent years
and OE-Core versions of those scripts use /bin/sh already.

Dropping these unnecessary RDEPENDS on bash actually significantly prunes
dependency tree for simple BSP builds like u-boot, etc.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-01 10:01:11 -04:00
Denys Dmytriyenko efd0773165 external-arm-toolchain: drop unnecessary binutils-cross-${TARGET_ARCH} in PROVIDES
There's no need to directly provide binutils-cross-${TARGET_ARCH}, as the
PROVIDES list already contains virtual/${TARGET_PREFIX}binutils and correct
PREFERRED_PROVIDER is set in the corresponding tcmode-external-arm.inc file:

PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-arm-toolchain"

Similar to the compiler:

PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-arm-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-arm-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-arm-toolchain"

And similar to glibc:

PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-arm-toolchain"
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-arm-toolchain"

There shouldn't be any direct dependency on binutils-cross-${TARGET_ARCH}. And
if there is, it needs to be fixed to depend on virtual/${TARGET_PREFIX}binutils

During 8.x upgrade there was an attempt to clean it up:

https://git.linaro.org/openembedded/meta-linaro.git/commit/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb?id=a8ce3dc47f3be9f98abc6ac98a849f918386cf9f

But unfortunately, it got re-added back w/o reasoning:

https://git.linaro.org/openembedded/meta-linaro.git/commit/?id=bb04bc8c67fd032fe04c47b2163ea5fa6b2ffa86

Also, while at it, fix indentation for glibc-mtrace in PROVIDES list.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-01 10:00:08 -04:00
Denys Dmytriyenko 8aaba503d3 tcmode-external-arm: drop unnecessary CPPFLAGS and LDFLAGS adjustments
These were there from the very beginning and they were used as crutches to
prop up the build by pointing directly to the external toolchain location,
in case early versions of external-arm-toolchain missed staging/packaging
something from there.

First of all, it is unnecessary to adjust CPPFLAGS and LDFLAGS in this way,
as external-arm-toolchain is supposed to stage everything needed from the
toolchain in internal sysroot.

And second, these settings can be harmful and conflict with component's own
CPPFLAGS/LDFLAGS. For example, OpenCV 4.1 fails to link internal libraries
because of incorrect -Wl,-rpath-link passed down the build.

After dropping these, I was able to verify that everything still builds,
including BSP, Wayland/Weston, Qt5, gstreamer, OpenCV, etc for Aarch64 and
Armv7a platforms.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-01 09:59:25 -04:00
Diego Sueiro d9fbf9da4e meta-arm-bsp: Remove fvp-base and foundation-armv8 simulation tools
Since the Fixed Virtual Platforms simulation tools are not publicly
available, remove them from meta-arm-bsp layer.

Change-Id: Ifece50bfd494241499540030b6ac5968abd8ad1f
Issue-Id: SCM-951
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-05-01 09:34:23 -04:00
Bertrand Marquis 987cb439ea arm-autonomy: Fix xenguest volume check on boot
Fix xenguest-manager to only check the device configured to be used for
LVM volumes for guests when a guest is created which needs it.

This prevent the manager doing errors during boot when the volume does
not exist even if it is not used by any guest.

Change-Id: Ibc285887836ea40595634412dcfa7ee9039dc220
Issue-Id: SCM-956
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-23 14:38:36 -04:00
Bertrand Marquis 9b9ed8bbbb arm-autonomy: Fix circle dependency in xen-dtb
Solve circle dependency in xen-devicetree when initramfs is activated as
compile depends on kernel:do_deploy and xen-devicetree is needed to
create the arm-autonomy-host-image-minimal.
Move all actions in do_deploy so that only do_deploy depends on the
kernel do_deploy.

Change-Id: I011df8f225550afa71b18a88e0ebe01debca0bed
Issue-Id: SCM-949
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-23 14:38:24 -04:00
Diego Sueiro e921026326 arm-autonomy: Append firmware-image-juno recipe to collect Xen binaries
For juno, the Xen binary and dtb are now collected by the
firmware-image-juno recipe instead of the trusted-firmware-a.

Change-Id: Iaf4e4821e80c09910771c57ba3dbd481626187d5
Issue-Id: SCM-754
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-By: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-23 14:29:24 -04:00
Diego Sueiro d7b179b934 meta-arm-bsp: Introduce firmware-image-juno recipe
Add the firmware-image-juno recipe to produce the Firmware Image for
Juno to be copied to the Configuration microSD card instead of the
trusted-firmware-a recipe.

Include the firmware-image-juno recipe in the EXTRA_IMAGEDEPENDS
only for juno MACHINE.

Change-Id: I316c70f22d57a3d85cc40386f1961ecd23edc865
Issue-Id: SCM-754 SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-By: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-23 14:29:19 -04:00
Diego Sueiro 4b84b124cc meta-arm-bsp: Introduce the scp-firmware-juno recipe
The scp-firmware-juno recipe is used to fetch the System Control
Processor (SCP) firmware in binary form for Juno.

Also update the trusted-firmware-a for juno to make usage of
the the SCP firmware binary from scp-firmware-juno recipe.

Change-Id: I2a7e517e06c3bbac6b0ffa3f28e0848d8f30589f
Issue-Id: SCM-754 SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-By: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-23 14:29:14 -04:00
Diego Sueiro bd65efd542 trusted-firmware-a: Deliver binaries artefacts to sysroot/firmware
Make usage of the do_install task to deliver binaries artefacts to
the `sysroot/firmware` path, making it easier for other recipes that
depends on it to make usage of those binaries instead of copying them
from the DEPLOY_DIR_IMAGE.

This recipe still deploys its artefacts to DEPLOY_DIR_IMAGE.

Change-Id: I97b97f90b23746557e981f8de10159c5f475becd
Issue-Id: SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-By: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-23 14:29:08 -04:00
Diego Sueiro 5368b21fea meta-arm-bsp:trusted-firmware-a: Remove custom do_clean task
The custom do_clean task is not necessary and is misbehaving by not
removing the output files from other tasks.

Change-Id: I5ff837dece88030f24a0dd20c75a738b7b277d61
Issue-Id: SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-By: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-23 14:28:19 -04:00
Denys Dmytriyenko 74b76e3281 external-arm-toolchain: split and strip packages normally
In the past, some Linaro toolchain versions were shipped with already stripped
libraries, causing QA issues, hence splitting and stripping was disabled.

This is no longer the case and it is better to split and strip binaries and
libraries normally, generating smaller images, while retaining debug symbols
in corresponding -dbg packages.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-13 17:27:18 -04:00
Denys Dmytriyenko b1f540ffe2 optee-os: unbreak parsing when arch is not armv7a nor aarch64
When meta-arm is in the layer stack, parsing will break for unsupported archs,
like armv5, armv6, etc. Unbreak parsing by defining null default OPTEE_ARCH.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-13 17:27:18 -04:00
Khem Raj 327cd94f49 optee-os: Mark recipes dormant by default
All arm SOCs may not support optee and there are non-arm machines too
this makes this recipe fit into mutli-BSP environments, platforms which
support optee should be specifically called out via COMPATIBLE_MACHINE,
for general case it remains 'null'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-13 17:27:18 -04:00
Denys Dmytriyenko c5643e7cff layer.conf: meta-arm-toolchain should depend on core layer
While core layer may be implied, it's still nice to depend on it explicitly
for building gcc and other toolchain components in this layer.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-13 17:27:18 -04:00
Sumit Garg ea741c16cf meta-arm-toolchain: use GCC 9.2 source tar ball insted of svn
GCC 9.2 source fetch from svn is quite slow as compared to source tar
ball. So switch to fetch GCC 9.2 source tar ball instead.

Reported-by: Riku Voipio <riku.voipio@linaro.org>
Suggested-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-10 10:21:29 -04:00
Diego Sueiro 7857cb4b12 arm-autonomy:init-ifupdown: Fix interfaces.d sub-dir scan
Add a missing line breake ("\") to do_install_append to effectually
append the "/etc/network/interfaces.d/" line into
"/etc/network/interfaces" file.

Change-Id: I1cf4e134639d1f63ada7d068cc2822d1ac4218ea
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:57:15 -04:00
Diego Sueiro 132db950a0 arm-autonomy: Add Xen specifics from meta-arm-bsp
Variables, settings and operations specific to Xen should be located
at meta-arm-autonomy.

Change-Id: Ida86119e9d196ce8a498b53890b16fefaa3d8d8b
Issue-Id: SCM-769
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:55:21 -04:00
Diego Sueiro 85eeeea87a meta-arm-bsp: Remove Xen specifics
Remove all variables, settings and operations specific to Xen from
meta-arm-bsp.

These implementations will be added later in another separate layer.

Change-Id: I971a6898f985f5ec7264da5ad5e4b6436067e3dd
Issue-Id: SCM-769
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:55:14 -04:00
Denys Dmytriyenko ed0e683ee5 optee-examples: cleanup
* Rename with _git suffix to match other optee recipes
* Set PV
* Add DESCRIPTION
* Depend on Python3 version of PyCryptodomex instead of Python2 version of PyCrypto

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:32:44 -04:00
Denys Dmytriyenko ae6533336f optee-test: upgrade 3.7.0 -> 3.8.0, cleanup
* Drop previously backported patch for Python3 support
* Add DESCRIPTION
* Use common HOMEPAGE
* Depend on PyCryptodomex instead of old PyCrypto

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:32:38 -04:00
Denys Dmytriyenko 6d0eefa084 optee-client: upgrade 3.7.0 -> 3.8.0, cleanup
* Rename with _git suffix to match other optee recipes
* Add DESCRIPTION
* Use common HOMEPAGE
* Use install command for header files instead of cp -a

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:32:32 -04:00
Denys Dmytriyenko 43bc224685 optee-os: upgrade 3.7.0 -> 3.8.0, cleanup
* Cleanup the recipe - add HOMEPAGE, update DESCRIPTION, indentation
* Depend on PyCryptodomex, but old PyCrypto is still required
* Ensure full support for arm32 platforms - build corresponding core and TA

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:32:26 -04:00
Denys Dmytriyenko 4f2443469f layer.conf: add meta-python to LAYERDEPENDS for optee components
optee components use pycrypto, pycryptodomex and pyelftools from meta-python layer

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:32:08 -04:00
Denys Dmytriyenko b1393356c0 layer.conf: update LAYERSERIES_COMPAT for dunfell
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-08 09:32:05 -04:00
Bertrand Marquis ad6a675817 arm-autonomy: Update quick start guide
Add more documentation to the quick start guide:
- to include guests images in host image
- to boot the host image
- to adapt the layer to new boards

Change-Id: I07ff13190daf404476d28803f43f330fc190cddc
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-by: Vineeth Raveendran <vineeth.raveendran@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis b3e13f492a arm-autonomy: Add external guests to host image
Add ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS variable to let user specifiy
a list of guests to be included directly in the host image.
The variable can be set to a space separated list of full path to
xenguest image files or SRC_URI compatible urls. Each entry can also
have a ';guestname=NAME' argument to set the destination name of the
guest added.

Change-Id: I4fc5e53df979b792ad930066a068ad1d4512c991
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis df189a806b arm-autonomy: Create xenguest network bridge
Add a xenguest-network-bridge script to create a network bridge with the
host interfaces.
Add a xenguest init script to create a xen network interface connected
to the bridge
Add a network interfaces configuration file to have dhcp configuration
on the network bridge
Add xenguest-network-bridge to the default host image
Add XENGUEST_IMAGE_NETWORK_BRIDGE parameter to xenguest-image to let
user setup if a guest should be or not connected to the bridge

Change-Id: Id15fde234386376e89c2562e1ffa935c51affa5b
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 16e4f7450e arm-autonomy: Add subdirectory config to ifupdown
Modify default interfaces file for network to scan sub-directory
interfaces.d to let other recipes contribute to the network
configuration file

Change-Id: I72cf7fd8ccb51e3cdfdafc368adb4574393fdc08
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 56196afc91 arm-autonomy: Create xenguest-nodisk-image recipe
Create a xenguest-nodisk-image recipe to be used when wanting to create
a xenguest image without packing in it a root filesystem generated by
Yocto.
This recipe can be used to use aio root filesystem from an external tar
file and just compile and take the linux kernel coming from Yocto.

To achieve this, the variable XENGUEST_IMAGE_SRC_URI_DISK_FILES should
be set to a SRC_URI compatible URL to the tar file and then call bitbake
xenguest-nodisk-image.

Change-Id: I1a8d80b89930f3bb6bcce40a55b4dfce9b5331ef
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 77c6d12f59 arm-autonomy: Create xenguest-image-extra class
Add class xenguest-image-extra to be used by recipes which wants to add
elements to the generated xenguest image.
The recipes using this call must inherit the deploy class and declare a
deploy task that will be extended by the class. The variables
XENGUEST_EXTRA_* documented in the class can be used to define what
should be used to extend the xenguest image.

Change-Id: I8a7682a7a7ca57b424ea815145408ccb8e4348ca
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 926ce4ffcd arm-autonomy: Create xenguest image type
Create an image type xenguest to create a xenguest image as part of a
Yocto image (add FSTYPE xenguest).

The image type is using xenguest-base-image as a producer for the
xenguest image directory, adds kernel defined by
XENGUEST_IMAGE_KERNEL to it, adds rootfs if listed in
XENGUEST_IMAGE_DISK_PARTITIONS and pack the final image with file
extension .xenguest with other types of images.

If initramfs is configured, a xenguest image containing the kernel with
initramfs is produced.

The xenguest image type is added to IMAGE_FSTYPES and IMAGE_CLASSES if
arm-autonomy-guest is set in DISTRO_FEATURES.

Change-Id: Ibae8a50d41375839492e43a2e28d9472dc71b4a1
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 5cd294263b arm-autonomy: Create xenguest-base-image recipe
Add xenguest-base-image recipe to create an initial xenguest image
directory in deploy.
This is using the xenguest-image class.
The recipe is also introducing several parameters named
XENGUEST_IMAGE_SRC_URI_* to allow the user to specify files or elements
to be added to the xenguest image.
Those parameters are documented inside the recipe.

Change-Id: I806a2fa07fb9593c366d88e2f4ee8b649cbcf8ea
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 4c76616c9c arm-autonomy: Create xenguest-image class
Create xenguest-image class to be used by recipes and other classes to
manipulate xenguest images.
The recipe is defining some variables to configure default parameters of
xenguest image (memory size, number of vcpus, command line, etc.). Those
parameters all have the prefix XENGUEST_IMAGE_ and are documented at the
beginning of the class.

The class also provide some helper functions:
- xenguest_image_create to create a xenguest image (using global
parameters) in deploy as xenguest image directory
- xenguest_image_clone to clone current xenguest image from deploy to be
able to extend it and pack it in a xenguest image file
- xenguest_image_rootfs_file function to allow other recipes to detect
if the rootfs should or not be embedded in the xenguest image

Change-Id: I4ba54aa2c41e72964c152f673b71fe32f30b4aca
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 3ebc163110 arm-autonomy: Create xenguest-manager
Add xenguest-manager to handle xenguest image based guests:
- create guest (use LVM to create disks for guests)
- start/stop guests
- provide init script to have guest auto started on boot
- add documentation

Change-Id: I5319ecb77f3aa9f8c1aff4891c05973288156f11
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 37505ea4fc arm-autonomy: Create xenguest-mkimage
Create a xenguest-mkimage tool to create Xen guest images.
Add documentation to explain what is a xenguest-image and how to use
xenguest-mkimage.

Change-Id: Id87240a4dfac2723f1dcceb8bfe969a7633ef261
Issue-Id: SCM-767
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis bca1918461 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>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 12c70f287f 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>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 06bbe868de 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>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 23b3db93c3 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>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 882753f179 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>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis 780adc19c3 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>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:32 -04:00
Bertrand Marquis c1a093a4d4 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>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-04-07 23:32:23 -04:00
Jon Mason 3e1546ac57 meta-arm-bsp: add layer dependencies
meta-arm-bsp has dependencies on other layers, which are not being
represented in the layers.conf file.  This causes build breaks when
using tools like `bitbake-layers layerindex-fetch`, as it will not fetch
the depencies properly.  Currently, the dependencies on other layers are:
* core => u-boot, linux, etc
* openembedded-layer (meta-oe) => haveged
* meta-arm => trusted-firmware-a

Change-Id: Icafc2f1c55a6138172706bb4b99e9dc59904cad4
Signed-off-by: Jon Mason <jon.mason@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
2020-03-23 15:44:18 -04:00
Jon Mason f08f9b590c meta-arm-bsp: a5ds: Remove WIC references
The current WIC references in the A5DS config file are causing a build
break, due to not being defined.  These WIC files should be revisited
once the IOTA distro is present.

Change-Id: Ied2cd6f768625d18150ed60bd5fe317e06c7f48a
Signed-off-by: Jon Mason <jon.mason@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>
2020-03-23 15:42:48 -04:00
Leo Yan 46b2d238ca OpenCSD: Support for Arm CoreSight decode lib
This patch is to add recipe for OpenCSD, which is an open source
CoreSight trace decode library and utility.

Also create a new folder recipes-devtools under meta-arm to place
this recipe.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-19 16:59:27 -04:00
Daniel D?az 3108c6debc conf/machine: Make preferred virtual/kernel overridable
A user of the BSP layer may decide to use the machine
configuration but a different kernel.

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-19 16:59:04 -04:00
Rahul Singh 29d57f0ac1 foundation: disable Scalable Vector Extension (SVE)
When foundation platform is booted with SVE enabled in linux
kernel and with Xen hypervisor, linux kernel is stopped by a
trap catched by Xen during early boot as Xen is configuring
the coprocessor to trap access to SVE to EL2.Disabling the SVE
in foundation to boot the guest and host.

Change-Id: I862540a46686f1fb5343a3143da61db6073bb1d3
Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-19 16:23:23 -04:00
Rahul Singh f63763443d Use xen dtb if xen image is present
Use xen dtb if xen image is present for foundation
and fvp pltaform.

Change-Id: I8ee0c5f59ea731202ca97c2cdef315cc5e6665e6
Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-19 16:22:23 -04:00
Diego Sueiro 42541f9f39 meta-arm-bsp:linux-linaro-arm: Fix kernel menuconfig task
When calling `bitbake virtual/kernel -c menuconfig` it fails if the
ncurses-dev package is not installed on the host machine.

This patch makes usage of the ncurses library built by yocto if it
is present.

Change-Id: I6a8c4ca6a7da07ac834b29a2d23e83e6c153efb3
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-18 22:05:25 -04:00
Rui Silva 00e87b1894 arm-bsp: add support to cortex-a5 designstart
Add tf-a recipes, u-boot, machine configuration, and documentation to
support Arm Cortex-A5 Designstart.

The output of this build is compatible to run on the FVP and
the FPGA implementation of the package.

For more information see:
https://community.arm.com/developer/ip-products/processors/\
designstart/b/blog/posts/\
pre-silicon-software-development-with-arm-models-for-cortex-a5-designstart

Change-Id: Ie2715ad1871975cb7620d7a195c8dd74144629da
Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-17 10:27:01 -04:00
Rui Silva 89ac0f6602 arm-bsp: u-boot: move machine patches
Move Juno patches to machine specific directory. This will allow to
add others machines related patches later on.

Change-Id: I71c327ca4866fdb0205eeac0f40475e691caf4cc
Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-17 10:26:56 -04:00
Rui Silva 9e1b4e045b arm-bsp: add upstream kernel inc and v5.3 recipe
Add support to build using the upstream (Linus tree) and as first user
add recipe for v5.3, which will be later.

Change-Id: I0f30a45002adca7c0b95a0421e0291a6852295eb
Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-17 10:26:31 -04:00
Patrik Berglund 5569afc1df TF-A: Add git development version
Change-Id: I7f734d2f89ad8da6eae55403691806b9d9106f15
Signed-off-by: Patrik Berglund <patrik.berglund@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-08 22:54:14 -04:00
Jon Mason b15ad02130 Remove meta-arm-iota
Feedback received that it is not acceptable to have a distro layer
inside (https://lists.yoctoproject.org/g/meta-arm/message/6).  Removing
from meta-arm and will create a separate git repository once that code
is ready.

Change-Id: I74d1083341d90caa038c1bd8c1d53aa565d28460
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-08 22:54:08 -04:00
Jon Mason ae19998d27 Fix MACHINE setting in start script
The current MACHINE setting could be different than when bitbake was
originally run, thus causing an error when the start scripts are run.
Set the MACHINE in each bitbake command call to get around this.

Change-Id: I778b58d751ea0ddbcac6d73f347e6861edcf1ecf
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-03-08 22:53:59 -04:00
Peter Griffin 11233ba158 optee-test_git.bb: add optee-test recipe & patches
This has moved from meta-linaro to meta-arm as this
is the new place for general recipes for Arm arch
and has a mailing list for external contributors.

python2 is now EOL. This patch updates to python3
but is a backport from v3.8.0 release.

Change-Id: Ib778b8dd9c605e1fbb69627f5e640c1683c3176b
Tested-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
2020-02-04 07:18:14 -05:00
Peter Griffin 72848d26e2 optee-examples.bb: add recipe for optee examples
This has moved from meta-linaro to meta-arm as this
is the new place for general recipes for Arm arch
and has a mailing list for external contributors.

Change-Id: I75de7398e9247c8a329f50292f912b7787ead372
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
2020-02-04 07:18:14 -05:00
Peter Griffin 94c5b5460d optee-os_git.bb: add optee-os recipe and patches
This has moved from meta-linaro to meta-arm as this
is the new place for general recipes for Arm arch
and has a mailing list for external contributors.

Change-Id: Id43f498e35350eb62a718e64011c8b2f8cd85fdd
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
2020-02-04 07:18:14 -05:00
Peter Griffin 0bce62510e optee-client.bb: add optee client recipe and patches
This has moved from meta-linaro to meta-arm as this
is the new place for general recipes for Arm arch
and has a mailing list for external contributors.

Change-Id: I5550620801d1d86217abb84f52fcd1e9a5873b08
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
2020-02-04 07:18:14 -05:00
Bertrand Marquis 8e5b91b42e Optimize execution on FVP and Foundation platform
Add an extra partition to the disk image generated for FVP and
Foundation platform (to be used for user data or extra usage). The
partition is created on the hard drive but is not formated.
Speed up running on FVP and Foundation by optimizing model parameters:
- disable options that are already set by default
- disable cache modelling on FVP
- disable secure memory
- disable real time on Foundation (prevents timeout as execution is a
lot slower then on a real system)

Change-Id: I20d613bd8b0f4cb7df87c294d45b9f718f6a8ed3
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2020-02-04 07:18:14 -05:00
Vineeth Raveendran 313544372c Fix to improve boot time on Emulators
Use haveged instead of rngd (That gets added when adding ssh) since rngd
init is taking ~7 mins during boot time

Change-Id: I038c42b8a7c025959248d78940483322421ad5ef
Signed-off-by: Vineeth Raveendran <vineeth.raveendran@arm.com>
2020-02-04 07:18:14 -05:00
Sumit Garg c0a59f3d94 Import ARM GNU-A toolset recipes from meta-linaro
Add a new meta-arm-toolchain layer to hold ARM GNU-A toolset recipes
imported from meta-linaro tree, branch: master and commit ID:
504ca3b217c9602b10eda0ec8a9f1055b59e482f.

Change-Id: I5a2907874da2869ab94d7d48e0cf4a1bfe241041
Tested-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2020-01-27 16:44:36 -05:00
Bertrand Marquis 46b8667ac6 Remove DISTRO_FEATURES from juno.conf
Do not try to add distro features from juno machine definition.
Modify juno documentation to mention usbhost and usbgadget in case
someone use a distribution not activating them by default.

Change-Id: I7fc44c9921ce3fdbf069fd5354f37bb2ec38ac53
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2020-01-24 21:38:41 +00:00
Vineeth Raveendran c3b26ed67c Use Linaro kernel for Juno Yocto BSP
In order to have SCMi or HDMI support, the Juno BSP must use
the Linaro kernel instead of the standard Yocto one.

Change-Id: Ib53cb81a074439e9a4018bf356d749c7fd0a5d5a
Signed-off-by: Vineeth Raveendran <vineeth.raveendran@arm.com>
2020-01-15 10:26:46 +00:00
Jon Mason 6ee3651287 Fix bitbake license warnings
The following warnings are seen when building fvp-base
WARNING: fvp-base-native-r11p7-30rel0-r0 do_populate_lic: fvp-base-native: No generic license file exists for: GPL in any provider
WARNING: fvp-base-native-r11p7-30rel0-r0 do_populate_lic: fvp-base-native: No generic license file exists for: Apache in any provider
Correct the license names to the expected strings resolves the issue

Change-Id: Ia4962736840de8b4a02d0c9d59b7c14c9999997c
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-01-07 20:31:13 -05:00
Jon Mason bd8bc290fd Remove meta-arm-integration
Remove meta-arm-integration, as it is not currently being used.  Also,
remove the reference in the README.md.  These can be added bach when
they are in use again.

Change-Id: If8535d6d9a0a307a42b24e8f42e0eb7847e047c4
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-01-07 20:07:52 -05:00
Jon Mason a3a41fc092 Move TF-A recipes to meta-arm directory
The TF-A recipes should only be in meta-arm-integration after we have
submitted them for inclusion in Yocto git tree.  Move them to the proper
location until this occurs.

Change-Id: Ia2fa5c5a377392aa45b801bd1f2ae4ca0f056c34
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-01-07 20:04:59 -05:00
Vineeth Raveendran aab12c535e Use += where ever possible instead of append
Exceptions will be cases involving overrides, machine specific
varible expansion and cases where variable modification needed to be
done after all += operations.

Change-Id: I7c76a77949d0a012238d488d5a75c489c54abf68
Signed-off-by: Vineeth Raveendran <vineeth.raveendran@arm.com>
2019-12-13 16:28:49 +00:00
Bertrand Marquis c601acec48 Add support for Gem5 for arm64
Add Yocto support for Gem5:
- add kernel configuration
- add recipes to build an image using boot-wrapper-aarch64
- add recipes to build Gem5 native to run the produced image
- add script to start image using gem5
- add recipe to create a dtb using gem5
- add recipe to build an image using gem5 boot wrapper
- add dts to linux kernel for gem5 for arm64
- add scons for python2 as this is required to build gem5 (until gem5
will support python3)
- add xen patch to limit number of interrupts if hardware is claiming to
have to more interrupts then the number supported by xen

When an image has been built it can be directly started using gem5 using
this command (console is available using telnet localhost 3456):
./tmp/deploy/tools/start-gem5.sh

Change-Id: Iec5ef735fc22643685e29ffbdaf63a55b1111c60
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2019-12-13 16:26:49 +00:00
Bertrand Marquis 4ff58c5f89 Add support for arm Juno Development Board
Add Yocto support for Juno development board:
- add machine definition
- add kernel configuration
- add u-boot patch to get the environment from a file in flash
- add trusted firmware extension to produce a firmware image
- add ifupdown interfaces to start eth0 and eth1 on startup

Change-Id: I5046166cf1cc9e80a57815ef6bfb0cbb263a704e
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2019-12-10 15:38:44 +00:00
Bertrand Marquis 3ae02d723f Add support for arm FVP Base simulator
Add recipes and configuration files to add Yocto support
for FVP Base simulator from arm.
The following components are supported:
- trusted-firmware-a
- linux kernel (with specific kernel configuration and dts)
- xen (with meta-virtualization layer)
- unpacking and starting the generated image directly in Foundation
simulator (package must be download from www.arm.com website and put in
the directory downloads/licensed/silver.arm.com).

After building, the following command can be used to start a generated
image in fvp:
./tmp/deploy/tools/start-fvp-base.sh

Change-Id: I1759aecf32e84e25e813d7b0305f49616d4b47ef
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2019-12-10 15:38:44 +00:00
Bertrand Marquis ad73752f4b Add support for arm Foundation ARMv8 FVP simulator
Add recipes and configuration files to add Yocto support
for Foundation armv8 simulator from arm.
The following components are supported:
- trusted-firmware-a
- linux kernel (with specific kernel configuration)
- xen (with meta-virtualization layer)
- unpacking and starting the generated image directly in Foundation
simulator (package must be download from www.arm.com website and put in
the directory downloads/licensed/silver.arm.com).

After building, the following command can be used to start a generated
image in foundation:
./tmp/deploy/tools/start-foundation-armv8.sh

Change-Id: Iade343c38f0799ee8523434d555cb3ca42068a86
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2019-12-10 15:38:44 +00:00
Bertrand Marquis d8dd9ad0ad TF-A: Download mbedTLS if needed, set build dir
Fix TF-A recipe to only download mbedTLS when it is activated.
Allow user to modify TFA_BUILD_DIR and set BUILD_PLAT accordingly in
make arguments to properly set the build directory.

Change-Id: Ib53b245d4d3b2d62e41f0ef238ad03dc45bab056
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2019-12-09 14:08:28 +00:00
Jon Mason 6a7919518f Add layer.conf to all the sub-meta-layers
Also, removed empty README.md files (which were place holders for the
directories).

Change-Id: I1c1db95158f257015b5eb9f4a6f05219df489b4a
Signed-off-by: Jon Mason <jon.mason@arm.com>
2019-12-05 15:35:53 -05:00
Jon Mason 893d3305c0 README.md clean-up
Add a little more description for what belongs in meta-arm/meta-arm (per
feedback from Richard Purdie), and modify the max width to be 80
characters to improve readability.

Change-Id: I8f7b0598e3336132c2594c92cf3400dd5e216baf
Signed-off-by: Jon Mason <jon.mason@arm.com>
2019-12-05 15:35:53 -05:00
Bertrand Marquis c7c809e465 Create meta-arm-bsp layer
Create layer definition file for meta-arm-bsp sub-layer.

Change-Id: I305da32bf389b09750a721349fa0796c0b33b0ea
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2019-12-05 20:33:32 +00:00
Vineeth Raveendran ce6fa2ec19 Move to Zeus release of Yocto
Change-Id: Ic05d950971a5b161df1fafdcf6d3c01d9b3d5fb7
Signed-off-by: Vineeth Raveendran <vineeth.raveendran@arm.com>
2019-12-05 20:32:58 +00:00
Bertrand Marquis 0a5ba9885d Add a Trusted Firmware A recipe
Add a generic Trusted Firmware A recipe using TF-A version 2.1

Change-Id: I873509970bd44c6cfdaa0456516197a4eebf6ebd
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2019-11-15 11:19:35 -05:00
Bertrand Marquis 204d8e4a9d Create the meta-arm-integration layer
Add basic layer configuration file

Change-Id: I11b63d0bc74a33272feffeb73e6b0c6d717a259a
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
2019-11-15 11:19:35 -05:00
Filipe Rinaldi 793a8834f9 readme: Keep layers in alphabetical order
Signed-off-by: Filipe Rinaldi <filipe.rinaldi@arm.com>
2019-11-15 11:19:35 -05:00
Jon Mason 62028f103e Create skeleton for meta-arm layer
Add README and License Files in the root directory describing the layers
and process for interacting with the meta-arm layer.  Create the
directories for future layers (and add empty README files to force the
directories to be created by git).

Change-Id: I4d70759bf90b1c964e6d9040d145737b2f441205
Signed-off-by: Jon Mason <jon.mason@arm.com>
2019-11-15 11:19:35 -05:00
375 changed files with 20512 additions and 1209 deletions
View File
+12 -12
View File
@@ -1,17 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+38
View File
@@ -0,0 +1,38 @@
Introduction
------------
This repository contains Arm layers for OpenEmbedded
meta-arm:
This layer provides support for general recipes for the Arm
architecture. Anything that's not needed explicitly for BSPs, the IOTA
distribution, or destined to be upstreamed belongs here.
meta-arm-bsp:
This layer provides support for Arm reference platforms
meta-arm-iota:
This layer provides support for Arm's IOTA Linux Distribution
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
information on how to submit a patch, please read
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
E-mail meta-arm@lists.yoctoproject.org with patches created using this process
Reporting bugs
--------------
E-mail meta-arm@lists.yoctoproject.org with the error encountered and the steps
to reproduce the issue
Maintainer(s)
-------------
* Jon Mason <jon.mason@arm.com>
-15
View File
@@ -1,15 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
SUMMARY = "Cramfs XIP image type"
DESCRIPTION = "Cramfs XIP type image to add to IMAGE_TYPES"
LICENSE = "MIT"
inherit image_types
do_image_cramfs_xip[depends] += "cramfs-tools-native:do_populate_sysroot"
IMAGE_TYPES += " cramfs-xip"
IMAGE_CMD_cramfs-xip = "mkcramfs -n ${IMAGE_NAME} -X ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cramfs-xip ${EXTRA_IMAGECMD}"
-21
View File
@@ -1,21 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
# arm has a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
BBFILES += " \
${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bbappend' % layer \
for layer in BBFILE_COLLECTIONS.split())}"
BBFILE_COLLECTIONS += "arm"
BBFILE_PATTERN_arm := "^${LAYERDIR}/"
BBFILE_PRIORITY_arm = "10"
LAYERSERIES_COMPAT_arm = "warrior"
LAYERDEPENDS_arm = "core"
@@ -1,18 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
IMAGE_FSTYPES += "tar.bz2 wic cpio.gz"
EXTRA_IMAGEDEPENDS_append = " trusted-firmware-a"
PREFERRED_PROVIDER_u-boot ?= "u-boot"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
UBOOT_SUFFIX ?= "bin"
UBOOT_MACHINE ?= "vexpress_aemv8a_aarch32_defconfig"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-arm"
SERIAL_CONSOLES = "115200;ttyAMA0"
-8
View File
@@ -1,8 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
TUNE_FEATURES = "aarch32"
require conf/machine/include/arm/arch-armv8a.inc
-11
View File
@@ -1,11 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
DEFAULTTUNE="cortexa5"
require conf/machine/include/tune-cortexa5.inc
TF-A_EXTRA_OPTIONS = "ARM_ARCH_MAJOR=7 ARM_CORTEX_A5=yes \
ARM_XLAT_TABLES_LIB_V1=1"
@@ -1,61 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
SUMMARY = "Trusted Firmware for Cortex-A"
DESCRIPTION = "Trusted Firmware-A"
HOMEPAGE = "https://github.com/ARM-software/arm-trusted-firmware"
LICENSE = "BSD-3-Clause"
TF-A_DEPENDS ?= ""
DEPENDS += " dtc-native coreutils-native"
DEPENDS += " ${TF-A_DEPENDS} "
LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRCREV = "${AUTOREV}"
SRC_URI = "\
git://github.com/ARM-software/arm-trusted-firmware;protocol=https;nobranch=1 \
"
S = "${WORKDIR}/git"
B = "${WORKDIR}/build"
COMPATIBLE_MACHINE = "(vexpress-a5|vexpress-a32|corstone700|a5ds)"
LDFLAGS[unexport] = "1"
TF-A_PLATFORM ?= "fvp"
TF-A_ARCH ?= "aarch32"
TF-A_DEBUG ?= "1"
TF-A_AARCH32_SP ?= "sp_min"
TF-A_BL33 ?= ""
TF-A_TARGET_IMAGES ?= "all fip"
TF-A_EXTRA_OPTIONS ?= ""
do_compile() {
mkdir -p ${B}
oe_runmake -C ${S} BUILD_BASE=${B} \
BUILD_PLAT=${B}/${TF-A_PLATFORM}/ \
PLAT=${TF-A_PLATFORM} \
DEBUG=${TF-A_DEBUG} \
ARCH=${TF-A_ARCH} \
CROSS_COMPILE=${TARGET_PREFIX} \
AARCH32_SP=${TF-A_AARCH32_SP} \
BL33=${TF-A_BL33} \
${TF-A_EXTRA_OPTIONS} \
${TF-A_TARGET_IMAGES}
}
do_install() {
[ -f ${B}/${TF-A_PLATFORM}/bl1.bin ] && install -D -p -m 0644 ${B}/${TF-A_PLATFORM}/bl1.bin ${DEPLOY_DIR_IMAGE}/bl1.bin
[ -f ${B}/${TF-A_PLATFORM}/bl1/bl1.elf ] && install -D -p -m 0644 ${B}/${TF-A_PLATFORM}/bl1/bl1.elf ${DEPLOY_DIR_IMAGE}/bl1.elf
install -D -p -m 0644 ${B}/${TF-A_PLATFORM}/fip.bin ${DEPLOY_DIR_IMAGE}/${TF-A_PLATFORM}.fip
}
-30
View File
@@ -1,30 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
SRCREV = "9bed08a2ed8d4915e694e5b4a030bd361b829a52"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
SRC_URI = "\
git://git.linaro.org/landing-teams/working/arm/u-boot;protocol=https;nobranch=1 \
"
S = "${WORKDIR}/git"
B = "${WORKDIR}/build"
U-BOOT_PLATFORM = "fvp_ve"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
COMPATIBLE_MACHINE = "(vexpress-a5|vexpress-a32|a5ds)"
do_compile() {
mkdir -p ${B}
oe_runmake -C ${S} BUILD_BASE=${B} \
BUILD_PLAT=${B}/${PLATFORM}/ \
SUPPORT_ARCH_TIMER=no \
O=${B}
}
@@ -1,23 +0,0 @@
SUMMARY = "Cramfs tools"
DESCRIPTION = "Cramfs tools to create cramfs images with support to XIP"
HOMEPAGE = "https://github.com/npitre/cramfs-tools"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
SRC_URI = "git://github.com/npitre/cramfs-tools;protocol=https;nobranch=1"
SRCREV = "23d032e6e0a973810c6aedf165441592641b60f4"
BBCLASSEXTEND = "native"
S = "${WORKDIR}/git"
do_compile () {
oe_runmake
}
do_install() {
install -d ${D}${bindir}
install ${S}/mkcramfs ${D}${bindir}
install ${S}/cramfsck ${D}${bindir}
}
@@ -1,36 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
# Recipe for fetching and installing the prebuilt gcc-arm toolchain for
# bare-metal targets.
# Recipe based on the meta-ti layer:
# http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/tree/recipes-ti/devtools/gcc-arm-none-eabi-native_4.9.2015q3.bb?h=master
#
# Whilst most of the tools built in relies on the linaro-provided
# toolchain, some recipes require the baremetal Arm GCC toolchain. The baremetal
# Arm GCC toolchain is distributed as precompiled binaries. This recipe fetches
# the toolchain and installs it in sysroot.
# Recipes may then 'DEPENDS' on this recipe to fetch the toolchain, making the
# toolchain available in the staging directory of the depending recipe.
GCC_ARM_VERSION = "gcc-arm-none-eabi-7-2018-q2-update"
LICENSE="GPLv3"
LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=f77466c63f5787f4bd669c402aabe061"
inherit native
SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/${GCC_ARM_VERSION}-linux.tar.bz2;name=tc32"
SRC_URI[tc32.md5sum] = "299ebd3f1c2c90930d28ab82e5d8d6c0"
S = "${WORKDIR}/${GCC_ARM_VERSION}"
do_install() {
install -d ${D}${INSTALL_GCC_ARM_NONE_EABI}
cp -r ${S}/. ${D}${INSTALL_GCC_ARM_NONE_EABI}
}
FILES_${PN} = "${INSTALL_GCC_ARM_NONE_EABI}/"
INSANE_SKIP_${PN} = "already-stripped"
-10
View File
@@ -1,10 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
SRCREV = "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf"
LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
@@ -1,35 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
DESCRIPTION = "Linux Kernel provided and supported by Arm and Linaro with \
focus on vexpress and other Arm models and hardware. Trying to be as much \
as possible close to upstream tree."
SECTION = "kernel"
LICENSE = "GPLv2"
SRCREV_FORMAT = "kernel"
require recipes-kernel/linux/linux-yocto.inc
KERNEL_VERSION_SANITY_SKIP = "1"
S = "${WORKDIR}/git"
COMPATIBLE_MACHINE = "(vexpress-a5|vexpress-a32|corstone700|a5ds)"
# Override do_kernel_configme to avoid kernel being assembled into a linux-yocto style kernel
# https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#ref-tasks-kernel_configme
do_kernel_configme() {
}
KBRANCH = ""
LINUX_VERSION ?= "5.2"
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
SRC_URI = "\
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux;protocol=https;nobranch=1 \
"
SRCREV = "v5.2"
-8
View File
@@ -1,8 +0,0 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2019 Arm Limited
#
SUMMARY = "Linux Kernel provided and supported by Arm/Linaro"
require recipes-kernel/linux/linux-arm-common.inc
+92
View File
@@ -0,0 +1,92 @@
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.
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:
* 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:
* 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.
- To reduce the root filesystem image size the kernel image is not installed.
* 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
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:
- [xen-devicetree](documentation/xen-devicetree.md)
- [xenguest-manager](documentation/xenguest-manager.md)
- [xenguest-network-bridge](documentation/xenguest-network-bridge.md)
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:
* 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:
* [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.
* [xenguest-mkimage](documentation/xenguest-mkimage.md): this is a tool to
create and modify images to be used as Xen guests.
* [xenguest-manager](documentation/xenguest-manager.md): this is a tool to
create/remove/start/stop xen guest generated using xenguest-mkimage.
* [xenguest-network-bridge](documentation/xenguest-network-bridge.md): this
recipe add tools and init scripts to create a bridge connected to the
external network on the host and allow guests to be connected to it.
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>
@@ -0,0 +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)}
@@ -0,0 +1,108 @@
# Create a xenguest image with kernel and filesystem produced by Yocto
# This will create a .xenguest file that the xenguest-manager can use.
inherit xenguest-image
# We are creating our guest in a local subdirectory
# force the value so that we are not impacted if the user is changing it
XENGUEST_IMAGE_DEPLOY_DIR = "${WORKDIR}/tmp-xenguest"
# Name of deployed file (keep standard image name and add .xenguest)
XENGUEST_IMAGE_DEPLOY ??= "${IMAGE_NAME}"
# Add kernel XENGUEST_IMAGE_KERNEL from DEPLOY_DIR_IMAGE to image
xenguest_image_add_kernel() {
srcfile="${1:-}"
if [ -z "${srcfile}" ]; then
srcfile="${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_KERNEL}"
fi
call_xenguest_mkimage partial --xen-kernel=$srcfile
}
# Add rootfs file to the image
xenguest_image_add_rootfs() {
call_xenguest_mkimage partial \
--disk-add-file=${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${IMAGE_TYPEDEP_xenguest}:rootfs.${IMAGE_TYPEDEP_xenguest}
}
# Pack xenguest image
xenguest_image_pack() {
mkdir -p ${IMGDEPLOYDIR}
rm -f ${IMGDEPLOYDIR}/${XENGUEST_IMAGE_DEPLOY}.xenguest
call_xenguest_mkimage pack \
${IMGDEPLOYDIR}/${XENGUEST_IMAGE_DEPLOY}.xenguest
}
#
# Task finishing the bootimg
# We need this task to actually create the symlinks
#
python do_bootimg_xenguest() {
subtasks = d.getVarFlag('do_bootimg_xenguest', 'subtasks')
bb.build.exec_func('xenguest_image_clone', d)
if subtasks:
for tk in subtasks.split():
bb.build.exec_func(tk, d)
bb.build.exec_func('xenguest_image_pack', d)
bb.build.exec_func('create_symlinks', d)
}
# This is used to add sub-tasks to do_bootimg_xenguest
do_bootimg_xenguest[subtasks] = ""
# Those are required by create_symlinks to find our image
do_bootimg_xenguest[subimages] = "xenguest"
do_bootimg_xenguest[imgsuffix] = "."
do_bootimg_xenguest[depends] += "xenguest-base-image:do_deploy"
# Need to have rootfs so all recipes have deployed their content
do_bootimg_xenguest[depends] += "${PN}:do_rootfs"
# This set in python anonymous after, just set a default value here
IMAGE_TYPEDEP_xenguest ?= "tar"
# We must not be built at rootfs build time because we need the kernel
IMAGE_TYPES_MASKED += "xenguest"
IMAGE_TYPES += "xenguest"
python __anonymous() {
# Do not do anything if we are not in the want FSTYPES
if bb.utils.contains_any('IMAGE_FSTYPES', 'xenguest', '1', '0', d):
# Check the coherency of the configuration
rootfs_needed = False
rootfs_file = ''
kernel_needed = False
rootfs_file = xenguest_image_rootfs_file(d)
if rootfs_file:
rootfs_needed = True
if d.getVar('XENGUEST_IMAGE_KERNEL') and not d.getVar('INITRAMFS_IMAGE'):
# If INITRAMFS_IMAGE is set, even if INITRAMFS_IMAGE_BUNDLE is not
# set to 1 to bundle the initramfs with the kernel, kernel.bbclass
# is setting a dependency on ${PN}:do_image_complete. We cannot
# in this case depend on do_deploy as it would create a circular
# dependency:
# do_image_complete would depend on kernel:do_deploy which would
# depend on ${PN}:do_image_complete
# In the case INITRAMFS_IMAGE_BUNDLE = 1, the kernel-xenguest class
# will handle the creation of a xenguest image with the kernel.
# In the other case the kernel can be added manually to the image.
kernel_needed = True
bb.build.addtask('do_bootimg_xenguest', 'do_image_complete', None, d)
if rootfs_needed:
# tell do_bootimg_xenguest to call add_rootfs
d.appendVarFlag('do_bootimg_xenguest', 'subtasks', ' xenguest_image_add_rootfs')
# do_bootimg_xenguest will need the tar file
d.appendVarFlag('do_bootimg_xenguest', 'depends', ' %s:do_image_tar' % (d.getVar('PN')))
# set our TYPEDEP to the proper compression
d.setVar('IMAGE_TYPEDEP_xenguest', 'tar' + (rootfs_file.split('.tar', 1)[1] or ''))
if kernel_needed:
# Tell do_bootimg_xenguest to call xenguest_image_add_kernel
d.appendVarFlag('do_bootimg_xenguest', 'subtasks', ' xenguest_image_add_kernel')
# we will need kernel do_deploy
d.appendVarFlag('do_bootimg_xenguest', 'depends', ' virtual/kernel:do_deploy')
}
@@ -0,0 +1,34 @@
# Create a xenguest image containing the kernel with initramfs when
# initramfs is activated
# This is done using kernel-fitimage as model
# To activate this, kernel-xenguest must be added to KERNEL_CLASSES
inherit xenguest-image
# use a local copy to pack all together
XENGUEST_IMAGE_DEPLOY_DIR = "${WORKDIR}/tmp-xenguest"
python __anonymous () {
# only if xenguest image type is present
if bb.utils.contains('IMAGE_FSTYPES', 'xenguest', '1', '0', d):
# only if initramfs bundle is activated
if d.getVar('INITRAMFS_IMAGE') and d.getVar('INITRAMFS_IMAGE_BUNDLE') == "1":
if not bb.utils.contains('KERNEL_IMAGETYPES', 'Image', '1', '0', d):
bb.fatal("xenguest image type with initramfs require Image kernel image type")
bb.build.addtask('do_assemble_xenguest_initramfs', 'do_deploy', 'do_bundle_initramfs', d)
}
do_assemble_xenguest_initramfs() {
xenguest_image_clone
call_xenguest_mkimage partial --xen-kernel=${B}/${KERNEL_OUTPUT_DIR}/Image.initramfs
rm -f ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest
call_xenguest_mkimage pack ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest
}
do_assemble_xenguest_initramfs[depends] += "${INITRAMFS_IMAGE}:do_image_complete"
kernel_do_deploy_append() {
if [ -f "${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest" ]; then
install -m 0644 ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest "$deployDir/Image-${INITRAMFS_NAME}.xenguest"
ln -snf Image-${INITRAMFS_NAME}.xenguest $deployDir/Image-${INITRAMFS_LINK_NAME}.xenguest
fi
}
@@ -0,0 +1,102 @@
# This class must be used to extend the xenguest image
# It provides variables to add init scripts, a dtb, xen files or disk files.
#
# The class is extending deploy function so you recipe must inherit deploy and
# have a do_deploy function (even if it is empty)
# Use standard xenguest-image
inherit xenguest-image
# Add a DTB file for the guest
# Only one file should be added, if this is set multiple times or in several
# recipes, the last recipe setting it will prevail.
XENGUEST_EXTRA_DTB ??= ""
# Append something to the guest xen configuration
# All files here will be merged together in the final xen configuration
# This can contain several files or be used in several recipes
XENGUEST_EXTRA_XENCONFIG ??= ""
# Add a xenguest init, init-pre or init-post script
XENGUEST_EXTRA_INIT_PRE ??= ""
XENGUEST_EXTRA_INIT ??= ""
XENGUEST_EXTRA_INIT_POST ??= ""
# Add xenguest files, (to be used in extra xen config for example)
# several files may be added, space separated, the path will be kept on the
# generated xenguest image (if dir1/file1 is added, it can be used as
# dir1/file1 file in the xen configuration).
XENGUEST_EXTRA_FILES ??= ""
# Add xenguest disk files (to be used as disk partition content)
# several files may be added, space separated, the path will be kept on the
# generated xenguest image (if dir1/file1 is added, it can be used as
# dir1/file1 file in the disk content parameters).
XENGUEST_EXTRA_DISK_FILES ??= ""
do_deploy_append() {
if [ -z "${XENGUEST_IMAGE_DEPLOY_DIR}" -o \
-z "${XENGUEST_IMAGE_DEPLOY_SUBDIR}" ]; then
die "Configuration error: XENGUEST_IMAGE_DEPLOY_DIR or XENGUEST_IMAGE_DEPLOY_SUBDIR is empty"
fi
rm -rf ${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
mkdir -p ${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
if [ -n "${XENGUEST_EXTRA_DTB}" ]; then
if [ ! -f ${XENGUEST_EXTRA_DTB} ]; then
die "xenguest-image: DTB file ${XENGUEST_EXTRA_DTB} does not exist"
fi
call_xenguest_mkimage partial --xen-device-tree=${XENGUEST_EXTRA_DTB}
fi
if [ -n "${XENGUEST_EXTRA_XENCONFIG}" ]; then
for f in ${XENGUEST_EXTRA_XENCONFIG}; do
if [ ! -f $f ]; then
die "xenguest-image: Xen config $f does not exist"
fi
call_xenguest_mkimage partial --xen-append=$f
done
fi
if [ -n "${XENGUEST_EXTRA_INIT_PRE}" ]; then
if [ ! -f ${XENGUEST_EXTRA_INIT_PRE} ]; then
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT_PRE} does not exist"
fi
call_xenguest_mkimage partial --init-pre=${XENGUEST_EXTRA_INIT_PRE}
fi
if [ -n "${XENGUEST_EXTRA_INIT}" ]; then
if [ ! -f ${XENGUEST_EXTRA_INIT} ]; then
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT} does not exist"
fi
call_xenguest_mkimage partial --init-script=${XENGUEST_EXTRA_INIT}
fi
if [ -n "${XENGUEST_EXTRA_INIT_POST}" ]; then
if [ ! -f ${XENGUEST_EXTRA_INIT_POST} ]; then
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT_POST} does not exist"
fi
call_xenguest_mkimage partial --init-post=${XENGUEST_EXTRA_INIT_POST}
fi
if [ -n "${XENGUEST_EXTRA_FILES}" ]; then
for f in ${XENGUEST_EXTRA_FILES}; do
if [ ! -f $f ]; then
die "xenguest-image: Xen file $f does not exist"
fi
call_xenguest_mkimage partial --xen-add-file=$f
done
fi
if [ -n "${XENGUEST_EXTRA_DISK_FILES}" ]; then
for f in ${XENGUEST_EXTRA_DISK_FILES}; do
if [ ! -f $f ]; then
die "xenguest-image: Disk file $f does not exist"
fi
call_xenguest_mkimage partial --disk-add-file=$f
done
fi
}
# Need to have xenguest-image tool
do_deploy[depends] += "xenguest-base-image:do_deploy"
@@ -0,0 +1,195 @@
# This class must be used to create, extend or pack a xenguest image.
# It is using xenguest-mkimage tool to do operations
DEPENDS += "xenguest-mkimage-native"
#
# Xenguest image parameters
# All the following parameters can be modified in local.conf or on recipes
# inheriting this class
#
# Guest memory size in MB
XENGUEST_IMAGE_MEMORY_SIZE ??= "512"
# Guest number of vcpus
XENGUEST_IMAGE_NUM_VCPUS ??= "1"
# Guest auto boot during init, set to 1 to have guest started during init or
# to 0 if the guest should not be auto started
XENGUEST_IMAGE_AUTOBOOT ??= "1"
# Partition containing the root file system
# Xen will actually add root=${XENGUEST_IMAGE_ROOT} to your guest kernel
# command line
# You can let this empty if the root filesystem is specified in an other way
# and have root= option added to the command line for example or if you don't
# need a root filesystem mounted for your guest (initrd for example)
XENGUEST_IMAGE_ROOT ??= "/dev/xvda1"
# Guest kernel command line arguments
XENGUEST_IMAGE_CMDLINE ??= "earlyprintk=xenboot console=hvc0 rw"
# Extra commands to add to xenguest-image when creating the image
XENGUEST_IMAGE_EXTRA_CMD ??= ""
# Kernel binary
# This value is used by the xenguest image type but is declared here to have
# all variables in the same place
# If this value is empty no kernel will be added to the image
XENGUEST_IMAGE_KERNEL ??= "Image"
# Size of the disk to create (if 0 no disk will be created and rootfs will not
# be included in the xenguest image)
XENGUEST_IMAGE_DISK_SIZE ??= "${@ '4' if not d.getVar('INITRAMFS_IMAGE') else '0'}"
#
# XENGUEST_IMAGE_DISK PARTITIONS is used to describe the partitions to setup
# and their content.
# It must be set to a space separated list of entries with each entry having
# the format num:sz:fs:[file] where:
# - num is a partition number
# - sz is the partition size in Gigabit
# - fs is the filesystem to use for the partition
# - file is optionally pointing to a file to use as content of the partition
# Please check image_types_xenguest.bbclass for rootfs handling of files
#
# Default value creates a partition 1 using the full disk, formated with ext4
# and containing the root filesystem produced by Yocto
XENGUEST_IMAGE_DISK_PARTITIONS ??= "1:${XENGUEST_IMAGE_DISK_SIZE}:ext4:rootfs.tar.gz"
# XENGUEST_IMAGE_NETWORK_BRIDGE can be set to 1 to have a network interface
# on the guest connected to host bridged network. This will provide the guest
# with a network interface connected directly to the external network
XENGUEST_IMAGE_NETWORK_BRIDGE ??= "1"
# Sub-directory in wich the guest is created. This is create in deploy as a
# subdirectory and must be coherent between all components using this class so
# it must only be modified from local.conf if needed
XENGUEST_IMAGE_DEPLOY_SUBDIR ?= "xenguest"
# Directory in which the xenguest should be deployed
# a sub-directory named ${XENGUEST_IMAGE_DEPLOY_SUBDIR} will be created there.
# This should be set to:
# - ${DEPLOYDIR} (default) if creating or extending the xenguest for a normal
# recipe.
# - something in ${WORKDIR} if you need to clone and manipulate an image
XENGUEST_IMAGE_DEPLOY_DIR ??= "${DEPLOYDIR}"
#
# Wrapper to call xenguest-mkimage
# It is using XENGUEST_IMAGE_DEPLOY_DIR and XENGUEST_IMAGE_DEPLOY_SUBDIR
# to find the image to operate on
#
# Usage: call_xenguest_mkimage [operation] [args]
call_xenguest_mkimage() {
local cmd="${1}"
local img="${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}"
shift
echo "xenguest-mkimage $cmd $img $@"
xenguest-mkimage $cmd $img $@
}
#
# Create an initial xenguest image.
# This is a task which must be added in a recipe inheriting deploy
# It is using XENGUEST_IMAGE_MEMORY_SIZE, XENGUEST_IMAGE_NUM_VCPUS,
# XENGUEST_IMAGE_AUTOBOOT, XENGUEST_IMAGE_ROOT, XENGUEST_IMAGE_EXTRA_CMD,
# XENGUEST_IMAGE_CMDLINE, XENGUEST_IMAGE_DISK_SIZE and
# XENGUEST_IMAGE_DISK_PARTITIONS to customize the initial guest
#
xenguest_image_create() {
if [ -z "${XENGUEST_IMAGE_DEPLOY_DIR}" -o \
-z "${XENGUEST_IMAGE_DEPLOY_SUBDIR}" ]; then
die "Configuration error: XENGUEST_IMAGE_DEPLOY_DIR or XENGUEST_IMAGE_DEPLOY_SUBDIR is empty"
fi
rm -rf ${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
mkdir -p ${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
# Create the image
call_xenguest_mkimage create --xen-memory=${XENGUEST_IMAGE_MEMORY_SIZE} \
--xen-vcpus=${XENGUEST_IMAGE_NUM_VCPUS} \
--xen-root=${XENGUEST_IMAGE_ROOT} \
${XENGUEST_IMAGE_EXTRA_CMD}
# add command line
if [ -n "${XENGUEST_IMAGE_CMDLINE}" ]; then
call_xenguest_mkimage update --xen-clean-extra
for arg in ${XENGUEST_IMAGE_CMDLINE}; do
call_xenguest_mkimage update --xen-extra=$arg
done
fi
# create disk if needed
disksize="${XENGUEST_IMAGE_DISK_SIZE}"
if [ -z "$disksize" ]; then
disksize="0"
fi
if [ $disksize -gt 0 ]; then
# setup disk size
call_xenguest_mkimage update --disk-reset-config --disk-size=$disksize
diskparts="${XENGUEST_IMAGE_DISK_PARTITIONS}"
if [ -n "$diskparts" ]; then
for arg in $diskparts; do
call_xenguest_mkimage update --disk-add-part=$arg
partnum="$(expr $partnum + 1)"
done
fi
fi
if [ "${XENGUEST_IMAGE_AUTOBOOT}" = "1" ]; then
call_xenguest_mkimage update --set-param=GUEST_AUTOBOOT=1
else
call_xenguest_mkimage update --set-param=GUEST_AUTOBOOT=0
fi
if [ "${XENGUEST_IMAGE_NETWORK_BRIDGE}" = "1" ]; then
call_xenguest_mkimage update --set-param=NETWORK_BRIDGE=1
else
call_xenguest_mkimage update --set-param=NETWORK_BRIDGE=0
fi
}
#
# Clone the current xenguest from deploy to manipulate it locally
# This is required if you need to change things before packing an image
# To set the local directory where to clone you must set
# XENGUEST_IMAGE_DEPLOY_DIR if you don't want to use do_deploy to modify the
# image
#
xenguest_image_clone() {
if [ -z "${XENGUEST_IMAGE_DEPLOY_DIR}" -o \
-z "${XENGUEST_IMAGE_DEPLOY_SUBDIR}" ]; then
die "Configuration error: XENGUEST_IMAGE_DEPLOY_DIR or XENGUEST_IMAGE_DEPLOY_SUBDIR is empty"
fi
if [ ! -f ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}/guest.cfg ]; then
die "xenguest-image: ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR} does not contain a valid guest"
fi
rm -rf ${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
mkdir -p ${XENGUEST_IMAGE_DEPLOY_DIR}
cp -rf ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR} \
${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
}
# Helper function to retrieve rootfs file if present in one partition
# This can return an empty string or rootfs.tar[.COMP]
def xenguest_image_rootfs_file(d):
disksize = d.getVar('XENGUEST_IMAGE_DISK_SIZE')
# if disksize is 0, we don't create anything
if not disksize or disksize == '0':
return ""
# Find first partition with file=rootfs.tar*
partlist = d.getVar('XENGUEST_IMAGE_DISK_PARTITIONS')
if partlist:
for partdesc in partlist.split():
partelems = partdesc.split(':', 3)
if partelems[3]:
if partelems[3].startswith('rootfs.tar'):
return partelems[3]
return ""
@@ -0,0 +1,11 @@
# This files is added when DISTRO_FEATURES contains arm-autonomy-guest
# We need to have ipv4 activated
DISTRO_FEATURES_append = " ipv4"
# Build a xenguest type image
IMAGE_CLASSES += "image_types_xenguest"
IMAGE_FSTYPES += "xenguest"
# xenguest kernel extension to handle initramfs
KERNEL_CLASSES += "kernel-xenguest"
@@ -0,0 +1,9 @@
# This files is added when DISTRO_FEATURES contains arm-autonomy-host
# We need to have xen and ipv4 activated
DISTRO_FEATURES_append = " xen ipv4"
# Don't include kernels in standard images when building arm-autonomy-host
# If the kernel image is needed in the rootfs the following should be set from
# a bbappend: RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-image"
RDEPENDS_${KERNEL_PACKAGE_NAME}-base ?= ""
+34
View File
@@ -0,0 +1,34 @@
# 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 = "dunfell"
# 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"
# 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"
BBFILES_DYNAMIC += " \
meta-arm-bsp:${LAYERDIR}/dynamic-layers/meta-arm-bsp/*/*/*.bbappend \
"
@@ -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 ?= "5.4%"
DISTRO_FEATURES += "arm-autonomy-guest"
@@ -0,0 +1,225 @@
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. Add `meta-arm/meta-arm-autonomy` layer to the list of layers of your
project in the `conf/bblayers.conf`. 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). You can achieve this by using
the `bitbake-layers add-layer layerdir [layerdir ...]` command.
For example:
```
export LAYERDIR_BASE="/home/user/arm-autonomy/"
bitbake-layers add-layer $LAYERDIR_BASE/meta-poky $LAYERDIR_BASE/meta-yocto-bsp \
$LAYERDIR_BASE/meta-openembedded/meta-oe $LAYERDIR_BASE/meta-openembedded/meta-python \
$LAYERDIR_BASE/meta-openembedded/meta-filesystems $LAYERDIR_BASE/meta-openembedded/meta-networking \
$LAYERDIR_BASE/meta-virtualization $LAYERDIR_BASE/meta-arm/meta-arm-autonomy \
$LAYERDIR_BASE/meta-arm/meta-arm $LAYERDIR_BASE/meta-arm/meta-arm-bsp
```
Example of a `conf/bblayers.conf`:
```
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-virtualization \
/home/user/arm-autonomy/meta-arm/meta-arm-autonomy \
/home/user/arm-autonomy/meta-arm/meta-arm \
/home/user/arm-autonomy/meta-arm/meta-arm-bsp \
"
```
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`
The project will generate a Linux kernel, a root filesystem, a Xen binary and
a DTB modified to include the required entries to boot Xen and Linux as Dom0
(this DTB has the extension `-xen.dtb`).
To boot the system using an u-boot base board you will need to:
- Load the kernel (by default at 0x80080000 unless you modify
XEN_DEVICETREE_DOM0_ADDR value)
- Load the xen device tree (for example at 0x83000000)
- Load the xen-efi binary (for example at 0x84000000)
- run using `booti 0x84000000 - 0x83000000`
In this example the addresses might need to be adapted depending on your board.
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`
The build will create a ".xenguest" image that can be use on an host project
with the xenguest-manager.
Include guests directly in the host image
-----------------------------------------
The layer provides a way to directly include in the host project one or several
images generated by guest projects.
To use this feature, you must edit your host project `local.conf` file and
add set ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS to the list of xenguest images
you want to include in your host. Each xenguest image must be given using a
full path to it.
For example:
```
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS = "/home/user/guest-project/tmp/deploy/images/arm64-autonomy-guest/core-image-minimal-arm64-autonomy-guest.xenguest;guestname=myguest"
```
This will add the guest and name it `myguest` on the host project image and
the xenguest-manager will automatically boot it during startup.
Add support for your board
--------------------------
Most of arm-autonomy layer is board independent but some functionalities
might need to be customized for your board:
### Add the kernel configuration for the host
The layer is using KERNEL_FEATURES to add drivers required to be a Xen Dom0
system.
Depending on the kernel used by your BSP and how it is configured you might
need to add the required drivers to your kernel configuration:
- if KERNEL_FEATURES system is supported by your kernel, make sure that the
file `recipes-kernel/linux/linux-arm-autonomy.inc` from the layer is included
by your kernel recipe.
- if it is not supported, you must add the proper drivers inside your kernel
(modules are possible but they must be loaded before xenguest-manager is
started). You can find the complete list of the kernel configuration elements
required in `recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg`.
### Define the drive and partition to use for the LVM volume
The xenguest-manager is creating disk hard drive using LVM on an empty
partition. The default value is set to use /dev/sda2.
You can change this for your board by setting XENGUEST_MANAGER_VOLUME_DEVICE.
Check `recipes-extended/xenguest/xenguest-manager.bbappend` for examples.
Please also read xenguest-manager.md.
### Define the interface to add to xenguest network bridge
xenguest-network bridge is creating a bridge on the host and adds network
interfaces to it so that guest connected to it have access to external network.
By default `eth0` is set as the list of interfaces to be added to the bridge.
Depending on your board or use case you might want to use an other interface
or use multiple interfaces.
You can change this for your board by setting XENGUEST_NETWORK_BRIDGE_MEMBERS.
Check `recipes-extended/xenguest/xenguest-network-bridge.bbappend` for
exmaples.
Please also read xenguest-network-bridge.md.
### Define the network configuration of the xenguest network bridge
xenguest network bridge is putting the host network interfaces in a bridge
and is configuring it by default to use dhcp.
If you need a different type of configuration you can set
XENGUEST_NETWORK_BRIDGE_CONFIG in a xenguest-network-bridge.bbappend to use
a different file.
The recipe will look for the file in ${WORKDIR} so you will need to add it to
SRC_URI in your bbappend.
The recipe will also substitute `###BRIDGE_NAME###` with the bridge name
configured in ${XENGUEST_NETWORK_BRIDGE_NAME}.
You can find an example configuration file in
`recipes-extended/xenguest/files/xenguest-network-bridge-dhcp.cfg.in`.
Please also read xenguest-network-bridge.md.
### Customize Dom0 and Xen boot arguments for you board
xen-devicetree is writting inside the generated DTB Xen and Linux boot
arguments as long as the address where Dom0 Linux kernel can be found.
You might need to have different values for your board or depending on your
use case.
You can find examples to customize this in
`recipes-extended/xen-devicetree/xen-devicetree.bbappend`.
Please also read 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.
@@ -0,0 +1,67 @@
Xenguest Manager
================
Introduction
------------
xenguest-manager is a tool to manage Xenguest images generated by
[xenguest-mkimage](xenguest-mkimage.md).
On a Xen Dom0 system it will:
- create a xen guest from a xenguest image: extract its components, create a
disk for the guest using LVM volumes.
- start/stop a xen guest (during init or using xenguest-manager directly).
- check guest status
xenguest-manager is composed of 2 shell scripts:
- xenguest-manager which can be used from command line to start/stop/check
guests and create or remove guest using xenguest images.
- xenguest-init which is called during init to automatically create and start
some guests as part of the host init process.
Usage
-----
xenguest-manager must be called like this:
`xenguest-manager OPERATION [OPTIONS]`
The following operations are available:
- create XENGUEST_IMAGE [GUESTNAME]: create a guest from a xenguest image file
as guest GUESTNAME. If GUESTNAME is not given the image file name is used
without the xenguest extension.
- remove GUESTNAME: remove the guest GUESTNAME.
- start GUESTNAME: start the guest GUESTNAME.
- stop GUESTNAME: stop the guest GUESTNAME (this is using `xl stop` which is
sending a stop signal to the running guest).
- kill GUESTNAME: force stopping the guest GUESTNAME.
- list: list the available guests.
- status [GUESTNAME]: print the current status of GUESTNAME. If GUESTNAME is
not given, print the status of all guests.
For a detailed help on available options please use:
`xenguest-manager --help`
Bitbake parameters
------------------
Several parameters are available to configure the xenguest manager during Yocto
project compilation (those can be set in your project local.conf, for example).
The following parameters are available:
- XENGUEST_MANAGER_VOLUME_DEVICE: This is the device path used by the
xenguest-manager on the device to create LVM disks when guests have a disk
configuration.
This is set by default to "/dev/sda2".
- XENGUEST_MANAGER_VOLUME_NAME: This is the LVM volume name that the
xenguest-manager will create and use to create guest LVM disks.
This is set by default to "vg-xen".
- XENGUEST_MANAGER_GUEST_DIR: This is the directory on Dom0 where the
xenguest-manager will look for xenguest images to create during init. That's
the place where xenguest images can be added to have them automatically
created during next Dom0 boot. The xenguests found there will only be created
if they were not already before (the basename of the files is used as guest
name).
This is set by default to "/usr/share/guests".
@@ -0,0 +1,119 @@
Xenguest mkimage
================
Introduction
------------
xenguest-mkimage is a tool to create and modify images to be used as Guest with
Xen. It defines a format to store completely defined guests as a file or as
a directory and provides options to create and modify those images.
A xenguest image contains all elements required to create a xen guest.
This is the base elements like a Xen configuration and a Linux kernel binary
but also some more advanced elements like init scripts or a disk definition.
The format is made to be deployable easily by storing everything in a single
file and provide tools to easily manipulate the images. It can also easily be
extended to have features like encryption or signature of images, updates or
complex configurations by providing features to have init script that will be
executed on the host embedded inside the image.
Xenguest images content
-----------------------
### params.cfg
This file contains parameters that can be used by tools to configure some
functionalities on the host. This can be used by init scripts to have
configurable parameters as it is sourced before calling init scripts.
### guest.cfg and guest.d
guest.cfg is the main xen configuration and guest.d contains optional
configuration parts. All those will be merged into one final xen configuration
before starting the guest.
### files
This directory contains files that can be used by the xen configuration, for
example the binary of the kernel referenced in xen configuration).
This is where the kernel binary, the dtb or a ramdisk will be stored.
### init.pre, init.d and init.post
These directories contain init scripts that will be executed on the host
during the guest startup. Those must be shell scripts and each directory
contains scripts called at a different time:
- init.pre: scripts executed before the guest is created. This can be used
to prepare some features required to create the guest in xen or to
generate part of the xen configuration dynamically.
- init.d: scripts executed when the guest has been created but before it is
started. This can be used to do some xenstore operations or configure the
guest behaviour using xl, for example.
- init.post: scripts executed just after starting the guest. This can be
used to configure things created by xen for the guest like network
network interfaces.
When a directory contains several scripts, those will be called in alphabetical
order.
### disk.cfg and disk-files
disk.cfg contains the guest disk description (disk size and disk partitions).
The file contains the following entries:
- `DISK_SIZE=X`: size of the disk to create in GB
- `DISK_PARTX=SIZE:FS:CONTENT`: create a partition number X (1 to 4) with a
size of SIZE GB, format it with filesystem FS (can be ext2, ext3, ext4, vfat
or swap) and extract CONTENT as initial partition content
(.tar[.gz|.xz|.bz2] file or img[.gz|.bz2] file to be dumped in the partition). FS and
CONTENT can be empty.
The disk-files contain files to be used for initializing the disk partitions
content. Those should be used to create a LVM or a physical disk and initialize
it (create partitions, format them and put the initial content).
Usage
-----
xenguest-mkimage is a shell script which must be called like this:
`xenguest-mkimage OPERATION XENGUEST [OPTIONS]`
### Operations
- create: create a xenguest image. If XENGUEST is an existing empty directory,
the image is created as a directory otherwise it will be created as a file.
- check: verify that XENGUEST is a valid xenguest image.
- update: modify a xenguest image (see --help for a list of operations).
- pack: pack a xenguest image directory into a xenguest image file. The file to
be created must be given as 3rd argument.
- extract: extract a xenguest image file into a directory. The destination
directory must be given as 3rd argument.
- dump-xenconfig: dump xenguest image xen configuration.
- dump-diskconfig: dump xenguest image disk configuration.
- dump-paramsconfig: dump xenguest image parameters configuration.
For a detailed help on available operations, please use:
`xenguest-mkimage --help`
### Options
- --kernel=FILE: add kernel FILE as guest kernel. This is both adding the file
to the image and modifying the xen configuration to use it.
- --xen-memory=SIZE: set the guest memory size in MB.
- --xen-extra: add a kernel command line argument. This can be called several
times to add several command line options.
- --xen-device-tree=FILE: add dtb FILE as device tree. This both adding the
file to the image and modifying the xen configuration to use it.
- --init-script=FILE: add guest init script. The script is embedded inside the
image file. Several script can be added and the basename of FILE is used to
distinguish them (calling the option twice with the same file will update the
script in the image with the second one).
--disk-size=SIZE: set the guest disk size to SIZE in GB. Calling this with 0
disable the guest disk.
- --disk-add-part=NUM:SIZE:FS:CONTENT: This is adding a partition to the
xenguest image disk. The partition is described with the arguments:
- NUM: partition number.
- SIZE: partition size in GB.
- FS: filesystem to format the partition with. This can be ext2, ext3, ext4,
vfat of swap. If empty the partition is not formated.
- CONTENT: tar of img file to use to initialize the partition. The file must
be added to the image using --disk-add-file=FILE:CONTENT.
For a detailed help on available options, please use:
`xenguest-mkimage OPERATION --help`
@@ -0,0 +1,49 @@
xenguest network bridge
=======================
Introduction
------------
xenguest-network-bridge is creating a network bridge to allow some guests to
have a direct connection to the external network.
To do this, a bridge is created on the host using brctl with the network
interfaces added to it so that the bridge is connected to the external network.
It is also adding a guest init script which will, for guests configured to use
it, create a virtual network interface for the guest and connect it to the
network bridge on the host.
Usage
-----
On the host the package xenguest-network-bridge must be included in your image.
On the xenguest image of your guest, the parameter NETWORK_BRIDGE must be set
to 1 (using xenguest-mkimage --set-param=NETWORK_BRIDGE=1).
Bitbake parameters
------------------
Several parameters are available to configure the xenguest network bridge
during Yocto project compilation (those can be set in your project local.conf,
for example).
The following parameters are available:
- XENGUEST_NETWORK_BRIDGE_NAME: This variable defines the name of the network
bridge that is created on the host during init.
This is set by default to "xenbr0".
- XENGUEST_NETWORK_BRIDGE_MEMBERS: This variable defines the list of network
interfaces that are added to the bridge when it is created on the host during
init.
This is set by default to "eth0".
- XENGUEST_NETWORK_BRIDGE_CONFIG: This variable defines the configuration file
to use to configure the bridge network. By default it points to have file
configuring the network using dhcp.
You can provide a different file using a bbappend and make this variable
point to it if you want to customize your network configuration.
- XENGUEST_IMAGE_NETWORK_BRIDGE: This variable can be set to 0 or 1 on guest
projects to enable or not the connection of the guest to the host bridge.
This is set by default to "1".
@@ -0,0 +1,32 @@
# Use OVERRIDES to minimize the usage of
# ${@bb.utils.contains('DISTRO_FEATURES', 'xen', ...
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d)}"
# Xen image to put in the image
# This should point to a file in the deploy image directory
BOOT_WRAPPER_AARCH64_XEN ??= "xen-${MACHINE}"
# Xen command line for the image
BOOT_WRAPPER_AARCH64_XEN_CMDLINE ??= "noreboot dom0_mem=256M"
BOOT_WRAPPER_AARCH64_XEN_CMDLINE_gem5-arm64 = "noreboot dom0_mem=256M console=dtuart \
dtuart=/uart@1c090000 bootscrub=0"
# Fix command line in the axf file for gem5-arm64 when Xen is present
BOOT_WRAPPER_AARCH64_CMDLINE_xen_gem5-arm64 = "console=hvc0 root=/dev/vda rw"
# Image generated by boot wrapper when Xen is present
BOOT_WRAPPER_AARCH64_IMAGE_xen ?= "xen-system.axf"
EXTRA_OECONF_append_xen = " \
--with-xen=${WORKDIR}/kernel/arch/arm64/boot/Image \
--with-xen-cmdline="" \
"
EXTRA_OEMAKE_append_xen = " \
XEN_IMAGE=${DEPLOY_DIR_IMAGE}/${BOOT_WRAPPER_AARCH64_XEN} \
XEN_CMDLINE="${BOOT_WRAPPER_AARCH64_XEN_CMDLINE}" \
"
# We need xen if it is activated
do_deploy[depends] += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen:do_deploy', '', d)}"
@@ -0,0 +1,21 @@
# Use OVERRIDES to minimize the usage of
# ${@bb.utils.contains('DISTRO_FEATURES', 'xen', ...
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d)}"
FILESEXTRAPATHS_prepend_xen := "${THISDIR}/${PN}:"
DEPLOY_EXTRA_DEPS ??= ""
DEPLOY_EXTRA_DEPS_xen = "xen:do_deploy xen-devicetree:do_deploy"
do_deploy[depends] += "${DEPLOY_EXTRA_DEPS}"
do_deploy_prepend_xen() {
# To avoid dependency loop between firmware-image-juno:do_install,
# xen:do_deploy and xen-devicetree:do_deploy when
# INITRAMFS_IMAGE_BUNDLE = "1", we need to handle the xen and
# xen-devicetree binaries copying in the do_deploy task.
cp ${DEPLOY_DIR_IMAGE}/xen-${COMPATIBLE_MACHINE}.efi \
${D}/${UNPACK_DIR}/SOFTWARE/xen
cp ${DEPLOY_DIR_IMAGE}/*xen.dtb \
${D}/${UNPACK_DIR}/SOFTWARE/
}
@@ -0,0 +1,78 @@
TITLE: Versatile Express Images Configuration File
[IMAGES]
TOTALIMAGES: 11 ;Number of Images (Max: 32)
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR0ADDRESS: 0x00000000 ;Image Flash Address
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
NOR0LOAD: 00000000 ;Image Load Address
NOR0ENTRY: 00000000 ;Image Entry Point
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
NOR1LOAD: 00000000 ;Image Load Address
NOR1ENTRY: 00000000 ;Image Entry Point
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR2ADDRESS: 0x00500000 ;Image Flash Address
NOR2FILE: \SOFTWARE\Image ;Image File Name
NOR2NAME: norkern ;Rename kernel to norkern
NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno-xen.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x01D00000 ;Image Flash Address
NOR4FILE: \SOFTWARE\xen ;Image File Name
NOR4NAME: xen
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR5ADDRESS: 0x025C0000 ;Image Flash Address
NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR5LOAD: 00000000 ;Image Load Address
NOR5ENTRY: 00000000 ;Image Entry Point
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR6ADDRESS: 0x03E40000 ;Image Flash Address
NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
NOR6LOAD: 00000000 ;Image Load Address
NOR6ENTRY: 00000000 ;Image Entry Point
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR7ADDRESS: 0x0BF00000 ;Image Flash Address
NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name
NOR7NAME: startup.nsh
NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address
NOR8FILE: \SOFTWARE\blank.img ;Image File Name
NOR8NAME: BOOTENV
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02600000 ;Image Flash Address
NOR9FILE: \SOFTWARE\selftest ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
NOR9ENTRY: 00000000 ;Image Entry Point
NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR10ADDRESS: 0x02780000 ;Image Flash Address
NOR10NAME: uEnv.txt
NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR10LOAD: 00000000 ;Image Load Address
NOR10ENTRY: 00000000 ;Image Entry Point
@@ -0,0 +1,78 @@
TITLE: Versatile Express Images Configuration File
[IMAGES]
TOTALIMAGES: 11 ;Number of Images (Max: 32)
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR0ADDRESS: 0x00000000 ;Image Flash Address
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
NOR0LOAD: 00000000 ;Image Load Address
NOR0ENTRY: 00000000 ;Image Entry Point
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
NOR1LOAD: 00000000 ;Image Load Address
NOR1ENTRY: 00000000 ;Image Entry Point
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR2ADDRESS: 0x00500000 ;Image Flash Address
NOR2FILE: \SOFTWARE\Image ;Image File Name
NOR2NAME: norkern ;Rename kernel to norkern
NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno-r1-xen.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x01D00000 ;Image Flash Address
NOR4FILE: \SOFTWARE\xen ;Image File Name
NOR4NAME: xen
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR5ADDRESS: 0x025C0000 ;Image Flash Address
NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR5LOAD: 00000000 ;Image Load Address
NOR5ENTRY: 00000000 ;Image Entry Point
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR6ADDRESS: 0x03E40000 ;Image Flash Address
NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
NOR6LOAD: 00000000 ;Image Load Address
NOR6ENTRY: 00000000 ;Image Entry Point
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR7ADDRESS: 0x0BF00000 ;Image Flash Address
NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name
NOR7NAME: startup.nsh
NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address
NOR8FILE: \SOFTWARE\blank.img ;Image File Name
NOR8NAME: BOOTENV
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02600000 ;Image Flash Address
NOR9FILE: \SOFTWARE\selftest ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
NOR9ENTRY: 00000000 ;Image Entry Point
NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR10ADDRESS: 0x02780000 ;Image Flash Address
NOR10NAME: uEnv.txt
NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR10LOAD: 00000000 ;Image Load Address
NOR10ENTRY: 00000000 ;Image Entry Point
@@ -0,0 +1,78 @@
TITLE: Versatile Express Images Configuration File
[IMAGES]
TOTALIMAGES: 11 ;Number of Images (Max: 32)
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR0ADDRESS: 0x00000000 ;Image Flash Address
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
NOR0LOAD: 00000000 ;Image Load Address
NOR0ENTRY: 00000000 ;Image Entry Point
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
NOR1LOAD: 00000000 ;Image Load Address
NOR1ENTRY: 00000000 ;Image Entry Point
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR2ADDRESS: 0x00500000 ;Image Flash Address
NOR2FILE: \SOFTWARE\Image ;Image File Name
NOR2NAME: norkern ;Rename kernel to norkern
NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno-r2-xen.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x01D00000 ;Image Flash Address
NOR4FILE: \SOFTWARE\xen ;Image File Name
NOR4NAME: xen
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR5ADDRESS: 0x025C0000 ;Image Flash Address
NOR5FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR5LOAD: 00000000 ;Image Load Address
NOR5ENTRY: 00000000 ;Image Entry Point
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR6ADDRESS: 0x03E40000 ;Image Flash Address
NOR6FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
NOR6LOAD: 00000000 ;Image Load Address
NOR6ENTRY: 00000000 ;Image Entry Point
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR7ADDRESS: 0x0BF00000 ;Image Flash Address
NOR7FILE: \SOFTWARE\startup.nsh ;Image File Name
NOR7NAME: startup.nsh
NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x0BFC0000 ;Image Flash Address
NOR8FILE: \SOFTWARE\blank.img ;Image File Name
NOR8NAME: BOOTENV
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02600000 ;Image Flash Address
NOR9FILE: \SOFTWARE\selftest ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
NOR9ENTRY: 00000000 ;Image Entry Point
NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR10ADDRESS: 0x02780000 ;Image Flash Address
NOR10NAME: uEnv.txt
NOR10FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR10LOAD: 00000000 ;Image Load Address
NOR10ENTRY: 00000000 ;Image Entry Point
@@ -0,0 +1,15 @@
xen_name=xen
xen_addr=0x84000000
uenvcmd=run mybootcmd
mybootcmd=echo Loading custom boot command; \
echo Loading kernel; \
afs load ${kernel_name} ${kernel_addr} ; \
if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr}; fi; \
echo Loading device tree; \
afs load ${fdtfile} ${fdt_addr}; \
if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \
afs load ${fdt_alt_name} ${fdt_addr}; fi; fdt addr ${fdt_addr}; fdt resize; \
echo Loading Xen; \
afs load ${xen_name} ${xen_addr}; \
if test $? -eq 0; then echo Booting Xen; bootefi ${xen_addr} ${fdt_addr}; fi;
@@ -0,0 +1,11 @@
/*
* Disable IOMMU on juno board when Xen is used
*/
/ {
/* turn off iommu */
iommu@2b600000 {
status = "disabled";
};
};
@@ -0,0 +1,39 @@
/*
* Modify N1SDP DTB to work properly when Xen is used
*/
/ {
/*
* pmu is using PPI interrupts which are reserved by xen
* remove pm nodes
*/
/delete-node/ pmu;
/delete-node/ spe-pmu;
/*
* disable IOMMU until we have a proper support in xen
*/
/delete-node/ iommu@4f000000;
/delete-node/ iommu@4f400000;
/*
* Set extra registers required for PCI quirks to communicate with SCP
* and remove invalid properties due to removal
*/
pcie@68000000 {
reg = <0 0x68000000 0 0x1200000>,
<0 0x06000000 0 0x80000>,
<0 0x62000000 0 0x80000>;
/delete-property/ msi-map;
/delete-property/ iommu-map;
};
pcie@70000000 {
reg = <0 0x70000000 0 0x1200000>,
<0 0x06000000 0 0x80000>,
<0 0x60000000 0 0x80000>;
/delete-property/ msi-map;
/delete-property/ iommu-map;
};
};
@@ -0,0 +1,25 @@
# 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"
# Add a dtb snippet to remove pmu and iommu in dom0 on N1SDP
SRC_URI_append_n1sdp = " file://xen-n1sdp.dtsi"
XEN_DEVICETREE_DTSI_MERGE_append_n1sdp = " xen-n1sdp.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_n1sdp = " root=/dev/sda1 rootwait"
XEN_DEVICETREE_XEN_BOOTARGS_append_n1sdp = " 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"
@@ -0,0 +1,44 @@
From a41feccdb6c03f12bddb4fb650a0465f0ed6eeca Mon Sep 17 00:00:00 2001
From: Lukas Juenger <juenger@ice.rwth-aachen.de>
Date: Fri, 5 Apr 2019 15:54:04 +0200
Subject: [PATCH] xen/arm: Cap the number of interrupt lines for dom0
Dom0 vGIC will use the same number of interrupt lines as the hardware GIC.
While the hardware GIC can support up to 1020 interrupt lines,
the vGIC is only supporting up to 992 interrupt lines.
This means that Xen will not be able to boot on platforms where the hardware
GIC supports more than 992 interrupt lines.
While it would make sense to increase the limits in the vGICs, this is not
trivial because of the design choices.
At the moment, only models seem to report the maximum of interrupt lines.
They also do not have any interrupt wired above the 992 limit.
So it should be fine to cap the number of interrupt lines for dom0 to 992 lines.
Signed-off-by: Lukas Juenger <juenger@ice.rwth-aachen.de>
Acked-by: Julien Grall <julien.grall@arm.com>
---
xen/arch/arm/setup.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 444857a967..ccb0f181ea 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -888,7 +888,13 @@ void __init start_xen(unsigned long boot_phys_offset,
/* Create initial domain 0. */
/* The vGIC for DOM0 is exactly emulating the hardware GIC */
dom0_cfg.arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE;
- dom0_cfg.arch.nr_spis = gic_number_lines() - 32;
+ /*
+ * Xen vGIC supports a maximum of 992 interrupt lines.
+ * 32 are substracted to cover local IRQs.
+ */
+ dom0_cfg.arch.nr_spis = min(gic_number_lines(), (unsigned int) 992) - 32;
+ if ( gic_number_lines() > 992 )
+ printk(XENLOG_WARNING "Maximum number of vGIC IRQs exceeded.\n");
dom0_cfg.max_vcpus = dom0_max_vcpus();
dom0 = domain_create(0, &dom0_cfg, true);
--
2.17.1
@@ -0,0 +1,73 @@
#
# Automatically generated file; DO NOT EDIT.
# Xen/arm 4.12.0 Configuration
#
CONFIG_64BIT=y
CONFIG_ARM_64=y
CONFIG_ARM=y
CONFIG_ARCH_DEFCONFIG="arch/arm/configs/arm64_defconfig"
#
# Architecture Features
#
CONFIG_NR_CPUS=128
CONFIG_GICV3=y
CONFIG_HVM=y
# CONFIG_NEW_VGIC is not set
CONFIG_SBSA_VUART_CONSOLE=y
CONFIG_ARM_SSBD=y
CONFIG_HARDEN_BRANCH_PREDICTOR=y
#
# ARM errata workaround via the alternative framework
#
CONFIG_ARM64_ERRATUM_827319=y
CONFIG_ARM64_ERRATUM_824069=y
CONFIG_ARM64_ERRATUM_819472=y
CONFIG_ARM64_ERRATUM_832075=y
CONFIG_ARM64_ERRATUM_834220=y
CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=y
CONFIG_ALL_PLAT=y
# CONFIG_QEMU is not set
# CONFIG_RCAR3 is not set
# CONFIG_MPSOC is not set
# CONFIG_NO_PLAT is not set
CONFIG_ALL64_PLAT=y
# CONFIG_ALL32_PLAT is not set
CONFIG_MPSOC_PLATFORM=y
#
# Common Features
#
CONFIG_HAS_ALTERNATIVE=y
CONFIG_HAS_DEVICE_TREE=y
CONFIG_MEM_ACCESS=y
CONFIG_HAS_PDX=y
# CONFIG_XSM is not set
CONFIG_SCHED_CREDIT=y
CONFIG_SCHED_CREDIT2=y
CONFIG_SCHED_RTDS=y
# CONFIG_SCHED_ARINC653 is not set
CONFIG_SCHED_NULL=y
CONFIG_SCHED_DEFAULT="credit2"
# CONFIG_LIVEPATCH is not set
CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=y
CONFIG_CMDLINE=""
CONFIG_DOM0_MEM=""
#
# Device Drivers
#
CONFIG_HAS_NS16550=y
CONFIG_HAS_CADENCE_UART=y
CONFIG_HAS_MVEBU=y
CONFIG_HAS_PL011=y
CONFIG_HAS_SCIF=y
CONFIG_HAS_PASSTHROUGH=y
CONFIG_ARM_SMMU=y
CONFIG_DEFCONFIG_LIST="arch/arm/configs/arm64_defconfig"
#
# Debugging Options
#
# CONFIG_DEBUG is not set
@@ -0,0 +1,73 @@
#
# Automatically generated file; DO NOT EDIT.
# Xen/arm 4.12.0 Configuration
#
CONFIG_64BIT=y
CONFIG_ARM_64=y
CONFIG_ARM=y
CONFIG_ARCH_DEFCONFIG="arch/arm/configs/arm64_defconfig"
#
# Architecture Features
#
CONFIG_NR_CPUS=128
CONFIG_GICV3=y
CONFIG_HVM=y
# CONFIG_NEW_VGIC is not set
CONFIG_SBSA_VUART_CONSOLE=y
CONFIG_ARM_SSBD=y
CONFIG_HARDEN_BRANCH_PREDICTOR=y
#
# ARM errata workaround via the alternative framework
#
CONFIG_ARM64_ERRATUM_827319=y
CONFIG_ARM64_ERRATUM_824069=y
CONFIG_ARM64_ERRATUM_819472=y
CONFIG_ARM64_ERRATUM_832075=y
CONFIG_ARM64_ERRATUM_834220=y
CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=y
CONFIG_ALL_PLAT=y
# CONFIG_QEMU is not set
# CONFIG_RCAR3 is not set
# CONFIG_MPSOC is not set
# CONFIG_NO_PLAT is not set
CONFIG_ALL64_PLAT=y
# CONFIG_ALL32_PLAT is not set
CONFIG_MPSOC_PLATFORM=y
#
# Common Features
#
CONFIG_HAS_ALTERNATIVE=y
CONFIG_HAS_DEVICE_TREE=y
CONFIG_MEM_ACCESS=y
CONFIG_HAS_PDX=y
# CONFIG_XSM is not set
CONFIG_SCHED_CREDIT=y
CONFIG_SCHED_CREDIT2=y
CONFIG_SCHED_RTDS=y
# CONFIG_SCHED_ARINC653 is not set
CONFIG_SCHED_NULL=y
CONFIG_SCHED_DEFAULT="credit2"
# CONFIG_LIVEPATCH is not set
CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=y
CONFIG_CMDLINE=""
CONFIG_DOM0_MEM=""
#
# Device Drivers
#
CONFIG_HAS_NS16550=y
CONFIG_HAS_CADENCE_UART=y
CONFIG_HAS_MVEBU=y
CONFIG_HAS_PL011=y
CONFIG_HAS_SCIF=y
CONFIG_HAS_PASSTHROUGH=y
CONFIG_ARM_SMMU=y
CONFIG_DEFCONFIG_LIST="arch/arm/configs/arm64_defconfig"
#
# Debugging Options
#
# CONFIG_DEBUG is not set
@@ -0,0 +1,100 @@
#
# Automatically generated file; DO NOT EDIT.
# Xen/arm 4.12.2 Configuration
#
CONFIG_64BIT=y
CONFIG_ARM_64=y
CONFIG_ARM=y
CONFIG_ARCH_DEFCONFIG="arch/arm/configs/arm64_defconfig"
#
# Architecture Features
#
CONFIG_NR_CPUS=128
CONFIG_ACPI=y
CONFIG_GICV3=y
CONFIG_HAS_ITS=y
CONFIG_HVM=y
# CONFIG_NEW_VGIC is not set
CONFIG_SBSA_VUART_CONSOLE=y
CONFIG_ARM_SSBD=y
CONFIG_HARDEN_BRANCH_PREDICTOR=y
#
# ARM errata workaround via the alternative framework
#
CONFIG_ARM64_ERRATUM_827319=y
CONFIG_ARM64_ERRATUM_824069=y
CONFIG_ARM64_ERRATUM_819472=y
CONFIG_ARM64_ERRATUM_832075=y
CONFIG_ARM64_ERRATUM_834220=y
CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=y
CONFIG_ALL_PLAT=y
# CONFIG_QEMU is not set
# CONFIG_RCAR3 is not set
# CONFIG_MPSOC is not set
# CONFIG_NO_PLAT is not set
CONFIG_ALL64_PLAT=y
# CONFIG_ALL32_PLAT is not set
CONFIG_MPSOC_PLATFORM=y
#
# Common Features
#
CONFIG_HAS_ALTERNATIVE=y
CONFIG_HAS_DEVICE_TREE=y
# CONFIG_MEM_ACCESS is not set
CONFIG_HAS_PDX=y
# CONFIG_TMEM is not set
CONFIG_XSM=y
CONFIG_XSM_FLASK=y
CONFIG_XSM_FLASK_AVC_STATS=y
# CONFIG_XSM_FLASK_POLICY is not set
CONFIG_XSM_SILO=y
# CONFIG_XSM_DUMMY_DEFAULT is not set
# CONFIG_XSM_FLASK_DEFAULT is not set
CONFIG_XSM_SILO_DEFAULT=y
# CONFIG_ARGO is not set
#
# Schedulers
#
CONFIG_SCHED_CREDIT=y
CONFIG_SCHED_CREDIT2=y
CONFIG_SCHED_RTDS=y
# CONFIG_SCHED_ARINC653 is not set
CONFIG_SCHED_NULL=y
# CONFIG_SCHED_CREDIT_DEFAULT is not set
CONFIG_SCHED_CREDIT2_DEFAULT=y
# CONFIG_SCHED_RTDS_DEFAULT is not set
# CONFIG_SCHED_NULL_DEFAULT is not set
CONFIG_SCHED_DEFAULT="credit2"
# CONFIG_LIVEPATCH is not set
CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=y
CONFIG_CMDLINE=""
CONFIG_DOM0_MEM=""
#
# Device Drivers
#
CONFIG_HAS_NS16550=y
CONFIG_HAS_CADENCE_UART=y
CONFIG_HAS_MVEBU=y
CONFIG_HAS_PL011=y
CONFIG_HAS_SCIF=y
CONFIG_HAS_PASSTHROUGH=y
CONFIG_ARM_SMMU=y
CONFIG_DEFCONFIG_LIST="arch/arm/configs/arm64_defconfig"
#
# Debugging Options
#
# CONFIG_DEBUG is not set
CONFIG_DEBUG_INFO=y
# CONFIG_FRAME_POINTER is not set
# CONFIG_COVERAGE is not set
# CONFIG_LOCK_PROFILE is not set
# CONFIG_PERF_COUNTERS is not set
CONFIG_VERBOSE_DEBUG=y
# CONFIG_DEVICE_TREE_DEBUG is not set
# CONFIG_SCRUB_DEBUG is not set
@@ -0,0 +1,32 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
# Machine specific settings
XEN_CONFIG_EARLY_PRINTK_juno = "juno"
XEN_CONFIG_EARLY_PRINTK_gem5-arm64 = "vexpress"
XEN_CONFIG_EARLY_PRINTK_fvp-base = "fastmodel"
XEN_CONFIG_EARLY_PRINTK_foundation-armv8 = "fastmodel"
XEN_CONFIG_EARLY_PRINTK_n1sdp = "pl011,0x2a400000"
# Foundation-armv8 support
COMPATIBLE_MACHINE_foundation-armv8 = "foundation-armv8"
SRC_URI_append_foundation-armv8 = " file://fvp/defconfig"
# FVP Base support
COMPATIBLE_MACHINE_fvp-base = "fvp-base"
SRC_URI_append_fvp-base = " file://fvp/defconfig"
# Juno support
COMPATIBLE_MACHINE_juno = "juno"
SRC_URI_append_juno = " file://juno/defconfig"
# Gem5 support
# Fix problem with number of interrupts on gem5
SRC_URI_append_gem5-arm64 = " file://4.12.0/0001-xen-arm-Cap-the-number-of-interrupt-lines-for-dom0.patch"
# N1SDP support
COMPATIBLE_MACHINE_n1sdp = "n1sdp"
SRC_URI_append_n1sdp = " file://n1sdp/defconfig"
@@ -0,0 +1,6 @@
# Board specific configuration for the manager
# FVP and Foundation are using vda as hard drive and partition 2 is the
# default rootfs, so use vda3 for guest lvm
XENGUEST_MANAGER_VOLUME_DEVICE_foundation-armv8 ?= "/dev/vda3"
XENGUEST_MANAGER_VOLUME_DEVICE_fvp-base ?= "/dev/vda3"
@@ -0,0 +1,2 @@
# Juno board has 2 network interfaces, add both of them to the bridge
XENGUEST_NETWORK_BRIDGE_MEMBERS_juno ?= "eth0 eth1"
@@ -0,0 +1,4 @@
# We need to turn off SVE support in the Linux kernel otherwise Xen is stopping
# Linux kernel with a coredump while trying to access ZEN bit of CPACR1 core
# register.
# CONFIG_ARM64_SVE is not set
@@ -0,0 +1,3 @@
define KFEATURE_DESCRIPTION "Disable SVE support"
kconf non-hardware disable-arm64-sve.cfg
@@ -0,0 +1,17 @@
FILESEXTRAPATHS_prepend := "${THISDIR}:"
#
# arm-autonomy kmeta extra
#
SRC_URI_append = " file://arm-autonomy-kmeta-extra;type=kmeta;name=arm-autonomy-kmeta-extra;destsuffix=arm-autonomy-kmeta-extra"
# We need to turn off SVE support in the Linux kernel otherwise Xen is stopping
# Linux kernel with a coredump while trying to access XEN bit of CPACR1 core
# register.
LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE = "${@bb.utils.contains_any('DISTRO_FEATURES', \
'arm-autonomy-host arm-autonomy-guest', \
' features/arm-autonomy/disable-arm64-sve.scc','',d)}"
KERNEL_FEATURES_append_gem5-arm64 = "${LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE}"
KERNEL_FEATURES_append_fvp-base = "${LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE}"
KERNEL_FEATURES_append_foundation-armv8 = "${LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE}"
@@ -0,0 +1,120 @@
# Recipe to create a minimal Arm Autonomy stack host image
DESCRIPTION = "Arm Autonomy stack host minimal image"
inherit core-image
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# The ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS variable can be used to include in the
# image one or several xenguest images.
# The list must be space separated and each entry must have the following
# format: URL[;guestname=NAME]
# - URL can be the full path to a file or a Yocto compatible SRC_URI url
# - guestname=NAME can be used to specify the name of the guest. If not
# specified the basename of the file (without .xenguest extension) is used.
# Here are examples of values:
# /home/mydir/myguest.xenguest;guestname=guest1
# http://www.url.com/testguest.xenguest
#
# If you are using the output of an other Yocto project, you should use the
# full path syntax instead of the Yocto SRC_URI to be able to use the
# symlink version of your image (as the real file has a new name on each
# build as it includes the date). You must not use SRC_URI type file:// as
# it will try to include the symlink and not the destination file which will
# be detected by the recipe and output an error 'Guest file is a symlink'.
#
# Guests can also be added using a bbapend to this recipe by adding entries
# to SRC_URI with parameter ;guestname=NAME to specify the destination
# guestname. The parameter guestname must be present as it is used to detect
# guests to be added
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS ??= ""
# 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. It doesn't include all kernel modules to
# reduce the image size. If the kernel-modules packages are needed they can
# be appended to IMAGE_INSTALL in a bbappend.
IMAGE_INSTALL += " \
packagegroup-core-boot \
packagegroup-core-ssh-openssh \
qemu-xen \
xenguest-manager \
xenguest-network-bridge \
"
# Build xen binary
EXTRA_IMAGEDEPENDS += "xen"
# 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'")
if bb.utils.contains('DISTRO_FEATURES', 'xen', False, True, d):
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'xen'")
# Check in ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS for extra guests and add them
# to SRC_URI with xenguest parameter if not set
guestlist = d.getVar('ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS')
if guestlist:
for guest in guestlist.split():
# If the user just specified a file instead of file://FILE, add
# the file:// prefix
if guest.startswith('/'):
guestfile = ''
guestname = ''
if ';guestname=' in guest:
# user specified a guestname
guestname = guest.split(';guestname=')[1]
guestfile = guest.split(';guestname=')[0]
else:
# no guestname so use the basename
guestname = os.path.basename(guest)
guestfile = guest
# in case we have a link we need the destination
guestfile = os.path.realpath(guestfile)
# make sure the file exist to give a meaningfull error
if not os.path.exists(guestfile):
raise bb.parse.SkipRecipe("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS entry does not exist: " + guest)
# In case the file is a symlink make sure we use the destination
d.appendVar('SRC_URI', ' file://' + guestfile + ';guestname=' + guestname)
else:
# we have a Yocto URL
try:
_, _, path, _, _, parm = bb.fetch.decodeurl(guest)
# force guestname param in if not already there
if not 'guestname' in parm:
guest += ';guestname=' + os.path.basename(path)
d.appendVar('SRC_URI', ' ' + guest)
except:
raise bb.parse.SkipRecipe("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS contains an invalid entry: " + guest)
}
python add_extern_guests () {
# Destination directory on the rootfs
guestdir = d.getVar('IMAGE_ROOTFS') + d.getVar('datadir') + '/guests'
# Parse SRC_URI for files with ;guestname= parameter
src_uri = d.getVar('SRC_URI')
for entry in src_uri.split():
_, _, path, _, _, parm = bb.fetch.decodeurl(entry)
if 'guestname' in parm:
if os.path.islink(path):
bb.fatal("Guest file is a symlink: " + path)
bb.utils.mkdirhier(guestdir)
dstname = parm['guestname']
# Add file extension if not there
if not dstname.endswith('.xenguest'):
dstname += '.xenguest'
if not bb.utils.copyfile(path, guestdir + '/' + dstname):
bb.fatal("Fail to copy Guest file " + path)
}
IMAGE_PREPROCESS_COMMAND += "add_extern_guests; "
@@ -0,0 +1,18 @@
# Add support for interface configuration via interfaces.d directory. This
# feature can be used by other packages to add network interface
# configuration by adding network network interface configuration file under
# interfaces.d directory.
do_install_append() {
# Add scan of interfaces.d to interfaces file
cp -f ${WORKDIR}/interfaces ${WORKDIR}/interfaces.subdir
echo "source-directory ${sysconfdir}/network/interfaces.d/" \
>> ${WORKDIR}/interfaces.subdir
# Create interfaces.d script in case nobody is adding a script
# so that there is no error about non existing directory
install -d -m 755 ${D}${sysconfdir}/network/interfaces.d
# Install our file instead of the original one
install -m 644 interfaces.subdir ${D}${sysconfdir}/network/interfaces
}
@@ -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
}
@@ -0,0 +1,18 @@
# Use OVERRIDES to minimize the usage of
# ${@bb.utils.contains('DISTRO_FEATURES', 'xen', ...
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d)}"
# For Xen we only need the i386 binaries
QEMU_TARGETS_xen = "i386"
PACKAGECONFIG[noaudio] = "--audio-drv-list='',,"
PACKAGECONFIG_append_xen = " virtfs noaudio"
PACKAGECONFIG_remove_xen = "sdl"
# Reduce the qemu package size by splitting it into
# qemu and qemu-xen packages
PACKAGES_prepend_xen := "${PN}-xen"
RDEPENDS_${PN}_xen += "${PN}-xen"
FILES_${PN}-xen_xen = "${bindir}/qemu-system-i386"
RDEPENDS_${PN}-xen_xen += "xen-tools-libxenstore xen-tools-libxenctrl \
xen-tools-libxenguest"
@@ -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";
};
};
};
};
@@ -0,0 +1,72 @@
# 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_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install[noexec] = "1"
do_deploy() {
if [ ! -f ${WORKDIR}/xen.dtsi.in ]; then
die "xen.dtsi.in does not exist"
fi
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
if [ ! -f ${WORKDIR}/${inc} ]; then
die "Wrong file in XEN_DEVICETREE_DTSI_MERGE: ${WORKDIR}/${inc} does not exist"
fi
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
install -m 644 ${rdtbnoextn}-xen.dtb ${DEPLOYDIR}/.
done
}
do_deploy[depends] += "${XEN_DEVICETREE_DEPEND}"
addtask deploy after do_install
@@ -0,0 +1,14 @@
#
# Define early console based on board parameters
#
XEN_CONFIG_EARLY_PRINTK ??= "disable"
EXTRA_OEMAKE += "${@bb.utils.contains('XEN_CONFIG_EARLY_PRINTK', 'disable', \
'', ' CONFIG_DEBUG=y CONFIG_EARLY_PRINTK=${XEN_CONFIG_EARLY_PRINTK}',d)}"
# Make Xen machine specific
# This ensures that sstate is properly handled and that each machine can have
# its own configuration
PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -0,0 +1,15 @@
#!/bin/sh
# This script is setting up a virtual network interface connected to the
# xenguest-network-bridge if NETWORK_BRIDGE is set to 1 in the guest params
guestname="${1}"
BRIDGE_NAME="###BRIDGE_NAME###"
# get guest parameters
. ./params.cfg
if [ "${NETWORK_BRIDGE:-}" = "1" ]; then
echo "vif = ['${BRIDGE_NAME}']" >> ${guestname}.cfg
fi
@@ -0,0 +1,85 @@
#!/bin/bash
#
# xenguest Init Script to start and stop xenguests during boot
#
XENGUEST_CONF_BASE="/etc/xenguest"
if [ ! -f ${XENGUEST_CONF_BASE}/xenguest-manager.conf ]; then
echo "No xenguest manager configuration !!"
exit 1
fi
source ${XENGUEST_CONF_BASE}/xenguest-manager.conf
# Create guest list
guestlist=$(/usr/bin/xenguest-manager list)
# Unconfigured guests
case "$1" in
start)
echo "Starting xenguest"
# Create unconfigured guests
if [ -d ${XENGUEST_GUEST_DIR} ]; then
for f in $(find ${XENGUEST_GUEST_DIR} -name "*.xenguest" \
-exec basename {} .xenguest \;); do
if [ ! -f ${XENGUEST_CONF_BASE}/guests/${f}/guest.cfg ]; then
# Check if this guest should be auto booted
autoboot=$(/usr/bin/xenguest-mkimage dump-paramsconfig \
${XENGUEST_GUEST_DIR}/${f}.xenguest | \
grep GUEST_AUTOBOOT | sed -e "s,.*=,," | tr -d '"')
if [ "$autoboot" = "0" ]; then
echo "Do not create $f, autoboot disabled"
else
/usr/bin/xenguest-manager create \
${XENGUEST_GUEST_DIR}/${f}.xenguest
# Update guestlist
if [ $? -eq 0 ]; then
guestlist="${guestlist} ${f}"
fi
fi
fi
done
fi
if [ -n "${guestlist}" ]; then
for f in ${guestlist}; do
GUEST_AUTOBOOT="1"
if [ -f ${XENGUEST_CONF_BASE}/guests/${f}/params.cfg ]; then
source ${XENGUEST_CONF_BASE}/guests/${f}/params.cfg
fi
if [ "${GUEST_AUTOBOOT}" = "1" ]; then
/usr/bin/xenguest-manager start ${f}
fi
done
else
echo "No guest configured"
fi
;;
status)
true
;;
stop)
echo "Stopping xenguest"
for f in ${guestlist}; do
/usr/bin/xenguest-manager stop ${f}
done
;;
reload)
echo >&2 'Reload not available; use force-reload'; exit 1
;;
force-reload|restart)
echo "Restarting xenguest"
$0 stop
$0 start
;;
*)
# do not advertise unreasonable commands that there is no reason
# to use with this device
echo $"Usage: $0 {start|stop|status|restart|force-reload}"
exit 1
esac
exit $?
@@ -0,0 +1,665 @@
#!/bin/bash
# This script manages xenguest
#
set -u
this="$0"
XENGUEST_CONF_BASE="/etc/xenguest"
LOGFILE="/var/log/xenguest"
if [ ! -f ${XENGUEST_CONF_BASE}/xenguest-manager.conf ]; then
echo "Cannot find xenguest manager configuration"
exit 1
fi
# Following variables must be set in configuration:
# XENGUEST_VOLUME_DEVICE: device to use for lvm
# XENGUEST_VOLUME_NAME: lvm volume name to create on device
source ${XENGUEST_CONF_BASE}/xenguest-manager.conf
PREF="xenguest:"
function usage() {
cat <<EOF
Usage $this ACTION [OPTIONS]
with ACTION being one of:
help
Display this help
create GUESTFILE [GUESTNAME]
Create a guest using xenguest image GUESTFILE and name it GUESTNAME.
This will extract and configure the guest and will also create the guest
disk if guest has one configured.
GUESTNAME is set to the basename of GUESTFILE if unspecified.
GUESTNAME guest must not exist
remove GUESTNAME
Remove GUESTNAME and destroy its disk (if it has one)
start GUESTNAME
Start guest GUESTNAME
stop|shutdown GUESTNAME
Stop guest GUESTNAME (send stop signal and let it shutdown normally)
kill|destroy GUESTNAME
Kill guest GUESTNAME (stop directly the guest without signaling it)
list
List configured guests
status
List guests and their current status (running or stopped)
EOF
}
function xenguest_volume_init()
{
if [ -z "${XENGUEST_VOLUME_DEVICE:-}" -o \
! -b ${XENGUEST_VOLUME_DEVICE:-} ]; then
echo "${PREF} Invalid volume device in configuration: ${XENGUEST_VOLUME_DEVICE:-}"
exit 1
fi
if [ -z "${XENGUEST_VOLUME_NAME:-}" ]; then
echo "${PREF} No volume name in configuration, using vg-xen..."
XENGUEST_VOLUME_NAME="vg-xen"
fi
pvs ${XENGUEST_VOLUME_DEVICE} > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Initialize lvm on ${XENGUEST_VOLUME_DEVICE}"
echo "pvcreate -f ${XENGUEST_VOLUME_DEVICE}" >> ${LOGFILE} 2>&1
pvcreate -f ${XENGUEST_VOLUME_DEVICE} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error"
exit 1
fi
fi
vgs ${XENGUEST_VOLUME_NAME} > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Create ${XENGUEST_VOLUME_NAME} volume"
echo "vgcreate ${XENGUEST_VOLUME_NAME} ${XENGUEST_VOLUME_DEVICE}" \
>> ${LOGFILE} 2>&1
vgcreate ${XENGUEST_VOLUME_NAME} ${XENGUEST_VOLUME_DEVICE} \
>> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error"
exit 1
fi
fi
}
# Detach a disk we attached to xen
function xenguest_detach_disk()
{
echo "xl block-detach 0 \$\(xl block-list 0 | " \
"grep \"domain/0\" | awk '{print \$1}'\)" \
>> ${LOGFILE} 2>&1
xl block-detach 0 $(xl block-list 0 | \
grep "domain/0" | awk '{print $1}') \
>> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error detaching partition ${part}"
exit 1
fi
}
function xenguest_disk_init()
{
guestname="$1"
guestfile="$2"
devname="/dev/${XENGUEST_VOLUME_NAME}/${guestname}"
source ${XENGUEST_CONF_BASE}/guests/${guestname}/disk.cfg
if [ ${DISK_SIZE:-0} -eq 0 ]; then
echo "${PREF} No disk for ${guestname}"
return
fi
echo "${PREF} Create ${guestname} disk"
# Init our volume
xenguest_volume_init
echo "${PREF} Create hard drive for ${guestname}"
# Remove volume if it already exist
echo "lvs ${XENGUEST_VOLUME_NAME}/${guestname}" >> ${LOGFILE} 2>&1
lvs ${XENGUEST_VOLUME_NAME}/${guestname} >> ${LOGFILE} 2>&1
if [ $? -eq 0 ]; then
echo "lvremove -y ${devname}" >> ${LOGFILE} 2>&1
lvremove -y ${devname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error removing volume ${guestname}"
exit 1
fi
fi
# Create volume
echo "lvcreate -y -L ${DISK_SIZE}G -n ${guestname} ${XENGUEST_VOLUME_NAME}" \
>> ${LOGFILE} 2>&1
lvcreate -y -L ${DISK_SIZE}G -n ${guestname} ${XENGUEST_VOLUME_NAME} \
>> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error creating volume ${guestname}"
exit 1
fi
# Add partition table
echo "parted -s ${devname} mklabel msdos" >> ${LOGFILE} 2>&1
parted -s ${devname} mklabel msdos >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error creating partition table on ${guestname}"
exit 1
fi
# Setup disk name in xen configuration
echo "xenguest-mkimage update ${XENGUEST_CONF_BASE}/guests/${guestname}" \
"--xen-disk=${devname}" >> ${LOGFILE} 2>&1
xenguest-mkimage update ${XENGUEST_CONF_BASE}/guests/${guestname} \
--xen-disk=${devname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error setting disk in xen configuration"
exit 1
fi
# Create partitions
partstart="0"
# For each partition X the disk.cfg file should set a variable DISK_PARTX
# with a : separated list defining the partition:
# DISK_PART3="4:ext4:disk.tgz" means that partition 3 should be 4G formated
# with ext4 and initialized with the content of disk.tgz
for part in $(seq 1 4); do
eval partdesc="\${DISK_PART${part}:-0}"
size=$(echo ${partdesc} | sed -e "s/\(.*\):.*:.*/\1/")
fstype=$(echo ${partdesc} | sed -e "s/.*:\(.*\):.*/\1/")
content=$(echo ${partdesc} | sed -e "s/.*:.*:\(.*\)/\1/")
if [ "${size}" -ne 0 ]; then
# Size is expressed in GB, pass it in MB
size=$(expr ${size} \* 1024)
partend=$(expr ${partstart} + ${size})
# Let first MB of disk free for partition table
if [ ${partstart} -eq 0 ]; then
partstart="1"
fi
# Create partition
echo "parted -s ${devname} unit MB mkpart primary ${partstart}" \
"${partend}" >> ${LOGFILE} 2>&1
parted -s ${devname} unit MB mkpart primary ${partstart} \
${partend} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error adding partition ${part}"
exit 1
fi
# Set next partition start to current partition end
partstart="${partend}"
# Sync to see the created partition
echo "sync" >> ${LOGFILE} 2>&1
sync >> ${LOGFILE} 2>&1
# Prepare format command
if [ -n "${fstype}" ]; then
case ${fstype} in
vfat|ext2|ext3|ext4)
formatcmd="mkfs.${fstype} -F"
;;
swap)
formatcmd="mkswap"
;;
*)
echo "${PREF} partition ${part} of ${guestname}" \
"fstype is invalid: ${fstype}"
exit 1
;;
esac
else
formatcmd=""
fi
# Attach disk to xen
echo "xl block-attach 0 phy:${devname} xvda w" >> ${LOGFILE} 2>&1
xl block-attach 0 phy:${devname} xvda w >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error attaching partition ${part}"
exit 1
fi
# Loop for 20s to wait until /dev/xvdaX appears
i=0
while [ ! -b /dev/xvda${part} ]; do
((i++))
if [[ "$i" == '40' ]]; then
break;
fi
sleep 0.5
done
if [ ! -b /dev/xvda${part} ]; then
echo "${PREF} Partition ${part} creation error"
xenguest_detach_disk
exit 1
fi
if [ -n "${formatcmd}" ]; then
echo "${formatcmd} /dev/xvda${part}" >> ${LOGFILE} 2>&1
${formatcmd} /dev/xvda${part}
if [ $? -ne 0 ]; then
echo "${PREF} Cannot create partition ${part} FS"
xenguest_detach_disk
exit 1
fi
fi
case ${content} in
*.img*)
decompress=""
case ${content} in
*.img.gz)
decompress='zcat'
;;
*.img.bz2)
decompress='bzcat'
;;
*.img)
decompress='cat'
;;
*)
# invalid/unknown compression type
echo "${PREF} Invalid file format in disk ${content}"
xenguest_detach_disk
exit 1
;;
esac
# dd into partition
echo "xenguest-mkimage extract-disk-file ${guestfile} " \
"${content} | ${decompress} | dd of=/dev/xvda${part} " >> ${LOGFILE} 2>&1
xenguest-mkimage extract-disk-file ${guestfile} ${content} \
| ${decompress} | dd of=/dev/xvda${part} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Cannot populate partition ${part}"
xenguest_detach_disk
exit 1
fi
;;
*.tar*)
tararg=""
case ${content} in
*.tar.gz)
tararg="z"
;;
*.tar.bz2)
tararg="j"
;;
*.tar.xz)
tararg="J"
;;
*.tar)
tararg=""
;;
*)
# invalid/unknown tar type
echo "${PREF} Invalid file format in disk ${content}"
xenguest_detach_disk
exit 1
;;
esac
# must mount the partition and extract
mntdir=$(mktemp -d)
echo "mount /dev/xvda${part} ${mntdir}" >> ${LOGFILE} 2>&1
mount /dev/xvda${part} ${mntdir} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Cannot mount partition ${part}"
xenguest_detach_disk
rm -rf ${mntdir}
exit 1
fi
# tar and unmount
echo "xenguest-mkimage extract-disk-file ${guestfile}" \
"${content} | tar -C ${mntdir} -x${tararg}f - " \
>> ${LOGFILE} 2>&1
xenguest-mkimage extract-disk-file ${guestfile} ${content} \
| tar -C ${mntdir} -x${tararg}f - >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Cannot populate partition ${part}"
umount ${mntdir}
rm -rf ${mntdir}
xenguest_detach_disk
exit 1
fi
echo "umount ${mntdir}" >> ${LOGFILE} 2>&1
umount ${mntdir} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error unmounting ${part}"
xenguest_detach_disk
rm -rf ${mntdir}
exit 1
fi
rm -rf ${mntdir}
;;
*)
#invalid content type
;;
esac
# Detach disk
xenguest_detach_disk
fi
done
}
function xenguest_guest_create()
{
guestfile="$1"
guestname="$2"
# extract xenguest tar
# put xen config in etc ?
# if disk config file:
# disk init
# add partititions
echo "${PREF} Create ${guestname} using ${guestfile}"
rm -rf ${XENGUEST_CONF_BASE}/guests/${guestname}
mkdir -p ${XENGUEST_CONF_BASE}/guests/${guestname}
echo "xenguest-mkimage extract-config ${guestfile}" \
"${XENGUEST_CONF_BASE}/guests/${guestname}" >> ${LOGFILE} 2>&1
xenguest-mkimage extract-config ${guestfile} \
${XENGUEST_CONF_BASE}/guests/${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error extracting guest image"
exit 1
fi
# Set guest name inside config
echo "xenguest-mkimage update ${XENGUEST_CONF_BASE}/guests/${guestname}" \
"--xen-name=${guestname}" >> ${LOGFILE} 2>&1
xenguest-mkimage update ${XENGUEST_CONF_BASE}/guests/${guestname} \
--xen-name=${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error setting guest name"
exit 1
fi
xenguest_disk_init ${guestname} ${guestfile}
}
function xenguest_guest_remove()
{
guestname="$1"
devname="/dev/${XENGUEST_VOLUME_NAME}/${guestname}"
# check if guest had a volume
echo "lvs ${XENGUEST_VOLUME_NAME}/${guestname}" >> ${LOGFILE} 2>&1
lvs ${XENGUEST_VOLUME_NAME}/${guestname} >> ${LOGFILE} 2>&1
if [ $? -eq 0 ]; then
# Remove guest volume
echo "lvremove -y ${devname}" >> ${LOGFILE} 2>&1
lvremove -y ${devname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error removing volume ${guestname}"
exit 1
fi
fi
# remove guest files
rm -rf ${XENGUEST_CONF_BASE}/guests/${guestname}
}
function xenguest_guest_start()
{
guestname="${1}"
guestdir=${XENGUEST_CONF_BASE}/guests/${guestname}
# Get guest configuration
source ${guestdir}/params.cfg
pushd ${guestdir} > /dev/null 2>&1
# create config by merging all configurations together
cat guest.cfg $(find guest.d -type f 2> /dev/null) > ${guestname}.cfg
# Build init script lists (ignore non existing dirs errors,
# sort alphabetically and run global scripts first)
init_pre="$(find ${XENGUEST_CONF_BASE}/init.pre -type f 2> /dev/null | \
sort) $(find ${guestdir}/init.pre -type f 2> /dev/null | sort)"
init_d="$(find ${XENGUEST_CONF_BASE}/init.d -type f 2> /dev/null | \
sort) $(find ${guestdir}/init.d -type f 2> /dev/null | sort)"
init_post="$(find ${XENGUEST_CONF_BASE}/init.post -type f 2> /dev/null | \
sort) $(find ${guestdir}/init.post -type f 2> /dev/null | sort)"
# call pre init scripts
for f in ${init_pre}; do
echo "$f ${guestname}" >> ${LOGFILE} 2>&1
$f ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestname}.cfg
popd > /dev/null 2>&1
echo "${PREF} Error during pre init script of ${guestname}"
exit 1
fi
done
# Create non started guest
echo "xl create -p ${guestname}.cfg" >> ${LOGFILE} 2>&1
xl create -p ${guestname}.cfg >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestname}.cfg
popd > /dev/null 2>&1
echo "${PREF} Error starting ${guestname}"
exit 1
fi
# call init scripts
for f in ${init_d}; do
echo "$f ${guestname}" >> ${LOGFILE} 2>&1
$f ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestname}.cfg
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
popd > /dev/null 2>&1
echo "${PREF} Error during init script of ${guestname}"
exit 1
fi
done
# Start guest
echo "xl unpause ${guestname}" >> ${LOGFILE} 2>&1
xl unpause ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestname}.cfg
popd > /dev/null 2>&1
echo "${PREF} Error starting ${guestname}"
exit 1
fi
# call post init scripts
for f in ${init_post}; do
echo "$f ${guestname}" >> ${LOGFILE} 2>&1
$f ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
rm -f ${guestname}.cfg
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
popd > /dev/null 2>&1
echo "${PREF} Error during post init script of ${guestname}"
exit 1
fi
done
rm -f ${guestname}.cfg
popd > /dev/null 2>&1
}
function xenguest_guest_stop()
{
guestname="${1}"
echo "xl shutdown ${guestname}" >> ${LOGFILE} 2>&1
xl shutdown ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error stopping ${guestname}"
exit 1
fi
}
function check_guest_arg()
{
cmd="${1}"
guestname="${2:-}"
if [ -z "${guestname:-}" ]; then
echo "${PREF} Usage ${this} ${cmd} GUESTNAME"
exit 1
fi
}
function check_guest_exist()
{
guestname="${1}"
if [ ! -f ${XENGUEST_CONF_BASE}/guests/${guestname}/guest.cfg -o \
! -f ${XENGUEST_CONF_BASE}/guests/${guestname}/params.cfg ]; then
echo "${PREF} Invalid guest name: ${guestname}"
exit 1
fi
}
function check_guest_running()
{
guestname="${1}"
running=$(xl list | awk 'NR > 1 {print $1}' | grep "${guestname}" || echo)
if [ ! "${running}" = "${guestname}" ]; then
echo "${PREF} Guest ${guestname} is not running"
exit 1
fi
}
function check_guest_not_running()
{
guestname="${1}"
running=$(xl list | awk 'NR > 1 {print $1}' | grep "${guestname}" || echo)
if [ "${running}" = "${guestname}" ]; then
echo "${PREF} Guest ${guestname} is running"
exit 1
fi
}
cmd="${1:-help}"
arg1="${2:-}"
arg2="${3:-}"
case ${cmd} in
help|--help|-h|-?)
usage
exit 0
;;
create)
guestfile="${arg1}"
guestname="${arg2}"
if [ -z "${guestfile}" -o ! -f "${guestfile}" ]; then
echo "${PREF} Usage ${this} create XENGUEST_FILE [NAME]"
exit 1
fi
if [ -z "${guestname}" ]; then
guestname=$(basename ${guestfile} .xenguest)
fi
if [ -f ${XENGUEST_CONF_BASE}/guests/${guestname}/guest.cfg ]; then
# Guest already exist
echo "${PREF} A guest ${guestname} already exist"
exit 1
fi
xenguest_guest_create ${guestfile} ${guestname}
;;
remove)
guestname="${arg1:-}"
check_guest_arg ${cmd} ${guestname}
check_guest_exist ${guestname}
# We need to stop the guest first
running=$(xl list | awk 'NR > 1 {print $1}' | grep "${guestname}" \
|| echo)
if [ "${running}" = "${guestname}" ]; then
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error killing ${guestname}"
exit 1
fi
fi
xenguest_guest_remove ${guestname}
;;
start)
guestname="${arg1:-}"
check_guest_arg ${cmd} ${guestname}
check_guest_exist ${guestname}
check_guest_not_running ${guestname}
xenguest_guest_start ${guestname}
;;
stop|shutdown)
guestname="${arg1:-}"
check_guest_arg ${cmd} ${guestname}
check_guest_exist ${guestname}
check_guest_running ${guestname}
xenguest_guest_stop ${guestname}
;;
kill|destroy)
guestname="${arg1:-}"
check_guest_arg ${cmd} ${guestname}
check_guest_exist ${guestname}
check_guest_running ${guestname}
echo "xl destroy ${guestname}" >> ${LOGFILE} 2>&1
xl destroy ${guestname} >> ${LOGFILE} 2>&1
if [ $? -ne 0 ]; then
echo "${PREF} Error killing ${guestname}"
exit 1
fi
;;
list)
if [ -d ${XENGUEST_CONF_BASE}/guests ]; then
for f in $(find ${XENGUEST_CONF_BASE}/guests -mindepth 1 \
-maxdepth 1 -type d -exec basename {} \;); do
if [ -f ${XENGUEST_CONF_BASE}/guests/$f/guest.cfg ]; then
echo "$f"
fi
done
fi
;;
status)
guestname="${arg1}"
if [ -n "${guestname}" ]; then
check_guest_exist ${guestname}
if xl list | awk 'NR > 1 {print $1}' | grep "${guestname}" > \
/dev/null 2>&1; then
echo "${guestname}: Running"
else
echo "${guestname}: Stopped"
fi
else
guestlist=$($this list)
if [ -n "${guestlist}" ]; then
for f in ${guestlist}; do
$this status $f
done
fi
fi
;;
*)
echo "${PREF} Invalid argument ${cmd}"
exit 1
;;
esac
@@ -0,0 +1,772 @@
#!/bin/bash
# This script must be used to manipulate xenguest images
#
# xenguest image topology:
# params.cfg: guest global configuration file. Only edited using this script.
# guest.cfg: xen main configuration file. Only edited using this script.
# guest.d: directory contains files with custom xen configuration entries
# which are appended to guest.cfg before starting the guest
# files: directory where files used by xen configuration are stored
# disk.cfg: guest disk configuration file. Only edited using this script.
# (dtb, kernel image, etc)
# disk: directory where files for disk creation are stored
# init.[pre,d,post]: directories containing init pre, base and post scripts
set -u
set -e
this="$0"
IMAGE_TMPDIR=""
usage() {
cat <<EOF
Usage $this ACTION XENGUEST [ARGS]
Where XENGUEST is a xenguest image file or a xenguest directory.
The following actions are supported:
help Display this help
create Create a xenguest image
update Update/modify a xenguest image
partial Create partial xenguest image in a directory
pack Pack a xenguest directory into an image
check Check a xenguest image
dump-paramsconfig Display the guest configuration of a xenguest image
dump-xenconfig Display the xen configuration of a xenguest image
dump-diskconfig Display the disk configuration of a xenguest image
dump-init Display init scripts of a xenguest image
extract Extract a xenguest image content
extract-config Extract the guest configuration from a xenguest image
extract-disk-file Extract a disk file from a xenguest image
Use $this ACTION --help to have help on a specific action and its arguments.
EOF
}
usage-check() {
cat <<EOF
Usage $this check XENGUEST
Check a xenguest image or a xenguest directory.
EOF
}
usage-update-create() {
cat <<EOF
All arguments are handled in order.
Global configuration for the guest
--guest-config-reset reset guest global configuration
--set-param=PARAM disable parameter PARAM in guest global configuration
--set-param=PARAM=VAL set parameter PARAM to value VAL in guest global
configuration.
Example of parameters supported are:
GUEST_AUTOBOOT: if set to 1 (default), guest will be
automatically created and started during host init.
Xen configuration for the guest
--xen-reset-config reset xen guest configuration to default
--xen-name= disable name parameter in xen configuration
--xen-name=NAME set guest name in xen configuration
--xen-kernel= disable guest kernel parameter in xen configuration
--xen-kernel=FILE set guest kernel to FILE (file is added and xen
configuration is set to use it)
--xen-memory set guest memory size (in MB)
--xen-vcpus set guest number of virtual cpus
--xen-clean-extra set guest command line (extra) to an empty string
--xen-extra=ARG append ARG to the guest command line (with space)
use this several time to set command line.
To set the command line to "console=ttyS0 rw" do
--xen-extra=console=ttyS0 --xen-extra=rw
--xen-root= disable root parameter in xen configuration
--xen-root=ROOT set guest root in xen configuration
--xen-device-tree= disable device tree parameter in xen configuration
--xen-device-tree=FILE set guest device tree in xen configuration and add
file to xen files
--xen-disk= disable disk parameter in xen configuration
--xen-disk=DEV set guest disk to device DEV (phy:DEV,xvda,w is set)
--xen-append=FILE append FILE content to xen configuration
Xen files
--xen-add-file=SRC:DST add file SRC as file DST in the xenguest image.
If DST already exist in the image, it is overwritten.
DST must be the same as arguments passed to other
options (like --xen-kernel)
--xen-rm-file=DST remove file DST from the xenguest image.
Init configuration
This can be used to add init scripts for the guest. There are 3 possible init
scripts which are called at different time. The pre scripts are called first,
then the xen guest is created in pause and standard init scripts are called.
Finally the xen guest is started then the post init scripts are called.
Each script is called with the name of the guest as first argument and
multiple scripts can be added (they must have different names).
--init-script=FILE add FILE as init script
--init-pre=FILE add FILE as pre init script
--init-post=FILE add FILE as post init script
Disk configuration
--disk-reset-config reset disk guest configuration to default (no disk)
--disk-size=SZ set guest disk size (in GB)
--disk-device=DEV set device to be used to create the guest disk
if unset or set to an empty string, the volume will be
create in the default manager volume group.
--disk-add-part=DEF add a partition to the guest disk with definition DEF
a partition definition must have the following format:
ID:SIZE:FORMAT:CONTENT where:
- ID is the partition numeric ID (1 to 4)
- FORMAT is the filesystem format (supported formats
are none, vfat, swap, ext2, ext3 and ext4) or can be
left empty to not format
- CONTENT can be used to point to a file added using
--disk-add-file to be used as partition initial
content (tar file or img file)
--disk-rm-part=ID remove partition ID from the guest disk
--disk-add-file=SRC:DST add file SRC as disk file DST in the xenguest image.
DST can then be used as a partition CONTENT.
--disk--rm-file=DST remove disk file DST from the xenguest image.
EOF
}
usage-create() {
cat <<EOF
Usage $this create XENGUEST [ARGS]
Create a xenguest image as XENGUEST file.
EOF
usage-update-create
}
usage-update() {
cat <<EOF
Usage $this update XENGUEST [ARGS]
Update or modify a xenguest image or a xenguest directory.
EOF
usage-update-create
}
usage-pack() {
cat <<EOF
Usage $this pack XENGUEST DESTFILE
Pack a xenguest directory in XENGUEST to create a xenguest image DESTFILE.
EOF
}
usage-partial() {
cat <<EOF
Usage $this partial XENGUEST [ARGS]
Update or modify a partial xenguest image.
EOF
usage-update-create
}
usage-dump-paramsconfig() {
cat <<EOF
Usage $this dump-paramsconfig XENGUEST
Dump the guest parameters of a xenguest image or directory
EOF
}
usage-dump-xenconfig() {
cat <<EOF
Usage $this dump-xenconfig XENGUEST
Dump the xen configuration of a xenguest image or directory
EOF
}
usage-dump-diskconfig() {
cat <<EOF
Usage $this dump-diskconfig XENGUEST
Dump the disk configuration of a xenguest image or directory
EOF
}
usage-extract() {
cat <<EOF
Usage $this extract XENGUEST DESTDIR
Extract guest to DESTDIR
EOF
}
usage-extract-config() {
cat <<EOF
Usage $this extract-config XENGUEST DESTDIR
Extract guest configuration to DESTDIR
EOF
}
usage-extract-disk-file() {
cat <<EOF
Usage $this extract-disk-file XENGUEST DISKFILE
Extract disk file DISKFILE to stdout.
EOF
}
check_image() {
local tstfile=${1}
if [ ! -e ${tstfile} -o ! -w ${tstfile} ]; then
echo "Error: File ${tstfile} does not exist or is not writeable"
exit 1
fi
if [ -f ${tstfile} ]; then
# This is a xenguest file
local res=$(tar -tvf ${tstfile} ./guest.cfg ./disk.cfg \
./params.cfg > /dev/null 2>&1 || echo "error")
if [ -n "${res}" ]; then
echo "Error: File ${tstfile} is not a valid xenguest"
exit 1
fi
elif [ -d ${tstfile} ]; then
if [ ! -f ${tstfile}/guest.cfg -o ! -f ${tstfile}/disk.cfg -o \
! ${tstfile}/params.cfg ]; then
echo "Error: Directory ${tstfile} is not a valid xenguest"
exit 1
fi
fi
}
params_config_reset() {
cat <<EOF > ${IMAGE_TMPDIR}/params.cfg
# Xenguest-image guest global configuration
#
# !! This file must not be modified manually !!
#
# You can use xenguest-image to modify parameters.
#
# Guest auto boot during Dom0 init
GUEST_AUTOBOOT="1"
EOF
}
params_config_setparam() {
param="${1}"
shift
value="$@"
if [ -z "$value" ]; then
sed -i "/.*${param}=.*/d" ${IMAGE_TMPDIR}/params.cfg
elif grep -e "^${param}=" ${IMAGE_TMPDIR}/params.cfg > /dev/null; then
sed -i "s/${param}=\".*\"/${param}=\"${value}\"/" \
${IMAGE_TMPDIR}/params.cfg
else
echo "${param}=\"${value}\"" >> ${IMAGE_TMPDIR}/params.cfg
fi
}
xen_config_reset() {
cat <<EOF > ${IMAGE_TMPDIR}/guest.cfg
# Xenguest-image main configuraiton
#
# !! This file must not be modified manually !!
#
# You can use xenguest-image to modify parameters.
#
# You can add custom entries to configuration in the guest.d directory.
# Guest name (set by manager when guest is created)
# name = ""
# Guest memory size in MB
memory = 1024
# Number of VCPUS
vcpus = 1
# Guest command line
extra = "earlyprintk=xenboot console=hvc0 rw"
# Guest root filesystem device (from guest point of view)
# root = "/dev/xvda2"
# Disk that will be used by the guest (set by manager when guest is created)
# disk = ['phy:/dev/vg-xen/guestname,xvda,w']
EOF
}
get_param_file() {
param="${1}"
if grep ${param} ${IMAGE_TMPDIR}/guest.cfg > /dev/null 2>&1; then
echo "${IMAGE_TMPDIR}/guest.cfg"
else
if [ ! -f ${IMAGE_TMPDIR}/guest.d/${param}.cfg ]; then
mkdir -p ${IMAGE_TMPDIR}/guest.d
echo "# ${param} = \"\"" > ${IMAGE_TMPDIR}/guest.d/${param}.cfg
fi
echo "${IMAGE_TMPDIR}/guest.d/${param}.cfg"
fi
}
xen_config_disable_param() {
param="${1}"
dst=$(get_param_file ${param})
sed -i "s@.*\(${param} = .*\)\$@# \1@" ${dst}
}
xen_config_set_number() {
param="${1}"
shift
value="$@"
dst=$(get_param_file ${param})
sed -i "s@.*${param} = .*@${param} = ${value}@" ${dst}
}
xen_config_set_string() {
param="${1}"
shift
value="$@"
dst=$(get_param_file ${param})
sed -i "s@.*${param} = .*@${param} = \"${value}\"@" ${dst}
}
xen_config_append_string() {
param="${1}"
shift
value="$@"
dst=$(get_param_file ${param})
sed -i "s@.*${param} = \"\([^\"]*\)\"@${param} = \"\1 ${value}\"@" ${dst}
}
xen_config_set_list() {
param="${1}"
shift
value=$(echo $@ | tr " " ",")
dst=$(get_param_file ${param})
sed -i "s@.*${param} = .*@${param} = ['${value}']@" ${dst}
}
disk_config_reset() {
echo "DISK_SIZE=\"0\"" > ${IMAGE_TMPDIR}/disk.cfg
echo "DISK_DEVICE=\"\"" >> ${IMAGE_TMPDIR}/disk.cfg
}
disk_config_rm_part() {
partid=$1
sed -i "/DISK_PART${partid}=.*/d" ${IMAGE_TMPDIR}/disk.cfg
}
disk_config_add_part() {
partconf="${1}"
partid=$(echo ${partconf} | sed -e "s/:.*//")
partinfo=$(echo ${partconf} | sed -e "s/[^:]*://")
# Make sure we don't add the same partition twice
disk_config_rm_part ${partid}
echo "DISK_PART${partid}=\"${partinfo}\"" >> \
${IMAGE_TMPDIR}/disk.cfg
}
# We need an action as first argument
action="${1:-}"
if [ -z "${action}" ]; then
echo "Error: No ACTION provided"
usage
exit 1
fi
# Only help does not require a xenguest argument so treat this first
# while there we also check that user is asking for a supported action
case $action in
help|--help|-h|-?)
usage
exit 0
;;
check|create|update|pack|partial)
;;
dump-xenconfig|dump-diskconfig|dump-init|dump-paramsconfig)
;;
extract|extract-config|extract-disk-file)
;;
*)
echo "Error: Invalid action $action"
exit 1
;;
esac
# Second argument should be the file name or directory
guestfile="${2:-}"
# Handle user asking for help on a specific action
case $guestfile in
help|--help|-h|-?)
usage-${action}
exit 0
;;
esac
if [ -z "${guestfile}" ]; then
echo "Error: no GUESTFILE provided"
usage
exit 1
fi
shift 2
case ${action} in
check)
check_image ${guestfile}
echo "Image is OK"
exit 0
;;
dump-paramsconfig)
check_image ${guestfile}
echo "Guest configuration:"
if [ -f ${guestfile} ]; then
tar -xOf ${guestfile} ./params.cfg
else
cat ${guestfile}/params.cfg
fi
exit 0
;;
dump-xenconfig)
check_image ${guestfile}
echo "Xen configuration:"
if [ -f ${guestfile} ]; then
tar -xOf ${guestfile} ./guest.cfg
tar -xOf ${guestfile} ./guest.d 2> /dev/null || true
else
cat ${guestfile}/guest.cfg
cat ${guestfile}/guest.d/* 2> /dev/null || true
fi
echo
exit 0
;;
dump-diskconfig)
check_image ${guestfile}
echo "Disk configuration:"
if [ -f ${guestfile} ]; then
tar -xOf ${guestfile} ./disk.cfg
else
cat ${guestfile}/disk.cfg
fi
echo
exit 0
;;
dump-init)
check_image ${guestfile}
for init in init.d init-pre init-post; do
echo "=== ${init} ==="
if [ -f ${guestfile} ]; then
tar -xOf ${guestfile} ./${init} 2> /dev/null || \
echo "No ${init} scripts."
else
cat ${guestfile}/${init}/* 2> /dev/null || \
echo "No ${init} scripts."
fi
echo "==============="
echo
done
exit 0
;;
pack)
check_image ${guestfile}
if [ ! -d ${guestfile} ]; then
echo "Error: Pack can only be done on a xenguest directory"
exit 1
fi
if [ -z "${1:-}" ] || [ -f ${1} ]; then
echo "Error: No destination file or already existing file"
exit 1
fi
tar -C ${guestfile} -cf ${1} .
exit 0
;;
extract)
check_image ${guestfile}
if [ -d ${guestfile} ]; then
echo "Error: Cannot extract config from xenguest directory"
exit 1
fi
if [ -z "${1:-}" ] || [ ! -d ${1} ]; then
echo "Error: No destination directory for image extract"
exit 1
fi
tar -C ${1} -xf ${guestfile}
exit 0
;;
extract-config)
check_image ${guestfile}
if [ -d ${guestfile} ]; then
echo "Error: Cannot extract config from xenguest directory"
exit 1
fi
if [ -z "${1:-}" ] || [ ! -d ${1} ]; then
echo "Error: No destination directory for config extract"
exit 1
fi
#extract all but disk files
tar -C ${1} --exclude='./disk' -xf ${guestfile}
exit 0
;;
extract-disk-file)
check_image ${guestfile}
if [ -d ${guestfile} ]; then
echo "Error: Cannot extract disk file from xenguest directory" >&2
exit 1
fi
if [ -z "${1:-}" ]; then
echo "Error: No file to extract" >&2
exit 1
fi
tar -xOf ${guestfile} ./disk/${1}
exit 0
;;
create)
if [ -f ${guestfile} ]; then
echo "Error: File ${guestfile} already exist"
exit 1
elif [ -d ${guestfile} ]; then
if [ -n "$(ls -A ${guestfile})" ]; then
echo "Error: Directory ${guestfile} is not empty"
exit 1
fi
IMAGE_TMPDIR=$(realpath -m ${guestfile})
else
IMAGE_TMPDIR=$(mktemp -d)
fi
# Create initial content
params_config_reset
xen_config_reset
disk_config_reset
;;
update)
check_image ${guestfile}
if [ -f ${guestfile} ]; then
# Extract the image to update it
IMAGE_TMPDIR=$(mktemp -d)
tar -C ${IMAGE_TMPDIR} -xf ${guestfile}
else
IMAGE_TMPDIR=$(realpath -m ${guestfile})
fi
;;
partial)
if [ -e ${guestfile} -a ! -d ${guestfile} ]; then
echo "Error: Invalid partial output directory"
exit 1
fi
mkdir -p ${guestfile}
IMAGE_TMPDIR=$(realpath -m ${guestfile})
;;
*)
echo "Invalid action ${action}"
usage
exit 1
;;
esac
# Process command line arguments
for arg in "${@}"; do
case ${arg} in
--*=*)
optarg=$(echo ${arg} | sed -e "s/[^=]*=//")
;;
*)
optarg=""
;;
esac
case ${arg} in
--guest-reset-config)
params_config_reset
;;
--set-param=*=*)
param_name=$(echo $optarg | sed -e "s/=.*//")
param_value=$(echo $optarg | sed -e "s/[^=]*=//")
params_config_setparam "$param_name" "$param_value"
;;
--set-param=*)
params_config_setparam "$optarg"
;;
--xen-reset-config)
xen_config_create
;;
--xen-name=*)
if [ -z "${optarg}" ]; then
xen_config_disable_param "name"
else
xen_config_set_string "name" "${optarg}"
fi
;;
--xen-kernel=*)
if [ -z "${optarg}" ]; then
xen_config_disable_param "kernel"
rm -f ${IMAGE_TMPDIR}/files/kernel
else
if [ ! -f ${optarg} ]; then
echo "Error: invalid kernel file ${optarg}"
exit 1
fi
xen_config_set_string "kernel" "files/kernel"
mkdir -p ${IMAGE_TMPDIR}/files
install -m 644 ${optarg} ${IMAGE_TMPDIR}/files/kernel
fi
;;
--xen-memory=*)
xen_config_set_number "memory" ${optarg}
;;
--xen-vcpus=*)
xen_config_set_number "vcpus" ${optarg}
;;
--xen-clean-extra)
xen_config_set_string "extra" ""
;;
--xen-extra=*)
xen_config_append_string "extra" ${optarg}
;;
--xen-root=*)
if [ -z "${optarg}" ]; then
xen_config_disable_param "root"
else
xen_config_set_string "root" "${optarg}"
fi
;;
--xen-device-tree=*)
if [ -z "${optarg}" ]; then
xen_config_disable_param "device_tree"
rm -f ${IMAGE_TMPDIR}/files/guest.dtb
else
if [ ! -f ${optarg} ]; then
echo "Error: invalid dtb file ${optarg}"
exit 1
fi
xen_config_set_string "device_tree" "files/guest.dtb"
mkdir -p ${IMAGE_TMPDIR}/files
install -m 644 ${optarg} ${IMAGE_TMPDIR}/files/guest.dtb
fi
;;
--xen-disk=*)
if [ -z "${optarg}" ]; then
xen_config_disable_param "disk"
else
xen_config_set_list "disk" "phy:${optarg}" "xvda" "w"
fi
;;
--xen-append=*)
if [ ! -f ${optarg} ]; then
echo "Error: invalid xen append file ${optarg}"
exit 1
fi
mkdir -p ${IMAGE_TMPDIR}/guest.d
install -m 755 ${optarg} ${IMAGE_TMPDIR}/guest.d/.
;;
--xen-add-file=*)
src=$(echo "${optarg}" | sed -e "s/:.*//")
dst=$(echo "${optarg}" | sed -e "s/.*://")
if [ ! -f ${src} ]; then
echo "Error: Invalid file: ${src}"
rm -rf ${IMAGE_TMPDIR}
exit 1
fi
if [ -z "${dst}" ]; then
dst=$(basename ${src})
fi
mkdir -p ${IMAGE_TMPDIR}/files/$(dirname ${dst})
cp -f ${src} ${IMAGE_TMPDIR}/files/${dst}
;;
--xen-rm-file=*)
rm -f ${IMAGE_TMPDIR}/files/${optarg}
;;
--init-script=*|--init-pre=*|--init-post=*)
dst=""
case $arg in
--init-script=*)
dst="init.d"
;;
--init-pre=*)
dst="init.pre"
;;
--init-post=*)
dst="init.post"
;;
esac
if [ ! -f ${optarg} ]; then
echo "${optarg} does not point to a valid file"
exit 1
else
mkdir -p ${IMAGE_TMPDIR}/${dst}
install -m 755 ${optarg} ${IMAGE_TMPDIR}/${dst}/.
fi
;;
--disk-reset-config)
disk_config_reset
;;
--disk-size=*)
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${optarg}\"/" \
${IMAGE_TMPDIR}/disk.cfg
;;
--disk-device=*)
sed -i "s/DISK_DEVICE=.*/DISK_SIZE=\"${optarg}\"/" \
${IMAGE_TMPDIR}/disk.cfg
;;
--disk-add-part=*)
disk_config_add_part ${optarg}
;;
--disk-rm-part=*)
disk_config_rm_part ${optarg}
;;
--disk-add-file=*)
src=$(echo "${optarg}" | sed -e "s/:.*//")
dst=$(echo "${optarg}" | sed -e "s/.*://")
if [ ! -f ${src} ]; then
echo "Error: Invalid disk file: ${src}"
rm -rf ${IMAGE_TMPDIR}
exit 1
fi
if [ -z "${dst}" ]; then
dst=$(basename ${src})
fi
mkdir -p ${IMAGE_TMPDIR}/disk/$(dirname ${dst})
cp -f ${src} ${IMAGE_TMPDIR}/disk/${dst}
;;
--disk-rm-file=*)
rm -f ${IMAGE_TMPDIR}/disk/${optarg}
;;
*)
echo "Unsupported command: ${arg}"
exit 1
;;
esac
done
if [ ! -d ${guestfile} ]; then
# If the original guest was in a file we need to repack the file
# with the changes we did on it in the IMAGE_TMPDIR
rm -f ${guestfile}
tar -C ${IMAGE_TMPDIR} -cf ${guestfile} .
rm -rf ${IMAGE_TMPDIR}
fi
@@ -0,0 +1,3 @@
# Xenguest Network Bridge interface configuration
auto ###BRIDGE_NAME###
iface ###BRIDGE_NAME### inet dhcp
@@ -0,0 +1,44 @@
#!/bin/sh
#
# Xenguest Network Bridge init
# This script creates a network bridge and add host interfaces to it
# It will then be used by xen guests to connect to the external nework
#
INTFS="###BRIDGE_MEMBERS###"
BR_INTF="###BRIDGE_NAME###"
case "$1" in
start)
echo "Starting $BR_INTF"
brctl addbr $BR_INTF
for intf in $INTFS; do
echo "Adding $intf to $BR_INTF"
brctl addif $BR_INTF $intf
done
;;
status)
true
;;
stop)
echo "Stopping $BR_INTF"
ifdown $BR_INTF
brctl delbr $BR_INTF
;;
reload)
echo >&2 'Reload not available; use force-reload'; exit 1
;;
force-reload|restart)
echo "Restarting host-bridge"
$0 stop
$0 start
;;
*)
# do not advertise unreasonable commands that there is no reason
# to use with this device
echo $"Usage: $0 {start|stop|status|restart|force-reload}"
exit 1
esac
exit $?
@@ -0,0 +1,119 @@
# Create a xenguest base image
#
# This recipe creates a base image that is then extended by other recipes
# through xenguest-image class.
# xenguest image type is using this as base to add a kernel and a disk image
# to create a guest
#
# The recipe is also adding files in those directories to the xenguest image:
# - ${WORKDIR}/extend/disk-files: all files in this directory will be added to
# the guest disk files (using --disk-add-file)
# - ${WORKDIR}/extend/files: all files in this directory will be added to the
# guest xen files (using --xen-add-file)
# - ${WORKDIR}/extend/guest.d: all files in this directory will be added to
# the xen append configuration files (using --xen-append)
# - ${WORKDIR}/extend/init.[pre|post|d]: all files in those directories will
# be added to the corresponding init scripts (using --init-[pre|post|script])
# You can bbappend this recipe and put files in ${WORKDIR}/extend to add
# elements to the image.
#
DESCRIPTION = "Xenguest Base Image"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
#
# The following variables can contain SRC_URI compatible entries to add
# files to the xenguest image.
# You can set those variable in local.conf to add one or several files
# For example to add a boot.tar.gz file that has to be downloaded to the file
# useable for disk partition initialisation:
# XENGUEST_IMAGE_SRC_URI_DISK_FILES += "https://www.test.com/files/boot.tar.gz"
# Add disk files
XENGUEST_IMAGE_SRC_URI_DISK_FILES ??= ""
# Add xen files
XENGUEST_IMAGE_SRC_URI_XEN_FILES ??= ""
# Add xen configuration elements
XENGUEST_IMAGE_SRC_URI_XEN_CONFIG ??= ""
# Add pre init script
XENGUEST_IMAGE_SRC_URI_INIT_PRE ??= ""
# Add init script
XENGUEST_IMAGE_SRC_URI_INIT ??= ""
# Add post init script
XENGUEST_IMAGE_SRC_URI_INIT_POST ??= ""
S = "${WORKDIR}"
inherit deploy xenguest-image
# parse XENGUEST_IMAGE_SRC_URI_ variables and add them to SRC_URI
python __anonymous() {
def parse_extend_variable(d, varname, destdir):
list = d.getVar(varname)
if list:
for entry in list.split():
#Check the URL
try:
decode = bb.fetch.decodeurl(entry)
d.appendVar('SRC_URI', ' ' + entry + ';unpack=0;subdir=extend/' + destdir)
except:
bb.fatal("%s: %s contains an invalid URL: %s" \
% (d.getVar('PF'), varname, entry))
parse_extend_variable(d, 'XENGUEST_IMAGE_SRC_URI_DISK_FILES', 'disk-files')
parse_extend_variable(d, 'XENGUEST_IMAGE_SRC_URI_XEN_FILES', 'files')
parse_extend_variable(d, 'XENGUEST_IMAGE_SRC_URI_XEN_CONFIG', 'guest.d')
parse_extend_variable(d, 'XENGUEST_IMAGE_SRC_URI_INIT_PRE', 'init.pre')
parse_extend_variable(d, 'XENGUEST_IMAGE_SRC_URI_INIT', 'init.d')
parse_extend_variable(d, 'XENGUEST_IMAGE_SRC_URI_INIT_POST', 'init.post')
}
# Make sure we are removing old files before redoing a fetch
do_fetch[cleandirs] += "${WORKDIR}/extend"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install[noexec] = "1"
add_extend_files() {
local subdir="$1"
local cmd="$2"
local stripdest="${3:-n}"
if [ -d ${WORKDIR}/extend/$subdir ]; then
filelist=$(find ${WORKDIR}/extend/$subdir -type f)
if [ -n "$filelist" ]; then
for f in $filelist; do
if [ "$stripdest" = "y" ]; then
call_xenguest_mkimage update --$cmd=$f:$(basename $f)
else
call_xenguest_mkimage update --$cmd=$f
fi
done
fi
fi
}
do_deploy() {
# Create a new image
xenguest_image_create
# Add our extra files if any
add_extend_files "disk-files" "disk-add-file" "y"
add_extend_files "files" "xen-add-file" "y"
add_extend_files "guest.d" "xen-append"
add_extend_files "init.pre" "init-pre"
add_extend_files "init.d" "init-script"
add_extend_files "init.post" "init-post"
}
addtask deploy after do_install before do_build
@@ -0,0 +1,52 @@
# Xenguest manager recipe
#
# xenguest-manager is a tool to control xen guest (e.g. create, start, stop)
#
DESCRIPTION = "Xen Guest Manager"
LICENSE = "MIT"
SRC_URI = " \
file://xenguest-manager \
file://xenguest-init \
"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
S = "${WORKDIR}"
# Please refer to documentation/xenguest-manager.md for documentation on those
# parameters
XENGUEST_MANAGER_VOLUME_DEVICE ?= "/dev/sda2"
XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen"
XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
# We add an init script to create and start guests automatically
INITSCRIPT_NAME = "xenguest"
INITSCRIPT_PARAMS = "defaults 90"
inherit update-rc.d
do_compile() {
echo "XENGUEST_VOLUME_DEVICE=\"${XENGUEST_MANAGER_VOLUME_DEVICE}\"" > \
xenguest-manager.conf
echo "XENGUEST_VOLUME_NAME=\"${XENGUEST_MANAGER_VOLUME_NAME}\"" >> \
xenguest-manager.conf
echo "XENGUEST_GUEST_DIR=\"${XENGUEST_MANAGER_GUEST_DIR}\"" >> \
xenguest-manager.conf
}
do_install() {
install -d -m 755 ${D}${bindir}
install -m 755 xenguest-manager ${D}${bindir}/.
install -d -m 755 ${D}${sysconfdir}/xenguest
install -m 644 xenguest-manager.conf ${D}${sysconfdir}/xenguest/.
install -d -m 755 ${D}${sysconfdir}/init.d
install -m 755 xenguest-init ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
install -d -m 755 ${D}${XENGUEST_GUEST_DIR}
}
# Things that we need on the target
RDEPENDS_${PN} += "bash tar xenguest-mkimage lvm2 xen-tools parted e2fsprogs"
FILES_${PN} += "${bindir}/xenguest-manager \
${sysconfdir}/xenguest"
@@ -0,0 +1,31 @@
# Xenguest mkimage recipe
#
# xenguest-mkimage is a tool to create/modify images to be used as xen guests
# Produced images contains a xen configuration and several optional components
# (kernel, device-tree, disk definition and files, init scripts) which all
# together fully define a full xen guest
DESCRIPTION = "Xenguest mkimage tool"
LICENSE = "MIT"
SRC_URI = "file://xenguest-mkimage"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
S = "${WORKDIR}"
# Can be built native also to produce xenguest images during Yocto build
BBCLASSEXTEND = "native"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install() {
install -d -m 755 ${D}${bindir}
install -m 755 xenguest-mkimage ${D}${bindir}/.
}
# We need bash and tar
RDEPENDS_${PN} = "bash tar"
FILES_${PN} = "${bindir}/xenguest-mkimage"
@@ -0,0 +1,52 @@
# Recipe to handle xenguest network configuration
DESCRIPTION = "XenGuest Network Bridge"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
S = "${WORKDIR}"
# Please refer to documentation/xenguest-network-bridge.md for documentation on
# those parameters
XENGUEST_NETWORK_BRIDGE_NAME ?= "xenbr0"
XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0"
XENGUEST_NETWORK_BRIDGE_CONFIG ?= "xenguest-network-bridge-dhcp.cfg.in"
SRC_URI = " \
file://xenguest-network-bridge.in \
file://xenguest-network-bridge-dhcp.cfg.in \
file://network-bridge.sh.in \
"
# Bridge configurator needs to run before S01networking init script
# Prefix with a_ to make sure it is executed in runlevel 01 before others
INITSCRIPT_NAME = "a_xenguest-network-bridge"
INITSCRIPT_PARAMS = "defaults 01"
inherit update-rc.d
do_install() {
cat ${WORKDIR}/xenguest-network-bridge.in \
| sed -e "s,###BRIDGE_MEMBERS###,${XENGUEST_NETWORK_BRIDGE_MEMBERS}," \
| sed -e "s,###BRIDGE_NAME###,${XENGUEST_NETWORK_BRIDGE_NAME}," \
> ${WORKDIR}/xenguest-network-bridge
cat ${WORKDIR}/${XENGUEST_NETWORK_BRIDGE_CONFIG} \
| sed -e "s,###BRIDGE_NAME###,${XENGUEST_NETWORK_BRIDGE_NAME}," \
> ${WORKDIR}/xenguest-network-bridge.cfg
cat ${WORKDIR}/network-bridge.sh.in \
| sed -e "s,###BRIDGE_NAME###,${XENGUEST_NETWORK_BRIDGE_NAME}," \
> ${WORKDIR}/network-bridge.sh
install -d -m 755 ${D}${sysconfdir}/init.d
install -m 755 ${WORKDIR}/xenguest-network-bridge \
${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
install -d -m 755 ${D}${sysconfdir}/network/interfaces.d
install -m 755 ${WORKDIR}/xenguest-network-bridge.cfg \
${D}${sysconfdir}/network/interfaces.d/.
install -d -m 755 ${D}${sysconfdir}/xenguest/init.pre
install -m 755 ${WORKDIR}/network-bridge.sh \
${D}${sysconfdir}/xenguest/init.pre/.
}
RDEPENDS_${PN} += "bridge-utils"
FILES_${PN} += "${sysconfdir}/network/interfaces.d/xenguest-network-bridge.cfg"
FILES_${PN} += "${sysconfdir}/xenguest/init.pre/network-bridge.sh"
@@ -0,0 +1,38 @@
# Create a xenguest image with kernel but no rootfs or an external rootfs
DESCRIPTION = "Xenguest No Disk Image"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
S = "${WORKDIR}"
inherit deploy xenguest-image
# Name of the file we create in deploy
XENGUEST_IMAGE_NODISK_DEPLOY = "xenguest-nodisk-image.xenguest"
# use a local copy to pack all together
XENGUEST_IMAGE_DEPLOY_DIR = "${WORKDIR}/tmp-xenguest"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install[noexec] = "1"
do_deploy() {
xenguest_image_clone
# Add kernel to the image
if [ -n "${XENGUEST_IMAGE_KERNEL}" ]; then
call_xenguest_mkimage partial \
--xen-kernel=${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_KERNEL}
fi
# Pack and deploy the final image
rm -f ${DEPLOYDIR}/${XENGUEST_IMAGE_NODISK_DEPLOY}
call_xenguest_mkimage pack ${DEPLOYDIR}/${XENGUEST_IMAGE_NODISK_DEPLOY}
}
do_deploy[depends] += "virtual/kernel:do_deploy"
do_deploy[depends] += "xenguest-base-image:do_deploy"
addtask deploy before do_build after do_install
@@ -0,0 +1,5 @@
define KMACHINE arm64-autonomy-guest
define KTYPE standard
define KARCH arm64
include arm64-autonomy-guest.scc
@@ -0,0 +1,2 @@
CONFIG_ARM64=y
CONFIG_SMP=y
@@ -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
@@ -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
@@ -0,0 +1,4 @@
define KFEATURE_DESCRIPTION "Enable XEN Guest Frontend Drivers"
kconf non-hardware xen-guest.cfg
@@ -0,0 +1,38 @@
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
# For LVM2 we need Multiple Devices and Device Mapper support
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
@@ -0,0 +1,4 @@
define KFEATURE_DESCRIPTION "Enable XEN Host Drivers on autonomy systems"
kconf non-hardware xen-host.cfg
@@ -0,0 +1,3 @@
# Add arm-autonomy kernel support
require linux-arm-autonomy.inc
@@ -0,0 +1,22 @@
# 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)}"
# 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"
@@ -0,0 +1,155 @@
# Defines the disk.img image type
#
# Add an image type 'disk.img' which creates a disk image
# with up to 4 partitions
#
# For partition 1 (replace 1 by 2 for partition 2, and so on for 3 and 4):
#
# * DISK_IMG_PARTITION1_SIZE is the partition size in MB (1024 is 1 GB)
#
# * DISK_IMG_PARTITION1_FSTYPE is the file system to format the partition with.
# We support only ext files systems (ext2, ext3 and ext4)
# If this is empty, the partition will not be formated.
#
# * DISK_IMG_PARTITION1_CONTENT is the content to put in the filesystem.
# Only 'rootfs' is supported and will create a partition with the Yocto
# root filesystem.
#
# Default values for partition 1
DISK_IMG_PARTITION1_SIZE ??= "2048"
DISK_IMG_PARTITION1_FSTYPE ??= "ext4"
DISK_IMG_PARTITION1_CONTENT ??= "rootfs"
# Default values for partition 2
DISK_IMG_PARTITION2_SIZE ??= "0"
DISK_IMG_PARTITION2_FSTYPE ??= "ext2"
DISK_IMG_PARTITION2_CONTENT ??= ""
# Default values for partition 3
DISK_IMG_PARTITION3_SIZE ??= "0"
DISK_IMG_PARTITION3_FSTYPE ??= "ext4"
DISK_IMG_PARTITION3_CONTENT ??= ""
# Default values for partition 4
DISK_IMG_PARTITION4_SIZE ??= "0"
DISK_IMG_PARTITION4_FSTYPE ??= "ext4"
DISK_IMG_PARTITION4_CONTENT ??= ""
# Default disk sector size
DISK_IMG_SECTOR_SIZE ??= "512"
# We need mkfs.ext and parted tools to create our image (dd is always there)
do_image_disk_img[depends] += "e2fsprogs-native:do_populate_sysroot \
parted-native:do_populate_sysroot"
DISK_IMG_FILE = "${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.disk.img"
# Create one disk partition
disk_img_createpart() {
local imagefile="$1"
local start="$2"
local size="$3"
local fstype="${4:-ext4}"
local content="${5:-}"
local formatargs=""
set -x
rm -f $imagefile
# Create the partition image
dd if=/dev/zero of=$imagefile bs=${DISK_IMG_SECTOR_SIZE} count=0 \
seek=$(expr $size / ${DISK_IMG_SECTOR_SIZE})
if [ -n "$fstype" ]; then
case $content in
rootfs)
formatargs=" -d ${IMAGE_ROOTFS}"
;;
boot)
echo "Unsupported"
exit 1
;;
*)
esac
# Create the file system (with content if needed)
mkfs.$fstype -F $imagefile $formatargs
fi
cat $imagefile >> ${DISK_IMG_FILE}
# Add the partition to the partition table
parted -s ${DISK_IMG_FILE} unit B mkpart primary $start \
$(expr $start + $realsize - 1)
}
disk_img_create () {
local currpos
local realsize
set -x
currpos=${DISK_IMG_SECTOR_SIZE}
# Create reserved part for partition table (1MB)
dd if=/dev/zero of=${DISK_IMG_FILE} bs=${DISK_IMG_SECTOR_SIZE} count=0 \
seek=1
parted -s ${DISK_IMG_FILE} mklabel msdos
if [ ${DISK_IMG_PARTITION1_SIZE} -ne 0 ]; then
# Reduce the first block size of one sector to make space
# for the partition table
realsize=$(expr ${DISK_IMG_PARTITION1_SIZE} \* 1024 \* 1024 \
- ${DISK_IMG_SECTOR_SIZE})
# Create the partition
disk_img_createpart ${WORKDIR}/part1.img $currpos $realsize \
"${DISK_IMG_PARTITION1_FSTYPE}" "${DISK_IMG_PARTITION1_CONTENT}"
currpos=$(expr $currpos + $realsize)
fi
if [ ${DISK_IMG_PARTITION2_SIZE} -ne 0 ]; then
# Partition size
realsize=$(expr ${DISK_IMG_PARTITION2_SIZE} \* 1024 \* 1024)
# Create the partition
disk_img_createpart ${WORKDIR}/part2.img $currpos $realsize \
"${DISK_IMG_PARTITION2_FSTYPE}" "${DISK_IMG_PARTITION2_CONTENT}"
currpos=$(expr $currpos + $realsize)
fi
if [ ${DISK_IMG_PARTITION3_SIZE} -ne 0 ]; then
# Partition size
realsize=$(expr ${DISK_IMG_PARTITION3_SIZE} \* 1024 \* 1024)
# Create the partition
disk_img_createpart ${WORKDIR}/part3.img $currpos $realsize \
"${DISK_IMG_PARTITION3_FSTYPE}" "${DISK_IMG_PARTITION3_CONTENT}"
currpos=$(expr $currpos + $realsize)
fi
if [ ${DISK_IMG_PARTITION4_SIZE} -ne 0 ]; then
# Partition size
realsize=$(expr ${DISK_IMG_PARTITION4_SIZE} \* 1024 \* 1024)
# Create the partition
disk_img_createpart ${WORKDIR}/part4.img $currpos $realsize \
"${DISK_IMG_PARTITION4_FSTYPE}" "${DISK_IMG_PARTITION4_CONTENT}"
currpos=$(expr $currpos + $realsize)
fi
}
IMAGE_CMD_disk.img = "disk_img_create"
IMAGE_TYPES += "disk.img"
+13
View File
@@ -0,0 +1,13 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "meta-arm-bsp"
BBFILE_PATTERN_meta-arm-bsp = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-arm-bsp = "6"
LAYERDEPENDS_meta-arm-bsp = "core openembedded-layer meta-arm"
LAYERSERIES_COMPAT_meta-arm-bsp = "warrior zeus dunfell"
+25
View File
@@ -0,0 +1,25 @@
# Configuration for Cortex-A5 DesignStart development board
#@TYPE: Machine
#@NAME: a5ds machine
#@DESCRIPTION: Machine configuration for Cortex-A5 DesignStart
require conf/machine/include/tune-cortexa5.inc
PREFERRED_PROVIDER_virtual/kernel ?= "linux-upstream-arm"
PREFERRED_VERSION_linux-upstream-arm ?= "5.3%"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
SERIAL_CONSOLES = "115200;ttyAMA0"
IMAGE_FSTYPES += "tar.bz2 cpio.gz"
EXTRA_IMAGEDEPENDS += "u-boot"
# Cortex-a5 u-boot configuration
UBOOT_MACHINE = "designstart_ca5_defconfig"
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
@@ -0,0 +1,14 @@
# Configuration for Armv8-A Foundation
#@TYPE: Machine
#@NAME: Armv8-A Foundation Platform machine
#@DESCRIPTION: Machine configuration for Armv8-A Foundation Platform model
require conf/machine/fvp-common/fvp.inc
KERNEL_DEVICETREE = "arm/foundation-v8-gicv3-psci.dtb"
# Use haveged as a source of entropy instead of rng-tools (Needed for ssh).
# rngd (Part of rng-tools) takes ~7 mins to init resulting in a slow boot time.
PACKAGE_EXCLUDE_append = " rng-tools"
IMAGE_INSTALL_append = " haveged"
+14
View File
@@ -0,0 +1,14 @@
# Configuration for Armv8-A Base Platform FVP
#@TYPE: Machine
#@NAME: Armv8-A Base Platform FVP machine
#@DESCRIPTION: Machine configuration for Armv8-A Base Platform FVP model
require conf/machine/fvp-common/fvp.inc
KERNEL_DEVICETREE = "arm/fvp-base-gicv3-psci-custom.dtb"
# Use haveged as a source of entropy instead of rng-tools (Needed for ssh).
# rngd (Part of rng-tools) takes ~7 mins to init resulting in a slow boot time.
PACKAGE_EXCLUDE_append = " rng-tools"
IMAGE_INSTALL_append = " haveged"
@@ -0,0 +1,43 @@
# FVP common parameters
#
# Capturing FVP common configurations (Armv8-A Base Platform FVP and
# Armv8-A Foundation Platform).
#
TUNE_FEATURES = "aarch64"
require conf/machine/include/arm/arch-armv8a.inc
MACHINE_FEATURES = "optee"
KERNEL_IMAGETYPE = "Image"
IMAGE_CLASSES += "image_types_disk_img"
IMAGE_FSTYPES += "disk.img"
# Disk image configuration
# We don't use the first partition
DISK_IMG_PARTITION1_SIZE = "128"
DISK_IMG_PARTITION1_FSTYPE = ""
DISK_IMG_PARTITION1_CONTENT = ""
# Second partition is used for rootfs
DISK_IMG_PARTITION2_SIZE = "2048"
DISK_IMG_PARTITION2_FSTYPE = "ext4"
DISK_IMG_PARTITION2_CONTENT = "rootfs"
# Empty third partition (8G - 2048M - 128M)
DISK_IMG_PARTITION3_SIZE = "6016"
DISK_IMG_PARTITION3_FSTYPE = ""
DISK_IMG_PARTITION3_CONTENT = ""
SERIAL_CONSOLES = "115200;ttyAMA0"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "5.4%"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
# FVP u-boot configuration
UBOOT_MACHINE = "vexpress_aemv8a_semi_defconfig"
+53
View File
@@ -0,0 +1,53 @@
# Configuration for gem5 running on ARM64
#@TYPE: Machine
#@NAME: Gem5 arm64 machine
#@DESCRIPTION: Machine configuration for Gem5 arm64
TUNE_FEATURES = "aarch64"
require conf/machine/include/arm/arch-armv8a.inc
MACHINE_FEATURES = "optee pci"
KERNEL_IMAGETYPES = "Image vmlinux"
KERNEL_IMAGETYPE = "Image"
IMAGE_FSTYPES += "tar.bz2 ext4"
SERIAL_CONSOLES = "115200;ttyAMA0"
EXTRA_IMAGEDEPENDS += "virtual/gem5-bootloader"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "5.4%"
# Uncomment the following if you need to build gem5 provided bootloader, else
# using standard bootloader by Linux aarch64
# Use gem5 provided bootloader
# PREFERRED_PROVIDER_virtual/gem5-bootloader = "gem5-aarch64-bootloader"
# use the dtb stored in the kernel recipe
# KERNEL_DEVICETREE ?= "gem5-arm64/armv8_gem5_v2_4cpu.dtb"
# Use Linux aarch64 boot wrapper with FDT support and generated
# dtb (gem5-aarch64-dtb.bb)
PREFERRED_PROVIDER_virtual/gem5-bootloader = "boot-wrapper-aarch64"
BOOT_WRAPPER_AARCH64_CMDLINE ?= "\
earlyprintk=pl011,0x1c090000 console=ttyAMA0 root=/dev/vda rw mem=1G \
"
# Use baremetal profile and axf file so dtb is in axf file
GEM5_RUN_PROFILE = "configs/example/arm/baremetal.py"
GEM5_RUN_KERNEL = "linux-system.axf"
GEM5_RUN_EXTRA = ""
GEM5_RUN_DTB = ""
GEM5_RUN_CMDLINE = ""
EXTRA_IMAGEDEPENDS += "gem5-aarch64-native"
# Use haveged as a source of entropy instead of rng-tools (Needed for ssh).
# rngd (Part of rng-tools) takes ~7 mins to init resulting in a slow boot time.
PACKAGE_EXCLUDE_append = " rng-tools"
IMAGE_INSTALL_append = " haveged"
+28
View File
@@ -0,0 +1,28 @@
# Configuration for juno development board
#@TYPE: Machine
#@NAME: Juno machine
#@DESCRIPTION: Machine configuration for Juno
TUNE_FEATURES = "aarch64"
require conf/machine/include/arm/arch-armv8a.inc
MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth optee pci"
KERNEL_IMAGETYPE = "Image"
KERNEL_DEVICETREE = "arm/juno.dtb arm/juno-r1.dtb arm/juno-r2.dtb"
IMAGE_FSTYPES += "tar.bz2 ext4"
SERIAL_CONSOLES = "115200;ttyAMA0"
# Use kernel provided by linaro (Contains support for SCMi or HDMI)
PREFERRED_PROVIDER_virtual/kernel ?= "linux-linaro-arm"
PREFERRED_VERSION_linux-linaro-arm ?= "4.19%"
PREFERRED_VERSION_trusted-firmware-a ?= "2.1%"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot firmware-image-juno"
# Juno u-boot configuration
UBOOT_MACHINE = "vexpress_aemv8a_juno_defconfig"
+23
View File
@@ -0,0 +1,23 @@
# Configuration for Arm N1SDP development board
#@TYPE: Machine
#@NAME: N1SDP machine
#@DESCRIPTION: Machine configuration for N1SDP
TUNE_FEATURES = "aarch64"
require conf/machine/include/arm/arch-armv8a.inc
KERNEL_IMAGETYPE = "Image"
KERNEL_DEVICETREE = "n1sdp/n1sdp.dtb"
IMAGE_FSTYPES += "tar.bz2 ext4"
SERIAL_CONSOLES = "115200;ttyAMA0"
# Use kernel provided by linaro (Contains support for SCMi or HDMI)
PREFERRED_PROVIDER_virtual/kernel ?= "linux-linaro-arm"
PREFERRED_VERSION_linux-linaro-arm ?= "5.4%"
# RTL8168E Gigabit Ethernet Controller is attached to the PCIe interface
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
+24
View File
@@ -0,0 +1,24 @@
# Cortex-A5 DesignStart A5DS Platform Support in meta-arm-platforms
## Howto Build and Run
### Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "a5ds"
DISTRO ?= "iota-tiny"
Or set environment variables with that values:
MACHINE "a5ds"
DISTRO "iota-tiny"
### Build:
``bash$ bitbake iota-tiny-image```
### Run:
To run the result in a Fixed Virtual Platform please get:
https://git.linaro.org/landing-teams/working/arm/model-scripts
and follow the instructions in the readme.txt file in that
repository.
@@ -0,0 +1,50 @@
# Armv8-A Base Platform Support in meta-arm-platforms
## Howto Build and Run
### Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "foundation-v8"
### Build:
```bash$ bitbake core-image-minimal```
### Run:
To Run the Fixed Virtual Platform simulation tool you must download "Armv8-A
Foundation Platform" from Arm developer (This might require the user to
register) from this address:
https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
and install it on your host PC.
Fast Models Fixed Virtual Platforms (FVP) Reference Guide:
https://developer.arm.com/docs/100966/latest
Armv8A Foundation Platform User Guide:
https://developer.arm.com/docs/100961/latest/
Once done, do the following to build and run an image:
```bash$ bitbake core-image-minimal```
```bash$ export YOCTO_DEPLOY_IMGS_DIR="<yocto-build-dir/tmp/deploy/images/foundation-v8>"```
```bash$ cd <path-to-Foundation_Platformpkg-dir/models/Linux64_GCC-X.X/>```
```
bash$ ./Foundation_Platform --cores=4 --no-sve --gicv3 \
--data=${YOCTO_DEPLOY_IMGS_DIR}/bl1-fvp.bin@0x0 \
--data=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \
--data=${YOCTO_DEPLOY_IMGS_DIR}/foundation-v8-gicv3-psci.dtb@0x83000000 \
--block-device=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-foundation-armv8.disk.img \
```
If you have built a configuration without a ramdisk, you can use the following
command in U-boot to start Linux:
```VExpress64# booti 0x80080000 - 0x83000000```
## Devices supported in the kernel
- serial
- virtio disk
- network
- watchdog
- rtc
## Devices not supported or not functional
None
+53
View File
@@ -0,0 +1,53 @@
# Armv8-A Base Platform FVP Support in meta-arm-platforms
## Howto Build and Run
### Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "fvp-base"
### Build:
```bash$ bitbake core-image-minimal```
### Run:
To Run the Fixed Virtual Platform simulation tool you must download "Armv8-A
Base Platform FVP" from Arm developer (This might require the user to
register) from this address:
https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
and install it on your host PC.
Fast Models Fixed Virtual Platforms (FVP) Reference Guide:
https://developer.arm.com/docs/100966/latest
Armv8A Foundation Platform User Guide:
https://developer.arm.com/docs/100961/latest/
Once done, do the following to build and run an image:
```bash$ bitbake core-image-minimal```
```bash$ export YOCTO_DEPLOY_IMGS_DIR="<yocto-build-dir/tmp/deploy/images/fvp-base>"```
```bash$ cd <path-to-Base_RevC_AEMv8A_pkg-dir/models/Linux64_GCC-X.X/>```
```
bash$ ./FVP_Base_RevC-2xAEMv8A -C bp.virtio_net.enabled=1 \
-C cache_state_modelled=0 \
-C bp.secureflashloader.fname=${YOCTO_DEPLOY_IMGS_DIR}/bl1-fvp.bin \
-C bp.flashloader0.fname=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin \
--data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \
--data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/fvp-base-gicv3-psci-custom.dtb@0x83000000 \
-C bp.virtioblockdevice.image_path=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-foundation-armv8.disk.img \
```
If you have built a configuration without a ramdisk, you can use the following
command in U-boot to start Linux:
```VExpress64# booti 0x80080000 - 0x83000000```
## Devices supported in the kernel
- serial
- virtio disk
- network
- watchdog
- rtc
## Devices not supported or not functional
None
+29
View File
@@ -0,0 +1,29 @@
# Gem5 Arm64 Platform Support in meta-arm-platforms
## Howto Build and Run
### Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "gem5-arm64"
### Build:
```bash$ bitbake core-image-minimal```
### Run:
After compilation of an image, you can execute it using the compiled gem5
with the followin command:
```./tmp/deploy/tools/start-gem5.sh```
You can modify the script to change the command line options of gem5.
## Devices supported in the kernel
- serial
### Untested:
- pci
- sata
- ide
## Devices not supported or not functional
+75
View File
@@ -0,0 +1,75 @@
# Juno Development Platform Support in meta-arm-platforms
## Howto Build and Run
### Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "juno"
Juno is using a USB hard drive for root filesystem by default. The distribution
used must have ```usbhost``` and ```usbgadget``` in DISTRO_FEATURES (this is
the case in poky distribution).
### Build:
```bash$ bitbake core-image-minimal```
### Update Juno SD card:
The SD card content is generated during the build here:
tmp/deploy/images/juno/firmware-image-juno.tar.gz
Its content must be written on the Juno firmware SD card.
To do this:
- insert the sdcard of the Juno in an SD card reader and mount it:
```bash$ sudo mount /dev/sdx1 /mnt```
(replace sdx by the device of the SD card)
- erase its content and put the new one:
```bash$ sudo rm -rf /mnt/*```
```bash$ sudo tar --no-same-owner -xzf tmp/deploy/images/juno/firmware-image-juno.tar.gz -C /mnt/```
```bash$ sudo umount /mnt```
- reinsert the SD card in the Juno board
### Create an USB hard drive:
Linux root file system should be stored on the second partition of an USB
drive that must be plugged on the Juno Platform.
This partition should be initialized with the content of the filesystem
generated by yocto that you can find here:
tmp/deploy/images/juno/core-image-minimal-juno.tar.bz2
To do this
- Format a USB disk, create two primary partitions (ext4).
- mount the secondary partition
- untar tmp/deploy/images/juno/core-image-minimal-juno.tar.bz2 on to the
secondary partition.
### Run:
You must insert the SD card and the USB drive and power-on the Juno board.
The console should be available on the second serial line:
screen -L /dev/tty.usbserial 115200
On the first boot the images will be flashed which can take some time.
## Devices supported in the kernel
- serial
- usb
- network
- watchdog
- rtc
- mmc
### Untested:
- i2c
- dma
- pci
- sata
- sound
## Devices not supported or not functional
- framebuffer: not functional
The HDMI is not properly detected.
- GPU (no user land libraries).
The mali-midgard-kernel can be used to have a kernel driver
@@ -0,0 +1,87 @@
SUMMARY = "Linux aarch64 boot wrapper with FDT support"
LICENSE = "BSD"
inherit autotools deploy
PROVIDES = "virtual/gem5-bootloader boot-wrapper-aarch64"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE ?= ""
# Device tree to put in the image
# by default use the standard kernel devicetree
# This should be overwritten if the devicetree is not generated
# by the kernel.
# This should point to a file in the deploy image directory
BOOT_WRAPPER_AARCH64_DEVICETREE ??= "${KERNEL_DEVICETREE}"
# Kernel image to put in the image
# This should point to a file in the deploy image directory
BOOT_WRAPPER_AARCH64_KERNEL ??= "Image"
# Kernel command line for the image
BOOT_WRAPPER_AARCH64_CMDLINE ??= "rw"
# Image generated by boot wrapper
BOOT_WRAPPER_AARCH64_IMAGE ??= "linux-system.axf"
DEPENDS += "virtual/kernel dtc-native"
EXTRA_OECONF += "--with-kernel-dir=${WORKDIR}/kernel"
EXTRA_OECONF += "--with-dtb=${WORKDIR}/kernel/dummy.dtb"
EXTRA_OECONF += "--with-cmdline=\"\""
EXTRA_OECONF += "--enable-psci --enable-gicv3"
# unset LDFLAGS solves this error when compiling kernel modules:
# aarch64-poky-linux-ld: unrecognized option '-Wl,-O1'
EXTRA_OEMAKE += "'LDFLAGS= --gc-sections '"
# Strip prefix if any
REAL_DTB = "${@os.path.basename(d.getVar('BOOT_WRAPPER_AARCH64_DEVICETREE'))}"
EXTRA_OEMAKE += "'KERNEL_DTB=${DEPLOY_DIR_IMAGE}/${REAL_DTB}'"
EXTRA_OEMAKE += "'KERNEL_IMAGE=${DEPLOY_DIR_IMAGE}/${BOOT_WRAPPER_AARCH64_KERNEL}'"
EXTRA_OEMAKE += "'CMDLINE=${BOOT_WRAPPER_AARCH64_CMDLINE}'"
do_configure_prepend() {
# Create dummy files to make configure happy.
# We will pass the generated ones directly to make.
mkdir -p ${WORKDIR}/kernel/arch/arm64/boot
echo "dummy" > ${WORKDIR}/kernel/arch/arm64/boot/Image
echo "dummy" > ${WORKDIR}/kernel/dummy.dtb
# Generate configure
(cd ${S} && autoreconf -i || exit 1)
}
do_compile[noexec] = "1"
do_install[noexec] = "1"
# We need the kernel to create an image
do_deploy[depends] += "virtual/kernel:do_deploy"
do_deploy() {
if [ ! -f ${DEPLOY_DIR_IMAGE}/${REAL_DTB} ]; then
echo "ERROR: cannot find ${REAL_DTB} in ${DEPLOY_DIR_IMAGE}" >&2
echo "Please check your BOOT_WRAPPER_AARCH64_DEVICETREE settings" >&2
exit 1
fi
if [ ! -f ${DEPLOY_DIR_IMAGE}/${BOOT_WRAPPER_AARCH64_KERNEL} ]; then
echo "ERROR: cannot find ${BOOT_WRAPPER_AARCH64_KERNEL}" \
" in ${DEPLOY_DIR_IMAGE}" >&2
echo "Please check your BOOT_WRAPPER_AARCH64_KERNEL settings" >&2
exit 1
fi
oe_runmake clean
oe_runmake all
install -D -p -m 644 ${BOOT_WRAPPER_AARCH64_IMAGE} \
${DEPLOYDIR}/linux-system.axf
}
addtask deploy before do_build after do_compile
@@ -0,0 +1,27 @@
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=bb63326febfb5fb909226c8e7ebcef5c"
SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git"
PV = "git${SRCPV}"
S = "${WORKDIR}/git"
SRCREV = "fd74c8cbd0e17483d2299208cad9742bee605ca7"
BPN = "boot-wrapper-aarch64"
require boot-wrapper-aarch64.inc
# Gem5 aarch64 support
COMPATIBLE_MACHINE_gem5_arm64 = "gem5-arm64"
# For gem5 we use the dtb generated by gem5 directly
DEPENDS_append_gem5-arm64 = " gem5-aarch64-dtb"
BOOT_WRAPPER_AARCH64_DEVICETREE_gem5-arm64 = "gem5-aarch64.dtb"
# The dtb must be generated for us to generate the axf
DEPLOY_DEPEND_LIST ?= ""
DEPLOY_DEPEND_LIST_gem5-arm64 = " gem5-aarch64-dtb:do_deploy"
do_deploy[depends] += "${DEPLOY_DEPEND_LIST}"
@@ -0,0 +1,38 @@
DESCRIPTION = "System Control Processor (SCP) firmware for Juno"
HOMEPAGE = "https://github.com/ARM-software/SCP-firmware"
LICENSE = "BSD-3-Clause"
SECTION = "firmware"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "juno"
PROVIDES += "virtual/scp-firmware"
# For now, for juno we retrieve the SCP firmware in binary format
# from Linaro Releases.
SRC_URI = "http://releases.linaro.org/members/arm/platforms/${PV}/juno-latest-oe-uboot.zip;subdir=${UNPACK_DIR}"
SRC_URI[md5sum] = "01b662b81fa409d55ff298238ad24003"
SRC_URI[sha256sum] = "b8a3909bb3bc4350a8771b863193a3e33b358e2a727624a77c9ecf13516cec82"
UNPACK_DIR = "juno-firmware"
S = "${WORKDIR}/${UNPACK_DIR}"
SCP_FIRMWARE_BINARIES = "scp_bl1.bin scp_bl2.bin"
inherit nopackages
do_configure[noexec] = "1"
do_configure[compile] = "1"
do_install() {
install -d ${D}/firmware
for file in ${SCP_FIRMWARE_BINARIES}; do
install -m 644 ${S}/SOFTWARE/${file} ${D}/firmware
done
}
SYSROOT_DIRS += "/firmware"
@@ -0,0 +1,75 @@
DESCRIPTION = "Firmware Image for Juno to be copied to the Configuration \
microSD card"
LICENSE = "BSD-3-Clause"
SECTION = "firmware"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9"
DEPENDS = "virtual/trusted-firmware-a virtual/kernel"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "juno"
LINARO_RELEASE = "19.06"
SRC_URI = "http://releases.linaro.org/members/arm/platforms/${LINARO_RELEASE}/juno-latest-oe-uboot.zip;subdir=${UNPACK_DIR} \
file://images-r0.txt \
file://images-r1.txt \
file://images-r2.txt \
file://uEnv.txt \
"
SRC_URI[md5sum] = "01b662b81fa409d55ff298238ad24003"
SRC_URI[sha256sum] = "b8a3909bb3bc4350a8771b863193a3e33b358e2a727624a77c9ecf13516cec82"
UNPACK_DIR = "juno-firmware-${LINARO_RELEASE}"
inherit deploy nopackages
do_configure[noexec] = "1"
do_compile[noexec] = "1"
# The ${D} is used as a temporary directory and we don't generate any
# packages for this recipe.
do_install() {
cp -a ${WORKDIR}/${UNPACK_DIR} ${D}
cp -f ${RECIPE_SYSROOT}/firmware/bl1-juno.bin \
${D}/${UNPACK_DIR}/SOFTWARE/bl1.bin
cp -f ${RECIPE_SYSROOT}/firmware/fip-juno.bin \
${D}/${UNPACK_DIR}/SOFTWARE/fip.bin
# u-boot environment file
cp -f ${WORKDIR}/uEnv.txt ${D}/${UNPACK_DIR}/SOFTWARE/
# Juno images list file
cp -f ${WORKDIR}/images-r0.txt ${D}/${UNPACK_DIR}/SITE1/HBI0262B/images.txt
cp -f ${WORKDIR}/images-r1.txt ${D}/${UNPACK_DIR}/SITE1/HBI0262C/images.txt
cp -f ${WORKDIR}/images-r2.txt ${D}/${UNPACK_DIR}/SITE1/HBI0262D/images.txt
}
do_deploy() {
# To avoid dependency loop between firmware-image-juno:do_install
# and virtual/kernel:do_deploy when INITRAMFS_IMAGE_BUNDLE = "1",
# we need to handle the kernel binaries copying in the do_deploy
# task.
for f in ${KERNEL_DEVICETREE}; do
install -m 755 -c ${DEPLOY_DIR_IMAGE}/$(basename $f) \
${D}/${UNPACK_DIR}/SOFTWARE/.
done
if [ "${INITRAMFS_IMAGE_BUNDLE}" -eq 1 ]; then
cp -L -f ${DEPLOY_DIR_IMAGE}/Image-initramfs-juno.bin \
${D}/${UNPACK_DIR}/SOFTWARE/Image
else
cp -L -f ${DEPLOY_DIR_IMAGE}/Image ${D}/${UNPACK_DIR}/SOFTWARE/
fi
# Compress the files
tar -C ${D}/${UNPACK_DIR} -zcvf ${WORKDIR}/${PN}.tar.gz ./
# Deploy the compressed archive to the deploy folder
install -D -p -m0644 ${WORKDIR}/${PN}.tar.gz ${DEPLOYDIR}/${PN}.tar.gz
}
do_deploy[depends] += "virtual/kernel:do_deploy"
addtask deploy after do_install
@@ -0,0 +1,71 @@
TITLE: Versatile Express Images Configuration File
[IMAGES]
TOTALIMAGES: 10 ;Number of Images (Max: 32)
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR0ADDRESS: 0x00000000 ;Image Flash Address
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
NOR0LOAD: 00000000 ;Image Load Address
NOR0ENTRY: 00000000 ;Image Entry Point
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
NOR1LOAD: 00000000 ;Image Load Address
NOR1ENTRY: 00000000 ;Image Entry Point
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR2ADDRESS: 0x00500000 ;Image Flash Address
NOR2FILE: \SOFTWARE\Image ;Image File Name
NOR2NAME: norkern ;Rename kernel to norkern
NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x025C0000 ;Image Flash Address
NOR4FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR5ADDRESS: 0x03E40000 ;Image Flash Address
NOR5FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
NOR5LOAD: 00000000 ;Image Load Address
NOR5ENTRY: 00000000 ;Image Entry Point
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR6ADDRESS: 0x0BF00000 ;Image Flash Address
NOR6FILE: \SOFTWARE\startup.nsh ;Image File Name
NOR6NAME: startup.nsh
NOR6LOAD: 00000000 ;Image Load Address
NOR6ENTRY: 00000000 ;Image Entry Point
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR7ADDRESS: 0x0BFC0000 ;Image Flash Address
NOR7FILE: \SOFTWARE\blank.img ;Image File Name
NOR7NAME: BOOTENV
NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x02600000 ;Image Flash Address
NOR8FILE: \SOFTWARE\selftest ;Image File Name
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02780000 ;Image Flash Address
NOR9NAME: uEnv.txt
NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
NOR9ENTRY: 00000000 ;Image Entry Point
@@ -0,0 +1,71 @@
TITLE: Versatile Express Images Configuration File
[IMAGES]
TOTALIMAGES: 10 ;Number of Images (Max: 32)
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR0ADDRESS: 0x00000000 ;Image Flash Address
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
NOR0LOAD: 00000000 ;Image Load Address
NOR0ENTRY: 00000000 ;Image Entry Point
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
NOR1LOAD: 00000000 ;Image Load Address
NOR1ENTRY: 00000000 ;Image Entry Point
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR2ADDRESS: 0x00500000 ;Image Flash Address
NOR2FILE: \SOFTWARE\Image ;Image File Name
NOR2NAME: norkern ;Rename kernel to norkern
NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno-r1.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x025C0000 ;Image Flash Address
NOR4FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR5ADDRESS: 0x03E40000 ;Image Flash Address
NOR5FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
NOR5LOAD: 00000000 ;Image Load Address
NOR5ENTRY: 00000000 ;Image Entry Point
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR6ADDRESS: 0x0BF00000 ;Image Flash Address
NOR6FILE: \SOFTWARE\startup.nsh ;Image File Name
NOR6NAME: startup.nsh
NOR6LOAD: 00000000 ;Image Load Address
NOR6ENTRY: 00000000 ;Image Entry Point
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR7ADDRESS: 0x0BFC0000 ;Image Flash Address
NOR7FILE: \SOFTWARE\blank.img ;Image File Name
NOR7NAME: BOOTENV
NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x02600000 ;Image Flash Address
NOR8FILE: \SOFTWARE\selftest ;Image File Name
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02780000 ;Image Flash Address
NOR9NAME: uEnv.txt
NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
NOR9ENTRY: 00000000 ;Image Entry Point
@@ -0,0 +1,71 @@
TITLE: Versatile Express Images Configuration File
[IMAGES]
TOTALIMAGES: 10 ;Number of Images (Max: 32)
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR0ADDRESS: 0x00000000 ;Image Flash Address
NOR0FILE: \SOFTWARE\fip.bin ;Image File Name
NOR0LOAD: 00000000 ;Image Load Address
NOR0ENTRY: 00000000 ;Image Entry Point
NOR1UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR1ADDRESS: 0x03EC0000 ;Image Flash Address
NOR1FILE: \SOFTWARE\bl1.bin ;Image File Name
NOR1LOAD: 00000000 ;Image Load Address
NOR1ENTRY: 00000000 ;Image Entry Point
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR2ADDRESS: 0x00500000 ;Image Flash Address
NOR2FILE: \SOFTWARE\Image ;Image File Name
NOR2NAME: norkern ;Rename kernel to norkern
NOR2LOAD: 00000000 ;Image Load Address
NOR2ENTRY: 00000000 ;Image Entry Point
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR3ADDRESS: 0x02700000 ;Image Flash Address
NOR3FILE: \SOFTWARE\juno-r2.dtb ;Image File Name
NOR3NAME: board.dtb ;Specify target filename to preserve file extension
NOR3LOAD: 00000000 ;Image Load Address
NOR3ENTRY: 00000000 ;Image Entry Point
NOR4UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR4ADDRESS: 0x025C0000 ;Image Flash Address
NOR4FILE: \SOFTWARE\hdlcdclk.dat ;Image File Name
NOR4LOAD: 00000000 ;Image Load Address
NOR4ENTRY: 00000000 ;Image Entry Point
NOR5UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR5ADDRESS: 0x03E40000 ;Image Flash Address
NOR5FILE: \SOFTWARE\scp_bl1.bin ;Image File Name
NOR5LOAD: 00000000 ;Image Load Address
NOR5ENTRY: 00000000 ;Image Entry Point
NOR6UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR6ADDRESS: 0x0BF00000 ;Image Flash Address
NOR6FILE: \SOFTWARE\startup.nsh ;Image File Name
NOR6NAME: startup.nsh
NOR6LOAD: 00000000 ;Image Load Address
NOR6ENTRY: 00000000 ;Image Entry Point
NOR7UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR7ADDRESS: 0x0BFC0000 ;Image Flash Address
NOR7FILE: \SOFTWARE\blank.img ;Image File Name
NOR7NAME: BOOTENV
NOR7LOAD: 00000000 ;Image Load Address
NOR7ENTRY: 00000000 ;Image Entry Point
NOR8UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR8ADDRESS: 0x02600000 ;Image Flash Address
NOR8FILE: \SOFTWARE\selftest ;Image File Name
NOR8LOAD: 00000000 ;Image Load Address
NOR8ENTRY: 00000000 ;Image Entry Point
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
NOR9ADDRESS: 0x02780000 ;Image Flash Address
NOR9NAME: uEnv.txt
NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
NOR9LOAD: 00000000 ;Image Load Address
NOR9ENTRY: 00000000 ;Image Entry Point
@@ -0,0 +1,11 @@
uenvcmd=run mybootcmd
mybootcmd=echo Loading custom boot command; \
echo Loading kernel; \
afs load ${kernel_name} ${kernel_addr} ; \
if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr}; fi; \
echo Loading device tree; \
afs load ${fdtfile} ${fdt_addr}; \
if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \
afs load ${fdt_alt_name} ${fdt_addr}; fi; fdt addr ${fdt_addr}; fdt resize; \
booti ${kernel_addr} - ${fdt_addr};
@@ -0,0 +1,31 @@
From d3cadbc6f1060020960dc05af0465db919bbbe2b Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Fri, 30 Aug 2019 13:38:44 +0100
Subject: [PATCH] plat/arm: a5ds: move dtb to a new address
When Using bigger kernel images (>8.4MB compressed zImage) and at
decompress and final location init stage of kernel start makes it
override dtb at this address, to avoid this move the dtb a little
higher in address related.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
plat/arm/board/a5ds/fdts/a5ds_tb_fw_config.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plat/arm/board/a5ds/fdts/a5ds_tb_fw_config.dts b/plat/arm/board/a5ds/fdts/a5ds_tb_fw_config.dts
index 9ab2d9656600..c616ff772237 100644
--- a/plat/arm/board/a5ds/fdts/a5ds_tb_fw_config.dts
+++ b/plat/arm/board/a5ds/fdts/a5ds_tb_fw_config.dts
@@ -10,7 +10,7 @@
/* Platform Config */
plat_arm_bl2 {
compatible = "arm,tb_fw";
- hw_config_addr = <0x0 0x82000000>;
+ hw_config_addr = <0x0 0x83000000>;
hw_config_max_size = <0x01000000>;
/* Disable authentication for development */
disable_auth = <0x0>;
--
2.22.1
@@ -0,0 +1,22 @@
# Cortex-A5 Designstart specific TFA support
COMPATIBLE_MACHINE = "a5ds"
TFA_PLATFORM = "a5ds"
TFA_DEBUG = "1"
TFA_UBOOT = "1"
TFA_BUILD_TARGET = "all fip"
TFA_INSTALL_TARGET = "bl1.bin fip.bin"
SRCREV = "5d3ee0764b03567bf3501edf47d67d72daff0cb3"
LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031"
EXTRA_OEMAKE_append = " \
ARCH=aarch32 \
FVP_HW_CONFIG_DTS=fdts/a5ds.dts \
ARM_ARCH_MAJOR=7 \
AARCH32_SP=sp_min \
ARM_CORTEX_A5=yes \
ARM_XLAT_TABLES_LIB_V1=1 \
"

Some files were not shown because too many files have changed in this diff Show More