Skip to contentSkip to conversation

Enable split mode in binman

PATCH Superseded Neha Malcom Francis 2 participants 10 messages Oct 6, 2023 – Oct 23, 2023 Arm (32-bit)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover Enable split mode in binman

This series extends the functionality of ti-secure-rom entry type in binman to support enabling of split mode vs. the default lockstep mode via changing the field in the x509 certificate. A DONOTMERGE patch is added to give an example of how this can be done via the binman.dtsi

Changes in v3:
- Simon
- added entries.rst change
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- Udit:
- included TRM link in commit message
- added DONOTMERGE patch showing example

Neha Malcom Francis (2):
binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts
DONOTMERGE: arm: dts: k3-j7200-binman: Enable split mode for MCU R5

 arch/arm/dts/k3-j7200-binman.dtsi       |  3 +++
 tools/binman/btool/openssl.py           |  6 ++++--
 tools/binman/entries.rst                |  1 +
 tools/binman/etype/ti_secure_rom.py     | 11 +++++++++--
 tools/binman/etype/x509_cert.py         |  3 ++-
 tools/binman/test/297_ti_secure_rom.dts |  1 +
 6 files changed, 20 insertions(+), 5 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/2 binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts

According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage.

---
Link to J721E TRM: https://www.ti.com/lit/zip/spruil1
Section 4.5.4.1 Boot Info

Changes in v3:
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- included TRM link in commit message

 tools/binman/btool/openssl.py           |  6 ++++--
 tools/binman/entries.rst                |  1 +
 tools/binman/etype/ti_secure_rom.py     | 11 +++++++++--
 tools/binman/etype/x509_cert.py         |  3 ++-
 tools/binman/test/297_ti_secure_rom.dts |  1 +
 5 files changed, 17 insertions(+), 5 deletions(-)
tools/binman/btool/openssl.py +4 -2
index aad3b61ae2..86cc56fbd7 100644
@@ -155,6 +155,7 @@ authInPlace = INTEGER:2
             C, ST, L, O, OU, CN and emailAddress
             cert_type (int): Certification type
             bootcore (int): Booting core
+            bootcore_opts(int): Booting core option (split/lockstep mode)
             load_addr (int): Load address of image
             sha (int): Hash function
 
@@ -225,7 +226,7 @@ emailAddress           = {req_dist_name_dict['emailAddress']}
                   imagesize_sbl, hashval_sbl, load_addr_sysfw, imagesize_sysfw,
                   hashval_sysfw, load_addr_sysfw_data, imagesize_sysfw_data,
                   hashval_sysfw_data, sysfw_inner_cert_ext_boot_block,
-                  dm_data_ext_boot_block):
+                  dm_data_ext_boot_block, bootcore_opts):
         """Create a certificate
 
         Args:
@@ -241,6 +242,7 @@ emailAddress           = {req_dist_name_dict['emailAddress']}
             bootcore (int): Booting core
             load_addr (int): Load address of image
             sha (int): Hash function
+            bootcore_opts (int): Boot core option (split/lockstep mode)
 
         Returns:
             str: Tool output
@@ -285,7 +287,7 @@ sysfw_data=SEQUENCE:sysfw_data
 [sbl]
 compType = INTEGER:1
 bootCore = INTEGER:16
-compOpts = INTEGER:0
+compOpts = INTEGER:{bootcore_opts}
 destAddr = FORMAT:HEX,OCT:{load_addr:08x}
 compSize = INTEGER:{imagesize_sbl}
 shaType  = OID:{sha_type}
tools/binman/entries.rst +1 -0
index 801bd94674..b401f9426a 100644
@@ -1900,6 +1900,7 @@ Properties / Entry arguments:
     - core: core on which bootloader runs, valid cores are 'secure' and 'public'
     - content: phandle of SPL in case of legacy bootflow or phandles of component binaries
       in case of combined bootflow
+    - core-opts (optional): split-mode (0) or lockstep mode (1) set to 0 by default
 
 The following properties are only for generating a combined bootflow binary:
     - sysfw-inner-cert: boolean if binary contains sysfw inner certificate
tools/binman/etype/ti_secure_rom.py +9 -2
index 9a7ac9e9e0..17c50cefa1 100644
@@ -32,6 +32,7 @@ class Entry_ti_secure_rom(Entry_x509_cert):
         - core: core on which bootloader runs, valid cores are 'secure' and 'public'
         - content: phandle of SPL in case of legacy bootflow or phandles of component binaries
           in case of combined bootflow
+        - core-opts (optional): split-mode (0) or lockstep mode (1) set to 0 by default
 
     The following properties are only for generating a combined bootflow binary:
         - sysfw-inner-cert: boolean if binary contains sysfw inner certificate
@@ -69,6 +70,7 @@ class Entry_ti_secure_rom(Entry_x509_cert):
         self.sw_rev = fdt_util.GetInt(self._node, 'sw-rev', 1)
         self.sha = fdt_util.GetInt(self._node, 'sha', 512)
         self.core = fdt_util.GetString(self._node, 'core', 'secure')
+        self.bootcore_opts = fdt_util.GetInt(self._node, 'core-opts')
         self.key_fname = self.GetEntryArgsOrProps([
             EntryArg('keyfile', str)], required=True)[0]
         if self.combined:
@@ -97,17 +99,19 @@ class Entry_ti_secure_rom(Entry_x509_cert):
             bytes content of the entry, which is the certificate binary for the
                 provided data
         """
+        if self.bootcore_opts is None:
+            self.bootcore_opts = 0
+
         if self.core == 'secure':
             if self.countersign:
                 self.cert_type = 3
             else:
                 self.cert_type = 2
             self.bootcore = 0
-            self.bootcore_opts = 32
         else:
             self.cert_type = 1
             self.bootcore = 16
-            self.bootcore_opts = 0
+
         return super().GetCertificate(required=required, type='rom')
 
     def CombinedGetCertificate(self, required):
@@ -126,6 +130,9 @@ class Entry_ti_secure_rom(Entry_x509_cert):
         self.num_comps = 3
         self.sha_type = SHA_OIDS[self.sha]
 
+        if self.bootcore_opts is None:
+            self.bootcore_opts = 0
+
         # sbl
         self.content = fdt_util.GetPhandleList(self._node, 'content-sbl')
         input_data_sbl = self.GetContents(required)
tools/binman/etype/x509_cert.py +2 -1
index d028cfe38c..fc0bb12278 100644
@@ -136,7 +136,8 @@ class Entry_x509_cert(Entry_collection):
                 imagesize_sysfw_data=self.imagesize_sysfw_data,
                 hashval_sysfw_data=self.hashval_sysfw_data,
                 sysfw_inner_cert_ext_boot_block=self.sysfw_inner_cert_ext_boot_block,
-                dm_data_ext_boot_block=self.dm_data_ext_boot_block
+                dm_data_ext_boot_block=self.dm_data_ext_boot_block,
+                bootcore_opts=self.bootcore_opts
             )
         if stdout is not None:
             data = tools.read_file(output_fname)
tools/binman/test/297_ti_secure_rom.dts +1 -0
index d1313769f4..1a3eca9425 100644
@@ -9,6 +9,7 @@
 	binman {
 		ti-secure-rom {
 			content = <&unsecure_binary>;
+			core-opts = <2>;
 		};
 		unsecure_binary: blob-ext {
 			filename = "ti_unsecure.bin";
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v3 1/2] binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts

Hi Neha,

Quoted 31 lines · Neha Malcom Francis

According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage.

---
Link to J721E TRM: https://www.ti.com/lit/zip/spruil1
Section 4.5.4.1 Boot Info

Changes in v3:
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- included TRM link in commit message

 tools/binman/btool/openssl.py           |  6 ++++--
 tools/binman/entries.rst                |  1 +
 tools/binman/etype/ti_secure_rom.py     | 11 +++++++++--
 tools/binman/etype/x509_cert.py         |  3 ++-
 tools/binman/test/297_ti_secure_rom.dts |  1 +
 5 files changed, 17 insertions(+), 5 deletions(-)
tools/binman/btool/openssl.py +0 -0
index aad3b61ae2..86cc56fbd7 100644

tools/binman/btool/openssl.py authInPlace = INTEGER:2 · line 158

Quoted 4 lines
tools/binman/btool/openssl.py +1 -0
@@ -155,6 +155,7 @@ authInPlace = INTEGER:2
             C, ST, L, O, OU, CN and emailAddress
             cert_type (int): Certification type
             bootcore (int): Booting core
+            bootcore_opts(int): Booting core option (split/lockstep mode)

Please indicate what possible values are allowed

Quoted 34 lines
tools/binman/btool/openssl.py +3 -2
             load_addr (int): Load address of image
             sha (int): Hash function
 
@@ -225,7 +226,7 @@ emailAddress           = {req_dist_name_dict['emailAddress']}
                   imagesize_sbl, hashval_sbl, load_addr_sysfw, imagesize_sysfw,
                   hashval_sysfw, load_addr_sysfw_data, imagesize_sysfw_data,
                   hashval_sysfw_data, sysfw_inner_cert_ext_boot_block,
-                  dm_data_ext_boot_block):
+                  dm_data_ext_boot_block, bootcore_opts):
         """Create a certificate
 
         Args:
@@ -241,6 +242,7 @@ emailAddress           = {req_dist_name_dict['emailAddress']}
             bootcore (int): Booting core
             load_addr (int): Load address of image
             sha (int): Hash function
+            bootcore_opts (int): Boot core option (split/lockstep mode)
 
         Returns:
             str: Tool output
@@ -285,7 +287,7 @@ sysfw_data=SEQUENCE:sysfw_data
 [sbl]
 compType = INTEGER:1
 bootCore = INTEGER:16
-compOpts = INTEGER:0
+compOpts = INTEGER:{bootcore_opts}
 destAddr = FORMAT:HEX,OCT:{load_addr:08x}
 compSize = INTEGER:{imagesize_sbl}
 shaType  = OID:{sha_type}
tools/binman/entries.rst +0 -0
index 801bd94674..b401f9426a 100644

tools/binman/entries.rst Properties / Entry arguments: · line 1903

Quoted 4 lines
tools/binman/entries.rst +1 -0
@@ -1900,6 +1900,7 @@ Properties / Entry arguments:
     - core: core on which bootloader runs, valid cores are 'secure' and 'public'
     - content: phandle of SPL in case of legacy bootflow or phandles of component binaries
       in case of combined bootflow
+    - core-opts (optional): split-mode (0) or lockstep mode (1) set to 0 by default

Here it is 1 but below it says 2

Quoted 74 lines
tools/binman/entries.rst +0 -0
 The following properties are only for generating a combined bootflow binary:
     - sysfw-inner-cert: boolean if binary contains sysfw inner certificate
tools/binman/etype/ti_secure_rom.py +9 -2
index 9a7ac9e9e0..17c50cefa1 100644
@@ -32,6 +32,7 @@ class Entry_ti_secure_rom(Entry_x509_cert):
         - core: core on which bootloader runs, valid cores are 'secure' and 'public'
         - content: phandle of SPL in case of legacy bootflow or phandles of component binaries
           in case of combined bootflow
+        - core-opts (optional): split-mode (0) or lockstep mode (1) set to 0 by default
 
     The following properties are only for generating a combined bootflow binary:
         - sysfw-inner-cert: boolean if binary contains sysfw inner certificate
@@ -69,6 +70,7 @@ class Entry_ti_secure_rom(Entry_x509_cert):
         self.sw_rev = fdt_util.GetInt(self._node, 'sw-rev', 1)
         self.sha = fdt_util.GetInt(self._node, 'sha', 512)
         self.core = fdt_util.GetString(self._node, 'core', 'secure')
+        self.bootcore_opts = fdt_util.GetInt(self._node, 'core-opts')
         self.key_fname = self.GetEntryArgsOrProps([
             EntryArg('keyfile', str)], required=True)[0]
         if self.combined:
@@ -97,17 +99,19 @@ class Entry_ti_secure_rom(Entry_x509_cert):
             bytes content of the entry, which is the certificate binary for the
                 provided data
         """
+        if self.bootcore_opts is None:
+            self.bootcore_opts = 0
+
         if self.core == 'secure':
             if self.countersign:
                 self.cert_type = 3
             else:
                 self.cert_type = 2
             self.bootcore = 0
-            self.bootcore_opts = 32
         else:
             self.cert_type = 1
             self.bootcore = 16
-            self.bootcore_opts = 0
+
         return super().GetCertificate(required=required, type='rom')
 
     def CombinedGetCertificate(self, required):
@@ -126,6 +130,9 @@ class Entry_ti_secure_rom(Entry_x509_cert):
         self.num_comps = 3
         self.sha_type = SHA_OIDS[self.sha]
 
+        if self.bootcore_opts is None:
+            self.bootcore_opts = 0
+
         # sbl
         self.content = fdt_util.GetPhandleList(self._node, 'content-sbl')
         input_data_sbl = self.GetContents(required)
tools/binman/etype/x509_cert.py +2 -1
index d028cfe38c..fc0bb12278 100644
@@ -136,7 +136,8 @@ class Entry_x509_cert(Entry_collection):
                 imagesize_sysfw_data=self.imagesize_sysfw_data,
                 hashval_sysfw_data=self.hashval_sysfw_data,
                 sysfw_inner_cert_ext_boot_block=self.sysfw_inner_cert_ext_boot_block,
-                dm_data_ext_boot_block=self.dm_data_ext_boot_block
+                dm_data_ext_boot_block=self.dm_data_ext_boot_block,
+                bootcore_opts=self.bootcore_opts
             )
         if stdout is not None:
             data = tools.read_file(output_fname)
tools/binman/test/297_ti_secure_rom.dts +0 -0
index d1313769f4..1a3eca9425 100644

tools/binman/test/297_ti_secure_rom.dts line 12

Quoted 4 lines
tools/binman/test/297_ti_secure_rom.dts +1 -0
@@ -9,6 +9,7 @@
        binman {
                ti-secure-rom {
                        content = <&unsecure_binary>;
+                       core-opts = <2>;

here ^

Do you think there could be a binding file in dt-bindings/ for this value?

Quoted 6 lines
tools/binman/test/297_ti_secure_rom.dts +0 -1
                };
                unsecure_binary: blob-ext {
                        filename = "ti_unsecure.bin";
--

2.34.1

Regards,
Simon

#3 lore raw

Re: [PATCH v3 1/2] binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts

Hi Simon

Quoted 29 lines · Simon Glass

Hi Neha,

Quoted 26 lines · Neha Malcom Francis

According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage.

---
Link to J721E TRM: https://www.ti.com/lit/zip/spruil1
Section 4.5.4.1 Boot Info

Changes in v3:
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- included TRM link in commit message

  tools/binman/btool/openssl.py           |  6 ++++--
  tools/binman/entries.rst                |  1 +
  tools/binman/etype/ti_secure_rom.py     | 11 +++++++++--
  tools/binman/etype/x509_cert.py         |  3 ++-
  tools/binman/test/297_ti_secure_rom.dts |  1 +
  5 files changed, 17 insertions(+), 5 deletions(-)

[...]

Quoted 12 lines

tools/binman/test/297_ti_secure_rom.dts line 12

Quoted 9 lines
tools/binman/test/297_ti_secure_rom.dts +1 -0
index d1313769f4..1a3eca9425 100644
@@ -9,6 +9,7 @@
         binman {
                 ti-secure-rom {
                         content = <&unsecure_binary>;
+                       core-opts = <2>;

here ^

Quoted 2 lines

Do you think there could be a binding file in dt-bindings/ for this value?

Sorry for getting back to this patch so late, but wanted to ask about this. I had seen a last version of getting the binman compatible in dt-bindings but I don't see it merged. Not sure where I would add this property in.

Quoted 9 lines
Quoted 6 lines
tools/binman/test/297_ti_secure_rom.dts +0 -1
                 };
                 unsecure_binary: blob-ext {
                         filename = "ti_unsecure.bin";
--

2.34.1

Regards,
Simon

Signature · 2 lines
Thanking You
Neha Malcom Francis
#4 lore raw

Re: [PATCH v3 1/2] binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts

Hi Neha,

Quoted 48 lines · Neha Malcom Francis

Hi Simon

Quoted 29 lines · Simon Glass

Hi Neha,

Quoted 26 lines · Neha Malcom Francis

According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage.

---
Link to J721E TRM: https://www.ti.com/lit/zip/spruil1
Section 4.5.4.1 Boot Info

Changes in v3:
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- included TRM link in commit message

  tools/binman/btool/openssl.py           |  6 ++++--
  tools/binman/entries.rst                |  1 +
  tools/binman/etype/ti_secure_rom.py     | 11 +++++++++--
  tools/binman/etype/x509_cert.py         |  3 ++-
  tools/binman/test/297_ti_secure_rom.dts |  1 +
  5 files changed, 17 insertions(+), 5 deletions(-)

[...]

Quoted 12 lines

tools/binman/test/297_ti_secure_rom.dts line 12

Quoted 9 lines
tools/binman/test/297_ti_secure_rom.dts +1 -0
index d1313769f4..1a3eca9425 100644
@@ -9,6 +9,7 @@
         binman {
                 ti-secure-rom {
                         content = <&unsecure_binary>;
+                       core-opts = <2>;

here ^

Quoted 6 lines
Quoted 2 lines

Do you think there could be a binding file in dt-bindings/ for this value?

Sorry for getting back to this patch so late, but wanted to ask about this. I had seen a last version of getting the binman compatible in dt-bindings but I don't see it merged. Not sure where I would add this property in.

Yes it is difficult to do anything genuinely new.

I am anticipating something like compatible = "ti,secure-rom"

so I suppose you could create a header file with suitable values for this property.

On the other hand, you could wait until there is progress with the bindings.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
tools/binman/test/297_ti_secure_rom.dts +0 -1
                 };
                 unsecure_binary: blob-ext {
                         filename = "ti_unsecure.bin";
--

2.34.1

Regards,
Simon

#5 lore raw

Re: [PATCH v3 1/2] binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts

Hi Simon

Quoted 58 lines · Simon Glass

Hi Neha,

Quoted 48 lines · Neha Malcom Francis

Hi Simon

Quoted 29 lines · Simon Glass

Hi Neha,

Quoted 26 lines · Neha Malcom Francis

According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage.

---
Link to J721E TRM: https://www.ti.com/lit/zip/spruil1
Section 4.5.4.1 Boot Info

Changes in v3:
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- included TRM link in commit message

   tools/binman/btool/openssl.py           |  6 ++++--
   tools/binman/entries.rst                |  1 +
   tools/binman/etype/ti_secure_rom.py     | 11 +++++++++--
   tools/binman/etype/x509_cert.py         |  3 ++-
   tools/binman/test/297_ti_secure_rom.dts |  1 +
   5 files changed, 17 insertions(+), 5 deletions(-)

[...]

Quoted 12 lines

tools/binman/test/297_ti_secure_rom.dts line 12

Quoted 9 lines
tools/binman/test/297_ti_secure_rom.dts +1 -0
index d1313769f4..1a3eca9425 100644
@@ -9,6 +9,7 @@
          binman {
                  ti-secure-rom {
                          content = <&unsecure_binary>;
+                       core-opts = <2>;

here ^

Quoted 6 lines
Quoted 2 lines

Do you think there could be a binding file in dt-bindings/ for this value?

Sorry for getting back to this patch so late, but wanted to ask about this. I had seen a last version of getting the binman compatible in dt-bindings but I don't see it merged. Not sure where I would add this property in.

Quoted 10 lines

Yes it is difficult to do anything genuinely new.

I am anticipating something like compatible = "ti,secure-rom"

so I suppose you could create a header file with suitable values for this property.

On the other hand, you could wait until there is progress with the bindings.

I can try adding a header file for now, but follow up question; shouldn't it be added to arch/arm/dts rather than include/dt-bindings? There was traction by DT maintainers to move all such constants not directly used by the driver (in this case binman) to arch/arm/dts? [1] If you mean to use these constants in binman, will need to see how we can do that.

Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
tools/binman/test/297_ti_secure_rom.dts +0 -1
                  };
                  unsecure_binary: blob-ext {
                          filename = "ti_unsecure.bin";
--

2.34.1

Regards,
Simon

[1] https://lore.kernel.org/all/[email protected]/

Signature · 2 lines
Thanking You
Neha Malcom Francis
#6 lore raw

Re: [PATCH v3 1/2] binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts

Hi Neha,

Quoted 73 lines · Neha Malcom Francis

Hi Simon

Quoted 58 lines · Simon Glass

Hi Neha,

Quoted 48 lines · Neha Malcom Francis

Hi Simon

Quoted 29 lines · Simon Glass

Hi Neha,

Quoted 26 lines · Neha Malcom Francis

According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage.

---
Link to J721E TRM: https://www.ti.com/lit/zip/spruil1
Section 4.5.4.1 Boot Info

Changes in v3:
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- included TRM link in commit message

   tools/binman/btool/openssl.py           |  6 ++++--
   tools/binman/entries.rst                |  1 +
   tools/binman/etype/ti_secure_rom.py     | 11 +++++++++--
   tools/binman/etype/x509_cert.py         |  3 ++-
   tools/binman/test/297_ti_secure_rom.dts |  1 +
   5 files changed, 17 insertions(+), 5 deletions(-)

[...]

Quoted 12 lines

tools/binman/test/297_ti_secure_rom.dts line 12

Quoted 9 lines
tools/binman/test/297_ti_secure_rom.dts +1 -0
index d1313769f4..1a3eca9425 100644
@@ -9,6 +9,7 @@
          binman {
                  ti-secure-rom {
                          content = <&unsecure_binary>;
+                       core-opts = <2>;

here ^

Quoted 6 lines
Quoted 2 lines

Do you think there could be a binding file in dt-bindings/ for this value?

Sorry for getting back to this patch so late, but wanted to ask about this. I had seen a last version of getting the binman compatible in dt-bindings but I don't see it merged. Not sure where I would add this property in.

Quoted 10 lines

Yes it is difficult to do anything genuinely new.

I am anticipating something like compatible = "ti,secure-rom"

so I suppose you could create a header file with suitable values for this property.

On the other hand, you could wait until there is progress with the bindings.

Quoted 5 lines

I can try adding a header file for now, but follow up question; shouldn't it be added to arch/arm/dts rather than include/dt-bindings? There was traction by DT maintainers to move all such constants not directly used by the driver (in this case binman) to arch/arm/dts? [1] If you mean to use these constants in binman, will need to see how we can do that.

You can put the constant in the .dtsi and #include your binding file. But if you hit problems, let's worry about it later.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
tools/binman/test/297_ti_secure_rom.dts +0 -1
                  };
                  unsecure_binary: blob-ext {
                          filename = "ti_unsecure.bin";
--

2.34.1

Quoted 4 lines
Quoted 2 lines

Regards,
Simon

[1] https://lore.kernel.org/all/[email protected]/

Regards,
Simon

#7 lore raw

Re: [PATCH v3 1/2] binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts

Hi Simon

Quoted 76 lines · Simon Glass

Hi Neha,

Quoted 73 lines · Neha Malcom Francis

Hi Simon

Quoted 68 lines · Simon Glass

Hi Neha,

Quoted 48 lines · Neha Malcom Francis

Hi Simon

Quoted 29 lines · Simon Glass

Hi Neha,

Quoted 26 lines · Neha Malcom Francis

According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage.

---
Link to J721E TRM: https://www.ti.com/lit/zip/spruil1
Section 4.5.4.1 Boot Info

Changes in v3:
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- included TRM link in commit message

tools/binman/btool/openssl.py | 6 ++++--
tools/binman/entries.rst | 1 +
tools/binman/etype/ti_secure_rom.py | 11 +++++++++--
tools/binman/etype/x509_cert.py | 3 ++-
tools/binman/test/297_ti_secure_rom.dts | 1 + 5 files changed, 17 insertions(+), 5 deletions(-)

[...]

Quoted 12 lines

tools/binman/test/297_ti_secure_rom.dts line 12

Quoted 9 lines
tools/binman/test/297_ti_secure_rom.dts +1 -0
index d1313769f4..1a3eca9425 100644
@@ -9,6 +9,7 @@
           binman {
                   ti-secure-rom {
                           content = <&unsecure_binary>;
+                       core-opts = <2>;

here ^

Quoted 6 lines
Quoted 2 lines

Do you think there could be a binding file in dt-bindings/ for this value?

Sorry for getting back to this patch so late, but wanted to ask about this. I had seen a last version of getting the binman compatible in dt-bindings but I don't see it merged. Not sure where I would add this property in.

Yes it is difficult to do anything genuinely new.

I am anticipating something like compatible = "ti,secure-rom"

so I suppose you could create a header file with suitable values for this property.

On the other hand, you could wait until there is progress with the bindings.

Quoted 9 lines
Quoted 5 lines

I can try adding a header file for now, but follow up question; shouldn't it be added to arch/arm/dts rather than include/dt-bindings? There was traction by DT maintainers to move all such constants not directly used by the driver (in this case binman) to arch/arm/dts? [1] If you mean to use these constants in binman, will need to see how we can do that.

You can put the constant in the .dtsi and #include your binding file. But if you hit problems, let's worry about it later.

I'm a little confused on what has to be done regarding the binding ATM, so I'll stick to waiting for some progress with the binman bindings and then tackle it.

Quoted 14 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
tools/binman/test/297_ti_secure_rom.dts +0 -1
                   };
                   unsecure_binary: blob-ext {
                           filename = "ti_unsecure.bin";
--

2.34.1

Quoted 4 lines
Quoted 2 lines

Regards,
Simon

[1] https://lore.kernel.org/all/[email protected]/

Regards,
Simon

Signature · 2 lines
Thanking You
Neha Malcom Francis
#8 lore raw

Re: [PATCH v3 1/2] binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts

Hi Neha,

Quoted 86 lines · Neha Malcom Francis

Hi Simon

Quoted 82 lines · Simon Glass

Hi Neha,

Quoted 78 lines · Neha Malcom Francis

Hi Simon

Quoted 58 lines · Simon Glass

Hi Neha,

Quoted 48 lines · Neha Malcom Francis

Hi Simon

Quoted 29 lines · Simon Glass

Hi Neha,

Quoted 26 lines · Neha Malcom Francis

According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage.

---
Link to J721E TRM: https://www.ti.com/lit/zip/spruil1
Section 4.5.4.1 Boot Info

Changes in v3:
- updated function comments
- removed inconsistency in setting bootcore_opts to 32

Changes in v2:
- included TRM link in commit message

tools/binman/btool/openssl.py | 6 ++++--
tools/binman/entries.rst | 1 +
tools/binman/etype/ti_secure_rom.py | 11 +++++++++--
tools/binman/etype/x509_cert.py | 3 ++-
tools/binman/test/297_ti_secure_rom.dts | 1 + 5 files changed, 17 insertions(+), 5 deletions(-)

[...]

Quoted 12 lines

tools/binman/test/297_ti_secure_rom.dts line 12

Quoted 9 lines
tools/binman/test/297_ti_secure_rom.dts +1 -0
index d1313769f4..1a3eca9425 100644
@@ -9,6 +9,7 @@
           binman {
                   ti-secure-rom {
                           content = <&unsecure_binary>;
+                       core-opts = <2>;

here ^

Quoted 6 lines
Quoted 2 lines

Do you think there could be a binding file in dt-bindings/ for this value?

Sorry for getting back to this patch so late, but wanted to ask about this. I had seen a last version of getting the binman compatible in dt-bindings but I don't see it merged. Not sure where I would add this property in.

Quoted 10 lines

Yes it is difficult to do anything genuinely new.

I am anticipating something like compatible = "ti,secure-rom"

so I suppose you could create a header file with suitable values for this property.

On the other hand, you could wait until there is progress with the bindings.

I can try adding a header file for now, but follow up question; shouldn't it be added to arch/arm/dts rather than include/dt-bindings? There was traction by DT maintainers to move all such constants not directly used by the driver (in this case binman) to arch/arm/dts? [1] If you mean to use these constants in binman, will need to see how we can do that.

Quoted 7 lines
Quoted 3 lines

You can put the constant in the .dtsi and #include your binding file. But if you hit problems, let's worry about it later.

I'm a little confused on what has to be done regarding the binding ATM, so I'll stick to waiting for some progress with the binman bindings and then tackle it.

Yes that sounds fine.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
tools/binman/test/297_ti_secure_rom.dts +0 -1
                   };
                   unsecure_binary: blob-ext {
                           filename = "ti_unsecure.bin";
--

2.34.1

Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Regards,
Simon

[1] https://lore.kernel.org/all/[email protected]/

Regards,
Simon

Regards,
Simon

#9 lore raw

PATCH v3 2/2 DONOTMERGE: arm: dts: k3-j7200-binman: Enable split mode for MCU R5

In reply to Neha Malcom Francis

Set boot core-opts to enable split mode for MCU R5 cluster by default. This patch serves to demonstrate how this can be done.

---
No change since v2

 arch/arm/dts/k3-j7200-binman.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/dts/k3-j7200-binman.dtsi +3 -0
index 14f7dea65e..025a0bd071 100644
@@ -55,6 +55,7 @@
 				<&combined_dm_cfg>, <&sysfw_inner_cert>;
 			combined;
 			dm-data;
+			core-opts = <2>;
 			sysfw-inner-cert;
 			keyfile = "custMpk.pem";
 			sw-rev = <1>;
@@ -100,6 +101,7 @@
 				<&combined_dm_cfg_fs>, <&sysfw_inner_cert_fs>;
 			combined;
 			dm-data;
+			core-opts = <2>;
 			sysfw-inner-cert;
 			keyfile = "custMpk.pem";
 			sw-rev = <1>;
@@ -146,6 +148,7 @@
 				<&combined_tifs_cfg_gp>, <&combined_dm_cfg_gp>;
 			combined;
 			dm-data;
+			core-opts = <2>;
 			content-sbl = <&u_boot_spl_unsigned>;
 			load = <0x41c00000>;
 			content-sysfw = <&ti_fs_gp>;
Signature · 1 line
2.34.1