1 /* *********************************************************************
2 * Broadcom Common Firmware Environment (CFE)
4 * Verification Test APIs File: vapi.h
6 * This module contains special low-level routines for use
7 * by verification programs.
9 * Author: Mitch Lichtenberg (mpl@broadcom.com)
11 *********************************************************************
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
16 * This software is furnished under license and may be used and
17 * copied only in accordance with the following terms and
18 * conditions. Subject to these conditions, you may download,
19 * copy, install, use, modify and distribute modified or unmodified
20 * copies of this software in source and/or binary form. No title
21 * or ownership is transferred hereby.
23 * 1) Any source code used, modified or distributed must reproduce
24 * and retain this copyright notice and list of conditions
25 * as they appear in the source file.
27 * 2) No right is granted to use any trade name, trademark, or
28 * logo of Broadcom Corporation. The "Broadcom Corporation"
29 * name may not be used to endorse or promote products derived
30 * from this software without the prior written permission of
31 * Broadcom Corporation.
33 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
34 * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
35 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36 * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
37 * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
38 * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
39 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
40 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
41 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
42 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
43 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
44 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
45 * THE POSSIBILITY OF SUCH DAMAGE.
46 ********************************************************************* */
49 #define VAPI_EPTSEAL 0x56415049
50 #define VAPI_CFESEAL 0xCFE10000
51 #define VAPI_SEAL_MASK 0xFFFF0000
52 #define VAPI_FMT_MASK 0x000000FF
53 #define VAPI_PRID_MASK 0x0000FF00
55 #define VAPI_DIAG_ENTRY 0x80020000
56 #define VAPI_DIAG_ENTRY_UNC 0xA0020000
57 #define VAPI_DIAG_ENTRY_MC 0xBFD00000
58 #define VAPI_MAGIC_NUMBER 0x1CFE2CFE3CFE4CFE
59 #define VAPI_MAGIC_NUMBER_UNC 0x0CFE1CFE2CFE3CFE
60 #define VAPI_MAGIC_NUMBER_MC 0xACFEBCFECCFEDCFE
62 #define VAPI_FMT_GPRS 0
63 #define VAPI_FMT_SOC 1
64 #define VAPI_FMT_DATA 2
65 #define VAPI_FMT_BUFFER 3
66 #define VAPI_FMT_TRACE 4
67 #define VAPI_FMT_EXIT 5
68 #define VAPI_FMT_FPRS 6
70 #define VAPI_PRNUM_SHIFT 8
72 #define VAPI_REC_SIGNATURE 0
73 #define VAPI_REC_SIZE 8
74 #define VAPI_REC_RA 16
75 #define VAPI_REC_DATA 24
77 #define VAPI_IDX_SIGNATURE 0
78 #define VAPI_IDX_SIZE 1
80 #define VAPI_IDX_DATA 3
83 #define VAPI_FUNC_EXIT 0x9fc00510
84 #define VAPI_FUNC_DUMPGPRS 0x9fc00520
85 #define VAPI_FUNC_SETLOG 0x9fc00530
86 #define VAPI_FUNC_LOGVALUE 0x9fc00540
87 #define VAPI_FUNC_LOGDATA 0x9fc00550
88 #define VAPI_FUNC_LOGTRACE 0x9fc00560
89 #define VAPI_FUNC_LOGSOC 0x9fc00570
90 #define VAPI_FUNC_LOGGPRS 0x9fc00580
91 #define VAPI_FUNC_DUMPSTRING 0x9fc00590
92 #define VAPI_FUNC_SETLEDS 0x9fc005a0
93 #define VAPI_FUNC_LOGFPRS 0x9fc005b0
96 #define VAPI_LOG_SETBUF(start,end) \
101 li k0, VAPI_FUNC_SETLOG ; \
105 #define VAPI_EXIT_CONST(val) \
109 li k0, VAPI_FUNC_EXIT ; \
113 #define VAPI_EXIT_REG(val) \
117 li k0, VAPI_FUNC_EXIT ; \
121 #define VAPI_LOG_CONST(id,value) \
126 li k0, VAPI_FUNC_LOGVALUE ; \
130 #define VAPI_LOG_REG(id,value) \
135 li k0, VAPI_FUNC_LOGVALUE ; \
139 #define VAPI_LOG_BUFFER(id,addr,nwords) \
145 li k0, VAPI_FUNC_LOGDATA ; \
149 #define VAPI_PUTS(text) \
156 li k0, VAPI_FUNC_DUMPSTRING ; \
160 #define VAPI_PRINTGPRS() \
163 li k0, VAPI_FUNC_DUMPGPRS ; \
167 #define VAPI_LOG_GPRS(id) \
171 li k0, VAPI_FUNC_LOGGPRS ; \
175 #define VAPI_LOG_FPRS(id) \
179 li k0, VAPI_FUNC_LOGFPRS ; \
183 #define VAPI_LOG_TRACE(id) \
187 li k0, VAPI_FUNC_LOGTRACE ; \
191 #define VAPI_LOG_SOCSTATE(id,bits) \
196 li k0, VAPI_FUNC_LOGSOC ; \
200 #define VAPI_SETLEDS(a,b,c,d) \
203 li a0, ((a) << 24) | ((b) << 16) | ((c) << 8) | (d) ; \
204 li k0, VAPI_FUNC_SETLEDS ; \
208 #ifndef SOC_AGENT_MC0
209 #define SOC_AGENT_MC0 0x00000001
210 #define SOC_AGENT_MC1 0x00000002
211 #define SOC_AGENT_MC 0x00000003
212 #define SOC_AGENT_L2 0x00000004
213 #define SOC_AGENT_MACDMA0 0x00000008
214 #define SOC_AGENT_MACDMA1 0x00000010
215 #define SOC_AGENT_MACDMA2 0x00000020
216 #define SOC_AGENT_MACDMA 0x00000038
217 #define SOC_AGENT_MACRMON0 0x00000040
218 #define SOC_AGENT_MACRMON1 0x00000080
219 #define SOC_AGENT_MACRMON2 0x00000100
220 #define SOC_AGENT_MACRMON 0x000001C0
221 #define SOC_AGENT_MAC0 0x00000200
222 #define SOC_AGENT_MAC1 0x00000400
223 #define SOC_AGENT_MAC2 0x00000800
224 #define SOC_AGENT_MAC 0x00000E00
225 #define SOC_AGENT_DUART 0x00001000
226 #define SOC_AGENT_GENCS 0x00002000
227 #define SOC_AGENT_GEN 0x00004000
228 #define SOC_AGENT_GPIO 0x00008000
229 #define SOC_AGENT_SMBUS0 0x00010000
230 #define SOC_AGENT_SMBUS1 0x00020000
231 #define SOC_AGENT_SMBUS 0x00030000
232 #define SOC_AGENT_TIMER 0x00040000
233 #define SOC_AGENT_SCD 0x00080000
234 #define SOC_AGENT_BUSERR 0x00100000
235 #define SOC_AGENT_DM 0x00200000
236 #define SOC_AGENT_IMR0 0x00400000
237 #define SOC_AGENT_IMR1 0x00800000
238 #define SOC_AGENT_IMR 0x00C00000