3 * struct flchip definition
5 * Contains information about the location and state of a given flash device
7 * (C) 2000 Red Hat. GPLd.
10 #ifndef __MTD_FLASHCHIP_H__
11 #define __MTD_FLASHCHIP_H__
13 /* For spinlocks. sched.h includes spinlock.h from whichever directory it
14 * happens to be in - so we don't have to care whether we're on 2.2, which
15 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
17 #include <linux/sched.h>
41 /* These 2 come from nand_state_t, which has been unified here */
44 /* These 4 come from onenand_state_t, which has been unified here */
55 /* NOTE: confusingly, this can be used to refer to more than one chip at a time,
56 if they're interleaved. This can even refer to individual partitions on
57 the same physical chip when present. */
60 unsigned long start
; /* Offset within the map */
62 /* We omit len for now, because when we group them together
63 we insist that they're all of the same size, and the chip size
64 is held in the next level up. If we get more versatile later,
65 it'll make it a damn sight harder to find which chip we want from
66 a given offset, and we'll want to add the per-chip length field
69 int ref_point_counter
;
73 unsigned int write_suspended
:1;
74 unsigned int erase_suspended
:1;
75 unsigned long in_progress_block_addr
;
78 spinlock_t _spinlock
; /* We do it like this because sometimes they'll be shared. */
79 wait_queue_head_t wq
; /* Wait on here when we're waiting for the chip
82 int buffer_write_time
;
85 int word_write_time_max
;
86 int buffer_write_time_max
;
92 /* This is used to handle contention on write/erase operations
93 between partitions of the same physical chip. */
94 struct flchip_shared
{
96 struct flchip
*writing
;
97 struct flchip
*erasing
;
101 #endif /* __MTD_FLASHCHIP_H__ */