···1515 * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.1717 */1818-1919-/* *********************************************************************2020- *2121- * Broadcom Common Firmware Environment (CFE)2222- *2323- * Device function prototypes File: cfe_api_int.h2424- *2525- * This header defines all internal types and macros for the2626- * library. This is stuff that's not exported to an app2727- * using the library.2828- *2929- * Authors: Mitch Lichtenberg, Chris Demetriou3030- *3131- ********************************************************************* */3232-3318#ifndef CFE_API_INT_H3419#define CFE_API_INT_H35203636-/* *********************************************************************3737- * Constants3838- ********************************************************************* */3939-2121+/*2222+ * Constants.2323+ */4024#define CFE_CMD_FW_GETINFO 04125#define CFE_CMD_FW_RESTART 14226#define CFE_CMD_FW_BOOT 2···48644965#define CFE_CMD_VENDOR_USE 0x8000 /* codes above this are for customer use */50665151-/* *********************************************************************5252- * Structures5353- ********************************************************************* */6767+/*6868+ * Structures.6969+ */54705555-typedef uint64_t cfe_xuint_t;5656-typedef int64_t cfe_xint_t;5757-typedef int64_t cfe_xptr_t;7171+/* eeek, signed "pointers" */7272+typedef s64 cfe_xptr_t;58735959-typedef struct xiocb_buffer_s {6060- cfe_xuint_t buf_offset; /* offset on device (bytes) */7474+struct xiocb_buffer {7575+ u64 buf_offset; /* offset on device (bytes) */6176 cfe_xptr_t buf_ptr; /* pointer to a buffer */6262- cfe_xuint_t buf_length; /* length of this buffer */6363- cfe_xuint_t buf_retlen; /* returned length (for read ops) */6464- cfe_xuint_t buf_ioctlcmd; /* IOCTL command (used only for IOCTLs) */6565-} xiocb_buffer_t;7777+ u64 buf_length; /* length of this buffer */7878+ u64 buf_retlen; /* returned length (for read ops) */7979+ u64 buf_ioctlcmd; /* IOCTL command (used only for IOCTLs) */8080+};66816767-#define buf_devflags buf_ioctlcmd /* returned device info flags */8282+struct xiocb_inpstat {8383+ u64 inp_status; /* 1 means input available */8484+};68856969-typedef struct xiocb_inpstat_s {7070- cfe_xuint_t inp_status; /* 1 means input available */7171-} xiocb_inpstat_t;7272-7373-typedef struct xiocb_envbuf_s {7474- cfe_xint_t enum_idx; /* 0-based enumeration index */8686+struct xiocb_envbuf {8787+ s64 enum_idx; /* 0-based enumeration index */7588 cfe_xptr_t name_ptr; /* name string buffer */7676- cfe_xint_t name_length; /* size of name buffer */8989+ s64 name_length; /* size of name buffer */7790 cfe_xptr_t val_ptr; /* value string buffer */7878- cfe_xint_t val_length; /* size of value string buffer */7979-} xiocb_envbuf_t;9191+ s64 val_length; /* size of value string buffer */9292+};80938181-typedef struct xiocb_cpuctl_s {8282- cfe_xuint_t cpu_number; /* cpu number to control */8383- cfe_xuint_t cpu_command; /* command to issue to CPU */8484- cfe_xuint_t start_addr; /* CPU start address */8585- cfe_xuint_t gp_val; /* starting GP value */8686- cfe_xuint_t sp_val; /* starting SP value */8787- cfe_xuint_t a1_val; /* starting A1 value */8888-} xiocb_cpuctl_t;9494+struct xiocb_cpuctl {9595+ u64 cpu_number; /* cpu number to control */9696+ u64 cpu_command; /* command to issue to CPU */9797+ u64 start_addr; /* CPU start address */9898+ u64 gp_val; /* starting GP value */9999+ u64 sp_val; /* starting SP value */100100+ u64 a1_val; /* starting A1 value */101101+};891029090-typedef struct xiocb_time_s {9191- cfe_xint_t ticks; /* current time in ticks */9292-} xiocb_time_t;103103+struct xiocb_time {104104+ s64 ticks; /* current time in ticks */105105+};931069494-typedef struct xiocb_exitstat_s {9595- cfe_xint_t status;9696-} xiocb_exitstat_t;107107+struct xiocb_exitstat{108108+ s64 status;109109+};971109898-typedef struct xiocb_meminfo_s {9999- cfe_xint_t mi_idx; /* 0-based enumeration index */100100- cfe_xint_t mi_type; /* type of memory block */101101- cfe_xuint_t mi_addr; /* physical start address */102102- cfe_xuint_t mi_size; /* block size */103103-} xiocb_meminfo_t;111111+struct xiocb_meminfo {112112+ s64 mi_idx; /* 0-based enumeration index */113113+ s64 mi_type; /* type of memory block */114114+ u64 mi_addr; /* physical start address */115115+ u64 mi_size; /* block size */116116+};104117105105-typedef struct xiocb_fwinfo_s {106106- cfe_xint_t fwi_version; /* major, minor, eco version */107107- cfe_xint_t fwi_totalmem; /* total installed mem */108108- cfe_xint_t fwi_flags; /* various flags */109109- cfe_xint_t fwi_boardid; /* board ID */110110- cfe_xint_t fwi_bootarea_va; /* VA of boot area */111111- cfe_xint_t fwi_bootarea_pa; /* PA of boot area */112112- cfe_xint_t fwi_bootarea_size; /* size of boot area */113113- cfe_xint_t fwi_reserved1;114114- cfe_xint_t fwi_reserved2;115115- cfe_xint_t fwi_reserved3;116116-} xiocb_fwinfo_t;118118+struct xiocb_fwinfo {119119+ s64 fwi_version; /* major, minor, eco version */120120+ s64 fwi_totalmem; /* total installed mem */121121+ s64 fwi_flags; /* various flags */122122+ s64 fwi_boardid; /* board ID */123123+ s64 fwi_bootarea_va; /* VA of boot area */124124+ s64 fwi_bootarea_pa; /* PA of boot area */125125+ s64 fwi_bootarea_size; /* size of boot area */126126+ s64 fwi_reserved1;127127+ s64 fwi_reserved2;128128+ s64 fwi_reserved3;129129+};117130118118-typedef struct cfe_xiocb_s {119119- cfe_xuint_t xiocb_fcode; /* IOCB function code */120120- cfe_xint_t xiocb_status; /* return status */121121- cfe_xint_t xiocb_handle; /* file/device handle */122122- cfe_xuint_t xiocb_flags; /* flags for this IOCB */123123- cfe_xuint_t xiocb_psize; /* size of parameter list */131131+struct cfe_xiocb {132132+ u64 xiocb_fcode; /* IOCB function code */133133+ s64 xiocb_status; /* return status */134134+ s64 xiocb_handle; /* file/device handle */135135+ u64 xiocb_flags; /* flags for this IOCB */136136+ u64 xiocb_psize; /* size of parameter list */124137 union {125125- xiocb_buffer_t xiocb_buffer; /* buffer parameters */126126- xiocb_inpstat_t xiocb_inpstat; /* input status parameters */127127- xiocb_envbuf_t xiocb_envbuf; /* environment function parameters */128128- xiocb_cpuctl_t xiocb_cpuctl; /* CPU control parameters */129129- xiocb_time_t xiocb_time; /* timer parameters */130130- xiocb_meminfo_t xiocb_meminfo; /* memory arena info parameters */131131- xiocb_fwinfo_t xiocb_fwinfo; /* firmware information */132132- xiocb_exitstat_t xiocb_exitstat; /* Exit Status */133133- } plist;134134-} cfe_xiocb_t;138138+ /* buffer parameters */139139+ struct xiocb_buffer xiocb_buffer;135140136136-#endif /* CFE_API_INT_H */141141+ /* input status parameters */142142+ struct xiocb_inpstat xiocb_inpstat;143143+144144+ /* environment function parameters */145145+ struct xiocb_envbuf xiocb_envbuf;146146+147147+ /* CPU control parameters */148148+ struct xiocb_cpuctl xiocb_cpuctl;149149+150150+ /* timer parameters */151151+ struct xiocb_time xiocb_time;152152+153153+ /* memory arena info parameters */154154+ struct xiocb_meminfo xiocb_meminfo;155155+156156+ /* firmware information */157157+ struct xiocb_fwinfo xiocb_fwinfo;158158+159159+ /* Exit Status */160160+ struct xiocb_exitstat xiocb_exitstat;161161+ } plist;162162+};163163+164164+#endif /* CFE_API_INT_H */
+12-75
include/asm-mips/fw/cfe/cfe_api.h
···1515 * along with this program; if not, write to the Free Software1616 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.1717 */1818-1919-/* *********************************************************************2020- *2121- * Broadcom Common Firmware Environment (CFE)2222- *2323- * Device function prototypes File: cfe_api.h2424- *2525- * This file contains declarations for doing callbacks to2626- * cfe from an application. It should be the only header2727- * needed by the application to use this library2828- *2929- * Authors: Mitch Lichtenberg, Chris Demetriou3030- *3131- ********************************************************************* */3232-1818+/*1919+ * Broadcom Common Firmware Environment (CFE)2020+ *2121+ * This file contains declarations for doing callbacks to2222+ * cfe from an application. It should be the only header2323+ * needed by the application to use this library2424+ *2525+ * Authors: Mitch Lichtenberg, Chris Demetriou2626+ */3327#ifndef CFE_API_H3428#define CFE_API_H35293636-/*3737- * Apply customizations here for different OSes. These need to:3838- * * typedef uint64_t, int64_t, intptr_t, uintptr_t.3939- * * define cfe_strlen() if use of an existing function is desired.4040- * * define CFE_API_IMPL_NAMESPACE if API functions are to use4141- * names in the implementation namespace.4242- * Also, optionally, if the build environment does not do so automatically,4343- * CFE_API_* can be defined here as desired.4444- */4545-/* Begin customization. */4630#include <linux/types.h>4731#include <linux/string.h>48324933typedef long intptr_t;50345151-#define cfe_strlen strlen52355353-#define CFE_API_ALL5454-#define CFE_API_STRLEN_CUSTOM5555-/* End customization. */5656-5757-5858-/* *********************************************************************5959- * Constants6060- ********************************************************************* */3636+/*3737+ * Constants3838+ */61396240/* Seal indicating CFE's presence, passed to user program. */6341#define CFE_EPTSEAL 0x43464531···871098811089111/*9090- * cfe_strlen is handled specially: If already defined, it has been9191- * overridden in this environment with a standard strlen-like function.9292- */9393-#ifdef cfe_strlen9494-# define CFE_API_STRLEN_CUSTOM9595-#else9696-# ifdef CFE_API_IMPL_NAMESPACE9797-# define cfe_strlen(a) __cfe_strlen(a)9898-# endif9999-int cfe_strlen(char *name);100100-#endif101101-102102-/*103112 * Defines and prototypes for functions which take no arguments.104113 */105105-#ifdef CFE_API_IMPL_NAMESPACE106106-int64_t __cfe_getticks(void);107107-#define cfe_getticks() __cfe_getticks()108108-#else109114int64_t cfe_getticks(void);110110-#endif111115112116/*113117 * Defines and prototypes for the rest of the functions.114118 */115115-#ifdef CFE_API_IMPL_NAMESPACE116116-#define cfe_close(a) __cfe_close(a)117117-#define cfe_cpu_start(a, b, c, d, e) __cfe_cpu_start(a, b, c, d, e)118118-#define cfe_cpu_stop(a) __cfe_cpu_stop(a)119119-#define cfe_enumenv(a, b, d, e, f) __cfe_enumenv(a, b, d, e, f)120120-#define cfe_enummem(a, b, c, d, e) __cfe_enummem(a, b, c, d, e)121121-#define cfe_exit(a, b) __cfe_exit(a, b)122122-#define cfe_flushcache(a) __cfe_cacheflush(a)123123-#define cfe_getdevinfo(a) __cfe_getdevinfo(a)124124-#define cfe_getenv(a, b, c) __cfe_getenv(a, b, c)125125-#define cfe_getfwinfo(a) __cfe_getfwinfo(a)126126-#define cfe_getstdhandle(a) __cfe_getstdhandle(a)127127-#define cfe_init(a, b) __cfe_init(a, b)128128-#define cfe_inpstat(a) __cfe_inpstat(a)129129-#define cfe_ioctl(a, b, c, d, e, f) __cfe_ioctl(a, b, c, d, e, f)130130-#define cfe_open(a) __cfe_open(a)131131-#define cfe_read(a, b, c) __cfe_read(a, b, c)132132-#define cfe_readblk(a, b, c, d) __cfe_readblk(a, b, c, d)133133-#define cfe_setenv(a, b) __cfe_setenv(a, b)134134-#define cfe_write(a, b, c) __cfe_write(a, b, c)135135-#define cfe_writeblk(a, b, c, d) __cfe_writeblk(a, b, c, d)136136-#endif /* CFE_API_IMPL_NAMESPACE */137137-138119int cfe_close(int handle);139120int cfe_cpu_start(int cpu, void (*fn) (void), long sp, long gp, long a1);140121int cfe_cpu_stop(int cpu);
+7-12
include/asm-mips/fw/cfe/cfe_error.h
···1616 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.1717 */18181919-/* *********************************************************************2020- *2121- * Broadcom Common Firmware Environment (CFE)2222- *2323- * Error codes File: cfe_error.h2424- *2525- * CFE's global error code list is here.2626- *2727- * Author: Mitch Lichtenberg2828- *2929- ********************************************************************* */3030-1919+/*2020+ * Broadcom Common Firmware Environment (CFE)2121+ *2222+ * CFE's global error code list is here.2323+ *2424+ * Author: Mitch Lichtenberg2525+ */31263227#define CFE_OK 03328#define CFE_ERR -1 /* generic error */