1 /* $NetBSD: cfe_api_int.h,v 1.2 2003/02/07 17:38:48 cgd Exp $ */
2 /* from: SiByte Id: cfe_api_int.h,v 1.21 2002/07/09 23:29:11 cgd Exp $ */
3
4 /*-
5 * Copyright 2000, 2001, 2002
6 * Broadcom Corporation. All rights reserved.
7 *
8 * This software is furnished under license and may be used and copied only
9 * in accordance with the following terms and conditions. Subject to these
10 * conditions, you may download, copy, install, use, modify and distribute
11 * modified or unmodified copies of this software in source and/or binary
12 * form. No title or ownership is transferred hereby.
13 *
14 * 1) Any source code used, modified or distributed must reproduce and
15 * retain this copyright notice and list of conditions as they appear in
16 * the source file.
17 *
18 * 2) No right is granted to use any trade name, trademark, or logo of
19 * Broadcom Corporation. The "Broadcom Corporation" name may not be
20 * used to endorse or promote products derived from this software
21 * without the prior written permission of Broadcom Corporation.
22 *
23 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
24 * WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
26 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
27 * FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
28 * LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 * OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 * $FreeBSD: releng/10.3/sys/dev/cfe/cfe_api_int.h 183370 2008-09-26 03:53:10Z imp $
36 */
37
38 /* *********************************************************************
39 *
40 * Broadcom Common Firmware Environment (CFE)
41 *
42 * Device function prototypes File: cfe_api_int.h
43 *
44 * This header defines all internal types and macros for the
45 * library. This is stuff that's not exported to an app
46 * using the library.
47 *
48 * Authors: Mitch Lichtenberg, Chris Demetriou
49 *
50 ********************************************************************* */
51
52 #ifndef CFE_API_INT_H
53 #define CFE_API_INT_H
54
55 /* *********************************************************************
56 * Constants
57 ********************************************************************* */
58
59 #define CFE_CMD_FW_GETINFO 0
60 #define CFE_CMD_FW_RESTART 1
61 #define CFE_CMD_FW_BOOT 2
62 #define CFE_CMD_FW_CPUCTL 3
63 #define CFE_CMD_FW_GETTIME 4
64 #define CFE_CMD_FW_MEMENUM 5
65 #define CFE_CMD_FW_FLUSHCACHE 6
66
67 #define CFE_CMD_DEV_GETHANDLE 9
68 #define CFE_CMD_DEV_ENUM 10
69 #define CFE_CMD_DEV_OPEN 11
70 #define CFE_CMD_DEV_INPSTAT 12
71 #define CFE_CMD_DEV_READ 13
72 #define CFE_CMD_DEV_WRITE 14
73 #define CFE_CMD_DEV_IOCTL 15
74 #define CFE_CMD_DEV_CLOSE 16
75 #define CFE_CMD_DEV_GETINFO 17
76
77 #define CFE_CMD_ENV_ENUM 20
78 #define CFE_CMD_ENV_GET 22
79 #define CFE_CMD_ENV_SET 23
80 #define CFE_CMD_ENV_DEL 24
81
82 #define CFE_CMD_MAX 32
83
84 #define CFE_CMD_VENDOR_USE 0x8000 /* codes above this are for customer use */
85
86 /* *********************************************************************
87 * Structures
88 ********************************************************************* */
89
90 typedef uint64_t cfe_xuint_t;
91 typedef int64_t cfe_xint_t;
92 typedef int64_t cfe_xptr_t;
93
94 typedef struct xiocb_buffer_s {
95 cfe_xuint_t buf_offset; /* offset on device (bytes) */
96 cfe_xptr_t buf_ptr; /* pointer to a buffer */
97 cfe_xuint_t buf_length; /* length of this buffer */
98 cfe_xuint_t buf_retlen; /* returned length (for read ops) */
99 cfe_xuint_t buf_ioctlcmd; /* IOCTL command (used only for IOCTLs) */
100 } xiocb_buffer_t;
101
102 #define buf_devflags buf_ioctlcmd /* returned device info flags */
103
104 typedef struct xiocb_inpstat_s {
105 cfe_xuint_t inp_status; /* 1 means input available */
106 } xiocb_inpstat_t;
107
108 typedef struct xiocb_envbuf_s {
109 cfe_xint_t enum_idx; /* 0-based enumeration index */
110 cfe_xptr_t name_ptr; /* name string buffer */
111 cfe_xint_t name_length; /* size of name buffer */
112 cfe_xptr_t val_ptr; /* value string buffer */
113 cfe_xint_t val_length; /* size of value string buffer */
114 } xiocb_envbuf_t;
115
116 typedef struct xiocb_cpuctl_s {
117 cfe_xuint_t cpu_number; /* cpu number to control */
118 cfe_xuint_t cpu_command; /* command to issue to CPU */
119 cfe_xuint_t start_addr; /* CPU start address */
120 cfe_xuint_t gp_val; /* starting GP value */
121 cfe_xuint_t sp_val; /* starting SP value */
122 cfe_xuint_t a1_val; /* starting A1 value */
123 } xiocb_cpuctl_t;
124
125 typedef struct xiocb_time_s {
126 cfe_xint_t ticks; /* current time in ticks */
127 } xiocb_time_t;
128
129 typedef struct xiocb_exitstat_s {
130 cfe_xint_t status;
131 } xiocb_exitstat_t;
132
133 typedef struct xiocb_meminfo_s {
134 cfe_xint_t mi_idx; /* 0-based enumeration index */
135 cfe_xint_t mi_type; /* type of memory block */
136 cfe_xuint_t mi_addr; /* physical start address */
137 cfe_xuint_t mi_size; /* block size */
138 } xiocb_meminfo_t;
139
140 typedef struct xiocb_fwinfo_s {
141 cfe_xint_t fwi_version; /* major, minor, eco version */
142 cfe_xint_t fwi_totalmem; /* total installed mem */
143 cfe_xint_t fwi_flags; /* various flags */
144 cfe_xint_t fwi_boardid; /* board ID */
145 cfe_xint_t fwi_bootarea_va; /* VA of boot area */
146 cfe_xint_t fwi_bootarea_pa; /* PA of boot area */
147 cfe_xint_t fwi_bootarea_size; /* size of boot area */
148 cfe_xint_t fwi_reserved1;
149 cfe_xint_t fwi_reserved2;
150 cfe_xint_t fwi_reserved3;
151 } xiocb_fwinfo_t;
152
153 typedef struct cfe_xiocb_s {
154 cfe_xuint_t xiocb_fcode; /* IOCB function code */
155 cfe_xint_t xiocb_status; /* return status */
156 cfe_xint_t xiocb_handle; /* file/device handle */
157 cfe_xuint_t xiocb_flags; /* flags for this IOCB */
158 cfe_xuint_t xiocb_psize; /* size of parameter list */
159 union {
160 xiocb_buffer_t xiocb_buffer; /* buffer parameters */
161 xiocb_inpstat_t xiocb_inpstat; /* input status parameters */
162 xiocb_envbuf_t xiocb_envbuf; /* environment function parameters */
163 xiocb_cpuctl_t xiocb_cpuctl; /* CPU control parameters */
164 xiocb_time_t xiocb_time; /* timer parameters */
165 xiocb_meminfo_t xiocb_meminfo; /* memory arena info parameters */
166 xiocb_fwinfo_t xiocb_fwinfo; /* firmware information */
167 xiocb_exitstat_t xiocb_exitstat; /* Exit Status */
168 } plist;
169 } cfe_xiocb_t;
170
171 #endif /* CFE_API_INT_H */
Cache object: 0b8296e425e51288ea545546f9b5773a
|