Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to NXP's iMX93 SoC A1 revision #1700

Conversation

jmarcoscosta
Copy link

Hello,

I'm currently in a project where the target board is the A1 revision of iMX93, and I picked meta-freescale's BSP to work upon.

At first, I built a core-image-minimal and it didn't boot. As it turns out, the layer only supported building firmware for iMX93's A0 revision. Basically, firmware-sentinel only supports A1 starting at v0.11.

I'm sending this pull request to update firmware-sentinel according to meta-imx's, and I also added some tweaks to dynamically set the firmware name (e.g, mx93a0-ahab-container.img or mx93a1-ahab-container.img), because the current implementation doesn't actually use SECO_FIRMWARE_NAME (and consequently neither IMX_SOC_REV).

Please do not hesitate to point any mistakes, or even to point a specific revision that already fixes (partially or entirely) this issue.

Best regards,
João Marcos Costa

v0.11 supports A1 revision for iMX93 SoC. The previous version,
however, only supports A0.

Without the proper firmware version, it is impossible to boot
the SoC.

Upgrade firmware-sentinel from v0.10 to v0.11, which supports
both A0 and A1 hardware revisions.

Signed-off-by: Joao Marcos Costa <[email protected]>
In imx-boot's iMX9/soc.mak, the firmware name is set to a constant
value, i.e. mx93a0-ahab-container.img.

Instead, it should be set to SECO_FIRMWARE_NAME. This variable is
defined in use-imx-security-controller-firmware.bbclass, then it
is passed as a make parameter in imx-boot's do_compile() task.

As of now, there are revisions beyond A0 (namely A1), so the firmware
must be compiled accordingly. This patch implements such feature.

Signed-off-by: Joao Marcos Costa <[email protected]>
This is a follow-up to the previous commit, which handles
firmware naming in Yocto side.

Add patch to handle it in imx-boot/imx-mkimage side.

Signed-off-by: Joao Marcos Costa <[email protected]>
@jmarcoscosta jmarcoscosta force-pushed the master-add-support-to-IMX_SOC_REV-A1 branch from 3f8ddb1 to 25c496f Compare December 7, 2023 15:40
@@ -4,6 +4,7 @@ DEPENDS = "zlib-native openssl-native"

SRC_URI = "git://github.com/nxp-imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH} \
file://0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch \
file://0001-iMX9-soc.mak-dynamically-set-AHAB_IMG.patch \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @thochstein, could you please ensure that you apply those changes for the upcoming release? Thank you!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes to imx-boot and imx-mkimage are not necessary. The root cause is there is some other meta-data that did not get upstreamed, namely the setting of IMX_SOC_REV:

diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc
index 71c2aa80..7d63472f 100644
--- a/conf/machine/include/imx-base.inc
+++ b/conf/machine/include/imx-base.inc
@@ -180,6 +180,7 @@ IMX_SOC_REV:mx8dx-generic-bsp  ??= "C0"
 IMX_SOC_REV:mx8ulp-generic-bsp ??= \
     "${@bb.utils.contains('MACHINE_FEATURES', 'soc-reva0', 'A0', \
                                                            'A2', d)}"
+IMX_SOC_REV:mx93-generic-bsp   ??= "A1"

 IMX_SOC_REV_LOWER   = "${@d.getVar('IMX_SOC_REV').lower()}"
 IMX_SOC_REV_UPPER   = "${@d.getVar('IMX_SOC_REV').upper()}"

I'm testing now, but unfortunately my build is delayed by rust rebuild.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

I'm going to test this tomorrow morning, but I was getting the very same error (which I'll try to reproduce and send the logs here) even though I was setting IMX_SOC_REV to "A1" by hand in my local.conf, so I don't really see how setting this elsewhere would give a different result.

Kind regards,
João

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I did run into the error as well. It seems that imx-mkimage is not up to date either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this is fixed now by #1701.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmarcoscosta please test #1701

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@otavio @thochstein I just tested it, and it works fine. Thanks!

Still, I must admit I'm feeling a bit bothered with keeping this hardcoded firmware name in the makefile I fixed.

Besides, shouldn't we keep at least the commit messages, for documentation's sake?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jmarcoscosta,

Glad to hear it works!

The firmware name is not hard-coded anymore [1] and is driven by IMX_SOC_REV, which sets SECO_FIRMWARE_NAME and gets passed to imx-mkimage [2].

[1] 0688f79
[2] https://github.com/nxp-imx/imx-mkimage/blob/lf-6.1.36_2.1.0/iMX9/soc.mak#L20-L21

In the end this error should never have happened had we done the upstreaming of NXP release 6.1.36-2.1.0 properly. I can try to flesh out the new commit messages with some of this information.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks!

Could you please give me a heads-up once this is all merged into meta-freescale's master?

@otavio
Copy link
Member

otavio commented Dec 7, 2023

Hey @jmarcoscosta, have you performed any tests on other Systems on Chips (SoCs)?

@jmarcoscosta
Copy link
Author

@otavio not really, as the A1 revision is the only one I have in hands.

@angolini
Copy link
Member

I don't have access to any imx93 any longer, so I cannot test it on the board

@otavio
Copy link
Member

otavio commented Dec 11, 2023

Replaced by #1701

@otavio otavio closed this Dec 11, 2023
@tprrt
Copy link
Contributor

tprrt commented Feb 20, 2024

Hello @otavio,

Can you backport these changes on the Kirkstone (LTS) branch?

Kind regards,
Thomas

@otavio
Copy link
Member

otavio commented Feb 20, 2024

Please prepare a PR for this.

@tprrt
Copy link
Contributor

tprrt commented Feb 21, 2024

Hello @otavio,

Please prepare a PR for this.

I'm preparing a pull-request to backport SoC revision support and sentinel firmware update, otherwise boards with new SoC revisions aren't usable with the Kirkstone (LTS) branch.

But what do you advise about Freescale EULA ?

Because the sentinel firmware v0.11 is using the EULA V48 that isn't available on the Kirkstone branch.

Kind regards,
Thomas Perrot

@otavio
Copy link
Member

otavio commented Feb 21, 2024

Could it be added? we must confirm it does not break old recipes.

@tprrt
Copy link
Contributor

tprrt commented Feb 23, 2024

Hello @otavio,

Moreover, it seems that the sentinel API has been modified since the 0.9 and the U-Boot 2022.04 used in the Kirkstone (LTS) branch doesn't use this new API.

So, to be able to use new SoC revision with the Kirkstone (LTS) it should be also necessary to update U-Boot or to backport patches adding the new sentinel API.

  • Have you planned to support all SoC revision on the Kirkstone (LTS) branch until 2026?
  • Have you planned to quickly release a Scarthgap (the next LTS) branch in April ?

Kind regards,
Thomas

@ricardosalveti
Copy link
Contributor

We are using meta-freescale master with kirkstone (currently using based on the previous BSP rev, about to update to the latest), and it works fine with imx93 a1.

@ricardosalveti
Copy link
Contributor

I believe not only u-boot, but optee might need to be updated as well, which is why backporting is a pain.

@otavio
Copy link
Member

otavio commented Feb 23, 2024

I'd rather avoid too invasive backports to reduce the risk of regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants