Skip to contentSkip to conversation

imx: Fix imx8m FIT script issue

PATCH New Ye Li 5 participants 7 messages Apr 9, 2020 – Apr 27, 2020

Subsystems (3)
lore
Share & tools
lore

Ye Li

author
#0 lore raw

PATCH 1/1 imx: Fix imx8m FIT script issue

The FIT config node has reversed ATF and u-boot: ATF is set to firmware but u-boot is set to loadable.
This script can work previously because spl fit driver wrongly appends fdt to all loadable images. With the issue fixed, the u-boot in loadable does not have fdt appended and fails to work. So correct script by moving u-boot to firmware and ATF to loadable.

---
 arch/arm/mach-imx/mkimage_fit_atf.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-imx/mkimage_fit_atf.sh +4 -4
index ad81d5e..dd1ca5a 100755
@@ -116,8 +116,8 @@ if [ -f $BL32 ]; then
 cat << __CONF_SECTION_EOF
 		config@$cnt {
 			description = "$(basename $dtname .dtb)";
-			firmware = "atf at 1";
-			loadables = "uboot at 1", "tee at 1";
+			firmware = "uboot at 1";
+			loadables = "atf at 1", "tee at 1";
 			fdt = "fdt@$cnt";
 		};
 __CONF_SECTION_EOF
@@ -125,8 +125,8 @@ else
 cat << __CONF_SECTION1_EOF
 		config@$cnt {
 			description = "$(basename $dtname .dtb)";
-			firmware = "atf at 1";
-			loadables = "uboot at 1";
+			firmware = "uboot at 1";
+			loadables = "atf@1";
 			fdt = "fdt@$cnt";
 		};
 __CONF_SECTION1_EOF
Signature · 1 line
2.7.4
reviewer
#1 lore raw

PATCH 1/1 imx: Fix imx8m FIT script issue

Hi Ye Li,

Thanks for the fix.

Quoted 5 lines · Ye Li

The FIT config node has reversed ATF and u-boot: ATF is set to firmware but u-boot is set to loadable.
This script can work previously because spl fit driver wrongly appends fdt to all loadable images. With the issue fixed, the u-boot

Please mention the commit that fixed the issue:

With the issue fixed in commit 9d15d1d1c24f ("Revert "common:
spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled"")

Quoted 2 lines

in loadable does not have fdt appended and fails to work. So correct script by moving u-boot to firmware and ATF to loadable.

Since Matt reported this problem, please add:

Quoted 1 line

Let's wait for Matt's Tested-by.

Thanks

#2 lore raw

PATCH 1/1 imx: Fix imx8m FIT script issue

In reply to Ye Li
Quoted 8 lines · Ye Li

The FIT config node has reversed ATF and u-boot: ATF is set to firmware but u-boot is set to loadable.
This script can work previously because spl fit driver wrongly appends fdt to all loadable images. With the issue fixed, the u-boot in loadable does not have fdt appended and fails to work. So correct script by moving u-boot to firmware and ATF to loadable.

Hi Ye Li,

Thanks, this patch does fix the issue.

-Matt

reviewer
#3 lore raw

PATCH 1/1 imx: Fix imx8m FIT script issue

Hi Tom,

Quoted 9 lines · Matt Porter
Quoted 7 lines · Ye Li

The FIT config node has reversed ATF and u-boot: ATF is set to firmware but u-boot is set to loadable.
This script can work previously because spl fit driver wrongly appends fdt to all loadable images. With the issue fixed, the u-boot in loadable does not have fdt appended and fails to work. So correct script by moving u-boot to firmware and ATF to loadable.

Quoted 7 lines
Quoted 1 line

Hi Ye Li,

Thanks, this patch does fix the issue.

Not sure if Stefano plans to send another pull request. If not, maybe you could apply this one directly?

Thanks

#4 lore raw

PATCH 1/1 imx: Fix imx8m FIT script issue

Quoted 14 lines · Fabio Estevam

Hi Tom,

Quoted 11 lines · Matt Porter
Quoted 8 lines · Ye Li

The FIT config node has reversed ATF and u-boot: ATF is set to firmware but u-boot is set to loadable.
This script can work previously because spl fit driver wrongly appends fdt to all loadable images. With the issue fixed, the u-boot in loadable does not have fdt appended and fails to work. So correct script by moving u-boot to firmware and ATF to loadable.

Quoted 8 lines
Quoted 5 lines

Hi Ye Li,

Thanks, this patch does fix the issue.

Not sure if Stefano plans to send another pull request. If not, maybe you could apply this one directly?

I'm fine picking this up directly, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200409/8f0df120/attachment.sig>
#5 lore raw

PATCH 1/1 imx: Fix imx8m FIT script issue

In reply to Ye Li
Quoted 11 lines · Ye Li

The FIT config node has reversed ATF and u-boot: ATF is set to 'firmware' but u-boot is set to 'loadables'.
This script can work previously because spl fit driver wrongly appends fdt to all loadable images. With the issue fixed in commit 9d15d1d1c24f ("Revert "common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled"") the u-boot in 'loadables' does not have fdt appended and fails to work. So correct the script by moving u-boot to 'firmware' and ATF to 'loadables'.

Rewording the commit per Fabio's suggestion with a few other tweaks as I read over the code to the above, and taking directly also at his suggestion.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200409/d8ab05a7/attachment.sig>
#6 lore raw

PATCH 1/1 imx: Fix imx8m FIT script issue

In reply to Ye Li
Quoted 6 lines · Ye Li

The FIT config node has reversed ATF and u-boot: ATF is set to firmware but u-boot is set to loadable.
This script can work previously because spl fit driver wrongly appends fdt to all loadable images. With the issue fixed, the u-boot in loadable does not have fdt appended and fails to work. So correct script by moving u-boot to firmware and ATF to loadable.

I know this has been applied and the change itself is probably correct. But when I apply this to my 2020.01-based tree, TFA/U-Boot isn't loaded anymore.

Please note, that I have disabled CONFIG_SPL_FIT_IMAGE_TINY, so 9d15d1d1c24f ("Revert "common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled"") won't help.

I haven't tested with master so far, so I'm not sure if I miss some other patch or if there is an actual issue.

I just wondered why I switched the order in the first place in fa99af41e0da ("imx: mkimage_fit_atf: Fix FIT image for correct boot order").

It would also have been nice if I would have been cc-ed for this patch as I was the one introducing the "wrong" order in fa99af41e0da.

Quoted 33 lines
---
  arch/arm/mach-imx/mkimage_fit_atf.sh | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-imx/mkimage_fit_atf.sh +4 -4
index ad81d5e..dd1ca5a 100755
@@ -116,8 +116,8 @@ if [ -f $BL32 ]; then
  cat << __CONF_SECTION_EOF
  		config@$cnt {
  			description = "$(basename $dtname .dtb)";
-			firmware = "atf at 1";
-			loadables = "uboot at 1", "tee at 1";
+			firmware = "uboot at 1";
+			loadables = "atf at 1", "tee at 1";
  			fdt = "fdt@$cnt";
  		};
  __CONF_SECTION_EOF
@@ -125,8 +125,8 @@ else
  cat << __CONF_SECTION1_EOF
  		config@$cnt {
  			description = "$(basename $dtname .dtb)";
-			firmware = "atf at 1";
-			loadables = "uboot at 1";
+			firmware = "uboot at 1";
+			loadables = "atf at 1";
  			fdt = "fdt@$cnt";
  		};
  __CONF_SECTION1_EOF