TF-A: v2.6-stm32mp1-r1
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com> Change-Id: I23dff9a9a33a1094bfcf01c2fa8e555f349d0782
This commit is contained in:
1 parent
10b737d31d
commit
4e63a23ff6
14 files changed
+55773
-46241
No files matched your search
@@ -1,26 +0,0 @@
|
||||
From a9163bb270c27524c36cfc216ddb61169a7ccef8 Mon Sep 17 00:00:00 2001
|
||||
From: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
|
||||
Date: Fri, 29 Apr 2022 16:57:28 +0200
|
||||
Subject: [PATCH] correct DTC version detection
|
||||
|
||||
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
|
||||
---
|
||||
plat/st/stm32mp1/platform.mk | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plat/st/stm32mp1/platform.mk b/plat/st/stm32mp1/platform.mk
|
||||
index 55acd6742..2db7b506c 100644
|
||||
--- a/plat/st/stm32mp1/platform.mk
|
||||
+++ b/plat/st/stm32mp1/platform.mk
|
||||
@@ -109,7 +109,7 @@ endif
|
||||
endif
|
||||
|
||||
$(eval DTC_V = $(shell $(DTC) -v | awk '{print $$NF}'))
|
||||
-$(eval DTC_VERSION = $(shell printf "%d" $(shell echo ${DTC_V} | cut -d- -f1 | sed "s/\./0/g")))
|
||||
+$(eval DTC_VERSION = $(shell printf "%d" $(shell echo ${DTC_V} | cut -d- -f1 | sed "s/\./0/g" | grep -o [0-9]*)))
|
||||
DTC_CPPFLAGS += ${INCLUDES}
|
||||
DTC_FLAGS += -Wno-unit_address_vs_reg
|
||||
ifeq ($(shell test $(DTC_VERSION) -ge 10601; echo $$?),0)
|
||||
--
|
||||
2.25.1
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,157 +0,0 @@
|
||||
From 903a55e874e91ccd1fb435bea3a675e2eb4257fa Mon Sep 17 00:00:00 2001
|
||||
From: Romuald JEANNE <romuald.jeanne@st.com>
|
||||
Date: Wed, 2 Jun 2021 16:45:18 +0200
|
||||
Subject: [PATCH 2/3] v2.4-stm32mp-r1.1-rc1
|
||||
|
||||
---
|
||||
docs/plat/stm32mp1.rst | 9 ++++++---
|
||||
drivers/st/clk/stm32mp1_clk.c | 4 ++--
|
||||
include/drivers/st/stm32mp1_rcc.h | 16 ++++++++++++++++
|
||||
plat/st/common/stm32mp_crypto_lib.c | 5 ++++-
|
||||
plat/st/stm32mp1/stm32mp1_def.h | 2 ++
|
||||
plat/st/stm32mp1/stm32mp1_helper.S | 13 +++++++++++++
|
||||
6 files changed, 43 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/docs/plat/stm32mp1.rst b/docs/plat/stm32mp1.rst
|
||||
index fb7afdbbb0..95f4a186f5 100644
|
||||
--- a/docs/plat/stm32mp1.rst
|
||||
+++ b/docs/plat/stm32mp1.rst
|
||||
@@ -153,7 +153,10 @@ To build TF-A BL2 with its STM32 header for SD-card boot:
|
||||
.. code:: bash
|
||||
|
||||
make CROSS_COMPILE=arm-none-eabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 \
|
||||
- DTB_FILE_NAME=stm32mp157c-ev1.dtb
|
||||
+ DTB_FILE_NAME=stm32mp157c-ev1.dtb STM32MP_SDMMC=1
|
||||
+
|
||||
+For other boot devices, you have to replace STM32MP_SDMMC in the previous command
|
||||
+with the desired devive flag.
|
||||
|
||||
This BL2 is independent of the BL32 used (SP_min or OP-TEE)
|
||||
|
||||
@@ -204,14 +207,14 @@ __________________
|
||||
--nt-fw <u-boot_directory>/u-boot-nodtb.bin \
|
||||
--nt-fw-cert build/stm32mp1/cert_images/u-boot.bin.crt \
|
||||
--nt-fw-key-cert build/stm32mp1/cert_images/u-boot.bin.key-crt \
|
||||
- --hw-config <u-boot_directory>/u-boot.dtb
|
||||
+ --hw-config <u-boot_directory>/u-boot.dtb \
|
||||
--fw-config build/stm32mp1/debug/fdts/fw-config.dtb
|
||||
|
||||
tools/fiptool/fiptool create --tos-fw <optee_directory>/tee-header_v2.bin \
|
||||
--tos-fw-extra1 <optee_directory>/tee-pager_v2.bin \
|
||||
--tos-fw-extra2 <optee_directory>/tee-pageable_v2.bin \
|
||||
--nt-fw <u-boot_directory>/u-boot-nodtb.bin \
|
||||
- --hw-config <u-boot_directory>/uboot-nodtb.dtb \
|
||||
+ --hw-config <u-boot_directory>/u-boot.dtb \
|
||||
--tos-fw-cert build/stm32mp1/cert_images/tee-header_v2.bin.crt \
|
||||
--tos-fw-key-cert build/stm32mp1/cert_images/tee-header_v2.bin.key-crt \
|
||||
--nt-fw-cert build/stm32mp1/cert_images/u-boot.bin.crt \
|
||||
diff --git a/drivers/st/clk/stm32mp1_clk.c b/drivers/st/clk/stm32mp1_clk.c
|
||||
index 00954cb2e8..d074a1568c 100644
|
||||
--- a/drivers/st/clk/stm32mp1_clk.c
|
||||
+++ b/drivers/st/clk/stm32mp1_clk.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (C) 2018-2020, STMicroelectronics - All Rights Reserved
|
||||
+ * Copyright (C) 2018-2021, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
*/
|
||||
@@ -1853,7 +1853,7 @@ static void stm32mp1_set_rtcsrc(unsigned int clksrc, bool lse_css)
|
||||
(clksrc != (uint32_t)CLK_RTC_DISABLED)) {
|
||||
mmio_clrsetbits_32(address,
|
||||
RCC_BDCR_RTCSRC_MASK,
|
||||
- clksrc << RCC_BDCR_RTCSRC_SHIFT);
|
||||
+ (clksrc & RCC_SELR_SRC_MASK) << RCC_BDCR_RTCSRC_SHIFT);
|
||||
|
||||
mmio_setbits_32(address, RCC_BDCR_RTCCKEN);
|
||||
}
|
||||
diff --git a/include/drivers/st/stm32mp1_rcc.h b/include/drivers/st/stm32mp1_rcc.h
|
||||
index feaac43a13..616051e772 100644
|
||||
--- a/include/drivers/st/stm32mp1_rcc.h
|
||||
+++ b/include/drivers/st/stm32mp1_rcc.h
|
||||
@@ -576,6 +576,22 @@
|
||||
#define RCC_FMCCKSELR_FMCSRC_MASK GENMASK(1, 0)
|
||||
#define RCC_FMCCKSELR_FMCSRC_SHIFT 0
|
||||
|
||||
+/* RCC_APB1RSTSETR register fields */
|
||||
+#define RCC_APB1RSTSETR_USART2RST BIT(14)
|
||||
+#define RCC_APB1RSTSETR_USART3RST BIT(15)
|
||||
+#define RCC_APB1RSTSETR_UART4RST BIT(16)
|
||||
+#define RCC_APB1RSTSETR_UART5RST BIT(17)
|
||||
+#define RCC_APB1RSTSETR_UART7RST BIT(18)
|
||||
+#define RCC_APB1RSTSETR_UART8RST BIT(19)
|
||||
+
|
||||
+/* RCC_APB1RSTCLRR register fields */
|
||||
+#define RCC_APB1RSTCLRR_USART2RST BIT(14)
|
||||
+#define RCC_APB1RSTCLRR_USART3RST BIT(15)
|
||||
+#define RCC_APB1RSTCLRR_UART4RST BIT(16)
|
||||
+#define RCC_APB1RSTCLRR_UART5RST BIT(17)
|
||||
+#define RCC_APB1RSTCLRR_UART7RST BIT(18)
|
||||
+#define RCC_APB1RSTCLRR_UART8RST BIT(19)
|
||||
+
|
||||
/* RCC_USBCKSELR register fields */
|
||||
#define RCC_USBCKSELR_USBPHYSRC_MASK GENMASK(1, 0)
|
||||
#define RCC_USBCKSELR_USBPHYSRC_SHIFT 0
|
||||
diff --git a/plat/st/common/stm32mp_crypto_lib.c b/plat/st/common/stm32mp_crypto_lib.c
|
||||
index de9601d2b8..9582162813 100644
|
||||
--- a/plat/st/common/stm32mp_crypto_lib.c
|
||||
+++ b/plat/st/common/stm32mp_crypto_lib.c
|
||||
@@ -40,6 +40,7 @@ static void crypto_lib_init(void)
|
||||
{
|
||||
boot_api_context_t *boot_context =
|
||||
(boot_api_context_t *)stm32mp_get_boot_ctx_address();
|
||||
+ int ret;
|
||||
|
||||
if (!stm32mp_is_auth_supported()) {
|
||||
return;
|
||||
@@ -48,7 +49,9 @@ static void crypto_lib_init(void)
|
||||
auth_ops.verify_signature =
|
||||
boot_context->bootrom_ecdsa_verify_signature;
|
||||
|
||||
- if (stm32_hash_register() != 0) {
|
||||
+ ret = stm32_hash_register();
|
||||
+ if (ret != 0) {
|
||||
+ ERROR("HASH init (%d)\n", ret);
|
||||
panic();
|
||||
}
|
||||
}
|
||||
diff --git a/plat/st/stm32mp1/stm32mp1_def.h b/plat/st/stm32mp1/stm32mp1_def.h
|
||||
index 027dba1bde..326b227842 100644
|
||||
--- a/plat/st/stm32mp1/stm32mp1_def.h
|
||||
+++ b/plat/st/stm32mp1/stm32mp1_def.h
|
||||
@@ -433,6 +433,8 @@ enum ddr_type {
|
||||
#define DEBUG_UART_TX_CLKSRC RCC_UART24CKSELR_HSI
|
||||
#define DEBUG_UART_TX_EN_REG RCC_MP_APB1ENSETR
|
||||
#define DEBUG_UART_TX_EN RCC_MP_APB1ENSETR_UART4EN
|
||||
+#define DEBUG_UART_RST_REG RCC_APB1RSTSETR
|
||||
+#define DEBUG_UART_RST_BIT RCC_APB1RSTSETR_UART4RST
|
||||
|
||||
/*******************************************************************************
|
||||
* STM32MP1 ETZPC
|
||||
diff --git a/plat/st/stm32mp1/stm32mp1_helper.S b/plat/st/stm32mp1/stm32mp1_helper.S
|
||||
index bc2d73cebb..315a67f2cf 100644
|
||||
--- a/plat/st/stm32mp1/stm32mp1_helper.S
|
||||
+++ b/plat/st/stm32mp1/stm32mp1_helper.S
|
||||
@@ -245,6 +245,19 @@ endfunc plat_my_core_pos
|
||||
* ---------------------------------------------
|
||||
*/
|
||||
func plat_crash_console_init
|
||||
+ /* Reset UART peripheral */
|
||||
+ ldr r1, =(RCC_BASE + DEBUG_UART_RST_REG)
|
||||
+ ldr r2, =DEBUG_UART_RST_BIT
|
||||
+ str r2, [r1]
|
||||
+1:
|
||||
+ ldr r0, [r1]
|
||||
+ ands r0, r2
|
||||
+ beq 1b
|
||||
+ str r2, [r1, #4] /* RSTCLR register */
|
||||
+2:
|
||||
+ ldr r0, [r1]
|
||||
+ ands r0, r2
|
||||
+ bne 2b
|
||||
/* Enable GPIOs for UART TX */
|
||||
ldr r1, =(RCC_BASE + DEBUG_UART_TX_GPIO_BANK_CLK_REG)
|
||||
ldr r2, [r1]
|
||||
--
|
||||
2.17.1
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+25
@@ -0,0 +1,25 @@
|
||||
From f83c3e1e478fa7dfd8ee41b3c7b0c0c32341d954 Mon Sep 17 00:00:00 2001
|
||||
From: Lionel VITTE <lionel.vitte@st.com>
|
||||
Date: Thu, 24 Mar 2022 13:48:26 +0100
|
||||
Subject: [PATCH] Modify 'Reset reason' trace level
|
||||
|
||||
---
|
||||
plat/st/stm32mp1/bl2_plat_setup.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c
|
||||
index 57aa5590a..b248d17ff 100644
|
||||
--- a/plat/st/stm32mp1/bl2_plat_setup.c
|
||||
+++ b/plat/st/stm32mp1/bl2_plat_setup.c
|
||||
@@ -66,7 +66,7 @@ static void print_reset_reason(void)
|
||||
return;
|
||||
}
|
||||
|
||||
- INFO("Reset reason (0x%x):\n", rstsr);
|
||||
+ NOTICE("Reset reason (0x%x):\n", rstsr);
|
||||
|
||||
if ((rstsr & RCC_MP_RSTSCLRR_PADRSTF) == 0U) {
|
||||
if ((rstsr & RCC_MP_RSTSCLRR_STDBYRSTF) != 0U) {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
Compilation of TF-A (Trusted Firmware-A):
|
||||
1. Pre-requisite
|
||||
2. Initialise cross-compilation via SDK
|
||||
3. Prepare tf-a source code
|
||||
4. Management of tf-a source code
|
||||
5. Compile tf-a source code
|
||||
2. Initialize cross-compilation via SDK
|
||||
3. Prepare TF-A source code
|
||||
4. Manage TF-A source code with GIT
|
||||
5. Compile TF-A source code
|
||||
6. Update software on board
|
||||
|
||||
1. Pre-requisite:
|
||||
-----------------
|
||||
----------------
|
||||
1. Pre-requisite
|
||||
----------------
|
||||
OpenSTLinux SDK must be installed.
|
||||
|
||||
For tf-a build you need to install:
|
||||
For TF-A build you need to install:
|
||||
- git:
|
||||
Ubuntu: sudo apt-get install git-core gitk
|
||||
Fedora: sudo yum install git
|
||||
@@ -19,7 +20,8 @@ If you have never configured you git configuration:
|
||||
$ git config --global user.name "your_name"
|
||||
$ git config --global user.email "your_email@example.com"
|
||||
|
||||
2. Initialise cross-compilation via SDK:
|
||||
---------------------------------------
|
||||
2. Initialize cross-compilation via SDK
|
||||
---------------------------------------
|
||||
Source SDK environment:
|
||||
$ source <path to SDK>/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
|
||||
@@ -31,26 +33,38 @@ To verify if your cross-compilation environment have put in place:
|
||||
Warning: the environment are valid only on the shell session where you have
|
||||
sourced the sdk environment.
|
||||
|
||||
3. Prepare tf-a source:
|
||||
------------------------
|
||||
If you have the tarball and the list of patch then you must extract the tarball
|
||||
and apply the patch.
|
||||
$> tar xfz ##BP##-##PR##.tar.gz
|
||||
A new directory containing tf-a standard source code will be created, go into it:
|
||||
$> cd ##BP##
|
||||
----------------------
|
||||
3. Prepare TF-A source
|
||||
----------------------
|
||||
If not already done, extract the sources from Developer Package tarball, for example:
|
||||
$ tar xfJ en.SOURCES-stm32mp1-*.tar.xz
|
||||
|
||||
NB: if there is no git management on source code and you would like to have a
|
||||
git management on the code see section 4 [Management of tf-a source code]
|
||||
if there is some patch, please apply it on source code
|
||||
In the TF-A source directory (sources/*/##BP##-##PR##),
|
||||
you have one TF-A source tarball, the patches and one Makefile:
|
||||
- ##BP##-##PR##.tar.xz
|
||||
- 00*.patch
|
||||
- Makefile.sdk
|
||||
|
||||
If you would like to have a git management for the source code move to
|
||||
to section 4 [Management of TF-A source code with GIT].
|
||||
|
||||
Otherwise, to manage TF-A source code without git, you must extract the
|
||||
tarball now and apply the patch:
|
||||
|
||||
$> tar xf ##BP##-##PR##.tar.xz
|
||||
$> cd ##BP##
|
||||
$> for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
|
||||
|
||||
4. Management of tf-a source code:
|
||||
You can now move to section 5 [Compile TF-A source code].
|
||||
|
||||
-----------------------------------
|
||||
If you like to have a better management of change made on tf-a source, you
|
||||
4. Manage TF-A source code with GIT
|
||||
-----------------------------------
|
||||
If you like to have a better management of change made on TF-A source, you
|
||||
have 3 solutions to use git:
|
||||
|
||||
4.1 Get STMicroelectronics TF-A source from GitHub
|
||||
|
||||
--------------------------------------------------
|
||||
URL: https://github.com/STMicroelectronics/arm-trusted-firmware.git
|
||||
Branch: ##ARCHIVER_ST_BRANCH##
|
||||
Revision: ##ARCHIVER_ST_REVISION##
|
||||
@@ -59,38 +73,45 @@ have 3 solutions to use git:
|
||||
$ git checkout -b WORKING ##ARCHIVER_ST_REVISION##
|
||||
|
||||
4.2 Create Git from tarball
|
||||
---------------------------
|
||||
$ cd <directory to tf-a source code>
|
||||
$ test -d .git || git init . && git add . && git commit -m "tf-a source code" && git gc
|
||||
$ git checkout -b WORKING
|
||||
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
|
||||
|
||||
4.3 Get Git from community and apply STMicroelectronics patches
|
||||
$ for p in `ls -1 ../*.patch`; do git am $p; done
|
||||
|
||||
4.3 Get Git from Arm Software community and apply STMicroelectronics patches
|
||||
---------------------------------------------------------------
|
||||
URL: git://github.com/ARM-software/arm-trusted-firmware.git
|
||||
Branch: ##ARCHIVER_COMMUNITY_BRANCH##
|
||||
Revision: ##ARCHIVER_COMMUNITY_REVISION##
|
||||
|
||||
$ git clone git://github.com/ARM-software/arm-trusted-firmware.git
|
||||
$ cd <directory to tf-a source code>
|
||||
$ cd arm-trusted-firmware
|
||||
$ git checkout -b WORKING ##ARCHIVER_COMMUNITY_REVISION##
|
||||
$ for p in `ls -1 <path to patch>/*.patch`; do git am $p; done
|
||||
|
||||
5. Build tf-a source code:
|
||||
--------------------------------
|
||||
Since OpenSTLinux has activated FIP by default, so the FIP_artifacts should be specified before launching compilation
|
||||
- In case of using SOURCES-xxxx.tar.gz of Developer package the FIP_DEPLOYDIR_ROOT should be set as below:
|
||||
---------------------------
|
||||
5. Compile TF-A source code
|
||||
---------------------------
|
||||
Since OpenSTLinux activates FIP by default, FIP_artifacts directory path must be specified before launching compilation
|
||||
- In case of using SOURCES-xxxx.tar.gz of Developer package the FIP_DEPLOYDIR_ROOT must be set as below:
|
||||
$> export FIP_DEPLOYDIR_ROOT=$PWD/../../FIP_artifacts
|
||||
|
||||
To compile tf-a source code
|
||||
To compile TF-A source code
|
||||
$> make -f $PWD/../Makefile.sdk all
|
||||
or for a specific config :
|
||||
$ make -f $PWD/../Makefile.sdk TF_A_DEVICETREE=stm32mp157c-ev1 TF_A_CONFIG=trusted ELF_DEBUG_ENABLE='1' all
|
||||
|
||||
NB: TF_A_DEVICETREE flag must be set to switch to correct board configuration.
|
||||
|
||||
By default, the build results for this component are available in $PWD/../deploy directory.
|
||||
If needed, this deploy directory can be specified by added "DEPLOYDIR=<your_deploy_dir_path>" compilation option to the build command line above.
|
||||
In case DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/arm-trusted-firmware it overwrites files directly in FIP artifacts directory.
|
||||
|
||||
The generated FIP images are available in $FIP_DEPLOYDIR_ROOT/fip
|
||||
|
||||
6. Update software on board:
|
||||
----------------------------
|
||||
---------------------------
|
||||
6. Update software on board
|
||||
---------------------------
|
||||
Please use STM32CubeProgrammer then only tick the boot partitions means patitions 0x1 to 0x6 (more informations on the wiki website http://wiki.st.com/stm32mpu)
|
||||
|
||||
Reference in new issue
Block a user