Commit graph

12395 commits

Author SHA1 Message Date
Chris Kay
12562af369 fix(uuid): add missing #include directives
These include directives were missing from both `uuid.h` files.

Change-Id: I875dfda3e0985728277b72f0e7597dde5cf9d304
Signed-off-by: Chris Kay <chris.kay@arm.com>
2023-04-17 16:13:16 +01:00
Manish Pandey
4a24538ae9 Merge "feat(hcx): initialize HCRX_EL2 to its default value" into integration 2023-04-13 18:10:44 +02:00
Madhukar Pappireddy
9d124ecd56 Merge "fix(stm32mp15-fdts): use /omit-if-no-ref/ for spi and i2c" into integration 2023-04-13 16:33:27 +02:00
Manish Pandey
15b0a94bb5 Merge "docs(maintainers): update maintainers for n1sdp/morello" into integration 2023-04-13 11:51:14 +02:00
André Przywara
24ddb6ce01 Merge "fix(rpi3): initialize SD card host controller" into integration 2023-04-13 11:33:00 +02:00
Rob Newberry
bd96d533dc fix(rpi3): initialize SD card host controller
Add initial configuration parameters for Rasperry Pi 3's sdhost
controller, and then configure and use those parameters.

This change allows warm reboots of UEFI on Raspberry Pi 3B+ where
existing code often fails with "unknown error". See discussion at:

https://github.com/pftf/RPi3/issues/24

The basic idea is that some initial configuration parameters
(clock rate, bus width) aren't configured into the hardware before
commands start being sent. I suspect that the particular setting
that matters is the "slow card" bit, but the initial clock setting
also seemed wrong to me.

Change-Id: I526def340def143f23f3422f1fc14c12c937ca7f
Signed-off-by: Rob Newberry <robthedude@mac.com>
2023-04-13 10:29:51 +01:00
Juan Pablo Conde
ddb615b419 feat(hcx): initialize HCRX_EL2 to its default value
The value of register HCRX_EL2 is UNKNOWN out of reset. This can
affect the behavior in lower exception levels, such as traps to
EL2 due to a wrong configuration of the register upon reset.

This patch initializes the register at EL3 and disables all traps
related to it.

On the other hand, new fields have been introduced for HCRX_EL2,
which are now defined in this patch, so they can be used in
further development.

Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: I0bf1e949aa0d3be9f227358ad088a1ecb96ce222
2023-04-12 15:26:41 -05:00
André Przywara
15db5039b5 Merge "feat(pie/por): support permission indirection and overlay" into integration 2023-04-12 17:47:54 +02:00
Manish Pandey
741a5dc8f6 Merge "fix(psci): potential array overflow with cpu on" into integration 2023-04-12 16:47:36 +02:00
Mark Brown
062b6c6bf2 feat(pie/por): support permission indirection and overlay
Arm v8.9 introduces a series of features providing a new way to set memory
permissions. Instead of directly encoding the permissions in the page
tables the PTEs contain indexes into an array of permissions stored in
system registers, allowing greater flexibility and density of encoding.

Enable access to these features for EL2 and below, context switching the
newly added EL2 registers as appropriate. Since all of FEAT_S[12]P[IO]E
are separately discoverable we have separate build time options for
enabling them, but note that there is overlap in the registers that they
implement and the enable bit required for lower EL access.

Change the FVP platform to default to handling them as dynamic options so
the right decision can be made by the code at runtime.

Signed-off-by: Mark Brown <broonie@kernel.org>
Change-Id: Icf89e444e39e1af768739668b505661df18fb234
2023-04-12 15:03:22 +01:00
André Przywara
2237e562fd Merge "fix(imx8mq): fix compilation with gcc >= 12.x" into integration 2023-04-12 14:40:36 +02:00
Joanna Farley
d2309b49ea Merge "feat(zynqmp): make stack size configurable" into integration 2023-04-12 11:04:09 +02:00
Sandrine Bailleux
49eccae949 Merge "feat(intel): fix bridge disable and reset" into integration 2023-04-12 08:32:56 +02:00
Olivier Deprez
66327414fb fix(psci): potential array overflow with cpu on
Fix coverity finding in psci_cpu_on, in which target_idx is directly
assigned the return value from plat_core_pos_by_mpidr. If the latter
returns a negative or large positive value, it can trigger an out of
bounds overflow for the psci_cpu_pd_nodes array.

>>>>    CID 382009:    (OVERRUN)
>>>>    Overrunning callee's array of size 8 by passing argument "target_idx" (which evaluates to 4294967295) in call to "psci_spin_lock_cpu".
> 80         psci_spin_lock_cpu(target_idx);

>>>>    CID 382009:    (OVERRUN)
>>>>    Overrunning callee's array of size 8 by passing argument "target_idx" (which evaluates to 4294967295) in call to "psci_spin_unlock_cpu".
> 160         psci_spin_unlock_cpu(target_idx);

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ibc46934e9ca7fdcaeebd010e5c6954dcf2dcf8c7
2023-04-11 17:59:38 +02:00
Manish V Badarkhe
a1c924df6d Merge changes from topic "mb/rst-to-bl31-update" into integration
* changes:
  docs: update RESET_TO_BL31 documentation
  fix(bl31): avoid clearing of argument registers in RESET_TO_BL31 case
  Revert "docs(bl31): aarch64: RESET_TO_BL31_WITH_PARAMS"
  Revert "feat(bl31): aarch64: RESET_TO_BL31_WITH_PARAMS"
2023-04-11 17:10:23 +02:00
Akshay Belsare
57536653e6 feat(zynqmp): make stack size configurable
If PLATFORM_STACK_SIZE not already defined, use the default value of
PLATFORM_STACK_SIZE.
This makes the stack size value configurable for different interface
like custom packages.

Signed-off-by: Amit Nagal <amit.nagal@amd.com>
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
Change-Id: I87e9fcbfb4c4092378b1ac0ff8fb6d084495d320
2023-04-11 15:10:23 +01:00
Sandrine Bailleux
07c594c518 Merge changes from topic "sb/doc-updates" into integration
* changes:
  docs(porting): refer the reader back to the threat model
  docs(porting): move porting guide upper in table of contents
2023-04-11 10:14:24 +02:00
Sandrine Bailleux
fd0933516b docs(porting): refer the reader back to the threat model
When porting TF-A to a new platform, it is essential to read the
threat model documents in conjunction with the porting guide to
understand the security responsibilities of each platform interface
to implement.

Add a note to highlight this in the porting guide.

Change-Id: Icd1e41ae4b15032b72531690dd82a9ef95ca0db5
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2023-04-11 10:11:04 +02:00
Sandrine Bailleux
292585be90 docs(porting): move porting guide upper in table of contents
The porting guide is currently hosted under the 'Getting started'
section. Yet, porting the full firmware to a new platform is probably
not the first thing that one would do. Before delving into the
details, one would probably start by building the code for an emulated
platform, such as Arm FVP.

Furthermore, the porting guide is such a big and important document
that it probably deserves being visible in the main table of contents.
Thus, move it just above the list of supported platforms.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I51b3d2a93832505ab90d73c823f06f9540e84c77
2023-04-11 10:11:04 +02:00
Sandrine Bailleux
da87d6a34c Merge changes from topic "sb/doc-updates" into integration
* changes:
  docs(porting): remove reference to xlat_table lib v1
  docs(porting): remove pull request terminology
  docs(changelog): add 'porting' scope
2023-04-11 10:04:32 +02:00
Sandrine Bailleux
24d0fbcddf docs(porting): remove reference to xlat_table lib v1
Version 1 of the translation table library is deprecated. Refer to
version 2 instead.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I10a4ab7b346ea963345f82baff2deda267c5308d
2023-04-11 09:58:17 +02:00
Sandrine Bailleux
93e1ad7f76 docs(porting): remove pull request terminology
The pull request terminology dates back from when TF-A repository was
hosted on Github. Use a terminology that is more suited to Gerrit
workflow.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: Ieecf47617ca1cdb76b9c4a83f63ba3c402b9e975
2023-04-11 09:58:14 +02:00
Sandrine Bailleux
d3171619b3 docs(changelog): add 'porting' scope
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I22a81b3f69d90e0fcb88c7e98178e915253afb43
2023-04-11 09:58:10 +02:00
Sandrine Bailleux
f1bdf105d0 Merge "fix(intel): update boot scratch to indicate to Uboot is PSCI ON" into integration 2023-04-11 09:39:11 +02:00
Joanna Farley
ebb0838a98 Merge "feat(zynqmp): add hooks for custom runtime setup" into integration 2023-04-11 09:27:48 +02:00
Sandrine Bailleux
ffe7a9191c Merge changes Ifd5a63a3,Idb8bda44 into integration
* changes:
  fix(intel): flash dcache before mmio read
  fix(intel): fix the pointer of block memory to fill in and bytes being set
2023-04-11 08:36:34 +02:00
Jit Loon Lim
731622fe75 fix(intel): flash dcache before mmio read
Flash dcache before mmio read to avoid reading old/previous value.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: Ifd5a63a3c0f20b3e673be62ff5c3b6c4cf69df51
2023-04-11 00:20:45 +08:00
Sieu Mun Tang
afe9fcc3d2 fix(intel): fix the pointer of block memory to fill in and bytes being set
Fix on the pointer of the block memory to fill in and the number of
bytes to be set. So it can clear the exact address with exact number
of bytes.

Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: Idb8bda446ecd4c1d85d1ec9802bdcb020904c6c1
2023-04-11 00:20:24 +08:00
Ang Tien Sung
9ce82519c6 feat(intel): fix bridge disable and reset
Fix bridge sideband manager register clear and set incorrect
implementation. To support non-graceful full bridge disable
and enable.

Signed-off-by: Ang Tien Sung <tien.sung.ang@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: I651f3ec163d954e8efb0542ec33bce96e51992db
2023-04-11 00:17:00 +08:00
Jit Loon Lim
7f7a16a6c0 fix(intel): update boot scratch to indicate to Uboot is PSCI ON
There is a use case where kernel requested ATF to power off/on only CPU0.
However, after ATF power off/on CPU0, CPU0 did not back into the state
to wait for ATF. Instead, CPU0 continue to reentry SPL boot sequence
because CPU0 is master/primary core. This causing the system reboot from
SPL again, while the slave core still in kernel.

To resolve this, ATF is set the boot scratch register 8 bit 17 whenever
it is a request from kernel to power off/on only CPU0. So, if this boot
scratch bit is set, CPU 0 will be able to put into a state to wait for
ATF.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: Ia0228c5396beaa479858f5bd02fc05139efd2423
2023-04-10 23:58:53 +08:00
Joanna Farley
04f59c4a64 Merge "style(docs): fix typo s/flase/false/" into integration 2023-04-06 13:52:25 +02:00
Joanna Farley
529bc3df37 Merge "fix(scmi): fix compilation error in scmi base" into integration 2023-04-06 13:51:25 +02:00
Sandrine Bailleux
aa2922a69c Merge "docs(threat-model): refresh top-level page" into integration 2023-04-06 13:29:45 +02:00
Manish V Badarkhe
4b88d048f5 Merge "fix(fvp): work around DRTM_SUPPORT BL31 progbits exceeded" into integration 2023-04-06 11:23:51 +02:00
Akshay Belsare
88a8938e62 feat(zynqmp): add hooks for custom runtime setup
Add runtime setup hooks (via custom_runtime_setup()) for low level
operations related to setting up the system to correct state.

Change-Id: I4af7050dba2ee2446366d482bef5f5c5dde4bddf
Signed-off-by: Amit Nagal <amit.nagal@amd.com>
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-04-06 14:33:02 +05:30
Bipin Ravi
a7e17453fd Merge changes from topic "cpus" into integration
* changes:
  feat(cpus): add support for blackhawk cpu
  feat(cpus): add support for chaberton cpu
2023-04-06 08:06:10 +02:00
Vyacheslav Yurkov
d480df2116 fix(stm32mp15-fdts): use /omit-if-no-ref/ for spi and i2c
Use /omit-if-no-ref/ keyword in DT to remove extra device nodes only
when they are not used / not referenced.

If the board device tree only defines subnodes, dtc does not consider it
as usage, you have to specifically mention device's phandle, e.g.:

\ {
	i2c6-phandle = <&i2c6>;
};

or in aliases section
aliases {
	i2c6 = &i2c6;
};

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Change-Id: I431ecd93576f97fd021d82d23b93c659fc8f26b8
2023-04-05 19:46:21 +02:00
Sandrine Bailleux
266f0b0e35 Merge "chore: add dependency files generated by tools to .gitignore" into integration 2023-04-05 14:39:50 +02:00
Manish V Badarkhe
09b053bed7 chore: add dependency files generated by tools to .gitignore
In order to avoid git tracking dependency files generated while
compiling tools, the .gitignore list was updated with these files.

Change-Id: I97f1ace40441353779f4f82051d66c478571df38
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-04-05 09:47:15 +01:00
Andre Przywara
e75a3b6e89 fix(imx8mq): fix compilation with gcc >= 12.x
Starting with GCC >= 12.x the -Wall option includes -Werror=array-bounds
checks. Per default GCC treats all memory accesses below 4096 as NULL,
so access to ROMAPI causes the following warning:

------------
In file included from plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:20:
In function 'mmio_read_8',
    inlined from 'imx8mq_soc_info_init' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:70:16,
    inlined from 'bl31_platform_setup' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:206:2:
include/lib/mmio.h:19:16: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds]
   19 |         return *(volatile uint8_t*)addr;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
In function 'mmio_read_8',
    inlined from 'imx8mq_soc_info_init' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:74:16,
    inlined from 'bl31_platform_setup' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:206:2:
include/lib/mmio.h:19:16: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds]
   19 |         return *(volatile uint8_t*)addr;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
------------

This comes arguably from us somewhat abusing pointers to access MMIO
memory regions, which is not really covered by the C language.

Replace the pointer-dereferencing mmio_read_8() with an implementation
that uses inline assembly, to directly generate an 8-bit load
instruction. This avoids the compiler thinking that this access is using
a pointer it needs to jealously look after.

Change-Id: Iab39f6f615d51d3e8a1c54a1262d1e6ec208811d
Reported-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-04-04 17:20:40 +01:00
Anurag Koul
55b748a0d6 docs(maintainers): update maintainers for n1sdp/morello
Signed-off-by: Anurag Koul <anurag.koul@arm.com>
Change-Id: I305d03ae664f7d6124bf73d3bfdd81d34d760065
2023-04-04 17:02:02 +01:00
Govindraj Raja
6578343bb2 feat(cpus): add support for blackhawk cpu
Add basic CPU library code to support the Blackhawk CPU,
BlackHawk core is based out of Hunter ELP core,
so overall library code was adapted based on that.

Change-Id: I4750e774732218ee669dceb734cd107f46b78492
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-04-04 17:16:53 +02:00
Govindraj Raja
516a52f6f5 feat(cpus): add support for chaberton cpu
Add basic CPU library code to support the Chaberton CPU,
Chaberton cores are based out of Hunter core, so overall
library code was adapted based on that.

Change-Id: I58321c77f2c364225a764da6fa65656d1bec33f1
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2023-04-04 17:16:46 +02:00
Boyan Karatotev
7762e5d0ed fix(fvp): work around DRTM_SUPPORT BL31 progbits exceeded
Just like the tspd, DRTM support pulls in a lot of code which can't fit
into SRAM with everything else the fvp is including. Luckily, testing
this feature is only done on v8.0 models, meaning all feature related
code can be excluded for this run, saving space. The benefit of doing it
this way is that the test can continue running unaltered in the interim.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Iced2089837622fea49c10ae403c653dd1f331ca3
2023-04-04 15:58:46 +01:00
Joanna Farley
42fb812a75 Merge changes from topic "ethos-n" into integration
* changes:
  docs(maintainers): update NPU driver files
  docs(ethos-n): update porting-guide.rst for NPU
  feat(ethos-n): add separate RO and RW NSAIDs
  feat(ethos-n)!: add protected NPU firmware setup
  feat(ethos-n): add stream extends and attr support
  feat(ethos-n): add reserved memory address support
  feat(ethos-n): add event and aux control support
  feat(ethos-n): add SMC call to get FW properties
  refactor(ethos-n): split up SMC call handling
  feat(ethos-n): add NPU firmware validation
  feat(ethos-n): add check for NPU in SiP setup
  feat(ethos-n)!: load NPU firmware at BL2
  feat(juno): support ARM_IO_IN_DTB option for Juno
  fix(fconf): fix FCONF_ARM_IO_UUID_NUMBER value
  fix(fvp): incorrect UUID name in FVP tb_fw_config
  fix(ethos-n): add workaround for erratum 2838783
  feat(ethos-n): add support for NPU to cert_create
  feat(ethos-n): add NPU support in fiptool
  feat(ethos-n): add support to set up NSAID
  build(fiptool): add object dependency generation
  feat(ethos-n): add NPU sleeping SMC call
  feat(ethos-n): add multiple asset allocators
  feat(ethos-n): add reset type to reset SMC calls
  feat(ethos-n): add protected NPU TZMP1 regions
  build(ethos-n): add TZMP1 build flag
2023-04-04 16:16:04 +02:00
Sandrine Bailleux
1988677350 docs(threat-model): refresh top-level page
The top-level page for threat model documents is evidently out-dated,
as it contains text which no longer makes sense on its own. Most
likely it relates back to the days where we had a single threat model
document.

Reword it accordingly. While we are at it, explain the motivation and
structure of the documents.

Change-Id: I63c8f38ec32b6edbfd1b4332eeaca19a01ae70e9
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2023-04-04 16:08:05 +02:00
Manish Pandey
e6faf28289 Merge "fix(psci): remove unreachable switch/case blocks" into integration 2023-04-04 13:58:19 +02:00
Joanna Farley
4e5f1ca03b Merge "docs(maintainers): update NPU driver owners" into integration 2023-04-04 12:50:03 +02:00
Andre Przywara
ad27f4b5d9 fix(psci): remove unreachable switch/case blocks
The PSCI function dispatcher switch/case is split up between 32-bit and
64-bit function IDs, based on bit 30 of the encoding. This bit just
encodes the maximum size of the arguments, not necessarily whether they
are used from AArch64 or AArch32. So while some functions exist in both
worlds (CPU_ON, for instance), some functions take no or only 32-bit
arguments (CPU_OFF, PSCI_FEATURES), so they only exist as a 32-bit
function call.

Commit b88a4416b5 ("feat(psci): add support for PSCI_SET_SUSPEND_MODE"
, gerrit ID Iebf65f5f7846aef6b8643ad6082db99b4dcc4bef) and commit
9a70e69e05 ("feat(psci): update PSCI_FEATURES", gerrit ID
I5da8a989b53419ad2ab55b73ddeee6e882c25554) introduced two "case"
sections for 32-bit function IDs in the 64-bit branch, which will never
trigger. The one small extra case caused the sun50i_a64 DEBUG build to
go beyond its RAM limit.

Removed the redundant switch/case blocks, to make sun50i_a64 build
again.

Change-Id: Ic65b7403d128837296a0c3af42c6f23f9f57778e
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-04-04 12:39:36 +02:00
Mikael Olsson
3e1921c887 docs(maintainers): update NPU driver owners
Mikael Olsson will no longer be working with the Arm(R) Ethos(TM)-N NPU
so Ştefana Simion will take over the ownership of the driver.

Change-Id: If22bbdcb26af9bf851efc14ad96ed76c745eadfd
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2023-04-04 11:38:44 +02:00