summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-03-15 08:41:14 -0400
committerTom Rini <trini@konsulko.com>2021-03-15 08:41:14 -0400
commit1876b390f31afca15de334e499aa071b0bf64a44 (patch)
treeb22356b605c5881781ab4ea88743054558753149 /doc
parentc57ec2c2bab00c02a457ca70624c1333c60c2ec0 (diff)
parent7f047b4f5b4c86b53dbdd002322dcbf007f80623 (diff)
downloadu-boot-1876b390f31afca15de334e499aa071b0bf64a44.tar.gz
u-boot-1876b390f31afca15de334e499aa071b0bf64a44.tar.xz
u-boot-1876b390f31afca15de334e499aa071b0bf64a44.zip
Merge branch '2021-03-12-assorted-improvements' into next
- More log enhancements - A few warning fixes in some cases - Secure Channel Protocol 03 (SCP03) support for TEEs
Diffstat (limited to 'doc')
-rw-r--r--doc/arch/sandbox.rst2
-rw-r--r--doc/develop/logging.rst31
-rw-r--r--doc/usage/index.rst1
-rw-r--r--doc/usage/scp03.rst33
4 files changed, 65 insertions, 2 deletions
diff --git a/doc/arch/sandbox.rst b/doc/arch/sandbox.rst
index 1638b05000..8b18a22117 100644
--- a/doc/arch/sandbox.rst
+++ b/doc/arch/sandbox.rst
@@ -82,7 +82,7 @@ console::
You can issue commands as your would normally. If the command you want is
not supported you can add it to include/configs/sandbox.h.
-To exit, type 'reset' or press Ctrl-C.
+To exit, type 'poweroff' or press Ctrl-C.
Console / LCD support
diff --git a/doc/develop/logging.rst b/doc/develop/logging.rst
index 60c18c5b3a..f4e925048e 100644
--- a/doc/develop/logging.rst
+++ b/doc/develop/logging.rst
@@ -96,16 +96,45 @@ Also debug() and error() will generate log records - these use LOG_CATEGORY
as the category, so you should #define this right at the top of the source
file to ensure the category is correct.
+Generally each log format_string ends with a newline. If it does not, then the
+next log statement will have the LOGRECF_CONT flag set. This can be used to
+continue the statement on the same line as the previous one without emitting
+new header information (such as category/level). This behaviour is implemented
+with log_console. Here is an example that prints a list all on one line with
+the tags at the start:
+
+.. code-block:: c
+
+ log_debug("Here is a list:");
+ for (i = 0; i < count; i++)
+ log_debug(" item %d", i);
+ log_debug("\n");
+
+Also see the special category LOGL_CONT and level LOGC_CONT.
+
You can also define CONFIG_LOG_ERROR_RETURN to enable the log_ret() macro. This
can be used whenever your function returns an error value:
.. code-block:: c
- return log_ret(uclass_first_device(UCLASS_MMC, &dev));
+ return log_ret(uclass_first_device_err(UCLASS_MMC, &dev));
This will write a log record when an error code is detected (a value < 0). This
can make it easier to trace errors that are generated deep in the call stack.
+The log_msg_ret() variant will print a short string if CONFIG_LOG_ERROR_RETURN
+is enabled. So long as the string is unique within the function you can normally
+determine exactly which call failed:
+
+.. code-block:: c
+
+ ret = gpio_request_by_name(dev, "cd-gpios", 0, &desc, GPIOD_IS_IN);
+ if (ret)
+ return log_msg_ret("gpio", ret);
+
+Some functions return 0 for success and any other value is an error. For these,
+log_retz() and log_msg_retz() are available.
+
Convenience functions
~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index f7b706f916..7fac2e4f27 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -33,3 +33,4 @@ Shell commands
qfw
sbi
true
+ scp03
diff --git a/doc/usage/scp03.rst b/doc/usage/scp03.rst
new file mode 100644
index 0000000000..7ff87ed85a
--- /dev/null
+++ b/doc/usage/scp03.rst
@@ -0,0 +1,33 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+scp03 command
+=============
+
+Synopsis
+--------
+
+::
+
+ scp03 enable
+ scp03 provision
+
+Description
+-----------
+
+The *scp03* command calls into a Trusted Application executing in a
+Trusted Execution Environment to enable (if present) the Secure
+Channel Protocol 03 stablished between the processor and the secure
+element.
+
+This protocol encrypts all the communication between the processor and
+the secure element using a set of pre-defined keys. These keys can be
+rotated (provisioned) using the *provision* request.
+
+See also
+--------
+
+For some information on the internals implemented in the TEE, please
+check the GlobalPlatform documentation on `Secure Channel Protocol '03'`_
+
+.. _Secure Channel Protocol '03':
+ https://globalplatform.org/wp-content/uploads/2014/07/GPC_2.3_D_SCP03_v1.1.2_PublicRelease.pdf