📄 flash_nand_samsung.c
字号:
/********************************************************************** * flash_nand_samsung.c * * NAND Samsung device level operations * * This file implements the functions specific to Samsung nand based * devices. * * Copyright (C) 2004-2006 Qualcomm, Inc. All Rights Reserved. * **********************************************************************//*=========================================================================== EDIT HISTORY FOR MODULE This section contains comments describing changes made to the module. Notice that changes are listed in reverse chronological order. $Header: //depot/asic/msmshared/drivers/flash/MSM_FLASH.01.04/flash_nand_samsung.c#4 $ $DateTime: 2006/05/16 22:40:13 $ $Author: dhamimp $when who what, where, why-------- --- ----------------------------------------------------------2006-05-04 dp Adding controller abstraction layer2006-02-18 rt Modularize the bad_block marking and check functions.2006-02-17 rt Add support for 2K page NAND devices.2005-11-16 yug Changed Offset location dependent on NAND Controller. FOZ controller is New.2005-09-27 yug Corrected typo in badblock offset.2005-08-25 drh Correct re-init of NAND config registers after NAND controller reset2005-08-02 drh Changes to compile in L4 environment2005-07-29 drh Modify bad block flag usage to be configurable2005-05-13 drh Correct limit handling2005-05-12 drh Add support for K91G08R0B2005-04-28 drh Remove macros for clear status bits, done in NAND CMD macro instead2005-01-28 drh Add fix for 8-bit NAND after reset2004-10-04 drh Add NAND specific partition header file2004-09-30 drh Move partition functions out to partition specific file2004-09-29 drh Support for dynamic 8/16 bit use2004-09-24 drh Correct handling of block numbers by using variable instead of #define2004-08-26 drh Conditionally compile out functions not needed by boot loader.2004-08-11 drh Add support for turning ECC off when needed2004-07-20 gr Added multi-threading support.2004-07-20 drh Do not compile partition functions for boot_loader Fix bug in mark_block_bad function.2004-07-08 drh Add support for Samsung K9K1216Q0C2004-06-09 drh Prevent 8/16 bit false detection2004-05-18 drh Make flash name string more generic to not confuse user2004-03-08 dlb Rename FS_NAND... to FLASH_NAND...2004-04-02 drh Change use of spare_byte to spare_unit except func name2004-03-30 drh Add macros to separate setting wait states from setting ECC enable/disable state.2004-03-26 drh Use single common ops table for all devices. Modify probe to fill in device structure.2004-03-19 drh Change partition manipulation function names. Correct ordering of flash reset.2004-02-23 drh Move device specific function dispatch tables out of device common file and put them here. Correct handling of wait states setting. Remove functions that merely returned constants as they are replaced by generic functions in flash_nand_device.c.2004-01-21 drh Came from services/efs/fs_nand_samsung.c===========================================================================*/#include "flash_nand_samsung.h"#include "flash_msg.h"/* Forward Function Declarations */static int samsung_nand_bad_block_check(fs_device_t self, block_id block);static int samsung_onenand_bad_block_check(fs_device_t self, block_id block);/* Device specific data, unique to each flash device */static const struct flash_device_config_data samsung_devices_array[] = { /*==========================================================*/ { /* Samsung K9F2808U0B flash */ "samsung_k9f2808", /* Device Name */ 1024, /* Block Count */ 32, /* Page Count */ 512, /* Page Size */ 528, /* Total Page Size */ 0xEC, /* Maker ID */ 0x73, /* Device ID */ FLASHI_NAND_8BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K9F2808U0B flash */ /*==========================================================*/ /*==========================================================*/ { /* Samsung K9F2808Q0B flash */ "samsung_k9f2808", /* Device Name */ 1024, /* Block Count */ 32, /* Page Count */ 512, /* Page Size */ 528, /* Total Page Size */ 0xEC, /* Maker ID */ 0x33, /* Device ID */ FLASHI_NAND_8BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K9F2808Q0B flash */ /*==========================================================*/ /*==========================================================*/ { /* Samsung K9F5608Q0B flash */ "samsung_k9f5608", /* Device Name */ 2048, /* Block Count */ 32, /* Page Count */ 512, /* Page Size */ 528, /* Total Page Size */ 0xEC, /* Maker ID */ 0x35, /* Device ID */ FLASHI_NAND_8BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K9F5608Q0B flash */ /*==========================================================*/ /*==========================================================*/ { /* Samsung K9F1208U0A flash */ "samsung_k9f1208", /* Device Name */ 4096, /* Block Count */ 32, /* Page Count */ 512, /* Page Size */ 528, /* Total Page Size */ 0xEC, /* Maker ID */ 0x76, /* Device ID */ FLASHI_NAND_8BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K9F1208U0A flash */ /*==========================================================*/ /*==========================================================*/ { /* Samsung K9F1208Q0A flash */ "samsung_k9f1208", /* Device Name */ 4096, /* Block Count */ 32, /* Page Count */ 512, /* Page Size */ 528, /* Total Page Size */ 0xEC, /* Maker ID */ 0x36, /* Device ID */ FLASHI_NAND_8BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K9F1208Q0A flash */ /*==========================================================*/ /*==========================================================*/ { /* Samsung K91G08U0A flash */ "samsung_k91g08" , /* Device Name */ 8192, /* Block Count */ 32, /* Page Count */ 512, /* Page Size */ 528, /* Total Page Size */ 0xEC, /* Maker ID */ 0x79, /* Device ID */ FLASHI_NAND_8BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K91G08U0A flash */ /*==========================================================*/ /*==========================================================*/ { /* Samsung K91G08R0B flash */ "samsung_k91g08" , /* Device Name */ 8192, /* Block Count */ 32, /* Page Count */ 512, /* Page Size */ 528, /* Total Page Size */ 0xEC, /* Maker ID */ 0x78, /* Device ID */ FLASHI_NAND_8BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K91G08R0B flash */ /*==========================================================*/ /*==========================================================*/ { /* Samsung K9K1216Q0C flash (1.8V, x16 part) */ "samsung_k9k1216" , /* Device Name */ 4096, /* Block Count */ 32, /* Page Count */ 512, /* Page Size */ 528, /* Total Page Size */ 0xEC, /* Maker ID */ 0x46, /* Device ID */ FLASHI_NAND_16BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K9K1216Q0C flash (1.8V, x16 part) */ /*==========================================================*/ /*==========================================================*/ { /* Samsung K9K2G08R0A flash (1.8V, x8 part) */ "samsung_k9k2g08" , /* Device Name */ 2048, /* Block Count */ 64, /* Page Count */ 2048, /* Page Size */ 2112, /* Total Page Size */ 0xEC, /* Maker ID */ 0xAA, /* Device ID */ FLASHI_NAND_8BIT, /* Device width */ 0x0, 0x0, /* dev_specfic_flag1/2 */ }, /* END Samsung K9K2G08R0A flash (1.8V, x8 part) */ /*==========================================================*/};/* Device specific data, unique to each flash device */static const struct flash_device_config_data samsung_onenand_devices_array[] = { /*==========================================================*/ { /* Samsung KFG1G16Q2A flash */ "samsung_kfg1g16", /* Device Name */ 1024, /* Block Count */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -