blob: 6f2f609d7b0a6c445b25db50058a6555030ce6ff [file] [log] [blame]
/**
* @filename nand_list.h
* @brief: AK3223M interrupt
*
* This file describe what is in the table of nand list
* Copyright (C) 2006 Anyka (GuangZhou) Software Technology Co., Ltd.
* @author zhaojiahuan
* @modify chenyanyan
* @date 2007-1-10
* @version 1.0
* @ref
*/
#ifndef __CHIP_NFC_3224__
#define __CHIP_NFC_3224__
#include "anyka_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @defgroup NandFlash Architecture NandFlash Interface
* @ingroup Architecture
*/
/*@{*/
/**
* @BRIEF Nandflash info define
* @AUTHOR zhaojiahuan
* @DATE 2006-7-17
*/
typedef struct
Nand_phy_info{
T_U32 chip_id;//chip id
T_U16 page_size; //page size
T_U16 page_per_blk; //page of one blok
T_U16 blk_num;//total block number
T_U16 group_blk_num;//the same concept as die, according to nand's struture
T_U16 plane_blk_num;
T_U8 spare_size;//spareÇøÓò´óСµÄµÍ룬²»³¬¹ý255 Byte
T_U8 col_cycle;//column address cycle
T_U8 lst_col_mask;//last column addrress cycle mask bit
T_U8 row_cycle;//row address cycle
T_U8 delay_cnt;//Rb delay, unit is 1024 asic clock, default value corresponds to 84MHz
T_U8 custom_nd;//nand type flag, used to detect the original invilid block
//currently there are 7 types, more types might be added when new nand come out
//˵Ã÷£ºÀ¨ºÅÀïÇ°Ò»¸öÊÇpageºÅ,ºóÒ»¸öÊÇpageÖеÄλÖÃ, Èç¹ûÕâЩλÖò»Îª0xFFÔò¸ÃblockÊdzö³§»µ¿ì
//NAND_TYPE_SAMSUNG: 0x1 СҳSLC([0,1],[517]), ´óÒ³SLC([0,1],[2048]), MLC([127], [2048/4096])
//NAND_TYPE_HYNIX: 0x2 СҳSLC([0,1],[517]), ´óÒ³SLC([0,1],[2048]), MLC([125,127], [2048/4096])
//NAND_TYPE_TOSHIBA: 0x3 СҳSLC([0,1],[0,512]), ´óÒ³SLC([0,1],[0,2048]), MLC([127], [0,2048/4096])
//NAND_TYPE_TOSHIBA_EXT: 0x4 СҳSLC(), ´óÒ³SLC(), MLC([0,127/255], [0,2048/4096/8192])
//NAND_TYPE_MICRON: 0x5 СҳSLC([0,1],[512]), ´óÒ³SLC([0,1],[2048]), MLC([0,1], [2048/4096])
//NAND_TYPE_ST: 0x6 СҳSLC([0,1],[517]), ´óÒ³SLC([0],[2048,2053]), MLC([127], [0])
//NAND_TYPE_MICRON_4K 0x7 СҳSLC(), ´óÒ³SLC(), MLC([0], [4096 ~ 4096+218])
T_U32 flag;//character bits, ×î¸ß4λ±íʾplaneÊôÐÔ£¬×îµÍλ±íʾÊÇ·ñÐèÒªblockÄÚ˳Ðòдpage
//bit31±íʾÊÇ·ñÓÐcopyback£¬1±íʾÓÐcopyback
//bit30±íʾÊÇ·ñÖ»ÓÐÒ»¸öplane£¬1±íʾֻÓÐÒ»¸öplane
//bit29±íʾÊÇ·ñÇ°ºóplane£¬1±íʾÓÐÇ°ºóplane
//bit28±íʾÊÇ·ñÆæżplane£¬1±íʾÓÐÆæżplane
//ÒÔÏÂbitÊÇΪÁ˽â¾öpageºÍblockµØÖ·²»Á¬Ðø¶øÔö¼ÓµÄ¿ØÖÆbit:
//bit11±íʾblock number per dieÊÇ·ñÐèÒªÏòÉϹæÕû£¬ÈçToshiba TH58NVG6D2ETA20ÊÇ2048 block/die(ʵ¼ÊÓÐ2084 block/die)
//ΪÁ˶ÔÆëÏÂÒ»¸ödieµÄblockÔòÐèÒª¹æÕûΪ4096 block/die¸øµ×²ãÇý¶¯
//bit10±íʾpage numberÊÇ·ñÐèÒªÏòÉϹæÕû£¬ÈçTLCÊÇ192page/block£¬ÎªÁ˶ÔÆëÏÂÒ»¸öblockÔòÐèÒª¹æÕûΪ256page/block¸øÇý¶¯
//bit8~9±íʾspareÇøÓò´óСµÄ¸ß룬µ¥Î»ÊÇ256 Bytes¡£Òòspare_size½öΪT_U8£¬²»×ãÒÔ±íʾÐÂÐÍnandµÄ400¶à¸ö×Ö½ÚµÄspare´óС
//bit4-7±íʾECCÀàÐÍ£¬0Ϊ4 bit/512B£¬1Ϊ8 bit/512B£¬2Ϊ12 bit/512B£¬3Ϊ16 bit/512B£¬4Ϊ24 bit/1024B£¬5Ϊ32 bit/1024B
//bit0±íʾÔÚͬһ¸öblockÄÚÊÇ·ñÐèҪ˳Ðòдpage£¬1±íʾÐèÒª°´Ë³Ðòд£¬¼´¸ÃnandΪMLC
//×¢Òâ: Èç¹û(bit29ºÍbit28)Ϊ'11'£¬Ôò±íʾ¸Ãchip°üÀ¨4¸öplane£¬¼ÈÓÐÆæżҲÓÐÇ°ºóplane
T_U32 cmd_len;//nandflash command length
T_U32 data_len;//nandflash data length
T_U8 des_str[32];//descriptor string
}T_NAND_PHY_INFO;
#define ERROR_CHIP_ID 0xFFFFFFFF
/*@}*/
#ifdef __cplusplus
}
#endif
#endif