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

Fix imx-boot and u-boot-imx generation/instalation for when UBOOT_CONFIG is empty #1707

Closed
wants to merge 2 commits into from

Conversation

angolini
Copy link
Member

@angolini angolini commented Dec 15, 2023

What

It adds a path to install and compile the files for those cases when a machine is configured with UBOOT_MACHINE instead of UBOOT_CONFIG.

tests

Tested with the following changes in conf/local.conf, it means I only tested for MACHINE = 'imx8mm-lpddr4-evk' and
MACHINE = 'imx93-11x11-lpddr4x-evk'.

UBOOT_CONFIG:imx8mm-lpddr4-evk = ""
UBOOT_MACHINE:imx8mm-lpddr4-evk = "imx8mm_evk_defconfig"

UBOOT_CONFIG:imx93-11x11-lpddr4x-evk = ""
UBOOT_MACHINE:imx93-11x11-lpddr4x-evk = "imx93_11x11_evk_defconfig"

IMX_DEFAULT_BSP = "nxp"

IMX_DEFAULT_BOOTLOADER:imx8mm-lpddr4-evk ??= "u-boot-imx"
IMX_DEFAULT_BOOTLOADER:imx93-11x11-lpddr4x-evk ??= "u-boot-imx"

points of attention

  • I don't know why I cannot set the variable UBOOT_NAME_EXTRA outside the compile_${SOC_FAMILY}. If you see why, let me know. fixed
  • I have double checked if the files u-boot-spl.bin and u-boot-nodtb.bin are copied to the directory used to create the imx-boot:
 ./tmp/work/imx93_11x11_lpddr4x_evk-fslc-linux/imx-boot/1.0/git/iMX9/u-boot-spl.bin
./tmp/work/imx8mm_lpddr4_evk-fslc-linux/imx-boot/1.0/git/iMX8M/u-boot-spl.bin
./tmp/work/imx8mm_lpddr4_evk-fslc-linux/imx-boot/1.0/git/iMX8M/u-boot-nodtb.bin

Copy link
Contributor

@MrCry0 MrCry0 left a comment

Choose a reason for hiding this comment

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

LGTM

@otavio otavio requested a review from MrCry0 December 20, 2023 20:40
}

compile_mx8() {
bbnote 8QM boot binary build
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME} ${BOOT_STAGING}/scfw_tcm.bin
cp ${DEPLOY_DIR_IMAGE}/${ATF_MACHINE_NAME} ${BOOT_STAGING}/bl31.bin
Copy link
Contributor

@thochstein thochstein Jan 3, 2024

Choose a reason for hiding this comment

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

Hi @angolini, I happened to be looking at taking the UBOOT_CONFIG changes into our local layer, but I'm confused how it even works. Since this function can be called multiple times, it will fail on the second call for any files which are not UBOOT_CONFIG specific (like the ATF file here) since in that case it will be copying the same file to the same location.

I feel there is a structural problem with do_deploy as well since it calls deploy_${SOC_FAMILY} without setting the _EXTRA variables at all.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that we have to think of a better way to reorg this recipe. It's becoming more and more disorganized and crazy. But maybe it would be better if we only switch to bootloader container instead?

If you have any suggestions on how to fix/enhance the PR, please let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I believe moving to the bootloader container would be better, but in the meantime, I guess the recipe should at least be fixed.

A refactoring of the functions is needed so common logic occurs once and uboot-config-specific logic occurs once per config.

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed where the spl is copied.

@thochstein , if you know a better way to test this (without the machines, as I don't have them) please, let me know

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just put two values in UBOOT_CONFIG? I'm pretty sure that will just fail to build.

Copy link
Member Author

Choose a reason for hiding this comment

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

./tmp/sysroots-components/imx8mm_lpddr4_evk/imx-boot/boot/imx-boot-imx8mm-lpddr4-evk-sd.bin-flash_evk_flexspi
./tmp/sysroots-components/imx8mm_lpddr4_evk/imx-boot/boot/imx-boot-imx8mm-lpddr4-evk-fspi.bin-flash_evk_flexspi

I've been testing this as well.

But if you think in anything else, please, let me know

(this PR does not touch the multiple UBOOT_CONFIG, it only deals when UBOOT_CONFIG is empty)

The patchset to enable multiple u-boot targets for the same machine is
based only on UBOOT_CONFIG variable.

For the case where a machine is not using UBOOT_MACHINE instead (and
UBOOT_CONFIG is empty) the previous code does not work, this is the
reason for this fix.

Signed-off-by: Daiane Angolini <[email protected]>
The patchset to enable multiple u-boot targets (and as a consequence,
multimple imx-boot binaries) for the same machine is based only on
UBOOT_CONFIG variable.

For the case where a machine is not using UBOOT_MACHINE instead (and
UBOOT_CONFIG is empty) the previous code does not work, this is the
reason for this fix.

Signed-off-by: Daiane Angolini <[email protected]>
@angolini angolini closed this Feb 7, 2024
@angolini angolini deleted the empty_uboot_config branch February 7, 2024 18:35
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.

4 participants