Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
mhal_mbox.h
1 /*
2  * (C) 2005-2020 MediaTek Inc. All rights reserved.
3  *
4  * Copyright Statement:
5  *
6  * This MT3620 driver software/firmware and related documentation
7  * ("MediaTek Software") are protected under relevant copyright laws.
8  * The information contained herein is confidential and proprietary to
9  * MediaTek Inc. ("MediaTek"). You may only use, reproduce, modify, or
10  * distribute (as applicable) MediaTek Software if you have agreed to and been
11  * bound by this Statement and the applicable license agreement with MediaTek
12  * ("License Agreement") and been granted explicit permission to do so within
13  * the License Agreement ("Permitted User"). If you are not a Permitted User,
14  * please cease any access or use of MediaTek Software immediately.
15  *
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
18  * PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS
19  * ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
21  * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
22  * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
23  * INCORPORATED IN, OR SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO
24  * LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
25  * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
26  * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
27  * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
28  * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
29  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
30  * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED
31  * HEREUNDER WILL BE ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
32  * RECEIVER TO MEDIATEK DURING THE PRECEDING TWELVE (12) MONTHS FOR SUCH
33  * MEDIATEK SOFTWARE AT ISSUE.
34  */
35 
36 #ifndef __MHAL_MBOX_H__
37 #define __MHAL_MBOX_H__
38 
39 #include <mhal_osai.h>
40 
105 #define MBOX_OK 0
106 
107 #define MBOX_EDEFAULT 1
108 
109 #define MBOX_EPTR 2
110 
111 #define MBOX_EEMPTY 3
112 
113 #define MBOX_EFULL 4
114 
137 };
138 
149 };
150 
152 typedef enum mbox_transfer_type {
160 
164 typedef enum mbox_ioctl_type {
177 
190 
199 
204 } mbox_ioctl_t;
205 
219  u32 data;
221  u32 cmd;
222 };
223 
227  int enable;
229  u32 id;
230 };
231 
233 struct mbox_int_arg {
237  u32 enable;
238 };
239 
248  u32 channel;
253  u32 rd_int;
258  u32 wr_int;
263  u32 nf_sts;
268  u32 ne_sts;
269 };
270 
274  u32 channel;
277 };
278 
289 #ifdef __cplusplus
290 extern "C" {
291 #endif
292 
304 int mtk_mhal_mbox_reset(void __iomem *base);
305 
320 int mtk_mhal_mbox_fifo_read(void __iomem *base, struct mbox_fifo_item *buf,
321  mbox_tr_type_t type);
322 
336 int mtk_mhal_mbox_fifo_write(void __iomem *base,
337  const struct mbox_fifo_item *buf,
338  mbox_tr_type_t type);
339 
411 int mtk_mhal_mbox_ioctl(void __iomem *base,
412  mbox_ioctl_t ctrl, void *arg);
413 
414 #ifdef __cplusplus
415 }
416 #endif
417 
427 #endif /* __MHAL_MBOX_H__ */
Get 'enable software interrupt' mask.
Definition: mhal_mbox.h:183
u32 ne_sts
Status: FIFO Non-Empty interrupt.
Definition: mhal_mbox.h:268
int enable
Software interrupt enable/disable.
Definition: mhal_mbox.h:227
Control software interrupt.
Definition: mhal_mbox.h:185
mbox_transfer_type
User should specify the transfer type when reading/writing FIFO.
Definition: mhal_mbox.h:152
enum mbox_int_type type
FIFO interrupt type.
Definition: mhal_mbox.h:235
Clear FIFO interrupt.
Definition: mhal_mbox.h:198
u32 nf_sts
Status: FIFO Non-Full interrupt.
Definition: mhal_mbox.h:263
SEM CM4 LOCK.
Definition: mhal_mbox.h:144
Only write/read cmd to/from FIFO.
Definition: mhal_mbox.h:154
enum mbox_ioctl_type mbox_ioctl_t
Users should specify the ioctl type when setting/getting information to/from MBOX HW...
Get FIFO interrupt status.
Definition: mhal_mbox.h:196
int mtk_mhal_mbox_fifo_write(void __iomem *base, const struct mbox_fifo_item *buf, mbox_tr_type_t type)
This function is used to write data to MBOX channel FIFO.
FIFO Write interrupt.
Definition: mhal_mbox.h:130
FIFO Read interrupt.
Definition: mhal_mbox.h:134
Invalid State.
Definition: mhal_mbox.h:148
Meaningless transfer type.
Definition: mhal_mbox.h:158
mbox_ioctl_type
Users should specify the ioctl type when setting/getting information to/from MBOX HW...
Definition: mhal_mbox.h:164
Clear software interrupt.
Definition: mhal_mbox.h:189
u32 channel
MBOX channel.
Definition: mhal_mbox.h:248
mbox_sem_status
Semaphore status, only used between CA7 and CM4.
Definition: mhal_mbox.h:140
Release sema.
Definition: mhal_mbox.h:174
enum mbox_transfer_type mbox_tr_type_t
User should specify the transfer type when reading/writing FIFO.
Get read FIFO count(CMD FIFO).
Definition: mhal_mbox.h:203
Set FIFO Non-Full threshold.
Definition: mhal_mbox.h:170
Trigger software interrupt.
Definition: mhal_mbox.h:179
u32 wr_int
Status: Write FIFO interrupt.
Definition: mhal_mbox.h:258
FIFO Non-Full interrupt.
Definition: mhal_mbox.h:132
Invalid.
Definition: mhal_mbox.h:136
Enable FIFO interrupt.
Definition: mhal_mbox.h:192
u32 id
Software interrupt id.
Definition: mhal_mbox.h:229
Acquire sema.
Definition: mhal_mbox.h:176
SEM UNLOCK.
Definition: mhal_mbox.h:142
Get FIFO Non-Empty threshold.
Definition: mhal_mbox.h:168
Set FIFO Non-Empty threshold.
Definition: mhal_mbox.h:166
u32 data
The data written to/read from MBOX FIFO.
Definition: mhal_mbox.h:219
u32 channel
MBOX channel.
Definition: mhal_mbox.h:274
int mtk_mhal_mbox_fifo_read(void __iomem *base, struct mbox_fifo_item *buf, mbox_tr_type_t type)
This function is used to read MBOX channel FIFO data.
int mtk_mhal_mbox_ioctl(void __iomem *base, mbox_ioctl_t ctrl, void *arg)
Control various hardware settings of MBOX.
FIFO Non-Empty interrupt.
Definition: mhal_mbox.h:128
Write/read both data and cmd to/from FIFO.
Definition: mhal_mbox.h:156
Enable software interrupt.
Definition: mhal_mbox.h:181
Get software interrupt status.
Definition: mhal_mbox.h:187
u32 rd_int
Status: Read FIFO interrupt.
Definition: mhal_mbox.h:253
Get FIFO Non-Full threshold.
Definition: mhal_mbox.h:172
Software interrupt information.
Definition: mhal_mbox.h:272
Get write FIFO count(CMD FIFO).
Definition: mhal_mbox.h:201
Get 'enable FIFO interrupt' mask.
Definition: mhal_mbox.h:194
To enable/disable FIFO interrupt specified by type.
Definition: mhal_mbox.h:233
FIFO interrupt status information or enable mask.
Definition: mhal_mbox.h:246
SEM CA7 LOCK.
Definition: mhal_mbox.h:146
u32 cmd
The cmd written to/read from MBOX FIFO.
Definition: mhal_mbox.h:221
The data and cmd written to/read from MBOX FIFO.
Definition: mhal_mbox.h:217
u32 swint_sts
Software interrupt status.
Definition: mhal_mbox.h:276
int mtk_mhal_mbox_reset(void __iomem *base)
This function is used to reset MBOX channel.
mbox_int_type
FIFO interrupt type.
Definition: mhal_mbox.h:126
u32 enable
FIFO interrupt enable/disable.
Definition: mhal_mbox.h:237
To enable/disable software interrupt specified by id.
Definition: mhal_mbox.h:225