[PATCH v4 2/2] doc: man-page for optee commands

Jerome Forissier jerome.forissier at linaro.org
Tue Dec 17 09:23:20 CET 2024


Hi Venkatesh,

Some suggestions below.

On 12/17/24 04:59, Venkatesh Yadav Abbarapu wrote:
> Provide a man-page for the optee command.
> 
> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu at amd.com>
> ---
>  doc/usage/cmd/optee.rst | 66 +++++++++++++++++++++++++++++++++++++++++
>  doc/usage/index.rst     |  1 +
>  2 files changed, 67 insertions(+)
>  create mode 100644 doc/usage/cmd/optee.rst
> 
> diff --git a/doc/usage/cmd/optee.rst b/doc/usage/cmd/optee.rst
> new file mode 100644
> index 00000000000..53e36853742
> --- /dev/null
> +++ b/doc/usage/cmd/optee.rst
> @@ -0,0 +1,66 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +
> +.. index::
> +   single: optee (command)
> +
> +optee command
> +=============
> +
> +Synopsis
> +--------
> +
> +::
> +
> +    optee hello
> +    optee hello <value>
> +
> +Description
> +-----------
> +
> +This is a very simple optee hello command which is going to
> +increment an integer value.

While this description may be good enough, I believe it would be
better to say more about the real purpose. This is a test command.

"""
This is an OP-TEE sanity test which invokes the "Hello World"
Trusted Application (TA). The TA does two things:
- It prints debug and information messages to the secure
console (if logging is enabled)
- It increments the integer value passed as a parameter and
returns it
"""

> +
> +value
> +	value to be passed which is going to increment

Integer value that the TA is expected to increment and return.
The default value is 0.

> +
> +To enable the OP-TEE OS side HELLO WORLD example please refer

To enable the OP-TEE Hello World example please refer to

> +https://optee.readthedocs.io/en/latest/building/gits/optee_examples/optee_examples.html
> +
> +Examples
> +--------
> +
> +::
> +
> +	==> optee hello
> +	The Hello World TA is going to be called
> +	D/TA:  TA_CreateEntryPoint:39 has been called
> +	I/TA: Hello World!
> +	TA value: 0x0
> +	D/TA:  inc_value:105 has been called
> +	I/TA: Got value: 0 from NW
> +	I/TA: Increase value to: 1
> +	TA value: 0x1
> +	I/TA: Goodbye!
> +	D/TA:  TA_DestroyEntryPoint:50 has been called

This output doesn't match with the code in 1/2

 +       printf("value: 0x%x TA value: 0x%x\n", value, (int)param[0].u.value.a);

> +
> +	===> optee hello 74
> +	The Hello World TA is going to be called
> +	D/TA:  TA_CreateEntryPoint:39 has been called
> +	I/TA: Hello World!
> +	TA value: 0x74
> +	D/TA:  inc_value:105 has been called
> +	I/TA: Got value: 116 from NW
> +	I/TA: Increase value to: 117
> +	TA value: 0x75
> +	I/TA: Goodbye!
> +	D/TA:  TA_DestroyEntryPoint:50 has been called
> +
> +Configuration
> +-------------
> +
> +The optee command is enabled by CONFIG_OPTEE=y and CONFIG_CMD_OPTEE=y.
> +
> +Return value
> +------------
> +
> +The return value $? is 0 (true) if the command succeeds, 1 (false) otherwise.
> diff --git a/doc/usage/index.rst b/doc/usage/index.rst
> index cb7a23f1170..4dd00f002cd 100644
> --- a/doc/usage/index.rst
> +++ b/doc/usage/index.rst
> @@ -92,6 +92,7 @@ Shell commands
>     cmd/msr
>     cmd/mtest
>     cmd/mtrr
> +   cmd/optee
>     cmd/panic
>     cmd/part
>     cmd/pause


Thanks,
-- 
Jerome


More information about the U-Boot mailing list