Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
cfi.h File Reference
#include <linux/delay.h>
#include <linux/types.h>
#include <linux/bug.h>
#include <linux/interrupt.h>
#include <linux/mtd/flashchip.h>
#include <linux/mtd/map.h>
#include <linux/mtd/cfi_endian.h>
#include <linux/mtd/xip.h>

Go to the source code of this file.

Data Structures

struct  cfi_ident
 
struct  cfi_extquery
 
struct  cfi_pri_intelext
 
struct  cfi_intelext_otpinfo
 
struct  cfi_intelext_blockinfo
 
struct  cfi_intelext_regioninfo
 
struct  cfi_intelext_programming_regioninfo
 
struct  cfi_pri_amdstd
 
struct  cfi_pri_atmel
 
struct  cfi_pri_query
 
struct  cfi_bri_query
 
struct  cfi_private
 
struct  cfi_fixup
 

Macros

#define cfi_interleave_is_1(cfi)   (0)
 
#define cfi_interleave_is_2(cfi)   (0)
 
#define cfi_interleave_is_4(cfi)   (0)
 
#define cfi_interleave_is_8(cfi)   (0)
 
#define CFI_DEVICETYPE_X8   (8 / 8)
 
#define CFI_DEVICETYPE_X16   (16 / 8)
 
#define CFI_DEVICETYPE_X32   (32 / 8)
 
#define CFI_DEVICETYPE_X64   (64 / 8)
 
#define CFI_INTERFACE_X8_ASYNC   0x0000
 
#define CFI_INTERFACE_X16_ASYNC   0x0001
 
#define CFI_INTERFACE_X8_BY_X16_ASYNC   0x0002
 
#define CFI_INTERFACE_X32_ASYNC   0x0003
 
#define CFI_INTERFACE_X16_BY_X32_ASYNC   0x0005
 
#define CFI_INTERFACE_NOT_ALLOWED   0xffff
 
#define P_ID_NONE   0x0000
 
#define P_ID_INTEL_EXT   0x0001
 
#define P_ID_AMD_STD   0x0002
 
#define P_ID_INTEL_STD   0x0003
 
#define P_ID_AMD_EXT   0x0004
 
#define P_ID_WINBOND   0x0006
 
#define P_ID_ST_ADV   0x0020
 
#define P_ID_MITSUBISHI_STD   0x0100
 
#define P_ID_MITSUBISHI_EXT   0x0101
 
#define P_ID_SST_PAGE   0x0102
 
#define P_ID_SST_OLD   0x0701
 
#define P_ID_INTEL_PERFORMANCE   0x0200
 
#define P_ID_INTEL_DATA   0x0210
 
#define P_ID_RESERVED   0xffff
 
#define CFI_MODE_CFI   1
 
#define CFI_MODE_JEDEC   0
 
#define CMD(x)   cfi_build_cmd((x), map, cfi)
 
#define MERGESTATUS(x)   cfi_merge_status((x), map, cfi)
 
#define CFI_MFR_ANY   0xFFFF
 
#define CFI_ID_ANY   0xFFFF
 
#define CFI_MFR_CONTINUATION   0x007F
 
#define CFI_MFR_AMD   0x0001
 
#define CFI_MFR_AMIC   0x0037
 
#define CFI_MFR_ATMEL   0x001F
 
#define CFI_MFR_EON   0x001C
 
#define CFI_MFR_FUJITSU   0x0004
 
#define CFI_MFR_HYUNDAI   0x00AD
 
#define CFI_MFR_INTEL   0x0089
 
#define CFI_MFR_MACRONIX   0x00C2
 
#define CFI_MFR_NEC   0x0010
 
#define CFI_MFR_PMC   0x009D
 
#define CFI_MFR_SAMSUNG   0x00EC
 
#define CFI_MFR_SHARP   0x00B0
 
#define CFI_MFR_SST   0x00BF
 
#define CFI_MFR_ST   0x0020 /* STMicroelectronics */
 
#define CFI_MFR_TOSHIBA   0x0098
 
#define CFI_MFR_WINBOND   0x00DA
 

Typedefs

typedef int(* varsize_frob_t )(struct map_info *map, struct flchip *chip, unsigned long adr, int len, void *thunk)
 

Functions

struct cfi_ident __attribute__ ((packed))
 
int __xipram cfi_qry_present (struct map_info *map, __u32 base, struct cfi_private *cfi)
 
int __xipram cfi_qry_mode_on (uint32_t base, struct map_info *map, struct cfi_private *cfi)
 
void __xipram cfi_qry_mode_off (uint32_t base, struct map_info *map, struct cfi_private *cfi)
 
struct cfi_extquerycfi_read_pri (struct map_info *map, uint16_t adr, uint16_t size, const char *name)
 
void cfi_fixup (struct mtd_info *mtd, struct cfi_fixup *fixups)
 
int cfi_varsize_frob (struct mtd_info *mtd, varsize_frob_t frob, loff_t ofs, size_t len, void *thunk)
 

Variables

uint8_t qry [3]
 
uint16_t P_ID
 
uint16_t P_ADR
 
uint16_t A_ID
 
uint16_t A_ADR
 
uint8_t VccMin
 
uint8_t VccMax
 
uint8_t VppMin
 
uint8_t VppMax
 
uint8_t WordWriteTimeoutTyp
 
uint8_t BufWriteTimeoutTyp
 
uint8_t BlockEraseTimeoutTyp
 
uint8_t ChipEraseTimeoutTyp
 
uint8_t WordWriteTimeoutMax
 
uint8_t BufWriteTimeoutMax
 
uint8_t BlockEraseTimeoutMax
 
uint8_t ChipEraseTimeoutMax
 
uint8_t DevSize
 
uint16_t InterfaceDesc
 
uint16_t MaxBufWriteSize
 
uint8_t NumEraseRegions
 
uint32_t EraseRegionInfo [0]
 
uint8_t pri [3]
 
uint8_t MajorVersion
 
uint8_t MinorVersion
 
uint32_t FeatureSupport
 
uint8_t SuspendCmdSupport
 
uint16_t BlkStatusRegMask
 
uint8_t VccOptimal
 
uint8_t VppOptimal
 
uint8_t NumProtectionFields
 
uint16_t ProtRegAddr
 
uint8_t FactProtRegSize
 
uint8_t UserProtRegSize
 
uint8_t extra [0]
 
uint16_t FactGroups
 
uint16_t UserGroups
 
uint16_t NumIdentBlocks
 
uint16_t BlockSize
 
uint16_t MinBlockEraseCycles
 
uint8_t BitsPerCell
 
uint8_t BlockCap
 
uint16_t NumIdentPartitions
 
uint8_t NumOpAllowed
 
uint8_t NumOpAllowedSimProgMode
 
uint8_t NumOpAllowedSimEraMode
 
uint8_t NumBlockTypes
 
struct cfi_intelext_blockinfo BlockTypes [1]
 
uint8_t ProgRegShift
 
uint8_t Reserved1
 
uint8_t ControlValid
 
uint8_t Reserved2
 
uint8_t ControlInvalid
 
uint8_t Reserved3
 
uint8_t SiliconRevision
 
uint8_t EraseSuspend
 
uint8_t BlkProt
 
uint8_t TmpBlkUnprotect
 
uint8_t BlkProtUnprot
 
uint8_t SimultaneousOps
 
uint8_t BurstMode
 
uint8_t PageMode
 
uint8_t TopBottom
 
uint8_t Features
 
uint8_t BottomBoot
 
uint8_t NumFields
 
uint32_t ProtField [1]
 
uint8_t PageModeReadCap
 
uint32_t ConfField [1]
 
struct cfi_private __attribute__
 

Macro Definition Documentation

#define CFI_DEVICETYPE_X16   (16 / 8)

Definition at line 112 of file cfi.h.

#define CFI_DEVICETYPE_X32   (32 / 8)

Definition at line 113 of file cfi.h.

#define CFI_DEVICETYPE_X64   (64 / 8)

Definition at line 114 of file cfi.h.

#define CFI_DEVICETYPE_X8   (8 / 8)

Definition at line 111 of file cfi.h.

#define CFI_ID_ANY   0xFFFF

Definition at line 535 of file cfi.h.

#define CFI_INTERFACE_NOT_ALLOWED   0xffff

Definition at line 125 of file cfi.h.

#define CFI_INTERFACE_X16_ASYNC   0x0001

Definition at line 121 of file cfi.h.

#define CFI_INTERFACE_X16_BY_X32_ASYNC   0x0005

Definition at line 124 of file cfi.h.

#define CFI_INTERFACE_X32_ASYNC   0x0003

Definition at line 123 of file cfi.h.

#define CFI_INTERFACE_X8_ASYNC   0x0000

Definition at line 120 of file cfi.h.

#define CFI_INTERFACE_X8_BY_X16_ASYNC   0x0002

Definition at line 122 of file cfi.h.

#define cfi_interleave_is_1 (   cfi)    (0)

Definition at line 36 of file cfi.h.

#define cfi_interleave_is_2 (   cfi)    (0)

Definition at line 48 of file cfi.h.

#define cfi_interleave_is_4 (   cfi)    (0)

Definition at line 60 of file cfi.h.

#define cfi_interleave_is_8 (   cfi)    (0)

Definition at line 72 of file cfi.h.

#define CFI_MFR_AMD   0x0001

Definition at line 538 of file cfi.h.

#define CFI_MFR_AMIC   0x0037

Definition at line 539 of file cfi.h.

#define CFI_MFR_ANY   0xFFFF

Definition at line 534 of file cfi.h.

#define CFI_MFR_ATMEL   0x001F

Definition at line 540 of file cfi.h.

#define CFI_MFR_CONTINUATION   0x007F

Definition at line 536 of file cfi.h.

#define CFI_MFR_EON   0x001C

Definition at line 541 of file cfi.h.

#define CFI_MFR_FUJITSU   0x0004

Definition at line 542 of file cfi.h.

#define CFI_MFR_HYUNDAI   0x00AD

Definition at line 543 of file cfi.h.

#define CFI_MFR_INTEL   0x0089

Definition at line 544 of file cfi.h.

#define CFI_MFR_MACRONIX   0x00C2

Definition at line 545 of file cfi.h.

#define CFI_MFR_NEC   0x0010

Definition at line 546 of file cfi.h.

#define CFI_MFR_PMC   0x009D

Definition at line 547 of file cfi.h.

#define CFI_MFR_SAMSUNG   0x00EC

Definition at line 548 of file cfi.h.

#define CFI_MFR_SHARP   0x00B0

Definition at line 549 of file cfi.h.

#define CFI_MFR_SST   0x00BF

Definition at line 550 of file cfi.h.

#define CFI_MFR_ST   0x0020 /* STMicroelectronics */

Definition at line 551 of file cfi.h.

#define CFI_MFR_TOSHIBA   0x0098

Definition at line 552 of file cfi.h.

#define CFI_MFR_WINBOND   0x00DA

Definition at line 553 of file cfi.h.

#define CFI_MODE_CFI   1

Definition at line 277 of file cfi.h.

#define CFI_MODE_JEDEC   0

Definition at line 278 of file cfi.h.

#define CMD (   x)    cfi_build_cmd((x), map, cfi)

Definition at line 389 of file cfi.h.

#define MERGESTATUS (   x)    cfi_merge_status((x), map, cfi)

Definition at line 451 of file cfi.h.

#define P_ID_AMD_EXT   0x0004

Definition at line 265 of file cfi.h.

#define P_ID_AMD_STD   0x0002

Definition at line 263 of file cfi.h.

#define P_ID_INTEL_DATA   0x0210

Definition at line 273 of file cfi.h.

#define P_ID_INTEL_EXT   0x0001

Definition at line 262 of file cfi.h.

#define P_ID_INTEL_PERFORMANCE   0x0200

Definition at line 272 of file cfi.h.

#define P_ID_INTEL_STD   0x0003

Definition at line 264 of file cfi.h.

#define P_ID_MITSUBISHI_EXT   0x0101

Definition at line 269 of file cfi.h.

#define P_ID_MITSUBISHI_STD   0x0100

Definition at line 268 of file cfi.h.

#define P_ID_NONE   0x0000

Definition at line 261 of file cfi.h.

#define P_ID_RESERVED   0xffff

Definition at line 274 of file cfi.h.

#define P_ID_SST_OLD   0x0701

Definition at line 271 of file cfi.h.

#define P_ID_SST_PAGE   0x0102

Definition at line 270 of file cfi.h.

#define P_ID_ST_ADV   0x0020

Definition at line 267 of file cfi.h.

#define P_ID_WINBOND   0x0006

Definition at line 266 of file cfi.h.

Typedef Documentation

typedef int(* varsize_frob_t)(struct map_info *map, struct flchip *chip, unsigned long adr, int len, void *thunk)

Definition at line 557 of file cfi.h.

Function Documentation

struct cfi_ident __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

void cfi_fixup ( struct mtd_info mtd,
struct cfi_fixup fixups 
)

Definition at line 150 of file cfi_util.c.

void __xipram cfi_qry_mode_off ( uint32_t  base,
struct map_info map,
struct cfi_private cfi 
)

Definition at line 92 of file cfi_util.c.

int __xipram cfi_qry_mode_on ( uint32_t  base,
struct map_info map,
struct cfi_private cfi 
)

Definition at line 54 of file cfi_util.c.

int __xipram cfi_qry_present ( struct map_info map,
__u32  base,
struct cfi_private cfi 
)

Definition at line 26 of file cfi_util.c.

struct cfi_extquery* cfi_read_pri ( struct map_info map,
uint16_t  adr,
uint16_t  size,
const char name 
)
read

Definition at line 105 of file cfi_util.c.

int cfi_varsize_frob ( struct mtd_info mtd,
varsize_frob_t  frob,
loff_t  ofs,
size_t  len,
void thunk 
)

Definition at line 166 of file cfi_util.c.

Variable Documentation

uint16_t A_ADR

Definition at line 161 of file cfi.h.

uint16_t A_ID

Definition at line 160 of file cfi.h.

uint8_t BitsPerCell

Definition at line 203 of file cfi.h.

uint8_t BlkProt

Definition at line 242 of file cfi.h.

uint8_t BlkProtUnprot

Definition at line 244 of file cfi.h.

uint16_t BlkStatusRegMask

Definition at line 190 of file cfi.h.

uint8_t BlockCap

Definition at line 204 of file cfi.h.

uint8_t BlockEraseTimeoutMax

Definition at line 172 of file cfi.h.

uint8_t BlockEraseTimeoutTyp

Definition at line 168 of file cfi.h.

uint16_t BlockSize

Definition at line 201 of file cfi.h.

Definition at line 214 of file cfi.h.

uint8_t BottomBoot

Definition at line 253 of file cfi.h.

uint8_t BufWriteTimeoutMax

Definition at line 171 of file cfi.h.

uint8_t BufWriteTimeoutTyp

Definition at line 167 of file cfi.h.

uint8_t BurstMode

Definition at line 246 of file cfi.h.

uint8_t ChipEraseTimeoutMax

Definition at line 173 of file cfi.h.

uint8_t ChipEraseTimeoutTyp

Definition at line 169 of file cfi.h.

uint32_t ConfField[1]

Definition at line 262 of file cfi.h.

uint8_t ControlInvalid

Definition at line 222 of file cfi.h.

uint8_t ControlValid

Definition at line 220 of file cfi.h.

uint8_t DevSize

Definition at line 174 of file cfi.h.

uint32_t EraseRegionInfo[0]

Definition at line 178 of file cfi.h.

uint8_t EraseSuspend

Definition at line 241 of file cfi.h.

uint8_t extra[0]

Definition at line 197 of file cfi.h.

uint16_t FactGroups

Definition at line 193 of file cfi.h.

uint8_t FactProtRegSize

Definition at line 195 of file cfi.h.

uint8_t Features

Definition at line 252 of file cfi.h.

uint32_t FeatureSupport

Definition at line 187 of file cfi.h.

uint16_t InterfaceDesc

Definition at line 175 of file cfi.h.

uint8_t MajorVersion

Definition at line 166 of file cfi.h.

uint16_t MaxBufWriteSize

Definition at line 176 of file cfi.h.

uint16_t MinBlockEraseCycles

Definition at line 202 of file cfi.h.

uint8_t MinorVersion

Definition at line 167 of file cfi.h.

uint8_t NumBlockTypes

Definition at line 213 of file cfi.h.

uint8_t NumEraseRegions

Definition at line 177 of file cfi.h.

uint8_t NumFields

Definition at line 254 of file cfi.h.

uint16_t NumIdentBlocks

Definition at line 200 of file cfi.h.

uint16_t NumIdentPartitions

Definition at line 209 of file cfi.h.

uint8_t NumOpAllowed

Definition at line 210 of file cfi.h.

uint8_t NumOpAllowedSimEraMode

Definition at line 212 of file cfi.h.

uint8_t NumOpAllowedSimProgMode

Definition at line 211 of file cfi.h.

uint8_t NumProtectionFields

Definition at line 193 of file cfi.h.

uint16_t P_ADR

Definition at line 159 of file cfi.h.

uint16_t P_ID

Definition at line 158 of file cfi.h.

uint8_t PageMode

Definition at line 247 of file cfi.h.

uint8_t PageModeReadCap

Definition at line 260 of file cfi.h.

uint8_t pri

Definition at line 165 of file cfi.h.

uint8_t ProgRegShift

Definition at line 218 of file cfi.h.

uint32_t ProtField[1]

Definition at line 255 of file cfi.h.

uint32_t ProtRegAddr

Definition at line 194 of file cfi.h.

uint8_t qry[3]

Definition at line 157 of file cfi.h.

uint8_t Reserved1

Definition at line 219 of file cfi.h.

uint8_t Reserved2

Definition at line 221 of file cfi.h.

uint8_t Reserved3

Definition at line 223 of file cfi.h.

uint8_t SiliconRevision

Definition at line 240 of file cfi.h.

uint8_t SimultaneousOps

Definition at line 245 of file cfi.h.

uint8_t SuspendCmdSupport

Definition at line 189 of file cfi.h.

uint8_t TmpBlkUnprotect

Definition at line 243 of file cfi.h.

uint8_t TopBottom

Definition at line 250 of file cfi.h.

uint16_t UserGroups

Definition at line 195 of file cfi.h.

uint8_t UserProtRegSize

Definition at line 196 of file cfi.h.

uint8_t VccMax

Definition at line 163 of file cfi.h.

uint8_t VccMin

Definition at line 162 of file cfi.h.

uint8_t VccOptimal

Definition at line 191 of file cfi.h.

uint8_t VppMax

Definition at line 165 of file cfi.h.

uint8_t VppMin

Definition at line 164 of file cfi.h.

uint8_t VppOptimal

Definition at line 192 of file cfi.h.

uint8_t WordWriteTimeoutMax

Definition at line 170 of file cfi.h.

uint8_t WordWriteTimeoutTyp

Definition at line 166 of file cfi.h.