lld.h

来自「SAMSUNG S3C6410 CPU BSP for winmobile6」· C头文件 代码 · 共 261 行 · 第 1/2 页

H
261
字号
/*****************************************************************************/
/*                                                                           */
/* PROJECT : AnyStore II                                                     */
/* MODULE  : LLD                                                             */
/* NAME    : Low level Device Driver header                                  */
/* FILE    : LLD.h                                                           */
/* PURPOSE : LLD return value definitions                                    */
/*           LFT element definitions                                         */
/*                                                                           */
/*---------------------------------------------------------------------------*/
/*                                                                           */
/*        COPYRIGHT 2003-2005, SAMSUNG ELECTRONICS CO., LTD.                 */
/*                      ALL RIGHTS RESERVED                                  */
/*                                                                           */
/*   Permission is hereby granted to licensees of Samsung Electronics        */
/*   Co., Ltd. products to use or abstract this computer program for the     */
/*   sole purpose of implementing a product based on Samsung                 */
/*   Electronics Co., Ltd. products. No other rights to reproduce, use,      */
/*   or disseminate this computer program, whether in part or in whole,      */
/*   are granted.                                                            */
/*                                                                           */
/*   Samsung Electronics Co., Ltd. makes no representation or warranties     */
/*   with respect to the performance of this computer program, and           */
/*   specifically disclaims any responsibility for any damages,              */
/*   special or consequential, connected with the use of this program.       */
/*                                                                           */
/*---------------------------------------------------------------------------*/
/*                                                                           */
/* REVISION HISTORY                                                          */
/*                                                                           */
/*   01-OCT-2003 [Janghwan Kim] : first writing                              */
/*   06-OCT-2003 [Janghwan Kim] : code modification                          */
/*   08-JAN-2004 [Janghwan Kim] : Add LLD_PREV_OP_RESULT                     */
/*   06-MAY-2004 [SongHo Yoon]  : reorganization                             */
/*   25/MAR/2005 [Younwon Park] : LLD code merge                             */
/*                                512M M/A-die, 1G DDP, 1G M-die, 2G DDP     */
/*                                256M M/A-die, 128M M-die                   */
/*                                                                           */
/*****************************************************************************/

#ifndef _XSR_LLD_H_
#define _XSR_LLD_H_

/*****************************************************************************/
/* Debug Configurations                                                      */
/*****************************************************************************/
#define LLD_RTL_PRINT(x)            XSR_RTL_PRINT(x)

//#define LLD_DEBUG
#if defined(LLD_DEBUG)
#define LLD_DBG_PRINT(x)            XSR_DBG_PRINT(x)
#else
#define LLD_DBG_PRINT(x)
#endif  /* LLD_DEBUG */

/*****************************************************************************/
/* External Constant Definitions                                             */
/*****************************************************************************/
#define LLD_MAIN_SIZE               512
#define LLD_SPARE_SIZE              16
#define LLD_SECTOR_SIZE             (LLD_MAIN_SIZE)

#define LLD_BW_X08                  0
#define LLD_BW_X16                  1
#define LLD_BW_X32                  2

#define LLD_ME_NO                   0
#define LLD_ME_OK                   1

#define LLD_MEBL_LEN                16

/*****************************************************************************/
/* LLD Return Values                                                         */
/*****************************************************************************/
/*--------------------*/
/* Major Return Value */
/*--------------------*/
#define	LLD_READ_DISTURBANCE		XSR_RETURN_VALUE(0, 0x0007, 0x0000)		 /* 1-Bit error by read disturbance */
#define LLD_IOC_NOT_SUPPORT         XSR_RETURN_VALUE(0, 0x0006, 0x0000)      /* Not supported IO Ctrl           */
#define LLD_DEV_NOT_OPENED          XSR_RETURN_VALUE(0, 0x0005, 0x0000)      /* Device not opened               */
#define LLD_DEV_POWER_OFF           XSR_RETURN_VALUE(0, 0x0004, 0x0000)      /* Power is not supported to LLD   */
#define LLD_DEV_NO_LLD_FUNC         XSR_RETURN_VALUE(0, 0x0003, 0x0000)
#define LLD_INIT_BADBLOCK           XSR_RETURN_VALUE(0, 0x0002, 0x0000)
#define LLD_INIT_GOODBLOCK          XSR_RETURN_VALUE(0, 0x0001, 0x0000)
#define LLD_SUCCESS                 XSR_RETURN_VALUE(0, 0x0000, 0x0000)      /* success                         */
#define LLD_ERASE_ERROR             XSR_RETURN_VALUE(1, 0x0001, 0x0000)      /* erase error                     */
#define LLD_MERASE_ERROR            XSR_RETURN_VALUE(1, 0x0002, 0x0000)      /* merase error                    */
#define LLD_WRITE_ERROR             XSR_RETURN_VALUE(1, 0x0003, 0x0000)      /* write error                     */
#define LLD_READ_ERROR              XSR_RETURN_VALUE(1, 0x0005, 0x0000)      /* read error                      */
#define LLD_CRITICAL_ERROR          XSR_RETURN_VALUE(1, 0x0008, 0x0000)
#define LLD_WR_PROTECT_ERROR        XSR_RETURN_VALUE(1, 0x0009, 0x0000)
#define LLD_ILLEGAL_ACCESS          XSR_RETURN_VALUE(1, 0x000A, 0x0000)      /* Invalid op attempts or values   */
#define LLD_ALREADY_INITIALIZED		XSR_RETURN_VALUE(1, 0x000B, 0x0000)

#define LLD_INIT_FAILURE            XSR_RETURN_VALUE(1, 0x0011, 0x0000)
#define LLD_OPEN_FAILURE            XSR_RETURN_VALUE(1, 0x0012, 0x0000)
#define LLD_CLOSE_FAILURE           XSR_RETURN_VALUE(1, 0x0013, 0x0000)

/*-------------------*/
/* Minor Retun Value */
/*-------------------*/
/* Detailed Read Error Specifiations */
/* READ_U/CERROR_XX is combined with LLD_READ_ERROR as Minor Return Value    */
#define LLD_READ_CERROR_S0          XSR_RETURN_VALUE(0, 0x0000, 0x0001)
#define LLD_READ_UERROR_S0          XSR_RETURN_VALUE(0, 0x0000, 0x0002)
#define LLD_READ_CERROR_M0          XSR_RETURN_VALUE(0, 0x0000, 0x0004)
#define LLD_READ_UERROR_M0          XSR_RETURN_VALUE(0, 0x0000, 0x0008)

#define LLD_READ_CERROR_S1          XSR_RETURN_VALUE(0, 0x0000, 0x0010)
#define LLD_READ_UERROR_S1          XSR_RETURN_VALUE(0, 0x0000, 0x0020)
#define LLD_READ_CERROR_M1          XSR_RETURN_VALUE(0, 0x0000, 0x0040)
#define LLD_READ_UERROR_M1          XSR_RETURN_VALUE(0, 0x0000, 0x0080)

#define LLD_READ_CERROR_S2          XSR_RETURN_VALUE(0, 0x0000, 0x0100)
#define LLD_READ_UERROR_S2          XSR_RETURN_VALUE(0, 0x0000, 0x0200)
#define LLD_READ_CERROR_M2          XSR_RETURN_VALUE(0, 0x0000, 0x0400)
#define LLD_READ_UERROR_M2          XSR_RETURN_VALUE(0, 0x0000, 0x0800)

#define LLD_READ_CERROR_S3          XSR_RETURN_VALUE(0, 0x0000, 0x1000)
#define LLD_READ_UERROR_S3          XSR_RETURN_VALUE(0, 0x0000, 0x2000)
#define LLD_READ_CERROR_M3          XSR_RETURN_VALUE(0, 0x0000, 0x4000)
#define LLD_READ_UERROR_M3          XSR_RETURN_VALUE(0, 0x0000, 0x8000)

/* Previous Operation Flag */
/* LLD_PREV_OP_RESULT is combined with Major Return Value, and means 
   Previous Operation Error except LLD_READ_ERROR */
#define LLD_PREV_OP_RESULT          XSR_RETURN_VALUE(0, 0x0000, 0xF0F0)

/*****************************************************************************/
/* Flags                                                                     */
/*****************************************************************************/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?