public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: Heiko Schocher <hs@nabladev.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	Adrian Freihofer <adrian.freihofer@siemens.com>,
	Alexander Sverdlin <alexander.sverdlin@siemens.com>,
	Tom Rini <trini@konsulko.com>,
	Walter Schweizer <walter.schweizer@siemens.com>
Subject: Re: [PATCH v1 10/11] siemens: capricorn: rework bootcmd environment variables
Date: Mon, 26 Jan 2026 09:32:48 +0800	[thread overview]
Message-ID: <aXbEQJsoHAvVI6yx@shlinux89> (raw)
In-Reply-To: <20260124055452.8799-11-hs@nabladev.com>

On Sat, Jan 24, 2026 at 06:54:51AM +0100, Heiko Schocher wrote:
>From: Adrian Freihofer <adrian.freihofer@siemens.com>
>
>Rework the boot state machine to a significantly simpler and more
>robust implementation. The basic idea is to revert to the previous
>partition whenever an issue is detected during the boot process.
>
>- Broken SPL
>
>  If one of the two SPLs does not boot, the ROM code of the i.MX8 SoC
>  automatically starts the second SPL from the second boot partition.
>  For example, if the system's active partition is A but the SPL from
>  partition A is broken, the ROM code automatically uses the SPL/u-boot
>  from partition B.
>  Proceeding with this boot procedure would lead to booting the kernel/
>  rootfs from partition A, which could potentially successfully boot
>  the system and allow the user to apply the firmware update with the
>  broken SPL again. This would lead to a non-bootable system because
>  thesecond update would overwrite the last working bootloader.

Nit: the second

>  To prevent such situations, zigzag boots are detected and the system
>  reverts to the previous partition rather than booting the kernel/rootfs
>  from the currently active partition. Detecting zigzag boots is done
>  via the new fallback variable.
>
>  To make this state machine even more consistent, the partitionset_active
>  variable is no longer used to determine the active partition during
>  boot. Instead, the active partition is always read from the eMMC
>  partconf registers.
>  For backward compatibility, the partitionset_active variable is still
>  updated whenever a partition switch occurs. However, u-boot no longer
>  relies on this variable, as it could potentially be out of sync with
>  the actual partition state, leading to situations where the ROM code
>  of the i.MX8 SoC would be out of sync with u-boot.
>
>- Broken kernel, initramfs or rootfs
>
>  If the upgrade_available variable is set, u-boot counts the number of
>  consecutive boots via the bootcount variable. If the bootcount exceeds
>  the bootlimit variable, u-boot starts the altbootcmd instead of the
>  bootcmd. Previously, this logic was bypassed by assigning the regular
>  bootcmd to altbootcmd. Now, the altbootcmd is used to revert to the
>  previous partition when the bootlimit is exceeded.
>
>The netdev variable is changed to eth0 by default. This is what the FEC
>driver uses on Capricorn boards. For devices with switches and DSA
>subsystems in use, the netdev should be set accordingly by additional
>logic in the environment or u-boot code. This is not part of this commit.
>
>Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
>Signed-off-by: Heiko Schocher <hs@nabladev.com>


Acked-by: Peng Fan <peng.fan@nxp.com>

  reply	other threads:[~2026-01-26  1:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-24  5:54 [PATCH v1 00/11] imx8qxp: siemens: small board updates Heiko Schocher
2026-01-24  5:54 ` [PATCH v1 01/11] arm: dts: capricorn: pinctrl_usdhc1 cleanup Heiko Schocher
2026-01-26  1:12   ` Peng Fan
2026-01-24  5:54 ` [PATCH v1 02/11] siemens: capricorn: set max-frequency for usdhc1 Heiko Schocher
2026-01-26  1:14   ` Peng Fan
2026-01-24  5:54 ` [PATCH v1 03/11] arm: dts: capricorn: remove pinctrl_usdhc2 Heiko Schocher
2026-01-26  1:15   ` Peng Fan
2026-01-24  5:54 ` [PATCH v1 04/11] arm: dts: capricorn: move fec2 config Heiko Schocher
2026-01-26  1:18   ` Peng Fan
2026-01-24  5:54 ` [PATCH v1 05/11] imx8qxp_capricorn config: add wget command Heiko Schocher
2026-01-26  1:17   ` Peng Fan
2026-01-24  5:54 ` [PATCH v1 06/11] capricorn: config: add bootcounter command Heiko Schocher
2026-01-26  1:22   ` Peng Fan
2026-01-26  5:20     ` Heiko Schocher
2026-01-24  5:54 ` [PATCH v1 07/11] siemens: capricorn: add logic to U-Boot to avoid zig-zag boot Heiko Schocher
2026-01-26  1:29   ` Peng Fan
2026-01-26  5:30     ` Heiko Schocher
2026-01-24  5:54 ` [PATCH v1 08/11] siemens: capricorn: always detect emmc device Heiko Schocher
2026-01-26  1:18   ` Peng Fan
2026-01-24  5:54 ` [PATCH v1 09/11] siemens: capricorn: fix fallback bootm call for fitImage Heiko Schocher
2026-01-26  1:31   ` Peng Fan
2026-01-24  5:54 ` [PATCH v1 10/11] siemens: capricorn: rework bootcmd environment variables Heiko Schocher
2026-01-26  1:32   ` Peng Fan [this message]
2026-01-24  5:54 ` [PATCH v1 11/11] siemens: capricorn: protect environment Heiko Schocher
2026-01-26  1:24   ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aXbEQJsoHAvVI6yx@shlinux89 \
    --to=peng.fan@oss.nxp.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=alexander.sverdlin@siemens.com \
    --cc=festevam@gmail.com \
    --cc=hs@nabladev.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=walter.schweizer@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox