Re: [PATCH v3 12/16] gpu: nova-core: use projection for PFALCON and PFALCON2 registers

"Alexandre Courbot" <[email protected]>
Newsgroups dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Fri Aug 28, 2026 at 10:04 AM JST, Alexandre Courbot wrote:
> On Wed Aug 19, 2026 at 8:09 PM JST, Gary Guo wrote:
>> Add fixed size region types `PFalconRegisters` and `PFalcon2Registers` and
>> update PFALCON and PFALCON2 registers to be fixed register on them and not
>> relative registers on `NovaRegisters`.
>>
>> Update `Falcon` struct to store projected views when constructing and
>> access with `self.pfalcon` and `self.pfalcon2`.
>>
>> Signed-off-by: Gary Guo <[email protected]>
>
> Reviewed-by: Alexandre Courbot <[email protected]>
>
>> ---
>>  drivers/gpu/nova-core/falcon.rs                    | 157 +++++++++------------
>>  drivers/gpu/nova-core/falcon/fsp.rs                |  63 +++++----
>>  drivers/gpu/nova-core/falcon/gsp.rs                |  51 ++++---
>>  drivers/gpu/nova-core/falcon/hal/ga102.rs          |  62 ++++----
>>  drivers/gpu/nova-core/falcon/hal/tu102.rs          |   9 +-
>>  drivers/gpu/nova-core/falcon/sec2.rs               |  37 +++--
>>  drivers/gpu/nova-core/firmware/fwsec/bootloader.rs |  18 +--
>>  drivers/gpu/nova-core/gsp/hal/tu102.rs             |   7 +-
>>  drivers/gpu/nova-core/regs.rs                      |  92 ++++++------
>>  9 files changed, 238 insertions(+), 258 deletions(-)
>>
>> diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
>> index 65cb12d26e2b..119d305e2ea3 100644
>> --- a/drivers/gpu/nova-core/falcon.rs
>> +++ b/drivers/gpu/nova-core/falcon.rs
>> @@ -14,13 +14,12 @@
>>      io::{
>>          io_project,
>>          poll::read_poll_timeout,
>> -        register::{
>> -            RegisterBase,
>> -            WithBase, //
>> -        },
>> +        register::Array,
>>          Io,
>> +        Mmio, //
>>      },
>>      prelude::*,
>> +    sizes::SZ_4K,
>>      time::Delta,
>>  };
>>  
>> @@ -165,18 +164,22 @@ pub(crate) enum FalconFbifMemType with From<Bounded<u32, 1>> {
>>      }
>>  }
>>  
>> -/// Type used to represent the `PFALCON` registers address base for a given falcon engine.
>> -pub(crate) struct PFalconBase(());
>> +/// Type used to represent the `PFALCON` registers.
>> +#[repr(align(4))]
>> +#[derive(FromBytes, IntoBytes)]
>> +pub(crate) struct PFalconRegisters([u8; SZ_4K]);
>>  
>> -/// Type used to represent the `PFALCON2` registers address base for a given falcon engine.
>> -pub(crate) struct PFalcon2Base(());
>> +/// Type used to represent the `PFALCON2` registers.
>> +#[repr(align(4))]
>> +#[derive(FromBytes, IntoBytes)]
>> +pub(crate) struct PFalcon2Registers([u8; SZ_4K]);

Actually one more nit: while `SZ_4K` is correct, these should ideally be
named constants instead of being hardcoded.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.