Commit Graph

8925 Commits

Author SHA1 Message Date
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
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
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
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
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
Manish Pandey e55d12b7eb Merge changes from topic "Arm_PCI_Config_Space_Interface" into integration
* changes:
  TF-A: Document SMC_PCI_SUPPORT option
  SMCCC/PCI: Handle std svc boilerplate
  SMCCC/PCI: Add initial PCI conduit definitions
  SMCCC: Hoist SMC_32 sanitization
2021-05-27 09:49:10 +02:00
Pranav Madhu 7bd64c70e9 feat(plat/sgi): enable use of PSCI extended state ID format
The SGI/RD platforms have been using PSCI state ID format as defined in
PSCI version prior to 1.0. This is being changed and the PSCI extended
state ID format as defined in PSCI version 1.1 is being adapted. In
addition to this, the use of Arm recommended PSCI state ID encoding is
enabled as well.

Change-Id: I2be8a9820987a96b23f4281563b6fa22db48fa5f
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-05-27 10:29:17 +05:30
Hsin-Hsiung Wang 9ed4e6fb66 fix(plat/mediatek/pmic_wrap): update idle flow
Update idle flow in case of last read command timeout.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Change-Id: Idb0552d70d59b23822c38269d0fa9fe9ac0d6975
2021-05-27 02:13:37 +01:00
Madhukar Pappireddy b941145973 Merge "fix(services): drop warning on unimplemented calls" into integration 2021-05-27 00:45:41 +02:00
Mark Dykes fa4718031a Merge "fix(docs): fix typos in v2.5 release documentation" into integration 2021-05-26 20:02:36 +02:00
Madhukar Pappireddy 8d4aa7d95b Merge changes from topic "mt8192-apu" into integration
* changes:
  feat(plat/mediatek/apu): add mt8192 APU device apc driver
  feat(plat/mediatek/apu): add mt8192 APU SiP call support
  feat(plat/mediatek/apu): add mt8192 APU iommap regions
  feat(plat/mediatek/apu): setup mt8192 APU_S_S_4 and APU_S_S_5 permission
2021-05-26 16:36:21 +02:00
Madhukar Pappireddy 3bb3157ab3 Merge "feat(plat/sgi): enable AMU for RD-V1-MC" into integration 2021-05-26 15:54:28 +02:00
Madhukar Pappireddy 99b5dd65bb Merge "fix(plat/xilinx/versal/include): correct IPI buffer offset" into integration 2021-05-26 15:26:58 +02:00
Flora Fu f46e1f1853 feat(plat/mediatek/apu): add mt8192 APU device apc driver
Add APU device apc driver and setup permission.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: I2bbdb69d11267e4252b2138b5c5ac8faf752740f
2021-05-26 12:40:02 +08:00
Flora Fu ca4c0c2e78 feat(plat/mediatek/apu): add mt8192 APU SiP call support
Add APU SiP call support for start/stop mcu.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: Ibf93d8ccf22c414de3093cee9e13f7668588f69e
Signed-off-by: Pi-Cheng Chen <pi-cheng.chen@mediatek.com>
2021-05-26 12:29:32 +08:00
Rex-BC Chen 7eb4223757 feat(plat/mdeiatek/mt8195): add display port control in SiP service
MTK display port mute/unmute control registers need to be
set in secure world.

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Iec73650e937bd20e25c18fa28d55ae29e68b10d3
2021-05-26 02:13:56 +01:00
Madhukar Pappireddy 481c7b6b91 fix(docs): fix typos in v2.5 release documentation
Two issues in documentation were identified after the release.
This patch fixes these typos.

1. Matternhorn ELP CPU was made available through v2.5 release, not
   Matternhorn CPU
2. We had upgraded TF-A to use GCC 10.2 toolchain family and used this
   toolchain for release testing

Change-Id: I33e59bb5a6d13f4d40dbb3352004d5b133431d65
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-05-25 17:18:11 -05:00
Rajan Vaja e1e5b1339b fix(plat/xilinx/versal/include): correct IPI buffer offset
Use proper offset for IPI data based on offset for IPI0
channel.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I3070517944dd353c3733aa595df0da030127751a
2021-05-25 07:02:49 -07:00
Jeremy Linton 2d31cb079b TF-A: Document SMC_PCI_SUPPORT option
Add some basic documentation and pointers for the SMCCC PCI
build options.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Change-Id: Ia35f31d15066ea74135367cde2dce2f26e6ab31e
2021-05-25 14:49:15 +02:00
Jeremy Linton 1cdf1eb875 SMCCC/PCI: Handle std svc boilerplate
Add SMC wrappers for handshaking the existence
and basic parameter validation for the SMCCC/PCI
API. The actual read/write/segment validation is
implemented by a given platform which will enable
the API by defining SMC_PCI_SUPPORT.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Change-Id: I4485ad0fe6003cec6f5eedef688914d100513c21
2021-05-25 14:49:08 +02:00
Jeremy Linton c7a28aa798 SMCCC/PCI: Add initial PCI conduit definitions
Add constants, structures and build definition for the
new standard SMCCC PCI conduit. These are documented
in DEN0115A.

https://developer.arm.com/documentation/den0115/latest

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Change-Id: If667800a26b9ae88626e8d895674c9c2e8c09658
2021-05-25 14:49:01 +02:00
Jeremy Linton 475333c8a9 SMCCC: Hoist SMC_32 sanitization
The SMCCC, part 3 indicates that only the bottom
32-bits of a 32-bit SMC call are valid. The upper
bits must be zero. Lets enforce that so standard
service code can assume its been called that way.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Change-Id: I1bac50fbdc3b6ddca5fe2d1d1f96166a65ac4eb4
2021-05-25 14:48:56 +02:00
Flora Fu 2671f31872 feat(plat/mediatek/apu): add mt8192 APU iommap regions
Add APU iommap settings for reviser, apu_ao and
devapc control wrapper.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: Ie8e6a197c0f440f9e4ee8101202283a2dbf501a6
2021-05-25 14:49:30 +08:00
Flora Fu 77b6801966 feat(plat/mediatek/apu): setup mt8192 APU_S_S_4 and APU_S_S_5 permission
Setup APU_S_S_4/APU_S_S_5 permission as SEC_RW_ONLY.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: I6c50b2913bf34270a1b0ffaf0e0c435fee192a4c
2021-05-25 14:48:58 +08:00
Mark Dykes 09e153a9a8 Merge "feat(hw_crc): add support for HW computed CRC" into integration 2021-05-24 17:47:18 +02:00
Igor Opaniuk 9ce232fe98 feat(plat/imx8m): add SiP call for secondary boot
In iMX8MM it is possible to have two copies of bootloader in
SD/eMMC and switch between them. The switch is triggered either
by the BootROM in case the bootloader image is faulty OR can be
enforced by the user. To trigger that switch the
PERSIST_SECONDARY_BOOT bit should be set in GPR10 SRC register.
As the bit is retained after WARM reset, that permits to control
BootROM behavior regarding what boot image it will boot after
reset: primary or secondary.

This is useful for reliable bootloader A/B updates, as it permits
switching between two copies of bootloader at different offsets of
the same storage.

If the PERSIST_SECONDARY_BOOT is 0, the boot ROM uses address
0x8400 for the primary image. If the PERSIST_SECONDARY_BOOT is 1,
the boot ROM reads that secondary image table from address 0x8200
on the boot media and uses the address specified in the table for
the secondary image.

Secondary Image Table contains the sector of secondary bootloader
image, exluding the offset to that image (explained below in the
note). To generate the Secondary Image Table, use e.g.:
$ printf '\x0\x0\x0\x0\x0\x0\x0\x0\x33\x22\x11'
         '\x00\x00\x10\x0\x0\x00\x0\x0\x0'
  > /tmp/sit.bin
$ hexdump  -vC /tmp/sit.bin
  00000000  00 00 00 00
  00000004  00 00 00 00
  00000008  33 22 11 00 <--- This is the "tag"
  0000000c  00 10 00 00 <--- This is the "firstSectorNumber"
  00000010  00 00 00 00

You can also use NXP script from [1][2] imx-mkimage tool for
SIT generation. Note that the firstSectorNumber is NOT the offset
of the IVT, but an offset of the IVT decremented by Image Vector
Table offset (Table 6-25. Image Vector Table Offset and Initial
Load Region Size for iMX8MM/MQ), so for secondary SPL copy at
offset 0x1042 sectors, firstSectorNumber must be 0x1000
(0x42 sectors * 512 = 0x8400 bytes offset).

In order to test redundant boot board should be closed and
SD/MMC manufacture mode disabled, as secondary boot is not
supported in the SD/MMC manufacture mode, which can be disabled
by blowing DISABLE_SDMMC_MFG (example for iMX8MM):
> fuse prog -y 2 1 0x00800000

For additional details check i.MX 8M Mini Apllication Processor
Reference Manual, 6.1.5.4.5 Redundant boot support for
expansion device chapter.

[1] https://source.codeaurora.org/external/imx/imx-mkimage/
[2] scripts/gen_sit.sh
Change-Id: I0a5cea7295a4197f6c89183d74b4011cada52d4c
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
2021-05-21 15:01:38 +03:00
Mark Dykes 0fd12b9e11 Merge "refactor(juno): disable non-invasive debug of secure state" into integration 2021-05-20 17:06:23 +02:00