aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/fw/cfe
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/fw/cfe')
-rw-r--r--arch/mips/include/asm/fw/cfe/cfe_api.h122
-rw-r--r--arch/mips/include/asm/fw/cfe/cfe_error.h80
2 files changed, 202 insertions, 0 deletions
diff --git a/arch/mips/include/asm/fw/cfe/cfe_api.h b/arch/mips/include/asm/fw/cfe/cfe_api.h
new file mode 100644
index 000000000000..0995575db320
--- /dev/null
+++ b/arch/mips/include/asm/fw/cfe/cfe_api.h
@@ -0,0 +1,122 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18/*
19 * Broadcom Common Firmware Environment (CFE)
20 *
21 * This file contains declarations for doing callbacks to
22 * cfe from an application. It should be the only header
23 * needed by the application to use this library
24 *
25 * Authors: Mitch Lichtenberg, Chris Demetriou
26 */
27#ifndef CFE_API_H
28#define CFE_API_H
29
30#include <linux/types.h>
31#include <linux/string.h>
32
33typedef long intptr_t;
34
35
36/*
37 * Constants
38 */
39
40/* Seal indicating CFE's presence, passed to user program. */
41#define CFE_EPTSEAL 0x43464531
42
43#define CFE_MI_RESERVED 0 /* memory is reserved, do not use */
44#define CFE_MI_AVAILABLE 1 /* memory is available */
45
46#define CFE_FLG_WARMSTART 0x00000001
47#define CFE_FLG_FULL_ARENA 0x00000001
48#define CFE_FLG_ENV_PERMANENT 0x00000001
49
50#define CFE_CPU_CMD_START 1
51#define CFE_CPU_CMD_STOP 0
52
53#define CFE_STDHANDLE_CONSOLE 0
54
55#define CFE_DEV_NETWORK 1
56#define CFE_DEV_DISK 2
57#define CFE_DEV_FLASH 3
58#define CFE_DEV_SERIAL 4
59#define CFE_DEV_CPU 5
60#define CFE_DEV_NVRAM 6
61#define CFE_DEV_CLOCK 7
62#define CFE_DEV_OTHER 8
63#define CFE_DEV_MASK 0x0F
64
65#define CFE_CACHE_FLUSH_D 1
66#define CFE_CACHE_INVAL_I 2
67#define CFE_CACHE_INVAL_D 4
68#define CFE_CACHE_INVAL_L2 8
69
70#define CFE_FWI_64BIT 0x00000001
71#define CFE_FWI_32BIT 0x00000002
72#define CFE_FWI_RELOC 0x00000004
73#define CFE_FWI_UNCACHED 0x00000008
74#define CFE_FWI_MULTICPU 0x00000010
75#define CFE_FWI_FUNCSIM 0x00000020
76#define CFE_FWI_RTLSIM 0x00000040
77
78typedef struct {
79 int64_t fwi_version; /* major, minor, eco version */
80 int64_t fwi_totalmem; /* total installed mem */
81 int64_t fwi_flags; /* various flags */
82 int64_t fwi_boardid; /* board ID */
83 int64_t fwi_bootarea_va; /* VA of boot area */
84 int64_t fwi_bootarea_pa; /* PA of boot area */
85 int64_t fwi_bootarea_size; /* size of boot area */
86} cfe_fwinfo_t;
87
88
89/*
90 * Defines and prototypes for functions which take no arguments.
91 */
92int64_t cfe_getticks(void);
93
94/*
95 * Defines and prototypes for the rest of the functions.
96 */
97int cfe_close(int handle);
98int cfe_cpu_start(int cpu, void (*fn) (void), long sp, long gp, long a1);
99int cfe_cpu_stop(int cpu);
100int cfe_enumenv(int idx, char *name, int namelen, char *val, int vallen);
101int cfe_enummem(int idx, int flags, uint64_t * start, uint64_t * length,
102 uint64_t * type);
103int cfe_exit(int warm, int status);
104int cfe_flushcache(int flg);
105int cfe_getdevinfo(char *name);
106int cfe_getenv(char *name, char *dest, int destlen);
107int cfe_getfwinfo(cfe_fwinfo_t * info);
108int cfe_getstdhandle(int flg);
109int cfe_init(uint64_t handle, uint64_t ept);
110int cfe_inpstat(int handle);
111int cfe_ioctl(int handle, unsigned int ioctlnum, unsigned char *buffer,
112 int length, int *retlen, uint64_t offset);
113int cfe_open(char *name);
114int cfe_read(int handle, unsigned char *buffer, int length);
115int cfe_readblk(int handle, int64_t offset, unsigned char *buffer,
116 int length);
117int cfe_setenv(char *name, char *val);
118int cfe_write(int handle, unsigned char *buffer, int length);
119int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer,
120 int length);
121
122#endif /* CFE_API_H */
diff --git a/arch/mips/include/asm/fw/cfe/cfe_error.h b/arch/mips/include/asm/fw/cfe/cfe_error.h
new file mode 100644
index 000000000000..b80374636279
--- /dev/null
+++ b/arch/mips/include/asm/fw/cfe/cfe_error.h
@@ -0,0 +1,80 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19/*
20 * Broadcom Common Firmware Environment (CFE)
21 *
22 * CFE's global error code list is here.
23 *
24 * Author: Mitch Lichtenberg
25 */
26
27#define CFE_OK 0
28#define CFE_ERR -1 /* generic error */
29#define CFE_ERR_INV_COMMAND -2
30#define CFE_ERR_EOF -3
31#define CFE_ERR_IOERR -4
32#define CFE_ERR_NOMEM -5
33#define CFE_ERR_DEVNOTFOUND -6
34#define CFE_ERR_DEVOPEN -7
35#define CFE_ERR_INV_PARAM -8
36#define CFE_ERR_ENVNOTFOUND -9
37#define CFE_ERR_ENVREADONLY -10
38
39#define CFE_ERR_NOTELF -11
40#define CFE_ERR_NOT32BIT -12
41#define CFE_ERR_WRONGENDIAN -13
42#define CFE_ERR_BADELFVERS -14
43#define CFE_ERR_NOTMIPS -15
44#define CFE_ERR_BADELFFMT -16
45#define CFE_ERR_BADADDR -17
46
47#define CFE_ERR_FILENOTFOUND -18
48#define CFE_ERR_UNSUPPORTED -19
49
50#define CFE_ERR_HOSTUNKNOWN -20
51
52#define CFE_ERR_TIMEOUT -21
53
54#define CFE_ERR_PROTOCOLERR -22
55
56#define CFE_ERR_NETDOWN -23
57#define CFE_ERR_NONAMESERVER -24
58
59#define CFE_ERR_NOHANDLES -25
60#define CFE_ERR_ALREADYBOUND -26
61
62#define CFE_ERR_CANNOTSET -27
63#define CFE_ERR_NOMORE -28
64#define CFE_ERR_BADFILESYS -29
65#define CFE_ERR_FSNOTAVAIL -30
66
67#define CFE_ERR_INVBOOTBLOCK -31
68#define CFE_ERR_WRONGDEVTYPE -32
69#define CFE_ERR_BBCHECKSUM -33
70#define CFE_ERR_BOOTPROGCHKSUM -34
71
72#define CFE_ERR_LDRNOTAVAIL -35
73
74#define CFE_ERR_NOTREADY -36
75
76#define CFE_ERR_GETMEM -37
77#define CFE_ERR_SETMEM -38
78
79#define CFE_ERR_NOTCONN -39
80#define CFE_ERR_ADDRINUSE -40