#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <asm/mach-types.h>
#include <plat/gpmc.h>
#include <plat/cpu.h>
#include <plat/sdrc.h>
#include <plat/omap_device.h>
#include "soc.h"
#include "common.h"
Go to the source code of this file.
|
void | gpmc_cs_write_reg (int cs, int idx, u32 val) |
|
u32 | gpmc_cs_read_reg (int cs, int idx) |
|
unsigned long | gpmc_get_fclk_period (void) |
|
unsigned int | gpmc_ns_to_ticks (unsigned int time_ns) |
|
unsigned int | gpmc_ps_to_ticks (unsigned int time_ps) |
|
unsigned int | gpmc_ticks_to_ns (unsigned int ticks) |
|
unsigned int | gpmc_round_ns_to_ticks (unsigned int time_ns) |
|
int | gpmc_cs_calc_divider (int cs, unsigned int sync_clk) |
|
int | gpmc_cs_set_timings (int cs, const struct gpmc_timings *t) |
|
int | gpmc_cs_set_reserved (int cs, int reserved) |
|
int | gpmc_cs_reserved (int cs) |
|
int | gpmc_cs_request (int cs, unsigned long size, unsigned long *base) |
|
| EXPORT_SYMBOL (gpmc_cs_request) |
|
void | gpmc_cs_free (int cs) |
|
| EXPORT_SYMBOL (gpmc_cs_free) |
|
int | gpmc_read_status (int cmd) |
|
| EXPORT_SYMBOL (gpmc_read_status) |
|
int | gpmc_cs_configure (int cs, int cmd, int wval) |
|
| EXPORT_SYMBOL (gpmc_cs_configure) |
|
int | gpmc_nand_read (int cs, int cmd) |
|
| EXPORT_SYMBOL (gpmc_nand_read) |
|
int | gpmc_nand_write (int cs, int cmd, int wval) |
|
| EXPORT_SYMBOL (gpmc_nand_write) |
|
int | gpmc_prefetch_enable (int cs, int fifo_th, int dma_mode, unsigned int u32_count, int is_write) |
|
| EXPORT_SYMBOL (gpmc_prefetch_enable) |
|
int | gpmc_prefetch_reset (int cs) |
|
| EXPORT_SYMBOL (gpmc_prefetch_reset) |
|
void | gpmc_update_nand_reg (struct gpmc_nand_regs *reg, int cs) |
|
int | gpmc_get_client_irq (unsigned irq_config) |
|
| postcore_initcall (gpmc_init) |
|
| module_exit (gpmc_exit) |
|
| postcore_initcall (omap_gpmc_init) |
|
int | gpmc_enable_hwecc (int cs, int mode, int dev_width, int ecc_size) |
|
| EXPORT_SYMBOL_GPL (gpmc_enable_hwecc) |
|
int | gpmc_calculate_ecc (int cs, const u_char *dat, u_char *ecc_code) |
|
| EXPORT_SYMBOL_GPL (gpmc_calculate_ecc) |
|
#define BOOT_ROM_SPACE 0x100000 /* 1MB */ |
#define DEVICE_NAME "omap-gpmc" |
#define ENABLE_PREFETCH (0x1 << 7) |
#define GPMC_CHUNK_SHIFT 24 /* 16 MB */ |
#define GPMC_CS0_OFFSET 0x60 |
#define GPMC_CS_SIZE 0x30 |
#define GPMC_ECC1_RESULT 0x200 |
#define GPMC_ECC_BCH_RESULT_0 0x240 /* not available on OMAP2 */ |
#define GPMC_ECC_CONFIG 0x1f4 |
#define GPMC_ECC_CONTROL 0x1f8 |
#define GPMC_ECC_CTRL_ECCCLEAR 0x100 |
#define GPMC_ECC_CTRL_ECCDISABLE 0x000 |
#define GPMC_ECC_CTRL_ECCREG1 0x001 |
#define GPMC_ECC_CTRL_ECCREG2 0x002 |
#define GPMC_ECC_CTRL_ECCREG3 0x003 |
#define GPMC_ECC_CTRL_ECCREG4 0x004 |
#define GPMC_ECC_CTRL_ECCREG5 0x005 |
#define GPMC_ECC_CTRL_ECCREG6 0x006 |
#define GPMC_ECC_CTRL_ECCREG7 0x007 |
#define GPMC_ECC_CTRL_ECCREG8 0x008 |
#define GPMC_ECC_CTRL_ECCREG9 0x009 |
#define GPMC_ECC_SIZE_CONFIG 0x1fc |
#define GPMC_ERR_ADDRESS 0x44 |
#define GPMC_ERR_TYPE 0x48 |
#define GPMC_HAS_WR_ACCESS 0x1 |
#define GPMC_HAS_WR_DATA_MUX_BUS 0x2 |
#define GPMC_IRQENABLE 0x1c |
#define GPMC_IRQSTATUS 0x18 |
#define GPMC_MEM_END 0x3FFFFFFF |
#define GPMC_MEM_START 0x00000000 |
#define GPMC_PREFETCH_CONFIG1 0x1e0 |
#define GPMC_PREFETCH_CONFIG2 0x1e4 |
#define GPMC_PREFETCH_CONTROL 0x1ec |
#define GPMC_PREFETCH_STATUS 0x1f0 |
#define GPMC_REVISION 0x00 |
#define GPMC_REVISION_MAJOR |
( |
|
l | ) |
((l >> 4) & 0xf) |
#define GPMC_REVISION_MINOR |
( |
|
l | ) |
(l & 0xf) |
#define GPMC_SECTION_SHIFT 28 /* 128 MB */ |
Value:if (set_gpmc_timing_reg(
cs, (
reg), (
st), (
end),
t->field) < 0) \
return -1
Definition at line 286 of file gpmc.c.
#define GPMC_SYSCONFIG 0x10 |
#define GPMC_SYSSTATUS 0x14 |
#define GPMC_TIMEOUT_CONTROL 0x40 |
gpmc_calculate_ecc - generate non-inverted ecc bytes : chip select number : data pointer over which ecc is computed : ecc code buffer
Using non-inverted ECC is considered ugly since writing a blank page (padding) will clear the ECC bytes. This is not a problem as long no one is trying to write data on the seemingly unused page. Reading an erased page will produce an ECC mismatch between generated and read ECC bytes that has to be dealt with separately.
Definition at line 1159 of file gpmc.c.
int gpmc_cs_calc_divider |
( |
int |
cs, |
|
|
unsigned int |
sync_clk |
|
) |
| |
gpmc_cs_configure - write request to configure gpmc : chip select number : command type : value to write
- Returns
- status of the operation
Definition at line 556 of file gpmc.c.
int gpmc_cs_request |
( |
int |
cs, |
|
|
unsigned long |
size, |
|
|
unsigned long * |
base |
|
) |
| |
int gpmc_cs_reserved |
( |
int |
cs | ) |
|
int gpmc_cs_set_reserved |
( |
int |
cs, |
|
|
int |
reserved |
|
) |
| |
gpmc_enable_hwecc - enable hardware ecc functionality : chip select number : read/write mode : device bus width(1 for x16, 0 for x8) : bytes for which ECC will be generated
Definition at line 1104 of file gpmc.c.
int gpmc_get_client_irq |
( |
unsigned |
irq_config | ) |
|
unsigned long gpmc_get_fclk_period |
( |
void |
| ) |
|
gpmc_nand_read - nand specific read access request : chip select number : command type
Definition at line 622 of file gpmc.c.
gpmc_nand_write - nand specific write request : chip select number : command type : value to write
Definition at line 644 of file gpmc.c.
unsigned int gpmc_ns_to_ticks |
( |
unsigned int |
time_ns | ) |
|
int gpmc_prefetch_enable |
( |
int |
cs, |
|
|
int |
fifo_th, |
|
|
int |
dma_mode, |
|
|
unsigned int |
u32_count, |
|
|
int |
is_write |
|
) |
| |
gpmc_prefetch_enable - configures and starts prefetch transfer : cs (chip select) number : fifo threshold to be used for read/ write : dma mode enable (1) or disable (0) : number of bytes to be transferred : prefetch read(0) or write post(1) mode
Definition at line 678 of file gpmc.c.
int gpmc_prefetch_reset |
( |
int |
cs | ) |
|
gpmc_prefetch_reset - disables and stops the prefetch engine
Definition at line 711 of file gpmc.c.
unsigned int gpmc_ps_to_ticks |
( |
unsigned int |
time_ps | ) |
|
int gpmc_read_status |
( |
int |
cmd | ) |
|
gpmc_read_status - read access request to get the different gpmc status : command type
- Returns
- status
Definition at line 516 of file gpmc.c.
unsigned int gpmc_round_ns_to_ticks |
( |
unsigned int |
time_ns | ) |
|
unsigned int gpmc_ticks_to_ns |
( |
unsigned int |
ticks | ) |
|
module_exit |
( |
gpmc_exit |
| ) |
|
postcore_initcall |
( |
gpmc_init |
| ) |
|
postcore_initcall |
( |
omap_gpmc_init |
| ) |
|