nand flash从1.8V替换为3.3v

来源:互联网 发布:淘宝代购是真的吗 编辑:程序博客网 时间:2024/06/06 06:01

机子开始量产了,但是1.8v的nandflash库存不足,而且国内基本上都买不到货了。那只好用3.3v的nanflash来替代。

那替代的话,相应的程序是需要修改的,否则无法正常运行。其实要改的也就是更改一下flash device code 即可。

基本原理如下:

bootloader下的mian.c中的

1)BOOL OEMPlatformInit(void)

2)// BP_Init() will invoke FMD_Init().
     if (!BP_Init((LPBYTE)BPbuf, BPBUF_SIZE, L"Eboot BP_Init()", NULL, NULL))

3)PVOID FMD_Init(LPCTSTR pActive, PPCI_REG_INFO pRegIn, PPCI_REG_INFO pRegOut)

4)INT32 PXA_Platform_DfcNandProbe(PXA_DFC_NAND_CONTEXT *pContext)

 

 

需要修改的代码位置:c:/WINCE600/PLATFORM/zylonite_mhl/SRC/COMMON/FMD/dfcplatform.c

涉及到两个地方:

1) flash硬件信息的结构体;

//added by zhangwh for arg pdav10
static PXA_DFC_NAND_SPEC stm1GbX8 =
{
    {
        20,    // tCH, Enable signal hold time.
        35,    // tCS, Enable signal setup time.
        15,    // tWH, ND_nWE high duration.
        25,    // tWP, ND_nWE pulse time.
        15,    // tRH, ND_nRE high duration.
        25,    // tRP, ND_nRE pulse width.
        25000,    // tR = tR + tRR + tWB + 1, ND_nWE high to ND_nRE low for read.
        60,    // tWHR, ND_nWE high to ND_nRE low delay for status read.
        10,    // tAR, ND_ALE low to ND_nRE low delay.
    },
    1,    // Data flash bus arbiter enable (ND_ARB_EN).
    64,    // 32, Pages per block (PG_PER_BLK).
    1,    // Second cycle start, Row address start position (RA_START).
    4,    // 2 bytes, returned ID bytes(RD_ID_CNT).
    0,    // NAND, (ND_MODE)
    0,    // Chip select don't care bit (NCSX).
    2048,    // 512, Page size in bytes (PAGE_SZ).
    64, /* Pages per block */
    8,    //16,    // width of flash memory (DWIDTH_M)
    8,    //16,    // width of flash controller (DWIDTH_C)
    1024,    // Number of physical blocks in Flash
    4,    // Read, Program address cycles
    0xa120, // NAND chip ID
    // command codes

    0x3000,    // Read
    0x0050,    // Read1 unused, current DFC don't support
    0x1080,    // Write, two cycle command
    0x0070,    // Read status
    0x0090,    // Read ID
    0xD060,    // Erase, two cycle command
    0x00FF,    // Reset
    0x002A,    // Lock whole flash
    0x2423,    // Unlock, two cycle command, supporting partial unlock
    0x007A,    // Read block lock status
    STM1GbX8Addr2NDCB1,
    STM1GbX8NDBBR2Addr,
};

2) 程序回去遍历,找出相匹配的flash。

static PXA_PLATFROM_DFC_FLASH_TYPE_INFO typeInfo[] = {
    {SAMSUNG_CODE, 0x46, PXA_PLATFORM_DFC_FLASH_Samsung512MbX16, &samsung512MbX16},
    {MICRON_CODE, 0xA1, PXA_PLATFORM_DFC_FLASH_Micron1GbX8,      µn1GbX8},
    {MICRON_CODE, 0xB1, PXA_PLATFORM_DFC_FLASH_Micron1GbX16,        µn1GbX16},
    {STM_CODE, 0xB1, PXA_PLATFORM_DFC_FLASH_STM1GbX16,           &stm1GbX16},
    {STM_CODE, 0xBA, PXA_PLATFORM_DFC_FLASH_STM2GbX16,             &stm2GbX16},
    {TOSHIBA_CODE, 0xBA, PXA_PLATFORM_DFC_FLASH_TOSHIBA2GbX16,   &toshiba2GbX16},
    {STM_CODE, 0xA1, PXA_PLATFORM_DFC_FLASH_STM1GbX8,             &stm1GbX8},
    {STM_CODE, 0xF1, PXA_PLATFORM_DFC_FLASH_STM1GbX8,             &stm1GbX8},//3.3V
    {0, 0, PXA_PLATFORM_DFC_FLASH_NULL},
};

原创粉丝点击