Commit Graph

9005 Commits

Author SHA1 Message Date
Manish Pandey 95d064b451 Merge "fix(plat/marvell/armada): select correct pcie reference clock source" into integration 2021-06-07 15:45:30 +02:00
Manish Pandey 076bb38df5 Merge "fix(plat/marvell/a3720/uart): fix UART parent clock rate determination" into integration 2021-06-07 15:36:46 +02:00
Joanna Farley 7737fdf0ed Merge "docs: add threat model code owners" into integration 2021-06-06 16:06:54 +02:00
Yann Gautier a5bcf82402 fix(io_stm32image): invalidate cache on local buf
When retrieving data from stm32 image file, the header is removed with
a memcpy that shifts the data to overwrite the useless header for next
binary.

STM32 binary from boot device:
|-------------------------------------|
| header | payload                    |
|-------------------------------------|

After the memcpy:
|-------------------------------------|
| payload                    | remain |
|-------------------------------------|

But the remaining data after the shifted payload is still in
the cache. As it is of no use for anyone, just invalidate the cache
at this address.
This is required if the DDR is mapped secure in BL2, and the secure
access is forbidden in BL33, or else TZC-400 issues an error.

Change-Id: Ice2af3b1ca49eccb79bfc62db60437e259d344ca
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-06-04 15:15:18 +02:00
Yann Gautier b6561c1217 refactor(io_stm32image): add header size variable
A variable hdr_sz is created in stm32image_partition_read() function.
It just represents the size of the stm32 image header but it really
improves the readability of the function.

Change-Id: I95ec62a78a4b6c6a75b0d8c8aa0faef8bee424da
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-06-04 15:15:18 +02:00
Nicolas Le Bayon c1d732d0db fix(io_stm32image): uninitialized variable warning
Fixes implementation against build warning reported by GCC:

drivers/st/io/io_stm32image.c: In function ‘stm32image_partition_read’:
drivers/st/io/io_stm32image.c:249:6: error: ‘result’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  int result;
      ^~~~~~

Actually, by construction the current implementation of function
stm32image_partition_read() does not mandate result to be initialized
since it always reaches the exit point with a valid value in 'result'.
Yet, this change prevents compiler from complaining and is more robust
against future changes in the implementation.

Change-Id: I383575edb605b7535398952a5fdfc266c0068c71
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-06-04 15:15:18 +02:00
Yann Gautier c20b060661 refactor(plat/st): avoid fixed DT address
Device Tree address is now a parameter for dt_open_and_check() function.
This will allow better flexibility when introducing PIE and FIP.
The fdt pointer is now only assigned if the given address holds
a valid device tree file. This allows removing the fdt_checked variable,
as we now check fdt is not null.

Change-Id: I04cbb2fc05c9c711ae1c77d56368dbeb6dd4b01a
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-06-04 15:05:05 +02:00
Yann Gautier d3b0e8702a refactor(plat/st): check boot device only for BL2
The boot device is now checked inside a dedicated rule, that is only
called during BL2 compilation step

Change-Id: Ie7bcd1f166285224b0c042238989a82f7b6105c6
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-06-04 15:03:35 +02:00
Olivier Deprez 1a2c0ff927 Merge changes from topic "od/cleanup-changes" into integration
* changes:
  perf(spmd): omit sel1 context save if sel2 present
  fix(fvp): spmc optee manifest remove SMC allowlist
  fix: random typos in tf-a code base
2021-06-04 14:50:20 +02:00
Vyacheslav Yurkov 214c8a8d08 feat(plat/st): add STM32MP_EMMC_BOOT option
Added a new STM32MP_EMMC_BOOT option, which is used to look for SSBL in
the same eMMC boot partition TF-A booted from at a fixed 256k offset. In
case STM32 image header is not found, the boot process rolls back to a
GPT partition look-up scheme.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Change-Id: I85a87dc9ae7f2b915ed8e584be80f4b3588efc48
2021-06-04 10:10:51 +02:00
Vyacheslav Yurkov f3d2750aa2 feat(drivers/st): manage boot part in io_mmc
Use dedicated read function for boot partition

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Change-Id: If75df7691fce0797205365736fc6e4e3429efdca
2021-06-04 10:08:39 +02:00
Vyacheslav Yurkov 5014b52dec feat(drivers/mmc): boot partition read support
Added a public function to read blocks from a current boot partition.
switch between partitions has to respect eMMC partition switch timing.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Change-Id: I55b0c910314253e5647486609583fd290dadd30a
2021-06-04 09:52:37 +02:00
Madhukar Pappireddy 0ef419b145 Merge "feat(plat/zynqmp): add SDEI support" into integration 2021-06-03 16:52:26 +02:00
Jan Kiszka 4143268a5c feat(plat/zynqmp): add SDEI support
Add basic SDEI support, implementing the software event 0 only for now.
This already allows hypervisors like Jailhouse to use SDEI for internal
signaling while passing the GICC through to the guest (see also IMX8).

With SDEI on, we overrun the SRAM and need to stay in DRAM. So keep SDEI
off by default.

Co-developed-by: Angelo Ruocco <angeloruocco90@gmail.com>
Signed-off-by: Angelo Ruocco <angeloruocco90@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Change-Id: Ic0d71b4ef0978c0a34393f4e3530ed1e24a39ca2
2021-06-03 16:34:12 +02:00
Madhukar Pappireddy a49babce63 Merge changes from topic "stm32_bl2_io" into integration
* changes:
  refactor(plat/st): remove io_dummy code for OP-TEE
  refactor(plat/st): remove BL2 image loading
  refactor(plat/st): rename OP-TEE pager to core
2021-06-03 16:08:35 +02:00
Yann Gautier 3f916a412a refactor(plat/st): remove io_dummy code for OP-TEE
The io_dummy code and function calls are only used in case BL32 is TF-A
SP_min, and not OP-TEE. This code in bl2_io_storage can then be put under
#ifndef AARCH32_SP_OPTEE.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I52787a775160b335f97547203f653419621f5147
2021-06-03 10:48:57 +02:00
Yann Gautier e1db570a30 refactor(plat/st): remove BL2 image loading
STM32MP1 does not use BL1, the loading of BL2 is done by ROM code. It is
then useless to have an entry BL2_IMAGE_ID in the policies.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I464cedf588114d60522433123f8dbef32ae36818
2021-06-03 10:45:17 +02:00
Yann Gautier 06c3b100ea refactor(plat/st): rename OP-TEE pager to core
OPTEE_PAGER defines are renamed OPTEE_CORE.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I4c28d3b0a6ed843088a3ef06e3e348ce689fabde
2021-06-03 10:43:42 +02:00
Olivier Deprez 678ce2237c perf(spmd): omit sel1 context save if sel2 present
The SPMC at S-EL2 manages S-EL1 execution contexts for SPs. The
currently running SP vCPU state is always saved when the SPMC exits to
SPMD. A fresh vCPU context is always restored when the SPMC is entered
from the SPMD and a SP resumed. For performance optimization reasons
this permits omitting the saving/restoring of the S-EL1 context from
within the EL3 SPMD on entering/exiting the SPMC. The S-EL2 SPMC and
NS-EL1 context save/restore remain done in the SPMD.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I66413ed5983913791ff5c9fc03c590ee65c6ccd7
2021-06-03 09:31:24 +02:00
Olivier Deprez 183725b39d fix(fvp): spmc optee manifest remove SMC allowlist
Fix a remainder from early prototyping. OP-TEE as a secure partition
does not need specific SMC function id pass through to EL3.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I2843d1b9a5eb4c966f82790e1655fb569c2de7d4
2021-06-03 09:31:18 +02:00
Olivier Deprez 2e61d6871c fix: random typos in tf-a code base
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Id610f7e4398e799a2fbd74861274fd684c32db53
2021-06-03 09:31:10 +02:00
Manish Pandey cbcdf688a1 Merge "fix(plat/arm): correct UUID strings in FVP DT" into integration 2021-06-03 08:41:33 +02:00
Yann Gautier 748bdd19aa fix(plat/arm): correct UUID strings in FVP DT
The UUID strings used in FW_CONFIG DT are not aligned with UUIDs defined
in include/tools_share/firmware_image_package.h for BL32_EXTRA1 and
TRUSTED_KEY_CERT.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I517f8f9311585931f2cb931e0588414da449b694
2021-06-02 17:21:06 +02:00
Madhukar Pappireddy 2512d0480f Merge "feat(plat/imx8m): add SiP call for secondary boot" into integration 2021-06-02 15:45:29 +02:00
Pali Rohár 5a91c439cb fix(plat/marvell/a3720/uart): fix UART parent clock rate determination
The UART code for the A3K platform assumes that UART parent clock rate
is always 25 MHz. This is incorrect, because the xtal clock can also run
at 40 MHz (this is board specific).

The frequency of the xtal clock is determined by a value on a strapping
pin during SOC reset. The code to determine this frequency is already in
A3K's comphy driver.

Move the get_ref_clk() function from the comphy driver to a separate
file and use it for UART parent clock rate determination.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I8bb18a2d020ef18fe65aa06ffa4ab205c71be92e
2021-06-02 14:19:52 +01:00
Zelalem 99a99eb4dd docs: change Linaro release version to 20.01
We currently use Linaro release software stack version
20.01 in the CI. Reflect that change in the docs.

Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
Change-Id: I0fa9f0163afb0bf399ec503abe9af4f17231f173
2021-06-01 17:32:02 -05:00
Madhukar Pappireddy 203d48adca Merge "refactor(plat/marvell/uart): de-duplicate PLAT_MARVELL_UART macros" into integration 2021-06-01 20:24:05 +02:00
Madhukar Pappireddy 94869f0fd1 Merge "refactor(plat/marvell/uart): remove unused macros" into integration 2021-06-01 18:58:39 +02:00
Guo Yi 371648e1c7 fix(plat/marvell/armada): select correct pcie reference clock source
when comphy is in pcie mode, correct reference clock need be
selected according to SAR register that reflect the CPx_MPP boot
strapping pins. Either from external or from internal

Signed-off-by: Guo Yi <yguo@cavium.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Change-Id: I99ed64a141e85174cc0f8e9dab5886ab2506efa1
2021-06-01 17:44:21 +02:00
Madhukar Pappireddy 73a3db718c Merge "fix(morello): initialise CNTFRQ in Non Secure CNTBaseN" into integration 2021-06-01 17:07:45 +02:00
Madhukar Pappireddy 906116f829 Merge "fix(plat/marvell/a3720/uart): fix configuring UART clock" into integration 2021-06-01 16:45:49 +02:00
Pali Rohár 3133625859 refactor(plat/marvell/uart): de-duplicate PLAT_MARVELL_UART macros
Macros PLAT_MARVELL_BOOT_UART* and PLAT_MARVELL_CRASH_UART* are defined
to same values. De-duplicate them into PLAT_MARVELL_UART* macros.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Iae5daf7cad6a971e6f3dbe561df3d0174106ca7f
2021-06-01 16:34:52 +02:00
Pali Rohár 6b557f48c3 refactor(plat/marvell/uart): remove unused macros
Macros PLAT_MARVELL_BL31_RUN_UART* are not used since commit
d7c4420cb8 ("plat/marvell: Migrate to multi-console API").

Remove them.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I5ec959ef4de87dcfb332c017ad2599bf8af6ffc3
2021-06-01 16:34:08 +02:00
Pali Rohár b9185c75f7 fix(plat/marvell/a3720/uart): fix configuring UART clock
When configuring the UART_BAUD_REG register, the function
console_a3700_core_init() currently only changes the baud divisor field,
leaving other fields to their previous value.

This is incorrect, because the baud divisor is computed with the
assumption that the parent clock rate is 25 MHz, and since the other
fields in this register configure the parent clock, which could have
been changed by U-Boot or Linux.

Fix this function to also configure the other fields so that the UART
parent clock is selected to be the xtal clock.

For example without this change TF-A prints only

    ERROR: a3700_system_off needs to be implemented

followed by garbage after plat_crash_console_init() is called.

After applying this change instead of garbage it also print crash info:

    PANIC at PC : 0x0000000004023800

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I72f338355cc60d939b8bb978d9c7fdd576416b81
2021-06-01 16:32:10 +02:00
Madhukar Pappireddy 4fe55a2fd8 Merge "fix(plat/marvell/a3720/uart): fix UART clock rate value and divisor calculation" into integration 2021-06-01 16:13:11 +02:00
Madhukar Pappireddy fb88c71d2a Merge "feat(plat/mdeiatek/mt8195): add display port control in SiP service" into integration 2021-06-01 15:36:16 +02:00
Madhukar Pappireddy e4622d3cec Merge "feat(plat/zynqmp): add support for XCK26 silicon" into integration 2021-06-01 15:35:45 +02:00
Manoj Kumar 7f2d23d9d7 fix(morello): initialise CNTFRQ in Non Secure CNTBaseN
Morello exhibits the behavior similar to Juno wherein CNTBaseN.CNTFRQ
can be written but does not reflect the value of the CNTFRQ register
in CNTCTLBase frame. This doesn't follow ARM ARM in that the value
updated in CNTCTLBase.CNTFRQ is not reflected in CNTBaseN.CNTFRQ.

Hence enable the workaround (applied to Juno) for Morello that updates
the CNTFRQ register in the Non Secure CNTBaseN frame.

Change-Id: Iabe53bf3c25152052107e08321323e4bde5fbef4
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
2021-06-01 13:11:50 +01:00
Jiaxin Yu 6c4973b0a9 feat(plat/mediatek/mpu): add MPU support for DSP
Forbidden domain D4(DSP) access 0x40000000~0x1FFFF0000.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Change-Id: If409df10cecbcccc493d7958ab2765fd110d9009
2021-05-31 10:13:16 +01:00
Olivier Deprez b35f8f2d1e Merge "feat(tc0): add support for trusted services" into integration 2021-05-31 08:44:33 +02:00
Venkatesh Yadav Abbarapu 7a30e08b70 feat(plat/zynqmp): add support for XCK26 silicon
Add support for XCK26 silicon which is available on SOM board.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: Ic98213328702903af8a79f487a2868f3e6d60338
2021-05-30 21:37:20 -06:00
Madhukar Pappireddy 2ea8d41979 Merge "fix: rename Matterhorn, Matterhorn ELP, and Klein CPUs" into integration 2021-05-28 22:08:24 +02:00
johpow01 c6ac4df622 fix: rename Matterhorn, Matterhorn ELP, and Klein CPUs
This patch renames the Matterhorn, Matterhorn ELP, and Klein CPUs to
Cortex A710, Cortex X2, and Cortex A510 respectively.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I056d3114210db71c2840a24562b51caf2546e195
2021-05-28 13:53:23 -05:00
Pali Rohár 66a7752834 fix(plat/marvell/a3720/uart): fix UART clock rate value and divisor calculation
UART parent clock is by default the platform's xtal clock, which is
25 MHz.

The value defined in the driver, though, is 25.8048 MHz. This is a hack
for the suboptimal divisor calculation
  Divisor = UART clock / (16 * baudrate)
which does not use rounding division, resulting in a suboptimal value
for divisor if the correct parent clock rate was used.

Change the code for divisor calculation to
  Divisor = Round(UART clock / (16 * baudrate))
and change the parent clock rate value to 25 MHz.

The final UART divisor for default baudrate 115200 is not affected by
this change.

(Note that the parent clock rate should not be defined via a macro,
since the xtal clock can also be 40 MHz. This is outside of the scope of
this fix, though.)

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Iaa401173df87aec94f2dd1b38a90fb6ed0bf0ec6
2021-05-28 10:13:06 +01:00
Madhukar Pappireddy 0f7d2e8911 Merge "fix(plat/mediatek/pmic_wrap): update idle flow" into integration 2021-05-27 16:56:28 +02:00
Madhukar Pappireddy 1f8dceeac1 Merge "feat(plat/sgi): enable use of PSCI extended state ID format" into integration 2021-05-27 15:50:00 +02:00
Yann Gautier 34b508be9f fix(makefile): use space in WARNINGS list
The tab between -Wdisabled-optimization and -Wvla is replaced with
a space. This avoids having it removed when copy/pasting the compilation
command line, and having the following error:
arm-none-eabi-gcc: error: unrecognized command line option
 '-Wdisabled-optimization-Wvla'; did you mean '-Wdisabled-optimization'?

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I72de2a70d192a7813b1f9b55485914142d1fc428
2021-05-27 13:50:21 +02:00
Yann Gautier 46b9033359 refactor(plat/nvidia): use SOC_ID defines
Use the macros that are now defined in include/lib/smccc.h.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Ibe3c17acd2482b7779318c8a922a138dcace5554
2021-05-27 10:00:38 +02:00
Yann Gautier 48648c0993 refactor(plat/mediatek): use SOC_ID defines
Use the macros that are now defined in include/lib/smccc.h.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Ie1dbc54569086f6a74206b873fee664b4cdeea36
2021-05-27 09:59:11 +02:00
Yann Gautier dfff46862f refactor(plat/arm): use SOC_ID defines
Use the macros that are now defined in include/lib/smccc.h.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I688a76277b729672835d51fafb68d1d6205b6ae4
2021-05-27 09:59:11 +02:00