📄 syscon_api.h
字号:
/************************************************************************
*
* syscon_api.h
*
* The 'syscon' module implements a generic api, which is available
* on all MIPS designed boards and which establishes an adaptation
* to the specific system resources per board. The 'syscon' api
* must be used in drivers, protocols, applications etc. to access
* any required system data to allow modules being portable across
* all MIPS designed boards.
*
*
* ######################################################################
*
* Copyright (c) 1999-2000 MIPS Technologies, Inc. All rights reserved.
*
* Unpublished rights reserved under the Copyright Laws of the United States of
* America.
*
* This document contains information that is proprietary to MIPS Technologies,
* Inc. ("MIPS Technologies"). Any copying, modifying or use of this information
* (in whole or in part) which is not expressly permitted in writing by MIPS
* Technologies or a contractually-authorized third party is strictly
* prohibited. At a minimum, this information is protected under unfair
* competition laws and the expression of the information contained herein is
* protected under federal copyright laws. Violations thereof may result in
* criminal penalties and fines.
* MIPS Technologies or any contractually-authorized third party reserves the
* right to change the information contained in this document to improve
* function, design or otherwise. MIPS Technologies does not assume any
* liability arising out of the application or use of this information. Any
* license under patent rights or any other intellectual property rights owned
* by MIPS Technologies or third parties shall be conveyed by MIPS Technologies
* or any contractually-authorized third party in a separate license agreement
* between the parties.
* The information contained in this document constitutes one or more of the
* following: commercial computer software, commercial computer software
* documentation or other commercial items. If the user of this information, or
* any related documentation of any kind, including related technical data or
* manuals, is an agency, department, or other entity of the United States
* government ("Government"), the use, duplication, reproduction, release,
* modification, disclosure, or transfer of this information, or any related
* documentation of any kind, is restricted in accordance with Federal
* Acquisition Regulation 12.212 for civilian agencies and Defense Federal
* Acquisition Regulation Supplement 227.7202 for military agencies. The use of
* this information by the Government is further restricted in accordance with
* the terms of the license agreement(s) and/or applicable contract terms and
* conditions covering this information from MIPS Technologies or any
* contractually-authorized third party.
*
************************************************************************/
#ifndef SYSCON_API_H
#define SYSCON_API_H
/************************************************************************
* Include files
************************************************************************/
#include <sysdefs.h>
#include <sys_api.h>
#include <syserror.h>
/************************************************************************
* Macro Definitions
*************************************************************************/
/************************************************************************
* SYSCON, ERROR completion codes
*************************************************************************/
typedef enum SYSCON_error_ids
{
ERROR_SYSCON_OUT_OF_MEMORY /* No more dynamic memory */
= ERROR_SYSCON,
ERROR_SYSCON_UNKNOWN_PARAM, /* Parameter is not supported */
ERROR_SYSCON_IP_UNKNOWN, /* IP address unknown */
ERROR_SYSCON_SUBNET_UNKNOWN, /* Subnetmask unknown */
ERROR_SYSCON_GATEWAY_UNKNOWN, /* Default gateway unknown */
ERROR_SYSCON_READ_ONLY_ID, /* This parameter is read-only */
ERROR_SYSCON_WRITE_ONLY_ID, /* This parameter is write-only */
ERROR_SYSCON_ENV_VAR_TOO_BIG, /* environment var size too big */
ERROR_SYSCON_INVALID_CHAR_POS, /* Alphanumeric display does not
support this position id */
/******* ADD NEW SYSCON ERROR TAGS JUST BEFORE THIS LINE ONLY *******/
} t_SYSCON_error_ids;
/************************************************************************
* System Definitions
*************************************************************************/
/* Memory allocation */
#define SYS_MALLOC_DYNAMIC_MEMORY_SIZE (4+90+1)*2048+4096
typedef struct sys_malloc
{
UINT32 size; /* size (bytes) of memory block to be allocated */
UINT32 boundary; /* address boundary alignment unit */
void **memory; /* pointer to allocated memory block */
} t_sys_malloc;
/* String or one-character output for Alphanumeric display. */
typedef struct sys_alphanumeric
{
UINT32 posid; /* position to start the string or char display;
position '0' is leftmost */
UINT8 *string; /* nul-terminated string or pointer ref for char */
} t_sys_alphanumeric;
/* System error to string conversion. */
typedef struct sys_error_string
{
UINT32 syserror; /* system error code to be converted */
UINT32 count; /* number of string-pointers returned */
UINT8 **strings; /* pointer to array of string-pointers */
} t_sys_error_string;
#define SYSCON_ERRORMSG_IDX 0 /* String index for error message */
#define SYSCON_DIAGMSG_IDX 1 /* String index for diagnose message */
#define SYSCON_HINTMSG_IDX 2 /* String index for hint message */
/* Prototype of system error lookup function: */
typedef INT32 (*t_sys_error_lookup)(
t_sys_error_string *p_param ); /* INOUT: code to string(s) */
/* System error lookup registration */
typedef struct sys_error_lookup_registration
{
UINT32 prefix; /* syserror prefix,
allocated in syserror.h */
t_sys_error_lookup lookup; /* lookup function */
} t_sys_error_lookup_registration;
/* System batch file descriptor:
Used to read or write a file via TFTP.
The file content is conveyed in one
operation between the 'buffer' and
the host. */
typedef struct sys_batch_file_descriptor
{
UINT32 mode ; /* the IP-address of the TFTP server host */
UINT32 host_ip ; /* the IP-address of the TFTP server host */
UINT8 *file_name ; /* nul-terminated ASCII string */
UINT8 *buffer ; /* Pointer for caller allocated buffer */
UINT32 buffer_size ; /* Before the file operation (read or write),
this parameter contains the size of
the caller supplied buffer,
After the file operation has been completed,
this parameter contains the actual
number of bytes, which have been read or
written. */
} t_sys_batch_file_descriptor ;
#define SYSCON_FILE_READ_MODE 0 /* File buffer is to be 'read' */
#define SYSCON_FILE_WRITE_MODE 1 /* File buffer is to be 'written' */
/************************************************************************
* SYSCON enumeration definitions
*************************************************************************/
typedef enum syscon_ids
{
/* REVISION register */
SYSCON_BOARD_REVISION_ID = 0, /* UINT32 */
SYSCON_BOARD_PRODUCTID_ID, /* UINT32 */
SYSCON_BOARD_PRODUCTNAME_ID, /* char * */
SYSCON_BOARD_PRODUCTREV_ID, /* UINT32 */
SYSCON_BOARD_CORECARDID_ID, /* UINT32 */
SYSCON_BOARD_CORECARD_NAME_ID, /* char * */
SYSCON_BOARD_CORECARDREV_ID, /* UINT32 */
SYSCON_BOARD_FPGAREV_ID, /* UINT32 */
SYSCON_BOARD_RTL_ID, /* UINT32 */
SYSCON_BOARD_RTLREV_MAJOR_ID, /* UINT32 */
SYSCON_BOARD_RTLREV_MINOR_ID, /* UINT32 */
SYSCON_BOARD_RTL_NAME_ID, /* char * */
/* Serial number */
SYSCON_BOARD_SN_ID, /* t_sn_ascii */
/* NMI */
SYSCON_BOARD_NMI_STATUS_ID, /* bool */
SYSCON_BOARD_NMI_WERR_ID, /* UINT32 */
/* Default configuration switch (if available) */
SYSCON_BOARD_USE_DEFAULT_ID, /* UINT32 */
SYSCON_BOARD_INIT_BASED_ON_ENV_ID, /* bool */
/* Memory */
SYSCON_BOARD_STACK_SIZE_ID, /* UINT32 */
SYSCON_BOARD_APPL_STACK_SIZE_ID, /* UINT32 */
SYSCON_BOARD_FREE_MEM_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_ACTUAL_SIZE_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_REFRESH_NS_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_REFRESH_CYCLES_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_SRASPRCHG_NS_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_SRASPRCHG_CYCLES_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_SRAS2SCAS_NS_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_SRAS2SCAS_CYCLES_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_CASLAT_CYCLES_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_READ_BURSTLEN_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_WRITE_BURSTLEN_ID, /* UINT32 */
/* Malloc */
SYSCON_BOARD_MALLOC_ID, /* 't_sys_malloc' */
/* Reset/power off */
SYSCON_BOARD_SOFTRES_ID, /* void */
SYSCON_BOARD_BRKRES_ID, /* UINT32 */
SYSCON_BOARD_PSUSTBY_ID, /* UINT32 */
/* Frequencies */
SYSCON_BOARD_CPU_CLOCK_FREQ_ID, /* UINT32 */
SYSCON_BOARD_BUS_CLOCK_FREQ_ID, /* UINT32 */
SYSCON_BOARD_PCI_FREQ_KHZ_ID, /* UINT32 */
/* Base addresses and sizes */
SYSCON_BOARD_SYSTEMFLASH_BASE_ID, /* 'void *' */
SYSCON_BOARD_SYSTEMFLASH_SIZE_ID, /* UINT32 */
SYSCON_BOARD_MONITORFLASH_BASE_ID, /* 'void *' */
SYSCON_BOARD_MONITORFLASH_SIZE_ID, /* UINT32 */
SYSCON_BOARD_FILEFLASH_BASE_ID, /* 'void *' */
SYSCON_BOARD_FILEFLASH_SIZE_ID, /* UINT32 */
SYSCON_BOARD_SYSTEMRAM_BASE_ID, /* 'void *' */
SYSCON_BOARD_SYSTEMRAM_SIZE_ID, /* UINT32 */
SYSCON_BOARD_SRAM_BASE_ID, /* 'void *' */
SYSCON_BOARD_SRAM_SIZE_ID, /* UINT32 */
SYSCON_BOARD_GT64120_BASE_ID, /* 'void *' */
SYSCON_BOARD_SAA9730_BASE_ID, /* 'void *' */
SYSCON_BOARD_AM79C973_BASE_ID, /* 'void *' */
SYSCON_BOARD_SYM53C810A_BASE_ID, /* 'void *' */
SYSCON_BOARD_INTEL21150_BASE_ID, /* 'void *' */
SYSCON_BOARD_TI16C550C_BASE0_ID, /* 'void *' */
SYSCON_BOARD_TI16C550C_BASE1_ID, /* 'void *' */
SYSCON_BOARD_ICTA_BASE_ID, /* 'void *' */
SYSCON_BOARD_TMRA_BASE_ID, /* 'void *' */
SYSCON_BOARD_PIIX4_SMB_BASE_ID, /* 'void *' */
SYSCON_BOARD_PIIX4_POWER_BASE_ID, /* 'void *' */
/* LEDs and display */
SYSCON_BOARD_LEDGREEN_ID, /* UINT32 */
SYSCON_BOARD_LEDBAR_ID, /* UINT32 */
SYSCON_BOARD_ASCIIWORD_ID, /* UINT32 */
SYSCON_BOARD_ASCIICHAR_ID, /* t_sys_alphanumeric */
SYSCON_BOARD_ASCIISTRING_ID, /* t_sys_alphanumeric */
/* Time count */
SYSCON_BOARD_GET_MILLISEC_ID, /* UINT32 */
/* Flash parameters */
SYSCON_BOARD_SYSTEMFLASH_SECTORSIZE_ID, /* UINT32 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -