On Thu Nov 26, 2026 at 5:20 PM JST, Eliot Courtney wrote:
<...>
> @@ -208,6 +198,16 @@ pub(crate) struct FalconDmaLoadTarget {
>      pub(crate) len: u32,
>  }
>  
> +impl FalconDmaLoadTarget {
> +    /// Returns the data that should be copied to the falcon from `blob`.
> +    fn data<'a>(&self, blob: &'a [u8]) -> Result<&'a [u8]> {
> +        let start = usize::from_safe_cast(self.src_start);
> +        let end = start + usize::from_safe_cast(self.len);
> +
> +        blob.get(start..end).ok_or(EINVAL)
> +    }
> +}
> +
>  /// Parameters for the falcon boot ROM.
>  #[derive(Debug, Clone)]
>  pub(crate) struct FalconBromParams {
> @@ -219,6 +219,21 @@ pub(crate) struct FalconBromParams {
>      pub(crate) ucode_id: u8,
>  }
>  
> +/// Denotes where the bytes of a firmware segment are.
> +#[derive(Clone, Copy)]
> +pub(crate) enum FalconSegmentSource<'a> {
> +    /// Bytes in system memory.
> +    Sysmem(&'a [u8]),
> +    /// Bytes in the framebuffer.
> +    #[expect(dead_code)]
> +    Framebuffer {
> +        /// DMA base address of the segment in the framebuffer.
> +        base: u64,

That's not technically the base of the segment, there can be zeroed
bytes before the segment starts because of tagging as the falcon will
add `va` to `base`.

Reply via email to