OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2008-2009 NVIDIA Corporation. |
| 3 * All rights reserved. |
| 4 * |
| 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: |
| 7 * |
| 8 * Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. |
| 10 * |
| 11 * Redistributions in binary form must reproduce the above copyright notice, |
| 12 * this list of conditions and the following disclaimer in the documentation |
| 13 * and/or other materials provided with the distribution. |
| 14 * |
| 15 * Neither the name of the NVIDIA Corporation nor the names of its contributors |
| 16 * may be used to endorse or promote products derived from this software |
| 17 * without specific prior written permission. |
| 18 * |
| 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 * POSSIBILITY OF SUCH DAMAGE. |
| 30 * |
| 31 */ |
| 32 |
| 33 #ifndef INCLUDED_NVBOOTARGS_H |
| 34 #define INCLUDED_NVBOOTARGS_H |
| 35 |
| 36 /** |
| 37 * This defines the basic bootarg structure and keys for use with |
| 38 * NvOsBootArgGet and NvOsBootArgSet. |
| 39 */ |
| 40 |
| 41 #include "nvcommon.h" |
| 42 |
| 43 /** |
| 44 * The maximum number of memory handles that may be preserved across the |
| 45 * bootloader-to-OS transition. @see NvRmBootArg_PreservedMemHandle. |
| 46 */ |
| 47 #define NV_BOOTARGS_MAX_PRESERVED_MEMHANDLES 3 |
| 48 |
| 49 #if defined(__cplusplus) |
| 50 extern "C" |
| 51 { |
| 52 #endif |
| 53 |
| 54 /* accessor for various boot arg classes, see NvOsBootArg* */ |
| 55 typedef enum |
| 56 { |
| 57 NvBootArgKey_Rm = 0x1, |
| 58 NvBootArgKey_Display, |
| 59 NvBootArgKey_Framebuffer, |
| 60 NvBootArgKey_ChipShmoo, |
| 61 NvBootArgKey_ChipShmooPhys, |
| 62 NvBootArgKey_Carveout, |
| 63 NvBootArgKey_WarmBoot, |
| 64 NvBootArgKey_PreservedMemHandle_0 = 0x10000, |
| 65 NvBootArgKey_PreservedMemHandle_Num = (NvBootArgKey_PreservedMemHandle_0 + |
| 66 NV_BOOTARGS_MAX_PRESERVED_MEMHANDLES), |
| 67 NvBootArgKey_Force32 = 0x7FFFFFFF, |
| 68 } NvBootArgKey; |
| 69 |
| 70 /** |
| 71 * Resource Manager boot args. |
| 72 * |
| 73 * Nothing here yet. |
| 74 */ |
| 75 typedef struct NvBootArgsRmRec |
| 76 { |
| 77 NvU32 reserved; |
| 78 } NvBootArgsRm; |
| 79 |
| 80 /** |
| 81 * Carveout boot args, which define the physical memory location of the GPU |
| 82 * carved-out memory region(s). |
| 83 */ |
| 84 typedef struct NvBootArgsCarveoutRec |
| 85 { |
| 86 NvUPtr base; |
| 87 NvU32 size; |
| 88 } NvBootArgsCarveout; |
| 89 |
| 90 /** |
| 91 * Warmbootloader boot args. This structure only contains |
| 92 * a mem handle key to preserve the warm bootloader |
| 93 * across the bootloader->os transition |
| 94 */ |
| 95 typedef struct NvBootArgsWarmbootRec |
| 96 { |
| 97 NvU32 MemHandleKey; |
| 98 } NvBootArgsWarmboot; |
| 99 |
| 100 /** |
| 101 * PreservedMemHandle boot args, indexed by PreservedMemHandle_0 + n. |
| 102 * All values n from 0 to the first value which does not return NvSuccess will |
| 103 * be quered at RM initialization in the OS environment. If present, a new |
| 104 * memory handle for the physical region specified will be created. |
| 105 * This allows physical memory allocations (e.g., for framebuffers) to persist |
| 106 * between the bootloader and operating system. Only carveout and IRAM |
| 107 * allocations may be preserved with this interface. |
| 108 */ |
| 109 typedef struct NvBootArgsPreservedMemHandleRec |
| 110 { |
| 111 NvUPtr Address; |
| 112 NvU32 Size; |
| 113 } NvBootArgsPreservedMemHandle; |
| 114 |
| 115 |
| 116 /** |
| 117 * Display boot args, indexed by NvBootArgKey_Display. |
| 118 * |
| 119 * The bootloader may have a splash screen. This will flag which controller |
| 120 * and device was used for the splash screen so the device will not be |
| 121 * reinitialized (which causes visual artifacts). |
| 122 */ |
| 123 typedef struct NvBootArgsDisplayRec |
| 124 { |
| 125 /* which controller is initialized */ |
| 126 NvU32 Controller; |
| 127 |
| 128 /* index into the ODM device list of the boot display device */ |
| 129 NvU32 DisplayDeviceIndex; |
| 130 |
| 131 /* set to NV_TRUE if the display has been initialized */ |
| 132 NvBool bEnabled; |
| 133 } NvBootArgsDisplay; |
| 134 |
| 135 /** |
| 136 * Framebuffer boot args, indexed by NvBootArgKey_Framebuffer |
| 137 * |
| 138 * A framebuffer may be shared between the bootloader and the |
| 139 * operating system display driver. When this key is present, |
| 140 * a preserved memory handle for the framebuffer must also |
| 141 * be present, to ensure that no display corruption occurs |
| 142 * during the transition. |
| 143 */ |
| 144 typedef struct NvBootArgsFramebufferRec |
| 145 { |
| 146 /* The key used for accessing the preserved memory handle */ |
| 147 NvU32 MemHandleKey; |
| 148 /* Total memory size of the framebuffer */ |
| 149 NvU32 Size; |
| 150 /* Color format of the framebuffer, cast to a U32 */ |
| 151 NvU32 ColorFormat; |
| 152 /* Width of the framebuffer, in pixels */ |
| 153 NvU16 Width; |
| 154 /* Height of each surface in the framebuffer, in pixels */ |
| 155 NvU16 Height; |
| 156 /* Pitch of a framebuffer scanline, in bytes */ |
| 157 NvU16 Pitch; |
| 158 /* Surface layout of the framebuffer, cast to a U8 */ |
| 159 NvU8 SurfaceLayout; |
| 160 /* Number of contiguous surfaces of the same height in the |
| 161 * framebuffer, if multi-buffering. Each surface is |
| 162 * assumed to begin at Pitch * Height bytes from the |
| 163 * previous surface. */ |
| 164 NvU8 NumSurfaces; |
| 165 } NvBootArgsFramebuffer; |
| 166 |
| 167 /** |
| 168 * Chip chatcterization shmoo data indexed by NvBootArgKey_ChipShmoo |
| 169 */ |
| 170 typedef struct NvBootArgsChipShmooRec |
| 171 { |
| 172 // The key used for accessing the preserved memory handle of packed |
| 173 // charcterization tables |
| 174 NvU32 MemHandleKey; |
| 175 |
| 176 // Offset and size of each unit in the packed buffer |
| 177 NvU32 CoreShmooVoltagesListOffset; |
| 178 NvU32 CoreShmooVoltagesListSize; |
| 179 |
| 180 NvU32 CoreScaledLimitsListOffset; |
| 181 NvU32 CoreScaledLimitsListSize; |
| 182 |
| 183 NvU32 OscDoublerListOffset; |
| 184 NvU32 OscDoublerListSize; |
| 185 |
| 186 NvU32 SKUedLimitsOffset; |
| 187 NvU32 SKUedLimitsSize; |
| 188 |
| 189 NvU32 CpuShmooVoltagesListOffset; |
| 190 NvU32 CpuShmooVoltagesListSize; |
| 191 |
| 192 NvU32 CpuScaledLimitsOffset; |
| 193 NvU32 CpuScaledLimitsSize; |
| 194 |
| 195 // Misc charcterization settings |
| 196 NvU16 CoreCorner; |
| 197 NvU16 CpuCorner; |
| 198 NvU32 Dqsib; |
| 199 NvU32 SvopLowVoltage; |
| 200 NvU32 SvopLowSetting; |
| 201 NvU32 SvopHighSetting; |
| 202 } NvBootArgsChipShmoo; |
| 203 |
| 204 /** |
| 205 * Chip chatcterization shmoo data indexed by NvBootArgKey_ChipShmooPhys |
| 206 */ |
| 207 typedef struct NvBootArgsChipShmooPhysRec |
| 208 { |
| 209 NvU32 PhysShmooPtr; |
| 210 NvU32 Size; |
| 211 } NvBootArgsChipShmooPhys; |
| 212 |
| 213 #define NVBOOTARG_NUM_PRESERVED_HANDLES (NvBootArgKey_PreservedMemHandle_Num - \ |
| 214 NvBootArgKey_PreservedMemHandle_0) |
| 215 |
| 216 /** |
| 217 * OS-agnostic bootarg structure. |
| 218 */ |
| 219 typedef struct NvBootArgsRec |
| 220 { |
| 221 NvBootArgsRm RmArgs; |
| 222 NvBootArgsDisplay DisplayArgs; |
| 223 NvBootArgsFramebuffer FramebufferArgs; |
| 224 NvBootArgsChipShmoo ChipShmooArgs; |
| 225 NvBootArgsChipShmooPhys ChipShmooPhysArgs; |
| 226 NvBootArgsWarmboot WarmbootArgs; |
| 227 NvBootArgsPreservedMemHandle MemHandleArgs[NVBOOTARG_NUM_PRESERVED_HANDLES]; |
| 228 } NvBootArgs; |
| 229 |
| 230 #if defined(__cplusplus) |
| 231 } |
| 232 #endif |
| 233 |
| 234 #endif // INCLUDED_NVBOOTARGS_H |
OLD | NEW |