Commit Graph

9124 Commits

Author SHA1 Message Date
Jeremy Linton ab061eb732 rpi4: SMCCC PCI implementation
The rpi4 has a single nonstandard ECAM. It is broken
into two pieces, the root port registers, and a window
to a single device's config space which can be moved
between devices. Now that we have widened the page
tables/MMIO window, we can create a read/write acces
functions that are called by the SMCCC/PCI API.

As an example platform, the rpi4 single device ECAM
region quirk is pretty straightforward. The assumption
here is that a lower level (uefi) has configured and
initialized the PCI root to match the values we are
using here.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Change-Id: Ie1ffa8fe9aa1d3c62e6aa84746a949c1009162e0
2021-07-28 09:41:55 +02:00
Madhukar Pappireddy 743e3b4147 Merge "plat/sgi: tag dmc620 MM communicate messages with a guid" into integration 2021-07-27 21:35:11 +02:00
Madhukar Pappireddy 7fb82d8286 Merge "fix(rk3399/suspend): correct LPDDR4 resume sequence" into integration 2021-07-27 17:01:40 +02:00
Olivier Deprez 048fe1916c Merge "fix(fdt): fix OOB write in uuid parsing function" into integration 2021-07-27 16:06:30 +02:00
David Horstmann d0d642450f fix(fdt): fix OOB write in uuid parsing function
The function read_uuid() zeroes the UUID destination buffer
on error. However, it mistakenly uses the dest pointer
that has been incremented many times during the parsing,
leading to an out-of-bounds write.

To fix this, retain a pointer to the start of the buffer,
and use this when clearing it instead.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
Change-Id: Iee8857be5d3f383ca2eab86cde99a43bf606f306
2021-07-26 16:42:25 +01:00
Madhukar Pappireddy d31f319492 Merge "fix(plat/imx): do not keep mmc_device_info in stack" into integration 2021-07-26 17:39:59 +02:00
André Przywara 81e63f25ff Merge changes from topic "allwinner_mmap" into integration
* changes:
  refactor(plat/allwinner): clean up platform definitions
  refactor(plat/allwinner): do not map BL32 DRAM at EL3
  refactor(plat/allwinner): map SRAM as device memory by default
  refactor(plat/allwinner): rename static mmap region constant
  feat(bl_common): import BL_NOBITS_{BASE,END} when defined
2021-07-26 17:29:30 +02:00
Manish Pandey f98c0bea9c Merge "fix(sdei): set SPSR for SDEI based on TakeException" into integration 2021-07-26 11:15:30 +02:00
Manish Pandey a52c52477a Merge changes from topic "sve+amu" into integration
* changes:
  fix(plat/tc0): enable AMU extension
  fix(el3_runtime): fix SVE and AMU extension enablement flags
2021-07-26 11:05:39 +02:00
Joanna Farley 76cce57108 Merge "docs(maintainers): update imx8 entry" into integration 2021-07-25 15:02:03 +02:00
Joanna Farley e73d9d0fa8 Merge "refactor(aarch64): remove `FEAT_BTI` architecture check" into integration 2021-07-24 18:38:19 +02:00
Peng Fan 7b514399e9 docs(maintainers): update imx8 entry
Add myself as i.MX8 maintainer.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Change-Id: Ib037c24a75d42febd79f2eb1ab3b985356dbfb58
2021-07-24 21:16:13 +08:00
Madhukar Pappireddy d55d83090e Merge changes from topic "diphda" into integration
* changes:
  feat: disabling non volatile counters in diphda
  feat: adding the diphda platform
2021-07-23 19:24:07 +02:00
Daniel Boulby 37596fcb43 fix(sdei): set SPSR for SDEI based on TakeException
The SDEI specification now says that during an SDEI
event handler dispatch the SPSR should be set according
to the TakeException() pseudocode function defined in
the Arm Architecture Reference Manual. This patch sets
the SPSR according to the function given in
ARM DDI 0487F.c page J1-7635

Change-Id: Id2f8f2464fd69c701d81626162827e5c4449b658
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2021-07-23 13:20:28 +01:00
Arunachalam Ganapathy b5863cab9a fix(plat/tc0): enable AMU extension
Recent changes to enable SVE for the secure world have disabled AMU
extension by default in the reset value of CPTR_EL3 register. So the
platform has to enable this extension explicitly.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I7d930d96ec22d7c3db961411370564bece0ce272
2021-07-23 10:33:59 +01:00
Arunachalam Ganapathy 68ac5ed049 fix(el3_runtime): fix SVE and AMU extension enablement flags
If SVE are enabled for both Non-secure and Secure world along with AMU
extension, then it causes the TAM_BIT in CPTR_EL3 to be set upon exit
from bl31. This restricts access to the AMU register set in normal
world. This fix maintains consistency in both TAM_BIT and CPTR_EZ_BIT
by saving and restoring CPTR_EL3 register from EL3 context.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Id76ce1d27ee48bed65eb32392036377716aff087
2021-07-23 10:33:59 +01:00
Samuel Holland 0e54a7899d refactor(plat/allwinner): clean up platform definitions
Group the SCP base/size definitions in a more logical location.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: Id43f9b468d7d855a2413173d674a5ee666527808
2021-07-22 20:50:30 -05:00
Samuel Holland 8d9efdf8a8 refactor(plat/allwinner): do not map BL32 DRAM at EL3
BL31 does not appear to ever access the DRAM allocated to BL32,
so there is no need to map it at EL3.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: Ie8727b793e53ea14517894942266f6da0333eb74
2021-07-22 20:50:27 -05:00
Samuel Holland ab74206b60 refactor(plat/allwinner): map SRAM as device memory by default
The SRAM on Allwinner platforms is shared between BL31 and coprocessor
firmware. Previously, SRAM was mapped as normal memory by default.
This scheme requires carveouts and cache maintenance code for proper
synchronization with the coprocessor.

A better scheme is to only map pages owned by BL31 as normal memory,
and leave everything else as device memory. This removes the need for
cache maintenance, and it makes the mapping for BL31 RW data explicit
instead of magic.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I820ddeba2dfa2396361c2322308c0db51b55c348
2021-07-22 20:50:24 -05:00
Samuel Holland bc135624ef refactor(plat/allwinner): rename static mmap region constant
This constant specifically refers to the number of static mmap regions.
Rename it to make that clear.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I475c037777ce2a10db2631ec0e7446bb73590a36
2021-07-22 20:50:21 -05:00
Samuel Holland 9aedca021d feat(bl_common): import BL_NOBITS_{BASE,END} when defined
If SEPARATE_NOBITS_REGION is enabled, the platform may need to map
memory specifically for that region. Import the symbols from the linker
script to allow the platform to do so.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: Iaec4dee94a6735b22f58f7b61f18d53e7bc6ca8d
2021-07-22 20:50:17 -05:00
Abdellatif El Khlifi 7f70cd2923 feat: disabling non volatile counters in diphda
At this stage of development Non Volatile counters are not implemented
in the Diphda platform.

This commit disables their use during the Trusted Board Boot by
overriding the NV counters get/set functions.

Change-Id: I8dcbebe0281cc4d0837c283ff637e20b850988ef
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2021-07-22 18:01:43 +01:00
Abdellatif El Khlifi bf3ce99371 feat: adding the diphda platform
This commit enables trusted-firmware-a with Trusted Board Boot support
for the Diphda 64-bit platform.

Diphda uses a FIP image located in the flash. The FIP contains the
following components:

- BL2
- BL31
- BL32
- BL32 SPMC manifest
- BL33
- The TBB certificates

The board boot relies on CoT (chain of trust). The trusted-firmware-a
BL2 is extracted from the FIP and verified by the Secure Enclave
processor. BL2 verification relies on the signature area at the
beginning of the BL2 image. This area is needed by the SecureEnclave
bootloader.

Then, the application processor is released from reset and starts by
executing BL2.

BL2 performs the actions described in the trusted-firmware-a TBB design
document.

Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Change-Id: Iddb1cb9c2a0324a9635e23821c210ac81dfc305d
2021-07-22 18:01:39 +01:00
Madhukar Pappireddy 52eb322919 Merge "fix(mediatek/mt8192/spm): add missing bit define for debug purpose" into integration 2021-07-22 17:40:31 +02:00
Madhukar Pappireddy 61b5243d34 Merge changes from topic "scmi-power" into integration
* changes:
  fix(drivers/scmi-msg): entry: add weak functions
  feat(drivers/scmi-msg): add power domain protocol
  fix(drivers/scmi-msg): smt: fix build for aarch64
2021-07-22 15:47:59 +02:00
Peng Fan b3c8fd5d77 fix(drivers/scmi-msg): entry: add weak functions
One platform may not implement all the protocols, to avoid build break
when we not include all the protocols, add weak functions.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Change-Id: I1485baa2e8f381cb0eede1a7b93ed10e49934971
2021-07-22 10:27:48 +08:00
Peng Fan 7e4833cdde feat(drivers/scmi-msg): add power domain protocol
Add SCMI power domain protocol, with POWER_STATE_NOTIFY and
POWER_STATE_CHANGE_REQUESTED_NOTIFY not implemented.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Change-Id: Ia7c4db57c4c702667f8eaa630c924016e4a8bde0
2021-07-22 10:27:42 +08:00
Roger Lu 310c3a26e1 fix(mediatek/mt8192/spm): add missing bit define for debug purpose
Signed-off-by: Roger Lu <roger.lu@mediatek.com>
Change-Id: I6dbf6d4ea6310c3371ca15d1e7cce249a05af2fb
2021-07-21 03:36:14 +02:00
Madhukar Pappireddy e2a16044ad Merge "fix(plat/mediatek/me8195): fix error setting for SPM" into integration 2021-07-20 18:00:28 +02:00
Manish Pandey 3d88d1136d Merge changes from topic "fwu-refactor" into integration
* changes:
  refactor(plat/arm): use mmio* functions to read/write NVFLAGS registers
  refactor(plat/arm): mark the flash region as read-only
  refactor(plat/arm): update NV flags on image load/authentication failure
2021-07-20 17:24:18 +02:00
Manish Pandey e18f4aaf5e Merge changes from topic "marvell-a3k-a8k-updates" into integration
* changes:
  fix(plat/marvell/a3k): Fix building uart-images.tgz.bin archive
  refactor(plat/marvell/a3k): Rename *_CFG and *_SIG variables
  refactor(plat/marvell/a3k): Rename DOIMAGETOOL to TBB
  refactor(plat/marvell/a3k): Remove useless DOIMAGEPATH variable
  fix(plat/marvell/a3k): Fix check for external dependences
  fix(plat/marvell/a8k): Add missing build dependency for BLE target
  fix(plat/marvell/a8k): Correctly set include directories for individual targets
  fix(plat/marvell/a8k): Require that MV_DDR_PATH is correctly set
2021-07-20 16:27:16 +02:00
Garmin Chang 1f81cccedd fix(plat/mediatek/me8195): fix error setting for SPM
There is a error setting for SPM, so we need to fix this issue.

Signed-off-by: Garmin Chang <garmin.chang@mediatek.com>
Change-Id: I741a5dc1505a831fe48fd5bc3da9904db14c8a57
2021-07-20 02:55:46 +01:00
bipin.ravi c31c82dfd4 Merge "errata: workaround for Neoverse V1 errata 1940577" into integration 2021-07-20 00:09:18 +02:00
johpow01 182ce10155 errata: workaround for Neoverse V1 errata 1940577
Neoverse V1 erratum 1940577 is a Cat B erratum, present in some
revisions of the V1 processor core.  The workaround is to insert a
DMB ST before acquire atomic instructions without release semantics.
This issue is present in revisions r0p0 - r1p1  but this workaround
only applies to revisions r1p0 - r1p1, there is no workaround for older
versions.

SDEN can be found here:
https://documentation-service.arm.com/static/60d499080320e92fa40b4625

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I210ad7d8f31c81b6ac51b028dfbce75a725c11aa
2021-07-19 22:27:35 +01:00
Jimmy Brisson 2c4b0c05c6 fix(rk3399/suspend): correct LPDDR4 resume sequence
This change adds 208 bytes to PMUSRAM, pushing the end of text from
0xff3b0de0 to 0xff3b0eb0, which is still shy of the maximum
0xff3b1000.

Further, this skips enabling the watchdog when it's not being used
elsewhere, as you can't turn the watchdog off.

Change-Id: I2e6fa3c7e01f2be6b32ce04ce479edf64e278554
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2021-07-19 23:06:33 +02:00
Madhukar Pappireddy c8861f9f42 Merge changes Iebb86a0b,I7fe63311 into integration
* changes:
  refactor(plat/nxp/lx216x): refine variable definition
  refactor(plat/nxp/lx216x): use common make variables
2021-07-19 18:51:27 +02:00
Madhukar Pappireddy 8cf5afafd7 Merge changes I2b3aa9bd,I3237199b into integration
* changes:
  docs: add mt6795 to deprecated list
  feat(plat/mediatek/mt8195): add DCM driver
2021-07-19 18:38:59 +02:00
bipin.ravi 586aafa3a4 Merge "errata: workaround for Neoverse V1 errata 1791573" into integration 2021-07-19 05:36:18 +02:00
Madhukar Pappireddy 447e93eb81 Merge "fix(plat/marvell/a3k): fix printing info messages on output" into integration 2021-07-19 02:58:05 +02:00
Madhukar Pappireddy 384953df68 Merge "fix(rockchip/rk3399): fix dram section placement" into integration 2021-07-19 02:57:48 +02:00
Rex-BC Chen fc3300a500 docs: add mt6795 to deprecated list
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I2b3aa9bd0c23c360ecee673c68e1b2c92bc6d2be
2021-07-17 05:36:06 +01:00
johpow01 33e3e92541 errata: workaround for Neoverse V1 errata 1791573
Neoverse V1 erratum 1791573 is a Cat B erratum present in r0p0 and
r1p0 of the V1 processor core. It is fixed in r1p1.

SDEN can be found here:
https://documentation-service.arm.com/static/60d499080320e92fa40b4625

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Ic6f92da4d0b995bd04ca5b1673ffeedaebb71d10
2021-07-16 15:20:36 -05:00
Pali Rohár 9f6d154083 fix(plat/marvell/a3k): fix printing info messages on output
INFO() macro for every call prepends "INFO:   " string. Therefore
current code prints unreadable debug messages:

    "INFO:    set_io_addr_dec 0 result: ctrl(0x3fff3d01) base(0x0)INFO:    "
    "INFO:    Set IO decode window successfully, base(0xc000)INFO:     win_attr(3d) max_dram_win(2) max_remap(0)INFO:     win_offset(8)"

Fix it by calling exactly one INFO() call for one line. After this
change output is:

    "INFO:    set_io_addr_dec 0 result: ctrl(0x3fff3d01) base(0x0) remap(0x0)"
    "INFO:    Set IO decode window successfully, base(0xc000) win_attr(3d) max_dram_win(2) max_remap(0) win_offset(8)"

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I6084e64c6f4da6c1929e5300588e4ba2608ca745
2021-07-16 19:07:44 +01:00
Madhukar Pappireddy c791113776 Merge "docs(maintainers): add Julius Werner as Rockchip platform code owner" into integration 2021-07-16 18:03:19 +02:00
Peng Fan 0e223c6a9e fix(drivers/scmi-msg): smt: fix build for aarch64
For AARCH64, BIT() will make the number as ULL type, let use BIT_32()
here.

And use %zu for size_t print format.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Change-Id: I1dc18d374cd2c6eb83b40b66ed6189dcc6a21728
2021-07-15 11:51:34 +08:00
Madhukar Pappireddy 6f466062fe Merge "docs: update supported FVP models as per release 11.15.14" into integration 2021-07-13 14:58:48 +02:00
Joanna Farley 07066378c4 Merge "refactor(mpam): remove unused function declaration" into integration 2021-07-13 10:10:38 +02:00
Manish V Badarkhe 8d15e46c57 docs: update supported FVP models as per release 11.15.14
Change-Id: I65da6ead356e3f4ee47c5a6bf391f65309bafcdd
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-07-12 23:19:14 +02:00
Julius Werner c0cb6122bd docs(maintainers): add Julius Werner as Rockchip platform code owner
The two existing plat/rockchip code owners seem to be no longer active
in the project and are not responding to reviews. There have been a
couple of small fixup patches[1][2][3] pending for months that couldn't
be checked in for lack of Code-Owner-Review+1 flag. Add myself to the
code owner list to unblock this bottleneck (I have been deeply involved
in the rk3399 port, at least, so I know most of the code reasonably
well).

[1] https://review.trustedfirmware.org/9616
[2] https://review.trustedfirmware.org/9990
[2] https://review.trustedfirmware.org/10415

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ic7b2bb73c35a9bea91ff46ee445a22819d2045d9
2021-07-12 18:57:18 +01:00
Manish Pandey 3d47046712 Merge "refactor(plat/qemu): increase the non-secure DRAM size" into integration 2021-07-12 12:54:05 +02:00