// by the constant CPU_BASE_REG_XX_NAND in the configuration file
// cpu_base_reg_cfg.h.
//
typedef struct
{
UINT32 NFCONF; //0x00 // configuration reg
UINT32 NFCONT; //0x04
UINT8 NFCMD; //0x08 // command set reg
UINT8 d0[3];
UINT8 NFADDR; //0x0C // address set reg
UINT8 d1[3];
UINT8 NFDATA; //0x10 // data reg
UINT8 d2[3];
UINT32 NFMECCD0; //0x14
UINT32 NFMECCD1; //0x18
UINT32 NFSECCD; //0x1C
UINT32 NFSBLK; //0x20
UINT32 NFEBLK; //0x24 // error correction code 2
UINT32 NFSTAT; //0x28 // operation status reg
UINT32 NFECCERR0; //0x2C
UINT32 NFECCERR1; //0x30
UINT32 NFMECC0; //0x34 // error correction code 0
UINT32 NFMECC1; //0x38 // error correction code 1
UINT32 NFSECC; //0x3C
UINT32 NFMLCBITPT; //0x40
} S3C6410_NAND_REG, *PS3C6410_NAND_REG;
#if __cplusplus
}
#endif
#endif
注意到了麽?这个跟文档中的寄存器少了8bit ECC寄存器部分。

晕菜了吧,飞凌的这个2G 256M的BSP的Nandflash源码既然是这个样子,为什么还在那里号称8bit的ECC,还说开放源码。
靠别人都行的话,母猪都会上树啦!咱还是自己搞吧!
在上面UINT32 NFMLCBITPT; //0x40 的后面添加以下代码:
[cpp] //0x44-- 8位ECC错误状态0寄存器
UINT32 NF8ECCERR1; //0x48-- 8位ECC错误状态1寄存器
UINT32 NF8ECCERR2; //0x4c-- 8位ECC错误状态2寄存器
UINT32 NFM8ECC0; //0x50-- 生成8位ECC状态0寄存器
UINT32 NFM8ECC1; //0x54-- 生成8位ECC状态1寄存器
UINT32 NFM8ECC2; //0x58-- 生成8位ECC状态2寄存器
UINT32 NFM8ECC3; //0x5c-- 生成8位ECC状态3寄存器
UINT32 NFMLC8BITPT0; //0x60-- 8位ECC错误位模式寄存器0
UINT32 NFMLC8BITPT1; //0x64-- 8位ECC错误位模式寄存器1
[cpp]
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#ifndef __NAND_H__
#define __NAND_H__
//-----------------------------------------------------------------------------
typedef struct
{
UINT16 nNumOfBlks;
UINT16 nPagesPerBlk;
UINT16 nSctsPerPage;
} NANDDeviceInfo;
NANDDeviceInfo stDeviceInfo;
#ifdef __cplusplus
extern "C" {
#endif
NANDDeviceInfo GetNandInfo(void);
#ifdef __cplusplus
}
#endif
#define NUM_OF_BLOCKS (stDeviceInfo.nNumOfBlks)
#define PAGES_PER_BLOCK (stDeviceInfo.nPagesPerBlk)
#define SECTORS_PER_PAGE (stDeviceInfo.nSctsPerPage)
#undef SECTOR_SIZE
#define SECTOR_SIZE (512)
#define NAND_SECTOR_SIZE (SECTOR_SIZE*SECTORS_PER_PAGE)
#define NAND_PAGE_SIZE (SECTOR_SIZE*SECTORS_PER_PAGE) //< Physical Page Size
#define IS_LB ((SECTORS_PER_PAGE == 4)||(SECTORS_PER_PAGE == 8))
//--------------------------------