os/linux-2.6-tag--devboard-R2_10-4/arch/cris/arch-v32/drivers/nandflash.c File Reference

#include <linux/slab.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <asm/arch/memmap.h>
#include <asm/arch/hwregs/reg_map.h>
#include <asm/arch/hwregs/reg_rdwr.h>
#include <asm/arch/hwregs/gio_defs.h>
#include <asm/arch/hwregs/bif_core_defs.h>
#include <asm/io.h>
#include <linux/time.h>

Include dependency graph for nandflash.c:

Go to the source code of this file.

Defines

#define CE_BIT   4
#define CLE_BIT   5
#define ALE_BIT   6
#define BY_BIT   7
#define PIN_BITMASK   ((1 << CE_BIT) | (1 << CLE_BIT) | (1 << ALE_BIT))
#define CTRL_BITMASK   (NAND_NCE | NAND_CLE | NAND_ALE)
#define DEBUG_ELPHEL_MTD   1
 when enabled allows monitoring NAND requests by OR-ing 0x10000000 with cfg3 (not used)

Functions

static void crisv32_hwcontrol (struct mtd_info *mtd, int cmd, unsigned int ctrl)
int crisv32_device_ready (struct mtd_info *mtd)
mtd_info *__init crisv32_nand_flash_probe (void)

Variables

static struct mtd_infocrisv32_mtd = NULL
volatile unsigned long * port_dummy_addr


Define Documentation

#define ALE_BIT   6

Definition at line 34 of file nandflash.c.

Referenced by crisv32_hwcontrol(), and crisv32_nand_flash_probe().

#define BY_BIT   7

Definition at line 35 of file nandflash.c.

Referenced by crisv32_device_ready(), and crisv32_nand_flash_probe().

#define CE_BIT   4

Definition at line 32 of file nandflash.c.

Referenced by crisv32_hwcontrol(), and crisv32_nand_flash_probe().

#define CLE_BIT   5

Definition at line 33 of file nandflash.c.

Referenced by crisv32_hwcontrol(), and crisv32_nand_flash_probe().

#define CTRL_BITMASK   (NAND_NCE | NAND_CLE | NAND_ALE)

Definition at line 41 of file nandflash.c.

Referenced by crisv32_hwcontrol().

#define DEBUG_ELPHEL_MTD   1

when enabled allows monitoring NAND requests by OR-ing 0x10000000 with cfg3 (not used)

Definition at line 44 of file nandflash.c.

#define PIN_BITMASK   ((1 << CE_BIT) | (1 << CLE_BIT) | (1 << ALE_BIT))

Definition at line 38 of file nandflash.c.

Referenced by crisv32_hwcontrol().


Function Documentation

int crisv32_device_ready ( struct mtd_info mtd  ) 

Definition at line 112 of file nandflash.c.

References BY_BIT, NAND_NCE, and printk.

Referenced by crisv32_nand_flash_probe().

static void crisv32_hwcontrol ( struct mtd_info mtd,
int  cmd,
unsigned int  ctrl 
) [static]

read from unused CSR1 (0 w.s.) - used to make sure bus write cycle (possibly delayed by DMA) is over and it is OK to change ALE, CLE, ...

these commands take a small fraction of the time compared to block read/write, so there is really no sense to optimize it.

Make sure port_dummy_addr[0] is not optimized out. Will that work?

Definition at line 53 of file nandflash.c.

References ALE_BIT, CE_BIT, CLE_BIT, CTRL_BITMASK, NAND_ALE, NAND_CLE, NAND_CMD_NONE, NAND_CTRL_CHANGE, NAND_NCE, PIN_BITMASK, port_dummy_addr, printk, mtd_info::priv, and writeb().

Referenced by crisv32_nand_flash_probe().

struct mtd_info* __init crisv32_nand_flash_probe ( void   ) 

Definition at line 125 of file nandflash.c.


Variable Documentation

struct mtd_info* crisv32_mtd = NULL [static]

Definition at line 45 of file nandflash.c.

Referenced by crisv32_nand_flash_probe().

volatile unsigned long* port_dummy_addr

Definition at line 50 of file nandflash.c.

Referenced by crisv32_hwcontrol(), and crisv32_nand_flash_probe().


Generated on Fri Nov 28 00:08:17 2008 for elphel by  doxygen 1.5.1