1 /* 2 * Copyright 2021, NXP 3 * All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #ifndef _FSL_FUSION_H_ 9 #define _FSL_FUSION_H_ 10 11 #include "fsl_common.h" 12 13 /*! 14 * @addtogroup fusion 15 * @{ 16 */ 17 18 /******************************************************************************* 19 * Definitions 20 ******************************************************************************/ 21 22 /*! @name Driver version */ 23 /*@{*/ 24 /*! @brief fusion driver version 2.0.0. */ 25 #define FSL_FUSION_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) 26 /*@}*/ 27 28 /*! 29 * @brief Structure for DSP copy image to destination address 30 * 31 * Defines start and destination address for copying image with given size. 32 */ 33 typedef struct _dsp_copy_image 34 { 35 uint32_t *srcAddr; 36 uint32_t *destAddr; 37 uint32_t size; 38 } dsp_copy_image_t; 39 40 /******************************************************************************* 41 * API 42 ******************************************************************************/ 43 #if defined(__cplusplus) 44 extern "C" { 45 #endif 46 47 /*! 48 * @brief Set Fusion DSP vector table remap. 49 * 50 * @param remap vector remap, valid value from 0x0U to 0x1FFFU 51 */ Fusion_SetVecRemap(uint32_t remap)52static inline void Fusion_SetVecRemap(uint32_t remap) 53 { 54 SIM_SEC->FUSION_GPR0 &= ~SIM_SEC_FUSION_GPR0_VECTOR_REMAP_MASK; 55 SIM_SEC->FUSION_GPR0 |= SIM_SEC_FUSION_GPR0_VECTOR_REMAP(remap); 56 } 57 58 /*! 59 * @brief Copy DSP image to destination address. 60 * 61 * Copy DSP image from source address to destination address with given size. 62 * 63 * @param dspCopyImage Structure contains information for DSP copy image to destination address. 64 */ 65 void DSP_CopyImage(dsp_copy_image_t *dspCopyImage); 66 67 /*! 68 * @brief Initializing Fusion core. 69 * 70 * Power up Fusion 71 * Put Fusion core in reset 72 * Enable Fusion clocks 73 * Enable SSRAM access 74 * Reset Fusion Debug logic 75 */ 76 void Fusion_Init(void); 77 78 /*! 79 * @brief Deinitializing Fusion core. 80 * 81 * Stop Fusion core 82 * Disable Fusion clocks 83 * Disable SSRAM access 84 * Poweroff Fusion 85 */ 86 void Fusion_Deinit(void); 87 88 /*! 89 * @brief Start Fusion core. 90 */ Fusion_Start(void)91static inline void Fusion_Start(void) 92 { 93 SIM_SEC_Type *base = SIM_SEC; 94 95 base->SYSCTRL0 &= ~SIM_SEC_SYSCTRL0_FUSION_DSP_STALL_MASK; 96 } 97 98 /*! 99 * @brief Stop Fusion core. 100 */ Fusion_Stop(void)101static inline void Fusion_Stop(void) 102 { 103 SIM_SEC_Type *base = SIM_SEC; 104 105 base->SYSCTRL0 |= SIM_SEC_SYSCTRL0_FUSION_DSP_STALL_MASK; 106 } 107 108 #if defined(__cplusplus) 109 } 110 #endif 111 112 /*! @} */ 113 114 #endif /* _FSL_FUSION_H_ */ 115