/* from: Broadcom Id: cfe_api_int.h,v 1.22 2003/02/07 17:27:56 cgd Exp $ */12/*-3* SPDX-License-Identifier: BSD-3-Clause4*5* Copyright 2000, 2001, 20026* Broadcom Corporation. All rights reserved.7*8* This software is furnished under license and may be used and copied only9* in accordance with the following terms and conditions. Subject to these10* conditions, you may download, copy, install, use, modify and distribute11* modified or unmodified copies of this software in source and/or binary12* form. No title or ownership is transferred hereby.13*14* 1) Any source code used, modified or distributed must reproduce and15* retain this copyright notice and list of conditions as they appear in16* the source file.17*18* 2) No right is granted to use any trade name, trademark, or logo of19* Broadcom Corporation. The "Broadcom Corporation" name may not be20* used to endorse or promote products derived from this software21* without the prior written permission of Broadcom Corporation.22*23* 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED24* WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF25* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR26* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE27* FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE28* LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR29* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF30* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR31* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,32* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE33* OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.34*/3536/* *********************************************************************37*38* Broadcom Common Firmware Environment (CFE)39*40* Device function prototypes File: cfe_api_int.h41*42* This header defines all internal types and macros for the43* library. This is stuff that's not exported to an app44* using the library.45*46* Authors: Mitch Lichtenberg, Chris Demetriou47*48********************************************************************* */4950#ifndef CFE_API_INT_H51#define CFE_API_INT_H5253/* *********************************************************************54* Constants55********************************************************************* */5657#define CFE_CMD_FW_GETINFO 058#define CFE_CMD_FW_RESTART 159#define CFE_CMD_FW_BOOT 260#define CFE_CMD_FW_CPUCTL 361#define CFE_CMD_FW_GETTIME 462#define CFE_CMD_FW_MEMENUM 563#define CFE_CMD_FW_FLUSHCACHE 66465#define CFE_CMD_DEV_GETHANDLE 966#define CFE_CMD_DEV_ENUM 1067#define CFE_CMD_DEV_OPEN 1168#define CFE_CMD_DEV_INPSTAT 1269#define CFE_CMD_DEV_READ 1370#define CFE_CMD_DEV_WRITE 1471#define CFE_CMD_DEV_IOCTL 1572#define CFE_CMD_DEV_CLOSE 1673#define CFE_CMD_DEV_GETINFO 177475#define CFE_CMD_ENV_ENUM 2076#define CFE_CMD_ENV_GET 2277#define CFE_CMD_ENV_SET 2378#define CFE_CMD_ENV_DEL 247980#define CFE_CMD_MAX 328182#define CFE_CMD_VENDOR_USE 0x8000 /* codes above this are for customer use */8384/* *********************************************************************85* Structures86********************************************************************* */8788typedef uint64_t cfe_xuint_t;89typedef int64_t cfe_xint_t;90typedef int64_t cfe_xptr_t;9192typedef struct xiocb_buffer_s {93cfe_xuint_t buf_offset; /* offset on device (bytes) */94cfe_xptr_t buf_ptr; /* pointer to a buffer */95cfe_xuint_t buf_length; /* length of this buffer */96cfe_xuint_t buf_retlen; /* returned length (for read ops) */97cfe_xuint_t buf_ioctlcmd; /* IOCTL command (used only for IOCTLs) */98} xiocb_buffer_t;99100#define buf_devflags buf_ioctlcmd /* returned device info flags */101102typedef struct xiocb_inpstat_s {103cfe_xuint_t inp_status; /* 1 means input available */104} xiocb_inpstat_t;105106typedef struct xiocb_envbuf_s {107cfe_xint_t enum_idx; /* 0-based enumeration index */108cfe_xptr_t name_ptr; /* name string buffer */109cfe_xint_t name_length; /* size of name buffer */110cfe_xptr_t val_ptr; /* value string buffer */111cfe_xint_t val_length; /* size of value string buffer */112} xiocb_envbuf_t;113114typedef struct xiocb_cpuctl_s {115cfe_xuint_t cpu_number; /* cpu number to control */116cfe_xuint_t cpu_command; /* command to issue to CPU */117cfe_xuint_t start_addr; /* CPU start address */118cfe_xuint_t gp_val; /* starting GP value */119cfe_xuint_t sp_val; /* starting SP value */120cfe_xuint_t a1_val; /* starting A1 value */121} xiocb_cpuctl_t;122123typedef struct xiocb_time_s {124cfe_xint_t ticks; /* current time in ticks */125} xiocb_time_t;126127typedef struct xiocb_exitstat_s {128cfe_xint_t status;129} xiocb_exitstat_t;130131typedef struct xiocb_meminfo_s {132cfe_xint_t mi_idx; /* 0-based enumeration index */133cfe_xint_t mi_type; /* type of memory block */134cfe_xuint_t mi_addr; /* physical start address */135cfe_xuint_t mi_size; /* block size */136} xiocb_meminfo_t;137138typedef struct xiocb_fwinfo_s {139cfe_xint_t fwi_version; /* major, minor, eco version */140cfe_xint_t fwi_totalmem; /* total installed mem */141cfe_xint_t fwi_flags; /* various flags */142cfe_xint_t fwi_boardid; /* board ID */143cfe_xint_t fwi_bootarea_va; /* VA of boot area */144cfe_xint_t fwi_bootarea_pa; /* PA of boot area */145cfe_xint_t fwi_bootarea_size; /* size of boot area */146cfe_xint_t fwi_reserved1;147cfe_xint_t fwi_reserved2;148cfe_xint_t fwi_reserved3;149} xiocb_fwinfo_t;150151typedef struct cfe_xiocb_s {152cfe_xuint_t xiocb_fcode; /* IOCB function code */153cfe_xint_t xiocb_status; /* return status */154cfe_xint_t xiocb_handle; /* file/device handle */155cfe_xuint_t xiocb_flags; /* flags for this IOCB */156cfe_xuint_t xiocb_psize; /* size of parameter list */157union {158xiocb_buffer_t xiocb_buffer; /* buffer parameters */159xiocb_inpstat_t xiocb_inpstat; /* input status parameters */160xiocb_envbuf_t xiocb_envbuf; /* environment function parameters */161xiocb_cpuctl_t xiocb_cpuctl; /* CPU control parameters */162xiocb_time_t xiocb_time; /* timer parameters */163xiocb_meminfo_t xiocb_meminfo; /* memory arena info parameters */164xiocb_fwinfo_t xiocb_fwinfo; /* firmware information */165xiocb_exitstat_t xiocb_exitstat; /* Exit Status */166} plist;167} cfe_xiocb_t;168169#endif /* CFE_API_INT_H */170171172