All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/9] optee: Make OPTEE_TZDRAM_BASE a mandatory define
Date: Fri, 12 Jan 2018 11:23:22 -0500	[thread overview]
Message-ID: <20180112162322.GQ4660@bill-the-cat> (raw)
In-Reply-To: <1515768744-25246-4-git-send-email-bryan.odonoghue@linaro.org>

On Fri, Jan 12, 2018 at 02:52:18PM +0000, Bryan O'Donoghue wrote:

> This patch makes OTPEE_TZDRAM_BASE a mandatory parameter.
> Subsequent patches will ensure that the region between
> OTPEE_TZDRAM_BASE and (OTPEE_TZDRAM_BASE +
> CONFIG_OPTEE_TZDRAM_SIZE) match the information given in the OPTEE header
> before handing off control to the OPTEE image when booting OPTEE directly
> via bootm.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Cc: Harinarayan Bhatta <harinarayan@ti.com>
> Cc: Andrew F. Davis <afd@ti.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Cc: Peng Fan <peng.fan@nxp.com>
> ---
>  lib/optee/optee.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/lib/optee/optee.c b/lib/optee/optee.c
> index a6c856a..6e55027 100644
> --- a/lib/optee/optee.c
> +++ b/lib/optee/optee.c
> @@ -5,9 +5,14 @@
>   * SPDX-License-Identifier:	GPL-2.0+
>   */
>  
> +#include <config.h>
>  #include <common.h>
>  #include <tee/optee.h>
>  
> +#ifndef OPTEE_TZDRAM_BASE
> +#error "OPTEE_TZDRAM_BASE not defined"
> +#endif
> +
>  int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start,
>  		       unsigned long tzdram_len, unsigned long image_len)
>  {

I'm not a fan of adding #error's like this.  Since this is a static
value,it should be in Kconfig (with appropriate depends) or defined in a
consistent location (asm/arch/optee.h ?) and it should be obvious from
the code that uses the value that you need to have this value be
provided and how to determine what the valid and correct value is.
Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180112/373009ef/attachment.sig>

  reply	other threads:[~2018-01-12 16:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 14:52 [U-Boot] [PATCH 0/9] Add new OPTEE bootm support to u-boot Bryan O'Donoghue
2018-01-12 14:52 ` [U-Boot] [PATCH 1/9] optee: Add lib entries for sharing OPTEE code across ports Bryan O'Donoghue
2018-01-12 14:52 ` [U-Boot] [PATCH 2/9] optee: Add CONFIG_OPTEE_TZDRAM_SIZE Bryan O'Donoghue
2018-01-12 14:52 ` [U-Boot] [PATCH 3/9] optee: Make OPTEE_TZDRAM_BASE a mandatory define Bryan O'Donoghue
2018-01-12 16:23   ` Tom Rini [this message]
2018-01-12 14:52 ` [U-Boot] [PATCH 4/9] optee: Add optee_image_get_entry_point() Bryan O'Donoghue
2018-01-12 14:52 ` [U-Boot] [PATCH 5/9] optee: Add optee_image_get_load_addr() Bryan O'Donoghue
2018-01-12 14:52 ` [U-Boot] [PATCH 6/9] tools: mkimage: add optee image type Bryan O'Donoghue
2018-01-12 14:52 ` [U-Boot] [PATCH 7/9] optee: Add optee_verify_bootm_image() Bryan O'Donoghue
2018-01-12 14:52 ` [U-Boot] [PATCH 8/9] optee: Improve error printout Bryan O'Donoghue
2018-01-12 14:52 ` [U-Boot] [PATCH 9/9] bootm: optee: Add mechanism to validate an OPTEE image before boot Bryan O'Donoghue
2018-01-15  4:00 ` [U-Boot] [PATCH 0/9] Add new OPTEE bootm support to u-boot Peng Fan
2018-01-15  4:39 ` Kever Yang
2018-01-15 10:24   ` Dr. Philipp Tomsich
2018-01-15 10:29     ` Dr. Philipp Tomsich
2018-01-15 12:03       ` Peng Fan
2018-01-15 13:26         ` Dr. Philipp Tomsich
2018-01-15 14:01         ` 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=20180112162322.GQ4660@bill-the-cat \
    --to=trini@konsulko.com \
    --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 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.