2 * Copyright © 2000 Red Hat UK Limited
3 * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __MTD_FLASHCHIP_H__
22 #define __MTD_FLASHCHIP_H__
24 /* For spinlocks. sched.h includes spinlock.h from whichever directory it
25 * happens to be in - so we don't have to care whether we're on 2.2, which
26 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
28 #include <linux/sched.h>
29 #include <linux/mutex.h>
53 /* These 2 come from nand_state_t, which has been unified here */
56 /* These 4 come from onenand_state_t, which has been unified here */
67 /* NOTE: confusingly, this can be used to refer to more than one chip at a time,
68 if they're interleaved. This can even refer to individual partitions on
69 the same physical chip when present. */
72 unsigned long start
; /* Offset within the map */
74 /* We omit len for now, because when we group them together
75 we insist that they're all of the same size, and the chip size
76 is held in the next level up. If we get more versatile later,
77 it'll make it a damn sight harder to find which chip we want from
78 a given offset, and we'll want to add the per-chip length field
81 int ref_point_counter
;
85 unsigned int write_suspended
:1;
86 unsigned int erase_suspended
:1;
87 unsigned long in_progress_block_addr
;
90 wait_queue_head_t wq
; /* Wait on here when we're waiting for the chip
93 int buffer_write_time
;
96 int word_write_time_max
;
97 int buffer_write_time_max
;
103 /* This is used to handle contention on write/erase operations
104 between partitions of the same physical chip. */
105 struct flchip_shared
{
107 struct flchip
*writing
;
108 struct flchip
*erasing
;
112 #endif /* __MTD_FLASHCHIP_H__ */