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

Barebox support #395

Merged
merged 4 commits into from
Oct 12, 2023
Merged

Barebox support #395

merged 4 commits into from
Oct 12, 2023

Conversation

bith3ad
Copy link

@bith3ad bith3ad commented Oct 12, 2023

This adds the initial support for loading barebox i.MX8M images.

Marco Felsch added 2 commits October 12, 2023 12:28
Allow to skip check_ack since there are use cases where this generates
false positives. One use-case would be:
 1st) loading a small binary capable to handle USB transfers
 2nd) loading a larger binary by this command. The larger binary is
      started immediatly after all blocks are received on the device
      side.

Barebox does have such an behaviour and loading the BL33 binary triggers
an false positiv.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Add a command line option to handle barebox bl33 loading.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

if (!(rom->flags & ROM_INFO_NEED_BAREBOX_FULL_IMAGE))
return 0;

Copy link
Contributor

Choose a reason for hiding this comment

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

why need check ROM_INFO_NEED_BAREBOX_FULL_IMAGE? you already have option -barebox-bl33

Copy link
Author

Choose a reason for hiding this comment

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

This is for making it more straight forward for the users. The user only need to:

SDP: boot -barebox -f <barebox.img>

instead of:

SDP: boot -f <barebox.img>
SDP: write -ivt 0 -barebox-bl33 -f <barebox.img>

The 2nd form is far more complex to me since the user need to know the internals of uuu else no one would specify -ivt 0 which is required to take the correct uuu code path.

Copy link
Author

@bith3ad bith3ad Oct 12, 2023

Choose a reason for hiding this comment

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

Furthermore the ROM_INFO_NEED_BAREBOX_FULL_IMAGE is only required for i.MX8M devices. Loading i.MX6 images is not that complex since it requires only one file transfer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Furthermore the ROM_INFO_NEED_BAREBOX_FULL_IMAGE is only required for i.MX8M devices. Loading i.MX6 images is not that complex since it requires only one file transfer.

Can you add comments about ROM_INFO_NEED_BAREBOX_FULL_IMAGE in code? And explain why only i.MX8M need, i.MX6 needn't?

Copy link
Author

Choose a reason for hiding this comment

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

Of course I can do that. By code you mean this function here, right? Not the rominfo.cpp.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can add comments at define ROM_INFO_NEED_BAREBOX_FULL_IMAGE place.

Copy link
Author

Choose a reason for hiding this comment

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

Kept here in this function, since IMHO this is more useful for code readers. I hope this is okay for you.

Marco Felsch added 2 commits October 12, 2023 17:21
Add '-barebox' command line parameter to load a i.MX8MM barebox image
with a single: 'SDP: boot -barebox -f barebox.img' command.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Currently write() always sends buffers of 'm_size_out' size in case of
report_id != 1. This may cause an issue for the last buffer if not
aligned to 'm_size_out'.

Fix this by send only the required size of bytes by using 's'. This also
simplifies the call a lot.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
@nxpfrankli nxpfrankli merged commit 7cac399 into nxp-imx:master Oct 12, 2023
@bith3ad bith3ad deleted the feat/barebox-support branch October 12, 2023 15: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.

2 participants