All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
To: Sughosh Ganu <sughosh.ganu@linaro.org>, <u-boot@lists.denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Alexander Graf <agraf@csgraf.de>, Simon Glass <sjg@chromium.org>,
	Bin Meng <bmeng.cn@gmail.com>, Peng Fan <peng.fan@nxp.com>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jose Marinho <jose.marinho@arm.com>,
	Grant Likely <grant.likely@arm.com>,
	Jason Liu <jason.hui.liu@nxp.com>
Subject: Re: [RFC PATCH 06/10] FWU: STM32MP1: Add support to read boot index from backup register
Date: Tue, 7 Dec 2021 15:27:05 +0100	[thread overview]
Message-ID: <4102ae4d-e441-514b-cab7-4832cc7cfa9a@foss.st.com> (raw)
In-Reply-To: <20211125070146.2389-7-sughosh.ganu@linaro.org>

Hi Sughosh,

On 11/25/21 8:01 AM, Sughosh Ganu wrote:
> The FWU Multi Bank Update feature allows the platform to boot the
> firmware images from one of the partitions(banks). The first stage
> bootloader(fsbl) passes the value of the boot index, i.e. the bank
> from which the firmware images were booted from to U-Boot. On the
> STM32MP157C-DK2 board, this value is passed through one of the SoC's
> backup register. Add a function to read the boot index value from the
> backup register.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
>   arch/arm/mach-stm32mp/include/mach/stm32.h | 1 +
>   board/st/stm32mp1/stm32mp1.c               | 7 +++++++
>   include/fwu_metadata.h                     | 1 +
>   3 files changed, 9 insertions(+)
>
> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
> index c11a9903f2..21ed9f12e4 100644
> --- a/arch/arm/mach-stm32mp/include/mach/stm32.h
> +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
> @@ -97,6 +97,7 @@ enum boot_device {
>   #define TAMP_BACKUP_REGISTER(x)		(STM32_TAMP_BASE + 0x100 + 4 * x)
>   #define TAMP_BACKUP_MAGIC_NUMBER	TAMP_BACKUP_REGISTER(4)
>   #define TAMP_BACKUP_BRANCH_ADDRESS	TAMP_BACKUP_REGISTER(5)
> +#define TAMP_FWU_BOOT_IDX		TAMP_BACKUP_REGISTER(10)

The used TAMP register need to be aligned with TF-A BL2, offset = 10 to 
be confirmed


>   #define TAMP_COPRO_RSC_TBL_ADDRESS	TAMP_BACKUP_REGISTER(17)
>   #define TAMP_COPRO_STATE		TAMP_BACKUP_REGISTER(18)
>   #define TAMP_BOOT_CONTEXT		TAMP_BACKUP_REGISTER(20)
> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
> index a6884d2772..32bba71289 100644
> --- a/board/st/stm32mp1/stm32mp1.c
> +++ b/board/st/stm32mp1/stm32mp1.c
> @@ -990,6 +990,13 @@ int fwu_plat_get_blk_desc(struct blk_desc **desc)
>   	return 0;
>   }
>   
> +void fwu_plat_get_bootidx(void *boot_idx)
> +{
> +	u32 *bootidx = boot_idx;
> +
> +	*bootidx = readl(TAMP_FWU_BOOT_IDX);
> +}
> +
>   struct fwu_metadata_ops *get_plat_fwu_metadata_ops(void)
>   {
>   	if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
> diff --git a/include/fwu_metadata.h b/include/fwu_metadata.h
> index 6a5e814ab6..44f06f4c6a 100644
> --- a/include/fwu_metadata.h
> +++ b/include/fwu_metadata.h
> @@ -124,5 +124,6 @@ int fwu_get_metadata(struct fwu_metadata **metadata);
>   
>   int fwu_plat_get_update_index(u32 *update_idx);
>   int fwu_plat_get_blk_desc(struct blk_desc **desc);
> +void fwu_plat_get_bootidx(void *boot_idx);
>   
>   #endif /* _FWU_METADATA_H_ */


Regards


Patrick


  reply	other threads:[~2021-12-07 14:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25  7:01 [RFC PATCH 00/10] FWU: Add support for FWU Multi Bank Update feature Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 01/10] GPT: Add function to get gpt header and partition entries Sughosh Ganu
2021-12-07 15:35   ` Patrick DELAUNAY
2021-12-08  7:40     ` Sughosh Ganu
2021-12-09  1:32       ` AKASHI Takahiro
2021-12-09  9:00         ` Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 02/10] stm32mp: dfu: Move the ram partitions to the end of the dfu_alt_info variable Sughosh Ganu
2021-12-08 13:13   ` Etienne Carriere
2021-12-09  9:04     ` Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 03/10] FWU: Add metadata structure and functions for accessing metadata Sughosh Ganu
2021-12-08 13:53   ` Etienne Carriere
2021-12-09  9:42     ` Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 04/10] FWU: Add metadata access functions for GPT partitioned block devices Sughosh Ganu
2021-12-07 14:23   ` Patrick DELAUNAY
2021-12-08  7:18     ` Sughosh Ganu
2021-12-09  2:32   ` Simon Glass
2021-12-09  9:01     ` Sughosh Ganu
2021-12-09  9:35   ` Jason Liu
2021-12-09  9:46     ` Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 05/10] FWU: stm32mp1: Add helper functions for accessing metadata Sughosh Ganu
2021-12-07 14:33   ` Patrick DELAUNAY
2021-12-08 10:18     ` Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 06/10] FWU: STM32MP1: Add support to read boot index from backup register Sughosh Ganu
2021-12-07 14:27   ` Patrick DELAUNAY [this message]
2021-12-08  7:21     ` Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 07/10] EFI: FMP: Add provision to update image's ImageTypeId in image descriptor Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 08/10] FWU: Add boot time checks as highlighted by the FWU specification Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 09/10] FWU: Add support for FWU Multi Bank Update feature Sughosh Ganu
2021-11-25  7:01 ` [RFC PATCH 10/10] FWU: cmd: Add a command to read metadata Sughosh Ganu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4102ae4d-e441-514b-cab7-4832cc7cfa9a@foss.st.com \
    --to=patrick.delaunay@foss.st.com \
    --cc=agraf@csgraf.de \
    --cc=bmeng.cn@gmail.com \
    --cc=grant.likely@arm.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jason.hui.liu@nxp.com \
    --cc=jose.marinho@arm.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=peng.fan@nxp.com \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.