diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2023-06-28 18:24:25 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2023-06-28 18:24:25 -0400 |
| commit | 01e6fac4d61fdd7fff5433942ec93fc2ea1e4df1 (patch) | |
| tree | 4ef34501728a087be24f4ba0af90f91486bf780b /include/nvgpu/acr/acr_lsfm.h | |
| parent | 306a03d18b305e4e573be3b2931978fa10679eb9 (diff) | |
Include nvgpu headers
These are needed to build on NVIDIA's Jetson boards for the time
being. Only a couple structs are required, so it should be fairly
easy to remove this dependency at some point in the future.
Diffstat (limited to 'include/nvgpu/acr/acr_lsfm.h')
| -rw-r--r-- | include/nvgpu/acr/acr_lsfm.h | 328 |
1 files changed, 328 insertions, 0 deletions
diff --git a/include/nvgpu/acr/acr_lsfm.h b/include/nvgpu/acr/acr_lsfm.h new file mode 100644 index 0000000..ed58552 --- /dev/null +++ b/include/nvgpu/acr/acr_lsfm.h | |||
| @@ -0,0 +1,328 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. | ||
| 3 | * | ||
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 5 | * copy of this software and associated documentation files (the "Software"), | ||
| 6 | * to deal in the Software without restriction, including without limitation | ||
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 9 | * Software is furnished to do so, subject to the following conditions: | ||
| 10 | * | ||
| 11 | * The above copyright notice and this permission notice shall be included in | ||
| 12 | * all copies or substantial portions of the Software. | ||
| 13 | * | ||
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 20 | * DEALINGS IN THE SOFTWARE. | ||
| 21 | */ | ||
| 22 | #ifndef NVGPU_ACR_LSFM_H | ||
| 23 | #define NVGPU_ACR_LSFM_H | ||
| 24 | |||
| 25 | #ifndef NVGPU_ACR_H | ||
| 26 | #warning "acr_lsfm.h not included from nvgpu_acr.h!" \ | ||
| 27 | "Include nvgpu_acr.h instead of acr_xxx.h to get access to ACR interfaces" | ||
| 28 | #endif | ||
| 29 | |||
| 30 | /* | ||
| 31 | * READ/WRITE masks for WPR region | ||
| 32 | */ | ||
| 33 | /* Readable only from level 2 and 3 client */ | ||
| 34 | #define LSF_WPR_REGION_RMASK (0xC) | ||
| 35 | /* Writable only from level 2 and 3 client */ | ||
| 36 | #define LSF_WPR_REGION_WMASK (0xC) | ||
| 37 | /* Readable only from level 3 client */ | ||
| 38 | #define LSF_WPR_REGION_RMASK_SUB_WPR_ENABLED (0x8) | ||
| 39 | /* Writable only from level 3 client */ | ||
| 40 | #define LSF_WPR_REGION_WMASK_SUB_WPR_ENABLED (0x8) | ||
| 41 | /* Disallow read mis-match for all clients */ | ||
| 42 | #define LSF_WPR_REGION_ALLOW_READ_MISMATCH_NO (0x0) | ||
| 43 | /* Disallow write mis-match for all clients */ | ||
| 44 | #define LSF_WPR_REGION_ALLOW_WRITE_MISMATCH_NO (0x0) | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Falcon Id Defines | ||
| 48 | * Defines a common Light Secure Falcon identifier. | ||
| 49 | */ | ||
| 50 | #define LSF_FALCON_ID_PMU (0) | ||
| 51 | #define LSF_FALCON_ID_GSPLITE (1) | ||
| 52 | #define LSF_FALCON_ID_FECS (2) | ||
| 53 | #define LSF_FALCON_ID_GPCCS (3) | ||
| 54 | #define LSF_FALCON_ID_SEC2 (7) | ||
| 55 | #define LSF_FALCON_ID_END (11) | ||
| 56 | #define LSF_FALCON_ID_INVALID (0xFFFFFFFF) | ||
| 57 | |||
| 58 | /* | ||
| 59 | * Light Secure Falcon Ucode Description Defines | ||
| 60 | * This structure is prelim and may change as the ucode signing flow evolves. | ||
| 61 | */ | ||
| 62 | struct lsf_ucode_desc { | ||
| 63 | u8 prd_keys[2][16]; | ||
| 64 | u8 dbg_keys[2][16]; | ||
| 65 | u32 b_prd_present; | ||
| 66 | u32 b_dbg_present; | ||
| 67 | u32 falcon_id; | ||
| 68 | }; | ||
| 69 | |||
| 70 | struct lsf_ucode_desc_v1 { | ||
| 71 | u8 prd_keys[2][16]; | ||
| 72 | u8 dbg_keys[2][16]; | ||
| 73 | u32 b_prd_present; | ||
| 74 | u32 b_dbg_present; | ||
| 75 | u32 falcon_id; | ||
| 76 | u32 bsupports_versioning; | ||
| 77 | u32 version; | ||
| 78 | u32 dep_map_count; | ||
| 79 | u8 dep_map[LSF_FALCON_ID_END * 2 * 4]; | ||
| 80 | u8 kdf[16]; | ||
| 81 | }; | ||
| 82 | |||
| 83 | /* | ||
| 84 | * Light Secure WPR Header | ||
| 85 | * Defines state allowing Light Secure Falcon bootstrapping. | ||
| 86 | */ | ||
| 87 | struct lsf_wpr_header { | ||
| 88 | u32 falcon_id; | ||
| 89 | u32 lsb_offset; | ||
| 90 | u32 bootstrap_owner; | ||
| 91 | u32 lazy_bootstrap; | ||
| 92 | u32 status; | ||
| 93 | }; | ||
| 94 | |||
| 95 | struct lsf_wpr_header_v1 { | ||
| 96 | u32 falcon_id; | ||
| 97 | u32 lsb_offset; | ||
| 98 | u32 bootstrap_owner; | ||
| 99 | u32 lazy_bootstrap; | ||
| 100 | u32 bin_version; | ||
| 101 | u32 status; | ||
| 102 | }; | ||
| 103 | |||
| 104 | |||
| 105 | /* | ||
| 106 | * LSF shared SubWpr Header | ||
| 107 | * | ||
| 108 | * use_case_id - Shared SubWpr use case ID (updated by nvgpu) | ||
| 109 | * start_addr - start address of subWpr (updated by nvgpu) | ||
| 110 | * size_4K - size of subWpr in 4K (updated by nvgpu) | ||
| 111 | */ | ||
| 112 | struct lsf_shared_sub_wpr_header { | ||
| 113 | u32 use_case_id; | ||
| 114 | u32 start_addr; | ||
| 115 | u32 size_4K; | ||
| 116 | }; | ||
| 117 | |||
| 118 | /* shared sub_wpr use case IDs */ | ||
| 119 | enum { | ||
| 120 | LSF_SHARED_DATA_SUB_WPR_USE_CASE_ID_FRTS_VBIOS_TABLES = 1, | ||
| 121 | LSF_SHARED_DATA_SUB_WPR_USE_CASE_ID_PLAYREADY_SHARED_DATA = 2 | ||
| 122 | }; | ||
| 123 | |||
| 124 | #define LSF_SHARED_DATA_SUB_WPR_USE_CASE_ID_MAX \ | ||
| 125 | LSF_SHARED_DATA_SUB_WPR_USE_CASE_ID_PLAYREADY_SHARED_DATA | ||
| 126 | |||
| 127 | #define LSF_SHARED_DATA_SUB_WPR_USE_CASE_ID_INVALID (0xFFFFFFFF) | ||
| 128 | |||
| 129 | #define MAX_SUPPORTED_SHARED_SUB_WPR_USE_CASES \ | ||
| 130 | LSF_SHARED_DATA_SUB_WPR_USE_CASE_ID_MAX | ||
| 131 | |||
| 132 | /* Static sizes of shared subWPRs */ | ||
| 133 | /* Minimum granularity supported is 4K */ | ||
| 134 | /* 1MB in 4K */ | ||
| 135 | #define LSF_SHARED_DATA_SUB_WPR_FRTS_VBIOS_TABLES_SIZE_IN_4K (0x100) | ||
| 136 | /* 4K */ | ||
| 137 | #define LSF_SHARED_DATA_SUB_WPR_PLAYREADY_SHARED_DATA_SIZE_IN_4K (0x1) | ||
| 138 | |||
| 139 | /* | ||
| 140 | * Bootstrap Owner Defines | ||
| 141 | */ | ||
| 142 | #define LSF_BOOTSTRAP_OWNER_DEFAULT (LSF_FALCON_ID_PMU) | ||
| 143 | |||
| 144 | /* | ||
| 145 | * Image Status Defines | ||
| 146 | */ | ||
| 147 | #define LSF_IMAGE_STATUS_NONE (0) | ||
| 148 | #define LSF_IMAGE_STATUS_COPY (1) | ||
| 149 | #define LSF_IMAGE_STATUS_VALIDATION_CODE_FAILED (2) | ||
| 150 | #define LSF_IMAGE_STATUS_VALIDATION_DATA_FAILED (3) | ||
| 151 | #define LSF_IMAGE_STATUS_VALIDATION_DONE (4) | ||
| 152 | #define LSF_IMAGE_STATUS_VALIDATION_SKIPPED (5) | ||
| 153 | #define LSF_IMAGE_STATUS_BOOTSTRAP_READY (6) | ||
| 154 | |||
| 155 | /*Light Secure Bootstrap header related defines*/ | ||
| 156 | #define NV_FLCN_ACR_LSF_FLAG_LOAD_CODE_AT_0_FALSE 0 | ||
| 157 | #define NV_FLCN_ACR_LSF_FLAG_LOAD_CODE_AT_0_TRUE 1 | ||
| 158 | #define NV_FLCN_ACR_LSF_FLAG_DMACTL_REQ_CTX_FALSE 0 | ||
| 159 | #define NV_FLCN_ACR_LSF_FLAG_DMACTL_REQ_CTX_TRUE 4 | ||
| 160 | #define NV_FLCN_ACR_LSF_FLAG_FORCE_PRIV_LOAD_TRUE 8 | ||
| 161 | #define NV_FLCN_ACR_LSF_FLAG_FORCE_PRIV_LOAD_FALSE 0 | ||
| 162 | |||
| 163 | /* | ||
| 164 | * Light Secure Bootstrap Header | ||
| 165 | * Defines state allowing Light Secure Falcon bootstrapping. | ||
| 166 | */ | ||
| 167 | struct lsf_lsb_header { | ||
| 168 | struct lsf_ucode_desc signature; | ||
| 169 | u32 ucode_off; | ||
| 170 | u32 ucode_size; | ||
| 171 | u32 data_size; | ||
| 172 | u32 bl_code_size; | ||
| 173 | u32 bl_imem_off; | ||
| 174 | u32 bl_data_off; | ||
| 175 | u32 bl_data_size; | ||
| 176 | u32 app_code_off; | ||
| 177 | u32 app_code_size; | ||
| 178 | u32 app_data_off; | ||
| 179 | u32 app_data_size; | ||
| 180 | u32 flags; | ||
| 181 | }; | ||
| 182 | |||
| 183 | struct lsf_lsb_header_v1 { | ||
| 184 | struct lsf_ucode_desc_v1 signature; | ||
| 185 | u32 ucode_off; | ||
| 186 | u32 ucode_size; | ||
| 187 | u32 data_size; | ||
| 188 | u32 bl_code_size; | ||
| 189 | u32 bl_imem_off; | ||
| 190 | u32 bl_data_off; | ||
| 191 | u32 bl_data_size; | ||
| 192 | u32 app_code_off; | ||
| 193 | u32 app_code_size; | ||
| 194 | u32 app_data_off; | ||
| 195 | u32 app_data_size; | ||
| 196 | u32 flags; | ||
| 197 | }; | ||
| 198 | |||
| 199 | /* | ||
| 200 | * Light Secure WPR Content Alignments | ||
| 201 | */ | ||
| 202 | #define LSF_WPR_HEADER_ALIGNMENT (256U) | ||
| 203 | #define LSF_SUB_WPR_HEADER_ALIGNMENT (256U) | ||
| 204 | #define LSF_LSB_HEADER_ALIGNMENT (256U) | ||
| 205 | #define LSF_BL_DATA_ALIGNMENT (256U) | ||
| 206 | #define LSF_BL_DATA_SIZE_ALIGNMENT (256U) | ||
| 207 | #define LSF_BL_CODE_SIZE_ALIGNMENT (256U) | ||
| 208 | #define LSF_DATA_SIZE_ALIGNMENT (256U) | ||
| 209 | #define LSF_CODE_SIZE_ALIGNMENT (256U) | ||
| 210 | |||
| 211 | /* MMU excepts sub_wpr sizes in units of 4K */ | ||
| 212 | #define SUB_WPR_SIZE_ALIGNMENT (4096U) | ||
| 213 | |||
| 214 | /* | ||
| 215 | * Maximum WPR Header size | ||
| 216 | */ | ||
| 217 | #define LSF_WPR_HEADERS_TOTAL_SIZE_MAX \ | ||
