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__ 3 4 /* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.113.01 */ 5 6 /* 7 * SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 8 * SPDX-License-Identifier: MIT 9 * 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: 16 * 17 * The above copyright notice and this permission notice shall be included in 18 * all copies or substantial portions of the Software. 19 * 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. 27 */ 28 29 typedef struct 30 { 31 // Magic 32 // BL to use for verification (i.e. Booter locked it in WPR2) 33 NvU64 magic; // = 0xdc3aae21371a60b3; 34 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; 39 40 // ---- Members regarding data in SYSMEM ---------------------------- 41 // Consumed by Booter for DMA 42 43 NvU64 sysmemAddrOfRadix3Elf; 44 NvU64 sizeOfRadix3Elf; 45 46 NvU64 sysmemAddrOfBootloader; 47 NvU64 sizeOfBootloader; 48 49 // Offsets inside bootloader image needed by Booter 50 NvU64 bootloaderCodeOffset; 51 NvU64 bootloaderDataOffset; 52 NvU64 bootloaderManifestOffset; 53 54 union 55 { 56 // Used only at initial boot 57 struct 58 { 59 NvU64 sysmemAddrOfSignature; 60 NvU64 sizeOfSignature; 61 }; 62 63 // 64 // Used at suspend/resume to read GspFwHeapFreeList 65 // Offset relative to GspFwWprMeta FBMEM PA (gspFwWprStart) 66 // 67 struct 68 { 69 NvU32 gspFwHeapFreeListWprOffset; 70 NvU32 unused0; 71 NvU64 unused1; 72 }; 73 }; 74 75 // ---- Members describing FB layout -------------------------------- 76 NvU64 gspFwRsvdStart; 77 78 NvU64 nonWprHeapOffset; 79 NvU64 nonWprHeapSize; 80 81 NvU64 gspFwWprStart; 82 83 // GSP-RM to use to setup heap. 84 NvU64 gspFwHeapOffset; 85 NvU64 gspFwHeapSize; 86 87 // BL to use to find ELF for jump 88 NvU64 gspFwOffset; 89 // Size is sizeOfRadix3Elf above. 90 91 NvU64 bootBinOffset; 92 // Size is sizeOfBootloader above. 93 94 NvU64 frtsOffset; 95 NvU64 frtsSize; 96 97 NvU64 gspFwWprEnd; 98 99 // GSP-RM to use for fbRegionInfo? 100 NvU64 fbSize; 101 102 // ---- Other members ----------------------------------------------- 103 104 // GSP-RM to use for fbRegionInfo? 105 NvU64 vgaWorkspaceOffset; 106 NvU64 vgaWorkspaceSize; 107 108 // Boot count. Used to determine whether to load the firmware image. 109 NvU64 bootCount; 110 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. 117 118 union 119 { 120 struct 121 { 122 // Shared partition RPC memory (physical address) 123 NvU64 partitionRpcAddr; 124 125 // Offsets relative to partitionRpcAddr 126 NvU16 partitionRpcRequestOffset; 127 NvU16 partitionRpcReplyOffset; 128 129 // Code section and dataSection offset and size. 130 NvU32 elfCodeOffset; 131 NvU32 elfDataOffset; 132 NvU32 elfCodeSize; 133 NvU32 elfDataSize; 134 135 // Used during GSP-RM resume to check for revocation 136 NvU32 lsUcodeVersion; 137 }; 138 139 struct 140 { 141 // Pad for the partitionRpc* fields, plus 4 bytes 142 NvU32 partitionRpcPadding[4]; 143 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; 149 150 // Pad for the lsUcodeVersion field 151 NvU32 lsUcodeVersionPadding[1]; 152 }; 153 }; 154 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; 158 159 // Pad structure to exactly 256 bytes. Can replace padding with additional 160 // fields without incrementing revision. Padding initialized to 0. 161 NvU8 padding[7]; 162 163 // BL to use for verification (i.e. Booter says OK to boot) 164 NvU64 verified; // 0x0 -> unverified, 0xa0a0a0a0a0a0a0a0 -> verified 165 } GspFwWprMeta; 166 167 #define GSP_FW_WPR_META_REVISION 1 168 #define GSP_FW_WPR_META_MAGIC 0xdc3aae21371a60b3ULL 169 170 #endif 171