public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
To: u-boot@lists.denx.de
Cc: Alexandru Gagniuc <mr.nuke.me@gmail.com>,
	patrick.delaunay@foss.st.com, etienne.carriere@linaro.org,
	sbabic@denx.de, festevam@gmail.com
Subject: [PATCH 0/4] Repeal and replace TZDRAM_ related config options
Date: Tue,  7 Sep 2021 12:07:05 -0500	[thread overview]
Message-ID: <20210907170709.2684890-1-mr.nuke.me@gmail.com> (raw)

When enabling OPTEE support in the config menu, one is asked for the
TZDRAM region and OPTEE load address. It would seem that these are
very important values, not just some half-assed bollocks.

There are currently three sources of information regarding OPTEE and
its associated DRAM region:
    1) Devicetree "/reserved-memory" nodes
    2) uImage and FIT load-address and entry-point
    3) The CONFIG_s currently under scrutiny

(1) and (2) are sufficient to identify and reject OP-TEE images which
fall outside TZDRAM. Such a check might make sense in the context of
not bricking a device. But if an incompatible image was already
installed, the device is likely soft-bricked anyway and needs manual
intervention. This series doesn't implement such a check.

It is possible for (1) and (3) to be in conflict. Because the values
in (3) default to 0x0, it is very likely to happen. Such a situation
causes the "bootm" command to reject otherwise valid OP-TEE images.
Thus a perfectly tuned u-boot which doesn't also set (3) will be
non-functional with respect to OP-TEE images.

This becomes confusing, and has caused yours truly a disproportionate
amount of grief.
Fortunately, SPL can also load OP-TEE images, and does not even look
at the values in (3). It only uses (1) and (2) to determine the
appropriate values for firing up OP-TEE. It is more reliable and easy
to use than "bootm".

We are able to remove these configs without breaking anything. This
also resolves the problems with "bootm" mentioned earlier.

I hypothesize that one could re-add the removed checks from
optee_verify_image() by deriving TZDRAM information from (1) instead
of (3). I chose not to implement it because I don't see the value.



Alexandru Gagniuc (4):
  lib: optee: Avoid CONFIG_TZDRAM_* in optee_verify_bootm_image()
  lib: optee: Remove CONFIG_OPTEE_TZDRAM_BASE
  lib: optee: Remove CONFIG_OPTEE_LOAD_ADDR
  arm: imx: mx7: Move CONFIG_OPTEE_TZDRAM_SIZE from lib/optee

 arch/arm/mach-imx/mx7/Kconfig |  8 ++++++++
 configs/warp7_bl33_defconfig  |  1 -
 configs/warp7_defconfig       |  2 --
 include/configs/warp7.h       |  5 -----
 include/tee/optee.h           | 14 --------------
 lib/optee/Kconfig             | 23 -----------------------
 lib/optee/optee.c             | 21 ++++++---------------
 7 files changed, 14 insertions(+), 60 deletions(-)

-- 
2.31.1


             reply	other threads:[~2021-09-07 17:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 17:07 Alexandru Gagniuc [this message]
2021-09-07 17:07 ` [PATCH 1/4] lib: optee: Avoid CONFIG_TZDRAM_* in optee_verify_bootm_image() Alexandru Gagniuc
2021-10-05 22:01   ` Tom Rini
2021-09-07 17:07 ` [PATCH 2/4] lib: optee: Remove CONFIG_OPTEE_TZDRAM_BASE Alexandru Gagniuc
2021-10-05 22:01   ` Tom Rini
2021-09-07 17:07 ` [PATCH 3/4] lib: optee: Remove CONFIG_OPTEE_LOAD_ADDR Alexandru Gagniuc
2021-10-05 22:01   ` Tom Rini
2021-09-07 17:07 ` [PATCH 4/4] arm: imx: mx7: Move CONFIG_OPTEE_TZDRAM_SIZE from lib/optee Alexandru Gagniuc
2021-10-05 22:02   ` Tom Rini

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=20210907170709.2684890-1-mr.nuke.me@gmail.com \
    --to=mr.nuke.me@gmail.com \
    --cc=etienne.carriere@linaro.org \
    --cc=festevam@gmail.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sbabic@denx.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