[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5beb884b-f0fe-46b8-ac62-f11637fcc93f@nvidia.com>
Date: Fri, 18 Jul 2025 13:23:05 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Alexandre Courbot <acourbot@...dia.com>,
Danilo Krummrich <dakr@...nel.org>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>
Cc: Daniel Almeida <daniel.almeida@...labora.com>,
Beata Michalska <beata.michalska@....com>, nouveau@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 16/19] gpu: nova-core: falcon: add distinct base
address for PFALCON2
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 0db9f94036a6a7ced5a461aec2cff2ce246a5e0e..f17599cb49fa1e5077a554dc14b3715aa62a4ebd 100644
> --- a/drivers/gpu/nova-core/falcon/gsp.rs
> +++ b/drivers/gpu/nova-core/falcon/gsp.rs
> @@ -2,7 +2,7 @@
>
> use crate::{
> driver::Bar0,
> - falcon::{Falcon, FalconEngine, PFalconBase},
> + falcon::{Falcon, FalconEngine, PFalcon2Base, PFalconBase},
> regs::{self, macros::RegisterBase},
> };
>
> @@ -13,6 +13,10 @@ impl RegisterBase<PFalconBase> for Gsp {
> const BASE: usize = 0x00110000;
This approach means that the reference manual values such as these, end
up being scattered throughout the code base, as magic numbers.
I'm thinking that there should be no problem with using a symbol from
the manuals, listed in a common area, instead, right?
> }
>
> +impl RegisterBase<PFalcon2Base> for Gsp {
> + const BASE: usize = 0x00111000;
> +}
> +
> impl FalconEngine for Gsp {
> const ID: Self = Gsp(());
> }
> diff --git a/drivers/gpu/nova-core/falcon/sec2.rs b/drivers/gpu/nova-core/falcon/sec2.rs
> index dbc486a712ffce30efa3a4264b0757974962302e..815786c8480db6cb74541d7ab574112baeb816fe 100644
> --- a/drivers/gpu/nova-core/falcon/sec2.rs
> +++ b/drivers/gpu/nova-core/falcon/sec2.rs
> @@ -1,6 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -use crate::falcon::{FalconEngine, PFalconBase};
> +use crate::falcon::{FalconEngine, PFalcon2Base, PFalconBase};
> use crate::regs::macros::RegisterBase;
>
> /// Type specifying the `Sec2` falcon engine. Cannot be instantiated.
> @@ -10,6 +10,10 @@ impl RegisterBase<PFalconBase> for Sec2 {
> const BASE: usize = 0x00840000;
> }
>
> +impl RegisterBase<PFalcon2Base> for Sec2 {
> + const BASE: usize = 0x00841000;
> +}
Here are a re more examples of that.
thanks,
--
John Hubbard
Powered by blists - more mailing lists