All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas
@ 2019-04-24  0:43 Bryan O'Donoghue
  2019-04-24  0:43 ` [U-Boot] [PATCH 1/4] optee: Make TZDRAM config options contingent on CONFIG_OPTEE Bryan O'Donoghue
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2019-04-24  0:43 UTC (permalink / raw)
  To: u-boot

Rober P Day rightly pointed out that some odd OP-TEE specific defines were
appearing in his defconfig, despite not having CONFIG_OPTEE=y set in his
defconfig.

Looking into this with a small bit of restructure we can fix this corner
case.

- Make sure OP-TEE CONFIG options only appear when you are compiling for
  OPTEE
- Fix WaRP7 BL33 so that the low-level init skipping routines can tolerate
  the afore mentioned change.
- Update MAINTAINERS with my own details so that questions pertaining to
  lib/optee comes my way.

Bryan O'Donoghue (4):
  optee: Make TZDRAM config options contingent on CONFIG_OPTEE
  warp7: include: configs: Skip low-level init if BOOTM_OPTEE false
  warp7: configs: bl33: Tidy up OPTEE defines
  MAINTAINERS: Update lib/optee with my details

 MAINTAINERS                  | 5 +++++
 configs/warp7_bl33_defconfig | 4 +++-
 include/configs/warp7.h      | 4 +---
 lib/optee/Kconfig            | 2 ++
 4 files changed, 11 insertions(+), 4 deletions(-)

-- 
2.20.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/4] optee: Make TZDRAM config options contingent on CONFIG_OPTEE
  2019-04-24  0:43 [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
@ 2019-04-24  0:43 ` Bryan O'Donoghue
  2019-04-24  0:43 ` [U-Boot] [PATCH 2/4] warp7: include: configs: Skip low-level init if BOOTM_OPTEE false Bryan O'Donoghue
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2019-04-24  0:43 UTC (permalink / raw)
  To: u-boot

Commit c7b3a7ee5351 ("optee: adjust dependencies and default values for
dram") makes the TZDRAM defines for OPTEE show up for all configs as a
side-effect. While not harmful its not what we really want.

This patch makes the following defines contingent on CONFIG_OPTEE=y

CONFIG_OPTEE_TZDRAM_BASE
CONFIG_OPTEE_TZDRAM_SIZE

Rightly, if you don't have CONFIG_OPTEE=y you don't care about the above
two defines.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Rui Miguel Silva <rui.silva@linaro.org>
---
 lib/optee/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/optee/Kconfig b/lib/optee/Kconfig
index 3773d89c31..c398f9b953 100644
--- a/lib/optee/Kconfig
+++ b/lib/optee/Kconfig
@@ -17,6 +17,7 @@ config OPTEE_LOAD_ADDR
 config OPTEE_TZDRAM_SIZE
 	hex "Amount of Trust-Zone RAM for the OPTEE image"
 	default 0x0000000
+	depends on OPTEE
 	help
 	  The size of pre-allocated Trust Zone DRAM to allocate for the OPTEE
 	  runtime.
@@ -24,6 +25,7 @@ config OPTEE_TZDRAM_SIZE
 config OPTEE_TZDRAM_BASE
 	hex "Base address of Trust-Zone RAM for the OPTEE image"
 	default 0x00000000
+	depends on OPTEE
 	help
 	  The base address of pre-allocated Trust Zone DRAM for
 	  the OPTEE runtime.
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/4] warp7: include: configs: Skip low-level init if BOOTM_OPTEE false
  2019-04-24  0:43 [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
  2019-04-24  0:43 ` [U-Boot] [PATCH 1/4] optee: Make TZDRAM config options contingent on CONFIG_OPTEE Bryan O'Donoghue
@ 2019-04-24  0:43 ` Bryan O'Donoghue
  2019-04-24  0:43 ` [U-Boot] [PATCH 3/4] warp7: configs: bl33: Tidy up OPTEE defines Bryan O'Donoghue
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2019-04-24  0:43 UTC (permalink / raw)
  To: u-boot

Commit c7b3a7ee5351 ("optee: adjust dependencies and default values for
dram") wants to skip low-level init of i.MX7 hardware in the case where
OP-TEE has already run and u-boot is being run as BL33 in normal world.

Currently we check for both #ifdef CONFIG_OPTEE_TZDRAM_SIZE and #ifndef
CONFIG_OPTEE to determine if lowlevel init should be skipped, however, in
order to ensure non-OPTEE users never see OPTEE related defines we cannot
rely on this method.

Fortunately we can use CONFIG_BOOTM_OPTEE for the same purpose.
CONFIG_BOOTM_OPTEE is only relevant if you want u-boot to load OP-TEE not
if u-boot has already been loaded by OP-TEE.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Rui Miguel Silva <rui.silva@linaro.org>
---
 include/configs/warp7.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 043f2861b6..458cb8fe10 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -18,11 +18,9 @@
  * launched by OPTEE, because of that we shall skip all the low level
  * initialization since it was already done by ATF or OPTEE
  */
-#ifdef CONFIG_OPTEE_TZDRAM_SIZE
-#ifndef CONFIG_OPTEE
+#ifndef CONFIG_BOOTM_OPTEE
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
-#endif
 
 #define CONFIG_MXC_UART_BASE		UART1_IPS_BASE_ADDR
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 3/4] warp7: configs: bl33: Tidy up OPTEE defines
  2019-04-24  0:43 [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
  2019-04-24  0:43 ` [U-Boot] [PATCH 1/4] optee: Make TZDRAM config options contingent on CONFIG_OPTEE Bryan O'Donoghue
  2019-04-24  0:43 ` [U-Boot] [PATCH 2/4] warp7: include: configs: Skip low-level init if BOOTM_OPTEE false Bryan O'Donoghue
@ 2019-04-24  0:43 ` Bryan O'Donoghue
  2019-04-24  0:43 ` [U-Boot] [PATCH 4/4] MAINTAINERS: Update lib/optee with my details Bryan O'Donoghue
  2019-04-30  1:30 ` [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
  4 siblings, 0 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2019-04-24  0:43 UTC (permalink / raw)
  To: u-boot

When booting in BL33 mode i.e. with u-boot loaded by OP-TEE we get the
following print-out.

Board: WARP7 in secure mode OPTEE DRAM 0xa0000000-0xa0000000

This is incorrect the right range is 0x9e000000-0xa0000000. This patch
fixes the defines on the warp7_bl33_defconfig file to tidy up the output.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
---
 configs/warp7_bl33_defconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 6eaf152bac..8cc622fe47 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -50,4 +50,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
-CONFIG_OPTEE_TZDRAM_SIZE=0x2000000
+CONFIG_OPTEE=y
+CONFIG_OPTEE_TZDRAM_BASE=0x9e000000
+CONFIG_OPTEE_TZDRAM_SIZE=0x02000000
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 4/4] MAINTAINERS: Update lib/optee with my details
  2019-04-24  0:43 [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
                   ` (2 preceding siblings ...)
  2019-04-24  0:43 ` [U-Boot] [PATCH 3/4] warp7: configs: bl33: Tidy up OPTEE defines Bryan O'Donoghue
@ 2019-04-24  0:43 ` Bryan O'Donoghue
  2019-04-30  1:30 ` [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
  4 siblings, 0 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2019-04-24  0:43 UTC (permalink / raw)
  To: u-boot

Commit 32ce6179fb99 ("optee: Add lib entries for sharing OPTEE code across
ports") adds code into lib/optee but neglects to update MAINTAINERS to make
me buggable for questions and maintenance.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Suggested-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 MAINTAINERS | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index aa4b3bc650..16ea180fe2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -754,6 +754,11 @@ F:	drivers/tee/
 F:	include/tee.h
 F:	include/tee/
 
+TEE-lib
+M:	Bryan O'Donoghue <bryan.odonoghue@linaro.org>
+S:	Maintained
+F:	lib/optee
+
 UBI
 M:	Kyungmin Park <kmpark@infradead.org>
 M:	Heiko Schocher <hs@denx.de>
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas
  2019-04-24  0:43 [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
                   ` (3 preceding siblings ...)
  2019-04-24  0:43 ` [U-Boot] [PATCH 4/4] MAINTAINERS: Update lib/optee with my details Bryan O'Donoghue
@ 2019-04-30  1:30 ` Bryan O'Donoghue
  2019-04-30 11:20   ` Rui Miguel Silva
  2019-04-30 12:59   ` Fabio Estevam
  4 siblings, 2 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2019-04-30  1:30 UTC (permalink / raw)
  To: u-boot



On 24/04/2019 01:43, Bryan O'Donoghue wrote:
> Rober P Day rightly pointed out that some odd OP-TEE specific defines were
> appearing in his defconfig, despite not having CONFIG_OPTEE=y set in his
> defconfig.

Ping,

Robert, Rui, Fabio - do you guys want changes here ?

---
bod

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas
  2019-04-30  1:30 ` [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
@ 2019-04-30 11:20   ` Rui Miguel Silva
  2019-04-30 12:59   ` Fabio Estevam
  1 sibling, 0 replies; 8+ messages in thread
From: Rui Miguel Silva @ 2019-04-30 11:20 UTC (permalink / raw)
  To: u-boot

Hi Bryan,
On Tue 30 Apr 2019 at 02:30, Bryan O'Donoghue wrote:
> On 24/04/2019 01:43, Bryan O'Donoghue wrote:
>> Rober P Day rightly pointed out that some odd OP-TEE specific defines were
>> appearing in his defconfig, despite not having CONFIG_OPTEE=y set in his
>> defconfig.
>
> Ping,
>
> Robert, Rui, Fabio - do you guys want changes here ?

Regarding OPTEE, patches 1/4 and 2/4:
Acked-by: Rui Miguel Silva <rui.silva@linaro.org>

---
Cheers,
	Rui

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas
  2019-04-30  1:30 ` [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
  2019-04-30 11:20   ` Rui Miguel Silva
@ 2019-04-30 12:59   ` Fabio Estevam
  1 sibling, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2019-04-30 12:59 UTC (permalink / raw)
  To: u-boot

On Mon, Apr 29, 2019 at 10:31 PM Bryan O'Donoghue
<bryan.odonoghue@linaro.org> wrote:
>
>
>
> On 24/04/2019 01:43, Bryan O'Donoghue wrote:
> > Rober P Day rightly pointed out that some odd OP-TEE specific defines were
> > appearing in his defconfig, despite not having CONFIG_OPTEE=y set in his
> > defconfig.
>
> Ping,
>
> Robert, Rui, Fabio - do you guys want changes here ?

Looks good to me.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-04-30 12:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24  0:43 [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
2019-04-24  0:43 ` [U-Boot] [PATCH 1/4] optee: Make TZDRAM config options contingent on CONFIG_OPTEE Bryan O'Donoghue
2019-04-24  0:43 ` [U-Boot] [PATCH 2/4] warp7: include: configs: Skip low-level init if BOOTM_OPTEE false Bryan O'Donoghue
2019-04-24  0:43 ` [U-Boot] [PATCH 3/4] warp7: configs: bl33: Tidy up OPTEE defines Bryan O'Donoghue
2019-04-24  0:43 ` [U-Boot] [PATCH 4/4] MAINTAINERS: Update lib/optee with my details Bryan O'Donoghue
2019-04-30  1:30 ` [U-Boot] [PATCH 0/4] Tidy up some dangling OP-TEE gotchas Bryan O'Donoghue
2019-04-30 11:20   ` Rui Miguel Silva
2019-04-30 12:59   ` Fabio Estevam

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.