View Issue Details

IDProjectCategoryView StatusLast Update
0005983UBootU-Bootpublic2023-11-06 13:08
Reportergerbach Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status feedbackResolutionreopened 
Product Versionfsimx8mp-Y2023.09 
Target Versionfsimx8m-nextFixed in Versionfsimx8mm-Y2023.10 
Summary0005983: Add option -b to fsimage save to select boot partition
DescriptionUp to now, the setting to boot from the boot1 hwpart on eMMC had to be
done with

  mmc partconf 2 0 1 0

where 1 is the value for the boot1 partition. This was an extra step and
was only possible when booting from eMMC, not when booting from NAND, which
required two different installation scripts for NAND and eMMC.

Add an option -b <n> to command fsimage save to select the boot partition.
<n> can be one of:

 0: Boot from User hardware partition
 1: Boot from boot1 hardware partition
 2: Boot from boot2 hardware partition

So saving NBoot and setting the boot partition can be done in one single
step. And because this option is ignored in case of NAND, we can use the
same installation script for NAND and eMMC now.

In combination with fsimage load, this can also be used to switch the boot
strategy. For example to switch to booting from User partition, simply call:

  fsimage load
  fsimage save -b 0

This will also automatically relocate U-Boot and environment if necessary.

These are the changes in more detail:

- Parse the -b option in do_fsimage_save() and set variable boot_hwpart
  accordingly. Set -1 if partition setting should not be changed.
- Add an additional argument boot_hwpart to fs_image_get_nboot_info() to
  pass the target partition. If not -1, then the nboot info values will
  be with respect to this partition instead of the currently active boot
  partition.
- Add ops function si_differs() with fs_image_si_differs_nand() and
  fs_image_si_differs_mmc() as implementations that compare two si
  entries. They return true if they differ in start address, size or
  hwpart. Use this when comparing the old and the new nboot-info in
  do_fsimage_save().
- In do_fsimage_save(), after all images have been collected (and probably
  been loaded from the old setting), switch to the new boot hardware boot
  partition before actually saving the new configuration. Add ops function
  set_boot_hwpart() and the implementations fs_image_set_boot_hwpart_nand()
  and fs_image_set_boot_hwpart_mmc() that actually to the job.
- Use EXT_CSD_EXTRACT_BOOT_PART() to cleanly get the current boot partition
  (also in fs_image_common.c).
- Update command table and help text accordingly.
Forum Link

Activities

gerbach

2023-11-06 13:07

developer   ~0004606

Git commit: 2127eedbbd88da4b0867a2cca83a89f0277f309a

gerbach

2023-11-06 13:08

developer   ~0004607

Doesn't work as expected.
Still has issues with unfused boards.