1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2004-2021 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 #pragma once
25 
26 #include <nvtypes.h>
27 
28 //
29 // This file was generated with FINN, an NVIDIA coding tool.
30 // Source file:      ctrl/ctrl0080/ctrl0080host.finn
31 //
32 
33 #include "ctrl/ctrl0080/ctrl0080base.h"
34 
35 /* NV01_DEVICE_XX/NV03_DEVICE host control commands and parameters */
36 
37 /*
38  * NV0080_CTRL_CMD_HOST_GET_CAPS
39  *
40  * This command returns the set of host capabilities for the device
41  * in the form of an array of unsigned bytes.  Host capabilities
42  * include supported features and required workarounds for the host-related
43  * engine(s) within the device, each represented by a byte offset into
44  * the table and a bit position within that byte.
45  *
46  *   capsTblSize
47  *     This parameter specifies the size in bytes of the caps table.
48  *     This value should be set to NV0080_CTRL_HOST_CAPS_TBL_SIZE.
49  *   capsTbl
50  *     This parameter specifies a pointer to the client's caps table buffer
51  *     into which the host caps bits will be transferred by the RM.
52  *     The caps table is an array of unsigned bytes.
53  *
54  * Possible status values returned are:
55  *   NV_OK
56  *   NV_ERR_INVALID_PARAM_STRUCT
57  *   NV_ERR_INVALID_ARGUMENT
58  *   NV_ERR_INVALID_POINTER
59  */
60 #define NV0080_CTRL_CMD_HOST_GET_CAPS (0x801401) /* finn: Evaluated from "(FINN_NV01_DEVICE_0_HOST_INTERFACE_ID << 8) | NV0080_CTRL_HOST_GET_CAPS_PARAMS_MESSAGE_ID" */
61 
62 #define NV0080_CTRL_HOST_GET_CAPS_PARAMS_MESSAGE_ID (0x1U)
63 
64 typedef struct NV0080_CTRL_HOST_GET_CAPS_PARAMS {
65     NvU32 capsTblSize;
66     NV_DECLARE_ALIGNED(NvP64 capsTbl, 8);
67 } NV0080_CTRL_HOST_GET_CAPS_PARAMS;
68 
69 /* extract cap bit setting from tbl */
70 #define NV0080_CTRL_HOST_GET_CAP(tbl,c)            (((NvU8)tbl[(1?c)]) & (0?c))
71 
72 /* caps format is byte_index:bit_mask */
73 #define NV0080_CTRL_HOST_CAPS_CPU_WRITE_WAR_BUG_420495              2:0x20
74 #define NV0080_CTRL_HOST_CAPS_EXPLICIT_CACHE_FLUSH_REQD             2:0x40
75 
76 /* size in bytes of host caps table */
77 #define NV0080_CTRL_HOST_CAPS_TBL_SIZE   3
78 
79 #define NV0080_CTRL_CMD_HOST_GET_CAPS_V2 (0x801402) /* finn: Evaluated from "(FINN_NV01_DEVICE_0_HOST_INTERFACE_ID << 8) | NV0080_CTRL_HOST_GET_CAPS_V2_PARAMS_MESSAGE_ID" */
80 
81 #define NV0080_CTRL_HOST_GET_CAPS_V2_PARAMS_MESSAGE_ID (0x2U)
82 
83 typedef struct NV0080_CTRL_HOST_GET_CAPS_V2_PARAMS {
84     NvU8 capsTbl[NV0080_CTRL_HOST_CAPS_TBL_SIZE];
85 } NV0080_CTRL_HOST_GET_CAPS_V2_PARAMS;
86 
87 /* _ctrl0080host_h_ */
88