[PATCH v3 16/19] nova-core: Add support for VBIOS ucode extraction for boot

2025-05-07 Thread Alexandre Courbot
] [applied changes related to code reorg, prints etc from Danilo Krummrich] [acour...@nvidia.com: fix clippy warnings] [acour...@nvidia.com: remove now-unneeded Devres acquisition] [acour...@nvidia.com: fix read_more to read `len` bytes, not u32s] Cc: Alexandre Courbot Cc: John Hubbard Cc: Shirish

[PATCH v3 03/19] gpu: nova-core: add missing GA100 definition

2025-05-07 Thread Alexandre Courbot
linux-firmware contains a directory for GA100, and it is a defined chipset in Nouveau. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index

Re: [PATCH v2 17/21] rust: num: Add an upward alignment helper for usize

2025-05-07 Thread Alexandre Courbot
On Tue May 6, 2025 at 12:25 AM JST, Joel Fernandes wrote: >> Actually it may be a good idea to move this into its own patch/series so >> it gets more attention as this is starting to look like the `num` or >> `num_integer` crates and we might be well-advised to take more >> inspiration from them in

[PATCH v3 10/19] gpu: nova-core: add DMA object struct

2025-05-07 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. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/dma.rs | 60

[PATCH v3 18/19] gpu: nova-core: extract FWSEC from BIOS and patch it to run FWSEC-FRTS

2025-05-07 Thread Alexandre Courbot
x27;s fields] Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/dma.rs| 3 - drivers/gpu/nova-core/firmware.rs | 18 ++ drivers/gpu/nova-core/firmware/fwsec.rs | 359 drivers/gpu/nova-core/gpu.rs| 20 +- drivers/gpu/nova

[PATCH v3 19/19] gpu: nova-core: load and run FWSEC-FRTS

2025-05-07 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. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 3 --- drivers/gpu/nova-core/gpu.rs| 57

[PATCH v3 17/19] gpu: nova-core: compute layout of the FRTS region

2025-05-07 Thread Alexandre Courbot
FWSEC-FRTS is run with the desired address of the FRTS region as parameter, which we need to compute depending on some hardware parameters. Do this in a `FbLayout` structure, that will be later extended to describe more memory regions used to boot the GSP. Signed-off-by: Alexandre Courbot

[PATCH v3 13/19] gpu: nova-core: add falcon register definitions and base code

2025-05-07 Thread Alexandre Courbot
Add the common Falcon code and HAL for Ampere GPUs, and instantiate the GSP and SEC2 Falcons that will be required to boot the GSP. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 540 ++ drivers/gpu/nova-core/falcon/gsp.rs

[PATCH v3 15/19] rust: num: Add an upward alignment helper for usize

2025-05-07 Thread Alexandre Courbot
From: Joel Fernandes This will be used in the nova-core driver where we need to upward-align the image size to get to the next image in the VBIOS ROM. [acour...@nvidia.com: handled conflicts due to removal of patch creating num.rs] Signed-off-by: Joel Fernandes Signed-off-by: Alexandre

[PATCH v3 08/19] rust: make ETIMEDOUT error available

2025-05-07 Thread Alexandre Courbot
We will use this error in the nova-core driver. Signed-off-by: Alexandre Courbot --- rust/kernel/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index 3dee3139fcd4379b94748c0ba1965f4e1865b633..083c7b068cf4e185100de96e520c54437898ee72

[PATCH v3 05/19] gpu: nova-core: define registers layout using helper macro

2025-05-07 Thread Alexandre Courbot
accessors. Suggested-by: Danilo Krummrich Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/todo.rst | 6 + drivers/gpu/nova-core/gpu.rs | 10 +- drivers/gpu/nova-core/regs.rs| 61 ++ drivers/gpu/nova-core/regs/macros.rs | 380

[PATCH v3 14/19] gpu: nova-core: firmware: add ucode descriptor used by FWSEC-FRTS

2025-05-07 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. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware.rs | 43 +++ 1 file changed, 43

[PATCH v3 06/19] gpu: nova-core: fix layout of NV_PMC_BOOT_0

2025-05-07 Thread Alexandre Courbot
at a different location than the rest of its bits. Redefine the register layout to match its actual definition as provided by OpenRM and expose the fully-constructed "architecture" field through our own "Architecture" type. The "chipset" pseudo-field is also u

[PATCH v3 12/19] gpu: nova-core: add helper function to wait on condition

2025-05-07 Thread Alexandre Courbot
`read_poll_timeout` [1] once it is available. [1] https://lore.kernel.org/lkml/20250220070611.214262-8-fujita.tomon...@gmail.com/ Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/util.rs | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/nova

[PATCH v3 11/19] gpu: nova-core: register sysmem flush page

2025-05-07 Thread Alexandre Courbot
A page of system memory is reserved so sysmembar can perform a read on it if a system write occurred since the last flush. Do this early as it can be required to e.g. reset the GPU falcons. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 45

[PATCH v3 09/19] gpu: nova-core: wait for GFW_BOOT completion

2025-05-07 Thread Alexandre Courbot
Upon reset, the GPU executes the GFW_BOOT 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/devinit.rs | 38

[PATCH v3 07/19] gpu: nova-core: move Firmware to firmware module

2025-05-07 Thread Alexandre Courbot
We will extend the firmware methods, so move it to its own module instead to keep gpu.rs focused. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware.rs | 46 +-- drivers/gpu/nova-core/gpu.rs | 35 +++-- 2 files

[PATCH v3 02/19] gpu: nova-core: derive useful traits for Chipset

2025-05-07 Thread Alexandre Courbot
We will commonly need to compare chipset versions, so derive the ordering traits to make that possible. Also derive Copy and Clone since passing Chipset by value will be more efficient than by reference. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 2 +- 1 file changed, 1

[PATCH v3 01/19] rust: dma: expose the count and size of CoherentAllocation

2025-05-07 Thread Alexandre Courbot
These properties are very useful to have and should be accessible. Signed-off-by: Alexandre Courbot --- rust/kernel/dma.rs | 14 ++ 1 file changed, 14 insertions(+) diff --git a/rust/kernel/dma.rs b/rust/kernel/dma.rs index 605e01e35715667f93297fd9ec49d8e7032e0910

[PATCH v3 04/19] gpu: nova-core: take bound device in Gpu::new

2025-05-07 Thread Alexandre Courbot
We will need to perform things like allocating DMA memory during device creation, so make sure to take the device context that will allow us to perform these actions. This also allows us to use Devres::access to obtain the BAR without holding a RCU lock. Signed-off-by: Alexandre Courbot

[PATCH v3 00/19] nova-core: run FWSEC-FRTS to perform first stage of GSP initialization

2025-05-07 Thread Alexandre Courbot
order for a smooth review. [1] https://lore.kernel.org/rust-for-linux/20250503040802.1411285-1-joelagn...@nvidia.com/ Signed-off-by: Alexandre Courbot --- Changes in v3: - Rebased on top of latest nova-next. - Use the new Devres::access() and remove the now unneeded with_bar!() macro. - Dro

Re: [PATCH v2 09/21] gpu: nova-core: move Firmware to firmware module

2025-05-07 Thread Alexandre Courbot
On Sat May 3, 2025 at 6:14 AM JST, Timur Tabi wrote: > On Thu, 2025-05-01 at 21:58 +0900, Alexandre Courbot wrote: >> +pub(crate) const FIRMWARE_VERSION: &str = "535.113.01"; > > This needs to change to 570.144. You can find images to use here: > > https://githu

Re: [PATCH v2 17/21] rust: num: Add an upward alignment helper for usize

2025-05-03 Thread Alexandre Courbot
On Sat May 3, 2025 at 12:02 PM JST, Joel Fernandes wrote: > > > On 5/2/2025 9:59 PM, Alexandre Courbot wrote: >>> pub trait AlignUp { >>> fn align_up(self, alignment: Self) -> Self; >>> } >>> >>> macro_rules! align_up_impl { >>>

Re: [PATCH v2 17/21] rust: num: Add an upward alignment helper for usize

2025-05-03 Thread Alexandre Courbot
On Sat May 3, 2025 at 12:02 PM JST, Joel Fernandes wrote: > > > On 5/2/2025 9:59 PM, Alexandre Courbot wrote: >>> pub trait AlignUp { >>> fn align_up(self, alignment: Self) -> Self; >>> } >>> >>> macro_rules! align_up_impl { >>>

Re: [PATCH v2 17/21] rust: num: Add an upward alignment helper for usize

2025-05-02 Thread Alexandre Courbot
On Sat May 3, 2025 at 4:59 AM JST, Joel Fernandes wrote: > Hello, Alex, > > On 5/2/2025 12:57 AM, Alexandre Courbot wrote: >> On Thu May 1, 2025 at 9:58 PM JST, Alexandre Courbot wrote: >>> From: Joel Fernandes >>> >>> This will be used in the nova

Re: [PATCH v2 17/21] rust: num: Add an upward alignment helper for usize

2025-05-01 Thread Alexandre Courbot
On Thu May 1, 2025 at 9:58 PM JST, Alexandre Courbot wrote: > From: Joel Fernandes > > This will be used in the nova-core driver where we need to upward-align > the image size to get to the next image in the VBIOS ROM. > > [acour...@nvidia.com: handled conflicts due to removal

Re: [PATCH v2 17/21] rust: num: Add an upward alignment helper for usize

2025-05-01 Thread Alexandre Courbot
On Fri May 2, 2025 at 12:19 AM JST, Timur Tabi wrote: > On Thu, 2025-05-01 at 21:58 +0900, Alexandre Courbot wrote: > > >> +impl UsizeAlign for usize { >> +    fn align_up(mut self, align: usize) -> usize { >> +    self = (self + align - 1) &a

Re: [PATCH v2 15/21] gpu: nova-core: add falcon register definitions and base code

2025-05-01 Thread Alexandre Courbot
On Thu May 1, 2025 at 10:52 PM JST, Joel Fernandes wrote: > Hello Alex, > > On Thu, May 01, 2025 at 09:58:33PM +0900, Alexandre Courbot wrote: >> Add the common Falcon code and HAL for Ampere GPUs, and instantiate the >> GSP and SEC2 Falcons that will be required to boot the G

Re: [PATCH 11/16] gpu: nova-core: add falcon register definitions and base code

2025-05-01 Thread Alexandre Courbot
On Thu May 1, 2025 at 9:22 AM JST, Joel Fernandes wrote: > Hi Alex, > > On 4/30/2025 8:09 PM, Alexandre Courbot wrote: >>>> I am just not seeing the benefits of not using dyn for >>>> this use case and only drawbacks. IMHO, we should try to not be doing the >>

[PATCH v2 17/21] rust: num: Add an upward alignment helper for usize

2025-05-01 Thread Alexandre Courbot
From: Joel Fernandes This will be used in the nova-core driver where we need to upward-align the image size to get to the next image in the VBIOS ROM. [acour...@nvidia.com: handled conflicts due to removal of patch creating num.rs] Signed-off-by: Joel Fernandes Signed-off-by: Alexandre

[PATCH v2 05/21] gpu: nova-core: take bound device in Gpu::new

2025-05-01 Thread Alexandre Courbot
We will need to perform things like allocating DMA memory during device creation, so make sure to take the device context that will allow us to perform these actions. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 5 - 1 file changed, 4 insertions(+), 1 deletion

[PATCH v2 09/21] gpu: nova-core: move Firmware to firmware module

2025-05-01 Thread Alexandre Courbot
We will extend the firmware methods, so move it to its own module instead to keep gpu.rs focused. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware.rs | 46 +-- drivers/gpu/nova-core/gpu.rs | 35 +++-- 2 files

[PATCH v2 02/21] rust: dma: expose the count and size of CoherentAllocation

2025-05-01 Thread Alexandre Courbot
These properties are very useful to have and should be accessible. Signed-off-by: Alexandre Courbot --- rust/kernel/dma.rs | 14 ++ 1 file changed, 14 insertions(+) diff --git a/rust/kernel/dma.rs b/rust/kernel/dma.rs index 605e01e35715667f93297fd9ec49d8e7032e0910

[PATCH v2 20/21] gpu: nova-core: extract FWSEC from BIOS and patch it to run FWSEC-FRTS

2025-05-01 Thread Alexandre Courbot
x27;s fields] Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/dma.rs| 3 - drivers/gpu/nova-core/firmware.rs | 18 ++ drivers/gpu/nova-core/firmware/fwsec.rs | 360 drivers/gpu/nova-core/gpu.rs| 20 +- drivers/gpu/nova

[PATCH v2 08/21] gpu: nova-core: introduce helper macro for register access

2025-05-01 Thread Alexandre Courbot
proper error as needed. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 3 +-- drivers/gpu/nova-core/nova_core.rs | 18 ++ drivers/gpu/nova-core/regs/macros.rs | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nova-core

[PATCH v2 01/21] rust: devres: allow to borrow a reference to the resource's Device

2025-05-01 Thread Alexandre Courbot
Functions that take a &Devres as argument might need to print error messages related on behalf the device. Providing the reference here removes the need for drivers to store their own for that sole purpose. Signed-off-by: Alexandre Courbot --- rust/kernel/devres.rs | 6 ++ 1 file change

[PATCH v2 21/21] gpu: nova-core: load and run FWSEC-FRTS

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

[PATCH v2 18/21] nova-core: Add support for VBIOS ucode extraction for boot

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

[PATCH v2 19/21] gpu: nova-core: compute layout of the FRTS region

2025-05-01 Thread Alexandre Courbot
FWSEC-FRTS is run with the desired address of the FRTS region as parameter, which we need to compute depending on some hardware parameters. Do this in a `FbLayout` structure, that will be later extended to describe more memory regions used to boot the GSP. Signed-off-by: Alexandre Courbot

[PATCH v2 10/21] rust: make ETIMEDOUT error available

2025-05-01 Thread Alexandre Courbot
We will use this error in the nova-core driver. Signed-off-by: Alexandre Courbot --- rust/kernel/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index 3dee3139fcd4379b94748c0ba1965f4e1865b633..083c7b068cf4e185100de96e520c54437898ee72

[PATCH v2 11/21] gpu: nova-core: wait for GFW_BOOT completion

2025-05-01 Thread Alexandre Courbot
Upon reset, the GPU executes the GFW_BOOT 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/devinit.rs | 43

[PATCH v2 12/21] gpu: nova-core: add DMA object struct

2025-05-01 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. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/dma.rs | 60

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

2025-05-01 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. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware.rs | 43 +++ 1 file changed, 43

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

2025-05-01 Thread Alexandre Courbot
Add the common Falcon code and HAL for Ampere GPUs, and instantiate the GSP and SEC2 Falcons that will be required to boot the GSP. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 546 ++ drivers/gpu/nova-core/falcon/gsp.rs

[PATCH v2 03/21] gpu: nova-core: derive useful traits for Chipset

2025-05-01 Thread Alexandre Courbot
We will commonly need to compare chipset versions, so derive the ordering traits to make that possible. Also derive Copy and Clone since passing Chipset by value will be more efficient than by reference. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 2 +- 1 file changed, 1

[PATCH v2 06/21] gpu: nova-core: define registers layout using helper macro

2025-05-01 Thread Alexandre Courbot
accessors. Suggested-by: Danilo Krummrich Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/todo.rst | 6 + drivers/gpu/nova-core/gpu.rs | 10 +- drivers/gpu/nova-core/regs.rs| 61 ++ drivers/gpu/nova-core/regs/macros.rs | 379

[PATCH v2 14/21] gpu: nova-core: add helper function to wait on condition

2025-05-01 Thread Alexandre Courbot
`read_poll_timeout` [1] once it is available. [1] https://lore.kernel.org/lkml/20250220070611.214262-8-fujita.tomon...@gmail.com/ Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/util.rs | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/nova

[PATCH v2 13/21] gpu: nova-core: register sysmem flush page

2025-05-01 Thread Alexandre Courbot
A page of system memory is reserved so sysmembar can perform a read on it if a system write occurred since the last flush. Do this early as it can be required to e.g. reset the GPU falcons. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 51

[PATCH v2 07/21] gpu: nova-core: fix layout of NV_PMC_BOOT_0

2025-05-01 Thread Alexandre Courbot
at a different location than the rest of its bits. Redefine the register layout to match its actual definition as provided by OpenRM and expose the fully-constructed "architecture" field through our own "Architecture" type. The "chipset" pseudo-field is also u

[PATCH v2 04/21] gpu: nova-core: add missing GA100 definition

2025-05-01 Thread Alexandre Courbot
linux-firmware contains a directory for GA100, and it is a defined chipset in Nouveau. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index

[PATCH v2 00/21] nova-core: run FWSEC-FRTS to perform first stage of GSP initialization

2025-05-01 Thread Alexandre Courbot
7.199712-1-fujita.tomon...@gmail.com/ Signed-off-by: Alexandre Courbot --- Changes in v2: - Rebased on latest nova-next. - Fixed all clippy warnings. - Added `count` and `size` methods to `CoherentAllocation`. - Added method to obtain a reference to the `Device` from a `Devres` (this is super convenient

Re: [PATCH 11/16] gpu: nova-core: add falcon register definitions and base code

2025-04-30 Thread Alexandre Courbot
On Thu May 1, 2025 at 3:16 AM JST, Danilo Krummrich wrote: > On Wed, Apr 30, 2025 at 10:38:11AM -0400, Joel Fernandes wrote: >> On 4/30/2025 9:25 AM, Alexandre Courbot wrote: >> > On Tue Apr 22, 2025 at 11:44 PM JST, Danilo Krummrich wrote: >> >> >>> +///

Re: [PATCH 11/16] gpu: nova-core: add falcon register definitions and base code

2025-04-30 Thread Alexandre Courbot
t; On Sun, Apr 20, 2025 at 09:19:43PM +0900, Alexandre Courbot wrote: >> >> +#[repr(u8)] >> +#[derive(Debug, Default, Copy, Clone)] >> +pub(crate) enum FalconSecurityModel { >> +#[default] >> +None = 0, >> +Light = 2, >> +Heavy = 3, >&

Re: [PATCH 10/16] gpu: nova-core: add basic timer device

2025-04-29 Thread Alexandre Courbot
On Tue Apr 22, 2025 at 9:07 PM JST, Danilo Krummrich wrote: > On Sun, Apr 20, 2025 at 09:19:42PM +0900, Alexandre Courbot wrote: >> Add a timer that works with GPU time and provides the ability to wait on >> a condition with a specific timeout. > > What can this timer do for

Re: [PATCH 08/16] gpu: nova-core: wait for GFW_BOOT completion

2025-04-29 Thread Alexandre Courbot
On Tue Apr 22, 2025 at 8:36 PM JST, Danilo Krummrich wrote: > On Sun, Apr 20, 2025 at 09:19:40PM +0900, Alexandre Courbot wrote: >> Upon reset, the GPU executes the GFW_BOOT firmware in order to >> initialize its base parameters such as clocks. The driver must ensure >> that t

Re: [PATCH 06/16] gpu: nova-core: define registers layout using helper macro

2025-04-28 Thread Alexandre Courbot
Hi Danilo, On Tue Apr 22, 2025 at 7:29 PM JST, Danilo Krummrich wrote: > On Sun, Apr 20, 2025 at 09:19:38PM +0900, Alexandre Courbot wrote: >> Add the register!() macro, which defines a given register's layout and >> provide bit-field accessors with a way to convert them to a

Re: [PATCH 03/16] gpu: nova-core: derive useful traits for Chipset

2025-04-24 Thread Alexandre Courbot
On Wed Apr 23, 2025 at 1:23 AM JST, Joel Fernandes wrote: > > > On 4/20/2025 8:19 AM, Alexandre Courbot wrote: >> We will commonly need to compare chipset versions, so derive the >> ordering traits to make that possible. Also derive Copy and Clone since >> passing Ch

Re: [5/6] gpu: nova-core: Clarify fields in FalconAppifHdrV1

2025-04-24 Thread Alexandre Courbot
On Thu Apr 24, 2025 at 12:06 PM JST, Joel Fernandes wrote: > On April 24, 2025, 1:18 a.m. UTC > Alexandre Courbot wrote: >> Since this just renames fields, would you be ok if I squashed this one >> into the relevant patch of my series, alongside a >> >> [joelagn...

Re: [PATCH 0/6] Additional documentation for nova-core

2025-04-23 Thread Alexandre Courbot
Thanks a lot for doing this, this was severely missing from the WPR2 patchset. Due to the strong focus on documentation, and in order to ease merging, I think it makes sense to keep this separate from the WPR2 patchset and merge it on top of it. Danilo, would that work for you? On Thu Apr 24, 202

Re: [PATCH 5/6] gpu: nova-core: Clarify fields in FalconAppifHdrV1

2025-04-23 Thread Alexandre Courbot
Since this just renames fields, would you be ok if I squashed this one into the relevant patch of my series, alongside a [joelagn...@nvidia.com: give better names to FalconAppifHdrV1's fields] ? On Thu Apr 24, 2025 at 7:54 AM JST, Joel Fernandes wrote: > Signed-off-by: Joel Fernandes > --- > d

Re: [PATCH 09/16] gpu: nova-core: register sysmem flush page

2025-04-23 Thread Alexandre Courbot
On Tue Apr 22, 2025 at 8:45 PM JST, Danilo Krummrich wrote: > On Sun, Apr 20, 2025 at 09:19:41PM +0900, Alexandre Courbot wrote: >> A page of system memory is reserved so sysmembar can perform a read on >> it if a system write occurred since the last flush. Do this early as it >

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

2025-04-22 Thread Alexandre Courbot
Hi Danilo, On Tue Apr 22, 2025 at 5:40 PM JST, Danilo Krummrich wrote: > On Sun, Apr 20, 2025 at 09:19:32PM +0900, Alexandre Courbot wrote: >> Hi everyone, >> >> This series is a continuation of my previous RFCs [1] to complete the >> first step of GSP booting (runn

Re: [PATCH 08/16] gpu: nova-core: wait for GFW_BOOT completion

2025-04-22 Thread Alexandre Courbot
Hi Joel, Danilo, On Tue Apr 22, 2025 at 8:28 PM JST, Danilo Krummrich wrote: > On Mon, Apr 21, 2025 at 05:45:33PM -0400, Joel Fernandes wrote: >> On 4/20/2025 8:19 AM, Alexandre Courbot wrote: >> > diff --git a/drivers/gpu/nova-core/devinit.rs >> > b/drivers/gpu/no

[PATCH 14/16] gpu: nova-core: compute layout of the FRTS region

2025-04-20 Thread Alexandre Courbot
FWSEC-FRTS is run with the desired address of the FRTS region as parameter, which we need to compute depending on some hardware parameters. Do this in a `FbLayout` structure, that will be later extended to describe more memory regions used to boot the GSP. Signed-off-by: Alexandre Courbot

[PATCH 05/16] gpu: nova-core: take bound device in Gpu::new

2025-04-20 Thread Alexandre Courbot
We will need to perform things like allocating DMA memory during device creation, so make sure to take the device context that will allow us to perform these actions. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 5 - 1 file changed, 4 insertions(+), 1 deletion

[PATCH 01/16] rust: add useful ops for u64

2025-04-20 Thread Alexandre Courbot
will be extended with other useful operations, and similar extension traits implemented for other types. Reviewed-by: Sergio González Collado Signed-off-by: Alexandre Courbot --- rust/kernel/lib.rs | 1 + rust/kernel/num.rs | 52 2 files

[PATCH 09/16] gpu: nova-core: register sysmem flush page

2025-04-20 Thread Alexandre Courbot
A page of system memory is reserved so sysmembar can perform a read on it if a system write occurred since the last flush. Do this early as it can be required to e.g. reset the GPU falcons. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/dma.rs | 54

[PATCH 10/16] gpu: nova-core: add basic timer device

2025-04-20 Thread Alexandre Courbot
Add a timer that works with GPU time and provides the ability to wait on a condition with a specific timeout. The `Duration` Rust type is used to keep track is differences between timestamps ; this will be replaced by the equivalent kernel type once it lands. Signed-off-by: Alexandre Courbot

[PATCH 16/16] gpu: nova-core: load and run FWSEC-FRTS

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

[PATCH 15/16] gpu: nova-core: extract FWSEC from BIOS and patch it to run FWSEC-FRTS

2025-04-20 Thread Alexandre Courbot
The FWSEC firmware needs to be extracted from the VBIOS and patched with the desired command, as well as the right signature. Do this so we are ready to load and run this firmware into the GSP falcon and create the FRTS region. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core

[PATCH 13/16] gpu: nova-core: Add support for VBIOS ucode extraction for boot

2025-04-20 Thread Alexandre Courbot
] Signed-off-by: Joel Fernandes Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware.rs |2 - drivers/gpu/nova-core/gpu.rs |5 + drivers/gpu/nova-core/nova_core.rs |1 + drivers/gpu/nova-core/vbios.rs | 1103 4 files

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

2025-04-20 Thread Alexandre Courbot
doing such transmute operations safely are not in the kernel crate yet. [1] https://lore.kernel.org/rust-for-linux/20250320-nova_timer-v3-0-79aa2ad25...@nvidia.com/ [2] https://lore.kernel.org/rust-for-linux/20250411-try_with-v4-0-f470ac79e...@nvidia.com/ Signed-off-by: Alexandre Courbot

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

2025-04-20 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. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware.rs | 28 1 file changed, 28 insertions

[PATCH 11/16] gpu: nova-core: add falcon register definitions and base code

2025-04-20 Thread Alexandre Courbot
Add the common Falcon code and HAL for Ampere GPUs, and instantiate the GSP and SEC2 Falcons that will be required to boot the GSP. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 469 ++ drivers/gpu/nova-core/falcon/gsp.rs

[PATCH 04/16] gpu: nova-core: add missing GA100 definition

2025-04-20 Thread Alexandre Courbot
linux-firmware contains a directory for GA100, and it is a defined chipset in Nouveau. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index

[PATCH 08/16] gpu: nova-core: wait for GFW_BOOT completion

2025-04-20 Thread Alexandre Courbot
Upon reset, the GPU executes the GFW_BOOT 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/devinit.rs | 40

[PATCH 06/16] gpu: nova-core: define registers layout using helper macro

2025-04-20 Thread Alexandre Courbot
uses Revocable::try_access() and converts its returned Option into the proper error as needed. Suggested-by: Danilo Krummrich Signed-off-by: Alexandre Courbot --- Documentation/gpu/nova/core/todo.rst | 6 + drivers/gpu/nova-core/gpu.rs | 5 +- drivers/gpu/nova-core/nova_core.rs

[PATCH 07/16] gpu: nova-core: move Firmware to firmware module

2025-04-20 Thread Alexandre Courbot
We will extend the firmware methods, so move it to its own module instead to keep gpu.rs focused. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware.rs | 42 ++- drivers/gpu/nova-core/gpu.rs | 35 +++- 2 files

[PATCH 02/16] rust: make ETIMEDOUT error available

2025-04-20 Thread Alexandre Courbot
We will use this error in the nova-core driver. Signed-off-by: Alexandre Courbot --- rust/kernel/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index 3dee3139fcd4379b94748c0ba1965f4e1865b633..083c7b068cf4e185100de96e520c54437898ee72

[PATCH 03/16] gpu: nova-core: derive useful traits for Chipset

2025-04-20 Thread Alexandre Courbot
We will commonly need to compare chipset versions, so derive the ordering traits to make that possible. Also derive Copy and Clone since passing Chipset by value will be more efficient than by reference. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 2 +- 1 file changed, 1

[PATCH RFC v3 6/7] gpu: nova-core: add basic timer device

2025-04-05 Thread Alexandre Courbot
in the current code), but they seem to be monomorphized as well. Calling extra functions could work better, but looks also less elegant to me, so I am really open to suggestions here. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/driver.rs| 4 +- drivers/gpu/nova-core/gpu

Re: [PATCH RFC v3 6/7] gpu: nova-core: add basic timer device

2025-04-05 Thread Alexandre Courbot
Hi Boqun, On Fri Mar 21, 2025 at 3:17 AM JST, Boqun Feng wrote: > Hi Alexandre, > > On Thu, Mar 20, 2025 at 10:39:14PM +0900, Alexandre Courbot wrote: >> Add a basic timer device and exercise it during device probing. This >> first draft is probably very questionable

[PATCH RFC v3 1/7] rust: add useful ops for u64

2025-04-05 Thread Alexandre Courbot
will be extended with other useful operations, and similar extension traits implemented for other types. Reviewed-by: Sergio González Collado Signed-off-by: Alexandre Courbot --- rust/kernel/lib.rs | 1 + rust/kernel/num.rs | 52 2 files

[PATCH RFC v3 7/7] gpu: nova-core: add falcon register definitions and probe code

2025-03-28 Thread Alexandre Courbot
This is still very preliminary work, and is mostly designed to show how register fields can be turned into safe types that force us to handle invalid values. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/driver.rs| 2 +- drivers/gpu/nova-core/falcon.rs| 618

Re: [PATCH RFC v3 6/7] gpu: nova-core: add basic timer device

2025-03-23 Thread Alexandre Courbot
On Sat Mar 22, 2025 at 1:20 AM JST, Daniel Brooks wrote: > "Alexandre Courbot" writes: > >> Hi Boqun, >> >> On Fri Mar 21, 2025 at 3:17 AM JST, Boqun Feng wrote: >>> Also an Instant type has been proposed and reviewed for a while: >>>

Re: [PATCH RFC v3 6/7] gpu: nova-core: add basic timer device

2025-03-20 Thread Alexandre Courbot
On Fri Mar 21, 2025 at 12:54 AM JST, Daniel Brooks wrote: > Alexandre Courbot writes: > >> +impl Add for Timestamp { >> +type Output = Self; >> + >> +fn add(mut self, rhs: Duration) -> Self::Output { >> +let mut nanos = rhs.as_nanos(); >

[PATCH RFC v3 5/7] gpu: nova-core: use register!() to define register layout

2025-03-20 Thread Alexandre Courbot
Use the register!() macro to define the layout for the Boot0 register and use its accessors through the use of the convenience with_bar!() macro, which uses Revocable::try_access() and converts its returned Option into the proper error as needed. Signed-off-by: Alexandre Courbot --- drivers/gpu

[PATCH RFC v3 3/7] gpu: nova-core: derive useful traits for Chipset

2025-03-20 Thread Alexandre Courbot
We will commonly need to compare chipset versions, so derive the ordering traits to make that possible. Also derive Copy and Clone since Chipsets are as cheap as an integer. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH RFC v3 2/7] rust: make ETIMEDOUT error available

2025-03-20 Thread Alexandre Courbot
Signed-off-by: Alexandre Courbot --- rust/kernel/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index 1e510181432cceae46219f7ed3597a88b85ebe0a..475d14a4830774aa7717d3b5e70c7ff9de203dc2 100644 --- a/rust/kernel/error.rs +++ b/rust/kernel

[PATCH RFC v3 4/7] gpu: nova-core: add missing GA100 definition

2025-03-20 Thread Alexandre Courbot
linux-firmware contains a directory for GA100, and it is a defined chipset in Nouveau. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index

[RFC PATCH v3 0/7] gpu: nova-core: register definitions and basic timer and falcon devices

2025-03-20 Thread Alexandre Courbot
-FRTS firmware, - Complete FWSEC-FRTS execution to obtain WPR2 region. Signed-off-by: Alexandre Courbot --- Changes in v3: - Fixed typo in Boot0 register definition that made probing fail. - Moved the register definition macros to their own patch series. - Used Revocable::try_access_with() when acce

Re: [PATCH v5 4/5] gpu: nova-core: add initial driver stub

2025-03-06 Thread Alexandre Courbot
gmx28B3BQ?si=sBdSEer4tAPKGpOs [3] > Signed-off-by: Danilo Krummrich A couple of nits inline below, but feel free to add my Reviewed-by: Alexandre Courbot > --- > MAINTAINERS| 10 ++ > drivers/gpu/Makefile | 1 + > drivers/gpu/nova-core/K

Re: [PATCH v5 5/5] gpu: nova-core: add initial documentation

2025-03-06 Thread Alexandre Courbot
rastructure. > > Signed-off-by: Danilo Krummrich Reviewed-by: Alexandre Courbot Thanks for this - the todo list in particular is super helpful to understand which components outside of the driver we need to include or drive to completion.

Re: [PATCH v4 5/6] gpu: nova-core: add initial driver stub

2025-03-04 Thread Alexandre Courbot
Hi Danilo, On Thu Feb 27, 2025 at 2:55 AM JST, Danilo Krummrich wrote: > Add the initial nova-core driver stub. > > nova-core is intended to serve as a common base for nova-drm (the > corresponding DRM driver) and the vGPU manager VFIO driver, serving as a > hard- and firmware abstraction layer fo

[RFC PATCH v2 0/5] gpu: nova-core: register definitions and basic timer and falcon devices

2025-03-04 Thread Alexandre Courbot
ation to define more registers and exercise the register definition macro. - Link to v1: https://lore.kernel.org/r/20250217-nova_timer-v1-0-78c5ace2d...@nvidia.com --- Alexandre Courbot (5): rust: add useful ops for u64 rust: make ETIMEDOUT error available gpu: nova-core: add regis

[PATCH RFC v2 4/5] gpu: nova-core: add basic timer device

2025-03-04 Thread Alexandre Courbot
in the current code), but they seem to be monomorphized as well. Calling extra functions could work better, but looks also less elegant to me, so I am really open to suggestions here. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/driver.rs| 4 +- drivers/gpu/nova-core/gpu

[PATCH RFC v2 5/5] gpu: nova-core: add falcon register definitions and probe code

2025-03-04 Thread Alexandre Courbot
This is still very preliminary work, and is mostly designed to show how register fields can be turned into safe types that force us to handle invalid values. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/driver.rs| 2 +- drivers/gpu/nova-core/falcon.rs| 124

[PATCH RFC v2 3/5] gpu: nova-core: add register definition macro

2025-03-04 Thread Alexandre Courbot
cause of an invalid value. The ending string at the end of each line is optional, and expands to doc comments for the type itself, or each of the field accessors. Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/gpu.rs | 2 +- drivers/gpu/nova-core/regs.rs | 195 +++

[PATCH RFC v2 1/5] rust: add useful ops for u64

2025-03-04 Thread Alexandre Courbot
will be extended with other useful operations, and similar extension traits implemented for other types. Signed-off-by: Alexandre Courbot --- rust/kernel/lib.rs | 1 + rust/kernel/num.rs | 43 +++ 2 files changed, 44 insertions(+) diff --git a/rust/kernel

[PATCH RFC v2 2/5] rust: make ETIMEDOUT error available

2025-03-04 Thread Alexandre Courbot
Signed-off-by: Alexandre Courbot --- rust/kernel/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index 1e510181432cceae46219f7ed3597a88b85ebe0a..475d14a4830774aa7717d3b5e70c7ff9de203dc2 100644 --- a/rust/kernel/error.rs +++ b/rust/kernel

  1   2   3   4   5   >