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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ 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 #include <linux/wait.h>
 17 
 18 typedef enum {
 19         FL_READY,
 20         FL_STATUS,
 21         FL_CFI_QUERY,
 22         FL_JEDEC_QUERY,
 23         FL_ERASING,
 24         FL_ERASE_SUSPENDING,
 25         FL_ERASE_SUSPENDED,
 26         FL_WRITING,
 27         FL_WRITING_TO_BUFFER,
 28         FL_OTP_WRITE,
 29         FL_WRITE_SUSPENDING,
 30         FL_WRITE_SUSPENDED,
 31         FL_PM_SUSPENDED,
 32         FL_SYNCING,
 33         FL_UNLOADING,
 34         FL_LOCKING,
 35         FL_UNLOCKING,
 36         FL_POINT,
 37         FL_XIP_WHILE_ERASING,
 38         FL_XIP_WHILE_WRITING,
 39         FL_SHUTDOWN,
 40         /* These 2 come from nand_state_t, which has been unified here */
 41         FL_READING,
 42         FL_CACHEDPRG,
 43         /* These 4 come from onenand_state_t, which has been unified here */
 44         FL_RESETTING,
 45         FL_OTPING,
 46         FL_PREPARING_ERASE,
 47         FL_VERIFYING_ERASE,
 48 
 49         FL_UNKNOWN
 50 } flstate_t;
 51 
 52 
 53 
 54 /* NOTE: confusingly, this can be used to refer to more than one chip at a time,
 55    if they're interleaved.  This can even refer to individual partitions on
 56    the same physical chip when present. */
 57 
 58 struct flchip {
 59         unsigned long start; /* Offset within the map */
 60         //      unsigned long len;
 61         /* We omit len for now, because when we group them together
 62            we insist that they're all of the same size, and the chip size
 63            is held in the next level up. If we get more versatile later,
 64            it'll make it a damn sight harder to find which chip we want from
 65            a given offset, and we'll want to add the per-chip length field
 66            back in.
 67         */
 68         int ref_point_counter;
 69         flstate_t state;
 70         flstate_t oldstate;
 71 
 72         unsigned int write_suspended:1;
 73         unsigned int erase_suspended:1;
 74         unsigned long in_progress_block_addr;
 75         unsigned long in_progress_block_mask;
 76 
 77         struct mutex mutex;
 78         wait_queue_head_t wq; /* Wait on here when we're waiting for the chip
 79                              to be ready */
 80         int word_write_time;
 81         int buffer_write_time;
 82         int erase_time;
 83 
 84         int word_write_time_max;
 85         int buffer_write_time_max;
 86         int erase_time_max;
 87 
 88         void *priv;
 89 };
 90 
 91 /* This is used to handle contention on write/erase operations
 92    between partitions of the same physical chip. */
 93 struct flchip_shared {
 94         struct mutex lock;
 95         struct flchip *writing;
 96         struct flchip *erasing;
 97 };
 98 
 99 
100 #endif /* __MTD_FLASHCHIP_H__ */
101 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php