Propagate bootph* property to all parent nodes
v2 cover Propagate bootph* property to all parent nodes
In the U-Boot pre-relocation stage, if the parent node lacks bootph* property and the driver lacks a pre-reloc flag, all of its subsequent subnodes gets skipped over from driver binding—even if they have a bootph* property.
This series addresses the issue by scanning through all the nodes during build time and adds the bootph-* property to all of its supernode.
Change since v1:
https://lore.kernel.org/u-boot/[email protected]/
- Change of approach to do the bootph-* property addition during build time instead of run time, saving boot time delays seen in V1.
Moteen Shah (2):
tools: binman: control.py: Propagate bootph-* properties to supernodes
tools: binman: ftest.py: Add testcase for bootph-* propagation
tools/binman/control.py | 35 ++++++++++++++++++++++++++- tools/binman/ftest.py | 17 +++++++++++++ tools/binman/test/347_bootph_prop.dts | 19 +++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 tools/binman/test/347_bootph_prop.dts
Signature · 1 line
2.34.1
RFC PATCH v2 1/2 tools: binman: control.py: Propagate bootph-* properties to supernodes
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)
tools/binman/control.py +34 -1
@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete() +def prop_bootph_to_parent(node, prop, dtb): + """Propagates bootph-* property to all the parent + nodes up the hierarchy + """ + parent = node.parent + if parent == None or parent.props.get(prop): + return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent + +def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node. + """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram'] + + for props in bootph_prop: + if node.props.get(props): + prop_bootph_to_parent(node, props, dtb) + + for subnode in node.subnodes: + scan_and_prop_bootph(subnode, dtb) + def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir): """Prepare the images to be processed and select the device tree
@@ -563,7 +592,11 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind indir = [] dtb_fname = fdt_util.EnsureCompiled(dtb_fname, indir=indir) fname = tools.get_output_filename('u-boot.dtb.out') - tools.write_file(fname, tools.read_file(dtb_fname)) + dtb = fdt.FdtScan(dtb_fname) + scan_and_prop_bootph(dtb.GetRoot(), dtb) + dtb.Sync(True) + tools.write_file(dtb_fname, dtb.GetContents()) + tools.write_file(fname, dtb.GetContents()) dtb = fdt.FdtScan(fname) node = _FindBinmanNode(dtb)
Signature · 1 line
2.34.1
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hi Moteen,
Quoted 29 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +12
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete() +def prop_bootph_to_parent(node, prop, dtb): + """Propagates bootph-* property to all the parent + nodes up the hierarchy + """ + parent = node.parent + if parent == None or parent.props.get(prop): + return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent +
tools/binman/control.py def _RemoveTemplates(parent): · line 550
Quoted 10 lines
tools/binman/control.py +10
-0+def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node. + """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram'] +
This should only be done for U-Boot proper DTB I believe, otherwise it'll cause FDT size increase for TPL/SPL/VPL/whatever where we may be extremely size-constrained. Furthermore, TPL/SPL/VPL should not need this since they get a subset of the actual full DTB (see scripts/Makefile.lib and fdtgrep_props), only containing the DT node that are relevant for the stage in question. The only exception I can think of right now is if we use bloblist or any other mechanism having the full DT passed from stage to stage.
Maybe the solution is to have it as part of tools/binman/etype/u_boot_dtb.py only?
Also, I imagine we want to support this for systems which do not use binman (yet?)?
Cheers,
Quentin
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hi Quentin,
Quoted 53 lines · Quentin Schulz
Hi Moteen,
Quoted 29 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +12
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete() +def prop_bootph_to_parent(node, prop, dtb): + """Propagates bootph-* property to all the parent + nodes up the hierarchy + """ + parent = node.parent + if parent == None or parent.props.get(prop): + return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent +tools/binman/control.py def _RemoveTemplates(parent): · line 550
Quoted 10 lines
tools/binman/control.py +10
-0+def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node. + """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram'] +This should only be done for U-Boot proper DTB I believe, otherwise it'll cause FDT size increase for TPL/SPL/VPL/whatever where we may be extremely size-constrained. Furthermore, TPL/SPL/VPL should not need this since they get a subset of the actual full DTB (see
scripts/Makefile.libandfdtgrep_props), only containing the DT node that are relevant for the stage in question. The only exception I can think of right now is if we use bloblist or any other mechanism having the full DT passed from stage to stage.
Quoted 2 lines
Maybe the solution is to have it as part of
tools/binman/etype/u_boot_dtb.pyonly?
The location of this code is where it is handling the U-Boot device tree, so it won't affect xPL versions.
But it is possible to add a check for this into the test.
Quoted 3 lines
Also, I imagine we want to support this for systems which do not use binman (yet?)?
Nope, sorry :-) They can enable binman if they want this.
Regards,
Simon
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
In reply to Quentin SchulzHi Quentin,
Quoted 51 lines · Quentin Schulz
Hi Moteen,
Quoted 28 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +12
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete() +def prop_bootph_to_parent(node, prop, dtb): + """Propagates bootph-* property to all the parent + nodes up the hierarchy + """ + parent = node.parent + if parent == None or parent.props.get(prop): + return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent +tools/binman/control.py def _RemoveTemplates(parent): · line 549
Quoted 10 lines
tools/binman/control.py +10
-0+def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node. + """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram'] +This should only be done for U-Boot proper DTB I believe, otherwise it'll cause FDT size increase for TPL/SPL/VPL/whatever where we may be extremely size-constrained. Furthermore, TPL/SPL/VPL should not need this since they get a subset of the actual full DTB (see
scripts/Makefile.libandfdtgrep_props), only containing the DT node that are relevant for the stage in question. The only exception I can think of right now is if we use bloblist or any other mechanism having the full DT passed from stage to stage.
Quoted 5 lines
Maybe the solution is to have it as part of
tools/binman/etype/u_boot_dtb.pyonly?Also, I imagine we want to support this for systems which do not use binman (yet?)?
I think if we really want to unblock platforms that are facing this then maybe the v1 of this patchset along with the v2 can be merged. ( keeping v1 config as disabled by default for now ). This can help the platforms wanting to fix this issue without binman by enabling that config in their defconfig ( ofcourse with a boot time penalty which would force them to migrate to binman ). Though not sure if this is the right way to go about it but just a suggestion.
Regards,
Manorit
Quoted 3 lines
Cheers,
Quentin
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hi Manorit,
Quoted 61 lines · Manorit Chawdhry
Hi Quentin,
Quoted 51 lines · Quentin Schulz
Hi Moteen,
Quoted 28 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +12
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete() +def prop_bootph_to_parent(node, prop, dtb): + """Propagates bootph-* property to all the parent + nodes up the hierarchy + """ + parent = node.parent + if parent == None or parent.props.get(prop): + return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent +tools/binman/control.py def _RemoveTemplates(parent): · line 549
Quoted 10 lines
tools/binman/control.py +10
-0+def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node. + """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram'] +This should only be done for U-Boot proper DTB I believe, otherwise it'll cause FDT size increase for TPL/SPL/VPL/whatever where we may be extremely size-constrained. Furthermore, TPL/SPL/VPL should not need this since they get a subset of the actual full DTB (see
scripts/Makefile.libandfdtgrep_props), only containing the DT node that are relevant for the stage in question. The only exception I can think of right now is if we use bloblist or any other mechanism having the full DT passed from stage to stage.Quoted 5 lines
Maybe the solution is to have it as part of
tools/binman/etype/u_boot_dtb.pyonly?Also, I imagine we want to support this for systems which do not use binman (yet?)?
Quoted 7 lines
I think if we really want to unblock platforms that are facing this then maybe the v1 of this patchset along with the v2 can be merged. ( keeping v1 config as disabled by default for now ). This can help the platforms wanting to fix this issue without binman by enabling that config in their defconfig ( ofcourse with a boot time penalty which would force them to migrate to binman ). Though not sure if this is the right way to go about it but just a suggestion.
Yes that seems like a good idea to me.
Regards,
Simon
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hey Simon and Quentin,
Should I send one RFC for this for folks not using binman?
Regards,
Moteen
Quoted 72 lines · Simon Glass
Hi Manorit,
Quoted 58 lines · Manorit Chawdhry
Hi Quentin,
Quoted 50 lines · Quentin Schulz
Hi Moteen,
Quoted 28 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +12
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete() +def prop_bootph_to_parent(node, prop, dtb): + """Propagates bootph-* property to all the parent + nodes up the hierarchy + """ + parent = node.parent + if parent == None or parent.props.get(prop): + return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent +tools/binman/control.py def _RemoveTemplates(parent): · line 549
Quoted 10 lines
tools/binman/control.py +10
-0+def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node. + """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram'] +This should only be done for U-Boot proper DTB I believe, otherwise it'll cause FDT size increase for TPL/SPL/VPL/whatever where we may be extremely size-constrained. Furthermore, TPL/SPL/VPL should not need this since they get a subset of the actual full DTB (see
scripts/Makefile.libandfdtgrep_props), only containing the DT node that are relevant for the stage in question. The only exception I can think of right now is if we use bloblist or any other mechanism having the full DT passed from stage to stage.Quoted 5 lines
Maybe the solution is to have it as part of
tools/binman/etype/u_boot_dtb.pyonly?Also, I imagine we want to support this for systems which do not use binman (yet?)?
Quoted 7 lines
I think if we really want to unblock platforms that are facing this then maybe the v1 of this patchset along with the v2 can be merged. ( keeping v1 config as disabled by default for now ). This can help the platforms wanting to fix this issue without binman by enabling that config in their defconfig ( ofcourse with a boot time penalty which would force them to migrate to binman ). Though not sure if this is the right way to go about it but just a suggestion.
Yes that seems like a good idea to me.
Regards,
Simon
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hi Moteen,
Quoted 4 lines · Moteen Shah
Hey Simon and Quentin,
Should I send one RFC for this for folks not using binman?
If you already have code for it, sure. Otherwise, I guess whoever encounter a similar issues as yours for their boards can fix that themselves if you don't feel like working on that (as I assume your boards all are using binman already?).
Cheers,
Quentin
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
In reply to Moteen ShahHi Moteen,
Quoted 15 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +0
-0
tools/binman/control.py def _RemoveTemplates(parent): · line 529
Quoted 4 lines
tools/binman/control.py +1
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete() +def prop_bootph_to_parent(node, prop, dtb):
I think the 'prop_' is a bit confusing, since you are dealing with properties! How about 'add_' as the prefix?
tools/binman/control.py def _RemoveTemplates(parent): · line 531
Quoted 2 lines
tools/binman/control.py +2
-0+ """Propagates bootph-* property to all the parent + nodes up the hierarchy
First line should be a summary
then blank line
then describe the args...you can see this if you look at a few other functions.
tools/binman/control.py def _RemoveTemplates(parent): · line 534
Quoted 3 lines
tools/binman/control.py +3
-0+ """ + parent = node.parent + if parent == None or parent.props.get(prop):
if not parent or ...
tools/binman/control.py def _RemoveTemplates(parent): · line 547
Quoted 13 lines
tools/binman/control.py +13
-0+ return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent + +def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node.
comment style again
tools/binman/control.py def _RemoveTemplates(parent): · line 549
Quoted 2 lines
tools/binman/control.py +2
-0+ """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram']
From my understanding the only ones that matter are bootph-all and bootph-some-ram, since the SPL ones are handled by fdtgrep.
tools/binman/control.py def _RemoveTemplates(parent): · line 551
Quoted 2 lines
tools/binman/control.py +2
-0+ + for props in bootph_prop:
for prop
(since it is just one)
Quoted 10 lines
tools/binman/control.py +6
-0+ if node.props.get(props): + prop_bootph_to_parent(node, props, dtb) + + for subnode in node.subnodes: + scan_and_prop_bootph(subnode, dtb) + def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir): """Prepare the images to be processed and select the device tree
tools/binman/control.py def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind · line 599
Quoted 9 lines
tools/binman/control.py +5
-1@@ -563,7 +592,11 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind indir = [] dtb_fname = fdt_util.EnsureCompiled(dtb_fname, indir=indir) fname = tools.get_output_filename('u-boot.dtb.out') - tools.write_file(fname, tools.read_file(dtb_fname)) + dtb = fdt.FdtScan(dtb_fname) + scan_and_prop_bootph(dtb.GetRoot(), dtb) + dtb.Sync(True) + tools.write_file(dtb_fname, dtb.GetContents()) + tools.write_file(fname, dtb.GetContents())
You shouldn't write back to the file created by the build. Do you need this?
Quoted 6 lines
tools/binman/control.py +0
-1dtb = fdt.FdtScan(fname) node = _FindBinmanNode(dtb) --2.34.1
The code looks fine to me apart from the nits.
This addition needs a test - see ftest.py for some examples there. But basically just create a dts that has some props in it, then check that they got added.
I think testSimpleFitEncryptedData() could be a good example?
Regards,
Simon
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hey Simon,
Quoted 20 lines · Simon Glass
Hi Moteen,
Quoted 17 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +0
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete()
Quoted 3 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 529
Quoted 1 line
tools/binman/control.py +1
-0+def prop_bootph_to_parent(node, prop, dtb):I think the '
prop_' is a bit confusing, since you are dealing with properties! How about 'add_' as the prefix?
'add_' should be more descriptive, will add that in v3.
Quoted 8 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 531
Quoted 3 lines
tools/binman/control.py +2
-0+ """Propagates bootph-* property to all the parent + nodes up the hierarchyFirst line should be a summary
then blank line
then describe the args...you can see this if you look at a few other functions.
Noted, will rectify in v3.
Quoted 4 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 534
Quoted 3 lines
tools/binman/control.py +3
-0+ """ + parent = node.parent + if parent == None or parent.props.get(prop):if not parent or ...
Noted.
Quoted 16 lines
Quoted 4 lines
tools/binman/control.py +3
-0+ return + + while parent:tools/binman/control.py def _RemoveTemplates(parent): · line 547
Quoted 10 lines
tools/binman/control.py +10
-0+ parent.AddEmptyProp(prop, 0) + parent = parent.parent + +def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node.comment style again
Quoted 4 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 549
Quoted 2 lines
tools/binman/control.py +2
-0+ """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram']From my understanding the only ones that matter are bootph-all and
bootph-some-ram, since the SPL ones are handled by fdtgrep.
Noted.
Quoted 16 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 551
Quoted 3 lines
tools/binman/control.py +2
-0+ + for props in bootph_prop:for prop
(since it is just one)
Quoted 9 lines
tools/binman/control.py +6
-0+ if node.props.get(props): + prop_bootph_to_parent(node, props, dtb) + + for subnode in node.subnodes: + scan_and_prop_bootph(subnode, dtb) + def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir): """Prepare the images to be processed and select the device tree
Quoted 11 lines
tools/binman/control.py def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind · line 599
Quoted 10 lines
tools/binman/control.py +5
-1@@ -563,7 +592,11 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind indir = [] dtb_fname = fdt_util.EnsureCompiled(dtb_fname, indir=indir) fname = tools.get_output_filename('u-boot.dtb.out') - tools.write_file(fname, tools.read_file(dtb_fname)) + dtb = fdt.FdtScan(dtb_fname) + scan_and_prop_bootph(dtb.GetRoot(), dtb) + dtb.Sync(True) + tools.write_file(dtb_fname, dtb.GetContents()) + tools.write_file(fname, dtb.GetContents())You shouldn't write back to the file created by the build. Do you need this?
Had the same thought, but the build fails in non clean builds[0]. Did a workaround[1] but then some essential template nodes ends up getting deleted from u-boot.dtb. Finally, had to write back to the file to resolve the issue.
Quoted 11 lines
Quoted 6 lines
tools/binman/control.py +0
-1dtb = fdt.FdtScan(fname) node = _FindBinmanNode(dtb) --2.34.1
The code looks fine to me apart from the nits.
This addition needs a test - see
ftest.pyfor some examples there. But basically just create a dts that has some props in it, then check that they got added.
Included a test as well in the patchset[3]. Do let me know if there are some changes required in it.
Quoted 5 lines
I think
testSimpleFitEncryptedData()could be a good example?Regards,
Simon
References:
[0] https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-non-clean-build
[1] https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-patch-tools-dtdoc-fdt-py
[3] https://lore.kernel.org/u-boot/[email protected]/
Thanks for the review.
Regards,
Moteen
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hi Moteen,
Quoted 105 lines · Moteen Shah
Hey Simon,
Quoted 20 lines · Simon Glass
Hi Moteen,
Quoted 17 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +0
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete()Quoted 3 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 529
Quoted 1 line
tools/binman/control.py +1
-0+def prop_bootph_to_parent(node, prop, dtb):I think the '
prop_' is a bit confusing, since you are dealing with properties! How about 'add_' as the prefix?'
add_' should be more descriptive, will add that in v3.Quoted 8 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 531
Quoted 3 lines
tools/binman/control.py +2
-0+ """Propagates bootph-* property to all the parent + nodes up the hierarchyFirst line should be a summary
then blank line
then describe the args...you can see this if you look at a few other functions.
Noted, will rectify in v3.
Quoted 4 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 534
Quoted 3 lines
tools/binman/control.py +3
-0+ """ + parent = node.parent + if parent == None or parent.props.get(prop):if not parent or ...
Noted.
Quoted 16 lines
Quoted 4 lines
tools/binman/control.py +3
-0+ return + + while parent:tools/binman/control.py def _RemoveTemplates(parent): · line 547
Quoted 10 lines
tools/binman/control.py +10
-0+ parent.AddEmptyProp(prop, 0) + parent = parent.parent + +def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node.comment style again
Quoted 4 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 549
Quoted 2 lines
tools/binman/control.py +2
-0+ """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram']From my understanding the only ones that matter are bootph-all and
bootph-some-ram, since the SPL ones are handled by fdtgrep.Noted.
Quoted 16 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 551
Quoted 3 lines
tools/binman/control.py +2
-0+ + for props in bootph_prop:for prop
(since it is just one)
Quoted 9 lines
tools/binman/control.py +6
-0+ if node.props.get(props): + prop_bootph_to_parent(node, props, dtb) + + for subnode in node.subnodes: + scan_and_prop_bootph(subnode, dtb) + def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir): """Prepare the images to be processed and select the device treeQuoted 11 lines
tools/binman/control.py def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind · line 599
Quoted 10 lines
tools/binman/control.py +5
-1@@ -563,7 +592,11 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind indir = [] dtb_fname = fdt_util.EnsureCompiled(dtb_fname, indir=indir) fname = tools.get_output_filename('u-boot.dtb.out') - tools.write_file(fname, tools.read_file(dtb_fname)) + dtb = fdt.FdtScan(dtb_fname) + scan_and_prop_bootph(dtb.GetRoot(), dtb) + dtb.Sync(True) + tools.write_file(dtb_fname, dtb.GetContents()) + tools.write_file(fname, dtb.GetContents())You shouldn't write back to the file created by the build. Do you need this?
Quoted 4 lines
Had the same thought, but the build fails in non clean builds[0]. Did a workaround[1] but then some essential template nodes ends up getting deleted from u-boot.dtb. Finally, had to write back to the file to resolve the issue.
Can you push a tree somewhere. This could be a bug that I could fix.
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
tools/binman/control.py +0
-1dtb = fdt.FdtScan(fname) node = _FindBinmanNode(dtb) --2.34.1
The code looks fine to me apart from the nits.
Quoted 7 lines
Quoted 3 lines
This addition needs a test - see
ftest.pyfor some examples there. But basically just create a dts that has some props in it, then check that they got added.Included a test as well in the patchset[3]. Do let me know if there are some changes required in it.
Somehow I'm not seeing that in patchwork. It looks good but please try to keep lines <=80 cols.
Quoted 7 lines
Quoted 6 lines
I think
testSimpleFitEncryptedData()could be a good example?Regards,
Simon
Quoted 8 lines
References:
[0]
https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-non-clean-build
[1]
https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-patch-tools-dtdoc-fdt-py
[3] https://lore.kernel.org/u-boot/[email protected]/Thanks for the review.
Regards,
Simon
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hey Simon,
Quoted 99 lines · Simon Glass
Hi Moteen,
Quoted 96 lines · Moteen Shah
Hey Simon,
Quoted 20 lines · Simon Glass
Hi Moteen,
Quoted 17 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +0
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete()Quoted 3 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 529
Quoted 1 line
tools/binman/control.py +1
-0+def prop_bootph_to_parent(node, prop, dtb):I think the '
prop_' is a bit confusing, since you are dealing with properties! How about 'add_' as the prefix?'
add_' should be more descriptive, will add that in v3.Quoted 7 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 531
Quoted 2 lines
tools/binman/control.py +2
-0+ """Propagates bootph-* property to all the parent + nodes up the hierarchyFirst line should be a summary
then blank line
then describe the args...you can see this if you look at a few other functions.
Noted, will rectify in v3.
Quoted 4 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 534
Quoted 3 lines
tools/binman/control.py +3
-0+ """ + parent = node.parent + if parent == None or parent.props.get(prop):if not parent or ...
Noted.
Quoted 15 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 547
Quoted 13 lines
tools/binman/control.py +13
-0+ return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent + +def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if its present + in subnode + + This is used to set the bootph-* property in the parent node if a + "bootph-*" property is found in any of the subnodes of the parent + node.comment style again
Quoted 4 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 549
Quoted 2 lines
tools/binman/control.py +2
-0+ """ + bootph_prop = ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram']From my understanding the only ones that matter are bootph-all and
bootph-some-ram, since the SPL ones are handled by fdtgrep.Noted.
Quoted 26 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 551
Quoted 2 lines
tools/binman/control.py +2
-0+ + for props in bootph_prop:for prop
(since it is just one)
Quoted 10 lines
tools/binman/control.py +6
-0+ if node.props.get(props): + prop_bootph_to_parent(node, props, dtb) + + for subnode in node.subnodes: + scan_and_prop_bootph(subnode, dtb) + def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir): """Prepare the images to be processed and select the device treetools/binman/control.py def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind · line 599
Quoted 9 lines
tools/binman/control.py +5
-1@@ -563,7 +592,11 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind indir = [] dtb_fname = fdt_util.EnsureCompiled(dtb_fname, indir=indir) fname = tools.get_output_filename('u-boot.dtb.out') - tools.write_file(fname, tools.read_file(dtb_fname)) + dtb = fdt.FdtScan(dtb_fname) + scan_and_prop_bootph(dtb.GetRoot(), dtb) + dtb.Sync(True) + tools.write_file(dtb_fname, dtb.GetContents()) + tools.write_file(fname, dtb.GetContents())You shouldn't write back to the file created by the build. Do you need this?
Quoted 5 lines
Quoted 4 lines
Had the same thought, but the build fails in non clean builds[0]. Did a workaround[1] but then some essential template nodes ends up getting deleted from u-boot.dtb. Finally, had to write back to the file to resolve the issue.
Can you push a tree somewhere. This could be a bug that I could fix.
You can use the tree here to recreate the non clean build issue mentioned:
https://github.com/Jamm02/U-Boot-patchwork/tree/bootph-patch-test
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
tools/binman/control.py +0
-1dtb = fdt.FdtScan(fname) node = _FindBinmanNode(dtb) --2.34.1
The code looks fine to me apart from the nits.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
This addition needs a test - see
ftest.pyfor some examples there. But basically just create a dts that has some props in it, then check that they got added.Included a test as well in the patchset[3]. Do let me know if there are some changes required in it.
Somehow I'm not seeing that in patchwork. It looks good but please try to keep lines <=80 cols.
Sure, will fix up in v3. Should I push a v3 or wait for you to fix the issue discussed above?
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
I think
testSimpleFitEncryptedData()could be a good example?Regards,
Simon
Quoted 8 lines
Quoted 6 lines
References:
[0]https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-non-clean-build [1]https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-patch-tools-dtdoc-fdt-py [3]https://lore.kernel.org/u-boot/[email protected]/Thanks for the review.
Regards,
Simon
Regards,
Moteen
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hey Simon,
Is the problem discussed in the thread an actual bug or am I missing something in the implementation?
Regards,
Moteen
Quoted 159 lines · Moteen Shah
Hey Simon,
Quoted 104 lines · Simon Glass
Hi Moteen,
Quoted 101 lines · Moteen Shah
Hey Simon,
Quoted 20 lines · Simon Glass
Hi Moteen,
Quoted 17 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>---
tools/binman/control.py| 35 ++++++++++++++++++++++++++++++++++-1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +0
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent):if
node.name.startswith('template'):
node.Delete()Quoted 3 lines
Quoted 1 line
+def
prop_bootph_to_parent(node, prop, dtb):I think the '
prop_' is a bit confusing, since you are dealing with properties! How about 'add_' as the prefix?'
add_' should be more descriptive, will add that in v3.Quoted 7 lines
Quoted 2 lines
+ """Propagates bootph-* property to all the parent + nodes up the hierarchy
First line should be a summary
then blank line
then describe the args...you can see this if you look at a few other functions.
Noted, will rectify in v3.
Quoted 4 lines
Quoted 3 lines
+ """
+ parent = node.parent
+ if parent == None orparent.props.get(prop):if not parent or ...
Noted.
Quoted 18 lines
Quoted 8 lines
+ return
tools/binman/control.py +7
-0+ + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent + +def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if itsQuoted 8 lines
present
+ in subnode
+
+ This is used to set the bootph-* property in the parent node if a
+ "bootph-*" property is found in any of the subnodes of the parent
+ node.comment style again
Quoted 5 lines
Quoted 3 lines
+ """
+bootph_prop= ['bootph-all', 'bootph-some-ram', 'bootph-pre-ram', 'bootph-pre-sram']From my understanding the only ones that matter are bootph-all and bootph-some-ram, since the SPL ones are handled by fdtgrep.
Noted.
Quoted 27 lines
Quoted 2 lines
+
+ for props inbootph_prop:for prop
(since it is just one)
Quoted 12 lines
+ if
node.props.get(props):
+prop_bootph_to_parent(node, props, dtb)tools/binman/control.py +4
-0+ + for subnode in node.subnodes: + scan_and_prop_bootph(subnode, dtb) +def
PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir):
"""Prepare the images to be processed and select the device treetools/binman/control.py +0
-0@@ -563,7 +592,11 @@ def PrepareImagesAndDtbs(dtb_fname,
select_images,update_fdt,use_expanded, ind
indir = []Quoted 8 lines
dtb_fname=fdt_util.EnsureCompiled(dtb_fname, indir=indir)fname =tools.get_output_filename('u-boot.dtb.out')-tools.write_file(fname, tools.read_file(dtb_fname))+ dtb =fdt.FdtScan(dtb_fname)
+scan_and_prop_bootph(dtb.GetRoot(), dtb)
+dtb.Sync(True)
+tools.write_file(dtb_fname, dtb.GetContents())
+tools.write_file(fname, dtb.GetContents())You shouldn't write back to the file created by the build. Do you need this?
Quoted 5 lines
Quoted 4 lines
Had the same thought, but the build fails in non clean builds[0]. Did a workaround[1] but then some essential template nodes ends up getting deleted from u-boot.dtb. Finally, had to write back to the file to resolve the issue.
Can you push a tree somewhere. This could be a bug that I could fix.
You can use the tree here to recreate the non clean build issue mentioned:
https://github.com/Jamm02/U-Boot-patchwork/tree/bootph-patch-testQuoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
dtb =
fdt.FdtScan(fname)node =
_FindBinmanNode(dtb)Signature · 1 line
2.34.1The code looks fine to me apart from the nits.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
This addition needs a test - see
ftest.pyfor some examples there. But basically just create a dts that has some props in it, then check that they got added.Included a test as well in the patchset[3]. Do let me know if there are some changes required in it.
Somehow I'm not seeing that in patchwork. It looks good but please try to keep lines <=80 cols.
Sure, will fix up in v3. Should I push a v3 or wait for you to fix the issue discussed above?
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
I think
testSimpleFitEncryptedData()could be a good example?Regards,
SimonReferences:
[0]https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-non-clean-buildQuoted 8 lines
Quoted 6 lines
[1]https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-patch-tools-dtdoc-fdt-py
[3]https://lore.kernel.org/u-boot/[email protected]/
Thanks for the review.
Regards,
SimonRegards,
Moteen
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hi Moteen,
Quoted 152 lines · Moteen Shah
Hey Simon,
Is the problem discussed in the thread an actual bug or am I missing something in the implementation?
Regards,
MoteenQuoted 142 lines · Moteen Shah
Hey Simon,
Quoted 108 lines · Simon Glass
Hi Moteen,
Quoted 105 lines · Moteen Shah
Hey Simon,
Quoted 20 lines · Simon Glass
Hi Moteen,
Quoted 17 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +0
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete()Quoted 3 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 529
Quoted 1 line
tools/binman/control.py +1
-0+def prop_bootph_to_parent(node, prop, dtb):I think the '
prop_' is a bit confusing, since you are dealing with properties! How about 'add_' as the prefix?'
add_' should be more descriptive, will add that in v3.Quoted 8 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 531
Quoted 2 lines
tools/binman/control.py +2
-0+ """Propagates bootph-* property to all the parent + nodes up the hierarchyFirst line should be a summary
then blank line
then describe the args...you can see this if you look at a few other functions.
Noted, will rectify in v3.
Quoted 4 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 534
Quoted 3 lines
tools/binman/control.py +3
-0+ """ + parent = node.parent + if parent == None or parent.props.get(prop):if not parent or ...
Noted.
Quoted 18 lines
Quoted 12 lines
tools/binman/control.py +8
-0+ return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent + +def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if itspresent
tools/binman/control.py +3
-0+ in subnode + + This is used to set the bootph-* property in the parent nodeQuoted 4 lines
if a
+ "bootph-*" property is found in any of the subnodes of the
parent
+ node.comment style again
Quoted 5 lines
Quoted 3 lines
tools/binman/control.py +2
-0+ """ + bootph_prop = ['bootph-all', 'bootph-some-ram','bootph-pre-ram', 'bootph-pre-sram']
From my understanding the only ones that matter are bootph-all and
bootph-some-ram, since the SPL ones are handled by fdtgrep.Noted.
Quoted 30 lines
tools/binman/control.py
Quoted 2 lines
tools/binman/control.py +2
-0+ + for props in bootph_prop:for prop
(since it is just one)
Quoted 16 lines
tools/binman/control.py +6
-0+ if node.props.get(props): + prop_bootph_to_parent(node, props, dtb) + + for subnode in node.subnodes: + scan_and_prop_bootph(subnode, dtb) + def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt,
use_expanded, indir):
"""Prepare the images to be processed and select the device
treetools/binman/control.py +0
-0@@ -563,7 +592,11 @@ def PrepareImagesAndDtbs(dtb_fname,
select_images,update_fdt,use_expanded, ind
indir = []
dtb_fname=fdt_util.EnsureCompiled(dtb_fname, indir=indir)fname =tools.get_output_filename('u-boot.dtb.out')tools/binman/control.py def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind · line 599
Quoted 6 lines
tools/binman/control.py +5
-1- tools.write_file(fname, tools.read_file(dtb_fname)) + dtb = fdt.FdtScan(dtb_fname) + scan_and_prop_bootph(dtb.GetRoot(), dtb) + dtb.Sync(True) + tools.write_file(dtb_fname, dtb.GetContents()) + tools.write_file(fname, dtb.GetContents())You shouldn't write back to the file created by the build. Do you need this?
Quoted 5 lines
Quoted 4 lines
Had the same thought, but the build fails in non clean builds[0]. Did a workaround[1] but then some essential template nodes ends up getting deleted from u-boot.dtb. Finally, had to write back to the file to resolve the issue.
Can you push a tree somewhere. This could be a bug that I could fix.
You can use the tree here to recreate the non clean build issue mentioned:
https://github.com/Jamm02/U-Boot-patchwork/tree/bootph-patch-testQuoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
dtb =
fdt.FdtScan(fname)node =
_FindBinmanNode(dtb)
--
2.34.1The code looks fine to me apart from the nits.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
This addition needs a test - see
ftest.pyfor some examples there. But basically just create a dts that has some props in it, then check that they got added.Included a test as well in the patchset[3]. Do let me know if there are some changes required in it.
Somehow I'm not seeing that in patchwork. It looks good but please try to keep lines <=80 cols.
Sure, will fix up in v3. Should I push a v3 or wait for you to fix the issue discussed above?
I've finally got back to this, but I can't repeat it.
For me:
crosfw j7200_evm_r5 -F
cmd: make -j32 'CROSS_COMPILE=/home/sglass/.buildman-toolchains/gcc-13.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-' --no-print-directory 'HOSTSTRIP=true' 'QEMU_ARCH='
'KCONFIG_NOSILENTUPDATE=1' 'O=/tmp/b/j7200_evm_r5' -s 'BUILD_ROM=1'
all
Image 'tiboot3-j7200-hs-evm.bin' has faked external blobs and is
non-functional: ti-fs-firmware-j7200-hs-enc.bin
ti-fs-firmware-j7200-hs-cert.bin
Image 'tiboot3-j7200-hs-evm.bin' is missing optional external blobs but is still functional: ti-fs-enc.bin sysfw-inner-cert
/binman/tiboot3-j7200-hs-evm.bin/ti-fs-enc.bin
(ti-sysfw/ti-fs-firmware-j7200-hs-enc.bin):
Missing blob
/binman/tiboot3-j7200-hs-evm.bin/sysfw-inner-cert
(ti-sysfw/ti-fs-firmware-j7200-hs-cert.bin):
Missing blob
Image 'tiboot3-j7200_sr2-hs-evm.bin' has faked external blobs and is
non-functional: ti-fs-firmware-j7200_sr2-hs-enc.bin ti-fs-firmware-j7200_sr2-hs-cert.bin
Image 'tiboot3-j7200_sr2-hs-evm.bin' is missing optional external blobs but is still functional: ti-fs-enc.bin sysfw-inner-cert
/binman/tiboot3-j7200_sr2-hs-evm.bin/ti-fs-enc.bin (ti-sysfw/ti-fs-firmware-j7200_sr2-hs-enc.bin):
Missing blob
/binman/tiboot3-j7200_sr2-hs-evm.bin/sysfw-inner-cert (ti-sysfw/ti-fs-firmware-j7200_sr2-hs-cert.bin):
Missing blob
Image 'tiboot3-j7200-hs-fs-evm.bin' has faked external blobs and is
non-functional: ti-fs-firmware-j7200-hs-fs-enc.bin ti-fs-firmware-j7200-hs-fs-cert.bin
Image 'tiboot3-j7200-hs-fs-evm.bin' is missing optional external blobs but is still functional: ti-fs-enc.bin sysfw-inner-cert
/binman/tiboot3-j7200-hs-fs-evm.bin/ti-fs-enc.bin
(ti-sysfw/ti-fs-firmware-j7200-hs-fs-enc.bin):
Missing blob
/binman/tiboot3-j7200-hs-fs-evm.bin/sysfw-inner-cert (ti-sysfw/ti-fs-firmware-j7200-hs-fs-cert.bin):
Missing blob
Image 'tiboot3-j7200_sr2-hs-fs-evm.bin' has faked external blobs and is non-functional: ti-fs-firmware-j7200_sr2-hs-fs-enc.bin ti-fs-firmware-j7200_sr2-hs-fs-cert.bin
Image 'tiboot3-j7200_sr2-hs-fs-evm.bin' is missing optional external blobs but is still functional: ti-fs-enc.bin sysfw-inner-cert
/binman/tiboot3-j7200_sr2-hs-fs-evm.bin/ti-fs-enc.bin (ti-sysfw/ti-fs-firmware-j7200_sr2-hs-fs-enc.bin):
Missing blob
/binman/tiboot3-j7200_sr2-hs-fs-evm.bin/sysfw-inner-cert (ti-sysfw/ti-fs-firmware-j7200_sr2-hs-fs-cert.bin):
Missing blob
Image 'tiboot3-j7200-gp-evm.bin' has faked external blobs and is
non-functional: ti-fs-firmware-j7200-gp.bin
Image 'tiboot3-j7200-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin
/binman/tiboot3-j7200-gp-evm.bin/ti-fs-gp.bin
(ti-sysfw/ti-fs-firmware-j7200-gp.bin):
Missing blob
Some images are invalid
make[1]: *** [/scratch/sglass/cosarm/src/third_party/u-boot/files/Makefile:1135:
.binman_stamp] Error 103
make: *** [Makefile:177: sub-make] Error 2
I wonder if I need some blobs?
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
I think
testSimpleFitEncryptedData()could be a good example?Regards,
SimonReferences:
[0]https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-non-clean-build
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
[1]https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-patch-tools-dtdoc-fdt-py
[3]https://lore.kernel.org/u-boot/[email protected]/
Thanks for the review.
Regards,
SImon
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hey Simon,
I missed some essential build instructions I should have given to you, apologies.
1. Clone ti-linux-firmware: https://git.ti.com/git/processor-firmware/ti-linux-firmware.git and switch to ti-linux-firmware-next branch
2. Clone U-Boot: https://github.com/Jamm02/U-Boot-patchwork
3. Set variables :
$ export CC64=aarch64-linux-gnu- $ export LNX_FW_PATH=path/to/ti-linux-firmware $ export UBOOT_CFG_CORTEXA=j7200_evm_a72_defconfig
4. Inside U-Boot source:
$ touch bl31.bin $ touch tee-raw.bin $ make $UBOOT_CFG_CORTEXA $ make CROSS_COMPILE=$CC64 BINMAN_INDIRS=$LNX_FW_PATH \ BL31=bl31.bin \ TEE=tee-raw.bin
Let me know if this works.
Regards,
Moteen
Quoted 248 lines · Simon Glass
Hi Moteen,
Quoted 143 lines · Moteen Shah
Hey Simon,
Is the problem discussed in the thread an actual bug or am I missing something in the implementation?
Regards,
MoteenQuoted 134 lines · Moteen Shah
Hey Simon,
Quoted 104 lines · Simon Glass
Hi Moteen,
Quoted 101 lines · Moteen Shah
Hey Simon,
Quoted 20 lines · Simon Glass
Hi Moteen,
Quoted 17 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>--- tools/binman/control.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)tools/binman/control.py +0
-0@@ -526,6 +526,35 @@ def _RemoveTemplates(parent): if node.name.startswith('template'): node.Delete()Quoted 3 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 529
Quoted 1 line
tools/binman/control.py +1
-0+def prop_bootph_to_parent(node, prop, dtb):I think the '
prop_' is a bit confusing, since you are dealing with properties! How about 'add_' as the prefix?'
add_' should be more descriptive, will add that in v3.Quoted 8 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 531
Quoted 2 lines
tools/binman/control.py +2
-0+ """Propagates bootph-* property to all the parent + nodes up the hierarchyFirst line should be a summary
then blank line
then describe the args...you can see this if you look at a few other functions.
Noted, will rectify in v3.
Quoted 4 lines
tools/binman/control.py def _RemoveTemplates(parent): · line 534
Quoted 3 lines
tools/binman/control.py +3
-0+ """ + parent = node.parent + if parent == None or parent.props.get(prop):if not parent or ...
Noted.
Quoted 18 lines
Quoted 12 lines
tools/binman/control.py +8
-0+ return + + while parent: + parent.AddEmptyProp(prop, 0) + parent = parent.parent + +def scan_and_prop_bootph(node, dtb): + """Scan the device tree and set the bootph-* property if itspresent
tools/binman/control.py +3
-0+ in subnode + + This is used to set the bootph-* property in the parent nodeQuoted 4 lines
if a
+ "bootph-*" property is found in any of the subnodes of the
parent
+ node.comment style again
Quoted 5 lines
Quoted 3 lines
tools/binman/control.py +2
-0+ """ + bootph_prop = ['bootph-all', 'bootph-some-ram','bootph-pre-ram', 'bootph-pre-sram']
From my understanding the only ones that matter are bootph-all and
bootph-some-ram, since the SPL ones are handled by fdtgrep.Noted.
Quoted 30 lines
tools/binman/control.py
Quoted 2 lines
tools/binman/control.py +2
-0+ + for props in bootph_prop:for prop
(since it is just one)
Quoted 16 lines
tools/binman/control.py +6
-0+ if node.props.get(props): + prop_bootph_to_parent(node, props, dtb) + + for subnode in node.subnodes: + scan_and_prop_bootph(subnode, dtb) + def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt,
use_expanded, indir):
"""Prepare the images to be processed and select the device
treetools/binman/control.py +0
-0@@ -563,7 +592,11 @@ def PrepareImagesAndDtbs(dtb_fname,
select_images,update_fdt,use_expanded, ind
indir = []
dtb_fname=fdt_util.EnsureCompiled(dtb_fname, indir=indir)fname =tools.get_output_filename('u-boot.dtb.out')tools/binman/control.py
Quoted 6 lines
tools/binman/control.py +5
-1- tools.write_file(fname, tools.read_file(dtb_fname)) + dtb = fdt.FdtScan(dtb_fname) + scan_and_prop_bootph(dtb.GetRoot(), dtb) + dtb.Sync(True) + tools.write_file(dtb_fname, dtb.GetContents()) + tools.write_file(fname, dtb.GetContents())You shouldn't write back to the file created by the build. Do you need this?
Quoted 5 lines
Quoted 4 lines
Had the same thought, but the build fails in non clean builds[0]. Did a workaround[1] but then some essential template nodes ends up getting deleted from u-boot.dtb. Finally, had to write back to the file to resolve the issue.
Can you push a tree somewhere. This could be a bug that I could fix.
You can use the tree here to recreate the non clean build issue mentioned:
https://github.com/Jamm02/U-Boot-patchwork/tree/bootph-patch-testQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
dtb =
fdt.FdtScan(fname)node =
_FindBinmanNode(dtb)
--
2.34.1The code looks fine to me apart from the nits.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
This addition needs a test - see
ftest.pyfor some examples there. But basically just create a dts that has some props in it, then check that they got added.Included a test as well in the patchset[3]. Do let me know if there are some changes required in it.
Somehow I'm not seeing that in patchwork. It looks good but please try to keep lines <=80 cols.
Sure, will fix up in v3. Should I push a v3 or wait for you to fix the issue discussed above?
I've finally got back to this, but I can't repeat it.
For me:
crosfw
j7200_evm_r5-F
cmd: make -j32 'CROSS_COMPILE=/home/sglass/.buildman-toolchains/gcc-13.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-' --no-print-directory 'HOSTSTRIP=true' 'QEMU_ARCH='
'KCONFIG_NOSILENTUPDATE=1' 'O=/tmp/b/j7200_evm_r5' -s 'BUILD_ROM=1'
all
Image 'tiboot3-j7200-hs-evm.bin' has faked external blobs and is
non-functional: ti-fs-firmware-j7200-hs-enc.bin
ti-fs-firmware-j7200-hs-cert.binImage 'tiboot3-j7200-hs-evm.bin' is missing optional external blobs but is still functional: ti-fs-enc.bin sysfw-inner-cert
/binman/tiboot3-j7200-hs-evm.bin/ti-fs-enc.bin
(ti-sysfw/ti-fs-firmware-j7200-hs-enc.bin):
Missing blob/binman/tiboot3-j7200-hs-evm.bin/sysfw-inner-cert
(ti-sysfw/ti-fs-firmware-j7200-hs-cert.bin):
Missing blobImage 'tiboot3-j7200_sr2-hs-evm.bin' has faked external blobs and is
non-functional: ti-fs-firmware-j7200_sr2-hs-enc.bin ti-fs-firmware-j7200_sr2-hs-cert.binImage 'tiboot3-j7200_sr2-hs-evm.bin' is missing optional external blobs but is still functional: ti-fs-enc.bin sysfw-inner-cert
/binman/tiboot3-j7200_sr2-hs-evm.bin/ti-fs-enc.bin (ti-sysfw/ti-fs-firmware-j7200_sr2-hs-enc.bin):
Missing blob/binman/tiboot3-j7200_sr2-hs-evm.bin/sysfw-inner-cert (ti-sysfw/ti-fs-firmware-j7200_sr2-hs-cert.bin):
Missing blobImage 'tiboot3-j7200-hs-fs-evm.bin' has faked external blobs and is
non-functional: ti-fs-firmware-j7200-hs-fs-enc.bin ti-fs-firmware-j7200-hs-fs-cert.binImage 'tiboot3-j7200-hs-fs-evm.bin' is missing optional external blobs but is still functional: ti-fs-enc.bin sysfw-inner-cert
/binman/tiboot3-j7200-hs-fs-evm.bin/ti-fs-enc.bin
(ti-sysfw/ti-fs-firmware-j7200-hs-fs-enc.bin):
Missing blob/binman/tiboot3-j7200-hs-fs-evm.bin/sysfw-inner-cert (ti-sysfw/ti-fs-firmware-j7200-hs-fs-cert.bin):
Missing blobImage 'tiboot3-j7200_sr2-hs-fs-evm.bin' has faked external blobs and is non-functional: ti-fs-firmware-j7200_sr2-hs-fs-enc.bin ti-fs-firmware-j7200_sr2-hs-fs-cert.bin
Image 'tiboot3-j7200_sr2-hs-fs-evm.bin' is missing optional external blobs but is still functional: ti-fs-enc.bin sysfw-inner-cert
/binman/tiboot3-j7200_sr2-hs-fs-evm.bin/ti-fs-enc.bin (ti-sysfw/ti-fs-firmware-j7200_sr2-hs-fs-enc.bin):
Missing blob/binman/tiboot3-j7200_sr2-hs-fs-evm.bin/sysfw-inner-cert (ti-sysfw/ti-fs-firmware-j7200_sr2-hs-fs-cert.bin):
Missing blobImage 'tiboot3-j7200-gp-evm.bin' has faked external blobs and is
non-functional: ti-fs-firmware-j7200-gp.binImage 'tiboot3-j7200-gp-evm.bin' is missing optional external blobs but is still functional: ti-fs-gp.bin
/binman/tiboot3-j7200-gp-evm.bin/ti-fs-gp.bin
(ti-sysfw/ti-fs-firmware-j7200-gp.bin):
Missing blobSome images are invalid
make[1]: *** [/scratch/sglass/cosarm/src/third_party/u-boot/files/Makefile:1135:
.binman_stamp] Error 103
make: *** [Makefile:177: sub-make] Error 2I wonder if I need some blobs?
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
I think
testSimpleFitEncryptedData()could be a good example?Regards,
SimonReferences:
[0]https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-non-clean-buildQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
[1]https://gist.github.com/Jamm02/2478a4f1186f3ba4a8cd7dbf1fb11e2f#file-patch-tools-dtdoc-fdt-py
[3]https://lore.kernel.org/u-boot/[email protected]/
Thanks for the review.
Regards,
SImon
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hello Moteen
Quoted 3 lines · Moteen Shah
Hey Simon,
I missed some essential build instructions I should have given to you, apologies.
I assume our u-boot public document should capture this information,
It not, then please fix
Quoted 53 lines
1. Clone ti-linux-firmware: https://git.ti.com/git/processor-firmware/ti-linux-firmware.git and switch to ti-linux-firmware-next branch
2. Clone U-Boot: https://github.com/Jamm02/U-Boot-patchwork
3. Set variables :$ export CC64=aarch64-linux-gnu- $ export LNX_FW_PATH=path/to/ti-linux-firmware $ export UBOOT_CFG_CORTEXA=j7200_evm_a72_defconfig4. Inside U-Boot source:
$ touch bl31.bin $ touch tee-raw.bin $ make $UBOOT_CFG_CORTEXA $ make CROSS_COMPILE=$CC64 BINMAN_INDIRS=$LNX_FW_PATH \ BL31=bl31.bin \ TEE=tee-raw.binLet me know if this works.
Regards,
MoteenQuoted 31 lines · Simon Glass
Hi Moteen,
Quoted 28 lines · Moteen Shah
Hey Simon,
Is the problem discussed in the thread an actual bug or am I missing something in the implementation?
Regards,
MoteenQuoted 19 lines · Moteen Shah
Hey Simon,
Quoted 16 lines · Simon Glass
Hi Moteen,
Quoted 13 lines · Moteen Shah
Hey Simon,
Quoted 10 lines · Simon Glass
Hi Moteen,
Quoted 7 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>---
[..]
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hey Udit,
The public documentation[0] has the required information which is sufficient. The build instructions mentioned below are a subset of the information present in [0] which should be faster in recreating the issue.
[0] https://docs.u-boot.org/en/latest/board/ti/j7200_evm.html
Regards,
Moteen
Quoted 65 lines · Udit
Hello Moteen
Quoted 3 lines · Moteen Shah
Hey Simon,
I missed some essential build instructions I should have given to you, apologies.
I assume our u-boot public document should capture this information,
It not, then please fix
Quoted 53 lines
1. Clone ti-linux-firmware: https://git.ti.com/git/processor-firmware/ti-linux-firmware.git and switch to ti-linux-firmware-next branch
2. Clone U-Boot: https://github.com/Jamm02/U-Boot-patchwork
3. Set variables :$ export CC64=aarch64-linux-gnu- $ export LNX_FW_PATH=path/to/ti-linux-firmware $ export UBOOT_CFG_CORTEXA=j7200_evm_a72_defconfig4. Inside U-Boot source:
$ touch bl31.bin $ touch tee-raw.bin $ make $UBOOT_CFG_CORTEXA $ make CROSS_COMPILE=$CC64 BINMAN_INDIRS=$LNX_FW_PATH \ BL31=bl31.bin \ TEE=tee-raw.binLet me know if this works.
Regards,
MoteenQuoted 31 lines · Simon Glass
Hi Moteen,
Quoted 28 lines · Moteen Shah
Hey Simon,
Is the problem discussed in the thread an actual bug or am I missing something in the implementation?
Regards,
MoteenQuoted 19 lines · Moteen Shah
Hey Simon,
Quoted 16 lines · Simon Glass
Hi Moteen,
Quoted 13 lines · Moteen Shah
Hey Simon,
Quoted 10 lines · Simon Glass
Hi Moteen,
Quoted 7 lines · Moteen Shah
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>---
[..]
Re: [RFC PATCH 1/2 v2] tools: binman: control.py: Propagate bootph-* properties to supernodes
Hi Moteen,
Quoted 7 lines · Moteen Shah
Hey Udit,
The public documentation[0] has the required information which is sufficient. The build instructions mentioned below are a subset of the information present in [0] which should be faster in recreating the issue.
Quoted 38 lines
[0] https://docs.u-boot.org/en/latest/board/ti/j7200_evm.html
Regards,
MoteenQuoted 32 lines · Udit
Hello Moteen
Quoted 4 lines · Moteen Shah
Hey Simon,
I missed some essential build instructions I should have given to you, apologies.
I assume our u-boot public document should capture this information,
It not, then please fix
Quoted 19 lines
1. Clone ti-linux-firmware:
https://git.ti.com/git/processor-firmware/ti-linux-firmware.git and switch to ti-linux-firmware-next branch
2. Clone U-Boot: https://github.com/Jamm02/U-Boot-patchwork
3. Set variables :$ export CC64=aarch64-linux-gnu- $ export LNX_FW_PATH=path/to/ti-linux-firmware $ export UBOOT_CFG_CORTEXA=j7200_evm_a72_defconfig4. Inside U-Boot source:
$ touch bl31.bin $ touch tee-raw.bin $ make $UBOOT_CFG_CORTEXA $ make CROSS_COMPILE=$CC64 BINMAN_INDIRS=$LNX_FW_PATH \ BL31=bl31.bin \ TEE=tee-raw.binLet me know if this works.
Thanks for the info. Yes I was able to repeat this.
But the problem seems to be that your tree is broken. When I try your patches against -master things seem to work OK.
In your tree, even before your changes, 'binman test' fails. That is an indication that something is broken, so there isn't really any point in trying to add a new feature to that tree.
Anyway, apart from that and the changing of the u-boot.dtb file, your implementation seems fine. I'll send a series with some suggestions to incorporate.
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Regards,
MoteenQuoted 23 lines · Simon Glass
Hi Moteen,
Quoted 20 lines · Moteen Shah
Hey Simon,
Is the problem discussed in the thread an actual bug or am I missing something in the implementation?
Regards,
MoteenQuoted 11 lines · Moteen Shah
Hey Simon,
Quoted 8 lines · Simon Glass
Hi Moteen,
Quoted 5 lines · Moteen Shah
Hey Simon,
Quoted 2 lines · Simon Glass
Hi Moteen,
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Moteen Shah
Quoted 7 lines
Add a function to scan through all the nodes in the device-tree recusively for bootph-* property. If found, propagate it to all of its parent nodes up the hierarchy.
Signed-off-by Moteen Shah <[email protected]>---
[..]
Regards,
Simon
RFC PATCH v2 2/2 tools: binman: ftest.py: Add testcase for bootph-* propagation
In reply to Moteen ShahAdd a testcase to ensure that scan_and_prop_bootph() actually propagates bootph-* properties to supernodes.
--- tools/binman/ftest.py | 17 +++++++++++++++++ tools/binman/test/347_bootph_prop.dts | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tools/binman/test/347_bootph_prop.dts
tools/binman/ftest.py +17 -0
@@ -7973,5 +7973,22 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test an image with an FIT with multiple FDT images using NAME""" self.CheckFitFdt('345_fit_fdt_name.dts', use_seq_num=False) + def testBootphPropagation(self): + """Test that bootph-* properties are propagated correctly to supernodes""" + data, _, _, out_dtb_fname = self._DoReadFileDtb('347_bootph_prop.dts', + use_real_dtb=True, update_dtb=True) + dtb = fdt.Fdt(out_dtb_fname) + dtb.Scan() + root = dtb.GetRoot() + parent_node = root.FindNode('dummy-parent') + subnode1 = parent_node.FindNode('subnode-1') + subnode2 = parent_node.FindNode('subnode-2') + subnode3 = parent_node.FindNode('subnode-3') + + self.assertIn('bootph-pre-ram', subnode1.props, "Child node is missing 'bootph-pre-ram' property") + self.assertIn('bootph-all', subnode1.props, "Child node is missing 'bootph-all' property") + self.assertIn('bootph-pre-ram', parent_node.props, "Parent node is missing 'bootph-pre-ram' property") + self.assertIn('bootph-all', parent_node.props, "Parent node is missing 'bootph-all' property") + if __name__ == "__main__": unittest.main()
tools/binman/test/347_bootph_prop.dts new file +19 -0
@@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; +/ { + dummy-parent { + subnode-1 { + subnode-2 { + bootph-all; + }; + subnode-3 { + bootph-pre-ram; + }; + }; + }; + + binman: binman { + }; +}; +
Signature · 1 line
2.34.1