1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-07-19 16:57:09 +00:00

Compare commits

..

54 Commits

Author SHA1 Message Date
Jon Mason 4a9d140e4e README: remove reference to meta-arm-autonomy
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-10-01 16:21:22 -04:00
Jon Mason 58952aa7ba CI: dev kernel allow failure
The dev kernel can frequently fail, and is not anything that is used in
production.  Allow failure to prevent CI issues but still notify that
there are potential issues.

Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-05-05 14:59:05 -04:00
Peter Hoyes 54e8f00795 CI: Add BUILD_ENABLE_REGEX option to conditionally enable builds
Mirrors of meta-arm may focus their development on a small subset of
MACHINEs so provide the option to restrict the boards that are built on
CI using the variable BUILD_ENABLE_REGEX. If set, it conditionally
enables builds; if unset there is no change in behavior.

This variable could be overridden in a scheduled build, to e.g. build
all the MACHINEs weekly.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-05-05 14:58:51 -04:00
Adam Johnston eb41589aa1 CI: Remove ts-smm-gateway from N1SDP
Installing SMM Gateway SP on the N1SDP may stop the platform from booting
for on-device testing in CI.

In n1sdp.yml, remove `ts-smm-gateway` if it has been added

Keep `ts-smm-gateway` in default SP set so it can still be tested with
`qemu-secureboot`

Signed-off-by: Adam Johnston <adam.johnston@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-04-26 08:55:36 -04:00
Ross Burton 7d50f71baa arm-bsp/external-system: fix the gen_module race, again
Apply the patch from scp-firmware to the third copy of the buggy
Makefiles which fail randomly under parallel builds.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-04-25 11:00:07 -04:00
Gowtham Suresh Kumar 04071ec9f5 arm-bsp/uefi_capsule: Move UEFI capsule to IMGDEPLOYDIR
The UEFI capsule generated is in the incorrect build directory.
This patch copies it to IMGDEPLOYDIR.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-28 10:00:16 -05:00
Gowtham Suresh Kumar 71f92f4df8 arm-bsp/uefi_capsule: Use json file to pass capsule config
This patch uses the json config file for UEFI capsule generation
as this is efficient and easily scalable to generate multiple
capsules.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-28 10:00:16 -05:00
Gowtham Suresh Kumar 50c462da2d arm/edk2-basetools: Convert edk2 basetools recipes to native only
The BBCLASSEXTEND configuration can generate native sdk and target
recipes as well. The cp command used in do_install will
create host contamination issues for these recipes, so this patch
makes the recipe native only.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-28 10:00:16 -05:00
Gowtham Suresh Kumar 2792359e0a arm-bsp/corstone1000-image: Generate UEFI capsule for corstone1000 platform
Inherits the UEFI capsule generation class and configures the capsule
variables for the wic.nopt image

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-28 10:00:16 -05:00
Gowtham Suresh Kumar 7a16491373 arm-bsp/uefi_capsule: Add UEFI capsule generation class
This class currently supports only a single firmware binary. The
required capsule parameters needs to be set, if not the build fails.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-28 10:00:16 -05:00
Gowtham Suresh Kumar ccf216ce4d arm/edk2-basetools: Add edk2 base tool native recipe
The native recipe installs the UEFI capsule generation tool
along with the other base tools to native sysroot.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-28 10:00:16 -05:00
Emekcan Aras 4ec5d8b306 arm/trusted-firmware-m: Do not use release branches
TFM repos do not use release branches. TFM-test repo does not use master
branch and use detached head for the 1.6 release. This commits makes necessary
changes to be able to build tfm and tfm-test again for langdale.

Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-09 09:22:37 -05:00
Ross Burton deda0fe304 CI: pin to kas 3.2 as 3.2.1 fails
For some reason the kas 3.2.1 container fails:

No such file or directory: '/builds/engineering/yocto/meta-arm/ci/ci/base.yml'

Note the repeated /ci/, which is wrong.

Pin the kas container to 3.2 for now until this is resolved.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2023-02-09 12:39:17 +00:00
Daniel Díaz d338ac4535 arm-bsp/firmware-image-juno: Fix deployment of compressed Image
A recent commit compressed the kernel image (to Image.gz) and
by default enabled an initramfs image. In the case for when
such that (initramfs) is not desirable, the deploy step of the
Juno firmware will still try to install the Image file, (not
Image.gz), so this fails:

  ERROR: firmware-image-juno-1.0-r0 do_deploy: ExecutionError('/oe/build/tmp-glibc/work/juno-oe-linux/firmware-image-juno/1.0-r0/temp/run.do_deploy.360477', 1, None, None)
  ERROR: Logfile of failure stored in: /oe/build/tmp-glibc/work/juno-oe-linux/firmware-image-juno/1.0-r0/temp/log.do_deploy.360477
  Log data follows:
  | DEBUG: Executing python function sstate_task_prefunc
  | DEBUG: Python function sstate_task_prefunc finished
  | DEBUG: Executing shell function do_deploy
  | cp: cannot stat '/oe/build/tmp-glibc/deploy/images/juno/Image': No such file or directory
  | WARNING: /oe/build/tmp-glibc/work/juno-oe-linux/firmware-image-juno/1.0-r0/temp/run.do_deploy.360477:152 exit 1 from 'cp -L -f /oe/build/tmp-glibc/deploy/images/juno/Image /oe/build/tmp-glibc/work/juno-oe-linux/firmware-image-juno/1.0-r0/image/juno-firmware-19.06/SOFTWARE/'
  | WARNING: Backtrace (BB generated script):
  | 	#1: do_deploy, /oe/build/tmp-glibc/work/juno-oe-linux/firmware-image-juno/1.0-r0/temp/run.do_deploy.360477, line 152
  | 	#2: main, /oe/build/tmp-glibc/work/juno-oe-linux/firmware-image-juno/1.0-r0/temp/run.do_deploy.360477, line 163
  NOTE: recipe firmware-image-juno-1.0-r0: task do_deploy: Failed
  ERROR: Task (../meta-arm/meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bb:do_deploy) failed with exit code '1'

This updates the else case for when an initramfs image is not
in use so that the right kernel image is deployed, by using
the KERNEL_IMAGETYPE variable, to use either version of the
kernel image.

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-04 04:53:49 -05:00
Qi Feng 85746671a4 kas/fvp-baser-aemv8r64: Use langdale as kas default refspec
The default refspec for the repos used by kas is now langdale.

Signed-off-by: Qi Feng <qi.feng@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-02-01 06:00:07 -05:00
Peter Hoyes a590d6e1b8 classes: Set ARMLMD_LICENSE_FILE in the runfvp environment
For models that require a license, ARMLMD_LICENSE_FILE is used to define
the location of a license file or server. If the variable is not set in
Bitbake it will not be set in the model environment.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-23 09:00:20 -05:00
Peter Hoyes 7090a9bb8e classes: Prevent passing None to the runfvp environment
FVP_ENV_PASSTHROUGH may contain variables that have not been set.
d.getVar returns None in this case. Detect this and skip setting the
variable in the model environment.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-23 09:00:20 -05:00
Peter Hoyes 9d980336fd classes: Define FVP_ENV_PASSTHROUGH variable dependencies
Define FVP_ENV_PASSTHROUGH's vardeps to equal itself, so that the
fvpconf is regenerated if any of the defined variables change.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-23 09:00:20 -05:00
Peter Hoyes 65c36dc6c3 arm/lib: Add XAUTHORITY to runfvp environment
aa89fe3f ensured environment variables necessary for GUI applications
are passed through to the model despite runfvp env var restrictions. Add
XAUTHORITY to this list. This is useful when doing X-forwarding with
Kas, which creates its own home directory.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-23 09:00:20 -05:00
Jon Mason 0f6b032d59 arm-bsp/juno: Update kernel patches to the latest
Pulling in the latest juno kernel patches from
https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git

Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-18 12:40:44 -05:00
Jon Mason 47211c659e arm-bsp/juno: move to compressed initramfs image
Change u-boot and machine config to default to booting a compressed
initramfs.  This allows for easier testing.  A compressed image is
needed as the image is too big for the storage, and the error notifying
of such is vague.

Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-18 12:40:44 -05:00
Adam Johnston 13c7463c9f arm/trusted-services: Fix 'no such file' when building libts
The libts recipe assumes generated cmake file will be suffixed with
'-noconfig'. This is only true when building with the default type
i.e. "".

Check which target cmake file has been generated before trying to
patch it. This fixes 'no such file' error when building with an
explicit type (Debug, Release, etc).

Signed-off-by: Adam Johnston <adam.johnston@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-13 10:05:30 -05:00
Peter Hoyes fd414c303c arm/scp-firmware: Disable cppcheck
The SCP-firmware CMake compile step automatically attempts to execute
cppcheck if both:
 * cppcheck can be located using find_program
 * DISABLE_CPPCHECK is not defined

cppcheck is not readily available in OE-core and is not an essential
part of the compilation process for end-users, so explicitly disable the
cppcheck step by passing DISABLE_CPPCHECK to CMake.

Additionally, because the OE-core CMake toolchain file cannot be used,
find_program may locate cppcheck on the host machine, which will cause
the build to fail if it is not the recommended version (as it is in
recent Linux distros).

Issue-Id: SCM-5864
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Ia87a0cbbb67ac1d6f3b26cfb5747a85b46131f81
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-11 14:00:09 -05:00
Peter Hoyes b5fe2bf2b7 arm/scp-firmware: Ensure CMAKE_BUILD_TYPE is capitalized
If CMAKE_BUILD_TYPE=debug (lowercase), SCP-firmware builds with debug
compiler flags but BUILD_MODE_DEBUG is not defined in C code so features
that are conditionally enabled/disabled in debug mode are not active.

Pass capitalized "Debug" and "Release" strings to CMAKE_BUILD_TYPE to
ensure Debug mode is fully enabled when SCP_BUILD_RELEASE = "0".

SCP_BUILD_RELEASE = "1" (the default) for all machines in meta-arm-bsp
so they are unaffected.

Issue-Id: SCM-5864
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I93220420eedd2e3e6c169679efcaf4642dd5bc51
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-11 14:00:09 -05:00
Peter Hoyes 8b95c97a00 arm/classes: Ensure patch files are sorted in apply_local_src_patches
apply_local_src_patches.bbclass was added in a previous patch to handle
the application of patch files located inside the fetched source code.

find is used to collect the patch files which does not guarantee the
order of its output. Pipe the output of find into sort to ensure patch
files are applied in the correct order.

Issue-Id: SCM-5864
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I1082fb7a726a7745289a5aa8bb6447bef57a94b0
Signed-off-by: Jon Mason <jon.mason@arm.com>
2023-01-10 09:00:07 -05:00
Ross Burton 898a4aa99b CI: fix builds with clang
meta-clang has a langdale branch now, so use that instead of master.

linux-yocto needs to use non-clang objcopy, apply the change locally
until the commit has been merged into meta-clang's langdale branch.

perf needs some patches backported to langdale, until that has been done
use gcc to build perf.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2023-01-03 17:19:59 +00:00
Peter Hoyes 025124814e arm/fvpboot: Disable timing annotation by default
Timing Annotation is a feature of the model that enables high-level
performance estimations to be made [1]. It is not needed to demonstrate
a functioning software stack so set FASTSIM_DISABLE_TA to 1 in the model
environment to disable this feature. This also improves model
performance.

[1] https://developer.arm.com/documentation/100965/1119/Timing-Annotation

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-16 07:00:12 -05:00
Jon Mason a0e5349c24 CI: define DEFAULT_TAG and CPU_REQUEST
DEFAULT_TAG and CPU_REQUEST are being used to help with internal Gitlab
pipeline setups know which type of machines to run on, but has no value
outside of Arm Corp.  Gitlab CI allows for variables to be overridden
by default.  So, we can give it a default value of NULL/empty and have
everything work internally and externally by default.

Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-15 17:15:30 +00:00
Ross Burton 7ac3f9f155 CI: use the .setup fragment in machine-coverage
Signed-off-by: Ross Burton <ross.burton@arm.com>
2022-12-15 13:03:14 +00:00
Ross Burton 1e540d9f49 CI: no need to install telnet
The kas 3.1 container has telnet in. We can also remove python3-subunit
once kas 3.2 is released.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2022-12-15 13:03:14 +00:00
Ross Burton 3d68b6a0a9 CI: add tags to all jobs
Tag all jobs with the DEFAULT_TAG variable so each instance can control
what tags the jobs have, whilst still explicitly tagging the jobs which
need specific tags (such as x86_64 for jobs which need to run x86-only
binaries)

Signed-off-by: Ross Burton <ross.burton@arm.com>
2022-12-15 13:03:14 +00:00
Ross Burton 63a2b36141 CI: add variables needed for k8s runners
The Kas container needs to use the entrypoint as that is where the user
changes from root to a normal user.

Also set the KUBERNETES_CPU_REQUEST to the variable CPU_REQUEST as this
needs to be tuned per-deployment.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2022-12-15 13:03:14 +00:00
Robbie Cao d7660ca618 arm/fvp-base-r-aem: upgrade to version 11.20.15
Update version in documentation.

Issue-Id: SCM-4874
Signed-off-by: Robbie Cao <robbie.cao@arm.com>
Change-Id: Ic66bdcdc5c6309331f80faab6eaf2e3e936a5da4
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-14 03:00:14 -05:00
Adrián Herrera Arcila 26847ac52f ci: add meta-atp to check-layers
Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-09 13:07:47 -05:00
Adrián Herrera Arcila 5937b4a793 atp: fix machine overrides in recipes
Ensure meta-atp recipes are only performed if a compatible machine is
selected.

Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-09 13:07:47 -05:00
Adrián Herrera Arcila cb55a84894 atp: separate recipe for gem5 models
Previously, meta-atp extended the original gem5 recipe to add the ATP
Engine models; the .bbappend was complex, because it pulled from two
sources, and it was not possible to make machine-based overrides, as it
is a native recipe.

To solve this, we use the recent EXTRAS feature to add the gem5 models
from a different recipe.

Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-09 13:07:47 -05:00
Adrián Herrera Arcila e8334d3309 gem5: support for EXTRAS
External models can be added to gem5 through EXTRAS:
https://www.gem5.org/documentation/general_docs/building/EXTRAS

Added GEM5_EXTRAS to the gem5-native recipe to support it.

Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-09 13:07:47 -05:00
Adrian Herrera fe7c4c6ee0 atp: move m5readfile to meta-gem5
The m5 readfile recipe provides general utility for gem5 users to
run any script on OS boot. We hence move it to the meta-gem5 layer.

Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-09 13:07:47 -05:00
Adrian Herrera 5e00e21286 atp: decouple m5readfile from m5ops
By making m5readfile into its own recipe, we avoid modifications to the
m5ops recipe when using the meta-atp layer, which break the Yocto
compatibility of the layer.

Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-09 13:07:47 -05:00
Adrián Herrera Arcila ee80cc19e4 atp: fix failing test_readme
Test failed because there was no reference to maintainers in the
meta-atp README.

Following the common structure of other layers in the meta-arm
repository, the README in meta-atp now refers to the top-level README,
and a documentation directory contains the guidance that was present in
the original meta-atp README.

Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-09 13:07:47 -05:00
Vishnu Banavath ca4b469ac5 arm-bsp/optee: register DRAM1 for N1SDP target
N1SDP has 2 DRAM's. This change is to register 2nd DRAM which starts at
0x8080000000. Linux uses 1KB of this memory to share data with optee-os.

Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-05 15:00:08 -05:00
Peter Hoyes e89020b5e4 arm/fvp: Backport shlex.join from Python 3.8
721bec25 "arm/fvp: Join cli arguments in verbose logging" changed the
verbose output of FVPRunner to print the generated arguments using
shlex.join instead of as a list. However, this function is only
available in Python >= 3.8, whereas OE-core currently supports Python
3.6.

To fix this, backport its one-line implementation to a local function
shlex_join and update the call site.

Issue-Id: SCM-5314
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I56cab9dddcd0a91272464be15742a6ee726dad41
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-12-01 11:03:40 -05:00
Ross Burton 4f1e45b6bd CI: revert a meta-clang change which breaks pixman (thus, xserver)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-28 15:47:19 -05:00
Diego Sueiro 5a2018ae99 arm/trusted-firmware-m: Fix local source patches application
As TF-M ships patches that it needs applied to mbedcrypto, we apply them as
part of do_patch by using a postfunc. There is an issue when do_patch is
executed after do_deploy_source_date_epoch_setscene and apply_local_patches
tries to apply the patches already applied.

To fix this, make usage of the apply_local_src_patches bbclass.

Change-Id: Ia115b540b37ad3a2cce30e1e0461abd1f5a6ccc1
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-28 11:43:30 -05:00
Diego Sueiro 0f10564eaf arm/classes: Introduce apply_local_src_patches bbclass
This class is to be inherited by recipes where there are patches located inside
the fetched source code which need to be applied.

The following variables need to be set:
LOCAL_SRC_PATCHES_INPUT_DIR is the directory from where the patches are located
LOCAL_SRC_PATCHES_DEST_DIR is the directory where the patches will be applied

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I8f9c16a5fbc9d5569cba60136560f1951408bd60
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-28 11:43:30 -05:00
Rui Miguel Silva df7ac03ac8 kas/corstone500.yml: pin repos to langdale
Pin repos by default to langdale release branches.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-28 08:00:17 -05:00
Peter Hoyes 17828e6e8b runfvp: Fix verbose output when using --console
Start a new thread to simultaneously log the output of FVP and the
telnet output if the --verbose flag is passed to runfvp. So that
ConsolePortParser can read the same stream, use itertools.tee to
temporarily duplicate the stream.

Use a custom log format string with an escape character to ensure that
log output always starts at the beginning of a line when interleaved
with console output.

Issue-Id: SCM-5314
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I3e815d9d899425e0d2af619524f09f2eda87562c
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-23 11:20:03 -05:00
Peter Hoyes 33dbc4f690 arm/oeqa: Log the FVP output in OEFVPSSHTarget
It is often useful to inspect the FVP output after running the tests.

Refactor OEFVPSerialTarget._create_logfile into
OEFVPSSHTarget._create_log_filename, so that all FVP test controllers
are able to create secondary log files.

Pass a filehandle to the stdout argument of run_fvp so that the FVP
output is asynchronously logged to a file. Change the port parsing logic
to read back from the same log file instead of reading the stdout
directly.

Issue-Id: SCM-5314
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I2ddb423fa0d896c13d3e96884858c680c4d34555
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-23 11:20:03 -05:00
Peter Hoyes 8eba0eecec arm/lib: Decouple console parsing from the FVPRunner
To simplify the FVPRunner class, create a separate ConsolePortParser
class to handle reading an iterator of lines and parsing port numbers
for FVP consoles. Use this in runfvp and the test targets.

This refactor also allows the stream being monitored to be changed more
easily, e.g. to a log file.

Issue-Id: SCM-5314
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Iade3a4c803fb355b04af7afa298d0a41fe707d94
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-23 11:20:03 -05:00
Peter Hoyes c6418d6d59 arm/lib: Factor out asyncio in FVPRunner
FVPRunner relies heavily on asyncio, despite there being very little
concurrent work happening. Additionally, while the runfvp entry point
starts an asyncio runner, it is not practical to have a single asyncio
runtime during testimage, which is fully synchronous.

Refactor to use subprocess.Popen and related functionality. The process
object has a similar interface to its async equivalent.

Cascade the API changes to runfvp and the test target classes.

Issue-Id: SCM-5314
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I3e7517e8bcbb3b93c41405d43dbd8bd24a9e7eb8
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-23 11:20:03 -05:00
Peter Hoyes f3fc634bbf arm/fvp: Join cli arguments in verbose logging
It is sometimes helpful to copy and paste the cli arguments from the
verbose runfvp output (e.g. to test with a development FVP build), but
currently the arguments are printed as a Python list.  Use
shlex.join(cli) to safely join the arguments together in form that can
be reused directly in a shell.

Issue-Id: SCM-5314
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Ibb5c5ed45d02e241cb3858f68740fb9d4e89357a
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-23 11:20:03 -05:00
Emekcan Aras f2997ee1a7 kas/corstone1000-base.yml: set refspec for Corstone1000 release
Sets refspec for meta-openembedded and poky for upcoming
Corstone1000 release. These SHAs are tested.

Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-23 09:00:19 -05:00
Emekcan Aras 1549624dbf arm-bsp/documentation: corstone1000: update the user guide
Aligning the user guide with the latest Corstone1000 SW updates.

Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-23 09:00:16 -05:00
Emekcan fb43632e7c arm/fvp: Upgrade Corstone1000 FVP
Upgrades the Corstone1000 FVP to the latest release
version.

Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2022-11-23 09:00:16 -05:00
60 changed files with 1242 additions and 336 deletions
+32 -5
View File
@@ -1,4 +1,12 @@
image: ghcr.io/siemens/kas/kas:latest-release
image: ghcr.io/siemens/kas/kas:3.2
variables:
CPU_REQUEST: ""
DEFAULT_TAG: ""
# These are needed as the k8s executor doesn't respect the container entrypoint
# by default
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: 0
FF_KUBERNETES_HONOR_ENTRYPOINT: 1
stages:
- prep
@@ -6,6 +14,8 @@ stages:
# Common job fragment to get a worker ready
.setup:
tags:
- $DEFAULT_TAG
stage: build
interruptible: true
variables:
@@ -25,11 +35,29 @@ stages:
- mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
# Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
- ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
- sudo apt-get update && sudo apt-get install --yes telnet python3-subunit
# This can be removed with Kas 3.2
- sudo apt-get update && sudo apt-get install --yes python3-subunit
# Generalised fragment to do a Kas build
.build:
extends: .setup
variables:
KUBERNETES_CPU_REQUEST: $CPU_REQUEST
rules:
# Don't run MR pipelines
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
# Don't run pipelines for tags
- if: $CI_COMMIT_TAG
when: never
# Don't run if BUILD_ENABLE_REGEX is set, but the job doesn't match the regex
- if: '$BUILD_ENABLE_REGEX != null && $CI_JOB_NAME !~ $BUILD_ENABLE_REGEX'
when: never
# Allow the dev kernels to fail and not fail the overall build
- if: '$KERNEL == "linux-yocto-dev"'
allow_failure: true
# Catch all for everything else
- if: '$KERNEL != "linux-yocto-dev"'
script:
- KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME")
- kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
@@ -210,7 +238,7 @@ check-layers:
"yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
parallel:
matrix:
- LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain, meta-gem5]
- LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain, meta-gem5, meta-atp]
pending-updates:
extends: .setup
@@ -228,8 +256,7 @@ pending-updates:
# What percentage of machines in the layer do we build
machine-coverage:
stage: build
interruptible: true
extends: .setup
script:
- ./ci/check-machine-coverage
coverage: '/Coverage: \d+/'
+1 -5
View File
@@ -6,10 +6,6 @@ This repository contains the Arm layers for OpenEmbedded.
This layer contains general recipes for the Arm architecture, such as firmware, FVPs, and Arm-specific integration.
* meta-arm-autonomy
This layer is the distribution for a reference stack for autonomous systems.
* meta-arm-bsp
This layer contains machines for Arm reference platforms, for example FVP Base, N1SDP, and Juno.
@@ -20,7 +16,7 @@ This repository contains the Arm layers for OpenEmbedded.
* meta-atp
This layer contains recipes for the Adaptive Traffic Generation integration into meta-gem5.
This layer contains recipes for the [AMBA Adaptive Traffic Profiles (ATP)](https://developer.arm.com/documentation/ihi0082/latest) generation integration into meta-gem5.
* meta-gem5
@@ -0,0 +1,26 @@
This causes illegal instruction faults in pixman, so xserver crashes.
https://github.com/kraj/meta-clang/issues/696
From 8659c5c5bec39dd43a1988b19d4cf30507a44679 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Mon, 28 Nov 2022 16:52:50 +0000
Subject: [PATCH] Revert "pixman: Do not use clang assembler for now"
This reverts commit 84dbafa42d8141b00da75d6664aef07c252a52ee.
---
conf/nonclangable.conf | 1 -
1 file changed, 1 deletion(-)
diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf
index 04112f4..b5db848 100644
--- a/conf/nonclangable.conf
+++ b/conf/nonclangable.conf
@@ -347,5 +347,4 @@ DEPENDS:append:pn-pixman:mips:toolchain-clang = " openmp"
#| .endfunc
#| ^
CFLAGS:append:pn-pixman:arm:toolchain-clang = " -no-integrated-as"
-CFLAGS:append:pn-pixman:aarch64:toolchain-clang = " -no-integrated-as"
--
2.34.1
+9 -1
View File
@@ -4,8 +4,16 @@ header:
repos:
meta-clang:
url: https://github.com/kraj/meta-clang
refspec: master
patches:
pixman:
repo: meta-arm
path: ci/0001-Revert-pixman-Do-not-use-clang-assembler-for-now.patch
local_conf_header:
clang: |
TOOLCHAIN = "clang"
# Backport d89e06ad94a46f6810d0a8787004b71b8ecaf87d to langdale
OBJCOPY:pn-linux-yocto:toolchain-clang = "${HOST_PREFIX}objcopy"
# Perf needs fixes backported, use GCC for now
# https://lore.kernel.org/linux-perf-users/Y5d4k7fDxfRP7hcN@kernel.org/T/#t
TOOLCHAIN:pn-perf = "gcc"
+4
View File
@@ -4,3 +4,7 @@ header:
- ci/base.yml
machine: n1sdp
local_conf_header:
unsupported_trusted_services: |
MACHINE_FEATURES:remove = "ts-smm-gateway"
+1 -1
View File
@@ -4,7 +4,7 @@ OE-Core's [oeqa][OEQA] framework provides a method of performing runtime tests o
Tests can be configured to run automatically post-build by setting the variable `TESTIMAGE_AUTO="1"`, e.g. in your Kas file or local.conf.
There are two main methods of testing, using different test "targets".
There are two main methods of testing, using different test "targets". Both test targets generate an additional log file with the prefix 'fvp_log' in the image recipe's `${WORKDIR}/testimage` containing the FVP's stdout.
## OEFVPTarget
+2
View File
@@ -16,6 +16,7 @@ repos:
poky:
url: https://git.yoctoproject.org/git/poky
refspec: 79434a17eb4835e85fcd477baec08c8ce49a4c14
layers:
meta:
meta-poky:
@@ -23,6 +24,7 @@ repos:
meta-openembedded:
url: https://git.openembedded.org/meta-openembedded
refspec: c5668905a6d8a78fb72c2cbf8b20e91e686ceb86
layers:
meta-oe:
meta-python:
+1 -3
View File
@@ -5,7 +5,7 @@ distro: poky-tiny
defaults:
repos:
refspec: master
refspec: langdale
repos:
meta-arm:
@@ -16,7 +16,6 @@ repos:
poky:
url: https://git.yoctoproject.org/git/poky
refspec: master
layers:
meta:
meta-poky:
@@ -24,7 +23,6 @@ repos:
meta-openembedded:
url: https://git.openembedded.org/meta-openembedded
refspec: master
layers:
meta-oe:
meta-python:
+1 -1
View File
@@ -6,7 +6,7 @@ machine: fvp-baser-aemv8r64
defaults:
repos:
refspec: master
refspec: langdale
repos:
meta-arm:
+5 -2
View File
@@ -10,10 +10,10 @@ require conf/machine/include/arm/arch-armv8a.inc
MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth optee pci"
KERNEL_IMAGETYPE = "Image"
KERNEL_IMAGETYPE = "Image.gz"
KERNEL_DEVICETREE = "arm/juno.dtb arm/juno-r1.dtb arm/juno-r2.dtb"
IMAGE_FSTYPES += "tar.bz2 ext4"
IMAGE_FSTYPES += "tar.bz2 ext4 cpio.gz"
SERIAL_CONSOLES = "115200;ttyAMA0"
@@ -25,3 +25,6 @@ EXTRA_IMAGEDEPENDS += "trusted-firmware-a virtual/bootloader firmware-image-juno
# Juno u-boot configuration
UBOOT_MACHINE = "vexpress_aemv8a_juno_defconfig"
INITRAMFS_IMAGE_BUNDLE ?= "1"
INITRAMFS_IMAGE = "core-image-minimal"
@@ -11,7 +11,7 @@ This document contains a summary of the new features, changes and
fixes in each release of Corstone-1000 software stack.
******************
Version 2022.11.10
Version 2022.11.23
******************
Changes
@@ -7,8 +7,21 @@
Release notes
#############
*************************
Disclaimer
*************************
You expressly assume all liabilities and risks relating to your use or operation
of Your Software and Your Hardware designed or modified using the Arm Tools,
including without limitation, Your software or Your Hardware designed or
intended for safety-critical applications. Should Your Software or Your Hardware
prove defective, you assume the entire cost of all necessary servicing, repair
or correction.
**************************
Release notes - 2022.11.10
Release notes - 2022.11.23
**************************
Known Issues or Limitations
@@ -18,10 +31,13 @@ Known Issues or Limitations
- Due to the performance uplimit of MPS3 FPGA and FVP, some Linux distros like Fedora Rawhide can not boot on Corstone-1000 (i.e. user may experience timeouts or boot hang).
- Below SCT FAILURE is a known issues in the FVP:
UEFI Compliant - Boot from network protocols must be implemented -- FAILURE
- Below SCT FAILURE is a known issue when a terminal emulator (in the system where the user connects to serial ports) does not support 80x25 or 80x50 mode:
EFI_SIMPLE_TEXT_OUT_PROTOCOL.SetMode - SetMode() with valid mode -- FAILURE
- Known limitations regarding ACS tests: The behavior after running ACS tests on FVP is not consistent. Both behaviors are expected and are valid;
The system might boot till the Linux prompt. Or, the system might wait after finishing the ACS tests.
In both cases, the system executes the entire test suite and writes the results as stated in the user guide.
Platform Support
-----------------
- This software release is tested on Corstone-1000 FPGA version AN550_v1
@@ -152,7 +168,9 @@ Known Issues or Limitations
Support
-------
For support email: support-subsystem-iot@arm.com
For technical support email: support-subsystem-iot@arm.com
For all security issues, contact Arm by email at arm-security@arm.com.
--------------
@@ -18,9 +18,7 @@ for more information.
Prerequisites
-------------
These instructions assume your host PC is running Ubuntu Linux 18.04 or 20.04 LTS, with
at least 32GB of free disk space and 16GB of RAM as minimum requirement. The
following instructions expect that you are using a bash shell.
These instructions assume your host PC is running Ubuntu Linux 18.04 or 20.04 LTS, with at least 32GB of free disk space and 16GB of RAM as minimum requirement. The following instructions expect that you are using a bash shell. All the paths stated in this document are absolute paths.
The following prerequisites must be available on the host system. To resolve these dependencies, run:
@@ -146,11 +144,13 @@ commands to build the stack. To install kas tool, run:
pip3 install kas
If 'kas' command is not found in command-line, please make sure the user installation directories are visible on $PATH. If you have sudo rights, try 'sudo pip3 install kas'.
In the top directory of the workspace ``<_workspace>``, run:
::
git clone https://git.yoctoproject.org/git/meta-arm -b CORSTONE1000-2022.11.10
git clone https://git.yoctoproject.org/git/meta-arm -b CORSTONE1000-2022.11.23
To build a Corstone-1000 image for MPS3 FPGA, run:
@@ -215,9 +215,10 @@ The directory structure of the FPGA bundle is shown below.
└── config.txt
Depending upon the MPS3 board version (printed on the MPS3 board) you should update the images.txt file
(in corresponding HBI0309x folder) so that the file points to the images under SOFTWARE directory.
(in corresponding HBI0309x folder. Boardfiles/MB/HBI0309<board_revision>/AN550/images.txt) so that the file points to the images under SOFTWARE directory.
Here is an example
The images.txt file that is compatible with the latest version of the software
stack can be seen below;
::
@@ -289,6 +290,9 @@ logs on the serial port terminals. Once the HOST(Cortex-A35) is
booted completely, user can login to the shell using
**"root"** login.
If system does not boot and only the ttyUSB1 logs are visible, please follow the steps in `Clean Secure Flash Before Testing (applicable to FPGA only)`_ under `SystemReady-IR tests`_ section. The previous image used in FPGA (MPS3) might have filled the Secure Flash completely. The best practice is to clean the secure flash in this case.
Running the software on FVP
---------------------------
@@ -299,8 +303,11 @@ A Yocto recipe is provided and allows to download the latest supported FVP versi
The recipe is located at <_workspace>/meta-arm/meta-arm/recipes-devtools/fvp/fvp-corstone1000.bb
The latest supported Fixed Virtual Platform (FVP) version is 11.19_21 and is automatically downloaded
and installed when using the runfvp command as detailed below.
The latest supported Fixed Virtual Platform (FVP) version is 11.19_21 and is automatically downloaded and installed when using the runfvp command as detailed below. The FVP version can be checked by running the following command:
::
<_workspace>/meta-arm/scripts/runfvp <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.fvpconf -- --version
The FVP can also be manually downloaded from the `Arm Ecosystem FVPs`_ page. On this page, navigate
to "Corstone IoT FVPs" section to download the Corstone-1000 platform FVP installer. Follow the
@@ -361,8 +368,8 @@ boot. Run following commands to build such image.
::
cd <_workspace>
git clone https://git.yoctoproject.org/git/meta-arm -b CORSTONE1000-2022.11.10
git clone https://git.gitlab.arm.com/arm-reference-solutions/systemready-patch.git
git clone https://git.yoctoproject.org/git/meta-arm -b CORSTONE1000-2022.11.23
git clone https://git.gitlab.arm.com/arm-reference-solutions/systemready-patch.git -b CORSTONE1000-2022.11.23
cp -f systemready-patch/embedded-a/corstone1000/erase_flash/0001-arm-bsp-trusted-firmware-m-corstone1000-Clean-Secure.patch meta-arm
cd meta-arm
git apply 0001-arm-bsp-trusted-firmware-m-corstone1000-Clean-Secure.patch
@@ -374,7 +381,8 @@ Replace the bl1.bin and cs1000.bin files on the SD card with following files:
- The flash image: <_workspace>/build/tmp/deploy/images/corstone1000-mps3/corstone1000-image-corstone1000-mps3.wic.nopt
Now reboot the board. This step erases the Corstone-1000 SecureEnclave flash
completely, the user should expect following message from TF-M log:
completely, the user should expect following message from TF-M log (can be seen
in ttyUSB1):
::
@@ -388,7 +396,7 @@ software stack and flash the FPGA as normal. And continue the testing.
Run SystemReady-IR ACS tests
=============================
ACS image contains two partitions. BOOT partition and RESULTS partition.
ACS image contains two partitions. BOOT partition and RESULT partition.
Following packages are under BOOT partition
* SCT
@@ -398,8 +406,8 @@ Following packages are under BOOT partition
* grub
* uefi manual capsule application
RESULTS partition is used to store the test results.
PLEASE MAKE SURE THAT THE RESULTS PARTITION IS EMPTY BEFORE YOU START THE TESTING. OTHERWISE THE TEST RESULTS
RESULT partition is used to store the test results.
PLEASE MAKE SURE THAT THE RESULT PARTITION IS EMPTY BEFORE YOU START THE TESTING. OTHERWISE THE TEST RESULTS
WILL NOT BE CONSISTENT
FPGA instructions for ACS image
@@ -441,6 +449,8 @@ Once the USB stick with ACS image is prepared, the user should make sure that
ensure that only the USB stick with the ACS image is connected to the board,
and then boot the board.
The FPGA will reset multiple times during the test, and it might take approx. 24-36 hours to finish the test. At the end of test, the FPGA host terminal will halt showing a shell prompt. Once test is finished the result can be copied following above instructions.
FVP instructions for ACS image and run
============================================
@@ -456,7 +466,7 @@ SD card.
tmux
<_workspace>/meta-arm/scripts/runfvp <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.fvpconf -C board.msd_mmc.p_mmc_file="${<path-to-img>/ir_acs_live_image.img}"
<_workspace>/meta-arm/scripts/runfvp <_workspace>/build/tmp/deploy/images/corstone1000-fvp/corstone1000-image-corstone1000-fvp.fvpconf -- -C board.msd_mmc.p_mmc_file="${<path-to-img>/ir_acs_live_image.img}"
The test results can be fetched using following commands:
@@ -488,7 +498,7 @@ automatically in the following sequence:
- FWTS
- BSA Linux
The results can be fetched from the ``acs_results`` partition of the USB stick (FPGA) / SD Card (FVP).
The results can be fetched from the ``acs_results`` folder in the RESULT partition of the USB stick (FPGA) / SD Card (FVP).
#####################################################
@@ -757,11 +767,29 @@ In the Linux command-line run the following:
Negative scenario
=================
In the negative case scenario, the user should see appropriate logs in
the secure enclave terminal. If capsule pass initial verification, but fails
verifications performed during boot time, secure enclave will try new images
predetermined number of times (defined in the code), before reverting back to
the previous good bank.
In the negative case scenario (rollback the capsule version), the user should
see appropriate logs in the secure enclave terminal.
::
...
uefi_capsule_retrieve_images: image 0 at 0xa0000070, size=15654928
uefi_capsule_retrieve_images: exit
flash_full_capsule: enter: image = 0x0xa0000070, size = 15654928, version = 10
ERROR: flash_full_capsule: version error
private_metadata_write: enter: boot_index = 1
private_metadata_write: success
fmp_set_image_info:133 Enter
FMP image update: image id = 0
FMP image update: status = 1version=11 last_attempt_version=10.
fmp_set_image_info:157 Exit.
corstone1000_fwu_flash_image: exit: ret = -1
...
If capsule pass initial verification, but fails verifications performed during
boot time, secure enclave will try new images predetermined number of times
(defined in the code), before reverting back to the previous good bank.
::
@@ -803,7 +831,7 @@ Linux distros tests
Debian/OpenSUSE install and boot (applicable to FPGA only)
***************************************************************************************
To test Linux distro install and boot, the user should prepare two empty USB sticks.
To test Linux distro install and boot, the user should prepare two empty USB sticks (minimum size should be 4GB and formatted with FAT32).
Download one of following Linux distro images:
- Debian installer image: https://cdimage.debian.org/cdimage/weekly-builds/arm64/iso-dvd/
@@ -819,7 +847,7 @@ file into the first USB stick, run:
::
sudo dd if=</path/to/iso_file> of=/dev/sdb iflag=direct oflag=direct status=progress bs=1M; sync;
sudo dd if=<path-to-iso_file> of=/dev/sdb iflag=direct oflag=direct status=progress bs=1M; sync;
Boot the MSP3 board with the first USB stick connected. Open following minicom sessions:
@@ -828,9 +856,7 @@ Boot the MSP3 board with the first USB stick connected. Open following minicom s
sudo picocom -b 115200 /dev/ttyUSB0 # in one terminal
sudo picocom -b 115200 /dev/ttyUSB2 # in another terminal.
Press <Ctrl+x>.
Now plug in the second USB stick, the distro installation process will start.
Now plug in the second USB stick (once installation screen is visible), the distro installation process will start. The installation prompt can be seen in ttyUSB2. If installer does not start, please try to reboot the board with both USB sticks connected and repeat the process.
**NOTE:** Due to the performance limitation of Corstone-1000 MPS3 FPGA, the
distro installation process can take up to 24 hours to complete.
@@ -922,7 +948,7 @@ First, load FF-A TEE kernel module:
::
insmod /lib/modules/5.19.9-yocto-standard/extra/arm-ffa-tee.ko
insmod /lib/modules/5.19.14-yocto-standard/extra/arm-ffa-tee.ko
Then, check whether the FF-A TEE driver is loaded correctly by using the following command:
@@ -1034,7 +1060,7 @@ The output on the Host terminal should be:
Tests results
-----------------------------------
As a reference for the end user, reports for various tests for `Corstone-1000 software (CORSTONE1000-2022.11.10) <https://git.yoctoproject.org/meta-arm/tag/?h=CORSTONE1000-2022.11.10>`__
As a reference for the end user, reports for various tests for `Corstone-1000 software (CORSTONE1000-2022.11.23) <https://git.yoctoproject.org/meta-arm/tag/?h=CORSTONE1000-2022.11.23>`__
can be found in `here <https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-test-report/-/tree/master/embedded-a/corstone1000>`__.
Running the software on FVP on Windows
@@ -27,9 +27,9 @@ The fvp-baser-aemv8r64 Yocto MACHINE supports the following BSP components,
where either a standard or Real-Time Linux kernel (PREEMPT\_RT) can be built
and run:
- FVP_Base_AEMv8R: v11.19.14
- FVP_Base_AEMv8R: v11.20.15
- boot-wrapper-aarch64: provides PSCI support
- U-Boot: v2022.04 - provides UEFI services
- U-Boot: v2022.07 - provides UEFI services
- Linux kernel: linux-yocto-5.15
- Linux kernel with PREEMPT\_RT support: linux-yocto-rt-5.15
@@ -8,7 +8,8 @@ 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.gitlab.arm.com/arm-reference-solutions/corstone1000/external_system/rtx.git;protocol=https;branch=master"
SRC_URI = "gitsm://git.gitlab.arm.com/arm-reference-solutions/corstone1000/external_system/rtx.git;protocol=https;branch=master \
file://race.patch"
SRCREV = "8c9dca74b104ff6c9722fb0738ba93dd3719c080"
PV .= "+git${SRCPV}"
@@ -0,0 +1,66 @@
Upstream-Status: Submitted [https://gitlab.arm.com/arm-reference-solutions/corstone1000/external_system/rtx/-/issues/1]
Signed-off-by: Ross Burton <ross.burton@arm.com>
From 34e1c04534607f5605255f39fb46e26261fc9c4e Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Tue, 8 Sep 2020 11:49:08 +0100
Subject: [PATCH] tools/gen_module_code: atomically rewrite the generated files
The gen_module rule in rules.mk is marked as .PHONY, so make will
execute it whenever it is mentioned. This results in gen_module_code
being executed 64 times for a Juno build.
However in heavily parallel builds there's a good chance that
gen_module_code is writing a file whilst the compiler is reading it
because make also doesn't know what files are generated by
gen_module_code.
The correct fix is to adjust the Makefiles so that the dependencies are
correct but this isn't trivial, so band-aid the problem by atomically
writing the generated files.
Change-Id: I82d44f9ea6537a91002e1f80de8861d208571630
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
tools/gen_module_code.py | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/tools/gen_module_code.py b/tools/gen_module_code.py
index 7b3953845..ee099b713 100755
--- a/tools/gen_module_code.py
+++ b/tools/gen_module_code.py
@@ -17,6 +17,7 @@
import argparse
import os
import sys
+import tempfile
DEFAULT_PATH = 'build/'
@@ -53,13 +54,21 @@
def generate_file(path, filename, content):
full_filename = os.path.join(path, filename)
- with open(full_filename, 'a+') as f:
- f.seek(0)
- if f.read() != content:
+
+ try:
+ with open(full_filename) as f:
+ rewrite = f.read() != content
+ except FileNotFoundError:
+ rewrite = True
+
+ if rewrite:
+ with tempfile.NamedTemporaryFile(prefix="gen-module-code",
+ dir=path,
+ delete=False,
+ mode="wt") as f:
print("[GEN] {}...".format(full_filename))
- f.seek(0)
- f.truncate()
f.write(content)
+ os.replace(f.name, full_filename)
def generate_header(path, modules):
@@ -7,10 +7,15 @@ COMPATIBLE_MACHINE = "corstone1000"
inherit image
inherit wic_nopt tfm_sign_image
inherit uefi_capsule
PACKAGE_INSTALL = ""
IMAGE_FSTYPES += "wic wic.nopt"
IMAGE_FSTYPES += "wic wic.nopt uefi_capsule"
UEFI_FIRMWARE_BINARY = "${PN}-${MACHINE}.${CAPSULE_IMGTYPE}"
UEFI_CAPSULE_CONFIG = "${THISDIR}/files/${PN}-capsule-update-image.json"
CAPSULE_IMGTYPE = "wic.nopt"
do_sign_images() {
# Sign TF-A BL2
@@ -0,0 +1,11 @@
{
"Payloads": [
{
"FwVersion": "5",
"Guid": "e2bb9c06-70e9-4b14-97a3-5a7913176e3f",
"LowestSupportedVersion": "1",
"Payload": "$UEFI_FIRMWARE_BINARY",
"UpdateImageIndex": "0"
}
]
}
@@ -63,10 +63,10 @@ do_deploy() {
done
if [ "${INITRAMFS_IMAGE_BUNDLE}" -eq 1 ]; then
cp -L -f ${DEPLOY_DIR_IMAGE}/Image-initramfs-juno.bin \
cp -L -f ${DEPLOY_DIR_IMAGE}/Image.gz-initramfs-juno.bin \
${D}/${UNPACK_DIR}/SOFTWARE/Image
else
cp -L -f ${DEPLOY_DIR_IMAGE}/Image ${D}/${UNPACK_DIR}/SOFTWARE/
cp -L -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ${D}/${UNPACK_DIR}/SOFTWARE/
fi
# Compress the files
@@ -0,0 +1,41 @@
From 097a43223da4fa42335944295903ede2755e2dfd Mon Sep 17 00:00:00 2001
From: Jon Mason <jdmason@kudzu.us>
Date: Mon, 19 Dec 2022 11:36:04 -0500
Subject: [PATCH] configs: vexpress: modify to boot compressed initramfs
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Upstream-Status: Inappropriate
---
configs/vexpress_aemv8a_juno_defconfig | 1 +
include/configs/vexpress_aemv8.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/configs/vexpress_aemv8a_juno_defconfig b/configs/vexpress_aemv8a_juno_defconfig
index e02124cc7f54..6ffe8f5fe67e 100644
--- a/configs/vexpress_aemv8a_juno_defconfig
+++ b/configs/vexpress_aemv8a_juno_defconfig
@@ -16,6 +16,7 @@ CONFIG_SYS_LOAD_ADDR=0x90000000
CONFIG_BOOTDELAY=1
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=ttyAMA0,115200n8 root=/dev/sda2 rw rootwait earlycon=pl011,0x7ff80000 debug user_debug=31 androidboot.hardware=juno loglevel=9"
+CONFIG_BOOTCOMMAND="echo running default boot command; 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 ; 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; if afs load ${initrd_name} ${initrd_addr_r} ; then setenv initrd_param ${initrd_addr_r}; else setenv initrd_param -; fi ; booti ${kernel_addr_r} ${initrd_param} ${fdt_addr_r}"
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="VExpress64# "
diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
index cd7f6c1b9ba0..c2f5eb302076 100644
--- a/include/configs/vexpress_aemv8.h
+++ b/include/configs/vexpress_aemv8.h
@@ -164,6 +164,8 @@
"kernel_name=norkern\0" \
"kernel_alt_name=Image\0" \
"kernel_addr_r=0x80080000\0" \
+ "kernel_comp_addr_r=0x90000000\0" \
+ "kernel_comp_size=0x3000000\0" \
"initrd_name=ramdisk.img\0" \
"initrd_addr_r=0x88000000\0" \
"fdtfile=board.dtb\0" \
--
2.30.2
@@ -82,7 +82,9 @@ SRC_URI:append:fvp-baser-aemv8r64 = " \
#
# Juno Machines
#
SRC_URI:append:juno = " file://0001-arm-juno-add-custom-bootcmd-to-autoboot-from-uEnv.tx.patch"
SRC_URI:append:juno = " file://0001-arm-juno-add-custom-bootcmd-to-autoboot-from-uEnv.tx.patch \
file://0002-configs-vexpress-modify-to-boot-compressed-initramfs.patch \
"
#
@@ -0,0 +1,60 @@
From c4a7b9b587ca1bb4678d48d8be7132492b23a81c Mon Sep 17 00:00:00 2001
From: Cristian Marussi <cristian.marussi@arm.com>
Date: Fri, 28 Oct 2022 15:08:33 +0100
Subject: [PATCH] arm64: dts: juno: Add thermal critical trip points
When thermnal zones are defined, trip points definitions are mandatory.
Define a couple of critical trip points for monitoring of existing
PMIC and SOC thermal zones.
This was lost between txt to yaml conversion and was re-enforced recently
via the commit 8c596324232d ("dt-bindings: thermal: Fix missing required property")
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Fixes: f7b636a8d83c ("arm64: dts: juno: add thermal zones for scpi sensors")
Link: https://lore.kernel.org/r/20221028140833.280091-8-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
Upstream-Status: Backport
---
arch/arm64/boot/dts/arm/juno-base.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi
index 2f27619d8abd..8b4d280b1e7e 100644
--- a/arch/arm64/boot/dts/arm/juno-base.dtsi
+++ b/arch/arm64/boot/dts/arm/juno-base.dtsi
@@ -751,12 +751,26 @@ pmic {
polling-delay = <1000>;
polling-delay-passive = <100>;
thermal-sensors = <&scpi_sensors0 0>;
+ trips {
+ pmic_crit0: trip0 {
+ temperature = <90000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
};
soc {
polling-delay = <1000>;
polling-delay-passive = <100>;
thermal-sensors = <&scpi_sensors0 3>;
+ trips {
+ soc_crit0: trip0 {
+ temperature = <80000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
};
big_cluster_thermal_zone: big-cluster {
--
2.30.2
@@ -0,0 +1,141 @@
From 59fb813f9742b349f48250bd7793279cafe2752c Mon Sep 17 00:00:00 2001
From: Pierre Gondois <pierre.gondois@arm.com>
Date: Mon, 7 Nov 2022 16:56:58 +0100
Subject: [PATCH] arm64: dts: Update cache properties for Arm Ltd platforms
The DeviceTree Specification v0.3 specifies that the cache node
"compatible" and "cache-level" properties are required.
Cf. s3.8 Multi-level and Shared Cache Nodes
The 'cache-unified' property should be present if one of the properties
for unified cache is present ('cache-size', ...).
Update the relevant device trees nodes accordingly.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Link: https://lore.kernel.org/r/20221107155825.1644604-6-pierre.gondois@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
Upstream-Status: Backport
---
arch/arm64/boot/dts/arm/corstone1000.dtsi | 1 +
arch/arm64/boot/dts/arm/foundation-v8.dtsi | 1 +
arch/arm64/boot/dts/arm/juno-r1.dts | 2 ++
arch/arm64/boot/dts/arm/juno-r2.dts | 2 ++
arch/arm64/boot/dts/arm/juno.dts | 2 ++
arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts | 1 +
arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts | 1 +
7 files changed, 10 insertions(+)
diff --git a/arch/arm64/boot/dts/arm/corstone1000.dtsi b/arch/arm64/boot/dts/arm/corstone1000.dtsi
index 4e46826f883a..21f1f952e985 100644
--- a/arch/arm64/boot/dts/arm/corstone1000.dtsi
+++ b/arch/arm64/boot/dts/arm/corstone1000.dtsi
@@ -53,6 +53,7 @@ gic: interrupt-controller@1c000000 {
L2_0: l2-cache0 {
compatible = "cache";
+ cache-unified;
cache-level = <2>;
cache-size = <0x80000>;
cache-line-size = <64>;
diff --git a/arch/arm64/boot/dts/arm/foundation-v8.dtsi b/arch/arm64/boot/dts/arm/foundation-v8.dtsi
index 83e3e7e3984f..c8bd23b1a7ba 100644
--- a/arch/arm64/boot/dts/arm/foundation-v8.dtsi
+++ b/arch/arm64/boot/dts/arm/foundation-v8.dtsi
@@ -58,6 +58,7 @@ cpu3: cpu@3 {
L2_0: l2-cache0 {
compatible = "cache";
+ cache-level = <2>;
};
};
diff --git a/arch/arm64/boot/dts/arm/juno-r1.dts b/arch/arm64/boot/dts/arm/juno-r1.dts
index 6451c62146fd..1d90eeebb37d 100644
--- a/arch/arm64/boot/dts/arm/juno-r1.dts
+++ b/arch/arm64/boot/dts/arm/juno-r1.dts
@@ -189,6 +189,7 @@ A53_3: cpu@103 {
A57_L2: l2-cache0 {
compatible = "cache";
+ cache-unified;
cache-size = <0x200000>;
cache-line-size = <64>;
cache-sets = <2048>;
@@ -197,6 +198,7 @@ A57_L2: l2-cache0 {
A53_L2: l2-cache1 {
compatible = "cache";
+ cache-unified;
cache-size = <0x100000>;
cache-line-size = <64>;
cache-sets = <1024>;
diff --git a/arch/arm64/boot/dts/arm/juno-r2.dts b/arch/arm64/boot/dts/arm/juno-r2.dts
index 438cd1ff4bd0..d2ada69b0a43 100644
--- a/arch/arm64/boot/dts/arm/juno-r2.dts
+++ b/arch/arm64/boot/dts/arm/juno-r2.dts
@@ -195,6 +195,7 @@ A53_3: cpu@103 {
A72_L2: l2-cache0 {
compatible = "cache";
+ cache-unified;
cache-size = <0x200000>;
cache-line-size = <64>;
cache-sets = <2048>;
@@ -203,6 +204,7 @@ A72_L2: l2-cache0 {
A53_L2: l2-cache1 {
compatible = "cache";
+ cache-unified;
cache-size = <0x100000>;
cache-line-size = <64>;
cache-sets = <1024>;
diff --git a/arch/arm64/boot/dts/arm/juno.dts b/arch/arm64/boot/dts/arm/juno.dts
index cf4a58211399..5e48a01a5b9f 100644
--- a/arch/arm64/boot/dts/arm/juno.dts
+++ b/arch/arm64/boot/dts/arm/juno.dts
@@ -194,6 +194,7 @@ A53_3: cpu@103 {
A57_L2: l2-cache0 {
compatible = "cache";
+ cache-unified;
cache-size = <0x200000>;
cache-line-size = <64>;
cache-sets = <2048>;
@@ -202,6 +203,7 @@ A57_L2: l2-cache0 {
A53_L2: l2-cache1 {
compatible = "cache";
+ cache-unified;
cache-size = <0x100000>;
cache-line-size = <64>;
cache-sets = <1024>;
diff --git a/arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts b/arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts
index 258991ad7cc0..ef68f5aae7dd 100644
--- a/arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts
+++ b/arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts
@@ -71,6 +71,7 @@ cpu@3 {
L2_0: l2-cache0 {
compatible = "cache";
+ cache-level = <2>;
};
};
diff --git a/arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts b/arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts
index 5b6d9d8e934d..796cd7d02eb5 100644
--- a/arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts
+++ b/arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts
@@ -57,6 +57,7 @@ cpu@1 {
L2_0: l2-cache0 {
compatible = "cache";
+ cache-level = <2>;
};
};
--
2.30.2
@@ -0,0 +1,38 @@
From 3bd7a0219082c2c91570b81afc35f2aec57cade2 Mon Sep 17 00:00:00 2001
From: James Clark <james.clark@arm.com>
Date: Thu, 17 Nov 2022 10:25:36 +0000
Subject: [PATCH] arm64: dts: fvp: Add SPE to Foundation FVP
Add SPE DT node to FVP model. If the model doesn't support SPE (e.g.,
turned off via parameter), the driver will skip the initialisation
accordingly and thus is safe.
Signed-off-by: James Clark <james.clark@arm.com>
Link: https://lore.kernel.org/r/20221117102536.237515-1-james.clark@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
Upstream-Status: Backport
---
arch/arm64/boot/dts/arm/foundation-v8.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/boot/dts/arm/foundation-v8.dtsi b/arch/arm64/boot/dts/arm/foundation-v8.dtsi
index c8bd23b1a7ba..029578072d8f 100644
--- a/arch/arm64/boot/dts/arm/foundation-v8.dtsi
+++ b/arch/arm64/boot/dts/arm/foundation-v8.dtsi
@@ -85,6 +85,11 @@ pmu {
<GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
};
+ spe-pmu {
+ compatible = "arm,statistical-profiling-extension-v1";
+ interrupts = <GIC_PPI 5 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
watchdog@2a440000 {
compatible = "arm,sbsa-gwdt";
reg = <0x0 0x2a440000 0 0x1000>,
--
2.30.2
@@ -0,0 +1,149 @@
From b2d5025e129289d9b914c696646e64495a7453c0 Mon Sep 17 00:00:00 2001
From: Sudeep Holla <sudeep.holla@arm.com>
Date: Fri, 18 Nov 2022 15:10:17 +0000
Subject: [PATCH] arm64: dts: fvp: Add information about L1 and L2 caches
Add the information about L1 and L2 caches on FVP RevC platform.
Though the cache size is configurable through the model parameters,
having default values in the device tree helps to exercise and debug
any code utilising the cache information without the need of real
hardware.
Link: https://lore.kernel.org/r/20221118151017.704716-1-sudeep.holla@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
Upstream-Status: Backport
---
arch/arm64/boot/dts/arm/fvp-base-revc.dts | 73 +++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/arch/arm64/boot/dts/arm/fvp-base-revc.dts b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
index 5f6f30c801a7..60472d65a355 100644
--- a/arch/arm64/boot/dts/arm/fvp-base-revc.dts
+++ b/arch/arm64/boot/dts/arm/fvp-base-revc.dts
@@ -47,48 +47,121 @@ cpu0: cpu@0 {
compatible = "arm,armv8";
reg = <0x0 0x000>;
enable-method = "psci";
+ i-cache-size = <0x8000>;
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ d-cache-size = <0x8000>;
+ d-cache-line-size = <64>;
+ d-cache-sets = <256>;
+ next-level-cache = <&C0_L2>;
};
cpu1: cpu@100 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x100>;
enable-method = "psci";
+ i-cache-size = <0x8000>;
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ d-cache-size = <0x8000>;
+ d-cache-line-size = <64>;
+ d-cache-sets = <256>;
+ next-level-cache = <&C0_L2>;
};
cpu2: cpu@200 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x200>;
enable-method = "psci";
+ i-cache-size = <0x8000>;
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ d-cache-size = <0x8000>;
+ d-cache-line-size = <64>;
+ d-cache-sets = <256>;
+ next-level-cache = <&C0_L2>;
};
cpu3: cpu@300 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x300>;
enable-method = "psci";
+ i-cache-size = <0x8000>;
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ d-cache-size = <0x8000>;
+ d-cache-line-size = <64>;
+ d-cache-sets = <256>;
+ next-level-cache = <&C0_L2>;
};
cpu4: cpu@10000 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x10000>;
enable-method = "psci";
+ i-cache-size = <0x8000>;
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ d-cache-size = <0x8000>;
+ d-cache-line-size = <64>;
+ d-cache-sets = <256>;
+ next-level-cache = <&C1_L2>;
};
cpu5: cpu@10100 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x10100>;
enable-method = "psci";
+ i-cache-size = <0x8000>;
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ d-cache-size = <0x8000>;
+ d-cache-line-size = <64>;
+ d-cache-sets = <256>;
+ next-level-cache = <&C1_L2>;
};
cpu6: cpu@10200 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x10200>;
enable-method = "psci";
+ i-cache-size = <0x8000>;
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ d-cache-size = <0x8000>;
+ d-cache-line-size = <64>;
+ d-cache-sets = <256>;
+ next-level-cache = <&C1_L2>;
};
cpu7: cpu@10300 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x10300>;
enable-method = "psci";
+ i-cache-size = <0x8000>;
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ d-cache-size = <0x8000>;
+ d-cache-line-size = <64>;
+ d-cache-sets = <256>;
+ next-level-cache = <&C1_L2>;
+ };
+ C0_L2: l2-cache0 {
+ compatible = "cache";
+ cache-size = <0x80000>;
+ cache-line-size = <64>;
+ cache-sets = <512>;
+ cache-level = <2>;
+ cache-unified;
+ };
+
+ C1_L2: l2-cache1 {
+ compatible = "cache";
+ cache-size = <0x80000>;
+ cache-line-size = <64>;
+ cache-sets = <512>;
+ cache-level = <2>;
+ cache-unified;
};
};
--
2.30.2
@@ -0,0 +1,84 @@
From e15031539490733279c41ba87f4ef2b440a685f5 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date: Fri, 25 Nov 2022 15:41:12 +0100
Subject: [PATCH] ARM: dts: vexpress: align LED node names with dtschema
The node names should be generic and DT schema expects certain pattern.
vexpress-v2p-ca9.dtb: leds: 'user1', 'user2', 'user3', 'user4', 'user5', 'user6', 'user7', 'user8' do not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221125144112.476817-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
Upstream-Status: Backport
---
arch/arm/boot/dts/vexpress-v2m.dtsi | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/boot/dts/vexpress-v2m.dtsi b/arch/arm/boot/dts/vexpress-v2m.dtsi
index f434fe5cf4a1..def538ce8769 100644
--- a/arch/arm/boot/dts/vexpress-v2m.dtsi
+++ b/arch/arm/boot/dts/vexpress-v2m.dtsi
@@ -383,49 +383,49 @@ v2m_refclk32khz: refclk32khz {
leds {
compatible = "gpio-leds";
- user1 {
+ led-user1 {
label = "v2m:green:user1";
gpios = <&v2m_led_gpios 0 0>;
linux,default-trigger = "heartbeat";
};
- user2 {
+ led-user2 {
label = "v2m:green:user2";
gpios = <&v2m_led_gpios 1 0>;
linux,default-trigger = "mmc0";
};
- user3 {
+ led-user3 {
label = "v2m:green:user3";
gpios = <&v2m_led_gpios 2 0>;
linux,default-trigger = "cpu0";
};
- user4 {
+ led-user4 {
label = "v2m:green:user4";
gpios = <&v2m_led_gpios 3 0>;
linux,default-trigger = "cpu1";
};
- user5 {
+ led-user5 {
label = "v2m:green:user5";
gpios = <&v2m_led_gpios 4 0>;
linux,default-trigger = "cpu2";
};
- user6 {
+ led-user6 {
label = "v2m:green:user6";
gpios = <&v2m_led_gpios 5 0>;
linux,default-trigger = "cpu3";
};
- user7 {
+ led-user7 {
label = "v2m:green:user7";
gpios = <&v2m_led_gpios 6 0>;
linux,default-trigger = "cpu4";
};
- user8 {
+ led-user8 {
label = "v2m:green:user8";
gpios = <&v2m_led_gpios 7 0>;
linux,default-trigger = "cpu5";
--
2.30.2
@@ -100,6 +100,13 @@ COMPATIBLE_MACHINE:juno = "juno"
KBUILD_DEFCONFIG:juno = "defconfig"
KCONFIG_MODE:juno = "--alldefconfig"
FILESEXTRAPATHS:prepend:juno := "${ARMBSPFILESPATHS}"
SRC_URI:append:juno = " \
file://0001-arm64-dts-juno-Add-thermal-critical-trip-points.patch \
file://0002-arm64-dts-Update-cache-properties-for-Arm-Ltd-platfo.patch \
file://0003-arm64-dts-fvp-Add-SPE-to-Foundation-FVP.patch \
file://0004-arm64-dts-fvp-Add-information-about-L1-and-L2-caches.patch \
file://0005-ARM-dts-vexpress-align-LED-node-names-with-dtschema.patch \
"
#
# Musca B1/S2 can't run Linux
@@ -0,0 +1,52 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From 2eb1da30564428551ca687d456d848129105abac Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Tue, 25 Oct 2022 19:08:49 +0100
Subject: [PATCH] plat-n1sdp: register DRAM1 to optee-os
N1SDP supports two DRAM's. This change is to add 2nd DRAM
starting at 0x8080000000 address.
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
diff --git a/core/arch/arm/plat-n1sdp/conf.mk b/core/arch/arm/plat-n1sdp/conf.mk
index 06b4975a..5374e406 100644
--- a/core/arch/arm/plat-n1sdp/conf.mk
+++ b/core/arch/arm/plat-n1sdp/conf.mk
@@ -38,4 +38,4 @@ CFG_SHMEM_START ?= 0x83000000
CFG_SHMEM_SIZE ?= 0x00210000
# DRAM1 is defined above 4G
$(call force,CFG_CORE_LARGE_PHYS_ADDR,y)
-$(call force,CFG_CORE_ARM64_PA_BITS,36)
+$(call force,CFG_CORE_ARM64_PA_BITS,42)
diff --git a/core/arch/arm/plat-n1sdp/main.c b/core/arch/arm/plat-n1sdp/main.c
index cfb7f19b..bb951ce6 100644
--- a/core/arch/arm/plat-n1sdp/main.c
+++ b/core/arch/arm/plat-n1sdp/main.c
@@ -33,6 +33,7 @@ static struct pl011_data console_data __nex_bss;
register_phys_mem_pgdir(MEM_AREA_IO_SEC, CONSOLE_UART_BASE, PL011_REG_SIZE);
register_ddr(DRAM0_BASE, DRAM0_SIZE);
+register_ddr(DRAM1_BASE, DRAM1_SIZE);
register_phys_mem_pgdir(MEM_AREA_IO_SEC, GICD_BASE, GIC_DIST_REG_SIZE);
register_phys_mem_pgdir(MEM_AREA_IO_SEC, GICC_BASE, GIC_DIST_REG_SIZE);
diff --git a/core/arch/arm/plat-n1sdp/platform_config.h b/core/arch/arm/plat-n1sdp/platform_config.h
index 81b99409..bf0a3c83 100644
--- a/core/arch/arm/plat-n1sdp/platform_config.h
+++ b/core/arch/arm/plat-n1sdp/platform_config.h
@@ -35,6 +35,9 @@
#define DRAM0_BASE 0x80000000
#define DRAM0_SIZE 0x80000000
+#define DRAM1_BASE 0x8080000000ULL
+#define DRAM1_SIZE 0x80000000ULL
+
#define GICD_BASE 0x30000000
#define GICC_BASE 0x2C000000
#define GICR_BASE 0x300C0000
--
2.17.1
@@ -11,6 +11,7 @@ SRC_URI:append = " \
file://0002-plat-n1sdp-add-N1SDP-platform-support.patch \
file://0003-HACK-disable-instruction-cache-and-data-cache.patch \
file://0004-Handle-logging-syscall.patch \
file://0005-plat-n1sdp-register-DRAM1-to-optee-os.patch \
"
EXTRA_OEMAKE += " CFG_TEE_CORE_LOG_LEVEL=4"
@@ -0,0 +1,48 @@
# This class is to be inherited by recipes where there are patches located inside
# the fetched source code which need to be applied.
# The following variables need to be set:
# LOCAL_SRC_PATCHES_INPUT_DIR is the directory from where the patches are located
# LOCAL_SRC_PATCHES_DEST_DIR is the directory where the patches will be applied
do_patch[depends] += "quilt-native:do_populate_sysroot"
LOCAL_SRC_PATCHES_INPUT_DIR ??= ""
LOCAL_SRC_PATCHES_DEST_DIR ??= "${LOCAL_SRC_PATCHES_INPUT_DIR}"
python() {
if not d.getVar('LOCAL_SRC_PATCHES_INPUT_DIR'):
bb.warn("LOCAL_SRC_PATCHES_INPUT_DIR variable needs to be set.")
}
apply_local_src_patches() {
input_dir="${LOCAL_SRC_PATCHES_INPUT_DIR}"
dest_dir="${LOCAL_SRC_PATCHES_DEST_DIR}"
if [ ! -d "$input_dir" ] ; then
bbfatal "LOCAL_SRC_PATCHES_INPUT_DIR=$input_dir not found."
fi
if [ ! -d "$dest_dir" ] ; then
bbfatal "LOCAL_SRC_PATCHES_DEST_DIR=$dest_dir not found."
fi
cd $dest_dir
export QUILT_PATCHES=./patches-extra
mkdir -p patches-extra
for patch in $(find $input_dir -type f -name *.patch -or -name *.diff | sort)
do
patch_basename=`basename $patch`
if ! quilt applied $patch_basename >/dev/null ; then
bbdebug 1 "Applying $patch_basename in $dest_dir."
echo $patch_basename >> patches-extra/series
cp $patch patches-extra
quilt push $patch_basename
else
bbdebug 1 "$patch_basename already applied."
fi
done
}
do_patch[postfuncs] += "apply_local_src_patches"
+6 -2
View File
@@ -24,7 +24,10 @@ FVP_CONSOLES[default] ?= "${FVP_CONSOLE}"
# Arbitrary extra arguments
FVP_EXTRA_ARGS ?= ""
# Bitbake variables to pass to the FVP environment
FVP_ENV_PASSTHROUGH ?= ""
FVP_ENV_PASSTHROUGH ?= "FASTSIM_DISABLE_TA ARMLMD_LICENSE_FILE"
FVP_ENV_PASSTHROUGH[vardeps] = "${FVP_ENV_PASSTHROUGH}"
# Disable timing annotation by default
FASTSIM_DISABLE_TA ?= "1"
EXTRA_IMAGEDEPENDS += "${FVP_PROVIDER}"
@@ -70,7 +73,8 @@ python do_write_fvpboot_conf() {
data["env"] = {}
for var in d.getVar("FVP_ENV_PASSTHROUGH").split():
data["env"][var] = d.getVar(var)
if d.getVar(var) is not None:
data["env"][var] = d.getVar(var)
os.makedirs(os.path.dirname(conffile), exist_ok=True)
with open(conffile, "wt") as f:
+55
View File
@@ -0,0 +1,55 @@
# This class generates UEFI capsules
# The current class supports generating a capsule with single firmware binary
DEPENDS += "gettext-native"
inherit python3native
IMAGE_TYPES += "uefi_capsule"
# edk2 base tools should be installed in the native sysroot directory
do_image_uefi_capsule[depends] += "edk2-basetools-native:do_populate_sysroot"
# By default the wic image is used to create a capsule
CAPSULE_IMGTYPE ?= "wic"
# IMGDEPLOYDIR is used as the default location of firmware binary for which the capsule needs to be created
CAPSULE_IMGLOCATION ?= "${IMGDEPLOYDIR}"
# The generated capsule by default has uefi.capsule extension
CAPSULE_EXTENSION ?= "uefi.capsule"
# The following variables must be set to be able to generate a capsule update
UEFI_FIRMWARE_BINARY ?= ""
UEFI_CAPSULE_CONFIG ?= ""
# Check if the required variables are set
python() {
for var in ["UEFI_FIRMWARE_BINARY", "UEFI_CAPSULE_CONFIG"]:
if not d.getVar(var):
raise bb.parse.SkipRecipe(f"{var} not set")
}
IMAGE_CMD:uefi_capsule(){
# Force the GenerateCapsule script to use python3
export PYTHON_COMMAND=${PYTHON}
# Copy the firmware and the capsule config json to current directory
if [ -e ${CAPSULE_IMGLOCATION}/${UEFI_FIRMWARE_BINARY} ]; then
cp ${CAPSULE_IMGLOCATION}/${UEFI_FIRMWARE_BINARY} . ;
fi
export UEFI_FIRMWARE_BINARY=${UEFI_FIRMWARE_BINARY}
envsubst < ${UEFI_CAPSULE_CONFIG} > ./${MACHINE}-capsule-update-image.json
${STAGING_DIR_NATIVE}/usr/bin/edk2-BaseTools/BinWrappers/PosixLike/GenerateCapsule \
-e -o ${IMGDEPLOYDIR}/${UEFI_FIRMWARE_BINARY}.${CAPSULE_EXTENSION} -j \
${MACHINE}-capsule-update-image.json
# Remove the firmware to avoid contamination of IMGDEPLOYDIR
rm ${UEFI_FIRMWARE_BINARY}
}
# The firmware binary should be created before generating the capsule
IMAGE_TYPEDEP:uefi_capsule:append = "${CAPSULE_IMGTYPE}"
+53 -46
View File
@@ -1,7 +1,7 @@
import asyncio
import re
import subprocess
import os
import shlex
import shutil
import sys
@@ -44,50 +44,70 @@ def check_telnet():
if not bool(shutil.which("telnet")):
raise RuntimeError("Cannot find telnet, this is needed to connect to the FVP.")
class ConsolePortParser:
def __init__(self, lines):
self._lines = lines
self._console_ports = {}
def parse_port(self, console):
if console in self._console_ports:
return self._console_ports[console]
while True:
try:
line = next(self._lines).strip().decode(errors='ignore')
m = re.match(r"^(\S+): Listening for serial connection on port (\d+)$", line)
if m:
matched_console = m.group(1)
matched_port = int(m.group(2))
if matched_console == console:
return matched_port
else:
self._console_ports[matched_console] = matched_port
except StopIteration:
# self._lines might be a growing log file
pass
# This function is backported from Python 3.8. Remove it and replace call sites
# with shlex.join once OE-core support for earlier Python versions is dropped.
def shlex_join(split_command):
"""Return a shell-escaped string from *split_command*."""
return ' '.join(shlex.quote(arg) for arg in split_command)
class FVPRunner:
def __init__(self, logger):
self._terminal_ports = {}
self._line_callbacks = []
self._logger = logger
self._fvp_process = None
self._telnets = []
self._pexpects = []
def add_line_callback(self, callback):
self._line_callbacks.append(callback)
async def start(self, config, extra_args=[], terminal_choice="none"):
def start(self, config, extra_args=[], terminal_choice="none", stdout=subprocess.PIPE):
cli = cli_from_config(config, terminal_choice)
cli += extra_args
# Pass through environment variables needed for GUI applications, such
# as xterm, to work.
env = config['env']
for name in ('DISPLAY', 'WAYLAND_DISPLAY'):
for name in ('DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY'):
if name in os.environ:
env[name] = os.environ[name]
self._logger.debug(f"Constructed FVP call: {cli}")
self._fvp_process = await asyncio.create_subprocess_exec(
*cli,
stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
self._logger.debug(f"Constructed FVP call: {shlex_join(cli)}")
self._fvp_process = subprocess.Popen(
cli,
stdin=subprocess.DEVNULL, stdout=stdout, stderr=subprocess.STDOUT,
env=env)
def detect_terminals(line):
m = re.match(r"^(\S+): Listening for serial connection on port (\d+)$", line)
if m:
terminal = m.group(1)
port = int(m.group(2))
self._terminal_ports[terminal] = port
self.add_line_callback(detect_terminals)
async def stop(self):
def stop(self):
if self._fvp_process:
self._logger.debug(f"Terminating FVP PID {self._fvp_process.pid}")
try:
self._fvp_process.terminate()
await asyncio.wait_for(self._fvp_process.wait(), 10.0)
except asyncio.TimeoutError:
self._fvp_process.wait(10.0)
except subprocess.TimeoutExpired:
self._logger.debug(f"Killing FVP PID {self._fvp_process.pid}")
self._fvp_process.kill()
except ProcessLookupError:
@@ -96,8 +116,8 @@ class FVPRunner:
for telnet in self._telnets:
try:
telnet.terminate()
await asyncio.wait_for(telnet.wait(), 10.0)
except asyncio.TimeoutError:
telnet.wait(10.0)
except subprocess.TimeoutExpired:
telnet.kill()
except ProcessLookupError:
pass
@@ -117,34 +137,21 @@ class FVPRunner:
else:
return 0
async def run(self, until=None):
if until and until():
return
def wait(self, timeout):
self._fvp_process.wait(timeout)
async for line in self._fvp_process.stdout:
line = line.strip().decode("utf-8", errors="replace")
for callback in self._line_callbacks:
callback(line)
if until and until():
return
@property
def stdout(self):
return self._fvp_process.stdout
async def _get_terminal_port(self, terminal, timeout):
def terminal_exists():
return terminal in self._terminal_ports
await asyncio.wait_for(self.run(terminal_exists), timeout)
return self._terminal_ports[terminal]
async def create_telnet(self, terminal, timeout=15.0):
def create_telnet(self, port):
check_telnet()
port = await self._get_terminal_port(terminal, timeout)
telnet = await asyncio.create_subprocess_exec("telnet", "localhost", str(port), stdin=sys.stdin, stdout=sys.stdout)
telnet = subprocess.Popen(["telnet", "localhost", str(port)], stdin=sys.stdin, stdout=sys.stdout)
self._telnets.append(telnet)
return telnet
async def create_pexpect(self, terminal, timeout=15.0, **kwargs):
check_telnet()
def create_pexpect(self, port, **kwargs):
import pexpect
port = await self._get_terminal_port(terminal, timeout)
instance = pexpect.spawn(f"telnet localhost {port}", **kwargs)
self._pexpects.append(instance)
return instance
+58 -67
View File
@@ -1,4 +1,3 @@
import asyncio
import pathlib
import pexpect
import os
@@ -13,7 +12,7 @@ class OEFVPSSHTarget(OESSHTarget):
Contains common logic to start and stop an FVP.
"""
def __init__(self, logger, target_ip, server_ip, timeout=300, user='root',
port=None, dir_image=None, rootfs=None, **kwargs):
port=None, dir_image=None, rootfs=None, bootlog=None, **kwargs):
super().__init__(logger, target_ip, server_ip, timeout, user, port)
image_dir = pathlib.Path(dir_image)
# rootfs may have multiple extensions so we need to strip *all* suffixes
@@ -21,36 +20,40 @@ class OEFVPSSHTarget(OESSHTarget):
basename = basename.name.replace("".join(basename.suffixes), "")
self.fvpconf = image_dir / (basename + ".fvpconf")
self.config = conffile.load(self.fvpconf)
self.bootlog = bootlog
if not self.fvpconf.exists():
raise FileNotFoundError(f"Cannot find {self.fvpconf}")
async def boot_fvp(self):
self.fvp = runner.FVPRunner(self.logger)
await self.fvp.start(self.config)
self.logger.debug(f"Started FVP PID {self.fvp.pid()}")
await self._after_start()
async def _after_start(self):
def _after_start(self):
pass
async def _after_stop(self):
pass
async def stop_fvp(self):
returncode = await self.fvp.stop()
await self._after_stop()
self.logger.debug(f"Stopped FVP with return code {returncode}")
def start(self, **kwargs):
# When we can assume Py3.7+, this can simply be asyncio.run()
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.gather(self.boot_fvp()))
self.fvp_log = self._create_logfile("fvp")
self.fvp = runner.FVPRunner(self.logger)
self.fvp.start(self.config, stdout=self.fvp_log)
self.logger.debug(f"Started FVP PID {self.fvp.pid()}")
self._after_start()
def stop(self, **kwargs):
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.gather(self.stop_fvp()))
returncode = self.fvp.stop()
self.logger.debug(f"Stopped FVP with return code {returncode}")
def _create_logfile(self, name):
if not self.bootlog:
return None
test_log_path = pathlib.Path(self.bootlog).parent
test_log_suffix = pathlib.Path(self.bootlog).suffix
fvp_log_file = f"{name}_log{test_log_suffix}"
fvp_log_path = pathlib.Path(test_log_path, fvp_log_file)
fvp_log_symlink = pathlib.Path(test_log_path, f"{name}_log")
try:
os.remove(fvp_log_symlink)
except:
pass
os.symlink(fvp_log_file, fvp_log_symlink)
return open(fvp_log_path, 'wb')
class OEFVPTarget(OEFVPSSHTarget):
@@ -59,31 +62,34 @@ class OEFVPTarget(OEFVPSSHTarget):
waits for a Linux shell before returning to ensure that SSH commands work
with the default test dependencies.
"""
def __init__(self, logger, target_ip, server_ip, bootlog=None, **kwargs):
def __init__(self, logger, target_ip, server_ip, **kwargs):
super().__init__(logger, target_ip, server_ip, **kwargs)
self.logfile = bootlog and open(bootlog, "wb") or None
self.logfile = self.bootlog and open(self.bootlog, "wb") or None
# FVPs boot slowly, so allow ten minutes
self.boot_timeout = 10 * 60
async def _after_start(self):
self.logger.debug(f"Awaiting console on terminal {self.config['consoles']['default']}")
console = await self.fvp.create_pexpect(self.config['consoles']['default'])
try:
console.expect("login\\:", timeout=self.boot_timeout)
self.logger.debug("Found login prompt")
except pexpect.TIMEOUT:
self.logger.info("Timed out waiting for login prompt.")
self.logger.info("Boot log follows:")
self.logger.info(b"\n".join(console.before.splitlines()[-200:]).decode("utf-8", errors="replace"))
raise RuntimeError("Failed to start FVP.")
def _after_start(self):
with open(self.fvp_log.name, 'rb') as logfile:
parser = runner.ConsolePortParser(logfile)
self.logger.debug(f"Awaiting console on terminal {self.config['consoles']['default']}")
port = parser.parse_port(self.config['consoles']['default'])
console = self.fvp.create_pexpect(port)
try:
console.expect("login\\:", timeout=self.boot_timeout)
self.logger.debug("Found login prompt")
except pexpect.TIMEOUT:
self.logger.info("Timed out waiting for login prompt.")
self.logger.info("Boot log follows:")
self.logger.info(b"\n".join(console.before.splitlines()[-200:]).decode("utf-8", errors="replace"))
raise RuntimeError("Failed to start FVP.")
class OEFVPSerialTarget(OEFVPSSHTarget):
"""
This target is intended for interaction with the target over one or more
telnet consoles using pexpect.
This still depends on OEFVPSSHTarget so SSH commands can still be run on
the target, but note that this class does not inherently guarantee that
the SSH server is running prior to running test cases. Test cases that use
@@ -92,40 +98,25 @@ class OEFVPSerialTarget(OEFVPSSHTarget):
"""
DEFAULT_CONSOLE = "default"
def __init__(self, logger, target_ip, server_ip, bootlog=None, **kwargs):
def __init__(self, logger, target_ip, server_ip, **kwargs):
super().__init__(logger, target_ip, server_ip, **kwargs)
self.terminals = {}
self.test_log_path = pathlib.Path(bootlog).parent
self.test_log_suffix = pathlib.Path(bootlog).suffix
self.bootlog = bootlog
def _after_start(self):
with open(self.fvp_log.name, 'rb') as logfile:
parser = runner.ConsolePortParser(logfile)
for name, console in self.config["consoles"].items():
logfile = self._create_logfile(name)
self.logger.info(f'Creating terminal {name} on {console}')
port = parser.parse_port(console)
self.terminals[name] = \
self.fvp.create_pexpect(port, logfile=logfile)
async def _add_terminal(self, name, fvp_name):
logfile = self._create_logfile(name)
self.logger.info(f'Creating terminal {name} on {fvp_name}')
self.terminals[name] = \
await self.fvp.create_pexpect(fvp_name, logfile=logfile)
def _create_logfile(self, name):
fvp_log_file = f"{name}_log{self.test_log_suffix}"
fvp_log_path = pathlib.Path(self.test_log_path, fvp_log_file)
fvp_log_symlink = pathlib.Path(self.test_log_path, f"{name}_log")
try:
os.remove(fvp_log_symlink)
except:
pass
os.symlink(fvp_log_file, fvp_log_symlink)
return open(fvp_log_path, 'wb')
async def _after_start(self):
for name, console in self.config["consoles"].items():
await self._add_terminal(name, console)
# testimage.bbclass expects to see a log file at `bootlog`,
# so make a symlink to the 'default' log file
if name == 'default':
default_test_file = f"{name}_log{self.test_log_suffix}"
os.symlink(default_test_file, self.bootlog)
# testimage.bbclass expects to see a log file at `bootlog`,
# so make a symlink to the 'default' log file
if name == 'default':
default_test_file = f"{name}_log{self.test_log_suffix}"
os.symlink(default_test_file, self.bootlog)
def _get_terminal(self, name):
return self.terminals[name]
+8 -8
View File
@@ -81,13 +81,13 @@ class ConfFileTests(OESelftestTestCase):
class RunnerTests(OESelftestTestCase):
def create_mock(self):
return unittest.mock.patch("asyncio.create_subprocess_exec")
return unittest.mock.patch("subprocess.Popen")
def test_start(self):
from fvp import runner
with self.create_mock() as m:
fvp = runner.FVPRunner(self.logger)
asyncio.run(fvp.start({
fvp.start({
"fvp-bindir": "/usr/bin",
"exe": "FVP_Binary",
"parameters": {'foo': 'bar'},
@@ -96,13 +96,13 @@ class RunnerTests(OESelftestTestCase):
"terminals": {},
"args": ['--extra-arg'],
"env": {"FOO": "BAR"}
}))
})
m.assert_called_once_with('/usr/bin/FVP_Binary',
m.assert_called_once_with(['/usr/bin/FVP_Binary',
'--parameter', 'foo=bar',
'--data', 'data1',
'--application', 'a1=file',
'--extra-arg',
'--extra-arg'],
stdin=unittest.mock.ANY,
stdout=unittest.mock.ANY,
stderr=unittest.mock.ANY,
@@ -113,7 +113,7 @@ class RunnerTests(OESelftestTestCase):
from fvp import runner
with self.create_mock() as m:
fvp = runner.FVPRunner(self.logger)
asyncio.run(fvp.start({
fvp.start({
"fvp-bindir": "/usr/bin",
"exe": "FVP_Binary",
"parameters": {},
@@ -122,9 +122,9 @@ class RunnerTests(OESelftestTestCase):
"terminals": {},
"args": [],
"env": {"FOO": "BAR"}
}))
})
m.assert_called_once_with('/usr/bin/FVP_Binary',
m.assert_called_once_with(['/usr/bin/FVP_Binary'],
stdin=unittest.mock.ANY,
stdout=unittest.mock.ANY,
stderr=unittest.mock.ANY,
@@ -27,7 +27,7 @@ DEPENDS = "virtual/arm-none-eabi-gcc-native \
# For now we only build with GCC, so stop meta-clang trying to get involved
TOOLCHAIN = "gcc"
SCP_BUILD_STR = "${@bb.utils.contains('SCP_BUILD_RELEASE', '1', 'release', 'debug', d)}"
SCP_BUILD_STR = "${@bb.utils.contains('SCP_BUILD_RELEASE', '1', 'Release', 'Debug', d)}"
inherit deploy
@@ -46,6 +46,7 @@ CFLAGS[unexport] = "1"
EXTRA_OECMAKE = "-D CMAKE_BUILD_TYPE=${SCP_BUILD_STR} \
-D SCP_LOG_LEVEL=${SCP_LOG_LEVEL} \
-D SCP_PLATFORM_FEATURE_SET=${SCP_PLATFORM_FEATURE_SET} \
-D DISABLE_CPPCHECK=1 \
"
do_configure() {
@@ -16,20 +16,19 @@ LIC_FILES_CHKSUM = "file://license.rst;md5=07f368487da347f3c7bd0fc3085f3afa \
file://../mcuboot/LICENSE;md5=b6ee33f1d12a5e6ee3de1e82fb51eeb8"
SRC_URI = "git://git.trustedfirmware.org/TF-M/trusted-firmware-m.git;protocol=https;branch=${SRCBRANCH_tfm};name=tfm;destsuffix=git/tfm \
git://git.trustedfirmware.org/TF-M/tf-m-tests.git;protocol=https;branch=${SRCBRANCH_tfm-tests};name=tfm-tests;destsuffix=git/tf-m-tests \
git://git.trustedfirmware.org/TF-M/tf-m-tests.git;protocol=https;nobranch=1;name=tfm-tests;destsuffix=git/tf-m-tests \
git://github.com/ARMmbed/mbedtls.git;protocol=https;branch=${SRCBRANCH_mbedtls};name=mbedtls;destsuffix=git/mbedtls \
git://github.com/mcu-tools/mcuboot.git;protocol=https;branch=${SRCBRANCH_mcuboot};name=mcuboot;destsuffix=git/mcuboot \
"
# The required dependencies are documented in tf-m/config/config_default.cmake
# TF-Mv1.6.0
SRCBRANCH_tfm ?= "release/1.6.x"
SRCBRANCH_tfm ?= "master"
SRCREV_tfm = "7387d88158701a3c51ad51c90a05326ee12847a8"
# mbedtls-3.1.0
SRCBRANCH_mbedtls ?= "master"
SRCREV_mbedtls = "d65aeb37349ad1a50e0f6c9b694d4b5290d60e49"
# TF-Mv1.6.0
SRCBRANCH_tfm-tests ?= "release/1.6.x"
SRCREV_tfm-tests = "723905d46019596f3f2df66d79b5d6bff6f3f213"
# v1.9.0
SRCBRANCH_mcuboot ?= "main"
@@ -108,10 +107,9 @@ export OPENSSL_MODULES="${STAGING_LIBDIR_NATIVE}/ossl-modules"
# TF-M ships patches that it needs applied to mbedcrypto, so apply them
# as part of do_patch.
apply_local_patches() {
cat ${S}/lib/ext/mbedcrypto/*.patch | patch -p1 -d ${S}/../mbedtls
}
do_patch[postfuncs] += "apply_local_patches"
LOCAL_SRC_PATCHES_INPUT_DIR = "${S}/lib/ext/mbedcrypto"
LOCAL_SRC_PATCHES_DEST_DIR = "${S}/../mbedtls"
inherit apply_local_src_patches
do_configure[cleandirs] = "${B}"
do_configure() {
@@ -0,0 +1,24 @@
# Install EDK2 Base Tools in native sysroot. Currently the BaseTools are not
# built, they are just copied to native sysroot. This is sufficient for
# generating UEFI capsules as it only depends on some python scripts. Other
# tools need to be built first before adding to sysroot.
SUMMARY = "EDK2 Base Tools"
LICENSE = "BSD-2-Clause-Patent"
# EDK2
SRC_URI = "git://github.com/tianocore/edk2.git;branch=master;protocol=https"
LIC_FILES_CHKSUM = "file://License.txt;md5=2b415520383f7964e96700ae12b4570a"
SRCREV = "fff6d81270b57ee786ea18ad74f43149b9f03494"
S = "${WORKDIR}/git"
inherit native
RDEPENDS:${PN} += "python3-core"
do_install () {
mkdir -p ${D}${bindir}/edk2-BaseTools
cp -r ${WORKDIR}/git/BaseTools/* ${D}${bindir}/edk2-BaseTools/
}
@@ -5,6 +5,6 @@ LIC_FILES_CHKSUM = "file://license_terms/license_agreement.txt;md5=1a33828e132ba
file://license_terms/third_party_licenses/third_party_licenses.txt;md5=34a1ba318d745f05e6197def68ea5411 \
file://license_terms/third_party_licenses/arm_license_management_utilities/third_party_licenses.txt;md5=2e53bda6ff2db4c35d69944b93926c9f"
SRC_URI[sha256sum] = "788ede659414af36a2d09489e400c4d822c859b726565f1f171bc3102a9413d0"
SRC_URI[sha256sum] = "c252616489b79fffa3bb721255b1c99ff4ee8c38e4beebce4fa05862a3195fe9"
MODEL_CODE = "FVP_Base_AEMv8R"
@@ -2,10 +2,10 @@ require fvp-ecosystem.inc
MODEL = "Corstone-1000-23"
MODEL_CODE = "FVP_Corstone_1000"
PV = "11.17_23"
PV = "11.19_21"
SRC_URI = "https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/${MODEL}/Linux/${MODEL_CODE}_${PV}.tgz;subdir=${BP}"
SRC_URI[sha256sum] = "00ccb72d02c90e2424d24a625d275cabf8ea8dc024713985208f618bb88d1934"
SRC_URI = "https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/${MODEL}/Linux/${MODEL_CODE}_${PV}_${FVP_ARCH}.tgz;subdir=${BP}"
SRC_URI[sha256sum] = "dbdcb8b0c206fd56fd2296fe338a62902eb978883ba07f4da28440e180383b24"
LIC_FILES_CHKSUM = "file://license_terms/license_agreement.txt;md5=1a33828e132ba71861c11688dbb0bd16 \
file://license_terms/third_party_licenses.txt;md5=41029e71051b1c786bae3112a29905a7"
file://license_terms/third_party_licenses/third_party_licenses.txt;md5=34a1ba318d745f05e6197def68ea5411"
@@ -1,7 +1,7 @@
SRC_URI = "git://git.trustedfirmware.org/TF-M/trusted-firmware-m.git;protocol=https;branch=${SRCBRANCH}"
# Use the wrapper script from TF-Mv1.6.0
SRCBRANCH ?= "release/1.6.x"
SRCBRANCH ?= "master"
SRCREV = "7387d88158701a3c51ad51c90a05326ee12847a8"
LICENSE = "BSD-3-Clause"
@@ -24,11 +24,14 @@ do_install:append () {
fi
# Move the dynamic libraries into the standard place.
# Update a cmake file to use correct paths.
install -d ${D}${libdir}
mv ${D}${TS_INSTALL}/lib/libts* ${D}${libdir}
sed -i -e "s#/${TS_ENV}##g" ${D}${TS_INSTALL}/lib/cmake/libts/libtsTargets-noconfig.cmake
# Update generated cmake file to use correct paths.
target_cmake=$(find ${D}${TS_INSTALL}/lib/cmake/libts -type f -iname "libtsTargets-*.cmake")
if [ ! -z "$target_cmake" ]; then
sed -i -e "s#/${TS_ENV}##g" $target_cmake
fi
}
inherit ${@oe.utils.conditional('VIRTUAL-RUNTIME_dev_manager', 'busybox-mdev', '', 'useradd', d)}
+1 -76
View File
@@ -1,76 +1 @@
# meta-atp layer
The meta-atp layer supports building environments with traffic generation capabilities based on [AMBA Adaptive Traffic Profiles (ATP)](https://developer.arm.com/documentation/ihi0082/latest).
## Recipes
The meta-atp layer supports building the following software components:
- Arm's implementation of the AMBA ATP specification, namely the [AMBA ATP Engine](https://github.com/ARM-software/ATP-Engine).
- Linux kernel modules and user API (UAPI) for programming ATP devices.
- Integration test suite for verification of kernel modules and UAPI.
It is also possible to build the AMBA ATP Engine as part of the final [gem5](https://www.gem5.org/) executable. For this, meta-atp extends the `gem5-aarch64-native` recipe to add the AMBA ATP engine code as extra sources.
## Machines
The `gem5-atp-arm64` machine extends the `gem5-arm64` machine to instantiate a simulated platform with support for programmable AMBA ATP traffic generation. The platform includes the following models:
- `ProfileGen` model. This is the adapter layer between gem5 and the AMBA ATP Engine. It is the source of traffic into the gem5 host platform.
- `ATPDevice` model. Software can program it using the Linux kernel modules and UAPI to control traffic generation.
## Usage
Users should add the meta-atp layer and layer dependencies to `conf/bblayers.conf`. See `conf/layer.conf` for dependencies.
### Standalone Engine executable
Users can build the AMBA ATP Engine as a standalone native executable as follows:
```bash
bitbake atp-native
```
Users can run the executable through standard build scripts:
```bash
oe-run-native atp-native atpeng [--help | args...]
```
## Integration of the Engine in gem5
Users should select the `gem5-atp-arm64` platform in their `conf/local.conf` file.
Users can build the target image of preference, for example:
```bash
bitbake core-image-minimal
```
The resulting gem5 native executable contains the AMBA ATP Engine. The resulting target image contains the kernel modules, UAPI and test suite.
Users should run the environment as follows:
```bash
./tmp/deploy/tools/start-gem5-atp.sh
```
This script launches a fast simulation to fast-forward Linux boot. Once Linux boot is completed, the fast simulation switches into a detailed simulation for the final usable environment. Users can connect and interact with the environment as follows:
```bash
oe-run-native gem5-m5term-native m5term <PORT>
```
The connection PORT is announced by the deploy script as:
```bash
system.terminal: Listening for connections on port <PORT>
```
This is usually port 3456.
Users can verify access to the ATP device by running the integration test suite from within the simulated environment as follows:
```bash
test_atp.out
```
See ../README.md
+6 -2
View File
@@ -5,7 +5,11 @@ MACHINEOVERRIDES =. "gem5-arm64:"
GEM5_RUN_PROFILE = "configs/baremetal_atp.py"
# Require m5term
EXTRA_IMAGEDEPENDS += "gem5-m5term-native"
# Require ATP kernel modules, user API and gem5 m5ops
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-atp atp-uapi gem5-m5ops"
# Require ATP kernel modules, user API and gem5 m5readfile
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-atp atp-uapi gem5-m5readfile"
# Optionally provide ATP kernel tests
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "atp-test"
# Use ATP Engine gem5 models in gem5 build
DEPENDS:append:pn-gem5-aarch64-native = " atp-gem5-native"
GEM5_EXTRAS:pn-gem5-aarch64-native = "${STAGING_DATADIR_NATIVE}/atp"
+13
View File
@@ -0,0 +1,13 @@
# Standalone ATP Engine executable
Users can build the AMBA ATP Engine as a standalone native executable as follows:
```bash
bitbake atp-native
```
Users can run the executable through standard build scripts:
```bash
oe-run-native atp-native atpeng [--help | args...]
```
+37
View File
@@ -0,0 +1,37 @@
## ATP Engine integration in gem5, and the gem5-atp-arm64 machine
Users should select the `gem5-atp-arm64` machine in their `conf/local.conf` file.
Users can build the target image of preference, for example:
```bash
bitbake core-image-minimal
```
The resulting gem5 native executable contains the AMBA ATP Engine. The resulting target image contains the kernel modules, UAPI and test suite.
Users should run the environment as follows:
```bash
oe-run-native atp-gem5-native start-gem5-atp.sh
```
This script launches a fast simulation to fast-forward Linux boot. Once Linux boot is completed, the fast simulation switches into a detailed simulation for the final usable environment. Users can connect and interact with the environment as follows:
```bash
oe-run-native gem5-m5term-native m5term <PORT>
```
The connection PORT is announced by the deploy script as:
```bash
system.terminal: Listening for connections on port <PORT>
```
This is usually port 3456.
Users can verify access to the ATP device by running the integration test suite from within the simulated environment as follows:
```bash
test_atp.out
```
+11
View File
@@ -0,0 +1,11 @@
# meta-atp summary
The meta-atp layer supports building the following software components:
- Arm's implementation of the AMBA ATP specification, namely the [AMBA ATP Engine](https://github.com/ARM-software/ATP-Engine).
- Linux kernel modules and user API (UAPI) for programming ATP devices.
- Integration test suite for verification of kernel modules and UAPI.
It is also possible to build the AMBA ATP Engine as part of the final [gem5](https://www.gem5.org/) executable. For this, meta-atp extends the `gem5-aarch64-native` recipe to add the AMBA ATP engine code as extra sources.
Users should add the meta-atp layer and layer dependencies to `conf/bblayers.conf`. See `conf/layer.conf` for dependencies.
@@ -0,0 +1,24 @@
require atp-source_3.1.inc
inherit native
SUMMARY = "AMBA ATP Engine gem5 models"
S = "${WORKDIR}/git"
SRC_URI = "${ATP_SRC} file://start-gem5-atp.sh"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install() {
install -d ${D}${datadir}/gem5/configs ${D}${datadir}/atp ${D}${bindir}
# baremetal_atp.py machine configuration and sample stream.atp file
install ${S}/gem5/baremetal_atp.py ${S}/configs/stream.atp ${D}${datadir}/gem5/configs
# ATP Engine sources for gem5 to use
install ${S}/SConscript ${S}/*.hh ${S}/*.cc ${D}${datadir}/atp
cp -RL ${S}/gem5 ${S}/proto ${D}${datadir}/atp
install ${WORKDIR}/start-gem5-atp.sh ${D}${bindir}
}
addtask addto_recipe_sysroot after do_populate_sysroot before do_build
@@ -1,3 +1,5 @@
# Export datadir paths for baremetal_atp.py script
export GEM5_DATADIR = "${STAGING_DATADIR_NATIVE}/gem5"
export ATP_DATADIR = "${STAGING_DATADIR_NATIVE}/gem5"
do_compile:prepend:gem5-atp-arm64() {
# Export datadir paths for baremetal_atp.py script
export GEM5_DATADIR="${STAGING_DATADIR_NATIVE}/gem5"
export ATP_DATADIR="${STAGING_DATADIR_NATIVE}/gem5"
}
@@ -1,24 +0,0 @@
require recipes-devtools/atp/atp-source_3.1.inc
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
SRC_URI += "${ATP_SRC};destsuffix=git/atp;name=atp \
file://start-gem5-atp.sh"
SRCREV_FORMAT = "gem5_atp"
SRCREV_atp = "${ATP_REV}"
LICENSE += "& ${ATP_LIC}"
LIC_FILES_CHKSUM += "file://atp/LICENSE;md5=${ATP_LIC_MD5}"
EXTRA_OESCONS += "EXTRAS=${S}/atp"
do_install:append() {
# baremetal_atp.py machine configuration and sample stream.atp file
install -m 644 ${B}/atp/gem5/baremetal_atp.py \
${B}/atp/configs/stream.atp \
${D}${datadir}/gem5/configs
}
do_deploy:append() {
# start-gem5-atp.sh launch script
install -m 755 ${WORKDIR}/start-gem5-atp.sh ${DEPLOYDIR}
}
@@ -1,14 +0,0 @@
inherit update-rc.d
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
# Add startup script calling m5 readfile for automatic checkpoint and restore
SRC_URI += "file://m5-readfile.sh"
INITSCRIPT_NAME = "m5-readfile.sh"
INITSCRIPT_PARAMS = "defaults 99"
do_install:append() {
install -d ${D}/${INIT_D_DIR}
install -m 755 ${WORKDIR}/m5-readfile.sh ${D}/${INIT_D_DIR}
}
@@ -1,3 +1,4 @@
COMPATIBLE_MACHINE = "gem5-atp-arm64"
require recipes-devtools/atp/atp-source_3.1.inc
inherit module
@@ -1,3 +1,4 @@
COMPATIBLE_MACHINE = "gem5-atp-arm64"
require recipes-devtools/atp/atp-source_3.1.inc
SUMMARY = "End-to-end tests evaluating ATP kernel modules service correctness"
@@ -1,3 +1,4 @@
COMPATIBLE_MACHINE = "gem5-atp-arm64"
require recipes-devtools/atp/atp-source_3.1.inc
SUMMARY = "User API for accessing services from ATP kernel modules"
@@ -1,2 +1,2 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://no_ftrace.cfg file://smmuv3.cfg"
FILESEXTRAPATHS:prepend:gem5-atp-arm64 := "${THISDIR}/files:"
SRC_URI:append:gem5-atp-arm64 = " file://no_ftrace.cfg file://smmuv3.cfg"
@@ -0,0 +1,17 @@
inherit update-rc.d
SUMMARY = "Enables reading any script at simulation launch time"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9"
SRC_URI = "file://m5-readfile.sh"
INITSCRIPT_NAME = "m5-readfile.sh"
INITSCRIPT_PARAMS = "defaults 99"
do_install() {
install -d ${D}/${INIT_D_DIR}
install -m 755 ${WORKDIR}/m5-readfile.sh ${D}/${INIT_D_DIR}
}
RDEPENDS:${PN} = "gem5-m5ops"
@@ -3,7 +3,7 @@
# Provides: m5-readfile
# Required-Start: $all
# Default-Start: 5
# Description: Enables reading any script at simulation launch time.
# Description: Enables reading any script at simulation launch time.
### END INIT INFO
m5 readfile | sh
@@ -12,10 +12,15 @@ GEM5_BUILD_VARIANT ?= "opt"
# What gem5 binary are we building
GEM5_BUILD_CONFIGS ?= "build/X86/gem5.{GEM5_BUILD_VARIANT}"
# Extra directories with sources for gem5 build. Intended to be used from
# machine configuration files, to add out-of-tree gem5 models of their
# hardware components.
GEM5_EXTRAS ?= ""
# Scons build arguments
GEM5_SCONS_ARGS ?= "CC=${BUILD_CC} CXX=${BUILD_CXX} \
AS=${BUILD_AS} AR=${BUILD_AR} ${GEM5_BUILD_CONFIGS} \
PYTHON_CONFIG=python3-config"
PYTHON_CONFIG=python3-config EXTRAS=${GEM5_EXTRAS}"
# Default profile to run
GEM5_RUN_PROFILE ?= "configs/example/fs.py"
+24 -18
View File
@@ -1,10 +1,11 @@
#! /usr/bin/env python3
import asyncio
import itertools
import os
import pathlib
import signal
import sys
import threading
import logging
logger = logging.getLogger("RunFVP")
@@ -37,7 +38,8 @@ def parse_args(arguments):
fvp_args = []
args = parser.parse_args(args=arguments)
logging.basicConfig(level=args.verbose and logging.DEBUG or logging.WARNING)
logging.basicConfig(level=args.verbose and logging.DEBUG or logging.WARNING,
format='\033[G%(levelname)s: %(message)s')
# If we're hooking up the console, don't start any terminals
if args.console:
@@ -47,27 +49,37 @@ def parse_args(arguments):
logger.debug(f"FVP arguments: {fvp_args}")
return args, fvp_args
async def start_fvp(args, config, extra_args):
def start_fvp(args, config, extra_args):
fvp = runner.FVPRunner(logger)
try:
await fvp.start(config, extra_args, args.terminals)
fvp.start(config, extra_args, args.terminals)
if args.console:
fvp.add_line_callback(lambda line: logger.debug(f"FVP output: {line}"))
expected_terminal = config["consoles"]["default"]
if not expected_terminal:
logger.error("--console used but FVP_CONSOLE not set in machine configuration")
return 1
telnet = await fvp.create_telnet(expected_terminal)
await telnet.wait()
port_stdout, log_stdout = itertools.tee(fvp.stdout, 2)
parser = runner.ConsolePortParser(port_stdout)
port = parser.parse_port(expected_terminal)
def debug_log():
for line in log_stdout:
line = line.strip().decode(errors='ignore')
logger.debug(f'FVP output: {line}')
log_thread = threading.Thread(None, debug_log)
log_thread.start()
telnet = fvp.create_telnet(port)
telnet.wait()
logger.debug(f"Telnet quit, cancelling tasks")
else:
fvp.add_line_callback(lambda line: print(line))
await fvp.run()
for line in fvp.stdout:
print(line.strip().decode(errors='ignore'))
finally:
await fvp.stop()
fvp.stop()
def runfvp(cli_args):
args, extra_args = parse_args(cli_args)
@@ -77,14 +89,8 @@ def runfvp(cli_args):
config_file = conffile.find(args.config)
logger.debug(f"Loading {config_file}")
config = conffile.load(config_file)
start_fvp(args, config, extra_args)
try:
# When we can assume Py3.7+, this can simply be asyncio.run()
loop = asyncio.get_event_loop()
return loop.run_until_complete(start_fvp(args, config, extra_args))
except asyncio.CancelledError:
# This means telnet exited, which isn't an error
return 0
if __name__ == "__main__":
try: