From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] imx: hab: Add routine to set HAB IVT address
Date: Fri, 16 Mar 2018 09:17:50 +0100 [thread overview]
Message-ID: <20180316091750.253be6de@karo-electronics.de> (raw)
In-Reply-To: <1520616949-11879-2-git-send-email-bryan.odonoghue@linaro.org>
Hi,
On Fri, 9 Mar 2018 17:35:46 +0000 Bryan O'Donoghue wrote:
> This patch takes a given address applies a plus or minus offset to locate
> the putative address of an IVT given a non-IVT link location.
>
> It then sets hab_ivt_address to allow for further logic/scripting based on
> the calculated address.
>
> This routine is useful when scripting hab_auth_img calls from boot.scr.
> Subsequent patches will illustrate its utility in a board-port.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
> Cc: Breno Lima <breno.lima@nxp.com>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> ---
> arch/arm/mach-imx/hab.c | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
> index c730c8f..0c18b2e 100644
> --- a/arch/arm/mach-imx/hab.c
> +++ b/arch/arm/mach-imx/hab.c
> @@ -341,6 +341,31 @@ static int do_hab_failsafe(cmd_tbl_t *cmdtp, int flag, int argc,
> return 0;
> }
>
> +/*
> + * This routine takes a given address and applies a plus or minus offset to that
> + * address.
> + */
> +static int do_hab_get_ivt_addr(cmd_tbl_t *cmdtp, int flag, int argc,
> + char * const argv[])
> +{
> + ulong addr;
> + long ivt_offset;
> +
> + if (argc < 3)
> + return CMD_RET_USAGE;
> +
> + if (!imx_hab_is_enabled())
> + return CMD_RET_FAILURE;
> +
> + addr = simple_strtoul(argv[1], NULL, 16);
> + ivt_offset = simple_strtol(argv[2], NULL, 16);
> + addr += ivt_offset;
> +
> + env_set_hex("hab_ivt_addr", addr);
> +
> + return CMD_RET_SUCCESS;
> +}
> +
> U_BOOT_CMD(
> hab_status, CONFIG_SYS_MAXARGS, 1, do_hab_status,
> "display HAB status",
>
What does this function offer, that a
'setexpr hab_ivt_addr ${loadaddr} + 0x400' could not do as well?
Lothar Waßmann
next prev parent reply other threads:[~2018-03-16 8:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 17:35 [U-Boot] [PATCH 0/4] imx: hab: Add helper functions for scripted HAB auth Bryan O'Donoghue
2018-03-09 17:35 ` [U-Boot] [PATCH 1/4] imx: hab: Add routine to set HAB IVT address Bryan O'Donoghue
2018-03-15 16:37 ` Breno Matheus Lima
2018-03-16 8:17 ` Lothar Waßmann [this message]
2018-03-17 10:55 ` Bryan O'Donoghue
2018-03-09 17:35 ` [U-Boot] [PATCH 2/4] imx: hab: Encase majority of header in __ASSEMBLY__ declaration Bryan O'Donoghue
2018-03-15 16:38 ` Breno Matheus Lima
2018-03-09 17:35 ` [U-Boot] [PATCH 3/4] imx: hab: Specify IVT padding size Bryan O'Donoghue
2018-03-15 16:54 ` Breno Matheus Lima
2018-03-17 11:06 ` Bryan O'Donoghue
2018-03-19 17:53 ` Breno Matheus Lima
2018-03-21 4:47 ` Bryan O'Donoghue
2018-03-09 17:35 ` [U-Boot] [PATCH 4/4] imx: hab: Provide hab_auth_img_or_fail command Bryan O'Donoghue
2018-03-15 17:15 ` Breno Matheus Lima
2018-03-17 11:06 ` Bryan O'Donoghue
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=20180316091750.253be6de@karo-electronics.de \
--to=lw@karo-electronics.de \
--cc=u-boot@lists.denx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox