Commit Graph

48 Commits

Author SHA1 Message Date
Hector Palacios 918a9caf1d boot scripts: print boot attempts only when bootcount mechanism active
Improve boot attempts message showing not only the current boot attempt
but also the limit:
	(boot attempt 1/3)

Print the message only when the bootcount mechanism is active, i.e. when
the bootlimit is defined (not zero), and when bootcount is > 0.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DUB-1056
2023-10-20 10:48:07 +02:00
David Escalona 910ee4ab44 u-boot-dey: boot: update all boot scripts to synchronize boot variables for dualboot systems
Until now, for dualboot systems, all boot variables were calculated on each boot depending on the value of the
'active_system'. These variables are used to boot the device but were not saved, which could lead to a missmatch
between their value in the environment and their required values to correctly boot the system. This commit
simplifies a bit the variables calculation and adds a block to synchronize their value in the environment.

Signed-off-by: David Escalona <david.escalona@digi.com>
2023-09-04 18:23:58 +02:00
David Escalona 88f74279b1 recipes-bsp: u-boot: boot-scripts: update boot scripts to use new 'bootcount' mechanism
The 'bootcount' value is now incremented and stored in the system on every boot and
not only then the 'upgrade_available' flag is set. Also, ensure the value is cleared
when the 'altboot' script is executed by running the new U-Boot command 'bootcount reset'.

https://onedigi.atlassian.net/browse/DEL-8506

Signed-off-by: David Escalona <david.escalona@digi.com>
2023-08-29 09:48:04 +02:00
Javier Viguera aab5eda5c2 meta-digi-arm: add kernel parameter for single boot logo
Number of bootup logos is now configured using fbcon=logo-count parameter,
so use it instead of our deprecated custom code in the kernel.

For backwards compatibility, we add this parameter in the u-boot boot
script for all platforms but the ccimx93, where this is directly handled
by u-boot (v2022.04).

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2023-01-23 17:33:31 +01:00
Hector Palacios 3ab0340741 u-boot: print what system is booting after update
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-10-11 11:36:00 +02:00
Francisco Gil e67ed06dd5 dualboot: move the logic of fallback boot to altbootcmd
U-Boot has embedded support to handle bootcount tries.
When the limit of tries is reached, U-Boot runs the script
in `altbootcmd` rather than the usual `bootcmd`.
This other script resides on meta-digi-dualboot layer.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2021-10-08 12:59:30 +02:00
Hector Palacios 05d21a1310 u-boot: boot.txt: move dualboot checks to the top
When DualBoot mechanism is enabled and an update is pending,
the boot script needs to change certain variables and save the
environment.
The regular boot script already changes a number of variables,
such as 'extra_bootargs' and 'overlays' by appending strings to
the already existing values. Saving the envionment may make these
grow endlessly with each iteration of the boot script.

For this reason, move the DualBoot check as the first thing in
the script, save the environment if needed, and then continue
with the normal flow, that changes variables before booting
but doesn't save them.

On certain scripts, this allows us to get rid of some instructions
for resetting the overlays variable.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-09-09 17:38:44 +02:00
Hector Palacios f00ce5ca9b u-boot-dey: add support for dualboot to boot scripts
The support for dualboot was integrated on meta-digi-dualboot layer, but it
really depends only on environment variable 'dualboot' so we'd better
integrate the support on the scripts in meta-digi, to avoid synchonization
problems between both layers.
This also allows to be able to easily enable dualboot in U-Boot with the
variable, without needing to update the script on the linux partition.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-09-09 17:38:44 +02:00
Hector Palacios 9f3ab7c9d9 u-boot-dey: group identical files per SOM or SOM family
With the generalization done in previous commits, we have now several files
that are identical and can be merged into a common SOM or SOM family
folder.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-06-02 11:01:37 +02:00
Hector Palacios 96bc57c7f0 u-boot-dey: use global variables to generalize install scripts
Create global variables:
  DEFAULT_IMAGE_NAME
  GRAPHICAL_IMAGES

to have them substituted on the U-Boot install scripts for better
generalization.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-06-02 11:01:37 +02:00
Hector Palacios c2c3cfb7cd u-boot-dey: use new variable 'image-name' to compose filenames in scripts
U-Boot install scripts (from uSD and USB) were hard-coded to dey-image-qt.
Allow to install other image files by setting a new variable 'image-name'
which defaults to 'dey-image-qt' if not defined, except for the CC6UL
SBC Express, that defaults to 'core-image-base'.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-7385
https://jira.digi.com/browse/DEL-7333
2021-06-02 11:01:37 +02:00
Hector Palacios a7d0ba8b38 u-boot-dey: remove hard-coded platform name from scripts
Use ##MACHINE## placeholder to have it later substituted by the recipe
using Yocto ${MACHINE} variable.
This will help later reducing the number of files to have one per SOM
(or even family) instead of one per platform.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-06-02 11:01:37 +02:00
Hector Palacios c89d46600a u-boot-dey: append the graphic backend only to graphical images
Non-graphical images (core-image-base, dey-image-aws) don't contain the
graphic-backend on their filenames.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-05-25 17:15:45 +02:00
Hector Palacios aa535a505b u-boot-dey: improve workflow and messages of uuu install script
- Determine first the filenames and abort if any does not exist.
- Print a warning message about the erasing of the media with a list
  of partitions and files to use for the update
- Sync the different scripts so they look more similar

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-7333
2021-05-25 17:15:45 +02:00
Hector Palacios 8f4d707fb6 u-boot-dey: function for updating eMMC partitions with a message
Similar to how it's done on the ccimx6ul, create a function for updating
a partition with a file, that also prints a message.
Rename the function to be the same in all scripts.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-7333
2021-05-25 17:15:45 +02:00
Hector Palacios 51ce92b982 u-boot-dey: [cosmetic] print countdown on wait message, and OK at the end
Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-7333
2021-05-25 17:15:45 +02:00
Hector Palacios ce417f5b9e u-boot-dey: abort update from uuu if any of files to update does not exist
Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-7333
2021-05-25 17:15:45 +02:00
Hector Palacios ed2d2e54c6 u-boot-dey: add uuu install script for ccimx8x-sbc-express
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-05-25 17:15:45 +02:00
Hector Palacios fddaee85b9 update-fw scripts: fix error path after sucessful update
On commit 1e5cafeb79 a fall-back
update command was introduced in case the newest command fails.
If the newest command succeeds, however, the 'test' command for
error doesn't match (there is no error) and the return code of
such test is "1". On the next check for errors, this results on
an error, when we really mean to continue because the first
command was successful.

Move the second error check inside the error path of the first
attempt.

Reported-by: Francisco Gil <francisco.gilmartinez@digi.com>
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-01-18 17:36:38 +01:00
Hector Palacios 1e5cafeb79 uboot: update fw install scripts to remove source fs from commands
The 'source file system' was removed as an argument from the
'update' command in U-Boot v2020.04.
For platforms using such version, remove it from the update fw
scripts.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DUB-983
2021-01-07 19:29:06 +01:00
Gabriel Valcazar ae012f7069 ccimx8x: update USB install script with selected U-Boot for variants
A similar change was done in the dey-3.0/maint branch for the uSD installation
scripts, but since USB scripts were added in dey-3.0/master, apply the same
to them as well.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-12-28 14:54:38 +01:00
Gabriel Valcazar e0055ce0cb Merge branch 'dey-3.0/master' into dey-3.0/maint
Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-12-28 12:28:39 +01:00
Hector Palacios 2caec3176a ccimx8x: update install script with selected U-Boot for variants
CC8X SOMs code the RAM size on the OTP bits so this fall-back table
shouldn't be necessary, but update it with latest variants just
in case.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2020-12-21 14:06:28 +01:00
Arturo Buzarra 8b3b8b5516 uboot: add script to update firmware from a USB stick
Create scripts to install DEY firmware using a USB stick.

https://jira.digi.com/browse/DEL-6802

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-12-03 15:46:22 +01:00
Hector Palacios 4685664d07 u-boot: boot script: allow to disable Wi-Fi/BT overlays
Check a U-Boot env variable (disable_wifi/disable_bt) for easily
disabling Wi-Fi and/or Bluetooth overlays.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>ç

https://jira.digi.com/browse/DEL-7297
(cherry picked from commit b74a8cee54)
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2020-11-04 16:10:20 +01:00
Hector Palacios b74a8cee54 u-boot: boot script: allow to disable Wi-Fi/BT overlays
Check a U-Boot env variable (disable_wifi/disable_bt) for easily
disabling Wi-Fi and/or Bluetooth overlays.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>ç

https://jira.digi.com/browse/DEL-7297
2020-10-29 09:56:55 +01:00
Arturo Buzarra 3a5d193b09 u-boot: ccimx8x-sbc-express: sync installation sd card script
This commit added support to C0/B0 variants.

https://jira.digi.com/browse/DUB-974

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-10-19 17:12:51 +02:00
Gabriel Valcazar 666c361df2 ccimx8x-sbc-pro: add overlay for SBC versions 3 and lower
Since this overlay is only used in the SBC Pro bootscript, have a separate
bootscript for the SBC Express.

https://jira.digi.com/browse/DEL-7276

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-10-13 16:19:34 +02:00
Hector Palacios fe6d67ad2c u-boot: fix scripts for variants with old-style HWID
Wrapping unterminated lines doesn't work for scripts (even
if they contain the backslash).
Substitute with full non-wrapped if/elif sentences.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-7252
2020-09-28 11:24:23 +02:00
Gabriel Valcazar 222ded5a38 digi-sc-firmware: update to v1.4.0.2
This update is a cosmetic one and removes the RAM frequency from the SCFW
filenames. Reflect this change in the RAM_CONFIGS variable and in the uSD/UUU
installation scripts.

As a result, the imx-boot filenames will no longer have the RAM frequency
either.

https://jira.digi.com/browse/DEL-7096

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-05-28 18:15:38 +02:00
Hector Palacios f58ccb7463 boot: don't set fdt_file on bootscript; just the overlays
With the device tree overlays mechanism in place, the bootscript
doesn't need to set the fdt_file variable. Instead, it will use
the value it has (which can be changed by the user) and it will
simply update the 'overlays' variable with the device tree
overlays that apply basing on the hardware capabilities found
on the HWID, SOM version, and carrier board version.

This allows a user to override the default fdt_file to point
to his custom device tree, but still make use of the boot script
for hardware-detected overlays.

Without the need to set the base filename, the boot script is the
same for any carrier board of the ccimx8x SOM, so this commit
moves it to a common folder.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2020-05-27 07:06:29 +02:00
Gabriel Valcazar bc7320f203 ccimx8x: add support for QXP overlay
Each platform now has only one base device tree, meant for the i.MX8DX variants
of the ccimx8x boards. Apply the QXP overlay in the bootscript if the SOC is
identified as an i.MX8QXP.

Since we want to give this overlay a higher priority than the SOM overlays
(wifi and bluetooth), prepend it to the overlay list after appending the SOM
overlays.

https://jira.digi.com/browse/DEL-7100

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-05-26 12:25:18 +02:00
Gabriel Valcazar 306b83eef0 ccimx8x: add support for wifi and bt overlays
Remove the old wb device trees from the ccimx8x-sbc-express and ccimx8x-sbc-pro
configuration files and add the ccimx8x wifi and bt overlays. Modify both
platforms' bootscripts to apply the overlays depending on board_id, hardware
capabilities or module variants.

https://jira.digi.com/browse/DEL-7100

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-05-26 12:17:34 +02:00
Hector Palacios 92d658107f u-boot-dey: fix wrapped lines on install script
Wrapped lines must have a back-slash symbol so that U-Boot
doesn't interpret them as finished.
The missing symbol resulted in the script not being able to
determine the U-Boot image to program in some cases.

Reported-by: Leonid Makhnovskiy <leonid.makhnovskiy@digi.com>
Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-6953
2020-01-27 17:49:29 +01:00
Hector Palacios fd3f3ba413 uboot: update scripts to consider 'soc_type' var starts with "imx"
The 'soc_type' variable was already set by fastboot to "imx8qxp"
so the U-Boot board code that was setting this to just "8qxp" has
been changed to set it to "imx8qxp".

Update the scripts accordingly.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DUB-901
2019-08-21 11:03:25 +02:00
Arturo Buzarra f0024862cd u-boot: ccimx8x: fix comparison of the 'if' clause in the install_fw script
This commit fixes two issues:
- Comparison clause uses only one equal sign
- Fix soc_type for Dual variants because the supported soc types
  for the imx8 processor are: 8qm, 8qxp, and 8dx

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-07-24 16:31:23 +02:00
Hector Palacios 6eb3bd001c ccimx8x: change bootable artifacts filenames on U-Boot install script
After the recent changes to generate the bootable artifacts, these are
now formed using the ${MACHINE} variable rather than the string in
${UBOOT_CONFIG} array, so the underscores must be changed with dashes.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2019-07-12 12:49:03 +02:00
Hector Palacios 852cf8a570 u-boot-dey: update install scripts to handle variants
Now the U-Boot binaries contain the RAM frequency and bus width, not just
only the RAM size.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-6641
2019-07-08 16:42:28 +02:00
Hector Palacios 7508d58d4d ccimx8x: u-boot: fix SDRAM denomination on install_linux_fw script
The SDRAM is an LPDDR4, not DDR3.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2019-07-03 10:58:55 +02:00
Hector Palacios 964b8eff2c ccimx8x: u-boot: add support for variant 0x06 in U-Boot scripts
Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-6641
2019-07-02 12:05:44 +02:00
Hector Palacios 4167ab1769 ccimx8x: u-boot: use 'soc_type' variable when determining device tree file
With the arrival of DualX variants, the device tree files have been renamed
to contain the SOC type (8qxp, or 8dx). This is determined by a new U-Boot
variable 'soc_type'.
Default to "8qxp" if the variable is not defined (old U-Boots).

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-6641
2019-07-02 11:58:05 +02:00
Hector Palacios 4351db1677 uboot: add support for new HWID fields to install fw scripts
The new HWID fields make U-Boot create new variable 'module_ram'.

If it exists use it to select the U-Boot file to use during
firmware update. If not, fall back to old method of using the
variant code and the hard-coded table of variants.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-6598
2019-05-20 15:47:53 +02:00
Hector Palacios 702bc57cae uboot: add support for new HWID fields to boot scripts
The new HWID fields make U-Boot create new variable 'module_ram'.

If it exists calculate new HWID fields to check if the SOM has
Wi-Fi, Bluetooth, etc. in order to select the device tree file.
If not, fall back to old method of using the variant code and
the hard-coded table of variants.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-6598
2019-05-20 15:47:53 +02:00
Arturo Buzarra e508231683 thud migration: u-boot: remove kernel image type from device tree files
Device tree file names won't have the kernel image type like a
prefix anymore, since thud uses the original file names.

https://jira.digi.com/browse/DEL-6443

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-02-08 12:13:11 +01:00
Gabriel Valcazar a7fdb72a46 ccimx8x-sbc-express: force otf-update in the install_linux_fw_sd script
We have seen errors when verifying the rootfs update on 2 GiB variants. Forcing
otf-update prevents these errors from happening.

https://jira.digi.com/browse/DUB-855

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2018-09-14 13:34:46 +02:00
Gabriel Valcazar b014572474 ccimx8x-sbc-express: adapt install_linux_fw_sd script for imx-boot images
Also, make the script recognize the different SOM variants.

https://jira.digi.com/browse/DEL-6175

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2018-09-13 18:35:40 +02:00
Hector Palacios fb765741a5 ccimx8x: change kernel to Image.gz and support all SOM variants in DT
U-Boot's 'dboot' command now supports uncompressing Image.gz.
This will be the default kernel image type for the CC8X.

This also changes the names of the device tree artifacts, that must be
updated on the boot script. While on it, add support for all the SOM
variants (wireless and non-wireless).

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2018-07-06 16:20:47 +02:00
Hector Palacios 8af8817796 u-boot: add support for U-Boot v2017.03
This adds support for U-Boot v2017.03 for all platforms (including CC8X).

For legacy v2015.04:
  - Renames u-boot.inc as a versioned file only for v2015.04.
  - Moves boot/install scripts from versioned folder into non-versioned
    folder (since the scripts remain the same between versions).

For new v2017.03:
  - Re-uses poky's u-boot.inc in rocko for v2017.03
  - DEY recipe re-writes the do_compile for special U-Boot configuration
    required for TrustFence.
  - DEY recipe appends the do_deploy, for U-Boot scripts and deploy of
    special TrustFence artifacts.
  - Adds u-boot-dtb.xxx to UBOOT_CONFIG, required for new U-Boots.
  - Adds CC8X scripts.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-5936
2018-05-31 12:06:37 +02:00