Commit graph

11359 commits

Author SHA1 Message Date
Lucian Paul-Trifu
d72c486b52 feat(fvp): add platform hooks for DRTM DMA protection
Added necessary platform hooks for DRTM DMA protection.
These calls will be used by the subsequent DRTM implementation
patches.
DRTM platform API declarations have been listed down in a
separate header file.

Signed-off-by: Manish V Badarkhe <manish.badarkhe@arm.com>
Signed-off-by: Lucian Paul-Trifu <lucian.paultrifu@gmail.com>
Change-Id: Ib9726d1d3570800241bde702ee7006a64f1739ec
2022-10-05 15:25:28 +01:00
Chris Kay
274a69e7ca build: forbid ENABLE_RME=1 when SEPARATE_CODE_AND_RODATA=0
This change mitigates against read-only data being used for malicious
execution on platforms utilizing the RME/CCA.

Change-Id: I0068535aeaa5d2515c7c54ee0dc19200c7a86ba5
Signed-off-by: Chris Kay <chris.kay@arm.com>
2022-10-05 14:17:02 +01:00
Sandrine Bailleux
6f70cce625 Merge "fix(qemu): enable SVE and SME" into integration 2022-10-05 15:08:32 +02:00
Sandrine Bailleux
2ddb5415ca Merge "fix(rss): fix build issues with comms protocol" into integration 2022-10-05 14:44:05 +02:00
Tamas Ban
ab545efddc fix(rss): fix build issues with comms protocol
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I77d2d3c5ac39a840b768f84f859d76b3965749aa
2022-10-05 13:37:35 +02:00
Olivier Deprez
af1ee1fad2 Merge changes from topic "mt8188 cpu_pm" into integration
* changes:
  feat(mediatek): move lpm drivers back to common
  feat(mt8188): add cpu_pm driver
  fix(mt8188): refine c-state power domain for extensibility
2022-10-05 13:37:10 +02:00
Olivier Deprez
a9120f596f Merge "fix(mt8186-emi-mpu): fix SCP permission" into integration 2022-10-05 11:31:36 +02:00
Andre Przywara
337ff4f1dd fix(qemu): enable SVE and SME
Starting with QEMU v3.1.0 (Dec 2018), QEMU's TCG emulation engine supports
the SVE architecture extension. In QEMU v7.1.0 (Aug 2022) it also gained
SME support.

As it stands today, running TF-A under QEMU with "-cpu max" makes Linux
hang, because SME and SVE accesses trap to EL3, but are never handled
there. This is because the Linux kernel sees the SVE or SME feature bits,
and assumes firmware has enabled the feature for lower exception levels.
This requirement is described in the Linux kernel booting protocol.

Enable those features in the TF-A build, so that BL31 does the proper
EL3 setup to make the feature usable in non-secure world.
We check the actual feature bits before accessing SVE or SME registers,
so this is safe even for older QEMU version or when not running with
-cpu max. As SVE and SME are AArch64 features only, do not enable them
when building for AArch32.

Change-Id: I5b718eb298a0bbcf36244479e8d42e54a2faca61
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-10-05 10:17:55 +01:00
Manish Pandey
4f2c4ecfb0 Merge changes from topic "aarch32_debug_aborts" into integration
* changes:
  feat(stm32mp1): add plat_report_*_abort functions
  feat(debug): add helpers for aborts on AARCH32
  feat(debug): add AARCH32 CP15 fault registers
2022-10-05 11:15:28 +02:00
Manish Pandey
afc9b23b13 Merge "feat(fvp): support building RSS comms driver" into integration 2022-10-05 11:00:26 +02:00
Madhukar Pappireddy
c19116dd61 Merge "refactor(console): move putchar() to console driver" into integration 2022-10-04 17:06:43 +02:00
Yidi Lin
8a998b5aca fix(mt8186-emi-mpu): fix SCP permission
Hardware video decoding is not working after enabling EMI MPU protection
for SCP.

According to coreboot DEVAPC setting, SCP belongs to domain 4 instead of
domain 3. So correct the permission setting.

BUG=b:249954378
TEST=play video and see codec irq count is incrementing.

Signed-off-by: Yidi Lin <yidilin@chromium.org>
Change-Id: If71de3eabf8682909f96924c159aa92f25deb96c
2022-10-04 22:31:16 +08:00
Manish V Badarkhe
b97b2817ac Merge "fix(versal-net): use api_id directly without FUNCID_MASK" into integration 2022-10-04 11:50:43 +02:00
Manish V Badarkhe
252b2bd8a3 Merge changes I134f125f,Ia4bf45bf into integration
* changes:
  refactor(sgi): rename RD-Edmunds to RD-V2
  refactor(cpu): use the updated IP name for Demeter CPU
2022-10-04 10:45:50 +02:00
Claus Pedersen
e0b6826e44 refactor(console): move putchar() to console driver
Moving putchar() out of libc and adding a weak dummy
implementation in libc.

This is to remove libc's dependencies to the platform
driver.

Signed-off-by: Claus Pedersen <claustbp@google.com>
Change-Id: Ib7fefaec0babb783def614ea23521f482fa4a28a
2022-10-04 09:30:48 +02:00
Bo-Chen Chen
cd7890d79e feat(mediatek): move lpm drivers back to common
In order to sync drivers with MediaTek internal code base, we move lpm
drivers back to common folder.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I1066e092febe0abb9782a46f668613e137737c88
2022-10-04 09:52:10 +08:00
Edward-JW Yang
4fe7e6a8d9 feat(mt8188): add cpu_pm driver
- Add cpu_pm driver for CPU idle and SMP flow.
- Add SMP driver for CPU power on/off control.
- Add CPC driver to handle CPU powered on/off in CPU suspend.
- Add mbox driver for tinysys support.

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.com>
Change-Id: I20141474e1c43cdfacb9f2c6a2285721e50a617c
2022-10-04 09:52:10 +08:00
Edward-JW Yang
e35f4cbf80 fix(mt8188): refine c-state power domain for extensibility
1. MT8188 uses "suspend to RAM" instead of "suspend to idle", so
   remove s2idle state.
2. Definition c-state power domain:
    - bit[7:4] (main state id):
      1: Cluster.
      2: Mcusys.
      3: Memory.
      4: System pll.
      5: System bus.
      6: SoC 26m/DCXO.
      7: Vcore buck.
      15: Suspend.
    - bit[3:0] (reserved for state_id extension):
      4: CPU buck.

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.corp-partner.google.com>
Change-Id: Ibacd3d642f78726e1f1c08f18892481d2695f9e6
2022-10-04 09:44:08 +08:00
Manish Pandey
9bd1aed30d Merge "refactor(psci): unify psci_is_last_on_cpu and psci_is_last_on_cpu_safe" into integration 2022-10-03 16:46:52 +02:00
Yann Gautier
0423868373 feat(stm32mp1): add plat_report_*_abort functions
The new helpers are created in STM32MP1 platform for prefetch and data
aborts.
While at it, put plat_report_exception() under DEBUG flag. If DEBUG is
not set, the weak function which does the same will be used.
This plat_report_exception() function can also be simplified, as it will
no more be used to report aborts.

Change-Id: Ibe989b28e236693f317cffb0545ea0611b7bdde4
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2022-10-03 14:44:05 +02:00
Yann Gautier
6dc5979a6c feat(debug): add helpers for aborts on AARCH32
New helper functions are created to handle data & prefetch aborts
in AARCH32. They call platform functions, just like what
report_exception is doing.
As extended MSR/MRS instructions (to access lr_abt in monitor mode)
are only available if CPU (Armv7) has virtualization extension,
the functions branch to original report_exception handlers if this is
not the case.
Those new helpers are created mainly to distinguish data and prefetch
aborts, as they both share the same mode.
This adds 40 bytes of code.

Change-Id: I5dd31930344ad4e3a658f8a9d366a87a300aeb67
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2022-10-03 14:42:40 +02:00
Yann Gautier
bb2289142c feat(debug): add AARCH32 CP15 fault registers
For an easier debug on Aarch32, in case of abort, it is useful to access
DFSR, IFSR, DFAR and IFAR CP15 registers.

Change-Id: Ie6b5a2882cd701f76e9d455ec43bd4b0fbe3cc78
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2022-10-03 14:06:25 +02:00
Michal Simek
b0eb6d124b fix(versal-net): use api_id directly without FUNCID_MASK
The purpose of this code is to extract api_id from smc_fid but this masking
is done already in the code with using generic mask from smccc.h
(FUNCID_NUM_MASK). That's why remove FUNCID_MASK is which not needed and
actually also equal to already used FUNCID_NUM_MASK.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I1113825baa5d9d58d9d7c5d9d5855fecf62e8d45
2022-10-03 14:03:38 +02:00
Sandrine Bailleux
967d8c99f4 Merge "build(rss): introduce rss_comms.mk makefile" into integration 2022-10-03 13:37:54 +02:00
Sandrine Bailleux
29e6fc5cc7 feat(fvp): support building RSS comms driver
On one hand, there is currently no upstream platform supporting the
RSS. On the other hand, we are gradually introducing driver code for
RSS. Even though we cannot test this code in the TF-A CI right now, we
can at least build it to make sure no build regressions are introduced
as we continue development.

This patch adds support for overriding PLAT_RSS_NOT_SUPPORTED build
flag (which defaults to 1 on the Base AEM FVP) from the command
line. This allows introducing an ad-hoc CI build config with
PLAT_RSS_NOT_SUPPORTED=0, which will correctly pull in the RSS and MHU
source files. Of course, the resulting firmware will not be
functional.

Change-Id: I2b0e8dd03bf301e7063dd4734ea5266b73265be1
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-10-03 12:52:21 +02:00
Sandrine Bailleux
4348497ace build(rss): introduce rss_comms.mk makefile
Provide a new makefile as a convenience for platform makefiles to pull
in the list of source files and headers for the RSS communication
driver.

Change-Id: I188a1a8f4e77318cdc87c3155b280090c46ce813
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-10-03 12:44:36 +02:00
Joel Goddard
91890b7ab3 refactor(sgi): rename RD-Edmunds to RD-V2
Neoverse Reference Design platform RD-Edmunds has been renamed to RD-V2
and so all corresponding references have been changed.

Signed-off-by: Joel Goddard <joel.goddard@arm.com>
Change-Id: I134f125f8ce9ec2f42988ecd742de307da936f2b
2022-10-03 15:31:40 +05:30
Joel Goddard
bd063a73a8 refactor(cpu): use the updated IP name for Demeter CPU
Neoverse Demeter CPU has been renamed to Neoverse V2 CPU.
Correspondingly, update the CPU library, file names and other
references to use the updated IP name.

Signed-off-by: Joel Goddard <joel.goddard@arm.com>
Change-Id: Ia4bf45bf47807c06f4c966861230faea420d088f
2022-10-03 15:31:40 +05:30
Manish Pandey
e8f4ec1ab0 Merge changes from topic "st_uart_updates" into integration
* changes:
  feat(stm32mp1): add early console in SP_min
  feat(st): properly manage early console
  feat(st-uart): manage STM32MP_RECONFIGURE_CONSOLE
  docs(st): introduce STM32MP_RECONFIGURE_CONSOLE
  feat(st): add trace for early console
  fix(stm32mp1): enable crash console in FIQ handler
  feat(st-uart): add initialization with the device tree
  refactor(stm32mp1): move DT_UART_COMPAT in include file
  feat(stm32mp1): configure the serial boot load address
  fix(stm32mp1): update the FIP load address for serial boot
  refactor(st): configure baudrate for UART programmer
  refactor(st-uart): compute the over sampling dynamically
2022-10-03 11:58:07 +02:00
Sandrine Bailleux
8efbd9dc29 Merge "fix(rcar3): fix RPC-IF device node name" into integration 2022-10-03 11:21:28 +02:00
Manish V Badarkhe
4db1bd801c Merge "fix(st): add missing string.h include" into integration 2022-10-03 11:14:30 +02:00
Sandrine Bailleux
fe8573ef1c Merge "fix(intel): fix asynchronous read response by copying data to input buffer" into integration 2022-10-03 10:51:09 +02:00
Sandrine Bailleux
34cf68ad4a Merge "fix(intel): fix Mac verify update and finalize for return response data" into integration 2022-10-03 10:50:01 +02:00
Geert Uytterhoeven
08ae2471b1 fix(rcar3): fix RPC-IF device node name
According to the Generic Names Recommendation in the Devicetree
Specification Release v0.3, and the DT Bindings for the Renesas Reduced
Pin Count Interface, the node name for a Renesas RPC-IF device should be
"spi".  The node name matters, as the node is enabled by passing a DT
fragment from TF-A to subsequent software.

Fix this by renaming the device node in the passed DT fragment from
"rpc" to "spi".

Fixes: 12c75c8886 ("feat(plat/rcar3): emit RPC status to DT fragment if RPC unlocked")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Change-Id: Idb43353947607611331abc344f8c8ae932a20408
2022-10-03 10:47:23 +02:00
Yann Gautier
0d33d38334 fix(st): add missing string.h include
Since patch on libc refactoring, there is a compilation error with
STM32MP_USB_PROGRAMMER=1:
plat/st/common/stm32cubeprogrammer_usb.c:81:35: error:
 implicit declaration of function 'strnlen'
 [-Werror=implicit-function-declaration]
      length += strnlen((char *)&dfu->buffer[GET_PHASE_LEN],

The string.h header file should be included.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I1fbb2d9714cbc0d0640cb5e3c5ae8201dbfbe14e
2022-10-03 10:00:03 +02:00
Joanna Farley
aa9d315009 Merge "chore(libc): clean up includes in lib/libc/printf.c" into integration 2022-09-30 17:50:15 +02:00
Lauren Wehrmeister
8e834443a2 Merge "docs(changelog): fix incorrect documentation title" into integration 2022-09-30 15:35:42 +02:00
Joanna Farley
76250d51d6 Merge "fix(zynqmp): resolve MISRA-C:2012 R.10.1 warnings" into integration 2022-09-30 14:35:25 +02:00
Manish Pandey
2c16b802cb Merge "fix(ras): trap "RAS error record" accesses only for NS" into integration 2022-09-30 14:14:26 +02:00
HariBabu Gattem
c889088386 fix(zynqmp): resolve MISRA-C:2012 R.10.1 warnings
MISRA Violation: MISRA-C: 2012 R.10.1
- The operand to the operator does not have an essentially
unsigned type.

Signed-off-by: HariBabu Gattem <haribabu.gattem@amd.com>
Change-Id: I0f974e9d6f63dddfab55d55c952a57645d931e40
2022-09-30 10:40:34 +02:00
Chris Kay
833b4ffefd docs(changelog): fix incorrect documentation title
Change-Id: Idb4b174f65891ba406f83c213c80ebb8a6ba0b81
Signed-off-by: Chris Kay <chris.kay@arm.com>
2022-09-29 16:56:12 +01:00
Jayanth Dodderi Chidanand
b41b082464 refactor(psci): unify psci_is_last_on_cpu and psci_is_last_on_cpu_safe
"psci_is_last_on_cpu" and "psci_is_last_on_cpu_safe" modules perform
mostly similar functionalities, verifying whether the current CPU
is the only active core and other cores have been turned off.

However, psci_is_last_on_cpu_safe function differs from the other with:
1. Safe API locks the power domain

This patch removes the section duplicating the functionality
and ensures that "psci_is_last_on_cpu api",is reused in
"psci_is_last_on_cpu_safe" procedure.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: Ie372519e423898d7afa5427cdd77a7f9d3369587
2022-09-29 16:37:34 +01:00
Madhukar Pappireddy
62068b10a3 Merge "feat(ls1043ardb): update ddr configure for ls1043ardb-pd" into integration 2022-09-29 16:45:48 +02:00
Manish Pandey
76453e7e7e Merge "fix(rme): update FVP platform token" into integration 2022-09-29 16:39:01 +02:00
Mate Toth-Pal
364b4cddba fix(rme): update FVP platform token
Update test CCA Platform token in fvp_plat_attest_token.c to be
up-to-date with RMM spec Beta0.

Change-Id: I0f5e2ac1149eb6f7a93a997682f41d90e109a049
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
2022-09-29 15:35:18 +02:00
Manish V Badarkhe
ea7aee20c1 Merge "fix(rmmd): return X4 output value" into integration 2022-09-29 10:25:57 +02:00
Joanna Farley
a291687de2 Merge "fix(zynqmp): resolve misra 4.6 warnings" into integration 2022-09-29 10:15:01 +02:00
Sandrine Bailleux
711ce52bc6 Merge "feat(rss): add new comms protocols" into integration 2022-09-29 08:20:59 +02:00
Manish Pandey
00e8f79c15 fix(ras): trap "RAS error record" accesses only for NS
RAS_TRAP_LOWER_EL_ERR_ACCESS was used to prevent access to RAS error
record registers (RAS ERR* & RAS ERX*) from lower EL's in any security
state. To give more fine grain control per world basis re-purpose this
macro to RAS_TRAP_NS_ERR_REC_ACCESS, which will enable the trap only
if Error record registers are accessed from NS.
This will also help in future scenarios when RAS handling(in Firmware
first handling paradigm)can be offloaded to a secure partition.

This is first patch in series to refactor RAS framework in TF-A.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ifa7f60bc8c82c9960adf029001bc36c443016d5d
2022-09-28 17:10:57 +01:00
Manish Pandey
3a3722c9e1 Merge "fix(tc): resolve the static-checks errors" into integration 2022-09-28 16:06:45 +02:00