]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gpu: nova-core: define registers layout using helper macro
authorAlexandre Courbot <acourbot@nvidia.com>
Wed, 7 May 2025 13:52:32 +0000 (22:52 +0900)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 13 May 2025 13:08:18 +0000 (15:08 +0200)
commitc3f22262670da259d7cf1fda199d8f06f1d6ff6d
treee3b6aca27e2e230b24e89bd01a545988fc7fd746
parenta2a637ffdf8692e9a376383ca82a990036424fe0
gpu: nova-core: define registers layout using helper macro

Add the register!() macro, which defines a given register's layout and
provide bit-field accessors with a way to convert them to a given type.
This macro will allow us to make clear definitions of the registers and
manipulate their fields safely.

The long-term goal is to eventually move it to the kernel crate so it
can be used by other drivers as well, but it was agreed to first land it
into nova-core and make it mature there.

To illustrate its usage, use it to define the layout for the Boot0
(renamed to NV_PMC_BOOT_0 to match OpenRM's naming scheme) and take
advantage of its accessors.

Suggested-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://lore.kernel.org/r/20250507-nova-frts-v3-5-fcb02749754d@nvidia.com
[ Fix typo in commit message. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Documentation/gpu/nova/core/todo.rst
drivers/gpu/nova-core/gpu.rs
drivers/gpu/nova-core/regs.rs
drivers/gpu/nova-core/regs/macros.rs [new file with mode: 0644]