Re: [PATCH v3 17/33] gpu: nova-core: add the r000 load-and-execute bootloader handler

From: Alexandre Courbot

Date: Mon Sep 28 2026 - 10:53:28 EST


On Fri Sep 18, 2026 at 10:07 AM JST, John Hubbard wrote:
<...>
> @@ -72,9 +80,18 @@ pub(crate) struct BootloaderDmemDescV2 {
> /// Arguments to be passed to the target firmware being loaded.
> pub(crate) argv: u32,
> }
> +
> +impl BootloaderDmemDescV2 {
> + /// Size of the descriptor in bytes, as the load-and-execute event states it.
> + pub(crate) const SIZE: u32 = num::usize_into_u32::<{ size_of::<BootloaderDmemDescV2>() }>();

This constant is only used locally in one method, so let's declare it
there instead.

> +}
> +
> // SAFETY: This struct doesn't contain uninitialized bytes and doesn't have interior mutability.
> unsafe impl AsBytes for BootloaderDmemDescV2 {}
>
> +// SAFETY: This struct only contains integer types for which all bit patterns are valid.
> +unsafe impl FromBytes for BootloaderDmemDescV2 {}
> +
> /// The generic falcon bootloader image and its IMEM load parameters.
> pub(crate) struct GenericBootloader {
> /// Bootloader code, zero-padded to a whole number of falcon memory blocks.
> @@ -144,4 +161,56 @@ pub(crate) fn imem_load_params(&self) -> FalconPioImemLoadTarget<'_> {
> start_tag: self.start_tag,
> }
> }
> +
> + /// Returns the bootloader and `descriptor` as one firmware that [`Falcon::pio_load`] accepts.
> + pub(crate) fn with_descriptor<'a>(

This makes us export the `GenericBootloaderLoad` type and is not used
for anything but running the bootloader. How about converting this to a
`boot` method?

If would need to take a few parameters like the `FalconFbifTarget` and
mbox0 value, but that way we don't need to export `GenericBootloaderLoad`.