aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorSukumar Ghorai <s-ghorai@ti.com>2010-07-09 05:14:44 -0400
committerTony Lindgren <tony@atomide.com>2010-08-02 08:29:25 -0400
commit948d38e799f0ab87cf8ed9113fcdaaee61acf321 (patch)
tree04a3524066098465a23b28c71d2cbedf8ba6a20c /arch/arm/plat-omap
parent055a1b8c9927bc587f293020a54c6cd8e24dfac0 (diff)
omap3 gpmc: functionality enhancement
few functions added in gpmc module and to be used by other drivers like NAND. Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h39
1 files changed, 36 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index 145838a81ef6..561c64f5ab50 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -27,8 +27,27 @@
27 27
28#define GPMC_CONFIG 0x50 28#define GPMC_CONFIG 0x50
29#define GPMC_STATUS 0x54 29#define GPMC_STATUS 0x54
30#define GPMC_CS0_BASE 0x60 30
31#define GPMC_CS_SIZE 0x30 31/* Control Commands */
32#define GPMC_CONFIG_RDY_BSY 0x00000001
33#define GPMC_CONFIG_DEV_SIZE 0x00000002
34#define GPMC_CONFIG_DEV_TYPE 0x00000003
35#define GPMC_SET_IRQ_STATUS 0x00000004
36#define GPMC_CONFIG_WP 0x00000005
37
38#define GPMC_GET_IRQ_STATUS 0x00000006
39#define GPMC_PREFETCH_FIFO_CNT 0x00000007 /* bytes available in FIFO for r/w */
40#define GPMC_PREFETCH_COUNT 0x00000008 /* remaining bytes to be read/write*/
41#define GPMC_STATUS_BUFFER 0x00000009 /* 1: buffer is available to write */
42
43#define GPMC_NAND_COMMAND 0x0000000a
44#define GPMC_NAND_ADDRESS 0x0000000b
45#define GPMC_NAND_DATA 0x0000000c
46
47/* ECC commands */
48#define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */
49#define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */
50#define GPMC_ECC_READSYN 2 /* Reset before syndrom is read back */
32 51
33#define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31) 52#define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31)
34#define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30) 53#define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30)
@@ -56,6 +75,14 @@
56#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3)) 75#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3))
57#define GPMC_CONFIG7_CSVALID (1 << 6) 76#define GPMC_CONFIG7_CSVALID (1 << 6)
58 77
78#define GPMC_DEVICETYPE_NOR 0
79#define GPMC_DEVICETYPE_NAND 2
80#define GPMC_CONFIG_WRITEPROTECT 0x00000010
81#define GPMC_STATUS_BUFF_EMPTY 0x00000001
82#define WR_RD_PIN_MONITORING 0x00600000
83#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F)
84#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff)
85
59/* 86/*
60 * Note that all values in this struct are in nanoseconds, while 87 * Note that all values in this struct are in nanoseconds, while
61 * the register values are in gpmc_fck cycles. 88 * the register values are in gpmc_fck cycles.
@@ -108,10 +135,16 @@ extern int gpmc_cs_set_reserved(int cs, int reserved);
108extern int gpmc_cs_reserved(int cs); 135extern int gpmc_cs_reserved(int cs);
109extern int gpmc_prefetch_enable(int cs, int dma_mode, 136extern int gpmc_prefetch_enable(int cs, int dma_mode,
110 unsigned int u32_count, int is_write); 137 unsigned int u32_count, int is_write);
111extern void gpmc_prefetch_reset(void); 138extern int gpmc_prefetch_reset(int cs);
112extern int gpmc_prefetch_status(void); 139extern int gpmc_prefetch_status(void);
113extern void omap3_gpmc_save_context(void); 140extern void omap3_gpmc_save_context(void);
114extern void omap3_gpmc_restore_context(void); 141extern void omap3_gpmc_restore_context(void);
115extern void gpmc_init(void); 142extern void gpmc_init(void);
143extern int gpmc_read_status(int cmd);
144extern int gpmc_cs_configure(int cs, int cmd, int wval);
145extern int gpmc_nand_read(int cs, int cmd);
146extern int gpmc_nand_write(int cs, int cmd, int wval);
116 147
148int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size);
149int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code);
117#endif 150#endif