aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-blackfin/mach-bf548/dma.h1
-rw-r--r--include/asm-blackfin/nand.h47
-rw-r--r--include/linux/jffs2.h1
-rw-r--r--include/linux/mtd/cfi.h9
-rw-r--r--include/linux/mtd/flashchip.h1
-rw-r--r--include/linux/mtd/map.h10
-rw-r--r--include/linux/mtd/mtd.h7
-rw-r--r--include/linux/mtd/nand.h1
-rw-r--r--include/linux/mtd/onenand.h12
-rw-r--r--include/linux/mtd/onenand_regs.h4
10 files changed, 92 insertions, 1 deletions
diff --git a/include/asm-blackfin/mach-bf548/dma.h b/include/asm-blackfin/mach-bf548/dma.h
index fcc8b4c34c6a..14cb10cc24ae 100644
--- a/include/asm-blackfin/mach-bf548/dma.h
+++ b/include/asm-blackfin/mach-bf548/dma.h
@@ -55,6 +55,7 @@
55#define CH_SPORT3_RX 20 55#define CH_SPORT3_RX 20
56#define CH_SPORT3_TX 21 56#define CH_SPORT3_TX 21
57#define CH_SDH 22 57#define CH_SDH 22
58#define CH_NFC 22
58#define CH_SPI2 23 59#define CH_SPI2 23
59 60
60#define CH_MEM_STREAM0_DEST 24 61#define CH_MEM_STREAM0_DEST 24
diff --git a/include/asm-blackfin/nand.h b/include/asm-blackfin/nand.h
new file mode 100644
index 000000000000..afbaafa793f1
--- /dev/null
+++ b/include/asm-blackfin/nand.h
@@ -0,0 +1,47 @@
1/* linux/include/asm-blackfin/nand.h
2 *
3 * Copyright (c) 2007 Analog Devices, Inc.
4 * Bryan Wu <bryan.wu@analog.com>
5 *
6 * BF5XX - NAND flash controller platfrom_device info
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13/* struct bf5xx_nand_platform
14 *
15 * define a interface between platfrom board specific code and
16 * bf54x NFC driver.
17 *
18 * nr_partitions = number of partitions pointed to be partitoons (or zero)
19 * partitions = mtd partition list
20 */
21
22#define NFC_PG_SIZE_256 0
23#define NFC_PG_SIZE_512 1
24#define NFC_PG_SIZE_OFFSET 9
25
26#define NFC_NWIDTH_8 0
27#define NFC_NWIDTH_16 1
28#define NFC_NWIDTH_OFFSET 8
29
30#define NFC_RDDLY_OFFSET 4
31#define NFC_WRDLY_OFFSET 0
32
33#define NFC_STAT_NBUSY 1
34
35struct bf5xx_nand_platform {
36 /* NAND chip information */
37 unsigned short page_size;
38 unsigned short data_width;
39
40 /* RD/WR strobe delay timing information, all times in SCLK cycles */
41 unsigned short rd_dly;
42 unsigned short wr_dly;
43
44 /* NAND MTD partition information */
45 int nr_partitions;
46 struct mtd_partition *partitions;
47};
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index 840631fa5ff1..6b563cae23df 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -46,6 +46,7 @@
46#define JFFS2_COMPR_COPY 0x04 46#define JFFS2_COMPR_COPY 0x04
47#define JFFS2_COMPR_DYNRUBIN 0x05 47#define JFFS2_COMPR_DYNRUBIN 0x05
48#define JFFS2_COMPR_ZLIB 0x06 48#define JFFS2_COMPR_ZLIB 0x06
49#define JFFS2_COMPR_LZO 0x07
49/* Compatibility flags. */ 50/* Compatibility flags. */
50#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ 51#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
51#define JFFS2_NODE_ACCURATE 0x2000 52#define JFFS2_NODE_ACCURATE 0x2000
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 123948b14547..e17c5343cf51 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -57,6 +57,15 @@
57#define cfi_interleave_is_8(cfi) (0) 57#define cfi_interleave_is_8(cfi) (0)
58#endif 58#endif
59 59
60#ifndef cfi_interleave
61#warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work.
62static inline int cfi_interleave(void *cfi)
63{
64 BUG();
65 return 0;
66}
67#endif
68
60static inline int cfi_interleave_supported(int i) 69static inline int cfi_interleave_supported(int i)
61{ 70{
62 switch (i) { 71 switch (i) {
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index a293a3b78e05..39e7d2a1be9a 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -40,6 +40,7 @@ typedef enum {
40 FL_POINT, 40 FL_POINT,
41 FL_XIP_WHILE_ERASING, 41 FL_XIP_WHILE_ERASING,
42 FL_XIP_WHILE_WRITING, 42 FL_XIP_WHILE_WRITING,
43 FL_SHUTDOWN,
43 FL_UNKNOWN 44 FL_UNKNOWN
44} flstate_t; 45} flstate_t;
45 46
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 81f3a314dd76..a9fae032ba81 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -125,7 +125,15 @@
125#endif 125#endif
126 126
127#ifndef map_bankwidth 127#ifndef map_bankwidth
128#error "No bus width supported. What's the point?" 128#warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work"
129static inline int map_bankwidth(void *map)
130{
131 BUG();
132 return 0;
133}
134#define map_bankwidth_is_large(map) (0)
135#define map_words(map) (0)
136#define MAX_MAP_BANKWIDTH 1
129#endif 137#endif
130 138
131static inline int map_bankwidth_supported(int w) 139static inline int map_bankwidth_supported(int w)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index fd64ccfbce02..783fc983417c 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -133,6 +133,13 @@ struct mtd_info {
133 int numeraseregions; 133 int numeraseregions;
134 struct mtd_erase_region_info *eraseregions; 134 struct mtd_erase_region_info *eraseregions;
135 135
136 /*
137 * Erase is an asynchronous operation. Device drivers are supposed
138 * to call instr->callback() whenever the operation completes, even
139 * if it completes with a failure.
140 * Callers are supposed to pass a callback function and wait for it
141 * to be called before writing to the block.
142 */
136 int (*erase) (struct mtd_info *mtd, struct erase_info *instr); 143 int (*erase) (struct mtd_info *mtd, struct erase_info *instr);
137 144
138 /* This stuff for eXecute-In-Place */ 145 /* This stuff for eXecute-In-Place */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index d2365c8dcacc..c42bc7f533a5 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -432,6 +432,7 @@ struct nand_chip {
432#define NAND_MFR_STMICRO 0x20 432#define NAND_MFR_STMICRO 0x20
433#define NAND_MFR_HYNIX 0xad 433#define NAND_MFR_HYNIX 0xad
434#define NAND_MFR_MICRON 0x2c 434#define NAND_MFR_MICRON 0x2c
435#define NAND_MFR_AMD 0x01
435 436
436/** 437/**
437 * struct nand_flash_dev - NAND Flash Device ID Structure 438 * struct nand_flash_dev - NAND Flash Device ID Structure
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index a56d24ada505..fd0a260e070b 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -60,6 +60,7 @@ struct onenand_bufferram {
60 * @erase_shift: [INTERN] number of address bits in a block 60 * @erase_shift: [INTERN] number of address bits in a block
61 * @page_shift: [INTERN] number of address bits in a page 61 * @page_shift: [INTERN] number of address bits in a page
62 * @page_mask: [INTERN] a page per block mask 62 * @page_mask: [INTERN] a page per block mask
63 * @writesize: [INTERN] a real page size
63 * @bufferram_index: [INTERN] BufferRAM index 64 * @bufferram_index: [INTERN] BufferRAM index
64 * @bufferram: [INTERN] BufferRAM info 65 * @bufferram: [INTERN] BufferRAM info
65 * @readw: [REPLACEABLE] hardware specific function for read short 66 * @readw: [REPLACEABLE] hardware specific function for read short
@@ -100,6 +101,7 @@ struct onenand_chip {
100 unsigned int erase_shift; 101 unsigned int erase_shift;
101 unsigned int page_shift; 102 unsigned int page_shift;
102 unsigned int page_mask; 103 unsigned int page_mask;
104 unsigned int writesize;
103 105
104 unsigned int bufferram_index; 106 unsigned int bufferram_index;
105 struct onenand_bufferram bufferram[MAX_BUFFERRAM]; 107 struct onenand_bufferram bufferram[MAX_BUFFERRAM];
@@ -140,6 +142,8 @@ struct onenand_chip {
140#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) 142#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
141#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) 143#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
142#define ONENAND_SET_PREV_BUFFERRAM(this) (this->bufferram_index ^= 1) 144#define ONENAND_SET_PREV_BUFFERRAM(this) (this->bufferram_index ^= 1)
145#define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0)
146#define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1)
143 147
144#define ONENAND_GET_SYS_CFG1(this) \ 148#define ONENAND_GET_SYS_CFG1(this) \
145 (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) 149 (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
@@ -149,6 +153,13 @@ struct onenand_chip {
149#define ONENAND_IS_DDP(this) \ 153#define ONENAND_IS_DDP(this) \
150 (this->device_id & ONENAND_DEVICE_IS_DDP) 154 (this->device_id & ONENAND_DEVICE_IS_DDP)
151 155
156#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM
157#define ONENAND_IS_2PLANE(this) \
158 (this->options & ONENAND_HAS_2PLANE)
159#else
160#define ONENAND_IS_2PLANE(this) (0)
161#endif
162
152/* Check byte access in OneNAND */ 163/* Check byte access in OneNAND */
153#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) 164#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
154 165
@@ -157,6 +168,7 @@ struct onenand_chip {
157 */ 168 */
158#define ONENAND_HAS_CONT_LOCK (0x0001) 169#define ONENAND_HAS_CONT_LOCK (0x0001)
159#define ONENAND_HAS_UNLOCK_ALL (0x0002) 170#define ONENAND_HAS_UNLOCK_ALL (0x0002)
171#define ONENAND_HAS_2PLANE (0x0004)
160#define ONENAND_PAGEBUF_ALLOC (0x1000) 172#define ONENAND_PAGEBUF_ALLOC (0x1000)
161#define ONENAND_OOBBUF_ALLOC (0x2000) 173#define ONENAND_OOBBUF_ALLOC (0x2000)
162 174
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index af94719890e7..c46161f4eee3 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -74,6 +74,8 @@
74 74
75#define ONENAND_DEVICE_DENSITY_512Mb (0x002) 75#define ONENAND_DEVICE_DENSITY_512Mb (0x002)
76#define ONENAND_DEVICE_DENSITY_1Gb (0x003) 76#define ONENAND_DEVICE_DENSITY_1Gb (0x003)
77#define ONENAND_DEVICE_DENSITY_2Gb (0x004)
78#define ONENAND_DEVICE_DENSITY_4Gb (0x005)
77 79
78/* 80/*
79 * Version ID Register F002h (R) 81 * Version ID Register F002h (R)
@@ -111,6 +113,8 @@
111#define ONENAND_CMD_READOOB (0x13) 113#define ONENAND_CMD_READOOB (0x13)
112#define ONENAND_CMD_PROG (0x80) 114#define ONENAND_CMD_PROG (0x80)
113#define ONENAND_CMD_PROGOOB (0x1A) 115#define ONENAND_CMD_PROGOOB (0x1A)
116#define ONENAND_CMD_2X_PROG (0x7D)
117#define ONENAND_CMD_2X_CACHE_PROG (0x7F)
114#define ONENAND_CMD_UNLOCK (0x23) 118#define ONENAND_CMD_UNLOCK (0x23)
115#define ONENAND_CMD_LOCK (0x2A) 119#define ONENAND_CMD_LOCK (0x2A)
116#define ONENAND_CMD_LOCK_TIGHT (0x2C) 120#define ONENAND_CMD_LOCK_TIGHT (0x2C)