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

tools/imx9: Add norimage support to bootloader #14902

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

joukkone
Copy link

Fetch fspi header and fcb generation script,
using mkimage generate nor bootable image.
compile bootloader using -mstrict-align

Note: Please adhere to Contributing Guidelines.

Summary

Update this section with information on why change is necessary,
what it exactly does and how, if new feature shows up, provide
references (dependencies, similar problems and solutions), etc.

Impact

Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.

Testing

Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.

@github-actions github-actions bot added Area: Tooling Size: S The size of the change in this PR is small labels Nov 22, 2024
@nuttxpr
Copy link

nuttxpr commented Nov 22, 2024

[Experimental Bot, please feedback here]

This PR does not fully meet the NuttX requirements yet. While it provides a basic outline of the changes, it lacks the crucial details requested in each section.

Here's a breakdown of what's missing:

  • Summary: The summary is a placeholder. It needs to explain why fetching the FSPI header and FCB generation script is necessary. What problem does this solve? It also needs to describe how mkimage is used to generate the NOR bootable image and the purpose of compiling the bootloader with -mstrict-align.
  • Impact: All impact sections are placeholders. This section requires specific answers (YES/NO) and descriptions for each impact area. Even if the answer is NO, briefly explain why (e.g., "Impact on user: NO - This change is internal to the build process and does not affect user functionality.").
  • Testing: The testing section needs actual build hosts and target information, along with before/after logs. Simply stating that the changes are verified is insufficient. Provide specific details about your test setup and the results you observed. Include commands used, any output, and clear evidence that the change works as intended.

Example of how to improve the PR:

## Summary

This change addresses the issue where [link to NuttX issue if applicable] the bootloader was unable to correctly boot from NOR flash due to inconsistencies in the FSPI header and FCB.  This PR automates the process of fetching the correct FSPI header and FCB generation script, and then uses `mkimage` to create a valid NOR bootable image.  The `-mstrict-align` flag is used during bootloader compilation to ensure data alignment compatibility with the NOR flash.


## Impact

* Is new feature added? NO
* Is existing feature changed? YES - The bootloader build process is modified to include automated header/FCB retrieval and image generation.
* Impact on user: YES - Users will now be able to reliably boot from NOR flash. Previously, they may have experienced boot failures due to the aforementioned inconsistencies.
* Impact on build: YES - The build process now includes steps to fetch the FSPI header, generate the FCB, and use `mkimage`.  This will require users to have `mkimage` in their build environment.
* Impact on hardware: NO - This change only affects the software build process and does not directly impact hardware.
* Impact on documentation: YES - The bootloader build instructions need to be updated to reflect the new process.  [Link to updated documentation or indicate where it will be updated].
* Impact on security: NO - This change does not have any security implications.
* Impact on compatibility: NO - This change maintains backward compatibility.
* Anything else to consider: N/A


## Testing

I confirm that changes are verified on local setup and works as intended:
* Build Host(s): Linux (Ubuntu 20.04), x86_64, GCC 9.4.0
* Target(s): sim:qemu-rv32imac

Testing logs before change:

[Previous build logs showing boot failure]
Booting...
[Boot failure message]


Testing logs after change:

[New build logs showing successful image generation]
Booting...
[Boot success message]
Login:

By providing concrete details, the reviewers can more easily understand the change, assess its impact, and verify its correctness, leading to a smoother and faster review process. Remember to fill in the bracketed placeholders with actual information.

@joukkone joukkone force-pushed the imx9_norimage_upstream branch from 9f8f22e to ec7e288 Compare November 22, 2024 08:19
Fetch fspi header and fcb generation script,
using mkimage generate nor bootable image.
compile bootloader using -mstrict-align

Signed-off-by: Jouni Ukkonen <[email protected]>
@xiaoxiang781216 xiaoxiang781216 merged commit 74cdb53 into apache:master Nov 22, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Tooling Board: arm64 Size: S The size of the change in this PR is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants