| Multicore Manager (MCMGR) User's Guide Rev. 4.1.1 NXP Semiconductors

- Main Page
- API Reference

mcmgr.h
1 /*
2 * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3 * Copyright 2016-2020 NXP
4 * All rights reserved.
5 *
6 *
7 * SPDX-License-Identifier: BSD-3-Clause
8 */
9
10 #ifndef MCMGR_H
11 #define MCMGR_H
12
13 #include <stdbool.h>
14 #include <stdint.h>
15
22 typedef enum _mcmgr_status
23 {
25 kStatus_MCMGR_Success,
27 kStatus_MCMGR_Error,
29 kStatus_MCMGR_NotImplemented,
31 kStatus_MCMGR_NotReady
32
33 } mcmgr_status_t;
34
36 typedef enum _mcmgr_core_property
37 {
39 kMCMGR_CoreStatus,
41 kMCMGR_CoreType,
43 kMCMGR_CorePowerMode
44 } mcmgr_core_property_t;
45
47 typedef enum _mcmgr_core_status
48 {
50 kMCMGR_InReset,
52 kMCMGR_NotInReset
53 } mcmgr_core_status_t;
54
56 typedef enum _mcmgr_core_type
57 {
59 kMCMGR_CoreTypeCortexM0,
61 kMCMGR_CoreTypeCortexM0Plus,
63 kMCMGR_CoreTypeCortexM4,
65 kMCMGR_CoreTypeCortexM33,
67 kMCMGR_CoreTypeCortexM7,
69 kMCMGR_CoreTypeCortexM3
70 } mcmgr_core_type_t;
71
73 typedef enum _mcmgr_core
74 {
76 kMCMGR_Core0,
78 kMCMGR_Core1
79 } mcmgr_core_t;
80
82 typedef enum _mcmgr_start_mode
83 {
85 kMCMGR_Start_Synchronous,
87 kMCMGR_Start_Asynchronous
88
89 } mcmgr_start_mode_t;
90
92 typedef enum _mcmgr_event_type_t
93 {
94 kMCMGR_RemoteCoreUpEvent = 1,
95 kMCMGR_RemoteCoreDownEvent,
96 kMCMGR_RemoteExceptionEvent,
97 kMCMGR_StartupDataEvent,
98 kMCMGR_FeedStartupDataEvent,
99 kMCMGR_RemoteRPMsgEvent,
100 kMCMGR_RemoteApplicationEvent,
101 kMCMGR_FreeRtosMessageBuffersEvent,
102 kMCMGR_EventTableLength
103 } mcmgr_event_type_t;
104
106 typedef void (*mcmgr_event_callback_t)(uint16_t data, void *context);
107
109 #ifndef MCMGR_HANDLE_EXCEPTIONS
110 #define MCMGR_HANDLE_EXCEPTIONS (0)
111 #endif
112
117 enum mcmgr_version_enum
118 {
119 kMCMGR_Version = 0x00040101
120 };
121
122 #if defined(__cplusplus)
123 extern "C" {
124 #endif // __cplusplus
125
133 mcmgr_status_t MCMGR_EarlyInit(void);
134
142 mcmgr_status_t MCMGR_Init(void);
143
159 mcmgr_status_t MCMGR_StartCore(mcmgr_core_t coreNum, void *bootAddress, uint32_t startupData, mcmgr_start_mode_t mode);
160
171 mcmgr_status_t MCMGR_GetStartupData(uint32_t *startupData);
172
182 mcmgr_status_t MCMGR_StopCore(mcmgr_core_t coreNum);
183
191 int32_t MCMGR_GetVersion(void);
192
205 mcmgr_status_t MCMGR_GetCoreProperty(mcmgr_core_t coreNum,
206 mcmgr_core_property_t property,
207 void *value,
208 uint32_t *length);
209
217 uint32_t MCMGR_GetCoreCount(void);
218
226 mcmgr_core_t MCMGR_GetCurrentCore(void);
227
240 mcmgr_status_t MCMGR_RegisterEvent(mcmgr_event_type_t type, mcmgr_event_callback_t callback, void *callbackData);
241
253 mcmgr_status_t MCMGR_TriggerEvent(mcmgr_event_type_t type, uint16_t eventData);
254
266 mcmgr_status_t MCMGR_TriggerEventForce(mcmgr_event_type_t type, uint16_t eventData);
267
268 #if defined(__cplusplus)
269 }
270 #endif // __cplusplus
271
274 #endif
kMCMGR_Start_Synchronous
Enum value for starting synchronously.
Definition: mcmgr.h:85
_mcmgr_core_status
_mcmgr_core_status
Enumeration that defines the property value of core status.
Definition: mcmgr.h:47
mcmgr_event_type_t
enum _mcmgr_event_type_t mcmgr_event_type_t
Type definition of event types.
kMCMGR_InReset
Core is held in reset.
Definition: mcmgr.h:50
kStatus_MCMGR_Success
Operation was successful.
Definition: mcmgr.h:25
kMCMGR_CoreStatus
Status of core read from hardware core status flag.
Definition: mcmgr.h:39
MCMGR_StartCore
mcmgr_status_t MCMGR_StartCore(mcmgr_core_t coreNum, void *bootAddress, uint32_t startupData, mcmgr_start_mode_t mode)
Start a selected core.
mcmgr_core_property_t
enum _mcmgr_core_property mcmgr_core_property_t
Enumeration that defines property of core.
kMCMGR_Core1
Enum value for Core 1.
Definition: mcmgr.h:78
kStatus_MCMGR_Error
Operation was not successful.
Definition: mcmgr.h:27
kStatus_MCMGR_NotReady
Operation result not ready.
Definition: mcmgr.h:31
MCMGR_GetCoreProperty
mcmgr_status_t MCMGR_GetCoreProperty(mcmgr_core_t coreNum, mcmgr_core_property_t property, void *value, uint32_t *length)
Get property of the CPU core.
kMCMGR_CoreTypeCortexM33
Cortex M33.
Definition: mcmgr.h:65
MCMGR_EarlyInit
mcmgr_status_t MCMGR_EarlyInit(void)
Initialize the multicore manager, early init.
mcmgr_version_enum
mcmgr_version_enum
Version of MCMGR.
Definition: mcmgr.h:117
MCMGR_GetCoreCount
uint32_t MCMGR_GetCoreCount(void)
Return the count of cores in a multicore system.
_mcmgr_core_property
_mcmgr_core_property
Enumeration that defines property of core.
Definition: mcmgr.h:36
MCMGR_GetStartupData
mcmgr_status_t MCMGR_GetStartupData(uint32_t *startupData)
Get startup data for the slave core.
kMCMGR_Core0
Enum value for Core 0.
Definition: mcmgr.h:76
mcmgr_core_t
enum _mcmgr_core mcmgr_core_t
Enumeration that defines core.
kMCMGR_CoreTypeCortexM4
Cortex M4.
Definition: mcmgr.h:63
kMCMGR_CoreTypeCortexM0
Cortex M0.
Definition: mcmgr.h:59
_mcmgr_event_type_t
_mcmgr_event_type_t
Type definition of event types.
Definition: mcmgr.h:92
MCMGR_GetCurrentCore
mcmgr_core_t MCMGR_GetCurrentCore(void)
Get current CPU core.
_mcmgr_core_type
_mcmgr_core_type
Enumeration that defines property value of core type.
Definition: mcmgr.h:56
kMCMGR_CoreTypeCortexM3
Cortex M3.
Definition: mcmgr.h:69
kMCMGR_CorePowerMode
Power Mode of Core - implementation is hardware-specific.
Definition: mcmgr.h:43
MCMGR_TriggerEventForce
mcmgr_status_t MCMGR_TriggerEventForce(mcmgr_event_type_t type, uint16_t eventData)
Trigger event handler, force version.
MCMGR_StopCore
mcmgr_status_t MCMGR_StopCore(mcmgr_core_t coreNum)
Stop a selected core.
MCMGR_Init
mcmgr_status_t MCMGR_Init(void)
Initialize the multicore manager.
kMCMGR_Start_Asynchronous
Enum value for starting asynchronously.
Definition: mcmgr.h:87
kStatus_MCMGR_NotImplemented
Function is not implemented.
Definition: mcmgr.h:29
mcmgr_status_t
enum _mcmgr_status mcmgr_status_t
Enumeration that defines MCMGR function return status codes.
_mcmgr_status
_mcmgr_status
Enumeration that defines MCMGR function return status codes.
Definition: mcmgr.h:22
MCMGR_RegisterEvent
mcmgr_status_t MCMGR_RegisterEvent(mcmgr_event_type_t type, mcmgr_event_callback_t callback, void *callbackData)
Register event handler.
MCMGR_TriggerEvent
mcmgr_status_t MCMGR_TriggerEvent(mcmgr_event_type_t type, uint16_t eventData)
Trigger event handler.
mcmgr_start_mode_t
enum _mcmgr_start_mode mcmgr_start_mode_t
Enumeration that defines start type.
mcmgr_core_type_t
enum _mcmgr_core_type mcmgr_core_type_t
Enumeration that defines property value of core type.
MCMGR_GetVersion
int32_t MCMGR_GetVersion(void)
Get version of MCMGR.
kMCMGR_CoreTypeCortexM0Plus
Cortex M0+.
Definition: mcmgr.h:61
kMCMGR_CoreType
Type of Core.
Definition: mcmgr.h:41
_mcmgr_start_mode
_mcmgr_start_mode
Enumeration that defines start type.
Definition: mcmgr.h:82
kMCMGR_NotInReset
Core is not in reset.
Definition: mcmgr.h:52
_mcmgr_core
_mcmgr_core
Enumeration that defines core.
Definition: mcmgr.h:73
kMCMGR_CoreTypeCortexM7
Cortex M7.
Definition: mcmgr.h:67
mcmgr_event_callback_t
void(* mcmgr_event_callback_t)(uint16_t data, void *context)
Type definition of event callback function pointer.
Definition: mcmgr.h:106
mcmgr_core_status_t
enum _mcmgr_core_status mcmgr_core_status_t
Enumeration that defines the property value of core status.