On Sun Nov 29, 2026 at 11:55 AM JST, Eliot Courtney wrote:
> In order to remove `FalconDmaLoadTarget`, remove usages of it in
> `FwsecFirmwareWithBl` and `BootloaderDmemDescV2`. `FalconDmaLoadTarget`
> ends up non-orthogonal with `FalconImage`, `FalconImemSegment`,
> `FalconDmemSegment` which are added in a following change. These three
> new types take over the job of denoting where code/data uploaded to a
> falcon is stored and where it is sent to. This is part of making the
> locations of where the falcon data/code is represented separate from how
> it is sent to the falcon. `FalconDmaLoadTarget` conflates those two
> things.
>
> Signed-off-by: Eliot Courtney <[email protected]>
> ---
>  drivers/gpu/nova-core/firmware/fwsec/bootloader.rs | 49 
> +++++++---------------
>  drivers/gpu/nova-core/firmware/gen_bootloader.rs   | 42 ++++++++++---------
>  2 files changed, 38 insertions(+), 53 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/firmware/fwsec/bootloader.rs 
> b/drivers/gpu/nova-core/firmware/fwsec/bootloader.rs
> index 461e5e6f7899..1efcf7a8624d 100644
> --- a/drivers/gpu/nova-core/firmware/fwsec/bootloader.rs
> +++ b/drivers/gpu/nova-core/firmware/fwsec/bootloader.rs
> @@ -19,7 +19,6 @@
>      falcon::{
>          gsp::Gsp,
>          Falcon,
> -        FalconDmaLoadable,
>          FalconFbifTarget, //
>      },
>      firmware::{
> @@ -28,6 +27,7 @@
>              BootloaderDmemDescV2,
>              GenericBootloader, //
>          },
> +        FalconUCodeDesc, //
>      },
>      gpu::Chipset,
>      num::FromSafeCast, //
> @@ -52,61 +52,44 @@ pub(crate) fn new(
>          dev: &'a Device<device::Bound>,
>          chipset: Chipset,
>      ) -> Result<Self> {
> +        let desc = match &firmware.desc {
> +            FalconUCodeDesc::V2(desc) => desc,
> +            FalconUCodeDesc::V3(_) => return Err(EINVAL),
> +        };

I'd just add a short comment to clarify:

    // Bootloader-loaded FWSEC is only used with V2.

And actually, this signals we can simplify the code even more by
matching against the header version in the TU102 HAL, and calling `new`
only when we matched against `V2` (passing the V2 descriptor to it
directly), as there seems to be a strict equivalence between "V2
descriptor" and "needs bootloader".

This would then let us remove the `needs_fwsec_bootloader` property of
the Tu102 HAL.

I'd do that as a follow-up though (i.e. not in this series), this patch
is correctly scoped and does a lot of simplifications already.

Reply via email to