VLSI Solution Oy / MegaLib Documentation

vsNand.h

Go to the documentation of this file.
00001 
00004 #ifndef VS_NAND_H
00005 #define VS_NAND_H
00006 
00007 #include <vstypes.h>
00008 #include <stdlib.h>
00009 #include <physical.h>
00010 
00012 #define NAND_OP_READ_SIGNATURE 0x90
00013 
00015 #define NAND_OP_READ_STATUS 0x70
00016 
00018 #define NAND_OP_READ_A 0x00
00019 
00021 #define NAND_OP_READ_C 0x50
00022 
00024 #define NAND_OP_COMMIT_DATA_ADDRESS 0x30
00025 
00027 #define NAND_OP_PREPARE_TO_PROGRAM 0x80
00028 
00030 #define NAND_OP_PERFORM_PROGRAM 0x10
00031 
00032 
00033 struct FsNandPhys {
00035   struct FsPhysical p;
00036   /* Custom fields follow */
00037   u_int16 nandType; 
00038   u_int16 waitns;   
00039 };
00040 
00042 s_int16 FsPhNandErase(struct FsPhysical *p, s_int32 block);
00043 
00045 struct FsPhysical *FsPhNandCreate(u_int16 param);
00046 
00048 s_int16 FsPhNandDelete(struct FsPhysical *p);
00049 
00051 s_int16 FsPhNandFreeBus(struct FsPhysical *p);
00052 
00054 s_int16 FsPhNandReinitialize(struct FsPhysical *p);
00055 
00060 s_int16 FsPhNandRead(struct FsPhysical *p, s_int32 firstPage,
00061                      u_int16 pages, u_int16 *data, u_int16 *meta);
00062 
00064 s_int16 FsPhNandWrite(struct FsPhysical *p, s_int32 firstPage,
00065                       u_int16 pages, u_int16 *data, u_int16 *meta);
00066 
00068 s_int16 NandCountBits(register __a u_int32 val);
00070 s_int16 NandMingle(register __a u_int32 val);
00073 void NandSwapBad(register __i0 u_int16 *spare);
00075 void NandWaitIdle(void);
00076 
00077 #endif

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