2010-09-04 02:54:36     NAND Flash Detection issue BF532

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2010-09-04 02:54:36     NAND Flash Detection issue BF532

Usama Shakeel (PAKISTAN)

Message: 93128   

 

Hello,

 

I am using MT29f2G16AAD 2GB NAND Flash memory which has 16 BIT and I am not being able to configure it correct as it always come up with a message :

 

No NAND Device Found.!!

 

I have done the following changes for the configurations

 

 

 

In Configs files in ./include/configs/board.h

 

/* I dont know the Sector Size , ADDR_Column , ADDR_PAGE  and ADDR_COLUMN_PAGE, so I kept it the same. I was not able to find these in datasheet as well. */

 

#define CONFIG_CMD_NAND

 

#define CFG_NAND_ADDR          0x20000000

#define CFG_NAND_BASE          CFG_NAND_ADDR

#define CFG_MAX_NAND_DEVICE    1

#define SECTORSIZE             512

#define ADDR_COLUMN             1

#define ADDR_PAGE               2

#define ADDR_COLUMN_PAGE        3

#define NAND_ChipID_UNKNOWN    0x00

#define NAND_MAX_FLOORS        1

#define NAND_MAX_CHIPS         1

#define BFIN_NAND_READY       PF14

 

 

#define NAND_WAIT_READY(nand)              \

    do {                     \

        int timeout = 0;         \

        while(!(*pPORTFIO & PF14))     \

            if (timeout++ > 10000000)    \

                break;        \

    } while (0)

 

#define BFIN_NAND_CLE     (1<<3)                  /* A3 -> Command Enable */

#define BFIN_NAND_ALE     /(1<<2)                  /* A2 -> Address Enable */

 

 

/* PF14 is NAND_READY

 

A3 CLE

 

A2 ALE */

 

 

 

./board/bard/nand.c

 

 

 

#include <common.h>

 

 

#if defined(CONFIG_CMD_NAND)

 

#include <nand.h>

 

/*

*    hardware specific access to control-lines

*/

static void bfin_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)

{

    struct nand_chip *this = mtd->priv;

 

    if (cmd == NAND_CMD_NONE)

        return;

 

    if (ctrl & NAND_CLE)

        WRITE_NAND_COMMAND(cmd, this->IO_ADDR_W);

    else

        WRITE_NAND_ADDRESS(cmd, this->IO_ADDR_W);

 

    /* Drain the writebuffer */

    SSYNC();

 

}

 

int bfin_device_ready(struct mtd_info *mtd)

{

        int ret = (*pFIO_FLAG_D & BFIN_NAND_READY)? 1 : 0;

        __builtin_bfin_ssync();

        return ret;

}

 

int board_nand_init(struct nand_chip *nand)

{

    *pFIO_DIR   &= ~BFIN_NAND_READY;     

    *pFIO_INEN  |= BFIN_NAND_READY;

    *pFIO_EDGE  &= ~BFIN_NAND_READY;

    *pFIO_POLAR &= ~BFIN_NAND_READY;

    __builtin_bfin_ssync();

 

    nand->cmd_ctrl = bfin_hwcontrol;

    nand->ecc.mode = NAND_ECC_SOFT;

    nand->dev_ready = bfin_device_ready;

       nand->chip_delay = 45;

//       nand->chip_delay = 30;

    return 0;      

     

}

#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */

 

 

 

 

 

Kindly tell where the configurations are going wrong.. ??

QuoteReplyEditDelete

 

 

2010-09-06 11:26:22     Re: NAND Flash Detection issue BF532

Mike Frysinger (UNITED STATES)

Message: 93187   

 

you could try the current svn trunk.  it has a rewritten nand layer for boards and should be a lot simpler.  just look at the bf537-stamp config header as an example.

QuoteReplyEditDelete

 

 

2010-09-07 00:39:09     Re: NAND Flash Detection issue BF532

Usama Shakeel (PAKISTAN)

Message: 93200   

 

Hi mike ,

 

I have started getting the Manufacturer ID and Device ID which are 0x25 and 0x50 although they should be 0x2C and 0xCA respectively.

 

I have set the chip delay to 60 ..

 

 

 

Kindly can you point out what is going wrong..?

 

 

 

Regards

 

Usama Bin Shakeel

Attachments

    Outcomes