aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/bbm.h7
-rw-r--r--include/linux/mtd/map.h2
-rw-r--r--include/linux/mtd/mtd.h16
-rw-r--r--include/linux/mtd/nand.h1
-rw-r--r--include/linux/mtd/onenand.h15
-rw-r--r--include/linux/mtd/onenand_regs.h7
-rw-r--r--include/linux/mtd/physmap.h3
7 files changed, 26 insertions, 25 deletions
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 1221b7c44158..fff8c53e5434 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -92,6 +92,13 @@ struct nand_bbt_descr {
92 */ 92 */
93#define ONENAND_BADBLOCK_POS 0 93#define ONENAND_BADBLOCK_POS 0
94 94
95/*
96 * Bad block scanning errors
97 */
98#define ONENAND_BBT_READ_ERROR 1
99#define ONENAND_BBT_READ_ECC_ERROR 2
100#define ONENAND_BBT_READ_FATAL_ERROR 4
101
95/** 102/**
96 * struct bbm_info - [GENERIC] Bad Block Table data structure 103 * struct bbm_info - [GENERIC] Bad Block Table data structure
97 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry 104 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 28d461d862bd..81f3a314dd76 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -183,7 +183,7 @@ typedef union {
183struct map_info { 183struct map_info {
184 char *name; 184 char *name;
185 unsigned long size; 185 unsigned long size;
186 unsigned long phys; 186 resource_size_t phys;
187#define NO_XIP (-1UL) 187#define NO_XIP (-1UL)
188 188
189 void __iomem *virt; 189 void __iomem *virt;
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index d644e57703ad..6a8570be331b 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -85,6 +85,10 @@ typedef enum {
85 * mode = MTD_OOB_PLACE) 85 * mode = MTD_OOB_PLACE)
86 * @datbuf: data buffer - if NULL only oob data are read/written 86 * @datbuf: data buffer - if NULL only oob data are read/written
87 * @oobbuf: oob data buffer 87 * @oobbuf: oob data buffer
88 *
89 * Note, it is allowed to read more then one OOB area at one go, but not write.
90 * The interface assumes that the OOB write requests program only one page's
91 * OOB area.
88 */ 92 */
89struct mtd_oob_ops { 93struct mtd_oob_ops {
90 mtd_oob_mode_t mode; 94 mtd_oob_mode_t mode;
@@ -117,18 +121,6 @@ struct mtd_info {
117 u_int32_t writesize; 121 u_int32_t writesize;
118 122
119 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 123 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
120 u_int32_t ecctype;
121 u_int32_t eccsize;
122
123 /*
124 * Reuse some of the above unused fields in the case of NOR flash
125 * with configurable programming regions to avoid modifying the
126 * user visible structure layout/size. Only valid when the
127 * MTD_PROGRAM_REGIONS flag is set.
128 * (Maybe we should have an union for those?)
129 */
130#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
131#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
132 124
133 // Kernel-only stuff starts here. 125 // Kernel-only stuff starts here.
134 char *name; 126 char *name;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 2071b02f0526..97523887fe5d 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -343,6 +343,7 @@ struct nand_buffers {
343 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about 343 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about
344 * special functionality. See the defines for further explanation 344 * special functionality. See the defines for further explanation
345 * @badblockpos: [INTERN] position of the bad block marker in the oob area 345 * @badblockpos: [INTERN] position of the bad block marker in the oob area
346 * @cellinfo: [INTERN] MLC/multichip data from chip ident
346 * @numchips: [INTERN] number of physical chips 347 * @numchips: [INTERN] number of physical chips
347 * @chipsize: [INTERN] the size of one chip for multichip arrays 348 * @chipsize: [INTERN] the size of one chip for multichip arrays
348 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 349 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index f775a7af3890..d8af8a95e58d 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/include/linux/mtd/onenand.h 2 * linux/include/linux/mtd/onenand.h
3 * 3 *
4 * Copyright (C) 2005-2006 Samsung Electronics 4 * Copyright (C) 2005-2007 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -42,14 +42,10 @@ typedef enum {
42 42
43/** 43/**
44 * struct onenand_bufferram - OneNAND BufferRAM Data 44 * struct onenand_bufferram - OneNAND BufferRAM Data
45 * @block: block address in BufferRAM 45 * @blockpage: block & page address in BufferRAM
46 * @page: page address in BufferRAM
47 * @valid: valid flag
48 */ 46 */
49struct onenand_bufferram { 47struct onenand_bufferram {
50 int block; 48 int blockpage;
51 int page;
52 int valid;
53}; 49};
54 50
55/** 51/**
@@ -63,7 +59,6 @@ struct onenand_bufferram {
63 * partly be set to inform onenand_scan about 59 * partly be set to inform onenand_scan about
64 * @erase_shift: [INTERN] number of address bits in a block 60 * @erase_shift: [INTERN] number of address bits in a block
65 * @page_shift: [INTERN] number of address bits in a page 61 * @page_shift: [INTERN] number of address bits in a page
66 * @ppb_shift: [INTERN] number of address bits in a pages per block
67 * @page_mask: [INTERN] a page per block mask 62 * @page_mask: [INTERN] a page per block mask
68 * @bufferram_index: [INTERN] BufferRAM index 63 * @bufferram_index: [INTERN] BufferRAM index
69 * @bufferram: [INTERN] BufferRAM info 64 * @bufferram: [INTERN] BufferRAM info
@@ -103,7 +98,6 @@ struct onenand_chip {
103 98
104 unsigned int erase_shift; 99 unsigned int erase_shift;
105 unsigned int page_shift; 100 unsigned int page_shift;
106 unsigned int ppb_shift; /* Pages per block shift */
107 unsigned int page_mask; 101 unsigned int page_mask;
108 102
109 unsigned int bufferram_index; 103 unsigned int bufferram_index;
@@ -150,6 +144,9 @@ struct onenand_chip {
150#define ONENAND_SET_SYS_CFG1(v, this) \ 144#define ONENAND_SET_SYS_CFG1(v, this) \
151 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) 145 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
152 146
147#define ONENAND_IS_DDP(this) \
148 (this->device_id & ONENAND_DEVICE_IS_DDP)
149
153/* Check byte access in OneNAND */ 150/* Check byte access in OneNAND */
154#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) 151#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
155 152
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index e31c8f5d4271..af94719890e7 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -3,7 +3,8 @@
3 * 3 *
4 * OneNAND Register header file 4 * OneNAND Register header file
5 * 5 *
6 * Copyright (C) 2005-2006 Samsung Electronics 6 * Copyright (C) 2005-2007 Samsung Electronics
7 * Kyungmin Park <kyungmin.park@samsung.com>
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * 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 * it under the terms of the GNU General Public License version 2 as
@@ -80,9 +81,11 @@
80#define ONENAND_VERSION_PROCESS_SHIFT (8) 81#define ONENAND_VERSION_PROCESS_SHIFT (8)
81 82
82/* 83/*
83 * Start Address 1 F100h (R/W) 84 * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W)
84 */ 85 */
85#define ONENAND_DDP_SHIFT (15) 86#define ONENAND_DDP_SHIFT (15)
87#define ONENAND_DDP_CHIP0 (0)
88#define ONENAND_DDP_CHIP1 (1 << ONENAND_DDP_SHIFT)
86 89
87/* 90/*
88 * Start Address 8 F107h (R/W) 91 * Start Address 8 F107h (R/W)
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index 86831e3594f6..0dc07d5f3354 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -18,9 +18,10 @@
18#define __LINUX_MTD_PHYSMAP__ 18#define __LINUX_MTD_PHYSMAP__
19 19
20#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
21#include <linux/mtd/map.h>
22#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
23 22
23struct map_info;
24
24struct physmap_flash_data { 25struct physmap_flash_data {
25 unsigned int width; 26 unsigned int width;
26 void (*set_vpp)(struct map_info *, int); 27 void (*set_vpp)(struct map_info *, int);