1 #ifndef __src_nvidia_arch_nvalloc_common_inc_gsp_gsp_fw_wpr_meta_h__
2 #define __src_nvidia_arch_nvalloc_common_inc_gsp_gsp_fw_wpr_meta_h__
4 /* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.113.01 */
7 * SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
8 * SPDX-License-Identifier: MIT
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included in
18 * all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
32 // BL to use for verification (i.e. Booter locked it in WPR2)
33 NvU64 magic; // = 0xdc3aae21371a60b3;
35 // Revision number of Booter-BL-Sequencer handoff interface
36 // Bumped up when we change this interface so it is not backward compatible.
37 // Bumped up when we revoke GSP-RM ucode
38 NvU64 revision; // = 1;
40 // ---- Members regarding data in SYSMEM ----------------------------
41 // Consumed by Booter for DMA
43 NvU64 sysmemAddrOfRadix3Elf;
44 NvU64 sizeOfRadix3Elf;
46 NvU64 sysmemAddrOfBootloader;
47 NvU64 sizeOfBootloader;
49 // Offsets inside bootloader image needed by Booter
50 NvU64 bootloaderCodeOffset;
51 NvU64 bootloaderDataOffset;
52 NvU64 bootloaderManifestOffset;
56 // Used only at initial boot
59 NvU64 sysmemAddrOfSignature;
60 NvU64 sizeOfSignature;
64 // Used at suspend/resume to read GspFwHeapFreeList
65 // Offset relative to GspFwWprMeta FBMEM PA (gspFwWprStart)
69 NvU32 gspFwHeapFreeListWprOffset;
75 // ---- Members describing FB layout --------------------------------
78 NvU64 nonWprHeapOffset;
83 // GSP-RM to use to setup heap.
84 NvU64 gspFwHeapOffset;
87 // BL to use to find ELF for jump
89 // Size is sizeOfRadix3Elf above.
92 // Size is sizeOfBootloader above.
99 // GSP-RM to use for fbRegionInfo?
102 // ---- Other members -----------------------------------------------
104 // GSP-RM to use for fbRegionInfo?
105 NvU64 vgaWorkspaceOffset;
106 NvU64 vgaWorkspaceSize;
108 // Boot count. Used to determine whether to load the firmware image.
111 // TODO: the partitionRpc* fields below do not really belong in this
112 // structure. The values are patched in by the partition bootstrapper
113 // when GSP-RM is booted in a partition, and this structure was a
114 // convenient place for the bootstrapper to access them. These should
115 // be moved to a different comm. mechanism between the bootstrapper
116 // and the GSP-RM tasks.
122 // Shared partition RPC memory (physical address)
123 NvU64 partitionRpcAddr;
125 // Offsets relative to partitionRpcAddr
126 NvU16 partitionRpcRequestOffset;
127 NvU16 partitionRpcReplyOffset;
129 // Code section and dataSection offset and size.
135 // Used during GSP-RM resume to check for revocation
136 NvU32 lsUcodeVersion;
141 // Pad for the partitionRpc* fields, plus 4 bytes
142 NvU32 partitionRpcPadding[4];
144 // CrashCat (contiguous) buffer size/location - occupies same bytes as the
145 // elf(Code|Data)(Offset|Size) fields above.
146 // TODO: move to GSP_FMC_INIT_PARAMS
147 NvU64 sysmemAddrOfCrashReportQueue;
148 NvU32 sizeOfCrashReportQueue;
150 // Pad for the lsUcodeVersion field
151 NvU32 lsUcodeVersionPadding[1];
155 // Number of VF partitions allocating sub-heaps from the WPR heap
156 // Used during boot to ensure the heap is adequately sized
157 NvU8 gspFwHeapVfPartitionCount;
159 // Pad structure to exactly 256 bytes. Can replace padding with additional
160 // fields without incrementing revision. Padding initialized to 0.
163 // BL to use for verification (i.e. Booter says OK to boot)
164 NvU64 verified; // 0x0 -> unverified, 0xa0a0a0a0a0a0a0a0 -> verified
167 #define GSP_FW_WPR_META_REVISION 1
168 #define GSP_FW_WPR_META_MAGIC 0xdc3aae21371a60b3ULL