From: Joel Fernandes <joelagnelf@nvidia.com>
To: linux-kernel@vger.kernel.org, Danilo Krummrich <dakr@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Jonathan Corbet <corbet@lwn.net>
Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Alexandre Courbot <acourbot@nvidia.com>,
John Hubbard <jhubbard@nvidia.com>,
Shirish Baskaran <sbaskaran@nvidia.com>,
Alistair Popple <apopple@nvidia.com>,
Timur Tabi <ttabi@nvidia.com>, Ben Skeggs <bskeggs@nvidia.com>,
Joel Fernandes <joelagnelf@nvidia.com>,
linux-doc@vger.kernel.org
Subject: [PATCH 6/6] nova-core: docs: Document devinit process
Date: Wed, 23 Apr 2025 18:54:02 -0400 [thread overview]
Message-ID: <20250423225405.139613-7-joelagnelf@nvidia.com> (raw)
In-Reply-To: <20250423225405.139613-1-joelagnelf@nvidia.com>
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 <joelagnelf@nvidia.com>
---
Documentation/gpu/nova/core/devinit.rst | 54 +++++++++++++++++++++++++
Documentation/gpu/nova/index.rst | 2 +
2 files changed, 56 insertions(+)
create mode 100644 Documentation/gpu/nova/core/devinit.rst
diff --git a/Documentation/gpu/nova/core/devinit.rst b/Documentation/gpu/nova/core/devinit.rst
new file mode 100644
index 000000000000..e504ed3efe15
--- /dev/null
+++ b/Documentation/gpu/nova/core/devinit.rst
@@ -0,0 +1,54 @@
+.. SPDX-License-Identifier: GPL-2.0
+==================================
+Device Initialization (devinit)
+==================================
+
+Overview
+--------
+Device initialization (devinit) is a crucial sequence of register read/write operations
+that occur after a GPU reset. The devinit sequence is essential for properly configuring
+the GPU hardware before it can be used.
+
+The devinit is an interpreter program that typically runs on the PMU (Power Management
+Unit) microcontroller of the GPU. This interpreter executes a "script" of initialization
+commands. The devinit interpreter itself is part of the FWSEC (Firmware Security)
+component provided by the GPU firmware in the VBIOS ROM (see fwsec.rst and vbios.rst).
+
+Key Functions of devinit
+------------------------
+devinit performs several critical tasks:
+
+1. Programming VRAM memory controller timings
+2. Power sequencing
+3. Clock and PLL (Phase-Locked Loop) configuration
+4. Thermal management
+5. VRAM memory scrubbing (ECC initialization)
+ - On some GPUs, it scrubs only part of memory and then initiates 'async scrubbing'
+
+Firmware Initialization Flow
+---------------------------
+Upon reset, several microcontrollers on the GPU (such as PMU, SEC2, GSP, etc.) run GPU
+firmware (gfw) code to set up core parameters. Most of the GPU is considered unusable
+until this initialization process completes.
+
+The GPU firmware components are:
+1. Located in the VBIOS ROM
+2. Executed in sequence on different microcontrollers:
+ - The devinit sequence runs on the PMU
+ - The FWSEC runs on the GSP (Graphics System Processor) in high secure mode
+
+Before the driver can proceed with further initialization, it must wait for a signal
+indicating that core initialization is complete (known as GFW_BOOT). This signal is
+set up by the FWSEC running on the GSP in high secure mode.
+
+Runtime Considerations
+---------------------
+It's important to note that the devinit sequence also needs to run during suspend/resume
+operations at runtime, not just during initial boot.
+
+Security and Access Control
+--------------------------
+The initialization process involves careful privilege management. For example, before
+accessing certain completion status registers, the driver must check privilege level
+masks. Some registers are only accessible after secure firmware (FWSEC) lowers the
+privilege level to allow CPU (LS/low-secure) access.
\ No newline at end of file
diff --git a/Documentation/gpu/nova/index.rst b/Documentation/gpu/nova/index.rst
index c01dcc5657e2..301435c5cf67 100644
--- a/Documentation/gpu/nova/index.rst
+++ b/Documentation/gpu/nova/index.rst
@@ -27,5 +27,7 @@ vGPU manager VFIO driver and the nova-drm driver.
:titlesonly:
core/guidelines
+ core/vbios
core/fwsec
+ core/devinit
core/todo
--
2.43.0
next prev parent reply other threads:[~2025-04-23 22:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 22:53 [PATCH 0/6] Additional documentation for nova-core Joel Fernandes
2025-04-23 22:53 ` [PATCH 1/6] nova-core: doc: Add code comments related to devinit Joel Fernandes
2025-04-23 22:53 ` [PATCH 2/6] nova-core: doc: Clarify sysmembar operations Joel Fernandes
2025-04-23 22:53 ` [PATCH 3/6] nova-core: docs: Document vbios layout Joel Fernandes
2025-04-23 23:12 ` Timur Tabi
2025-04-23 23:30 ` Joel Fernandes
2025-04-23 22:54 ` [PATCH 4/6] nova-core: docs: Document fwsec operation and layout Joel Fernandes
2025-04-23 22:54 ` [PATCH 5/6] gpu: nova-core: Clarify fields in FalconAppifHdrV1 Joel Fernandes
2025-04-24 1:18 ` Alexandre Courbot
[not found] ` <174546399398.876.3516508778193165894@patchwork.local>
2025-04-24 7:45 ` [5/6] " Alexandre Courbot
2025-04-24 13:03 ` Joel Fernandes
2025-04-23 22:54 ` Joel Fernandes [this message]
2025-04-24 1:25 ` [PATCH 0/6] Additional documentation for nova-core Alexandre Courbot
2025-04-24 8:10 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250423225405.139613-7-joelagnelf@nvidia.com \
--to=joelagnelf@nvidia.com \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=apopple@nvidia.com \
--cc=bskeggs@nvidia.com \
--cc=corbet@lwn.net \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jhubbard@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=sbaskaran@nvidia.com \
--cc=simona@ffwll.ch \
--cc=ttabi@nvidia.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox