rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Joel Fernandes <joelagnelf@nvidia.com>,
	linux-kernel@vger.kernel.org, Danilo Krummrich <dakr@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	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>,
	rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v2 3/7] nova-core: docs: Document vbios layout
Date: Mon, 5 May 2025 10:12:47 +0700	[thread overview]
Message-ID: <2b9baf30-53ae-4653-8043-afbc2e396107@gmail.com> (raw)
In-Reply-To: <aBgp5ZTIArRukRk8@archie.me>

On 5/5/25 10:00, Bagas Sanjaya wrote:
> On Sat, May 03, 2025 at 12:07:55AM -0400, Joel Fernandes wrote:
>> +Here is a block diagram of the VBIOS layout::
>> +
>> + ┌────────────────────────────────────────────────────────────────────────┐
>> + │ VBIOS (Starting at ROM_OFFSET: 0x300000)                               │
>> + ├────────────────────────────────────────────────────────────────────────┤
>> + │ ┌───────────────────────────────────────────────┐                      │
>> + │ │ PciAt Image (Type 0x00)                       │                      │
>> + │ ├───────────────────────────────────────────────┤                      │
>> + │ │ ┌───────────────────┐                         │                      │
>> + │ │ │ ROM Header        │                         │                      │
>> + │ │ │ (Signature 0xAA55)│                         │                      │
>> + │ │ └───────────────────┘                         │                      │
>> + │ │         │ rom header's pci_data_struct_offset │                      │
>> + │ │         │ points to the PCIR structure        │                      │
>> + │ │         V                                     │                      │
>> + │ │ ┌───────────────────┐                         │                      │
>> + │ │ │ PCIR Structure    │                         │                      │
>> + │ │ │ (Signature "PCIR")│                         │                      │
>> + │ │ │ last_image: 0x80  │                         │                      │
>> + │ │ │ image_len: size   │                         │                      │
>> + │ │ │ in 512-byte units │                         │                      │
>> + │ │ └───────────────────┘                         │                      │
>> + │ │         │                                     │                      │
>> + │ │         │ NPDE immediately follows PCIR       │                      │
>> + │ │         V                                     │                      │
>> + │ │ ┌───────────────────┐                         │                      │
>> + │ │ │ NPDE Structure    │                         │                      │
>> + │ │ │ (Signature "NPDE")│                         │                      │
>> + │ │ │ last_image: 0x00  │                         │                      │
>> + │ │ └───────────────────┘                         │                      │
>> + │ │                                               │                      │
>> + │ │ ┌───────────────────┐                         │                      │
>> + │ │ │ BIT Header        │ (Signature scanning     │                      │
>> + │ │ │ (Signature "BIT") │  provides the location  │                      │
>> + │ │ └───────────────────┘  of the BIT table)      │                      │
>> + │ │         │ header is                           │                      │
>> + │ │         | followed by a table of tokens       │                      │
>> + │ │         V one of which is for falcon data.    │                      │
>> + │ │ ┌───────────────────┐                         │                      │
>> + │ │ │ BIT Tokens        │                         │                      │
>> + │ | |  ______________   |                         |                      |
>> + │ │ │ │ Falcon Data │   │                         │                      │
>> + │ │ │ │ Token (0x70)│---+------------>------------┼──+                   │
>> + │ │ │ └─────────────┘   │  falcon_data_ptr()      │  │                   │
>> + │ │ └───────────────────┘                         │  V                   │
>> + │ └───────────────────────────────────────────────┘  │                   │
>> + │              (no gap between images)               │                   │
>> + │ ┌───────────────────────────────────────────────┐  │                   │
>> + │ │ EFI Image (Type 0x03)                         │  │                   │
>> + │ ├───────────────────────────────────────────────┤  │                   │
>> + │ | Contains the UEFI GOP driver (Graphics Output)|  |                   |
>> + │ │ ┌───────────────────┐                         │  │                   │
>> + │ │ │ ROM Header        │                         │  │                   │
>> + │ │ +───────────────────+                         │  │                   │
>> + │ │ │ PCIR Structure    │                         │  │                   │
>> + │ │ +───────────────────+                         │  │                   │
>> + │ │ │ NPDE Structure    │                         │  │                   │
>> + │ │ └───────────────────┘                         │  │                   │
>> + │ │ │ Image data        │                         │  │                   │
>> + │ │ └───────────────────┘                         │  │                   │
>> + │ └───────────────────────────────────────────────┘  │                   │
>> + │              (no gap between images)               │                   │
>> + │ ┌───────────────────────────────────────────────┐  │                   │
>> + │ │ First FwSec Image (Type 0xE0)                 │  │                   │
>> + │ ├───────────────────────────────────────────────┤  │                   │
>> + │ │ ┌───────────────────┐                         │  │                   │
>> + │ │ │ ROM Header        │                         │  │                   │
>> + │ │ +───────────────────+                         │  │                   │
>> + │ │ │ PCIR Structure    │                         │  │                   │
>> + │ │ +───────────────────+                         │  │                   │
>> + │ │ │ NPDE Structure    │                         │  │                   │
>> + │ │ └───────────────────┘                         │  │                   │
>> + │ │ │ Image data        │                         │  │                   │
>> + │ │ └───────────────────┘                         │  │                   │
>> + │ └───────────────────────────────────────────────┘  │                   │
>> + │              (no gap between images)               │                   │
>> + │ ┌───────────────────────────────────────────────┐  │                   │
>> + │ │ Second FwSec Image (Type 0xE0)                │  │                   │
>> + │ ├───────────────────────────────────────────────┤  │                   │
>> + │ │ ┌───────────────────┐                         │  │                   │
>> + │ │ │ ROM Header        │                         │  │                   │
>> + │ │ +───────────────────+                         │  │                   │
>> + │ │ │ PCIR Structure    │                         │  │                   │
>> + │ │ +───────────────────+                         │  │                   │
>> + │ │ │ NPDE Structure    │                         │  │                   │
>> + │ │ └───────────────────┘                         │  │                   │
>> + │ │                                               │  │                   │
>> + │ │ ┌───────────────────┐                         │  │                   │
>> + │ │ │ PMU Lookup Table  │ <- falcon_data_offset   │<─┘                   │
>> + │ │ │ ┌─────────────┐   │    pmu_lookup_table     │                      │
>> + │ │ │ │ Entry 0x85  │   │                         │                      │
>> + │ │ │ │ FWSEC_PROD  │   │                         │                      │
>> + │ │ │ └─────────────┘   │                         │                      │
>> + │ │ └───────────────────┘                         │                      │
>> + │ │         │                                     │                      │
>> + │ │         │ points to                           │                      │
>> + │ │         V                                     │                      │
>> + │ │ ┌───────────────────┐                         │                      │
>> + │ │ │ FalconUCodeDescV3 │ <- falcon_ucode_offset  │                      │
>> + │ │ │ (FWSEC Firmware)  │    fwsec_header()       │                      │
>> + │ │ └───────────────────┘                         │                      │
>> + │ │         │   immediately followed  by...       │                      │
>> + │ │         V                                     │                      │
>> + │ │ ┌────────────────────────────┐                │                      │
>> + │ │ │ Signatures + FWSEC Ucode   │                │                      │
>> + │ │ │ fwsec_sigs(), fwsec_ucode()│                │                      │
>> + │ │ └────────────────────────────┘                │                      │
>> + │ └───────────────────────────────────────────────┘______________________│
> 
> Diagram borders look messy in htmldocs output (due to Unicode characters
> ─ and │), so I use ASCII dash and vertical bar instead:
> 
> ---- >8 ----
> diff --git a/Documentation/gpu/nova/core/vbios.rst b/Documentation/gpu/nova/core/vbios.rst
> index dd6ac891e5f1d0..c68ef0e7b70124 100644
> --- a/Documentation/gpu/nova/core/vbios.rst
> +++ b/Documentation/gpu/nova/core/vbios.rst
> @@ -56,112 +56,113 @@ The VBIOS layout is roughly a series of concatenated images as follows:
>   
>   Here is a block diagram of the VBIOS layout::
>   
> - ┌────────────────────────────────────────────────────────────────────────┐
> - │ VBIOS (Starting at ROM_OFFSET: 0x300000)                               │
> - ├────────────────────────────────────────────────────────────────────────┤
> - │ ┌───────────────────────────────────────────────┐                      │
> - │ │ PciAt Image (Type 0x00)                       │                      │
> - │ ├───────────────────────────────────────────────┤                      │
> - │ │ ┌───────────────────┐                         │                      │
> - │ │ │ ROM Header        │                         │                      │
> - │ │ │ (Signature 0xAA55)│                         │                      │
> - │ │ └───────────────────┘                         │                      │
> - │ │         │ rom header's pci_data_struct_offset │                      │
> - │ │         │ points to the PCIR structure        │                      │
> - │ │         V                                     │                      │
> - │ │ ┌───────────────────┐                         │                      │
> - │ │ │ PCIR Structure    │                         │                      │
> - │ │ │ (Signature "PCIR")│                         │                      │
> - │ │ │ last_image: 0x80  │                         │                      │
> - │ │ │ image_len: size   │                         │                      │
> - │ │ │ in 512-byte units │                         │                      │
> - │ │ └───────────────────┘                         │                      │
> - │ │         │                                     │                      │
> - │ │         │ NPDE immediately follows PCIR       │                      │
> - │ │         V                                     │                      │
> - │ │ ┌───────────────────┐                         │                      │
> - │ │ │ NPDE Structure    │                         │                      │
> - │ │ │ (Signature "NPDE")│                         │                      │
> - │ │ │ last_image: 0x00  │                         │                      │
> - │ │ └───────────────────┘                         │                      │
> - │ │                                               │                      │
> - │ │ ┌───────────────────┐                         │                      │
> - │ │ │ BIT Header        │ (Signature scanning     │                      │
> - │ │ │ (Signature "BIT") │  provides the location  │                      │
> - │ │ └───────────────────┘  of the BIT table)      │                      │
> - │ │         │ header is                           │                      │
> - │ │         | followed by a table of tokens       │                      │
> - │ │         V one of which is for falcon data.    │                      │
> - │ │ ┌───────────────────┐                         │                      │
> - │ │ │ BIT Tokens        │                         │                      │
> - │ | |  ______________   |                         |                      |
> - │ │ │ │ Falcon Data │   │                         │                      │
> - │ │ │ │ Token (0x70)│---+------------>------------┼──+                   │
> - │ │ │ └─────────────┘   │  falcon_data_ptr()      │  │                   │
> - │ │ └───────────────────┘                         │  V                   │
> - │ └───────────────────────────────────────────────┘  │                   │
> - │              (no gap between images)               │                   │
> - │ ┌───────────────────────────────────────────────┐  │                   │
> - │ │ EFI Image (Type 0x03)                         │  │                   │
> - │ ├───────────────────────────────────────────────┤  │                   │
> - │ | Contains the UEFI GOP driver (Graphics Output)|  |                   |
> - │ │ ┌───────────────────┐                         │  │                   │
> - │ │ │ ROM Header        │                         │  │                   │
> - │ │ +───────────────────+                         │  │                   │
> - │ │ │ PCIR Structure    │                         │  │                   │
> - │ │ +───────────────────+                         │  │                   │
> - │ │ │ NPDE Structure    │                         │  │                   │
> - │ │ └───────────────────┘                         │  │                   │
> - │ │ │ Image data        │                         │  │                   │
> - │ │ └───────────────────┘                         │  │                   │
> - │ └───────────────────────────────────────────────┘  │                   │
> - │              (no gap between images)               │                   │
> - │ ┌───────────────────────────────────────────────┐  │                   │
> - │ │ First FwSec Image (Type 0xE0)                 │  │                   │
> - │ ├───────────────────────────────────────────────┤  │                   │
> - │ │ ┌───────────────────┐                         │  │                   │
> - │ │ │ ROM Header        │                         │  │                   │
> - │ │ +───────────────────+                         │  │                   │
> - │ │ │ PCIR Structure    │                         │  │                   │
> - │ │ +───────────────────+                         │  │                   │
> - │ │ │ NPDE Structure    │                         │  │                   │
> - │ │ └───────────────────┘                         │  │                   │
> - │ │ │ Image data        │                         │  │                   │
> - │ │ └───────────────────┘                         │  │                   │
> - │ └───────────────────────────────────────────────┘  │                   │
> - │              (no gap between images)               │                   │
> - │ ┌───────────────────────────────────────────────┐  │                   │
> - │ │ Second FwSec Image (Type 0xE0)                │  │                   │
> - │ ├───────────────────────────────────────────────┤  │                   │
> - │ │ ┌───────────────────┐                         │  │                   │
> - │ │ │ ROM Header        │                         │  │                   │
> - │ │ +───────────────────+                         │  │                   │
> - │ │ │ PCIR Structure    │                         │  │                   │
> - │ │ +───────────────────+                         │  │                   │
> - │ │ │ NPDE Structure    │                         │  │                   │
> - │ │ └───────────────────┘                         │  │                   │
> - │ │                                               │  │                   │
> - │ │ ┌───────────────────┐                         │  │                   │
> - │ │ │ PMU Lookup Table  │ <- falcon_data_offset   │<─┘                   │
> - │ │ │ ┌─────────────┐   │    pmu_lookup_table     │                      │
> - │ │ │ │ Entry 0x85  │   │                         │                      │
> - │ │ │ │ FWSEC_PROD  │   │                         │                      │
> - │ │ │ └─────────────┘   │                         │                      │
> - │ │ └───────────────────┘                         │                      │
> - │ │         │                                     │                      │
> - │ │         │ points to                           │                      │
> - │ │         V                                     │                      │
> - │ │ ┌───────────────────┐                         │                      │
> - │ │ │ FalconUCodeDescV3 │ <- falcon_ucode_offset  │                      │
> - │ │ │ (FWSEC Firmware)  │    fwsec_header()       │                      │
> - │ │ └───────────────────┘                         │                      │
> - │ │         │   immediately followed  by...       │                      │
> - │ │         V                                     │                      │
> - │ │ ┌────────────────────────────┐                │                      │
> - │ │ │ Signatures + FWSEC Ucode   │                │                      │
> - │ │ │ fwsec_sigs(), fwsec_ucode()│                │                      │
> - │ │ └────────────────────────────┘                │                      │
> - │ └───────────────────────────────────────────────┘______________________│
> + ┌------------------------------------------------------------------------┐
> + | VBIOS (Starting at ROM_OFFSET: 0x300000)                               |
> + ├------------------------------------------------------------------------┤
> + | ┌-----------------------------------------------┐                      |
> + | | PciAt Image (Type 0x00)                       |                      |
> + | ├-----------------------------------------------┤                      |
> + | | ┌-------------------┐                         |                      |
> + | | | ROM Header        |                         |                      |
> + | | | (Signature 0xAA55)|                         |                      |
> + | | └-------------------┘                         |                      |
> + | |         | rom header's pci_data_struct_offset |                      |
> + | |         | points to the PCIR structure        |                      |
> + | |         V                                     |                      |
> + | | ┌-------------------┐                         |                      |
> + | | | PCIR Structure    |                         |                      |
> + | | | (Signature "PCIR")|                         |                      |
> + | | | last_image: 0x80  |                         |                      |
> + | | | image_len: size   |                         |                      |
> + | | | in 512-byte units |                         |                      |
> + | | └-------------------┘                         |                      |
> + | |         |                                     |                      |
> + | |         | NPDE immediately follows PCIR       |                      |
> + | |         V                                     |                      |
> + | | ┌-------------------┐                         |                      |
> + | | | NPDE Structure    |                         |                      |
> + | | | (Signature "NPDE")|                         |                      |
> + | | | last_image: 0x00  |                         |                      |
> + | | └-------------------┘                         |                      |
> + | |                                               |                      |
> + | | ┌-------------------┐                         |                      |
> + | | | BIT Header        | (Signature scanning     |                      |
> + | | | (Signature "BIT") |  provides the location  |                      |
> + | | └-------------------┘  of the BIT table)      |                      |
> + | |         | header is                           |                      |
> + | |         | followed by a table of tokens       |                      |
> + | |         V one of which is for falcon data.    |                      |
> + | | ┌-------------------┐                         |                      |
> + | | | BIT Tokens        |                         |                      |
> + | | | ┌-------------┐   |                         |                      |
> + | | | | Falcon Data |   |                         |                      |
> + | | | | Token (0x70)|---+------------>------------┼--+                   |
> + | | | └-------------┘   |  falcon_data_ptr()      |  |                   |
> + | | └-------------------┘                         |  V                   |
> + | └-----------------------------------------------┘  |                   |
> + |              (no gap between images)               |                   |
> + | ┌-----------------------------------------------┐  |                   |
> + | | EFI Image (Type 0x03)                         |  |                   |
> + | ├-----------------------------------------------┤  |                   |
> + | | Contains the UEFI GOP driver (Graphics Output)|  |                   |
> + | | ┌-------------------┐                         |  |                   |
> + | | | ROM Header        |                         |  |                   |
> + | | +-------------------+                         |  |                   |
> + | | | PCIR Structure    |                         |  |                   |
> + | | +-------------------+                         |  |                   |
> + | | | NPDE Structure    |                         |  |                   |
> + | | └-------------------┘                         |  |                   |
> + | | | Image data        |                         |  |                   |
> + | | └-------------------┘                         |  |                   |
> + | └-----------------------------------------------┘  |                   |
> + |              (no gap between images)               |                   |
> + | ┌-----------------------------------------------┐  |                   |
> + | | First FwSec Image (Type 0xE0)                 |  |                   |
> + | ├-----------------------------------------------┤  |                   |
> + | | ┌-------------------┐                         |  |                   |
> + | | | ROM Header        |                         |  |                   |
> + | | +-------------------+                         |  |                   |
> + | | | PCIR Structure    |                         |  |                   |
> + | | +-------------------+                         |  |                   |
> + | | | NPDE Structure    |                         |  |                   |
> + | | └-------------------┘                         |  |                   |
> + | | | Image data        |                         |  |                   |
> + | | └-------------------┘                         |  |                   |
> + | └-----------------------------------------------┘  |                   |
> + |              (no gap between images)               |                   |
> + | ┌-----------------------------------------------┐  |                   |
> + | | Second FwSec Image (Type 0xE0)                |  |                   |
> + | ├-----------------------------------------------┤  |                   |
> + | | ┌-------------------┐                         |  |                   |
> + | | | ROM Header        |                         |  |                   |
> + | | +-------------------+                         |  |                   |
> + | | | PCIR Structure    |                         |  |                   |
> + | | +-------------------+                         |  |                   |
> + | | | NPDE Structure    |                         |  |                   |
> + | | └-------------------┘                         |  |                   |
> + | |                                               |  |                   |
> + | | ┌-------------------┐                         |  |                   |
> + | | | PMU Lookup Table  | <- falcon_data_offset   |<-┘                   |
> + | | | ┌-------------┐   |    pmu_lookup_table     |                      |
> + | | | | Entry 0x85  |   |                         |                      |
> + | | | | FWSEC_PROD  |   |                         |                      |
> + | | | └-------------┘   |                         |                      |
> + | | └-------------------┘                         |                      |
> + | |         |                                     |                      |
> + | |         | points to                           |                      |
> + | |         V                                     |                      |
> + | | ┌-------------------┐                         |                      |
> + | | | FalconUCodeDescV3 | <- falcon_ucode_offset  |                      |
> + | | | (FWSEC Firmware)  |    fwsec_header()       |                      |
> + | | └-------------------┘                         |                      |
> + | |         |   immediately followed  by...       |                      |
> + | |         V                                     |                      |
> + | | ┌----------------------------┐                |                      |
> + | | | Signatures + FWSEC Ucode   |                |                      |
> + | | | fwsec_sigs(), fwsec_ucode()|                |                      |
> + | | └----------------------------┘                |                      |
> + | └-----------------------------------------------┘                      |
> + └------------------------------------------------------------------------┘
>   

Addendum: I'm using Roboto Mono on my htmldocs build (using custom style 
sheet). The diagram looks fine with default Alabaster font stack 
(Consolas). If you disagree you can ignore above diff.

Thanks.

-- 
An old man doll... just what I always wanted! - Clara

  reply	other threads:[~2025-05-05  3:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-03  4:07 [PATCH v2 0/7] Documentation for nova-core Joel Fernandes
2025-05-03  4:07 ` [PATCH v2 1/7] nova-core: doc: Add code comments related to devinit Joel Fernandes
2025-05-03  4:07 ` [PATCH v2 2/7] nova-core: doc: Clarify sysmembar operations Joel Fernandes
2025-05-03  4:07 ` [PATCH v2 3/7] nova-core: docs: Document vbios layout Joel Fernandes
2025-05-05  3:00   ` Bagas Sanjaya
2025-05-05  3:12     ` Bagas Sanjaya [this message]
2025-05-03  4:07 ` [PATCH v2 4/7] nova-core: docs: Document fwsec operation and layout Joel Fernandes
2025-05-05  3:52   ` Bagas Sanjaya
2025-05-06 16:26   ` Zhi Wang
2025-05-09 20:56     ` Joel Fernandes
2025-05-03  4:07 ` [PATCH v2 5/7] docs: nova-core: Document devinit process Joel Fernandes
2025-05-05  4:04   ` Bagas Sanjaya
2025-05-05 22:15     ` Joel Fernandes
2025-05-03  4:07 ` [PATCH v2 6/7] docs: nova-core: Document basics of the Falcon Joel Fernandes
2025-05-05  4:14   ` Bagas Sanjaya
2025-05-05 21:37     ` Joel Fernandes
2025-05-03  4:07 ` [PATCH v2 7/7] gpu: nova-core: Clarify falcon code Joel Fernandes
2025-05-06 16:21   ` Zhi Wang
2025-05-09 20:59     ` Joel Fernandes
2025-06-30 10:37 ` [PATCH v2 0/7] Documentation for nova-core Danilo Krummrich
2025-06-30 11:33   ` Alexandre Courbot

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=2b9baf30-53ae-4653-8043-afbc2e396107@gmail.com \
    --to=bagasdotme@gmail.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=joelagnelf@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=rust-for-linux@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).