Commit Graph

1385 Commits

Author SHA1 Message Date
Madhukar Pappireddy be1d3a1a85 Merge changes from topic "gpt-crc" into integration
* changes:
  feat(partition): verify crc while loading gpt header
  build(hikey): platform changes for verifying gpt header crc
  build(agilex): platform changes for verifying gpt header crc
  build(stratix10): platform changes for verifying gpt header crc
  build(stm32mp1): platform changes for verifying gpt header crc
2022-05-19 16:04:39 +02:00
Lucian Paul-Trifu 6c5c532051 feat(smmu): add SMMU abort transaction function
Created a function to abort all pending NS DMA transactions to
engage complete DMA protection. This call will be used by the
subsequent DRTM implementation changes.

Signed-off-by: Manish V Badarkhe <manish.badarkhe@arm.com>
Signed-off-by: Lucian Paul-Trifu <lucian.paultrifu@gmail.com>
Change-Id: I94992b54c570327d6746295073822a9c0ebdc85d
2022-05-18 22:22:41 +01:00
Rohit Ner a283d19f82 feat(partition): verify crc while loading gpt header
This change makes use of 32-bit crc for calculating gpt header crc
and compares it with the given value.

Signed-off-by: Rohit Ner <rohitner@google.com>
Change-Id: I49bca7aab2c3884881c4b7d90d31786a895290e6
2022-05-18 06:25:47 -07:00
Sandrine Bailleux 6aed554954 Merge changes from topic "rss/mboot-attest" into integration
* changes:
  docs(maintainers): add PSA, MHU, RSS comms code owners
  feat(plat/arm/fvp): enable RSS backend based measured boot
  feat(lib/psa): mock PSA APIs
  feat(drivers/measured_boot): add RSS backend
  feat(drivers/arm/rss): add RSS communication driver
  feat(lib/psa): add initial attestation API
  feat(lib/psa): add measured boot API
  feat(drivers/arm/mhu): add MHU driver
2022-05-13 16:15:35 +02:00
Tamas Ban 0442ebd2e9 feat(drivers/measured_boot): add RSS backend
Runtime Security Subsystem (RSS) provides for the host:
- Runtime service to store measurments, which were
  computed by the host during measured boot.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ia9e4e8a1fe8f01a28da1fd8c434b780f2a08f94e
2022-05-11 15:47:02 +02:00
Tamas Ban ce0c40edc9 feat(drivers/arm/rss): add RSS communication driver
This commit adds a driver to conduct the AP's communication
with the Runtime Security Subsystem (RSS).
RSS is Arm's reference implementation for the CCA HES [1].
It can be considered as a secure enclave to which, for example,
certain services can be offloaded such as initial attestation.

RSS comms driver:
 - Relies on MHU v2.x communication IP, using a generic MHU API,
 - Exposes the psa_call(..) API to the upper layers.

[1] https://developer.arm.com/documentation/DEN0096/latest

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Signed-off-by: David Vincze <david.vincze@arm.com>
Change-Id: Ib174ac7d1858834006bbaf8aad0eb31e3a3ad107
2022-05-11 15:47:02 +02:00
Tamas Ban af26d7d6f0 feat(drivers/arm/mhu): add MHU driver
The Arm Message Handling Unit (MHU) is a mailbox controller used to
communicate with other processing element(s). Adding a driver to
enable the communication:
- Adding generic MHU driver interface,
- Adding MHU_v2_x driver.

Driver supports:
 - Discovering available MHU channels,
 - Sending / receiving words over MHU channels,
 - Signaling happens over a dedicated channel.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Signed-off-by: David Vincze <david.vincze@arm.com>
Change-Id: I41a5b968f6b8319cdbdf7907d70bd8837839862e
2022-05-11 15:47:02 +02:00
Christophe Kerello 5993b9157f fix(st-spi): remove SR_BUSY bit check before sending command
Waiting for SR_BUSY bit when receiving a new command is not needed.
SR_BUSY bit is already managed in the previous command treatment.

Change-Id: I736e8488d354cb165ae765022d864cca1dbdc9ee
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
2022-05-11 10:01:33 +02:00
Christophe Kerello 55de58323e fix(st-spi): always check SR_TCF flags in stm32_qspi_wait_cmd()
Currently, SR_TCF flag is checked in case there is data, this criteria
is not correct.

SR_TCF flags is set when programmed number of bytes have been
transferred to the memory device ("bytes" comprised command and data
send to the SPI device).
So even if there is no data, we must check SR_TCF flag.

Change-Id: I99c4145e639c1b842feb3690dd78329179c18132
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
2022-05-11 10:01:17 +02:00
Manish Pandey efceb6bead Merge changes Iaf21883b,I523c5d57,I57164923 into integration
* changes:
  fix(ufs): read and write attribute based on spec
  fix(ufs): disables controller if enabled
  refactor(ufs): adds a function for fdeviceinit
2022-05-06 17:47:28 +02:00
Olivier Deprez 52a314af25 feat(smmu): configure SMMU Root interface
This change performs a basic configuration of the SMMU root registers
interface on an RME enabled system. This permits enabling GPC checks
for transactions originated from a non-secure or secure device upstream
to an SMMU. It re-uses the boot time GPT base address and configuration
programmed on the PE.
The root register file offset is platform dependent and has to be
supplied on a model command line.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I4f889be6b7afc2afb4d1d147c5c1c3ea68f32e07
2022-04-28 18:50:24 +02:00
Manish Pandey fa4751f245 Merge changes from topic "st_clk_fix" into integration
* changes:
  fix(st-clock): correct stm32_clk_parse_fdt_by_name
  fix(st-clock): check _clk_stm32_get_parent return
2022-04-27 10:35:12 +02:00
Sandrine Bailleux ab1c943981 Merge changes from topic "sb/mbedtls-2.28" into integration
* changes:
  docs(prerequisites): upgrade to mbed TLS 2.28.0
  build(deps): upgrade to mbed TLS 2.28.0
2022-04-26 07:49:06 +02:00
anans a475518337 fix(ufs): read and write attribute based on spec
according to the spec, the response to read attr comes in the
ts.attr.value field and not in the data segment.

Signed-off-by: anans <anans@google.com>
Change-Id: Iaf21883bb7e364fd7c7e4bccb33359367a0cf99d
2022-04-26 06:13:06 +02:00
anans b3f03b2013 fix(ufs): disables controller if enabled
ufs controller needs to be disabled if already enabled, without
this we noticed a crash at linkstartup during reinit

Signed-off-by: anans <anans@google.com>
Change-Id: I523c5d57c1d34f6404a6368ee3f364fbffd2e542
2022-04-26 06:12:37 +02:00
Madhukar Pappireddy 91665f49c3 Merge "fix(ufs): fix cache maintenance issues" into integration 2022-04-25 20:59:58 +02:00
Sandrine Bailleux a93084be95 build(deps): upgrade to mbed TLS 2.28.0
Upgrade to the latest and greatest 2.x release of Mbed TLS library
(i.e. v2.28.0) to take advantage of their bug fixes.

Note that the Mbed TLS project published version 3.x some time
ago. However, as this is a major release with API breakages, upgrading
to 3.x might require some more involved changes in TF-A, which we are
not ready to do. We shall upgrade to mbed TLS 3.x after the v2.7
release of TF-A.

Actually, the upgrade this time simply boils down to including the new
source code module 'constant_time.c' into the firmware.

To quote mbed TLS v2.28.0 release notes [1]:

  The mbedcrypto library includes a new source code module
  constant_time.c, containing various functions meant to resist timing
  side channel attacks. This module does not have a separate
  configuration option, and functions from this module will be
  included in the build as required.

As a matter of fact, if one is attempting to link TF-A against mbed
TLS v2.28.0 without the present patch, one gets some linker errors
due to missing symbols from this new module.

Apart from this, none of the items listed in mbed TLS release
notes [1] directly affect TF-A. Special note on the following one:

  Fix a bug in mbedtls_gcm_starts() when the bit length of the iv
  exceeds 2^32.

In TF-A, we do use mbedtls_gcm_starts() when the firmware decryption
feature is enabled with AES-GCM as the authenticated decryption
algorithm (DECRYPTION_SUPPORT=aes_gcm). However, the iv_len variable
which gets passed to mbedtls_gcm_starts() is an unsigned int, i.e. a
32-bit value which by definition is always less than 2**32. Therefore,
we are immune to this bug.

With this upgrade, the size of BL1 and BL2 binaries does not appear to
change on a standard sample test build (with trusted boot and measured
boot enabled).

[1] https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.0

Change-Id: Icd5dbf527395e9e22c8fd6b77427188bd7237fd6
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-04-25 10:23:52 +02:00
anans 50593e696e refactor(ufs): adds a function for fdeviceinit
time taken for device init varies based on different devices,
instead of waiting for 200ms - we can poll on fdevice init
until it gets cleared, similar to what linux does

Change-Id: I571649231732fde0cd6d5be89b6f14fe905fcaff
Signed-off-by: anans <anans@google.com>
2022-04-25 05:47:35 +02:00
Jorge Troncoso a8904e94f0 refactor(ufs): delete unused variables
The result variable is not being used so it's better to delete it.

Signed-off-by: Jorge Troncoso <jatron@google.com>
Change-Id: Icae614076ce1ba7cdc86267473d59a8bec682f6c
2022-04-14 14:35:12 -07:00
Varun Wadekar 6a1c17c770 feat(gic600ae_fmu): enable all GICD, PPI, ITS SMs
The following SMIDs are disabled by default.

* GICD: MBIST REQ error and GICD FMU ClkGate override
* PPI: MBIST REQ error and PPI FMU ClkGate override
* ITS: MBIST REQ error and ITS FMU ClkGate override

This patch explicitly enables them during the FMU init sequence.

Change-Id: I573e64786e3318d4cbcd07d0a1caf25f8e6e9200
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2022-04-07 15:21:40 +02:00
Varun Wadekar 3f0094c15d feat(gic600ae_fmu): disable SMID for unavailable blocks
This patch updates the gic600_fmu_init function to disable all safety
mechanisms for a block ID that is not present on the platform. All
safety mechanisms for GIC-600AE are enabled by default and should be
disabled for blocks that are not present on the platform to avoid
false positive RAS errors.

Change-Id: I52dc3bee9a8b49fd2e51d7ed851fdc803a48e6e3
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2022-04-07 10:00:23 +02:00
Varun Wadekar 308dce4067 feat(gic600ae_fmu): introduce support for RAS error handling
The GIC-600AE uses a range of RAS features for all RAMs, which include
SECDED, ECC, and Scrub, software and bus error reporting. The GIC makes
all necessary information available to software through Armv8.2 RAS
architecture compliant register space.

This patch introduces support to probe the FMU_ERRGSR register to find
the right error record. Once the correct record is identified, the
"handler" function queries the FMU_ERR<m>STATUS register to further
identify the block ID, safety mechanism and the architecturally defined
primary error code. The description of the error is displayed on the
console to simplify debug.

Change-Id: I7e543664b74457afee2da250549f4c3d9beb1a03
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2022-04-06 08:14:39 +01:00
Yann Gautier 7417cda6ae fix(st-clock): correct stm32_clk_parse_fdt_by_name
The fdt_getprop() function sets the length to -1 if the property is not
found. We should then not use it later in stm32_clk_parse_fdt_by_name()
in that case. Directly set *nb to 0U and return 0 if the property is not
found.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I19c5c953f392cdc768e0b1f3f240fc99a73a049c
2022-04-05 17:05:55 +02:00
Yann Gautier b8eab512bf fix(st-clock): check _clk_stm32_get_parent return
This issue was found by Coverity (CID 376885). The _clk_stm32_get_parent()
return shouldn't be negative. Return the error in this case.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I91eff7e99fcdac9a258100b163fd9b040a9bd2c0
2022-04-05 17:05:40 +02:00
Joanna Farley f78cb61a11 Merge changes I84e257b3,I1317e482 into integration
* changes:
  fix(layerscape): fix coverity issue
  fix(nxp-ddr): fix coverity issue
2022-03-30 09:38:52 +02:00
Joanna Farley e24ce2c1c8 Merge "fix(scmi): use same type for message_id" into integration 2022-03-29 17:01:48 +02:00
Jiafei Pan f713e5954e fix(nxp-ddr): fix coverity issue
Check return value of mmap_add_dynamic_region().

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: I1317e4822f3da329185d54005f08047872b5cdce
2022-03-29 14:43:12 +08:00
Joanna Farley 2ea18c7df3 Merge changes from topics "ls1088a", "ls1088a-prepare" into integration
* changes:
  docs(layerscape): add ls1088a soc and board support
  feat(ls1088aqds): add ls1088aqds board support
  feat(ls1088ardb): add ls1088ardb board support
  feat(ls1088a): add new SoC platform ls1088a
  build(changelog): add new scopes for ls1088a
  feat(bl2): add support to separate no-loadable sections
  refactor(layerscape): refine comparison of inerconnection
  feat(layerscape): add soc helper macro definition for chassis 3
  feat(nxp-gic): add some macros definition for gicv3
  feat(layerscape): add CHASSIS 3 support for tbbr
  feat(layerscape): define more chassis 3 hardware address
  feat(nxp-crypto): add chassis 3 support
  feat(nxp-dcfg): add Chassis 3 support
  feat(lx2): enable DDR erratas for lx2 platforms
  feat(layerscape): print DDR errata information
  feat(nxp-ddr): add workaround for errata A050958
  feat(layerscape): add new soc errata a010539 support
  feat(layerscape): add new soc errata a009660 support
  feat(nxp-ddr): add rawcard 1F support
  fix(layerscape): fix build issue of mmap_add_ddr_region_dynamically
  fix(nxp-tools): fix create_pbl print log
  build(changelog): add new scopes for NXP driver
2022-03-28 17:40:59 +02:00
Sebastien Pasdeloup aae7c96de6 fix(fwu): rename is_fwu_initialized
The variable is_fwu_initialized was initialized after
plat_fwu_set_images_source() is called.
But some functions called by plat_fwu_set_images_source() for STM32MP1
implementation expect is_fwu_initialized is set to true with asserts.
Rename is_fwu_initialized to is_metadata_initialized, and set it before
plat_fwu_set_images_source() is called.

Change-Id: I17c6ee6293dfa55385b0c859db442647f0bebaed
Signed-off-by: Sebastien Pasdeloup <sebastien.pasdeloup-ext@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2022-03-28 09:10:11 +02:00
Biwen Li df02aeeec6 feat(nxp-dcfg): add Chassis 3 support
Add support for Chassis 3.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: I85cf68d4f1db81bf344e34dce13799ae173aa23a
2022-03-27 23:24:24 +08:00
Pankit Garg 291adf521a feat(nxp-ddr): add workaround for errata A050958
Set the receiver gain to max value to recover
cold temp marginality issue for phy-gen2

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: If639fa3ed404cf6e1b8abcc2b7137db1fdd0b2c2
2022-03-27 23:24:24 +08:00
Maninder Singh f2de48cb14 feat(nxp-ddr): add rawcard 1F support
New UDIMM 18ADF2G72AZ-2G6E1 has raw card ID = 0x1F

Also, changing mask for raw card ID from - 0x8f -> 0x9f

Changing the mask need the raw card to changed from 0x0f -> 0x1f

Signed-off-by: Maninder Singh <maninder.singh_1@nxp.com>
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: Iee8e732ebc5e09cdca6917be608f1597c7edd9f9
2022-03-27 23:24:24 +08:00
Manish Pandey 2ff6a49ea6 Merge changes from topic "stm32mp13" into integration
* changes:
  feat(stm32mp1): select platform compilation either by flag or DT
  feat(stm32mp1-fdts): add support for STM32MP13 DK board
  feat(stm32mp1-fdts): add DDR support for STM32MP13
  feat(stm32mp1-fdts): add st-io_policies node for STM32MP13
  feat(stm32mp1): updates for STM32MP13 device tree compilation
  feat(stm32mp1-fdts): add DT files for STM32MP13
  feat(dt-bindings): add TZC400 bindings for STM32MP13
  feat(stm32mp1): add "Boot mode" management for STM32MP13
  feat(stm32mp1): manage HSLV on STM32MP13
  feat(stm32mp1): add sdmmc compatible in platform define
  feat(st-sdmmc2): allow compatible to be defined in platform code
  feat(stm32mp1): update IO compensation on STM32MP13
  feat(stm32mp1): call pmic_voltages_init() in platform init
  feat(st-pmic): add pmic_voltages_init() function
  feat(stm32mp1): update CFG0 OTP for STM32MP13
  feat(stm32mp1): usb descriptor update for STM32MP13
  feat(st-clock): add clock driver for STM32MP13
  feat(dt-bindings): add bindings for STM32MP13
  feat(stm32mp1): get CPU info from SYSCFG on STM32MP13
  feat(stm32mp1): use only one filter for TZC400 on STM32MP13
  feat(stm32mp1): add a second fixed regulator
  feat(stm32mp1): adaptations for STM32MP13 image header
  feat(stm32mp1): update boot API for header v2.0
  feat(stm32mp1): update IP addresses for STM32MP13
  feat(stm32mp1): add part numbers for STM32MP13
  feat(stm32mp1): chip rev. Z is 0x1001 on STM32MP13
  feat(stm32mp1): update BACKUP_BOOT_MODE for STM32MP13
  feat(stm32mp1): stm32mp_is_single_core() for STM32MP13
  feat(stm32mp1): remove unsupported features on STM32MP13
  feat(stm32mp1): update memory mapping for STM32MP13
  feat(stm32mp1): introduce new flag for STM32MP13
  feat(st): update stm32image tool for header v2
2022-03-22 16:42:16 +01:00
Yann Gautier 6481a8f1e0 feat(st-sdmmc2): allow compatible to be defined in platform code
Put DT_SDMMC2_COMPAT under #ifndef. Keep the default value if it is not
defined in platform code.

Change-Id: I611baaf1fc622d33e655ee2c78d9c287baaa6a67
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2022-03-22 09:09:23 +01:00
Yann Gautier 5278ec3faf feat(st-pmic): add pmic_voltages_init() function
This new function pmic_voltages_init() is used to set the minimum value
for STM32MP13 VDDCPU and VDDCORE regulators. This value is retrieved
from device tree.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ibbe237cb5dccc1fddf92e07ffd3955048ff82075
2022-03-22 09:09:23 +01:00
Gabriel Fernandez 9be88e75c1 feat(st-clock): add clock driver for STM32MP13
Add new clock driver for STM32MP13. Split the include file to manage
either STM32MP13 or STM32MP15.

Change-Id: Ia568cd12b1d5538809204f0fd2224d51e5d1e985
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
2022-03-22 09:09:23 +01:00
Yann Gautier 111a384c90 feat(stm32mp1): remove unsupported features on STM32MP13
* GPIO: On STM32MP13, there are no banks GPIOJ, GPIOK and GPIOZ.
* STM32MP13 is a single Cortex-A7 CPU: remove reset from MPU1
  and reset from MCU traces
* There is no MCU on STM32MP13. Put MCU security management
  under STM32MP15 flag.
* The authentication feature is not supported yet on STM32MP13,
  put the code under SPM32MP15 flag.
* On STM32MP13, the monotonic counter is managed in ROM code, keep
  the monotonic counter update just for STM32MP15.
* SYSCFG: put registers not present on STM32MP13 under STM32MP15
  flag, as the code that manages them.
* PMIC: use ldo3 during DDR configuration only for STM32MP15
* Reset UART pins on USB boot is no more required.

Change-Id: Iceba59484a9bb02828fe7e99f3ecafe69c837bc7
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
2022-03-21 10:53:55 +01:00
Schspa Shi 2355ebff6f fix(scmi): use same type for message_id
The code declares different types of parameters.

static bool message_id_is_supported(unsigned int message_id);
static bool message_id_is_supported(size_t message_id)
{
	...
}

Signed-off-by: Schspa Shi <schspa@gmail.com>
Change-Id: I7435d3b9309ea5fb5f8e3daa7173e09322184422
2022-03-17 12:48:18 +08:00
anans 0956319b58 fix(ufs): move nutrs assignment to ufs_init
nutrs is set in ufs_enum (used by get_empty_slot), this will not
be assigned if UFS_FLAGS_SKIPINIT is set in flags during init and
might end up crashing read/write commands

Change-Id: I1517b69c56741fd5bf4ef0ebc1fc8738746233d7
Signed-off-by: anans <anans@google.com>
2022-03-16 09:12:44 +05:30
Channagoud kadabi 38a5ecb756 fix(ufs): fix cache maintenance issues
Fix software cache maintenance issues that can happen when
cpu prefetches data before DMA operations are complete.
This change fixes two cases one for ufs_read_blocks and
other for ufs_check_resp, in both cases invalidation of
buffer was done before the DMA operation completed.
This caused cpu prefetcher to bring data into cache
before DMA completed and caused UFS read failures.
The changes also removes unwanted cache operations to
local variable utrd which is not consumed by UFS host
controller and zeroing out buffer in ufs_read_capacity.

Change-Id: I9a288eb19d6705f6fa8bdb0b817a6411235fd8b6
Signed-off-by: Channagoud kadabi <kadabi@google.com>
2022-03-15 13:09:52 -07:00
anans 6e16f7f09c refactor(ufs): adds a function for sending command
new function for sending commands and reuses that function in the
driver, this can also be used to have retries for specific
commands in the future

Signed-off-by: anans <anans@google.com>
Change-Id: Ie01f36ff8e2df072db4d97929d293b80ed24f04b
2022-03-15 09:13:20 +05:30
Yann Gautier 57e6018305 fix(st-pmic): add static const to pmic_ops
The static was found by sparse tool:
drivers/st/pmic/stm32mp_pmic.c:456:18: warning: symbol 'pmic_ops'
 was not declared. Should it be static?
The const was also missing.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ibb5cfaf67ac980bf0af27712a95dbef05b617c25
2022-03-08 13:18:09 +01:00
Bipin Ravi af68314ddc Merge "refactor(mbedtls): allow platform to specify their config file" into integration 2022-03-07 21:40:26 +01:00
Madhukar Pappireddy c507b06007 Merge "fix(st-clock): initialize pllcfg table" into integration 2022-03-06 01:24:17 +01:00
Yann Gautier 1f60d1bd33 feat(st-uart): manage oversampling by 8
UART oversampling by 8 allows higher baud rates for UART. This is
required when (UART freq / baudrate) <= 16. In this case the OVER8 bit
needs to be enabled in CR1 register. And the BRR register management is
different:
USARTDIV = (2 * UART freq / baudrate) (with div round nearest)
BRR[15:4] = USARTDIV[15:4]
BRR[3] = 0
BRR[2:0] = USARTDIV[3:0] >> 1

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Ia3fbeeb73a36a4dc485c7ba428c531e65b6f6c09
2022-03-04 14:55:18 +01:00
Yann Gautier af7775ab53 fix(st-uart): correctly fill BRR register
To get the nearest divisor for BRR register, we use:
Divisor =  (Uart clock + (baudrate / 2)) / baudrate
But lsl was wrongly used instead of lsr to have the division by 2.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Iedcc3ccdb4cf8268012e82a66df2a9ec48fc1d79
2022-03-04 14:55:18 +01:00
Yann Gautier 175758b277 fix(st-clock): initialize pllcfg table
The issue was found by Coverity:
CID 376582:    (UNINIT)
    Using uninitialized value "*pllcfg[_PLL4]" when calling
    "stm32mp1_check_pll_conf".
CID 376582:    (UNINIT)
    Using uninitialized value "*pllcfg[_PLL3]" when calling
    "stm32mp1_check_pll_conf".

Check PLL configs are valid before using pllcfg.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I49de849eaf451d0c165a8eb8555112a0a4140bbc
2022-03-04 13:48:53 +01:00
Manish V Badarkhe 033f61370a refactor(mbedtls): allow platform to specify their config file
Common mbedTLS implementation include the fixed configuration
file of mbedTLS and that does not gives flexilibility to the
platform to include their own mbedTLS configuration.
Hence changes are done so that platform can include their own
mbedTLS configuration file.

Signed-off-by: Lucian Paul-Trifu <lucian.paul-trifu@arm.com>
Signed-off-by: Manish V Badarkhe <manish.badarkhe@arm.com>
Change-Id: I04546589f67299e26b0a6a6e151cdf1fdb302607
2022-03-01 19:08:11 +01:00
Channa Kadabi 2ef6b8d378 fix(ufs): don't zero out buf before ufs read
ufs_read_blocks always zeros out the buffer before passing
to UFS for DMA. We don't need to zero out buf before reading
from UFS storage, this change remove the memset in ufs_read_blocks.

Signed-off-by: Channa Kadabi <kadabi@google.com>
Change-Id: I8029a7ea07fbd8cce29b383c80a3cfc782c5b7ec
2022-03-01 08:28:30 -08:00
Yann Gautier 9fa9a0c55c fix(st-clock): print enums as unsigned
With gcc-11, the -Wformat-signedness warning complains about enum values
that should be printed as unsigned values. Change %d to %u for several
lines in the clock driver.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ia2d24e6feef5e852e0a6bfaa1286fe605f9a16b7
2022-02-28 11:36:00 +01:00