mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-07-18 04:27:08 +00:00
Compare commits
182 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f90f028646 | |||
| 1cba8aee6d | |||
| 5262d3d174 | |||
| 664d2a5f6a | |||
| ebee7ce68d | |||
| cc645908ef | |||
| 36314f2d87 | |||
| cddb08a7a2 | |||
| 5d47d3f9db | |||
| 9d1724c3d4 | |||
| 29f0e5982c | |||
| 853f3e0565 | |||
| 806bbb07ed | |||
| 9bb19dd0d6 | |||
| 88c201ca9d | |||
| 3be0996065 | |||
| 101abf89c6 | |||
| 549f362d2f | |||
| cb4c230b56 | |||
| 460210f4a8 | |||
| 568d4d7f9c | |||
| 1350f983ae | |||
| 15512adf39 | |||
| 63c9974493 | |||
| a6de147dc0 | |||
| ea931f83e3 | |||
| d692df24cd | |||
| e0c74f3b3b | |||
| 82b31654b0 | |||
| 57192fd8a5 | |||
| 67f57f35da | |||
| 0978f5a74c | |||
| 232b411b47 | |||
| 98f3779210 | |||
| 7ae8a30b6b | |||
| 933df12da8 | |||
| bc4cd77370 | |||
| 5b823a1eb4 | |||
| a8f32f990a | |||
| 51e014fd47 | |||
| f8e79562f9 | |||
| 980f559e87 | |||
| 44a3c5cf80 | |||
| 603a7657e2 | |||
| 7453f06afc | |||
| b595d1ea47 | |||
| a3481e5016 | |||
| 9fdf9297ac | |||
| 9e00b6b884 | |||
| ee8a242e7a | |||
| 43a25b2e96 | |||
| e25c325197 | |||
| 761bcbb365 | |||
| d9fe9a3eac | |||
| e627b698e7 | |||
| 84683227ed | |||
| 312a25202b | |||
| 1f548fce10 | |||
| 75c9cc3bf8 | |||
| 9e2ff72858 | |||
| 68a113c0a0 | |||
| f14be5995f | |||
| eb3a6b74b7 | |||
| a56011bf30 | |||
| 0a1d96948f | |||
| 6dbf49d633 | |||
| e454387d9f | |||
| b566fbce82 | |||
| 756e695b48 | |||
| 1f6d3f6ef2 | |||
| 9ed331bbd7 | |||
| a780470d96 | |||
| 800249ac61 | |||
| 5a44edaa0e | |||
| cff5aafc67 | |||
| 60ef8543f4 | |||
| 235b7539d8 | |||
| d9a0f4fe59 | |||
| 6a85fdbd77 | |||
| 7fdd34516c | |||
| 9b7905b994 | |||
| caaa21d84f | |||
| 65618b753f | |||
| 511c1ca429 | |||
| 16d10f9c58 | |||
| 7a3e9d5087 | |||
| 35adaace0e | |||
| e40b99e131 | |||
| fecf206b7d | |||
| 9b5f0a0cc4 | |||
| 88a5524a61 | |||
| eea9ce959a | |||
| 98014d1c1c | |||
| a230baa675 | |||
| da32f5c1c8 | |||
| 293d1e0e8d | |||
| e59fc3233b | |||
| c90cf8ce5a | |||
| 5b98ef9d65 | |||
| 35c0bcceea | |||
| fabf4a3c0f | |||
| b578b45092 | |||
| e05be1a396 | |||
| be19ce6b94 | |||
| 7cd87c3ee3 | |||
| a49c59daf6 | |||
| 7577cecab6 | |||
| 3c9486fb31 | |||
| 2a530c3419 | |||
| 0d83df0bd2 | |||
| 966e15826a | |||
| 719a003508 | |||
| 79360345fb | |||
| d683a5bc92 | |||
| 780fba3481 | |||
| afa281b7a9 | |||
| f54bb78861 | |||
| de5d5e611a | |||
| 2ab2f5e179 | |||
| 9d8bb0bea2 | |||
| 4b1d39b87d | |||
| 4ba96e72fd | |||
| cd9cdaad2a | |||
| e3b06f63b1 | |||
| 03f2d78e45 | |||
| e64c553fa0 | |||
| 7f5a3b06ee | |||
| a8a44f6916 | |||
| fda2117467 | |||
| 095d9e314d | |||
| 148103bf84 | |||
| f8fc3b463d | |||
| e18ee052f7 | |||
| 22948879f8 | |||
| 99da50c473 | |||
| b0188cd0cc | |||
| fb045c9019 | |||
| df93a23ad4 | |||
| 87d12f6fa4 | |||
| 42b114e5e0 | |||
| 39ae13d44e | |||
| 390aa6e354 | |||
| 8e2fa5edc8 | |||
| 342d2ec158 | |||
| ce8369461e | |||
| 3bbddbe213 | |||
| 02994f94df | |||
| aa35796c80 | |||
| 5331993f8c | |||
| 9b075d12de | |||
| 91225be953 | |||
| 7c34d0affc | |||
| d8dbaa20b2 | |||
| e52410e281 | |||
| 60f5176196 | |||
| 136207e7c1 | |||
| 56180fce2b | |||
| 067a259cbd | |||
| 197b0732e3 | |||
| 214ec04498 | |||
| 42c4ba9c96 | |||
| 9872afc6c7 | |||
| a996166e85 | |||
| e9e01e9be7 | |||
| ce9650ec84 | |||
| a9cd4fc12f | |||
| 171616a183 | |||
| 3c738c4f69 | |||
| 222fcf4281 | |||
| aee22517e4 | |||
| 167c854412 | |||
| 9a2847c0d6 | |||
| 55daf196a6 | |||
| 5fa6bc3a9c | |||
| 0f0a971458 | |||
| 658faaff76 | |||
| db1d714029 | |||
| 56514201ad | |||
| 86f9419b9d | |||
| da57312334 | |||
| 70a9c4991e | |||
| 29cee51f84 |
+139
@@ -0,0 +1,139 @@
|
||||
# Use our custom Crops-derived image
|
||||
image: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/yocto-builder:master
|
||||
|
||||
# First do a common bootstrap, and then build all the targets
|
||||
stages:
|
||||
- bootstrap
|
||||
- build
|
||||
|
||||
# Common job fragment to get a worker ready
|
||||
.setup:
|
||||
stage: build
|
||||
variables:
|
||||
KAS_WORK_DIR: $CI_PROJECT_DIR/work
|
||||
SSTATE_DIR: $CI_BUILDS_DIR/persist/sstate
|
||||
DL_DIR: $CI_BUILDS_DIR/persist/downloads
|
||||
BB_LOGCONFIG: $CI_PROJECT_DIR/kas/logging.yml
|
||||
before_script:
|
||||
- echo KAS_WORK_DIR = $KAS_WORK_DIR
|
||||
- echo SSTATE_DIR = $SSTATE_DIR
|
||||
- echo DL_DIR = $DL_DIR
|
||||
- mkdir --verbose --parents $KAS_WORK_DIR $SSTATE_DIR $DL_DIR
|
||||
|
||||
# Generalised fragment to do a Kas build
|
||||
.build:
|
||||
extends: .setup
|
||||
script:
|
||||
- KASFILES=$(kas/jobs-to-kas $CI_JOB_NAME)
|
||||
- kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
|
||||
- kas build $KASFILES
|
||||
- ./kas/check-warnings $KAS_WORK_DIR/build/warnings.log
|
||||
|
||||
|
||||
#
|
||||
# First phase, bootstrap and machine coverage
|
||||
#
|
||||
|
||||
# Build a number of native tools first to ensure the other builders don't race
|
||||
# over them
|
||||
n1sdp/bootstrap:
|
||||
extends: .build
|
||||
stage: bootstrap
|
||||
|
||||
# What percentage of machines in the layer do we build
|
||||
machine-coverage:
|
||||
stage: bootstrap
|
||||
script:
|
||||
- ./kas/check-machine-coverage
|
||||
coverage: '/Coverage: \d+/'
|
||||
|
||||
|
||||
#
|
||||
# Second phase, the actual build jobs
|
||||
#
|
||||
|
||||
corstone500:
|
||||
extends: .build
|
||||
|
||||
corstone700-fvp:
|
||||
extends: .build
|
||||
|
||||
corstone700-mps3:
|
||||
extends: .build
|
||||
|
||||
fvp-base:
|
||||
extends: .build
|
||||
|
||||
fvp-base-arm32:
|
||||
extends: .build
|
||||
|
||||
fvp-base-arm32/external-gcc-arm32:
|
||||
extends: .build
|
||||
|
||||
gem5-arm64:
|
||||
extends: .build
|
||||
|
||||
juno:
|
||||
extends: .build
|
||||
|
||||
juno/clang:
|
||||
extends: .build
|
||||
|
||||
musca-b1:
|
||||
extends: .build
|
||||
|
||||
musca-s1:
|
||||
extends: .build
|
||||
|
||||
n1sdp:
|
||||
extends: .build
|
||||
|
||||
n1sdp/armgcc:
|
||||
extends: .build
|
||||
|
||||
qemuarm64-secureboot:
|
||||
extends: .build
|
||||
|
||||
qemuarm64-secureboot/clang:
|
||||
extends: .build
|
||||
|
||||
qemuarm64-secureboot/clang/musl:
|
||||
extends: .build
|
||||
|
||||
qemuarm64-secureboot/musl:
|
||||
extends: .build
|
||||
|
||||
sgi575:
|
||||
extends: .build
|
||||
|
||||
tc0:
|
||||
extends: .build
|
||||
|
||||
|
||||
#
|
||||
# Utility tasks, not executed automatically
|
||||
#
|
||||
|
||||
# Report on disk usage
|
||||
usage:
|
||||
extends: .setup
|
||||
stage: bootstrap
|
||||
when: manual
|
||||
script:
|
||||
- du -h -s $DL_DIR $SSTATE_DIR
|
||||
|
||||
# Wipe out old sstate
|
||||
prune-sstate:
|
||||
extends: .setup
|
||||
stage: bootstrap
|
||||
when: manual
|
||||
script:
|
||||
- find $SSTATE_DIR -type f -atime +30 -delete
|
||||
|
||||
# Delete all sstate
|
||||
delete-sstate:
|
||||
extends: .setup
|
||||
stage: bootstrap
|
||||
when: manual
|
||||
script:
|
||||
- rm -rf $SSTATE_DIR/*
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
|
||||
local_conf_header:
|
||||
cc: |
|
||||
GCCVERSION = "arm-10.2"
|
||||
@@ -0,0 +1,44 @@
|
||||
header:
|
||||
version: 9
|
||||
|
||||
distro: poky
|
||||
|
||||
defaults:
|
||||
repos:
|
||||
refspec: master
|
||||
|
||||
repos:
|
||||
meta-arm:
|
||||
layers:
|
||||
meta-arm:
|
||||
meta-arm-bsp:
|
||||
meta-arm-toolchain:
|
||||
|
||||
poky:
|
||||
url: https://git.yoctoproject.org/git/poky
|
||||
layers:
|
||||
meta:
|
||||
meta-poky:
|
||||
|
||||
env:
|
||||
BB_LOGCONFIG: ""
|
||||
|
||||
local_conf_header:
|
||||
base: |
|
||||
CONF_VERSION = "1"
|
||||
PACKAGE_CLASSES = "package_ipk"
|
||||
LICENSE_FLAGS_WHITELIST += "armcompiler"
|
||||
PACKAGECONFIG_remove_pn-qemu-system-native = "gtk+ sdl"
|
||||
BB_NUMBER_THREADS = "16"
|
||||
PARALLEL_MAKE = "-j16"
|
||||
INHERIT += "rm_work"
|
||||
PACKAGECONFIG_append_pn-perf = " coresight"
|
||||
ERROR_QA = "${WARN_QA}"
|
||||
ptest: |
|
||||
DISTRO_FEATURES_remove = "ptest"
|
||||
|
||||
machine: unset
|
||||
|
||||
target:
|
||||
- core-image-base
|
||||
- perf
|
||||
@@ -0,0 +1,9 @@
|
||||
header:
|
||||
version: 9
|
||||
|
||||
target:
|
||||
- binutils-cross-aarch64
|
||||
- gcc-cross-aarch64
|
||||
- python3-native
|
||||
- opkg-native
|
||||
- rpm-native
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
metaarm = Path.cwd()
|
||||
|
||||
if metaarm.name != "meta-arm":
|
||||
print("Not running inside meta-arm")
|
||||
sys.exit(1)
|
||||
|
||||
# All machine configurations
|
||||
machines = metaarm.glob("meta-*/conf/machine/*.conf")
|
||||
machines = set(p.stem for p in machines)
|
||||
|
||||
# All kas files
|
||||
kas = metaarm.glob("kas/*.yml")
|
||||
kas = set(p.stem for p in kas)
|
||||
|
||||
missing = machines - kas
|
||||
print(f"The following machines are missing: {', '.join(sorted(missing))}.")
|
||||
|
||||
covered = len(machines) - len(missing)
|
||||
total = len(machines)
|
||||
percent = int(covered / total * 100)
|
||||
print(f"Coverage: {percent}%")
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Expects the path to a log file as $1, and if this file has any content
|
||||
# then display the contents and exit with an error code.
|
||||
|
||||
set -e -u
|
||||
|
||||
LOGFILE=$1
|
||||
|
||||
if test -s $LOGFILE; then
|
||||
echo ==============================
|
||||
echo The build had warnings/errors:
|
||||
echo ==============================
|
||||
cat $LOGFILE
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,10 @@
|
||||
header:
|
||||
version: 9
|
||||
|
||||
repos:
|
||||
meta-clang:
|
||||
url: https://github.com/kraj/meta-clang
|
||||
|
||||
local_conf_header:
|
||||
clang: |
|
||||
TOOLCHAIN = "clang"
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: corstone500
|
||||
@@ -0,0 +1,10 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: corstone700-fvp
|
||||
|
||||
local_conf_header:
|
||||
image: |
|
||||
CORE_IMAGE_EXTRA_INSTALL = "corstone700-test-app"
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- corstone700-fvp.yml
|
||||
|
||||
machine: corstone700-mps3
|
||||
@@ -0,0 +1,8 @@
|
||||
header:
|
||||
version: 9
|
||||
|
||||
local_conf_header:
|
||||
cc: |
|
||||
PNBLACKLIST[gcc-cross-arm] = "Using external toolchain"
|
||||
TCMODE = "external-arm"
|
||||
EXTERNAL_TOOLCHAIN = "/usr/local/gcc-arm-10.2-2020.11-aarch64-arm-none-linux-gnueabihf"
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: fvp-base-arm32
|
||||
@@ -0,0 +1,7 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: fvp-base
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
repos:
|
||||
meta-arm:
|
||||
layers:
|
||||
meta-gem5:
|
||||
|
||||
meta-openembedded:
|
||||
url: https://git.openembedded.org/meta-openembedded
|
||||
layers:
|
||||
meta-oe:
|
||||
|
||||
machine: gem5-arm64
|
||||
|
||||
target:
|
||||
- core-image-minimal
|
||||
- perf
|
||||
- gem5-aarch64-native
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Read a GitLab CI job name on $1 and transform it to a
|
||||
# list of Kas yaml files
|
||||
|
||||
set -e -u
|
||||
|
||||
# Read Job namne from $1 and split on /
|
||||
IFS=/ read -r -a PARTS<<<$1
|
||||
|
||||
# Prefix each part with kas/
|
||||
PARTS=("${PARTS[@]/#/kas/}")
|
||||
|
||||
# Suffix each part with .yml
|
||||
PARTS=("${PARTS[@]/%/.yml}")
|
||||
|
||||
# Print colon-separated
|
||||
IFS=":"
|
||||
echo "${PARTS[*]}"
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: juno
|
||||
@@ -0,0 +1,13 @@
|
||||
# Python logging configuration to write all warnings to a separate file
|
||||
version: 1
|
||||
|
||||
handlers:
|
||||
warnings:
|
||||
class: logging.FileHandler
|
||||
level: WARNING
|
||||
filename: warnings.log
|
||||
formatter: BitBake.logfileFormatter
|
||||
|
||||
loggers:
|
||||
BitBake:
|
||||
handlers: [warnings]
|
||||
@@ -0,0 +1,9 @@
|
||||
header:
|
||||
version: 9
|
||||
|
||||
repos:
|
||||
meta-openembedded:
|
||||
url: https://git.openembedded.org/meta-openembedded
|
||||
layers:
|
||||
meta-oe:
|
||||
meta-python:
|
||||
@@ -0,0 +1,8 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- meta-python.yml
|
||||
|
||||
repos:
|
||||
meta-zephyr:
|
||||
url: https://git.yoctoproject.org/git/meta-zephyr
|
||||
@@ -0,0 +1,11 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
- meta-zephyr.yml
|
||||
|
||||
machine: musca-b1
|
||||
|
||||
target:
|
||||
- trusted-firmware-m
|
||||
- zephyr-philosophers
|
||||
@@ -0,0 +1,10 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
- meta-python.yml
|
||||
|
||||
machine: musca-s1
|
||||
|
||||
target:
|
||||
- trusted-firmware-m
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
|
||||
local_conf_header:
|
||||
libc: |
|
||||
TCLIBC = "musl"
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: n1sdp
|
||||
@@ -0,0 +1,11 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: qemuarm64-secureboot
|
||||
|
||||
target:
|
||||
- core-image-base
|
||||
- perf
|
||||
- optee-examples
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: sgi575
|
||||
@@ -0,0 +1,6 @@
|
||||
header:
|
||||
version: 9
|
||||
includes:
|
||||
- base.yml
|
||||
|
||||
machine: tc0
|
||||
@@ -0,0 +1,26 @@
|
||||
# This class is to be inherited by image recipes that want to build and install
|
||||
# an alternate kernel (set via PREFERRED_PROVIDER_alternate/kernel).
|
||||
#
|
||||
# It is mandatory to also set the KERNEL_PACKAGE_NAME for the alternate kernel
|
||||
# recipe via KERNEL_PACKAGE_NAME_pn-${PREFERRED_PROVIDER_alternate/kernel} and
|
||||
# its value needs to be different from "kernel" since this is the default set
|
||||
# for PREFERRED_PROVIDER_virtual/kernel.
|
||||
#
|
||||
# An example of these settings can be found at meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc
|
||||
#
|
||||
# When building and installing an alternate kernel, the kernel-modules packages
|
||||
# for both virtual/kernel and alternate/kernel will be installed.
|
||||
|
||||
PREFERRED_PROVIDER_alternate/kernel ??= ""
|
||||
|
||||
python () {
|
||||
alternate_kernel = d.getVar('PREFERRED_PROVIDER_alternate/kernel')
|
||||
if alternate_kernel:
|
||||
alternate_kernel_pkg_name = d.getVar('KERNEL_PACKAGE_NAME_pn-%s' % alternate_kernel)
|
||||
if alternate_kernel_pkg_name:
|
||||
d.appendVar('EXTRA_IMAGEDEPENDS', ' ' + alternate_kernel)
|
||||
d.appendVar('IMAGE_INSTALL', ' kernel-modules')
|
||||
d.appendVar('IMAGE_INSTALL', ' ' + alternate_kernel_pkg_name + '-modules')
|
||||
else:
|
||||
raise bb.parse.SkipRecipe("No KERNEL_PACKAGE_NAME_pn-%s set" % alternate_kernel )
|
||||
}
|
||||
@@ -43,14 +43,17 @@ XENGUEST_IMAGE_KERNEL ??= "Image"
|
||||
# be included in the xenguest image)
|
||||
XENGUEST_IMAGE_DISK_SIZE ??= "${@ '4' if not d.getVar('INITRAMFS_IMAGE') else '0'}"
|
||||
|
||||
# set empty partition to be used by xenguest-manager for this image
|
||||
XENGUEST_IMAGE_DISK_DEVICE ??= ""
|
||||
|
||||
#
|
||||
# XENGUEST_IMAGE_DISK PARTITIONS is used to describe the partitions to setup
|
||||
# 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:
|
||||
# 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
|
||||
# - sz is the partition size in MB or GB(default), e.g 1000M or 1[G]
|
||||
# - fs is optional 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
|
||||
#
|
||||
@@ -129,21 +132,27 @@ xenguest_image_create() {
|
||||
|
||||
# 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
|
||||
case ${disksize:=0} in
|
||||
0|0M|0G)
|
||||
;;
|
||||
*)
|
||||
# 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
|
||||
done
|
||||
fi
|
||||
diskdevice="${XENGUEST_IMAGE_DISK_DEVICE}"
|
||||
if [ -n "$diskdevice" ]; then
|
||||
call_xenguest_mkimage update --disk-device="${diskdevice}"
|
||||
fi
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
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
|
||||
|
||||
@@ -9,7 +9,7 @@ BBFILES += " \
|
||||
|
||||
BBFILE_COLLECTIONS += "meta-arm-autonomy"
|
||||
BBFILE_PATTERN_meta-arm-autonomy = "^${LAYERDIR}/"
|
||||
BBFILE_PRIORITY_meta-arm-autonomy = "6"
|
||||
BBFILE_PRIORITY_meta-arm-autonomy = "5"
|
||||
LAYERDEPENDS_meta-arm-autonomy = " \
|
||||
core \
|
||||
yocto \
|
||||
|
||||
@@ -11,7 +11,7 @@ KERNEL_IMAGETYPE = "Image"
|
||||
IMAGE_FSTYPES += "tar.bz2"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||
|
||||
DISTRO_FEATURES += "arm-autonomy-guest"
|
||||
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
arm-autonomy Multiconfig Build Environment Instructions
|
||||
==================
|
||||
|
||||
This documentation explains how to simplify the process of building hosts
|
||||
and guests in a single bitbake command, rather than in seperate build
|
||||
folders. You can read more about multiconfig in the bitbake documentation:
|
||||
|
||||
- [bitbake user manual](https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html)
|
||||
|
||||
To achieve a multiconfig build, a number of different config files need to
|
||||
be created in a single build directory.
|
||||
|
||||
Create a new project
|
||||
----------------
|
||||
|
||||
Before you start, you will need to follow the instructions in
|
||||
"Create a project" from the quickstart guide, to create a new project
|
||||
directory with
|
||||
```
|
||||
oe-init-build-env my-mc-project
|
||||
```
|
||||
Ensure it has all the required layers in bblayers.conf as listed in
|
||||
`arm-autonomy-quickstart.md`. The result should be a directory containing:
|
||||
|
||||
```
|
||||
-- conf
|
||||
| -- bblayers.conf
|
||||
| -- local.conf
|
||||
| -- templateconf.cfg
|
||||
```
|
||||
|
||||
Add multiconfig
|
||||
----------------
|
||||
|
||||
Here are the steps required to make the project build both the host and any
|
||||
number of guests as required.
|
||||
|
||||
1. Create a new directory under `conf/` named `multiconfig/`
|
||||
|
||||
2. Create two new files in this directory:
|
||||
`multiconfig/host.conf`
|
||||
`multiconfig/guest.conf`
|
||||
These files will contain any configurations that a specific to either the
|
||||
host or the guest
|
||||
|
||||
```
|
||||
-- conf
|
||||
| -- bblayers.conf
|
||||
| -- local.conf
|
||||
| -- templateconf.cfg
|
||||
| -- multiconfig
|
||||
| -- host.conf
|
||||
| -- guest.conf
|
||||
```
|
||||
|
||||
3. In `local.conf` the following config variables must be added:
|
||||
|
||||
```
|
||||
MACHINE ?= "fvp-base"
|
||||
|
||||
# ---Guest Config Start--- #
|
||||
MC_GUEST = "guest"
|
||||
|
||||
MC_GUEST_NAME = "guest1"
|
||||
|
||||
MC_GUEST_IMAGERECIPE = "core-image-minimal"
|
||||
MC_GUEST_MACHINE = "arm64-autonomy-guest"
|
||||
|
||||
MC_GUEST_INITRAMFS_IMAGE_BUNDLE ?= ""
|
||||
MC_GUEST_INITRAMFS_IMAGE ?= ""
|
||||
|
||||
# Uncomment for initramfs
|
||||
#MC_GUEST_INITRAMFS_IMAGE_BUNDLE = "1"
|
||||
#MC_GUEST_INITRAMFS_IMAGE = "${MC_GUEST_IMAGERECIPE}"
|
||||
|
||||
# These variables are set automatically, don't edit them!
|
||||
MC_GUEST_FILENAME_PREFIX = "${@ 'Image-initramfs' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}' }"
|
||||
|
||||
MC_GUEST_FILENAME = "${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.xenguest"
|
||||
|
||||
MC_GUEST_DEP = "${@ 'virtual/kernel:do_deploy' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}:do_image_complete'}"
|
||||
|
||||
MC_DOIMAGE_MCDEPENDS += "mc:${MC_HOST}:${MC_GUEST}:${MC_GUEST_DEP} "
|
||||
|
||||
BBMULTICONFIG += "${MC_GUEST} "
|
||||
|
||||
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS += "file://${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME};guestname=${MC_GUEST_NAME} "
|
||||
# ---Guest Config End--- #
|
||||
|
||||
# ---Host Config Start--- #
|
||||
MC_HOST = "host"
|
||||
|
||||
BBMULTICONFIG += "${MC_HOST} "
|
||||
# ---Host Config End--- #
|
||||
```
|
||||
|
||||
These variables will be used in both of the multiconf files. `MC_HOST` and
|
||||
`MC_GUEST` should not be altered without renaming the conf files, but most
|
||||
`MC_GUEST_*` variables can be customised if you desire.
|
||||
|
||||
4. Next set the contents of `multiconfig/guest.conf`:
|
||||
|
||||
```
|
||||
TMPDIR = "${TOPDIR}/${MC_GUEST}"
|
||||
|
||||
MACHINE = "${MC_GUEST_MACHINE}"
|
||||
DISTRO_FEATURES += " arm-autonomy-guest"
|
||||
|
||||
INITRAMFS_IMAGE_BUNDLE = "${MC_GUEST_INITRAMFS_IMAGE_BUNDLE}"
|
||||
INITRAMFS_IMAGE = "${MC_GUEST_INITRAMFS_IMAGE}"
|
||||
|
||||
IMAGE_FSTYPES += "${@ 'cpio' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else ''}"
|
||||
|
||||
# ANY OTHER GUEST CONFIG
|
||||
```
|
||||
|
||||
This contents shouldn't be changed directly, rather change the equivalent
|
||||
config in local.conf. You can append any other config desired for the
|
||||
guest at this point, for example `XENGUEST_IMAGE_DISK_SIZE`
|
||||
|
||||
Make sure not to change `${DEPLOY_DIR_IMAGE}` to anything other than
|
||||
`${TMPDIR}/deploy/images`, as this is assumed by local.conf.
|
||||
|
||||
5. Lastly set the contents of `multiconfig/host.conf`:
|
||||
|
||||
```
|
||||
TMPDIR = "${TOPDIR}/${MC_HOST}"
|
||||
|
||||
DISTRO_FEATURES += " arm-autonomy-host"
|
||||
```
|
||||
|
||||
Building the image
|
||||
----------------
|
||||
|
||||
To build the multiconfig image the command is:
|
||||
```
|
||||
bitbake mc:host:arm-autonomy-host-image-minimal
|
||||
```
|
||||
|
||||
You should see that this triggers guest tasks to be built in
|
||||
parallel. Once the build completes the guest will already be in the
|
||||
rootfs of the host thanks to `ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST`
|
||||
|
||||
The deployed image including the guest will be in `host/deploy/images/`
|
||||
|
||||
|
||||
Multiple Guests
|
||||
----------------
|
||||
|
||||
To have multiple guests with the same config the line which appends to
|
||||
`ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST` just needs to be duplicated with
|
||||
a different guestname.
|
||||
|
||||
To have different config for each guest, each will need its own config
|
||||
file similar to guest.conf, ensuring TMPDIR is set to a different path,
|
||||
and everything between `---Guest Config Start---` and
|
||||
`---Guest Config End---` will need to be duplicated.
|
||||
|
||||
Any copies of variables that start `MC_GUEST` must be altered to avoid
|
||||
collisions (e.g. `MC_GUEST_2_*`), and the name of the conf file must also
|
||||
be added to BBMULTICONFIG.
|
||||
|
||||
|
||||
Guest with provisioned disk
|
||||
----------------
|
||||
|
||||
To add guest rootfs partition to host wic image,
|
||||
set `AUTONOMY_HOST_EXTRA_PARTITION` with proper wks partition entry, e.g:
|
||||
|
||||
```
|
||||
AUTONOMY_HOST_EXTRA_PARTITION = "part --label provisioned-guest --source rawcopy --fstype=ext4 --ondisk sda --align 1024 \
|
||||
--sourceparams=file=${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.ext4"
|
||||
```
|
||||
|
||||
inside host.conf file.
|
||||
|
||||
The rest of the configuration has to be appended to guest.conf file:
|
||||
|
||||
```
|
||||
XENGUEST_IMAGE_DISK_SIZE = "0"
|
||||
XENGUEST_IMAGE_SRC_URI_XEN_CONFIG = "file://\${TOPDIR}/path/to/rootdisk.cfg"
|
||||
XENGUEST_IMAGE_DISK_DEVICE = "_GUEST_DISK_DEVICE_"
|
||||
XENGUEST_IMAGE_ROOT = "/dev/xvda"
|
||||
IMAGE_ROOTFS_SIZE = "102400"
|
||||
IMAGE_FSTYPES = "ext4"
|
||||
```
|
||||
|
||||
content of rootdisk.cfg"
|
||||
|
||||
```
|
||||
disk = ["phy:_GUEST_DISK_DEVICE_,xvda,w"]
|
||||
```
|
||||
|
||||
`_GUEST_DISK_DEVICE_` should be substituted with `/dev/sdaX`,
|
||||
according to wks file.
|
||||
@@ -26,11 +26,10 @@ First you must download the Yocto layers needed:
|
||||
- [poky](https://git.yoctoproject.org/poky)
|
||||
- [meta-virtualization](https://git.yoctoproject.org/meta-virtualization)
|
||||
- [meta-arm](https://git.yoctoproject.org/meta-arm)
|
||||
- [meta-kernel](https://gitlab.com/openembedded/community/meta-kernel.git)
|
||||
- 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`).
|
||||
you want to use (for example gatesgarth using `git checkout gatesgarth`).
|
||||
|
||||
Please follow [Yocto documentation](https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html)
|
||||
in order to have the required dependencies.
|
||||
@@ -57,7 +56,6 @@ Here are the main steps to create an arm-autonomy project:
|
||||
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-kernel \
|
||||
$LAYERDIR_BASE/meta-arm/meta-arm $LAYERDIR_BASE/meta-arm/meta-arm-toolchain \
|
||||
$LAYERDIR_BASE/meta-arm/meta-arm-bsp $LAYERDIR_BASE/meta-arm/meta-arm-autonomy \
|
||||
```
|
||||
@@ -73,7 +71,6 @@ Here are the main steps to create an arm-autonomy project:
|
||||
/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-kernel \
|
||||
/home/user/arm-autonomy/meta-arm/meta-arm \
|
||||
/home/user/arm-autonomy/meta-arm/meta-arm-toolchain \
|
||||
/home/user/arm-autonomy/meta-arm/meta-arm-bsp \
|
||||
@@ -147,6 +144,9 @@ To create a guest project:
|
||||
The build will create a ".xenguest" image that can be use on an host project
|
||||
with the xenguest-manager.
|
||||
|
||||
The guest can also be built as a 'multiconfig' sub project of the host, see
|
||||
`meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md` for more information
|
||||
|
||||
Include guests directly in the host image
|
||||
-----------------------------------------
|
||||
The layer provides a way to directly include in the host project one or several
|
||||
@@ -209,7 +209,7 @@ 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
|
||||
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}.
|
||||
|
||||
@@ -11,12 +11,17 @@ perform a couple of customizations in the generated wic image:
|
||||
1 MiB per physical volume, hence it needs to be taken into account when
|
||||
setting GUEST_PART_SIZE.
|
||||
|
||||
2. The wic image partition layout and contents with a custom wks file via
|
||||
2. Set the boot partition size (default: 100M) via `BOOT_PART_SIZE` and
|
||||
`BOOT_PART_SIZE_UNIT` (M or G) variables in any conf file. The default
|
||||
bootimg is ~44M so 100M leaves just over 50M of free space.
|
||||
|
||||
3. The wic image partition layout and contents with a custom wks file via
|
||||
`ARM_AUTONOMY_WKS_FILE` variable (default:
|
||||
arm-autonomy-n1sdp-efidisk.wks.in which is affected by GUEST_PART_SIZE,
|
||||
GUEST_PART_SIZE_UNIT and GRUB_CFG_FILE variables).
|
||||
GUEST_PART_SIZE_UNIT, BOOT_PART_SIZE, BOOT_PART_SIZE_UNIT and
|
||||
GRUB_CFG_FILE variables).
|
||||
|
||||
3. Custom grub.cfg file via `GRUB_CFG_FILE` (default:
|
||||
4. Custom grub.cfg file via `GRUB_CFG_FILE` (default:
|
||||
arm-autonomy-n1sdp-grub.cfg) variable to be set in any conf file. The full
|
||||
path or relative to `ARM_AUTONOMY_WKS_FILE` should be set.
|
||||
|
||||
|
||||
@@ -70,7 +70,10 @@ The following parameters are available:
|
||||
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".
|
||||
This variable is set by default to "1024M,max:1024", and cannot be empty.
|
||||
The value can simply specify a size, e.g. "1024M", but best practice is to
|
||||
also provide a max, documented here:
|
||||
https://wiki.xenproject.org/wiki/Xen_Project_Best_Practices
|
||||
|
||||
- XEN_DEVICETREE_DOM0_BOOTARGS: Boot arguments to pass to Dom0 Linux when
|
||||
booting it.
|
||||
@@ -84,7 +87,8 @@ The following parameters are available:
|
||||
- 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".
|
||||
This variable is set by default to "0x80080000", and cannot be empty.
|
||||
Values for this variable can be in hex (prefixed with '0x') or in decimal.
|
||||
|
||||
- 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
|
||||
@@ -92,7 +96,8 @@ The following parameters are available:
|
||||
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".
|
||||
This variable is set by default to "0x01000000" and cannot be empty.
|
||||
Values for this variable can be in hex (prefixed with '0x') or in decimal.
|
||||
|
||||
- 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
|
||||
|
||||
@@ -23,7 +23,7 @@ Usage
|
||||
-----
|
||||
|
||||
xenguest-manager must be called like this:
|
||||
`xenguest-manager OPERATION [OPTIONS]`
|
||||
`xenguest-manager [-v(v)] 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
|
||||
@@ -37,6 +37,9 @@ The following operations are available:
|
||||
- status [GUESTNAME]: print the current status of GUESTNAME. If GUESTNAME is
|
||||
not given, print the status of all guests.
|
||||
|
||||
Passing -v or -vv will increase the logging written to the logfile.
|
||||
The terminal will always show only error messages, regardless of the logfile.
|
||||
|
||||
For a detailed help on available options please use:
|
||||
`xenguest-manager --help`
|
||||
|
||||
@@ -65,6 +68,13 @@ The following parameters are available:
|
||||
name).
|
||||
This is set by default to "/usr/share/guests".
|
||||
|
||||
- XENGUEST_MANAGER_LOG_LEVEL: Set the default log level for xenguest manager. Must
|
||||
be one of ERROR, INFO, VERBOSE (default: ERROR). The extra will be
|
||||
written to /var/log/xenguest.
|
||||
|
||||
If a verbosity argument (-v or -vv) is passed to xenguest-manager directly, it
|
||||
will override the setting in xenguest-manager.conf
|
||||
|
||||
Init scripts
|
||||
------------
|
||||
|
||||
@@ -80,7 +90,7 @@ directory on the target:
|
||||
|
||||
Inside the directory, scripts will be executed in alphabetical order.
|
||||
|
||||
Since these scripts are sourced by xenguest-manager they can acccess functions
|
||||
Since these scripts are sourced by xenguest-manager, they can acccess functions
|
||||
and variables from the parent file's scope, including:
|
||||
|
||||
- ${guestname} : The name of the guest being created
|
||||
@@ -89,12 +99,31 @@ and variables from the parent file's scope, including:
|
||||
|
||||
- ${guestcfgfile} : The name of the config file for the starting guest
|
||||
|
||||
- ${LOGFILE} : The file to append any logging to, e.g.
|
||||
echo "Hello, World" >> ${LOGFILE}
|
||||
- log() : Used to write a log to the logfile, default level INFO.
|
||||
Takes an optional log level and a message body
|
||||
e.g. log ERROR "blah"
|
||||
|
||||
Options for log level: ERROR, INFO, VERBOSE, and FATAL, which
|
||||
will call exit 1 immediately after logging the message
|
||||
|
||||
- log_command() : Used to call a shell command and log that it has been
|
||||
called, as well as capturing both stdout and stderr.
|
||||
|
||||
By default the command output is dumped to the logfile as an error
|
||||
if the command returns a status > 0, or as a verbose message if the
|
||||
whole script is running in verbose mode. An optional log level can
|
||||
be passed to alter the level the log should be if the command returns
|
||||
a status >0,
|
||||
e.g. log_command INFO "ls -lh ~"
|
||||
|
||||
Options for log level: ERROR, INFO, and VERBOSE
|
||||
|
||||
Attempting to call any other functions from xenguest_manager in an init script may
|
||||
result in a fatal error, from which cleanup is not guarenteed.
|
||||
|
||||
|
||||
Sourcing also allows the script to access params.cfg.
|
||||
|
||||
|
||||
An example of how to create the directory and install an init shell script can
|
||||
be found in:
|
||||
recipes-extended/xenguest/xenguest-network.bb
|
||||
|
||||
@@ -58,12 +58,19 @@ 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_SIZE=X`: size of the disk to create in MB or GB(default),
|
||||
e.g. 1000M or 4[G]
|
||||
- `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.
|
||||
size of SIZE MB or GB(default), e.g 1000M or 2[G].
|
||||
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.
|
||||
- `DISK_DEVICE=X`: disk or partition to be used by lvm. Setting this option
|
||||
allows to bind guest disk with any partition or disk available on host,
|
||||
e.g. /dev/sda3 or /dev/sdb.
|
||||
This variable is not set by default, but if set, it overrides disk settings
|
||||
inside xenguest-manager.conf - 'XENGUEST_VOLUME_DEVICE'.
|
||||
|
||||
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
|
||||
@@ -105,12 +112,12 @@ For a detailed help on available operations, please use:
|
||||
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-size=SIZE: set the guest disk size to SIZE in MB or GB(default),
|
||||
e.g 1000M or 2[G]. 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.
|
||||
- SIZE: partition size in MB or GB(default), e.g 1000M or 2[G].
|
||||
- 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
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
# Extra machine settings for juno
|
||||
KERNEL_ALT_IMAGETYPE = "Image.lzma"
|
||||
|
||||
# Juno board has 2 network interfaces, add both of them to the bridge
|
||||
XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0 eth1"
|
||||
XEN_DEVICETREE_DOM0_SIZE ?= "0x02400000"
|
||||
|
||||
# We need to extend the wks search path to be able to find the wks file set in
|
||||
# ARM_AUTONOMY_WKS_FILE.
|
||||
WKS_SEARCH_PATH_prepend := "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic:"
|
||||
|
||||
ARM_AUTONOMY_WKS_FILE ?= "arm-autonomy-juno-disk.wks.in"
|
||||
# set wks file only if INITRAMFS_IMAGE_BUNDLE is not set
|
||||
WKS_FILE = "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
|
||||
'${ARM_AUTONOMY_WKS_FILE}', d)}"
|
||||
|
||||
# Set the wks guest partition size and unit. It must be aligned with the sum of
|
||||
# all XENGUEST_IMAGE_DISK_SIZE set for the guests. By default, LVM2 metadata is
|
||||
# 1 MiB per physical volume, hence it needs to be taken into account when
|
||||
# setting GUEST_PART_SIZE. The XENGUEST_IMAGE_DISK_SIZE default value is 4GiB.
|
||||
GUEST_PART_SIZE ?= "4097"
|
||||
GUEST_PART_SIZE_UNIT ?= "M"
|
||||
|
||||
# set wic image type only if INITRAMFS_IMAGE_BUNDLE is not set
|
||||
IMAGE_FSTYPES += "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
|
||||
'wic wic.gz wic.bmap', d)}"
|
||||
|
||||
+51
-1
@@ -14,8 +14,19 @@ WKS_FILE = "${ARM_AUTONOMY_WKS_FILE}"
|
||||
GUEST_PART_SIZE ?= "4097"
|
||||
GUEST_PART_SIZE_UNIT ?= "M"
|
||||
|
||||
# Set default boot partition size and unit
|
||||
BOOT_PART_SIZE ?= "100"
|
||||
BOOT_PART_SIZE_UNIT ?= "M"
|
||||
|
||||
# The GRUB_CFG_FILE affects arm-autonomy-n1sdp-efidisk.wks.in file
|
||||
GRUB_CFG_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg"
|
||||
#
|
||||
# When alternate-kernel DISTRO_FEATURE is present we set the
|
||||
# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has
|
||||
# additional entries for booting with the PREEMPT_RT kernel.
|
||||
GRUB_CFG_FILE ?= "${@bb.utils.contains('DISTRO_FEATURES','alternate-kernel', \
|
||||
'${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-rt-grub.cfg', \
|
||||
'${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg' \
|
||||
, d)}"
|
||||
|
||||
# From arm-autonomy-n1sdp-efidisk.wks.in, the /boot partition is /dev/sda1, and
|
||||
# the "/" partition is /dev/sda2.
|
||||
@@ -38,3 +49,42 @@ do_image_wic[depends] += "xen:do_deploy"
|
||||
IMAGE_EFI_BOOT_FILES += "xen-n1sdp.efi;xen.efi"
|
||||
IMAGE_EFI_BOOT_FILES += "${XEN_MOD_DEVICETREE_DTBS}"
|
||||
|
||||
# Use 5.4 kernel until later versions have been validated for autonomy-host
|
||||
PREFERRED_PROVIDER_virtual/kernel = "linux-linaro-arm"
|
||||
PREFERRED_VERSION_linux-linaro-arm = "5.4%"
|
||||
|
||||
# When alternate-kernel DISTRO_FEATURE is present we set the linux-linaro-arm-rt
|
||||
# by default
|
||||
PREFERRED_PROVIDER_alternate/kernel ?= "\
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', \
|
||||
'linux-linaro-arm-rt', '', d)}"
|
||||
|
||||
KERNEL_PACKAGE_NAME_alternate/kernel ?= "kernel-rt"
|
||||
# When alternate-kernel DISTRO_FEATURE is present we set the kernel-rt by
|
||||
# default
|
||||
KERNEL_PACKAGE_NAME_pn-linux-linaro-arm-rt = "\
|
||||
${@ d.getVar('KERNEL_PACKAGE_NAME_alternate/kernel') \
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) \
|
||||
else 'kernel' }"
|
||||
|
||||
# Relative path from DEPLOY_DIR_IMAGE of the Kernel PREEMPT_RT deployed Image
|
||||
KERNEL_RT_IMAGE ?= "kernel-rt/Image-n1sdp.bin;Image-preempt-rt"
|
||||
# Only include the Kernel PREEMPT_RT Image if we are building with
|
||||
# alternate-kernel DISTRO_FEATURE
|
||||
IMAGE_EFI_BOOT_FILES += "\
|
||||
${@ d.getVar('KERNEL_RT_IMAGE',d) or '' \
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \
|
||||
d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
|
||||
|
||||
|
||||
EFIDIR ?= "/EFI/BOOT"
|
||||
GRUB_CFG_EXTRA_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg;.${EFIDIR}}"
|
||||
|
||||
# When alternate-kernel DISTRO_FEATURE is present we set the
|
||||
# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has
|
||||
# additional entries for booting with the PREEMPT_RT kernel and also includes
|
||||
# the main GRUB config file set by GRUB_CFG_EXTRA_FILE.
|
||||
IMAGE_EFI_BOOT_FILES += "\
|
||||
${@ d.getVar('GRUB_CFG_EXTRA_FILE',d) or '' \
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \
|
||||
d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
|
||||
|
||||
+33
-4
@@ -4,6 +4,19 @@ OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d
|
||||
|
||||
FILESEXTRAPATHS_prepend_xen := "${THISDIR}/${PN}:"
|
||||
|
||||
DEPENDS_append_xen = " dos2unix-native"
|
||||
|
||||
SRC_URI_append_xen = " file://add-xen-support.patch;patchdir=../"
|
||||
|
||||
do_install_append_xen() {
|
||||
mv -v ${D}/${UNPACK_DIR}/SOFTWARE/uEnv.txt \
|
||||
${D}/${UNPACK_DIR}/SOFTWARE/uenvfile
|
||||
for dir in $(ls ${D}/${UNPACK_DIR}/SITE1/)
|
||||
do
|
||||
unix2dos ${D}/${UNPACK_DIR}/SITE1/${dir}/images.txt
|
||||
done
|
||||
}
|
||||
|
||||
DEPLOY_EXTRA_DEPS ??= ""
|
||||
DEPLOY_EXTRA_DEPS_xen = "xen:do_deploy xen-devicetree:do_deploy"
|
||||
|
||||
@@ -14,8 +27,24 @@ do_deploy_prepend_xen() {
|
||||
# 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/
|
||||
|
||||
mkdir -p ${D}/${UNPACK_DIR}/SOFTWARE/XEN
|
||||
cp -v ${DEPLOY_DIR_IMAGE}/xen-${COMPATIBLE_MACHINE}.efi \
|
||||
${D}/${UNPACK_DIR}/SOFTWARE/XEN/xen
|
||||
|
||||
for dtb in $(basename -s .dtb ${KERNEL_DEVICETREE})
|
||||
do
|
||||
cp -v ${DEPLOY_DIR_IMAGE}/${dtb}-xen.dtb \
|
||||
${D}/${UNPACK_DIR}/SOFTWARE/XEN/${dtb}.dtb
|
||||
done
|
||||
|
||||
bbnote "Xen binaries added under SOFTWARE/XEN directory"
|
||||
|
||||
if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" -a "${KERNEL_ALT_IMAGETYPE}" = "Image.lzma" ]; then
|
||||
# KERNEL_ALT_IMAGETYPE is expected to be Image.lzma,
|
||||
# however NOR flash filesystem is DOS compatible with 8.3 naming,
|
||||
# so we need to replace ".lzma" with ".lzm"
|
||||
cp -L -f ${DEPLOY_DIR_IMAGE}/${KERNEL_ALT_IMAGETYPE} \
|
||||
${D}/${UNPACK_DIR}/SOFTWARE/Image.lzm
|
||||
fi
|
||||
}
|
||||
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
arm-bsp/firmware-image-juno: add xen support
|
||||
|
||||
This patch adds xen and dtbs binaries entries to images-r[012].txt files.
|
||||
These images-r[012].txt files contain NOR filesystem entries details,
|
||||
like file offset, name, path etc.
|
||||
|
||||
It also adds customization for uEnv.txt file, that allows to autoboot xen.
|
||||
|
||||
Upstream-Status: Inappropriate [configuration]
|
||||
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
|
||||
|
||||
diff -u a/images-r0.txt b/images-r0.txt
|
||||
--- a/images-r0.txt 2020-11-25 20:25:38.677687712 +0100
|
||||
+++ b/images-r0.txt 2020-11-25 20:36:55.482194294 +0100
|
||||
@@ -1,7 +1,7 @@
|
||||
TITLE: Versatile Express Images Configuration File
|
||||
|
||||
[IMAGES]
|
||||
-TOTALIMAGES: 10 ;Number of Images (Max: 32)
|
||||
+TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
||||
|
||||
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
||||
@@ -17,14 +17,14 @@
|
||||
|
||||
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
||||
-NOR2FILE: \SOFTWARE\Image ;Image File Name
|
||||
-NOR2NAME: norkern ;Rename kernel to norkern
|
||||
+NOR2FILE: \SOFTWARE\Image.lzm ;Image File Name
|
||||
+NOR2NAME: norkern.lzm ;Rename kernel to norkern.lzm
|
||||
NOR2LOAD: 00000000 ;Image Load Address
|
||||
NOR2ENTRY: 00000000 ;Image Entry Point
|
||||
|
||||
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR3ADDRESS: 0x02900000 ;Image Flash Address
|
||||
-NOR3FILE: \SOFTWARE\juno.dtb ;Image File Name
|
||||
+NOR3FILE: \SOFTWARE\XEN\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
|
||||
@@ -64,8 +64,13 @@
|
||||
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
|
||||
NOR9NAME: uEnv.txt
|
||||
-NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
||||
+NOR9FILE: \SOFTWARE\uenvfile ;Image File Name
|
||||
NOR9LOAD: 00000000 ;Image Load Address
|
||||
NOR9ENTRY: 00000000 ;Image Entry Point
|
||||
|
||||
-
|
||||
+NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
+NOR10ADDRESS: 0x03000000 ;Image Flash Address
|
||||
+NOR10FILE: \SOFTWARE\XEN\xen ;Image File Name
|
||||
+NOR10NAME: xen
|
||||
+NOR10LOAD: 00000000 ;Image Load Address
|
||||
+NOR10ENTRY: 00000000 ;Image Entry Point
|
||||
diff -u a/images-r1.txt b/images-r1.txt
|
||||
--- a/images-r1.txt 2020-11-25 20:40:19.005177152 +0100
|
||||
+++ b/images-r1.txt 2020-11-25 20:41:17.500886263 +0100
|
||||
@@ -1,7 +1,7 @@
|
||||
TITLE: Versatile Express Images Configuration File
|
||||
|
||||
[IMAGES]
|
||||
-TOTALIMAGES: 10 ;Number of Images (Max: 32)
|
||||
+TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
||||
|
||||
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
||||
@@ -17,14 +17,14 @@
|
||||
|
||||
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
||||
-NOR2FILE: \SOFTWARE\Image ;Image File Name
|
||||
-NOR2NAME: norkern ;Rename kernel to norkern
|
||||
+NOR2FILE: \SOFTWARE\Image.lzm ;Image File Name
|
||||
+NOR2NAME: norkern.lzm ;Rename kernel to norkern.lzm
|
||||
NOR2LOAD: 00000000 ;Image Load Address
|
||||
NOR2ENTRY: 00000000 ;Image Entry Point
|
||||
|
||||
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR3ADDRESS: 0x02900000 ;Image Flash Address
|
||||
-NOR3FILE: \SOFTWARE\juno-r1.dtb ;Image File Name
|
||||
+NOR3FILE: \SOFTWARE\XEN\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
|
||||
@@ -64,8 +64,13 @@
|
||||
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
|
||||
NOR9NAME: uEnv.txt
|
||||
-NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
||||
+NOR9FILE: \SOFTWARE\uenvfile ;Image File Name
|
||||
NOR9LOAD: 00000000 ;Image Load Address
|
||||
NOR9ENTRY: 00000000 ;Image Entry Point
|
||||
|
||||
-
|
||||
+NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
+NOR10ADDRESS: 0x03000000 ;Image Flash Address
|
||||
+NOR10FILE: \SOFTWARE\XEN\xen ;Image File Name
|
||||
+NOR10NAME: xen
|
||||
+NOR10LOAD: 00000000 ;Image Load Address
|
||||
+NOR10ENTRY: 00000000 ;Image Entry Point
|
||||
diff -u a/images-r2.txt b/images-r2.txt
|
||||
--- a/images-r2.txt 2020-11-25 20:40:30.625119321 +0100
|
||||
+++ b/images-r2.txt 2020-11-25 20:41:30.720820597 +0100
|
||||
@@ -1,7 +1,7 @@
|
||||
TITLE: Versatile Express Images Configuration File
|
||||
|
||||
[IMAGES]
|
||||
-TOTALIMAGES: 10 ;Number of Images (Max: 32)
|
||||
+TOTALIMAGES: 11 ;Number of Images (Max: 32)
|
||||
|
||||
NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR0ADDRESS: 0x00000000 ;Image Flash Address
|
||||
@@ -17,14 +17,14 @@
|
||||
|
||||
NOR2UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR2ADDRESS: 0x00500000 ;Image Flash Address
|
||||
-NOR2FILE: \SOFTWARE\Image ;Image File Name
|
||||
-NOR2NAME: norkern ;Rename kernel to norkern
|
||||
+NOR2FILE: \SOFTWARE\Image.lzm ;Image File Name
|
||||
+NOR2NAME: norkern.lzm ;Rename kernel to norkern.lzm
|
||||
NOR2LOAD: 00000000 ;Image Load Address
|
||||
NOR2ENTRY: 00000000 ;Image Entry Point
|
||||
|
||||
NOR3UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR3ADDRESS: 0x02900000 ;Image Flash Address
|
||||
-NOR3FILE: \SOFTWARE\juno-r2.dtb ;Image File Name
|
||||
+NOR3FILE: \SOFTWARE\XEN\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
|
||||
@@ -64,8 +64,13 @@
|
||||
NOR9UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
NOR9ADDRESS: 0x02A80000 ;Image Flash Address
|
||||
NOR9NAME: uEnv.txt
|
||||
-NOR9FILE: \SOFTWARE\uEnv.txt ;Image File Name
|
||||
+NOR9FILE: \SOFTWARE\uenvfile ;Image File Name
|
||||
NOR9LOAD: 00000000 ;Image Load Address
|
||||
NOR9ENTRY: 00000000 ;Image Entry Point
|
||||
|
||||
-
|
||||
+NOR10UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
|
||||
+NOR10ADDRESS: 0x03000000 ;Image Flash Address
|
||||
+NOR10FILE: \SOFTWARE\XEN\xen ;Image File Name
|
||||
+NOR10NAME: xen
|
||||
+NOR10LOAD: 00000000 ;Image Load Address
|
||||
+NOR10ENTRY: 00000000 ;Image Entry Point
|
||||
diff -u a/uEnv.txt b/uEnv.txt
|
||||
--- a/uEnv.txt 2020-11-20 13:48:31.845078690 +0100
|
||||
+++ b/uEnv.txt 2020-11-25 20:30:00.572306675 +0100
|
||||
@@ -1,11 +1,16 @@
|
||||
+xen_name=xen
|
||||
+xen_addr=0x84000000
|
||||
uenvcmd=run mybootcmd
|
||||
+kernel_alt_name=norkern.lzm
|
||||
+kernel_comp_addr_r=0x88080000
|
||||
mybootcmd=echo Loading custom boot command; \
|
||||
echo Loading kernel; \
|
||||
afs load ${kernel_name} ${kernel_addr_r} ; \
|
||||
-if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr_r}; fi; \
|
||||
+if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_comp_addr_r}; lzmadec ${kernel_comp_addr_r} ${kernel_addr_r}; fi; \
|
||||
echo Loading device tree; \
|
||||
afs load ${fdtfile} ${fdt_addr_r}; \
|
||||
if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \
|
||||
afs load ${fdt_alt_name} ${fdt_addr_r}; fi; fdt addr ${fdt_addr_r}; fdt resize; \
|
||||
-booti ${kernel_addr_r} - ${fdt_addr_r};
|
||||
-
|
||||
+echo Loading Xen; \
|
||||
+afs load ${xen_name} ${xen_addr}; \
|
||||
+if test $? -eq 0; then echo Booting Xen; bootefi ${xen_addr} ${fdt_addr_r}; fi;
|
||||
|
||||
-78
@@ -1,78 +0,0 @@
|
||||
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
|
||||
|
||||
|
||||
-78
@@ -1,78 +0,0 @@
|
||||
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
|
||||
|
||||
|
||||
-78
@@ -1,78 +0,0 @@
|
||||
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
|
||||
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
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;
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
# Yocto kernel-cache sets CONFIG_NLS_CODEPAGE_437=m for LINUX_KERNEL_TYPR=preempt-rt
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
# Yocto kernel-cache sets CONFIG_NLS_ISO8859_1=m for LINUX_KERNEL_TYPR=preempt-rt
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
|
||||
# Set the timer interrupt run at 1000 Hz to have a fast response
|
||||
CONFIG_HZ_1000=y
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
define KFEATURE_DESCRIPTION "Extra kernel configs when building with PREEMPT_RT"
|
||||
|
||||
kconf non-hardware preempt-rt-extras.cfg
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
From c2971c8a3f076ea8a522ce4fbb367d112d86c13a Mon Sep 17 00:00:00 2001
|
||||
From: Stefano Stabellini <sstabellini@kernel.org>
|
||||
Date: Mon, 27 Apr 2020 16:15:26 -0700
|
||||
Subject: [PATCH] xen: use handle_fasteoi_irq to handle xen dynamic events
|
||||
|
||||
When handling Xen events, we need to make sure the following sequence is
|
||||
followed:
|
||||
|
||||
- mask event
|
||||
- handle event and clear event (the order does not matter)
|
||||
- unmask event
|
||||
|
||||
It is not possible to implement this flow with handle_edge_irq, so
|
||||
switch back to handle_fasteoi_irq. Please note that Xen event irqs are
|
||||
ONESHOT. Also note that handle_fasteoi_irq was in-use before the
|
||||
following commit, that is partially reverted by this patch:
|
||||
|
||||
7e186bdd0098 xen: do not clear and mask evtchns in __xen_evtchn_do_upcall
|
||||
|
||||
PIRQ handling is left unchanged.
|
||||
|
||||
This patch fixes a domU hang observed when using LinuxRT as dom0 kernel.
|
||||
|
||||
Link: https://lkml.org/lkml/2020/4/27/1287
|
||||
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
|
||||
|
||||
Upstream-Status: Inappropriate since the upstream solution diverges from this patch
|
||||
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
|
||||
---
|
||||
drivers/xen/events/events_base.c | 13 +++----------
|
||||
1 file changed, 3 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
|
||||
index 6c8843968a52..1873a19b8b24 100644
|
||||
--- a/drivers/xen/events/events_base.c
|
||||
+++ b/drivers/xen/events/events_base.c
|
||||
@@ -845,7 +845,7 @@ int bind_evtchn_to_irq(unsigned int evtchn)
|
||||
goto out;
|
||||
|
||||
irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
|
||||
- handle_edge_irq, "event");
|
||||
+ handle_fasteoi_irq, "event");
|
||||
|
||||
ret = xen_irq_info_evtchn_setup(irq, evtchn);
|
||||
if (ret < 0) {
|
||||
@@ -978,7 +978,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu)
|
||||
handle_percpu_irq, "virq");
|
||||
else
|
||||
irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
|
||||
- handle_edge_irq, "virq");
|
||||
+ handle_fasteoi_irq, "virq");
|
||||
|
||||
bind_virq.virq = virq;
|
||||
bind_virq.vcpu = xen_vcpu_nr(cpu);
|
||||
@@ -1387,12 +1387,6 @@ static void ack_dynirq(struct irq_data *data)
|
||||
clear_evtchn(evtchn);
|
||||
}
|
||||
|
||||
-static void mask_ack_dynirq(struct irq_data *data)
|
||||
-{
|
||||
- disable_dynirq(data);
|
||||
- ack_dynirq(data);
|
||||
-}
|
||||
-
|
||||
static int retrigger_dynirq(struct irq_data *data)
|
||||
{
|
||||
unsigned int evtchn = evtchn_from_irq(data->irq);
|
||||
@@ -1595,8 +1589,7 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
|
||||
.irq_mask = disable_dynirq,
|
||||
.irq_unmask = enable_dynirq,
|
||||
|
||||
- .irq_ack = ack_dynirq,
|
||||
- .irq_mask_ack = mask_ack_dynirq,
|
||||
+ .irq_eoi = ack_dynirq,
|
||||
|
||||
.irq_set_affinity = set_affinity_irq,
|
||||
.irq_retrigger = retrigger_dynirq,
|
||||
--
|
||||
2.17.1
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-5.4:"
|
||||
|
||||
SRC_URI_append = " \
|
||||
file://0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch \
|
||||
"
|
||||
|
||||
KERNEL_FEATURES += "features/arm-autonomy/preempt-rt-extras.scc"
|
||||
@@ -0,0 +1,14 @@
|
||||
# short-description: Create a disk image
|
||||
# long-description: Creates a partitioned disk image that the user
|
||||
# can directly dd to boot media.
|
||||
|
||||
# For Juno first partition is rootfs normally populated as /dev/sda1
|
||||
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
|
||||
|
||||
# Second partition to accomodate guests images normally populated as /dev/sda2 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
|
||||
part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
|
||||
|
||||
# Third partition is user defined entry normally populated as /dev/sda3
|
||||
${AUTONOMY_HOST_EXTRA_PARTITION}
|
||||
|
||||
bootloader --ptable msdos
|
||||
@@ -3,7 +3,7 @@
|
||||
# can directly dd to boot media. Uses a custom grub.cfg file to configure the boot.
|
||||
|
||||
# First boot partition normally populated as /dev/sda1
|
||||
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
|
||||
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --size="${BOOT_PART_SIZE}${BOOT_PART_SIZE_UNIT}" --label msdos --active --align 1024
|
||||
|
||||
# Second rootfs partition normally populated as /dev/sda2
|
||||
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
|
||||
@@ -11,4 +11,7 @@ part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
|
||||
# Third partition to accomodate guests images normally populated as /dev/sda3 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
|
||||
part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
|
||||
|
||||
# Fourth partition is user defined entry normally populated as /dev/sda4
|
||||
${AUTONOMY_HOST_EXTRA_PARTITION}
|
||||
|
||||
bootloader --ptable msdos --configfile="${GRUB_CFG_FILE}"
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
set term="vt100"
|
||||
set default="3"
|
||||
set timeout="5"
|
||||
|
||||
source $prefix/arm-autonomy-n1sdp-grub.cfg
|
||||
|
||||
menuentry 'N1SDP PREEMPT_RT ACPI Boot' {
|
||||
linux /Image-preempt-rt $kernel_cmdline acpi=force
|
||||
}
|
||||
|
||||
menuentry 'N1SDP PREEMPT_RT Single-Chip Boot (Device Tree)' {
|
||||
devicetree /n1sdp-single-chip.dtb
|
||||
linux /Image-preempt-rt $kernel_cmdline
|
||||
}
|
||||
|
||||
menuentry 'N1SDP PREEMPT_RT Multi-Chip Boot (Device Tree)' {
|
||||
devicetree /n1sdp-multi-chip.dtb
|
||||
linux /Image-preempt-rt $kernel_cmdline
|
||||
}
|
||||
|
||||
menuentry 'N1SDP PREEMPT_RT Arm Autonomy (Xen) Single-Chip Boot (Device Tree)' {
|
||||
# no_argumants under here is a workaround for a bug
|
||||
# also any kernel or dom0 cmdline arguments has to be passed via dtb
|
||||
# because any arguments put here will be ignored by xen
|
||||
xen_hypervisor /xen.efi no_arguments=use_dtb_for_xen_or_kernel_cmdline
|
||||
xen_module /Image-preempt-rt
|
||||
devicetree /n1sdp-single-chip-xen.dtb
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
CONTAINER_IMAGE_FILE="###CONTAINER_IMAGE_FILE###"
|
||||
CONTAINER_IMAGE_NAME_AND_TAG="###CONTAINER_IMAGE_NAME_AND_TAG###"
|
||||
CONTAINER_IMAGE_FILE_KEEP="###CONTAINER_IMAGE_FILE_KEEP###"
|
||||
|
||||
has_docker_image() {
|
||||
docker image inspect "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
start() {
|
||||
# Image does not exist and image file exists: Import the image.
|
||||
if ! has_docker_image ${CONTAINER_IMAGE_NAME_AND_TAG} && \
|
||||
[ -f "/usr/share/docker/images/${CONTAINER_IMAGE_FILE}" ]; then
|
||||
echo "Importing ${CONTAINER_IMAGE_NAME_AND_TAG} container image..."
|
||||
docker import \
|
||||
/usr/share/docker/images/${CONTAINER_IMAGE_FILE} \
|
||||
${CONTAINER_IMAGE_NAME_AND_TAG} 2>&1 || {
|
||||
echo "Import ${CONTAINER_IMAGE_NAME_AND_TAG} container image: Failed."
|
||||
exit $?
|
||||
}
|
||||
echo "Import ${CONTAINER_IMAGE_NAME_AND_TAG} container image: Done."
|
||||
|
||||
if [ "${CONTAINER_IMAGE_FILE_KEEP}" != "1" ]; then
|
||||
rm /usr/share/docker/images/${CONTAINER_IMAGE_FILE}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start && exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,79 @@
|
||||
#
|
||||
# This recipe imports a docker container image to the xenguest image
|
||||
# Notes:
|
||||
# - Users should add docker in the local.conf of their target with
|
||||
# DISTRO_FEATURES += " docker" to make sure docker is installed.
|
||||
# - The CONTAINER_IMAGE_FILE variable defines the docker
|
||||
# container image to be imported and should be set in local.conf.
|
||||
# - The CONTAINER_IMAGE_FILE_KEEP variable defines the
|
||||
# behaviour that if the container image file is kept after import.
|
||||
# Setting this variable to 1 means keep the container image file after
|
||||
# import. This variable can be set in local.conf.
|
||||
# - The CONTAINER_IMAGE_NAME_AND_TAG variable defines the name and
|
||||
# tag of the imported image. The value of this variable should follow
|
||||
# the format of `NAME:TAG`. This variable can be set in local.conf.
|
||||
#
|
||||
|
||||
DESCRIPTION = "Import a docker image to xenguest"
|
||||
LICENSE = "MIT"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
CONTAINER_IMAGE_FILE ??= ""
|
||||
CONTAINER_IMAGE_FILE_KEEP ??= ""
|
||||
CONTAINER_IMAGE_NAME_AND_TAG ??= "local:local"
|
||||
|
||||
inherit features_check
|
||||
REQUIRED_DISTRO_FEATURES = "docker"
|
||||
|
||||
python __anonymous() {
|
||||
# Check if `CONTAINER_IMAGE_FILE` is empty.
|
||||
container_image_file = d.getVar('CONTAINER_IMAGE_FILE')
|
||||
if not container_image_file:
|
||||
raise bb.parse.SkipRecipe("CONTAINER_IMAGE_FILE is empty")
|
||||
|
||||
# In case we have a symlink we need to convert the link to its realpath.
|
||||
if os.path.islink(container_image_file):
|
||||
container_image_file = os.path.realpath(container_image_file)
|
||||
bb.warn("Given CONTAINER_IMAGE_FILE: %s is a symlink, "
|
||||
"convert the link to its realpath: %s" %
|
||||
(d.getVar('CONTAINER_IMAGE_FILE'), container_image_file))
|
||||
d.setVar('CONTAINER_IMAGE_FILE', container_image_file)
|
||||
|
||||
# Check if the container image file exists.
|
||||
# The container image file here is either the real file or the symlink target.
|
||||
if not os.path.exists(container_image_file):
|
||||
raise bb.parse.SkipRecipe("CONTAINER_IMAGE_FILE: %s does not exist." %
|
||||
container_image_file)
|
||||
|
||||
# Here we can ensure that the CONTAINER_IMAGE_FILE exists and is valid.
|
||||
# Therefore we can append this file to SRC_URI.
|
||||
d.appendVar('SRC_URI', ' file://' + container_image_file + ';unpack=0')
|
||||
}
|
||||
|
||||
S = "${WORKDIR}"
|
||||
SRC_URI = "file://import_container.sh"
|
||||
|
||||
inherit update-rc.d
|
||||
INITSCRIPT_PARAMS = "start 30 2 3 4 5 ."
|
||||
INITSCRIPT_NAME = "import_container.sh"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -d -m 755 ${D}${datadir}/docker/images
|
||||
|
||||
install -m 777 ${CONTAINER_IMAGE_FILE} ${D}${datadir}/docker/images/.
|
||||
install -m 755 import_container.sh ${D}${sysconfdir}/init.d
|
||||
|
||||
BASENAME_CONTAINER_IMAGE_FILE=$(basename "${CONTAINER_IMAGE_FILE}")
|
||||
|
||||
sed -i "s,###CONTAINER_IMAGE_FILE###,${BASENAME_CONTAINER_IMAGE_FILE}," \
|
||||
${D}${sysconfdir}/init.d/import_container.sh
|
||||
sed -i "s,###CONTAINER_IMAGE_NAME_AND_TAG###,${CONTAINER_IMAGE_NAME_AND_TAG}," \
|
||||
${D}${sysconfdir}/init.d/import_container.sh
|
||||
sed -i "s,###CONTAINER_IMAGE_FILE_KEEP###,${CONTAINER_IMAGE_FILE_KEEP}," \
|
||||
${D}${sysconfdir}/init.d/import_container.sh
|
||||
}
|
||||
|
||||
FILES_${PN} += "${datadir}/docker/images"
|
||||
RDEPENDS_${PN} = "packagegroup-docker-runtime-minimal"
|
||||
@@ -0,0 +1 @@
|
||||
CONFIG_FEATURE_TAR_LONG_OPTIONS=y
|
||||
@@ -0,0 +1,4 @@
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
# The --exclude flag in Busybox tar is required by xenguest-mkimage
|
||||
SRC_URI += "file://feature_tar_long_options.cfg"
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
DESCRIPTION = "Arm Autonomy stack host minimal image"
|
||||
|
||||
inherit core-image
|
||||
# When alternate-kernel DISTRO_FEATURE is present we will build
|
||||
# and install the alternate kernel
|
||||
inherit ${@bb.utils.filter('DISTRO_FEATURES', 'alternate-kernel', d)}
|
||||
|
||||
inherit core-image features_check
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
@@ -10,12 +14,21 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
|
||||
# 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]
|
||||
# format: URL[;params]
|
||||
# - 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.
|
||||
# - params encompasses two values that can be optionally set:
|
||||
# - guestname=NAME can be used to specify the name of the guest. If not
|
||||
# specified the default value is the basename of the file
|
||||
# (without .xenguest extension).
|
||||
# - guestcount=NUM can be used to created NUM guests with the same config.
|
||||
# All guests after the first will have numbers appended to the guestname,
|
||||
# starting from 2. In the rootfs additional xenguest files will be
|
||||
# symlinks to the original.
|
||||
# params should be semicolon seperated, without a space, and can appear in
|
||||
# any order.
|
||||
#
|
||||
# Here are examples of values:
|
||||
# /home/mydir/myguest.xenguest;guestname=guest1
|
||||
# /home/mydir/myguest.xenguest;guestname=guest1;guestcount=3
|
||||
# http://www.url.com/testguest.xenguest
|
||||
#
|
||||
# If you are using the output of an other Yocto project, you should use the
|
||||
@@ -50,12 +63,31 @@ 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'")
|
||||
# Documentation for setting up a multiconfig build can be found in:
|
||||
# meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
|
||||
|
||||
if bb.utils.contains('DISTRO_FEATURES', 'xen', False, True, d):
|
||||
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'xen'")
|
||||
# In a multiconfig build this variable will hold a dependency string, which differs based
|
||||
# on whether the guest has initramfs or not.
|
||||
# It may have a space seperated list of dependency strings if mulitple guest types are
|
||||
# configured
|
||||
MC_DOIMAGE_MCDEPENDS ?= ""
|
||||
# Example value: mc:host:guest:core-image-minimal:do_image_complete
|
||||
|
||||
# In a multiconfig build the host task 'do_image' has a dependency on multiconfig guest.
|
||||
# This ensures that the guest image file already exists when it is needed by the host
|
||||
DO_IMAGE_MCDEPENDS := "${@ '${MC_DOIMAGE_MCDEPENDS}' if d.getVar('BBMULTICONFIG') else ''}"
|
||||
|
||||
# Apply mc dependency. Empty string if multiconfig not enabled
|
||||
do_image[mcdepends] += "${DO_IMAGE_MCDEPENDS}"
|
||||
|
||||
REQUIRED_DISTRO_FEATURES += 'arm-autonomy-host'
|
||||
REQUIRED_DISTRO_FEATURES += 'xen'
|
||||
|
||||
python __anonymous() {
|
||||
import re
|
||||
guestfile_pattern = re.compile(r"^([^;]+);")
|
||||
guestname_pattern = re.compile(r";guestname=([^;]+);?")
|
||||
guestcount_pattern = re.compile(r";guestcount=(\d+);?")
|
||||
|
||||
# Check in ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS for extra guests and add them
|
||||
# to SRC_URI with xenguest parameter if not set
|
||||
@@ -65,16 +97,19 @@ python __anonymous() {
|
||||
# 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
|
||||
guestname = os.path.basename(guest)
|
||||
guestfile = guest
|
||||
guestcount = "1"
|
||||
f = guestfile_pattern.search(guest)
|
||||
n = guestname_pattern.search(guest)
|
||||
c = guestcount_pattern.search(guest)
|
||||
|
||||
if f is not None:
|
||||
guestfile = f.group(1)
|
||||
if n is not None:
|
||||
guestname = n.group(1)
|
||||
if c is not None:
|
||||
guestcount = c.group(1)
|
||||
# in case we have a link we need the destination
|
||||
guestfile = os.path.realpath(guestfile)
|
||||
|
||||
@@ -83,7 +118,7 @@ python __anonymous() {
|
||||
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)
|
||||
d.appendVar('SRC_URI', ' file://' + guestfile + ';guestname=' + guestname + ';guestcount=' + guestcount)
|
||||
else:
|
||||
# we have a Yocto URL
|
||||
try:
|
||||
@@ -119,8 +154,15 @@ python add_extern_guests () {
|
||||
# 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)
|
||||
|
||||
if 'guestcount' in parm:
|
||||
guestcount = int(parm['guestcount']) + 1
|
||||
|
||||
for i in range(2, guestcount):
|
||||
os.symlink('./' + dstname, guestdir + '/' + dstname.replace('.xenguest', str(i) + '.xenguest'))
|
||||
}
|
||||
|
||||
IMAGE_PREPROCESS_COMMAND += "add_extern_guests; "
|
||||
|
||||
@@ -14,10 +14,12 @@ 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"
|
||||
# kernel size is passed to xen via xen.dtb so wee need to add
|
||||
# 'virtual/kernel:do_deploy' as a dependency
|
||||
XEN_DEVICETREE_DEPEND_append = " 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_MEM ?= "1024M,max:1024M"
|
||||
XEN_DEVICETREE_DOM0_BOOTARGS ?= "console=hvc0 earlycon=xen"
|
||||
XEN_DEVICETREE_DOM0_ADDR ?= "0x80080000"
|
||||
XEN_DEVICETREE_DOM0_SIZE ?= "0x01000000"
|
||||
@@ -28,11 +30,36 @@ XEN_DEVICETREE_DTSI_MERGE ?= "xen.dtsi"
|
||||
inherit nopackages deploy
|
||||
|
||||
DEPENDS += "dtc-native"
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
do_compile[noexec] = "1"
|
||||
do_install[noexec] = "1"
|
||||
|
||||
# Validate xen devicetree variables
|
||||
python __anonymous() {
|
||||
|
||||
# Compare values of a list of variables to a regex pattern
|
||||
def validate_type(pattern, var_list):
|
||||
for varname in var_list:
|
||||
if d.getVar(varname):
|
||||
if not pattern.match(d.getVar(varname)):
|
||||
raise bb.parse.SkipRecipe(d.getVar(varname) + "' is not a valid value for " + varname + "!")
|
||||
else:
|
||||
raise bb.parse.SkipRecipe('Required variable ' + varname + ' is empty!')
|
||||
|
||||
import re
|
||||
|
||||
num_vars_to_check = ['XEN_DEVICETREE_DOM0_ADDR', 'XEN_DEVICETREE_DOM0_SIZE']
|
||||
size_vars_to_check = ['XEN_DEVICETREE_DOM0_MEM']
|
||||
|
||||
num_pattern = re.compile(r'((0x[0-9a-fA-F]+)|[0-9]+)$')
|
||||
size_pattern = re.compile(r'[0-9]+[MG](,max:[0-9]+[MG])?$')
|
||||
|
||||
validate_type(num_pattern, num_vars_to_check)
|
||||
validate_type(size_pattern, size_vars_to_check)
|
||||
}
|
||||
|
||||
do_deploy() {
|
||||
if [ ! -f ${WORKDIR}/xen.dtsi.in ]; then
|
||||
die "xen.dtsi.in does not exist"
|
||||
@@ -67,6 +94,37 @@ do_deploy() {
|
||||
done
|
||||
}
|
||||
do_deploy[depends] += "${XEN_DEVICETREE_DEPEND}"
|
||||
do_deploy[prefuncs] += "calc_xen_dtb_dom0_size"
|
||||
|
||||
addtask deploy after do_install
|
||||
|
||||
python calc_xen_dtb_dom0_size() {
|
||||
from math import ceil
|
||||
size = 0
|
||||
if d.getVar('KERNEL_IMAGE_MAXSIZE'):
|
||||
bb.note('size calculation based on KERNEL_IMAGE_MAXSIZE')
|
||||
size = int(d.getVar('KERNEL_IMAGE_MAXSIZE')) * 1024
|
||||
else:
|
||||
kernel = os.path.realpath(d.getVar('DEPLOY_DIR_IMAGE') + '/' +\
|
||||
d.getVar('KERNEL_IMAGETYPE'))
|
||||
size = os.stat(kernel).st_size
|
||||
bb.note('size calculation based on kernel Image file: %s' % kernel)
|
||||
|
||||
bb.note('size in bytes: %d' % size)
|
||||
# Ceil to MiB
|
||||
size_required = ceil(size / (2 ** 20)) * (2 ** 20)
|
||||
xen_devicetree_dom0_size = d.getVar('XEN_DEVICETREE_DOM0_SIZE')
|
||||
if xen_devicetree_dom0_size[:2] == "0x":
|
||||
size_defined = int(xen_devicetree_dom0_size, 16)
|
||||
else:
|
||||
size_defined = int(xen_devicetree_dom0_size)
|
||||
|
||||
if size_required > size_defined:
|
||||
bb.note ("Wrong kernel size setting inside xen dtb!\n"\
|
||||
"Required:\t%(req)d (%(req)#010X)\n"\
|
||||
"Requested:\t%(def)d (%(def)#010X)"\
|
||||
% {"req": size_required, "def": size_defined})
|
||||
bb.note ("Overriding XEN_DEVICETREE_DOM0_SIZE with "\
|
||||
"%(req)d (%(req)#010X)" % {"req": size_required})
|
||||
d.setVar('XEN_DEVICETREE_DOM0_SIZE', hex(size_required))
|
||||
}
|
||||
|
||||
@@ -1,18 +1,34 @@
|
||||
Upstream-Status: Pending
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
|
||||
|
||||
From 5499e0fc8082024bf7e2d0facd5c976e82105070 Mon Sep 17 00:00:00 2001
|
||||
From: Diego Sueiro <diego.sueiro@arm.com>
|
||||
Date: Thu, 20 Aug 2020 11:58:20 +0100
|
||||
Subject: [PATCH] tools/hotplug: Fix hostname setting in vif-nat
|
||||
|
||||
Setting the hostname is failing because the "$XENBUS_PATH/domain"
|
||||
doesn't exist anymore. To fix this we set it to dom$domid
|
||||
|
||||
Index: git/tools/hotplug/Linux/vif-nat
|
||||
===================================================================
|
||||
--- git.orig/tools/hotplug/Linux/vif-nat
|
||||
+++ git/tools/hotplug/Linux/vif-nat
|
||||
@@ -86,6 +86,7 @@ router_ip=$(routing_ip "$ip")
|
||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
|
||||
Acked-by: Wei Liu <wl@xen.org>
|
||||
---
|
||||
tools/hotplug/Linux/vif-nat | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/hotplug/Linux/vif-nat b/tools/hotplug/Linux/vif-nat
|
||||
index a76d9c784b..26144350b3 100644
|
||||
--- a/tools/hotplug/Linux/vif-nat
|
||||
+++ b/tools/hotplug/Linux/vif-nat
|
||||
@@ -85,7 +85,7 @@ router_ip=$(routing_ip "$ip")
|
||||
# Split the given IP/bits pair.
|
||||
vif_ip=`echo ${ip} | awk -F/ '{print $1}'`
|
||||
|
||||
hostname=$(xenstore_read "$XENBUS_PATH/domain" | tr -- '_.:/+' '-----')
|
||||
+[ -z "${hostname}" ] && hostname=dom$domid
|
||||
-hostname=$(xenstore_read "$XENBUS_PATH/domain" | tr -- '_.:/+' '-----')
|
||||
+hostname=dom$domid
|
||||
if [ "$vifid" != "1" ]
|
||||
then
|
||||
hostname="$hostname-$vifid"
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/var/log/xenguest {
|
||||
missingok
|
||||
size 10k
|
||||
copytruncate
|
||||
rotate 2
|
||||
}
|
||||
@@ -11,11 +11,13 @@ BRIDGE_NAME="###BRIDGE_NAME###"
|
||||
case "${XENGUEST_NETWORK_TYPE:=}" in
|
||||
nat)
|
||||
echo "vif = ['script=vif-nat']" >> ${guestcfgfile}
|
||||
log info "Network type is NAT"
|
||||
;;
|
||||
bridge)
|
||||
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> ${guestcfgfile}
|
||||
log info "Network type is bridge: ${BRIDGE_NAME}"
|
||||
;;
|
||||
*)
|
||||
echo "${@}: XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
|
||||
log error "XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -65,8 +65,10 @@ case "$1" in
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping xenguest"
|
||||
# update guest list
|
||||
guestlist=$(xenguest-manager status | grep Running | cut -d ":" -f1)
|
||||
for f in ${guestlist}; do
|
||||
/usr/bin/xenguest-manager stop ${f}
|
||||
xenguest-manager shutdown ${f} --kill
|
||||
done
|
||||
;;
|
||||
reload)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -110,7 +110,8 @@ Init configuration
|
||||
|
||||
Disk configuration
|
||||
--disk-reset-config reset disk guest configuration to default (no disk)
|
||||
--disk-size=SZ set guest disk size (in GB)
|
||||
--disk-size=SZ set guest disk size in MB or GB(default),
|
||||
e.g 1000M or 2[G].
|
||||
--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.
|
||||
@@ -127,7 +128,7 @@ Disk configuration
|
||||
--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.
|
||||
--disk-rm-file=DST remove disk file DST from the xenguest image.
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -370,13 +371,159 @@ disk_config_rm_part() {
|
||||
sed -i "/DISK_PART${partid}=.*/d" ${IMAGE_TMPDIR}/disk.cfg
|
||||
}
|
||||
|
||||
is_integer() {
|
||||
if ! [[ "${1}" =~ ^[0-9]+$ ]]; then
|
||||
>&2 echo "error: invalid number '${1}'"; exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# check size and convert it to MB, e.g '1[G]' => '1000M'
|
||||
check_size() {
|
||||
local disksize="${1}"
|
||||
|
||||
[ -n "${disksize}" ] || disksize="invalid"
|
||||
|
||||
# disksize may have appended M or G suffix, let's extract it
|
||||
# ${var:offset:length}, where #var is var length
|
||||
local lastchar="${disksize:${#disksize}-1}"
|
||||
case "${lastchar}" in
|
||||
[0-9])
|
||||
# backwards compatibility
|
||||
is_integer "${disksize}"
|
||||
echo -e "$((${disksize} * 1000))M"
|
||||
return
|
||||
;;
|
||||
G|M)
|
||||
if [ "${#disksize}" -gt "1" ]; then
|
||||
local size="${disksize::${#disksize}-1}"
|
||||
is_integer "${size}"
|
||||
# convert GB to MB
|
||||
[ "${lastchar}" = "M" ] || size=$((${size} * 1000))
|
||||
echo -e "${size}M"
|
||||
return
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
>&2 echo -e "Invalid size format '${1}'" \
|
||||
"\n\tSupported size format is e.g 1000M or 2[G]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
disk_config_get_size() {
|
||||
disksize=$(echo -e "$( . ${IMAGE_TMPDIR}/disk.cfg && echo $DISK_SIZE)")
|
||||
check_size "${disksize}"
|
||||
}
|
||||
|
||||
disk_config_get_parts() {
|
||||
echo -e "$( . ${IMAGE_TMPDIR}/disk.cfg && \
|
||||
typeset -p | awk '$3 ~ /^DISK_PART/ { print $3 }')"
|
||||
}
|
||||
|
||||
disk_config_get_free_space() {
|
||||
disk_usage="0"
|
||||
for partinfo in $(disk_config_get_parts)
|
||||
do
|
||||
partsize=$(echo "${partinfo}" | cut -d '"' -f2 | sed -e "s/:.*//")
|
||||
sizeMB=$(check_size "${partsize}")
|
||||
[ -n "${sizeMB}" ] || exit 1
|
||||
disk_usage=$((${sizeMB::${#sizeMB}-1} + $disk_usage))
|
||||
done
|
||||
|
||||
disk_size=$(disk_config_get_size)
|
||||
echo -e "$((${disk_size::${#disk_size}-1} - ${disk_usage}))M"
|
||||
}
|
||||
|
||||
disk_check_partition_format() {
|
||||
local partformat="${1}"
|
||||
# if partformat is not defined let's skip this check
|
||||
[ -n "${partformat}" ] || return 0
|
||||
|
||||
case "${partformat}" in
|
||||
vfat|ext2|ext3|ext4|swap)
|
||||
;;
|
||||
*)
|
||||
# invalid/unknown fstype
|
||||
echo "Invalid file fstype ${partformat}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
disk_check_partition_content() {
|
||||
local partcontent="${1}"
|
||||
# if partcontent is not defined let's skip this check
|
||||
[ -n "${partcontent}" ] || return 0
|
||||
|
||||
case "${partcontent}" in
|
||||
*.img*)
|
||||
case "${partcontent}" in
|
||||
*.img.gz|*.img.bz2|*.img)
|
||||
;;
|
||||
*)
|
||||
# invalid/unknown compression type
|
||||
echo "Invalid file format in disk ${partcontent}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.tar*)
|
||||
case "${partcontent}" in
|
||||
*.tar.gz|*.tar.bz2|*.tar.xz|*.tar)
|
||||
;;
|
||||
*)
|
||||
# invalid/unknown tar type
|
||||
echo "Invalid file format in disk ${partcontent}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#invalid content type
|
||||
echo "Unsupported content type ${partcontent}!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
# do not allow to create multiple partitions the same content
|
||||
if grep ":${partcontent}\"" <<< "$(disk_config_get_parts)"; then
|
||||
echo "Error ${partcontent} is already inside guest image"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
disk_config_add_part() {
|
||||
partconf="${1}"
|
||||
partid=$(echo ${partconf} | sed -e "s/:.*//")
|
||||
partinfo=$(echo ${partconf} | sed -e "s/[^:]*://")
|
||||
partsize=$(echo ${partinfo} | cut -d ":" -f1)
|
||||
partformat=$(echo ${partinfo} | cut -d ":" -f2)
|
||||
partcontent=$(echo ${partinfo} | cut -d ":" -f3)
|
||||
|
||||
# check size "ID:*SIZE*:FORMAT:CONTENT"
|
||||
partsizeMB=$(check_size "${partsize}")
|
||||
|
||||
# Make sure we don't add the same partition twice
|
||||
disk_config_rm_part ${partid}
|
||||
disk_config_rm_part "${partid}"
|
||||
|
||||
# check available disk space
|
||||
freespace=$(disk_config_get_free_space)
|
||||
if ((${partsizeMB::${#partsizeMB}-1} > ${freespace::${#freespace}-1}))
|
||||
then
|
||||
echo -e "Not enough free disk space(${freespace}) for partition "\
|
||||
"'${partconf}'!"\
|
||||
"\tTo adjust disk size use '--disk-size' parameter"\
|
||||
"\tor shrink the partition with '--disk-add-part' parameter"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check format "ID:SIZE:*FORMAT*:CONTENT"
|
||||
disk_check_partition_format "${partformat}"
|
||||
|
||||
# check content "ID:SIZE:FORMAT:*CONTENT*"
|
||||
disk_check_partition_content "${partcontent}"
|
||||
|
||||
echo "DISK_PART${partid}=\"${partinfo}\"" >> \
|
||||
${IMAGE_TMPDIR}/disk.cfg
|
||||
}
|
||||
@@ -742,11 +889,13 @@ for arg in "${@}"; do
|
||||
disk_config_reset
|
||||
;;
|
||||
--disk-size=*)
|
||||
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${optarg}\"/" \
|
||||
size=$(check_size "${optarg}")
|
||||
[ -n "size" ] || exit 1
|
||||
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${size}\"/" \
|
||||
${IMAGE_TMPDIR}/disk.cfg
|
||||
;;
|
||||
--disk-device=*)
|
||||
sed -i "s/DISK_DEVICE=.*/DISK_SIZE=\"${optarg}\"/" \
|
||||
sed -i "s@DISK_DEVICE=.*@DISK_DEVICE=\"${optarg}\"@" \
|
||||
${IMAGE_TMPDIR}/disk.cfg
|
||||
;;
|
||||
--disk-add-part=*)
|
||||
|
||||
@@ -31,15 +31,14 @@ case "${XENGUEST_NETWORK_TYPE:-}" in
|
||||
release_lock "vif-nat-kea"
|
||||
exit 0
|
||||
fi
|
||||
echo "Waiting for ${vif_name} - network interface is not ready..."\
|
||||
" try #${try}" >> "${LOGFILE}" 2>&1
|
||||
log info "Waiting for ${vif_name} - network interface is not ready..."
|
||||
log info "try #${try}"
|
||||
sleep 1
|
||||
done
|
||||
echo "ERROR: Failed to get ${vif_name} "\
|
||||
"network interface ready!" >> "${LOGFILE}" 2>&1
|
||||
log error "Failed to get ${vif_name}. network interface ready!"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "No action needed" >> "${LOGFILE}" 2>&1
|
||||
log verbose "No action needed"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -2,6 +2,16 @@
|
||||
#
|
||||
# xenguest-manager is a tool to control xen guest (e.g. create, start, stop)
|
||||
#
|
||||
# By default xenguest-manager logs to /var/log when in verbose mode, which is a
|
||||
# Volatile directory. To persist logs across reboots the following needs to be
|
||||
# added to either local.conf or distro.conf
|
||||
#
|
||||
# VOLATILE_LOG_DIR="no"
|
||||
#
|
||||
# Read more here: https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-VOLATILE_LOG_DIR
|
||||
#
|
||||
# When this is enabled, logrotate will monitor the file to ensure it does not grow
|
||||
# excessively large. See files/logrotate-xenguest
|
||||
|
||||
DESCRIPTION = "Xen Guest Manager"
|
||||
LICENSE = "MIT"
|
||||
@@ -9,6 +19,7 @@ LICENSE = "MIT"
|
||||
SRC_URI = " \
|
||||
file://xenguest-manager \
|
||||
file://xenguest-init \
|
||||
file://logrotate-xenguest \
|
||||
"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
@@ -17,14 +28,16 @@ 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_VOLUME_NAME ?= "vg-xen-$(basename ${XENGUEST_MANAGER_VOLUME_DEVICE})"
|
||||
XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
|
||||
XENGUEST_MANAGER_LOG_LEVEL ?= "ERROR"
|
||||
|
||||
# We add an init script to create and start guests automatically
|
||||
# run start script after xen-tools and run stop script before xen-tools
|
||||
INITSCRIPT_NAME = "xenguest"
|
||||
INITSCRIPT_PARAMS = "defaults 90"
|
||||
INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 79 0 1 6 ."
|
||||
|
||||
inherit update-rc.d
|
||||
inherit allarch update-rc.d
|
||||
|
||||
do_compile() {
|
||||
echo "XENGUEST_VOLUME_DEVICE=\"${XENGUEST_MANAGER_VOLUME_DEVICE}\"" > \
|
||||
@@ -33,6 +46,8 @@ do_compile() {
|
||||
xenguest-manager.conf
|
||||
echo "XENGUEST_GUEST_DIR=\"${XENGUEST_MANAGER_GUEST_DIR}\"" >> \
|
||||
xenguest-manager.conf
|
||||
echo "XENGUEST_LOG_LEVEL=\"${XENGUEST_MANAGER_LOG_LEVEL}\"" >> \
|
||||
xenguest-manager.conf
|
||||
}
|
||||
|
||||
do_install() {
|
||||
@@ -43,10 +58,13 @@ do_install() {
|
||||
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}
|
||||
install -d -m 755 ${D}${sysconfdir}/logrotate.d
|
||||
install -m 644 logrotate-xenguest ${D}${sysconfdir}/logrotate.d/xenguest
|
||||
}
|
||||
|
||||
# Things that we need on the target
|
||||
RDEPENDS_${PN} += "bash tar xenguest-mkimage lvm2 xen-tools parted e2fsprogs dosfstools"
|
||||
RDEPENDS_${PN} += "bash xenguest-mkimage lvm2 xen-tools parted e2fsprogs \
|
||||
dosfstools logrotate"
|
||||
|
||||
FILES_${PN} += "${bindir}/xenguest-manager \
|
||||
${sysconfdir}/xenguest"
|
||||
|
||||
@@ -17,6 +17,8 @@ S = "${WORKDIR}"
|
||||
# Can be built native also to produce xenguest images during Yocto build
|
||||
BBCLASSEXTEND = "native"
|
||||
|
||||
inherit allarch
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
do_compile[noexec] = "1"
|
||||
|
||||
@@ -25,7 +27,7 @@ do_install() {
|
||||
install -m 755 xenguest-mkimage ${D}${bindir}/.
|
||||
}
|
||||
|
||||
# We need bash and tar
|
||||
RDEPENDS_${PN} = "bash tar"
|
||||
# We need bash
|
||||
RDEPENDS_${PN} = "bash"
|
||||
FILES_${PN} = "${bindir}/xenguest-mkimage"
|
||||
|
||||
|
||||
@@ -29,16 +29,17 @@ PACKAGES =+ "${PN}-kea-dhcp4"
|
||||
|
||||
# Bridge configurator needs to run before S01networking init script
|
||||
# Prefix with a_ to make sure it is executed in runlevel 01 before others
|
||||
# run start script before ifupdown and run stop script after ifupdown
|
||||
INITSCRIPT_PACKAGES = "${PN} ${PN}-kea-dhcp4"
|
||||
INITSCRIPT_NAME_${PN} = "a_xenguest-network-bridge"
|
||||
INITSCRIPT_PARAMS_${PN} = "defaults 01"
|
||||
INITSCRIPT_PARAMS_${PN} = "start 01 2 3 4 5 . stop 81 0 1 6 ."
|
||||
|
||||
# Kea configuration needs to be restored before kea init scripts:
|
||||
# Kea dhcp4 server is 30, so lets use 20, to have higher priority
|
||||
INITSCRIPT_NAME_${PN}-kea-dhcp4 = "kea-restore-default-config"
|
||||
INITSCRIPT_PARAMS_${PN}-kea-dhcp4 = "defaults 20"
|
||||
|
||||
inherit update-rc.d
|
||||
inherit allarch update-rc.d
|
||||
|
||||
do_install() {
|
||||
cat ${WORKDIR}/xenguest-network-bridge.in \
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
define KFEATURE_DESCRIPTION "Common XEN (Host and Guest) configs and patches on autonomy systems"
|
||||
|
||||
kconf non-hardware xen-common.cfg
|
||||
|
||||
patch 0001-xen-arm-do-not-setup-the-runstate-info-page-if-kpti-.patch
|
||||
|
||||
+1
@@ -5,5 +5,6 @@
|
||||
define KFEATURE_DESCRIPTION "Enable netfilter + conn tracking + extras"
|
||||
define KFEATURE_COMPATIBILITY all
|
||||
|
||||
include cfg/net/bridge.scc
|
||||
include features/netfilter/netfilter.scc
|
||||
kconf non-hardware netfilter-extra.cfg
|
||||
|
||||
@@ -33,3 +33,13 @@ KMACHINE_arm64-autonomy-guest = "arm64-autonomy-guest"
|
||||
# Add Minimal Kernel Configs for Docker runtime
|
||||
KERNEL_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', \
|
||||
'docker', 'features/arm-autonomy/docker-minimal.scc', '', d)}"
|
||||
|
||||
python() {
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
kernelVersion = d.getVar('LINUX_VERSION')
|
||||
|
||||
if kernelVersion and LooseVersion(kernelVersion) < '5.10':
|
||||
if oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
|
||||
d.appendVar('SRC_URI', ' file://files/0001-xen-arm-do-not-setup-the-runstate-info-page-if-kpti-.patch' )
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
# The empty wic plugin is used to create unformatted empty partitions for wic
|
||||
# images.
|
||||
# To use it you must pass "empty" as argument for the "--source" parameter in
|
||||
# the wks file. For example:
|
||||
# part foo --source empty --ondisk sda --size="1024" --align 1024
|
||||
|
||||
import logging
|
||||
|
||||
from wic.pluginbase import SourcePlugin
|
||||
|
||||
logger = logging.getLogger('wic')
|
||||
|
||||
class EmptyPartitionPlugin(SourcePlugin):
|
||||
"""
|
||||
Populate unformatted empty partition.
|
||||
"""
|
||||
|
||||
name = 'empty'
|
||||
|
||||
@classmethod
|
||||
def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
|
||||
oe_builddir, bootimg_dir, kernel_dir,
|
||||
rootfs_dir, native_sysroot):
|
||||
"""
|
||||
Called to do the actual content population for a partition i.e. it
|
||||
'prepares' the partition to be incorporated into the image.
|
||||
"""
|
||||
return
|
||||
@@ -7,11 +7,11 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
|
||||
|
||||
BBFILE_COLLECTIONS += "meta-arm-bsp"
|
||||
BBFILE_PATTERN_meta-arm-bsp = "^${LAYERDIR}/"
|
||||
BBFILE_PRIORITY_meta-arm-bsp = "6"
|
||||
BBFILE_PRIORITY_meta-arm-bsp = "5"
|
||||
|
||||
LAYERSERIES_COMPAT_meta-arm-bsp = "gatesgarth"
|
||||
|
||||
LAYERDEPENDS_meta-arm-bsp = "core meta-arm meta-kernel"
|
||||
LAYERDEPENDS_meta-arm-bsp = "core meta-arm"
|
||||
# This won't be used by layerindex-fetch, but works everywhere else
|
||||
LAYERDEPENDS_meta-arm-bsp_append_musca-b1 = " meta-python"
|
||||
LAYERDEPENDS_meta-arm-bsp_append_musca-s1 = " meta-python"
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# 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-stable"
|
||||
PREFERRED_VERSION_linux-stable ?= "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"
|
||||
|
||||
# Cortex-a5 u-boot configuration
|
||||
UBOOT_MACHINE = "designstart_ca5_defconfig"
|
||||
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
|
||||
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#@TYPE: Machine
|
||||
#@NAME: Corstone-500 machine
|
||||
#@DESCRIPTION: Machine configuration for the Corstone-500 platform
|
||||
|
||||
require conf/machine/include/tune-cortexa5.inc
|
||||
|
||||
#
|
||||
# Corstone-500 is built against poky-tiny distro.
|
||||
# poky-tiny sets PREFERRED_PROVIDER_virtual/kernel to linux-yocto-tiny.
|
||||
# Since distro config is evaluated after the machine config, we need to
|
||||
# use the strongest override possible (forcevariable) so the
|
||||
# PREFERRED_PROVIDER_virtual/kernel specified in the machine config will
|
||||
# apply.
|
||||
#
|
||||
PREFERRED_PROVIDER_virtual/kernel_forcevariable = "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.3%"
|
||||
KBUILD_DEFCONFIG = "multi_v7_defconfig"
|
||||
KCONFIG_MODE = "--alldefconfig"
|
||||
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
IMAGE_FSTYPES += "tar.bz2 cpio.gz"
|
||||
|
||||
# Corstone-500 u-boot configuration
|
||||
UBOOT_MACHINE = "designstart_ca5_defconfig"
|
||||
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
|
||||
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
|
||||
PREFERRED_VERSION_u-boot ?= "2020.07"
|
||||
@@ -1,17 +0,0 @@
|
||||
# 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.inc
|
||||
require conf/machine/include/arm/arch-armv8a.inc
|
||||
|
||||
TUNE_FEATURES = "aarch64"
|
||||
|
||||
# FVP u-boot configuration
|
||||
UBOOT_MACHINE = "vexpress_aemv8a_semi_defconfig"
|
||||
|
||||
KERNEL_IMAGETYPE = "Image"
|
||||
|
||||
KERNEL_DEVICETREE = "arm/foundation-v8-gicv3-psci.dtb"
|
||||
@@ -9,8 +9,6 @@ require conf/machine/include/arm/arch-armv7a.inc
|
||||
|
||||
KERNEL_IMAGETYPE = "zImage"
|
||||
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.2%"
|
||||
|
||||
# FVP u-boot configuration
|
||||
UBOOT_MACHINE = "vexpress_aemv8a_aarch32_defconfig"
|
||||
|
||||
|
||||
@@ -29,7 +29,10 @@ DISK_IMG_PARTITION3_CONTENT = ""
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||
|
||||
PREFERRED_VERSION_u-boot ?= "2020.10"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
||||
|
||||
|
||||
@@ -8,14 +8,13 @@ TFA_PLATFORM = "corstone700"
|
||||
|
||||
SERIAL_CONSOLES ?= "115200;ttyAMA0"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel_corstone700 = "linux-stable"
|
||||
PREFERRED_VERSION_linux-stable ?= "5.6%"
|
||||
PREFERRED_PROVIDER_virtual/kernel_corstone700 = "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.6%"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "scp-firmware"
|
||||
PREFERRED_VERSION_control-processor-firmware ?= "2.6.0"
|
||||
PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "boot-firmware"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += " \
|
||||
virtual/trusted-firmware-a \
|
||||
|
||||
@@ -20,7 +20,9 @@ SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
# Use kernel provided by yocto
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
||||
PREFERRED_VERSION_scp-firmware ?= "2.6%"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
PREFERRED_VERSION_u-boot ?= "2020.07"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot firmware-image-juno"
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
#@NAME: Musca-B1 machine
|
||||
#@DESCRIPTION: Machine configuration for Musca-B1
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
|
||||
PREFERRED_VERSION_trusted-firmware-m = "1.0"
|
||||
|
||||
DEFAULTTUNE ?= "armv8m-main"
|
||||
require conf/machine/include/tune-cortexm33.inc
|
||||
|
||||
@@ -14,7 +11,8 @@ require conf/machine/include/tune-cortexm33.inc
|
||||
TCLIBC = "newlib"
|
||||
|
||||
# For runqemu
|
||||
require conf/machine/include/qemu.inc
|
||||
IMAGE_FSTYPES += "ext4"
|
||||
IMAGE_CLASSES += "qemuboot"
|
||||
QB_SYSTEM_NAME = "qemu-system-arm"
|
||||
QB_MACHINE = "-machine musca-b1"
|
||||
QB_CPU = "-cpu cortex-m33"
|
||||
@@ -25,3 +23,5 @@ QB_MEM = "512k"
|
||||
ZEPHYR_BOARD = "v2m_musca_b1"
|
||||
ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
|
||||
ARCH_musca-b1 = "arm"
|
||||
|
||||
TFM_PLATFORM = "MUSCA_B1"
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
#@NAME: Musca-S1 machine
|
||||
#@DESCRIPTION: Machine configuration for Musca-S1
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
|
||||
PREFERRED_VERSION_trusted-firmware-m = "1.0"
|
||||
|
||||
require conf/machine/include/tune-cortexm33.inc
|
||||
|
||||
# GLIBC will not work with Cortex-M.
|
||||
TCLIBC = "newlib"
|
||||
|
||||
TFM_PLATFORM = "MUSCA_S1"
|
||||
|
||||
@@ -8,7 +8,7 @@ require conf/machine/include/tune-neoversen1.inc
|
||||
|
||||
KERNEL_IMAGETYPE = "Image"
|
||||
|
||||
IMAGE_FSTYPES += "wic tar.bz2 ext4"
|
||||
IMAGE_FSTYPES += "wic wic.gz wic.bmap tar.bz2 ext4"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
@@ -17,22 +17,23 @@ WKS_FILE ?= "n1sdp-efidisk.wks"
|
||||
IMAGE_EFI_BOOT_FILES ?= "n1sdp-multi-chip.dtb n1sdp-single-chip.dtb"
|
||||
WKS_FILE_DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}"
|
||||
|
||||
# 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%"
|
||||
# Use kernel provided by yocto
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||
|
||||
# RTL8168E Gigabit Ethernet Controller is attached to the PCIe interface
|
||||
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
|
||||
|
||||
# Trusted firmware v2.3 version
|
||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
||||
EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
|
||||
|
||||
PREFERRED_VERSION_scp-firmware ?= "2.7%"
|
||||
|
||||
#UEFI EDK2 firmware
|
||||
EXTRA_IMAGEDEPENDS += "virtual/uefi-firmware"
|
||||
PREFERRED_VERSION_edk2-firmware ?= "201911%"
|
||||
|
||||
#grub-efi
|
||||
EFI_PROVIDER ?= "grub-efi"
|
||||
|
||||
@@ -16,10 +16,13 @@ EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
||||
|
||||
# Use kernel provided by linaro
|
||||
KERNEL_IMAGETYPE ?= "Image"
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-stable"
|
||||
PREFERRED_VERSION_linux-stable ?= "5.7%"
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.7%"
|
||||
KCONFIG_MODE = "--alldefconfig"
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
PREFERRED_VERSION_edk2-firmware ?= "202011%"
|
||||
|
||||
#grub-efi
|
||||
EFI_PROVIDER ?= "grub-efi"
|
||||
MACHINE_FEATURES += "efi"
|
||||
|
||||
@@ -10,19 +10,34 @@ require conf/machine/include/arm/arch-armv8a.inc
|
||||
|
||||
# Das U-boot
|
||||
UBOOT_MACHINE ?= "total_compute_defconfig"
|
||||
PREFERRED_VERSION_u-boot ?= "2020.10"
|
||||
UBOOT_RD_LOADADDRESS = "0x88000000"
|
||||
UBOOT_RD_ENTRYPOINT = "0x88000000"
|
||||
UBOOT_LOADADDRESS = "0x80080000"
|
||||
UBOOT_ENTRYPOINT = "0x80080000"
|
||||
# Below options will generate a key to sign the kernel Image and INITRAMFS_IMAGE
|
||||
# according to the default parameters of kernel-fitimage.bbclass. If the user
|
||||
# would prefer to use their own keys, disable the key generation using the
|
||||
# FIT_GENERATE_KEYS parameter and specify the location of the keys using the
|
||||
# below paramters.
|
||||
UBOOT_SIGN_ENABLE = "1"
|
||||
UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb"
|
||||
UBOOT_SIGN_KEYNAME = "dev_key"
|
||||
UBOOT_SIGN_KEYDIR = "${DEPLOY_DIR_IMAGE}/keys"
|
||||
FIT_GENERATE_KEYS = "1"
|
||||
|
||||
# Trusted firmware A v2.3
|
||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||
|
||||
PREFERRED_VERSION_linux-arm64-ack ?= "5.4"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-arm64-ack"
|
||||
|
||||
# Cannot use the default zImage on arm64
|
||||
KERNEL_IMAGETYPE = "Image"
|
||||
KERNEL_BOOTCMD = "booti"
|
||||
IMAGE_FSTYPES += "cpio.gz.u-boot"
|
||||
KERNEL_IMAGETYPES += "fitImage"
|
||||
KERNEL_CLASSES = " kernel-fitimage "
|
||||
|
||||
IMAGE_FSTYPES += "cpio.gz"
|
||||
INITRAMFS_IMAGE ?= "core-image-minimal"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# Cortex-A5 DesignStart A5DS Platform Support in meta-arm-bsp
|
||||
# Corstone-500 Platform Support in meta-arm-bsp
|
||||
|
||||
## Howto Build and Run
|
||||
|
||||
### Configuration:
|
||||
In the local.conf file, MACHINE should be set as follow:
|
||||
MACHINE ?= "a5ds"
|
||||
DISTRO ?= "iota-tiny"
|
||||
MACHINE ?= "corstone500"
|
||||
DISTRO ?= "poky-tiny"
|
||||
|
||||
Or set environment variables with that values:
|
||||
|
||||
MACHINE "a5ds"
|
||||
DISTRO "iota-tiny"
|
||||
MACHINE "corstone500"
|
||||
DISTRO "poky-tiny"
|
||||
|
||||
### Build:
|
||||
``bash$ bitbake iota-tiny-image```
|
||||
``bash$ bitbake arm-reference-image```
|
||||
|
||||
### Run:
|
||||
To run the result in a Fixed Virtual Platform please get:
|
||||
@@ -1,51 +0,0 @@
|
||||
# Armv8-A Base Platform Support in meta-arm-bsp
|
||||
|
||||
## Howto Build and Run
|
||||
|
||||
### Configuration:
|
||||
In the local.conf file, MACHINE should be set as follow:
|
||||
MACHINE ?= "foundation-armv8"
|
||||
|
||||
### 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
|
||||
|
||||
Armv8‑A 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}/fip-fvp.bin@0x8000000 \
|
||||
--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
|
||||
@@ -1,5 +1,19 @@
|
||||
# N1SDP Development Platform Support in meta-arm-bsp
|
||||
|
||||
## Overview
|
||||
The N1SDP provides access to the Arm Neoverse N1 SoC. The N1SDP enables software development for key enterprise technology
|
||||
and general Arm software development. The N1SDP consists of the N1 board containing the N1 SoC.
|
||||
The N1 SoC contains two dual-core Arm Neoverse N1 processor clusters.
|
||||
|
||||
The system demonstrates Arm technology in the context of Cache-Coherent Interconnect for Accelerators (CCIX) protocol by:
|
||||
|
||||
- Running coherent traffic between the N1 SoC and an accelerator card.
|
||||
- Coherent communication between two N1 SoCs.
|
||||
- Enabling development of CCIX-enabled FPGA accelerators.
|
||||
|
||||
Further information on N1SDP can be found at
|
||||
https://community.arm.com/developer/tools-software/oss-platforms/w/docs/458/neoverse-n1-sdp
|
||||
|
||||
## Configuration:
|
||||
In the local.conf file, MACHINE should be set as follow:
|
||||
MACHINE ?= "n1sdp"
|
||||
|
||||
@@ -15,9 +15,12 @@ https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms.git/tre
|
||||
In the local.conf file, MACHINE should be set as follows:
|
||||
MACHINE = "tc0"
|
||||
|
||||
To build the required binaries for tc0, run the commmand for the required image,
|
||||
for e.g for core-image-minimal:
|
||||
```bash$ bitbake core-image-minimal```
|
||||
To build the required binaries for tc0, run the commmand:
|
||||
```bash$ bitbake tc0-artifacts-image```
|
||||
|
||||
Trusted-firmware-a is the final component to be built with the rest of the
|
||||
components dependent of it, therefore building tc0-artifacts-image which depends
|
||||
on trusted-firmware-a will build all the required binaries.
|
||||
|
||||
## Running
|
||||
To run the produced binaries in a TC0 Fixed Virtual Platform please get
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
SUMMARY = "Boot Processor firmware for Corstone700"
|
||||
DESCRIPTION = "Boot Processor firmware"
|
||||
|
||||
LICENSE = "BSD-3-Clause & Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0 \
|
||||
file://cmsis/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
|
||||
SRC_URI = "gitsm://git.linaro.org/landing-teams/working/arm/boot-firmware.git;protocol=https"
|
||||
SRCREV = "af7eeb1bb8c5a85a5e5a76d48acc6fe864d715a9"
|
||||
PV = "2020.02.10+git${SRCPV}"
|
||||
|
||||
PROVIDES += "virtual/control-processor-firmware"
|
||||
|
||||
DEPENDS = "virtual/arm-none-eabi-gcc-native virtual/trusted-firmware-a"
|
||||
|
||||
inherit deploy
|
||||
|
||||
B = "${WORKDIR}/build"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
COMPATIBLE_MACHINE = "(corstone700-*)"
|
||||
SCP_PLATFORM = "corstone-700"
|
||||
|
||||
LDFLAGS[unexport] = "1"
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
|
||||
EXTRA_OEMAKE = "PRODUCT='${SCP_PLATFORM}' \
|
||||
BUILD_PATH=${B} \
|
||||
CROSS_COMPILE='arm-none-eabi-' \
|
||||
V=y \
|
||||
"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake -C ${S}/tools/spitoc CC=${BUILD_CC} all
|
||||
oe_runmake -C ${S}
|
||||
}
|
||||
do_compile[cleandirs] += "${B}"
|
||||
|
||||
do_install() {
|
||||
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_ramfw/release/bin/firmware.bin ${D}/firmware/se_ramfw.bin
|
||||
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_romfw/release/bin/firmware.bin ${D}/firmware/se_romfw.bin
|
||||
${S}/tools/spitoc/spitoc \
|
||||
--seram ${D}/firmware/se_ramfw.bin \
|
||||
--offset 1 \
|
||||
--fip ${RECIPE_SYSROOT}/firmware/fip.bin-${TFA_PLATFORM} \
|
||||
--offset 33 \
|
||||
--out ${D}/firmware/spitoc.bin
|
||||
}
|
||||
|
||||
FILES_${PN} = "/firmware"
|
||||
SYSROOT_DIRS += "/firmware"
|
||||
# Skip QA check for relocations in .text of elf binaries
|
||||
INSANE_SKIP_${PN} = "textrel"
|
||||
|
||||
do_deploy() {
|
||||
# Copy the images to deploy directory
|
||||
cp -rf ${D}/firmware/* ${DEPLOYDIR}/
|
||||
}
|
||||
addtask deploy after do_install
|
||||
@@ -2,7 +2,7 @@ SUMMARY = "External system Cortex-M3 Firmware"
|
||||
DESCRIPTION = "Firmware to be loaded and run in External System Harness in\
|
||||
support to the main application CPU."
|
||||
HOMEPAGE = "https://git.linaro.org/landing-teams/working/arm/external-system.git"
|
||||
DEPENDS = "coreutils-native gcc-arm-none-eabi-native"
|
||||
DEPENDS = "gcc-arm-none-eabi-native"
|
||||
LICENSE = "BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0"
|
||||
|
||||
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
From 7a8b0d634b23e77bb6c84f1b34c5cc031aa8c105 Mon Sep 17 00:00:00 2001
|
||||
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Date: Mon, 12 Apr 2021 10:08:29 +0100
|
||||
Subject: [PATCH 1/3] Revert "FFA: Set and verify allocator of memory handle"
|
||||
|
||||
This reverts commit 917d2f2dc46b20625156e9067329e04c7fec587d.
|
||||
Reverting this commit enables memory sharing between SPs
|
||||
|
||||
Upstream-Status: Inappropriate [will not be submitted as its only required for ACK 5.4]
|
||||
---
|
||||
inc/hf/arch/ffa_memory_handle.h | 25 ----------------
|
||||
inc/vmapi/hf/ffa.h | 14 ++++-----
|
||||
src/api.c | 4 +--
|
||||
src/arch/aarch64/hypervisor/BUILD.gn | 1 -
|
||||
.../aarch64/hypervisor/ffa_memory_handle.c | 29 -------------------
|
||||
src/arch/fake/hypervisor/BUILD.gn | 1 -
|
||||
src/arch/fake/hypervisor/ffa_memory_handle.c | 20 -------------
|
||||
src/ffa_memory.c | 19 ++++--------
|
||||
8 files changed, 14 insertions(+), 99 deletions(-)
|
||||
delete mode 100644 inc/hf/arch/ffa_memory_handle.h
|
||||
delete mode 100644 src/arch/aarch64/hypervisor/ffa_memory_handle.c
|
||||
delete mode 100644 src/arch/fake/hypervisor/ffa_memory_handle.c
|
||||
|
||||
diff --git a/inc/hf/arch/ffa_memory_handle.h b/inc/hf/arch/ffa_memory_handle.h
|
||||
deleted file mode 100644
|
||||
index 9eba5d4..0000000
|
||||
--- a/inc/hf/arch/ffa_memory_handle.h
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-/*
|
||||
- * Copyright 2021 The Hafnium Authors.
|
||||
- *
|
||||
- * Use of this source code is governed by a BSD-style
|
||||
- * license that can be found in the LICENSE file or at
|
||||
- * https://opensource.org/licenses/BSD-3-Clause.
|
||||
- */
|
||||
-
|
||||
-#ifndef FFA_MEMORY_HANDLE_H
|
||||
-#define FFA_MEMORY_HANDLE_H
|
||||
-
|
||||
-#include "hf/ffa.h"
|
||||
-
|
||||
-/**
|
||||
- * Encodes memory handle according to section 5.10.2 of the FF-A v1.0 spec.
|
||||
- */
|
||||
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index);
|
||||
-
|
||||
-/**
|
||||
- * Checks whether given handle was allocated by current world, according to
|
||||
- * handle encoding rules.
|
||||
- */
|
||||
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle);
|
||||
-
|
||||
-#endif
|
||||
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
|
||||
index a79f2eb..a948930 100644
|
||||
--- a/inc/vmapi/hf/ffa.h
|
||||
+++ b/inc/vmapi/hf/ffa.h
|
||||
@@ -189,23 +189,21 @@ ATTR_FUNCTION_SET(memory_shareability, ffa_memory_attributes_t,
|
||||
ATTR_FUNCTION_GET(memory_shareability, ffa_memory_attributes_t,
|
||||
FFA_MEMORY_SHAREABILITY_OFFSET, FFA_MEMORY_SHAREABILITY_MASK)
|
||||
|
||||
-/**
|
||||
- * A globally-unique ID assigned by the hypervisor for a region of memory being
|
||||
- * sent between VMs.
|
||||
- */
|
||||
-typedef uint64_t ffa_memory_handle_t;
|
||||
-
|
||||
#define FFA_MEMORY_HANDLE_ALLOCATOR_MASK \
|
||||
((ffa_memory_handle_t)(UINT64_C(1) << 63))
|
||||
#define FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR \
|
||||
((ffa_memory_handle_t)(UINT64_C(1) << 63))
|
||||
-
|
||||
-#define FFA_MEMORY_HANDLE_ALLOCATOR_SPMC (UINT64_C(0) << 63)
|
||||
#define FFA_MEMORY_HANDLE_INVALID (~UINT64_C(0))
|
||||
|
||||
/** The ID of a VM. These are assigned sequentially starting with an offset. */
|
||||
typedef uint16_t ffa_vm_id_t;
|
||||
|
||||
+/**
|
||||
+ * A globally-unique ID assigned by the hypervisor for a region of memory being
|
||||
+ * sent between VMs.
|
||||
+ */
|
||||
+typedef uint64_t ffa_memory_handle_t;
|
||||
+
|
||||
/**
|
||||
* A count of VMs. This has the same range as the VM IDs but we give it a
|
||||
* different name to make the different semantics clear.
|
||||
diff --git a/src/api.c b/src/api.c
|
||||
index fa5c9b7..16626b6 100644
|
||||
--- a/src/api.c
|
||||
+++ b/src/api.c
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "hf/api.h"
|
||||
|
||||
#include "hf/arch/cpu.h"
|
||||
-#include "hf/arch/ffa_memory_handle.h"
|
||||
#include "hf/arch/mm.h"
|
||||
#include "hf/arch/other_world.h"
|
||||
#include "hf/arch/timer.h"
|
||||
@@ -2158,7 +2157,8 @@ struct ffa_value api_ffa_mem_reclaim(ffa_memory_handle_t handle,
|
||||
struct vm *to = current->vm;
|
||||
struct ffa_value ret;
|
||||
|
||||
- if (ffa_memory_handle_allocated_by_current_world(handle)) {
|
||||
+ if ((handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
|
||||
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR) {
|
||||
struct vm_locked to_locked = vm_lock(to);
|
||||
|
||||
ret = ffa_memory_reclaim(to_locked, handle, flags,
|
||||
diff --git a/src/arch/aarch64/hypervisor/BUILD.gn b/src/arch/aarch64/hypervisor/BUILD.gn
|
||||
index 8f57598..0f9c15e 100644
|
||||
--- a/src/arch/aarch64/hypervisor/BUILD.gn
|
||||
+++ b/src/arch/aarch64/hypervisor/BUILD.gn
|
||||
@@ -17,7 +17,6 @@ offset_size_header("offsets") {
|
||||
source_set("other_world") {
|
||||
public_configs = [ "//src/arch/aarch64:config" ]
|
||||
sources = [
|
||||
- "ffa_memory_handle.c",
|
||||
"other_world.c",
|
||||
]
|
||||
deps = [
|
||||
diff --git a/src/arch/aarch64/hypervisor/ffa_memory_handle.c b/src/arch/aarch64/hypervisor/ffa_memory_handle.c
|
||||
deleted file mode 100644
|
||||
index 647186d..0000000
|
||||
--- a/src/arch/aarch64/hypervisor/ffa_memory_handle.c
|
||||
+++ /dev/null
|
||||
@@ -1,29 +0,0 @@
|
||||
-/*
|
||||
- * Copyright 2021 The Hafnium Authors.
|
||||
- *
|
||||
- * Use of this source code is governed by a BSD-style
|
||||
- * license that can be found in the LICENSE file or at
|
||||
- * https://opensource.org/licenses/BSD-3-Clause.
|
||||
- */
|
||||
-
|
||||
-#include "hf/arch/ffa_memory_handle.h"
|
||||
-
|
||||
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index)
|
||||
-{
|
||||
-#if SECURE_WORLD == 1
|
||||
- return (index & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK) |
|
||||
- FFA_MEMORY_HANDLE_ALLOCATOR_SPMC;
|
||||
-#else
|
||||
- return index | FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle)
|
||||
-{
|
||||
- return (handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
|
||||
-#if SECURE_WORLD == 1
|
||||
- FFA_MEMORY_HANDLE_ALLOCATOR_SPMC;
|
||||
-#else
|
||||
- FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
|
||||
-#endif
|
||||
-}
|
||||
diff --git a/src/arch/fake/hypervisor/BUILD.gn b/src/arch/fake/hypervisor/BUILD.gn
|
||||
index 8f28802..97a82f6 100644
|
||||
--- a/src/arch/fake/hypervisor/BUILD.gn
|
||||
+++ b/src/arch/fake/hypervisor/BUILD.gn
|
||||
@@ -16,7 +16,6 @@ source_set("hypervisor") {
|
||||
|
||||
source_set("other_world") {
|
||||
sources = [
|
||||
- "ffa_memory_handle.c",
|
||||
"other_world.c",
|
||||
]
|
||||
}
|
||||
diff --git a/src/arch/fake/hypervisor/ffa_memory_handle.c b/src/arch/fake/hypervisor/ffa_memory_handle.c
|
||||
deleted file mode 100644
|
||||
index 9091295..0000000
|
||||
--- a/src/arch/fake/hypervisor/ffa_memory_handle.c
|
||||
+++ /dev/null
|
||||
@@ -1,20 +0,0 @@
|
||||
-/*
|
||||
- * Copyright 2021 The Hafnium Authors.
|
||||
- *
|
||||
- * Use of this source code is governed by a BSD-style
|
||||
- * license that can be found in the LICENSE file or at
|
||||
- * https://opensource.org/licenses/BSD-3-Clause.
|
||||
- */
|
||||
-
|
||||
-#include "hf/arch/ffa_memory_handle.h"
|
||||
-
|
||||
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index)
|
||||
-{
|
||||
- return index;
|
||||
-}
|
||||
-
|
||||
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle)
|
||||
-{
|
||||
- (void)handle;
|
||||
- return true;
|
||||
-}
|
||||
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
|
||||
index 8b28191..00ec68c 100644
|
||||
--- a/src/ffa_memory.c
|
||||
+++ b/src/ffa_memory.c
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "hf/ffa_memory.h"
|
||||
|
||||
-#include "hf/arch/ffa_memory_handle.h"
|
||||
#include "hf/arch/other_world.h"
|
||||
|
||||
#include "hf/api.h"
|
||||
@@ -121,14 +120,6 @@ static struct ffa_memory_share_state share_states[MAX_MEM_SHARES];
|
||||
alignas(PAGE_SIZE) static uint8_t
|
||||
tee_retrieve_buffer[HF_MAILBOX_SIZE * MAX_FRAGMENTS];
|
||||
|
||||
-/**
|
||||
- * Extracts the index from a memory handle allocated by Hafnium's current world.
|
||||
- */
|
||||
-uint64_t ffa_memory_handle_get_index(ffa_memory_handle_t handle)
|
||||
-{
|
||||
- return handle & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK;
|
||||
-}
|
||||
-
|
||||
/**
|
||||
* Initialises the next available `struct ffa_memory_share_state` and sets
|
||||
* `share_state_ret` to a pointer to it. If `handle` is
|
||||
@@ -159,7 +150,8 @@ static bool allocate_share_state(
|
||||
|
||||
if (handle == FFA_MEMORY_HANDLE_INVALID) {
|
||||
memory_region->handle =
|
||||
- ffa_memory_handle_make(i);
|
||||
+ i |
|
||||
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
|
||||
} else {
|
||||
memory_region->handle = handle;
|
||||
}
|
||||
@@ -213,7 +205,7 @@ static bool get_share_state(struct share_states_locked share_states,
|
||||
struct ffa_memory_share_state **share_state_ret)
|
||||
{
|
||||
struct ffa_memory_share_state *share_state;
|
||||
- uint64_t index;
|
||||
+ uint32_t index;
|
||||
|
||||
CHECK(share_states.share_states != NULL);
|
||||
CHECK(share_state_ret != NULL);
|
||||
@@ -222,8 +214,9 @@ static bool get_share_state(struct share_states_locked share_states,
|
||||
* First look for a share_state allocated by us, in which case the
|
||||
* handle is based on the index.
|
||||
*/
|
||||
- if (ffa_memory_handle_allocated_by_current_world(handle)) {
|
||||
- index = ffa_memory_handle_get_index(handle);
|
||||
+ if ((handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
|
||||
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR) {
|
||||
+ index = handle & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK;
|
||||
if (index < MAX_MEM_SHARES) {
|
||||
share_state = &share_states.share_states[index];
|
||||
if (share_state->share_func != 0) {
|
||||
--
|
||||
2.29.2
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
From f080a6ae839b48188131648363c9e050f496f205 Mon Sep 17 00:00:00 2001
|
||||
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Date: Mon, 12 Apr 2021 10:22:26 +0100
|
||||
Subject: [PATCH 3/3] FF-A: Fix to fetch proper vCPU index for UP SP
|
||||
|
||||
When switching the context between SPs, fetch the vCPU index using
|
||||
api_vm_get_vcpu() helper routine. This routine gets the vCPU at index 0
|
||||
for UP SP.
|
||||
|
||||
Rename function api_ffa_msg_send_direct_get_receiver_vcpu() to
|
||||
api_vm_get_vcpu() as it is used both in direct message request
|
||||
and response.
|
||||
|
||||
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Change-Id: I45a60427f8c2d1b5058443536d972495728ee0c2
|
||||
Upstream-Status: Pending [Not submitted to upstream yet]
|
||||
---
|
||||
src/api.c | 44 +++++++++++++++++++++-----------------------
|
||||
1 file changed, 21 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/src/api.c b/src/api.c
|
||||
index 16626b6..4c8034e 100644
|
||||
--- a/src/api.c
|
||||
+++ b/src/api.c
|
||||
@@ -63,6 +63,25 @@ void api_init(struct mpool *ppool)
|
||||
mpool_init_from(&api_page_pool, ppool);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * Get target VM vCPU.
|
||||
+ * If VM is UP then return first vCPU.
|
||||
+ * If VM is MP then return vCPU whose index matches current CPU index.
|
||||
+ */
|
||||
+static struct vcpu *api_vm_get_vcpu(struct vm *vm, struct vcpu *current)
|
||||
+{
|
||||
+ ffa_vcpu_index_t current_cpu_index = cpu_index(current->cpu);
|
||||
+ struct vcpu *vcpu = NULL;
|
||||
+
|
||||
+ if (vm->vcpu_count == 1) {
|
||||
+ vcpu = vm_get_vcpu(vm, 0);
|
||||
+ } else if (current_cpu_index < vm->vcpu_count) {
|
||||
+ vcpu = vm_get_vcpu(vm, current_cpu_index);
|
||||
+ }
|
||||
+
|
||||
+ return vcpu;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* Switches the physical CPU back to the corresponding vCPU of the VM whose ID
|
||||
* is given as argument of the function.
|
||||
@@ -80,7 +99,7 @@ static struct vcpu *api_switch_to_vm(struct vcpu *current,
|
||||
ffa_vm_id_t to_id)
|
||||
{
|
||||
struct vm *to_vm = vm_find(to_id);
|
||||
- struct vcpu *next = vm_get_vcpu(to_vm, cpu_index(current->cpu));
|
||||
+ struct vcpu *next = api_vm_get_vcpu(to_vm, current);
|
||||
|
||||
CHECK(next != NULL);
|
||||
|
||||
@@ -1630,26 +1649,6 @@ struct ffa_value api_ffa_features(uint32_t function_id)
|
||||
}
|
||||
}
|
||||
|
||||
-/**
|
||||
- * Get target VM vCPU for direct messaging request.
|
||||
- * If VM is UP then return first vCPU.
|
||||
- * If VM is MP then return vCPU whose index matches current CPU index.
|
||||
- */
|
||||
-static struct vcpu *api_ffa_msg_send_direct_get_receiver_vcpu(
|
||||
- struct vm *vm, struct vcpu *current)
|
||||
-{
|
||||
- ffa_vcpu_index_t current_cpu_index = cpu_index(current->cpu);
|
||||
- struct vcpu *vcpu = NULL;
|
||||
-
|
||||
- if (vm->vcpu_count == 1) {
|
||||
- vcpu = vm_get_vcpu(vm, 0);
|
||||
- } else if (current_cpu_index < vm->vcpu_count) {
|
||||
- vcpu = vm_get_vcpu(vm, current_cpu_index);
|
||||
- }
|
||||
-
|
||||
- return vcpu;
|
||||
-}
|
||||
-
|
||||
/**
|
||||
* FF-A specification states that x2/w2 Must Be Zero for direct messaging
|
||||
* interfaces.
|
||||
@@ -1733,8 +1732,7 @@ struct ffa_value api_ffa_msg_send_direct_req(ffa_vm_id_t sender_vm_id,
|
||||
* number of PEs in the system. It further states that MP partitions
|
||||
* accepting direct request messages cannot migrate.
|
||||
*/
|
||||
- receiver_vcpu =
|
||||
- api_ffa_msg_send_direct_get_receiver_vcpu(receiver_vm, current);
|
||||
+ receiver_vcpu = api_vm_get_vcpu(receiver_vm, current);
|
||||
if (receiver_vcpu == NULL) {
|
||||
return ffa_error(FFA_INVALID_PARAMETERS);
|
||||
}
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From fd177558a1da73fa7e10f8b2997864bb76d66dc8 Mon Sep 17 00:00:00 2001
|
||||
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Date: Thu, 15 Apr 2021 10:46:33 +0100
|
||||
Subject: [PATCH] tc0: Add Theodul DSU support and GICR changes
|
||||
|
||||
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
Change-Id: I4a9b7e4350410fdacccd8c12ff03a61b7e64e98b
|
||||
Upstream-Status: Pending [Not submitted to upstream yet]
|
||||
---
|
||||
project/reference/BUILD.gn | 4 ++--
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/project/reference/BUILD.gn b/project/reference/BUILD.gn
|
||||
index 5596009..ffcaab7 100644
|
||||
--- a/project/reference/BUILD.gn
|
||||
+++ b/project/reference/BUILD.gn
|
||||
@@ -160,9 +160,9 @@ aarch64_toolchains("secure_tc0") {
|
||||
iommu = "//src/iommu:absent"
|
||||
gic_version = 3
|
||||
gicd_base_address = "0x30000000"
|
||||
- gicr_base_address = "0x30140000"
|
||||
- heap_pages = 60
|
||||
- max_cpus = 4
|
||||
+ gicr_base_address = "0x30080000"
|
||||
+ heap_pages = 80
|
||||
+ max_cpus = 8
|
||||
max_vms = 16
|
||||
toolchain_args = {
|
||||
plat_psci = "//src/arch/aarch64/plat/psci:spmc"
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# TC0 specific configuration
|
||||
|
||||
# Intermediate SHA with 2.4 baseline version, required for OP-TEE SEL1 support
|
||||
SRCREV = "2904b2c5361f06d35c324f37d2e71e3278d351a7"
|
||||
PV = "2.4+git${SRCPV}"
|
||||
|
||||
FILESEXTRAPATHS_prepend_tc0 := "${THISDIR}/files/tc0:"
|
||||
|
||||
SRC_URI_append = " \
|
||||
file://0001-Revert-FFA-Set-and-verify-allocator-of-memory-handle.patch \
|
||||
file://0002-FF-A-Fix-to-fetch-proper-vCPU-index-for-UP-SP.patch \
|
||||
file://0003-tc0-Theodul-GICR-changes.patch \
|
||||
"
|
||||
|
||||
COMPATIBLE_MACHINE = "tc0"
|
||||
|
||||
HAFNIUM_PROJECT = "reference"
|
||||
HAFNIUM_PLATFORM = "secure_tc0"
|
||||
HAFNIUM_INSTALL_TARGET = "hafnium"
|
||||
@@ -0,0 +1,6 @@
|
||||
# Machine specific configurations
|
||||
|
||||
MACHINE_HAFNIUM_REQUIRE ?= ""
|
||||
MACHINE_HAFNIUM_REQUIRE_tc0 = "hafnium-tc0.inc"
|
||||
|
||||
require ${MACHINE_HAFNIUM_REQUIRE}
|
||||
@@ -18,9 +18,7 @@ FIRMWARE_DIR = "n1sdp-board-firmware_source"
|
||||
PRIMARY_DIR = "${WORKDIR}/n1sdp-board-firmware_primary"
|
||||
SECONDARY_DIR = "${WORKDIR}/n1sdp-board-firmware_secondary"
|
||||
|
||||
SOC_BINARIES_PRIMARY = "mcp_fw.bin scp_fw.bin ${SOC_BINARIES_SECONDARY}"
|
||||
SOC_BINARIES_SECONDARY = "mcp_rom.bin scp_rom.bin"
|
||||
|
||||
SOC_BINARIES = "mcp_fw.bin scp_fw.bin mcp_rom.bin scp_rom.bin"
|
||||
|
||||
prepare_package() {
|
||||
cd ${WORKDIR}
|
||||
@@ -33,7 +31,7 @@ prepare_package() {
|
||||
cp -v ${RECIPE_SYSROOT}/firmware/uefi.bin ${PRIMARY_DIR}/SOFTWARE/
|
||||
|
||||
# Copy SOC binaries
|
||||
for f in ${SOC_BINARIES_PRIMARY}; do
|
||||
for f in ${SOC_BINARIES}; do
|
||||
cp -v ${RECIPE_SYSROOT}/firmware/${f} ${PRIMARY_DIR}/SOFTWARE/
|
||||
done
|
||||
|
||||
@@ -49,7 +47,7 @@ prepare_package() {
|
||||
mkdir -p ${SECONDARY_DIR}/SOFTWARE/
|
||||
|
||||
# Copy SOC binaries
|
||||
for f in ${SOC_BINARIES_SECONDARY}; do
|
||||
for f in ${SOC_BINARIES}; do
|
||||
cp -v ${RECIPE_SYSROOT}/firmware/${f} ${SECONDARY_DIR}/SOFTWARE/
|
||||
done
|
||||
|
||||
@@ -59,10 +57,8 @@ prepare_package() {
|
||||
${SECONDARY_DIR}/MB/HBI0316A/io_v123f.txt
|
||||
sed -i -e 's|.*SOCCON: 0x1170.*PLATFORM_CTRL.*|SOCCON: 0x1170 0x00000101 ;SoC SCC PLATFORM_CTRL|' \
|
||||
${SECONDARY_DIR}/MB/HBI0316A/io_v123f.txt
|
||||
sed -i -e '/^TOTALIMAGES:/ s|5|2|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
|
||||
sed -i -e 's|^IMAGE[^23]|;&|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
|
||||
sed -i -e 's|^IMAGE2|IMAGE0|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
|
||||
sed -i -e 's|^IMAGE3|IMAGE1|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
|
||||
sed -i -e '/^TOTALIMAGES:/ s|5|4|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
|
||||
sed -i -e 's|^IMAGE4|;&|' ${SECONDARY_DIR}/MB/HBI0316A/images.txt
|
||||
}
|
||||
|
||||
do_deploy() {
|
||||
@@ -81,4 +77,4 @@ do_deploy() {
|
||||
do_deploy[dirs] += "${PRIMARY_DIR} ${SECONDARY_DIR}"
|
||||
do_deploy[cleandirs] += "${PRIMARY_DIR} ${SECONDARY_DIR}"
|
||||
do_deploy[umask] = "022"
|
||||
addtask deploy after do_populate_sysroot
|
||||
addtask deploy after do_prepare_recipe_sysroot
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2020 Arm Limited
|
||||
#
|
||||
SUMMARY = "Total Compute Images"
|
||||
DESCRIPTION = "Build all the images required for Total Compute platform"
|
||||
LICENSE = "Apache-2.0"
|
||||
|
||||
inherit nopackages
|
||||
|
||||
# The last image to be built is trusted-firmware-a
|
||||
DEPENDS += " trusted-firmware-a"
|
||||
+14
-21
@@ -1,13 +1,9 @@
|
||||
Upstream-Status: Inappropriate [will not be submitted as its only required till hardware gets fixed]
|
||||
|
||||
The patch is picked from git repo:
|
||||
https://git.linaro.org/landing-teams/working/arm/n1sdp-pcie-quirk.git/tree/scp/0001-product-n1sdp-set-CCIX-speed-to-GEN3-to-work-with-in.patch
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
|
||||
|
||||
From a6d545cf9b6c46f2ea415d64fa81eb4771cfb51c Mon Sep 17 00:00:00 2001
|
||||
From 3deb59c5f4c64aa092bb3a4ebc018acf3f746f47 Mon Sep 17 00:00:00 2001
|
||||
From: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
|
||||
Date: Thu, 28 May 2020 16:19:12 +0530
|
||||
Date: Tue, 10 Nov 2020 12:31:04 +0530
|
||||
Subject: [PATCH] product/n1sdp: set CCIX speed to GEN3 to work with interposer
|
||||
C2C setup
|
||||
|
||||
@@ -15,23 +11,22 @@ Set CCIX speed to GEN3 to work with interposer C2C setup
|
||||
In this use case set downstream/upstream port transmitter
|
||||
preset value to 4.
|
||||
|
||||
Change-Id: I16e72a5eaa105386a64ab4ffe56f67134c670313
|
||||
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
|
||||
Change-Id: I635566574babbb7591b5bba97105f76f1f8e550a
|
||||
---
|
||||
.../module/n1sdp_pcie/src/mod_n1sdp_pcie.c | 33 +++++++++++++++----
|
||||
1 file changed, 26 insertions(+), 7 deletions(-)
|
||||
.../module/n1sdp_pcie/src/mod_n1sdp_pcie.c | 30 ++++++++++++++-----
|
||||
1 file changed, 23 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/product/n1sdp/module/n1sdp_pcie/src/mod_n1sdp_pcie.c b/product/n1sdp/module/n1sdp_pcie/src/mod_n1sdp_pcie.c
|
||||
index 19fa5a5..a93e6cc 100644
|
||||
index 901e0464..ba02144f 100644
|
||||
--- a/product/n1sdp/module/n1sdp_pcie/src/mod_n1sdp_pcie.c
|
||||
+++ b/product/n1sdp/module/n1sdp_pcie/src/mod_n1sdp_pcie.c
|
||||
@@ -206,7 +206,13 @@ static int n1sdp_pcie_phy_init(fwk_id_t id)
|
||||
@@ -206,7 +206,12 @@ static int n1sdp_pcie_phy_init(fwk_id_t id)
|
||||
if (dev_ctx == NULL)
|
||||
return FWK_E_PARAM;
|
||||
|
||||
- gen_speed = dev_ctx->config->ccix_capable ? PCIE_GEN_4 : PCIE_GEN_3;
|
||||
+ if ((n1sdp_get_chipid() != 0x0) ||
|
||||
+ !dev_ctx->config->ccix_capable ||
|
||||
+ if ((n1sdp_get_chipid() != 0x0) || !dev_ctx->config->ccix_capable ||
|
||||
+ pcie_ctx.c2c_api->is_slave_alive())
|
||||
+ gen_speed = PCIE_GEN_3;
|
||||
+ else
|
||||
@@ -40,13 +35,12 @@ index 19fa5a5..a93e6cc 100644
|
||||
lane_count = LAN_COUNT_IN_X_16;
|
||||
|
||||
FWK_LOG_INFO("[%s] Initializing PHY...", pcie_type[did]);
|
||||
@@ -239,7 +245,13 @@ static int n1sdp_pcie_controller_init(fwk_id_t id, bool ep_mode)
|
||||
@@ -239,7 +244,12 @@ static int n1sdp_pcie_controller_init(fwk_id_t id, bool ep_mode)
|
||||
if (dev_ctx == NULL)
|
||||
return FWK_E_PARAM;
|
||||
|
||||
- gen_speed = dev_ctx->config->ccix_capable ? PCIE_GEN_4 : PCIE_GEN_3;
|
||||
+ if ((n1sdp_get_chipid() != 0x0) ||
|
||||
+ !dev_ctx->config->ccix_capable ||
|
||||
+ if ((n1sdp_get_chipid() != 0x0) || !dev_ctx->config->ccix_capable ||
|
||||
+ pcie_ctx.c2c_api->is_slave_alive())
|
||||
+ gen_speed = PCIE_GEN_3;
|
||||
+ else
|
||||
@@ -55,13 +49,12 @@ index 19fa5a5..a93e6cc 100644
|
||||
lane_count = LAN_COUNT_IN_X_16;
|
||||
|
||||
if (ep_mode) {
|
||||
@@ -282,12 +294,19 @@ static int n1sdp_pcie_link_training(fwk_id_t id, bool ep_mode)
|
||||
@@ -282,12 +292,18 @@ static int n1sdp_pcie_link_training(fwk_id_t id, bool ep_mode)
|
||||
if (dev_ctx == NULL)
|
||||
return FWK_E_PARAM;
|
||||
|
||||
- gen_speed = dev_ctx->config->ccix_capable ? PCIE_GEN_4 : PCIE_GEN_3;
|
||||
+ if ((n1sdp_get_chipid() != 0x0) ||
|
||||
+ !dev_ctx->config->ccix_capable ||
|
||||
+ if ((n1sdp_get_chipid() != 0x0) || !dev_ctx->config->ccix_capable ||
|
||||
+ pcie_ctx.c2c_api->is_slave_alive()) {
|
||||
+ gen_speed = PCIE_GEN_3;
|
||||
+ down_stream_tx_preset = PCIE_RC_TX_PRESET_VALUE;
|
||||
@@ -81,5 +74,5 @@ index 19fa5a5..a93e6cc 100644
|
||||
if (gen_speed >= PCIE_GEN_3 && !ep_mode) {
|
||||
FWK_LOG_INFO(
|
||||
--
|
||||
2.25.0
|
||||
2.25.1
|
||||
|
||||
|
||||
+817
@@ -0,0 +1,817 @@
|
||||
From 6be977b3196b555cdee0758a380102264410f651 Mon Sep 17 00:00:00 2001
|
||||
From: Usama Arif <usama.arif@arm.com>
|
||||
Date: Sun, 31 Jan 2021 22:13:07 +0000
|
||||
Subject: [PATCH 1/2] product/tc0: add clock and dvfs support for all cores.
|
||||
|
||||
This patch corrects the OPPs of cores 0-3 (klein cores)
|
||||
and adds the right OPPs for matterhorn cores.
|
||||
|
||||
Signed-off-by: Usama Arif <usama.arif@arm.com>
|
||||
Change-Id: I1070d71c29ca2d06f9945708c135fa812b172003
|
||||
|
||||
Upstream-Status: Backport [https://github.com/ARM-software/SCP-firmware/commit/a550dd1042ecc1e6191ea2636b67d370ee865024]
|
||||
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
|
||||
---
|
||||
product/tc0/include/clock_soc.h | 15 +++-
|
||||
product/tc0/include/scp_soc_mmap.h | 4 +
|
||||
product/tc0/include/tc0_timer.h | 3 +-
|
||||
product/tc0/scp_ramfw/config_clock.c | 18 +++-
|
||||
product/tc0/scp_ramfw/config_css_clock.c | 105 +++++++++++++++++++---
|
||||
product/tc0/scp_ramfw/config_dvfs.c | 62 +++++++++++--
|
||||
product/tc0/scp_ramfw/config_mock_psu.c | 16 +++-
|
||||
product/tc0/scp_ramfw/config_pik_clock.c | 77 +++++++++++++---
|
||||
product/tc0/scp_ramfw/config_psu.c | 11 ++-
|
||||
product/tc0/scp_ramfw/config_scmi_perf.c | 1 +
|
||||
product/tc0/scp_ramfw/config_system_pll.c | 19 +++-
|
||||
product/tc0/scp_romfw/config_clock.c | 6 +-
|
||||
product/tc0/scp_romfw/config_css_clock.c | 40 ++++-----
|
||||
product/tc0/scp_romfw/config_pik_clock.c | 20 ++---
|
||||
product/tc0/scp_romfw/config_system_pll.c | 6 +-
|
||||
15 files changed, 327 insertions(+), 76 deletions(-)
|
||||
|
||||
diff --git a/product/tc0/include/clock_soc.h b/product/tc0/include/clock_soc.h
|
||||
index 3e05bbab..2c2805c0 100644
|
||||
--- a/product/tc0/include/clock_soc.h
|
||||
+++ b/product/tc0/include/clock_soc.h
|
||||
@@ -17,7 +17,8 @@
|
||||
* PLL clock indexes.
|
||||
*/
|
||||
enum clock_pll_idx {
|
||||
- CLOCK_PLL_IDX_CPU0,
|
||||
+ CLOCK_PLL_IDX_CPU_KLEIN,
|
||||
+ CLOCK_PLL_IDX_CPU_MATTERHORN,
|
||||
CLOCK_PLL_IDX_SYS,
|
||||
CLOCK_PLL_IDX_INTERCONNECT,
|
||||
CLOCK_PLL_IDX_DPU,
|
||||
@@ -30,11 +31,15 @@ enum clock_pll_idx {
|
||||
* PIK clock indexes.
|
||||
*/
|
||||
enum clock_pik_idx {
|
||||
+ CLOCK_PIK_IDX_INTERCONNECT,
|
||||
CLOCK_PIK_IDX_CLUS0_CPU0,
|
||||
CLOCK_PIK_IDX_CLUS0_CPU1,
|
||||
CLOCK_PIK_IDX_CLUS0_CPU2,
|
||||
CLOCK_PIK_IDX_CLUS0_CPU3,
|
||||
- CLOCK_PIK_IDX_INTERCONNECT,
|
||||
+ CLOCK_PIK_IDX_CLUS0_CPU4,
|
||||
+ CLOCK_PIK_IDX_CLUS0_CPU5,
|
||||
+ CLOCK_PIK_IDX_CLUS0_CPU6,
|
||||
+ CLOCK_PIK_IDX_CLUS0_CPU7,
|
||||
CLOCK_PIK_IDX_SCP,
|
||||
CLOCK_PIK_IDX_GIC,
|
||||
CLOCK_PIK_IDX_PCLKSCP,
|
||||
@@ -48,7 +53,8 @@ enum clock_pik_idx {
|
||||
* CSS clock indexes.
|
||||
*/
|
||||
enum clock_css_idx {
|
||||
- CLOCK_CSS_IDX_CPU_GROUP0,
|
||||
+ CLOCK_CSS_IDX_CPU_GROUP_KLEIN,
|
||||
+ CLOCK_CSS_IDX_CPU_GROUP_MATTERHORN,
|
||||
CLOCK_CSS_IDX_DPU,
|
||||
CLOCK_CSS_IDX_COUNT
|
||||
};
|
||||
@@ -58,7 +64,8 @@ enum clock_css_idx {
|
||||
*/
|
||||
enum clock_idx {
|
||||
CLOCK_IDX_INTERCONNECT,
|
||||
- CLOCK_IDX_CPU_GROUP0,
|
||||
+ CLOCK_IDX_CPU_GROUP_KLEIN,
|
||||
+ CLOCK_IDX_CPU_GROUP_MATTERHORN,
|
||||
CLOCK_IDX_DPU,
|
||||
CLOCK_IDX_PIXEL_0,
|
||||
CLOCK_IDX_PIXEL_1,
|
||||
diff --git a/product/tc0/include/scp_soc_mmap.h b/product/tc0/include/scp_soc_mmap.h
|
||||
index 14f8a8d5..774bbc29 100644
|
||||
--- a/product/tc0/include/scp_soc_mmap.h
|
||||
+++ b/product/tc0/include/scp_soc_mmap.h
|
||||
@@ -22,5 +22,9 @@
|
||||
#define SCP_PLL_CPU1 (SCP_PLL_BASE + 0x00000104)
|
||||
#define SCP_PLL_CPU2 (SCP_PLL_BASE + 0x00000108)
|
||||
#define SCP_PLL_CPU3 (SCP_PLL_BASE + 0x0000010C)
|
||||
+#define SCP_PLL_CPU4 (SCP_PLL_BASE + 0x00000110)
|
||||
+#define SCP_PLL_CPU5 (SCP_PLL_BASE + 0x00000114)
|
||||
+#define SCP_PLL_CPU6 (SCP_PLL_BASE + 0x00000118)
|
||||
+#define SCP_PLL_CPU7 (SCP_PLL_BASE + 0x0000011C)
|
||||
|
||||
#endif /* SCP_SOC_MMAP_H */
|
||||
diff --git a/product/tc0/include/tc0_timer.h b/product/tc0/include/tc0_timer.h
|
||||
index 03d6893c..6f4bf06c 100644
|
||||
--- a/product/tc0/include/tc0_timer.h
|
||||
+++ b/product/tc0/include/tc0_timer.h
|
||||
@@ -9,7 +9,8 @@
|
||||
#define CONFIG_TIMER_H
|
||||
|
||||
enum config_timer_refclk_sub_element_idx {
|
||||
- CONFIG_TIMER_DVFS_CPU,
|
||||
+ CONFIG_TIMER_DVFS_CPU_KLEIN,
|
||||
+ CONFIG_TIMER_DVFS_CPU_MATTERHORN,
|
||||
CONFIG_TIMER_SUB_ELEMENT_IDX_COUNT,
|
||||
};
|
||||
|
||||
diff --git a/product/tc0/scp_ramfw/config_clock.c b/product/tc0/scp_ramfw/config_clock.c
|
||||
index db545119..98863a01 100644
|
||||
--- a/product/tc0/scp_ramfw/config_clock.c
|
||||
+++ b/product/tc0/scp_ramfw/config_clock.c
|
||||
@@ -32,13 +32,25 @@ static const struct fwk_element clock_dev_desc_table[] = {
|
||||
MOD_PIK_CLOCK_API_TYPE_CLOCK),
|
||||
}),
|
||||
},
|
||||
- [CLOCK_IDX_CPU_GROUP0] =
|
||||
+ [CLOCK_IDX_CPU_GROUP_KLEIN] =
|
||||
{
|
||||
- .name = "CPU_GROUP0",
|
||||
+ .name = "CPU_GROUP_KLEIN",
|
||||
.data = &((struct mod_clock_dev_config){
|
||||
.driver_id = FWK_ID_ELEMENT_INIT(
|
||||
FWK_MODULE_IDX_CSS_CLOCK,
|
||||
- CLOCK_CSS_IDX_CPU_GROUP0),
|
||||
+ CLOCK_CSS_IDX_CPU_GROUP_KLEIN),
|
||||
+ .api_id = FWK_ID_API_INIT(
|
||||
+ FWK_MODULE_IDX_CSS_CLOCK,
|
||||
+ MOD_CSS_CLOCK_API_TYPE_CLOCK),
|
||||
+ }),
|
||||
+ },
|
||||
+ [CLOCK_IDX_CPU_GROUP_MATTERHORN] =
|
||||
+ {
|
||||
+ .name = "CPU_GROUP_MATTERHORN",
|
||||
+ .data = &((struct mod_clock_dev_config){
|
||||
+ .driver_id = FWK_ID_ELEMENT_INIT(
|
||||
+ FWK_MODULE_IDX_CSS_CLOCK,
|
||||
+ CLOCK_CSS_IDX_CPU_GROUP_MATTERHORN),
|
||||
.api_id = FWK_ID_API_INIT(
|
||||
FWK_MODULE_IDX_CSS_CLOCK,
|
||||
MOD_CSS_CLOCK_API_TYPE_CLOCK),
|
||||
diff --git a/product/tc0/scp_ramfw/config_css_clock.c b/product/tc0/scp_ramfw/config_css_clock.c
|
||||
index 1ad285ae..14a23d63 100644
|
||||
--- a/product/tc0/scp_ramfw/config_css_clock.c
|
||||
+++ b/product/tc0/scp_ramfw/config_css_clock.c
|
||||
@@ -17,7 +17,60 @@
|
||||
#include <fwk_module.h>
|
||||
#include <fwk_module_idx.h>
|
||||
|
||||
-static const struct mod_css_clock_rate rate_table_cpu_group[] = {
|
||||
+static const struct mod_css_clock_rate rate_table_cpu_group_klein[] = {
|
||||
+ {
|
||||
+ /* Super Underdrive */
|
||||
+ .rate = 768 * FWK_MHZ,
|
||||
+ .pll_rate = 768 * FWK_MHZ,
|
||||
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
+ .clock_div = 1,
|
||||
+ .clock_mod_numerator = 1,
|
||||
+ .clock_mod_denominator = 1,
|
||||
+ },
|
||||
+ {
|
||||
+ /* Underdrive */
|
||||
+ .rate = 1153 * FWK_MHZ,
|
||||
+ .pll_rate = 1153 * FWK_MHZ,
|
||||
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
+ .clock_div = 1,
|
||||
+ .clock_mod_numerator = 1,
|
||||
+ .clock_mod_denominator = 1,
|
||||
+ },
|
||||
+ {
|
||||
+ /* Nominal */
|
||||
+ .rate = 1537 * FWK_MHZ,
|
||||
+ .pll_rate = 1537 * FWK_MHZ,
|
||||
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
+ .clock_div = 1,
|
||||
+ .clock_mod_numerator = 1,
|
||||
+ .clock_mod_denominator = 1,
|
||||
+ },
|
||||
+ {
|
||||
+ /* Overdrive */
|
||||
+ .rate = 1844 * FWK_MHZ,
|
||||
+ .pll_rate = 1844 * FWK_MHZ,
|
||||
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
+ .clock_div = 1,
|
||||
+ .clock_mod_numerator = 1,
|
||||
+ .clock_mod_denominator = 1,
|
||||
+ },
|
||||
+ {
|
||||
+ /* Super Overdrive */
|
||||
+ .rate = 2152 * FWK_MHZ,
|
||||
+ .pll_rate = 2152 * FWK_MHZ,
|
||||
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
+ .clock_div = 1,
|
||||
+ .clock_mod_numerator = 1,
|
||||
+ .clock_mod_denominator = 1,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static const struct mod_css_clock_rate rate_table_cpu_group_matterhorn[] = {
|
||||
{
|
||||
/* Super Underdrive */
|
||||
.rate = 946 * FWK_MHZ,
|
||||
@@ -70,39 +123,71 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
|
||||
},
|
||||
};
|
||||
|
||||
-static const fwk_id_t member_table_cpu_group_0[] = {
|
||||
+static const fwk_id_t member_table_cpu_group_klein[] = {
|
||||
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU0),
|
||||
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU1),
|
||||
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU2),
|
||||
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU3),
|
||||
};
|
||||
|
||||
+static const fwk_id_t member_table_cpu_group_matterhorn[] = {
|
||||
+ FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU4),
|
||||
+ FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU5),
|
||||
+ FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU6),
|
||||
+ FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU7),
|
||||
+};
|
||||
+
|
||||
+
|
||||
static const fwk_id_t member_table_dpu[] = {
|
||||
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_DPU),
|
||||
};
|
||||
|
||||
static const struct fwk_element css_clock_element_table[] = {
|
||||
- [CLOCK_CSS_IDX_CPU_GROUP0] =
|
||||
+ [CLOCK_CSS_IDX_CPU_GROUP_KLEIN] =
|
||||
+ {
|
||||
+ .name = "CPU_GROUP_KLEIN",
|
||||
+ .data = &((struct mod_css_clock_dev_config){
|
||||
+ .clock_type = MOD_CSS_CLOCK_TYPE_INDEXED,
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
+ .clock_switching_source =
|
||||
+ MOD_PIK_CLOCK_CLUSCLK_SOURCE_SYSREFCLK,
|
||||
+ .pll_id = FWK_ID_ELEMENT_INIT(
|
||||
+ FWK_MODULE_IDX_SYSTEM_PLL,
|
||||
+ CLOCK_PLL_IDX_CPU_KLEIN),
|
||||
+ .pll_api_id = FWK_ID_API_INIT(
|
||||
+ FWK_MODULE_IDX_SYSTEM_PLL,
|
||||
+ MOD_SYSTEM_PLL_API_TYPE_DEFAULT),
|
||||
+ .member_table = member_table_cpu_group_klein,
|
||||
+ .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_klein),
|
||||
+ .member_api_id = FWK_ID_API_INIT(
|
||||
+ FWK_MODULE_IDX_PIK_CLOCK,
|
||||
+ MOD_PIK_CLOCK_API_TYPE_CSS),
|
||||
+ .initial_rate = 1537 * FWK_MHZ,
|
||||
+ .modulation_supported = true,
|
||||
+ }),
|
||||
+ },
|
||||
+ [CLOCK_CSS_IDX_CPU_GROUP_MATTERHORN] =
|
||||
{
|
||||
- .name = "CPU_GROUP_0",
|
||||
+ .name = "CPU_GROUP_MATTERHORN",
|
||||
.data = &((struct mod_css_clock_dev_config){
|
||||
.clock_type = MOD_CSS_CLOCK_TYPE_INDEXED,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_matterhorn,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
|
||||
.clock_switching_source =
|
||||
MOD_PIK_CLOCK_CLUSCLK_SOURCE_SYSREFCLK,
|
||||
.pll_id = FWK_ID_ELEMENT_INIT(
|
||||
FWK_MODULE_IDX_SYSTEM_PLL,
|
||||
- CLOCK_PLL_IDX_CPU0),
|
||||
+ CLOCK_PLL_IDX_CPU_MATTERHORN),
|
||||
.pll_api_id = FWK_ID_API_INIT(
|
||||
FWK_MODULE_IDX_SYSTEM_PLL,
|
||||
MOD_SYSTEM_PLL_API_TYPE_DEFAULT),
|
||||
- .member_table = member_table_cpu_group_0,
|
||||
- .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_0),
|
||||
+ .member_table = member_table_cpu_group_matterhorn,
|
||||
+ .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_matterhorn),
|
||||
.member_api_id = FWK_ID_API_INIT(
|
||||
FWK_MODULE_IDX_PIK_CLOCK,
|
||||
MOD_PIK_CLOCK_API_TYPE_CSS),
|
||||
- .initial_rate = 2271 * FWK_MHZ,
|
||||
+ .initial_rate = 1893 * FWK_MHZ,
|
||||
.modulation_supported = true,
|
||||
}),
|
||||
},
|
||||
diff --git a/product/tc0/scp_ramfw/config_dvfs.c b/product/tc0/scp_ramfw/config_dvfs.c
|
||||
index a0b59b2b..4b952ef8 100644
|
||||
--- a/product/tc0/scp_ramfw/config_dvfs.c
|
||||
+++ b/product/tc0/scp_ramfw/config_dvfs.c
|
||||
@@ -16,7 +16,35 @@
|
||||
#include <fwk_module.h>
|
||||
#include <fwk_module_idx.h>
|
||||
|
||||
-static struct mod_dvfs_opp opps[] = { {
|
||||
+static struct mod_dvfs_opp opps_klein[] = { {
|
||||
+ .level = 768 * 1000000UL,
|
||||
+ .frequency = 768 * FWK_KHZ,
|
||||
+ .voltage = 550,
|
||||
+ },
|
||||
+ {
|
||||
+ .level = 1153 * 1000000UL,
|
||||
+ .frequency = 1153 * FWK_KHZ,
|
||||
+ .voltage = 650,
|
||||
+ },
|
||||
+ {
|
||||
+ .level = 1537 * 1000000UL,
|
||||
+ .frequency = 1537 * FWK_KHZ,
|
||||
+ .voltage = 750,
|
||||
+ },
|
||||
+ {
|
||||
+ .level = 1844 * 1000000UL,
|
||||
+ .frequency = 1844 * FWK_KHZ,
|
||||
+ .voltage = 850,
|
||||
+ },
|
||||
+ {
|
||||
+ .level = 2152 * 1000000UL,
|
||||
+ .frequency = 2152 * FWK_KHZ,
|
||||
+ .voltage = 950,
|
||||
+ },
|
||||
+ { 0 } };
|
||||
+
|
||||
+
|
||||
+static struct mod_dvfs_opp opps_matterhorn[] = { {
|
||||
.level = 946 * 1000000UL,
|
||||
.frequency = 946 * FWK_KHZ,
|
||||
.voltage = 550,
|
||||
@@ -43,11 +71,26 @@ static struct mod_dvfs_opp opps[] = { {
|
||||
},
|
||||
{ 0 } };
|
||||
|
||||
-static const struct mod_dvfs_domain_config cpu_group = {
|
||||
+static const struct mod_dvfs_domain_config cpu_group_klein = {
|
||||
.psu_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PSU, 0),
|
||||
- .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP0),
|
||||
+ .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP_KLEIN),
|
||||
+ .alarm_id =
|
||||
+ FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, 0, CONFIG_TIMER_DVFS_CPU_KLEIN),
|
||||
+ .notification_id = FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SCMI_PERF),
|
||||
+ .updates_api_id = FWK_ID_API_INIT(
|
||||
+ FWK_MODULE_IDX_SCMI_PERF,
|
||||
+ MOD_SCMI_PERF_DVFS_UPDATE_API),
|
||||
+ .retry_ms = 1,
|
||||
+ .latency = 1200,
|
||||
+ .sustained_idx = 2,
|
||||
+ .opps = opps_klein,
|
||||
+};
|
||||
+
|
||||
+static const struct mod_dvfs_domain_config cpu_group_matterhorn = {
|
||||
+ .psu_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PSU, 1),
|
||||
+ .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP_MATTERHORN),
|
||||
.alarm_id =
|
||||
- FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, 0, CONFIG_TIMER_DVFS_CPU),
|
||||
+ FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, 0, CONFIG_TIMER_DVFS_CPU_MATTERHORN),
|
||||
.notification_id = FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SCMI_PERF),
|
||||
.updates_api_id = FWK_ID_API_INIT(
|
||||
FWK_MODULE_IDX_SCMI_PERF,
|
||||
@@ -55,13 +98,18 @@ static const struct mod_dvfs_domain_config cpu_group = {
|
||||
.retry_ms = 1,
|
||||
.latency = 1200,
|
||||
.sustained_idx = 2,
|
||||
- .opps = opps,
|
||||
+ .opps = opps_matterhorn,
|
||||
};
|
||||
|
||||
static const struct fwk_element element_table[] = { [0] =
|
||||
{
|
||||
- .name = "CPU_GROUP",
|
||||
- .data = &cpu_group,
|
||||
+ .name = "CPU_GROUP_KLEIN",
|
||||
+ .data = &cpu_group_klein,
|
||||
+ },
|
||||
+ [1] =
|
||||
+ {
|
||||
+ .name = "CPU_GROUP_MATTERHORN",
|
||||
+ .data = &cpu_group_matterhorn,
|
||||
},
|
||||
{ 0 } };
|
||||
|
||||
diff --git a/product/tc0/scp_ramfw/config_mock_psu.c b/product/tc0/scp_ramfw/config_mock_psu.c
|
||||
index 1f9411ca..2d3742f2 100644
|
||||
--- a/product/tc0/scp_ramfw/config_mock_psu.c
|
||||
+++ b/product/tc0/scp_ramfw/config_mock_psu.c
|
||||
@@ -12,7 +12,21 @@
|
||||
|
||||
static const struct fwk_element element_table[] = {
|
||||
{
|
||||
- .name = "DVFS_GROUP0",
|
||||
+ .name = "DVFS_GROUP_KLEIN",
|
||||
+ .data =
|
||||
+ &(const struct mod_mock_psu_element_cfg){
|
||||
+ .async_alarm_id = FWK_ID_NONE_INIT,
|
||||
+ .async_alarm_api_id = FWK_ID_NONE_INIT,
|
||||
+
|
||||
+ .async_response_id = FWK_ID_NONE_INIT,
|
||||
+ .async_response_api_id = FWK_ID_NONE_INIT,
|
||||
+
|
||||
+ .default_enabled = true,
|
||||
+ .default_voltage = 550,
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ .name = "DVFS_GROUP_MATTERHORN",
|
||||
.data =
|
||||
&(const struct mod_mock_psu_element_cfg){
|
||||
.async_alarm_id = FWK_ID_NONE_INIT,
|
||||
diff --git a/product/tc0/scp_ramfw/config_pik_clock.c b/product/tc0/scp_ramfw/config_pik_clock.c
|
||||
index d2c03865..38837a91 100644
|
||||
--- a/product/tc0/scp_ramfw/config_pik_clock.c
|
||||
+++ b/product/tc0/scp_ramfw/config_pik_clock.c
|
||||
@@ -21,9 +21,18 @@
|
||||
/*
|
||||
* Rate lookup tables
|
||||
*/
|
||||
-static struct mod_pik_clock_rate rate_table_cpu_group[] = {
|
||||
+static struct mod_pik_clock_rate rate_table_cpu_group_klein[] = {
|
||||
{
|
||||
- .rate = 1750 * FWK_MHZ,
|
||||
+ .rate = 1537 * FWK_MHZ,
|
||||
+ .source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
+ .divider_reg = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
+ .divider = 1, /* Rate adjusted via CPU PLL */
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct mod_pik_clock_rate rate_table_cpu_group_matterhorn[] = {
|
||||
+ {
|
||||
+ .rate = 1893 * FWK_MHZ,
|
||||
.source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
.divider_reg = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
.divider = 1, /* Rate adjusted via CPU PLL */
|
||||
@@ -103,8 +112,8 @@ static const struct fwk_element pik_clock_element_table[] = {
|
||||
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].CTRL,
|
||||
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].DIV,
|
||||
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].MOD,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
}),
|
||||
},
|
||||
[CLOCK_PIK_IDX_CLUS0_CPU1] = {
|
||||
@@ -115,8 +124,8 @@ static const struct fwk_element pik_clock_element_table[] = {
|
||||
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].CTRL,
|
||||
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].DIV,
|
||||
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].MOD,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
}),
|
||||
},
|
||||
[CLOCK_PIK_IDX_CLUS0_CPU2] = {
|
||||
@@ -127,8 +136,8 @@ static const struct fwk_element pik_clock_element_table[] = {
|
||||
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].CTRL,
|
||||
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].DIV,
|
||||
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].MOD,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
}),
|
||||
},
|
||||
[CLOCK_PIK_IDX_CLUS0_CPU3] = {
|
||||
@@ -139,8 +148,56 @@ static const struct fwk_element pik_clock_element_table[] = {
|
||||
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].CTRL,
|
||||
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].DIV,
|
||||
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].MOD,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
+ }),
|
||||
+ },
|
||||
+ [CLOCK_PIK_IDX_CLUS0_CPU4] = {
|
||||
+ .name = "CLUS0_CPU4",
|
||||
+ .data = &((struct mod_pik_clock_dev_config) {
|
||||
+ .type = MOD_PIK_CLOCK_TYPE_CLUSTER,
|
||||
+ .is_group_member = true,
|
||||
+ .control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[4].CTRL,
|
||||
+ .divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[4].DIV,
|
||||
+ .modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[4].MOD,
|
||||
+ .rate_table = rate_table_cpu_group_matterhorn,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
|
||||
+ }),
|
||||
+ },
|
||||
+ [CLOCK_PIK_IDX_CLUS0_CPU5] = {
|
||||
+ .name = "CLUS0_CPU5",
|
||||
+ .data = &((struct mod_pik_clock_dev_config) {
|
||||
+ .type = MOD_PIK_CLOCK_TYPE_CLUSTER,
|
||||
+ .is_group_member = true,
|
||||
+ .control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[5].CTRL,
|
||||
+ .divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[5].DIV,
|
||||
+ .modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[5].MOD,
|
||||
+ .rate_table = rate_table_cpu_group_matterhorn,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
|
||||
+ }),
|
||||
+ },
|
||||
+ [CLOCK_PIK_IDX_CLUS0_CPU6] = {
|
||||
+ .name = "CLUS0_CPU6",
|
||||
+ .data = &((struct mod_pik_clock_dev_config) {
|
||||
+ .type = MOD_PIK_CLOCK_TYPE_CLUSTER,
|
||||
+ .is_group_member = true,
|
||||
+ .control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[6].CTRL,
|
||||
+ .divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[6].DIV,
|
||||
+ .modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[6].MOD,
|
||||
+ .rate_table = rate_table_cpu_group_matterhorn,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
|
||||
+ }),
|
||||
+ },
|
||||
+ [CLOCK_PIK_IDX_CLUS0_CPU7] = {
|
||||
+ .name = "CLUS0_CPU7",
|
||||
+ .data = &((struct mod_pik_clock_dev_config) {
|
||||
+ .type = MOD_PIK_CLOCK_TYPE_CLUSTER,
|
||||
+ .is_group_member = true,
|
||||
+ .control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[7].CTRL,
|
||||
+ .divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[7].DIV,
|
||||
+ .modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[7].MOD,
|
||||
+ .rate_table = rate_table_cpu_group_matterhorn,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
|
||||
}),
|
||||
},
|
||||
[CLOCK_PIK_IDX_INTERCONNECT] = {
|
||||
diff --git a/product/tc0/scp_ramfw/config_psu.c b/product/tc0/scp_ramfw/config_psu.c
|
||||
index 8e3bcb5a..3bf0f7fd 100644
|
||||
--- a/product/tc0/scp_ramfw/config_psu.c
|
||||
+++ b/product/tc0/scp_ramfw/config_psu.c
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
static const struct fwk_element element_table[] = {
|
||||
{
|
||||
- .name = "DVFS_GROUP0",
|
||||
+ .name = "DVFS_GROUP_KLEIN",
|
||||
.data =
|
||||
&(const struct mod_psu_element_cfg){
|
||||
.driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_MOCK_PSU, 0),
|
||||
@@ -22,6 +22,15 @@ static const struct fwk_element element_table[] = {
|
||||
FWK_MODULE_IDX_MOCK_PSU,
|
||||
MOD_MOCK_PSU_API_IDX_DRIVER) },
|
||||
},
|
||||
+ {
|
||||
+ .name = "DVFS_GROUP_MATTERHORN",
|
||||
+ .data =
|
||||
+ &(const struct mod_psu_element_cfg){
|
||||
+ .driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_MOCK_PSU, 1),
|
||||
+ .driver_api_id = FWK_ID_API_INIT(
|
||||
+ FWK_MODULE_IDX_MOCK_PSU,
|
||||
+ MOD_MOCK_PSU_API_IDX_DRIVER) },
|
||||
+ },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
diff --git a/product/tc0/scp_ramfw/config_scmi_perf.c b/product/tc0/scp_ramfw/config_scmi_perf.c
|
||||
index f2be2253..6ef6146b 100644
|
||||
--- a/product/tc0/scp_ramfw/config_scmi_perf.c
|
||||
+++ b/product/tc0/scp_ramfw/config_scmi_perf.c
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
static const struct mod_scmi_perf_domain_config domains[] = {
|
||||
[0] = {},
|
||||
+ [1] = {},
|
||||
};
|
||||
|
||||
const struct fwk_module_config config_scmi_perf = {
|
||||
diff --git a/product/tc0/scp_ramfw/config_system_pll.c b/product/tc0/scp_ramfw/config_system_pll.c
|
||||
index b55dd642..37578855 100644
|
||||
--- a/product/tc0/scp_ramfw/config_system_pll.c
|
||||
+++ b/product/tc0/scp_ramfw/config_system_pll.c
|
||||
@@ -18,14 +18,27 @@
|
||||
|
||||
static const struct fwk_element system_pll_element_table[] =
|
||||
{
|
||||
- [CLOCK_PLL_IDX_CPU0] =
|
||||
+ [CLOCK_PLL_IDX_CPU_KLEIN] =
|
||||
{
|
||||
- .name = "CPU_PLL_0",
|
||||
+ .name = "CPU_PLL_KLEIN",
|
||||
.data = &((struct mod_system_pll_dev_config){
|
||||
.control_reg = (void *)SCP_PLL_CPU0,
|
||||
.status_reg = (void *)&SCP_PIK_PTR->PLL_STATUS[1],
|
||||
.lock_flag_mask = PLL_STATUS_CPUPLLLOCK(0),
|
||||
- .initial_rate = 1750 * FWK_MHZ,
|
||||
+ .initial_rate = 1537 * FWK_MHZ,
|
||||
+ .min_rate = MOD_SYSTEM_PLL_MIN_RATE,
|
||||
+ .max_rate = MOD_SYSTEM_PLL_MAX_RATE,
|
||||
+ .min_step = MOD_SYSTEM_PLL_MIN_INTERVAL,
|
||||
+ }),
|
||||
+ },
|
||||
+ [CLOCK_PLL_IDX_CPU_MATTERHORN] =
|
||||
+ {
|
||||
+ .name = "CPU_PLL_MATTERHORN",
|
||||
+ .data = &((struct mod_system_pll_dev_config){
|
||||
+ .control_reg = (void *)SCP_PLL_CPU4,
|
||||
+ .status_reg = (void *)&SCP_PIK_PTR->PLL_STATUS[1],
|
||||
+ .lock_flag_mask = PLL_STATUS_CPUPLLLOCK(0),
|
||||
+ .initial_rate = 1893 * FWK_MHZ,
|
||||
.min_rate = MOD_SYSTEM_PLL_MIN_RATE,
|
||||
.max_rate = MOD_SYSTEM_PLL_MAX_RATE,
|
||||
.min_step = MOD_SYSTEM_PLL_MIN_INTERVAL,
|
||||
diff --git a/product/tc0/scp_romfw/config_clock.c b/product/tc0/scp_romfw/config_clock.c
|
||||
index f43b61b0..96806211 100644
|
||||
--- a/product/tc0/scp_romfw/config_clock.c
|
||||
+++ b/product/tc0/scp_romfw/config_clock.c
|
||||
@@ -35,13 +35,13 @@ static const struct fwk_element clock_dev_desc_table[] = {
|
||||
|
||||
}),
|
||||
},
|
||||
- [CLOCK_IDX_CPU_GROUP0] =
|
||||
+ [CLOCK_IDX_CPU_GROUP_KLEIN] =
|
||||
{
|
||||
- .name = "CPU_GROUP0",
|
||||
+ .name = "CPU_GROUP_KLEIN",
|
||||
.data = &((struct mod_clock_dev_config){
|
||||
.driver_id = FWK_ID_ELEMENT_INIT(
|
||||
FWK_MODULE_IDX_CSS_CLOCK,
|
||||
- CLOCK_CSS_IDX_CPU_GROUP0),
|
||||
+ CLOCK_CSS_IDX_CPU_GROUP_KLEIN),
|
||||
.api_id = FWK_ID_API_INIT(
|
||||
FWK_MODULE_IDX_CSS_CLOCK,
|
||||
MOD_CSS_CLOCK_API_TYPE_CLOCK),
|
||||
diff --git a/product/tc0/scp_romfw/config_css_clock.c b/product/tc0/scp_romfw/config_css_clock.c
|
||||
index fcb9bbbb..ca284ee7 100644
|
||||
--- a/product/tc0/scp_romfw/config_css_clock.c
|
||||
+++ b/product/tc0/scp_romfw/config_css_clock.c
|
||||
@@ -17,11 +17,11 @@
|
||||
#include <fwk_module.h>
|
||||
#include <fwk_module_idx.h>
|
||||
|
||||
-static const struct mod_css_clock_rate rate_table_cpu_group[] = {
|
||||
+static const struct mod_css_clock_rate rate_table_cpu_group_klein[] = {
|
||||
{
|
||||
/* Super Underdrive */
|
||||
- .rate = 946 * FWK_MHZ,
|
||||
- .pll_rate = 946 * FWK_MHZ,
|
||||
+ .rate = 768 * FWK_MHZ,
|
||||
+ .pll_rate = 768 * FWK_MHZ,
|
||||
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
.clock_div = 1,
|
||||
@@ -30,8 +30,8 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
|
||||
},
|
||||
{
|
||||
/* Underdrive */
|
||||
- .rate = 1419 * FWK_MHZ,
|
||||
- .pll_rate = 1419 * FWK_MHZ,
|
||||
+ .rate = 1153 * FWK_MHZ,
|
||||
+ .pll_rate = 1153 * FWK_MHZ,
|
||||
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
.clock_div = 1,
|
||||
@@ -40,8 +40,8 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
|
||||
},
|
||||
{
|
||||
/* Nominal */
|
||||
- .rate = 1893 * FWK_MHZ,
|
||||
- .pll_rate = 1893 * FWK_MHZ,
|
||||
+ .rate = 1537 * FWK_MHZ,
|
||||
+ .pll_rate = 1537 * FWK_MHZ,
|
||||
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
.clock_div = 1,
|
||||
@@ -50,8 +50,8 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
|
||||
},
|
||||
{
|
||||
/* Overdrive */
|
||||
- .rate = 2271 * FWK_MHZ,
|
||||
- .pll_rate = 2271 * FWK_MHZ,
|
||||
+ .rate = 1844 * FWK_MHZ,
|
||||
+ .pll_rate = 1844 * FWK_MHZ,
|
||||
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
.clock_div = 1,
|
||||
@@ -60,8 +60,8 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
|
||||
},
|
||||
{
|
||||
/* Super Overdrive */
|
||||
- .rate = 2650 * FWK_MHZ,
|
||||
- .pll_rate = 2650 * FWK_MHZ,
|
||||
+ .rate = 2152 * FWK_MHZ,
|
||||
+ .pll_rate = 2152 * FWK_MHZ,
|
||||
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
.clock_div = 1,
|
||||
@@ -70,7 +70,7 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
|
||||
},
|
||||
};
|
||||
|
||||
-static const fwk_id_t member_table_cpu_group_0[] = {
|
||||
+static const fwk_id_t member_table_cpu_group_klein[] = {
|
||||
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU0),
|
||||
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU1),
|
||||
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU2),
|
||||
@@ -78,27 +78,27 @@ static const fwk_id_t member_table_cpu_group_0[] = {
|
||||
};
|
||||
|
||||
static const struct fwk_element css_clock_element_table[] = {
|
||||
- [CLOCK_CSS_IDX_CPU_GROUP0] =
|
||||
+ [CLOCK_CSS_IDX_CPU_GROUP_KLEIN] =
|
||||
{
|
||||
- .name = "CPU_GROUP_0",
|
||||
+ .name = "CPU_GROUP_KLEIN",
|
||||
.data = &((struct mod_css_clock_dev_config){
|
||||
.clock_type = MOD_CSS_CLOCK_TYPE_INDEXED,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
.clock_switching_source =
|
||||
MOD_PIK_CLOCK_CLUSCLK_SOURCE_SYSREFCLK,
|
||||
.pll_id = FWK_ID_ELEMENT_INIT(
|
||||
FWK_MODULE_IDX_SYSTEM_PLL,
|
||||
- CLOCK_PLL_IDX_CPU0),
|
||||
+ CLOCK_PLL_IDX_CPU_KLEIN),
|
||||
.pll_api_id = FWK_ID_API_INIT(
|
||||
FWK_MODULE_IDX_SYSTEM_PLL,
|
||||
MOD_SYSTEM_PLL_API_TYPE_DEFAULT),
|
||||
- .member_table = member_table_cpu_group_0,
|
||||
- .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_0),
|
||||
+ .member_table = member_table_cpu_group_klein,
|
||||
+ .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_klein),
|
||||
.member_api_id = FWK_ID_API_INIT(
|
||||
FWK_MODULE_IDX_PIK_CLOCK,
|
||||
MOD_PIK_CLOCK_API_TYPE_CSS),
|
||||
- .initial_rate = 2271 * FWK_MHZ,
|
||||
+ .initial_rate = 1537 * FWK_MHZ,
|
||||
.modulation_supported = true,
|
||||
}),
|
||||
},
|
||||
diff --git a/product/tc0/scp_romfw/config_pik_clock.c b/product/tc0/scp_romfw/config_pik_clock.c
|
||||
index ba7c3ddc..2c883084 100644
|
||||
--- a/product/tc0/scp_romfw/config_pik_clock.c
|
||||
+++ b/product/tc0/scp_romfw/config_pik_clock.c
|
||||
@@ -19,9 +19,9 @@
|
||||
/*
|
||||
* Rate lookup tables
|
||||
*/
|
||||
-static struct mod_pik_clock_rate rate_table_cpu_group[] = {
|
||||
+static struct mod_pik_clock_rate rate_table_cpu_group_klein[] = {
|
||||
{
|
||||
- .rate = 1750 * FWK_MHZ,
|
||||
+ .rate = 1537 * FWK_MHZ,
|
||||
.source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
|
||||
.divider_reg = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
|
||||
.divider = 1, /* Rate adjusted via CPU PLL */
|
||||
@@ -94,8 +94,8 @@ static const struct fwk_element
|
||||
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].CTRL,
|
||||
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].DIV,
|
||||
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].MOD,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
}),
|
||||
},
|
||||
[CLOCK_PIK_IDX_CLUS0_CPU1] =
|
||||
@@ -107,8 +107,8 @@ static const struct fwk_element
|
||||
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].CTRL,
|
||||
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].DIV,
|
||||
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].MOD,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
}),
|
||||
},
|
||||
[CLOCK_PIK_IDX_CLUS0_CPU2] =
|
||||
@@ -120,8 +120,8 @@ static const struct fwk_element
|
||||
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].CTRL,
|
||||
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].DIV,
|
||||
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].MOD,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
}),
|
||||
},
|
||||
[CLOCK_PIK_IDX_CLUS0_CPU3] =
|
||||
@@ -133,8 +133,8 @@ static const struct fwk_element
|
||||
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].CTRL,
|
||||
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].DIV,
|
||||
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].MOD,
|
||||
- .rate_table = rate_table_cpu_group,
|
||||
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
|
||||
+ .rate_table = rate_table_cpu_group_klein,
|
||||
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
|
||||
}),
|
||||
},
|
||||
[CLOCK_PIK_IDX_INTERCONNECT] =
|
||||
diff --git a/product/tc0/scp_romfw/config_system_pll.c b/product/tc0/scp_romfw/config_system_pll.c
|
||||
index e6b578ff..8440f126 100644
|
||||
--- a/product/tc0/scp_romfw/config_system_pll.c
|
||||
+++ b/product/tc0/scp_romfw/config_system_pll.c
|
||||
@@ -17,14 +17,14 @@
|
||||
#include <fwk_module.h>
|
||||
|
||||
static const struct fwk_element system_pll_element_table[] = {
|
||||
- [CLOCK_PLL_IDX_CPU0] =
|
||||
+ [CLOCK_PLL_IDX_CPU_KLEIN] =
|
||||
{
|
||||
- .name = "CPU_PLL_0",
|
||||
+ .name = "CPU_PLL_KLEIN",
|
||||
.data = &((struct mod_system_pll_dev_config){
|
||||
.control_reg = (void *)SCP_PLL_CPU0,
|
||||
.status_reg = (void *)&SCP_PIK_PTR->PLL_STATUS[1],
|
||||
.lock_flag_mask = PLL_STATUS_CPUPLLLOCK(0),
|
||||
- .initial_rate = 1750 * FWK_MHZ,
|
||||
+ .initial_rate = 1537 * FWK_MHZ,
|
||||
.min_rate = MOD_SYSTEM_PLL_MIN_RATE,
|
||||
.max_rate = MOD_SYSTEM_PLL_MAX_RATE,
|
||||
.min_step = MOD_SYSTEM_PLL_MIN_INTERVAL,
|
||||
--
|
||||
2.29.2
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user