nf.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 #ifndef _NF_H_
00016 #define _NF_H_
00017 
00018 // ooo ooo                            o
00019 //  o   o
00020 //  o   o
00021 //  o   o   oooo   ooo oo  oo oo    ooo    oo oo    oooooo
00022 //  o o o       o    oo  o  oo  o     o     oo  o  o    o
00023 //  o o o   ooooo    o      o   o     o     o   o  o    o
00024 //  o o o  o    o    o      o   o     o     o   o  o    o
00025 //   o o   o    o    o      o   o     o     o   o   ooooo
00026 //   o o    oooo o ooooo   ooo ooo  ooooo  ooo ooo      o
00027 //                                                      o
00028 //                                                  oooo
00029 //
00030 // Please note that auto-detect mode (NF_AUTO_DETECT_2KB=TRUE or
00031 // NF_AUTO_DETECT_512B=TRUE) may give different performances
00032 // than static compilation (#define NF_TYPE_...)
00033 //
00034 
00036 #define  M_ID_MICRON       0x2C
00037 #define  M_ID_HYNIX        0xAD
00038 #define  M_ID_SANDISK      0x98
00039 #define  M_ID_ST           0x20
00040 #define  M_ID_TOSHIBA      0x98
00041 #define  M_ID_TOSHIBA96    0x96
00042 #define  M_ID_SAMSUNG      0xEC
00043 #define  M_ID_INFINEON     0xC1
00044 
00045 // Structs used in generic mode
00046 
00047 // Device Indentifiant
00048 typedef struct {
00049    U8  manuf;
00050    U8  dev;
00051    U8  conf;
00052 } St_nf_id;
00053 
00054 // Table to link Device Indentifiant and Number of block
00055 typedef struct {
00056    U8  dev_id;
00057    U8  nb_zones;     // zone = 1024 blocks
00058 }St_nf_link_id_block;
00059 
00060 // Device Configuration
00061 typedef struct {
00062    U8  copy_back_cont   :4;
00063    U8  copy_back_discont:4;
00064    U8  cache_program    :1;
00065    U8  ce_toggle        :1;
00066    U8  timing_read      :1;
00067    U8  dfc_nfc_clock    :5;
00068 } St_nf_conf;
00069 
00070 
00071 //-- Pre Check configuration
00072 //
00073 #define NF_BAD_CONFIG            FALSE
00074 #define NF_GENERIC_DRIVER        FALSE // the configuration TRUE, it is not available
00075 #define NF_SHIFT_SECTOR_BYTE     9     // (1<<n) size of sector, unit in bytes (other value not supported)
00076 #if (!defined NF_AUTO_DETECT_2KB)
00077 #  define   NF_AUTO_DETECT_2KB   FALSE
00078 #endif
00079 #if (!defined NF_AUTO_DETECT_512B)
00080 #  define   NF_AUTO_DETECT_512B  FALSE
00081 #endif
00082 #if (NF_AUTO_DETECT_2KB==TRUE) && (NF_AUTO_DETECT_512B==TRUE)
00083 #  undef  NF_BAD_CONFIG
00084 #  define NF_BAD_CONFIG (TRUE)
00085 #  error NF_AUTO_DETECT_2KB and NF_AUTO_DETECT_512B can not be activated at the same time.
00086 #endif
00087 
00088 #include "nf_512B.h"
00089 #include "nf_2KB.h"
00090 
00091 //-- Final Check configuration
00092 //
00093 #if (NF_AUTO_DETECT_2KB==TRUE) && (NF_TYPE_512B_KNOWN==TRUE)
00094 #  undef  NF_BAD_CONFIG
00095 #  define NF_BAD_CONFIG (TRUE)
00096 #  error NF_AUTO_DETECT_2KB and NF_TYPE_x 512B can not be activated at the same time.
00097 #endif
00098 #if (NF_AUTO_DETECT_512B==TRUE) && (NF_TYPE_2KB_KNOWN==TRUE)
00099 #  undef  NF_BAD_CONFIG
00100 #  define NF_BAD_CONFIG (TRUE)
00101 #  error NF_AUTO_DETECT_512B and NF_TYPE_x 2KB can not be activated at the same time.
00102 #endif
00103 #if (NF_AUTO_DETECT_2KB==FALSE) && (NF_AUTO_DETECT_512B==FALSE)
00104 #  define NF_DETECTION_ID  (DISABLE)
00105 #  if (NF_TYPE_2KB_KNOWN ==FALSE) && (NF_TYPE_512B_KNOWN ==FALSE)
00106 #     undef  NF_BAD_CONFIG
00107 #     define NF_BAD_CONFIG (TRUE)
00108 #     error No NandFlash configuration found (NF_AUTO_DETECT_2KB, NF_AUTO_DETECT_512B, NF_TYPE_x)
00109 #  endif
00110 #else
00111 #  define NF_DETECTION_ID  (ENABLE)
00112 #endif
00113 
00114 
00115 #endif   // _NF_H_

Generated on Fri Oct 31 14:31:24 2008 for ATMEL by  doxygen 1.5.3