Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
doc2000.h File Reference
#include <linux/mtd/mtd.h>
#include <linux/mutex.h>

Go to the source code of this file.

Data Structures

struct  Nand
 
struct  DiskOnChip
 

Macros

#define DoC_Sig1   0
 
#define DoC_Sig2   1
 
#define DoC_ChipID   0x1000
 
#define DoC_DOCStatus   0x1001
 
#define DoC_DOCControl   0x1002
 
#define DoC_FloorSelect   0x1003
 
#define DoC_CDSNControl   0x1004
 
#define DoC_CDSNDeviceSelect   0x1005
 
#define DoC_ECCConf   0x1006
 
#define DoC_2k_ECCStatus   0x1007
 
#define DoC_CDSNSlowIO   0x100d
 
#define DoC_ECCSyndrome0   0x1010
 
#define DoC_ECCSyndrome1   0x1011
 
#define DoC_ECCSyndrome2   0x1012
 
#define DoC_ECCSyndrome3   0x1013
 
#define DoC_ECCSyndrome4   0x1014
 
#define DoC_ECCSyndrome5   0x1015
 
#define DoC_AliasResolution   0x101b
 
#define DoC_ConfigInput   0x101c
 
#define DoC_ReadPipeInit   0x101d
 
#define DoC_WritePipeTerm   0x101e
 
#define DoC_LastDataRead   0x101f
 
#define DoC_NOP   0x1020
 
#define DoC_Mil_CDSN_IO   0x0800
 
#define DoC_2k_CDSN_IO   0x1800
 
#define DoC_Mplus_NOP   0x1002
 
#define DoC_Mplus_AliasResolution   0x1004
 
#define DoC_Mplus_DOCControl   0x1006
 
#define DoC_Mplus_AccessStatus   0x1008
 
#define DoC_Mplus_DeviceSelect   0x1008
 
#define DoC_Mplus_Configuration   0x100a
 
#define DoC_Mplus_OutputControl   0x100c
 
#define DoC_Mplus_FlashControl   0x1020
 
#define DoC_Mplus_FlashSelect   0x1022
 
#define DoC_Mplus_FlashCmd   0x1024
 
#define DoC_Mplus_FlashAddress   0x1026
 
#define DoC_Mplus_FlashData0   0x1028
 
#define DoC_Mplus_FlashData1   0x1029
 
#define DoC_Mplus_ReadPipeInit   0x102a
 
#define DoC_Mplus_LastDataRead   0x102c
 
#define DoC_Mplus_LastDataRead1   0x102d
 
#define DoC_Mplus_WritePipeTerm   0x102e
 
#define DoC_Mplus_ECCSyndrome0   0x1040
 
#define DoC_Mplus_ECCSyndrome1   0x1041
 
#define DoC_Mplus_ECCSyndrome2   0x1042
 
#define DoC_Mplus_ECCSyndrome3   0x1043
 
#define DoC_Mplus_ECCSyndrome4   0x1044
 
#define DoC_Mplus_ECCSyndrome5   0x1045
 
#define DoC_Mplus_ECCConf   0x1046
 
#define DoC_Mplus_Toggle   0x1046
 
#define DoC_Mplus_DownloadStatus   0x1074
 
#define DoC_Mplus_CtrlConfirm   0x1076
 
#define DoC_Mplus_Power   0x1fff
 
#define ReadDOC_(adr, reg)   readb((void __iomem *)(adr) + (reg))
 
#define WriteDOC_(d, adr, reg)   writeb(d, (void __iomem *)(adr) + (reg))
 
#define DOC_IOREMAP_LEN   0x2000
 
#define ReadDOC(adr, reg)   ReadDOC_(adr,DoC_##reg)
 
#define WriteDOC(d, adr, reg)   WriteDOC_(d,adr,DoC_##reg)
 
#define DOC_MODE_RESET   0
 
#define DOC_MODE_NORMAL   1
 
#define DOC_MODE_RESERVED1   2
 
#define DOC_MODE_RESERVED2   3
 
#define DOC_MODE_CLR_ERR   0x80
 
#define DOC_MODE_RST_LAT   0x10
 
#define DOC_MODE_BDECT   0x08
 
#define DOC_MODE_MDWREN   0x04
 
#define DOC_ChipID_Doc2k   0x20
 
#define DOC_ChipID_Doc2kTSOP   0x21 /* internal number for MTD */
 
#define DOC_ChipID_DocMil   0x30
 
#define DOC_ChipID_DocMilPlus32   0x40
 
#define DOC_ChipID_DocMilPlus16   0x41
 
#define CDSN_CTRL_FR_B   0x80
 
#define CDSN_CTRL_FR_B0   0x40
 
#define CDSN_CTRL_FR_B1   0x80
 
#define CDSN_CTRL_ECC_IO   0x20
 
#define CDSN_CTRL_FLASH_IO   0x10
 
#define CDSN_CTRL_WP   0x08
 
#define CDSN_CTRL_ALE   0x04
 
#define CDSN_CTRL_CLE   0x02
 
#define CDSN_CTRL_CE   0x01
 
#define DOC_ECC_RESET   0
 
#define DOC_ECC_ERROR   0x80
 
#define DOC_ECC_RW   0x20
 
#define DOC_ECC__EN   0x08
 
#define DOC_TOGGLE_BIT   0x04
 
#define DOC_ECC_RESV   0x02
 
#define DOC_ECC_IGNORE   0x01
 
#define DOC_FLASH_CE   0x80
 
#define DOC_FLASH_WP   0x40
 
#define DOC_FLASH_BANK   0x02
 
#define DOC_ECC_EN   (DOC_ECC__EN | DOC_ECC_RESV)
 
#define DOC_ECC_DIS   (DOC_ECC_RESV)
 
#define MAX_FLOORS   4
 
#define MAX_CHIPS   4
 
#define MAX_FLOORS_MIL   1
 
#define MAX_CHIPS_MIL   1
 
#define MAX_FLOORS_MPLUS   2
 
#define MAX_CHIPS_MPLUS   1
 
#define ADDR_COLUMN   1
 
#define ADDR_PAGE   2
 
#define ADDR_COLUMN_PAGE   3
 

Functions

int doc_decode_ecc (unsigned char sector[512], unsigned char ecc1[6])
 

Macro Definition Documentation

#define ADDR_COLUMN   1

Definition at line 176 of file doc2000.h.

#define ADDR_COLUMN_PAGE   3

Definition at line 178 of file doc2000.h.

#define ADDR_PAGE   2

Definition at line 177 of file doc2000.h.

#define CDSN_CTRL_ALE   0x04

Definition at line 140 of file doc2000.h.

#define CDSN_CTRL_CE   0x01

Definition at line 142 of file doc2000.h.

#define CDSN_CTRL_CLE   0x02

Definition at line 141 of file doc2000.h.

#define CDSN_CTRL_ECC_IO   0x20

Definition at line 137 of file doc2000.h.

#define CDSN_CTRL_FLASH_IO   0x10

Definition at line 138 of file doc2000.h.

#define CDSN_CTRL_FR_B   0x80

Definition at line 133 of file doc2000.h.

#define CDSN_CTRL_FR_B0   0x40

Definition at line 134 of file doc2000.h.

#define CDSN_CTRL_FR_B1   0x80

Definition at line 135 of file doc2000.h.

#define CDSN_CTRL_WP   0x08

Definition at line 139 of file doc2000.h.

#define DoC_2k_CDSN_IO   0x1800

Definition at line 58 of file doc2000.h.

#define DoC_2k_ECCStatus   0x1007

Definition at line 41 of file doc2000.h.

#define DoC_AliasResolution   0x101b

Definition at line 50 of file doc2000.h.

#define DoC_CDSNControl   0x1004

Definition at line 38 of file doc2000.h.

#define DoC_CDSNDeviceSelect   0x1005

Definition at line 39 of file doc2000.h.

#define DoC_CDSNSlowIO   0x100d

Definition at line 43 of file doc2000.h.

#define DoC_ChipID   0x1000

Definition at line 34 of file doc2000.h.

#define DOC_ChipID_Doc2k   0x20

Definition at line 127 of file doc2000.h.

#define DOC_ChipID_Doc2kTSOP   0x21 /* internal number for MTD */

Definition at line 128 of file doc2000.h.

#define DOC_ChipID_DocMil   0x30

Definition at line 129 of file doc2000.h.

#define DOC_ChipID_DocMilPlus16   0x41

Definition at line 131 of file doc2000.h.

#define DOC_ChipID_DocMilPlus32   0x40

Definition at line 130 of file doc2000.h.

#define DoC_ConfigInput   0x101c

Definition at line 51 of file doc2000.h.

#define DoC_DOCControl   0x1002

Definition at line 36 of file doc2000.h.

#define DoC_DOCStatus   0x1001

Definition at line 35 of file doc2000.h.

#define DOC_ECC__EN   0x08

Definition at line 147 of file doc2000.h.

#define DOC_ECC_DIS   (DOC_ECC_RESV)

Definition at line 158 of file doc2000.h.

#define DOC_ECC_EN   (DOC_ECC__EN | DOC_ECC_RESV)

Definition at line 157 of file doc2000.h.

#define DOC_ECC_ERROR   0x80

Definition at line 145 of file doc2000.h.

#define DOC_ECC_IGNORE   0x01

Definition at line 150 of file doc2000.h.

#define DOC_ECC_RESET   0

Definition at line 144 of file doc2000.h.

#define DOC_ECC_RESV   0x02

Definition at line 149 of file doc2000.h.

#define DOC_ECC_RW   0x20

Definition at line 146 of file doc2000.h.

#define DoC_ECCConf   0x1006

Definition at line 40 of file doc2000.h.

#define DoC_ECCSyndrome0   0x1010

Definition at line 44 of file doc2000.h.

#define DoC_ECCSyndrome1   0x1011

Definition at line 45 of file doc2000.h.

#define DoC_ECCSyndrome2   0x1012

Definition at line 46 of file doc2000.h.

#define DoC_ECCSyndrome3   0x1013

Definition at line 47 of file doc2000.h.

#define DoC_ECCSyndrome4   0x1014

Definition at line 48 of file doc2000.h.

#define DoC_ECCSyndrome5   0x1015

Definition at line 49 of file doc2000.h.

#define DOC_FLASH_BANK   0x02

Definition at line 154 of file doc2000.h.

#define DOC_FLASH_CE   0x80

Definition at line 152 of file doc2000.h.

#define DOC_FLASH_WP   0x40

Definition at line 153 of file doc2000.h.

#define DoC_FloorSelect   0x1003

Definition at line 37 of file doc2000.h.

#define DOC_IOREMAP_LEN   0x2000

Definition at line 105 of file doc2000.h.

#define DoC_LastDataRead   0x101f

Definition at line 54 of file doc2000.h.

#define DoC_Mil_CDSN_IO   0x0800

Definition at line 57 of file doc2000.h.

#define DOC_MODE_BDECT   0x08

Definition at line 124 of file doc2000.h.

#define DOC_MODE_CLR_ERR   0x80

Definition at line 122 of file doc2000.h.

#define DOC_MODE_MDWREN   0x04

Definition at line 125 of file doc2000.h.

#define DOC_MODE_NORMAL   1

Definition at line 118 of file doc2000.h.

#define DOC_MODE_RESERVED1   2

Definition at line 119 of file doc2000.h.

#define DOC_MODE_RESERVED2   3

Definition at line 120 of file doc2000.h.

#define DOC_MODE_RESET   0

Definition at line 117 of file doc2000.h.

#define DOC_MODE_RST_LAT   0x10

Definition at line 123 of file doc2000.h.

#define DoC_Mplus_AccessStatus   0x1008

Definition at line 63 of file doc2000.h.

#define DoC_Mplus_AliasResolution   0x1004

Definition at line 61 of file doc2000.h.

#define DoC_Mplus_Configuration   0x100a

Definition at line 65 of file doc2000.h.

#define DoC_Mplus_CtrlConfirm   0x1076

Definition at line 86 of file doc2000.h.

#define DoC_Mplus_DeviceSelect   0x1008

Definition at line 64 of file doc2000.h.

#define DoC_Mplus_DOCControl   0x1006

Definition at line 62 of file doc2000.h.

#define DoC_Mplus_DownloadStatus   0x1074

Definition at line 85 of file doc2000.h.

#define DoC_Mplus_ECCConf   0x1046

Definition at line 83 of file doc2000.h.

#define DoC_Mplus_ECCSyndrome0   0x1040

Definition at line 77 of file doc2000.h.

#define DoC_Mplus_ECCSyndrome1   0x1041

Definition at line 78 of file doc2000.h.

#define DoC_Mplus_ECCSyndrome2   0x1042

Definition at line 79 of file doc2000.h.

#define DoC_Mplus_ECCSyndrome3   0x1043

Definition at line 80 of file doc2000.h.

#define DoC_Mplus_ECCSyndrome4   0x1044

Definition at line 81 of file doc2000.h.

#define DoC_Mplus_ECCSyndrome5   0x1045

Definition at line 82 of file doc2000.h.

#define DoC_Mplus_FlashAddress   0x1026

Definition at line 70 of file doc2000.h.

#define DoC_Mplus_FlashCmd   0x1024

Definition at line 69 of file doc2000.h.

#define DoC_Mplus_FlashControl   0x1020

Definition at line 67 of file doc2000.h.

#define DoC_Mplus_FlashData0   0x1028

Definition at line 71 of file doc2000.h.

#define DoC_Mplus_FlashData1   0x1029

Definition at line 72 of file doc2000.h.

#define DoC_Mplus_FlashSelect   0x1022

Definition at line 68 of file doc2000.h.

#define DoC_Mplus_LastDataRead   0x102c

Definition at line 74 of file doc2000.h.

#define DoC_Mplus_LastDataRead1   0x102d

Definition at line 75 of file doc2000.h.

#define DoC_Mplus_NOP   0x1002

Definition at line 60 of file doc2000.h.

#define DoC_Mplus_OutputControl   0x100c

Definition at line 66 of file doc2000.h.

#define DoC_Mplus_Power   0x1fff

Definition at line 87 of file doc2000.h.

#define DoC_Mplus_ReadPipeInit   0x102a

Definition at line 73 of file doc2000.h.

#define DoC_Mplus_Toggle   0x1046

Definition at line 84 of file doc2000.h.

#define DoC_Mplus_WritePipeTerm   0x102e

Definition at line 76 of file doc2000.h.

#define DoC_NOP   0x1020

Definition at line 55 of file doc2000.h.

#define DoC_ReadPipeInit   0x101d

Definition at line 52 of file doc2000.h.

#define DoC_Sig1   0

Definition at line 31 of file doc2000.h.

#define DoC_Sig2   1

Definition at line 32 of file doc2000.h.

#define DOC_TOGGLE_BIT   0x04

Definition at line 148 of file doc2000.h.

#define DoC_WritePipeTerm   0x101e

Definition at line 53 of file doc2000.h.

#define MAX_CHIPS   4

Definition at line 168 of file doc2000.h.

#define MAX_CHIPS_MIL   1

Definition at line 171 of file doc2000.h.

#define MAX_CHIPS_MPLUS   1

Definition at line 174 of file doc2000.h.

#define MAX_FLOORS   4

Definition at line 167 of file doc2000.h.

#define MAX_FLOORS_MIL   1

Definition at line 170 of file doc2000.h.

#define MAX_FLOORS_MPLUS   2

Definition at line 173 of file doc2000.h.

#define ReadDOC (   adr,
  reg 
)    ReadDOC_(adr,DoC_##reg)

Definition at line 114 of file doc2000.h.

#define ReadDOC_ (   adr,
  reg 
)    readb((void __iomem *)(adr) + (reg))

Definition at line 103 of file doc2000.h.

#define WriteDOC (   d,
  adr,
  reg 
)    WriteDOC_(d,adr,DoC_##reg)

Definition at line 115 of file doc2000.h.

#define WriteDOC_ (   d,
  adr,
  reg 
)    writeb(d, (void __iomem *)(adr) + (reg))

Definition at line 104 of file doc2000.h.

Function Documentation

int doc_decode_ecc ( unsigned char  sector[512],
unsigned char  ecc1[6] 
)