1*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/ 2*19fe7f1aSKevin CernekeeDate: April 2009 3*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 4*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 5*19fe7f1aSKevin CernekeeDescription: 6*19fe7f1aSKevin Cernekee The mtd/ class subdirectory belongs to the MTD subsystem 7*19fe7f1aSKevin Cernekee (MTD core). 8*19fe7f1aSKevin Cernekee 9*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/ 10*19fe7f1aSKevin CernekeeDate: April 2009 11*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 12*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 13*19fe7f1aSKevin CernekeeDescription: 14*19fe7f1aSKevin Cernekee The /sys/class/mtd/mtd{0,1,2,3,...} directories correspond 15*19fe7f1aSKevin Cernekee to each /dev/mtdX character device. These may represent 16*19fe7f1aSKevin Cernekee physical/simulated flash devices, partitions on a flash 17*19fe7f1aSKevin Cernekee device, or concatenated flash devices. They exist regardless 18*19fe7f1aSKevin Cernekee of whether CONFIG_MTD_CHAR is actually enabled. 19*19fe7f1aSKevin Cernekee 20*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdXro/ 21*19fe7f1aSKevin CernekeeDate: April 2009 22*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 23*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 24*19fe7f1aSKevin CernekeeDescription: 25*19fe7f1aSKevin Cernekee These directories provide the corresponding read-only device 26*19fe7f1aSKevin Cernekee nodes for /sys/class/mtd/mtdX/ . They are only created 27*19fe7f1aSKevin Cernekee (for the benefit of udev) if CONFIG_MTD_CHAR is enabled. 28*19fe7f1aSKevin Cernekee 29*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/dev 30*19fe7f1aSKevin CernekeeDate: April 2009 31*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 32*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 33*19fe7f1aSKevin CernekeeDescription: 34*19fe7f1aSKevin Cernekee Major and minor numbers of the character device corresponding 35*19fe7f1aSKevin Cernekee to this MTD device (in <major>:<minor> format). This is the 36*19fe7f1aSKevin Cernekee read-write device so <minor> will be even. 37*19fe7f1aSKevin Cernekee 38*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdXro/dev 39*19fe7f1aSKevin CernekeeDate: April 2009 40*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 41*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 42*19fe7f1aSKevin CernekeeDescription: 43*19fe7f1aSKevin Cernekee Major and minor numbers of the character device corresponding 44*19fe7f1aSKevin Cernekee to the read-only variant of thie MTD device (in 45*19fe7f1aSKevin Cernekee <major>:<minor> format). In this case <minor> will be odd. 46*19fe7f1aSKevin Cernekee 47*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/erasesize 48*19fe7f1aSKevin CernekeeDate: April 2009 49*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 50*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 51*19fe7f1aSKevin CernekeeDescription: 52*19fe7f1aSKevin Cernekee "Major" erase size for the device. If numeraseregions is 53*19fe7f1aSKevin Cernekee zero, this is the eraseblock size for the entire device. 54*19fe7f1aSKevin Cernekee Otherwise, the MEMGETREGIONCOUNT/MEMGETREGIONINFO ioctls 55*19fe7f1aSKevin Cernekee can be used to determine the actual eraseblock layout. 56*19fe7f1aSKevin Cernekee 57*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/flags 58*19fe7f1aSKevin CernekeeDate: April 2009 59*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 60*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 61*19fe7f1aSKevin CernekeeDescription: 62*19fe7f1aSKevin Cernekee A hexadecimal value representing the device flags, ORed 63*19fe7f1aSKevin Cernekee together: 64*19fe7f1aSKevin Cernekee 65*19fe7f1aSKevin Cernekee 0x0400: MTD_WRITEABLE - device is writable 66*19fe7f1aSKevin Cernekee 0x0800: MTD_BIT_WRITEABLE - single bits can be flipped 67*19fe7f1aSKevin Cernekee 0x1000: MTD_NO_ERASE - no erase necessary 68*19fe7f1aSKevin Cernekee 0x2000: MTD_POWERUP_LOCK - always locked after reset 69*19fe7f1aSKevin Cernekee 70*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/name 71*19fe7f1aSKevin CernekeeDate: April 2009 72*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 73*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 74*19fe7f1aSKevin CernekeeDescription: 75*19fe7f1aSKevin Cernekee A human-readable ASCII name for the device or partition. 76*19fe7f1aSKevin Cernekee This will match the name in /proc/mtd . 77*19fe7f1aSKevin Cernekee 78*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/numeraseregions 79*19fe7f1aSKevin CernekeeDate: April 2009 80*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 81*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 82*19fe7f1aSKevin CernekeeDescription: 83*19fe7f1aSKevin Cernekee For devices that have variable eraseblock sizes, this 84*19fe7f1aSKevin Cernekee provides the total number of erase regions. Otherwise, 85*19fe7f1aSKevin Cernekee it will read back as zero. 86*19fe7f1aSKevin Cernekee 87*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/oobsize 88*19fe7f1aSKevin CernekeeDate: April 2009 89*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 90*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 91*19fe7f1aSKevin CernekeeDescription: 92*19fe7f1aSKevin Cernekee Number of OOB bytes per page. 93*19fe7f1aSKevin Cernekee 94*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/size 95*19fe7f1aSKevin CernekeeDate: April 2009 96*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 97*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 98*19fe7f1aSKevin CernekeeDescription: 99*19fe7f1aSKevin Cernekee Total size of the device/partition, in bytes. 100*19fe7f1aSKevin Cernekee 101*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/type 102*19fe7f1aSKevin CernekeeDate: April 2009 103*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 104*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 105*19fe7f1aSKevin CernekeeDescription: 106*19fe7f1aSKevin Cernekee One of the following ASCII strings, representing the device 107*19fe7f1aSKevin Cernekee type: 108*19fe7f1aSKevin Cernekee 109*19fe7f1aSKevin Cernekee absent, ram, rom, nor, nand, dataflash, ubi, unknown 110*19fe7f1aSKevin Cernekee 111*19fe7f1aSKevin CernekeeWhat: /sys/class/mtd/mtdX/writesize 112*19fe7f1aSKevin CernekeeDate: April 2009 113*19fe7f1aSKevin CernekeeKernelVersion: 2.6.29 114*19fe7f1aSKevin CernekeeContact: linux-mtd@lists.infradead.org 115*19fe7f1aSKevin CernekeeDescription: 116*19fe7f1aSKevin Cernekee Minimal writable flash unit size. This will always be 117*19fe7f1aSKevin Cernekee a positive integer. 118*19fe7f1aSKevin Cernekee 119*19fe7f1aSKevin Cernekee In the case of NOR flash it is 1 (even though individual 120*19fe7f1aSKevin Cernekee bits can be cleared). 121*19fe7f1aSKevin Cernekee 122*19fe7f1aSKevin Cernekee In the case of NAND flash it is one NAND page (or a 123*19fe7f1aSKevin Cernekee half page, or a quarter page). 124*19fe7f1aSKevin Cernekee 125*19fe7f1aSKevin Cernekee In the case of ECC NOR, it is the ECC block size. 126