Commit graph

5591 commits

Author SHA1 Message Date
Sandrine Bailleux
6f70cce625 Merge "fix(qemu): enable SVE and SME" into integration 2022-10-05 15:08:32 +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
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
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
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
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
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
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
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
Madhukar Pappireddy
62068b10a3 Merge "feat(ls1043ardb): update ddr configure for ls1043ardb-pd" into integration 2022-09-29 16:45:48 +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
Chunlei Xu
18af644279 feat(ls1043ardb): update ddr configure for ls1043ardb-pd
DDR4 Chip is EOL during redesign of ls1043ardb pd version. The replacement from MT is MT40A1G8SA-062E:R.
New ddr configure is compatible with both pd and old version of ls1043ardb.

Signed-off-by: Chunlei Xu <chunlei.xu@nxp.com>
Change-Id: I714c091a2cf15046438d0723fb55a4410c386ef4
2022-09-28 16:58:15 +08:00
HariBabu Gattem
cdb62114cf fix(zynqmp): resolve misra 4.6 warnings
MISRA Violation: MISRA-C:2012 R.4.6
- Using basic numerical type int rather than a typedef
that includes size and signedness information.

Signed-off-by: HariBabu Gattem <haribabu.gattem@amd.com>
Change-Id: I3779f7b6e074e33cb66ace3bef2117029badce1e
2022-09-26 12:13:00 +02:00
Joanna Farley
2aaed86080 Merge "refactor(libc): clean up dependencies in libc" into integration 2022-09-23 17:24:01 +02:00
Yann Gautier
14a070408d feat(stm32mp1): add early console in SP_min
Allow early console to be used at the beginning of SP_min, before
the clocks and UART have been reconfigured.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I53d66938d42fcec830d9b81e5ef62b3790d0c3b3
2022-09-23 15:17:43 +02:00
Yann Gautier
5223d88032 feat(st): properly manage early console
The new flag STM32MP_RECONFIGURE_CONSOLE is managed in platform.mk.
It is used in stm32mp_setup_early_console() when calling
plat_crash_console_init(). This call is also under:
"#if defined(IMAGE_BL2)"
as this crash console init shouldn't be done by default in BL32.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Ib6b89db83d80095b662a2016e18ceb3fa8668435
2022-09-23 15:17:43 +02:00
Yann Gautier
00606df012 feat(st): add trace for early console
When the early console is configured with STM32MP_EARLY_CONSOLE,
display a message indicating it is enabled.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Iafdfa5afef27eba823d707841853a8a46de0b42d
2022-09-23 15:17:43 +02:00
Yann Gautier
484e846a03 fix(stm32mp1): enable crash console in FIQ handler
When a FIQ occurs and is trapped by SP_min, it is an unrecoverable
error. As kernel may have switched the UART console off, we should
re-enable it with plat_crash_console_init() for those failing states.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ib02e1271b6213f8e383a062b74494abf8826188f
2022-09-23 15:17:43 +02:00
Patrick Delaunay
7d197d6281 refactor(stm32mp1): move DT_UART_COMPAT in include file
Move the definition of DT_UART_COMPAT in stm32mp1_def.h to be used
in several files.

Change-Id: I74d0350bcd971df9b15697f2b9ec04061d6a7656
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-23 15:17:43 +02:00
Patrick Delaunay
4b2f23e55f feat(stm32mp1): configure the serial boot load address
For product with 128MB DDR size, the OP-TEE is located at the end
of the DDR and the FIP can't be loaded at the default location
because it overlap the OP-TEE final location. So the default value
for DWL_BUFFER_BASE is invalid.

To avoid this conflict the serial boot load address = DWL_BUFFER_BASE
can be modified with a configuration flags.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ie27b87c10c57fea5d4c6200ce4f624e775b9a080
2022-09-23 15:17:43 +02:00
Patrick Delaunay
32f2ca04bf fix(stm32mp1): update the FIP load address for serial boot
Update the FIP load address and size for serial boot to support
product with a DDR size = 128MB
1/ Move the FIP location at the end of the first 128MB
2/ Reduce the DWL_BUFFER_SIZE to 16MB, to be coherent with the value
   indicated in USB enumeration
   - for STM32MP13x: "@SSBL /0x03/1*16Me"
   - for STM32MP15x: "@Partition3 /0x03/1*16Me"

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id93bf00c64832c17426bfd78e060861275677ecc
2022-09-23 15:17:43 +02:00
Patrick Delaunay
e7705e9afd refactor(st): configure baudrate for UART programmer
Add the possibility to configure the UART baudrate; reused the
console configuration, defined in STM32MP_UART_BAUDRATE.

The default value remains 115200.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ifcf2b36e8ac929265405bc88e824ee78be3b5bbb
2022-09-23 15:17:43 +02:00
Patrick Delaunay
1258189515 refactor(st-uart): compute the over sampling dynamically
The parameter over_sampling of stm32_uart_init_s is not required
as it can be computed dynamically from clock rate of the serial
device and the requested baudrate.

Oversampling by 8 is allowed only for higher speed
(up to clock_rate / 8) to reduce the maximum receiver tolerance
to clock deviation.

This patch update the driver, the serial init struct and the
only user, the stm32cubeprogrammer over uart support.

Change-Id: I422731089730a288defeb7fa49886db65d0902b2
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-23 15:17:43 +02:00
Rohit Mathew
a371327ba9 feat(sgi): remove override for ARM_BL31_IN_DRAM build-option
RD-N2* variants of Neoverse reference design platforms could be
configured to boot from SRAM or DRAM. Having ARM_BL31_IN_DRAM set to 1
within the common makefile would deter these platforms from having this
flexibility. Remove the default override configuration for
`ARM_BL31_IN_DRAM`.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Change-Id: I8d79969c003a984675cbe705de890b51a1f7f4ea
2022-09-22 20:44:58 +01:00
Rohit Mathew
8fd820ffb9 feat(sgi): configure SRAM and BL31 size for sgi platform
Update SRAM size for Neoverse reference design platforms from 256KB to
512KB. This is required to place and execute BL31 image from the
on-chip SRAM. Additionally, revise BL31 image size to accommodate
larger BL31 images of multi-chip platforms.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Change-Id: I11c2672a1089f24a9fafcf6555b8e1d52032cfde
2022-09-22 16:58:18 +01:00
Bo-Chen Chen
a64d9f442e refactor(mt8188): move platform_def.h to mt8188/include
It is more suitable to place platform_def.h in mt8188/include.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I35720690ff4f2ca99c9430edb8bbe17edf9aefb9
2022-09-22 19:26:15 +08:00
Edward-JW Yang
4cc1ff7ef2 feat(mt8188): add MCUSYS support
Add MCUSYS drivers support for MT8188.

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.com>
Change-Id: I84107702a9fd021c37d2997ad25b321a483a1a66
2022-09-22 19:26:15 +08:00
Edward-JW Yang
45711e4e16 feat(mt8188): add armv8.2 support
Add armv8.2 support for MT8188.

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.com>
Change-Id: I0ac865949ba864fb207ee1f0937092cbabd550de
2022-09-22 19:26:15 +08:00
Fengquan Chen
7079a942bd feat(mt8188): add DFD control in SiP service
DFD (Design for Debug) is a debugging tool, which scans flip-flops and
dumps to internal RAM on the WDT reset. After system reboots, those
values could be showed for debugging.

TEST=build pass.
BUG=b:244216434

Signed-off-by: Fengquan Chen <fengquan.chen@mediatek.corp-partner.google.com>
Change-Id: I468036131e941a46bc1ec12d33105146000730d8
2022-09-22 19:26:15 +08:00
Dawei Chien
8454f0d65e feat(mt8188): add EMI MPU basic drivers
EMI MPU stands for external memory interface memory protect unit.
MT8188 supports 32 regions and 16 domains.

Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
Change-Id: I9bbeb355665401cc71dda6db22157d9d751570d1
2022-09-22 19:26:15 +08:00
Garmin Chang
bc9410e237 feat(mt8188): add DCM driver
DCM means dynamic clock management, and it can dynamically
slow down or gate clocks during CPU or bus idle.

1. Add MCUSYS related DCM drivers.
2. Enable MCUSYS related DCM by default.

Signed-off-by: Garmin Chang <garmin.chang@mediatek.com>
Change-Id: I131354d72bbc190af504e9639bcc85a720e2bb17
2022-09-22 19:26:15 +08:00
Rex-BC Chen
a72b9e7754 feat(mt8188): add reset and poweroff functions
- Add mtk_pm_system_reset_cros() for cros reset.
- Add mtk_pm_system_off_cros() for cros power-off.

TEST=build pass
BUG=b:236331724

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I4117f6080e282551b37a936a490ab7b37ac31827
2022-09-22 19:26:15 +08:00
Edward-JW Yang
6ca2046ef1 feat(mediatek): add more flexibility of mtk_pm.c
To use power manager function more easier, we add some drivers to let
the implementation easier.

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.com>
Change-Id: Ibc6e1680c4534592ed37de49da39b6667f468ea1
2022-09-22 19:26:15 +08:00
Edward-JW Yang
5b95e439c7 feat(mediatek): add more options for build helper
To support more LPM feature, we add more options for build helper.

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.com>
Change-Id: I17eeedbe0674e321f1891074ba0c72d858841dae
2022-09-22 19:26:15 +08:00