[PATCH 1/1] tools: binman: etype: Allow to replace 'NAME' in node names

Paul HENRYS paul.henrys_ext at softathome.com
Thu Nov 21 11:53:09 CET 2024


Hi Simon,

On 20/11/2024 14:35, Simon Glass wrote:
> This Mail comes from Outside of SoftAtHome: Do not answer, click links or open attachments unless you recognize the sender and know the content is safe.
>
> Hi Paul,
>
> On Wed, 20 Nov 2024 at 03:40, Paul HENRYS
> <paul.henrys_ext at softathome.com> wrote:
>> This change allows to replace both 'SEQ' and 'NAME' keywords by respectively a
>> sequence number and the name of the FDT to provide more flexibility in the node
>> name for the device trees included in the FIT.
> This seems OK to me, but it would help to understand the motivation
> better. Can you expand this a bit?
The rational behind this change is because some projects uses some kind 
of board data to look for the right config in a FIT image in U-Boot. The 
default sequence number (config-1, config-2...) does not make it easy to 
retrieve the right config in such a case. For instance, OpenWrt uses the 
script "scripts/mkits.sh" to create an ITS passed to mkimage, where the 
config node names can be customized when supporting multiple configs and 
typically uses the device tree name appended to "config-".
The idea is thus to provide the flexibility in binman to use the 
traditional scheme with the sequence numbers (config-1, config-2...) or 
use NAME instead (e.g. config-myboard1, config-myboard2...) or a 
combination of both.
>
>> Signed-off-by: Paul HENRYS <paul.henrys_ext at softathome.com>
>> ---
>>   tools/binman/etype/fit.py | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
>> index e0c1ac08d8..b9ebc3afd0 100644
>> --- a/tools/binman/etype/fit.py
>> +++ b/tools/binman/etype/fit.py
>> @@ -732,6 +732,7 @@ class Entry_fit(Entry_section):
>>                   # Generate nodes for each FDT
>>                   for seq, fdt_fname in enumerate(self._fdts):
>>                       node_name = node.name[1:].replace('SEQ', str(seq + 1))
>> +                    node_name = node_name.replace('NAME', fdt_fname)
>>                       if self._fdt_dir:
>>                           fname = os.path.join(self._fdt_dir, fdt_fname + '.dtb')
>>                       else:
>> --
>> 2.43.0
> Please update the documentation (near the top of this file) and
> regenerate entries.rst
>
> It also needs a test so that coverage passes (binman test -T)...
Ok. I am going to update the documentation and add a test.
>
> [..]
>
> Regards,
> Simon
Regards,
Paul


More information about the U-Boot mailing list