1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright © 2000 Red Hat UK Limited
4 * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org>
8 #ifndef __MTD_FLASHCHIP_H__
9 #define __MTD_FLASHCHIP_H__
12 /* For spinlocks. sched.h includes spinlock.h from whichever directory it
13 * happens to be in - so we don't have to care whether we're on 2.2, which
14 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
16 #include <linux/sched.h>
17 #include <linux/mutex.h>
42 /* These 2 come from nand_state_t, which has been unified here */
45 /* 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;
79 wait_queue_head_t wq; /* Wait on here when we're waiting for the chip
83 int buffer_write_time;
86 int word_write_time_max;
87 int buffer_write_time_max;
93 /* This is used to handle contention on write/erase operations
94 between partitions of the same physical chip. */
95 struct flchip_shared {
97 struct flchip *writing;
98 struct flchip *erasing;
102 #endif /* __MTD_FLASHCHIP_H__ */