~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mtd/flashchip.h

Version: ~ [ linux-5.9.1 ] ~ [ linux-5.8.16 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.72 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.152 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.202 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.240 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.240 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * Copyright © 2000      Red Hat UK Limited
  4  * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org>
  5  */
  6 
  7 #ifndef __MTD_FLASHCHIP_H__
  8 #define __MTD_FLASHCHIP_H__
  9 
 10 /* For spinlocks. sched.h includes spinlock.h from whichever directory it
 11  * happens to be in - so we don't have to care whether we're on 2.2, which
 12  * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
 13  */
 14 #include <linux/sched.h>
 15 #include <linux/mutex.h>
 16 
 17 typedef enum {
 18         FL_READY,
 19         FL_STATUS,
 20         FL_CFI_QUERY,
 21         FL_JEDEC_QUERY,
 22         FL_ERASING,
 23         FL_ERASE_SUSPENDING,
 24         FL_ERASE_SUSPENDED,
 25         FL_WRITING,
 26         FL_WRITING_TO_BUFFER,
 27         FL_OTP_WRITE,
 28         FL_WRITE_SUSPENDING,
 29         FL_WRITE_SUSPENDED,
 30         FL_PM_SUSPENDED,
 31         FL_SYNCING,
 32         FL_UNLOADING,
 33         FL_LOCKING,
 34         FL_UNLOCKING,
 35         FL_POINT,
 36         FL_XIP_WHILE_ERASING,
 37         FL_XIP_WHILE_WRITING,
 38         FL_SHUTDOWN,
 39         /* These 2 come from nand_state_t, which has been unified here */
 40         FL_READING,
 41         FL_CACHEDPRG,
 42         /* These 4 come from onenand_state_t, which has been unified here */
 43         FL_RESETING,
 44         FL_OTPING,
 45         FL_PREPARING_ERASE,
 46         FL_VERIFYING_ERASE,
 47 
 48         FL_UNKNOWN
 49 } flstate_t;
 50 
 51 
 52 
 53 /* NOTE: confusingly, this can be used to refer to more than one chip at a time,
 54    if they're interleaved.  This can even refer to individual partitions on
 55    the same physical chip when present. */
 56 
 57 struct flchip {
 58         unsigned long start; /* Offset within the map */
 59         //      unsigned long len;
 60         /* We omit len for now, because when we group them together
 61            we insist that they're all of the same size, and the chip size
 62            is held in the next level up. If we get more versatile later,
 63            it'll make it a damn sight harder to find which chip we want from
 64            a given offset, and we'll want to add the per-chip length field
 65            back in.
 66         */
 67         int ref_point_counter;
 68         flstate_t state;
 69         flstate_t oldstate;
 70 
 71         unsigned int write_suspended:1;
 72         unsigned int erase_suspended:1;
 73         unsigned long in_progress_block_addr;
 74         unsigned long in_progress_block_mask;
 75 
 76         struct mutex mutex;
 77         wait_queue_head_t wq; /* Wait on here when we're waiting for the chip
 78                              to be ready */
 79         int word_write_time;
 80         int buffer_write_time;
 81         int erase_time;
 82 
 83         int word_write_time_max;
 84         int buffer_write_time_max;
 85         int erase_time_max;
 86 
 87         void *priv;
 88 };
 89 
 90 /* This is used to handle contention on write/erase operations
 91    between partitions of the same physical chip. */
 92 struct flchip_shared {
 93         struct mutex lock;
 94         struct flchip *writing;
 95         struct flchip *erasing;
 96 };
 97 
 98 
 99 #endif /* __MTD_FLASHCHIP_H__ */
100 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp