]> git.baikalelectronics.ru Git - arm-tf.git/log
arm-tf.git
3 years agofeat(corstone1000): made changes to accommodate 3MB for optee
Arpita S.K [Wed, 13 Oct 2021 09:19:26 +0000 (14:49 +0530)]
feat(corstone1000): made changes to accommodate 3MB for optee

These changes are required to accommodate 3MB for OP-TEE and this
is required for SP's part of optee
Added size macro's for better readability of the code
Moved uboot execution memory from CVM to DDR

Change-Id: I16657c6e336fe7c0fffdee1617d10af8a2c76732
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Arpita S.K <Arpita.S.K@arm.com>
3 years agobuild(corstone1000): rename diphda to corstone1000
Vishnu Banavath [Wed, 19 Jan 2022 18:43:12 +0000 (18:43 +0000)]
build(corstone1000): rename diphda to corstone1000

diphda platform is now being renamed to corstone1000.
These changes are to replace all the instances and traces
of diphda  corstone1000.

Change-Id: I330f3a112d232b99b4721b6bf0236253b068dbba
Signed-off-by: Arpita S.K <Arpita.S.K@arm.com>
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
3 years agoMerge changes from topic "snprintf-fix" into integration
Joanna Farley [Fri, 11 Feb 2022 17:51:25 +0000 (18:51 +0100)]
Merge changes from topic "snprintf-fix" into integration

* changes:
  fix(libc): snprintf: include stdint.h
  fix(libc): limit snprintf radix value
  fix(libc): fix snprintf corner cases

3 years agoMerge "refactor(measured-boot): cleanup Event Log makefile" into integration
Manish Pandey [Fri, 11 Feb 2022 16:57:26 +0000 (17:57 +0100)]
Merge "refactor(measured-boot): cleanup Event Log makefile" into integration

3 years agoMerge "feat(common): add SZ_* macros" into integration
Madhukar Pappireddy [Fri, 11 Feb 2022 16:19:55 +0000 (17:19 +0100)]
Merge "feat(common): add SZ_* macros" into integration

3 years agoMerge "refactor(stm32mp1): update tamp_bkpr return type" into integration
Madhukar Pappireddy [Fri, 11 Feb 2022 16:05:23 +0000 (17:05 +0100)]
Merge "refactor(stm32mp1): update tamp_bkpr return type" into integration

3 years agoMerge "docs(contribution-guidelines): updated the build configuration section" into...
Manish Pandey [Fri, 11 Feb 2022 14:37:04 +0000 (15:37 +0100)]
Merge "docs(contribution-guidelines): updated the build configuration section" into integration

3 years agodocs(contribution-guidelines): updated the build configuration section
Jayanth Dodderi Chidanand [Tue, 8 Feb 2022 14:18:24 +0000 (14:18 +0000)]
docs(contribution-guidelines): updated the build configuration section

Added a couple of sub-sections (Coverity Scan and Test Configuration)
under "Add build configuration" to update the patch owners on the
sections they need to be aware of while introducing new source files.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I84adb182f9633863aac864df43578249c2269c1e

3 years agorefactor(stm32mp1): update tamp_bkpr return type
Nicolas Toromanoff [Wed, 9 Feb 2022 11:26:31 +0000 (12:26 +0100)]
refactor(stm32mp1): update tamp_bkpr return type

tamp_bkpr() returns a register address. So use uintptr_t instead of
uin32_t.

Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com>
Change-Id: I5eddfa525465313dadfec18d128248a968ba74e2

3 years agofix(libc): snprintf: include stdint.h
Andre Przywara [Thu, 27 Jan 2022 17:47:55 +0000 (17:47 +0000)]
fix(libc): snprintf: include stdint.h

The snprintf code uses the uintptr_t type, which is defined in stdint.h.
We do not include this header explicitly, but get the definition
indirectly through some other header doing so.

However this breaks when snprintf is compiled in isolation (for instance
for unit-testing), so let's add this #include to make things right.

Change-Id: I1299767ee482f5cf1af30c4df2e8f7e596969b41
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agofix(libc): limit snprintf radix value
Andre Przywara [Mon, 24 Jan 2022 18:16:10 +0000 (18:16 +0000)]
fix(libc): limit snprintf radix value

In our unsigned_num_print() function we first print the integer into a
local buffer, then put this through alignment and padding and output the
result. For this we use a local buffer, sized by the maximum possible
length of the largest possible number.

However this assumes that the radix is not smaller than 10, which is
indeed the smallest value we pass into this static function at the
moment. To prevent accidents in the future, should we add support for
other radices, add an assert to enforce our assumption.

Unfortunately this cannot be a static assert (CASSERT), since the
compiler is not smart enough to see that the argument is always coming
from a literal.

Change-Id: Ic204462600d9f4c281d899cf9f2c698a0a33a874
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agoMerge "feat(spe): add support for FEAT_SPEv1p2" into integration
Madhukar Pappireddy [Thu, 10 Feb 2022 15:11:10 +0000 (16:11 +0100)]
Merge "feat(spe): add support for FEAT_SPEv1p2" into integration

3 years agofeat(spe): add support for FEAT_SPEv1p2
Manish V Badarkhe [Fri, 31 Dec 2021 16:08:51 +0000 (16:08 +0000)]
feat(spe): add support for FEAT_SPEv1p2

Allow access to PMSNEVFR_EL1 register at NS-EL1 or NS-EL2 when
FEAT_SPEv1p2 is implemented.

Change-Id: I44b1de93526dbe9c11fd061d876371a6c0e6fa9c
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
3 years agoMerge changes from topic "db/exception_pstate" into integration
Manish Pandey [Wed, 9 Feb 2022 14:05:47 +0000 (15:05 +0100)]
Merge changes from topic "db/exception_pstate" into integration

* changes:
  test(el3-runtime): dit is retained on world switch
  fix(el3-runtime): set unset pstate bits to default
  refactor(el3-runtime): add prepare_el3_entry func

3 years agofeat(common): add SZ_* macros
Yann Gautier [Tue, 8 Feb 2022 09:21:58 +0000 (10:21 +0100)]
feat(common): add SZ_* macros

Add the SZ_* macros from 32 to 2G.
This allows removing some defines in raw NAND driver
and STM32MP1 boot device selection code.

Change-Id: I3c4d4959b0f43e785eeb37a43d03b2906b7fcfbc
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Arpita S.K <Arpita.S.K@arm.com>
3 years agofix(libc): fix snprintf corner cases
Andre Przywara [Tue, 21 Dec 2021 12:35:54 +0000 (12:35 +0000)]
fix(libc): fix snprintf corner cases

The number formatting routine in snprintf was trying to be clever with
the buffer handling, but tripped over its own feet: snprintf() users
expect output to be emitted, even if not everything fits into the
buffer. The current code gives up completely when the buffer is too
small.

Fix those issues and simplify the code on the way, by consequently using
the CHECK_AND_PUT_CHAR() macro, which both checks for the buffer size
correctly, but also keeps track of the number of should-be-printed
characters for the return value.

Change-Id: Ifd2b03b9a73f9279abed53081a2d88720ecbdbc1
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agoMerge "fix(ufs): don't zero out the write buffer" into integration
Madhukar Pappireddy [Mon, 7 Feb 2022 15:41:38 +0000 (16:41 +0100)]
Merge "fix(ufs): don't zero out the write buffer" into integration

3 years agoMerge "feat(rdn2): add board support for rdn2cfg2 variant" into integration
Madhukar Pappireddy [Mon, 7 Feb 2022 15:24:39 +0000 (16:24 +0100)]
Merge "feat(rdn2): add board support for rdn2cfg2 variant" into integration

3 years agoMerge "feat(st): update the security based on new compatible" into integration
Madhukar Pappireddy [Fri, 4 Feb 2022 15:57:15 +0000 (16:57 +0100)]
Merge "feat(st): update the security based on new compatible" into integration

3 years agoMerge "feat(st): add early console in BL2" into integration
Madhukar Pappireddy [Fri, 4 Feb 2022 15:56:32 +0000 (16:56 +0100)]
Merge "feat(st): add early console in BL2" into integration

3 years agofeat(rdn2): add board support for rdn2cfg2 variant
Aditya Angadi [Mon, 9 Aug 2021 04:08:58 +0000 (09:38 +0530)]
feat(rdn2): add board support for rdn2cfg2 variant

Add board support for variant 2 of RD-N2 platform which is a four chip
variant with 4 cores on each chip. The "CSS_SGI_PLATFORM_VARIANT" value
is 2 for multi-chip variant. The "CSS_SGI_CHIP_COUNT_MACRO" can be in
the range [1, 4] for multi-chip variant.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Change-Id: I6412106e80e2f17704c796226c2ee9fe808705ba

3 years agofix(ufs): don't zero out the write buffer
Jorge Troncoso [Thu, 3 Feb 2022 23:52:59 +0000 (15:52 -0800)]
fix(ufs): don't zero out the write buffer

Previously ufs_write_blocks was memsetting the write buffer before
calling ufs_prepare_cmd, causing zeros to be written to UFS. This change
deletes the memset call so the original buffer contents get written to
UFS.

Signed-off-by: Jorge Troncoso <jatron@google.com>
Change-Id: I3299f11b30e6d7d409408ce11a6759c88607ee18

3 years agoMerge changes from topic "msm8916" into integration
Manish Pandey [Thu, 3 Feb 2022 21:59:34 +0000 (22:59 +0100)]
Merge changes from topic "msm8916" into integration

* changes:
  feat(msm8916): allow booting secondary CPU cores
  feat(msm8916): setup hardware for non-secure world
  feat(gic): allow overriding GICD_PIDR2_GICV2 address
  feat(msm8916): initial platform port
  docs(msm8916): new port for Qualcomm Snapdragon 410

3 years agofeat(msm8916): allow booting secondary CPU cores
Stephan Gerhold [Wed, 1 Dec 2021 19:04:44 +0000 (20:04 +0100)]
feat(msm8916): allow booting secondary CPU cores

Add support for the PSCI CPU_ON call to allow booting secondary CPU
cores. On cold boot they need to be booted with a special register
sequence. Also, the "boot remapper" needs to be configured to point to
the BL31_BASE, so the CPUs actually start executing BL31 after reset.

Change-Id: I406c508070ccb046bfdefd51554f12e1db671fd4
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agofeat(msm8916): setup hardware for non-secure world
Stephan Gerhold [Wed, 1 Dec 2021 19:03:33 +0000 (20:03 +0100)]
feat(msm8916): setup hardware for non-secure world

Booting e.g. Linux in the non-secure world does not work with the
msm8916 port yet because essential hardware is not made available to
the non-secure world. Add more platform initialization to:

  - Initialize the GICv2 and mark secure interrupts.
    Only secure SGIs/PPIs so far. Override the GICD_PIDR2_GICV2
    register address in platform_def.h to avoid a failing assert()
    because of a (hardware) mistake in Qualcomm's GICv2 implementation.

  - Make a timer frame available to the non-secure world.
    The "Qualcomm Timer" (QTMR) implements the ARM generic timer
    specification, so the standard defines (CNTACR_BASE etc)
    can be used.

  - Make parts of the "APCS" register region available to the
    non-secure world, e.g. for CPU frequency control implemented
    in Linux.

  - Initialize a platform-specific register to route all SMMU context
    bank interrupts to the non-secure interrupt pin, since all control
    of the SMMUs is left up to the non-secure world for now.

Change-Id: Icf676437b8e329dead06658e177107dfd0ba4f9d
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agofeat(gic): allow overriding GICD_PIDR2_GICV2 address
Stephan Gerhold [Wed, 1 Dec 2021 19:02:22 +0000 (20:02 +0100)]
feat(gic): allow overriding GICD_PIDR2_GICV2 address

Older Qualcomm SoCs seem to have a custom Qualcomm implementation of
the GICv2 specification. It's mostly compliant but unfortunately it
looks like a mistake was made with the GICD_PIDR registers. PIDR2 is
defined to be at offset 0xFE8, but the Qualcomm implementation has it
at 0xFD8.

It looks like the entire PIDR0-3/4-7 block is swapped compared to the
ARM implementation: PIDR0 starts at 0xFD0 (instead of 0xFE0)
and PIDR4 starts at 0xFE0 (instead of 0xFD0).

Actually this only breaks a single assert in gicv2_main.c that checks
the GIC version: assert((gic_version == ARCH_REV_GICV2) ...
In release mode everything seems to work correctly.

To keep the code generic, allow affected platforms to override the
GICD_PIDR2_GICV2 register address in platform_def.h. Since this header
is typically included very early (e.g. from assert.h), add an #ifndef
so the definitions from platform_def.h takes priority.

Change-Id: I2929a8c1726f8d751bc28796567eb30b81eca2fe
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agotest(el3-runtime): dit is retained on world switch
Daniel Boulby [Fri, 22 Oct 2021 10:37:34 +0000 (11:37 +0100)]
test(el3-runtime): dit is retained on world switch

Add tsp service to check the value of the PSTATE DIT bit is as
expected and toggle it's value. This is used to ensure that
the DIT bit is maintained during a switch from the Normal to
Secure worlds and back.

Change-Id: I4e8bdfa6530e5e75925c0079d4fa2795133c5105
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
3 years agofix(el3-runtime): set unset pstate bits to default
Daniel Boulby [Tue, 25 May 2021 17:09:34 +0000 (18:09 +0100)]
fix(el3-runtime): set unset pstate bits to default

During a transition to a higher EL some of the PSTATE bits are not set
by hardware, this means that their state may be leaked from lower ELs.
This patch sets those bits to a default value upon entry to EL3.

This patch was tested using a debugger to check the PSTATE values
are correctly set. As well as adding a test in the next patch to
ensure the PSTATE in lower ELs is still maintained after this change.

Change-Id: Ie546acbca7b9aa3c86bd68185edded91b2a64ae5
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
3 years agofeat(msm8916): initial platform port
Stephan Gerhold [Wed, 1 Dec 2021 19:01:11 +0000 (20:01 +0100)]
feat(msm8916): initial platform port

Introduce the bare mimimum base of the msm8916 BL31 port. This is
pretty much just a standard platform "skeleton" with CPU/memory
initialization and an UART driver. This allows booting into
e.g. U-Boot with working UART output.

Note that the plat/qti/msm8916 port is completely separate and does not
make use of anything in plat/qti/common at the moment. The main reason
for that is that plat/qti/common is heavily focused around having a
binary "qtiseclib" component, while the MSM8916 port is fully
open-source (and therefore somewhat limited to publicly documented
functionality).

In the future it might be possible to re-use some of the open-source
parts in plat/qti/common (e.g. spmi_arb.c or pm_ps_hold.c) but it's
not strictly required for the basic functionality supported so far.

Change-Id: I7b4375df0f947b3bd1e55b0b52b21edb6e6d175b
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agodocs(msm8916): new port for Qualcomm Snapdragon 410
Stephan Gerhold [Wed, 1 Dec 2021 19:00:00 +0000 (20:00 +0100)]
docs(msm8916): new port for Qualcomm Snapdragon 410

The Qualcomm Snapdragon 410 is Qualcomm's first 64-bit SoC, released
in 2014 with four ARM Cortex-A53 cores. There are differents variants
(MSM8916, APQ8016(E), ...) that are all very similar. A popular device
based on APQ8016E is the DragonBoard 410c single-board computer,
but the SoC is also used in various mid-range smartphones/tablets.

This commit adds documentation for a minimal, community-maintained port
of TF-A/BL31 for MSM8916. The actual platform port is added in the
following four separate small commits to simplify the review process.
The code is primarily based on the information from the public
Snapdragon 410E Technical Reference Manual [1], combined with a lot of
trial and error to actually make it work.

Note that this port is a pure community effort without any
commercial interests and is not related to Qualcomm in any way.
The main motivation for this port is to have a minimal, updatable
firmware since this old chip does not receive many updates anymore from
Qualcomm. It works quite well for many use cases so I am willing to
maintain it as a "code owner". I have also added Nikita Travkin as
second code owner to help with reviews.

The main limitation so far is the lack of memory protection for TF-A.
This is similar to the ports for the Raspberry Pi but in this case not
a lack of hardware support but rather a lack of documentation. However,
this does not limit the usefulness of the port when used as a minimal
PSCI implementation.

[1]: https://developer.qualcomm.com/download/sd410/snapdragon-410e-technical-reference-manual.pdf

Change-Id: I676adf86061638cfc2f3ae8615470d145e84f172
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agofeat(st): update the security based on new compatible
Lionel Debieve [Tue, 15 Dec 2020 09:35:59 +0000 (10:35 +0100)]
feat(st): update the security based on new compatible

From the new binding, the RCC become secured based on the new
compatible. This must be done only from the secure OS initialisation.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Change-Id: I7f0a62f22bfcca638ddaefc9563df00f89f01653

3 years agofeat(st): add early console in BL2
Yann Gautier [Mon, 18 Oct 2021 08:55:23 +0000 (10:55 +0200)]
feat(st): add early console in BL2

Add an early UART console to ease debug before UART is fully configured.
This is done under flag STM32MP_EARLY_CONSOLE in the first STM32MP1
platform function called (bl2_el3_early_platform_setup()). It uses the
parameters defined for crash console: STM32MP_DEBUG_USART* macros.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Id6be62368723a0499e97bbf56fb52c166fcbdfad

3 years agoMerge changes from topic "st-security-update" into integration
Manish Pandey [Wed, 2 Feb 2022 21:17:12 +0000 (22:17 +0100)]
Merge changes from topic "st-security-update" into integration

* changes:
  feat(stm32mp1): warn when debug enabled on secure chip
  fix(stm32mp1): rework switch/case for MISRA
  feat(st): disable authentication based on part_number

3 years agoMerge changes I5d7e3cf3,Ie81f2fc5,If869ac93,I2cf2badf,Ic291eb13 into integration
Manish Pandey [Wed, 2 Feb 2022 17:41:08 +0000 (18:41 +0100)]
Merge changes I5d7e3cf3,Ie81f2fc5,If869ac93,I2cf2badf,Ic291eb13 into integration

* changes:
  fix(sptool): add leading zeroes in UUID conversion
  feat(tc): enable SMMU for DPU
  feat(tc): add reserved memory region for Gralloc
  feat(tc): enable GPU
  fix(tc): remove the bootargs node

3 years agoMerge changes from topic "st-gpio-update" into integration
Madhukar Pappireddy [Wed, 2 Feb 2022 16:29:52 +0000 (17:29 +0100)]
Merge changes from topic "st-gpio-update" into integration

* changes:
  feat(st-gpio): do not apply secure config in BL2
  feat(st): get pin_count from the gpio-ranges property
  feat(st-gpio): allow to set a gpio in output mode
  refactor(st-gpio): code improvements

3 years agorefactor(measured-boot): cleanup Event Log makefile
Manish V Badarkhe [Tue, 18 Jan 2022 22:40:17 +0000 (22:40 +0000)]
refactor(measured-boot): cleanup Event Log makefile

The Event Log sources are added to the source-list of BL1 and BL2
images in the Event Log Makefile. It doesn't seem correct since
some platforms only compile Event Log sources for BL2.
Hence, moved compilation decision of Event Log sources to the
platform makefile.

Change-Id: I1cb96e24d6bea5e091d08167f3d1470d22b461cc
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
3 years agofix(sptool): add leading zeroes in UUID conversion
Anders Dellien [Fri, 7 Jan 2022 13:26:29 +0000 (13:26 +0000)]
fix(sptool): add leading zeroes in UUID conversion

The UUID conversion drops leading zeroes, so make sure that
all hex strings always are 8 digits long

Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Change-Id: I5d7e3cf3b53403a02bf551f35f17dbdb96dec8ae

3 years agoMerge "fix(stm32mp1): remove interrupt_provider warning for dtc" into integration
Manish Pandey [Wed, 2 Feb 2022 11:19:53 +0000 (12:19 +0100)]
Merge "fix(stm32mp1): remove interrupt_provider warning for dtc" into integration

3 years agofeat(st-gpio): do not apply secure config in BL2
Yann Gautier [Tue, 11 Aug 2020 12:21:41 +0000 (14:21 +0200)]
feat(st-gpio): do not apply secure config in BL2

At boot, the devices under ETZPC control are secured, so should be
their GPIOs. As securable GPIOs are secured by default, keep the reset
values in BL2.

Change-Id: I9e560d936f8e8fda0f96f6299bb0c3b35ba9b71f
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofeat(st): get pin_count from the gpio-ranges property
Fabien Dessenne [Tue, 21 Sep 2021 09:32:30 +0000 (11:32 +0200)]
feat(st): get pin_count from the gpio-ranges property

The "ngpios" property is deprecated and may be removed.
Use the "gpio-ranges" property where the last parameter of that
property is the number of available pins within that range.

Signed-off-by: Fabien Dessenne <fabien.dessenne@foss.st.com>
Change-Id: I28295412c7cb1246fc753cff0d447b6fdcdc4c0f

3 years agofeat(st-gpio): allow to set a gpio in output mode
Fabien Dessenne [Tue, 21 Sep 2021 12:18:34 +0000 (14:18 +0200)]
feat(st-gpio): allow to set a gpio in output mode

Allow to set a gpio in output mode from the device tree.

Signed-off-by: Fabien Dessenne <fabien.dessenne@foss.st.com>
Change-Id: Ic483324bc5fe916a60df05f74706bd1da4d08aa5

3 years agorefactor(st-gpio): code improvements
Fabien Dessenne [Tue, 21 Sep 2021 09:05:06 +0000 (11:05 +0200)]
refactor(st-gpio): code improvements

No functional, change, but some improvements:
- Declare set_gpio() as static (only called locally)
- Handle the type ('open-drain') property independently from the
  mode one.
- Replace mmio_clrbits_32() +  mmio_setbits_32() with
  mmio_clrsetbits_32().
- Add a missing log
- Add missing U() in macro definitions

Signed-off-by: Fabien Dessenne <fabien.dessenne@foss.st.com>
Change-Id: I1a79609609ac8e8001127ebefdb81def573f76fa

3 years agoMerge "docs(commit-style): change blessed scope of FF-A" into integration
Madhukar Pappireddy [Tue, 1 Feb 2022 15:09:48 +0000 (16:09 +0100)]
Merge "docs(commit-style): change blessed scope of FF-A" into integration

3 years agofeat(stm32mp1): warn when debug enabled on secure chip
Lionel Debieve [Tue, 28 Jan 2020 08:02:41 +0000 (09:02 +0100)]
feat(stm32mp1): warn when debug enabled on secure chip

Add a banner that inform user that debug is enabled
on a secure chip.

Change-Id: Ib618ac1332b40a1af72d0b60750eea4fc36a8014
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofix(stm32mp1): rework switch/case for MISRA
Yann Gautier [Tue, 19 Oct 2021 11:31:06 +0000 (13:31 +0200)]
fix(stm32mp1): rework switch/case for MISRA

Avoid the use of return inside switch/case in stm32mp_is_single_core().
Although this MISRA rulre might not be enforced, we align on what is done
for stm32mp_is_auth_supported().

Change-Id: I00a5ec1b18c55b4254af00c9c5cf5a4dce104175
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofeat(st): disable authentication based on part_number
Lionel Debieve [Fri, 6 Dec 2019 11:42:20 +0000 (12:42 +0100)]
feat(st): disable authentication based on part_number

STM32MP15xA and STM32MP15xD chip part numbers don't
support the secure boot.
All functions linked to secure boot must not be used
and signed binaries are not allowed on such chip.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Change-Id: I5b85f322f5eb3b64415e1819bd00fb2c99f20695

3 years agofeat(tc): enable SMMU for DPU
Anders Dellien [Sat, 1 Jan 2022 21:56:25 +0000 (21:56 +0000)]
feat(tc): enable SMMU for DPU

The SMMU needs to be enabled to support 8GB RAM

Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Change-Id: Ie81f2fc59886c52e9d6ed799ea73f49eb7a7c307

3 years agofeat(tc): add reserved memory region for Gralloc
Anders Dellien [Wed, 8 Dec 2021 21:57:21 +0000 (21:57 +0000)]
feat(tc): add reserved memory region for Gralloc

Gralloc for Android S uses dmabuf, we need to add reserved memory area
for these allocations

Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Change-Id: If869ac930fadc374ec435cae3847ba374584275b

3 years agofeat(tc): enable GPU
Anders Dellien [Sat, 1 Jan 2022 21:51:21 +0000 (21:51 +0000)]
feat(tc): enable GPU

Add DTS node for GPU to support hardware rendering in Android

Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Change-Id: I2cf2badf5b15e59a910f6cf7d3d30fdfaf4fe9ce

3 years agofix(tc): remove the bootargs node
Anders Dellien [Wed, 8 Dec 2021 21:59:36 +0000 (21:59 +0000)]
fix(tc): remove the bootargs node

We need to keep the kernel command line in Yocto, otherwise we
can't support AVB.

Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Change-Id: Ic291eb13620b307f10354c2c2797c6fc9b053e83

3 years agoMerge changes from topic "st-nvmem" into integration
Madhukar Pappireddy [Mon, 31 Jan 2022 23:18:48 +0000 (00:18 +0100)]
Merge changes from topic "st-nvmem" into integration

* changes:
  feat(stm32mp1): manage monotonic counter
  feat(stm32mp1): new way to access platform OTP
  feat(stm32mp1-fdts): update NVMEM nodes
  refactor(st-drivers): improve BSEC driver
  feat(stm32mp1-fdts): add nvmem_layout node and OTP definitions
  feat(stm32mp1): add NVMEM layout compatibility definition

3 years agoMerge changes I25047322,Id476f815 into integration
Manish Pandey [Mon, 31 Jan 2022 15:53:19 +0000 (16:53 +0100)]
Merge changes I25047322,Id476f815 into integration

* changes:
  fix(plat/rcar3): change stack size of BL31
  fix(plat/rcar3): fix SYSTEM_OFF processing for R-Car D3

3 years agoMerge "fix(scmi): add missing \n in ERROR message" into integration
Madhukar Pappireddy [Mon, 31 Jan 2022 14:02:38 +0000 (15:02 +0100)]
Merge "fix(scmi): add missing \n in ERROR message" into integration

3 years agorefactor(el3-runtime): add prepare_el3_entry func
Daniel Boulby [Wed, 19 Jan 2022 11:20:05 +0000 (11:20 +0000)]
refactor(el3-runtime): add prepare_el3_entry func

In the next patch we add an extra step of setting the PSTATE
registers to a known state on el3 entry. In this patch we create
the function prepare_el3_entry to wrap the steps needed for before
el3 entry. For now this is only save_gp_pmcr_pauth_regs.

Change-Id: Ie26dc8d89bfaec308769165d2649e84d41be196c
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
3 years agodocs(commit-style): change blessed scope of FF-A
Daniel Boulby [Mon, 6 Dec 2021 14:44:35 +0000 (14:44 +0000)]
docs(commit-style): change blessed scope of FF-A

Also split SPM MM into it's own scope.

Change-Id: I9cfb1ddec7419ad0d7b539f65e7322bbd44a3913
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
3 years agofeat(stm32mp1): manage monotonic counter
Yann Gautier [Wed, 17 Apr 2019 13:12:58 +0000 (15:12 +0200)]
feat(stm32mp1): manage monotonic counter

The monotonic counter is stored in an OTP fuse.
A check is done in TF-A.
If the TF-A version is incremented, then the counter will be updated
in the corresponding OTP.

Change-Id: I6e7831300ca9efbb35b4c87706f2dcab35affacb
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Mathieu Belou <mathieu.belou@st.com>
3 years agofeat(stm32mp1): new way to access platform OTP
Lionel Debieve [Mon, 4 Nov 2019 13:31:38 +0000 (14:31 +0100)]
feat(stm32mp1): new way to access platform OTP

Use dt_find_otp_name() to retrieve platform OTP information
from device tree, directly or through stm32_get_otp_index() and
stm32_get_otp_value() platform services.
String definitions replace hard-coded values, they are used to call
this new function.

Change-Id: I81213e4a9ad08fddadc2c97b064ae057a4c79561
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofeat(stm32mp1-fdts): update NVMEM nodes
Nicolas Le Bayon [Tue, 10 Sep 2019 12:18:27 +0000 (14:18 +0200)]
feat(stm32mp1-fdts): update NVMEM nodes

Set non-secure property on platform secure OTP nodes that non-secure
world is allowed to access through secure world services.
These are the SoC MAC address and the ST boards board_id OTPs.
Most of these were already done but it was missing for ED1 board.

Change-Id: Idfa6322d9d5c35285706d0b2d32ae09af38684a7
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
3 years agorefactor(st-drivers): improve BSEC driver
Nicolas Le Bayon [Mon, 20 May 2019 16:35:02 +0000 (18:35 +0200)]
refactor(st-drivers): improve BSEC driver

Rename driver file to BSEC2.
Split header file in IP and feature parts.
Add functions to access BSEC scratch register.
Several corrections and improvements.
Probe the driver earlier, especially to check debug features.

Change-Id: I1981536398d598d67a19d2d7766dacc18de72ec1
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofeat(stm32mp1-fdts): add nvmem_layout node and OTP definitions
Nicolas Le Bayon [Fri, 25 Sep 2020 15:25:09 +0000 (17:25 +0200)]
feat(stm32mp1-fdts): add nvmem_layout node and OTP definitions

A new nvmem_layout node includes nvmem platform-dependent layout
information, such as OTP NVMEM cell lists (phandle, name).
This list allows easy access to OTP offsets defined in BSEC node,
where more OTP definitions with offsets in bytes and length have
been added (replace hard-coded values).
Each board may redefine this list, especially for board_id info.

Change-Id: I910ae671b3bf3320ee6500fecc9ec335ae67bbda
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofeat(stm32mp1): add NVMEM layout compatibility definition
Nicolas Le Bayon [Tue, 10 Sep 2019 08:26:50 +0000 (10:26 +0200)]
feat(stm32mp1): add NVMEM layout compatibility definition

Used by driver parsing this node to get information.

Change-Id: I50623a497157adf7b9da6fafe8d79f6ff58c0ebc
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
3 years agoMerge "feat(cpu): add library support for Poseidon CPU" into integration
Bipin Ravi [Fri, 28 Jan 2022 16:06:03 +0000 (17:06 +0100)]
Merge "feat(cpu): add library support for Poseidon CPU" into integration

3 years agoMerge "feat(st-regulator): add support for regulator-always-on" into integration
Madhukar Pappireddy [Fri, 28 Jan 2022 15:20:08 +0000 (16:20 +0100)]
Merge "feat(st-regulator): add support for regulator-always-on" into integration

3 years agofeat(st-regulator): add support for regulator-always-on
Pascal Paillet [Fri, 28 Jan 2022 12:40:36 +0000 (13:40 +0100)]
feat(st-regulator): add support for regulator-always-on

Add support for regulator-always-on at BL2 level as it was supported
before using the regulator framework.

Signed-off-by: Pascal Paillet <p.paillet@st.com>
Change-Id: Idb2f4ddc2fdd4e0d31fb33da87c84618aa2e5135

3 years agofix(scmi): add missing \n in ERROR message
Yann Gautier [Thu, 27 Jan 2022 14:47:11 +0000 (15:47 +0100)]
fix(scmi): add missing \n in ERROR message

Correct ERROR message in scmi_process_message().

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I55e337a3904045aa188975f6a7ed3e989678f571

3 years agoMerge "fix(stm32mp1-fdts): remove mmc1 alias if not needed" into integration
Manish Pandey [Fri, 28 Jan 2022 11:15:46 +0000 (12:15 +0100)]
Merge "fix(stm32mp1-fdts): remove mmc1 alias if not needed" into integration

3 years agofeat(cpu): add library support for Poseidon CPU
Jayanth Dodderi Chidanand [Tue, 7 Dec 2021 17:20:10 +0000 (17:20 +0000)]
feat(cpu): add library support for Poseidon CPU

This patch adds the basic CPU library code to support the Poseidon CPU
in TF-A. Poseidon is derived from HunterELP core, an implementation of
v9.2 architecture. Currently, Hunter CPU the predecessor to HunterELP,
is supported in TF-A. Accordingly the Hunter CPU library code has been
as the base and adapted here.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I406b4de156a67132e6a5523370115aaac933f18d

3 years agoMerge "docs(changelog): add some missing ST drivers" into integration
Manish Pandey [Fri, 28 Jan 2022 11:08:07 +0000 (12:08 +0100)]
Merge "docs(changelog): add some missing ST drivers" into integration

3 years agofix(stm32mp1): remove interrupt_provider warning for dtc
Yann Gautier [Tue, 9 Mar 2021 09:42:02 +0000 (10:42 +0100)]
fix(stm32mp1): remove interrupt_provider warning for dtc

This warning can only be removed if the version is newer than v1.6.0.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I472a8e552305b563447e8148074a5c0970b429e3

3 years agofix(stm32mp1-fdts): remove mmc1 alias if not needed
Yann Gautier [Fri, 28 Jan 2022 10:20:45 +0000 (11:20 +0100)]
fix(stm32mp1-fdts): remove mmc1 alias if not needed

If a board declares an mmc1 alias in its DT and is compiled without flags
STM32MP_EMMC or STM32MP_SDMMC, the DT will fail to build.
Add /delete-property/ mmc1; to correct this.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I1938ff99dc3d883f9174ee886f9ffa195ec60373

3 years agodocs(changelog): add some missing ST drivers
Yann Gautier [Thu, 27 Jan 2022 08:25:47 +0000 (09:25 +0100)]
docs(changelog): add some missing ST drivers

Some of the ST drivers were not listed, and had no scopes. Add BSEC,
Crypto, DDR, I2C, FMC, GPIO, Regulator, Reset, SPI and Watchdog.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I4441f160f778d4bf7686e24e7d2d3c8330891327

3 years agoMerge "fix(nxp-drivers): ddr: corrects mapping of HNFs nodes" into integration
Manish Pandey [Thu, 27 Jan 2022 22:05:51 +0000 (23:05 +0100)]
Merge "fix(nxp-drivers): ddr: corrects mapping of HNFs nodes" into integration

3 years agoMerge changes from topic "st-clk-updates" into integration
Manish Pandey [Thu, 27 Jan 2022 21:56:07 +0000 (22:56 +0100)]
Merge changes from topic "st-clk-updates" into integration

* changes:
  refactor(st-clock): update STGEN management
  feat(st-clock): assign clocks to the correct BL
  feat(st-clock): do not refcount on non-secure clocks in bl32
  feat(st-clock): define secure and non-secure gate clocks
  refactor(stm32mp1): remove unused refcount helper functions
  fix(stm32mp1): add missing debug.h
  refactor(st-clock): use refcnt instead of secure status

3 years agorefactor(st-clock): update STGEN management
Lionel Debieve [Wed, 4 Dec 2019 20:50:19 +0000 (21:50 +0100)]
refactor(st-clock): update STGEN management

Rework STGEN config function, and move it to stm32mp_clkfunc.c file.

Change-Id: I7784a79c486d1b8811f6f8d123e49ea34899e9b6
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofeat(st-clock): assign clocks to the correct BL
Yann Gautier [Fri, 17 Jan 2020 10:59:28 +0000 (11:59 +0100)]
feat(st-clock): assign clocks to the correct BL

Some clocks are only required in BL2, like boot devices clocks:
FMC, QSPI.
Some clocks are only used in BL32: Timers, devices that need special
care for independent reset.

Change-Id: Id4ba99afeea5095f419a86f7dc6423192c628d82
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofeat(st-clock): do not refcount on non-secure clocks in bl32
Yann Gautier [Wed, 27 Oct 2021 16:21:11 +0000 (18:21 +0200)]
feat(st-clock): do not refcount on non-secure clocks in bl32

This change removes reference counting support in clock gating
implementation for clocks that rely on non-secure only RCC resources.
As RCC registers are accessed straight by non-secure world for these
clocks, secure world cannot safely store the clock state and even
disabling such clock from secure world can jeopardize the non-secure
world clock management framework and drivers.

As a consequence, for such clocks, stm32_clock_enable() forces the clock
ON without any increment of a refcount and stm32_clock_disable() does
not disable the clock.

Change-Id: I0cc159b36a25dbc8676f05edf2668ae63c640537
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
3 years agofeat(st-clock): define secure and non-secure gate clocks
Yann Gautier [Wed, 27 Oct 2021 16:16:59 +0000 (18:16 +0200)]
feat(st-clock): define secure and non-secure gate clocks

Array stm32mp1_clk_gate[] defines the clock resources. This change
add a secure attribute to the clock: secure upon RCC[TZEN] (SEC),
secure upon RCC[TZEN] and RCC[MCKPROT] (MKP) or always accessible
from non-secure (N_S).

At init, lookup clock tree to check if any of the secure clocks
is derived from PLL3 in which case PLL3 shall be secure.

Note that this change does not grow byte size of stm32mp1_clk_gate[].

Change-Id: I933d8a30007f3c72f755aa1ef6d7e6bcfabbfa9e
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agorefactor(stm32mp1): remove unused refcount helper functions
Yann Gautier [Wed, 19 Jan 2022 13:01:52 +0000 (14:01 +0100)]
refactor(stm32mp1): remove unused refcount helper functions

Remove stm32mp_incr_shrefcnt(), stm32mp_decr_shrefcnt(),
stm32mp_incr_refcnt() and stm32mp_decr_refcnt() that are unused.
The file is then just removed.

Change-Id: I09ee23c02317df5d8f71cbc355d3ed4a67ce2749
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agofix(stm32mp1): add missing debug.h
Yann Gautier [Thu, 27 Jan 2022 12:55:18 +0000 (13:55 +0100)]
fix(stm32mp1): add missing debug.h

Due to stm32mp_shres_helpers.h removal, the debug.h header is no more
included. It should then be added to stm32mp1_boot_device.c.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I397911ac05fdff464c010cf3b2e04320a781b4aa

3 years agorefactor(st-clock): use refcnt instead of secure status
Yann Gautier [Wed, 19 Jan 2022 12:57:49 +0000 (13:57 +0100)]
refactor(st-clock): use refcnt instead of secure status

Rework the internal functions __stm32mp1_clk_enable/disable to check for
reference count instead of secure status for a clock.
Some functions now unused can be removed.

Change-Id: Ie4359110d7144229f85c961dcd5a019222c3fd25
Signed-off-by: Yann Gautier <yann.gautier@st.com>
3 years agoMerge changes from topic "fwu-on-stm32mp1" into integration
Madhukar Pappireddy [Thu, 27 Jan 2022 14:49:15 +0000 (15:49 +0100)]
Merge changes from topic "fwu-on-stm32mp1" into integration

* changes:
  feat(stm32mp1): add support for building the FWU feature
  feat(stm32mp1): add logic to pass the boot index to the Update Agent
  feat(stm32mp1): add support for reading the metadata partition
  feat(stm32mp1): add logic to select the images to be booted
  feat(stm32mp1): add GUID's for identifying firmware images to be booted
  feat(stm32mp1): add GUID values for updatable images
  feat(fwu): add platform hook for getting the boot index
  feat(fwu): simplify the assert to check for fwu init
  feat(fwu): add a function to pass metadata structure to platforms
  feat(partition): add a function to identify a partition by GUID
  feat(partition): copy the partition GUID into the partition structure
  feat(partition): make provision to store partition GUID value
  feat(partition): cleanup partition and gpt headers
  feat(fwu): add basic definitions for GUID handling
  feat(fwu): pass a const metadata structure to platform routines
  build(changelog): add a valid scope for partition code

3 years agofeat(stm32mp1): add support for building the FWU feature
Sughosh Ganu [Wed, 10 Nov 2021 12:17:16 +0000 (17:47 +0530)]
feat(stm32mp1): add support for building the FWU feature

Add support for enabling the FWU multi bank boot feature on the
platform.

Currently, this feature is supported on the STM32MP157C-DK2 board,
which boots off a uSD card. Also, support has been enabled when
booting from a FIP image.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: Ia69e858461e2daf599d41d66d7ff2ccae0c341c2

3 years agofeat(stm32mp1): add logic to pass the boot index to the Update Agent
Sughosh Ganu [Wed, 1 Dec 2021 10:26:27 +0000 (15:56 +0530)]
feat(stm32mp1): add logic to pass the boot index to the Update Agent

With the FWU Multi Bank update feature, the platform can boot from one
of multiple banks(partitions). Pass the value of bank from which the
platform has booted as boot index to the Update Agent. The Update
Agent will match this boot index value against the active_index field
in the metadata, and update the metadata if there is a mismatch.

Fow now, the mechanism to pass the boot index is platform specific. On
the STM32MP1 platform, the boot index value is passed through a
memorey mapped TAMP register on the SoC.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I0aa665ff9c1db95be8ae19ed8de6d866587d6850

3 years agofeat(stm32mp1): add support for reading the metadata partition
Sughosh Ganu [Wed, 1 Dec 2021 11:16:34 +0000 (16:46 +0530)]
feat(stm32mp1): add support for reading the metadata partition

Add support for reading the FWU metadata partition. The metadata
partition stores information on the current active bank along with
information on all the FWU updatable images on the platform. This
information is then used to identify the image to be booted.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I66bc5ac718c21a49c504e698b5b1f5c4daed2d08

3 years agofeat(stm32mp1): add logic to select the images to be booted
Sughosh Ganu [Wed, 1 Dec 2021 11:15:11 +0000 (16:45 +0530)]
feat(stm32mp1): add logic to select the images to be booted

With the FWU multi bank boot feature enabled, the platform can boot
from one of the multiple banks(partitions) containing the firmware
images. The bank whose firmware components are to be booted is read
from the FWU metadata structure -- the image to be booted is thus
derived by reading the metadata.

Read the metadata and set the image spec of the corresponding image
type to point to the partition from which the image is to be booted.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I3dfdc7e9202859e917ec4e1f7d1855aad42c6b70

3 years agofeat(stm32mp1): add GUID's for identifying firmware images to be booted
Sughosh Ganu [Wed, 10 Nov 2021 09:54:56 +0000 (15:24 +0530)]
feat(stm32mp1): add GUID's for identifying firmware images to be booted

Add GUID's for identifying the firmware image type. With the FWU
multi bank boot feature enabled, these GUID values are used to
identify the firmware image to be booted. This is done by matching
GUID values of images in the io policy table with the Image GUID value
that is read from the FWU metadata structure.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: Id9751f02f95fc48ef68e4e3f9f0ddbf6d6319d3c

3 years agofeat(stm32mp1): add GUID values for updatable images
Sughosh Ganu [Fri, 2 Jul 2021 10:35:14 +0000 (16:05 +0530)]
feat(stm32mp1): add GUID values for updatable images

With the FWU multi bank feature enabled, the identification of
firmware image type is done using the image type GUID instead of
binary_type field.

Add GUID values for the FIP image which can be updated through
the FWU firmware update feature. The GUID values are used in
identifying the firmware images.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: If7d9356aa8d2bb3fbcbc87100e6972f1a1862921

3 years agofeat(fwu): add platform hook for getting the boot index
Sughosh Ganu [Wed, 1 Dec 2021 10:23:32 +0000 (15:53 +0530)]
feat(fwu): add platform hook for getting the boot index

Add a platform hook for returning the boot index, i.e. the bank from
which the platform has booted the updatable firmware images. This
value will be passed to the Update Agent.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: Ic7bef21071c48cfc7b69c50e89df9ff758d95b00

3 years agofeat(fwu): simplify the assert to check for fwu init
Sughosh Ganu [Wed, 1 Dec 2021 06:22:53 +0000 (11:52 +0530)]
feat(fwu): simplify the assert to check for fwu init

Simplify the assert to check if the FWU subsystem has been initialised
in the fwu_is_trial_run_state function.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I428668470ebd4b67e68777a62d5732cb96841ab9

3 years agofeat(fwu): add a function to pass metadata structure to platforms
Sughosh Ganu [Wed, 1 Dec 2021 06:20:22 +0000 (11:50 +0530)]
feat(fwu): add a function to pass metadata structure to platforms

Add a helper function to pass the metadata structure to the
platforms. Platforms can then read the metadata structure and pass the
boot index value, i.e. the bank(partition) from which the firmware
images were booted, to the Update Agent.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I571179b9baa0fbc4d0f08d7a6e3b50c0c7165c5c

3 years agofeat(partition): add a function to identify a partition by GUID
Sughosh Ganu [Wed, 10 Nov 2021 07:30:30 +0000 (13:00 +0530)]
feat(partition): add a function to identify a partition by GUID

With the GPT partition scheme, a partition can be identified using
it's UniquePartitionGUID, instead of it's name. Add a function to
identify the partition based on this GUID value. This functionality is
useful in identification of a partition whose UniquePartitionGUID
value is known.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I543f794e1f7773f969968a6bce85ecca6f6a1659

3 years agofeat(partition): copy the partition GUID into the partition structure
Sughosh Ganu [Fri, 2 Jul 2021 11:03:46 +0000 (16:33 +0530)]
feat(partition): copy the partition GUID into the partition structure

Copy the UniquePartitionGUID member of a GPT partition entry into the
partition_entry structure. This GUID is subsequently used to identify
the image to boot on a platform which supports multiple partitions of
firmware components using the FWU metadata structure.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I8b55a1ee7deb1353886fbd8ebde53055d677fee0

3 years agofeat(partition): make provision to store partition GUID value
Sughosh Ganu [Fri, 2 Jul 2021 10:52:55 +0000 (16:22 +0530)]
feat(partition): make provision to store partition GUID value

The FWU multi bank feature supports multiple partitions or banks of
firmware components, where a platform can support having an active and
a backup partition(bank) of firmware images to boot from. This feature
identifies the images in a given bank using image GUID's --
this GUID value corresponds to the UniquePartitionGUID value used to
uniquely identify a GPT partition.

To support identification of images, add a member to the
partition_entry structure to store the UniquePartitionGUID value of
the GPT partition entry. This value is subsequently used to select the
firmware image to boot in a multi partition setup.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I2d235467ce7a7f20ebc1cef4db09924a5282e714

3 years agofeat(partition): cleanup partition and gpt headers
Sughosh Ganu [Tue, 7 Dec 2021 11:19:21 +0000 (16:49 +0530)]
feat(partition): cleanup partition and gpt headers

The EFI_NAMELEN macro has been moved to efi.h header. Get the macro
from efi.h. Use the struct efi_guid structure for declaring GUID
members in gpt.h

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I1c3a2605b9f857b9cf2dcfdaed4dc9d0a2cbf0f0

3 years agofeat(fwu): add basic definitions for GUID handling
Sughosh Ganu [Fri, 2 Jul 2021 10:30:40 +0000 (16:00 +0530)]
feat(fwu): add basic definitions for GUID handling

The FWU metadata structure uses GUID's to identify the updatable
firmware images. Add some basic helper functions and
macros that would be used for working with the GUID datatype.

With the FWU feature enabled, these would then be used for image
identification and booting of images from a particular
bank(partition).

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: Ia54c0402d72b503d6abd1d94bc751cc14602cd39

3 years agofeat(fwu): pass a const metadata structure to platform routines
Sughosh Ganu [Wed, 17 Nov 2021 11:38:10 +0000 (17:08 +0530)]
feat(fwu): pass a const metadata structure to platform routines

The metadata structure copy is passed to the platform routine to set
the image source to boot the platform from. This is done by reading
the metadata structure. Pass the metadata as a read-only copy to the
routine -- the routine only needs to consume the metadata values and
should not be able to update the metadata fields.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I399cad99ab89c71483e5a32a1de0e22df304f8b0

3 years agobuild(changelog): add a valid scope for partition code
Sughosh Ganu [Wed, 19 Jan 2022 06:01:20 +0000 (11:31 +0530)]
build(changelog): add a valid scope for partition code

Add a valid scope for the partition code under the drivers directory.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I173ac45e4ccbc95566277dabef15dcd25533e097

3 years agoMerge "fix(st-ddr): add missing debug.h" into integration
Madhukar Pappireddy [Thu, 27 Jan 2022 01:01:32 +0000 (02:01 +0100)]
Merge "fix(st-ddr): add missing debug.h" into integration

3 years agoMerge "refactor(stm32mp1): use a macro for header size" into integration
Madhukar Pappireddy [Thu, 27 Jan 2022 00:58:50 +0000 (01:58 +0100)]
Merge "refactor(stm32mp1): use a macro for header size" into integration

3 years agoMerge "refactor(ls1028a): fix header file group issue" into integration
Madhukar Pappireddy [Wed, 26 Jan 2022 15:08:06 +0000 (16:08 +0100)]
Merge "refactor(ls1028a): fix header file group issue" into integration