Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
onenand_base.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
#include <linux/mtd/partitions.h>
#include <asm/io.h>

Go to the source code of this file.

Macros

#define MB_ERASE_MIN_BLK_COUNT   2
 
#define MB_ERASE_MAX_BLK_COUNT   64
 
#define onenand_verify(...)   (0)
 
#define onenand_verify_oob(...)   (0)
 
#define NOTALIGNED(x)   ((x & (this->subpagesize - 1)) != 0)
 

Functions

 module_param_array (flex_bdry, int, NULL, 0400)
 
 MODULE_PARM_DESC (flex_bdry,"SLC Boundary information for Flex-OneNAND""Syntax:flex_bdry=DIE_BDRY,LOCK,...""DIE_BDRY: SLC boundary of the die""LOCK: Locking information for SLC boundary"" : 0->Set boundary in unlocked status"" : 1->Set boundary in locked status")
 
 module_param (otp, int, 0400)
 
 MODULE_PARM_DESC (otp,"Corresponding behaviour of OneNAND in OTP""Syntax : otp=LOCK_TYPE""LOCK_TYPE : Keys issued, for specific OTP Lock type"" : 0 -> Default (No Blocks Locked)"" : 1 -> OTP Block lock"" : 2 -> 1st Block lock"" : 3 -> BOTH OTP Block and 1st Block lock")
 
unsigned onenand_block (struct onenand_chip *this, loff_t addr)
 
loff_t onenand_addr (struct onenand_chip *this, int block)
 
 EXPORT_SYMBOL (onenand_addr)
 
int flexonenand_region (struct mtd_info *mtd, loff_t addr)
 
 EXPORT_SYMBOL (flexonenand_region)
 
int onenand_bbt_read_oob (struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops)
 
int onenand_scan (struct mtd_info *mtd, int maxchips)
 
void onenand_release (struct mtd_info *mtd)
 
 EXPORT_SYMBOL_GPL (onenand_scan)
 
 EXPORT_SYMBOL_GPL (onenand_release)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Kyungmin Park <[email protected]>")
 
 MODULE_DESCRIPTION ("Generic OneNAND flash driver code")
 

Macro Definition Documentation

#define MB_ERASE_MAX_BLK_COUNT   64

Definition at line 43 of file onenand_base.c.

#define MB_ERASE_MIN_BLK_COUNT   2

Definition at line 42 of file onenand_base.c.

#define NOTALIGNED (   x)    ((x & (this->subpagesize - 1)) != 0)

Definition at line 1715 of file onenand_base.c.

#define onenand_verify (   ...)    (0)

Definition at line 1711 of file onenand_base.c.

#define onenand_verify_oob (   ...)    (0)

Definition at line 1712 of file onenand_base.c.

Function Documentation

EXPORT_SYMBOL ( onenand_addr  )
EXPORT_SYMBOL ( flexonenand_region  )
EXPORT_SYMBOL_GPL ( onenand_scan  )
EXPORT_SYMBOL_GPL ( onenand_release  )
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.

MODULE_AUTHOR ( "Kyungmin Park <[email protected]>"  )
MODULE_DESCRIPTION ( "Generic OneNAND flash driver code )
MODULE_LICENSE ( "GPL"  )
module_param ( otp  ,
int  ,
0400   
)
module_param_array ( flex_bdry  ,
int  ,
NULL  ,
0400   
)
MODULE_PARM_DESC ( flex_bdry  ,
"SLC Boundary information for Flex-OneNAND""Syntax:flex_bdry  = DIE_BDRY,
LOCK  ,
...""DIE_BDRY:SLC boundary of the die""LOCK:Locking information for SLC boundary"":0->Set boundary in unlocked status"":1->Set boundary in locked status  
)
MODULE_PARM_DESC ( otp  ,
"Corresponding behaviour of OneNAND in OTP""Syntax :  otp = LOCK_TYPE""LOCK_TYPE : Keys issued,
for specific OTP Lock type"":0-> Default(No Blocks Locked)"":1-> OTP Block lock"":2-> 1st Block lock"":3-> BOTH OTP Block and 1st Block lock"   
)
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.