Skip to contentSkip to conversation

binman: add CST backend selection for i.MX8M signing

PATCH Superseded Marek Vasut 3 participants 8 messages Feb 13 – Mar 19 Arm i.MX and Layerscape

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 binman: add CST backend selection for i.MX8M signing

Add support for setting the CST backend, both via DT property and CST_BACKEND environment variable. The CST currently supports two backends, 'ssl' and 'pkcs11', with 'ssl' being the default when CST tool is invoked without any -b parameter. Keep 'ssl' backend as the default, but explicitly pass it via the '-b' parameter, unless the user selects 'pkcs11' via either method.

---
Cc: Alper Nebi Yasak <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
---
V2: Fill in documentation for all used DT properties

---
 doc/imx/habv4/guides/mx8m_spl_secure_boot.txt | 30 ++++++++++++-------
 tools/binman/entries.rst                      |  7 +++++
 tools/binman/etype/nxp_imx8mcst.py            | 12 +++++++-
 3 files changed, 37 insertions(+), 12 deletions(-)
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +19 -11
index 1bea091344d..a3ebd397d82 100644
@@ -167,17 +167,25 @@ The nxp-imx8mcst etype is configurable using either DT properties or environment
 variables. The following DT properties and environment variables are supported.
 Note that environment variables override DT properties.
 
-+--------------------+-----------+------------------------------------------------------------------+
-| DT property        | Variable  | Description                                                      |
-+====================+===========+==================================================================+
-| nxp,loader-address |           | SPL base address                                                 |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,srk-table      | SRK_TABLE | full path to SRK_1_2_3_4_table.bin                               |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,csf-crt        | CSF_KEY   | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,img-crt        | IMG_KEY   | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
++--------------------+-------------+------------------------------------------------------------------+
+| DT property        | Variable    | Description                                                      |
++====================+=============+==================================================================+
+| nxp,loader-address |             | SPL base address                                                 |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-table      | SRK_TABLE   | full path to SRK_1_2_3_4_table.bin                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,csf-crt        | CSF_KEY     | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,img-crt        | IMG_KEY     | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,fast-auth      |             | enable fast authentication method                                |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-crt        | SRK_KEY     | full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem    |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,unlock         |             | unlock CAAM in SPL                                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,cst-backend    | CST_BACKEND | CST tool backend, default is 'ssl', or selectable 'pkcs11'       |
++--------------------+-------------+------------------------------------------------------------------+
 
 Environment variables can be set as follows to point the build process
 to external key material:
tools/binman/entries.rst +7 -0
index 8922d6cd070..29bc778d0e5 100644
@@ -1664,6 +1664,13 @@ Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
 
 Properties / Entry arguments:
     - nxp,loader-address - loader address (SPL text base)
+    - nxp,srk-table - full path to SRK_1_2_3_4_table.bin
+    - nxp,csf-crt - full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,img-crt - full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,fast-auth - enable fast authentication method
+    - nxp,srk-crt - full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem
+    - nxp,unlock - unlock CAAM in SPL
+    - nxp,cst-backend - CST tool backend, default is 'ssl', or selectable 'pkcs11'
 
 
 
tools/binman/etype/nxp_imx8mcst.py +11 -1
index dd9f226b751..3a95da6a35d 100644
@@ -90,6 +90,10 @@ class Entry_nxp_imx8mcst(Entry_mkimage):
                 'SRK_KEY', fdt_util.GetString(self._node, 'nxp,srk-crt',
                                               f'SRK1_{KEY_NAME}.pem'))
 
+        self.backend = os.getenv(
+            'CST_BACKEND', fdt_util.GetString(self._node, 'nxp,cst-backend',
+                                              'ssl'))
+
         self.unlock = fdt_util.GetBool(self._node, 'nxp,unlock')
         self.ReadEntries()
 
@@ -161,8 +165,14 @@ class Entry_nxp_imx8mcst(Entry_mkimage):
         with open(cfg_fname, 'w') as cfgf:
             config.write(cfgf)
 
+        # SSL is the default backend, PKCS11 backend is optional
+        if self.backend == "pkcs11":
+            cst_backend = "pkcs11"
+        else:
+            cst_backend = "ssl"
+
         output_fname = tools.get_output_filename(f'nxp.csf-output-blob.{uniq}')
-        args = ['-i', cfg_fname, '-o', output_fname]
+        args = ['-i', cfg_fname, '-o', output_fname, '-b', cst_backend]
         if self.cst.run_cmd(*args) is not None:
             outdata = tools.read_file(output_fname)
             # fixme: 0x2000 should be CONFIG_CSF_SIZE
Signature · 1 line
2.51.0
#1 lore raw

Hi Marek,

Quoted 50 lines · Marek Vasut

Add support for setting the CST backend, both via DT property and CST_BACKEND environment variable. The CST currently supports two backends, 'ssl' and 'pkcs11', with 'ssl' being the default when CST tool is invoked without any -b parameter. Keep 'ssl' backend as the default, but explicitly pass it via the '-b' parameter, unless the user selects 'pkcs11' via either method.

---
Cc: Alper Nebi Yasak <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
---
V2: Fill in documentation for all used DT properties

---
 doc/imx/habv4/guides/mx8m_spl_secure_boot.txt | 30 ++++++++++++-------
 tools/binman/entries.rst                      |  7 +++++
 tools/binman/etype/nxp_imx8mcst.py            | 12 +++++++-
 3 files changed, 37 insertions(+), 12 deletions(-)
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +9 -11
index 1bea091344d..a3ebd397d82 100644
@@ -167,17 +167,25 @@ The nxp-imx8mcst etype is configurable using either DT properties or environment
 variables. The following DT properties and environment variables are supported.
 Note that environment variables override DT properties.
 
-+--------------------+-----------+------------------------------------------------------------------+
-| DT property        | Variable  | Description                                                      |
-+====================+===========+==================================================================+
-| nxp,loader-address |           | SPL base address                                                 |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,srk-table      | SRK_TABLE | full path to SRK_1_2_3_4_table.bin                               |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,csf-crt        | CSF_KEY   | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,img-crt        | IMG_KEY   | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
++--------------------+-------------+------------------------------------------------------------------+
+| DT property        | Variable    | Description                                                      |
++====================+=============+==================================================================+
+| nxp,loader-address |             | SPL base address                                                 |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-table      | SRK_TABLE   | full path to SRK_1_2_3_4_table.bin                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,csf-crt        | CSF_KEY     | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+

doc/imx/habv4/guides/mx8m_spl_secure_boot.txt The nxp-imx8mcst etype is configurable using either DT properties or environment · line 188

Quoted 10 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +10 -0
+| nxp,img-crt        | IMG_KEY     | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,fast-auth      |             | enable fast authentication method                                |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-crt        | SRK_KEY     | full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem    |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,unlock         |             | unlock CAAM in SPL                                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,cst-backend    | CST_BACKEND | CST tool backend, default is 'ssl', or selectable 'pkcs11'       |
++--------------------+-------------+------------------------------------------------------------------+

Perhaps point to an example?

Quoted 9 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +0 -0
 Environment variables can be set as follows to point the build process
 to external key material:
tools/binman/entries.rst +0 -0
index 8922d6cd070..29bc778d0e5 100644
@@ -1664,6 +1664,13 @@ Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
 

tools/binman/entries.rst Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker · line 1674

Quoted 10 lines
tools/binman/entries.rst +7 -0
 Properties / Entry arguments:
     - nxp,loader-address - loader address (SPL text base)
+    - nxp,srk-table - full path to SRK_1_2_3_4_table.bin
+    - nxp,csf-crt - full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,img-crt - full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,fast-auth - enable fast authentication method
+    - nxp,srk-crt - full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem
+    - nxp,unlock - unlock CAAM in SPL
+    - nxp,cst-backend - CST tool backend, default is 'ssl', or selectable 'pkcs11'
 

The way it works is you add this as a comment in nxp_imx8mcst.py and then run 'binman entry-docs' to generate entries.rst - see here:

https://docs.u-boot.org/en/latest/develop/package/binman.html#entry-documentation

Quoted 34 lines
tools/binman/etype/nxp_imx8mcst.py +11 -2
index dd9f226b751..3a95da6a35d 100644
@@ -90,6 +90,10 @@ class Entry_nxp_imx8mcst(Entry_mkimage):
                 'SRK_KEY', fdt_util.GetString(self._node, 'nxp,srk-crt',
                                               f'SRK1_{KEY_NAME}.pem'))
 
+        self.backend = os.getenv(
+            'CST_BACKEND', fdt_util.GetString(self._node, 'nxp,cst-backend',
+                                              'ssl'))
+
         self.unlock = fdt_util.GetBool(self._node, 'nxp,unlock')
         self.ReadEntries()
 
@@ -161,8 +165,14 @@ class Entry_nxp_imx8mcst(Entry_mkimage):
         with open(cfg_fname, 'w') as cfgf:
             config.write(cfgf)
 
+        # SSL is the default backend, PKCS11 backend is optional
+        if self.backend == "pkcs11":
+            cst_backend = "pkcs11"
+        else:
+            cst_backend = "ssl"
+
         output_fname = tools.get_output_filename(f'nxp.csf-output-blob.{uniq}')
-        args = ['-i', cfg_fname, '-o', output_fname]
+        args = ['-i', cfg_fname, '-o', output_fname, '-b', cst_backend]
         if self.cst.run_cmd(*args) is not None:
             outdata = tools.read_file(output_fname)
             # fixme: 0x2000 should be CONFIG_CSF_SIZE
--
Quoted 2 lines

2.51.0

Regards,
Simon

#2 lore raw

On 2/13/26 9:20 PM, Simon Glass wrote:

Hello Simon,

Quoted 32 lines
Quoted 32 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +13 -11
index 1bea091344d..a3ebd397d82 100644
@@ -167,17 +167,25 @@ The nxp-imx8mcst etype is configurable using either DT properties or environment
  variables. The following DT properties and environment variables are supported.
  Note that environment variables override DT properties.
 
-+--------------------+-----------+------------------------------------------------------------------+
-| DT property        | Variable  | Description                                                      |
-+====================+===========+==================================================================+
-| nxp,loader-address |           | SPL base address                                                 |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,srk-table      | SRK_TABLE | full path to SRK_1_2_3_4_table.bin                               |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,csf-crt        | CSF_KEY   | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,img-crt        | IMG_KEY   | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
++--------------------+-------------+------------------------------------------------------------------+
+| DT property        | Variable    | Description                                                      |
++====================+=============+==================================================================+
+| nxp,loader-address |             | SPL base address                                                 |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-table      | SRK_TABLE   | full path to SRK_1_2_3_4_table.bin                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,csf-crt        | CSF_KEY     | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,img-crt        | IMG_KEY     | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,fast-auth      |             | enable fast authentication method                                |
++--------------------+-------------+------------------------------------------------------------------+
Quoted 8 lines

doc/imx/habv4/guides/mx8m_spl_secure_boot.txt The nxp-imx8mcst etype is configurable using either DT properties or environment · line 188

Quoted 6 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +6 -0
+| nxp,srk-crt        | SRK_KEY     | full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem    |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,unlock         |             | unlock CAAM in SPL                                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,cst-backend    | CST_BACKEND | CST tool backend, default is 'ssl', or selectable 'pkcs11'       |
++--------------------+-------------+------------------------------------------------------------------+

Perhaps point to an example?

Example of what ? Two lines below, there is an example of using those env vars, see the entire file.

Quoted 22 lines
Quoted 8 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +0 -0
  Environment variables can be set as follows to point the build process
  to external key material:
tools/binman/entries.rst +0 -0
index 8922d6cd070..29bc778d0e5 100644
@@ -1664,6 +1664,13 @@ Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
 

tools/binman/entries.rst Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker · line 1674

Quoted 10 lines
tools/binman/entries.rst +7 -0
  Properties / Entry arguments:
      - nxp,loader-address - loader address (SPL text base)
+    - nxp,srk-table - full path to SRK_1_2_3_4_table.bin
+    - nxp,csf-crt - full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,img-crt - full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,fast-auth - enable fast authentication method
+    - nxp,srk-crt - full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem
+    - nxp,unlock - unlock CAAM in SPL
+    - nxp,cst-backend - CST tool backend, default is 'ssl', or selectable 'pkcs11'
 

The way it works is you add this as a comment in nxp_imx8mcst.py and then run 'binman entry-docs' to generate entries.rst - see here:

Quoted 1 line

https://docs.u-boot.org/en/latest/develop/package/binman.html#entry-documentation

Why is there this entries.rst then ? Should the entries be removed from here and moved into the py file or what is this inconsistency ?

#3 lore raw

+Heinrich Schuchardt

Hi Marek,

Quoted 45 lines · Marek Vasut

On 2/13/26 9:20 PM, Simon Glass wrote:

Hello Simon,

Quoted 40 lines
Quoted 28 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +9 -11
index 1bea091344d..a3ebd397d82 100644
@@ -167,17 +167,25 @@ The nxp-imx8mcst etype is configurable using either DT properties or environment
  variables. The following DT properties and environment variables are supported.
  Note that environment variables override DT properties.
 
-+--------------------+-----------+------------------------------------------------------------------+
-| DT property        | Variable  | Description                                                      |
-+====================+===========+==================================================================+
-| nxp,loader-address |           | SPL base address                                                 |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,srk-table      | SRK_TABLE | full path to SRK_1_2_3_4_table.bin                               |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,csf-crt        | CSF_KEY   | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,img-crt        | IMG_KEY   | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
++--------------------+-------------+------------------------------------------------------------------+
+| DT property        | Variable    | Description                                                      |
++====================+=============+==================================================================+
+| nxp,loader-address |             | SPL base address                                                 |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-table      | SRK_TABLE   | full path to SRK_1_2_3_4_table.bin                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,csf-crt        | CSF_KEY     | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+

doc/imx/habv4/guides/mx8m_spl_secure_boot.txt The nxp-imx8mcst etype is configurable using either DT properties or environment · line 188

Quoted 10 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +10 -0
+| nxp,img-crt        | IMG_KEY     | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,fast-auth      |             | enable fast authentication method                                |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-crt        | SRK_KEY     | full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem    |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,unlock         |             | unlock CAAM in SPL                                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,cst-backend    | CST_BACKEND | CST tool backend, default is 'ssl', or selectable 'pkcs11'       |
++--------------------+-------------+------------------------------------------------------------------+

Perhaps point to an example?

Sorry I missed this earlier.

Quoted 3 lines

Example of what ? Two lines below, there is an example of using those env vars, see the entire file.

Yes I see it, but it doesn't have CST_BACKEND right?

Quoted 23 lines
Quoted 23 lines
Quoted 9 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +0 -0
  Environment variables can be set as follows to point the build process
  to external key material:
tools/binman/entries.rst +0 -0
index 8922d6cd070..29bc778d0e5 100644
@@ -1664,6 +1664,13 @@ Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
 

tools/binman/entries.rst Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker · line 1674

Quoted 10 lines
tools/binman/entries.rst +7 -0
  Properties / Entry arguments:
      - nxp,loader-address - loader address (SPL text base)
+    - nxp,srk-table - full path to SRK_1_2_3_4_table.bin
+    - nxp,csf-crt - full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,img-crt - full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,fast-auth - enable fast authentication method
+    - nxp,srk-crt - full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem
+    - nxp,unlock - unlock CAAM in SPL
+    - nxp,cst-backend - CST tool backend, default is 'ssl', or selectable 'pkcs11'
 

The way it works is you add this as a comment in nxp_imx8mcst.py and then run 'binman entry-docs' to generate entries.rst - see here:

Quoted 3 lines
Quoted 1 line

https://docs.u-boot.org/en/latest/develop/package/binman.html#entry-documentation

Why is there this entries.rst then ? Should the entries be removed from here and moved into the py file or what is this inconsistency ?

The entries.rst file is there so that the documentation can be build, containing it. It might be possible to update 'make htmldocs' to run binman to update the generated docs.

Heinrich, what do you think about that?

Anyway, if you update the comments in the code, then you can run binman as above to regenerate the documentation.

Regards,
Simon

#4 lore raw
Quoted 83 lines · Simon Glass

+Heinrich Schuchardt

Hi Marek,

Quoted 45 lines · Marek Vasut

On 2/13/26 9:20 PM, Simon Glass wrote:

Hello Simon,

Quoted 40 lines
Quoted 28 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +9 -11
index 1bea091344d..a3ebd397d82 100644
@@ -167,17 +167,25 @@ The nxp-imx8mcst etype is configurable using either DT properties or environment
  variables. The following DT properties and environment variables are supported.
  Note that environment variables override DT properties.
 
-+--------------------+-----------+------------------------------------------------------------------+
-| DT property        | Variable  | Description                                                      |
-+====================+===========+==================================================================+
-| nxp,loader-address |           | SPL base address                                                 |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,srk-table      | SRK_TABLE | full path to SRK_1_2_3_4_table.bin                               |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,csf-crt        | CSF_KEY   | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,img-crt        | IMG_KEY   | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
++--------------------+-------------+------------------------------------------------------------------+
+| DT property        | Variable    | Description                                                      |
++====================+=============+==================================================================+
+| nxp,loader-address |             | SPL base address                                                 |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-table      | SRK_TABLE   | full path to SRK_1_2_3_4_table.bin                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,csf-crt        | CSF_KEY     | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+

doc/imx/habv4/guides/mx8m_spl_secure_boot.txt The nxp-imx8mcst etype is configurable using either DT properties or environment · line 188

Quoted 10 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +10 -0
+| nxp,img-crt        | IMG_KEY     | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,fast-auth      |             | enable fast authentication method                                |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-crt        | SRK_KEY     | full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem    |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,unlock         |             | unlock CAAM in SPL                                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,cst-backend    | CST_BACKEND | CST tool backend, default is 'ssl', or selectable 'pkcs11'       |
++--------------------+-------------+------------------------------------------------------------------+

Perhaps point to an example?

Sorry I missed this earlier.

Quoted 3 lines

Example of what ? Two lines below, there is an example of using those env vars, see the entire file.

Yes I see it, but it doesn't have CST_BACKEND right?

Quoted 24 lines
Quoted 24 lines
Quoted 9 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +0 -0
  Environment variables can be set as follows to point the build process
  to external key material:
tools/binman/entries.rst +0 -0
index 8922d6cd070..29bc778d0e5 100644
@@ -1664,6 +1664,13 @@ Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
 

tools/binman/entries.rst Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker · line 1674

Quoted 10 lines
tools/binman/entries.rst +7 -0
  Properties / Entry arguments:
      - nxp,loader-address - loader address (SPL text base)
+    - nxp,srk-table - full path to SRK_1_2_3_4_table.bin
+    - nxp,csf-crt - full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,img-crt - full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,fast-auth - enable fast authentication method
+    - nxp,srk-crt - full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem
+    - nxp,unlock - unlock CAAM in SPL
+    - nxp,cst-backend - CST tool backend, default is 'ssl', or selectable 'pkcs11'
 

The way it works is you add this as a comment in nxp_imx8mcst.py and then run 'binman entry-docs' to generate entries.rst - see here:

https://docs.u-boot.org/en/latest/develop/package/binman.html#entry-documentation

Quoted 8 lines
Quoted 2 lines

Why is there this entries.rst then ? Should the entries be removed from here and moved into the py file or what is this inconsistency ?

The entries.rst file is there so that the documentation can be build, containing it. It might be possible to update 'make htmldocs' to run binman to update the generated docs.

Heinrich, what do you think about that?

That won't work for readthedocs, it needs to be generated, if it can, as part of the normal sphix build doc process.

Signature · 1 line
Tom
#5 lore raw

Hi Tom,

Quoted 88 lines · Tom Rini
Quoted 86 lines · Simon Glass

+Heinrich Schuchardt

Hi Marek,

Quoted 45 lines · Marek Vasut

On 2/13/26 9:20 PM, Simon Glass wrote:

Hello Simon,

Quoted 40 lines
Quoted 28 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +9 -11
index 1bea091344d..a3ebd397d82 100644
@@ -167,17 +167,25 @@ The nxp-imx8mcst etype is configurable using either DT properties or environment
  variables. The following DT properties and environment variables are supported.
  Note that environment variables override DT properties.
 
-+--------------------+-----------+------------------------------------------------------------------+
-| DT property        | Variable  | Description                                                      |
-+====================+===========+==================================================================+
-| nxp,loader-address |           | SPL base address                                                 |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,srk-table      | SRK_TABLE | full path to SRK_1_2_3_4_table.bin                               |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,csf-crt        | CSF_KEY   | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,img-crt        | IMG_KEY   | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
++--------------------+-------------+------------------------------------------------------------------+
+| DT property        | Variable    | Description                                                      |
++====================+=============+==================================================================+
+| nxp,loader-address |             | SPL base address                                                 |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-table      | SRK_TABLE   | full path to SRK_1_2_3_4_table.bin                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,csf-crt        | CSF_KEY     | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+

doc/imx/habv4/guides/mx8m_spl_secure_boot.txt The nxp-imx8mcst etype is configurable using either DT properties or environment · line 188

Quoted 10 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +10 -0
+| nxp,img-crt        | IMG_KEY     | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,fast-auth      |             | enable fast authentication method                                |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-crt        | SRK_KEY     | full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem    |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,unlock         |             | unlock CAAM in SPL                                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,cst-backend    | CST_BACKEND | CST tool backend, default is 'ssl', or selectable 'pkcs11'       |
++--------------------+-------------+------------------------------------------------------------------+

Perhaps point to an example?

Sorry I missed this earlier.

Quoted 3 lines

Example of what ? Two lines below, there is an example of using those env vars, see the entire file.

Yes I see it, but it doesn't have CST_BACKEND right?

Quoted 26 lines
Quoted 23 lines
Quoted 9 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +0 -0
  Environment variables can be set as follows to point the build process
  to external key material:
tools/binman/entries.rst +0 -0
index 8922d6cd070..29bc778d0e5 100644
@@ -1664,6 +1664,13 @@ Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
 

tools/binman/entries.rst Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker · line 1674

Quoted 10 lines
tools/binman/entries.rst +7 -0
  Properties / Entry arguments:
      - nxp,loader-address - loader address (SPL text base)
+    - nxp,srk-table - full path to SRK_1_2_3_4_table.bin
+    - nxp,csf-crt - full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,img-crt - full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,fast-auth - enable fast authentication method
+    - nxp,srk-crt - full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem
+    - nxp,unlock - unlock CAAM in SPL
+    - nxp,cst-backend - CST tool backend, default is 'ssl', or selectable 'pkcs11'
 

The way it works is you add this as a comment in nxp_imx8mcst.py and then run 'binman entry-docs' to generate entries.rst - see here:

Quoted 1 line

https://docs.u-boot.org/en/latest/develop/package/binman.html#entry-documentation

Why is there this entries.rst then ? Should the entries be removed from here and moved into the py file or what is this inconsistency ?

Quoted 8 lines
Quoted 5 lines

The entries.rst file is there so that the documentation can be build, containing it. It might be possible to update 'make htmldocs' to run binman to update the generated docs.

Heinrich, what do you think about that?

That won't work for readthedocs, it needs to be generated, if it can, as part of the normal sphix build doc process.

Hmm that's a bit of a pain. We don't really want to run binman from sphinx. I could create an Sphinx extension to create the entry and bintools docs, perhaps?

Regards,
Simon

#6 lore raw
Quoted 95 lines · Simon Glass

Hi Tom,

Quoted 92 lines · Tom Rini
Quoted 90 lines · Simon Glass

+Heinrich Schuchardt

Hi Marek,

Quoted 45 lines · Marek Vasut

On 2/13/26 9:20 PM, Simon Glass wrote:

Hello Simon,

Quoted 40 lines
Quoted 28 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +9 -11
index 1bea091344d..a3ebd397d82 100644
@@ -167,17 +167,25 @@ The nxp-imx8mcst etype is configurable using either DT properties or environment
  variables. The following DT properties and environment variables are supported.
  Note that environment variables override DT properties.
 
-+--------------------+-----------+------------------------------------------------------------------+
-| DT property        | Variable  | Description                                                      |
-+====================+===========+==================================================================+
-| nxp,loader-address |           | SPL base address                                                 |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,srk-table      | SRK_TABLE | full path to SRK_1_2_3_4_table.bin                               |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,csf-crt        | CSF_KEY   | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,img-crt        | IMG_KEY   | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
++--------------------+-------------+------------------------------------------------------------------+
+| DT property        | Variable    | Description                                                      |
++====================+=============+==================================================================+
+| nxp,loader-address |             | SPL base address                                                 |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-table      | SRK_TABLE   | full path to SRK_1_2_3_4_table.bin                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,csf-crt        | CSF_KEY     | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+

doc/imx/habv4/guides/mx8m_spl_secure_boot.txt The nxp-imx8mcst etype is configurable using either DT properties or environment · line 188

Quoted 10 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +10 -0
+| nxp,img-crt        | IMG_KEY     | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,fast-auth      |             | enable fast authentication method                                |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-crt        | SRK_KEY     | full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem    |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,unlock         |             | unlock CAAM in SPL                                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,cst-backend    | CST_BACKEND | CST tool backend, default is 'ssl', or selectable 'pkcs11'       |
++--------------------+-------------+------------------------------------------------------------------+

Perhaps point to an example?

Sorry I missed this earlier.

Quoted 3 lines

Example of what ? Two lines below, there is an example of using those env vars, see the entire file.

Yes I see it, but it doesn't have CST_BACKEND right?

Quoted 23 lines
Quoted 23 lines
Quoted 9 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +0 -0
  Environment variables can be set as follows to point the build process
  to external key material:
tools/binman/entries.rst +0 -0
index 8922d6cd070..29bc778d0e5 100644
@@ -1664,6 +1664,13 @@ Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
 

tools/binman/entries.rst Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker · line 1674

Quoted 10 lines
tools/binman/entries.rst +7 -0
  Properties / Entry arguments:
      - nxp,loader-address - loader address (SPL text base)
+    - nxp,srk-table - full path to SRK_1_2_3_4_table.bin
+    - nxp,csf-crt - full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,img-crt - full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,fast-auth - enable fast authentication method
+    - nxp,srk-crt - full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem
+    - nxp,unlock - unlock CAAM in SPL
+    - nxp,cst-backend - CST tool backend, default is 'ssl', or selectable 'pkcs11'
 

The way it works is you add this as a comment in nxp_imx8mcst.py and then run 'binman entry-docs' to generate entries.rst - see here:

Quoted 3 lines
Quoted 1 line

https://docs.u-boot.org/en/latest/develop/package/binman.html#entry-documentation

Why is there this entries.rst then ? Should the entries be removed from here and moved into the py file or what is this inconsistency ?

The entries.rst file is there so that the documentation can be build, containing it. It might be possible to update 'make htmldocs' to run binman to update the generated docs.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Heinrich, what do you think about that?

That won't work for readthedocs, it needs to be generated, if it can, as part of the normal sphix build doc process.

Hmm that's a bit of a pain. We don't really want to run binman from sphinx. I could create an Sphinx extension to create the entry and bintools docs, perhaps?

I'm not sure of the best way to solve the problem of generating this file on-demand, so it doesn't get out of date (nor edited directly again). I just know that in addition to the CI targets we need for readthedocs to do it automatically as well.

Signature · 1 line
Tom
#7 lore raw

Hi,

Quoted 102 lines · Tom Rini
Quoted 100 lines · Simon Glass

Hi Tom,

Quoted 96 lines · Tom Rini
Quoted 83 lines · Simon Glass

+Heinrich Schuchardt

Hi Marek,

Quoted 45 lines · Marek Vasut

On 2/13/26 9:20 PM, Simon Glass wrote:

Hello Simon,

Quoted 40 lines
Quoted 28 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +9 -11
index 1bea091344d..a3ebd397d82 100644
@@ -167,17 +167,25 @@ The nxp-imx8mcst etype is configurable using either DT properties or environment
  variables. The following DT properties and environment variables are supported.
  Note that environment variables override DT properties.
 
-+--------------------+-----------+------------------------------------------------------------------+
-| DT property        | Variable  | Description                                                      |
-+====================+===========+==================================================================+
-| nxp,loader-address |           | SPL base address                                                 |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,srk-table      | SRK_TABLE | full path to SRK_1_2_3_4_table.bin                               |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,csf-crt        | CSF_KEY   | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
-| nxp,img-crt        | IMG_KEY   | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
-+--------------------+-----------+------------------------------------------------------------------+
++--------------------+-------------+------------------------------------------------------------------+
+| DT property        | Variable    | Description                                                      |
++====================+=============+==================================================================+
+| nxp,loader-address |             | SPL base address                                                 |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-table      | SRK_TABLE   | full path to SRK_1_2_3_4_table.bin                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,csf-crt        | CSF_KEY     | full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+

doc/imx/habv4/guides/mx8m_spl_secure_boot.txt The nxp-imx8mcst etype is configurable using either DT properties or environment · line 188

Quoted 10 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +10 -0
+| nxp,img-crt        | IMG_KEY     | full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,fast-auth      |             | enable fast authentication method                                |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,srk-crt        | SRK_KEY     | full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem    |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,unlock         |             | unlock CAAM in SPL                                               |
++--------------------+-------------+------------------------------------------------------------------+
+| nxp,cst-backend    | CST_BACKEND | CST tool backend, default is 'ssl', or selectable 'pkcs11'       |
++--------------------+-------------+------------------------------------------------------------------+

Perhaps point to an example?

Sorry I missed this earlier.

Quoted 3 lines

Example of what ? Two lines below, there is an example of using those env vars, see the entire file.

Yes I see it, but it doesn't have CST_BACKEND right?

Quoted 24 lines
Quoted 24 lines
Quoted 9 lines
doc/imx/habv4/guides/mx8m_spl_secure_boot.txt +0 -0
  Environment variables can be set as follows to point the build process
  to external key material:
tools/binman/entries.rst +0 -0
index 8922d6cd070..29bc778d0e5 100644
@@ -1664,6 +1664,13 @@ Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker
 

tools/binman/entries.rst Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker · line 1674

Quoted 10 lines
tools/binman/entries.rst +7 -0
  Properties / Entry arguments:
      - nxp,loader-address - loader address (SPL text base)
+    - nxp,srk-table - full path to SRK_1_2_3_4_table.bin
+    - nxp,csf-crt - full path to the CSF Key CSF1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,img-crt - full path to the IMG Key IMG1_1_sha256_4096_65537_v3_usr_crt.pem
+    - nxp,fast-auth - enable fast authentication method
+    - nxp,srk-crt - full path to the SRK Key SRK1_sha256_4096_65537_v3_ca_crt.pem
+    - nxp,unlock - unlock CAAM in SPL
+    - nxp,cst-backend - CST tool backend, default is 'ssl', or selectable 'pkcs11'
 

The way it works is you add this as a comment in nxp_imx8mcst.py and then run 'binman entry-docs' to generate entries.rst - see here:

https://docs.u-boot.org/en/latest/develop/package/binman.html#entry-documentation

Quoted 8 lines
Quoted 2 lines

Why is there this entries.rst then ? Should the entries be removed from here and moved into the py file or what is this inconsistency ?

The entries.rst file is there so that the documentation can be build, containing it. It might be possible to update 'make htmldocs' to run binman to update the generated docs.

Heinrich, what do you think about that?

That won't work for readthedocs, it needs to be generated, if it can, as part of the normal sphix build doc process.

Quoted 8 lines
Quoted 3 lines

Hmm that's a bit of a pain. We don't really want to run binman from sphinx. I could create an Sphinx extension to create the entry and bintools docs, perhaps?

I'm not sure of the best way to solve the problem of generating this file on-demand, so it doesn't get out of date (nor edited directly again). I just know that in addition to the CI targets we need for readthedocs to do it automatically as well.

I sent this:

https://patchwork.ozlabs.org/project/uboot/list/?series=496461

Regards,
Simon