xref: /linux/Documentation/ABI/testing/sysfs-class-mtd (revision a9b672e82bca47bf2b37ee869b8095000cf3ca88)
119fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/
219fe7f1aSKevin CernekeeDate:		April 2009
319fe7f1aSKevin CernekeeKernelVersion:	2.6.29
419fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
519fe7f1aSKevin CernekeeDescription:
619fe7f1aSKevin Cernekee		The mtd/ class subdirectory belongs to the MTD subsystem
719fe7f1aSKevin Cernekee		(MTD core).
819fe7f1aSKevin Cernekee
919fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/
1019fe7f1aSKevin CernekeeDate:		April 2009
1119fe7f1aSKevin CernekeeKernelVersion:	2.6.29
1219fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
1319fe7f1aSKevin CernekeeDescription:
1419fe7f1aSKevin Cernekee		The /sys/class/mtd/mtd{0,1,2,3,...} directories correspond
1519fe7f1aSKevin Cernekee		to each /dev/mtdX character device.  These may represent
1619fe7f1aSKevin Cernekee		physical/simulated flash devices, partitions on a flash
1719fe7f1aSKevin Cernekee		device, or concatenated flash devices.  They exist regardless
1819fe7f1aSKevin Cernekee		of whether CONFIG_MTD_CHAR is actually enabled.
1919fe7f1aSKevin Cernekee
2019fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdXro/
2119fe7f1aSKevin CernekeeDate:		April 2009
2219fe7f1aSKevin CernekeeKernelVersion:	2.6.29
2319fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
2419fe7f1aSKevin CernekeeDescription:
2519fe7f1aSKevin Cernekee		These directories provide the corresponding read-only device
2619fe7f1aSKevin Cernekee		nodes for /sys/class/mtd/mtdX/ .  They are only created
2719fe7f1aSKevin Cernekee		(for the benefit of udev) if CONFIG_MTD_CHAR is enabled.
2819fe7f1aSKevin Cernekee
2919fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/dev
3019fe7f1aSKevin CernekeeDate:		April 2009
3119fe7f1aSKevin CernekeeKernelVersion:	2.6.29
3219fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
3319fe7f1aSKevin CernekeeDescription:
3419fe7f1aSKevin Cernekee		Major and minor numbers of the character device corresponding
3519fe7f1aSKevin Cernekee		to this MTD device (in <major>:<minor> format).  This is the
3619fe7f1aSKevin Cernekee		read-write device so <minor> will be even.
3719fe7f1aSKevin Cernekee
3819fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdXro/dev
3919fe7f1aSKevin CernekeeDate:		April 2009
4019fe7f1aSKevin CernekeeKernelVersion:	2.6.29
4119fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
4219fe7f1aSKevin CernekeeDescription:
4319fe7f1aSKevin Cernekee		Major and minor numbers of the character device corresponding
4419fe7f1aSKevin Cernekee		to the read-only variant of thie MTD device (in
4519fe7f1aSKevin Cernekee		<major>:<minor> format).  In this case <minor> will be odd.
4619fe7f1aSKevin Cernekee
4719fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/erasesize
4819fe7f1aSKevin CernekeeDate:		April 2009
4919fe7f1aSKevin CernekeeKernelVersion:	2.6.29
5019fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
5119fe7f1aSKevin CernekeeDescription:
5219fe7f1aSKevin Cernekee		"Major" erase size for the device.  If numeraseregions is
5319fe7f1aSKevin Cernekee		zero, this is the eraseblock size for the entire device.
5419fe7f1aSKevin Cernekee		Otherwise, the MEMGETREGIONCOUNT/MEMGETREGIONINFO ioctls
5519fe7f1aSKevin Cernekee		can be used to determine the actual eraseblock layout.
5619fe7f1aSKevin Cernekee
5719fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/flags
5819fe7f1aSKevin CernekeeDate:		April 2009
5919fe7f1aSKevin CernekeeKernelVersion:	2.6.29
6019fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
6119fe7f1aSKevin CernekeeDescription:
6219fe7f1aSKevin Cernekee		A hexadecimal value representing the device flags, ORed
6319fe7f1aSKevin Cernekee		together:
6419fe7f1aSKevin Cernekee
6519fe7f1aSKevin Cernekee		0x0400: MTD_WRITEABLE - device is writable
6619fe7f1aSKevin Cernekee		0x0800: MTD_BIT_WRITEABLE - single bits can be flipped
6719fe7f1aSKevin Cernekee		0x1000: MTD_NO_ERASE - no erase necessary
6819fe7f1aSKevin Cernekee		0x2000: MTD_POWERUP_LOCK - always locked after reset
6919fe7f1aSKevin Cernekee
7019fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/name
7119fe7f1aSKevin CernekeeDate:		April 2009
7219fe7f1aSKevin CernekeeKernelVersion:	2.6.29
7319fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
7419fe7f1aSKevin CernekeeDescription:
7519fe7f1aSKevin Cernekee		A human-readable ASCII name for the device or partition.
7619fe7f1aSKevin Cernekee		This will match the name in /proc/mtd .
7719fe7f1aSKevin Cernekee
7819fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/numeraseregions
7919fe7f1aSKevin CernekeeDate:		April 2009
8019fe7f1aSKevin CernekeeKernelVersion:	2.6.29
8119fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
8219fe7f1aSKevin CernekeeDescription:
8319fe7f1aSKevin Cernekee		For devices that have variable eraseblock sizes, this
8419fe7f1aSKevin Cernekee		provides the total number of erase regions.  Otherwise,
8519fe7f1aSKevin Cernekee		it will read back as zero.
8619fe7f1aSKevin Cernekee
8719fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/oobsize
8819fe7f1aSKevin CernekeeDate:		April 2009
8919fe7f1aSKevin CernekeeKernelVersion:	2.6.29
9019fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
9119fe7f1aSKevin CernekeeDescription:
9219fe7f1aSKevin Cernekee		Number of OOB bytes per page.
9319fe7f1aSKevin Cernekee
9419fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/size
9519fe7f1aSKevin CernekeeDate:		April 2009
9619fe7f1aSKevin CernekeeKernelVersion:	2.6.29
9719fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
9819fe7f1aSKevin CernekeeDescription:
9919fe7f1aSKevin Cernekee		Total size of the device/partition, in bytes.
10019fe7f1aSKevin Cernekee
10119fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/type
10219fe7f1aSKevin CernekeeDate:		April 2009
10319fe7f1aSKevin CernekeeKernelVersion:	2.6.29
10419fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
10519fe7f1aSKevin CernekeeDescription:
10619fe7f1aSKevin Cernekee		One of the following ASCII strings, representing the device
10719fe7f1aSKevin Cernekee		type:
10819fe7f1aSKevin Cernekee
10919fe7f1aSKevin Cernekee		absent, ram, rom, nor, nand, dataflash, ubi, unknown
11019fe7f1aSKevin Cernekee
11119fe7f1aSKevin CernekeeWhat:		/sys/class/mtd/mtdX/writesize
11219fe7f1aSKevin CernekeeDate:		April 2009
11319fe7f1aSKevin CernekeeKernelVersion:	2.6.29
11419fe7f1aSKevin CernekeeContact:	linux-mtd@lists.infradead.org
11519fe7f1aSKevin CernekeeDescription:
11619fe7f1aSKevin Cernekee		Minimal writable flash unit size.  This will always be
11719fe7f1aSKevin Cernekee		a positive integer.
11819fe7f1aSKevin Cernekee
11919fe7f1aSKevin Cernekee		In the case of NOR flash it is 1 (even though individual
12019fe7f1aSKevin Cernekee		bits can be cleared).
12119fe7f1aSKevin Cernekee
12219fe7f1aSKevin Cernekee		In the case of NAND flash it is one NAND page (or a
12319fe7f1aSKevin Cernekee		half page, or a quarter page).
12419fe7f1aSKevin Cernekee
12519fe7f1aSKevin Cernekee		In the case of ECC NOR, it is the ECC block size.
126*a9b672e8SMike Dunn
127*a9b672e8SMike DunnWhat:		/sys/class/mtd/mtdX/ecc_strength
128*a9b672e8SMike DunnDate:		April 2012
129*a9b672e8SMike DunnKernelVersion:	3.4
130*a9b672e8SMike DunnContact:	linux-mtd@lists.infradead.org
131*a9b672e8SMike DunnDescription:
132*a9b672e8SMike Dunn		Maximum number of bit errors that the device is capable of
133*a9b672e8SMike Dunn		correcting within each region covering an ecc step.  This will
134*a9b672e8SMike Dunn		always be a non-negative integer.  Note that some devices will
135*a9b672e8SMike Dunn		have multiple ecc steps within each writesize region.
136*a9b672e8SMike Dunn
137*a9b672e8SMike Dunn		In the case of devices lacking any ECC capability, it is 0.
138