tools: binman: ti_board_cfg: Add configurable sw-rev support
PATCH 1/1 tools: binman: ti_board_cfg: Add configurable sw-rev support
The software revision field in the combined board config binary header was hardcoded to 1, preventing independent control from SBL SWREV configured via ti-secure-rom's sw-rev property.
Add support for the optional 'sw-rev' DTS property in ti_board_config nodes, which sets the SWREV byte in the header. Defaults to 1 for backward compatibility.
--- tools/binman/etype/ti_board_config.py | 4 ++- tools/binman/ftest.py | 5 ++++ .../vendor/ti_board_cfg_combined_sw_rev.dts | 26 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tools/binman/test/vendor/ti_board_cfg_combined_sw_rev.dts
tools/binman/etype/ti_board_config.py +3 -1
@@ -38,6 +38,8 @@ class Entry_ti_board_config(Entry_section): - config-file: File containing board configuration data in YAML - schema-file: File containing board configuration YAML schema against which the config file is validated + - sw-rev: Software revision for the board config binary header + (optional, default 1) Output files: - board config binary: File containing board configuration binary
@@ -80,11 +82,11 @@ class Entry_ti_board_config(Entry_section): self._fmt = '<HHHBB' self._index = 0 self._binary_offset = 0 - self._sw_rev = 1 self._devgrp = 0 def ReadNode(self): super().ReadNode() + self._sw_rev = fdt_util.GetInt(self._node, 'sw-rev', 1) self._config = fdt_util.GetString(self._node, 'config') self._schema = fdt_util.GetString(self._node, 'schema') # Depending on whether config file is present in node, we determine
tools/binman/ftest.py +5 -0
@@ -7212,6 +7212,11 @@ fdt fdtmap Extract the devicetree blob from the fdtmap configlen_noheader = TI_BOARD_CONFIG_DATA * 4 self.assertGreater(data, configlen_noheader) + def testTIBoardConfigCombinedSwRev(self): + """Test that sw-rev property is honoured in combined board config""" + data = self._DoReadFile('vendor/ti_board_cfg_combined_sw_rev.dts') + self.assertEqual(2, data[1]) + def testTIBoardConfigNoDataType(self): """Test that error is thrown when data type is not supported""" with self.assertRaises(ValueError) as e:
tools/binman/test/vendor/ti_board_cfg_combined_sw_rev.dts new file +26 -0
@@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0+ +/dts-v1/; + +/ { + binman { + ti-board-config { + sw-rev = <2>; + board-cfg { + config = "yaml/config.yaml"; + schema = "yaml/schema.yaml"; + }; + sec-cfg { + config = "yaml/config.yaml"; + schema = "yaml/schema.yaml"; + }; + rm-cfg { + config = "yaml/config.yaml"; + schema = "yaml/schema.yaml"; + }; + pm-cfg { + config = "yaml/config.yaml"; + schema = "yaml/schema.yaml"; + }; + }; + }; +};
Signature · 1 line
2.34.1
Quoted 10 lines · Shiva Tripathi
tools: binman:
ti_board_cfg: Add configurable sw-rev supportThe software revision field in the combined board config binary header was hardcoded to 1, preventing independent control from SBL SWREV configured via ti-secure-rom's sw-rev property.
Add support for the optional 'sw-rev' DTS property in
ti_board_confignodes, which sets the SWREV byte in the header. Defaults to 1 for backward compatibility.
Quoted 6 lines
Signed-off-by Shiva Tripathi <[email protected]>
tools/binman/etype/ti_board_config.py| 4 +++-tools/binman/ftest.py | 5 +++++ .../test/vendor/ti_board_cfg_combined_sw_rev.dts | 26 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-)
Quoted 9 lines · Shiva Tripathi
The software revision field in the combined board config binary header was hardcoded to 1, preventing independent control from SBL SWREV configured via ti-secure-rom's sw-rev property.
Add support for the optional 'sw-rev' DTS property in
ti_board_confignodes, which sets the SWREV byte in the header. Defaults to 1 for backward compatibility.[...]
Applied to u-boot/master, thanks!
[1/1] tools: binman: ti_board_cfg: Add configurable sw-rev support
commit: ab2266aff3622a1cf1a5e76a0702688b2bb538a5
Signature · 1 line
Tom