1 /* 2 * SPDX-FileCopyrightText: Copyright (c) 2018-2023 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 _RMSOECMDIF_H_ 25 #define _RMSOECMDIF_H_ 26 27 /*! 28 * @file rmsoecmdif.h 29 * @brief Top-level header-file that defines the command/message interfaces 30 * that may be used to communicate with SOE. 31 * 32 * This header does not directly define specific attributes, structure, or 33 * other properties for specific commands or messages. Instead, it includes all 34 * specific unit- header-files and then defines the top-level command and 35 * message structures, RM_SOE_COMMAND and RM_SOE_MESSAGE (respectively). 36 */ 37 38 39 40 #include "flcnifcmn.h" 41 42 #include "soe/soebif.h" 43 #include "soe/soeifcmn.h" 44 #include "soe/soeifsoe.h" 45 #include "soe/soeiftest.h" 46 #include "soe/soeiftherm.h" 47 #include "soe/soeifspi.h" 48 #include "soe/soeififr.h" 49 #include "soe/soeifsmbpbi.h" 50 #include "soe/soeifcore.h" 51 #include "soe/soeifchnmgmt.h" 52 #include "soe/soeifcci.h" 53 #include "soe/soeifheartbeat.h" 54 55 /*! 56 * Defines the structure that must be populated to send any arbitrary command 57 * to SOE's command queue. Each command packet will contain a command 58 * header ('hdr') describing various command attributes as well as the command 59 * data itself ('cmd'). 60 */ 61 typedef struct 62 { 63 RM_FLCN_QUEUE_HDR hdr; 64 union 65 { 66 RM_SOE_TEST_CMD soeTest; 67 RM_SOE_THERM_CMD therm; 68 RM_SOE_SPI_CMD spi; 69 RM_SOE_IFR_CMD ifr; 70 RM_SOE_SMBPBI_CMD smbpbiCmd; 71 RM_SOE_BIF_CMD bif; 72 RM_SOE_CORE_CMD core; 73 RM_SOE_CHNMGMT_CMD chnmgmt; 74 RM_SOE_CCI_CMD cci; 75 } cmd; 76 } RM_FLCN_CMD_SOE, 77 *PRM_FLCN_CMD_SOE; 78 79 typedef RM_FLCN_CMD_SOE RM_SOE_COMMAND; 80 typedef PRM_FLCN_CMD_SOE PRM_SOE_COMMAND; 81 82 /*! 83 * Defines the structure that represents all messages sent from SOE to 84 * the RM. Similar to the command structure, the message structure also 85 * contains a message header ('hdr') that describes the message as well as 86 * the actual message data ('msg'). 87 */ 88 typedef struct 89 { 90 RM_FLCN_QUEUE_HDR hdr; 91 union 92 { 93 RM_SOE_TEST_MSG soeTest; 94 RM_SOE_THERM_MSG soeTherm; 95 RM_FLCN_MSG_SOE_INIT init; 96 RM_SOE_CHNMGMT_MSG chnmgmt; 97 RM_SOE_CORE_MSG core; 98 RM_SOE_CCI_MSG cci; 99 RM_SOE_HEARTBEAT_MSG heartbeat; 100 } msg; 101 } RM_FLCN_MSG_SOE, 102 *PRM_FLCN_MSG_SOE; 103 104 /*! 105 * Production task-identifiers: 106 * 107 * @note TASK_ID__IDLE must remain zero. 108 * @note TASK_ID__END must mark the end of the valid IDs. 109 * 110 * @note Do NOT compact following defines! 111 * @note Do NOT recycle deleted/unused IDs! 112 */ 113 #define RM_SOE_TASK_ID__IDLE 0x00 114 #define RM_SOE_TASK_ID_CMDMGMT 0x01 115 #define RM_SOE_TASK_ID_WKRTHD 0x02 116 #define RM_SOE_TASK_ID_THERM 0x03 117 #define RM_SOE_TASK_ID_RESERVED 0x04 118 #define RM_SOE_TASK_ID_SPI 0x05 119 #define RM_SOE_TASK_ID_RSVD6 0x06 120 #define RM_SOE_TASK_ID_SMBPBI 0x07 121 #define RM_SOE_TASK_ID_BIF 0x08 122 #define RM_SOE_TASK_ID_CORE 0x09 123 #define RM_SOE_TASK_ID_IFR 0x0A 124 #define RM_SOE_TASK_ID_CHNMGMT 0x0B 125 #define RM_SOE_TASK_ID_RMMSG 0x0C 126 #define RM_SOE_TASK_ID_CCI 0x0D 127 #define RM_SOE_TASK_ID_FSPMGMT 0x0E 128 #define RM_SOE_TASK_ID_HEARTBEAT 0x0F 129 // Add new task ID here... 130 #define RM_SOE_TASK_ID__END 0x10 131 132 /*! 133 * Unit-identifiers: 134 * 135 * Notes: 136 * UNIT_END must mark the end of the valid IDs. 137 */ 138 #define RM_SOE_UNIT_REWIND RM_FLCN_UNIT_ID_REWIND 139 #define RM_SOE_UNIT_INIT (0x01) 140 #define RM_SOE_UNIT_NULL (0x02) 141 #define RM_SOE_UNIT_TEST (0x03) 142 #define RM_SOE_UNIT_UNLOAD (0x04) 143 #define RM_SOE_UNIT_THERM (0x05) 144 #define RM_SOE_UNIT_RESERVED (0x06) 145 #define RM_SOE_UNIT_SPI (0x07) 146 #define RM_SOE_UNIT_RSVD8 (0x08) 147 #define RM_SOE_UNIT_SMBPBI (0x09) 148 #define RM_SOE_UNIT_BIF (0x0A) 149 #define RM_SOE_UNIT_CORE (0x0B) 150 #define RM_SOE_UNIT_IFR (0x0C) 151 #define RM_SOE_UNIT_CHNMGMT (0x0D) 152 #define RM_SOE_UNIT_CCI (0x0E) 153 #define RM_SOE_UNIT_HEARTBEAT (0x0F) 154 // Add new unit ID here... 155 #define RM_SOE_UNIT_END (0x10) 156 157 #endif // _RMSOECMDIF_H_ 158 159