[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e235856e-5a57-40da-92d6-7e9ac8e2dee0@nvidia.com>
Date: Sun, 8 Feb 2026 17:56:22 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Timur Tabi <ttabi@...dia.com>, Alexandre Courbot <acourbot@...dia.com>,
"dakr@...nel.org" <dakr@...nel.org>
Cc: "aliceryhl@...gle.com" <aliceryhl@...gle.com>,
"lossin@...nel.org" <lossin@...nel.org>,
"a.hindborg@...nel.org" <a.hindborg@...nel.org>,
"boqun.feng@...il.com" <boqun.feng@...il.com>, Zhi Wang <zhiw@...dia.com>,
"simona@...ll.ch" <simona@...ll.ch>,
"alex.gaynor@...il.com" <alex.gaynor@...il.com>,
"ojeda@...nel.org" <ojeda@...nel.org>, "tmgross@...ch.edu"
<tmgross@...ch.edu>,
"nouveau@...ts.freedesktop.org" <nouveau@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>,
"bjorn3_gh@...tonmail.com" <bjorn3_gh@...tonmail.com>,
Eliot Courtney <ecourtney@...dia.com>, "airlied@...il.com"
<airlied@...il.com>, Joel Fernandes <joelagnelf@...dia.com>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"gary@...yguo.net" <gary@...yguo.net>, Alistair Popple <apopple@...dia.com>
Subject: Re: [PATCH v3 16/30] gpu: nova-core: Hopper/Blackwell: add FSP falcon
EMEM operations
On 2/6/26 10:07 AM, Timur Tabi wrote:
> On Thu, 2026-02-05 at 20:21 -0800, John Hubbard wrote:
>> +/// EMEM control register bit 24: write mode.
>> +const EMEM_CTL_WRITE: u32 = 1 << 24;
>> +/// EMEM control register bit 25: read mode.
>> +const EMEM_CTL_READ: u32 = 1 << 25;
>> +
>
> Shouldn't these be bits in the NV_PFALCON_FALCON_EMEM_CTL register instead?
Yes you are right. I've fixed it up for v3 like this:
diff --git a/drivers/gpu/nova-core/falcon/fsp.rs b/drivers/gpu/nova-core/falcon/fsp.rs
index 5152c2f1ed26..fb1c8c89d2ff 100644
--- a/drivers/gpu/nova-core/falcon/fsp.rs
+++ b/drivers/gpu/nova-core/falcon/fsp.rs
@@ -21,11 +21,6 @@
},
};
-/// EMEM control register bit 24: write mode.
-const EMEM_CTL_WRITE: u32 = 1 << 24;
-/// EMEM control register bit 25: read mode.
-const EMEM_CTL_READ: u32 = 1 << 25;
-
/// Type specifying the `Fsp` falcon engine. Cannot be instantiated.
pub(crate) struct Fsp(());
@@ -54,7 +49,8 @@ pub(crate) fn write_emem(&self, bar: &Bar0, offset: u32, data: &[u8]) -> Result
}
regs::NV_PFALCON_FALCON_EMEM_CTL::default()
- .set_value(EMEM_CTL_WRITE | offset)
+ .set_wr_mode(true)
+ .set_offset(offset)
.write(bar, &Fsp::ID);
for chunk in data.chunks_exact(4) {
@@ -78,7 +74,8 @@ pub(crate) fn read_emem(&self, bar: &Bar0, offset: u32, data: &mut [u8]) -> Resu
}
regs::NV_PFALCON_FALCON_EMEM_CTL::default()
- .set_value(EMEM_CTL_READ | offset)
+ .set_rd_mode(true)
+ .set_offset(offset)
.write(bar, &Fsp::ID);
for chunk in data.chunks_exact_mut(4) {
diff --git a/drivers/gpu/nova-core/regs.rs b/drivers/gpu/nova-core/regs.rs
index 30a5a49edeab..a9a65f98d8a3 100644
--- a/drivers/gpu/nova-core/regs.rs
+++ b/drivers/gpu/nova-core/regs.rs
@@ -434,7 +434,9 @@ pub(crate) fn reset_engine<E: FalconEngine>(bar: &Bar0) {
// GP102 EMEM PIO registers (used by FSP for Hopper/Blackwell)
// These registers provide falcon external memory communication interface
register!(NV_PFALCON_FALCON_EMEM_CTL @ PFalconBase[0x00000ac0] {
- 31:0 value as u32; // EMEM control register
+ 23:0 offset as u32; // EMEM byte offset (must be 4-byte aligned)
+ 24:24 wr_mode as bool; // Write mode
+ 25:25 rd_mode as bool; // Read mode
});
thanks,
--
John Hubbard
Powered by blists - more mailing lists