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

Compare commits

..

182 Commits

Author SHA1 Message Date
Tushar Khandelwal f90f028646 Revert "arm-bsp/tc0: Enable verified u-boot"
This reverts commit 29cee51f84.
2021-04-22 23:27:47 +01:00
Tushar Khandelwal 1cba8aee6d Revert "arm-bsp/u-boot: update SHA for tc0"
This reverts commit 70a9c4991e.
2021-04-22 23:24:10 +01:00
Tushar Khandelwal 5262d3d174 Revert "arm-bsp/images: Add tc0-kernel-image"
This reverts commit da57312334.
2021-04-22 23:23:34 +01:00
Tushar Khandelwal 664d2a5f6a Revert "arm-bsp: Enable SPM build option in yocto framework"
This reverts commit 86f9419b9d.
2021-04-22 23:23:13 +01:00
Tushar Khandelwal ebee7ce68d Revert "tc0/spm: boot SP according to boot order specified in manifest"
This reverts commit 56514201ad.
2021-04-22 23:22:02 +01:00
Tushar Khandelwal cc645908ef Merge branch 'upstream' into totalcompute 2021-04-22 22:36:21 +01:00
Ben Horgan 36314f2d87 arm-bsp/tc0: Add secure partitions secure-storage and crypo-sp
These are added along with the existing optee secure partition.

Change-Id: I50ce8adfa264d442cf52863f4f8572e623504ca3
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
2021-04-22 22:25:47 +01:00
Ben Horgan cddb08a7a2 arm-trusted-services: Add recipes for arm trusted services
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Change-Id: I14ac7649ae5899578167efca45d5c19d6248cb8f
2021-04-22 22:25:47 +01:00
Arunachalam Ganapathy 5d47d3f9db arm-bsp/linux: Add linux-trusted-services driver, FF-A ABI changes for TC0
This adds below patches:
     - buf driver for trusted service test applications
     - Fix in FFA-ABI aligning with latest SPMC (hafnium)

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I6b36a73a910f6e10748d78b2ad74603dde42c8a9
2021-04-22 22:25:47 +01:00
Arunachalam Ganapathy 9d1724c3d4 arm-bsp/tc0: Update hafnium revision and add patches
- Remove PSCI patches as those changes are upstreamed
- Adds Theodul, GICR changes
- Reverts FFA Set and verify allocator fix
- Adds fix to fetch proper vCPU for UP SP

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I26a7b31558e5bc4ce2fea61b76a3a92615f3e641
2021-04-22 22:25:47 +01:00
Arunachalam Ganapathy 29f0e5982c arm-bsp/tc0: Add patches in optee-os for FF-A ABI changes
Adds below patches:
     - To use FFA_SECONDARY_EP_REGISTER
     - To align with latest FFA_ABIs in SPMC (hafnium)

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I4ae386e2dd846e747cbc426270fc0c489ccdfe1f
2021-04-22 22:25:47 +01:00
Arunachalam Ganapathy 853f3e0565 arm-bsp/tc0: Update TF-A revision, add trusted-services support
- Update TF-A revision
- Add patch for trusted services support
- Add patch for GICR changes to support latest tc0 model

Change-Id: I3ba1fd9c1f89721fc6349db4e0270c8b42e9fcf0
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
2021-04-22 22:25:47 +01:00
Arunachalam Ganapathy 806bbb07ed arm-bsp/tc0: Update SCP firmware revision and add patches
Add below patches:
    - add clock and dvfs support for all cores
    - fix in CFGM base address calculation

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I2e70736070dd59f6209012dc875f3ea08d811046
2021-04-22 22:25:47 +01:00
Arunachalam Ganapathy 9bb19dd0d6 arm-bsp/tc0: add Theodul DSU support
- Adds patches required to support Theodul DSU in optee-os, hafnium
- Updates SHA of TF-A, SCP with revision that has Theodul DSU support

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I62f0990b7de919839be9ab0e3234914624c8afde
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-22 22:25:47 +01:00
Arunachalam Ganapathy 88c201ca9d arm-bsp/linux: add asymmetric AArch32 EL0 support for TC0
This adds patches for asymmetric AArch32 EL0 configuration support for
android11-5.4-lts kernel. And enables CONFIG_ASYMMETRIC_AARCH32 and
disables CONFIG_KVM in TC0 defconfig.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Iab94b5c48b60aca4a71267ba1be1cb1836002d10
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-04-22 22:25:47 +01:00
Ross Burton 3be0996065 CI: delete-sstate needs to delete contents
Change-Id: I278d470540e20db8d789a1428e927356e3a5d8b1
2021-02-08 20:16:16 +00:00
Ross Burton 101abf89c6 CI: add task to delete all sstate
Change-Id: If89c6c27cafe6ae7e93b5db5d37b9e8ecdaee131
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-02-08 18:55:21 +00:00
Adrian Herrera 549f362d2f gem5/gem5-aarch64-native: use oe-run-native
Persist gem5 binary in native sysroot. This allows executing the binary
with the standard oe-run-native script. We can also remove the wrapper
creation and the ".real" versioning, since paths are setup by oe-run-native.

Change-Id: I9fd46725c78e1a09a7142a9d343b140bb5a77088
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-04 14:16:47 -05:00
Adrian Herrera cb4c230b56 gem5/gem5-m5ops: initial recipe
m5ops provide pseudo-instructions to trigger gem5 functionality.
m5 utility provides a CLI for m5ops.
libm5.a provides a C library for m5ops.

Change-Id: Ib06dcb539648407522e31aeb1ed392fb5232675e
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-04 14:16:47 -05:00
Adrian Herrera 460210f4a8 gem5/gem5-m5term-native: initial recipe
m5term enables users to connect to the simulated console. Useful in
development environments.

Change-Id: I6096be9fbf44da280272656f3e15d1ba19593e50
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-04 14:16:47 -05:00
Ross Burton 568d4d7f9c gem5/gem5-aarch64-native: backport a patch to reduce warnings
With Python 3.9 the build produces a huge number of warnings, resulting in a
do_compile log that is 17M long.

Backport a patch from pybind11 upstream to silence this warning.

Change-Id: Ie4c71f8e5dd6c07c8be0a563778029a9859e1726
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-04 14:16:47 -05:00
Jon Mason 1350f983ae gem5/gem5-aarch64-native: update to v20.1.0.3
Update to the latest tagged version of gem5. Previously included
patches are now part of that release.
Upstream patch backported to enable boot with SMMUv3 model.

Change-Id: I7d7ad6f9681eb1f06743d214abbe901e9f8aa74e
Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-04 14:16:47 -05:00
Ross Burton 15512adf39 gem5/gem5-aarch64-native: don't build gem5 three times
The recipe currently builds gem5 binaries in optimised, fast, and
debug mode.  There is no need to build three at once (and triples the
build time), so simply build the optimised variant by default (as recommended
by upstream) whilst letting the variant be altered by setting
GEM5_BUILD_VARIANT.

Change-Id: I23baeee438d1ff08d1e2a54282141b55500f2ac1
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-04 14:16:47 -05:00
Anders Dellien 63c9974493 arm-bsp/fvp-base*: move to linux yocto kernel 5.10
Move both FVP platforms to linux yocto kernel 5.10

Change-Id: Idc0b35d201a188d69c2e475f2f864f5bb0f06341
Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-02 15:58:22 -05:00
Peter Hoyes a6de147dc0 arm-autonomy: Use busybox instead of GNU tar
Switch out the tar used by xenguest-manager and xenguest-mkimage.
xenguest-mkimage requires the --exclude flag so enable the Busybox
CONFIG_FEATURE_TAR_LONG_OPTIONS option.

Issue-Id: SCM-2034
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Iceed017ef8ebd058e6c06156989aaa2a4bff9103
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-02 07:36:33 -05:00
Peter Hoyes ea931f83e3 arm-autonomy: Use correct PACKAGE_ARCH in recipes-extended
xen-devicetree should be $MACHINE_ARCH.
xenguest-* should be allarch

Issue-Id: SCM-2039
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Id5666e1dc02a174e74bb8e843cb588287717d136
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-02 07:36:33 -05:00
Nathan Dunne d692df24cd arm-autonomy/xen-devictree: Update dom0_mem default inline with best practices
Updated default value for XEN_DEVICETREE_DOM0_MEM from "1024M" to
"1024M,max:1024" to match best practice for dom0_mem command line
argument. Documentation also updated to refer to new default value

Issue-Id: SCM-2037
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Ifa7e78bf22b024cb7fe4b782f628860ff44860ad
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-02 07:36:33 -05:00
Nathan Dunne e0c74f3b3b arm-autonomy/xen-devicetree: Check for empty/invalid variable values
Added check to xen-devicetree to validate values of required variables:
XEN_DEVICETREE_DOM0_ADDR
XEN_DEVICETREE_DOM0_SIZE
XEN_DEVICETREE_DOM0_MEM

Issue-Id: SCM-2037
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I31bfcdb9d064f6e91beb1500d0a18f2a30a42028
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-02 07:36:33 -05:00
Nathan Dunne 82b31654b0 arm-autonomy/xen-devicetree: Allow hex or decimal Dom0 Size
Check whether XEN_DEVICETREE_DOM0_SIZE begins '0x' and cast from hex
or decimal accordingly, rather than assuming hex.

Issue-Id: SCM-2037
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I3a1c7c7ae6711b3d645cdb66bcd9c2c27196b054
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-02 07:36:33 -05:00
Nathan Dunne 57192fd8a5 arm-autonomy/xen-devicetree: Lower log level for incorrect kernel size
Reduced the level at which messages relating to overriding the user provided
value for XEN_DEVICETREE_DOM0_SIZE when it is too small are logged at from
'warn' to 'note'

Issue-Id: SCM-2037
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I1436dac2c347d40c897291220fe30a95a57f2fa1
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-02-02 07:36:33 -05:00
Diego Sueiro 67f57f35da gem5/gem5-native: Fix INSANE_SKIP mechanism for native-last QA check
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Change-Id: Ic1c92e145694abd30fdd99fd073eeacce917c55e
2021-02-01 16:48:44 +00:00
Nathan Dunne 0978f5a74c arm-autonomy/xenguest-manager: Make stop by default a blocking action
Added -w parameter to xl shutdown to force it not to return until
the action is completed, and modified logging to reflect this

Stop operation can be configured to return immediately using
--nowait parameter, or to force destroy the guest if the graceful
shutdown fails using --kill. Both are now documented in usage().

Issue-Id: SCM-1861
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I664acc8a6a1eb17619fa2fd9b372ea661e537923
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-25 11:06:29 -05:00
Peter Hoyes 232b411b47 arm-autonomy: Use 5.10 kernel for autonomy-guest
Issue-Id: SCM-2054
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I8bcb464f0fd960cd01cce328c51be538cc705e84
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-25 09:26:11 -05:00
Peter Hoyes 98f3779210 arm-autonomy/n1sdp: Use 5.4 kernel for autonomy n1sdp builds
meta-arm-bsp has been updated to use 5.10 kernel but further validation
required before upgrading the autonomy n1sdp kernel.

Issue-Id: SCM-2053
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I3848a03d7d01dc3a1c27530ec395e1db083a9e35
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-25 09:26:11 -05:00
Peter Hoyes 7ae8a30b6b arm-autonomy/linux-arm-autonomy: Add explicit dependency on bridge.cfg
xenguest-network depends on CONFIG_BRIDGE_NETFILTER, but the default
value changed to 'n' in Linux 5.6
(http://git.yoctoproject.org/cgit.cgi/linux-yocto/commit/?id=98bda63e20daab95bdc084ce00459a4f622a0505).
Include bridge.cfg to define CONFIG_BRIDGE_NETFILTER manually for Xen
host builds.

Issue-Id: SCM-2057
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Id920d14f87a95214ee722007de923fd27b61afb3
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-21 09:27:37 -05:00
Nathan Dunne 933df12da8 arm-autonomy/arm-autonomy-host-image-minimal: Use REQUIRED_DISTRO_FEATURES
Make use of REQUIRED_DISTRO_FEATURES rather than anonymous python for
determining that both arm-autonomy-host and xen are present in
DISTRO_FEATURES

Issue-Id: SCM-1862
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Id21086ac4f4c45a89fa8fa8a2da28f04919f6b26
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-21 09:27:37 -05:00
Nathan Dunne bc4cd77370 arm-autonomy/documentation: Remove references to meta-kernel
Since meta-arm-bsp doesn't depend on meta-kernel anymore
it has been removed from the appropriate documentation.

Issue-Id: SCM-2005
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: If3548b84c4cffc5cc105a1fc07a656dc814699f3
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-21 09:27:37 -05:00
Nathan Dunne 5b823a1eb4 arm-autonomy/xenguest: Add guestcount support
Add guestcount parameter to ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS,
to create multiple guests with the same config. Symlinks are created
in the host rootfs pointing to the original xenguest file

Parameters for ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS are now
retrieved using python regex rather than split, so that they can
appear in any order

Issue-Id: SCM-1863
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Ifa5f5ab3b284815427c94979b3f1a5eed592ec3c
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-21 09:27:37 -05:00
Adrian Herrera a8f32f990a gem5: centralise v20 sources
Both simulator and bootloader now fetch from a single include file
defining the sources. This is in preparation for m5term recipe.

Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Change-Id: Ia4f6b6d99401ddb0c726d913ceff4ced90f41f6b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Adrian Herrera 51e014fd47 gem5: use GEM5_RUN_PROFILE in DTB generation
Allows to generate DTBs from profiles other than baremetal.py, which is
the default established by the layer.

Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Change-Id: Ic990bd6751e473756d0739f421dce4b8f98248d7
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy f8e79562f9 arm-bsp/tc0: Enable spmd and SEL2 SPMC with optee as SEL1 SP
- Set SPD to spmd with SEL2 SPMC. Set optee as SP
- Assign SP layout and spmc manifest file that corresponds to optee
- Move TF-A version from 2.3 to 2.4

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I3da3bf7f95ba42716b731f92e2cdfb928b1ab77f
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy 980f559e87 arm-bsp/linux: add ffa transport in optee driver for TC0
This patch adds FF-A transport driver for optee driver. This is based
on prototype version released by Arm and its port for android11-5.4-lts
kernel.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I991895881c069767854ae8a0722cdc282b221dd9
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy 44a3c5cf80 arm-bsp/linux: enable ffa driver for TC0
Enables ffa driver. Sets CONFIG_ARM_FFA_TRANSPORT=y

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I71ffeb6b3bc5b28c34bfab09cdcc66227203c74c
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy 603a7657e2 arm-bsp/linux: add ffa driver to TC0
This patch contains initial version of ffa driver adopted for
android11-5.4-lts kernel.

This is based on prototype ffa driver released by Arm.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Idb198cc77368a95257f1b5bff37b17bd13144109
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy 7453f06afc arm-bsp/tc0: Enable optee core with SPMC at SEL2
Sets config flag CFG_CORE_SEL2_SPMC. Copies optee manifest file and
sp_layout files to deploy directory.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: If2104e2d588cbc9fbd9db3d8c4ba9fb74732901b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy b595d1ea47 arm-bsp/tc0: Add tc0 platform support patches for optee
These patches in optee-os adds support for
      - tc0 platform
      - SEL2 SPMC support in optee core
      - support for tc0 SEL2 SPMC config

The patch in optee-client adds support for
    - allocating page aligned shmem buffers

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I1cfe134bdcedc45adf446f46af0d2881815b98f6
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy a3481e5016 arm-bsp/tc0: Add support for optee
This patch adds optee-os, optee-client, optee-test support in tc0 bsp.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I65f795b7ec2b4def4778b286b2f744b06b177157
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy 9fdf9297ac arm-bsp/tc0: Add hafnium support
Enables hafnium support for tc0.
Adds pending patches for SEL1 SP support.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: If5c12b7e7b7a301ae9a48a88223be3e51f38d3aa
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy 9e00b6b884 arm/trusted-firmware-a: Add support for spmd build option
This patch adds generic dispatcher 'spmd' option for SPD along with
SPMD_SPM_AT_SEL2 build option.

 Config: SPD=spmd and SPMD_SPM_AT_SEL2=1. Indicates the SPMC component
 runs at the S-EL2
   - Add hafnium dependency
   - Set CTX_INCLUDE_EL2_REGS=1 and ARM_ARCH_MINOR=4
   - Set BL32 to hafnium image
   - Set SP_LAYOUT_FILE and ARM_SPMC_MANIFEST build parameters

 Config: SPD=spmd and SPMD_SPM_AT_SEL2=0. Indicates the SPMC component
 runs at the S-EL1 execution state.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Icd3970e5132e75de67ef7f41dbfc8f9e1cdde7f3
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Arunachalam Ganapathy ee8a242e7a arm: Add hafnium support
Initial recipe for hafnium[1]. This enables build for reference Secure
Partition Manager (SPM) for systems that implement the Armv8.4-A
Secure-EL2 extension.

Link: [1] https://www.trustedfirmware.org/projects/hafnium/

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Ib256d8ca03c94131e308d962d786d5d6a656c256
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-14 09:37:35 -05:00
Ross Burton 43a25b2e96 arm/opencsd: upgrade to 1.0.0
Change-Id: I7c88e60bbeb6d9149d6d6178067bcd149405c111
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-13 17:30:40 -05:00
Khasim Mohammed e25c325197 arm-bsp/n1sdp: port and migrate to linux yocto kernel 5.10
This commit includes :
    - rebased and fixed kernel 5.4 PCIe quirk patches to apply on 5.10
    - pci probe in n1sdp driver is modified to use 5.10 structure
    - USB_CON_GPIO config is added to remove build time warning
    - Updated n1sdp conf to use 5.10 yocto kernel
    - Fix defconfig to not use obsolete symbols (RB)

Change-Id: I9e3d3945057ac09768a4a4e4d7a3033138925955
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-13 17:29:53 -05:00
Jon Mason 761bcbb365 arm/machine: add zephyr machine conf for microbit
Zephyr supports QEMU based machine for Cortex M0 (qemu-cortex-m0).  This
is actually using the BBC Microbit v1 machine in QEMU.  Use this more
accurate name for the machine conf.  This enables us to verify m0
tunings.

NOTE: qemu-cortex-m0's zephyr config has SRAM too small to run
zephyr-kernel-test-all, but can run zephyr-philosophers and
zephyr-kernel-test-sleep (and possibly others).

Change-Id: Ia997a162c10cf1a6b8fea244cb1960f4d4c66adc
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-13 17:29:30 -05:00
Anders Dellien d9fe9a3eac arm-bsp/fvp-base*: move to u-boot 2020.10
Move both FVP platforms to u-boot 2020.10

Change-Id: If94bb5a343e2709574f84283f39d8d227b32d84d
Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-13 17:29:30 -05:00
Ross Burton e627b698e7 kas: add a test for the external toolchain support
meta-arm-toolchain supports using an external binary arm
toolchain[1] instead of the gcc-cross built by oe-core.

Add a test case to exercise this build in the CI.  Currently this
is only for the Aarch32 target as our CI runs on aarch64 and there
is no binary or aarch64 target on aarch64 host.

This depends on the image used by the CI having the relevant
compilers installed into /usr/local.

[1] https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a

Change-Id: I9f7ea66786e98a40cbd490386497e2d3aaa47e80
Signed-off-by: Ross Burton <ross.burton@arm.com>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-13 17:29:30 -05:00
Ross Burton 84683227ed kas: rename armgcc fragment to avoid conflicting with musl
The armgcc fragment was labelled 'libc', which means it would be
impossible to armgcc+musl.

Change-Id: I96f1d6e1a77bcd05fe373315f575c57c36417852
Signed-off-by: Ross Burton <ross.burton@arm.com>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-13 17:29:30 -05:00
Usama Arif 312a25202b arm-bsp/images: artifacts image for tc0
Trusted-firmware-a is the final component to be built with the rest of the
components dependent of it, therefore building tc0-artifacts-image
which depends on trusted-firmware-a will build all the required binaries.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I57760a339da1601bd66e3dd752a7b2814e84bbb8
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-13 17:29:30 -05:00
Diego Sueiro 1f548fce10 arm-autonomy/linux-arm-autonomy: apply runstate fix to kernels older than 5.10
The patch introduced in 82ffc86 is a backport from the 5.10 version. Hence,
just apply it for kernels older than 5.10.

Change-Id: I6f442f540913b5e24bea533a436b4a3104d098e9
Issue-Id: SCM-2033
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-13 17:29:30 -05:00
Ross Burton 75c9cc3bf8 CI: don't retry jobs
We can't retry jobs blindly because if a build fails with warnings we want
to fail the job.  With retries enabled the job fails, but is immediately
retried and builds quickly from sstate without any warnings.

Thus, all and any warnings are hidden.

Disabling retries. We may get occasional failures from Docker, we'll have
to see how bad they are.

Change-Id: Ib726f14a264c029fdf372fc1b8a02aca52bf5e4c
Signed-off-by: Ross Burton <ross.burton@arm.com>
2021-01-12 18:05:41 +00:00
Ross Burton 9e2ff72858 arm-toolchain/external-arm-toolchains: add upstream checking information
Change-Id: I08168f5369eafb590d7cdbc972320c852d4252b3
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-07 10:55:12 -05:00
Ross Burton 68a113c0a0 kas: add testing of gcc-arm
Add a build to verify that setting GCCVERSION to arm-10.2 works.

Change-Id: I086fa786b11560a8e94ee646859c59288bacba5d
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-07 10:55:12 -05:00
Nathan Dunne f14be5995f arm-autonomy/xenguest-manager: Document VOLATILE_LOG_DIR in recipe
Added a comment to the xenguest-manager recipe to inform the user that
the default state is a volatile log dir, and how to persist logs across
reboots.

Issue-Id: SCM-1860
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Ie0c92b05d11543a1524cbb7a53cd845bc63ecd3d
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-07 10:55:12 -05:00
Sumit Garg eb3a6b74b7 external-arm-toolchain: Misc. fixup for GCC 10.2 support
Arm GCC 10.2 prebuilt toolchain comes with ldd and tzselect scripts
which uses "/usr/bin/bash", so replace this with "/bin/sh" as the
default shell.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-07 10:55:12 -05:00
Sumit Garg a56011bf30 arm-toolchain: Drop support for GCC 8.x toolchain
As OE core has moved to GCC 10.2 toolchain, so remove support for
legacy Arm 8.x toolchain.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-07 10:55:12 -05:00
Sumit Garg 0a1d96948f arm-toolchain: Add support for GCC 10.2-2020.11
Add support for GNU-A toolchain version: 10.2-2020.11.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-01-07 10:55:12 -05:00
Ross Burton 6dbf49d633 arm/trusted-firmware-a: remove git-specific recipe
This recipe isn't used by any machines and isn't tested, so remove it.

Machines that use a git snapshot should extend the closest versioned recipe
instead.

Change-Id: Ia0970f2d0491204c23d171c065e85c9f65f9472f
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-22 09:53:33 -05:00
Ross Burton e454387d9f arm/trusted-firmware-a: remove unused 2.1 recipe
No machines in meta-arm are using this old release.

Change-Id: I8b56b1cc3eb603ee423acc52950d1e7661502d0e
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-22 09:53:33 -05:00
Ross Burton b566fbce82 arm/edk2-firmware: remove unused 202008 version
Now that SGI575 has upgraded, this can be removed.

Change-Id: Ib8bdd9430b66a4b83524b21ad2a300a048c218eb
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-22 09:53:33 -05:00
Jon Mason 756e695b48 arm-bsp/linux: remove unused kmeta variables
gem5 is no longer in meta-arm-bsp, and kmeta entry should be removed.

sgi575 has no usage of the meta-arm-bsp kmeta and would be better suited
to use the generic one.

corstone700 is defining kmeta, but that variable is only used in the
generic kmeta src_uri, and not the meta-arm-bsp that it is using.

Change-Id: I01e80c433a9a02bad1f6337b0df27cbf6a96231f
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-21 09:55:52 -05:00
Jon Mason 1f6d3f6ef2 arm-bsp: fix sgi575 kernel compile warning
SGI575 throws a config warning when compiling the 5.7 kernel.

WARNING: linux-yocto-5.7.19+gitAUTOINC+b9e6fd082d_6b9830fecd-r0 do_kernel_configcheck: [kernel config]: specified values did not make it into the kernel's final configuration:

    [NOTE]: 'CONFIG_USB_CONN_GPIO' last val (m) and .config val (y) do not match
    [INFO]: CONFIG_USB_CONN_GPIO : y ## .config: 5334 :configs///defconfig (m)
    [INFO]: raw config text:

        config USB_CONN_GPIO
        	tristate "USB GPIO Based Connection Detection Driver"
        	select USB_ROLE_SWITCH
        	depends on GPIOLIB && USB_SUPPORT
        	help
        	  The driver supports USB role switch between host and device via GPIO
        	  based USB cable detection, used typically if an input GPIO is used
        	  to detect USB ID pin, and another input GPIO may be also used to detect
        	  Vbus pin at the same time, it also can be used to enable/disable
        	  device if an input GPIO is only used to detect Vbus pin.

        	  To compile the driver as a module, choose M here: the module will
        	  be called usb-conn-gpio.ko

        Config 'USB_CONN_GPIO' has the following Direct dependencies (USB_CONN_GPIO=y):
                GPIOLIB(=y) && USB_SUPPORT(=y)
        Parent dependencies are:
             USB_SUPPORT [y] GPIOLIB [y]

    [INFO]: selection details for 'CONFIG_USB_CONN_GPIO':
        Symbols currently y-selecting this symbol:
          - PHY_TEGRA_XUSB

It is using the defconfig from upstream Linux.  So, change that
defconfig to correct the warning by changing USB_CONN_GPIO from 'm' to
'y'.

Change-Id: Ia5080f7f22d0f1aef065b58d8c3b0222625c8f58
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 16:03:19 -05:00
Ross Burton 9ed331bbd7 arm-bsp/edk2-firmware: upgrade SGI575 to 202011
Change-Id: Id002f1f460d9a0d66c913d3f3c7bb460ae7d5904
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton a780470d96 arm/edk2-firmware: upgrade platforms to fix VariablePolicyLib errors
Upgrade to a newer edk2-platforms revision to incorporate the fixes
for the VariablePolicyLib changes in edk2 itself.

Change-Id: I928a59baee9cea4958963ac86f0093521036740b
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton 800249ac61 arm/edk2-firmware: no need to depend on the C library
Firmware is baremetal so doesn't need the C library to build.

Change-Id: Ie376783cb45fb6d455bc5d9c687e77703ff2cd72
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton 5a44edaa0e arm/trusted-firmware-m: upgrade to 1.1
Change-Id: Id0c37b291b32072ebe61abcd908ed9a2ebf79365
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton cff5aafc67 arm/trusted-firmware-m: set PACKAGE_ARCH
As this is machine-specific, set PACKAGE_ARCH to MACHINE.

Change-Id: I4569bce706de8dea4ba98770960c0d40348a3fa2
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton 60ef8543f4 arm/trusted-firmware-m: improve CMake calls
Use cmake more idiomatically, and enable verbose builds.

Change-Id: I908af71f4662fab1dde9de86fc7a56ca3701e0c5
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton 235b7539d8 arm/trusted-firmware-m: remove more unneeded build dependencies
TF-M uses the binary Arm toolchains currently, so we can inhibit
all of the default dependencies.

Change-Id: I38a7bda9570d9d63d3d81f0886c437f29929a0f5
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton d9a0f4fe59 arm-bsp/trusted-firmware-m: move TFM_PLATFORM to machine configuration
Now this can be easily set in the machine, do so.

Change-Id: I964c78c8e1e8f845cc2c95193c4a795e12089d1a
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton 6a85fdbd77 arm/trusted-firmware-m: don't use COMPATIBLE_MACHINE directly
COMPATIBLE_MACHINE is a wrapper around raising SkipRecipe, and as this
recipe basically just needs TFM_PLATFORM set we can raise that if the
variable is not set.  This allows BSPs to set TFM_PLATFORM in their
machine configuration instead of needing to bbappend.

Change-Id: I8544ff14ac4689bfbea1f0ac68364b673abde6f1
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Ross Burton 7fdd34516c arm-bsp/musca: remove trusted-firmware-m statements
Musca doesn't build 'images' in the traditional sense yet, just
trusted-firmware-m or Zephyr, so remove EXTRA_IMAGEDEPENDS.

Remove the preferred version for TF-M as we only ship one currently.

Change-Id: I2fbd1230f6ba7a49aa093ca90fc38e676ba14633
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Nathan Dunne 9b7905b994 arm-autonomy/xenguest-manager: Clean up code duplication
Reduced duplicated code in xenguest-manager to functions for better
maintainability. Also reduced instances of calling self with a different
argument, which is better for performance and log readability.

Issue-Id: SCM-1635
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Ic37b6b0a8a5f38145a298cc6aab908e3e58ae313
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-18 14:17:56 -05:00
Usama Arif caaa21d84f arm-bsp/documentation: Update the command for building all components
Trusted-firmware-a is the final component to be built with the rest of the
components dependent of it, therefore building trusted-firmware-a will
build all the required binaries.

Change-Id: Ia8675b048db4a127d32394f536632ce88fe20826
Signed-off-by: Usama Arif <usama.arif@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-16 14:38:31 -05:00
Usama Arif 65618b753f arm-bsp/tc0: Enable verified u-boot
This involes creating the fitImage which contains
both the kernel and ramdisk. The fitImage is also
signed.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I2fc50740aac3e347be02438cf54ef5741183a670
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-16 14:38:31 -05:00
Usama Arif 511c1ca429 arm-bsp: update tc0 platform with latest u-boot
Use 2020.10 u-boot as it has tc0 platform merged in upstream.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: Ia7da8b96a4509cee25b096f6637c036fef910b48
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-16 14:38:31 -05:00
Diego Sueiro 16d10f9c58 arm-autonomy/wic: Revert Introduce empty plugin to create unformatted empty partitions
This reverts commit bc07e6c62a.

Wic empty plugin upstreamed to oe-core as: 77d174fc80663403ef76c5b808aafc1117d3545c.

Change-Id: I94e6fb8583cf6e26cf141087fe5adb187ea85ef1
Issue-Id: SCM-1520
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-16 14:38:31 -05:00
Nathan Dunne 7a3e9d5087 arm-autonomy/xenguest-manager: improved logging
Introduced logging functions to unite logging to the console and to
the logfile with different filterable log levels. Also introduced
logrotate to ensure the size of the log does not become excessive.

The Log levels introduced are:
ERROR INFO VERBOSE

By default, both the terminal and the logfile will receive ERROR logs.
More verbose logs can be written to the logfile in two ways:
- passing the parameter "-v" or "-vv" to write info and verbose respectively
- modifying the value of "XENGUEST_MANAGER_LOG_LEVEL" in the host conf file,
  or updating the entry it creates in the config file
  /etc/xenguest/xenguest-manager.conf

The order of precedence is as listed above

Issue-Id: SCM-1516
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I47f74802ed31a5bff12305eab707e009af7e5398
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-16 14:38:31 -05:00
Ross Burton 35adaace0e ci: fail any build that emits warnings
Using a custom logging.yml we can instruct BitBake's logger to write all
warnings and errors into a separate log file.

Then after the build has finished we can see if the log file is empty and if
not show it and abort the build.

Change-Id: Ida835b5c822941fb513dfb1758b4ec195e0050fc
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-12-15 15:35:25 +00:00
Ross Burton e40b99e131 ci: make bootstrap just another kas overlay
Simplify the gitlab-ci by having the bootstrap build as just another Kas
overlay file, so there's no duplication of build script.

Change-Id: I7341750d2ae7f3c146bfe323f61fa98c0f3121c0
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-12-15 15:35:25 +00:00
Ross Burton fecf206b7d arm-bsp/linux: explicitly refuse to build for Musca
The Musca boards can't run Linux, so explictly refuse to build a kernel
on those platforms.

Change-Id: Ic38e9fb5a7af5b27b83a74615ece5d49c60d927b
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-12-15 14:50:35 +00:00
Ross Burton 9b5f0a0cc4 arm/trusted-firmware-a: add upstream tag regex
So that the automatic latest upstream release detection works correctly,
specify what release tags look like.

Change-Id: Ie53e82fffe5392d8e6f8d530d9f4ed732f03b50f
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-12-15 14:49:08 +00:00
Ross Burton 88a5524a61 arm/trusted-firmware-m: add upstream tag regex
So that the automatic latest upstream release detection works correctly,
specify what release tags look like.

Change-Id: I8e028b9457719a462f2028daca028714b80fad63
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-12-15 14:49:08 +00:00
Ross Burton eea9ce959a arm/edk2-firmware: add upstream tag regex
So that the automatic latest upstream release detection works correctly,
specify what release tags look like.

Change-Id: I1226290c223d18b776efffeccd48d291755d01a1
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-12-15 14:49:08 +00:00
Ross Burton 98014d1c1c arm/optee-test: add comment
Upstream has potentially fixed the musl issues, so leave a comment to remind
whoever does the upgrade.

Change-Id: I24d9b23e492b29b6690c0843c3f2c950791f93e5
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-12-15 14:49:08 +00:00
Ross Burton a230baa675 arm/optee: add upstream tag regex
So that the automatic latest upstream release detection works correctly,
specify what release tags look like.

Change-Id: Ibc43aecd3cb4def85e2f1549d16f5bcb27cfb703
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-12-15 14:49:08 +00:00
Brett Warren da32f5c1c8 arm/trusted-firmware-a: -Wtautological triggers removed
When compiling under clang, certain lines triggered
-Wtautological errors. Cosmetic modifications were made
via patches to mitigate this.

Change-Id: I3d17dd5102267e03a8b7d157e66e0788b542bdd8
Signed-off-by: Brett Warren <brett.warren@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:04:51 -05:00
Brett Warren 293d1e0e8d arm-bsp/trusted-firmware-a: enable explicit linking to runtime builtin
When compiling under clang for aarch32, linking fails because
the compiler-rt builtins aren't implicitly linked. Recipes and
patches have been modified and added to explicitly pass the runtime
builtin when linking files.

Change-Id: I4299b7d078d77c1fdd5576ceec1491f91e73c35d
Signed-off-by: Brett Warren <brett.warren@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:04:51 -05:00
Ross Burton e59fc3233b arm-bsp/u-boot: update FVP patch metadata
Change-Id: If8edc606afa57e33ddd05ae16d6bf53b798257bc
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:04:25 -05:00
Ross Burton c90cf8ce5a arm-bsp/scp-firmware: update a patch that is now upstream
Change-Id: Ibfa8f7d3c0f38fcde514170211264ec02efff953
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:04:25 -05:00
Ross Burton 5b98ef9d65 arm/op-tee: remove old 3.8.0
Change-Id: I8da09673c02f3a046e4291f7eb01cdb66117450f
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:04:25 -05:00
Ross Burton 35c0bcceea arm-bsp/musca: don't include qemu.inc
The oe-core qemu.inc is common configuration for the qemu machines
inside oe-core.  Including this to get qemuboot working has some
unintended consequences, such as a kernel being selected and
MACHINE_FEATURES being altered.

Change this to inherit qemuboot and set the correct filesystem type
directly.

Change-Id: Id17e2cc67f029653517ba802c7f8f5503eea3c31
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:04:25 -05:00
Henry Wang fabf4a3c0f arm-autonomy/container: Add a recipe to include container image
This commit implements a generic recipe to pack and import
container image to the xenguest image.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Issue-Id: SCM-1738
Change-Id: I239b360f9a7dd1cdc050d46a40e210406ca21aae
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:02:59 -05:00
Jon Mason b578b45092 arm-bsp: update SCP for TC0
Update TC0 SCP from using a local version (non-standard) to use the
generic 2.7 recipe.

Change-Id: I68aca8fe7f1f7a574a2324dff348f80cd4989581
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:02:59 -05:00
Jon Mason e05be1a396 arm-bsp: update SCP for SGI575
Update SGI575 SCP from using a non-standard, post 2.6 release version of
SCP to using the generic v2.7 recipe.

Change-Id: I31945afbb16ce65b4f87130c6b85f12c89b8713c
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:02:59 -05:00
Jon Mason be19ce6b94 arm-bsp: have sgi575 use EDK2 sources
Move sgi575 off its own unique version of EDK2 and onto using the
version used in the EDK2 recipe.

NOTE: SGI575 not compiling cleanly with EDK2 202011

Change-Id: I7ab9a6673cc91758121b618e6691c25ae67e9a21
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:02:59 -05:00
Jon Mason 7cd87c3ee3 arm: new recipes for EDK2
Rework the EDK2 recipes to allow for multiple versions, and create a
recipe for the latest version.  This will allow for BSPs using the older
version to continue to function while waiting to be upgraded.  Also,
rework the n1sdp recipe to use the 201911 recipe, but overwrite
everything with its unique git trees.

Change-Id: I96869191bcf896ea17304d2ccf93da58605c72a1
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-15 09:02:59 -05:00
Kamil Dziezyk a49c59daf6 arm-autonomy/xenguest-manager: remove double arguments checking
This patch brings following changes to xenguest_volume_init() function:
 (*) removes doubled arguments validation,
 (*) adds missing check_private() call,
 (*) inherits diskdevice and volumename values,
     as first and second function arguments.

Issue-Id: SCM-1520
Change-Id: Id01a326c2db5db1fcaae9237f887e97ea208d6ff
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-11 10:13:17 -05:00
Ross Burton 7577cecab6 layers: consolidate layer priority to match oe-core
Without exceptional justification there is no good reason for layers to
have a priority other than 5, to match oe-core.  If a layer has a
priority higher than oe-core's then recipes in that layer take immediate
preference over those in oe-core and there's no simple way to resolve
this as that is exactly what is meant to happen.

As a concrete example, meta-arm-bsp contains older releases of U-Boot
for platforms that have not yet moved to the latest release in oe-core.
As the priority of meta-arm-bsp is higher, simply adding this layer to a
qemuarm build will immediately downgrade u-boot.

As there is no exceptional justification for the differing priorities,
unify on 5.

Change-Id: I1975753b4a9799cc00310a7c8a6a11c2aef41f65
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-11 10:13:17 -05:00
Ross Burton 3c9486fb31 arm/qemuarm64-secureboot: don't use -dev kernel
According to the comment linux-yocto-dev was being used to get a 5.5
kernel as 5.4 was panicking on boot.  Now linux-yocto defaults to 5.8
so just use the standard kernel instead.

Change-Id: Id382c69f16f2ff4b2cbc63be94a645e56616549d
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-09 10:14:29 -05:00
Ross Burton 2a530c3419 kas: remove redundant env settings
These are left over from an experiment and are no longer needed.

Change-Id: I27677b58e4c196371a394f47b185f71917848528
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-09 10:14:29 -05:00
Ross Burton 0d83df0bd2 gitlab-ci: force git updates
Explicitly force kas to update in case the repositories are reused.

Change-Id: Ieedf518c7586bb1a4eff274dc1a33b52a3c49d9f
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-09 10:14:29 -05:00
Diego Sueiro 966e15826a arm-autonomy/init: Revert Change execution order between modutils.sh and checkroot.sh
This reverts commit a996166e85.

The fix was merged in oe-core as: 39f16d7dc42dcfe4a3fcceb8e476ac3c1e0ba3a2

Change-Id: Iab8f7d7b49fe62f04a5c77c1b48ec7c4fcf5c617
Issue-Id: SCM-1520
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-09 10:14:29 -05:00
Diego Sueiro 719a003508 arm-autonomy/modutils-initscripts: Revert fix modules.dep update
This reverts commit 9872afc6c7.

The fix was merged in oe-core as: 572f3045faa0a937947fbd56bcfef7bad55e9da6

Change-Id: Ib9531c1d18ac743c063afe66de18015472cdbb3d
Issue-Id: SCM-1520
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-09 10:14:29 -05:00
Ross Burton 79360345fb arm-bsp/trusted-firmware-a: move N1SDP to TF-A 2.4
Change-Id: I85a7b9421a6d5267c778c164b8f0e0bdd24b8407
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-08 08:33:25 -05:00
Khasim Syed Mohammed d683a5bc92 arm-bsp/scp-firmware: Update N1SDP SCP firmware to 2.7.0
SCP firmware recipes are updated to build SCP firmware version 2.7.0 for N1SDP

Change-Id: Ic42fac178cf4ac9e87127e9b6258c9bd15101906
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-08 08:33:25 -05:00
Kamil Dziezyk 780fba3481 arm-autonomy/xen-tools: update vif hostname fix patch status
Fix for hostname setting in vif-nat script was merged in xen upstream repo,
(sha: 5499e0fc8082024bf7e2d0facd5c976e82105070),
hence correct patch status for 4.14 is 'Backport'.

Issue-Id: SCM-1523
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Change-Id: I35f04bfa0f0fff81a1ef20d500b9323e5f13b9ed
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-08 08:33:25 -05:00
Ross Burton afa281b7a9 arm/opencsd: upgrade to 1.14.4
Notable changes include resolving a build race.

Clean up the recipe so that arguments are not passed twice in do_compile(),
and always pass the install path arguments to clean up the tasks.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Change-Id: I7e32a40092403fd0c0c53d157ae4581f7903356c
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:24 -05:00
Ross Burton f54bb78861 arm/scp-firmware: inhibit default DEPENDS
This is baremetal firmware so doesn't use the C runtime library and uses
the binary compiler for 32-bit Arm instead of the standard one, so
inhibit the default dependencies entirely.

Change-Id: Idd52bb09fea49640f1fc38e1c5a47ca8eecca107
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:24 -05:00
Ross Burton de5d5e611a arm/trusted-firmware-a: no need to DEPENDS on a C runtime
This recipe is for baremetal firmware, so remove libc from DEPENDS.

Change-Id: I89d0dde3f48599b9221cb1e153344dbc05e8cebe
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:24 -05:00
Ross Burton 2ab2f5e179 arm/trusted-firmware-m: no need to DEPENDS on a C runtime
This recipe is for baremetal firmware, so remove libc from DEPENDS.

Change-Id: Id37f82a4dad6207237117b65d242617467b83ed2
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:24 -05:00
Ross Burton 9d8bb0bea2 arm/trusted-firmware-m: clean up DEPENDS
TFM_DEPENDS isn't used anywhere so remove it.

Change-Id: I7707ada458a001a081aac1f417dc78d6ca37a307
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:24 -05:00
Kamil Dziezyk 4b1d39b87d arm-autonomy/juno-firmware: add compressed kernel support
This patch adds support for lzma compressed kernel,
by setting KERNEL_ALT_IMAGETYPE to 'Image.lzma' and
adding additional decompression step during u-boot boot stage.

U-boot automatic Image decompression cannot be used here,
because if xen binary is the target of 'booti' command,
Image is not being decompressed neither by u-boot nor by xen.

Lzma compression is supported in u-boot with 'lzmadec' command,
and does not require setting additional dependencies inside kernel recipe.

Change-Id: I51b9aea962f8905f88b60ac28e71017c7d500189
Issue-Id: SCM-1769
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:24 -05:00
Kamil Dziezyk 4ba96e72fd arm-autonomy/autonomy-host: add user defined partition to wic image
With this patch user can define additional partition entry,
via AUTONOMY_HOST_EXTRA_PARTITION variable.

Issue-Id: SCM-1514
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Change-Id: Ic103a40de44ea6cd88caa60f06033a9c678b265f
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:24 -05:00
Kamil Dziezyk cd9cdaad2a arm-autonomy/juno-image-customization: add host wks file
This patch also appends 'wic wic.gz wic.bmap' images,
to IMAGE_FSTYPES.

WKS file contains two partition entries:
 * first is rootfs partition
 * second is empty partition (4 GiB by default)

Issue-Id: SCM-1520
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Change-Id: Ic0c79ee5eb4b08ad8f9c133b267feda1c85519a3
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:24 -05:00
Kamil Dziezyk e3b06f63b1 arm-autonomy/xenguest-tools: add multiple disk devices support
With this patch user can set DISK_DEVICE for guest image.
If guest disk configuration contains DISK_DEVICE setting,
xenguest-manager uses that disk for this guest, insted of default one,
that is set with XENGUEST_VOLUME_DEVICE in xenguest-manager.conf file.
DISK_DEVICE is not set by deafult.

Change-Id: If400850f60097d38339e76a3d18fc0e2b927f3a0
Issue-Id: SCM-1513
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-07 08:45:23 -05:00
Jon Mason 03f2d78e45 arm: update Android common kernel
Update ACK to ASB-2020-07-05_5.4-stable and remove the 4.19 recipe

Change-Id: Iecc56effff11ecd9619553381815445b64aa645e
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-12-02 13:39:34 -05:00
Ross Burton e64c553fa0 Add experimental CI using Kas+GitLab
Add kas scripts that generic to test builds, and a GitLab CI runner.

Change-Id: I9026fd1af4155288c4adb523d00b1562ea8515e9
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-30 15:44:59 +00:00
Jon Mason 7f5a3b06ee arm/scp-firmware: Add SCP v2.7.0
Add the latest version of SCP.  Not adding an inc file between them,
since the older one should be removed ASAP.

Change-Id: I0a1e58ffdb6d0d405b199e498587fe410076fc08
Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-26 14:06:06 +00:00
Ross Burton a8a44f6916 arm/scp-firmware: remove redundant python3native inherit
Change-Id: I9df71eb6bb99bb4af48b77f50a1056027c8227a4
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-26 14:06:06 +00:00
Ross Burton fda2117467 arm-bsp/scp-firmware: explicitly select scp-firmware 2.6
Explicitly select scp-firmware 2.6 in all the machines that use it.

Change-Id: I83d3214fff05e7cbbf182f1215e67da42ceb68f1
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-26 14:06:06 +00:00
Ross Burton 095d9e314d arm-bsp/scp-firmware: add version to wildcard bbappend
To prepare for a new version of scp-firmware, add a version to this
bbappend.

Change-Id: Ib6d79f2992783f2d582ca5804bc081912f9bb674
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-26 14:06:06 +00:00
Satish Kumar 148103bf84 arm-bsp/boot-firmware: update boot-firmware recipe to latest hash
The recipe now points to the folowing commit.
commit hash : af7eeb1bb8c5a85a5e5a76d48acc6fe864d715a9

Change-Id: I73313597ddee117d92351d6daa1f7bae0b5edb82
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-26 14:06:06 +00:00
Ross Burton f8fc3b463d arm-bsp/boot-firmware: add firmware recipe for corstone700
Previously corstone700 used the scp-firmware recipe to build
boot-firmware, which is based on scp-firmware but doesn't share the
build system.

As the differences are not insignificant, extract a dedicated
boot-firmware recipe.  Also set PV appropriately as boot-firmware now
has dated tags.

Change-Id: I3b60172e145be571aa465afb81473b9d79e9e425
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-26 14:06:06 +00:00
Nathan Dunne e18ee052f7 arm-autonomy/xenguest-manager: Fixed subshell false positive
Removed private check from check_size and is_integer to prevent
false positive error on execution in a subshell

Issue-Id: SCM-1623
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I57564bf610e21244c963a77c0669da5d4526eeff
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 18:20:29 +00:00
Khasim Mohammed 22948879f8 arm-bsp/n1sdp-board-firmware: include RAM firmware for secondary device
While testing multi-chip mode it was observed that n1sdp running
as secondary device needs scp and mcp RAM firmware as well.

This issue wasn't captured earlier as QSPI flash had RAM firmware installed
and it doesn't get erased automatically therefore the device was able to
load it on every reboot.

Change-Id: Ied9d24429c7025206e35f50c8e5b6f090a590015
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 18:20:29 +00:00
Khasim Syed Mohammed 99da50c473 arm-bsp/n1sdp: add overview section to n1sdp documentation
Update the n1sdp documentation in meta-arm-bsp to include overview section
and link to Arm community portal for further details on hardware platform.

Change-Id: Ic7c212db18a8c1f24255615061eee862af3aafd1
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 18:20:29 +00:00
Ross Burton b0188cd0cc arm-bsp/fvp-base*: move to trusted-firmware-a 2.4
Move both FVP platforms to TF-A 2.4.

Change-Id: I2bf668c798983847197bfef80ef14ab3c87ecad5
Tested-by: Anders Dellien <anders.dellien@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 18:20:29 +00:00
Ross Burton fb045c9019 arm-bsp: remove foundation-armv8 machine
The Foundation FVP machine is no longer relevant now that meta-arm has
Base FVP machines and the Base FVPs are freely available.

Change-Id: Ia7043d98e2bcd8433c8c3d2661cd28484f691276
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 18:20:29 +00:00
Ross Burton df93a23ad4 arm-bsp/external-system: remove coreutils-native DEPENDS
This recipe doesn't appear to actually need coreutils-native at all, and
using it exposes a bug in pseudo where cp crashes.

Change-Id: I2fbf9ee75165194866e4a14758ed06148340dc2b
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 18:20:16 +00:00
Ross Burton 87d12f6fa4 arm-bsp/trusted-firmware-a: adapt for patched recipe
The base trusted-firmware-a recipe is now patched, but these BSPs
chose to use an intermediate SHA instead of the release.  This SHA
already contains the patch, so we need to remove it from SRC_URI.

Change-Id: I69fab93cefd2e8b38474e308c6f2910454ba3a81
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 18:20:16 +00:00
Abdellatif El Khlifi 42b114e5e0 arm-bsp/trusted-firmware-a: fix the Corstone-500 system timer issue
This commit applies the TF-A fix allowing to use the right FPGA system
timer clock frequency for Corstone-500.

Change-Id: Iaa09d33eb76d9b2b74cb3400897c8cc0e3c694db
Signed-off-by: lakshmi Kailasanathan <lakshmi.Kailasanathan@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 12:01:45 +00:00
Abdellatif El Khlifi 39ae13d44e arm-bsp/u-boot: enabling the generic timer for Corstone-500
This commit updates the ARMv7 generic timer driver by configuring
and enabling the timer.

Change-Id: I1fc1df83f40e28869d8dd41ff7b202f6fa177a1f
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 12:01:45 +00:00
Abdellatif El Khlifi 390aa6e354 arm-bsp: use forcevariable override to set Corstone-500 kernel
Corstone-500 is built against poky-tiny distro.
poky-tiny sets PREFERRED_PROVIDER_virtual/kernel to linux-yocto-tiny.
Since distro config is evaluated after the machine config, we need to
use the strongest override possible (forcevariable) so the
PREFERRED_PROVIDER_virtual/kernel specified in the machine config will
apply.

Change-Id: Iafa9209bf39cf63e83faa6eefa2a442513992290
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 12:01:45 +00:00
Abdellatif El Khlifi 8e2fa5edc8 arm-bsp: branding CA5DS to Corstone-500
This commit changes the name of CA5DS platform to Corstone-500

Change-Id: I7fc687aea8ce6bba6d7021963ad4cb38f30858d5
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-25 12:01:45 +00:00
Kamil Dziezyk 342d2ec158 arm-autonomy/firmware-image-juno: update offset addresses for NOR flash images
This patch brings following improvements:
 * Remove images-r[012].txt and uEnv.txt source files
   and move all customization to add-xen-support.patch.
 * Move juno*-xen.dtb and xen binaries under dedicated
   'XEN' directory to be compatible with 8.3 format.
 * Increase XEN_DEVICETREE_DOM0_SIZE to 36 MiB.

Change-Id: I3d3ff963f97c738dcf2d90ba825729232d63ad06
Issue-Id: SCM-1567
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-23 16:11:22 +00:00
Nathan Dunne ce8369461e arm-autonomy/xenguest-manager: Private xenguest-manager functions
Ensure that init scripts sourced on guest start cannot execute functions
from the parent script. This is done using a check for the BASH_SUBSHELL
variable to see the depth of execution.

An error will be thrown if any init script attempts to execute a
function from xenguest-manager

Issue-Id: SCM-1623
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I87fee51d03a64d99728a7eca1ca789ec7293096b
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-23 09:25:31 -05:00
Nathan Dunne 3bbddbe213 arm-autonomy/n1sdp-image-customization: boot partition size variables
Added variables BOOT_PART_SIZE and BOOT_PART_SIZE_UNIT to allow the
boot partition to be configured in conf files.

Issue-Id: SCM-1686
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Iaa76d4abdcccc693b3c38708ca452295ff8ee66e
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-23 09:06:03 -05:00
Kamil Dziezyk 02994f94df arm-autonomy/xenguest-mkimage: improve xenguest image checks
This patch brings following improvements:
 * Adding the same partition content e.g rootfs.tar.gz,
   for multiple partitions is now not possible.
 * Guest partition can contain only supported values of:
   - format types: vfat|ext2|ext3|ext4|swap|(empty)
   - image types: *.img.gz|*.img.bz2|*.img
                  *.tar.gz|*.tar.bz2|*.tar.xz|*.tar

Change-Id: I0201e7ef51830ac43fc59656fc496fcc1d13b8d4
Issue-Id: SCM-1515
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 11:40:03 -05:00
Kamil Dziezyk aa35796c80 arm-autonomy/xenguest-manager: keep user defined partition order
If xenguest image does not define some partitions,
e.g second partition definition is skipped but 1st and 3rd are present,
xenguest-manager will create second partition(with small 2MB size),
to keep user defined partition order.

Change-Id: I8ff19fd9f25eb47ac37f80bec849387f6802aba3
Issue-Id: SCM-1515
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 11:40:03 -05:00
Kamil Dziezyk 5331993f8c arm-autonomy/xenguest-mkimage: check if partition fits disk size
Check if partition defined with '--disk-add-part=*' will fit
in disk size defined with '--disk-size=*'.

Change-Id: Ide87fe541d050497b4f2e5b5b47c1bcac8f5d37a
Issue-Id: SCM-1515
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 11:40:03 -05:00
Kamil Dziezyk 9b075d12de arm-autonomy/xenguest-tools: set guest disk and partition sizes in MB or GB
This patch brings following improvements:
 * Allow user to set guest disk and partition sizes in MB or GB.
 * Documentation update about this improvement.

Change-Id: I0a1a2945022efcd9d32bb39404b4a85721e28e19
Issue-Id: SCM-1515
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 11:40:03 -05:00
Kamil Dziezyk 91225be953 arm-autonomy/xenguest-mkimage: fix DISK_DEVICE setting
Previously '--disk-device' was set according to DISK_SIZE value,
set with '--disk-size' option, which was not quite accurate,
because disk device is more likely to be '/dev/sda2' rather than '1'.
This patch also fixes typo in help message.

Change-Id: I19aa72f3adb32cd786bb570023b6b40cfc5633bf
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 11:40:03 -05:00
Kamil Dziezyk 7c34d0affc arm-autonomy/xen-devicetree: check if kernel Image size is correct
This patch brings following improvements:
 * Adds a check for kernel size defined by XEN_DEVICETREE_DOM0_SIZE variable,
   whether it is greater or equal to actual kernel size.
   If not, bitbake warns user and adjusts value of XEN_DEVICETREE_DOM0_SIZE.
 * Adds 'virtual/kernel:do_deploy' as a mandatory xen-devicetree dependency via
   XEN_DEVICETREE_DEPEND variable.

Issue-Id: SCM-1567
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Change-Id: I4f250172f1fa599b7a3673ba0887cd49372b7556
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 11:40:03 -05:00
Ross Burton d8dbaa20b2 arm/trusted-firmare-a: add version 2.4
Change-Id: Ia31b459a497bb5029d18a202b8add5edc7fd6872
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 08:57:23 -05:00
Ross Burton e52410e281 arm/trusted-firmware-a: consolidate SRC_URI and S
All the recipes use the same value for SRC_URI and S, so consolidate them
into the include file.

Change-Id: Ieda6b0104e163ce46190e9fc5756a264f7198f25
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 08:57:23 -05:00
Ross Burton 60f5176196 arm-bsp/fvp-common: explicitly select trusted-firmware-a 2.3
These BSPs don't select a version of trusted-firmware-a, for clarity and
allow smooth upgrades explictly select 2.3.

Change-Id: Ieea7d075d709e2006ebf217d802f3eeecfb9a281
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-20 08:57:23 -05:00
Ross Burton 136207e7c1 arm-bsp/fvp-base-arm32: explicitly select trusted-firmware-a 2.2
Previously TF-A 2.3 failed to build for fvp-base-arm32, so explicitly select 2.2 for now.

Change-Id: I21f74861c5d5955ed7890d4e6fafc72dd85fe27f
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-11-20 08:57:23 -05:00
Ross Burton 56180fce2b arm-bsp/a5ds: explicitly select trusted-firmware-a 2.3
This BSP doesn't select a version of trusted-firmware-a, for clarity and
allow smooth upgrades explictly select 2.3.

Change-Id: I4e7ca6ff8322e22406040ba2f220d36e1bde4cae
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-19 10:00:51 -05:00
Ross Burton 067a259cbd arm/trusted-firmware-a: add CVE_PRODUCT
trusted-firmware-a has gone by many names in the CVE database, so add
them all.

Change-Id: I51f64211d10245ffcae010e3a723657ff4114b9c
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-19 10:00:51 -05:00
Ross Burton 197b0732e3 arm/optee-os: add CVE_PRODUCT tag
There are known CVEs for optee-os, so set the CVE_PRODUCT to ensure that
they are found.

Change-Id: Ibe88c2193a8e33f603386beedc76fe60eac1b3ea
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-19 10:00:51 -05:00
Nathan Dunne 214ec04498 arm-autonomy/arm-autonomy-host-image-minimal: Added multiconfig support
Added new documentation file arm-autonomy-multiconfig.md which explains
how to set up a multiconfig build, where both the host and guest are
built simultaneously in the same build dir.

To enable this feature the dependency between host and guest is set in
the image recipe, using the variables described in the documentation.

Issue-Id: SCM-638
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Iae315c128dc6d2b39281312bc1a2ab9b88f6241e
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Nathan Dunne 42c4ba9c96 arm-autonomy/documentation: Updated for gatesgarth branch
Updated arm-autonomy-quickstart.md to suggest a user checkout the
latest gatesgarth branch instead of zeus.

Issue-Id: SCM-1521
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: Idbd54efbe4bdbc31588f726b41b082de89812d60
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Diego Sueiro 9872afc6c7 arm-autonomy/modutils-initscripts: Fix modules.dep update
When building an image with USE_DEPMOD="0" we expect that on the first boot the
modutils.sh initscript will create the modules.dep file if it is empty or not
present.

Change-Id: I0048dc47f807587e723c068b0a4ba24718d66f49
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Diego Sueiro a996166e85 arm-autonomy/init: Change execution order between modutils.sh and checkroot.sh
When '/' is first mounted as read-only, we want to have the checkroot.sh
initscript (which then remounts '/' as rw if allowed) running before the
modutils.sh.
This is because modutils.sh initscript might need to run depmod depending on
the status of the modules.dep file to update it and the '/' needs to be
writable.

Change-Id: Idac9aa19fba6b6bf46532097a667ce0518af515c
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Diego Sueiro e9e01e9be7 arm-autonomy/n1sdp: Add GRUB config when including alternate kernel
For N1SDP as arm-autonomy-host, when alternate-kernel DISTRO_FEATURE is present
we set, as GRUB config, the arm-autonomy-n1sdp-rt-grub.cfg which includes
additional entries for booting with the PREEMPT_RT kernel.

Change-Id: If40aee159ae5ba0efd3d9a5a16ee1c1167fb0504
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Diego Sueiro ce9650ec84 arm-autonomy/n1sdp: Add support for building/installing alternate kernel
For N1SDP as arm-autonomy-host, when alternate-kernel DISTRO_FEATURE is present
we build the linux-linaro-arm-rt (with PREEMPT_RT support) by setting it as the
PREFERRED_PROVIDER_alternate/kernel. As required, we set the
KERNEL_PACKAGE_NAME_pn-linux-linaro-arm-rt to kernel-rt.

Also, include the alternate kernel binary as Image-preempt-rt in the boot
partition of the generated wic image by setting the IMAGE_EFI_BOOT_FILES
variable.

Change-Id: I205caf5ef8b8d6b8a37ec3f4d0981fe8736cae63
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Diego Sueiro a9cd4fc12f arm-autonomy/arm-autonomy-host-image-minimal: Build/Install alternate kernel
This patch introduces the usage of the alternate-kernel DISTRO_FEATURE, and
when it is present we will build and install the alternate kernel set via
PREFERRED_PROVIDER_alternate/kernel.

Change-Id: I1fe7447a5f903d7ff5584813bfb38fca8979e755
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Diego Sueiro 171616a183 arm-autonomy/classes: Introduce alternate-kernel.bbclass
The alternate-kernel.bbclass is to be inherited by image recipes that want to
build and install an alternate kernel (set via
PREFERRED_PROVIDER_alternate/kernel).

It is mandatory to also set the KERNEL_PACKAGE_NAME for the alternate kernel
recipe via KERNEL_PACKAGE_NAME_pn-${PREFERRED_PROVIDER_alternate/kernel} and
its value needs to be different from "kernel" since this is the default set
for PREFERRED_PROVIDER_virtual/kernel.

When building and installing an alternate kernel, the kernel-modules packages
for both virtual/kernel and alternate/kernel will be installed.

Change-Id: I1cd0c425c39206fe449fb5f8761ed6de95cfb442
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Diego Sueiro 3c738c4f69 arm-autonomy/linux-linaro-arm-rt: Add preempt-rt-extras.scc KERNEL_FEATURE
For now, when building the linux-linaro-arm-rt recipe we want these extra
settings:
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_HZ_1000=y

Change-Id: I23573a2b5be512b7a84c71bc50a1a63b2d95dffb
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Diego Sueiro 222fcf4281 arm-autonomy/linux-linaro-arm-rt: add linux-RT patch for xen dynamic events
This patch contain following fix:
 * xen: use handle_fasteoi_irq to handle xen dynamic events

Change-Id: I0b1734247b151d65ca510a074a5de56e8f8f0ada
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-18 11:02:40 -05:00
Ross Burton aee22517e4 gem5/gem5-aarch64-native: bump to 20.0.0.3
Minor point release, that successfully compiles with GCC 9.3.

Change-Id: I22bec41f92ea4ae6e9fb7b6e6706338c0134bf99
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-13 11:55:37 -05:00
Ross Burton 167c854412 gem5/gem5-aarch64-native: don't specify -j twice
There's no need to pass -j here as the scons clas does this already.

Also, BB_NUMBER_THREADS is the number of BitBake threads, not the number
of parallel make jobs.

Change-Id: Ib6179bf05c5ec57b7cbe9c045f7bea86518d35af
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-13 11:55:37 -05:00
Kamil Dziezyk 9a2847c0d6 arm-autonomy/xenguest-init: fix guest shutdown issues after host reboot
This patch contain following changes:
 * xenguest-init stop action uses now blocking call,
   and additional 'xl destroy guest' call if normal shutdown has failed.
 * xenguest-init stop action stops only running guest.
 * xenguest-init script is now caled before xen-tools scripts
   on host shutdown or reboot.
 * xenguest-network-bridge script is now called before ifupdown script
   on host shutdown or reboot.

Change-Id: I46e307fd0ad36b2e35559b4e8a071be9bbc50e34
Issue-Id: SCM-1632
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-13 10:38:44 -05:00
Khasim Mohammed 55daf196a6 arm-bsp/n1sdp: remove swap parition entry from wic image
The swap partition on n1sdp seem to create an issue when shutdown or reboot is run
from the shell prompt, the console stops at "Deactivating swap ...". Hence
removing the swap partition entry from wic image.

Change-Id: I22cf971fdde7e3b8b386c74003983fab3d309cc5
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-13 10:38:44 -05:00
Jon Mason 5fa6bc3a9c arm-bsp: fix missing stable kernels
Corstone, a5ds, and sgi575 were using the meta-kernel, but recent
updates removed support for their non-LTS kernel.  Change to using the
respective kernels present in linux-yocto until it can be upgraded to
the latest version.

Change-Id: I63f2e511fe69051c06e6559950b798c1371cc8e9
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-13 09:23:50 -05:00
Jon Mason 0f0a971458 arm-bsp: Fix u-boot 2020.07 recipe
The u-boot 2020.07 temporary recipe is a copy of 2020.04, and brought
with it a limitation in the recipe to only be used on certain hardware.
Remove this limitation so that it can be used where needed.

Change-Id: I5b99e92f3f440812ebc1fc550e6b860e6530e9b7
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-12 14:04:24 -05:00
Jon Mason 658faaff76 arm-bsp: create u-boot 2020.07 to resolve warning
Poky, etc master branches updated the u-boot recipes to use 2020.10,
causing bbappends for 2020.07 to no longer function.  Create a temporary
recipe for 2020.07 until all the BSPs can update to support the latest
version.

Change-Id: Ib5fc9b8a2ff2ccf01be3640a34429d2c1e57b627
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-10 11:04:20 -05:00
Diego Sueiro db1d714029 arm-bsp/n1sdp: Add wic.gz and wic.bmap to IMAGE_FSTYPES
Speed up wic image flashing by including wic.gz and wic.bmap to IMAGE_FSTYPES.

Change-Id: I503b6ede5aaf188aabd2a925c2c42e5872d7713a
Issue-Id: SCM-1520
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2020-11-10 11:04:20 -05:00
Usama Arif 56514201ad tc0/spm: boot SP according to boot order specified in manifest
This is currently in review at:
https://review.trustedfirmware.org/c/hafnium/hafnium/+/4997/36

Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-27 17:35:35 +00:00
Arunachalam Ganapathy 86f9419b9d arm-bsp: Enable SPM build option in yocto framework
This patch adds:
spm, tf-a-tests recipes.
This builds tf-a with SPM at S-EL2 and test secure partitions at S-EL1.

Change-Id: Ia2f44f4000aa0786b945bc8fb66c9edb1a0094e8
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-27 17:35:26 +00:00
Usama Arif da57312334 arm-bsp/images: Add tc0-kernel-image
This depends on trusted-firmware-a which is the last component to be built.
Calling bitbake tc0-kernel-image will create all the required images
to boot poky.

Change-Id: Ia8675b048db4a127d32394f536632ce88fe20826
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-26 18:26:37 +00:00
Usama Arif 70a9c4991e arm-bsp/u-boot: update SHA for tc0
Change-Id: Ideb4866df92d05bdc07b53f47346ae4f381dfc6d
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-26 18:26:35 +00:00
Usama Arif 29cee51f84 arm-bsp/tc0: Enable verified u-boot
This involes creating the fitImage which contains
both the kernel and ramdisk. The fitImage is also
signed.

Change-Id: Iaedffd54751585a7ef6b467d63f5f8fb6e744aa7
Signed-off-by: Usama Arif <usama.arif@arm.com>
2020-10-26 18:20:22 +00:00
344 changed files with 30320 additions and 6807 deletions
+15 -4
View File
@@ -52,7 +52,7 @@ machine-coverage:
# Second phase, the actual build jobs
#
a5ds:
corstone500:
extends: .build
corstone700-fvp:
@@ -61,15 +61,15 @@ corstone700-fvp:
corstone700-mps3:
extends: .build
foundation-armv8:
extends: .build
fvp-base:
extends: .build
fvp-base-arm32:
extends: .build
fvp-base-arm32/external-gcc-arm32:
extends: .build
gem5-arm64:
extends: .build
@@ -88,6 +88,9 @@ musca-s1:
n1sdp:
extends: .build
n1sdp/armgcc:
extends: .build
qemuarm64-secureboot:
extends: .build
@@ -126,3 +129,11 @@ prune-sstate:
when: manual
script:
- find $SSTATE_DIR -type f -atime +30 -delete
# Delete all sstate
delete-sstate:
extends: .setup
stage: bootstrap
when: manual
script:
- rm -rf $SSTATE_DIR/*
+6
View File
@@ -0,0 +1,6 @@
header:
version: 9
local_conf_header:
cc: |
GCCVERSION = "arm-10.2"
+1 -1
View File
@@ -5,7 +5,7 @@ distro: poky
defaults:
repos:
refspec: gatesgarth
refspec: master
repos:
meta-arm:
-1
View File
@@ -4,7 +4,6 @@ header:
repos:
meta-clang:
url: https://github.com/kraj/meta-clang
refspec: gatesgarth
local_conf_header:
clang: |
+1 -1
View File
@@ -3,4 +3,4 @@ header:
includes:
- base.yml
machine: a5ds
machine: corstone500
+8
View File
@@ -0,0 +1,8 @@
header:
version: 9
local_conf_header:
cc: |
PNBLACKLIST[gcc-cross-arm] = "Using external toolchain"
TCMODE = "external-arm"
EXTERNAL_TOOLCHAIN = "/usr/local/gcc-arm-10.2-2020.11-aarch64-arm-none-linux-gnueabihf"
-6
View File
@@ -1,6 +0,0 @@
header:
version: 9
includes:
- base.yml
machine: foundation-armv8
@@ -0,0 +1,26 @@
# This class is to be inherited by image recipes that want to build and install
# an alternate kernel (set via PREFERRED_PROVIDER_alternate/kernel).
#
# It is mandatory to also set the KERNEL_PACKAGE_NAME for the alternate kernel
# recipe via KERNEL_PACKAGE_NAME_pn-${PREFERRED_PROVIDER_alternate/kernel} and
# its value needs to be different from "kernel" since this is the default set
# for PREFERRED_PROVIDER_virtual/kernel.
#
# An example of these settings can be found at meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc
#
# When building and installing an alternate kernel, the kernel-modules packages
# for both virtual/kernel and alternate/kernel will be installed.
PREFERRED_PROVIDER_alternate/kernel ??= ""
python () {
alternate_kernel = d.getVar('PREFERRED_PROVIDER_alternate/kernel')
if alternate_kernel:
alternate_kernel_pkg_name = d.getVar('KERNEL_PACKAGE_NAME_pn-%s' % alternate_kernel)
if alternate_kernel_pkg_name:
d.appendVar('EXTRA_IMAGEDEPENDS', ' ' + alternate_kernel)
d.appendVar('IMAGE_INSTALL', ' kernel-modules')
d.appendVar('IMAGE_INSTALL', ' ' + alternate_kernel_pkg_name + '-modules')
else:
raise bb.parse.SkipRecipe("No KERNEL_PACKAGE_NAME_pn-%s set" % alternate_kernel )
}
@@ -43,14 +43,17 @@ XENGUEST_IMAGE_KERNEL ??= "Image"
# be included in the xenguest image)
XENGUEST_IMAGE_DISK_SIZE ??= "${@ '4' if not d.getVar('INITRAMFS_IMAGE') else '0'}"
# set empty partition to be used by xenguest-manager for this image
XENGUEST_IMAGE_DISK_DEVICE ??= ""
#
# XENGUEST_IMAGE_DISK PARTITIONS is used to describe the partitions to setup
# XENGUEST_IMAGE_DISK_PARTITIONS is used to describe the partitions to setup
# and their content.
# It must be set to a space separated list of entries with each entry having
# the format num:sz:fs:[file] where:
# the format num:sz:[fs]:[file] where:
# - num is a partition number
# - sz is the partition size in Gigabit
# - fs is the filesystem to use for the partition
# - sz is the partition size in MB or GB(default), e.g 1000M or 1[G]
# - fs is optional filesystem to use for the partition
# - file is optionally pointing to a file to use as content of the partition
# Please check image_types_xenguest.bbclass for rootfs handling of files
#
@@ -129,21 +132,27 @@ xenguest_image_create() {
# create disk if needed
disksize="${XENGUEST_IMAGE_DISK_SIZE}"
if [ -z "$disksize" ]; then
disksize="0"
fi
if [ $disksize -gt 0 ]; then
# setup disk size
call_xenguest_mkimage update --disk-reset-config --disk-size=$disksize
case ${disksize:=0} in
0|0M|0G)
;;
*)
# setup disk size
call_xenguest_mkimage update --disk-reset-config --disk-size=$disksize
diskparts="${XENGUEST_IMAGE_DISK_PARTITIONS}"
if [ -n "$diskparts" ]; then
for arg in $diskparts; do
call_xenguest_mkimage update --disk-add-part=$arg
done
fi
diskdevice="${XENGUEST_IMAGE_DISK_DEVICE}"
if [ -n "$diskdevice" ]; then
call_xenguest_mkimage update --disk-device="${diskdevice}"
fi
;;
esac
diskparts="${XENGUEST_IMAGE_DISK_PARTITIONS}"
if [ -n "$diskparts" ]; then
for arg in $diskparts; do
call_xenguest_mkimage update --disk-add-part=$arg
partnum="$(expr $partnum + 1)"
done
fi
fi
if [ "${XENGUEST_IMAGE_AUTOBOOT}" = "1" ]; then
call_xenguest_mkimage update --set-param=GUEST_AUTOBOOT=1
+1 -2
View File
@@ -9,12 +9,11 @@ BBFILES += " \
BBFILE_COLLECTIONS += "meta-arm-autonomy"
BBFILE_PATTERN_meta-arm-autonomy = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-arm-autonomy = "6"
BBFILE_PRIORITY_meta-arm-autonomy = "5"
LAYERDEPENDS_meta-arm-autonomy = " \
core \
yocto \
openembedded-layer \
networking-layer \
virtualization-layer \
"
LAYERSERIES_COMPAT_meta-arm-autonomy = "gatesgarth"
@@ -11,7 +11,7 @@ KERNEL_IMAGETYPE = "Image"
IMAGE_FSTYPES += "tar.bz2"
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "5.4%"
PREFERRED_VERSION_linux-yocto ?= "5.10%"
DISTRO_FEATURES += "arm-autonomy-guest"
@@ -29,7 +29,7 @@ First you must download the Yocto layers needed:
- all other layers you might want to use
For each of the downloaded layer make sure you checkout the release of Yocto
you want to use (for example zeus using `git checkout zeus`).
you want to use (for example gatesgarth using `git checkout gatesgarth`).
Please follow [Yocto documentation](https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html)
in order to have the required dependencies.
@@ -119,10 +119,6 @@ To boot the system using an u-boot base board you will need to:
In this example the addresses might need to be adapted depending on your board.
For arm-autonomy host on FVP-Base u-boot has been modified such that
`booti 0x84000000 - 0x83000000` is the default boot command. If FVP-Base is your
MACHINE target there should be no need to interfere with u-boot.
Guest project
-------------
The guest projects are not target specific and will use a Yocto MACHINE defined
@@ -11,12 +11,17 @@ perform a couple of customizations in the generated wic image:
1 MiB per physical volume, hence it needs to be taken into account when
setting GUEST_PART_SIZE.
2. The wic image partition layout and contents with a custom wks file via
2. Set the boot partition size (default: 100M) via `BOOT_PART_SIZE` and
`BOOT_PART_SIZE_UNIT` (M or G) variables in any conf file. The default
bootimg is ~44M so 100M leaves just over 50M of free space.
3. The wic image partition layout and contents with a custom wks file via
`ARM_AUTONOMY_WKS_FILE` variable (default:
arm-autonomy-n1sdp-efidisk.wks.in which is affected by GUEST_PART_SIZE,
GUEST_PART_SIZE_UNIT and GRUB_CFG_FILE variables).
GUEST_PART_SIZE_UNIT, BOOT_PART_SIZE, BOOT_PART_SIZE_UNIT and
GRUB_CFG_FILE variables).
3. Custom grub.cfg file via `GRUB_CFG_FILE` (default:
4. Custom grub.cfg file via `GRUB_CFG_FILE` (default:
arm-autonomy-n1sdp-grub.cfg) variable to be set in any conf file. The full
path or relative to `ARM_AUTONOMY_WKS_FILE` should be set.
@@ -70,7 +70,10 @@ The following parameters are available:
This variable is only used if XEN_DEVICETREE_XEN_BOOTARGS has a value
containing "dom0_mem=${XEN_DEVICETREE_DOM0_MEM}" as the memory assigned to
dom0 is defined using Xen boot arguments.
This variable is set by default to "1024M".
This variable is set by default to "1024M,max:1024", and cannot be empty.
The value can simply specify a size, e.g. "1024M", but best practice is to
also provide a max, documented here:
https://wiki.xenproject.org/wiki/Xen_Project_Best_Practices
- XEN_DEVICETREE_DOM0_BOOTARGS: Boot arguments to pass to Dom0 Linux when
booting it.
@@ -84,7 +87,8 @@ The following parameters are available:
- XEN_DEVICETREE_DOM0_ADDR: This is the address from which the Linux kernel to
be used for Dom0 will be copied. When using u-boot, this is the address at
which you will load the kernel Image before starting Xen.
This variable is set by default to "0x80080000".
This variable is set by default to "0x80080000", and cannot be empty.
Values for this variable can be in hex (prefixed with '0x') or in decimal.
- XEN_DEVICETREE_DOM0_SIZE: This is the size of the kernel loaded at
${XEN_DEVICETREE_DOM0_ADDR}. Xen will copy this amount of data inside the
@@ -92,7 +96,8 @@ The following parameters are available:
size but can be bigger. You must be careful not to have a value too big as it
could slow down boot or copy other parts with it (like the DTB).
You might need to increase this if you use a kernel with a bundled initramfs.
This variable is set by default to "0x01000000".
This variable is set by default to "0x01000000" and cannot be empty.
Values for this variable can be in hex (prefixed with '0x') or in decimal.
- XEN_DEVICETREE_DTSI_MERGE: This variable contains the list of dtsi files that
must be included inside the generated DTB file. By default the only one
@@ -23,7 +23,7 @@ Usage
-----
xenguest-manager must be called like this:
`xenguest-manager OPERATION [OPTIONS]`
`xenguest-manager [-v(v)] OPERATION [OPTIONS]`
The following operations are available:
- create XENGUEST_IMAGE [GUESTNAME]: create a guest from a xenguest image file
as guest GUESTNAME. If GUESTNAME is not given the image file name is used
@@ -37,6 +37,9 @@ The following operations are available:
- status [GUESTNAME]: print the current status of GUESTNAME. If GUESTNAME is
not given, print the status of all guests.
Passing -v or -vv will increase the logging written to the logfile.
The terminal will always show only error messages, regardless of the logfile.
For a detailed help on available options please use:
`xenguest-manager --help`
@@ -65,6 +68,13 @@ The following parameters are available:
name).
This is set by default to "/usr/share/guests".
- XENGUEST_MANAGER_LOG_LEVEL: Set the default log level for xenguest manager. Must
be one of ERROR, INFO, VERBOSE (default: ERROR). The extra will be
written to /var/log/xenguest.
If a verbosity argument (-v or -vv) is passed to xenguest-manager directly, it
will override the setting in xenguest-manager.conf
Init scripts
------------
@@ -80,7 +90,7 @@ directory on the target:
Inside the directory, scripts will be executed in alphabetical order.
Since these scripts are sourced by xenguest-manager they can acccess functions
Since these scripts are sourced by xenguest-manager, they can acccess functions
and variables from the parent file's scope, including:
- ${guestname} : The name of the guest being created
@@ -89,12 +99,31 @@ and variables from the parent file's scope, including:
- ${guestcfgfile} : The name of the config file for the starting guest
- ${LOGFILE} : The file to append any logging to, e.g.
echo "Hello, World" >> ${LOGFILE}
- log() : Used to write a log to the logfile, default level INFO.
Takes an optional log level and a message body
e.g. log ERROR "blah"
Options for log level: ERROR, INFO, VERBOSE, and FATAL, which
will call exit 1 immediately after logging the message
- log_command() : Used to call a shell command and log that it has been
called, as well as capturing both stdout and stderr.
By default the command output is dumped to the logfile as an error
if the command returns a status > 0, or as a verbose message if the
whole script is running in verbose mode. An optional log level can
be passed to alter the level the log should be if the command returns
a status >0,
e.g. log_command INFO "ls -lh ~"
Options for log level: ERROR, INFO, and VERBOSE
Attempting to call any other functions from xenguest_manager in an init script may
result in a fatal error, from which cleanup is not guarenteed.
Sourcing also allows the script to access params.cfg.
An example of how to create the directory and install an init shell script can
be found in:
recipes-extended/xenguest/xenguest-network.bb
@@ -58,12 +58,19 @@ order.
### disk.cfg and disk-files
disk.cfg contains the guest disk description (disk size and disk partitions).
The file contains the following entries:
- `DISK_SIZE=X`: size of the disk to create in GB
- `DISK_SIZE=X`: size of the disk to create in MB or GB(default),
e.g. 1000M or 4[G]
- `DISK_PARTX=SIZE:FS:CONTENT`: create a partition number X (1 to 4) with a
size of SIZE GB, format it with filesystem FS (can be ext2, ext3, ext4, vfat
or swap) and extract CONTENT as initial partition content
(.tar[.gz|.xz|.bz2] file or img[.gz|.bz2] file to be dumped in the partition). FS and
CONTENT can be empty.
size of SIZE MB or GB(default), e.g 1000M or 2[G].
Format it with filesystem FS (can be ext2, ext3, ext4, vfat or swap)
and extract CONTENT as initial partition content (.tar[.gz|.xz|.bz2] file
or img[.gz|.bz2] file to be dumped in the partition).
FS and CONTENT can be empty.
- `DISK_DEVICE=X`: disk or partition to be used by lvm. Setting this option
allows to bind guest disk with any partition or disk available on host,
e.g. /dev/sda3 or /dev/sdb.
This variable is not set by default, but if set, it overrides disk settings
inside xenguest-manager.conf - 'XENGUEST_VOLUME_DEVICE'.
The disk-files contain files to be used for initializing the disk partitions
content. Those should be used to create a LVM or a physical disk and initialize
@@ -105,12 +112,12 @@ For a detailed help on available operations, please use:
image file. Several script can be added and the basename of FILE is used to
distinguish them (calling the option twice with the same file will update the
script in the image with the second one).
--disk-size=SIZE: set the guest disk size to SIZE in GB. Calling this with 0
disable the guest disk.
--disk-size=SIZE: set the guest disk size to SIZE in MB or GB(default),
e.g 1000M or 2[G]. Calling this with 0 disable the guest disk.
- --disk-add-part=NUM:SIZE:FS:CONTENT: This is adding a partition to the
xenguest image disk. The partition is described with the arguments:
- NUM: partition number.
- SIZE: partition size in GB.
- SIZE: partition size in MB or GB(default), e.g 1000M or 2[G].
- FS: filesystem to format the partition with. This can be ext2, ext3, ext4,
vfat of swap. If empty the partition is not formated.
- CONTENT: tar of img file to use to initialize the partition. The file must
@@ -14,8 +14,19 @@ WKS_FILE = "${ARM_AUTONOMY_WKS_FILE}"
GUEST_PART_SIZE ?= "4097"
GUEST_PART_SIZE_UNIT ?= "M"
# Set default boot partition size and unit
BOOT_PART_SIZE ?= "100"
BOOT_PART_SIZE_UNIT ?= "M"
# The GRUB_CFG_FILE affects arm-autonomy-n1sdp-efidisk.wks.in file
GRUB_CFG_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg"
#
# When alternate-kernel DISTRO_FEATURE is present we set the
# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has
# additional entries for booting with the PREEMPT_RT kernel.
GRUB_CFG_FILE ?= "${@bb.utils.contains('DISTRO_FEATURES','alternate-kernel', \
'${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-rt-grub.cfg', \
'${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg' \
, d)}"
# From arm-autonomy-n1sdp-efidisk.wks.in, the /boot partition is /dev/sda1, and
# the "/" partition is /dev/sda2.
@@ -38,3 +49,42 @@ do_image_wic[depends] += "xen:do_deploy"
IMAGE_EFI_BOOT_FILES += "xen-n1sdp.efi;xen.efi"
IMAGE_EFI_BOOT_FILES += "${XEN_MOD_DEVICETREE_DTBS}"
# Use 5.4 kernel until later versions have been validated for autonomy-host
PREFERRED_PROVIDER_virtual/kernel = "linux-linaro-arm"
PREFERRED_VERSION_linux-linaro-arm = "5.4%"
# When alternate-kernel DISTRO_FEATURE is present we set the linux-linaro-arm-rt
# by default
PREFERRED_PROVIDER_alternate/kernel ?= "\
${@bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', \
'linux-linaro-arm-rt', '', d)}"
KERNEL_PACKAGE_NAME_alternate/kernel ?= "kernel-rt"
# When alternate-kernel DISTRO_FEATURE is present we set the kernel-rt by
# default
KERNEL_PACKAGE_NAME_pn-linux-linaro-arm-rt = "\
${@ d.getVar('KERNEL_PACKAGE_NAME_alternate/kernel') \
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) \
else 'kernel' }"
# Relative path from DEPLOY_DIR_IMAGE of the Kernel PREEMPT_RT deployed Image
KERNEL_RT_IMAGE ?= "kernel-rt/Image-n1sdp.bin;Image-preempt-rt"
# Only include the Kernel PREEMPT_RT Image if we are building with
# alternate-kernel DISTRO_FEATURE
IMAGE_EFI_BOOT_FILES += "\
${@ d.getVar('KERNEL_RT_IMAGE',d) or '' \
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \
d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
EFIDIR ?= "/EFI/BOOT"
GRUB_CFG_EXTRA_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg;.${EFIDIR}}"
# When alternate-kernel DISTRO_FEATURE is present we set the
# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has
# additional entries for booting with the PREEMPT_RT kernel and also includes
# the main GRUB config file set by GRUB_CFG_EXTRA_FILE.
IMAGE_EFI_BOOT_FILES += "\
${@ d.getVar('GRUB_CFG_EXTRA_FILE',d) or '' \
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \
d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
@@ -0,0 +1,7 @@
# Yocto kernel-cache sets CONFIG_NLS_CODEPAGE_437=m for LINUX_KERNEL_TYPR=preempt-rt
CONFIG_NLS_CODEPAGE_437=y
# Yocto kernel-cache sets CONFIG_NLS_ISO8859_1=m for LINUX_KERNEL_TYPR=preempt-rt
CONFIG_NLS_ISO8859_1=y
# Set the timer interrupt run at 1000 Hz to have a fast response
CONFIG_HZ_1000=y
@@ -0,0 +1,3 @@
define KFEATURE_DESCRIPTION "Extra kernel configs when building with PREEMPT_RT"
kconf non-hardware preempt-rt-extras.cfg
@@ -0,0 +1,80 @@
From c2971c8a3f076ea8a522ce4fbb367d112d86c13a Mon Sep 17 00:00:00 2001
From: Stefano Stabellini <sstabellini@kernel.org>
Date: Mon, 27 Apr 2020 16:15:26 -0700
Subject: [PATCH] xen: use handle_fasteoi_irq to handle xen dynamic events
When handling Xen events, we need to make sure the following sequence is
followed:
- mask event
- handle event and clear event (the order does not matter)
- unmask event
It is not possible to implement this flow with handle_edge_irq, so
switch back to handle_fasteoi_irq. Please note that Xen event irqs are
ONESHOT. Also note that handle_fasteoi_irq was in-use before the
following commit, that is partially reverted by this patch:
7e186bdd0098 xen: do not clear and mask evtchns in __xen_evtchn_do_upcall
PIRQ handling is left unchanged.
This patch fixes a domU hang observed when using LinuxRT as dom0 kernel.
Link: https://lkml.org/lkml/2020/4/27/1287
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Upstream-Status: Inappropriate since the upstream solution diverges from this patch
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
---
drivers/xen/events/events_base.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 6c8843968a52..1873a19b8b24 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -845,7 +845,7 @@ int bind_evtchn_to_irq(unsigned int evtchn)
goto out;
irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
- handle_edge_irq, "event");
+ handle_fasteoi_irq, "event");
ret = xen_irq_info_evtchn_setup(irq, evtchn);
if (ret < 0) {
@@ -978,7 +978,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu)
handle_percpu_irq, "virq");
else
irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
- handle_edge_irq, "virq");
+ handle_fasteoi_irq, "virq");
bind_virq.virq = virq;
bind_virq.vcpu = xen_vcpu_nr(cpu);
@@ -1387,12 +1387,6 @@ static void ack_dynirq(struct irq_data *data)
clear_evtchn(evtchn);
}
-static void mask_ack_dynirq(struct irq_data *data)
-{
- disable_dynirq(data);
- ack_dynirq(data);
-}
-
static int retrigger_dynirq(struct irq_data *data)
{
unsigned int evtchn = evtchn_from_irq(data->irq);
@@ -1595,8 +1589,7 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
.irq_mask = disable_dynirq,
.irq_unmask = enable_dynirq,
- .irq_ack = ack_dynirq,
- .irq_mask_ack = mask_ack_dynirq,
+ .irq_eoi = ack_dynirq,
.irq_set_affinity = set_affinity_irq,
.irq_retrigger = retrigger_dynirq,
--
2.17.1
@@ -0,0 +1,7 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-5.4:"
SRC_URI_append = " \
file://0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch \
"
KERNEL_FEATURES += "features/arm-autonomy/preempt-rt-extras.scc"
@@ -3,7 +3,7 @@
# can directly dd to boot media. Uses a custom grub.cfg file to configure the boot.
# First boot partition normally populated as /dev/sda1
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --size="${BOOT_PART_SIZE}${BOOT_PART_SIZE_UNIT}" --label msdos --active --align 1024
# Second rootfs partition normally populated as /dev/sda2
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
@@ -0,0 +1,28 @@
set term="vt100"
set default="3"
set timeout="5"
source $prefix/arm-autonomy-n1sdp-grub.cfg
menuentry 'N1SDP PREEMPT_RT ACPI Boot' {
linux /Image-preempt-rt $kernel_cmdline acpi=force
}
menuentry 'N1SDP PREEMPT_RT Single-Chip Boot (Device Tree)' {
devicetree /n1sdp-single-chip.dtb
linux /Image-preempt-rt $kernel_cmdline
}
menuentry 'N1SDP PREEMPT_RT Multi-Chip Boot (Device Tree)' {
devicetree /n1sdp-multi-chip.dtb
linux /Image-preempt-rt $kernel_cmdline
}
menuentry 'N1SDP PREEMPT_RT Arm Autonomy (Xen) Single-Chip Boot (Device Tree)' {
# no_argumants under here is a workaround for a bug
# also any kernel or dom0 cmdline arguments has to be passed via dtb
# because any arguments put here will be ignored by xen
xen_hypervisor /xen.efi no_arguments=use_dtb_for_xen_or_kernel_cmdline
xen_module /Image-preempt-rt
devicetree /n1sdp-single-chip-xen.dtb
}
@@ -1,16 +0,0 @@
Upstream Status: Inappropriate [meta-arm-autonomy specifc u-boot config]
Signed-off-by: Nathan Dunne <nathan.dunne@arm.com>
diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
index e63c335f85..9ee050a4a6 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -162,7 +162,7 @@
#elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
#define CONFIG_EXTRA_ENV_SETTINGS \
"kernel_name=Image\0" \
- "kernel_addr=0x80080000\0" \
+ "kernel_addr=0x84000000\0" \
"initrd_name=ramdisk.img\0" \
"initrd_addr=0x88000000\0" \
"fdtfile=devtree.dtb\0" \
@@ -1,9 +0,0 @@
# Machine specific u-boot
FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"
#
# FVP BASE
#
SRC_URI_append_fvp-base = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ' file://xen_u-boot_kernel_addr.patch', '', d)}"
@@ -0,0 +1,39 @@
#!/bin/sh
CONTAINER_IMAGE_FILE="###CONTAINER_IMAGE_FILE###"
CONTAINER_IMAGE_NAME_AND_TAG="###CONTAINER_IMAGE_NAME_AND_TAG###"
CONTAINER_IMAGE_FILE_KEEP="###CONTAINER_IMAGE_FILE_KEEP###"
has_docker_image() {
docker image inspect "$1" >/dev/null 2>&1
}
start() {
# Image does not exist and image file exists: Import the image.
if ! has_docker_image ${CONTAINER_IMAGE_NAME_AND_TAG} && \
[ -f "/usr/share/docker/images/${CONTAINER_IMAGE_FILE}" ]; then
echo "Importing ${CONTAINER_IMAGE_NAME_AND_TAG} container image..."
docker import \
/usr/share/docker/images/${CONTAINER_IMAGE_FILE} \
${CONTAINER_IMAGE_NAME_AND_TAG} 2>&1 || {
echo "Import ${CONTAINER_IMAGE_NAME_AND_TAG} container image: Failed."
exit $?
}
echo "Import ${CONTAINER_IMAGE_NAME_AND_TAG} container image: Done."
if [ "${CONTAINER_IMAGE_FILE_KEEP}" != "1" ]; then
rm /usr/share/docker/images/${CONTAINER_IMAGE_FILE}
fi
fi
}
case "$1" in
start)
start && exit 0
;;
*)
echo "Usage: $0 {start}"
exit 2
esac
exit $?
@@ -0,0 +1,79 @@
#
# This recipe imports a docker container image to the xenguest image
# Notes:
# - Users should add docker in the local.conf of their target with
# DISTRO_FEATURES += " docker" to make sure docker is installed.
# - The CONTAINER_IMAGE_FILE variable defines the docker
# container image to be imported and should be set in local.conf.
# - The CONTAINER_IMAGE_FILE_KEEP variable defines the
# behaviour that if the container image file is kept after import.
# Setting this variable to 1 means keep the container image file after
# import. This variable can be set in local.conf.
# - The CONTAINER_IMAGE_NAME_AND_TAG variable defines the name and
# tag of the imported image. The value of this variable should follow
# the format of `NAME:TAG`. This variable can be set in local.conf.
#
DESCRIPTION = "Import a docker image to xenguest"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
CONTAINER_IMAGE_FILE ??= ""
CONTAINER_IMAGE_FILE_KEEP ??= ""
CONTAINER_IMAGE_NAME_AND_TAG ??= "local:local"
inherit features_check
REQUIRED_DISTRO_FEATURES = "docker"
python __anonymous() {
# Check if `CONTAINER_IMAGE_FILE` is empty.
container_image_file = d.getVar('CONTAINER_IMAGE_FILE')
if not container_image_file:
raise bb.parse.SkipRecipe("CONTAINER_IMAGE_FILE is empty")
# In case we have a symlink we need to convert the link to its realpath.
if os.path.islink(container_image_file):
container_image_file = os.path.realpath(container_image_file)
bb.warn("Given CONTAINER_IMAGE_FILE: %s is a symlink, "
"convert the link to its realpath: %s" %
(d.getVar('CONTAINER_IMAGE_FILE'), container_image_file))
d.setVar('CONTAINER_IMAGE_FILE', container_image_file)
# Check if the container image file exists.
# The container image file here is either the real file or the symlink target.
if not os.path.exists(container_image_file):
raise bb.parse.SkipRecipe("CONTAINER_IMAGE_FILE: %s does not exist." %
container_image_file)
# Here we can ensure that the CONTAINER_IMAGE_FILE exists and is valid.
# Therefore we can append this file to SRC_URI.
d.appendVar('SRC_URI', ' file://' + container_image_file + ';unpack=0')
}
S = "${WORKDIR}"
SRC_URI = "file://import_container.sh"
inherit update-rc.d
INITSCRIPT_PARAMS = "start 30 2 3 4 5 ."
INITSCRIPT_NAME = "import_container.sh"
do_install() {
install -d ${D}${sysconfdir}/init.d
install -d -m 755 ${D}${datadir}/docker/images
install -m 777 ${CONTAINER_IMAGE_FILE} ${D}${datadir}/docker/images/.
install -m 755 import_container.sh ${D}${sysconfdir}/init.d
BASENAME_CONTAINER_IMAGE_FILE=$(basename "${CONTAINER_IMAGE_FILE}")
sed -i "s,###CONTAINER_IMAGE_FILE###,${BASENAME_CONTAINER_IMAGE_FILE}," \
${D}${sysconfdir}/init.d/import_container.sh
sed -i "s,###CONTAINER_IMAGE_NAME_AND_TAG###,${CONTAINER_IMAGE_NAME_AND_TAG}," \
${D}${sysconfdir}/init.d/import_container.sh
sed -i "s,###CONTAINER_IMAGE_FILE_KEEP###,${CONTAINER_IMAGE_FILE_KEEP}," \
${D}${sysconfdir}/init.d/import_container.sh
}
FILES_${PN} += "${datadir}/docker/images"
RDEPENDS_${PN} = "packagegroup-docker-runtime-minimal"
@@ -0,0 +1 @@
CONFIG_FEATURE_TAR_LONG_OPTIONS=y
@@ -0,0 +1,4 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
# The --exclude flag in Busybox tar is required by xenguest-mkimage
SRC_URI += "file://feature_tar_long_options.cfg"
@@ -2,7 +2,11 @@
DESCRIPTION = "Arm Autonomy stack host minimal image"
inherit core-image
# When alternate-kernel DISTRO_FEATURE is present we will build
# and install the alternate kernel
inherit ${@bb.utils.filter('DISTRO_FEATURES', 'alternate-kernel', d)}
inherit core-image features_check
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
@@ -10,12 +14,21 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
# The ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS variable can be used to include in the
# image one or several xenguest images.
# The list must be space separated and each entry must have the following
# format: URL[;guestname=NAME]
# format: URL[;params]
# - URL can be the full path to a file or a Yocto compatible SRC_URI url
# - guestname=NAME can be used to specify the name of the guest. If not
# specified the basename of the file (without .xenguest extension) is used.
# - params encompasses two values that can be optionally set:
# - guestname=NAME can be used to specify the name of the guest. If not
# specified the default value is the basename of the file
# (without .xenguest extension).
# - guestcount=NUM can be used to created NUM guests with the same config.
# All guests after the first will have numbers appended to the guestname,
# starting from 2. In the rootfs additional xenguest files will be
# symlinks to the original.
# params should be semicolon seperated, without a space, and can appear in
# any order.
#
# Here are examples of values:
# /home/mydir/myguest.xenguest;guestname=guest1
# /home/mydir/myguest.xenguest;guestname=guest1;guestcount=3
# http://www.url.com/testguest.xenguest
#
# If you are using the output of an other Yocto project, you should use the
@@ -67,13 +80,14 @@ DO_IMAGE_MCDEPENDS := "${@ '${MC_DOIMAGE_MCDEPENDS}' if d.getVar('BBMULTICONFIG'
# Apply mc dependency. Empty string if multiconfig not enabled
do_image[mcdepends] += "${DO_IMAGE_MCDEPENDS}"
REQUIRED_DISTRO_FEATURES += 'arm-autonomy-host'
REQUIRED_DISTRO_FEATURES += 'xen'
python __anonymous() {
if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True, d):
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'arm-autonomy-host'")
if bb.utils.contains('DISTRO_FEATURES', 'xen', False, True, d):
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'xen'")
import re
guestfile_pattern = re.compile(r"^([^;]+);")
guestname_pattern = re.compile(r";guestname=([^;]+);?")
guestcount_pattern = re.compile(r";guestcount=(\d+);?")
# Check in ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS for extra guests and add them
# to SRC_URI with xenguest parameter if not set
@@ -83,16 +97,19 @@ python __anonymous() {
# If the user just specified a file instead of file://FILE, add
# the file:// prefix
if guest.startswith('/'):
guestfile = ''
guestname = ''
if ';guestname=' in guest:
# user specified a guestname
guestname = guest.split(';guestname=')[1]
guestfile = guest.split(';guestname=')[0]
else:
# no guestname so use the basename
guestname = os.path.basename(guest)
guestfile = guest
guestname = os.path.basename(guest)
guestfile = guest
guestcount = "1"
f = guestfile_pattern.search(guest)
n = guestname_pattern.search(guest)
c = guestcount_pattern.search(guest)
if f is not None:
guestfile = f.group(1)
if n is not None:
guestname = n.group(1)
if c is not None:
guestcount = c.group(1)
# in case we have a link we need the destination
guestfile = os.path.realpath(guestfile)
@@ -101,7 +118,7 @@ python __anonymous() {
raise bb.parse.SkipRecipe("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS entry does not exist: " + guest)
# In case the file is a symlink make sure we use the destination
d.appendVar('SRC_URI', ' file://' + guestfile + ';guestname=' + guestname)
d.appendVar('SRC_URI', ' file://' + guestfile + ';guestname=' + guestname + ';guestcount=' + guestcount)
else:
# we have a Yocto URL
try:
@@ -137,8 +154,15 @@ python add_extern_guests () {
# Add file extension if not there
if not dstname.endswith('.xenguest'):
dstname += '.xenguest'
if not bb.utils.copyfile(path, guestdir + '/' + dstname):
bb.fatal("Fail to copy Guest file " + path)
if 'guestcount' in parm:
guestcount = int(parm['guestcount']) + 1
for i in range(2, guestcount):
os.symlink('./' + dstname, guestdir + '/' + dstname.replace('.xenguest', str(i) + '.xenguest'))
}
IMAGE_PREPROCESS_COMMAND += "add_extern_guests; "
@@ -19,7 +19,7 @@ DESCRIPTION = "Add entries in DTB for Xen and Dom0"
XEN_DEVICETREE_DEPEND_append = " virtual/kernel:do_deploy"
XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
XEN_DEVICETREE_XEN_BOOTARGS ?= "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}"
XEN_DEVICETREE_DOM0_MEM ?= "1024M"
XEN_DEVICETREE_DOM0_MEM ?= "1024M,max:1024M"
XEN_DEVICETREE_DOM0_BOOTARGS ?= "console=hvc0 earlycon=xen"
XEN_DEVICETREE_DOM0_ADDR ?= "0x80080000"
XEN_DEVICETREE_DOM0_SIZE ?= "0x01000000"
@@ -30,11 +30,36 @@ XEN_DEVICETREE_DTSI_MERGE ?= "xen.dtsi"
inherit nopackages deploy
DEPENDS += "dtc-native"
PACKAGE_ARCH = "${MACHINE_ARCH}"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install[noexec] = "1"
# Validate xen devicetree variables
python __anonymous() {
# Compare values of a list of variables to a regex pattern
def validate_type(pattern, var_list):
for varname in var_list:
if d.getVar(varname):
if not pattern.match(d.getVar(varname)):
raise bb.parse.SkipRecipe(d.getVar(varname) + "' is not a valid value for " + varname + "!")
else:
raise bb.parse.SkipRecipe('Required variable ' + varname + ' is empty!')
import re
num_vars_to_check = ['XEN_DEVICETREE_DOM0_ADDR', 'XEN_DEVICETREE_DOM0_SIZE']
size_vars_to_check = ['XEN_DEVICETREE_DOM0_MEM']
num_pattern = re.compile(r'((0x[0-9a-fA-F]+)|[0-9]+)$')
size_pattern = re.compile(r'[0-9]+[MG](,max:[0-9]+[MG])?$')
validate_type(num_pattern, num_vars_to_check)
validate_type(size_pattern, size_vars_to_check)
}
do_deploy() {
if [ ! -f ${WORKDIR}/xen.dtsi.in ]; then
die "xen.dtsi.in does not exist"
@@ -88,14 +113,18 @@ python calc_xen_dtb_dom0_size() {
bb.note('size in bytes: %d' % size)
# Ceil to MiB
size_required = ceil(size / (2 ** 20)) * (2 ** 20)
size_defined = int(d.getVar('XEN_DEVICETREE_DOM0_SIZE'), 16)
xen_devicetree_dom0_size = d.getVar('XEN_DEVICETREE_DOM0_SIZE')
if xen_devicetree_dom0_size[:2] == "0x":
size_defined = int(xen_devicetree_dom0_size, 16)
else:
size_defined = int(xen_devicetree_dom0_size)
if size_required > size_defined:
bb.warn ("Wrong kernel size setting inside xen dtb!\n"\
bb.note ("Wrong kernel size setting inside xen dtb!\n"\
"Required:\t%(req)d (%(req)#010X)\n"\
"Requested:\t%(def)d (%(def)#010X)"\
% {"req": size_required, "def": size_defined})
bb.warn ("Overriding XEN_DEVICETREE_DOM0_SIZE with "\
bb.note ("Overriding XEN_DEVICETREE_DOM0_SIZE with "\
"%(req)d (%(req)#010X)" % {"req": size_required})
d.setVar('XEN_DEVICETREE_DOM0_SIZE', hex(size_required))
}
@@ -0,0 +1,40 @@
From 3b418b33265402aab0cb1bf2b745a25724bae2d8 Mon Sep 17 00:00:00 2001
Message-Id: <3b418b33265402aab0cb1bf2b745a25724bae2d8.1602684880.git.diego.sueiro@arm.com>
From: Bertrand Marquis <bertrand.marquis@arm.com>
Date: Tue, 18 Aug 2020 14:47:38 +0100
Subject: [PATCH] arm: Add Neoverse N1 processor identification
Add MIDR and CPU part numbers for Neoverse N1
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
Upstream-Status: Backport
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
xen/include/asm-arm/processor.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index aa642e3..3ca67f8 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -58,6 +58,7 @@
#define ARM_CPU_PART_CORTEX_A73 0xD09
#define ARM_CPU_PART_CORTEX_A75 0xD0A
#define ARM_CPU_PART_CORTEX_A76 0xD0B
+#define ARM_CPU_PART_NEOVERSE_N1 0xD0C
#define MIDR_CORTEX_A12 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A12)
#define MIDR_CORTEX_A17 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A17)
@@ -68,6 +69,7 @@
#define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
#define MIDR_CORTEX_A75 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A75)
#define MIDR_CORTEX_A76 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A76)
+#define MIDR_NEOVERSE_N1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N1)
/* MPIDR Multiprocessor Affinity Register */
#define _MPIDR_UP (30)
--
2.7.4
@@ -0,0 +1,42 @@
From 858c0be8c2fa4125a0fa0acaa03ae730e5c7cb3c Mon Sep 17 00:00:00 2001
Message-Id: <858c0be8c2fa4125a0fa0acaa03ae730e5c7cb3c.1602684183.git.diego.sueiro@arm.com>
From: Bertrand Marquis <bertrand.marquis@arm.com>
Date: Tue, 18 Aug 2020 14:47:39 +0100
Subject: [PATCH] xen/arm: Enable CPU Erratum 1165522 for Neoverse
Enable CPU erratum of Speculative AT on the Neoverse N1 processor
versions r0p0 to r2p0.
Also Fix Cortex A76 Erratum string which had a wrong errata number.
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
Upstream-Status: Backport
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
xen/arch/arm/cpuerrata.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 0248893..6c09017 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -477,8 +477,14 @@ static const struct arm_cpu_capabilities arm_errata[] = {
},
#endif
{
+ /* Neoverse r0p0 - r2p0 */
+ .desc = "ARM erratum 1165522",
+ .capability = ARM64_WORKAROUND_AT_SPECULATE,
+ MIDR_RANGE(MIDR_NEOVERSE_N1, 0, 2 << MIDR_VARIANT_SHIFT),
+ },
+ {
/* Cortex-A76 r0p0 - r2p0 */
- .desc = "ARM erratum 116522",
+ .desc = "ARM erratum 1165522",
.capability = ARM64_WORKAROUND_AT_SPECULATE,
MIDR_RANGE(MIDR_CORTEX_A76, 0, 2 << MIDR_VARIANT_SHIFT),
},
--
2.7.4
@@ -0,0 +1,35 @@
From 1814a626fb5811184eda64fe22f0055df4600211 Mon Sep 17 00:00:00 2001
Message-Id: <1814a626fb5811184eda64fe22f0055df4600211.1602684203.git.diego.sueiro@arm.com>
From: Julien Grall <jgrall@amazon.com>
Date: Tue, 25 Aug 2020 18:38:10 +0100
Subject: [PATCH] xen/arm: Update silicon-errata.txt with the Neovers AT
erratum
Commit 858c0be8c2fa "xen/arm: Enable CPU Erratum 1165522 for Neoverse"
added a new erratum but forgot to update silicon-errata.txt.
Update the file accordingly to keep track of errata workaround in Xen.
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Upstream-Status: Backport
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
docs/misc/arm/silicon-errata.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 11e5a9d..e15d092 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -51,4 +51,5 @@ stable hypervisors.
| ARM | Cortex-A57 | #1319537 | N/A |
| ARM | Cortex-A72 | #1319367 | N/A |
| ARM | Cortex-A76 | #1165522 | N/A |
+| ARM | Neoverse-N1 | #1165522 | N/A
| ARM | MMU-500 | #842869 | N/A |
--
2.7.4
@@ -0,0 +1,51 @@
From 968bb86d04913f52d7678a842474f2a674a8b23e Mon Sep 17 00:00:00 2001
Message-Id: <968bb86d04913f52d7678a842474f2a674a8b23e.1602683678.git.diego.sueiro@arm.com>
From: Wei Chen <wei.chen@arm.com>
Date: Fri, 28 Aug 2020 02:34:03 +0000
Subject: [PATCH] xen/arm: Missing N1/A76/A75 FP registers in vCPU context
switch
Xen has cpu_has_fp/cpu_has_simd to detect whether the CPU supports
FP/SIMD or not. But currently, these two MACROs only consider value 0
of ID_AA64PFR0_EL1.FP/SIMD as FP/SIMD features enabled. But for CPUs
that support FP/SIMD and half-precision floating-point arithmetic, the
ID_AA64PFR0_EL1.FP/SIMD are 1 (see Arm ARM DDI0487F.b, D13.2.64).
For these CPUs, xen will treat them as no FP/SIMD support, the
vfp_save/restore_state will not take effect.
From the TRM documents of Cortex-A75/A76/N1, we know these CPUs support
basic Advanced SIMD/FP and half-precision floating-point arithmetic. In
this case, on N1/A76/A75 platforms, Xen will always miss the floating
pointer registers save/restore. If different vCPUs are running on the
same pCPU, the floating pointer registers will be corrupted randomly.
This patch fixes Xen on these new cores.
Signed-off-by: Wei Chen <wei.chen@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Upstream-Status: Backport
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
xen/include/asm-arm/cpufeature.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index 674beb0..10878ea 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -13,8 +13,8 @@
#define cpu_has_el2_64 (boot_cpu_feature64(el2) >= 1)
#define cpu_has_el3_32 (boot_cpu_feature64(el3) == 2)
#define cpu_has_el3_64 (boot_cpu_feature64(el3) >= 1)
-#define cpu_has_fp (boot_cpu_feature64(fp) == 0)
-#define cpu_has_simd (boot_cpu_feature64(simd) == 0)
+#define cpu_has_fp (boot_cpu_feature64(fp) < 8)
+#define cpu_has_simd (boot_cpu_feature64(simd) < 8)
#define cpu_has_gicv3 (boot_cpu_feature64(gic) == 1)
#endif
--
2.7.4
@@ -1,5 +1,9 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-4.14:"
SRC_URI += " \
file://0001-xen-arm-Throw-messages-for-unknown-FP-SIMD-implement.patch \
file://0001-arm-Add-Neoverse-N1-processor-identification.patch \
file://0002-xen-arm-Enable-CPU-Erratum-1165522-for-Neoverse.patch \
file://0003-xen-arm-Update-silicon-errata.txt-with-the-Neovers-A.patch \
file://0004-xen-arm-Missing-N1-A76-A75-FP-registers-in-vCPU-cont.patch \
file://0005-xen-arm-Throw-messages-for-unknown-FP-SIMD-implement.patch \
"
@@ -0,0 +1,6 @@
/var/log/xenguest {
missingok
size 10k
copytruncate
rotate 2
}
@@ -11,11 +11,13 @@ BRIDGE_NAME="###BRIDGE_NAME###"
case "${XENGUEST_NETWORK_TYPE:=}" in
nat)
echo "vif = ['script=vif-nat']" >> ${guestcfgfile}
log info "Network type is NAT"
;;
bridge)
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> ${guestcfgfile}
log info "Network type is bridge: ${BRIDGE_NAME}"
;;
*)
echo "${@}: XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
log error "XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
;;
esac
@@ -68,7 +68,7 @@ case "$1" in
# update guest list
guestlist=$(xenguest-manager status | grep Running | cut -d ":" -f1)
for f in ${guestlist}; do
xl shutdown -w ${f} || xl destroy ${f}
xenguest-manager shutdown ${f} --kill
done
;;
reload)
File diff suppressed because it is too large Load Diff
@@ -110,7 +110,8 @@ Init configuration
Disk configuration
--disk-reset-config reset disk guest configuration to default (no disk)
--disk-size=SZ set guest disk size (in GB)
--disk-size=SZ set guest disk size in MB or GB(default),
e.g 1000M or 2[G].
--disk-device=DEV set device to be used to create the guest disk
if unset or set to an empty string, the volume will be
create in the default manager volume group.
@@ -127,7 +128,7 @@ Disk configuration
--disk-rm-part=ID remove partition ID from the guest disk
--disk-add-file=SRC:DST add file SRC as disk file DST in the xenguest image.
DST can then be used as a partition CONTENT.
--disk--rm-file=DST remove disk file DST from the xenguest image.
--disk-rm-file=DST remove disk file DST from the xenguest image.
EOF
}
@@ -370,13 +371,159 @@ disk_config_rm_part() {
sed -i "/DISK_PART${partid}=.*/d" ${IMAGE_TMPDIR}/disk.cfg
}
is_integer() {
if ! [[ "${1}" =~ ^[0-9]+$ ]]; then
>&2 echo "error: invalid number '${1}'"; exit 1
fi
}
# check size and convert it to MB, e.g '1[G]' => '1000M'
check_size() {
local disksize="${1}"
[ -n "${disksize}" ] || disksize="invalid"
# disksize may have appended M or G suffix, let's extract it
# ${var:offset:length}, where #var is var length
local lastchar="${disksize:${#disksize}-1}"
case "${lastchar}" in
[0-9])
# backwards compatibility
is_integer "${disksize}"
echo -e "$((${disksize} * 1000))M"
return
;;
G|M)
if [ "${#disksize}" -gt "1" ]; then
local size="${disksize::${#disksize}-1}"
is_integer "${size}"
# convert GB to MB
[ "${lastchar}" = "M" ] || size=$((${size} * 1000))
echo -e "${size}M"
return
fi
;;
*)
;;
esac
>&2 echo -e "Invalid size format '${1}'" \
"\n\tSupported size format is e.g 1000M or 2[G]"
exit 1
}
disk_config_get_size() {
disksize=$(echo -e "$( . ${IMAGE_TMPDIR}/disk.cfg && echo $DISK_SIZE)")
check_size "${disksize}"
}
disk_config_get_parts() {
echo -e "$( . ${IMAGE_TMPDIR}/disk.cfg && \
typeset -p | awk '$3 ~ /^DISK_PART/ { print $3 }')"
}
disk_config_get_free_space() {
disk_usage="0"
for partinfo in $(disk_config_get_parts)
do
partsize=$(echo "${partinfo}" | cut -d '"' -f2 | sed -e "s/:.*//")
sizeMB=$(check_size "${partsize}")
[ -n "${sizeMB}" ] || exit 1
disk_usage=$((${sizeMB::${#sizeMB}-1} + $disk_usage))
done
disk_size=$(disk_config_get_size)
echo -e "$((${disk_size::${#disk_size}-1} - ${disk_usage}))M"
}
disk_check_partition_format() {
local partformat="${1}"
# if partformat is not defined let's skip this check
[ -n "${partformat}" ] || return 0
case "${partformat}" in
vfat|ext2|ext3|ext4|swap)
;;
*)
# invalid/unknown fstype
echo "Invalid file fstype ${partformat}"
exit 1
;;
esac
}
disk_check_partition_content() {
local partcontent="${1}"
# if partcontent is not defined let's skip this check
[ -n "${partcontent}" ] || return 0
case "${partcontent}" in
*.img*)
case "${partcontent}" in
*.img.gz|*.img.bz2|*.img)
;;
*)
# invalid/unknown compression type
echo "Invalid file format in disk ${partcontent}"
exit 1
;;
esac
;;
*.tar*)
case "${partcontent}" in
*.tar.gz|*.tar.bz2|*.tar.xz|*.tar)
;;
*)
# invalid/unknown tar type
echo "Invalid file format in disk ${partcontent}"
exit 1
;;
esac
;;
*)
#invalid content type
echo "Unsupported content type ${partcontent}!"
exit 1
;;
esac
# do not allow to create multiple partitions the same content
if grep ":${partcontent}\"" <<< "$(disk_config_get_parts)"; then
echo "Error ${partcontent} is already inside guest image"
exit 1
fi
}
disk_config_add_part() {
partconf="${1}"
partid=$(echo ${partconf} | sed -e "s/:.*//")
partinfo=$(echo ${partconf} | sed -e "s/[^:]*://")
partsize=$(echo ${partinfo} | cut -d ":" -f1)
partformat=$(echo ${partinfo} | cut -d ":" -f2)
partcontent=$(echo ${partinfo} | cut -d ":" -f3)
# check size "ID:*SIZE*:FORMAT:CONTENT"
partsizeMB=$(check_size "${partsize}")
# Make sure we don't add the same partition twice
disk_config_rm_part ${partid}
disk_config_rm_part "${partid}"
# check available disk space
freespace=$(disk_config_get_free_space)
if ((${partsizeMB::${#partsizeMB}-1} > ${freespace::${#freespace}-1}))
then
echo -e "Not enough free disk space(${freespace}) for partition "\
"'${partconf}'!"\
"\tTo adjust disk size use '--disk-size' parameter"\
"\tor shrink the partition with '--disk-add-part' parameter"
exit 1
fi
# check format "ID:SIZE:*FORMAT*:CONTENT"
disk_check_partition_format "${partformat}"
# check content "ID:SIZE:FORMAT:*CONTENT*"
disk_check_partition_content "${partcontent}"
echo "DISK_PART${partid}=\"${partinfo}\"" >> \
${IMAGE_TMPDIR}/disk.cfg
}
@@ -742,11 +889,13 @@ for arg in "${@}"; do
disk_config_reset
;;
--disk-size=*)
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${optarg}\"/" \
size=$(check_size "${optarg}")
[ -n "size" ] || exit 1
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${size}\"/" \
${IMAGE_TMPDIR}/disk.cfg
;;
--disk-device=*)
sed -i "s/DISK_DEVICE=.*/DISK_SIZE=\"${optarg}\"/" \
sed -i "s@DISK_DEVICE=.*@DISK_DEVICE=\"${optarg}\"@" \
${IMAGE_TMPDIR}/disk.cfg
;;
--disk-add-part=*)
@@ -31,15 +31,14 @@ case "${XENGUEST_NETWORK_TYPE:-}" in
release_lock "vif-nat-kea"
exit 0
fi
echo "Waiting for ${vif_name} - network interface is not ready..."\
" try #${try}" >> "${LOGFILE}" 2>&1
log info "Waiting for ${vif_name} - network interface is not ready..."
log info "try #${try}"
sleep 1
done
echo "ERROR: Failed to get ${vif_name} "\
"network interface ready!" >> "${LOGFILE}" 2>&1
log error "Failed to get ${vif_name}. network interface ready!"
exit 1
;;
*)
echo "No action needed" >> "${LOGFILE}" 2>&1
log verbose "No action needed"
;;
esac
@@ -2,6 +2,16 @@
#
# xenguest-manager is a tool to control xen guest (e.g. create, start, stop)
#
# By default xenguest-manager logs to /var/log when in verbose mode, which is a
# Volatile directory. To persist logs across reboots the following needs to be
# added to either local.conf or distro.conf
#
# VOLATILE_LOG_DIR="no"
#
# Read more here: https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-VOLATILE_LOG_DIR
#
# When this is enabled, logrotate will monitor the file to ensure it does not grow
# excessively large. See files/logrotate-xenguest
DESCRIPTION = "Xen Guest Manager"
LICENSE = "MIT"
@@ -9,6 +19,7 @@ LICENSE = "MIT"
SRC_URI = " \
file://xenguest-manager \
file://xenguest-init \
file://logrotate-xenguest \
"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
@@ -17,15 +28,16 @@ S = "${WORKDIR}"
# Please refer to documentation/xenguest-manager.md for documentation on those
# parameters
XENGUEST_MANAGER_VOLUME_DEVICE ?= "/dev/sda2"
XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen"
XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen-$(basename ${XENGUEST_MANAGER_VOLUME_DEVICE})"
XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
XENGUEST_MANAGER_LOG_LEVEL ?= "ERROR"
# We add an init script to create and start guests automatically
# run start script after xen-tools and run stop script before xen-tools
INITSCRIPT_NAME = "xenguest"
INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 79 0 1 6 ."
inherit update-rc.d
inherit allarch update-rc.d
do_compile() {
echo "XENGUEST_VOLUME_DEVICE=\"${XENGUEST_MANAGER_VOLUME_DEVICE}\"" > \
@@ -34,6 +46,8 @@ do_compile() {
xenguest-manager.conf
echo "XENGUEST_GUEST_DIR=\"${XENGUEST_MANAGER_GUEST_DIR}\"" >> \
xenguest-manager.conf
echo "XENGUEST_LOG_LEVEL=\"${XENGUEST_MANAGER_LOG_LEVEL}\"" >> \
xenguest-manager.conf
}
do_install() {
@@ -44,10 +58,13 @@ do_install() {
install -d -m 755 ${D}${sysconfdir}/init.d
install -m 755 xenguest-init ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
install -d -m 755 ${D}${XENGUEST_GUEST_DIR}
install -d -m 755 ${D}${sysconfdir}/logrotate.d
install -m 644 logrotate-xenguest ${D}${sysconfdir}/logrotate.d/xenguest
}
# Things that we need on the target
RDEPENDS_${PN} += "bash tar xenguest-mkimage lvm2 xen-tools parted e2fsprogs dosfstools"
RDEPENDS_${PN} += "bash xenguest-mkimage lvm2 xen-tools parted e2fsprogs \
dosfstools logrotate"
FILES_${PN} += "${bindir}/xenguest-manager \
${sysconfdir}/xenguest"
@@ -17,6 +17,8 @@ S = "${WORKDIR}"
# Can be built native also to produce xenguest images during Yocto build
BBCLASSEXTEND = "native"
inherit allarch
do_configure[noexec] = "1"
do_compile[noexec] = "1"
@@ -25,7 +27,7 @@ do_install() {
install -m 755 xenguest-mkimage ${D}${bindir}/.
}
# We need bash and tar
RDEPENDS_${PN} = "bash tar"
# We need bash
RDEPENDS_${PN} = "bash"
FILES_${PN} = "${bindir}/xenguest-mkimage"
@@ -39,7 +39,7 @@ INITSCRIPT_PARAMS_${PN} = "start 01 2 3 4 5 . stop 81 0 1 6 ."
INITSCRIPT_NAME_${PN}-kea-dhcp4 = "kea-restore-default-config"
INITSCRIPT_PARAMS_${PN}-kea-dhcp4 = "defaults 20"
inherit update-rc.d
inherit allarch update-rc.d
do_install() {
cat ${WORKDIR}/xenguest-network-bridge.in \
@@ -5,5 +5,6 @@
define KFEATURE_DESCRIPTION "Enable netfilter + conn tracking + extras"
define KFEATURE_COMPATIBILITY all
include cfg/net/bridge.scc
include features/netfilter/netfilter.scc
kconf non-hardware netfilter-extra.cfg
@@ -1,147 +0,0 @@
From 5a0677110b73dd3e1766f89159701bfe8ac06808 Mon Sep 17 00:00:00 2001
From: Masami Hiramatsu <mhiramat@kernel.org>
Date: Tue, 6 Oct 2020 15:49:31 +0900
Subject: [PATCH] arm/arm64: xen: Fix to convert percpu address to gfn
correctly
Use per_cpu_ptr_to_phys() instead of virt_to_phys() for per-cpu
address conversion.
In xen_starting_cpu(), per-cpu xen_vcpu_info address is converted
to gfn by virt_to_gfn() macro. However, since the virt_to_gfn(v)
assumes the given virtual address is in linear mapped kernel memory
area, it can not convert the per-cpu memory if it is allocated on
vmalloc area.
This depends on CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK.
If it is enabled, the first chunk of percpu memory is linear mapped.
In the other case, that is allocated from vmalloc area. Moreover,
if the first chunk of percpu has run out until allocating
xen_vcpu_info, it will be allocated on the 2nd chunk, which is
based on kernel memory or vmalloc memory (depends on
CONFIG_NEED_PER_CPU_KM).
Without this fix and kernel configured to use vmalloc area for
the percpu memory, the Dom0 kernel will fail to boot with following
errors.
[ 0.466172] Xen: initializing cpu0
[ 0.469601] ------------[ cut here ]------------
[ 0.474295] WARNING: CPU: 0 PID: 1 at arch/arm64/xen/../../arm/xen/enlighten.c:153 xen_starting_cpu+0x160/0x180
[ 0.484435] Modules linked in:
[ 0.487565] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc4+ #4
[ 0.493895] Hardware name: Socionext Developer Box (DT)
[ 0.499194] pstate: 00000005 (nzcv daif -PAN -UAO BTYPE=--)
[ 0.504836] pc : xen_starting_cpu+0x160/0x180
[ 0.509263] lr : xen_starting_cpu+0xb0/0x180
[ 0.513599] sp : ffff8000116cbb60
[ 0.516984] x29: ffff8000116cbb60 x28: ffff80000abec000
[ 0.522366] x27: 0000000000000000 x26: 0000000000000000
[ 0.527754] x25: ffff80001156c000 x24: fffffdffbfcdb600
[ 0.533129] x23: 0000000000000000 x22: 0000000000000000
[ 0.538511] x21: ffff8000113a99c8 x20: ffff800010fe4f68
[ 0.543892] x19: ffff8000113a9988 x18: 0000000000000010
[ 0.549274] x17: 0000000094fe0f81 x16: 00000000deadbeef
[ 0.554655] x15: ffffffffffffffff x14: 0720072007200720
[ 0.560037] x13: 0720072007200720 x12: 0720072007200720
[ 0.565418] x11: 0720072007200720 x10: 0720072007200720
[ 0.570801] x9 : ffff8000100fbdc0 x8 : ffff800010715208
[ 0.576182] x7 : 0000000000000054 x6 : ffff00001b790f00
[ 0.581564] x5 : ffff800010bbf880 x4 : 0000000000000000
[ 0.586945] x3 : 0000000000000000 x2 : ffff80000abec000
[ 0.592327] x1 : 000000000000002f x0 : 0000800000000000
[ 0.597716] Call trace:
[ 0.600232] xen_starting_cpu+0x160/0x180
[ 0.604309] cpuhp_invoke_callback+0xac/0x640
[ 0.608736] cpuhp_issue_call+0xf4/0x150
[ 0.612728] __cpuhp_setup_state_cpuslocked+0x128/0x2c8
[ 0.618030] __cpuhp_setup_state+0x84/0xf8
[ 0.622192] xen_guest_init+0x324/0x364
[ 0.626097] do_one_initcall+0x54/0x250
[ 0.630003] kernel_init_freeable+0x12c/0x2c8
[ 0.634428] kernel_init+0x1c/0x128
[ 0.637988] ret_from_fork+0x10/0x18
[ 0.641635] ---[ end trace d95b5309a33f8b27 ]---
[ 0.646337] ------------[ cut here ]------------
[ 0.651005] kernel BUG at arch/arm64/xen/../../arm/xen/enlighten.c:158!
[ 0.657697] Internal error: Oops - BUG: 0 [#1] SMP
[ 0.662548] Modules linked in:
[ 0.665676] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 5.9.0-rc4+ #4
[ 0.673398] Hardware name: Socionext Developer Box (DT)
[ 0.678695] pstate: 00000005 (nzcv daif -PAN -UAO BTYPE=--)
[ 0.684338] pc : xen_starting_cpu+0x178/0x180
[ 0.688765] lr : xen_starting_cpu+0x144/0x180
[ 0.693188] sp : ffff8000116cbb60
[ 0.696573] x29: ffff8000116cbb60 x28: ffff80000abec000
[ 0.701955] x27: 0000000000000000 x26: 0000000000000000
[ 0.707344] x25: ffff80001156c000 x24: fffffdffbfcdb600
[ 0.712718] x23: 0000000000000000 x22: 0000000000000000
[ 0.718107] x21: ffff8000113a99c8 x20: ffff800010fe4f68
[ 0.723481] x19: ffff8000113a9988 x18: 0000000000000010
[ 0.728863] x17: 0000000094fe0f81 x16: 00000000deadbeef
[ 0.734245] x15: ffffffffffffffff x14: 0720072007200720
[ 0.739626] x13: 0720072007200720 x12: 0720072007200720
[ 0.745008] x11: 0720072007200720 x10: 0720072007200720
[ 0.750390] x9 : ffff8000100fbdc0 x8 : ffff800010715208
[ 0.755771] x7 : 0000000000000054 x6 : ffff00001b790f00
[ 0.761153] x5 : ffff800010bbf880 x4 : 0000000000000000
[ 0.766534] x3 : 0000000000000000 x2 : 00000000deadbeef
[ 0.771916] x1 : 00000000deadbeef x0 : ffffffffffffffea
[ 0.777304] Call trace:
[ 0.779819] xen_starting_cpu+0x178/0x180
[ 0.783898] cpuhp_invoke_callback+0xac/0x640
[ 0.788325] cpuhp_issue_call+0xf4/0x150
[ 0.792317] __cpuhp_setup_state_cpuslocked+0x128/0x2c8
[ 0.797619] __cpuhp_setup_state+0x84/0xf8
[ 0.801779] xen_guest_init+0x324/0x364
[ 0.805683] do_one_initcall+0x54/0x250
[ 0.809590] kernel_init_freeable+0x12c/0x2c8
[ 0.814016] kernel_init+0x1c/0x128
[ 0.817583] ret_from_fork+0x10/0x18
[ 0.821226] Code: d0006980 f9427c00 cb000300 17ffffea (d4210000)
[ 0.827415] ---[ end trace d95b5309a33f8b28 ]---
[ 0.832076] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 0.839815] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/160196697165.60224.17470743378683334995.stgit@devnote2
Signed-off-by: Juergen Gross <jgross@suse.com>
Upstream-Status: Backport
Signed-off-by: Richard Neill <richard.neill@arm.com>
---
arch/arm/xen/enlighten.c | 2 +-
include/xen/arm/page.h | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index e93145d72c26..a6ab3689b2f4 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -150,7 +150,7 @@ static int xen_starting_cpu(unsigned int cpu)
pr_info("Xen: initializing cpu%d\n", cpu);
vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
- info.mfn = virt_to_gfn(vcpup);
+ info.mfn = percpu_to_gfn(vcpup);
info.offset = xen_offset_in_page(vcpup);
err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, xen_vcpu_nr(cpu),
diff --git a/include/xen/arm/page.h b/include/xen/arm/page.h
index 39df751d0dc4..ac1b65470563 100644
--- a/include/xen/arm/page.h
+++ b/include/xen/arm/page.h
@@ -83,6 +83,9 @@ static inline unsigned long bfn_to_pfn(unsigned long bfn)
})
#define gfn_to_virt(m) (__va(gfn_to_pfn(m) << XEN_PAGE_SHIFT))
+#define percpu_to_gfn(v) \
+ (pfn_to_gfn(per_cpu_ptr_to_phys(v) >> XEN_PAGE_SHIFT))
+
/* Only used in PV code. But ARM guests are always HVM. */
static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr)
{
--
2.25.1
@@ -1,95 +0,0 @@
From 18d691d837b340c941ad778bc8dfa77446e48bb4 Mon Sep 17 00:00:00 2001
Message-Id: <18d691d837b340c941ad778bc8dfa77446e48bb4.1613579395.git.diego.sueiro@arm.com>
From: Julien Grall <jgrall@amazon.com>
Date: Wed, 10 Feb 2021 17:06:54 +0000
Subject: [PATCH] arm/xen: Don't probe xenbus as part of an early initcall
commit c4295ab0b485b8bc50d2264bcae2acd06f25caaf upstream.
After Commit 3499ba8198cad ("xen: Fix event channel callback via
INTX/GSI"), xenbus_probe() will be called too early on Arm. This will
recent to a guest hang during boot.
If the hang wasn't there, we would have ended up to call
xenbus_probe() twice (the second time is in xenbus_probe_initcall()).
We don't need to initialize xenbus_probe() early for Arm guest.
Therefore, the call in xen_guest_init() is now removed.
After this change, there is no more external caller for xenbus_probe().
So the function is turned to a static one. Interestingly there were two
prototypes for it.
Cc: stable@vger.kernel.org
Fixes: 3499ba8198cad ("xen: Fix event channel callback via INTX/GSI")
Reported-by: Ian Jackson <iwj@xenproject.org>
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/20210210170654.5377-1-julien@xen.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Upstream-Status: Backport
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
arch/arm/xen/enlighten.c | 2 --
drivers/xen/xenbus/xenbus.h | 1 -
drivers/xen/xenbus/xenbus_probe.c | 2 +-
include/xen/xenbus.h | 2 --
4 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index f45bff158fc2..57dfc13b2752 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -370,8 +370,6 @@ static int __init xen_guest_init(void)
return -ENOMEM;
}
gnttab_init();
- if (!xen_initial_domain())
- xenbus_probe();
/*
* Making sure board specific code will not set up ops for
diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h
index a9bb5f91082d..88516a8a9f93 100644
--- a/drivers/xen/xenbus/xenbus.h
+++ b/drivers/xen/xenbus/xenbus.h
@@ -115,7 +115,6 @@ int xenbus_probe_node(struct xen_bus_type *bus,
const char *type,
const char *nodename);
int xenbus_probe_devices(struct xen_bus_type *bus);
-void xenbus_probe(void);
void xenbus_dev_changed(const char *node, struct xen_bus_type *bus);
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 786494bb7f20..652894d61967 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -683,7 +683,7 @@ void unregister_xenstore_notifier(struct notifier_block *nb)
}
EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);
-void xenbus_probe(void)
+static void xenbus_probe(void)
{
xenstored_ready = 1;
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index fe9a9fa2ebc4..14d47ed4114f 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -187,8 +187,6 @@ void xs_suspend_cancel(void);
struct work_struct;
-void xenbus_probe(void);
-
#define XENBUS_IS_ERR_READ(str) ({ \
if (!IS_ERR(str) && strlen(str) == 0) { \
kfree(str); \
--
2.17.1
@@ -38,17 +38,6 @@ python() {
from distutils.version import LooseVersion
kernelVersion = d.getVar('LINUX_VERSION')
pn = d.getVar('PN')
if kernelVersion and LooseVersion(kernelVersion) < '5.4.99' \
and pn != 'linux-libc-headers' \
and oe.utils.any_distro_features(d, "arm-autonomy-guest"):
d.appendVar('SRC_URI', ' file://files/0001-arm-xen-Don-t-probe-xenbus-as-part-of-an-early-initc.patch' )
if kernelVersion and LooseVersion(kernelVersion) < '5.9' \
and pn != 'linux-libc-headers' \
and oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
d.appendVar('SRC_URI', ' file://files/0001-arm-arm64-xen-Fix-to-convert-percpu-address-to-gfn-c.patch' )
if kernelVersion and LooseVersion(kernelVersion) < '5.10':
if oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
@@ -1,32 +0,0 @@
#
# SPDX-License-Identifier: MIT
#
# The empty wic plugin is used to create unformatted empty partitions for wic
# images.
# To use it you must pass "empty" as argument for the "--source" parameter in
# the wks file. For example:
# part foo --source empty --ondisk sda --size="1024" --align 1024
import logging
from wic.pluginbase import SourcePlugin
logger = logging.getLogger('wic')
class EmptyPartitionPlugin(SourcePlugin):
"""
Populate unformatted empty partition.
"""
name = 'empty'
@classmethod
def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
oe_builddir, bootimg_dir, kernel_dir,
rootfs_dir, native_sysroot):
"""
Called to do the actual content population for a partition i.e. it
'prepares' the partition to be incorporated into the image.
"""
return
+1 -1
View File
@@ -7,7 +7,7 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
BBFILE_COLLECTIONS += "meta-arm-bsp"
BBFILE_PATTERN_meta-arm-bsp = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-arm-bsp = "6"
BBFILE_PRIORITY_meta-arm-bsp = "5"
LAYERSERIES_COMPAT_meta-arm-bsp = "gatesgarth"
-24
View File
@@ -1,24 +0,0 @@
# Configuration for Cortex-A5 DesignStart development board
#@TYPE: Machine
#@NAME: a5ds machine
#@DESCRIPTION: Machine configuration for Cortex-A5 DesignStart
require conf/machine/include/tune-cortexa5.inc
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "5.3%"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KCONFIG_MODE = "--alldefconfig"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
SERIAL_CONSOLES = "115200;ttyAMA0"
IMAGE_FSTYPES += "tar.bz2 cpio.gz"
# Cortex-a5 u-boot configuration
UBOOT_MACHINE = "designstart_ca5_defconfig"
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
@@ -0,0 +1,32 @@
#@TYPE: Machine
#@NAME: Corstone-500 machine
#@DESCRIPTION: Machine configuration for the Corstone-500 platform
require conf/machine/include/tune-cortexa5.inc
#
# Corstone-500 is built against poky-tiny distro.
# poky-tiny sets PREFERRED_PROVIDER_virtual/kernel to linux-yocto-tiny.
# Since distro config is evaluated after the machine config, we need to
# use the strongest override possible (forcevariable) so the
# PREFERRED_PROVIDER_virtual/kernel specified in the machine config will
# apply.
#
PREFERRED_PROVIDER_virtual/kernel_forcevariable = "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "5.3%"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KCONFIG_MODE = "--alldefconfig"
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
SERIAL_CONSOLES = "115200;ttyAMA0"
IMAGE_FSTYPES += "tar.bz2 cpio.gz"
# Corstone-500 u-boot configuration
UBOOT_MACHINE = "designstart_ca5_defconfig"
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
PREFERRED_VERSION_u-boot ?= "2020.07"
@@ -1,17 +0,0 @@
# Configuration for Armv8-A Foundation
#@TYPE: Machine
#@NAME: Armv8-A Foundation Platform machine
#@DESCRIPTION: Machine configuration for Armv8-A Foundation Platform model
require conf/machine/fvp-common.inc
require conf/machine/include/arm/arch-armv8a.inc
TUNE_FEATURES = "aarch64"
# FVP u-boot configuration
UBOOT_MACHINE = "vexpress_aemv8a_semi_defconfig"
KERNEL_IMAGETYPE = "Image"
KERNEL_DEVICETREE = "arm/foundation-v8-gicv3-psci.dtb"
@@ -9,8 +9,6 @@ require conf/machine/include/arm/arch-armv7a.inc
KERNEL_IMAGETYPE = "zImage"
PREFERRED_VERSION_trusted-firmware-a ?= "2.2%"
# FVP u-boot configuration
UBOOT_MACHINE = "vexpress_aemv8a_aarch32_defconfig"
+4 -1
View File
@@ -29,7 +29,10 @@ DISK_IMG_PARTITION3_CONTENT = ""
SERIAL_CONSOLES = "115200;ttyAMA0"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "5.4%"
PREFERRED_VERSION_linux-yocto ?= "5.10%"
PREFERRED_VERSION_u-boot ?= "2020.10"
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
@@ -14,8 +14,7 @@ PREFERRED_VERSION_linux-yocto ?= "5.6%"
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "scp-firmware"
PREFERRED_VERSION_control-processor-firmware ?= "2.6.0"
PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "boot-firmware"
EXTRA_IMAGEDEPENDS += " \
virtual/trusted-firmware-a \
+2
View File
@@ -20,7 +20,9 @@ SERIAL_CONSOLES = "115200;ttyAMA0"
# Use kernel provided by yocto
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "5.4%"
PREFERRED_VERSION_scp-firmware ?= "2.6%"
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
PREFERRED_VERSION_u-boot ?= "2020.07"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot firmware-image-juno"
+4 -4
View File
@@ -4,9 +4,6 @@
#@NAME: Musca-B1 machine
#@DESCRIPTION: Machine configuration for Musca-B1
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
PREFERRED_VERSION_trusted-firmware-m = "1.0"
DEFAULTTUNE ?= "armv8m-main"
require conf/machine/include/tune-cortexm33.inc
@@ -14,7 +11,8 @@ require conf/machine/include/tune-cortexm33.inc
TCLIBC = "newlib"
# For runqemu
require conf/machine/include/qemu.inc
IMAGE_FSTYPES += "ext4"
IMAGE_CLASSES += "qemuboot"
QB_SYSTEM_NAME = "qemu-system-arm"
QB_MACHINE = "-machine musca-b1"
QB_CPU = "-cpu cortex-m33"
@@ -25,3 +23,5 @@ QB_MEM = "512k"
ZEPHYR_BOARD = "v2m_musca_b1"
ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
ARCH_musca-b1 = "arm"
TFM_PLATFORM = "MUSCA_B1"
+2 -3
View File
@@ -4,10 +4,9 @@
#@NAME: Musca-S1 machine
#@DESCRIPTION: Machine configuration for Musca-S1
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
PREFERRED_VERSION_trusted-firmware-m = "1.0"
require conf/machine/include/tune-cortexm33.inc
# GLIBC will not work with Cortex-M.
TCLIBC = "newlib"
TFM_PLATFORM = "MUSCA_S1"
+8 -7
View File
@@ -8,7 +8,7 @@ require conf/machine/include/tune-neoversen1.inc
KERNEL_IMAGETYPE = "Image"
IMAGE_FSTYPES += "wic tar.bz2 ext4"
IMAGE_FSTYPES += "wic wic.gz wic.bmap tar.bz2 ext4"
SERIAL_CONSOLES = "115200;ttyAMA0"
@@ -17,22 +17,23 @@ WKS_FILE ?= "n1sdp-efidisk.wks"
IMAGE_EFI_BOOT_FILES ?= "n1sdp-multi-chip.dtb n1sdp-single-chip.dtb"
WKS_FILE_DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}"
# Use kernel provided by linaro (Contains support for SCMi or HDMI)
PREFERRED_PROVIDER_virtual/kernel ?= "linux-linaro-arm"
PREFERRED_VERSION_linux-linaro-arm ?= "5.4%"
# Use kernel provided by yocto
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "5.10%"
# RTL8168E Gigabit Ethernet Controller is attached to the PCIe interface
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
# Trusted firmware v2.3 version
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
PREFERRED_VERSION_scp-firmware ?= "2.7%"
#UEFI EDK2 firmware
EXTRA_IMAGEDEPENDS += "virtual/uefi-firmware"
PREFERRED_VERSION_edk2-firmware ?= "201911%"
#grub-efi
EFI_PROVIDER ?= "grub-efi"
+2
View File
@@ -21,6 +21,8 @@ PREFERRED_VERSION_linux-yocto ?= "5.7%"
KCONFIG_MODE = "--alldefconfig"
SERIAL_CONSOLES = "115200;ttyAMA0"
PREFERRED_VERSION_edk2-firmware ?= "202011%"
#grub-efi
EFI_PROVIDER ?= "grub-efi"
MACHINE_FEATURES += "efi"
+22 -7
View File
@@ -10,19 +10,34 @@ require conf/machine/include/arm/arch-armv8a.inc
# Das U-boot
UBOOT_MACHINE ?= "total_compute_defconfig"
PREFERRED_VERSION_u-boot ?= "2020.10"
UBOOT_RD_LOADADDRESS = "0x88000000"
UBOOT_RD_ENTRYPOINT = "0x88000000"
UBOOT_LOADADDRESS = "0x80080000"
UBOOT_ENTRYPOINT = "0x80080000"
# Below options will generate a key to sign the kernel Image and INITRAMFS_IMAGE
# according to the default parameters of kernel-fitimage.bbclass. If the user
# would prefer to use their own keys, disable the key generation using the
# FIT_GENERATE_KEYS parameter and specify the location of the keys using the
# below paramters.
UBOOT_SIGN_ENABLE = "1"
UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb"
UBOOT_SIGN_KEYNAME = "dev_key"
UBOOT_SIGN_KEYDIR = "${DEPLOY_DIR_IMAGE}/keys"
FIT_GENERATE_KEYS = "1"
# Trusted firmware A v2.3
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
PREFERRED_VERSION_linux-arm64-ack ?= "5.4"
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-arm64-ack"
# Cannot use the default zImage on arm64
KERNEL_IMAGETYPE = "Image"
KERNEL_BOOTCMD = "booti"
IMAGE_FSTYPES += "cpio.gz.u-boot"
KERNEL_IMAGETYPES += "fitImage"
KERNEL_CLASSES = " kernel-fitimage "
IMAGE_FSTYPES += "cpio.gz"
INITRAMFS_IMAGE ?= "core-image-minimal"
SERIAL_CONSOLES = "115200;ttyAMA0"
@@ -1,19 +1,19 @@
# Cortex-A5 DesignStart A5DS Platform Support in meta-arm-bsp
# Corstone-500 Platform Support in meta-arm-bsp
## Howto Build and Run
### Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "a5ds"
DISTRO ?= "iota-tiny"
MACHINE ?= "corstone500"
DISTRO ?= "poky-tiny"
Or set environment variables with that values:
MACHINE "a5ds"
DISTRO "iota-tiny"
MACHINE "corstone500"
DISTRO "poky-tiny"
### Build:
``bash$ bitbake iota-tiny-image```
``bash$ bitbake arm-reference-image```
### Run:
To run the result in a Fixed Virtual Platform please get:
@@ -1,51 +0,0 @@
# Armv8-A Base Platform Support in meta-arm-bsp
## Howto Build and Run
### Configuration:
In the local.conf file, MACHINE should be set as follow:
MACHINE ?= "foundation-armv8"
### Build:
```bash$ bitbake core-image-minimal```
### Run:
To Run the Fixed Virtual Platform simulation tool you must download "Armv8-A
Foundation Platform" from Arm developer (This might require the user to
register) from this address:
https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
and install it on your host PC.
Fast Models Fixed Virtual Platforms (FVP) Reference Guide:
https://developer.arm.com/docs/100966/latest
Armv8A Foundation Platform User Guide:
https://developer.arm.com/docs/100961/latest/
Once done, do the following to build and run an image:
```bash$ bitbake core-image-minimal```
```bash$ export YOCTO_DEPLOY_IMGS_DIR="<yocto-build-dir/tmp/deploy/images/foundation-v8>"```
```bash$ cd <path-to-Foundation_Platformpkg-dir/models/Linux64_GCC-X.X/>```
```
bash$ ./Foundation_Platform --cores=4 --no-sve --gicv3 \
--data=${YOCTO_DEPLOY_IMGS_DIR}/bl1-fvp.bin@0x0 \
--data=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin@0x8000000 \
--data=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \
--data=${YOCTO_DEPLOY_IMGS_DIR}/foundation-v8-gicv3-psci.dtb@0x83000000 \
--block-device=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-foundation-armv8.disk.img
```
If you have built a configuration without a ramdisk, you can use the following
command in U-boot to start Linux:
```VExpress64# booti 0x80080000 - 0x83000000```
## Devices supported in the kernel
- serial
- virtio disk
- network
- watchdog
- rtc
## Devices not supported or not functional
None
+6 -3
View File
@@ -15,9 +15,12 @@ https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms.git/tre
In the local.conf file, MACHINE should be set as follows:
MACHINE = "tc0"
To build the required binaries for tc0, run the commmand for the required image,
for e.g for core-image-minimal:
```bash$ bitbake core-image-minimal```
To build the required binaries for tc0, run the commmand:
```bash$ bitbake tc0-artifacts-image```
Trusted-firmware-a is the final component to be built with the rest of the
components dependent of it, therefore building tc0-artifacts-image which depends
on trusted-firmware-a will build all the required binaries.
## Running
To run the produced binaries in a TC0 Fixed Virtual Platform please get
@@ -0,0 +1,61 @@
SUMMARY = "Boot Processor firmware for Corstone700"
DESCRIPTION = "Boot Processor firmware"
LICENSE = "BSD-3-Clause & Apache-2.0"
LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0 \
file://cmsis/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRC_URI = "gitsm://git.linaro.org/landing-teams/working/arm/boot-firmware.git;protocol=https"
SRCREV = "af7eeb1bb8c5a85a5e5a76d48acc6fe864d715a9"
PV = "2020.02.10+git${SRCPV}"
PROVIDES += "virtual/control-processor-firmware"
DEPENDS = "virtual/arm-none-eabi-gcc-native virtual/trusted-firmware-a"
inherit deploy
B = "${WORKDIR}/build"
S = "${WORKDIR}/git"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "(corstone700-*)"
SCP_PLATFORM = "corstone-700"
LDFLAGS[unexport] = "1"
do_configure[noexec] = "1"
EXTRA_OEMAKE = "PRODUCT='${SCP_PLATFORM}' \
BUILD_PATH=${B} \
CROSS_COMPILE='arm-none-eabi-' \
V=y \
"
do_compile() {
oe_runmake -C ${S}/tools/spitoc CC=${BUILD_CC} all
oe_runmake -C ${S}
}
do_compile[cleandirs] += "${B}"
do_install() {
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_ramfw/release/bin/firmware.bin ${D}/firmware/se_ramfw.bin
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_romfw/release/bin/firmware.bin ${D}/firmware/se_romfw.bin
${S}/tools/spitoc/spitoc \
--seram ${D}/firmware/se_ramfw.bin \
--offset 1 \
--fip ${RECIPE_SYSROOT}/firmware/fip.bin-${TFA_PLATFORM} \
--offset 33 \
--out ${D}/firmware/spitoc.bin
}
FILES_${PN} = "/firmware"
SYSROOT_DIRS += "/firmware"
# Skip QA check for relocations in .text of elf binaries
INSANE_SKIP_${PN} = "textrel"
do_deploy() {
# Copy the images to deploy directory
cp -rf ${D}/firmware/* ${DEPLOYDIR}/
}
addtask deploy after do_install
@@ -0,0 +1,256 @@
From 7a8b0d634b23e77bb6c84f1b34c5cc031aa8c105 Mon Sep 17 00:00:00 2001
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Date: Mon, 12 Apr 2021 10:08:29 +0100
Subject: [PATCH 1/3] Revert "FFA: Set and verify allocator of memory handle"
This reverts commit 917d2f2dc46b20625156e9067329e04c7fec587d.
Reverting this commit enables memory sharing between SPs
Upstream-Status: Inappropriate [will not be submitted as its only required for ACK 5.4]
---
inc/hf/arch/ffa_memory_handle.h | 25 ----------------
inc/vmapi/hf/ffa.h | 14 ++++-----
src/api.c | 4 +--
src/arch/aarch64/hypervisor/BUILD.gn | 1 -
.../aarch64/hypervisor/ffa_memory_handle.c | 29 -------------------
src/arch/fake/hypervisor/BUILD.gn | 1 -
src/arch/fake/hypervisor/ffa_memory_handle.c | 20 -------------
src/ffa_memory.c | 19 ++++--------
8 files changed, 14 insertions(+), 99 deletions(-)
delete mode 100644 inc/hf/arch/ffa_memory_handle.h
delete mode 100644 src/arch/aarch64/hypervisor/ffa_memory_handle.c
delete mode 100644 src/arch/fake/hypervisor/ffa_memory_handle.c
diff --git a/inc/hf/arch/ffa_memory_handle.h b/inc/hf/arch/ffa_memory_handle.h
deleted file mode 100644
index 9eba5d4..0000000
--- a/inc/hf/arch/ffa_memory_handle.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2021 The Hafnium Authors.
- *
- * Use of this source code is governed by a BSD-style
- * license that can be found in the LICENSE file or at
- * https://opensource.org/licenses/BSD-3-Clause.
- */
-
-#ifndef FFA_MEMORY_HANDLE_H
-#define FFA_MEMORY_HANDLE_H
-
-#include "hf/ffa.h"
-
-/**
- * Encodes memory handle according to section 5.10.2 of the FF-A v1.0 spec.
- */
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index);
-
-/**
- * Checks whether given handle was allocated by current world, according to
- * handle encoding rules.
- */
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle);
-
-#endif
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index a79f2eb..a948930 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -189,23 +189,21 @@ ATTR_FUNCTION_SET(memory_shareability, ffa_memory_attributes_t,
ATTR_FUNCTION_GET(memory_shareability, ffa_memory_attributes_t,
FFA_MEMORY_SHAREABILITY_OFFSET, FFA_MEMORY_SHAREABILITY_MASK)
-/**
- * A globally-unique ID assigned by the hypervisor for a region of memory being
- * sent between VMs.
- */
-typedef uint64_t ffa_memory_handle_t;
-
#define FFA_MEMORY_HANDLE_ALLOCATOR_MASK \
((ffa_memory_handle_t)(UINT64_C(1) << 63))
#define FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR \
((ffa_memory_handle_t)(UINT64_C(1) << 63))
-
-#define FFA_MEMORY_HANDLE_ALLOCATOR_SPMC (UINT64_C(0) << 63)
#define FFA_MEMORY_HANDLE_INVALID (~UINT64_C(0))
/** The ID of a VM. These are assigned sequentially starting with an offset. */
typedef uint16_t ffa_vm_id_t;
+/**
+ * A globally-unique ID assigned by the hypervisor for a region of memory being
+ * sent between VMs.
+ */
+typedef uint64_t ffa_memory_handle_t;
+
/**
* A count of VMs. This has the same range as the VM IDs but we give it a
* different name to make the different semantics clear.
diff --git a/src/api.c b/src/api.c
index fa5c9b7..16626b6 100644
--- a/src/api.c
+++ b/src/api.c
@@ -9,7 +9,6 @@
#include "hf/api.h"
#include "hf/arch/cpu.h"
-#include "hf/arch/ffa_memory_handle.h"
#include "hf/arch/mm.h"
#include "hf/arch/other_world.h"
#include "hf/arch/timer.h"
@@ -2158,7 +2157,8 @@ struct ffa_value api_ffa_mem_reclaim(ffa_memory_handle_t handle,
struct vm *to = current->vm;
struct ffa_value ret;
- if (ffa_memory_handle_allocated_by_current_world(handle)) {
+ if ((handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR) {
struct vm_locked to_locked = vm_lock(to);
ret = ffa_memory_reclaim(to_locked, handle, flags,
diff --git a/src/arch/aarch64/hypervisor/BUILD.gn b/src/arch/aarch64/hypervisor/BUILD.gn
index 8f57598..0f9c15e 100644
--- a/src/arch/aarch64/hypervisor/BUILD.gn
+++ b/src/arch/aarch64/hypervisor/BUILD.gn
@@ -17,7 +17,6 @@ offset_size_header("offsets") {
source_set("other_world") {
public_configs = [ "//src/arch/aarch64:config" ]
sources = [
- "ffa_memory_handle.c",
"other_world.c",
]
deps = [
diff --git a/src/arch/aarch64/hypervisor/ffa_memory_handle.c b/src/arch/aarch64/hypervisor/ffa_memory_handle.c
deleted file mode 100644
index 647186d..0000000
--- a/src/arch/aarch64/hypervisor/ffa_memory_handle.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2021 The Hafnium Authors.
- *
- * Use of this source code is governed by a BSD-style
- * license that can be found in the LICENSE file or at
- * https://opensource.org/licenses/BSD-3-Clause.
- */
-
-#include "hf/arch/ffa_memory_handle.h"
-
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index)
-{
-#if SECURE_WORLD == 1
- return (index & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK) |
- FFA_MEMORY_HANDLE_ALLOCATOR_SPMC;
-#else
- return index | FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
-#endif
-}
-
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle)
-{
- return (handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
-#if SECURE_WORLD == 1
- FFA_MEMORY_HANDLE_ALLOCATOR_SPMC;
-#else
- FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
-#endif
-}
diff --git a/src/arch/fake/hypervisor/BUILD.gn b/src/arch/fake/hypervisor/BUILD.gn
index 8f28802..97a82f6 100644
--- a/src/arch/fake/hypervisor/BUILD.gn
+++ b/src/arch/fake/hypervisor/BUILD.gn
@@ -16,7 +16,6 @@ source_set("hypervisor") {
source_set("other_world") {
sources = [
- "ffa_memory_handle.c",
"other_world.c",
]
}
diff --git a/src/arch/fake/hypervisor/ffa_memory_handle.c b/src/arch/fake/hypervisor/ffa_memory_handle.c
deleted file mode 100644
index 9091295..0000000
--- a/src/arch/fake/hypervisor/ffa_memory_handle.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2021 The Hafnium Authors.
- *
- * Use of this source code is governed by a BSD-style
- * license that can be found in the LICENSE file or at
- * https://opensource.org/licenses/BSD-3-Clause.
- */
-
-#include "hf/arch/ffa_memory_handle.h"
-
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index)
-{
- return index;
-}
-
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle)
-{
- (void)handle;
- return true;
-}
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
index 8b28191..00ec68c 100644
--- a/src/ffa_memory.c
+++ b/src/ffa_memory.c
@@ -8,7 +8,6 @@
#include "hf/ffa_memory.h"
-#include "hf/arch/ffa_memory_handle.h"
#include "hf/arch/other_world.h"
#include "hf/api.h"
@@ -121,14 +120,6 @@ static struct ffa_memory_share_state share_states[MAX_MEM_SHARES];
alignas(PAGE_SIZE) static uint8_t
tee_retrieve_buffer[HF_MAILBOX_SIZE * MAX_FRAGMENTS];
-/**
- * Extracts the index from a memory handle allocated by Hafnium's current world.
- */
-uint64_t ffa_memory_handle_get_index(ffa_memory_handle_t handle)
-{
- return handle & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK;
-}
-
/**
* Initialises the next available `struct ffa_memory_share_state` and sets
* `share_state_ret` to a pointer to it. If `handle` is
@@ -159,7 +150,8 @@ static bool allocate_share_state(
if (handle == FFA_MEMORY_HANDLE_INVALID) {
memory_region->handle =
- ffa_memory_handle_make(i);
+ i |
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR;
} else {
memory_region->handle = handle;
}
@@ -213,7 +205,7 @@ static bool get_share_state(struct share_states_locked share_states,
struct ffa_memory_share_state **share_state_ret)
{
struct ffa_memory_share_state *share_state;
- uint64_t index;
+ uint32_t index;
CHECK(share_states.share_states != NULL);
CHECK(share_state_ret != NULL);
@@ -222,8 +214,9 @@ static bool get_share_state(struct share_states_locked share_states,
* First look for a share_state allocated by us, in which case the
* handle is based on the index.
*/
- if (ffa_memory_handle_allocated_by_current_world(handle)) {
- index = ffa_memory_handle_get_index(handle);
+ if ((handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
+ FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR) {
+ index = handle & ~FFA_MEMORY_HANDLE_ALLOCATOR_MASK;
if (index < MAX_MEM_SHARES) {
share_state = &share_states.share_states[index];
if (share_state->share_func != 0) {
--
2.29.2
@@ -0,0 +1,99 @@
From f080a6ae839b48188131648363c9e050f496f205 Mon Sep 17 00:00:00 2001
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Date: Mon, 12 Apr 2021 10:22:26 +0100
Subject: [PATCH 3/3] FF-A: Fix to fetch proper vCPU index for UP SP
When switching the context between SPs, fetch the vCPU index using
api_vm_get_vcpu() helper routine. This routine gets the vCPU at index 0
for UP SP.
Rename function api_ffa_msg_send_direct_get_receiver_vcpu() to
api_vm_get_vcpu() as it is used both in direct message request
and response.
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I45a60427f8c2d1b5058443536d972495728ee0c2
Upstream-Status: Pending [Not submitted to upstream yet]
---
src/api.c | 44 +++++++++++++++++++++-----------------------
1 file changed, 21 insertions(+), 23 deletions(-)
diff --git a/src/api.c b/src/api.c
index 16626b6..4c8034e 100644
--- a/src/api.c
+++ b/src/api.c
@@ -63,6 +63,25 @@ void api_init(struct mpool *ppool)
mpool_init_from(&api_page_pool, ppool);
}
+/**
+ * Get target VM vCPU.
+ * If VM is UP then return first vCPU.
+ * If VM is MP then return vCPU whose index matches current CPU index.
+ */
+static struct vcpu *api_vm_get_vcpu(struct vm *vm, struct vcpu *current)
+{
+ ffa_vcpu_index_t current_cpu_index = cpu_index(current->cpu);
+ struct vcpu *vcpu = NULL;
+
+ if (vm->vcpu_count == 1) {
+ vcpu = vm_get_vcpu(vm, 0);
+ } else if (current_cpu_index < vm->vcpu_count) {
+ vcpu = vm_get_vcpu(vm, current_cpu_index);
+ }
+
+ return vcpu;
+}
+
/**
* Switches the physical CPU back to the corresponding vCPU of the VM whose ID
* is given as argument of the function.
@@ -80,7 +99,7 @@ static struct vcpu *api_switch_to_vm(struct vcpu *current,
ffa_vm_id_t to_id)
{
struct vm *to_vm = vm_find(to_id);
- struct vcpu *next = vm_get_vcpu(to_vm, cpu_index(current->cpu));
+ struct vcpu *next = api_vm_get_vcpu(to_vm, current);
CHECK(next != NULL);
@@ -1630,26 +1649,6 @@ struct ffa_value api_ffa_features(uint32_t function_id)
}
}
-/**
- * Get target VM vCPU for direct messaging request.
- * If VM is UP then return first vCPU.
- * If VM is MP then return vCPU whose index matches current CPU index.
- */
-static struct vcpu *api_ffa_msg_send_direct_get_receiver_vcpu(
- struct vm *vm, struct vcpu *current)
-{
- ffa_vcpu_index_t current_cpu_index = cpu_index(current->cpu);
- struct vcpu *vcpu = NULL;
-
- if (vm->vcpu_count == 1) {
- vcpu = vm_get_vcpu(vm, 0);
- } else if (current_cpu_index < vm->vcpu_count) {
- vcpu = vm_get_vcpu(vm, current_cpu_index);
- }
-
- return vcpu;
-}
-
/**
* FF-A specification states that x2/w2 Must Be Zero for direct messaging
* interfaces.
@@ -1733,8 +1732,7 @@ struct ffa_value api_ffa_msg_send_direct_req(ffa_vm_id_t sender_vm_id,
* number of PEs in the system. It further states that MP partitions
* accepting direct request messages cannot migrate.
*/
- receiver_vcpu =
- api_ffa_msg_send_direct_get_receiver_vcpu(receiver_vm, current);
+ receiver_vcpu = api_vm_get_vcpu(receiver_vm, current);
if (receiver_vcpu == NULL) {
return ffa_error(FFA_INVALID_PARAMETERS);
}
--
2.29.2
@@ -0,0 +1,32 @@
From fd177558a1da73fa7e10f8b2997864bb76d66dc8 Mon Sep 17 00:00:00 2001
From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Date: Thu, 15 Apr 2021 10:46:33 +0100
Subject: [PATCH] tc0: Add Theodul DSU support and GICR changes
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I4a9b7e4350410fdacccd8c12ff03a61b7e64e98b
Upstream-Status: Pending [Not submitted to upstream yet]
---
project/reference/BUILD.gn | 4 ++--
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/project/reference/BUILD.gn b/project/reference/BUILD.gn
index 5596009..ffcaab7 100644
--- a/project/reference/BUILD.gn
+++ b/project/reference/BUILD.gn
@@ -160,9 +160,9 @@ aarch64_toolchains("secure_tc0") {
iommu = "//src/iommu:absent"
gic_version = 3
gicd_base_address = "0x30000000"
- gicr_base_address = "0x30140000"
- heap_pages = 60
- max_cpus = 4
+ gicr_base_address = "0x30080000"
+ heap_pages = 80
+ max_cpus = 8
max_vms = 16
toolchain_args = {
plat_psci = "//src/arch/aarch64/plat/psci:spmc"
--
2.29.2
@@ -0,0 +1,19 @@
# TC0 specific configuration
# Intermediate SHA with 2.4 baseline version, required for OP-TEE SEL1 support
SRCREV = "2904b2c5361f06d35c324f37d2e71e3278d351a7"
PV = "2.4+git${SRCPV}"
FILESEXTRAPATHS_prepend_tc0 := "${THISDIR}/files/tc0:"
SRC_URI_append = " \
file://0001-Revert-FFA-Set-and-verify-allocator-of-memory-handle.patch \
file://0002-FF-A-Fix-to-fetch-proper-vCPU-index-for-UP-SP.patch \
file://0003-tc0-Theodul-GICR-changes.patch \
"
COMPATIBLE_MACHINE = "tc0"
HAFNIUM_PROJECT = "reference"
HAFNIUM_PLATFORM = "secure_tc0"
HAFNIUM_INSTALL_TARGET = "hafnium"
@@ -0,0 +1,6 @@
# Machine specific configurations
MACHINE_HAFNIUM_REQUIRE ?= ""
MACHINE_HAFNIUM_REQUIRE_tc0 = "hafnium-tc0.inc"
require ${MACHINE_HAFNIUM_REQUIRE}
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2020 Arm Limited
#
SUMMARY = "Total Compute Images"
DESCRIPTION = "Build all the images required for Total Compute platform"
LICENSE = "Apache-2.0"
inherit nopackages
# The last image to be built is trusted-firmware-a
DEPENDS += " trusted-firmware-a"
@@ -1,13 +1,9 @@
Upstream-Status: Inappropriate [will not be submitted as its only required till hardware gets fixed]
The patch is picked from git repo:
https://git.linaro.org/landing-teams/working/arm/n1sdp-pcie-quirk.git/tree/scp/0001-product-n1sdp-set-CCIX-speed-to-GEN3-to-work-with-in.patch
Upstream-Status: Backport
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
From a6d545cf9b6c46f2ea415d64fa81eb4771cfb51c Mon Sep 17 00:00:00 2001
From 3deb59c5f4c64aa092bb3a4ebc018acf3f746f47 Mon Sep 17 00:00:00 2001
From: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Date: Thu, 28 May 2020 16:19:12 +0530
Date: Tue, 10 Nov 2020 12:31:04 +0530
Subject: [PATCH] product/n1sdp: set CCIX speed to GEN3 to work with interposer
C2C setup
@@ -15,23 +11,22 @@ Set CCIX speed to GEN3 to work with interposer C2C setup
In this use case set downstream/upstream port transmitter
preset value to 4.
Change-Id: I16e72a5eaa105386a64ab4ffe56f67134c670313
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Change-Id: I635566574babbb7591b5bba97105f76f1f8e550a
---
.../module/n1sdp_pcie/src/mod_n1sdp_pcie.c | 33 +++++++++++++++----
1 file changed, 26 insertions(+), 7 deletions(-)
.../module/n1sdp_pcie/src/mod_n1sdp_pcie.c | 30 ++++++++++++++-----
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/product/n1sdp/module/n1sdp_pcie/src/mod_n1sdp_pcie.c b/product/n1sdp/module/n1sdp_pcie/src/mod_n1sdp_pcie.c
index 19fa5a5..a93e6cc 100644
index 901e0464..ba02144f 100644
--- a/product/n1sdp/module/n1sdp_pcie/src/mod_n1sdp_pcie.c
+++ b/product/n1sdp/module/n1sdp_pcie/src/mod_n1sdp_pcie.c
@@ -206,7 +206,13 @@ static int n1sdp_pcie_phy_init(fwk_id_t id)
@@ -206,7 +206,12 @@ static int n1sdp_pcie_phy_init(fwk_id_t id)
if (dev_ctx == NULL)
return FWK_E_PARAM;
- gen_speed = dev_ctx->config->ccix_capable ? PCIE_GEN_4 : PCIE_GEN_3;
+ if ((n1sdp_get_chipid() != 0x0) ||
+ !dev_ctx->config->ccix_capable ||
+ if ((n1sdp_get_chipid() != 0x0) || !dev_ctx->config->ccix_capable ||
+ pcie_ctx.c2c_api->is_slave_alive())
+ gen_speed = PCIE_GEN_3;
+ else
@@ -40,13 +35,12 @@ index 19fa5a5..a93e6cc 100644
lane_count = LAN_COUNT_IN_X_16;
FWK_LOG_INFO("[%s] Initializing PHY...", pcie_type[did]);
@@ -239,7 +245,13 @@ static int n1sdp_pcie_controller_init(fwk_id_t id, bool ep_mode)
@@ -239,7 +244,12 @@ static int n1sdp_pcie_controller_init(fwk_id_t id, bool ep_mode)
if (dev_ctx == NULL)
return FWK_E_PARAM;
- gen_speed = dev_ctx->config->ccix_capable ? PCIE_GEN_4 : PCIE_GEN_3;
+ if ((n1sdp_get_chipid() != 0x0) ||
+ !dev_ctx->config->ccix_capable ||
+ if ((n1sdp_get_chipid() != 0x0) || !dev_ctx->config->ccix_capable ||
+ pcie_ctx.c2c_api->is_slave_alive())
+ gen_speed = PCIE_GEN_3;
+ else
@@ -55,13 +49,12 @@ index 19fa5a5..a93e6cc 100644
lane_count = LAN_COUNT_IN_X_16;
if (ep_mode) {
@@ -282,12 +294,19 @@ static int n1sdp_pcie_link_training(fwk_id_t id, bool ep_mode)
@@ -282,12 +292,18 @@ static int n1sdp_pcie_link_training(fwk_id_t id, bool ep_mode)
if (dev_ctx == NULL)
return FWK_E_PARAM;
- gen_speed = dev_ctx->config->ccix_capable ? PCIE_GEN_4 : PCIE_GEN_3;
+ if ((n1sdp_get_chipid() != 0x0) ||
+ !dev_ctx->config->ccix_capable ||
+ if ((n1sdp_get_chipid() != 0x0) || !dev_ctx->config->ccix_capable ||
+ pcie_ctx.c2c_api->is_slave_alive()) {
+ gen_speed = PCIE_GEN_3;
+ down_stream_tx_preset = PCIE_RC_TX_PRESET_VALUE;
@@ -81,5 +74,5 @@ index 19fa5a5..a93e6cc 100644
if (gen_speed >= PCIE_GEN_3 && !ep_mode) {
FWK_LOG_INFO(
--
2.25.0
2.25.1
@@ -0,0 +1,817 @@
From 6be977b3196b555cdee0758a380102264410f651 Mon Sep 17 00:00:00 2001
From: Usama Arif <usama.arif@arm.com>
Date: Sun, 31 Jan 2021 22:13:07 +0000
Subject: [PATCH 1/2] product/tc0: add clock and dvfs support for all cores.
This patch corrects the OPPs of cores 0-3 (klein cores)
and adds the right OPPs for matterhorn cores.
Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I1070d71c29ca2d06f9945708c135fa812b172003
Upstream-Status: Backport [https://github.com/ARM-software/SCP-firmware/commit/a550dd1042ecc1e6191ea2636b67d370ee865024]
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
---
product/tc0/include/clock_soc.h | 15 +++-
product/tc0/include/scp_soc_mmap.h | 4 +
product/tc0/include/tc0_timer.h | 3 +-
product/tc0/scp_ramfw/config_clock.c | 18 +++-
product/tc0/scp_ramfw/config_css_clock.c | 105 +++++++++++++++++++---
product/tc0/scp_ramfw/config_dvfs.c | 62 +++++++++++--
product/tc0/scp_ramfw/config_mock_psu.c | 16 +++-
product/tc0/scp_ramfw/config_pik_clock.c | 77 +++++++++++++---
product/tc0/scp_ramfw/config_psu.c | 11 ++-
product/tc0/scp_ramfw/config_scmi_perf.c | 1 +
product/tc0/scp_ramfw/config_system_pll.c | 19 +++-
product/tc0/scp_romfw/config_clock.c | 6 +-
product/tc0/scp_romfw/config_css_clock.c | 40 ++++-----
product/tc0/scp_romfw/config_pik_clock.c | 20 ++---
product/tc0/scp_romfw/config_system_pll.c | 6 +-
15 files changed, 327 insertions(+), 76 deletions(-)
diff --git a/product/tc0/include/clock_soc.h b/product/tc0/include/clock_soc.h
index 3e05bbab..2c2805c0 100644
--- a/product/tc0/include/clock_soc.h
+++ b/product/tc0/include/clock_soc.h
@@ -17,7 +17,8 @@
* PLL clock indexes.
*/
enum clock_pll_idx {
- CLOCK_PLL_IDX_CPU0,
+ CLOCK_PLL_IDX_CPU_KLEIN,
+ CLOCK_PLL_IDX_CPU_MATTERHORN,
CLOCK_PLL_IDX_SYS,
CLOCK_PLL_IDX_INTERCONNECT,
CLOCK_PLL_IDX_DPU,
@@ -30,11 +31,15 @@ enum clock_pll_idx {
* PIK clock indexes.
*/
enum clock_pik_idx {
+ CLOCK_PIK_IDX_INTERCONNECT,
CLOCK_PIK_IDX_CLUS0_CPU0,
CLOCK_PIK_IDX_CLUS0_CPU1,
CLOCK_PIK_IDX_CLUS0_CPU2,
CLOCK_PIK_IDX_CLUS0_CPU3,
- CLOCK_PIK_IDX_INTERCONNECT,
+ CLOCK_PIK_IDX_CLUS0_CPU4,
+ CLOCK_PIK_IDX_CLUS0_CPU5,
+ CLOCK_PIK_IDX_CLUS0_CPU6,
+ CLOCK_PIK_IDX_CLUS0_CPU7,
CLOCK_PIK_IDX_SCP,
CLOCK_PIK_IDX_GIC,
CLOCK_PIK_IDX_PCLKSCP,
@@ -48,7 +53,8 @@ enum clock_pik_idx {
* CSS clock indexes.
*/
enum clock_css_idx {
- CLOCK_CSS_IDX_CPU_GROUP0,
+ CLOCK_CSS_IDX_CPU_GROUP_KLEIN,
+ CLOCK_CSS_IDX_CPU_GROUP_MATTERHORN,
CLOCK_CSS_IDX_DPU,
CLOCK_CSS_IDX_COUNT
};
@@ -58,7 +64,8 @@ enum clock_css_idx {
*/
enum clock_idx {
CLOCK_IDX_INTERCONNECT,
- CLOCK_IDX_CPU_GROUP0,
+ CLOCK_IDX_CPU_GROUP_KLEIN,
+ CLOCK_IDX_CPU_GROUP_MATTERHORN,
CLOCK_IDX_DPU,
CLOCK_IDX_PIXEL_0,
CLOCK_IDX_PIXEL_1,
diff --git a/product/tc0/include/scp_soc_mmap.h b/product/tc0/include/scp_soc_mmap.h
index 14f8a8d5..774bbc29 100644
--- a/product/tc0/include/scp_soc_mmap.h
+++ b/product/tc0/include/scp_soc_mmap.h
@@ -22,5 +22,9 @@
#define SCP_PLL_CPU1 (SCP_PLL_BASE + 0x00000104)
#define SCP_PLL_CPU2 (SCP_PLL_BASE + 0x00000108)
#define SCP_PLL_CPU3 (SCP_PLL_BASE + 0x0000010C)
+#define SCP_PLL_CPU4 (SCP_PLL_BASE + 0x00000110)
+#define SCP_PLL_CPU5 (SCP_PLL_BASE + 0x00000114)
+#define SCP_PLL_CPU6 (SCP_PLL_BASE + 0x00000118)
+#define SCP_PLL_CPU7 (SCP_PLL_BASE + 0x0000011C)
#endif /* SCP_SOC_MMAP_H */
diff --git a/product/tc0/include/tc0_timer.h b/product/tc0/include/tc0_timer.h
index 03d6893c..6f4bf06c 100644
--- a/product/tc0/include/tc0_timer.h
+++ b/product/tc0/include/tc0_timer.h
@@ -9,7 +9,8 @@
#define CONFIG_TIMER_H
enum config_timer_refclk_sub_element_idx {
- CONFIG_TIMER_DVFS_CPU,
+ CONFIG_TIMER_DVFS_CPU_KLEIN,
+ CONFIG_TIMER_DVFS_CPU_MATTERHORN,
CONFIG_TIMER_SUB_ELEMENT_IDX_COUNT,
};
diff --git a/product/tc0/scp_ramfw/config_clock.c b/product/tc0/scp_ramfw/config_clock.c
index db545119..98863a01 100644
--- a/product/tc0/scp_ramfw/config_clock.c
+++ b/product/tc0/scp_ramfw/config_clock.c
@@ -32,13 +32,25 @@ static const struct fwk_element clock_dev_desc_table[] = {
MOD_PIK_CLOCK_API_TYPE_CLOCK),
}),
},
- [CLOCK_IDX_CPU_GROUP0] =
+ [CLOCK_IDX_CPU_GROUP_KLEIN] =
{
- .name = "CPU_GROUP0",
+ .name = "CPU_GROUP_KLEIN",
.data = &((struct mod_clock_dev_config){
.driver_id = FWK_ID_ELEMENT_INIT(
FWK_MODULE_IDX_CSS_CLOCK,
- CLOCK_CSS_IDX_CPU_GROUP0),
+ CLOCK_CSS_IDX_CPU_GROUP_KLEIN),
+ .api_id = FWK_ID_API_INIT(
+ FWK_MODULE_IDX_CSS_CLOCK,
+ MOD_CSS_CLOCK_API_TYPE_CLOCK),
+ }),
+ },
+ [CLOCK_IDX_CPU_GROUP_MATTERHORN] =
+ {
+ .name = "CPU_GROUP_MATTERHORN",
+ .data = &((struct mod_clock_dev_config){
+ .driver_id = FWK_ID_ELEMENT_INIT(
+ FWK_MODULE_IDX_CSS_CLOCK,
+ CLOCK_CSS_IDX_CPU_GROUP_MATTERHORN),
.api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_CSS_CLOCK,
MOD_CSS_CLOCK_API_TYPE_CLOCK),
diff --git a/product/tc0/scp_ramfw/config_css_clock.c b/product/tc0/scp_ramfw/config_css_clock.c
index 1ad285ae..14a23d63 100644
--- a/product/tc0/scp_ramfw/config_css_clock.c
+++ b/product/tc0/scp_ramfw/config_css_clock.c
@@ -17,7 +17,60 @@
#include <fwk_module.h>
#include <fwk_module_idx.h>
-static const struct mod_css_clock_rate rate_table_cpu_group[] = {
+static const struct mod_css_clock_rate rate_table_cpu_group_klein[] = {
+ {
+ /* Super Underdrive */
+ .rate = 768 * FWK_MHZ,
+ .pll_rate = 768 * FWK_MHZ,
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
+ .clock_div = 1,
+ .clock_mod_numerator = 1,
+ .clock_mod_denominator = 1,
+ },
+ {
+ /* Underdrive */
+ .rate = 1153 * FWK_MHZ,
+ .pll_rate = 1153 * FWK_MHZ,
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
+ .clock_div = 1,
+ .clock_mod_numerator = 1,
+ .clock_mod_denominator = 1,
+ },
+ {
+ /* Nominal */
+ .rate = 1537 * FWK_MHZ,
+ .pll_rate = 1537 * FWK_MHZ,
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
+ .clock_div = 1,
+ .clock_mod_numerator = 1,
+ .clock_mod_denominator = 1,
+ },
+ {
+ /* Overdrive */
+ .rate = 1844 * FWK_MHZ,
+ .pll_rate = 1844 * FWK_MHZ,
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
+ .clock_div = 1,
+ .clock_mod_numerator = 1,
+ .clock_mod_denominator = 1,
+ },
+ {
+ /* Super Overdrive */
+ .rate = 2152 * FWK_MHZ,
+ .pll_rate = 2152 * FWK_MHZ,
+ .clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
+ .clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
+ .clock_div = 1,
+ .clock_mod_numerator = 1,
+ .clock_mod_denominator = 1,
+ },
+};
+
+static const struct mod_css_clock_rate rate_table_cpu_group_matterhorn[] = {
{
/* Super Underdrive */
.rate = 946 * FWK_MHZ,
@@ -70,39 +123,71 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
},
};
-static const fwk_id_t member_table_cpu_group_0[] = {
+static const fwk_id_t member_table_cpu_group_klein[] = {
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU0),
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU1),
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU2),
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU3),
};
+static const fwk_id_t member_table_cpu_group_matterhorn[] = {
+ FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU4),
+ FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU5),
+ FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU6),
+ FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU7),
+};
+
+
static const fwk_id_t member_table_dpu[] = {
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_DPU),
};
static const struct fwk_element css_clock_element_table[] = {
- [CLOCK_CSS_IDX_CPU_GROUP0] =
+ [CLOCK_CSS_IDX_CPU_GROUP_KLEIN] =
+ {
+ .name = "CPU_GROUP_KLEIN",
+ .data = &((struct mod_css_clock_dev_config){
+ .clock_type = MOD_CSS_CLOCK_TYPE_INDEXED,
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
+ .clock_switching_source =
+ MOD_PIK_CLOCK_CLUSCLK_SOURCE_SYSREFCLK,
+ .pll_id = FWK_ID_ELEMENT_INIT(
+ FWK_MODULE_IDX_SYSTEM_PLL,
+ CLOCK_PLL_IDX_CPU_KLEIN),
+ .pll_api_id = FWK_ID_API_INIT(
+ FWK_MODULE_IDX_SYSTEM_PLL,
+ MOD_SYSTEM_PLL_API_TYPE_DEFAULT),
+ .member_table = member_table_cpu_group_klein,
+ .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_klein),
+ .member_api_id = FWK_ID_API_INIT(
+ FWK_MODULE_IDX_PIK_CLOCK,
+ MOD_PIK_CLOCK_API_TYPE_CSS),
+ .initial_rate = 1537 * FWK_MHZ,
+ .modulation_supported = true,
+ }),
+ },
+ [CLOCK_CSS_IDX_CPU_GROUP_MATTERHORN] =
{
- .name = "CPU_GROUP_0",
+ .name = "CPU_GROUP_MATTERHORN",
.data = &((struct mod_css_clock_dev_config){
.clock_type = MOD_CSS_CLOCK_TYPE_INDEXED,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_matterhorn,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
.clock_switching_source =
MOD_PIK_CLOCK_CLUSCLK_SOURCE_SYSREFCLK,
.pll_id = FWK_ID_ELEMENT_INIT(
FWK_MODULE_IDX_SYSTEM_PLL,
- CLOCK_PLL_IDX_CPU0),
+ CLOCK_PLL_IDX_CPU_MATTERHORN),
.pll_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_SYSTEM_PLL,
MOD_SYSTEM_PLL_API_TYPE_DEFAULT),
- .member_table = member_table_cpu_group_0,
- .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_0),
+ .member_table = member_table_cpu_group_matterhorn,
+ .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_matterhorn),
.member_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_PIK_CLOCK,
MOD_PIK_CLOCK_API_TYPE_CSS),
- .initial_rate = 2271 * FWK_MHZ,
+ .initial_rate = 1893 * FWK_MHZ,
.modulation_supported = true,
}),
},
diff --git a/product/tc0/scp_ramfw/config_dvfs.c b/product/tc0/scp_ramfw/config_dvfs.c
index a0b59b2b..4b952ef8 100644
--- a/product/tc0/scp_ramfw/config_dvfs.c
+++ b/product/tc0/scp_ramfw/config_dvfs.c
@@ -16,7 +16,35 @@
#include <fwk_module.h>
#include <fwk_module_idx.h>
-static struct mod_dvfs_opp opps[] = { {
+static struct mod_dvfs_opp opps_klein[] = { {
+ .level = 768 * 1000000UL,
+ .frequency = 768 * FWK_KHZ,
+ .voltage = 550,
+ },
+ {
+ .level = 1153 * 1000000UL,
+ .frequency = 1153 * FWK_KHZ,
+ .voltage = 650,
+ },
+ {
+ .level = 1537 * 1000000UL,
+ .frequency = 1537 * FWK_KHZ,
+ .voltage = 750,
+ },
+ {
+ .level = 1844 * 1000000UL,
+ .frequency = 1844 * FWK_KHZ,
+ .voltage = 850,
+ },
+ {
+ .level = 2152 * 1000000UL,
+ .frequency = 2152 * FWK_KHZ,
+ .voltage = 950,
+ },
+ { 0 } };
+
+
+static struct mod_dvfs_opp opps_matterhorn[] = { {
.level = 946 * 1000000UL,
.frequency = 946 * FWK_KHZ,
.voltage = 550,
@@ -43,11 +71,26 @@ static struct mod_dvfs_opp opps[] = { {
},
{ 0 } };
-static const struct mod_dvfs_domain_config cpu_group = {
+static const struct mod_dvfs_domain_config cpu_group_klein = {
.psu_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PSU, 0),
- .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP0),
+ .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP_KLEIN),
+ .alarm_id =
+ FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, 0, CONFIG_TIMER_DVFS_CPU_KLEIN),
+ .notification_id = FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SCMI_PERF),
+ .updates_api_id = FWK_ID_API_INIT(
+ FWK_MODULE_IDX_SCMI_PERF,
+ MOD_SCMI_PERF_DVFS_UPDATE_API),
+ .retry_ms = 1,
+ .latency = 1200,
+ .sustained_idx = 2,
+ .opps = opps_klein,
+};
+
+static const struct mod_dvfs_domain_config cpu_group_matterhorn = {
+ .psu_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PSU, 1),
+ .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP_MATTERHORN),
.alarm_id =
- FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, 0, CONFIG_TIMER_DVFS_CPU),
+ FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, 0, CONFIG_TIMER_DVFS_CPU_MATTERHORN),
.notification_id = FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SCMI_PERF),
.updates_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_SCMI_PERF,
@@ -55,13 +98,18 @@ static const struct mod_dvfs_domain_config cpu_group = {
.retry_ms = 1,
.latency = 1200,
.sustained_idx = 2,
- .opps = opps,
+ .opps = opps_matterhorn,
};
static const struct fwk_element element_table[] = { [0] =
{
- .name = "CPU_GROUP",
- .data = &cpu_group,
+ .name = "CPU_GROUP_KLEIN",
+ .data = &cpu_group_klein,
+ },
+ [1] =
+ {
+ .name = "CPU_GROUP_MATTERHORN",
+ .data = &cpu_group_matterhorn,
},
{ 0 } };
diff --git a/product/tc0/scp_ramfw/config_mock_psu.c b/product/tc0/scp_ramfw/config_mock_psu.c
index 1f9411ca..2d3742f2 100644
--- a/product/tc0/scp_ramfw/config_mock_psu.c
+++ b/product/tc0/scp_ramfw/config_mock_psu.c
@@ -12,7 +12,21 @@
static const struct fwk_element element_table[] = {
{
- .name = "DVFS_GROUP0",
+ .name = "DVFS_GROUP_KLEIN",
+ .data =
+ &(const struct mod_mock_psu_element_cfg){
+ .async_alarm_id = FWK_ID_NONE_INIT,
+ .async_alarm_api_id = FWK_ID_NONE_INIT,
+
+ .async_response_id = FWK_ID_NONE_INIT,
+ .async_response_api_id = FWK_ID_NONE_INIT,
+
+ .default_enabled = true,
+ .default_voltage = 550,
+ },
+ },
+ {
+ .name = "DVFS_GROUP_MATTERHORN",
.data =
&(const struct mod_mock_psu_element_cfg){
.async_alarm_id = FWK_ID_NONE_INIT,
diff --git a/product/tc0/scp_ramfw/config_pik_clock.c b/product/tc0/scp_ramfw/config_pik_clock.c
index d2c03865..38837a91 100644
--- a/product/tc0/scp_ramfw/config_pik_clock.c
+++ b/product/tc0/scp_ramfw/config_pik_clock.c
@@ -21,9 +21,18 @@
/*
* Rate lookup tables
*/
-static struct mod_pik_clock_rate rate_table_cpu_group[] = {
+static struct mod_pik_clock_rate rate_table_cpu_group_klein[] = {
{
- .rate = 1750 * FWK_MHZ,
+ .rate = 1537 * FWK_MHZ,
+ .source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
+ .divider_reg = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
+ .divider = 1, /* Rate adjusted via CPU PLL */
+ },
+};
+
+static struct mod_pik_clock_rate rate_table_cpu_group_matterhorn[] = {
+ {
+ .rate = 1893 * FWK_MHZ,
.source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
.divider_reg = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
.divider = 1, /* Rate adjusted via CPU PLL */
@@ -103,8 +112,8 @@ static const struct fwk_element pik_clock_element_table[] = {
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].CTRL,
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].DIV,
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].MOD,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
}),
},
[CLOCK_PIK_IDX_CLUS0_CPU1] = {
@@ -115,8 +124,8 @@ static const struct fwk_element pik_clock_element_table[] = {
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].CTRL,
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].DIV,
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].MOD,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
}),
},
[CLOCK_PIK_IDX_CLUS0_CPU2] = {
@@ -127,8 +136,8 @@ static const struct fwk_element pik_clock_element_table[] = {
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].CTRL,
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].DIV,
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].MOD,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
}),
},
[CLOCK_PIK_IDX_CLUS0_CPU3] = {
@@ -139,8 +148,56 @@ static const struct fwk_element pik_clock_element_table[] = {
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].CTRL,
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].DIV,
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].MOD,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
+ }),
+ },
+ [CLOCK_PIK_IDX_CLUS0_CPU4] = {
+ .name = "CLUS0_CPU4",
+ .data = &((struct mod_pik_clock_dev_config) {
+ .type = MOD_PIK_CLOCK_TYPE_CLUSTER,
+ .is_group_member = true,
+ .control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[4].CTRL,
+ .divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[4].DIV,
+ .modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[4].MOD,
+ .rate_table = rate_table_cpu_group_matterhorn,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
+ }),
+ },
+ [CLOCK_PIK_IDX_CLUS0_CPU5] = {
+ .name = "CLUS0_CPU5",
+ .data = &((struct mod_pik_clock_dev_config) {
+ .type = MOD_PIK_CLOCK_TYPE_CLUSTER,
+ .is_group_member = true,
+ .control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[5].CTRL,
+ .divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[5].DIV,
+ .modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[5].MOD,
+ .rate_table = rate_table_cpu_group_matterhorn,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
+ }),
+ },
+ [CLOCK_PIK_IDX_CLUS0_CPU6] = {
+ .name = "CLUS0_CPU6",
+ .data = &((struct mod_pik_clock_dev_config) {
+ .type = MOD_PIK_CLOCK_TYPE_CLUSTER,
+ .is_group_member = true,
+ .control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[6].CTRL,
+ .divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[6].DIV,
+ .modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[6].MOD,
+ .rate_table = rate_table_cpu_group_matterhorn,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
+ }),
+ },
+ [CLOCK_PIK_IDX_CLUS0_CPU7] = {
+ .name = "CLUS0_CPU7",
+ .data = &((struct mod_pik_clock_dev_config) {
+ .type = MOD_PIK_CLOCK_TYPE_CLUSTER,
+ .is_group_member = true,
+ .control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[7].CTRL,
+ .divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[7].DIV,
+ .modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[7].MOD,
+ .rate_table = rate_table_cpu_group_matterhorn,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_matterhorn),
}),
},
[CLOCK_PIK_IDX_INTERCONNECT] = {
diff --git a/product/tc0/scp_ramfw/config_psu.c b/product/tc0/scp_ramfw/config_psu.c
index 8e3bcb5a..3bf0f7fd 100644
--- a/product/tc0/scp_ramfw/config_psu.c
+++ b/product/tc0/scp_ramfw/config_psu.c
@@ -14,7 +14,7 @@
static const struct fwk_element element_table[] = {
{
- .name = "DVFS_GROUP0",
+ .name = "DVFS_GROUP_KLEIN",
.data =
&(const struct mod_psu_element_cfg){
.driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_MOCK_PSU, 0),
@@ -22,6 +22,15 @@ static const struct fwk_element element_table[] = {
FWK_MODULE_IDX_MOCK_PSU,
MOD_MOCK_PSU_API_IDX_DRIVER) },
},
+ {
+ .name = "DVFS_GROUP_MATTERHORN",
+ .data =
+ &(const struct mod_psu_element_cfg){
+ .driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_MOCK_PSU, 1),
+ .driver_api_id = FWK_ID_API_INIT(
+ FWK_MODULE_IDX_MOCK_PSU,
+ MOD_MOCK_PSU_API_IDX_DRIVER) },
+ },
{ 0 }
};
diff --git a/product/tc0/scp_ramfw/config_scmi_perf.c b/product/tc0/scp_ramfw/config_scmi_perf.c
index f2be2253..6ef6146b 100644
--- a/product/tc0/scp_ramfw/config_scmi_perf.c
+++ b/product/tc0/scp_ramfw/config_scmi_perf.c
@@ -15,6 +15,7 @@
static const struct mod_scmi_perf_domain_config domains[] = {
[0] = {},
+ [1] = {},
};
const struct fwk_module_config config_scmi_perf = {
diff --git a/product/tc0/scp_ramfw/config_system_pll.c b/product/tc0/scp_ramfw/config_system_pll.c
index b55dd642..37578855 100644
--- a/product/tc0/scp_ramfw/config_system_pll.c
+++ b/product/tc0/scp_ramfw/config_system_pll.c
@@ -18,14 +18,27 @@
static const struct fwk_element system_pll_element_table[] =
{
- [CLOCK_PLL_IDX_CPU0] =
+ [CLOCK_PLL_IDX_CPU_KLEIN] =
{
- .name = "CPU_PLL_0",
+ .name = "CPU_PLL_KLEIN",
.data = &((struct mod_system_pll_dev_config){
.control_reg = (void *)SCP_PLL_CPU0,
.status_reg = (void *)&SCP_PIK_PTR->PLL_STATUS[1],
.lock_flag_mask = PLL_STATUS_CPUPLLLOCK(0),
- .initial_rate = 1750 * FWK_MHZ,
+ .initial_rate = 1537 * FWK_MHZ,
+ .min_rate = MOD_SYSTEM_PLL_MIN_RATE,
+ .max_rate = MOD_SYSTEM_PLL_MAX_RATE,
+ .min_step = MOD_SYSTEM_PLL_MIN_INTERVAL,
+ }),
+ },
+ [CLOCK_PLL_IDX_CPU_MATTERHORN] =
+ {
+ .name = "CPU_PLL_MATTERHORN",
+ .data = &((struct mod_system_pll_dev_config){
+ .control_reg = (void *)SCP_PLL_CPU4,
+ .status_reg = (void *)&SCP_PIK_PTR->PLL_STATUS[1],
+ .lock_flag_mask = PLL_STATUS_CPUPLLLOCK(0),
+ .initial_rate = 1893 * FWK_MHZ,
.min_rate = MOD_SYSTEM_PLL_MIN_RATE,
.max_rate = MOD_SYSTEM_PLL_MAX_RATE,
.min_step = MOD_SYSTEM_PLL_MIN_INTERVAL,
diff --git a/product/tc0/scp_romfw/config_clock.c b/product/tc0/scp_romfw/config_clock.c
index f43b61b0..96806211 100644
--- a/product/tc0/scp_romfw/config_clock.c
+++ b/product/tc0/scp_romfw/config_clock.c
@@ -35,13 +35,13 @@ static const struct fwk_element clock_dev_desc_table[] = {
}),
},
- [CLOCK_IDX_CPU_GROUP0] =
+ [CLOCK_IDX_CPU_GROUP_KLEIN] =
{
- .name = "CPU_GROUP0",
+ .name = "CPU_GROUP_KLEIN",
.data = &((struct mod_clock_dev_config){
.driver_id = FWK_ID_ELEMENT_INIT(
FWK_MODULE_IDX_CSS_CLOCK,
- CLOCK_CSS_IDX_CPU_GROUP0),
+ CLOCK_CSS_IDX_CPU_GROUP_KLEIN),
.api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_CSS_CLOCK,
MOD_CSS_CLOCK_API_TYPE_CLOCK),
diff --git a/product/tc0/scp_romfw/config_css_clock.c b/product/tc0/scp_romfw/config_css_clock.c
index fcb9bbbb..ca284ee7 100644
--- a/product/tc0/scp_romfw/config_css_clock.c
+++ b/product/tc0/scp_romfw/config_css_clock.c
@@ -17,11 +17,11 @@
#include <fwk_module.h>
#include <fwk_module_idx.h>
-static const struct mod_css_clock_rate rate_table_cpu_group[] = {
+static const struct mod_css_clock_rate rate_table_cpu_group_klein[] = {
{
/* Super Underdrive */
- .rate = 946 * FWK_MHZ,
- .pll_rate = 946 * FWK_MHZ,
+ .rate = 768 * FWK_MHZ,
+ .pll_rate = 768 * FWK_MHZ,
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
.clock_div = 1,
@@ -30,8 +30,8 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
},
{
/* Underdrive */
- .rate = 1419 * FWK_MHZ,
- .pll_rate = 1419 * FWK_MHZ,
+ .rate = 1153 * FWK_MHZ,
+ .pll_rate = 1153 * FWK_MHZ,
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
.clock_div = 1,
@@ -40,8 +40,8 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
},
{
/* Nominal */
- .rate = 1893 * FWK_MHZ,
- .pll_rate = 1893 * FWK_MHZ,
+ .rate = 1537 * FWK_MHZ,
+ .pll_rate = 1537 * FWK_MHZ,
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
.clock_div = 1,
@@ -50,8 +50,8 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
},
{
/* Overdrive */
- .rate = 2271 * FWK_MHZ,
- .pll_rate = 2271 * FWK_MHZ,
+ .rate = 1844 * FWK_MHZ,
+ .pll_rate = 1844 * FWK_MHZ,
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
.clock_div = 1,
@@ -60,8 +60,8 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
},
{
/* Super Overdrive */
- .rate = 2650 * FWK_MHZ,
- .pll_rate = 2650 * FWK_MHZ,
+ .rate = 2152 * FWK_MHZ,
+ .pll_rate = 2152 * FWK_MHZ,
.clock_source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
.clock_div_type = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
.clock_div = 1,
@@ -70,7 +70,7 @@ static const struct mod_css_clock_rate rate_table_cpu_group[] = {
},
};
-static const fwk_id_t member_table_cpu_group_0[] = {
+static const fwk_id_t member_table_cpu_group_klein[] = {
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU0),
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU1),
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PIK_CLOCK, CLOCK_PIK_IDX_CLUS0_CPU2),
@@ -78,27 +78,27 @@ static const fwk_id_t member_table_cpu_group_0[] = {
};
static const struct fwk_element css_clock_element_table[] = {
- [CLOCK_CSS_IDX_CPU_GROUP0] =
+ [CLOCK_CSS_IDX_CPU_GROUP_KLEIN] =
{
- .name = "CPU_GROUP_0",
+ .name = "CPU_GROUP_KLEIN",
.data = &((struct mod_css_clock_dev_config){
.clock_type = MOD_CSS_CLOCK_TYPE_INDEXED,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
.clock_switching_source =
MOD_PIK_CLOCK_CLUSCLK_SOURCE_SYSREFCLK,
.pll_id = FWK_ID_ELEMENT_INIT(
FWK_MODULE_IDX_SYSTEM_PLL,
- CLOCK_PLL_IDX_CPU0),
+ CLOCK_PLL_IDX_CPU_KLEIN),
.pll_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_SYSTEM_PLL,
MOD_SYSTEM_PLL_API_TYPE_DEFAULT),
- .member_table = member_table_cpu_group_0,
- .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_0),
+ .member_table = member_table_cpu_group_klein,
+ .member_count = FWK_ARRAY_SIZE(member_table_cpu_group_klein),
.member_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_PIK_CLOCK,
MOD_PIK_CLOCK_API_TYPE_CSS),
- .initial_rate = 2271 * FWK_MHZ,
+ .initial_rate = 1537 * FWK_MHZ,
.modulation_supported = true,
}),
},
diff --git a/product/tc0/scp_romfw/config_pik_clock.c b/product/tc0/scp_romfw/config_pik_clock.c
index ba7c3ddc..2c883084 100644
--- a/product/tc0/scp_romfw/config_pik_clock.c
+++ b/product/tc0/scp_romfw/config_pik_clock.c
@@ -19,9 +19,9 @@
/*
* Rate lookup tables
*/
-static struct mod_pik_clock_rate rate_table_cpu_group[] = {
+static struct mod_pik_clock_rate rate_table_cpu_group_klein[] = {
{
- .rate = 1750 * FWK_MHZ,
+ .rate = 1537 * FWK_MHZ,
.source = MOD_PIK_CLOCK_CLUSCLK_SOURCE_PLL0,
.divider_reg = MOD_PIK_CLOCK_MSCLOCK_DIVIDER_DIV_EXT,
.divider = 1, /* Rate adjusted via CPU PLL */
@@ -94,8 +94,8 @@ static const struct fwk_element
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].CTRL,
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].DIV,
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[0].MOD,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
}),
},
[CLOCK_PIK_IDX_CLUS0_CPU1] =
@@ -107,8 +107,8 @@ static const struct fwk_element
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].CTRL,
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].DIV,
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[1].MOD,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
}),
},
[CLOCK_PIK_IDX_CLUS0_CPU2] =
@@ -120,8 +120,8 @@ static const struct fwk_element
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].CTRL,
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].DIV,
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[2].MOD,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
}),
},
[CLOCK_PIK_IDX_CLUS0_CPU3] =
@@ -133,8 +133,8 @@ static const struct fwk_element
.control_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].CTRL,
.divext_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].DIV,
.modulator_reg = &CLUSTER_PIK_PTR(0)->CORECLK[3].MOD,
- .rate_table = rate_table_cpu_group,
- .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group),
+ .rate_table = rate_table_cpu_group_klein,
+ .rate_count = FWK_ARRAY_SIZE(rate_table_cpu_group_klein),
}),
},
[CLOCK_PIK_IDX_INTERCONNECT] =
diff --git a/product/tc0/scp_romfw/config_system_pll.c b/product/tc0/scp_romfw/config_system_pll.c
index e6b578ff..8440f126 100644
--- a/product/tc0/scp_romfw/config_system_pll.c
+++ b/product/tc0/scp_romfw/config_system_pll.c
@@ -17,14 +17,14 @@
#include <fwk_module.h>
static const struct fwk_element system_pll_element_table[] = {
- [CLOCK_PLL_IDX_CPU0] =
+ [CLOCK_PLL_IDX_CPU_KLEIN] =
{
- .name = "CPU_PLL_0",
+ .name = "CPU_PLL_KLEIN",
.data = &((struct mod_system_pll_dev_config){
.control_reg = (void *)SCP_PLL_CPU0,
.status_reg = (void *)&SCP_PIK_PTR->PLL_STATUS[1],
.lock_flag_mask = PLL_STATUS_CPUPLLLOCK(0),
- .initial_rate = 1750 * FWK_MHZ,
+ .initial_rate = 1537 * FWK_MHZ,
.min_rate = MOD_SYSTEM_PLL_MIN_RATE,
.max_rate = MOD_SYSTEM_PLL_MAX_RATE,
.min_step = MOD_SYSTEM_PLL_MIN_INTERVAL,
--
2.29.2
@@ -0,0 +1,125 @@
From 492c5d094b5c9aaeffe076265840056a2b9d57ac Mon Sep 17 00:00:00 2001
From: Usama Arif <usama.arif@arm.com>
Date: Tue, 23 Feb 2021 15:06:46 +0000
Subject: [PATCH 2/2] module/cmn_booker: amend CFGM base address
The CFGM base address calculation depends on the number of ports
per XP.
Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: Iabb9e76b86ee80b345857deb86e9acd4cec5988c
Upstream-Status: Backport [https://github.com/ARM-software/SCP-firmware/commit/5abe1656f27216f633b3fc29e20ff64340f47bfe]
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
---
module/cmn_booker/include/mod_cmn_booker.h | 7 +++++++
module/cmn_booker/src/cmn_booker.c | 18 +++++++++++++++---
module/cmn_booker/src/cmn_booker.h | 5 +++--
module/cmn_booker/src/mod_cmn_booker.c | 2 +-
product/tc0/scp_romfw/config_cmn_booker.c | 1 +
5 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/module/cmn_booker/include/mod_cmn_booker.h b/module/cmn_booker/include/mod_cmn_booker.h
index 5d395521..a172b336 100644
--- a/module/cmn_booker/include/mod_cmn_booker.h
+++ b/module/cmn_booker/include/mod_cmn_booker.h
@@ -127,6 +127,13 @@ struct mod_cmn_booker_config {
* to a CAL port, node id of HN-F will be a odd number).
*/
bool hnf_cal_mode;
+
+ /*! \
+ * \brief Number of device ports per XP
+ * \details The calculation for CFGM base address depends on the number of
+ * ports per cross point
+ */
+ unsigned int ports_per_xp;
};
/*!
diff --git a/module/cmn_booker/src/cmn_booker.c b/module/cmn_booker/src/cmn_booker.c
index d6e90964..277415ef 100644
--- a/module/cmn_booker/src/cmn_booker.c
+++ b/module/cmn_booker/src/cmn_booker.c
@@ -196,7 +196,7 @@ unsigned int get_node_pos_y(void *node_base)
struct cmn_booker_cfgm_reg *get_root_node(uintptr_t base,
unsigned int hnd_node_id, unsigned int mesh_size_x,
- unsigned int mesh_size_y)
+ unsigned int mesh_size_y, unsigned int ports_per_xp)
{
unsigned int node_pos_x;
unsigned int node_pos_y;
@@ -217,11 +217,23 @@ struct cmn_booker_cfgm_reg *get_root_node(uintptr_t base,
node_port = (hnd_node_id >> CMN_BOOKER_NODE_ID_PORT_POS) &
CMN_BOOKER_NODE_ID_PORT_MASK;
+ /* Calculate node address offset */
+ if(ports_per_xp > 4)
+ {
+ // Single XP configuration, upto 6 device ports allowed
+ offset = ((node_port & 0x3) << CMN_BOOKER_ROOT_NODE_OFFSET_PORT_POS);
+ } else if(ports_per_xp > 2)
+ {
+ // XPs which have more than 2 device ports
+ offset = (((node_port)>>1) << CMN_BOOKER_ROOT_NODE_OFFSET_PORT_POS);
+ }else
+ {
+ offset = (node_port << CMN_BOOKER_ROOT_NODE_OFFSET_PORT_POS);
+ }
/* Calculate node address offset */
offset = (node_pos_y << CMN_BOOKER_ROOT_NODE_OFFSET_Y_POS) |
(node_pos_x << (CMN_BOOKER_ROOT_NODE_OFFSET_Y_POS +
- encoding_bits)) |
- (node_port << CMN_BOOKER_ROOT_NODE_OFFSET_PORT_POS);
+ encoding_bits)) | offset;
return (struct cmn_booker_cfgm_reg *)(base + offset);
}
diff --git a/module/cmn_booker/src/cmn_booker.h b/module/cmn_booker/src/cmn_booker.h
index 9a89f173..b0d59804 100644
--- a/module/cmn_booker/src/cmn_booker.h
+++ b/module/cmn_booker/src/cmn_booker.h
@@ -417,12 +417,13 @@ unsigned int get_node_pos_y(void *node_base);
* \param base CMN BOOKER peripheral base address
* \param hnd_node_id HN-D node identifier containing the global configuration
* \param mesh_size_x Size of the mesh along the x-axis
- * \param mesh_size_y Size of the mesh along the x-axis
+ * \param mesh_size_y Size of the mesh along the y-axis
+ * \param mesh_size_y Device ports per XP
*
* \return Pointer to the root node descriptor
*/
struct cmn_booker_cfgm_reg *get_root_node(uintptr_t base,
unsigned int hnd_node_id, unsigned int mesh_size_x,
- unsigned int mesh_size_y);
+ unsigned int mesh_size_y, unsigned int ports_per_xp);
#endif /* CMN_BOOKER_H */
diff --git a/module/cmn_booker/src/mod_cmn_booker.c b/module/cmn_booker/src/mod_cmn_booker.c
index cbff273e..09fc8884 100644
--- a/module/cmn_booker/src/mod_cmn_booker.c
+++ b/module/cmn_booker/src/mod_cmn_booker.c
@@ -536,7 +536,7 @@ static int cmn_booker_init(fwk_id_t module_id, unsigned int element_count,
return FWK_E_DATA;
ctx->root = get_root_node(config->base, config->hnd_node_id,
- config->mesh_size_x, config->mesh_size_y);
+ config->mesh_size_x, config->mesh_size_y, config->ports_per_xp);
ctx->config = config;
diff --git a/product/tc0/scp_romfw/config_cmn_booker.c b/product/tc0/scp_romfw/config_cmn_booker.c
index a076d8d7..d13138b2 100644
--- a/product/tc0/scp_romfw/config_cmn_booker.c
+++ b/product/tc0/scp_romfw/config_cmn_booker.c
@@ -116,5 +116,6 @@ const struct fwk_module_config config_cmn_booker = {
.clock_id =
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_INTERCONNECT),
.hnf_cal_mode = false,
+ .ports_per_xp = 4,
}),
};
--
2.29.2
@@ -1,37 +0,0 @@
# Corstone700 specific SCP configurations and build instructions
SUMMARY = "Boot Processor firmware"
DESCRIPTION = "Boot Processor firmware"
DEPENDS += "virtual/trusted-firmware-a"
LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0 \
file://cmsis/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
COMPATIBLE_MACHINE = "(corstone700-*)"
SCP_PLATFORM = "corstone-700"
# boot-firmware project is a fork of scp-firmware
SRC_URI = "gitsm://git.linaro.org/landing-teams/working/arm/boot-firmware.git;protocol=https;branch=master"
SRCREV = "a4dd1b60218b5172a94e6f44c96384b84a77588c"
PV = "0.1.0~git${SRCPV}"
B = "${WORKDIR}/build"
EXTRA_OEMAKE = "PRODUCT='${SCP_PLATFORM}' \
BUILD_PATH=${B} \
CROSS_COMPILE='arm-none-eabi-' \
"
do_compile_append() {
oe_runmake -C ${S}/tools/spitoc CC=${BUILD_CC} clean all
}
do_install() {
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_ramfw/release/bin/firmware.bin ${D}/firmware/se_ramfw.bin
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_romfw/release/bin/firmware.bin ${D}/firmware/se_romfw.bin
${S}/tools/spitoc/spitoc \
--seram ${D}/firmware/se_ramfw.bin \
--offset 1 \
--fip ${RECIPE_SYSROOT}/firmware/fip.bin-${TFA_PLATFORM} \
--offset 33 \
--out ${D}/firmware/spitoc.bin
}
@@ -1,6 +1,5 @@
# N1SDP specific SCP configurations and build instructions
SRCREV = "350be71a2ecef588b8ff5a095a0840de23506e45"
SCP_PLATFORM = "n1sdp"
SCP_LOG_LEVEL = "INFO"
@@ -12,8 +11,6 @@ SRC_URI_append = " \
COMPATIBLE_MACHINE_n1sdp = "n1sdp"
PV = "2.6.0+git${SRCPV}"
DEPENDS += "fiptool-native"
DEPENDS += "virtual/trusted-firmware-a"
@@ -1,7 +1,5 @@
# SGI575 specific SCP configurations and build instructions
#its a tested tag post-2.6.0
SRCREV = "7a025658d8318e95dbab4259a8ff7834ae6d8061"
SCP_PLATFORM = "sgi575"
SCP_LOG_LEVEL = "INFO"
@@ -13,7 +11,3 @@ do_install() {
install -D "${B}/product/${SCP_PLATFORM}/scp_ramfw/release/bin/scp_ramfw.bin" "${D}/firmware/"
install -D "${B}/product/${SCP_PLATFORM}/mcp_romfw/release/bin/mcp_romfw.bin" "${D}/firmware/"
}
PV = "2.6.0+git${SRCPV}"
@@ -1,12 +1,17 @@
# TC0 specific SCP configuration
# Intermediate SHA with 2.6 baseline version
SRC_URI = "gitsm://github.com/ARM-software/SCP-firmware.git;protocol=https"
SRCREV = "6fad1d3e2f82b2ef51e55928ac3a678a75f64ef4"
# Intermediate SHA with 2.7 baseline version, required for Theodul DSU
SRCREV = "a841e17b9a11784cddd96f3becdd7e4c54cfb44b"
PV = "2.7+git${SRCPV}"
FILESEXTRAPATHS_prepend_tc0 := "${THISDIR}/files/tc0:"
SRC_URI_append = " \
file://0001-product-tc0-add-clock-and-dvfs-support-for-all-cores.patch \
file://0002-module-cmn_booker-amend-CFGM-base-address.patch \
"
COMPATIBLE_MACHINE = "tc0"
SCP_PLATFORM = "tc0"
FW_TARGETS = "scp"
PV = "2.6.0+git${SRCPV}"
@@ -0,0 +1,7 @@
# Include machine specific SCP configurations
MACHINE_SCP_REQUIRE ?= ""
MACHINE_SCP_REQUIRE_juno = "scp-firmware-juno.inc"
require ${MACHINE_SCP_REQUIRE}
@@ -3,9 +3,7 @@
MACHINE_SCP_REQUIRE ?= ""
MACHINE_SCP_REQUIRE_n1sdp = "scp-firmware-n1sdp.inc"
MACHINE_SCP_REQUIRE_tc0 = "scp-firmware-tc0.inc"
MACHINE_SCP_REQUIRE_juno = "scp-firmware-juno.inc"
MACHINE_SCP_REQUIRE_sgi575 = "scp-firmware-sgi575.inc"
MACHINE_SCP_REQUIRE_corstone700 = "scp-firmware-corstone700.inc"
MACHINE_SCP_REQUIRE_tc0 = "scp-firmware-tc0.inc"
require ${MACHINE_SCP_REQUIRE}
@@ -26,6 +26,7 @@ software running on N1 SDP, including those that do not require mitigation.
This patch is meant for performance evaluation purposes ONLY and should not
be used for software that requires a seccomp computing environment.
Upstream-Status: Inappropriate
Signed-off-by: James Yang <James.Yang@arm.com>
---
plat/arm/board/n1sdp/platform.mk | 2 ++
@@ -0,0 +1,199 @@
From bda42d4e1c56022692b60447279d5321f872aa2b Mon Sep 17 00:00:00 2001
From: Davidson K <davidson.kumaresan@arm.com>
Date: Wed, 10 Mar 2021 12:07:15 +0530
Subject: [PATCH 1/2] product/tc0: Add support for Trusted Services Secure
Partitions
This patch adds support for the crypto and secure storage secure
partitions for the Total Compute platform. These secure partitions
have to be managed by Hafnium executing at S-EL2
Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
Change-Id: I2df690e3a99bf6bf50e2710994a905914a07026e
Upstream-Status: Pending [Not submitted to upstream yet]
---
Makefile | 4 +
docs/plat/arm/arm-build-options.rst | 4 +
.../fdts/tc0_spmc_ts_optee_sp_manifest.dts | 118 ++++++++++++++++++
plat/arm/board/tc0/fdts/tc0_tb_fw_config.dts | 10 ++
4 files changed, 136 insertions(+)
create mode 100644 plat/arm/board/tc0/fdts/tc0_spmc_ts_optee_sp_manifest.dts
diff --git a/Makefile b/Makefile
index b6c8b210c..d85c52bb4 100644
--- a/Makefile
+++ b/Makefile
@@ -514,6 +514,10 @@ ifneq (${SPD},none)
ifeq ($(findstring optee_sp,$(ARM_SPMC_MANIFEST_DTS)),optee_sp)
DTC_CPPFLAGS += -DOPTEE_SP_FW_CONFIG
endif
+
+ ifeq ($(findstring ts_optee_sp,$(ARM_SPMC_MANIFEST_DTS)),ts_optee_sp)
+ DTC_CPPFLAGS += -DTS_SP_FW_CONFIG
+ endif
else
# All other SPDs in spd directory
SPD_DIR := spd
diff --git a/docs/plat/arm/arm-build-options.rst b/docs/plat/arm/arm-build-options.rst
index a1d231357..32cf19291 100644
--- a/docs/plat/arm/arm-build-options.rst
+++ b/docs/plat/arm/arm-build-options.rst
@@ -98,6 +98,10 @@ Arm Platform Build Options
device tree. This flag is defined only when ``ARM_SPMC_MANIFEST_DTS`` manifest
file name contains pattern optee_sp.
+ - ``TS_SP_FW_CONFIG``: DTC build flag to include Trusted Services (Crypto and
+ secure-storage) as SP in tb_fw_config device tree. This flag is defined only
+ when ``ARM_SPMC_MANIFEST_DTS`` manifest file name contains pattern ts_optee_sp.
+
For a better understanding of these options, the Arm development platform memory
map is explained in the :ref:`Firmware Design`.
diff --git a/plat/arm/board/tc0/fdts/tc0_spmc_ts_optee_sp_manifest.dts b/plat/arm/board/tc0/fdts/tc0_spmc_ts_optee_sp_manifest.dts
new file mode 100644
index 000000000..ac91db238
--- /dev/null
+++ b/plat/arm/board/tc0/fdts/tc0_spmc_ts_optee_sp_manifest.dts
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2020, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+/dts-v1/;
+
+/ {
+ compatible = "arm,ffa-core-manifest-1.0";
+ #address-cells = <2>;
+ #size-cells = <1>;
+
+ attribute {
+ spmc_id = <0x8000>;
+ maj_ver = <0x1>;
+ min_ver = <0x0>;
+ exec_state = <0x0>;
+ load_address = <0x0 0xfd000000>;
+ entrypoint = <0x0 0xfd000000>;
+ binary_size = <0x80000>;
+ };
+
+ hypervisor {
+ compatible = "hafnium,hafnium";
+ vm1 {
+ is_ffa_partition;
+ debug_name = "op-tee";
+ load_address = <0xfd280000>;
+ vcpu_count = <8>;
+ mem_size = <0x1980000>; /* 25MB TZC DRAM */
+ };
+ vm2 {
+ is_ffa_partition;
+ debug_name = "secure-storage";
+ load_address = <0xfee00000>;
+ vcpu_count = <1>;
+ mem_size = <0x200000>; /* 2MB TZC DRAM */
+ };
+ vm3 {
+ is_ffa_partition;
+ debug_name = "crypto";
+ load_address = <0xfec00000>;
+ vcpu_count = <1>;
+ mem_size = <0x200000>; /* 2MB TZC DRAM */
+ };
+ };
+
+ cpus {
+ #address-cells = <0x2>;
+ #size-cells = <0x0>;
+
+ CPU0:cpu@0 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x0>;
+ enable-method = "psci";
+ };
+
+ /*
+ * SPMC (Hafnium) requires secondary cpu nodes are declared in
+ * descending order
+ */
+ CPU7:cpu@700 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x700>;
+ enable-method = "psci";
+ };
+
+ CPU6:cpu@600 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x600>;
+ enable-method = "psci";
+ };
+
+ CPU5:cpu@500 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x500>;
+ enable-method = "psci";
+ };
+
+ CPU4:cpu@400 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x400>;
+ enable-method = "psci";
+ };
+
+ CPU3:cpu@300 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x300>;
+ enable-method = "psci";
+ };
+
+ CPU2:cpu@200 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x200>;
+ enable-method = "psci";
+ };
+
+ CPU1:cpu@100 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x100>;
+ enable-method = "psci";
+ };
+ };
+
+ /* 32MB of TC0_TZC_DRAM1_BASE */
+ memory@fd000000 {
+ device_type = "memory";
+ reg = <0x0 0xfd000000 0x2000000>;
+ };
+};
diff --git a/plat/arm/board/tc0/fdts/tc0_tb_fw_config.dts b/plat/arm/board/tc0/fdts/tc0_tb_fw_config.dts
index de5f95d5e..82c6ccb27 100644
--- a/plat/arm/board/tc0/fdts/tc0_tb_fw_config.dts
+++ b/plat/arm/board/tc0/fdts/tc0_tb_fw_config.dts
@@ -27,6 +27,16 @@
secure-partitions {
compatible = "arm,sp";
+#if TS_SP_FW_CONFIG
+ secure-storage {
+ uuid = <0xdc1eef48 0x4ccfb17a 0xcfdf8bac 0x141b71f7>;
+ load-address = <0xfee00000>;
+ };
+ crypto {
+ uuid = <0xd9df52d5 0x4bb216a2 0x6dd2a49a 0xc0e8843b>;
+ load-address = <0xfec00000>;
+ };
+#endif
#if OPTEE_SP_FW_CONFIG
op-tee {
uuid = <0x486178e0 0xe7f811e3 0xbc5e0002 0xa5d5c51b>;
--
2.29.2
@@ -0,0 +1,59 @@
From bc31cd2454854ab44aa9861b98f13848c2b474aa Mon Sep 17 00:00:00 2001
From: Usama Arif <usama.arif@arm.com>
Date: Tue, 30 Mar 2021 16:39:19 +0100
Subject: [PATCH 2/2] tc0: update GICR base address
The number of ITS have changed from 4 to 1, resulting
in GICR base address change.
Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I28101f0d1faf9f3c58591b642033c3fd49a275e7
Upstream-Status: Pending [Not submitted to upstream yet]
---
fdts/tc0.dts | 4 ++--
plat/arm/board/tc0/include/platform_def.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fdts/tc0.dts b/fdts/tc0.dts
index 2d7611cf2..382860d9d 100644
--- a/fdts/tc0.dts
+++ b/fdts/tc0.dts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -236,7 +236,7 @@
ranges;
interrupt-controller;
reg = <0x0 0x30000000 0 0x10000>, /* GICD */
- <0x0 0x30140000 0 0x200000>; /* GICR */
+ <0x0 0x30080000 0 0x200000>; /* GICR */
interrupts = <0x1 0x9 0x4>;
};
diff --git a/plat/arm/board/tc0/include/platform_def.h b/plat/arm/board/tc0/include/platform_def.h
index 30b5ab716..b169d7720 100644
--- a/plat/arm/board/tc0/include/platform_def.h
+++ b/plat/arm/board/tc0/include/platform_def.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -220,7 +220,7 @@
/* GIC related constants */
#define PLAT_ARM_GICD_BASE UL(0x30000000)
#define PLAT_ARM_GICC_BASE UL(0x2C000000)
-#define PLAT_ARM_GICR_BASE UL(0x30140000)
+#define PLAT_ARM_GICR_BASE UL(0x30080000)
/*
* PLAT_CSS_MAX_SCP_BL2_SIZE is calculated using the current
--
2.29.2
@@ -0,0 +1,16 @@
{
"secure-storage" : {
"image": "secure-storage.bin",
"pm": "secure-storage.dts"
},
"crypto" : {
"image": "crypto-sp.bin",
"pm": "crypto.dts"
},
"op-tee" : {
"image": "tee-pager_v2.bin",
"pm": "optee_manifest.dts"
}
}
@@ -1,6 +1,6 @@
# Cortex-A5 Designstart specific TFA support
# Corstone-500 specific TFA support
COMPATIBLE_MACHINE = "a5ds"
COMPATIBLE_MACHINE = "corstone500"
TFA_PLATFORM = "a5ds"
TFA_DEBUG = "1"
TFA_UBOOT = "1"
@@ -13,6 +13,9 @@ LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031"
# fdts: corstone700: add NXP isp1763 node to device tree
SRCREV_tfa = "a6f65b11529b618ff04017f64054dc661c489068"
# This is incorporated into the SRCREV above
SRC_URI_remove = "file://0001-fdts-a5ds-Fix-for-the-system-timer-issue.patch"
PV = "2.3+git${SRCPV}"
EXTRA_OEMAKE_append = " \
@@ -1,11 +1,10 @@
# FVP specific TFA parameters
#
# Armv8-A Base Platform FVP and Armv8-A Foundation Platform uses the same
# TFAs.
# Armv8-A Base Platform FVP
#
COMPATIBLE_MACHINE = "fvp-base|foundation-armv8"
COMPATIBLE_MACHINE = "fvp-base"
TFA_PLATFORM = "fvp"
TFA_DEBUG = "1"
TFA_MBEDTLS = "1"
@@ -11,7 +11,3 @@ TFA_UBOOT = "0"
SRC_URI_append = " \
file://0001-n1sdp-arm-tf-disable-workaround-for-N1-Erratum-13157.patch \
"
SRCREV_tfa = "dffd5192df41e77e27bb524bfe64d747c1c43522"
PV = "2.3+git${SRCPV}"
@@ -1,8 +1,17 @@
# TCO specific TFA configuration
# TC0 specific TFA configuration
# Intermediate SHA with 2.3 baseline version
SRCREV_tfa = "16796a25fefc4ecf780211bf554d3b8dc5436fa4"
# Intermediate SHA with 2.4 baseline version, required for Theodul DSU
# --- This SRC_URI will be removed once below SRCREV_tfa gets merged to TF-A master
SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;branch=integration;name=tfa"
SRCREV_tfa = "8078b5c5a0c2a47710df96412d88df53486e2b29"
PV = "2.4+git${SRCPV}"
FILESEXTRAPATHS_prepend_tc0 := "${THISDIR}/files/tc0:"
SRC_URI_append = " \
file://0001-product-tc0-Add-support-for-Trusted-Services-Secure-.patch \
file://0002-tc0-update-GICR-base-address.patch \
"
DEPENDS += "scp-firmware"
COMPATIBLE_MACHINE = "tc0"
@@ -14,6 +23,27 @@ TFA_INSTALL_TARGET = "bl1 fip"
TFA_MBEDTLS = "1"
TFA_DEBUG = "1"
TFA_SPD = "spmd"
TFA_SPMD_SPM_AT_SEL2 = "1"
# Set optee, crypto-sp and secure-storage as the SP.
# Set spmc manifest and sp layout file to match.
DEPENDS += "optee-os crypto-sp secure-storage"
SRC_URI_append = " file://sp_layout.json;subdir=sp_layout"
TFA_SP_LAYOUT_FILE = "${WORKDIR}/sp_layout/sp_layout.json"
TFA_ARM_SPMC_MANIFEST_DTS = "plat/arm/board/tc0/fdts/tc0_spmc_ts_optee_sp_manifest.dts"
EXTRA_OEMAKE += "SCP_BL2=${RECIPE_SYSROOT}/firmware/scp_ramfw.bin"
EXTRA_OEMAKE += "TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem"
do_compile_prepend() {
cp -t ${WORKDIR}/sp_layout \
${RECIPE_SYSROOT}/${nonarch_base_libdir}/firmware/tee-pager_v2.bin \
${RECIPE_SYSROOT}/${nonarch_base_libdir}/firmware/optee_manifest.dts \
${RECIPE_SYSROOT}/firmware/secure-storage.bin \
${RECIPE_SYSROOT}/firmware/secure-storage.dts \
${RECIPE_SYSROOT}/firmware/crypto-sp.bin \
${RECIPE_SYSROOT}/firmware/crypto.dts
}
@@ -1,7 +1,6 @@
# Machine specific TFAs
MACHINE_TFA_REQUIRE ?= ""
MACHINE_TFA_REQUIRE_fvp-base-arm32 = "trusted-firmware-a-fvp-arm32.inc"
MACHINE_TFA_REQUIRE_sgi575 = "trusted-firmware-a-sgi575.inc"
require ${MACHINE_TFA_REQUIRE}
@@ -1,11 +1,7 @@
# Machine specific TFAs
MACHINE_TFA_REQUIRE ?= ""
MACHINE_TFA_REQUIRE_tc0 = "trusted-firmware-a-tc0.inc"
MACHINE_TFA_REQUIRE_a5ds = "trusted-firmware-a-a5ds.inc"
MACHINE_TFA_REQUIRE_foundation-armv8 = "trusted-firmware-a-fvp.inc"
MACHINE_TFA_REQUIRE_fvp-base = "trusted-firmware-a-fvp.inc"
MACHINE_TFA_REQUIRE_n1sdp = "trusted-firmware-a-n1sdp.inc"
MACHINE_TFA_REQUIRE_corstone500 = "trusted-firmware-a-corstone500.inc"
MACHINE_TFA_REQUIRE_juno = "trusted-firmware-a-juno.inc"
MACHINE_TFA_REQUIRE_corstone700 = "trusted-firmware-a-corstone700.inc"
@@ -0,0 +1,9 @@
# Machine specific TFAs
MACHINE_TFA_REQUIRE ?= ""
MACHINE_TFA_REQUIRE_fvp-base = "trusted-firmware-a-fvp.inc"
MACHINE_TFA_REQUIRE_fvp-base-arm32 = "trusted-firmware-a-fvp-arm32.inc"
MACHINE_TFA_REQUIRE_n1sdp = "trusted-firmware-a-n1sdp.inc"
MACHINE_TFA_REQUIRE_tc0 = "trusted-firmware-a-tc0.inc"
require ${MACHINE_TFA_REQUIRE}
@@ -1,4 +0,0 @@
COMPATIBLE_MACHINE = "musca-b1|musca-s1"
TFM_PLATFORM_musca-b1 = "MUSCA_B1"
TFM_PLATFORM_musca-s1 = "MUSCA_S1"
@@ -1,21 +1,33 @@
From 4449a6c2de38bdeb09e3158f6d9318812966243a Mon Sep 17 00:00:00 2001
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From b6879fc62b5ec01e3c87c2772d3a5e0f51c35f1c Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Wed, 18 Dec 2019 21:52:34 +0000
Subject: [PATCH 1/2] armv7: add mmio timer
Subject: [PATCH] armv7: adding generic timer access through MMIO
This timer can be used by u-boot when arch-timer is not available in
core, for example, Cortex-A5.
This driver enables the ARMv7 generic timer.
The access to the timer registers is through memory mapping (MMIO).
This driver can be used by u-boot to access to the timer through MMIO
when arch_timer is not available in the core (access using system
instructions not possible), for example, in case of Cortex-A5.
This driver configures and enables the generic timer at
the u-boot initcall level (timer_init) before u-boot relocation.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
arch/arm/cpu/armv7/Makefile | 1 +
arch/arm/cpu/armv7/mmio_timer.c | 56 +++++++++++++++++++++++++++++++++
arch/arm/cpu/armv7/mmio_timer.c | 64 +++++++++++++++++++++++++++++++++
scripts/config_whitelist.txt | 1 +
3 files changed, 58 insertions(+)
3 files changed, 66 insertions(+)
create mode 100644 arch/arm/cpu/armv7/mmio_timer.c
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 8c955d0d5284..82af9c031277 100644
index 8c955d0d52..82af9c0312 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_ARMV7_PSCI) += psci.o psci-common.o
@@ -28,10 +40,10 @@ index 8c955d0d5284..82af9c031277 100644
obj-y += s5p-common/
diff --git a/arch/arm/cpu/armv7/mmio_timer.c b/arch/arm/cpu/armv7/mmio_timer.c
new file mode 100644
index 000000000000..5d6f66172398
index 0000000000..82ff3937b6
--- /dev/null
+++ b/arch/arm/cpu/armv7/mmio_timer.c
@@ -0,0 +1,56 @@
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2019, Arm Limited. All rights reserved.
@@ -47,22 +59,30 @@ index 000000000000..5d6f66172398
+
+#define CNTCTLBASE 0x1a020000UL
+#define CNTREADBASE 0x1a030000UL
+#define CNTEN (1 << 0)
+#define CNTFCREQ (1 << 8)
+
+static inline uint32_t mmio_read32(uintptr_t addr)
+{
+ return *(volatile uint32_t*)addr;
+}
+
+static inline void mmio_write32(uintptr_t addr, uint32_t data)
+{
+ *(volatile uint32_t*)addr = data;
+}
+
+int timer_init(void)
+{
+ gd->arch.timer_rate_hz = mmio_read32(CNTCTLBASE);
+
+ gd->arch.timer_rate_hz = COUNTER_FREQUENCY / CONFIG_SYS_HZ; /* calculating the frequency in ms */
+ mmio_write32(CNTCTLBASE + 0x20, COUNTER_FREQUENCY); /* configuring CNTFID0 register: setting the base frequency */
+ mmio_write32(CNTCTLBASE, CNTFCREQ | CNTEN); /* configuring CNTCR register: enabling the generic counter and selecting the first frequency entry */
+ return 0;
+}
+
+unsigned long long get_ticks(void)
+{
+ return ((mmio_read32(CNTCTLBASE + 0x4) << 32) |
+ return ((mmio_read32(CNTREADBASE + 0x4) << 32) |
+ mmio_read32(CNTREADBASE));
+}
+
@@ -89,7 +109,7 @@ index 000000000000..5d6f66172398
+ return gd->arch.timer_rate_hz;
+}
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 916768f361d9..c8fd8c6e355a 100644
index 916768f361..c8fd8c6e35 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -3075,6 +3075,7 @@ CONFIG_SYS_MMC_U_BOOT_DST
@@ -101,5 +121,5 @@ index 916768f361d9..c8fd8c6e355a 100644
CONFIG_SYS_MONITOR_BASE
CONFIG_SYS_MONITOR_BASE_EARLY
--
2.28.0
2.17.1
@@ -1,4 +1,7 @@
From eed15d394137616a18add204a85b0e9dd5b00e0b Mon Sep 17 00:00:00 2001
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From f58e263f575c0520926e4737694e11da31cb4886 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Wed, 8 Jan 2020 09:48:11 +0000
Subject: [PATCH 2/2] board: arm: add designstart cortex-a5 board
@@ -22,7 +25,7 @@ Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
create mode 100644 include/configs/designstart_ca5.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 54d65f84889f..7bc12f0b4300 100644
index 54d65f8488..7bc12f0b43 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -665,6 +665,12 @@ config ARCH_BCM6858
@@ -48,7 +51,7 @@ index 54d65f84889f..7bc12f0b4300 100644
source "board/broadcom/bcm28155_ap/Kconfig"
diff --git a/board/armltd/designstart/Kconfig b/board/armltd/designstart/Kconfig
new file mode 100644
index 000000000000..a9564e8655e2
index 0000000000..a9564e8655
--- /dev/null
+++ b/board/armltd/designstart/Kconfig
@@ -0,0 +1,12 @@
@@ -66,7 +69,7 @@ index 000000000000..a9564e8655e2
+endif
diff --git a/board/armltd/designstart/Makefile b/board/armltd/designstart/Makefile
new file mode 100644
index 000000000000..d2dc2b74ed85
index 0000000000..d2dc2b74ed
--- /dev/null
+++ b/board/armltd/designstart/Makefile
@@ -0,0 +1,8 @@
@@ -80,7 +83,7 @@ index 000000000000..d2dc2b74ed85
+obj-y := designstart.o
diff --git a/board/armltd/designstart/designstart.c b/board/armltd/designstart/designstart.c
new file mode 100644
index 000000000000..658057a00330
index 0000000000..658057a003
--- /dev/null
+++ b/board/armltd/designstart/designstart.c
@@ -0,0 +1,49 @@
@@ -135,7 +138,7 @@ index 000000000000..658057a00330
+
diff --git a/configs/designstart_ca5_defconfig b/configs/designstart_ca5_defconfig
new file mode 100644
index 000000000000..a2a756740295
index 0000000000..a2a7567402
--- /dev/null
+++ b/configs/designstart_ca5_defconfig
@@ -0,0 +1,37 @@
@@ -178,7 +181,7 @@ index 000000000000..a2a756740295
+
diff --git a/include/configs/designstart_ca5.h b/include/configs/designstart_ca5.h
new file mode 100644
index 000000000000..6db5b1cf4ac2
index 0000000000..6db5b1cf4a
--- /dev/null
+++ b/include/configs/designstart_ca5.h
@@ -0,0 +1,122 @@
@@ -305,5 +308,5 @@ index 000000000000..6db5b1cf4ac2
+#define CONFIG_ENV_IS_IN_FLASH 1
+#endif
--
2.28.0
2.17.1
@@ -13,7 +13,7 @@ vexpress_armv8a.h.
This patch is co-authored with Soby Mathew <Soby.Mathew@arm.com>.
Upstream-status: Denied
Upstream-Status: Denied
For upstream discussion, please visit
https://www.mail-archive.com/u-boot@lists.denx.de/msg233429.html
@@ -1,4 +1,5 @@
Upstream-Status: Inappropriate [OE config specific]
Signed-off-by: Anders Dellien <anders.dellien@arm.com>
diff --git a/configs/vexpress_aemv8a_semi_defconfig b/configs/vexpress_aemv8a_semi_defconfig
index f0ac2f9da3..93fcd3026a 100644

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