]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blob - packages/ti/sdo/ipc/family/vayu/NotifySetup.xdc
SDOCM00106584 Notify mailbox driver support on DRA7xx (IPU, HOST) - Part 1
[ipc/ipcdev.git] / packages / ti / sdo / ipc / family / vayu / NotifySetup.xdc
1 /*
2  * Copyright (c) 2012-2014 Texas Instruments Incorporated - http://www.ti.com
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * *  Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * *  Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * *  Neither the name of Texas Instruments Incorporated nor the names of
17  *    its contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
33 /*
34  *  ======== NotifySetup.xdc ========
35  */
36 package ti.sdo.ipc.family.vayu;
38 import xdc.runtime.Assert;
39 import ti.sdo.utils.MultiProc;
41 /*!
42  *  ======== NotifySetup ========
43  *  Notify setup proxy for Vayu
44  *
45  *  This module creates and registers all drivers necessary for
46  *  inter-processor notification on Vayu.
47  */
48 @ModuleStartup
49 @Template("./NotifySetup.xdt")
51 module NotifySetup inherits ti.sdo.ipc.interfaces.INotifySetup
52 {
53     /*
54      *  ======== DriverIsr ========
55      *  Notify driver isr function type definition
56      *  param1 = mailbox table index
57      */
58     typedef Void (*DriverIsr)(UInt16);
60     /*!
61      *  ======== A_internal ========
62      *  Internal implementation error.
63      */
64     config Assert.Id A_internal = {
65         msg: "A_internal: internal implementation error"
66     };
68     /*!
69      *  Interrupt vector id for Vayu/DSP.
70      */
71     config UInt dspIntVectId = 4;
73     /*!
74      *  Interrupt vector id for Vayu/EVE
75      */
76     config UInt eveIntVectId_INTC0 = 4;
77     config UInt eveIntVectId_INTC1 = 8;
79     /*!
80      *  Available notify drivers.
81      */
82     enum Driver {
83         Driver_SHAREDMEMORY = 0x01,     /*! shared memory */
84         Driver_MAILBOX = 0x02           /*! hardware mailbox */
85     };
87     /*!
88      *  Notify driver connection specification.
89      */
90     struct Connection {
91         Driver driver;                  /*! notify driver */
92         String procName;                /*! remote processor name */
93     };
95     /*!
96      *  Specify notify driver for given processor connections.
97      */
98     metaonly config Connection connections[length];
100     /*!
101      *  ======== plugHwi ========
102      *  Register an isr for the given interrupt and event.
103      *
104      *  @param(remoteProcId) The MutiProc Id of the remote processor
105      *  which will raise the given interrupt.
106      *
107      *  @param(cpuIntrNum) The interrupt number which will be raised
108      *  by the remote processor.
109      *
110      *  @param(isr) The ISR which should be invoked to service the
111      *  given interrupt.
112      */
113     Void plugHwi(UInt16 remoteProcId, Int cpuIntrNum, DriverIsr isr);
115     /*!
116      *  ======== unplugHwi ========
117      *  Unregister the isr for the given interrupt.
118      */
119     Void unplugHwi(UInt16 remoteProcId, Int cpuIntrNum);
121     /*! @_nodoc
122      *  ======== interruptTable ========
123      *  Accessor method to return interrupt id for given virtual proc id
124      */
125     UInt16 interruptTable(Int srcVirtId);
127 internal:
128     /* total number of cores on Vayu SoC */
129     const UInt8 NUM_CORES = 11;
131     /* number of cores in eve subsystem */
132     const UInt8 NUM_EVES = 4;
134     /* number of internal eve mailboxes */
135     const UInt8 NUM_EVE_MBX = 12;
137     /* number of system mailboxes (used by IPC) */
138     const UInt8 NUM_SYS_MBX = 4;
140     /*  Mailbox table for storing encoded base address, mailbox user ID,
141      *  and sub-mailbox index.
142      */
143     config UInt32 mailboxTable[NUM_CORES * NUM_CORES];
145     /* base address table for the mailbox subsystem */
146     config UInt32 mailboxBaseAddr[NUM_EVE_MBX + NUM_SYS_MBX];
148     /* map procId to discrete processor/core */
149     config UInt eve1ProcId = MultiProc.INVALIDID;
150     config UInt eve2ProcId = MultiProc.INVALIDID;
151     config UInt eve3ProcId = MultiProc.INVALIDID;
152     config UInt eve4ProcId = MultiProc.INVALIDID;
153     config UInt dsp1ProcId = MultiProc.INVALIDID;
154     config UInt dsp2ProcId = MultiProc.INVALIDID;
155     config UInt ipu1_0ProcId = MultiProc.INVALIDID;  /* also used for ipu1 */
156     config UInt ipu1_1ProcId = MultiProc.INVALIDID;
157     config UInt ipu2_0ProcId = MultiProc.INVALIDID;  /* also used for ipu2 */
158     config UInt ipu2_1ProcId = MultiProc.INVALIDID;
159     config UInt hostProcId = MultiProc.INVALIDID;
161     /* map MultiProc ID to virtual ID, virtId = procIdTable[procId] */
162     config UInt32 procIdTable[NUM_CORES];
164     /*
165      *  ======== driverType ========
166      */
167     Driver driverType(UInt16 remoteProcId);
169     /*
170      *  ======== Shm_attach ========
171      */
172     Int Shm_attach(UInt16 remoteProcId, Ptr sharedAddr);
174     /*
175      *  ======== Shm_sharedMemReq ========
176      */
177     SizeT Shm_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr);
179     /*
180      *  ======== Mbx_attach ========
181      */
182     Int Mbx_attach(UInt16 remoteProcId, Ptr sharedAddr);
184     /*
185      *  ======== Mbx_sharedMemReq ========
186      */
187     SizeT Mbx_sharedMemReq(UInt16 remoteProcId, Ptr sharedAddr);
189     /*
190      *  ======== dispatchIsr ========
191      *  Dispatch interrupt to notify driver instance.
192      */
193     Void dispatchIsr(UArg arg);
195     /*
196      *  ======== DrvBind ========
197      */
198     struct DrvBind {
199         Driver driver;                  /*! notify driver */
200         UInt16 procId;                  /*! remote processor ID */
201     };
203     /*
204      *  ======== Module_State ========
205      */
206     struct Module_State {
207         /* interrupt plug counter */
208         UInt16 numPlugged[];
210         /* connection array */
211         DrvBind connAry[length];
213         /*  Interrupt event IDs used to communicate with this processor.
214          *  This table is indexed by virtual processor ID.
215          */
216         UInt16 interruptTable[NUM_CORES];
218         /*  Notify driver isr dispatch table. This table is indexed
219          *  by virtual processor ID.
220          */
221         DriverIsr isrDispatchTable[NUM_CORES];
222     };