Go to the documentation of this file.
25 #ifndef __MTD_DOC2000_H__
26 #define __MTD_DOC2000_H__
34 #define DoC_ChipID 0x1000
35 #define DoC_DOCStatus 0x1001
36 #define DoC_DOCControl 0x1002
37 #define DoC_FloorSelect 0x1003
38 #define DoC_CDSNControl 0x1004
39 #define DoC_CDSNDeviceSelect 0x1005
40 #define DoC_ECCConf 0x1006
41 #define DoC_2k_ECCStatus 0x1007
43 #define DoC_CDSNSlowIO 0x100d
44 #define DoC_ECCSyndrome0 0x1010
45 #define DoC_ECCSyndrome1 0x1011
46 #define DoC_ECCSyndrome2 0x1012
47 #define DoC_ECCSyndrome3 0x1013
48 #define DoC_ECCSyndrome4 0x1014
49 #define DoC_ECCSyndrome5 0x1015
50 #define DoC_AliasResolution 0x101b
51 #define DoC_ConfigInput 0x101c
52 #define DoC_ReadPipeInit 0x101d
53 #define DoC_WritePipeTerm 0x101e
54 #define DoC_LastDataRead 0x101f
55 #define DoC_NOP 0x1020
57 #define DoC_Mil_CDSN_IO 0x0800
58 #define DoC_2k_CDSN_IO 0x1800
60 #define DoC_Mplus_NOP 0x1002
61 #define DoC_Mplus_AliasResolution 0x1004
62 #define DoC_Mplus_DOCControl 0x1006
63 #define DoC_Mplus_AccessStatus 0x1008
64 #define DoC_Mplus_DeviceSelect 0x1008
65 #define DoC_Mplus_Configuration 0x100a
66 #define DoC_Mplus_OutputControl 0x100c
67 #define DoC_Mplus_FlashControl 0x1020
68 #define DoC_Mplus_FlashSelect 0x1022
69 #define DoC_Mplus_FlashCmd 0x1024
70 #define DoC_Mplus_FlashAddress 0x1026
71 #define DoC_Mplus_FlashData0 0x1028
72 #define DoC_Mplus_FlashData1 0x1029
73 #define DoC_Mplus_ReadPipeInit 0x102a
74 #define DoC_Mplus_LastDataRead 0x102c
75 #define DoC_Mplus_LastDataRead1 0x102d
76 #define DoC_Mplus_WritePipeTerm 0x102e
77 #define DoC_Mplus_ECCSyndrome0 0x1040
78 #define DoC_Mplus_ECCSyndrome1 0x1041
79 #define DoC_Mplus_ECCSyndrome2 0x1042
80 #define DoC_Mplus_ECCSyndrome3 0x1043
81 #define DoC_Mplus_ECCSyndrome4 0x1044
82 #define DoC_Mplus_ECCSyndrome5 0x1045
83 #define DoC_Mplus_ECCConf 0x1046
84 #define DoC_Mplus_Toggle 0x1046
85 #define DoC_Mplus_DownloadStatus 0x1074
86 #define DoC_Mplus_CtrlConfirm 0x1076
87 #define DoC_Mplus_Power 0x1fff
95 #define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2))))
96 #define WriteDOC_(d, adr, reg) do{ *(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)) = (__u32)d; wmb();} while(0)
97 #define DOC_IOREMAP_LEN 0x8000
98 #elif defined(__ppc__)
99 #define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u16 *)(((unsigned long)adr)+((reg)<<1))))
100 #define WriteDOC_(d, adr, reg) do{ *(volatile __u16 *)(((unsigned long)adr)+((reg)<<1)) = (__u16)d; wmb();} while(0)
101 #define DOC_IOREMAP_LEN 0x4000
103 #define ReadDOC_(adr, reg) readb((void __iomem *)(adr) + (reg))
104 #define WriteDOC_(d, adr, reg) writeb(d, (void __iomem *)(adr) + (reg))
105 #define DOC_IOREMAP_LEN 0x2000
109 #if defined(__i386__) || defined(__x86_64__)
114 #define ReadDOC(adr, reg) ReadDOC_(adr,DoC_##reg)
115 #define WriteDOC(d, adr, reg) WriteDOC_(d,adr,DoC_##reg)
117 #define DOC_MODE_RESET 0
118 #define DOC_MODE_NORMAL 1
119 #define DOC_MODE_RESERVED1 2
120 #define DOC_MODE_RESERVED2 3
122 #define DOC_MODE_CLR_ERR 0x80
123 #define DOC_MODE_RST_LAT 0x10
124 #define DOC_MODE_BDECT 0x08
125 #define DOC_MODE_MDWREN 0x04
127 #define DOC_ChipID_Doc2k 0x20
128 #define DOC_ChipID_Doc2kTSOP 0x21
129 #define DOC_ChipID_DocMil 0x30
130 #define DOC_ChipID_DocMilPlus32 0x40
131 #define DOC_ChipID_DocMilPlus16 0x41
133 #define CDSN_CTRL_FR_B 0x80
134 #define CDSN_CTRL_FR_B0 0x40
135 #define CDSN_CTRL_FR_B1 0x80
137 #define CDSN_CTRL_ECC_IO 0x20
138 #define CDSN_CTRL_FLASH_IO 0x10
139 #define CDSN_CTRL_WP 0x08
140 #define CDSN_CTRL_ALE 0x04
141 #define CDSN_CTRL_CLE 0x02
142 #define CDSN_CTRL_CE 0x01
144 #define DOC_ECC_RESET 0
145 #define DOC_ECC_ERROR 0x80
146 #define DOC_ECC_RW 0x20
147 #define DOC_ECC__EN 0x08
148 #define DOC_TOGGLE_BIT 0x04
149 #define DOC_ECC_RESV 0x02
150 #define DOC_ECC_IGNORE 0x01
152 #define DOC_FLASH_CE 0x80
153 #define DOC_FLASH_WP 0x40
154 #define DOC_FLASH_BANK 0x02
157 #define DOC_ECC_EN (DOC_ECC__EN | DOC_ECC_RESV)
158 #define DOC_ECC_DIS (DOC_ECC_RESV)
170 #define MAX_FLOORS_MIL 1
171 #define MAX_CHIPS_MIL 1
173 #define MAX_FLOORS_MPLUS 2
174 #define MAX_CHIPS_MPLUS 1
176 #define ADDR_COLUMN 1
178 #define ADDR_COLUMN_PAGE 3