nand.h File Reference

ONFI 1.0 compliant NAND kblock driver. More...

#include "cfg/cfg_nand.h"
#include <io/kblock.h>

Go to the source code of this file.

Data Structures

struct  Nand
 NAND context. More...

Defines

Error codes.

#define NAND_ERR_ERASE   BV(1)
 Error erasing a block.
#define NAND_ERR_WRITE   BV(2)
 Error writing a page.
#define NAND_ERR_RD_TMOUT   BV(3)
 Read timeout.
#define NAND_ERR_WR_TMOUT   BV(4)
 Write timeout.
#define NAND_ERR_ECC   BV(5)
 Unrecoverable ECC error.

Functions

NandNAND_CAST (KBlock *kb)
 Convert + ASSERT from generic KBlock to NAND context.
bool nand_init (Nand *chip, struct Heap *heap, unsigned chip_select)
 Initialize NAND kblock driver in buffered mode.
bool nand_initUnbuffered (Nand *chip, struct Heap *heap, unsigned chip_select)
 Initialize NAND kblock driver in unbuffered mode.
bool nand_getDevId (Nand *chip, uint8_t dev_id[5])
 Read Device ID and configuration codes.
int nand_blockErase (Nand *chip, uint16_t block)
 Erase the whole block.
void nand_format (Nand *chip)
 Reset bad blocks map and erase all blocks.

Detailed Description

ONFI 1.0 compliant NAND kblock driver.

Author:
Stefano Fedrigo <aleph@develer.com>

Definition in file nand.h.


Function Documentation

void nand_format ( Nand chip  ) 

Reset bad blocks map and erase all blocks.

Note:
DON'T USE on production chips: this function will try to erase factory marked bad blocks too.

Definition at line 511 of file nand.c.