Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
onenand.h File Reference
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/mtd/flashchip.h>
#include <linux/mtd/onenand_regs.h>
#include <linux/mtd/bbm.h>

Go to the source code of this file.

Data Structures

struct  onenand_bufferram
 
struct  onenand_chip
 
struct  onenand_manufacturers
 
struct  onenand_platform_data
 

Macros

#define MAX_DIES   2
 
#define MAX_BUFFERRAM   2
 
#define ONENAND_PAGES_PER_BLOCK   (1<<6)
 
#define ONENAND_CURRENT_BUFFERRAM(this)   (this->bufferram_index)
 
#define ONENAND_NEXT_BUFFERRAM(this)   (this->bufferram_index ^ 1)
 
#define ONENAND_SET_NEXT_BUFFERRAM(this)   (this->bufferram_index ^= 1)
 
#define ONENAND_SET_PREV_BUFFERRAM(this)   (this->bufferram_index ^= 1)
 
#define ONENAND_SET_BUFFERRAM0(this)   (this->bufferram_index = 0)
 
#define ONENAND_SET_BUFFERRAM1(this)   (this->bufferram_index = 1)
 
#define FLEXONENAND(this)   (this->device_id & DEVICE_IS_FLEXONENAND)
 
#define ONENAND_GET_SYS_CFG1(this)   (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
 
#define ONENAND_SET_SYS_CFG1(v, this)   (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
 
#define ONENAND_IS_DDP(this)   (this->device_id & ONENAND_DEVICE_IS_DDP)
 
#define ONENAND_IS_MLC(this)   (this->technology & ONENAND_TECHNOLOGY_IS_MLC)
 
#define ONENAND_IS_2PLANE(this)   (0)
 
#define ONENAND_IS_CACHE_PROGRAM(this)   (this->options & ONENAND_HAS_CACHE_PROGRAM)
 
#define ONENAND_IS_NOP_1(this)   (this->options & ONENAND_HAS_NOP_1)
 
#define ONENAND_CHECK_BYTE_ACCESS(addr)   (addr & 0x1)
 
#define ONENAND_HAS_CONT_LOCK   (0x0001)
 
#define ONENAND_HAS_UNLOCK_ALL   (0x0002)
 
#define ONENAND_HAS_2PLANE   (0x0004)
 
#define ONENAND_HAS_4KB_PAGE   (0x0008)
 
#define ONENAND_HAS_CACHE_PROGRAM   (0x0010)
 
#define ONENAND_HAS_NOP_1   (0x0020)
 
#define ONENAND_SKIP_UNLOCK_CHECK   (0x0100)
 
#define ONENAND_PAGEBUF_ALLOC   (0x1000)
 
#define ONENAND_OOBBUF_ALLOC   (0x2000)
 
#define ONENAND_SKIP_INITIAL_UNLOCKING   (0x4000)
 
#define ONENAND_IS_4KB_PAGE(this)   (this->options & ONENAND_HAS_4KB_PAGE)
 
#define ONENAND_MFR_SAMSUNG   0xec
 
#define ONENAND_MFR_NUMONYX   0x20
 

Functions

int onenand_scan (struct mtd_info *mtd, int max_chips)
 
void onenand_release (struct mtd_info *mtd)
 
: Manufacturer name

struct onenand_manufacturers - NAND Flash Manufacturer ID Structure

: manufacturer ID code of device.

int onenand_bbt_read_oob (struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops)
 
unsigned onenand_block (struct onenand_chip *this, loff_t addr)
 
loff_t onenand_addr (struct onenand_chip *this, int block)
 
int flexonenand_region (struct mtd_info *mtd, loff_t addr)
 

Macro Definition Documentation

#define FLEXONENAND (   this)    (this->device_id & DEVICE_IS_FLEXONENAND)

Definition at line 164 of file onenand.h.

#define MAX_BUFFERRAM   2

Definition at line 22 of file onenand.h.

#define MAX_DIES   2

Definition at line 21 of file onenand.h.

#define ONENAND_CHECK_BYTE_ACCESS (   addr)    (addr & 0x1)

Definition at line 191 of file onenand.h.

#define ONENAND_CURRENT_BUFFERRAM (   this)    (this->bufferram_index)

Definition at line 157 of file onenand.h.

#define ONENAND_GET_SYS_CFG1 (   this)    (this->read_word(this->base + ONENAND_REG_SYS_CFG1))

Definition at line 166 of file onenand.h.

#define ONENAND_HAS_2PLANE   (0x0004)

Definition at line 198 of file onenand.h.

#define ONENAND_HAS_4KB_PAGE   (0x0008)

Definition at line 199 of file onenand.h.

#define ONENAND_HAS_CACHE_PROGRAM   (0x0010)

Definition at line 200 of file onenand.h.

#define ONENAND_HAS_CONT_LOCK   (0x0001)

Definition at line 196 of file onenand.h.

#define ONENAND_HAS_NOP_1   (0x0020)

Definition at line 201 of file onenand.h.

#define ONENAND_HAS_UNLOCK_ALL   (0x0002)

Definition at line 197 of file onenand.h.

#define ONENAND_IS_2PLANE (   this)    (0)

Definition at line 181 of file onenand.h.

#define ONENAND_IS_4KB_PAGE (   this)    (this->options & ONENAND_HAS_4KB_PAGE)

Definition at line 207 of file onenand.h.

#define ONENAND_IS_CACHE_PROGRAM (   this)    (this->options & ONENAND_HAS_CACHE_PROGRAM)

Definition at line 184 of file onenand.h.

#define ONENAND_IS_DDP (   this)    (this->device_id & ONENAND_DEVICE_IS_DDP)

Definition at line 171 of file onenand.h.

#define ONENAND_IS_MLC (   this)    (this->technology & ONENAND_TECHNOLOGY_IS_MLC)

Definition at line 174 of file onenand.h.

#define ONENAND_IS_NOP_1 (   this)    (this->options & ONENAND_HAS_NOP_1)

Definition at line 187 of file onenand.h.

#define ONENAND_MFR_NUMONYX   0x20

Definition at line 214 of file onenand.h.

#define ONENAND_MFR_SAMSUNG   0xec

Definition at line 213 of file onenand.h.

#define ONENAND_NEXT_BUFFERRAM (   this)    (this->bufferram_index ^ 1)

Definition at line 158 of file onenand.h.

#define ONENAND_OOBBUF_ALLOC   (0x2000)

Definition at line 204 of file onenand.h.

#define ONENAND_PAGEBUF_ALLOC   (0x1000)

Definition at line 203 of file onenand.h.

#define ONENAND_PAGES_PER_BLOCK   (1<<6)

Definition at line 155 of file onenand.h.

#define ONENAND_SET_BUFFERRAM0 (   this)    (this->bufferram_index = 0)

Definition at line 161 of file onenand.h.

#define ONENAND_SET_BUFFERRAM1 (   this)    (this->bufferram_index = 1)

Definition at line 162 of file onenand.h.

#define ONENAND_SET_NEXT_BUFFERRAM (   this)    (this->bufferram_index ^= 1)

Definition at line 159 of file onenand.h.

#define ONENAND_SET_PREV_BUFFERRAM (   this)    (this->bufferram_index ^= 1)

Definition at line 160 of file onenand.h.

#define ONENAND_SET_SYS_CFG1 (   v,
  this 
)    (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))

Definition at line 168 of file onenand.h.

#define ONENAND_SKIP_INITIAL_UNLOCKING   (0x4000)

Definition at line 205 of file onenand.h.

#define ONENAND_SKIP_UNLOCK_CHECK   (0x0100)

Definition at line 202 of file onenand.h.

Function Documentation

int flexonenand_region ( struct mtd_info mtd,
loff_t  addr 
)

flexonenand_region - [Flex-OneNAND] Return erase region of addr

Parameters
mtdMTD device structure
addraddress whose erase region needs to be identified

Definition at line 350 of file onenand_base.c.

loff_t onenand_addr ( struct onenand_chip this,
int  block 
)

Definition at line 325 of file onenand_base.c.

int onenand_bbt_read_oob ( struct mtd_info mtd,
loff_t  from,
struct mtd_oob_ops ops 
)

onenand_bbt_read_oob - [MTD Interface] OneNAND read out-of-band for bbt scan

Parameters
mtdMTD device structure
fromoffset to read from
opsoob operation description structure

OneNAND read out-of-band data from the spare area for bbt scan

Definition at line 1572 of file onenand_base.c.

unsigned onenand_block ( struct onenand_chip this,
loff_t  addr 
)
inline

Definition at line 293 of file onenand_base.c.

void onenand_release ( struct mtd_info mtd)

onenand_release - [OneNAND Interface] Free resources held by the OneNAND device

Parameters
mtdMTD device structure

Definition at line 4134 of file onenand_base.c.

int onenand_scan ( struct mtd_info mtd,
int  maxchips 
)

onenand_scan - [OneNAND Interface] Scan for the OneNAND device

Parameters
mtdMTD device structure
maxchipsNumber of chips to scan for

This fills out all the not initialized function pointers with the defaults. The flash ID is read and the mtd/chip structures are filled with the appropriate values.

Definition at line 3959 of file onenand_base.c.