1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 
24 //
25 // This file holds GPU firmware related registry key definitions that are
26 // shared between Windows and Unix
27 //
28 
29 #ifndef NV_FIRMWARE_REGISTRY_H
30 #define NV_FIRMWARE_REGISTRY_H
31 
32 //
33 // Registry key that when enabled, will enable use of GPU firmware.
34 //
35 // Possible mode values:
36 //  0 - Do not enable GPU firmware
37 //  1 - Enable GPU firmware
38 //  2 - (Default) Use the default enablement policy for GPU firmware
39 //
40 // Setting this to anything other than 2 will alter driver firmware-
41 // enablement policies, possibly disabling GPU firmware where it would
42 // have otherwise been enabled by default.
43 //
44 // Policy bits:
45 //
46 // POLICY_ALLOW_FALLBACK:
47 //  As the normal behavior is to fail GPU initialization if this registry
48 //  entry is set in such a way that results in an invalid configuration, if
49 //  instead the user would like the driver to automatically try to fallback
50 //  to initializing the failing GPU with firmware disabled, then this bit can
51 //  be set (ex: 0x11 means try to enable GPU firmware but fall back if needed).
52 //  Note that this can result in a mixed mode configuration (ex: GPU0 has
53 //  firmware enabled, but GPU1 does not).
54 //
55 #define NV_REG_STR_ENABLE_GPU_FIRMWARE                   "EnableGpuFirmware"
56 
57 #define NV_REG_ENABLE_GPU_FIRMWARE_MODE_MASK              0x0000000F
58 #define NV_REG_ENABLE_GPU_FIRMWARE_MODE_DISABLED          0x00000000
59 #define NV_REG_ENABLE_GPU_FIRMWARE_MODE_ENABLED           0x00000001
60 #define NV_REG_ENABLE_GPU_FIRMWARE_MODE_DEFAULT           0x00000002
61 
62 #define NV_REG_ENABLE_GPU_FIRMWARE_POLICY_MASK            0x000000F0
63 #define NV_REG_ENABLE_GPU_FIRMWARE_POLICY_ALLOW_FALLBACK  0x00000010
64 
65 #define NV_REG_ENABLE_GPU_FIRMWARE_DEFAULT_VALUE          0x00000012
66 
67 //
68 // Registry key that when enabled,  will send GPU firmware logs
69 // to the system log, when possible.
70 //
71 // Possible values:
72 //  0 - Do not send GPU firmware logs to the system log
73 //  1 - Enable sending of GPU firmware logs to the system log
74 //  2 - (Default) Enable sending of GPU firmware logs to the system log for
75 //      the debug kernel driver build only
76 //
77 #define NV_REG_STR_ENABLE_GPU_FIRMWARE_LOGS                "EnableGpuFirmwareLogs"
78 
79 #define NV_REG_ENABLE_GPU_FIRMWARE_LOGS_DISABLE            0x00000000
80 #define NV_REG_ENABLE_GPU_FIRMWARE_LOGS_ENABLE             0x00000001
81 #define NV_REG_ENABLE_GPU_FIRMWARE_LOGS_ENABLE_ON_DEBUG    0x00000002
82 
83 #endif  // NV_FIRMWARE_REGISTRY_H
84