summaryrefslogtreecommitdiffstats
path: root/systemservice/interface_unified/library/include/system_service/ss_system_manager_if.h
blob: e6b4f8de7bc53ddfc251581274abd59ef47a92a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  system_manager
/// \file     ss_system_manager_if.h
/// \brief    This file supports the System Manager client interface.
///
///////////////////////////////////////////////////////////////////////////////

#ifndef SS_SYSTEM_MANAGER_IF_H_  // NOLINT (build/header_guard)
#define SS_SYSTEM_MANAGER_IF_H_

#include <native_service/frameworkunified_types.h>
#include <system_service/ss_sm_ram_access.h>
#include "system_service/ss_system_if.h"
#include "system_service/ss_error_event_common.h"
#include "system_service/ss_power_service.h"

/// \ingroup system_manager
/// \brief Boot mode information
typedef enum {
    e_SS_SM_BOOT_MODE_INVALID     = -1
  , e_SS_SM_BOOT_MODE_APPLICATION
  , e_SS_SM_BOOT_MODE_PROGRAMMING
}ESMBootModeInfo;

/// \ingroup system_manager
/// \brief Data reset mode information
typedef enum {
    e_SS_SM_DATA_RESET_MODE_NONE
  , e_SS_SM_DATA_RESET_MODE_USER
  , e_SS_SM_DATA_RESET_MODE_FACTORY
  , e_SS_SM_DATA_RESET_MODE_PROGUPDATE  // cannot use this
}ESMDataResetModeInfo;

/// \ingroup system_manager
/// \brief Program update status
typedef UI_32 SMProgUpdateState;
#define SS_SM_PROG_UPDATE_STATE_NONE            0x0000
#define SS_SM_PROG_UPDATE_STATE_UPDATED         0x0001
#define SS_SM_PROG_UPDATE_STATE_MAP_UPDATED     0x0002
#define SS_SM_PROG_UPDATE_STATE_MAPDIFF_UPDATED 0x0004

/// Set Next Wakeup type information
typedef enum {
    e_SS_SM_NEXT_WAKEUP_TYPE_NONE = 0
  , e_SS_SM_NEXT_WAKEUP_TYPE_COLD
  , e_SS_SM_NEXT_WAKEUP_TYPE_HOT
}ESMNextWakeupType;

/// \ingroup system_manager
/// \brief DRAM backup status
typedef enum {
    e_SS_SM_DRAM_BACKUP_UNSET = -1
  , e_SS_SM_DRAM_BACKUP_OK
  , e_SS_SM_DRAM_BACKUP_NG
}ESMDramBackupStatus;

/// \ingroup system_manager
/// \brief Reset status
typedef enum {
    e_SS_SM_RESET_STATUS_UNSET = -1
  , e_SS_SM_RESET_STATUS_NONE
  , e_SS_SM_RESET_STATUS_NG
  , e_SS_SM_RESET_STATUS_IMMEDIATE
}ESMResetStatus;

/// \ingroup system_manager
/// \brief Relaunch status
typedef enum {
    e_SS_SM_RELAUNCH_STATUS_NONE
  , e_SS_SM_RELAUNCH_STATUS_SAFE
  , e_SS_SM_RELAUNCH_STATUS_ERR
}EMRelaunchStatus;


/// \ingroup system_manager
/// \brief CPU Reset Reason
typedef enum {
    e_SS_SM_CPU_RESET_REASON_INVALID = -1
  , e_SS_SM_CPU_RESET_REASON_NORMAL  =  0
  , e_SS_SM_CPU_RESET_REASON_DATA_RESET
  , e_SS_SM_CPU_RESET_REASON_USER_FORCE_RESET
  , e_SS_SM_CPU_RESET_REASON_GENERIC
  , e_SS_SM_CPU_RESET_REASON_GENERIC_ERR = e_SS_SM_CPU_RESET_REASON_GENERIC
  , e_SS_SM_CPU_RESET_REASON_DSP_ERR
  , e_SS_SM_CPU_RESET_REASON_IMMRESET_NORMAL
  , e_SS_SM_CPU_RESET_REASON_CRITICAL_ERR  // DRAM backup will be discarded after reset
}ESMCpuResetReason;

/// \ingroup system_manager
/// \brief CPU Reset Info
typedef struct T_SystemManagerCpuResetInfo {
#define SS_SM_RESET_MSG_STR_SIZE 64
#define SS_SM_SUFFIX_STR_SIZE  32
    ESMCpuResetReason resetReason;
    CHAR              messageStr[SS_SM_RESET_MSG_STR_SIZE];
    CHAR              suffixStr[SS_SM_SUFFIX_STR_SIZE];
    T_SystemManagerCpuResetInfo
       () : resetReason(e_SS_SM_CPU_RESET_REASON_INVALID) {
    }
}TSystemManagerCpuResetInfo;


/// \ingroup system_manager
/// \brief Data Reset Reason
typedef enum {
    e_SS_SM_DATA_RESET_TYPE_USER = 0
  , e_SS_SM_DATA_RESET_TYPE_FACTORY  // AKA Shipment Mode
  , e_SS_SM_DATA_RESET_TYPE_CONFIGURATION
  , e_SS_SM_DATA_RESET_TYPE_PROGUPDATE    // cannot use this
}ESMDataResetType;

typedef enum {
    e_SS_SM_SVC_WAKEUP_STATUS_COMPLETE = 0x01
}ESMServiceWakeupStatus;

/// \ingroup system_manager
/// \brief Data Reset Reason
typedef struct T_SS_BootModeListStruct {
  ESMBootModeInfo             hostBootMode;
  EPWR_SC__CWORD56__BOOT_MODE_TYPE _CWORD56_BootMode;
} TSS_BootModeListStruct;

//****************************************************************************
/// \ingroup system_manager                                                   *
/// Data passed in the NTFY_SSSystemMgrPowerOnOff and                        *
/// NTFY_SSSystemMgrUserMode notification messages                           *

/// \ingroup system_manager
typedef struct T_SS_SM_UserModeOnOffNotification_Struct {                 // *
    BOOL                              isUserModeOn;                       // *
    EPWR_WAKEUP_FACTOR_TYPE           startupReason;                      // *
    EPWR_USER_MODE_CHANGE_REASON_TYPE userModeChangeReason;               // *
    T_SS_SM_UserModeOnOffNotification_Struct                              // *
       () : isUserModeOn(FALSE),                                          // *
            startupReason(epswfINVALID),                                  // *
            userModeChangeReason(epsumcrNOT_AVAILABLE) {                  // *
    }                                                                     // *
    T_SS_SM_UserModeOnOffNotification_Struct                              // *
        (BOOL                              f_bUserMode,                   // *
         EPWR_WAKEUP_FACTOR_TYPE           f_startupReason,               // *
         EPWR_USER_MODE_CHANGE_REASON_TYPE f_changeReason)                // *
           : isUserModeOn(f_bUserMode),                                   // *
             startupReason(f_startupReason),                              // *
             userModeChangeReason(f_changeReason) {                       // *
    }                                                                     // *
                                                                          // *
} T_SS_SM_UserModeOnOffNotification_StructType;                           // *
//                                                                           *
// End of Data passed as part of NTFY_SSSystemMgrPowerOnOff notification ... *
//****************************************************************************


//****************************************************************************
/// \ingroup system_manager
/**
 * \~english Parameters of the following message. \n
 *            SS_SM_START             'FrameworkunifiedOnStart'/'evStart' \n
 *            SS_SM_PRE_START         'FrameworkunifiedOnPreStart'/'evPreStart' \n
 *            SS_SM_BACKGROUND_START  'FrameworkunifiedOnBackgroundStart'/'evBackgroundStart' \n
 */
typedef struct T_SS_SM_START_DataStruct {
    EPWR_WAKEUP_FACTOR_TYPE           startupReason;        //!< \~english
    BOOL                              isUserModeOn;         //!< \~english
    ESMDataResetModeInfo              dataResetMode;        //!< \~english
    EPWR_SC_SECURITY_STATUS           securityStatus;       //!< \~english
    EPWR_SC_WAKEUP_TYPE               wakeupType;           //!< \~english
    ESMDramBackupStatus               dramBackupStatus;     //!< \~english
    ESMResetStatus                    resetStatus;          //!< \~english
    UI_32                             errResetCount;        //!< \~english
    /**
     *  \~english Constructor
     */
    T_SS_SM_START_DataStruct
       () : startupReason(epswfINVALID),
            isUserModeOn(FALSE),
            dataResetMode(e_SS_SM_DATA_RESET_MODE_NONE),
            securityStatus(epsssINVALID),
            wakeupType(epsstINVALID),
            dramBackupStatus(e_SS_SM_DRAM_BACKUP_UNSET),
            resetStatus(e_SS_SM_RESET_STATUS_UNSET),
            errResetCount(0) {}
    /**
     *  \~english Constructor
     */
    T_SS_SM_START_DataStruct
        (EPWR_WAKEUP_FACTOR_TYPE  f_startupReason,
         BOOL                     f_isUserModeOn,
         ESMDataResetModeInfo     f_dataResetMode,
         EPWR_SC_SECURITY_STATUS  f_securityStatus,
         EPWR_SC_WAKEUP_TYPE      f_wakeupType,
         ESMDramBackupStatus      f_dramBackupStatus,
         ESMResetStatus           f_resetStatus,
         UI_32                    f_resetCount)
           : startupReason(f_startupReason),
             isUserModeOn(f_isUserModeOn),
             dataResetMode(f_dataResetMode),
             securityStatus(f_securityStatus),
             wakeupType(f_wakeupType),
             dramBackupStatus(f_dramBackupStatus),
             resetStatus(f_resetStatus),
             errResetCount(f_resetCount) {}
} T_SS_SM_START_DataStructType;
//                                                                           *
// End of Data passed as part of SS_SM_START 'FrameworkunifiedOnStart'/'evStart' message  *
//****************************************************************************

//****************************************************************************
/// \ingroup system_manager
/// Data passed as part of SS_SM_STOP 'FrameworkunifiedOnStop'/'evStop' message            *
typedef struct T_SS_SM_STOP_DataStruct {                                  // *
  EPWR_SHUTDOWN_TRIGGER_TYPE     shutdownTrigger;                       // *
  EPWR_USER_MODE_TYPE            lastUserMode;                          // *
} T_SS_SM_STOP_DataStructType;                                            // *
//                                                                           *
// End of Data passed as part of SS_SM_STOP 'FrameworkunifiedOnStop'/'evStop' message  // *
//****************************************************************************

//****************************************************************************
/// \ingroup system_manager
/// Extended Parameter for FrameworkunifiedOnStart                                        *
typedef struct {                                                          // *
#define SS_SM_START_EXT_INFO_SIZE 64                                      // *
#define SS_SM_START_EXT_BODY_SIZE ( sizeof(BOOL) \
                                    + sizeof(EMRelaunchStatus) \
                                    + sizeof(BOOL) \
                                    + sizeof(BOOL) \
                                    )

#define SS_SM_START_EXT_RSV_SIZE  SS_SM_START_EXT_INFO_SIZE \
                                - SS_SM_START_EXT_BODY_SIZE               // *
        BOOL             isProgUpdated;                                   // *
        EMRelaunchStatus relaunchStatus;                                  // *
        BOOL             isMapUpdated;                                    // *
        BOOL             isMapDiffUpdated;                                // *
        uint8_t          reserved[SS_SM_START_EXT_RSV_SIZE];              // *
} T_SS_SM_START_ExtDataStructType;                                        // *
//                                                                           *
// End of Extended Parameter for FrameworkunifiedOnStart                                  *
//****************************************************************************

//****************************************************************************
/// \ingroup system_manager
/// Extended Parameter for FrameworkunifiedOnStop                                         *
typedef struct {                                                          // *
#define SS_SM_STOP_EXT_INFO_SIZE 64                                       // *
#define SS_SM_STOP_EXT_BODY_SIZE (sizeof(BOOL))                           // *
#define SS_SM_STOP_EXT_RSV_SIZE  SS_SM_STOP_EXT_INFO_SIZE \
                               - SS_SM_STOP_EXT_BODY_SIZE                 // *
        BOOL     isProgUpdated;                                           // *
        uint8_t  reserved[SS_SM_STOP_EXT_RSV_SIZE];                       // *
}T_SS_SM_STOP_ExtDataStructType;                                          // *
//                                                                           *
// End of Extended Parameter for FrameworkunifiedOnStop                                   *
//****************************************************************************

struct SMErrorEventNtfData {
#define SM_MODULE_NAME_SIZE 64
  EErrorEventType  EventType;
  CHAR             ModuleName[SM_MODULE_NAME_SIZE];
  BOOL             isNeedReboot;
};

//*************************************************************************
// Boot Micro Logging Protocol                                            *
//                                                                        *
enum eSMBootMicroResetReason {
    SS_SM_BOOT_MICRO_RESET_REASON_SELF_RESET = 0,
    SS_SM_BOOT_MICRO_RESET_REASON_USER_FORCE_RESET,
    SS_SM_BOOT_MICRO_RESET_REASON_DSP_RESET,
    SS_SM_BOOT_MICRO_RESET_REASON_HB_TIMEOUT
};
//                                                                        *
// End of Boot Micro Logging Protocol                                     *
//*************************************************************************


//****************************************************************************
/// \ingroup system_manager                                                        *
/// Error Event Logging enumerations                                         *
///
enum eSMUserLogType {
    e_SS_SM_CAPTURE_ALL_LOGS = 1,  //!< \~english Capture all logs
    e_SS_SM_SCREEN_CAPTURE,  //!< \~english Capture screenshot
    e_SS_SM_CAPTURE_INTERFACEUNIFIED_LOGS,  //!< \~english Capture application log
    e_SS_SM_USER_FORCE_RESET,  //!< \~english Capture logs are forcibily reset
    e_SS_SM_CAPTURE_DEV_LOGS,  //!< \~english Capture device log
    e_SS_SM_CAPTURE_MODULE_LOGS,  //!< \~english Capture debug log
    e_SS_SM_CAPTURE_DTC_LOGS,  //!< \~english Capture DTC event log
    e_SS_SM_CAPTURE_NAVI_LOGS,  //!< \~english Capture Navi event log
    e_SS_SM_CAPTURE_GROUP_RELAUNCH  //!< \~english Capture log by Group Relaunch
};
//                                                                           *
// Error Event Logging enumerations                                          *
//****************************************************************************

//****************************************************************************
/// \ingroup system_manager                                                        *
/// \brief Error Event Logging Info                                          *
typedef struct T_SystemManagerLoggingRequestInfo {
#define SS_SM_LOG_MSG_STR_SIZE 64
    eSMUserLogType    logType;
    CHAR              messageStr[SS_SM_LOG_MSG_STR_SIZE];
    CHAR              suffixStr[SS_SM_SUFFIX_STR_SIZE];
}TSystemManagerLoggingRequestInfo;
//
// Error Event Logging Info                                                  *
//****************************************************************************

//****************************************************************************
/// \ingroup system_manager                                                        *
/// \brief Error Event Clear Logs Info                                       *
typedef struct T_SystemManagerClearLogsInfo {
    void *rsv;
}TSystemManagerClearLogsInfo;
//
// Error Event Clear Logs Info                                               *
//****************************************************************************

#endif /* SS_SYSTEM_MANAGER_IF_H_ */  // NOLINT (build/header_guard)