| /kernel/linux/linux-5.10/drivers/mtd/ |
| D | mtdcore.c | 3 * Core registration and callback routines for MTD 32 #include <linux/mtd/mtd.h> 33 #include <linux/mtd/partitions.h> 43 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_suspend() local 45 return mtd ? mtd_suspend(mtd) : 0; in mtd_cls_suspend() 50 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_resume() local 52 if (mtd) in mtd_cls_resume() 53 mtd_resume(mtd); in mtd_cls_resume() 64 .name = "mtd", 102 pr_err("MTD:lock_owner is %s, but current is %s\n", in mtd_table_mutex_unlock() [all …]
|
| D | mtdpstore.c | 8 #include <linux/mtd/mtd.h> 16 struct mtd_info *mtd; member 30 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_isbad() local 33 off = ALIGN_DOWN(off, mtd->erasesize); in mtdpstore_block_isbad() 34 blknum = div_u64(off, mtd->erasesize); in mtdpstore_block_isbad() 38 ret = mtd_block_isbad(mtd, off); in mtdpstore_block_isbad() 40 dev_err(&mtd->dev, "mtd_block_isbad failed, aborting\n"); in mtdpstore_block_isbad() 52 struct mtd_info *mtd = cxt->mtd; in mtdpstore_panic_block_isbad() local 55 off = ALIGN_DOWN(off, mtd->erasesize); in mtdpstore_panic_block_isbad() 56 blknum = div_u64(off, mtd->erasesize); in mtdpstore_panic_block_isbad() [all …]
|
| D | mtdsuper.c | 2 /* MTD-based superblock management 11 #include <linux/mtd/super.h> 23 * - they are if the underlying MTD device is the same 27 struct mtd_info *mtd = fc->sget_key; in mtd_test_super() local 31 mtd->index, mtd->name); in mtd_test_super() 36 sb->s_mtd->index, sb->s_mtd->name, mtd->index, mtd->name); in mtd_test_super() 41 * mark the superblock by the MTD device it is using 42 * - set the device number to be the correct MTD block device for pesuperstence 54 * get a superblock on an MTD-backed filesystem 57 struct mtd_info *mtd, in mtd_get_sb() argument [all …]
|
| /kernel/linux/linux-6.6/drivers/mtd/ |
| D | mtdcore.c | 3 * Core registration and callback routines for MTD 34 #include <linux/mtd/mtd.h> 35 #include <linux/mtd/partitions.h> 45 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_suspend() local 47 return mtd ? mtd_suspend(mtd) : 0; in mtd_cls_suspend() 52 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_resume() local 54 if (mtd) in mtd_cls_resume() 55 mtd_resume(mtd); in mtd_cls_resume() 66 .name = "mtd", 88 /* REVISIT once MTD uses the driver model better, whoever allocates [all …]
|
| D | mtdpstore.c | 8 #include <linux/mtd/mtd.h> 16 struct mtd_info *mtd; member 30 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_isbad() local 33 off = ALIGN_DOWN(off, mtd->erasesize); in mtdpstore_block_isbad() 34 blknum = div_u64(off, mtd->erasesize); in mtdpstore_block_isbad() 38 ret = mtd_block_isbad(mtd, off); in mtdpstore_block_isbad() 40 dev_err(&mtd->dev, "mtd_block_isbad failed, aborting\n"); in mtdpstore_block_isbad() 52 struct mtd_info *mtd = cxt->mtd; in mtdpstore_panic_block_isbad() local 55 off = ALIGN_DOWN(off, mtd->erasesize); in mtdpstore_panic_block_isbad() 56 blknum = div_u64(off, mtd->erasesize); in mtdpstore_panic_block_isbad() [all …]
|
| /kernel/linux/linux-6.6/include/linux/mtd/ |
| D | mtd.h | 17 #include <mtd/mtd-abi.h> 37 uint64_t offset; /* At which this region starts, from the beginning of the MTD */ 64 * Note, some MTD drivers do not allow you to write more than one OOB area at 65 * one go. If you try to do that on such an MTD device, -EINVAL will be 66 * returned. If you want to make your implementation portable on all kind of MTD 107 int (*ecc)(struct mtd_info *mtd, int section, 109 int (*free)(struct mtd_info *mtd, int section, 168 * write-unit <-> (pair + group) conversions, we ask the MTD drivers to 171 * MTD users will then be able to query these information by using the 174 * @ngroups is here to help MTD users iterating over all the pages in a [all …]
|
| /kernel/linux/linux-5.10/include/linux/mtd/ |
| D | mtd.h | 17 #include <mtd/mtd-abi.h> 37 uint64_t offset; /* At which this region starts, from the beginning of the MTD */ 58 * Note, some MTD drivers do not allow you to write more than one OOB area at 59 * one go. If you try to do that on such an MTD device, -EINVAL will be 60 * returned. If you want to make your implementation portable on all kind of MTD 102 int (*ecc)(struct mtd_info *mtd, int section, 104 int (*free)(struct mtd_info *mtd, int section, 163 * write-unit <-> (pair + group) conversions, we ask the MTD drivers to 166 * MTD users will then be able to query these information by using the 169 * @ngroups is here to help MTD users iterating over all the pages in a [all …]
|
| /kernel/linux/linux-6.6/drivers/mtd/nand/onenand/ |
| D | onenand_base.c | 26 #include <linux/mtd/mtd.h> 27 #include <linux/mtd/onenand.h> 28 #include <linux/mtd/partitions.h> 66 static int flexonenand_ooblayout_ecc(struct mtd_info *mtd, int section, in flexonenand_ooblayout_ecc() argument 78 static int flexonenand_ooblayout_free(struct mtd_info *mtd, int section, in flexonenand_ooblayout_free() argument 102 static int onenand_ooblayout_128_ecc(struct mtd_info *mtd, int section, in onenand_ooblayout_128_ecc() argument 114 static int onenand_ooblayout_128_free(struct mtd_info *mtd, int section, in onenand_ooblayout_128_free() argument 138 static int onenand_ooblayout_32_64_ecc(struct mtd_info *mtd, int section, in onenand_ooblayout_32_64_ecc() argument 150 static int onenand_ooblayout_32_64_free(struct mtd_info *mtd, int section, in onenand_ooblayout_32_64_free() argument 153 int sections = (mtd->oobsize / 32) * 2; in onenand_ooblayout_32_64_free() [all …]
|
| /kernel/linux/linux-5.10/drivers/mtd/nand/onenand/ |
| D | onenand_base.c | 26 #include <linux/mtd/mtd.h> 27 #include <linux/mtd/onenand.h> 28 #include <linux/mtd/partitions.h> 66 static int flexonenand_ooblayout_ecc(struct mtd_info *mtd, int section, in flexonenand_ooblayout_ecc() argument 78 static int flexonenand_ooblayout_free(struct mtd_info *mtd, int section, in flexonenand_ooblayout_free() argument 102 static int onenand_ooblayout_128_ecc(struct mtd_info *mtd, int section, in onenand_ooblayout_128_ecc() argument 114 static int onenand_ooblayout_128_free(struct mtd_info *mtd, int section, in onenand_ooblayout_128_free() argument 138 static int onenand_ooblayout_32_64_ecc(struct mtd_info *mtd, int section, in onenand_ooblayout_32_64_ecc() argument 150 static int onenand_ooblayout_32_64_free(struct mtd_info *mtd, int section, in onenand_ooblayout_32_64_free() argument 153 int sections = (mtd->oobsize / 32) * 2; in onenand_ooblayout_32_64_free() [all …]
|
| /kernel/linux/linux-5.10/drivers/mtd/ubi/ |
| D | gluebi.c | 9 * This is a small driver which implements fake MTD devices on top of UBI 11 * MTD-oriented software (including all the legacy software) work on top of 14 * Gluebi emulates MTD devices of "MTD_UBIVOLUME" type. Their minimal I/O unit 15 * size (@mtd->writesize) is equivalent to the UBI minimal I/O unit. The 26 #include <linux/mtd/ubi.h> 27 #include <linux/mtd/mtd.h> 36 * @mtd: emulated MTD device description object 44 struct mtd_info mtd; member 77 * gluebi_get_device - get MTD device reference. 78 * @mtd: the MTD device description object [all …]
|
| /kernel/linux/linux-6.6/drivers/mtd/ubi/ |
| D | gluebi.c | 9 * This is a small driver which implements fake MTD devices on top of UBI 11 * MTD-oriented software (including all the legacy software) work on top of 14 * Gluebi emulates MTD devices of "MTD_UBIVOLUME" type. Their minimal I/O unit 15 * size (@mtd->writesize) is equivalent to the UBI minimal I/O unit. The 26 #include <linux/mtd/ubi.h> 27 #include <linux/mtd/mtd.h> 36 * @mtd: emulated MTD device description object 44 struct mtd_info mtd; member 77 * gluebi_get_device - get MTD device reference. 78 * @mtd: the MTD device description object [all …]
|
| /kernel/linux/linux-5.10/drivers/mtd/nand/raw/ |
| D | mpc5121_nfc.c | 21 #include <linux/mtd/mtd.h> 22 #include <linux/mtd/rawnand.h> 23 #include <linux/mtd/partitions.h> 119 static void mpc5121_nfc_done(struct mtd_info *mtd); 122 static inline u16 nfc_read(struct mtd_info *mtd, uint reg) in nfc_read() argument 124 struct nand_chip *chip = mtd_to_nand(mtd); in nfc_read() 131 static inline void nfc_write(struct mtd_info *mtd, uint reg, u16 val) in nfc_write() argument 133 struct nand_chip *chip = mtd_to_nand(mtd); in nfc_write() 140 static inline void nfc_set(struct mtd_info *mtd, uint reg, u16 bits) in nfc_set() argument 142 nfc_write(mtd, reg, nfc_read(mtd, reg) | bits); in nfc_set() [all …]
|
| /kernel/linux/linux-6.6/drivers/mtd/nand/raw/ |
| D | mpc5121_nfc.c | 21 #include <linux/mtd/mtd.h> 22 #include <linux/mtd/rawnand.h> 23 #include <linux/mtd/partitions.h> 119 static void mpc5121_nfc_done(struct mtd_info *mtd); 122 static inline u16 nfc_read(struct mtd_info *mtd, uint reg) in nfc_read() argument 124 struct nand_chip *chip = mtd_to_nand(mtd); in nfc_read() 131 static inline void nfc_write(struct mtd_info *mtd, uint reg, u16 val) in nfc_write() argument 133 struct nand_chip *chip = mtd_to_nand(mtd); in nfc_write() 140 static inline void nfc_set(struct mtd_info *mtd, uint reg, u16 bits) in nfc_set() argument 142 nfc_write(mtd, reg, nfc_read(mtd, reg) | bits); in nfc_set() [all …]
|
| /kernel/linux/linux-5.10/drivers/mtd/chips/ |
| D | map_rom.c | 15 #include <linux/mtd/mtd.h> 16 #include <linux/mtd/map.h> 22 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info); 23 static int maprom_point (struct mtd_info *mtd, loff_t from, size_t len, 25 static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len); 45 struct mtd_info *mtd; in map_rom_probe() local 47 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_rom_probe() 48 if (!mtd) in map_rom_probe() 52 mtd->priv = map; in map_rom_probe() 53 mtd->name = map->name; in map_rom_probe() [all …]
|
| D | map_ram.c | 14 #include <linux/mtd/mtd.h> 15 #include <linux/mtd/map.h> 23 static int mapram_point (struct mtd_info *mtd, loff_t from, size_t len, 25 static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len); 36 struct mtd_info *mtd; in map_ram_probe() local 59 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_ram_probe() 60 if (!mtd) in map_ram_probe() 64 mtd->priv = map; in map_ram_probe() 65 mtd->name = map->name; in map_ram_probe() 66 mtd->type = MTD_RAM; in map_ram_probe() [all …]
|
| D | map_absent.c | 6 * This map driver is used to allocate "placeholder" MTD 9 * registration of MTD device nodes regardless of probe outcome. 27 #include <linux/mtd/mtd.h> 28 #include <linux/mtd/map.h> 47 struct mtd_info *mtd; in map_absent_probe() local 49 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_absent_probe() 50 if (!mtd) { in map_absent_probe() 55 mtd->priv = map; in map_absent_probe() 56 mtd->name = map->name; in map_absent_probe() 57 mtd->type = MTD_ABSENT; in map_absent_probe() [all …]
|
| /kernel/linux/linux-5.10/Documentation/ABI/testing/ |
| D | sysfs-class-mtd | 1 What: /sys/class/mtd/ 4 Contact: linux-mtd@lists.infradead.org 6 The mtd/ class subdirectory belongs to the MTD subsystem 7 (MTD core). 9 What: /sys/class/mtd/mtdX/ 12 Contact: linux-mtd@lists.infradead.org 14 The /sys/class/mtd/mtd{0,1,2,3,...} directories correspond 19 What: /sys/class/mtd/mtdXro/ 22 Contact: linux-mtd@lists.infradead.org 25 nodes for /sys/class/mtd/mtdX/ . [all …]
|
| /kernel/linux/linux-6.6/Documentation/ABI/testing/ |
| D | sysfs-class-mtd | 1 What: /sys/class/mtd/ 4 Contact: linux-mtd@lists.infradead.org 6 The mtd/ class subdirectory belongs to the MTD subsystem 7 (MTD core). 9 What: /sys/class/mtd/mtdX/ 12 Contact: linux-mtd@lists.infradead.org 14 The /sys/class/mtd/mtd{0,1,2,3,...} directories correspond 19 What: /sys/class/mtd/mtdXro/ 22 Contact: linux-mtd@lists.infradead.org 25 nodes for /sys/class/mtd/mtdX/ . [all …]
|
| /kernel/linux/linux-6.6/drivers/mtd/chips/ |
| D | map_ram.c | 15 #include <linux/mtd/mtd.h> 16 #include <linux/mtd/map.h> 24 static int mapram_point (struct mtd_info *mtd, loff_t from, size_t len, 26 static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len); 37 struct mtd_info *mtd; in map_ram_probe() local 60 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_ram_probe() 61 if (!mtd) in map_ram_probe() 65 mtd->priv = map; in map_ram_probe() 66 mtd->name = map->name; in map_ram_probe() 67 mtd->type = MTD_RAM; in map_ram_probe() [all …]
|
| D | map_rom.c | 16 #include <linux/mtd/mtd.h> 17 #include <linux/mtd/map.h> 23 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info); 24 static int maprom_point (struct mtd_info *mtd, loff_t from, size_t len, 26 static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len); 46 struct mtd_info *mtd; in map_rom_probe() local 48 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_rom_probe() 49 if (!mtd) in map_rom_probe() 53 mtd->priv = map; in map_rom_probe() 54 mtd->name = map->name; in map_rom_probe() [all …]
|
| D | map_absent.c | 6 * This map driver is used to allocate "placeholder" MTD 9 * registration of MTD device nodes regardless of probe outcome. 27 #include <linux/mtd/mtd.h> 28 #include <linux/mtd/map.h> 47 struct mtd_info *mtd; in map_absent_probe() local 49 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_absent_probe() 50 if (!mtd) { in map_absent_probe() 55 mtd->priv = map; in map_absent_probe() 56 mtd->name = map->name; in map_absent_probe() 57 mtd->type = MTD_ABSENT; in map_absent_probe() [all …]
|
| /kernel/linux/linux-6.6/drivers/mtd/devices/ |
| D | mtdram.c | 2 * mtdram - a test mtd device 18 #include <linux/mtd/mtd.h> 19 #include <linux/mtd/mtdram.h> 34 // We could store these in the mtd structure, but we only support 1 device.. 37 static int check_offs_len(struct mtd_info *mtd, loff_t ofs, uint64_t len) in check_offs_len() argument 42 if (mtd_mod_by_eb(ofs, mtd)) { in check_offs_len() 48 if (mtd_mod_by_eb(len, mtd)) { in check_offs_len() 56 static int ram_erase(struct mtd_info *mtd, struct erase_info *instr) in ram_erase() argument 58 if (check_offs_len(mtd, instr->addr, instr->len)) in ram_erase() 60 memset((char *)mtd->priv + instr->addr, 0xff, instr->len); in ram_erase() [all …]
|
| /kernel/linux/linux-5.10/drivers/mtd/devices/ |
| D | mtdram.c | 2 * mtdram - a test mtd device 18 #include <linux/mtd/mtd.h> 19 #include <linux/mtd/mtdram.h> 34 // We could store these in the mtd structure, but we only support 1 device.. 37 static int check_offs_len(struct mtd_info *mtd, loff_t ofs, uint64_t len) in check_offs_len() argument 42 if (mtd_mod_by_eb(ofs, mtd)) { in check_offs_len() 48 if (mtd_mod_by_eb(len, mtd)) { in check_offs_len() 56 static int ram_erase(struct mtd_info *mtd, struct erase_info *instr) in ram_erase() argument 58 if (check_offs_len(mtd, instr->addr, instr->len)) in ram_erase() 60 memset((char *)mtd->priv + instr->addr, 0xff, instr->len); in ram_erase() [all …]
|
| /kernel/linux/linux-6.6/drivers/mtd/tests/ |
| D | stresstest.c | 5 * Test random reads, writes and erases on MTD device. 16 #include <linux/mtd/mtd.h> 26 MODULE_PARM_DESC(dev, "MTD device number to use"); 32 static struct mtd_info *mtd; variable 73 if (offs >= mtd->erasesize) in do_read() 74 offs -= mtd->erasesize; in do_read() 75 if (offs + len > mtd->erasesize) in do_read() 76 len = mtd->erasesize - offs; in do_read() 78 addr = (loff_t)eb * mtd->erasesize + offs; in do_read() 79 return mtdtest_read(mtd, addr, len, readbuf); in do_read() [all …]
|
| /kernel/linux/linux-5.10/drivers/mtd/tests/ |
| D | stresstest.c | 5 * Test random reads, writes and erases on MTD device. 16 #include <linux/mtd/mtd.h> 26 MODULE_PARM_DESC(dev, "MTD device number to use"); 32 static struct mtd_info *mtd; variable 82 if (offs >= mtd->erasesize) in do_read() 83 offs -= mtd->erasesize; in do_read() 84 if (offs + len > mtd->erasesize) in do_read() 85 len = mtd->erasesize - offs; in do_read() 87 addr = (loff_t)eb * mtd->erasesize + offs; in do_read() 88 return mtdtest_read(mtd, addr, len, readbuf); in do_read() [all …]
|