Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
denali.c File Reference
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/wait.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/mtd/mtd.h>
#include <linux/module.h>
#include "denali.h"

Go to the source code of this file.

Macros

#define NAND_DEFAULT_TIMINGS   -1
 
#define DENALI_NAND_NAME   "denali-nand"
 
#define DENALI_IRQ_ALL
 
#define CHIP_SELECT_INVALID   -1
 
#define SUPPORT_8BITECC   1
 
#define CEIL_DIV(X, Y)   (((X)%(Y)) ? ((X)/(Y)+1) : ((X)/(Y)))
 
#define mtd_to_denali(m)   container_of(m, struct denali_nand_info, mtd)
 
#define SPARE_ACCESS   0x41
 
#define MAIN_ACCESS   0x42
 
#define MAIN_SPARE_ACCESS   0x43
 
#define DENALI_READ   0
 
#define DENALI_WRITE   0x100
 
#define COMMAND_CYCLE   0
 
#define ADDR_CYCLE   1
 
#define STATUS_CYCLE   2
 
#define BANK(x)   ((x) << 24)
 
#define BANK(x)   ((x) << 24)
 
#define ECC_SECTOR_SIZE   512
 
#define ECC_SECTOR(x)   (((x) & ECC_ERROR_ADDRESS__SECTOR_NR) >> 12)
 
#define ECC_BYTE(x)   (((x) & ECC_ERROR_ADDRESS__OFFSET))
 
#define ECC_CORRECTION_VALUE(x)   ((x) & ERR_CORRECTION_INFO__BYTEMASK)
 
#define ECC_ERROR_CORRECTABLE(x)   (!((x) & ERR_CORRECTION_INFO__ERROR_TYPE))
 
#define ECC_ERR_DEVICE(x)   (((x) & ERR_CORRECTION_INFO__DEVICE_NR) >> 8)
 
#define ECC_LAST_ERR(x)   ((x) & ERR_CORRECTION_INFO__LAST_ERR_INFO)
 
#define ECC_8BITS   14
 
#define ECC_15BITS   26
 

Functions

 MODULE_LICENSE ("GPL")
 
 module_param (onfi_timing_mode, int, S_IRUGO)
 
 MODULE_PARM_DESC (onfi_timing_mode,"Overrides default ONFI setting."" -1 indicates use default timings")
 
bool is_erased (uint8_t *buf, int len)
 
void denali_drv_init (struct denali_nand_info *denali)
 
 MODULE_DEVICE_TABLE (pci, denali_pci_ids)
 
 module_pci_driver (denali_pci_driver)
 

Macro Definition Documentation

#define ADDR_CYCLE   1

Definition at line 85 of file denali.c.

#define BANK (   x)    ((x) << 24)

Definition at line 672 of file denali.c.

#define BANK (   x)    ((x) << 24)

Definition at line 672 of file denali.c.

#define CEIL_DIV (   X,
 
)    (((X)%(Y)) ? ((X)/(Y)+1) : ((X)/(Y)))

Definition at line 67 of file denali.c.

#define CHIP_SELECT_INVALID   -1

Definition at line 61 of file denali.c.

#define COMMAND_CYCLE   0

Definition at line 84 of file denali.c.

#define DENALI_IRQ_ALL
Value:
INTR_STATUS__ECC_TRANSACTION_DONE | \
INTR_STATUS__ECC_ERR | \
INTR_STATUS__PROGRAM_FAIL | \
INTR_STATUS__LOAD_COMP | \
INTR_STATUS__PROGRAM_COMP | \
INTR_STATUS__TIME_OUT | \
INTR_STATUS__ERASE_FAIL | \
INTR_STATUS__RST_COMP | \
INTR_STATUS__ERASE_COMP)

Definition at line 48 of file denali.c.

#define DENALI_NAND_NAME   "denali-nand"

Definition at line 44 of file denali.c.

#define DENALI_READ   0

Definition at line 80 of file denali.c.

#define DENALI_WRITE   0x100

Definition at line 81 of file denali.c.

#define ECC_15BITS   26

Definition at line 1378 of file denali.c.

#define ECC_8BITS   14

Definition at line 1373 of file denali.c.

#define ECC_BYTE (   x)    (((x) & ECC_ERROR_ADDRESS__OFFSET))

Definition at line 920 of file denali.c.

#define ECC_CORRECTION_VALUE (   x)    ((x) & ERR_CORRECTION_INFO__BYTEMASK)

Definition at line 921 of file denali.c.

#define ECC_ERR_DEVICE (   x)    (((x) & ERR_CORRECTION_INFO__DEVICE_NR) >> 8)

Definition at line 923 of file denali.c.

#define ECC_ERROR_CORRECTABLE (   x)    (!((x) & ERR_CORRECTION_INFO__ERROR_TYPE))

Definition at line 922 of file denali.c.

#define ECC_LAST_ERR (   x)    ((x) & ERR_CORRECTION_INFO__LAST_ERR_INFO)

Definition at line 924 of file denali.c.

#define ECC_SECTOR (   x)    (((x) & ECC_ERROR_ADDRESS__SECTOR_NR) >> 12)

Definition at line 919 of file denali.c.

#define ECC_SECTOR_SIZE   512

Definition at line 917 of file denali.c.

#define MAIN_ACCESS   0x42

Definition at line 77 of file denali.c.

#define MAIN_SPARE_ACCESS   0x43

Definition at line 78 of file denali.c.

#define mtd_to_denali (   m)    container_of(m, struct denali_nand_info, mtd)

Definition at line 72 of file denali.c.

#define NAND_DEFAULT_TIMINGS   -1

Definition at line 37 of file denali.c.

#define SPARE_ACCESS   0x41

Definition at line 76 of file denali.c.

#define STATUS_CYCLE   2

Definition at line 86 of file denali.c.

#define SUPPORT_8BITECC   1

Definition at line 63 of file denali.c.

Function Documentation

void denali_drv_init ( struct denali_nand_info denali)

Definition at line 1407 of file denali.c.

bool is_erased ( uint8_t buf,
int  len 
)

Definition at line 909 of file denali.c.

MODULE_DEVICE_TABLE ( pci  ,
denali_pci_ids   
)
MODULE_LICENSE ( "GPL"  )
module_param ( onfi_timing_mode  ,
int  ,
S_IRUGO   
)
MODULE_PARM_DESC ( onfi_timing_mode  ,
"Overrides default ONFI setting."" -1 indicates use default timings  
)
module_pci_driver ( denali_pci_driver  )