1 /**
2   ******************************************************************************
3   * @file    rtl8721d_ipc.h
4   * @author
5   * @version V1.0.0
6   * @date    2017-11-06
7   * @brief   This file contains all the functions prototypes for the Internal Processor Communication(IPC)
8   *
9   ******************************************************************************
10   * @attention
11   *
12   * This module is a confidential and proprietary property of RealTek and
13   * possession or use of this module requires written permission of RealTek.
14   *
15   * Copyright(c) 2015, Realtek Semiconductor Corporation. All rights reserved.
16   ******************************************************************************
17   */
18 
19 #ifndef _RTL8721D_IPC_H_
20 #define _RTL8721D_IPC_H_
21 
22 /** @addtogroup AmebaD_Platform
23   * @{
24   */
25 
26 /** @defgroup IPC
27   * @brief IPC driver modules
28   * @{
29   */
30 
31 /** @addtogroup IPC
32   * @verbatim
33   *****************************************************************************************
34   * Internal Processor Communication(IPC) Introduction
35   *****************************************************************************************
36   *		-32 core-to-core interrupts.
37   *		-16 hardware semephone.
38   *		-CPU ID get.
39   *****************************************************************************************
40   * @endverbatim
41   */
42 
43 /* Exported functions --------------------------------------------------------*/
44 /** @defgroup IPC_Exported_Functions IPC Exported Functions
45   * @{
46   */
47 void IPC_INTConfig(IPC_TypeDef *IPCx, u8 IPC_ChNum, u32 NewState);
48 void IPC_IERSet(IPC_TypeDef *IPCx, u32 IPC_Chs);
49 u32 IPC_IERGet(IPC_TypeDef *IPCx);
50 void IPC_INTRequest(IPC_TypeDef *IPCx, u8 IPC_ChNum);
51 void IPC_INTClear(IPC_TypeDef *IPCx, u8 IPC_ChNum);
52 u32 IPC_INTGet(IPC_TypeDef *IPCx);
53 u32 IPC_CPUID(void);
54 u32 IPC_INTHandler(void *Data);
55 void IPC_INTUserHandler(u8 IPC_ChNum, VOID *IrqHandler, VOID *IrqData);
56 /**
57   * @}
58   */
59 
60 /* Exported constants --------------------------------------------------------*/
61 
62 /** @defgroup IPC_Exported_Constants IPC Exported Constants
63   * @{
64   */
65 
66 /* Channel Definitions --------------------------------------------------------*/
67 /**************************************************************************//**
68  * @defgroup IPC_Channel_Definitions IPC Channel Definitions
69  * @{
70  *****************************************************************************/
71 #define IPC_INT_CHAN_SHELL_SWITCH				0	/*!<  KM0 <--> KM4 Switch shell */
72 #define IPC_INT_CHAN_WIFI_FW					1	/*!<  KM0 <--  KM4 FW INFO*/
73 #define IPC_INT_CHAN_FLASHPG_REQ				2	/*!<  KM0 <-->  KM4 Flash Program REQUEST*/
74 #define IPC_INT_KM4_TICKLESS_INDICATION		3	/*!<  KM0 <--  KM4 tickless indicate */
75 /** @} */
76 
77 /**************************************************************************//**
78  * @defgroup IPC0_USER_BUF_Definitions LP IPC User IDX Definitions
79  * @{
80  *****************************************************************************/
81 #define IPC_USER_BUF_LOG_RP					7	/*!<  logbuf write pointer */
82 #define IPC_USER_BUF_LOG_WP					8	/*!<  logbuf read pointer */
83 /** @} */
84 
85 /**************************************************************************//**
86  * @defgroup IPC_SEM_IDX_Definitions LP IPC SEM IDX Definitions
87  * @{
88  *****************************************************************************/
89 #define IPC_SEM_INDEX_LOG							0	/*!<  KM0 <-- KM4 log print */
90 
91 /** @} */
92 
93 
94 /**
95   * @}
96   */
97 
98 /* Exported Types --------------------------------------------------------*/
99 
100 /** @defgroup IPC_Exported_Constants IPC Exported Types
101   * @{
102   */
103 
104 /* Other definations --------------------------------------------------------*/
105 typedef void (*IPC_IRQ_FUN)(VOID *Data, u32 IrqStatus, u32 ChanNum);
106 
107 typedef enum
108 {
109 	IPC_USER_POINT = 0,
110 	IPC_USER_DATA	= 1
111 } USER_MSG_TYP_DEF;
112 
113 typedef struct _IPC_INIT_TABLE_ {
114 	u32 USER_MSG_TYPE;
115 	void (*func)(VOID *Data, u32 IrqStatus, u32 ChanNum);
116 	VOID *IrqData;
117 }IPC_INIT_TABLE, *PIPC_INIT_TABLE;
118 
119 extern const IPC_INIT_TABLE  ipc_init_config[];
120 
121 /**
122   * @}
123   */
124 
125 /**
126   * @}
127   */
128 
129 /**
130   * @}
131   */
132 
133 #endif
134 /******************* (C) COPYRIGHT 2016 Realtek Semiconductor *****END OF FILE****/
135