Re: [PATCH] MAINTAINERS: Add website of Nova GPU driver

2025-08-07 Thread Alexandre Courbot
On Thu Aug 7, 2025 at 4:07 PM JST, Philipp Stanner wrote: > The Nova GPU driver has a sub-website on the Rust-for-Linux website > which so far was missing from the respective section in MAINTAINERS. > > Add the Nova website. > > Signed-off-by: Philipp Stanner Staging this for inclusion into nova-

[PATCH] gpu: nova-core: falcon: align DMA transfers to 256 bytes

2025-08-07 Thread Alexandre Courbot
nment into a non-overflowing operation, and check that the requested transfer remains into the limits of the DMA object. This also allows us to remove a DMA-specific constant in the fwsec code. Signed-off-by: Alexandre Courbot --- This came up as I was writing the next iteration of the `Alig

[PATCH 2/2] gpu: nova-core: vbios: store reference to Device where relevant

2025-08-07 Thread Alexandre Courbot
Now that the vbios code uses a non-bound `Device` instance, store an `ARef` to it at construction time so we can use it for logging without having to carry an extra argument on every method for that sole purpose. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware/fwsec.rs | 8

[PATCH 0/2] gpu: nova-core: vbios: simplify device use

2025-08-07 Thread Alexandre Courbot
ad of having all their methods take an extra `dev` argument. Removing this argument streamlines the code a bit. Signed-off-by: Alexandre Courbot --- Alexandre Courbot (2): gpu: nova-core: vbios: replace pci::Device with device::Device gpu: nova-core: vbios: store reference to Device

[PATCH 1/2] gpu: nova-core: vbios: replace pci::Device with device::Device

2025-08-07 Thread Alexandre Courbot
The passed pci::Device is exclusively used for logging purposes, so it can be replaced by a regular device::Device, which allows us to remove the `as_ref()` indirections at each logging site. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 2 +- drivers/gpu/nova-core

Re: [PATCH v2 01/19] gpu: nova-core: register: minor grammar and spelling fixes

2025-07-29 Thread Alexandre Courbot
On Mon Jul 28, 2025 at 10:25 PM JST, Steven Price wrote: > On 28/07/2025 12:43, Alexandre Courbot wrote: >> On Mon Jul 28, 2025 at 4:51 PM JST, Steven Price wrote: >>> On 28/07/2025 05:59, Alexandre Courbot wrote: >>>> Hi Daniel, thanks for the review! >>>&g

Re: [PATCH 1/2] gpu: nova-core: vbios: split out PmuLookupTableHeader from PmuLookupTable

2025-07-28 Thread Alexandre Courbot
On Sun Jul 27, 2025 at 6:48 PM JST, Rhys Lloyd wrote: > Separating the header allows the use of `size_of::()` > instead of the magic number 4. > > Signed-off-by: Rhys Lloyd > --- > drivers/gpu/nova-core/vbios.rs | 56 +- > 1 file changed, 35 insertions(+), 21 delet

Re: [PATCH v2 01/19] gpu: nova-core: register: minor grammar and spelling fixes

2025-07-28 Thread Alexandre Courbot
On Mon Jul 28, 2025 at 4:51 PM JST, Steven Price wrote: > On 28/07/2025 05:59, Alexandre Courbot wrote: >> Hi Daniel, thanks for the review! >> >> On Sat Jul 26, 2025 at 1:14 AM JST, Daniel Almeida wrote: >>> Hi Alex. Thank you and John for working on this in g

Re: [PATCH v2 17/19] gpu: nova-core: register: add support for register arrays

2025-07-27 Thread Alexandre Courbot
On Sat Jul 26, 2025 at 4:12 AM JST, Daniel Almeida wrote: >> macro_rules! register { >> // Creates a register at a fixed offset of the MMIO space. >> ($name:ident @ $offset:literal $(, $comment:literal)? { $($fields:tt)* } >> ) => { >> @@ -187,6 +238,35 @@ macro_rules! register { >>

Re: [PATCH v2 15/19] gpu: nova-core: register: redesign relative registers

2025-07-27 Thread Alexandre Courbot
On Sat Jul 26, 2025 at 3:56 AM JST, Daniel Almeida wrote: > Hi Alex, > >> On 18 Jul 2025, at 04:26, Alexandre Courbot wrote: >> >> The relative registers are currently very unsafe to use: callers can >> specify any constant as the base address for access, m

Re: [PATCH v2 07/19] gpu: nova-core: register: move OFFSET declaration to I/O impl block

2025-07-27 Thread Alexandre Courbot
On Sat Jul 26, 2025 at 2:03 AM JST, Daniel Almeida wrote: > > >> On 18 Jul 2025, at 04:26, Alexandre Courbot wrote: >> >> The OFFSET const is an I/O property, and having to pass it to the >> @common rule makes it impossible to make I/O optional, as we want to get

Re: [PATCH v2 01/19] gpu: nova-core: register: minor grammar and spelling fixes

2025-07-27 Thread Alexandre Courbot
Hi Daniel, thanks for the review! On Sat Jul 26, 2025 at 1:14 AM JST, Daniel Almeida wrote: > Hi Alex. Thank you and John for working on this in general. It will be useful > for the whole ecosystem! :) > >> On 18 Jul 2025, at 04:26, Alexandre Courbot wrote: >>

Re: [PATCH] gpu: nova-core: vbios: use offset_of in PmuLookupTableHeader::new

2025-07-25 Thread Alexandre Courbot
On Fri Jul 18, 2025 at 4:36 PM JST, Rhys Lloyd wrote: > Use the offset_of macro for each struct field, annotate the > `PmuLookupTableHeader` struct with `#[repr(C)]` attribute, > and add a TODO message to use FromBytes when available. > > Signed-off-by: Rhys Lloyd > --- > drivers/gpu/nova-core/vb

Re: [PATCH v3] gpu: nova-core: vbios: change PmuLookupTableEntry to use size_of

2025-07-25 Thread Alexandre Courbot
On Fri Jul 18, 2025 at 4:36 PM JST, Rhys Lloyd wrote: > Annotate the PmuLookupTableEntry with an `#[repr(C, packed)]` attribute. > Removes another magic number by making the struct the same size as > the data it needs to read, allowing the use of > `size_of::()` > > Signed-off-by: Rhys Lloyd Look

Re: [PATCH v2] gpu: nova-core: vbios: use size_of instead of magic number

2025-07-25 Thread Alexandre Courbot
On Fri Jul 18, 2025 at 4:36 PM JST, Rhys Lloyd wrote: > 12 is identical to the value of `size_of::()`, > so use the latter instead. > > Signed-off-by: Rhys Lloyd Looking good - I'll push this to nova-next unless someone complains. Thanks!

Re: [PATCH v2 16/19] gpu: nova-core: falcon: add distinct base address for PFALCON2

2025-07-22 Thread Alexandre Courbot
On Sat Jul 19, 2025 at 5:23 AM JST, John Hubbard wrote: > On 7/18/25 12:26 AM, Alexandre Courbot wrote: > ... >> diff --git a/drivers/gpu/nova-core/falcon/gsp.rs >> b/drivers/gpu/nova-core/falcon/gsp.rs >> index >> 0db9f94036

Re: [PATCH v2 02/19] gpu: nova-core: register: fix typo

2025-07-22 Thread Alexandre Courbot
On Sat Jul 19, 2025 at 4:05 AM JST, Boqun Feng wrote: > On Fri, Jul 18, 2025 at 04:26:07PM +0900, Alexandre Courbot wrote: >> A space was missing between arguments in this invocation. >> > > It's obvious up to driver and Nova folks, but I feel this commit better > fo

[PATCH v2 19/19] gpu: nova-core: register: add support for relative array registers

2025-07-18 Thread Alexandre Courbot
Add support for declaring arrays of registers available from a variable base. This is effectively a combination of the relative and array registers features. nova-core does not make much use of this yet, but it will become helpful to have for GSP boot. Signed-off-by: Alexandre Courbot

[PATCH v2 18/19] gpu: nova-core: falcon: use register arrays for FUSE registers

2025-07-18 Thread Alexandre Courbot
FUSE registers are an array of 16 consecutive registers. Use the newly available register array feature to define them properly and improve the code using them. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon/hal/ga102.rs | 33 ++- drivers/gpu/nova

[PATCH v2 17/19] gpu: nova-core: register: add support for register arrays

2025-07-18 Thread Alexandre Courbot
-checking is effective for array accesses performed with a constant. For cases where the index cannot be known at compile time, `try_` variants of the accessors are also made available that return `EINVAL` if the access is out-of-bounds. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core

[PATCH v2 10/19] gpu: nova-core: register: add fields dispatcher internal rule

2025-07-18 Thread Alexandre Courbot
us to reuse the captured field information partially to provide better `Debug` and `Default` implementations in following patches. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 42 +++- 1 file changed, 32 insertions(+), 10 deletions

[PATCH v2 15/19] gpu: nova-core: register: redesign relative registers

2025-07-18 Thread Alexandre Courbot
a relative register, and, since the valid bases are all known at compile-time, also guarantees that all I/O accesses are done within the valid bounds of the I/O range. Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/todo.rst | 1 - drivers/gpu/nova-core/falcon.rs

[PATCH v2 16/19] gpu: nova-core: falcon: add distinct base address for PFALCON2

2025-07-18 Thread Alexandre Courbot
registers definitions to assign a distinct `PFalcon2Base` base address to each falcon engine. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 7 ++- drivers/gpu/nova-core/falcon/gsp.rs | 6 +- drivers/gpu/nova-core/falcon/sec2.rs | 6 +- drivers/gpu/nova

[PATCH v2 14/19] gpu: nova-core: register: use #[inline(always)] for all methods

2025-07-18 Thread Alexandre Courbot
These methods should always be inlined, so use the strongest compiler hint that exists to maximize the chance they will indeed be. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a

[PATCH v2 04/19] gpu: nova-core: register: improve documentation for basic registers

2025-07-18 Thread Alexandre Courbot
Reword parts of the documentation that were a bit heavy to read, and harmonize/fix the examples. The relative registers section is about to be redesigned and its documentation rewritten, so do not touch this part. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 24

[PATCH v2 05/19] gpu: nova-core: register: simplify @leaf_accessor rule

2025-07-18 Thread Alexandre Courbot
The `$type` metavariable is not used in the @leaf_accessor rule, so remove it. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs

[PATCH v2 12/19] gpu: nova-core: register: generate correct `Default` implementation

2025-07-18 Thread Alexandre Courbot
The `Default` implementation of a register should be the aggregate of the default values of all its fields, and not simply be zeroed. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff

[PATCH v2 13/19] gpu: nova-core: register: split @io rule into fixed and relative versions

2025-07-18 Thread Alexandre Courbot
. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs/macros.rs index f0942dc29210f703fddd4d86b758173f75b3477a

[PATCH v2 11/19] gpu: nova-core: register: improve `Debug` implementation

2025-07-18 Thread Alexandre Courbot
Now that we have an internal rule to dispatch field information where needed, use it to generate a better `Debug` implementation where the raw hexadecimal value of the register is displayed, as well as the `Debug` values of its individual fields. Signed-off-by: Alexandre Courbot --- drivers/gpu

[PATCH v2 09/19] gpu: nova-core: register: add missing doccomments for fixed registers I/O accessors

2025-07-18 Thread Alexandre Courbot
Add the missing doccomments for these accessors, as having a bit of inline documentation is always helpful. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova

[PATCH v2 08/19] gpu: nova-core: register: fix documentation and indentation

2025-07-18 Thread Alexandre Courbot
Fix a few documentation inconsistencies, and harmonize indentation where possible. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 34 +- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/nova-core/regs

[PATCH v2 06/19] gpu: nova-core: register: remove `try_` accessors for relative registers

2025-07-18 Thread Alexandre Courbot
Relative registers are always accessed using a literal base, meaning their validity can always be checked at compile-time. Thus remove the `try_` accessors that have no purpose. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 38

[PATCH v2 07/19] gpu: nova-core: register: move OFFSET declaration to I/O impl block

2025-07-18 Thread Alexandre Courbot
The OFFSET const is an I/O property, and having to pass it to the @common rule makes it impossible to make I/O optional, as we want to get to eventually. Thus, move OFFSET to the I/O impl block so it is not needed by the @common rule anymore. Signed-off-by: Alexandre Courbot --- drivers/gpu

[PATCH v2 01/19] gpu: nova-core: register: minor grammar and spelling fixes

2025-07-18 Thread Alexandre Courbot
break up a run-on sentence, for clarity. Cc: Alexandre Courbot Cc: Danilo Krummrich Signed-off-by: John Hubbard Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/nova

[PATCH v2 03/19] gpu: nova-core: register: allow fields named `offset`

2025-07-18 Thread Alexandre Courbot
` the field's range constant to avoid the name collision. Reported-by: Timur Tabi Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs.rs| 4 ++-- drivers/gpu/nova-core/regs/macros.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nova

[PATCH v2 02/19] gpu: nova-core: register: fix typo

2025-07-18 Thread Alexandre Courbot
A space was missing between arguments in this invocation. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs/macros.rs index

[PATCH v2 00/19] gpu: nova-core: register!() macro improvements

2025-07-18 Thread Alexandre Courbot
ive slices instead of NVIDIA's OpenRM format, - ... and proper suitability assessment by other driver contributors. These should be trivial compared to the work that is done in this series. Signed-off-by: Alexandre Courbot --- Changes in v2: - Improve documentation and add layout diagram f

Re: [PATCH] gpu: nova-core: fix bounds check in PmuLookupTableEntry::new

2025-07-16 Thread Alexandre Courbot
On Sun Jul 13, 2025 at 11:51 AM JST, Rhys Lloyd wrote: > data is sliced from 2..6, but the bounds check data.len() < 5 > does not satisfy those bounds. > > Fixes: 47c4846e4319 ("gpu: nova-core: vbios: Add support for FWSEC ucode > extraction") > > Signed-off-by: Rhys Lloyd Applied to nova-next,

Re: [PATCH] gpu: nova-core: vbios: use size_of instead of magic number

2025-07-15 Thread Alexandre Courbot
On Mon Jul 14, 2025 at 7:43 PM JST, Rhys Lloyd wrote: > 12 is identical to the value of `size_of::()`, > so use the latter instead. > > Signed-off-by: Rhys Lloyd > --- > drivers/gpu/nova-core/vbios.rs | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/nova-core/v

Re: [PATCH] gpu: nova-core: vbios: split out PmuLookupTableHeader from PmuLookupTable

2025-07-15 Thread Alexandre Courbot
On Mon Jul 14, 2025 at 7:43 PM JST, Rhys Lloyd wrote: > Separating the header allows the use of `size_of::()` > instead of the magic number 4. > > Signed-off-by: Rhys Lloyd > --- > drivers/gpu/nova-core/vbios.rs | 56 +- > 1 file changed, 35 insertions(+), 21 delet

Re: [PATCH v2] gpu: nova-core: vbios: change PmuLookupTableEntry to relax alignment

2025-07-15 Thread Alexandre Courbot
On Tue Jul 15, 2025 at 12:22 AM JST, Joel Fernandes wrote: > > > On 7/14/2025 10:53 AM, Alice Ryhl wrote: >> On Mon, Jul 14, 2025 at 4:49 PM Joel Fernandes wrote: >>> >>> Hello, Rhys, >>> >>> On Mon, Jul 14, 2025 at 04:02:23AM -0700, Rhys Lloyd wrote: Instead of the data field containing a u3

Re: [PATCH] gpu: nova-core: define named constants for magic numbers

2025-07-13 Thread Alexandre Courbot
On Sun Jul 13, 2025 at 11:51 AM JST, Rhys Lloyd wrote: > Introduce an associated constant `MIN_LEN` for each struct that checks > the length of the input data in its constructor against a magic number. > > Signed-off-by: Rhys Lloyd As I mentioned in [1], I think this would be better addressed by

Re: [PATCH] gpu: nova-core: fix bounds check in PmuLookupTableEntry::new

2025-07-13 Thread Alexandre Courbot
Rhys Lloyd > --- > Changes in v2: Since this is a v2, the message subject should have read "[PATCH v2]". You can achieve this by passing `-v 2` to git format-patch. No need to resend, just pointing it out for next time. :) For the fix in itself, Reviewed-by: Alexandre Courbot

[PATCH v4 7/8] Documentation: gpu: nova-core: Document fwsec operation and layout

2025-07-07 Thread Alexandre Courbot
From: Joel Fernandes Add explanation of fwsec with diagrams. This helps clarify how the nova-core falcon boot works. Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/fwsec.rst | 181 ++ Documentation/gpu/nova

[PATCH v4 8/8] Documentation: gpu: nova-core: Document basics of the Falcon

2025-07-07 Thread Alexandre Courbot
Nouveau code. Signed-off-by: Joel Fernandes Reviewed-by: Bagas Sanjaya Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/falcon.rst | 158 + Documentation/gpu/nova/index.rst | 1 + 2 files changed, 159 insertions(+) diff --git a

[PATCH v4 6/8] Documentation: gpu: nova-core: Document devinit process

2025-07-07 Thread Alexandre Courbot
: Alexandre Courbot --- Documentation/gpu/nova/core/devinit.rst | 61 + Documentation/gpu/nova/index.rst| 1 + 2 files changed, 62 insertions(+) diff --git a/Documentation/gpu/nova/core/devinit.rst b/Documentation/gpu/nova/core/devinit.rst new file mode

[PATCH v4 5/8] Documentation: gpu: nova-core: Document vbios layout

2025-07-07 Thread Alexandre Courbot
ff-by: Alexandre Courbot --- Documentation/gpu/nova/core/vbios.rst | 181 ++ Documentation/gpu/nova/index.rst | 1 + 2 files changed, 182 insertions(+) diff --git a/Documentation/gpu/nova/core/vbios.rst b/Documentation/gpu/nova/core/vbios.rst new file mode 1

[PATCH v4 3/8] gpu: nova-core: Clarify falcon code

2025-07-07 Thread Alexandre Courbot
From: Joel Fernandes Add documentation strings, comments and AES mode for completeness to the Falcon signatures. Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 29 ++--- 1 file changed, 22 insertions(+), 7

[PATCH v4 4/8] gpu: nova-core: convert `/*` comments to `//`

2025-07-07 Thread Alexandre Courbot
The second form is preferred, and there was no reason to use the first. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs.rs | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/nova-core/regs.rs b/drivers/gpu/nova-core/regs.rs index

[PATCH v4 2/8] gpu: nova-core: Clarify sysmembar operations

2025-07-07 Thread Alexandre Courbot
From: Joel Fernandes sysmembar is a critical operation that the GSP falcon needs to perform in the reset sequence. Add some code comments to clarify. [acour...@nvdidia.com: move relevant documentation to SysmemFlush type] Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot

[PATCH v4 0/8] Documentation for nova-core

2025-07-07 Thread Alexandre Courbot
g/all/db0i8wah970b.25d3s59ayf...@nvidia.com/ Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- Changes in v4: - Convert `/*` comments into `//`. - Fix missing slashes in doccomments and minor typos. - Move some less-important paragraphs to notes in the RST files. - Link to v3:

[PATCH v4 1/8] gpu: nova-core: Add code comments related to devinit

2025-07-07 Thread Alexandre Courbot
Fernandes Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gfw.rs | 39 +++ drivers/gpu/nova-core/regs.rs | 14 -- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nova-core/gfw.rs b/drivers/gpu/nova-core/gfw.rs

Re: [PATCH v3 1/7] gpu: nova-core: Add code comments related to devinit

2025-07-07 Thread Alexandre Courbot
On Sun Jul 6, 2025 at 10:42 PM JST, Miguel Ojeda wrote: > On Wed, Jul 2, 2025 at 1:04 PM Alexandre Courbot wrote: >> >> +// Check that FWSEC has lowered its protection level before reading >> the GFW_BOOT status. > > `GFW_BOOT` (another one below), since it

[PATCH 18/18] gpu: nova-core: registers: add support for relative array registers

2025-07-04 Thread Alexandre Courbot
Add support for declaring arrays of registers available from a variable base. This is effectively a combination of the relative and array registers features. nova-core does not make much use of this yet, but it will become helpful to have for GSP boot. Signed-off-by: Alexandre Courbot

[PATCH 17/18] gpu: nova-core: falcon: use register arrays for FUSE registers

2025-07-04 Thread Alexandre Courbot
FUSE registers are an array of 16 consecutive registers. Use the newly available register array feature to define them properly and improve the code using them. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon/hal/ga102.rs | 33 ++- drivers/gpu/nova

[PATCH 14/18] gpu: nova-core: register: redesign relative registers

2025-07-04 Thread Alexandre Courbot
a relative register, and, since the valid bases are all known at compile-time, also guarantees that all I/O accesses are done within the valid bounds of the I/O range. Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/todo.rst | 1 - drivers/gpu/nova-core/falcon.rs

[PATCH 16/18] gpu: nova-core: register: add support for register arrays

2025-07-04 Thread Alexandre Courbot
-checking is effective for array accesses performed with a constant. For cases where the index cannot be known at compile time, `try_` variants of the accessors are also made available that return `EINVAL` if the access is out-of-bounds. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core

[PATCH 15/18] gpu: nova-core: falcon: add distinct base address for PFALCON2

2025-07-04 Thread Alexandre Courbot
registers definitions to assign a distinct `PFalcon2Base` base address to each falcon engine. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 7 ++- drivers/gpu/nova-core/falcon/gsp.rs | 6 +- drivers/gpu/nova-core/falcon/sec2.rs | 6 +- drivers/gpu/nova

[PATCH 13/18] gpu: nova-core: register: use #[inline(always)] for all methods

2025-07-04 Thread Alexandre Courbot
These methods should always be inlined, so use the strongest compiler hint that exists to maximize the chance they will indeed be. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a

[PATCH 12/18] gpu: nova-core: register: split @io rule into fixed and relative versions

2025-07-04 Thread Alexandre Courbot
. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs/macros.rs index 97895800ff7031d287b3bbd03a00b1ca71014aa8

[PATCH 11/18] gpu: nova-core: register: generate correct `Default` implementation

2025-07-04 Thread Alexandre Courbot
The `Default` implementation of a register should be the aggregate of the default values of all its fields, and not simply be zeroed. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff

[PATCH 10/18] gpu: nova-core: register: improve `Debug` implementation

2025-07-04 Thread Alexandre Courbot
Now that we have an internal rule to dispatch field information where needed, use it to generate a better `Debug` implementation where the raw hexadecimal value of the register is displayed, as well as the `Debug` values of its individual fields. Signed-off-by: Alexandre Courbot --- drivers/gpu

[PATCH 08/18] gpu: nova-core: register: add missing doccomments for fixed registers I/O accessors

2025-07-04 Thread Alexandre Courbot
Add the missing doccomments for these accessors, as having a bit of inline documentation is always helpful. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova

[PATCH 09/18] gpu: nova-core: register: add fields dispatcher internal rule

2025-07-04 Thread Alexandre Courbot
us to reuse the captured field information partially to provide better `Debug` and `Default` implementations in following patches. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 42 +++- 1 file changed, 32 insertions(+), 10 deletions

[PATCH 07/18] gpu: nova-core: register: fix documentation and indentation

2025-07-04 Thread Alexandre Courbot
Fix a few documentation inconsistencies, and harmonize indentation where possible. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 34 +- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/nova-core/regs

[PATCH 06/18] gpu: nova-core: register: move OFFSET declaration to I/O impl block

2025-07-04 Thread Alexandre Courbot
The OFFSET const is an I/O property, and having to pass it to the @common rule makes it impossible to make I/O optional, as we want to get to eventually. Thus, move OFFSET to the I/O impl block so it is not needed by the @common rule anymore. Signed-off-by: Alexandre Courbot --- drivers/gpu

[PATCH 05/18] gpu: nova-core: register: remove `try_` accessors for relative registers

2025-07-04 Thread Alexandre Courbot
Relative registers are always accessed using a literal base, meaning their validity can always be checked at compile-time. Thus remove the `try_` accessors that have no purpose. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 38

[PATCH 04/18] gpu: nova-core: register: simplify @leaf_accessor rule

2025-07-04 Thread Alexandre Courbot
The `$type` metavariable is not used in the @leaf_accessor rule, so remove it. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs

[PATCH 03/18] gpu: nova-core: register: fix alias documentation

2025-07-04 Thread Alexandre Courbot
The provided example had its matching closing parentheses missing. Also simplify the example itself and reword the explanation a bit. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu

[PATCH 02/18] gpu: nova-core: register: fix typo

2025-07-04 Thread Alexandre Courbot
A space was missing between arguments in this invocation. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs/macros.rs index

[PATCH 01/18] gpu: nova-core: register: minor grammar and spelling fixes

2025-07-04 Thread Alexandre Courbot
break up a run-on sentence, for clarity. Cc: Alexandre Courbot Cc: Danilo Krummrich Signed-off-by: John Hubbard Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/regs/macros.rs | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/nova

[PATCH 00/18] gpu: nova-core: register!() macro improvements

2025-07-04 Thread Alexandre Courbot
ive slices instead of NVIDIA's OpenRM format, - ... and proper suitability assessment by other driver contributors. These should be trivial compared to the work that is done in this series. Signed-off-by: Alexandre Courbot --- Alexandre Courbot (17): gpu: nova-core: register: fix

[PATCH v3 6/7] Documentation: gpu: nova-core: Document fwsec operation and layout

2025-07-02 Thread Alexandre Courbot
From: Joel Fernandes Add explanation of fwsec with diagrams. This helps clarify how the nova-core falcon boot works. Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/fwsec.rst | 182 ++ Documentation/gpu/nova

[PATCH v3 7/7] Documentation: gpu: nova-core: Document basics of the Falcon

2025-07-02 Thread Alexandre Courbot
Nouveau code. Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/falcon.rst | 158 + Documentation/gpu/nova/index.rst | 1 + 2 files changed, 159 insertions(+) diff --git a/Documentation/gpu/nova/core/falcon.rst

[PATCH v3 2/7] gpu: nova-core: Clarify sysmembar operations

2025-07-02 Thread Alexandre Courbot
From: Joel Fernandes sysmembar is a critical operation that the GSP falcon needs to perform in the reset sequence. Add some code comments to clarify. [acour...@nvdidia.com: move relevant documentation to SysmemFlush type] Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot

[PATCH v3 5/7] Documentation: gpu: nova-core: Document devinit process

2025-07-02 Thread Alexandre Courbot
From: Joel Fernandes devinit is mentioned in the code. This patch explains it so it is clear what it does. devinit is not only essential at boot-time, but also at runtime due to suspend-resume and things like re-clocking. Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot

[PATCH v3 4/7] Documentation: gpu: nova-core: Document vbios layout

2025-07-02 Thread Alexandre Courbot
ff-by: Alexandre Courbot --- Documentation/gpu/nova/core/vbios.rst | 180 ++ Documentation/gpu/nova/index.rst | 1 + 2 files changed, 181 insertions(+) diff --git a/Documentation/gpu/nova/core/vbios.rst b/Documentation/gpu/nova/core/vbios.rst new file mode 1

[PATCH v3 3/7] gpu: nova-core: Clarify falcon code

2025-07-02 Thread Alexandre Courbot
From: Joel Fernandes Add documentation strings, comments and AES mode for completeness to the Falcon signatures. Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 29 ++--- 1 file changed, 22 insertions(+), 7

[PATCH v3 0/7] Documentation for nova-core

2025-07-02 Thread Alexandre Courbot
g/all/db0i8wah970b.25d3s59ayf...@nvidia.com/ Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- Changes in v3: - Rebase on top of latest nova-next. - Reorganize patches a bit and use standard prefixes. - Convert diagrams to only use ASCII characters (thanks Bagas!). - Move sysm

[PATCH v3 1/7] gpu: nova-core: Add code comments related to devinit

2025-07-02 Thread Alexandre Courbot
Fernandes Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gfw.rs | 39 +++ drivers/gpu/nova-core/regs.rs | 16 ++-- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nova-core/gfw.rs b/drivers/gpu/nova-core/gfw.rs

Re: [PATCH v6 00/24] nova-core: run FWSEC-FRTS to perform first stage of GSP initialization

2025-06-30 Thread Alexandre Courbot
On Tue Jul 1, 2025 at 12:43 AM JST, Danilo Krummrich wrote: > On 6/24/25 4:56 AM, Alexandre Courbot wrote: >> On Tue Jun 24, 2025 at 6:01 AM JST, Danilo Krummrich wrote: >>> There's one thing that would be nice to fix subsequently, which is properly >>> resettin

Re: [PATCH v2 0/7] Documentation for nova-core

2025-06-30 Thread Alexandre Courbot
On Mon Jun 30, 2025 at 7:37 PM JST, Danilo Krummrich wrote: > On 5/3/25 6:07 AM, Joel Fernandes wrote: >> Hello, >> >> Please find attached initial documentation for nova-core mainly about the >> vbios >> and boot process. It helps build an understanding of the boot code. All the >> information i

Re: [PATCH 1/2] gpu: nova-core: impl From for u32 for enums used from register!

2025-06-24 Thread Alexandre Courbot
On Tue Jun 24, 2025 at 10:23 PM JST, Danilo Krummrich wrote: > Implement From for u32 for all enum types used within the register!() > macro. > > This avoids a conflict with [1] as reported in [2]. > > Cc: Alexandre Courbot > Cc: Miguel Ojeda > Link: > https://lore.k

Re: [PATCH 2/2] gpu: nova-core: consider `clippy::cast_lossless`

2025-06-24 Thread Alexandre Courbot
On Tue Jun 24, 2025 at 10:23 PM JST, Danilo Krummrich wrote: > Fix all warnings caused by `clippy::cast_lossless`, which is going to be > enabled by [1]. > > Cc: Alexandre Courbot > Cc: Miguel Ojeda > Link: > https://lore.kernel.org/r/20250615-ptr-as-ptr-v12-5-f43b

[PATCH] gpu: nova-core: replace `Duration` with `Delta`

2025-06-24 Thread Alexandre Courbot
The kernel's `Delta` type was not available when the `wait_on` function was introduced. Now that it is, switch to it as it is more compact than `Duration` and cannot panic. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 12 ++-- drivers/gpu/nova

Re: [PATCH v6 00/24] nova-core: run FWSEC-FRTS to perform first stage of GSP initialization

2025-06-23 Thread Alexandre Courbot
On Tue Jun 24, 2025 at 6:01 AM JST, Danilo Krummrich wrote: > There's one thing that would be nice to fix subsequently, which is properly > resetting the GPU. Currently, it needs a power cycle to be able to probe > successfully after unbinding the driver. Yes, what I usually do is the following af

[PATCH v6 21/24] gpu: nova-core: add types for patching firmware binaries

2025-06-19 Thread Alexandre Courbot
Some of the firmwares need to be patched at load-time with a signature. Add a couple of types and traits that sub-modules can use to implement this behavior, while ensuring that the correct kind of signature is applied to the firmware. Reviewed-by: Lyude Paul Signed-off-by: Alexandre Courbot

[PATCH v6 19/24] gpu: nova-core: vbios: Add support for FWSEC ucode extraction

2025-06-19 Thread Alexandre Courbot
(Write protected region) before the Booter runs on the SEC2 processor. Tested on my Ampere GA102 and boot is successful. [applied changes by Alex Courbot for fwsec signatures] [acour...@nvidia.com: remove now-unneeded Devres acquisition] Cc: Alexandre Courbot Cc: John Hubbard Cc: Shirish Baskaran

Re: [PATCH v5 05/23] rust: num: add the `fls` operation

2025-06-19 Thread Alexandre Courbot
On Thu Jun 19, 2025 at 4:24 AM JST, Benno Lossin wrote: > On Mon Jun 16, 2025 at 8:41 AM CEST, Alexandre Courbot wrote: >> On Sun Jun 15, 2025 at 4:16 AM JST, Benno Lossin wrote: >>> On Thu Jun 12, 2025 at 4:01 PM CEST, Alexandre Courbot wrote: >>>>

[PATCH v6 20/24] gpu: nova-core: compute layout of the FRTS region

2025-06-19 Thread Alexandre Courbot
: Alexandre Courbot --- drivers/gpu/nova-core/fb.rs | 70 drivers/gpu/nova-core/fb/hal.rs | 12 +- drivers/gpu/nova-core/fb/hal/ga100.rs | 12 ++ drivers/gpu/nova-core/fb/hal/ga102.rs | 36 + drivers/gpu/nova-core/fb/hal/tu102

[PATCH v6 23/24] gpu: nova-core: load and run FWSEC-FRTS

2025-06-19 Thread Alexandre Courbot
With all the required pieces in place, load FWSEC-FRTS onto the GSP falcon, run it, and check that it successfully carved out the WPR2 region out of framebuffer memory. Reviewed-by: Lyude Paul Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 3 -- drivers/gpu

[PATCH v6 24/24] gpu: nova-core: update and annotate TODO list

2025-06-19 Thread Alexandre Courbot
: Alexandre Courbot --- Documentation/gpu/nova/core/todo.rst | 107 -- drivers/gpu/nova-core/dma.rs | 2 +- drivers/gpu/nova-core/driver.rs | 2 +- drivers/gpu/nova-core/falcon.rs | 8 ++- drivers/gpu/nova-core/falcon/hal

[PATCH v6 22/24] gpu: nova-core: extract FWSEC from BIOS and patch it to run FWSEC-FRTS

2025-06-19 Thread Alexandre Courbot
x27;s fields] Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/dma.rs| 3 - drivers/gpu/nova-core/firmware.rs | 3 +- drivers/gpu/nova-core/firmware/fwsec.rs | 398 drivers/gpu/nova-core/gpu.rs| 15 +- drivers/gpu/nova

[PATCH v6 15/24] gpu: nova-core: add falcon register definitions and base code

2025-06-19 Thread Alexandre Courbot
the GSP and SEC2 Falcons that will be required to perform that dance and boot the GSP. Thanks to Ben Skeggs for pointing out an important bug in the memory scrubbing code that could lead to a race condition and ultimately a failure to boot the GSP! Reviewed-by: Lyude Paul Signed-off-by: Alexandre

[PATCH v6 17/24] gpu: nova-core: vbios: Add base support for VBIOS construction and iteration

2025-06-19 Thread Alexandre Courbot
Tabi] [applied changes related to code reorg, prints etc from Danilo Krummrich] [acour...@nvidia.com: fix clippy warnings, read_more() function] Cc: Alexandre Courbot Cc: John Hubbard Cc: Shirish Baskaran Cc: Alistair Popple Cc: Timur Tabi Cc: Ben Skeggs Signed-off-by: Alexandre Courbot

[PATCH v6 18/24] gpu: nova-core: vbios: Add support to look up PMU table in FWSEC

2025-06-19 Thread Alexandre Courbot
From: Joel Fernandes The PMU table in the FWSEC image has to be located to locate the start of the Falcon ucode in the same or another FWSEC image. Add support for the same. Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/vbios.rs | 179

[PATCH v6 12/24] gpu: nova-core: wait for GFW_BOOT completion

2025-06-19 Thread Alexandre Courbot
Upon reset, the GPU executes the GFW (GPU Firmware) in order to initialize its base parameters such as clocks. The driver must ensure that this step is completed before using the hardware. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gfw.rs | 41

[PATCH v6 14/24] gpu: nova-core: register sysmem flush page

2025-06-19 Thread Alexandre Courbot
: Alexandre Courbot --- drivers/gpu/nova-core/fb.rs | 66 +++ drivers/gpu/nova-core/fb/hal.rs | 31 drivers/gpu/nova-core/fb/hal/ga100.rs | 45 drivers/gpu/nova-core/fb/hal/tu102.rs | 42

[PATCH v6 16/24] gpu: nova-core: firmware: add ucode descriptor used by FWSEC-FRTS

2025-06-19 Thread Alexandre Courbot
FWSEC-FRTS is the first firmware we need to run on the GSP falcon in order to initiate the GSP boot process. Introduce the structure that describes it. Reviewed-by: Lyude Paul Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware.rs | 45 +++ 1

[PATCH v6 13/24] gpu: nova-core: add DMA object struct

2025-06-19 Thread Alexandre Courbot
Since we will need to allocate lots of distinct memory chunks to be shared between GPU and CPU, introduce a type dedicated to that. It is a light wrapper around CoherentAllocation. Reviewed-by: Lyude Paul Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/dma.rs | 61

  1   2   3   4   5   6   7   >