1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2020 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_LR10_H_
25 #define _INFOROM_LR10_H_
26 
27 NvlStatus nvswitch_inforom_nvl_log_error_event_lr10
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_lr10
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_lr10
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_lr10
56 (
57     nvswitch_device *device,
58     NVSWITCH_GET_NVLINK_ERROR_COUNTS_PARAMS *params
59 );
60 
61 NvlStatus nvswitch_inforom_nvl_setL1Threshold_lr10
62 (
63     nvswitch_device *device,
64     void *pNvlGeneric,
65     NvU32 word1,
66     NvU32 word2
67 );
68 
69 NvlStatus nvswitch_inforom_nvl_getL1Threshold_lr10
70 (
71     nvswitch_device *device,
72     void *pNvlGeneric,
73     NvU32 *word1,
74     NvU32 *word2
75 );
76 
77 NvlStatus nvswitch_inforom_nvl_setup_nvlink_state_lr10
78 (
79     nvswitch_device *device,
80     INFOROM_NVLINK_STATE *pNvlinkState,
81     NvU8 version
82 );
83 
84 NvlStatus
85 nvswitch_inforom_ecc_log_error_event_lr10
86 (
87     nvswitch_device *device,
88     INFOROM_ECC_OBJECT *pEccGeneric,
89     INFOROM_NVS_ECC_ERROR_EVENT *err_event
90 );
91 
92 void
93 nvswitch_inforom_ecc_get_total_errors_lr10
94 (
95     nvswitch_device     *device,
96     INFOROM_ECC_OBJECT  *pEccGeneric,
97     NvU64               *pCorrectedTotal,
98     NvU64               *pUncorrectedTotal
99 );
100 
101 NvlStatus
102 nvswitch_inforom_ecc_get_errors_lr10
103 (
104     nvswitch_device *device,
105     NVSWITCH_GET_ECC_ERROR_COUNTS_PARAMS *params
106 );
107 
108 void
109 nvswitch_initialize_oms_state_lr10
110 (
111     nvswitch_device *device,
112     INFOROM_OMS_STATE *pOmsState
113 );
114 
115 NvBool
116 nvswitch_oms_get_device_disable_lr10
117 (
118     INFOROM_OMS_STATE *pOmsState
119 );
120 
121 void
122 nvswitch_oms_set_device_disable_lr10
123 (
124     INFOROM_OMS_STATE *pOmsState,
125     NvBool bForceDeviceDisable
126 );
127 
128 NvlStatus
129 nvswitch_oms_inforom_flush_lr10
130 (
131     struct nvswitch_device *device
132 );
133 
134 NvlStatus
135 nvswitch_inforom_load_obd_lr10
136 (
137     nvswitch_device *device
138 );
139 
140 NvlStatus
141 nvswitch_bbx_add_sxid_lr10
142 (
143     nvswitch_device *device,
144     NvU32 exceptionType,
145     NvU32 data0,
146     NvU32 data1,
147     NvU32 data2
148 );
149 
150 NvlStatus
151 nvswitch_bbx_unload_lr10
152 (
153     nvswitch_device *device
154 );
155 
156 NvlStatus
157 nvswitch_bbx_load_lr10
158 (
159     nvswitch_device *device,
160     NvU64 time_ns,
161     NvU8 osType,
162     NvU32 osVersion
163 );
164 
165 NvlStatus
166 nvswitch_bbx_get_sxid_lr10
167 (
168     nvswitch_device *device,
169     NVSWITCH_GET_SXIDS_PARAMS * params
170 );
171 
172 NvlStatus
173 nvswitch_bbx_get_data_lr10
174 (
175     nvswitch_device *device,
176     NvU8 dataType,
177     void *params
178 );
179 
180 #endif //_INFOROM_LR10_H_
181