Commit Graph

4949 Commits

Author SHA1 Message Date
Chandni Cherukuri 07302a23ec fix(morello): change the AP runtime UART address
SoC UART1 is internally connected to MCP UART1 so this
cannot be used as AP runtime UART instead we use the
IOFPGA UART0 as the AP runtime UART.

Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: Iecefb0d2cb875b3ecf97e0983b06f6e914835021
2021-12-16 19:56:31 +05:30
sah01 6ad6465e5c feat(morello): add support for nt_fw_config
This patch adds support to load nt_fw_config
with the information from plat_info sds
structure which is then passed from BL2 to BL33.

Signed-off-by: sah01 <sahil@arm.com>
Change-Id: I2242da7404c72a4f9c2e3d7f3b5c154890a78526
2021-12-16 19:56:26 +05:30
sah01 4a7a9dafbc feat(morello): split platform_info sds struct
Different platform_info sds struct definition will be used
for fvp and soc.

Signed-off-by: sahil <sahil@arm.com>
Change-Id: I92f0e1b2d0d755ad0405ceebfeb78d6e4c67013d
2021-12-16 19:55:14 +05:30
Manoj Kumar 4af5397753 feat(morello): add changes to enable TBBR boot
This patch adds all SOC and FVP related changes required to boot
a standard TBBR style boot on Morello.

Signed-off-by: sahil <sahil@arm.com>
Change-Id: Ib8f7f326790b13082cbe8db21a980e048e3db88c
2021-12-16 19:55:08 +05:30
Manoj Kumar 572c8ce255 feat(morello): add DTS for Morello SoC platform
Added Morello SoC specific DTS file.

Change-Id: I099e74ec95ed9e1b47f7d5a68b0dd1e251439e11
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2021-12-15 11:52:31 +05:30
Chandni Cherukuri 9b8c431e2b feat(morello): configure DMC-Bing mode
Based on the SCC configuration value obtained from the SDS
platform information structure configure DMC-Bing Server or
Client mode after zeroing out the memory.

Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: I0555fa06c9c1906264848f4e32ca413b4742cdee
2021-12-15 11:52:10 +05:30
Manoj Kumar 2d39b39704 feat(morello): zero out the DDR memory space
For Morello SoC, we use ECC capability for the RDIMMs
which require the entire DDR memory space to be zeroed
out before it can be accessed.

Change-Id: Icbe9916f9a2d3c4ce839d8bf7f867efa18f33e23
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2021-12-15 11:50:29 +05:30
Manoj Kumar 8840711f33 feat(morello): add TARGET_PLATFORM flag
The same folder "plat/arm/board/morello" is going to be
used by both Morello FVP and Morello SoC platforms.

TARGET_PLATFORM build flag has been introduced to
differentiate between the two platforms

Change-Id: I3e94da372a3f1ba810b4259b85dd4c204306c359
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2021-12-15 11:50:11 +05:30
Chandni Cherukuri c5f3de8dab fix(arm): use PLAT instead of TARGET_PLATFORM
There might be several platforms which use the
TARGET_PLATFORM build option to differentiate the code
between the platform variants.

Use of TARGET_PLATFORM in the common code leads to build
failures instead use PLAT build option.

Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: I9724caf875bd56225e035ecffa8b9ca1a50d3401
2021-12-15 11:49:21 +05:30
Madhukar Pappireddy 7468be1274 Merge changes from topic "fconf_get_index" into integration
* changes:
  feat(stm32mp1): skip TOS_FW_CONFIG if not in FIP
  feat(fconf): add a helper to get image index
2021-12-14 20:58:09 +01:00
Yann Gautier acf28c267b feat(st): protect UART during platform init
Protect the UART instance used for serial boot
with UART used for console.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ieee1557b34e7baa81594c3fbf0513191737027bf
2021-12-14 11:34:16 +01:00
Yann Gautier aafff04354 feat(stm32mp1): update console management for SP_min
Use stm32mp_uart_console_setup() in SP_min setup.
Adapt the function stm32mp_uart_console_setup() for BL32 (no reset, add
CONSOLE_FLAG_RUNTIME under DEBUG.

Change-Id: Ib2d35c8d285dafb680aa218872ad679cbf43d0ed
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier 86240942fa refactor(stm32mp1): improve console management in BL2
Use newly created function stm32mp_uart_console_setup().
And remove now useless code.

Change-Id: Ib8d0319d3f4f54309848bc225b58608cea73bad9
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier 53612f7293 feat(plat/st): add a function to configure console
To ease console configuration, a dedicated function is created:
stm32mp_uart_console_setup(). The code will also be common for the
different BLs.

Change-Id: Idf3cad756f125ca2313cf30b1311637a9df8f27f
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier a6bfa75cf2 feat(stm32mp1): add stm32_get_boot_interface function
Add function stm32_get_boot_interface to get the current boot interface
from information saved in the TAMP register.

Change-Id: I23af43c68eeaebe4c45920a57d739117aea3fbb1
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier 4dc77a35e3 refactor(stm32mp1): move stm32_save_boot_interface()
The function stm32_save_boot_interface()is moved to stm32mp1_private.c
file. The files stm32mp1_context.{c,h} are removed.
As return is always 0, change the function to return void.
Call it earlier, to be able to use it when configuring console.

Change-Id: I8986e1257dc8e8708eab044a51ea1f2426b16597
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier d7176f0319 fix(stm32mp1): deconfigure UART RX pins
Those pins are configured by ROM code, for serial boot use cases.
Their configs are reset if the boot is done on UART, but not on USB.
This should then be done in TF-A. This has to be done after clock
init, and before console is configured.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I29a9694e25fcf1665360dd71f73937f769c43b52
2021-12-14 09:25:19 +01:00
Yann Gautier 737ad29bf9 feat(stm32_gpio): add a function to reset a pin
Add set_gpio_reset_cfg() to set a pin in its reset configuration:
analog, no-pull, speed low, and its secure configuration, thanks to
stm32_gpio_is_secure_at_reset().

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I7b73c3636859f97fcc57f81cf68b42efc727922e
2021-12-14 09:25:19 +01:00
Yann Gautier ce21ee89d4 refactor(stm32mp1): sort compilation flags
Sort the compilation flags in platform.mk when checking and defining
them for C files.

Change-Id: I5a08399c89ede4c0bd8697045706122732205db5
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier c10f3a4559 feat(stm32mp1): add sign-compare warning
Add -Wsign-compare to TF_CFLAGS to check signedness comparison during
STM32MP1 platform compilation.

Change-Id: I4cada49622f44258d3e0da4560a566de9c7d54b3
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-14 09:25:19 +01:00
Yann Gautier b706608642 feat(stm32mp1): skip TOS_FW_CONFIG if not in FIP
Thanks to dyn_cfg_dtb_info_get_index(), we can check if TOS_FW_CONFIG
is inside the FIP partition. If not we can skip its treatment when
populating FIP images.

Change-Id: If5623eabd1ba484549d4a908d4a6f43325b36875
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-12-13 17:37:57 +01:00
Edward-JW Yang ab45305062 feat(plat/mediatek/mt8195): improve SPM wakeup log
To enhance debug efficiency, modify wakeup log:
1. Redefine strings of wakeup reason for readability.
2. Indicate 26M clock on/off state of previous suspend.
3. Add warning log if SPM cannot get wakeup reason.

BUG=b:205201535
TEST=build pass

Signed-off-by: Edward-JW Yang <edward-jw.yang@mediatek.corp-partner.google.com>
Change-Id: Icb14ebb08958da225969abd3cdd9e471d232c7eb
2021-12-13 17:20:37 +08:00
Takuya Sakata 14d9727e33 feat(plat/rcar3): update IPL and Secure Monitor Rev.3.0.3
Update the revision number in the revision management file.

Signed-off-by: Hideyuki Nitta <hideyuki.nitta.jf@hitachi.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I19f713de68e62a2ed3f4ec08c31b35af6a4014ef
2021-12-12 13:07:09 +01:00
Takuya Sakata ffb725be98 feat(plat/rcar3): modify type for Internal function argument
Modify the type of the variable that stores the value for MPIDR
in the internal function from uint64_t to u_register_t.

Signed-off-by: Koichi Yamaguchi <koichi.yamaguchi.zb@hitachi.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ib5bda93d5432e0412132bddf41ead8ee3fcf9e46
2021-12-12 13:07:06 +01:00
Takuya Sakata d9912cf3d1 feat(plat/rcar3): modify sequence for update value for WUPMSKCA57/53
Add new function so that the value of bit at WUPMSKCA57/53,
which points to CPU other than the BOOT CPU, is 1 at initialization.
Modify sequence so that value of each bit for CPU at WUPMSKCA57/53 is
basically 0 and target bit value is changed to 1 only when CPU_OFF.

Signed-off-by: Koichi Yamaguchi <koichi.yamaguchi.zb@hitachi.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Id5dafc04e1dbaf265c8b67b903c335bb1af49914
2021-12-12 13:07:02 +01:00
Madhukar Pappireddy 714ca37dc7 Merge "feat(plat/zynqmp): disable the -mbranch-protection flag" into integration 2021-12-10 19:07:40 +01:00
Manish Pandey c6b2919834 Merge changes from topic "mb_critical_data" into integration
* changes:
  docs(measured-boot): add a platform function for critical data
  feat(fvp): measure critical data
2021-12-10 14:37:06 +01:00
Venkatesh Yadav Abbarapu 67abd4762b feat(plat/zynqmp): disable the -mbranch-protection flag
With new gcc11.2 by default the -mbranch-protection is
set to "standard" which is leading to increase the text
section by 4Kb. As the ZynqMP uses the ARMv8 architecture,
so there is no impact when we disable the branch protection.
These instructions do not provide the branch protection in
architectures before Armv8.3-A.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Change-Id: I36f7a55abf99f50df2ee265255598d83b1f480c6
2021-12-10 05:16:07 -07:00
Madhukar Pappireddy 97af8baf0a Merge "refactor(measured-boot): add generic macros for using Crypto library" into integration 2021-12-10 01:25:26 +01:00
Madhukar Pappireddy 4f53c1301c Merge "fix(plat/socionext/synquacer): initialise CNTFRQ in Non Secure CNTBaseN" into integration 2021-12-09 15:03:19 +01:00
Madhukar Pappireddy 590fd53d61 Merge "refactor(plat/synquacer): update PSCI system_off handling" into integration 2021-12-09 15:03:06 +01:00
Manish V Badarkhe cf21064ec8 feat(fvp): measure critical data
Implemented a platform function 'plat_mboot_measure_critical_data' to
measure critical data and record its measurement using the Event Log
driver.
'bl2_plat_mboot_finish' function invokes this platform function
immediately after populating the critical data.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ia198295c6e07ab26d436eab1ff90df2cf28303af
2021-12-08 13:08:17 +00:00
Manish V Badarkhe 14db963fd3 refactor(measured-boot): add generic macros for using Crypto library
It doesn't look correct to use mbed TLS defines directly in the Event
Log driver as this driver may use another Crypto library in future.
Hence mbed TLS Crypto dependency on Event Log driver is removed by
introducing generic Crypto defines and uses those in the Event Log
driver to call Crypto functions.
Also, updated mbed TLS glue layer to map these generic Crypto defines
to mbed TLS library defines.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ibc9c751f60cbce4d3f3cf049b7c53b3d05cc6735
2021-12-08 11:00:13 +00:00
Sandrine Bailleux 0628fe3fff Merge "refactor(measured boot): rename a macro INVALID_ID to EVLOG_INVALID_ID" into integration 2021-12-08 08:16:53 +01:00
Masahisa Kojima e01acbe903 refactor(plat/synquacer): update PSCI system_off handling
SynQuacer SoC contains a Cortex-M3 System Control Processor(SCP)
which manages system power.
This commit modifies the PSCI system_off handling to call SCMI,
same as other PSCI calls. System power-off is done by turing off
the ATX power supply through GPIO, this operation is transferred
to SCP.

Note that this commit modifies only the SCMI case, obsolete SCPI
implementation is not updated.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Change-Id: I6c1009e67cccd1eb5d14c338c3df9103d63709dd
2021-12-07 17:33:29 +09:00
Masahisa Kojima 4d4911d77d fix(plat/socionext/synquacer): initialise CNTFRQ in Non Secure CNTBaseN
The GTimer implemented on SynQuacer has similar issue found on 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 SynQuacer that updates
the CNTFRQ register in the Non Secure CNTBaseN frame.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Change-Id: I5204fb57f28c0945812814f008c4905ef0882e2b
2021-12-07 17:29:27 +09:00
Madhukar Pappireddy 7c62111381 Merge changes from topic "st_uart" into integration
* changes:
  feat(plat/st): add STM32MP_UART_PROGRAMMER target
  feat(plat/st): add STM32CubeProgrammer support on UART
  feat(drivers/st/uart): add uart driver for STM32MP1
2021-12-06 19:03:26 +01:00
Tinghan Shen 690cb1265e feat(plat/mediatek/mt8195): add EMI MPU surppot for SCP and DSP
1. Enable domain D0 and D3 (SCP) access 0x50000000~0x51400000.
2. Enable domain D4 (DSP & AFE) access 0x60000000~0x610FFFFF.

BUG=b:204347737
TEST=build pass

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Change-Id: I7c9f8490b8898008ba6844c34c9e80caa6066cbc
2021-12-06 15:29:08 +08:00
Tinghan Shen 20ef588e86 feat(plat/mediatek/mt8195): dump EMI MPU configurations
Add dump_emi_mpu_regions() to dump EMI MPU configurations.

BUG=b:204347737
TEST=build pass

Change-Id: Ia92c6d19b96d429682dff1680d5f5b2dc2bc1b8f
Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2021-12-06 15:29:06 +08:00
Manish Pandey 8a63739b31 Merge "fix(plat/arm/sgi): disable SVE for NS to support SPM_MM builds" into integration 2021-12-03 15:12:21 +01:00
Patrick Delaunay 9083fa11ea feat(plat/st): add STM32MP_UART_PROGRAMMER target
Handle boot from UART with STM32CubeProgammer based on mmap io
for STM32MP15.

Depends-On: Iba84e8dfd67b9f30416efb0f6778e48ba1f75dad
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ibd719dd46a11da78633728675ef6639635b6cf67
2021-12-03 09:26:11 +01:00
Patrick Delaunay fb3e7985c9 feat(plat/st): add STM32CubeProgrammer support on UART
Add a file to support the STMicroelectronics tool STM32CubeProgrammer
over UART in BL2 for STM32MP15x platform.

This tools is based on protocol defined in AN5275,
"USB DFU/USART protocols used in STM32MP1 Series bootloaders"
based on STM32 MCU protocols (AN3155, "USART protocol used
in the STM32 bootloader").

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I956c95d8de0a94d1eb8e61f043651dae7b838170
2021-12-03 09:26:11 +01:00
Pali Rohár a4d35ff381 feat(plat/marvell/a3k): add north and south bridge reset registers
These registers make it is possible to do external resets of A3700
peripherals. Most peripherals are reset by clearing a particular bit,
but some need setting the bit. Reflect this via "_N" suffix in macro
names.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Iacef5e671746b831b5beea9e4fdcc59d8de84edc
2021-12-02 17:37:58 +01:00
Vijayenthiran Subramaniam 78d7e81979 fix(plat/arm/sgi): disable SVE for NS to support SPM_MM builds
Commit 4333f95 ("fix(spm_mm): do not compile if SVE/SME is enabled")
introduced a comiple time check to verify if ENABLE_SVE_FOR_NS is set to
0 when SPM_MM build is enabled. To support SPM_MM builds on SGI/RD
platforms set ENABLE_SVE_FOR_NS to 0.

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: If78ed7567f6d988795b2bc7f772a883783246964
2021-12-02 08:27:51 +01:00
Manish Pandey 29ad12a7b5 Merge changes Ia0d13c3c,I8cf821a4,I1e6a598b,I9c6dd8db,Iaf6db75e, ... into integration
* changes:
  fix(plat/xilinx/versal): resolve misra R10.6
  fix(plat/xilinx/versal): resolve misra R14.4
  fix(plat/xilinx/versal): resolve misra R17.7
  fix(plat/xilinx/versal): resolve misra R10.3
  fix(plat/xilinx/versal): resolve misra R7.2
  fix(plat/xilinx/versal): resolve misra R15.7
  fix(plat/xilinx/versal): resolve misra R15.6
  fix(plat/xilinx/versal): resolve misra R10.1 in pm services
  fix(plat/xilinx/versal): resolve misra R20.7 in pm services
  fix(plat/xilinx/versal): resolve misra R10.3 in pm services
  fix(plat/xilinx/versal): resolve misra R10.6 in pm services
  fix(plat/xilinx/versal): resolve misra R16.3 in pm services
  fix(plat/xilinx/versal): resolve misra R15.6 in pm services
2021-12-01 17:52:30 +01:00
Rex-BC Chen 27132f13ca feat(mt8186): initialize platform for MediaTek MT8186
- Add basic platform setup.
- Add MT8186 documentation at docs/plat/.
- Add generic CPU helper functions.
- Add basic register address.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Id3e2f46a8c3ab2f3e29137e508d4c671e8f4aad5
2021-12-01 16:36:28 +01:00
Manish Pandey 2141a68543 Merge changes I0c1f7d6c,I3bec0b58,If24cf213 into integration
* changes:
  feat(plat/mediatek/apu): add mt8195 APU clock and pll SiP call
  feat(plat/mediatek/apu): add mt8195 APU mcu boot and stop SiP call
  feat(plat/mediatek/apu): add mt8195 APU iommap regions
2021-12-01 14:21:50 +01:00
Abhyuday Godhasara 93d4625627 fix(plat/xilinx/versal): resolve misra R10.6
MISRA Violation: MISRA-C:2012 R.10.6
- The value of a composite expression shall not be assigned to an object
  with wider essential type

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: Ia0d13c3cfeb13d22b6fc7e8869cc713218302973
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara a62c40d427 fix(plat/xilinx/versal): resolve misra R14.4
MISRA Violation: MISRA-C:2012 R.14.4
- The controlling expression of an if statement and the controlling
  expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I8cf821a42015858200cc0c514600012c8f61061f
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara 526a1fd147 fix(plat/xilinx/versal): resolve misra R17.7
MISRA Violation: MISRA-C:2012 R.17.7
- The value returned by a function having non-void return type shall be
  used ((void) missing for discarded return value.).

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I1e6a598b9fe6c571a3e5010ee832ef860dfe491d
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara b2bb3efb8f fix(plat/xilinx/versal): resolve misra R10.3
MISRA Violation: MISRA-C:2012 R.10.3
- The value of an expression shall not be assigned to an object with a
  narrower essential type or of a different essential type category

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I9c6dd8dba40db8067b46947ceff295732648612a
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara 0623dcea0f fix(plat/xilinx/versal): resolve misra R7.2
MISRA Violation: MISRA-C:2012 R.7.2
- A "u" or "U" suffix shall be applied to all integer constants that are
  represented in an unsigned type

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: Iaf6db75e42913ddceccb803426287d0c47d7f31d
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara bc2637e379 fix(plat/xilinx/versal): resolve misra R15.7
MISRA Violation: MISRA-C:2012 R.15.7
- All if . . else if constructs shall be terminated with an else statement

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: Iea32e32b5683f7accd7fac8d557957f05ed0f5c5
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara b9fa2d9fc1 fix(plat/xilinx/versal): resolve misra R15.6
MISRA Violation: MISRA-C:2012 R.15.6
- The body of an iteration-statement or a selection-statement shall be
  a compound statement

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: If1ccaa2f254ac85a329295de501e2b5558e8ff43
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara 775bf1bbd3 fix(plat/xilinx/versal): resolve misra R10.1 in pm services
MISRA Violation: MISRA-C:2012 R.10.1
- Operands shall not be of an inappropriate essential type.

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I67b5788054a136be8d764472c5d85528a5c4272f
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara 5dada6227b fix(plat/xilinx/versal): resolve misra R20.7 in pm services
MISRA Violation: MISRA-C:2012 R.20.7
- Expressions resulting from the expansion of macro parameters shall be
  enclosed in parentheses

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: Id913c556cab955c798809ad2bd08ca3e48e2231a
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara 5d1c211e22 fix(plat/xilinx/versal): resolve misra R10.3 in pm services
MISRA Violation: MISRA-C:2012 R.10.3
- The value of an expression shall not be assigned to an object with a
  narrower essential type or of a different essential type category

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I73c056ff4df2f14e04c92a49ac5c97e578e82107
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara fa98d7f2f8 fix(plat/xilinx/versal): resolve misra R10.6 in pm services
MISRA Violation: MISRA-C:2012 R.10.6
- The value of a composite expression shall not be assigned to an object
  with wider essential type.

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I67ac6b6b4b643f57e76a435345540e241c9a88b9
2021-11-30 02:00:01 -08:00
Abhyuday Godhasara 27ae531088 fix(plat/xilinx/versal): resolve misra R16.3 in pm services
MISRA Violation: MISRA-C:2012 R.16.3
- An unconditional break statement shall terminate every switch-clause

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I576b2c6eb7d1b7ef20440b9a616886ccf230b63e
2021-11-30 01:59:34 -08:00
Abhyuday Godhasara 4156719550 fix(plat/xilinx/versal): resolve misra R15.6 in pm services
MISRA Violation: MISRA-C:2012 R.15.6
- The body of an iteration-statement or a selection-statement shall be
  a compound statement

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I82e924a77ee3afeb56fa18714e94cc4f6fff5a49
2021-11-30 01:54:51 -08:00
Flora Fu 296b590206 feat(plat/mediatek/apu): add mt8195 APU clock and pll SiP call
The clock and pll of mt8195 can be locked into security access
by device apc. Add clock and pll related SiP call for the access
from Kernel space.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: I0c1f7d6c6abdd3b976492a0b776dc5b1d1f1512b
2021-11-30 09:34:05 +08:00
Flora Fu 88906b4437 feat(plat/mediatek/apu): add mt8195 APU mcu boot and stop SiP call
Add APU SiP call support for start/stop mcu.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: I3bec0b588a2884327ba645e9568c0150436afa42
2021-11-30 09:23:46 +08:00
Flora Fu 339e4924a7 feat(plat/mediatek/apu): add mt8195 APU iommap regions
Add APU iommap settings for reviser, apu_ao and
clock/pll register ranges.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: If24cf21318813babfc2c11f38891521c7106b58c
2021-11-30 09:09:31 +08:00
Jens Wiklander f58237ccd9 feat(plat/qemu): add SPMD support with SPMC at S-EL1
Adds support for SPMD with SPMC at S-EL1. A new config option SPMC_OPTEE
is added to support loading the special OP-TEE images when configured
with SPD=spmd. With or without SPMC_OPTEE. It should still be possible
to load another BL32 payload implementing a SPMC, provided that entry
point is the same as load address, that is, BL32_BASE.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: Ie61dcd1ee564688baee1b575030e63dc2bb85121
2021-11-29 13:57:57 +01:00
Manish V Badarkhe 426a111965 refactor(measured boot): rename a macro INVALID_ID to EVLOG_INVALID_ID
Renamed a macro 'INVALID_ID' to 'EVLOG_INVALID_ID' to avoid its clash
with other macro names and to show it is explicitly used for Event
Log driver.

Change-Id: Ie4c92b3cd1366d9a59cd6f43221e24734865f427
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-11-23 15:29:09 +01:00
Sandrine Bailleux 5869ebd0e8 fix(plat/arm): fix a VERBOSE trace
When the console verbosity is at maximum, fconf_populate_arm_sp()
prints the UUID and load address of each secure partition. However,
the load address has not been retrieved yet at this point, which means
all partitions show a zero load address.

Move the trace after we have retrieved the SP's load address from the
device tree to make it more meaningful.

Change-Id: I58ef7df6c9107a433f61113cafd8f0855c468d40
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2021-11-17 08:40:49 +01:00
Manish Pandey 2242773ddb Merge "fix: use correct printf format for uint64_t" into integration 2021-11-12 15:01:00 +01:00
Manish Pandey 4ef449c15a fix: use correct printf format for uint64_t
sha 4ce3e99a3 introduced printf format specifiers for fixed width
types, which uses PRI*64 instead of "ll" for 64 bit values.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ic6811cc1788c698adde0807e5f8ab5290a900a26
2021-11-12 13:02:02 +00:00
Madhukar Pappireddy 964ee4e6be fix(mt8195): use correct print format for uint64_t
sha 4ce3e99a3 introduced printf format specifiers for fixed width
types, which uses PRI*64 instead of "ll" for 64 bit variables.

Change-Id: I09a8d174694d4b170a6ef2e4a03df13adc829c00
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-11-11 12:23:36 -06:00
Madhukar Pappireddy 2e43638e95 Merge changes from topic "st_usb" into integration
* changes:
  fix(drivers/usb): add a optional ops get_other_speed_config_desc
  fix(drivers/usb): remove unnecessary cast
2021-11-09 06:03:32 +01:00
Manish Pandey 28623c102d Merge "fix: libc: use long for 64-bit types on aarch64" into integration 2021-11-08 21:34:42 +01:00
Scott Branden 4ce3e99a33 fix: libc: use long for 64-bit types on aarch64
Use long instead of long long on aarch64 for 64_t stdint types.
Introduce inttypes.h to properly support printf format specifiers for
fixed width types for such change.

Change-Id: I0bca594687a996fde0a9702d7a383055b99f10a1
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
2021-11-08 14:41:17 +00:00
André Przywara 683bb4d7bd Merge changes from topic "arm_fpga_auto" into integration
* changes:
  feat(arm_fpga): write UART baud base clock frequency into DTB
  feat(arm_fpga): query PL011 to learn system frequency
  refactor(arm_fpga): move command line code into separate function
  fix(fdt): avoid output on missing DT property
  feat(arm_fpga): add ITS autodetection
  feat(arm_fpga): determine GICR base by probing
  feat(gicv3): introduce GIC component identification
  feat(libfdt): also allow changing base address
  fix(arm_fpga): avoid re-linking from executable ELF file
2021-11-06 02:32:00 +01:00
Mark Dykes 25d7dafb2c Merge "feat(tc0): add Ivy partition" into integration 2021-11-05 21:09:38 +01:00
Yann Gautier 325376eb81 refactor(stm32mp1): use fconf.mk
Update STM32MP1 platform.mk file to include fconf.mk.

Change-Id: Idc623a832b4cdf9486835fc612803015f4f1a5f5
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-11-05 13:32:32 +01:00
Patrick Delaunay 216c1223c2 fix(drivers/usb): add a optional ops get_other_speed_config_desc
Correctly handle USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION request
in USB driver and support a different result than
USB_DESC_TYPE_CONFIGURATION with the new optional ops
get_other_speed_config_desc().

The support of this descriptor is optionnal and is only
required when high-speed capable device which can operate at its
other possible speed.

This patch allows to remove the pbuf update in usb_core_get_desc()
and solves an issue on USB re-enumeration on STM32MP15 platform
as the result of get_config_desc() is a const array.
This issue is not see on normal use-case, as the USB enumeration
is only done in ROM code and TF-A reuse the same USB descritors.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I8edcc1e45065ab4e45d48f4bc37b49120674fdb0
2021-11-05 11:28:59 +02:00
Andre Przywara 422b44fb56 feat(arm_fpga): write UART baud base clock frequency into DTB
Since we now autodetect the actual system frequency, which is also used
as the base for the UART baudrate generation, we should update the value
currently hard-coded in the DT. Otherwise Linux will reprogram the
divider using a potentially wrong base rate, which breaks the UART
output.

Find the DT node referenced by the UART node as the clock rate, and set
the "clock-frequency" property in that node to the detected system
frequency. This will let Linux reprogram the divider to the same value,
preserving the actual baudrate.

Change-Id: Ib5a936849f2198577b86509f032751d5386ed2f8
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-11-04 15:58:34 +00:00
Andre Przywara d850169c9c feat(arm_fpga): query PL011 to learn system frequency
The Arm FPGAs run in mostly one clock domain, which is used for the CPU
cores, the generic timer, and also the UART baudrate base clock. This
single clock can have different rates, to compensate for different IP
complexity. So far most images used 10 MHz, but different rates start to
appear.

To avoid patching both the arch timer frequency and UART baud base fixed
clock in the DTB manually, we would like to set the clock rate
automatically. Fortunately the SCP firmware has the actual clock rate
hard coded, and already programs the PL011 UART baud divider register
with the correct value to achieve a 38400 bps baudrate.

So read the two PL011 baudrate divider values and re-calculate the
original base clock from there, to use as the arch timer frequency. If
the arch timer DT node contains a clock-frequency property, we use that
instead, to support overriding and disabling this autodetection.

Change-Id: I9857fbb418deb4644aeb2816f1102796f9bfd3bb
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-11-04 15:58:34 +00:00
Andre Przywara 52b8f4465e refactor(arm_fpga): move command line code into separate function
The code dealing with finding the command line and inserting that into
the DTB is somewhat large, and drowns the other DT handlers in our
fpga_prepare_dtb() function.

Move that code into a separate function, to improve readability.

Change-Id: I828203c4bb248d38a2562fcb6afdefedf3179f8d
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-11-04 15:58:34 +00:00
Andre Przywara d7e39c43f2 feat(arm_fpga): add ITS autodetection
Some FPGAs come with a GIC that has an ITS block configured. Since the
ITS sits between the distributor and redistributors, we can autodetect
that, and already adjust the GICR base address.

To also make this ITS usable, add an ITS node to our base DTB, and
remove that should we not find an ITS during the scan for the
redistributor. This allows to use the same TF-A binary for FPGA images
with or without an ITS.

Change-Id: I4c0417dec7bccdbad8cbca26fa2634950fc50a66
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-11-04 15:58:34 +00:00
Andre Przywara 93b785f5ae feat(arm_fpga): determine GICR base by probing
When an Arm Ltd GIC (Arm GIC-[567]00) is instantiated with one or more
ITSes, the ITS MMIO frames appear between the distributor and
redistributor addresses. This makes the beginning of the redistributor
region dependent on the existence and number of ITSes.

To support various FPGA images, with and without ITSes, probe the
addresses in question, to learn whether they accommodate an ITS or a
redistributor. This can be safely done by looking at the PIDR[01]
registers, which contain an ID code for each region, documented in the
Arm GIC TRMs.

We try to find all ITSes instantiated, and skip either two or four 64K
frames, depending on GICv4.1 support. At some point we will find the
first redistributor; this address we then update in the DTB.

Change-Id: Iefb88c2afa989e044fe0b36b7020b56538c60b07
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-11-04 15:58:34 +00:00
Andre Przywara 4d585fe52f feat(libfdt): also allow changing base address
For platforms where we don't know the number of cores at compile time,
the size of the GIC redistributor frame is then also undetermined, since
it depends on this number of cores.
On top of this the GICR base address can also change, when an unknown
number of ITS frames (including zero) take up space between the
distributor and redistributor.

So while those two adjustments are done for independent reasons, the
code for doing so is very similar, so we should utilise the existing
fdt_adjust_gic_redist() function.

Add an (optional) gicr_base parameters to the prototype, so callers can
choose to also adjust this base address later, if needed.

Change-Id: Id39c0ba83e7401fdff1944e86950bb7121f210e8
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-11-04 15:58:34 +00:00
Andre Przywara a67ac7648c fix(arm_fpga): avoid re-linking from executable ELF file
When we build the convenience firmware package file for the Arm FPGA
boards (bl31.axf), we combine trampolines, the DTB and the actual BL31
code into one ELF file, which is more a "container with load addresses"
than an actual executable. So far ld was fine with us using bl31.elf as
an input file, but binutils 2.35 changed that and complains about
taking an *executable* ELF file as in *input* to the linker:
-----------------
aarch64-none-elf-ld.bfd: cannot use executable file 'build/arm_fpga/debug/./bl31/bl31.elf' as input to a link
-----------------

Fortunately we don't need the actual BL31 ELF file for *that* part of
the linking, so can use the just created bl31.bin binary version of it.
Actually that shrinks the file, as we needlessly included the .BSS
section in the final file before.

Using the binary works with both older and newer toolchains versions, so
let's do this unconditionally.

Change-Id: Ib7e697f8363499123f7cb860f118f182d0830768
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-11-04 15:58:34 +00:00
Olivier Deprez a19bd32ed1 feat(tc0): add Ivy partition
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: Ie9d6a77722b2350c8479ecf7b0df701428e4da73
2021-11-03 10:47:09 -05:00
Yann Gautier 306dcd6b0d fix(plat/st): remove double space
Replace double space with single space in stm32cubeprogrammer_usb.c.

Change-Id: I717b136119e85fe8e25dd540758525f995200458
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-11-03 08:50:37 +01:00
Madhukar Pappireddy 4fcbbb33c3 Merge changes from topic "st_usb" into integration
* changes:
  feat(plat/st/stm32mp1): add STM32MP_USB_PROGRAMMER target
  feat(plat/st/stm32mp1): add USB DFU support for STM32MP1
  feat(plat/st): add STM32CubeProgrammer support on USB
  feat(drivers/st/usb): add device driver for STM32MP1
  feat(plat/st): add a USB DFU stack
  feat(drivers/usb): add a USB device stack
2021-10-29 23:47:56 +02:00
Manish Pandey 6482255d5d Merge "refactor(fvp_r): remove unused files and clean up makefiles" into integration 2021-10-29 18:48:52 +02:00
Patrick Delaunay fa92fef0a0 feat(plat/st/stm32mp1): add STM32MP_USB_PROGRAMMER target
Add a support of USB as serial boot devices for STM32MP15x platform:
the FIP file is provide by STM32CubeProgrammer with the DFU protocol,
loaded in DDR at DWL_BUFFER_BASE address and then the io memmap is used.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I272c17c458ff1e9d0780f8fa22330c8a35533d19
2021-10-29 16:44:03 +02:00
Patrick Delaunay 942f6be211 feat(plat/st/stm32mp1): add USB DFU support for STM32MP1
Add the USB descriptor, the struct used for USB enumeration with
the function usb_dfu_plat_init().

The USB support is based on the usb lib and on the stm32mp1 usb driver.

The content of enumeration (the string descriptor) is identical to
ROM code to avoid the USB reset en re-enumeration needs.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I18b40649e8df83813a5a340b0eee44c9a3470e43
2021-10-29 16:43:57 +02:00
Patrick Delaunay afad5214a7 feat(plat/st): add STM32CubeProgrammer support on USB
Add a file to support over USB the STMicroelectronics tool
STM32CubeProgrammer in BL2 for STM32MP15x platform.

This tools is based on DFU stack.

Change-Id: I48a8f772cb0e9b8be24c06847f724f0470c0f917
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-10-29 16:43:49 +02:00
Patrick Delaunay efbd65fa7b feat(plat/st): add a USB DFU stack
Add a stack to support the Universal Serial Bus Device Class
Specification for Device Firmware Upgrade (USB DFU v1.1).

This stack is based on the USB device stack (USBD).

Change-Id: I8a56411d184882b6a9e3617c6dfb859086b8f353
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-10-29 16:43:36 +02:00
johpow01 88c227374c refactor(fvp_r): remove unused files and clean up makefiles
This patch removes files that are not used by TF-R as well as
removes unused generic files from the TF-R makefile.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Idb15ac295dc77fd38735bf2844efdb73e6f7c89b
2021-10-29 09:43:19 -05:00
Manish Pandey e33ca7b44a Merge changes from topic "ck/mpmm" into integration
* changes:
  docs(maintainers): add Chris Kay to AMU and MPMM
  feat(tc): enable MPMM
  feat(mpmm): add support for MPMM
  feat(amu): enable per-core AMU auxiliary counters
  docs(amu): add AMU documentation
  refactor(amu): refactor enablement and context switching
  refactor(amu): detect auxiliary counters at runtime
  refactor(amu): detect architected counters at runtime
  refactor(amu): conditionally compile auxiliary counter support
  refactor(amu): factor out register accesses
  refactor(amu)!: privatize unused AMU APIs
  refactor(amu)!: remove `PLAT_AMU_GROUP1_COUNTERS_MASK`
  build(amu): introduce `amu.mk`
  build(fconf)!: clean up source collection
  feat(fdt-wrappers): add CPU enumeration utility function
  build(fdt-wrappers): introduce FDT wrappers makefile
  build(bl2): deduplicate sources
  build(bl1): deduplicate sources
2021-10-29 14:45:28 +02:00
Manish Pandey 7ab8339064 Merge "feat(plat/arm/sgi): increase max BL2 size" into integration 2021-10-28 14:28:14 +02:00
Manish Pandey 5c548dc657 Merge "fix(plat/imx/imx8m/imx8mm): fix FTBFS on SPD=opteed" into integration 2021-10-28 11:53:38 +02:00
Manish Pandey 04deada5d1 Merge "fix(spmd): revert workaround hafnium as hypervisor" into integration 2021-10-27 12:59:19 +02:00
Olivier Deprez 3221fce842 fix(spmd): revert workaround hafnium as hypervisor
This change essentially reverts [1] by removing the BL31 workaround
forcing the dtb address when Hafnium is loaded as an Hypervisor.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/9569

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I302161d027261448113c66b7fafa9c11620b54ef
2021-10-26 18:19:47 +02:00
Chris Kay c19a82bef0 feat(tc): enable MPMM
This change enables MPMM and adds, to the TC firmware configuration
device tree, the AMU counters representing the "gears" for the
Maximum Power Mitigation Mechanism feature of the Cortex-X2,
Cortex-A710 and Cortex-A510:

- Gear 0: throttle medium and high bandwidth vector and viruses.
- Gear 1: throttle high bandwidth vector and viruses.
- Gear 2: throttle power viruses only.

This ensures these counters are enabled and context-switched as
expected.

Change-Id: I6df6e0fe3a5362861aa967a78ab7c34fc4bb8fc3
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-10-26 12:15:43 +01:00
Chris Kay e04da4c8e1 build(fconf)!: clean up source collection
Including the FCONF Makefile today automatically places the FCONF
sources into the source list of the BL1 and BL2 images. This may be
undesirable if, for instance, FCONF is only required for BL31.

This change moves the BL1 and BL2 source appends out of the common
Makefile to where they are required.

BREAKING CHANGE: FCONF is no longer added to BL1 and BL2 automatically
when the FCONF Makefile (`fconf.mk`) is included. When including this
Makefile, consider whether you need to add `${FCONF_SOURCES}` and
`${FCONF_DYN_SOURCES}` to `BL1_SOURCES` and `BL2_SOURCES`.

Change-Id: Ic028eabb7437ae95a57c5bcb7821044d31755c77
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-10-26 12:14:29 +01:00
Chris Kay 1fa05dab07 build(fdt-wrappers): introduce FDT wrappers makefile
This has been introduced to simplify dependencies on the FDT wrappers.
We generally want to avoid pulling in components on a file-by-file
basis, particularly as we are trying to draw conceptual boxes around
components in preparation for transitioning the build system to CMake,
where dependencies are modelled on libraries rather than files.

Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: Idb7ee05a9b54a8caa3e07f36e608867e20b6dcd5
2021-10-26 12:14:28 +01:00