Hi Dan,
On 19.01.24 00:29, Dan Walkes wrote:
> Hi Stefano,
> Apologies, I just realized I inadvertently left the list out of my
> response. Resending to the list.
>
Thanks !
> On Tue, Jan 16, 2024 at 6:03 PM Stefano Babic
> <
stefan...@swupdate.org> wrote:
>>
>> I confess that this should be the goal. Fallback is a plus in an update
>> strategies and restores the board in many case due to runtime issues. It
>> is a pity if this is not available, and it is a step back because this
>> was possible with older Jetpacks.
>>
>> Nvidia had always had its way in the past, that wasn't sufficient for a
>> fallback. I am not aware with Jetpack 5, but Jetpack 4 still required to
>> patch cboot to provide a full functional fallback, that is not just
>> toggling between rootfs.
>>
> Do you have any information about the patches used for cboot?
Sure.
> I'm not
> familiar with these. The cboot implementations I used for Jetpack 4
> worked similarly, using nvidia's nv-update-engine (or
> tegra-bootloader-update) tool to perform the bootloader update and
> switch to the alternate rootfs. Example at [6].
Jetpack as delivered by Nvidia uses he nv-update-engine and there is no
fallback. Surely, Nvidia has more focus that the board is never bricked
(there are a lot of redundancy) else to update the full stack. With
nv-update-engine, just rootfs can be switched. Nevertheless, most
customers needs to update kernel, DT,etc. Fallback is strictly required
because a new DT can activate some drivers that can cause hanging on
some devices.
My choice was to drop kernel partitions (kernel_a / kernel_b) and put
the kernel inside rootfs. To perform the switch, I decided to use the
bootinfo (tegra-bootinfo) structure. This is put on TX2 / Xavier on
internal SPI flash and IMHO Nvidia's implementation for it is robust and
power-cut safe, that is well designed to store some kind of environment.
SWUpdate was adapted top manage them as bootloader's vars, see :
https://github.com/sbabic/swupdate/blob/master/bootloader/cboot.c
This uses the library provided by meta-tegra, and everything is
mainlined in SWupdate.
The delievered cboot (t19x-32.7.3 in my case) does not evaluate the
bootinfo, just for machine-id because it should be passed as kernel parm
at startup. I then changed the code and evaluate bootinfo vars to decide
which is the partition to be read to get the kernel and DT (default is
first partition or a partition with a GUID that is not standard but
invented by Nvidia). A counter was already implemented and it work like
the one in U-Boot - after hitting a threshold, a fallback happens inside
cboot.
cboot is delivered by Nvidia with an own license, and Nvidia is known to
not allowed 3rd-party contribution, so I never tried to push. This had
required more work, because I disabled in my patch the standard Nvidia
mode. And because license is not GPL, I cannot post my patch without
explicit agreement of my customer. However, what I did is explained above.
>
>>
>>> which aren't going to be possible without using
>>> something other than
>>> the capsule update mechanism NVIDIA provides with their EDK implementation and
>>> references in their documentation.
>>
>> As you have more investigated with Jetpack 5, can you provide me links
>> so that I understand why it is not possible ?
>
> I'm sure it is possible somehow by customizing NVIDIA's EDK
> bootloader, I was just mentioning that the current implementation uses
> the Capsule Update feature as described by NVIDIA in their
> documentation at [7].
Ah ok, same movie then as I already saw with previous release. Digging
in bootloader is required again to add fallback functionality. But
frankly speaking, as Nvidia already changed more than one time the boot
workflow, even if says that won't change in future is not enough to be
sure. And because contributions are not easy accepted, this requires
maintaining own patches in future.
Best regards,
Stefano