1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-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 #ifndef _INFOROM_LS10_H_
25 #define _INFOROM_LS10_H_
26 
27 NvlStatus nvswitch_inforom_nvl_log_error_event_ls10
28 (
29     nvswitch_device            *device,
30     void                       *pNvlGeneric,
31     void                       *pNvlErrorEvent,
32     NvBool                     *bDirty
33 );
34 
35 NvlStatus nvswitch_inforom_nvl_update_link_correctable_error_info_ls10
36 (
37     nvswitch_device *device,
38     void *pNvlGeneric,
39     void *pData,
40     NvU8 linkId,
41     NvU8 nvliptInstance,
42     NvU8 localLinkIdx,
43     void *pNvlErrorCounts,
44     NvBool *bDirty
45 );
46 
47 NvlStatus
48 nvswitch_inforom_nvl_get_max_correctable_error_rate_ls10
49 (
50     nvswitch_device *device,
51     NVSWITCH_GET_NVLINK_MAX_CORRECTABLE_ERROR_RATES_PARAMS *params
52 );
53 
54 NvlStatus
55 nvswitch_inforom_nvl_get_errors_ls10
56 (
57     nvswitch_device *device,
58     NVSWITCH_GET_NVLINK_ERROR_COUNTS_PARAMS *params
59 );
60 
61 NvlStatus nvswitch_inforom_nvl_setL1Threshold_ls10
62 (
63     nvswitch_device *device,
64     void *pNvlGeneric,
65     NvU32 word1,
66     NvU32 word2
67 );
68 
69 NvlStatus nvswitch_inforom_nvl_getL1Threshold_ls10
70 (
71     nvswitch_device *device,
72     void *pNvlGeneric,
73     NvU32 *word1,
74     NvU32 *word2
75 );
76 
77 NvlStatus nvswitch_inforom_nvl_setup_nvlink_state_ls10
78 (
79     nvswitch_device *device,
80     INFOROM_NVLINK_STATE *pNvlinkState,
81     NvU8 version
82 );
83 
84 void
85 nvswitch_initialize_oms_state_ls10
86 (
87     nvswitch_device *device,
88     INFOROM_OMS_STATE *pOmsState
89 );
90 
91 NvBool
92 nvswitch_oms_get_device_disable_ls10
93 (
94     INFOROM_OMS_STATE *pOmsState
95 );
96 
97 void
98 nvswitch_oms_set_device_disable_ls10
99 (
100     INFOROM_OMS_STATE *pOmsState,
101     NvBool bForceDeviceDisable
102 );
103 
104 NvlStatus
105 nvswitch_oms_inforom_flush_ls10
106 (
107     struct nvswitch_device *device
108 );
109 
110 void
111 nvswitch_inforom_ecc_get_total_errors_ls10
112 (
113     nvswitch_device     *device,
114     INFOROM_ECC_OBJECT  *pEccGeneric,
115     NvU64               *pCorrectedTotal,
116     NvU64               *pUncorrectedTotal
117 );
118 
119 NvlStatus
120 nvswitch_inforom_load_obd_ls10
121 (
122     nvswitch_device *device
123 );
124 
125 NvlStatus
126 nvswitch_bbx_add_sxid_ls10
127 (
128     nvswitch_device *device,
129     NvU32 exceptionType,
130     NvU32 data0,
131     NvU32 data1,
132     NvU32 data2
133 );
134 
135 NvlStatus
136 nvswitch_bbx_unload_ls10
137 (
138     nvswitch_device *device
139 );
140 
141 NvlStatus
142 nvswitch_bbx_load_ls10
143 (
144     nvswitch_device *device,
145     NvU64 time_ns,
146     NvU8 osType,
147     NvU32 osVersion
148 );
149 
150 NvlStatus
151 nvswitch_bbx_get_sxid_ls10
152 (
153     nvswitch_device *device,
154     NVSWITCH_GET_SXIDS_PARAMS * params
155 );
156 
157 #endif //_INFOROM_LS10_H_
158