00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef _NF_H_
00016 #define _NF_H_
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
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
00046
00047
00048 typedef struct {
00049 U8 manuf;
00050 U8 dev;
00051 U8 conf;
00052 } St_nf_id;
00053
00054
00055 typedef struct {
00056 U8 dev_id;
00057 U8 nb_zones;
00058 }St_nf_link_id_block;
00059
00060
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
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
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_