00001
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef _NF_H_
00045 #define _NF_H_
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00065 #define M_ID_MICRON 0x2C
00066 #define M_ID_HYNIX 0xAD
00067 #define M_ID_SANDISK 0x98
00068 #define M_ID_ST 0x20
00069 #define M_ID_TOSHIBA 0x98
00070 #define M_ID_TOSHIBA96 0x96
00071 #define M_ID_SAMSUNG 0xEC
00072 #define M_ID_INFINEON 0xC1
00073
00074
00075
00076
00077 typedef struct {
00078 U8 manuf;
00079 U8 dev;
00080 U8 conf;
00081 } St_nf_id;
00082
00083
00084 typedef struct {
00085 U8 dev_id;
00086 U8 nb_zones;
00087 }St_nf_link_id_block;
00088
00089
00090 typedef struct {
00091 U8 copy_back_cont :4;
00092 U8 copy_back_discont:4;
00093 U8 cache_program :1;
00094 U8 ce_toggle :1;
00095 } St_nf_conf;
00096
00097
00098
00099
00100 #define NF_BAD_CONFIG FALSE
00101 #define NF_GENERIC_DRIVER FALSE // the configuration TRUE, it is not available
00102 #define NF_SHIFT_SECTOR_BYTE 9 // (1<<n) size of sector, unit in bytes (other value not supported)
00103 #if (!defined NF_AUTO_DETECT_2KB)
00104 # define NF_AUTO_DETECT_2KB FALSE
00105 #endif
00106 #if (!defined NF_AUTO_DETECT_512B)
00107 # define NF_AUTO_DETECT_512B FALSE
00108 #endif
00109 #if (NF_AUTO_DETECT_2KB==TRUE) && (NF_AUTO_DETECT_512B==TRUE)
00110 # undef NF_BAD_CONFIG
00111 # define NF_BAD_CONFIG (TRUE)
00112 # error NF_AUTO_DETECT_2KB and NF_AUTO_DETECT_512B can not be activated at the same time.
00113 #endif
00114
00115 #include "nf_512B.h"
00116 #include "nf_2KB.h"
00117
00118
00119
00120 #if (NF_AUTO_DETECT_2KB==TRUE) && (NF_TYPE_512B_KNOWN==TRUE)
00121 # undef NF_BAD_CONFIG
00122 # define NF_BAD_CONFIG (TRUE)
00123 # error NF_AUTO_DETECT_2KB and NF_TYPE_x 512B can not be activated at the same time.
00124 #endif
00125 #if (NF_AUTO_DETECT_512B==TRUE) && (NF_TYPE_2KB_KNOWN==TRUE)
00126 # undef NF_BAD_CONFIG
00127 # define NF_BAD_CONFIG (TRUE)
00128 # error NF_AUTO_DETECT_512B and NF_TYPE_x 2KB can not be activated at the same time.
00129 #endif
00130 #if (NF_AUTO_DETECT_2KB==FALSE) && (NF_AUTO_DETECT_512B==FALSE)
00131 # define NF_DETECTION_ID (DISABLE)
00132 # if (NF_TYPE_2KB_KNOWN ==FALSE) && (NF_TYPE_512B_KNOWN ==FALSE)
00133 # undef NF_BAD_CONFIG
00134 # define NF_BAD_CONFIG (TRUE)
00135 # error No NandFlash configuration found (NF_AUTO_DETECT_2KB, NF_AUTO_DETECT_512B, NF_TYPE_x)
00136 # endif
00137 #else
00138 # define NF_DETECTION_ID (ENABLE)
00139 #endif
00140
00141
00142 #endif // _NF_H_