[PATCH 4/8] gpu: nova-core: convert GC6 registers to kernel register macro

Alexandre Courbot acourbot at nvidia.com
Thu Mar 19 07:19:54 PDT 2026


On Thu Mar 19, 2026 at 11:07 AM JST, Eliot Courtney wrote:
> On Wed Mar 18, 2026 at 5:06 PM JST, Alexandre Courbot wrote:
>> Convert all GC6 registers to use the kernel's register macro and update
>> the code accordingly.
>>
>> Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
>>  impl NV_PGC6_AON_SECURE_SCRATCH_GROUP_05_0_GFW_BOOT {
>>      /// Returns `true` if GFW boot is completed.
>> @@ -252,16 +253,17 @@ pub(crate) fn completed(self) -> bool {
>>      }
>>  }
>>  
>> -register!(NV_PGC6_AON_SECURE_SCRATCH_GROUP_42 @ 0x001183a4 {
>> -    31:0    value as u32;
>> -});
>> -
>> -register!(
>> -    NV_USABLE_FB_SIZE_IN_MB => NV_PGC6_AON_SECURE_SCRATCH_GROUP_42,
>> -    "Scratch group 42 register used as framebuffer size" {
>> -        31:0    value as u32, "Usable framebuffer size, in megabytes";
>> +nv_reg! {
>> +    NV_PGC6_AON_SECURE_SCRATCH_GROUP_42 @ 0x001183a4 {
>> +        31:0    value;
>>      }
>> -);
>> +
>> +    /// Scratch group 42 register used as framebuffer size.
>> +    NV_USABLE_FB_SIZE_IN_MB => NV_PGC6_AON_SECURE_SCRATCH_GROUP_42 {
>> +        /// Usable framebuffer size, in megabytes.
>> +        31:0    value;
>> +    }
>> +}
>
> This is not an issue with your series, but why do we have
> `NV_PGC6_AON_SECURE_SCRATCH_GROUP_42` which is aliased to
> `NV_USABLE_FB_SIZE_IN_MB` and not used for anything else?

This is just to follow the register definitions of OpenRM - the actual
register name is `SCRATCH_GROUP_42`, but we are using it in a given
software context where its role is reporting the size of the
framebuffer.

We could just define `NV_USABLE_FB_SIZE_IN_MB`, but that wouldn't
reflect the hardware manuals properly.



More information about the linux-riscv mailing list