2 /*
3 Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 #ifndef _ASP_MSG_COMMON_H_
37 #define _ASP_MSG_COMMON_H_
39 #include <xdc/std.h>
40 #include <ti/xdais/ialg.h>
41 #include <ti/ipc/MessageQ.h>
43 /* round up the value 'size' to the next 'align' boundary */
44 #define ROUNDUP(size, align) \
45 (UInt32)(((UInt32)(size) + ((UInt32)(align) - 1)) & ~((UInt32)(align) - 1))
47 #define MASTER_NAME ( "CORE0" ) // DSP is MASTER
48 #define SLAVE_NAME ( "HOST" ) // ARM is SLAVE
50 #define AspMsg_MasterMsgQueName ( "MASTER:MsgQ:01" )
51 #define AspMsg_SlaveMsgQueName ( "%s:MsgQ:01" ) /* %s is each slave's Proc Name */
53 #define ASP_MSG_BUF_LEN 32 // message buffer len, do we really need 32 bytes?
55 // ASP (Master-To-)Slave Commands
56 typedef enum ASP_Slave_Cmd {
57 ASP_SLAVE_NULL, // 0
58 ASP_SLAVE_START, // 1
59 ASP_SLAVE_EXIT, // 2
60 ASP_SLAVE_DEC_SOURCE_SELECT, // 3
61 ASP_SLAVE_DEC_EXIT, // 4
62 ASP_SLAVE_DEC_CONTROL, // 5
63 ASP_SLAVE_DEC_ACTIVATE, // 6
64 ASP_SLAVE_DEC_RESET, // 7
65 ASP_SLAVE_DEC_INFO, // 8
66 ASP_SLAVE_DEC_DECODE, // 9
67 ASP_SLAVE_DEC_DEACTIVATE, // 10
68 ASP_SLAVE_NCOMMANDS // 11
69 } ASP_Slave_Cmd;
71 // ASP (Slave-To-)Master Commands
72 typedef enum ASP_Master_Cmd {
73 ASP_MASTER_NULL = ASP_SLAVE_NCOMMANDS, // 11
74 ASP_MASTER_START_DONE, // 12
75 ASP_MASTER_EXIT_DONE, // 13
76 ASP_MASTER_DEC_SOURCE_SELECT_DONE, // 14
77 ASP_MASTER_DEC_EXIT_DONE, // 15
78 ASP_MASTER_DEC_CONTROL_DONE, // 16
79 ASP_MASTER_DEC_ACTIVATE_DONE, // 17
80 ASP_MASTER_DEC_RESET_DONE, // 18
81 ASP_MASTER_DEC_INFO_DONE, // 19 // temp
82 ASP_MASTER_DEC_DECODE_DONE, // 20 // temp
83 ASP_MASTER_DEC_DEACTIVATE_DONE // 21
84 } ASP_Master_Cmd;
86 // ASP Message
87 typedef struct ASP_Msg
88 {
89 MessageQ_MsgHeader reserved;
91 UInt32 cmd; // command
92 UInt16 procId; // processor Id of sender
93 Uint16 expectResp; // whether response expected from receiver + align buf to 32-bit boundary
94 UInt32 messageId; // MB bit: response bit, LS 31 bits: message Id
95 Char buf[ASP_MSG_BUF_LEN]; // buffer for message parameters
96 } ASP_Msg;
100 #endif /* _ASP_MSG_COMMON_H_ */