Skip to content

[RFC] bsp: u-boot-ostree-scr-fit: boot firmware updates for QSPI#453

Closed
igoropaniuk wants to merge 1 commit intofoundriesio:masterfrom
igoropaniuk:uz_qspi_bootfirmware
Closed

[RFC] bsp: u-boot-ostree-scr-fit: boot firmware updates for QSPI#453
igoropaniuk wants to merge 1 commit intofoundriesio:masterfrom
igoropaniuk:uz_qspi_bootfirmware

Conversation

@igoropaniuk
Copy link
Copy Markdown
Contributor

Add support of boot firmware updates on UltraZed QSPI.

Signed-off-by: Igor Opaniuk [email protected]

Just RFC, please don't merge it!

Add support of boot firmware updates on UltraZed QSPI.

Signed-off-by: Igor Opaniuk <[email protected]>

setenv update_primary_image2 'echo "${fio_msg} writing ${image_path} ..."; mmc dev ${devnum} && fatwrite mmc ${devnum}:${bootpart} ${loadaddr} u-boot0001.itb ${filesize}';
setenv update_secondary_image2 'echo "${fio_msg} writing ${image_path} ..."; mmc dev ${devnum} && fatwrite mmc ${devnum}:${bootpart} ${loadaddr} u-boot0002.itb ${filesize}';
setenv update_primary_image 'echo "${fio_msg} writing ${image_path} ..."; sf probe; sf update ${loadaddr} ${qspi_bootloader_offset} ${filesize}';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to generalize setting update_* commands to avoid code duplication?
Like

if test "${modeboot}" = "qspiboot"; then
...
   setenv update_cmd 'sf probe; sf update ${loadaddr}'
   setenv image_pri1 '${qspi_bootloader_offset}'
   setenv image_sec1 '${qspi_bootloader_s_offset}'
...
else
  setenv update_cmd 'mmc dev \${devnum} && fatwrite mmc \${devnum}:\${bootpart} \${loadaddr}'
  setenv image_pri1 'boot0001.bin'
  setenv image_sec1 'boot0002.bin'
fi
setenv update_primary_image 'echo "${fio_msg} writing ${image_path} ..."; ${update_cmd} ${image_pri1} ${filesize}';
setenv update_primary_image 'echo "${fio_msg} writing ${image_path} ..."; ${update_cmd} ${image_sec1} ${filesize}';
...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, nice idea, will do

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