mcmgr.h
/*
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef MCMGR_H
#define MCMGR_H
#include <stdbool.h>
#include <stdint.h>
typedef enum _mcmgr_status
{
kStatus_MCMGR_Success,
kStatus_MCMGR_Error,
kStatus_MCMGR_NotImplemented,
kStatus_MCMGR_NotReady
} mcmgr_status_t;
typedef enum _mcmgr_core_property
{
kMCMGR_CoreStatus,
kMCMGR_CoreType,
kMCMGR_CorePowerMode
} mcmgr_core_property_t;
typedef enum _mcmgr_core_type
{
kMCMGR_CoreTypeCortexM0,
kMCMGR_CoreTypeCortexM0Plus,
kMCMGR_CoreTypeCortexM4,
kMCMGR_CoreTypeCortexM33
} mcmgr_core_type_t;
typedef enum _mcmgr_core
{
kMCMGR_Core0,
kMCMGR_Core1
} mcmgr_core_t;
typedef enum _mcmgr_start_mode
{
kMCMGR_Start_Synchronous,
kMCMGR_Start_Asynchronous
} mcmgr_start_mode_t;
typedef enum _mcmgr_event_type_t
{
kMCMGR_RemoteCoreUpEvent = 1,
kMCMGR_RemoteCoreDownEvent,
kMCMGR_RemoteExceptionEvent,
kMCMGR_StartupDataEvent,
kMCMGR_FeedStartupDataEvent,
kMCMGR_RemoteRPMsgEvent,
kMCMGR_RemoteApplicationEvent,
kMCMGR_EventTableLength
} mcmgr_event_type_t;
typedef void (*mcmgr_event_callback_t)(uint16_t data, void *context);
#ifndef MCMGR_HANDLE_EXCEPTIONS
#define MCMGR_HANDLE_EXCEPTIONS (0)
#endif
enum mcmgr_version_enum
{
kMCMGR_Version = 0x00040003
};
#if defined(__cplusplus)
extern "C" {
#endif // __cplusplus
mcmgr_status_t MCMGR_EarlyInit(void);
mcmgr_status_t MCMGR_Init(void);
mcmgr_status_t MCMGR_StartCore(mcmgr_core_t coreNum, void *bootAddress, uint32_t startupData, mcmgr_start_mode_t mode);
mcmgr_status_t MCMGR_GetStartupData(uint32_t *startupData);
mcmgr_status_t MCMGR_StopCore(mcmgr_core_t coreNum);
int32_t MCMGR_GetVersion(void);
mcmgr_status_t MCMGR_GetCoreProperty(mcmgr_core_t coreNum,
mcmgr_core_property_t property,
void *value,
uint32_t *length);
uint32_t MCMGR_GetCoreCount(void);
mcmgr_core_t MCMGR_GetCurrentCore(void);
mcmgr_status_t MCMGR_RegisterEvent(mcmgr_event_type_t type, mcmgr_event_callback_t callback, void *callbackData);
mcmgr_status_t MCMGR_TriggerEvent(mcmgr_event_type_t type, uint16_t eventData);
mcmgr_status_t MCMGR_TriggerEventForce(mcmgr_event_type_t type, uint16_t eventData);
#if defined(__cplusplus)
}
#endif // __cplusplus
#endif
kMCMGR_Start_Synchronous
Enum value for starting synchronously.
Definition: mcmgr.h:72
mcmgr_event_type_t
enum _mcmgr_event_type_t mcmgr_event_type_t
Type definition of event types.
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:65
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:56
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:103
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:63
mcmgr_core_t
enum _mcmgr_core mcmgr_core_t
Enumeration that defines core.
kMCMGR_CoreTypeCortexM4
Cortex M4.
Definition: mcmgr.h:54
kMCMGR_CoreTypeCortexM0
Cortex M0.
Definition: mcmgr.h:50
_mcmgr_event_type_t
_mcmgr_event_type_t
Type definition of event types.
Definition: mcmgr.h:79
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:47
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:74
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:52
kMCMGR_CoreType
Type of Core.
Definition: mcmgr.h:41
_mcmgr_start_mode
_mcmgr_start_mode
Enumeration that defines start type.
Definition: mcmgr.h:69
_mcmgr_core
_mcmgr_core
Enumeration that defines core.
Definition: mcmgr.h:60
mcmgr_event_callback_t
void(* mcmgr_event_callback_t)(uint16_t data, void *context)
Type definition of event callback function pointer.
Definition: mcmgr.h:92