Skip to content

Commit 9af3a16

Browse files
SebastianBoerlubos
authored andcommitted
doc: ironside: Expand on IronSide SE docs
Add documentation for BOOTMODE.DEBUGWAIT. Add documentation for BOOTMODE.SECONDARYMODE. Add documentation for BOOTSTATUS.SECONDARYMODE. Expand on how to configure a secondary firmware. Remove existing UICR secondary firmware docs as they were describing the UICR interface instead of the Kconfig interface. Signed-off-by: Sebastian Bøe <[email protected]>
1 parent eef0a7e commit 9af3a16

File tree

1 file changed

+68
-74
lines changed

1 file changed

+68
-74
lines changed

doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_ironside.rst

Lines changed: 68 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -735,58 +735,6 @@ UICR.SECURESTORAGE.ITS
735735
UICR.SECURESTORAGE.ITS.RADIOCORESIZE1KB
736736
Sets the size of the ``RADIOCORE`` domain partition for ITS, specified in 1 kiB blocks.
737737

738-
UICR.SECONDARY
739-
==============
740-
741-
:kconfig:option:`CONFIG_GEN_UICR_SECONDARY` configures the secondary firmware boot system, which allows |ISE| to boot alternative firmware in response to specific conditions or triggers.
742-
This feature enables a recovery firmware setup through a dual-firmware configuration that includes both main and recovery firmware.
743-
744-
The UICR.SECONDARY configuration consists of multiple sub-registers organized into functional groups:
745-
746-
UICR.SECONDARY.ENABLE
747-
Controls whether the secondary firmware boot feature is enabled.
748-
749-
UICR.SECONDARY.PROCESSOR
750-
Specifies which processor should be used to boot the secondary firmware.
751-
Valid values are:
752-
753-
* ``APPLICATION`` - Boot secondary firmware on the application domain CPU.
754-
* ``RADIOCORE`` - Boot secondary firmware on the radio core CPU.
755-
756-
UICR.SECONDARY.ADDRESS
757-
Sets the start address of the secondary firmware.
758-
This value is used as the initial value of the secure Vector Table Offset Register (VTOR) after CPU reset.
759-
The address must be aligned to a 4 KiB boundary.
760-
Bits [11:0] are ignored.
761-
762-
UICR.SECONDARY.TRIGGER
763-
Configures automatic triggers that cause |ISE| to boot the secondary firmware instead of the primary firmware.
764-
765-
UICR.SECONDARY.TRIGGER.ENABLE
766-
Controls whether automatic triggers are enabled to boot the secondary firmware.
767-
768-
UICR.SECONDARY.TRIGGER.RESETREAS
769-
Specifies which reset reasons will trigger an automatic boot into the secondary firmware.
770-
Multiple triggers can be enabled simultaneously by setting the corresponding bits:
771-
772-
* ``APPLICATIONWDT0`` - Application domain watchdog 0 reset
773-
* ``APPLICATIONWDT1`` - Application domain watchdog 1 reset
774-
* ``APPLICATIONLOCKUP`` - Application domain CPU lockup reset
775-
* ``RADIOCOREWDT0`` - Radio core watchdog 0 reset
776-
* ``RADIOCOREWDT1`` - Radio core watchdog 1 reset
777-
* ``RADIOCORELOCKUP`` - Radio core CPU lockup reset
778-
779-
UICR.SECONDARY.PROTECTEDMEM
780-
Identical to :kconfig:option:`CONFIG_GEN_UICR_PROTECTEDMEM`, but applies to the secondary firmware.
781-
782-
UICR.SECONDARY.WDTSTART
783-
Identical to :kconfig:option:`CONFIG_GEN_UICR_WDTSTART`, but applies to the secondary firmware boot process.
784-
Note that if RADIOCORE is specified in ``UICR.SECONDARY.PROCESSOR``, the WDT instances used are the ones in the radio core.
785-
786-
UICR.SECONDARY.PERIPHCONF
787-
Identical to UICR.PERIPHCONF, but applies to the secondary firmware boot process.
788-
789-
790738
.. _ug_nrf54h20_ironside_se_debug:
791739

792740
Debugging
@@ -953,9 +901,9 @@ To enable secondary firmware support, you must complete the following steps:
953901
954902
CONFIG_GEN_UICR_SECONDARY=y
955903
956-
2. Create a separate Zephyr application for your secondary firmware (for example in a :file:`secondary/` directory).
904+
#. Create a separate Zephyr application for your secondary firmware (for example in a :file:`secondary/` directory).
957905

958-
3. Include the secondary image as an external project in :file:`sysbuild.cmake`:
906+
#. Include this Zephyr application as an external project in :file:`sysbuild.cmake`:
959907

960908
.. code-block:: cmake
961909
@@ -964,14 +912,27 @@ To enable secondary firmware support, you must complete the following steps:
964912
SOURCE_DIR ${APP_DIR}/secondary
965913
)
966914
967-
4. **Configure secondary firmware**: The secondary firmware image itself must enable the appropriate Kconfig option to indicate it is a secondary firmware.
915+
#. *Configure secondary firmware Kconfig*: The secondary firmware image itself must enable the appropriate Kconfig option to indicate it is a secondary firmware.
968916
Add the following to your secondary firmware's :file:`prj.conf`:
969917

970918
.. code-block:: kconfig
971919
972920
CONFIG_IS_IRONSIDE_SE_SECONDARY_IMAGE=y
973921
974-
5. **Optional: Configure automatic triggers**: If you want automatic triggering based on reset reasons, add trigger options to your :file:`sysbuild/uicr.conf`:
922+
#. *Configure secondary firmware placement*: The secondary firmware image must be placed in the DT partition named ``secondary_partition``.
923+
Add the following to your secondary firmware's :file:`app.overlay`:
924+
925+
.. code-block:: devicetree
926+
927+
/ {
928+
chosen {
929+
zephyr,code-partition = &secondary_partition;
930+
};
931+
};
932+
933+
#. *Optional: Configure secondary firmware features*: Additional features can be configured by adding more options to your :file:`sysbuild/uicr.conf`:
934+
935+
For instance, if you want automatic triggering based on reset reasons, add trigger options:
975936

976937
.. code-block:: kconfig
977938
@@ -994,9 +955,27 @@ Setting bit 5 in ``CTRLAP.BOOTMODE`` will also trigger secondary firmware.
994955

995956
* The integrity check of the memory specified in :kconfig:option:`CONFIG_GEN_UICR_PROTECTEDMEM` fails.
996957
* Any boot failure occurs, such as missing primary firmware or failure to apply ``UICR.PERIPHCONF`` configurations.
997-
* A local domain is reset with a reason configured to trigger the secondary firmware.
998-
* If one of the triggers configured in :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER` and related options occurs.
958+
* If :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER` is enabled, and a UICR-configurable trigger occurs.
959+
See the following table for UICR-configurable triggers.
999960

961+
.. list-table:: Secondary firmware trigger Kconfig options
962+
:header-rows: 1
963+
:widths: auto
964+
965+
* - Kconfig option
966+
- Description
967+
* - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0`
968+
- Trigger on Application domain watchdog 0 reset
969+
* - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1`
970+
- Trigger on Application domain watchdog 1 reset
971+
* - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP`
972+
- Trigger on Application domain CPU lockup reset
973+
* - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0`
974+
- Trigger on Radio core watchdog 0 reset
975+
* - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1`
976+
- Trigger on Radio core watchdog 1 reset
977+
* - :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP`
978+
- Trigger on Radio core CPU lockup reset
1000979

1001980
Protection
1002981
==========
@@ -1014,7 +993,17 @@ As with the primary firmware, |ISE| does not facilitate updating the secondary f
1014993
The secondary image can be updated by other components as long as :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM` is not set.
1015994
Using the secondary firmware as a bootloader capable of validating and updating a second image enables updating firmware in the secondary boot flow while having secure boot enabled through :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM`.
1016995

996+
Secondary processor
997+
===================
998+
999+
By default, the secondary firmware uses the application processor.
1000+
The radio core can be used instead by enabling the :kconfig:option:`CONFIG_GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE` option.
10171001

1002+
Changing the secondary firmware location
1003+
========================================
1004+
1005+
You can customize the location of the secondary firmware by modifying the ``secondary_partition`` DT partition in both the UICR image and the secondary firmware image.
1006+
This is typically done by editing the relevant devicetree source files (such as ``nrf54h20dk_nrf54h20_common.dts`` or board-specific overlay files) in your application and UICR image projects.
10181007

10191008
.. _ug_nrf54h20_ironside_se_cpuconf_service:
10201009

@@ -1137,11 +1126,11 @@ CTRLAP.BOOTMODE register format
11371126

11381127
The format of the CTRLAP.MAILBOX.BOOTMODE register is described in the following table.
11391128

1140-
+------------------+--------+------------------+-----+----------------+--------+------------+
1141-
| Bit numbers | 31-8 | 7 | 6-5 | 4 | 3-1 | 0 |
1142-
+------------------+--------+------------------+-----+----------------+--------+------------+
1143-
| Field | N/A | Reserved | RFU | SAFEMODE (ROM) | OPCODE | MODE (ROM) |
1144-
+------------------+--------+------------------+-----+----------------+--------+------------+
1129+
+------------------+--------+------------+-----+----------------+----------------+--------+------------+
1130+
| Bit numbers | 31-8 | 7 | 6 | 5 | 4 | 3-1 | 0 |
1131+
+------------------+--------+------------+-----+----------------+----------------+--------+------------+
1132+
| Field | N/A | DEBUGWAIT | RFU | SECONDARYMODE | SAFEMODE (ROM) | OPCODE | MODE (ROM) |
1133+
+------------------+--------+------------+-----+----------------+----------------+--------+------------+
11451134

11461135
.. _ug_nrf54h20_ironside_se_bootstatus_register_format:
11471136

@@ -1161,11 +1150,11 @@ The BOOTSTAGE field indicates which component in the boot sequence encountered a
11611150

11621151
If ``BOOTSTAGE`` is set to ``0xC`` or ``0xD``, the register has the following format:
11631152

1164-
+------------------+-------+-----------+-------+-----------+-----------+-----------+-----+-------------+
1165-
| Bit numbers | 31-28 | 27-24 | 23-22 | 21-15 | 14-12 | 11-9 | 8 | 7-0 |
1166-
+------------------+-------+-----------+-------+-----------+-----------+-----------+-----+-------------+
1167-
| Field | RFU | BOOTSTAGE | RFU | FWVERSION | CMDOPCODE | CMDERROR | RFU | BOOTERROR |
1168-
+------------------+-------+-----------+-------+-----------+-----------+-----------+-----+-------------+
1153+
+------------------+-------+-----------+-------+-----------+-----------+-----------+----------------+-------------+
1154+
| Bit numbers | 31-28 | 27-24 | 23-22 | 21-15 | 14-12 | 11-9 | 8 | 7-0 |
1155+
+------------------+-------+-----------+-------+-----------+-----------+-----------+----------------+-------------+
1156+
| Field | RFU | BOOTSTAGE | RFU | FWVERSION | CMDOPCODE | CMDERROR | SECONDARYMODE | BOOTERROR |
1157+
+------------------+-------+-----------+-------+-----------+-----------+-----------+----------------+-------------+
11691158

11701159
This field can have one of the following values:
11711160

@@ -1186,10 +1175,11 @@ This field can have one of the following values:
11861175
+--------------------+--------------------------------------------------------------+
11871176

11881177
.. note::
1189-
The value ``0xB`` indicates a boot status error reported by the Secure Domain running a version earlier than version 20.
1178+
The value ``0xB`` indicates a boot status error reported by the Secure Domain running a firmware version earlier than 20.
1179+
See :ref:`abi_compatibility` for more information.
11901180

11911181
The register is written by |ISE| at the end of every cold boot sequence.
1192-
A value of 0 indicates that |ISE| did not complete the boot process.
1182+
A value of ``0`` indicates that |ISE| did not complete the boot process.
11931183

11941184
The following fields are reported by |ISE|:
11951185

@@ -1200,20 +1190,24 @@ FWVERSION
12001190

12011191
CMDOPCODE
12021192
The opcode of the boot command issued to |ISE| in the CTRLAP.MAILBOX.BOOTMODE register.
1203-
A value of 0 indicates that no boot command has been issued.
1193+
A value of ``0`` indicates that no boot command has been issued.
12041194

12051195
CMDERROR
12061196
A code indicating the execution status of the boot command specified in CMDOPCODE:
12071197

1208-
* A status value of 0 indicates that the command was executed successfully.
1198+
* A status value of ``0`` indicates that the command was executed successfully.
12091199
* A non-zero value indicates that an error condition occurred during execution of the command.
1210-
The error code 0x7 means that an unexpected condition happened that might have prevented the command from executing.
1200+
The error code ``0x7`` means that an unexpected condition happened that might have prevented the command from executing.
12111201
Other error codes must be interpreted based on the boot command in CMDOPCODE.
12121202

1203+
SECONDARYMODE
1204+
Indicates whether the secondary firmware was booted.
1205+
A value of ``1`` indicates that the secondary firmware was booted, while a value of ``0`` indicates that the primary firmware was booted.
1206+
12131207
BOOTERROR
12141208
A code indicating the status of the application domain boot sequence:
12151209

1216-
* A status value of 0 indicates that the CPU was started normally.
1210+
* A status value of ``0`` indicates that the CPU was started normally.
12171211
* A non-zero value indicates that an error condition occurred, preventing the CPU from starting.
12181212
Detailed information about the issue can be found in the boot report.
12191213

0 commit comments

Comments
 (0)