Home
last modified time | relevance | path

Searched full:mtd (Results 1 – 25 of 699) sorted by relevance

12345678910>>...28

/Linux-v5.10/drivers/mtd/
Dmtdcore.c3 * 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",
87 /* REVISIT once MTD uses the driver model better, whoever allocates
[all …]
Dmtdpstore.c8 #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 …]
Dmtdsuper.c2 /* 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 …]
Dmtdchar.c22 #include <linux/mtd/mtd.h>
23 #include <linux/mtd/partitions.h>
24 #include <linux/mtd/map.h>
33 * Data structure to hold the pointer to the mtd device as well
37 struct mtd_info *mtd; member
44 return fixed_size_llseek(file, offset, orig, mfi->mtd->size); in mtdchar_lseek()
52 struct mtd_info *mtd; in mtdchar_open() local
62 mtd = get_mtd_device(NULL, devnum); in mtdchar_open()
64 if (IS_ERR(mtd)) { in mtdchar_open()
65 ret = PTR_ERR(mtd); in mtdchar_open()
[all …]
Dmtdoops.c3 * MTD Oops/Panic logger
19 #include <linux/mtd/mtd.h>
22 /* Maximum MTD partition size */
31 "record size for MTD OOPS pages in bytes (default 4096)");
36 "name or index number of the MTD device to use");
49 struct mtd_info *mtd; member
75 struct mtd_info *mtd = cxt->mtd; in mtdoops_erase_block() local
76 u32 start_page_offset = mtd_div_by_eb(offset, mtd) * mtd->erasesize; in mtdoops_erase_block()
78 u32 erase_pages = mtd->erasesize / record_size; in mtdoops_erase_block()
84 erase.len = mtd->erasesize; in mtdoops_erase_block()
[all …]
Dmtdconcat.c3 * MTD device concatenation layer
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/concat.h>
30 struct mtd_info mtd; member
43 * Given a pointer to the MTD object in the mtd_concat structure,
49 * MTD methods which look up the relevant subdevice, translate the
54 concat_read(struct mtd_info *mtd, loff_t from, size_t len, in concat_read() argument
57 struct mtd_concat *concat = CONCAT(mtd); in concat_read()
83 mtd->ecc_stats.failed++; in concat_read()
86 mtd->ecc_stats.corrected++; in concat_read()
[all …]
DKconfig1 menuconfig MTD config
2 tristate "Memory Technology Device (MTD) support"
7 will provide the generic support for MTD drivers to register
8 themselves with the kernel and for potential users of MTD devices
11 particular hardware and users of MTD devices. If unsure, say N.
13 if MTD
16 tristate "MTD tests support (DANGEROUS)"
19 This option includes various MTD tests into compilation. The tests
23 WARNING: some of the tests will ERASE entire MTD device which they
27 source "drivers/mtd/parsers/Kconfig"
[all …]
/Linux-v5.10/include/linux/mtd/
Dmtd.h17 #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 …]
/Linux-v5.10/drivers/mtd/nand/onenand/
Donenand_base.c26 #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 …]
/Linux-v5.10/drivers/mtd/ubi/
Dgluebi.c9 * 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 …]
/Linux-v5.10/drivers/mtd/nand/raw/
Dmpc5121_nfc.c21 #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 …]
/Linux-v5.10/drivers/mtd/chips/
Dmap_rom.c15 #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 …]
Dmap_ram.c14 #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 …]
Dmap_absent.c6 * 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 …]
/Linux-v5.10/Documentation/ABI/testing/
Dsysfs-class-mtd1 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 …]
/Linux-v5.10/drivers/mtd/devices/
Dmtdram.c2 * 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 …]
Dpowernv_flash.c3 * OPAL PNOR flash MTD abstraction
16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/partitions.h>
26 * This driver creates the a Linux MTD abstraction for platform PNOR flash
31 struct mtd_info mtd; member
42 * Don't return -ERESTARTSYS if we can't get a token, the MTD core
46 static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op, in powernv_flash_async_op() argument
49 struct powernv_flash *info = (struct powernv_flash *)mtd->priv; in powernv_flash_async_op()
50 struct device *dev = &mtd->dev; in powernv_flash_async_op()
87 * If we return the mtd core will free the in powernv_flash_async_op()
[all …]
/Linux-v5.10/drivers/mtd/tests/
Dstresstest.c5 * 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 …]
Dpagetest.c5 * Test page read and write on MTD device.
17 #include <linux/mtd/mtd.h>
26 MODULE_PARM_DESC(dev, "MTD device number to use");
28 static struct mtd_info *mtd; variable
43 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
45 prandom_bytes_state(&rnd_state, writebuf, mtd->erasesize); in write_eraseblock()
47 return mtdtest_write(mtd, addr, mtd->erasesize, writebuf); in write_eraseblock()
55 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock()
59 addr0 += mtd->erasesize; in verify_eraseblock()
61 addrn = mtd->size; in verify_eraseblock()
[all …]
Doobtest.c5 * Test OOB read and write on MTD device.
17 #include <linux/mtd/mtd.h>
27 MODULE_PARM_DESC(dev, "MTD device number to use");
31 static struct mtd_info *mtd; variable
61 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
64 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in write_eraseblock()
73 err = mtd_write_oob(mtd, addr, &ops); in write_eraseblock()
170 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock()
174 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in verify_eraseblock()
183 err = mtd_read_oob(mtd, addr, &ops); in verify_eraseblock()
[all …]
Dspeedtest.c5 * Test read and write speed of a MTD device.
17 #include <linux/mtd/mtd.h>
26 MODULE_PARM_DESC(dev, "MTD device number to use");
33 static struct mtd_info *mtd; variable
47 loff_t addr = (loff_t)ebnum * mtd->erasesize; in multiblock_erase()
51 ei.len = mtd->erasesize * blocks; in multiblock_erase()
53 err = mtd_erase(mtd, &ei); in multiblock_erase()
65 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
67 return mtdtest_write(mtd, addr, mtd->erasesize, iobuf); in write_eraseblock()
73 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_page()
[all …]
Dreadtest.c5 * Check MTD device read.
16 #include <linux/mtd/mtd.h>
24 MODULE_PARM_DESC(dev, "MTD device number to use");
26 static struct mtd_info *mtd; variable
38 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock_by_page()
44 ret = mtdtest_read(mtd, addr, pgsize, buf); in read_eraseblock_by_page()
49 if (mtd->oobsize) { in read_eraseblock_by_page()
55 ops.ooblen = mtd->oobsize; in read_eraseblock_by_page()
60 ret = mtd_read_oob(mtd, addr, &ops); in read_eraseblock_by_page()
62 ops.oobretlen != mtd->oobsize) { in read_eraseblock_by_page()
[all …]
/Linux-v5.10/drivers/net/ethernet/sfc/
Dmtd.c9 #include <linux/mtd/mtd.h>
16 #define to_efx_mtd_partition(mtd) \ argument
17 container_of(mtd, struct efx_mtd_partition, mtd)
19 /* MTD interface */
21 static int efx_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) in efx_mtd_erase() argument
23 struct efx_nic *efx = mtd->priv; in efx_mtd_erase()
25 return efx->type->mtd_erase(mtd, erase->addr, erase->len); in efx_mtd_erase()
28 static void efx_mtd_sync(struct mtd_info *mtd) in efx_mtd_sync() argument
30 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in efx_mtd_sync()
31 struct efx_nic *efx = mtd->priv; in efx_mtd_sync()
[all …]
/Linux-v5.10/drivers/net/ethernet/sfc/falcon/
Dmtd.c9 #include <linux/mtd/mtd.h>
16 #define to_ef4_mtd_partition(mtd) \ argument
17 container_of(mtd, struct ef4_mtd_partition, mtd)
19 /* MTD interface */
21 static int ef4_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) in ef4_mtd_erase() argument
23 struct ef4_nic *efx = mtd->priv; in ef4_mtd_erase()
25 return efx->type->mtd_erase(mtd, erase->addr, erase->len); in ef4_mtd_erase()
28 static void ef4_mtd_sync(struct mtd_info *mtd) in ef4_mtd_sync() argument
30 struct ef4_mtd_partition *part = to_ef4_mtd_partition(mtd); in ef4_mtd_sync()
31 struct ef4_nic *efx = mtd->priv; in ef4_mtd_sync()
[all …]
/Linux-v5.10/drivers/mtd/parsers/
Dafs.c4 drivers/mtd/afs.c: ARM Flash Layout/Partitioning
22 #include <linux/mtd/mtd.h>
23 #include <linux/mtd/map.h>
24 #include <linux/mtd/partitions.h>
78 static bool afs_is_v1(struct mtd_info *mtd, u_int off) in afs_is_v1() argument
81 u_int ptr = off + mtd->erasesize - 12; in afs_is_v1()
86 ret = mtd_read(mtd, ptr, 4, &sz, (u_char *)&magic); in afs_is_v1()
88 printk(KERN_ERR "AFS: mtd read failed at 0x%x: %d\n", in afs_is_v1()
98 static bool afs_is_v2(struct mtd_info *mtd, u_int off) in afs_is_v2() argument
101 u_int ptr = off + mtd->erasesize - 8; in afs_is_v2()
[all …]

12345678910>>...28