TEE: minor cleanup
Subsystems (2)
cover TEE: minor cleanup
- Address some spelling errors and typos
- Support CMD_OPTEE_RPMB for SANDBOX configurations and add python tests
- Remove common.h inclusion for drivers/tee
Igor Opaniuk (5):
tee: optee: fix description in Kconfig
tee: sandbox: fix spelling errors
cmd: optee_rpmb: build cmd for sandbox
test: py: add optee_rpmb tests
tee: remove common.h inclusion
cmd/Kconfig | 4 +++- drivers/tee/broadcom/chimp_optee.c | 2 +- drivers/tee/optee/Kconfig | 2 +- drivers/tee/optee/core.c | 1 - drivers/tee/optee/i2c.c | 1 - drivers/tee/optee/rpmb.c | 1 - drivers/tee/optee/supplicant.c | 2 +- drivers/tee/sandbox.c | 10 +++++----- drivers/tee/tee-uclass.c | 1 - test/py/tests/test_optee_rpmb.py | 20 ++++++++++++++++++++ 10 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 test/py/tests/test_optee_rpmb.py
Signature · 1 line
2.34.1
PATCH 1/5 tee: optee: fix description in Kconfig
Fix OPTEE_TA_AVB symbol description in Kconfig:
s/"write"rb"/"write_rb"/g
---
drivers/tee/optee/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tee/optee/Kconfig +1 -1
@@ -19,7 +19,7 @@ config OPTEE_TA_AVB default y help Enables support for the AVB Trusted Application (TA) in OP-TEE. - The TA can support the "avb" subcommands "read_rb", "write"rb" + The TA can support the "avb" subcommands "read_rb", "write_rb" and "is_unlocked". config OPTEE_TA_RPC_TEST
Signature · 1 line
2.34.1
Re: [PATCH v1 1/5] tee: optee: fix description in Kconfig
Quoted 4 lines · Igor Opaniuk
Fix
OPTEE_TA_AVBsymbol description inKconfig:
s/"write"rb"/"write_rb"/gSigned-off-by Igor Opaniuk <[email protected]>
The change is consistent withcmd/avb.c:424:U_BOOT_CMD_MKENT(write_rb, 3, 0, do_avb_write_rb, "", ""),
Quoted 18 lines
---
drivers/tee/optee/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tee/optee/Kconfig +1
-1@@ -19,7 +19,7 @@ config OPTEE_TA_AVB default y help Enables support for the AVB Trusted Application (TA) in OP-TEE. - The TA can support the "avb" subcommands "read_rb", "write"rb" + The TA can support the "avb" subcommands "read_rb", "write_rb" and "is_unlocked". config OPTEE_TA_RPC_TEST
Re: [PATCH v1 1/5] tee: optee: fix description in Kconfig
In reply to Igor OpaniukQuoted 25 lines · Igor Opaniuk
Fix
OPTEE_TA_AVBsymbol description inKconfig:
s/"write"rb"/"write_rb"/gSigned-off-by Igor Opaniuk <[email protected]>---
drivers/tee/optee/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tee/optee/Kconfig +1
-1@@ -19,7 +19,7 @@ config OPTEE_TA_AVB default y help Enables support for the AVB Trusted Application (TA) in OP-TEE. - The TA can support the "avb" subcommands "read_rb", "write"rb" + The TA can support the "avb" subcommands "read_rb", "write_rb" and "is_unlocked". config OPTEE_TA_RPC_TESTSignature · 1 line
2.34.1
PATCH 2/5 tee: sandbox: fix spelling errors
In reply to Igor OpaniukFix spelling errors in comments.
---
drivers/tee/sandbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tee/sandbox.c +4 -4
@@ -14,7 +14,7 @@#include "optee/optee_private.h" /* -* The sandbox tee driver tries to emulate a generic Trusted Exectution +* The sandbox tee driver tries to emulate a generic Trusted Execution * Environment (TEE) with the Trusted Applications (TA) OPTEE_TA_AVB and * OPTEE_TA_RPC_TEST available. */
@@ -23,7 +23,7 @@ static const u32 pstorage_max = 16;/** * struct ta_entry - TA entries * @uuid: UUID of an emulated TA -* @open_session Called when a session is openened to the TA +* @open_session Called when a session is opened to the TA * @invoke_func Called when a function in the TA is to be invoked * * This struct is used to register TAs in this sandbox emulation of a TEE.
@@ -140,8 +140,8 @@ static u32 pta_scp03_invoke_func(struct udevice *dev, u32 func, uint num_params, provisioned = true;/* -* Either way, we asume both operations succeeded and that -* the communication channel has now been stablished +* Either way, we assume both operations succeeded and that +* the communication channel has now been established */ return TEE_SUCCESS ;
Signature · 1 line
2.34.1
Re: [PATCH v1 2/5] tee: sandbox: fix spelling errors
Quoted 3 lines · Igor Opaniuk
Fix spelling errors in comments.
Signed-off-by Igor Opaniuk <[email protected]>
Quoted 38 lines
---
drivers/tee/sandbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/tee/sandbox.c +4
-4@@ -14,7 +14,7 @@#include "optee/optee_private.h" /* -* The sandbox tee driver tries to emulate a generic Trusted Exectution +* The sandbox tee driver tries to emulate a generic Trusted Execution * Environment (TEE) with the Trusted Applications (TA) OPTEE_TA_AVB and * OPTEE_TA_RPC_TEST available. */ @@ -23,7 +23,7 @@ static const u32 pstorage_max = 16;/** * struct ta_entry - TA entries * @uuid: UUID of an emulated TA -* @open_session Called when a session is openened to the TA +* @open_session Called when a session is opened to the TA * @invoke_func Called when a function in the TA is to be invoked * * This struct is used to register TAs in this sandbox emulation of a TEE. @@ -140,8 +140,8 @@ static u32 pta_scp03_invoke_func(struct udevice *dev, u32 func, uint num_params, provisioned = true;/* -* Either way, we asume both operations succeeded and that -* the communication channel has now been stablished +* Either way, we assume both operations succeeded and that +* the communication channel has now been established */ return TEE_SUCCESS ;
Re: [PATCH v1 2/5] tee: sandbox: fix spelling errors
In reply to Igor OpaniukQuoted 44 lines · Igor Opaniuk
Fix spelling errors in comments.
Signed-off-by Igor Opaniuk <[email protected]>---
drivers/tee/sandbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/tee/sandbox.c +4
-4@@ -14,7 +14,7 @@#include "optee/optee_private.h" /* -* The sandbox tee driver tries to emulate a generic Trusted Exectution +* The sandbox tee driver tries to emulate a generic Trusted Execution * Environment (TEE) with the Trusted Applications (TA) OPTEE_TA_AVB and * OPTEE_TA_RPC_TEST available. */ @@ -23,7 +23,7 @@ static const u32 pstorage_max = 16;/** * struct ta_entry - TA entries * @uuid: UUID of an emulated TA -* @open_session Called when a session is openened to the TA +* @open_session Called when a session is opened to the TA * @invoke_func Called when a function in the TA is to be invoked * * This struct is used to register TAs in this sandbox emulation of a TEE. @@ -140,8 +140,8 @@ static u32 pta_scp03_invoke_func(struct udevice *dev, u32 func, uint num_params, provisioned = true;/* -* Either way, we asume both operations succeeded and that -* the communication channel has now been stablished +* Either way, we assume both operations succeeded and that +* the communication channel has now been established */ return TEE_SUCCESS ;Signature · 1 line
2.34.1
PATCH 3/5 cmd: optee_rpmb: build cmd for sandbox
In reply to Igor OpaniukSupport CMD_OPTEE_RPMB for SANDBOX configurations. Test:
$ ./u-boot -d arch/sandbox/dts/test.dtb ... => optee_rpmb write_pvalue test_variable test_value Wrote 11 bytes => optee_rpmb read_pvalue test_variable 11 Read 11 bytes, value = test_value
---
cmd/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
cmd/Kconfig +3 -1
@@ -1370,7 +1370,9 @@ config CMD_CLONE config CMD_OPTEE_RPMB bool "Enable read/write support on RPMB via OPTEE" - depends on SUPPORT_EMMC_RPMB && OPTEE + depends on (SUPPORT_EMMC_RPMB && OPTEE) || SANDBOX_TEE + default y if SANDBOX_TEE + select OPTEE_TA_AVB if SANDBOX_TEE help Enable the commands for reading, writing persistent named values in the Replay Protection Memory Block partition in eMMC by
Signature · 1 line
2.34.1
Re: [PATCH v1 3/5] cmd: optee_rpmb: build cmd for sandbox
Hi Igor,
Thank you for the patch.
Quoted 11 lines · Igor Opaniuk
Support
CMD_OPTEE_RPMBfor SANDBOX configurations. Test:$ ./u-boot -d arch/sandbox/dts/test.dtb ... => optee_rpmb write_pvalue test_variable test_value Wrote 11 bytes => optee_rpmb read_pvalue test_variable 11 Read 11 bytes, value = test_valueSigned-off-by Igor Opaniuk <[email protected]>
Quoted 22 lines
---
cmd/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)cmd/Kconfig +3
-1@@ -1370,7 +1370,9 @@ config CMD_CLONE config CMD_OPTEE_RPMB bool "Enable read/write support on RPMB via OPTEE" - depends on SUPPORT_EMMC_RPMB && OPTEE + depends on (SUPPORT_EMMC_RPMB && OPTEE) || SANDBOX_TEE + default y if SANDBOX_TEE + select OPTEE_TA_AVB if SANDBOX_TEE help Enable the commands for reading, writing persistent named values in the Replay Protection Memory Block partition in eMMC bySignature · 1 line
2.34.1
PATCH 4/5 test: py: add optee_rpmb tests
In reply to Igor OpaniukAdd read/write tests for optee_rpmb cmd.
---
test/py/tests/test_optee_rpmb.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/py/tests/test_optee_rpmb.py
test/py/tests/test_optee_rpmb.py new file +20 -0
@@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Tests for OP-TEE RPMB read/write support + +""" +This tests optee_rpmb cmd in U-Boot +""" + +import pytest +import u_boot_utils as util + [email protected]('cmd_optee_rpmb') +def test_optee_rpmb_read_write(u_boot_console): + """Test OP-TEE RPMB cmd read/write + """ + response = u_boot_console.run_command('optee_rpmb write_pvalue test_variable test_value') + assert response == 'Wrote 11 bytes' + + response = u_boot_console.run_command('optee_rpmb read_pvalue test_variable 11') + assert response == 'Read 11 bytes, value = test_value'
Signature · 1 line
2.34.1
PATCH 5/5 tee: remove common.h inclusion
In reply to Igor OpaniukThe usage of the common.h include file is deprecated [1], and has already been removed from several files.
Get rid of all inclusions in the "drivers/tee" directory, and replace it with required include files directly where needed.
[1] doc/develop/codingstyle.rst
---
drivers/tee/broadcom/chimp_optee.c | 2 +- drivers/tee/optee/core.c | 1 - drivers/tee/optee/i2c.c | 1 - drivers/tee/optee/rpmb.c | 1 - drivers/tee/optee/supplicant.c | 2 +- drivers/tee/sandbox.c | 2 +- drivers/tee/tee-uclass.c | 1 - 7 files changed, 3 insertions(+), 7 deletions(-)
drivers/tee/broadcom/chimp_optee.c +1 -1
@@ -3,9 +3,9 @@* Copyright 2020 Broadcom. */ -#include <common.h> #include <tee.h> #include <broadcom/chimp.h> +#include <linux/errno.h> #ifdef CONFIG_CHIMP_OPTEE
drivers/tee/optee/core.c +0 -1
@@ -3,7 +3,6 @@* Copyright (c) 2018-2020 Linaro Limited */ -#include <common.h> #include <cpu_func.h> #include <dm.h> #include <dm/device_compat.h>
drivers/tee/optee/i2c.c +0 -1
@@ -3,7 +3,6 @@* Copyright (c) 2020 Foundries.io Ltd */ -#include <common.h> #include <dm.h> #include <i2c.h> #include <tee.h>
drivers/tee/optee/rpmb.c +0 -1
@@ -3,7 +3,6 @@* Copyright (c) 2018 Linaro Limited */ -#include <common.h> #include <dm.h> #include <log.h> #include <tee.h>
drivers/tee/optee/supplicant.c +1 -1
@@ -3,10 +3,10 @@* Copyright (c) 2018, Linaro Limited */ -#include <common.h> #include <log.h> #include <malloc.h> #include <tee.h> +#include <linux/errno.h> #include <linux/types.h> #include "optee_msg.h"
drivers/tee/sandbox.c +1 -1
@@ -2,7 +2,7 @@/* * Copyright (C) 2018 Linaro Limited */ -#include <common.h> +#include <dm.h> #include <sandboxtee.h> #include <tee.h>
drivers/tee/tee-uclass.c +0 -1
@@ -5,7 +5,6 @@#define LOG_CATEGORY UCLASS_TEE -#include <common.h> #include <cpu_func.h> #include <dm.h> #include <log.h>
Signature · 1 line
2.34.1
Hi Ilias,
Quoted 24 lines · Igor Opaniuk
- Address some spelling errors and typos
- SupportCMD_OPTEE_RPMBfor SANDBOX configurations and add python tests
- Removecommon.hinclusion fordrivers/teeIgor Opaniuk (5):
tee: optee: fix description inKconfig
tee: sandbox: fix spelling errors
cmd:optee_rpmb: build cmd for sandbox
test: py: addoptee_rpmbtests
tee: removecommon.hinclusioncmd/Kconfig | 4 +++- drivers/tee/broadcom/chimp_optee.c | 2 +- drivers/tee/optee/Kconfig | 2 +- drivers/tee/optee/core.c | 1 - drivers/tee/optee/i2c.c | 1 - drivers/tee/optee/rpmb.c | 1 - drivers/tee/optee/supplicant.c | 2 +- drivers/tee/sandbox.c | 10 +++++----- drivers/tee/tee-uclass.c | 1 - test/py/tests/test_optee_rpmb.py | 20 ++++++++++++++++++++ 10 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 test/py/tests/test_optee_rpmb.py
Quoted 4 lines
--
2.34.1
Are there currently any comments/objections that can prevent these cosmetic changes from being applied? If there are - just let me know, thanks
Regards,
Igor
Signature · 7 lines
Best regards - Atentamente - Meilleures salutations Igor Opaniuk mailto: [email protected] skype: igor.opanyuk http://ua.linkedin.com/in/iopaniuk
Quoted 30 lines · Igor Opaniuk
Hi Ilias,
Quoted 24 lines · Igor Opaniuk
- Address some spelling errors and typos
- SupportCMD_OPTEE_RPMBfor SANDBOX configurations and add python tests
- Removecommon.hinclusion fordrivers/teeIgor Opaniuk (5):
tee: optee: fix description inKconfig
tee: sandbox: fix spelling errors
cmd:optee_rpmb: build cmd for sandbox
test: py: addoptee_rpmbtests
tee: removecommon.hinclusioncmd/Kconfig | 4 +++- drivers/tee/broadcom/chimp_optee.c | 2 +- drivers/tee/optee/Kconfig | 2 +- drivers/tee/optee/core.c | 1 - drivers/tee/optee/i2c.c | 1 - drivers/tee/optee/rpmb.c | 1 - drivers/tee/optee/supplicant.c | 2 +- drivers/tee/sandbox.c | 10 +++++----- drivers/tee/tee-uclass.c | 1 - test/py/tests/test_optee_rpmb.py | 20 ++++++++++++++++++++ 10 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 test/py/tests/test_optee_rpmb.py
Quoted 6 lines
Quoted 4 lines
--
2.34.1Are there currently any comments/objections that can prevent these cosmetic changes from being applied? If there are - just let me know, thanks
Probably awaiting the next dev cycle, we're post RC3 now so it's mostly fixes landing ATM.
Quoted 35 lines · Peter Robinson
Quoted 34 lines · Igor Opaniuk
Hi Ilias,
Quoted 28 lines · Igor Opaniuk
- Address some spelling errors and typos
- SupportCMD_OPTEE_RPMBfor SANDBOX configurations and add python tests
- Removecommon.hinclusion fordrivers/teeIgor Opaniuk (5):
tee: optee: fix description inKconfig
tee: sandbox: fix spelling errors
cmd:optee_rpmb: build cmd for sandbox
test: py: addoptee_rpmbtests
tee: removecommon.hinclusioncmd/Kconfig | 4 +++- drivers/tee/broadcom/chimp_optee.c | 2 +- drivers/tee/optee/Kconfig | 2 +- drivers/tee/optee/core.c | 1 - drivers/tee/optee/i2c.c | 1 - drivers/tee/optee/rpmb.c | 1 - drivers/tee/optee/supplicant.c | 2 +- drivers/tee/sandbox.c | 10 +++++----- drivers/tee/tee-uclass.c | 1 - test/py/tests/test_optee_rpmb.py | 20 ++++++++++++++++++++ 10 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 test/py/tests/test_optee_rpmb.py--
2.34.1
Quoted 5 lines
Quoted 2 lines
Are there currently any comments/objections that can prevent these cosmetic changes from being applied? If there are - just let me know, thanks
Probably awaiting the next dev cycle, we're post RC3 now so it's mostly fixes landing ATM.
The -next branch is open too now tho, and I am picking up things out of my queue. And other custodians can as well, time permitting :)
Signature · 1 line
Tom
Hi Igor,
Quoted 8 lines · Igor Opaniuk
Hi Ilias,
Quoted 4 lines · Igor Opaniuk
- Address some spelling errors and typos
- SupportCMD_OPTEE_RPMBfor SANDBOX configurations and add python tests
- Removecommon.hinclusion fordrivers/tee
CI fails on https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/19780
Can you have a look?
Thanks
/Ilias
Quoted 39 lines
Quoted 21 lines
Igor Opaniuk (5):
tee: optee: fix description inKconfig
tee: sandbox: fix spelling errors
cmd:optee_rpmb: build cmd for sandbox
test: py: addoptee_rpmbtests
tee: removecommon.hinclusioncmd/Kconfig | 4 +++- drivers/tee/broadcom/chimp_optee.c | 2 +- drivers/tee/optee/Kconfig | 2 +- drivers/tee/optee/core.c | 1 - drivers/tee/optee/i2c.c | 1 - drivers/tee/optee/rpmb.c | 1 - drivers/tee/optee/supplicant.c | 2 +- drivers/tee/sandbox.c | 10 +++++----- drivers/tee/tee-uclass.c | 1 - test/py/tests/test_optee_rpmb.py | 20 ++++++++++++++++++++ 10 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 test/py/tests/test_optee_rpmb.pyQuoted 3 lines
--
2.34.1Are there currently any comments/objections that can prevent these cosmetic changes from being applied? If there are - just let me know, thanks
Regards,
Igor--
Best regards - Atentamente - Meilleures salutationsIgor Opaniuk
mailto: [email protected]
skype: igor.opanyuk
http://ua.linkedin.com/in/iopaniuk
Hello Ilias,
Quoted 9 lines · Ilias Apalodimas
Hi Igor,
Quoted 4 lines · Igor Opaniuk
Hi Ilias,
On Wed, Feb 14, 2024 at 7:34 PM Igor Opaniuk <[email protected]>
Quoted 1 line · wrote:
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
- Address some spelling errors and typos
- SupportCMD_OPTEE_RPMBfor SANDBOX configurations and add python tests
- Removecommon.hinclusion fordrivers/teeCI fails on
https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/19780
Can you have a look?
I've fixed and sent v2, thanks!
Quoted 44 lines
Thanks
/IliasQuoted 21 lines
Quoted 21 lines
Igor Opaniuk (5):
tee: optee: fix description inKconfig
tee: sandbox: fix spelling errors
cmd:optee_rpmb: build cmd for sandbox
test: py: addoptee_rpmbtests
tee: removecommon.hinclusioncmd/Kconfig | 4 +++- drivers/tee/broadcom/chimp_optee.c | 2 +- drivers/tee/optee/Kconfig | 2 +- drivers/tee/optee/core.c | 1 - drivers/tee/optee/i2c.c | 1 - drivers/tee/optee/rpmb.c | 1 - drivers/tee/optee/supplicant.c | 2 +- drivers/tee/sandbox.c | 10 +++++----- drivers/tee/tee-uclass.c | 1 - test/py/tests/test_optee_rpmb.py | 20 ++++++++++++++++++++ 10 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 test/py/tests/test_optee_rpmb.pyQuoted 5 lines
Quoted 3 lines
--
2.34.1Are there currently any comments/objections that can prevent these
cosmetic
Quoted 13 lines
changes from being applied? If there are - just let me know, thanks
Regards,
Igor--
Best regards - Atentamente - Meilleures salutationsIgor Opaniuk
mailto: [email protected]
skype: igor.opanyuk
http://ua.linkedin.com/in/iopaniuk
Signature · 7 lines
Best regards - Atentamente - Meilleures salutations Igor Opaniuk mailto: [email protected] skype: igor.opanyuk http://ua.linkedin.com/in/iopaniuk