Skip to contentSkip to conversation

rockchip: make_fit_atf.py: fix .its generation for a single atf image

PATCH New Heiko Stuebner 2 participants 3 messages Sep 26, 2019 – Sep 29, 2019

Subsystems (3)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

PATCH 1/1 rockchip: make_fit_atf.py: fix .its generation for a single atf image

The commit 619f002db864 ("rockchip: make_fit_atf.py: fix loadables property set error") fixed the double-loading of the primary atf-image, but didn't take into account that there may be rare atf images with only that main section present.

Right now this will result in a broken its due to the loadables section not getting closed correctly, so fix that by adapting the guards around the loop.

The guards now protect against 0 segments when the bl31 binary doesn't contain any section and 1 segment when only a core atf section is present.

Fixes 619f002db864 ("rockchip: make_fit_atf.py: fix loadables property set error")
---
 arch/arm/mach-rockchip/make_fit_atf.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/make_fit_atf.py +2 -2
index b9a1988298..585edcf9d5 100755
@@ -82,7 +82,7 @@ def append_conf_section(file, cnt, dtname, segments):
     file.write('\t\t\tdescription = "%s";\n' % dtname)
     file.write('\t\t\tfirmware = "atf_1";\n')
     file.write('\t\t\tloadables = "uboot"')
-    if segments != 0:
+    if segments > 1:
         file.write(',')
     for i in range(1, segments):
         file.write('"atf_%d"' % (i + 1))
@@ -90,7 +90,7 @@ def append_conf_section(file, cnt, dtname, segments):
             file.write(',')
         else:
             file.write(';\n')
-    if segments == 0:
+    if segments <= 1:
         file.write(';\n')
     file.write('\t\t\tfdt = "fdt_1";\n')
     file.write('\t\t};\n')
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 rockchip: make_fit_atf.py: fix .its generation for a single atf image

Quoted 5 lines · Heiko Stuebner

The commit 619f002db864 ("rockchip: make_fit_atf.py: fix loadables property set error") fixed the double-loading of the primary atf-image, but didn't take into account that there may be rare atf images with only that main section present.

Quoted 8 lines

Right now this will result in a broken its due to the loadables section not getting closed correctly, so fix that by adapting the guards around the loop.

The guards now protect against 0 segments when the bl31 binary doesn't contain any section and 1 segment when only a core atf section is present.

Fixes 619f002db864 ("rockchip: make_fit_atf.py: fix loadables property set error")

Thanks,
- Kever

Quoted 26 lines
---
  arch/arm/mach-rockchip/make_fit_atf.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/make_fit_atf.py +2 -2
index b9a1988298..585edcf9d5 100755
@@ -82,7 +82,7 @@ def append_conf_section(file, cnt, dtname, segments):
      file.write('\t\t\tdescription = "%s";\n' % dtname)
      file.write('\t\t\tfirmware = "atf_1";\n')
      file.write('\t\t\tloadables = "uboot"')
-    if segments != 0:
+    if segments > 1:
          file.write(',')
      for i in range(1, segments):
          file.write('"atf_%d"' % (i + 1))
@@ -90,7 +90,7 @@ def append_conf_section(file, cnt, dtname, segments):
              file.write(',')
          else:
              file.write(';\n')
-    if segments == 0:
+    if segments <= 1:
          file.write(';\n')
      file.write('\t\t\tfdt = "fdt_1";\n')
      file.write('\t\t};\n')
#2 lore raw

PATCH 1/1 rockchip: make_fit_atf.py: fix .its generation for a single atf image【请注意,邮件由[email protected]代发】

Quoted 18 lines · Kever Yang
Quoted 16 lines · Heiko Stuebner

The commit 619f002db864 ("rockchip: make_fit_atf.py: fix loadables property
set error") fixed the double-loading of the primary atf-image, but didn't
take into account that there may be rare atf images with only that main section present.

Right now this will result in a broken its due to the loadables section not
getting closed correctly, so fix that by adapting the guards around the loop.

The guards now protect against 0 segments when the bl31 binary doesn't contain any section and 1 segment when only a core atf section is present.

Quoted 5 lines
Quoted 3 lines
Fixes 619f002db864 ("rockchip: make_fit_atf.py: fix loadables

property set error")

Applied to u-boot-rockchip/master.

Quoted 36 lines

Thanks,
- Kever

Quoted 20 lines

---
  arch/arm/mach-rockchip/make_fit_atf.py | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/make_fit_atf.py +1 -1
index b9a1988298..585edcf9d5 100755
@@ -82,7 +82,7 @@ def append_conf_section(file, cnt, dtname, segments):
       file.write('\t\t\tdescription = "%s";\n' % dtname)
       file.write('\t\t\tfirmware = "atf_1";\n')
       file.write('\t\t\tloadables = "uboot"')
-    if segments != 0:
+    if segments > 1:
           file.write(',')

      for i in range(1, segments):
          file.write('"atf_%d"' % (i + 1))

arch/arm/mach-rockchip/make_fit_atf.py +0 -0
@@ -90,7 +90,7 @@ def append_conf_section(file, cnt, dtname, segments):
               file.write(',')
Quoted 7 lines

          else:
              file.write(';\n')
-    if segments == 0:
+    if segments <= 1:
          file.write(';\n')
      file.write('\t\t\tfdt = "fdt_1";\n')
      file.write('\t\t};\n')

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot