VLSI Solution Oy / MegaLib Documentation

vsNand.h File Reference

#include <vstypes.h>
#include <stdlib.h>
#include <physical.h>

Include dependency graph for vsNand.h:

Go to the source code of this file.

Data Structures

struct  FsNandPhys

Defines

#define NAND_OP_READ_SIGNATURE   0x90
#define NAND_OP_READ_STATUS   0x70
#define NAND_OP_READ_A   0x00
#define NAND_OP_READ_C   0x50
#define NAND_OP_COMMIT_DATA_ADDRESS   0x30
#define NAND_OP_PREPARE_TO_PROGRAM   0x80
#define NAND_OP_PERFORM_PROGRAM   0x10

Functions

s_int16 FsPhNandErase (struct FsPhysical *p, s_int32 block)
FsPhysicalFsPhNandCreate (u_int16 param)
s_int16 FsPhNandDelete (struct FsPhysical *p)
s_int16 FsPhNandFreeBus (struct FsPhysical *p)
s_int16 FsPhNandReinitialize (struct FsPhysical *p)
s_int16 FsPhNandRead (struct FsPhysical *p, s_int32 firstPage, u_int16 pages, u_int16 *data, u_int16 *meta)
s_int16 FsPhNandWrite (struct FsPhysical *p, s_int32 firstPage, u_int16 pages, u_int16 *data, u_int16 *meta)
s_int16 NandCountBits (register __a u_int32 val)
s_int16 NandMingle (register __a u_int32 val)
void NandSwapBad (register __i0 u_int16 *spare)
void NandWaitIdle (void)


Detailed Description

NAND FLASH routines.

Definition in file vsNand.h.


Define Documentation

#define NAND_OP_COMMIT_DATA_ADDRESS   0x30
 

Nand Flash Opcode: Commit read address

Definition at line 24 of file vsNand.h.

#define NAND_OP_PERFORM_PROGRAM   0x10
 

Nand Flash Opcode: Execute Programming

Definition at line 30 of file vsNand.h.

#define NAND_OP_PREPARE_TO_PROGRAM   0x80
 

Nand Flash Opcode: Prepare to Program

Definition at line 27 of file vsNand.h.

#define NAND_OP_READ_A   0x00
 

Nand Flash Opcode: Read A - data area

Definition at line 18 of file vsNand.h.

#define NAND_OP_READ_C   0x50
 

Nand Flash Opcode: Read C - spare area

Definition at line 21 of file vsNand.h.

#define NAND_OP_READ_SIGNATURE   0x90
 

Nand Flash Opcode: Read Signature

Definition at line 12 of file vsNand.h.

#define NAND_OP_READ_STATUS   0x70
 

Nand Flash Opcode: Read Signature

Definition at line 15 of file vsNand.h.


Function Documentation

struct FsPhysical* FsPhNandCreate u_int16  param  ) 
 

Creates a physical layer.

s_int16 FsPhNandDelete struct FsPhysical p  ) 
 

Free resources allocated by FsPhNandCreate and release HW

s_int16 FsPhNandErase struct FsPhysical p,
s_int32  block
 

Erase the block that starts from page "block".

s_int16 FsPhNandFreeBus struct FsPhysical p  ) 
 

Free hardware bus for possible other devices

s_int16 FsPhNandRead struct FsPhysical p,
s_int32  firstPage,
u_int16  pages,
u_int16 data,
u_int16 meta
 

Read pages. If meta is non-NULL, will use error correction. To read both sector and spare areas without error correction, you need two reads: first read only sector datas (meta = NULL), then read only spares (data = NULL).

s_int16 FsPhNandReinitialize struct FsPhysical p  ) 
 

Reinitialize bus

s_int16 FsPhNandWrite struct FsPhysical p,
s_int32  firstPage,
u_int16  pages,
u_int16 data,
u_int16 meta
 

Write pages. If meta is non-NULL, will generate error correction.

s_int16 NandCountBits register __a u_int32  val  ) 
 

Support: Count the number of 1-bits

s_int16 NandMingle register __a u_int32  val  ) 
 

Support: takes every other bit from the value.

void NandSwapBad register __i0 u_int16 spare  ) 
 

Support: reorder large-page bad block indicators to be compatible with small-page bad block indicators.

void NandWaitIdle void   ) 
 

Support: Waits until the NAND FLASH interface is idle.


All software copyright 2005-2006 VLSI Solution OY. Redistribution of this software is strictly forbidden.