/Linux-v6.1/drivers/mtd/ |
D | mtdsuper.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* MTD-based superblock management 4 * Copyright © 2001-2007 Red Hat, Inc. All Rights Reserved. 5 * Copyright © 2001-2010 David Woodhouse <dwmw2@infradead.org> 11 #include <linux/mtd/super.h> 17 #include <linux/backing-dev.h> 24 * - they are if the underlying MTD device is the same 28 struct mtd_info *mtd = fc->sget_key; in mtd_test_super() local 30 if (sb->s_mtd == fc->sget_key) { in mtd_test_super() 32 mtd->index, mtd->name); in mtd_test_super() [all …]
|
D | mtdcore.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Core registration and callback routines for MTD 6 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> 24 #include <linux/backing-dev.h> 30 #include <linux/nvmem-provider.h> 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 [all …]
|
D | mtdpart.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Simple MTD partitioning layer 7 * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> 16 #include <linux/mtd/mtd.h> 17 #include <linux/mtd/partitions.h> 25 * MTD methods which simply translate the effective address and pass through 29 static inline void free_partition(struct mtd_info *mtd) in free_partition() argument 31 kfree(mtd->name); in free_partition() 32 kfree(mtd); in free_partition() 40 int wr_alignment = (parent->flags & MTD_NO_ERASE) ? in allocate_partition() [all …]
|
D | mtdblock.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Direct MTD block device access 5 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> 6 * Copyright © 2000-2003 Nicolas Pitre <nico@fluxnic.net> 18 #include <linux/mtd/mtd.h> 19 #include <linux/mtd/blktrans.h> 38 * buffer cache can handle, we must implement read-modify-write on flash 39 * sectors for each block write requests. To avoid over-erasing flash sectors 44 static int erase_write (struct mtd_info *mtd, unsigned long pos, in erase_write() argument 57 ret = mtd_erase(mtd, &erase); in erase_write() [all …]
|
D | mtdconcat.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * MTD device concatenation layer 6 * Copyright © 2002-2010 David Woodhouse <dwmw2@infradead.org> 16 #include <linux/backing-dev.h> 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 [all …]
|
D | mtdblock_ro.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Simple read-only (writable only for RAM) mtdblock driver 5 * Copyright © 2001-2010 David Woodhouse <dwmw2@infradead.org> 10 #include <linux/mtd/mtd.h> 11 #include <linux/mtd/blktrans.h> 20 if (mtd_read(dev->mtd, (block * 512), 512, &retlen, buf)) in mtdblock_readsect() 30 if (mtd_write(dev->mtd, (block * 512), 512, &retlen, buf)) in mtdblock_writesect() 35 static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) in mtdblock_add_mtd() argument 42 dev->mtd = mtd; in mtdblock_add_mtd() 43 dev->devnum = mtd->index; in mtdblock_add_mtd() [all …]
|
D | rfd_ftl.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * rfd_ftl.c -- resident flash disk (flash translation layer) 17 #include <linux/mtd/blktrans.h> 18 #include <linux/mtd/mtd.h> 95 struct block *block = &part->blocks[block_no]; in build_block_map() 98 block->offset = part->block_size * block_no; in build_block_map() 100 if (le16_to_cpu(part->header_cache[0]) != RFD_MAGIC) { in build_block_map() 101 block->state = BLOCK_UNUSED; in build_block_map() 102 return -ENOENT; in build_block_map() 105 block->state = BLOCK_OK; in build_block_map() [all …]
|
/Linux-v6.1/drivers/mtd/parsers/ |
D | afs.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 4 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> 44 char name[16]; /* Null terminated */ member 47 u32 headerType; /* AIF, RLF, s-record etc. */ 56 while (num--) in word_sum() 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() [all …]
|
D | cmdlinepart.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright © 2002 SYSGO Real-Time Solutions GmbH 6 * Copyright © 2002-2010 David Woodhouse <dwmw2@infradead.org> 11 * <mtddef> := <mtd-id>:<partdef>[,<partdef>] 12 * <partdef> := <size>[@<offset>][<name>][ro][lk][slc] 13 * <mtd-id> := unique name used in mapping driver/device (mtd->name) 14 * <size> := standard linux memsize OR "-" to denote all remaining space 20 * <name> := '(' NAME ')' 21 * NAME will appear in /proc/mtd 26 * The parts are assigned MTD numbers in the order they are specified in the [all …]
|
/Linux-v6.1/drivers/mtd/devices/ |
D | block2mtd.c | 2 * block2mtd.c - create an mtd from a block device 5 * Copyright (C) 2004-2006 Joern Engel <joern@wh.fh-wedel.de> 23 #include <linux/backing-dev.h> 28 #include <linux/mtd/mtd.h> 34 /* Maximum number of comma-separated items in the 'block2mtd=' parameter */ 41 struct mtd_info mtd; member 46 /* Static info about the MTD, used in cleanup_module */ 58 struct address_space *mapping = dev->blkdev->bd_inode->i_mapping; in _block2mtd_erase() 72 if (*p != -1UL) { in _block2mtd_erase() 82 pages--; in _block2mtd_erase() [all …]
|
D | phram.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * Copyright (c) 2003-2004 Joern Engel <joern@wh.fh-wedel.de> 9 * phram=<name>,<start>,<len>[,<erasesize>] 10 * <name> may be up to 63 characters. 28 #include <linux/mtd/mtd.h> 35 struct mtd_info mtd; member 42 static int phram_erase(struct mtd_info *mtd, struct erase_info *instr) in phram_erase() argument 44 u_char *start = mtd->priv; in phram_erase() 46 memset(start + instr->addr, 0xff, instr->len); in phram_erase() 51 static int phram_point(struct mtd_info *mtd, loff_t from, size_t len, in phram_point() argument [all …]
|
D | sst25l.c | 1 // SPDX-License-Identifier: GPL-2.0-only 21 #include <linux/mtd/mtd.h> 22 #include <linux/mtd/partitions.h> 49 struct mtd_info mtd; member 53 const char *name; member 60 #define to_sst25l_flash(x) container_of(x, struct sst25l_flash, mtd) 83 err = spi_sync(flash->spi, &m); in sst25l_status() 97 err = spi_write(flash->spi, command, 1); in sst25l_write_enable() 102 err = spi_write(flash->spi, command, 1); in sst25l_write_enable() 108 err = spi_write(flash->spi, command, 2); in sst25l_write_enable() [all …]
|
D | mtdram.c | 2 * mtdram - a test mtd device 6 * Copyright (c) 2005 Joern Engel <joern@wh.fh-wedel.de> 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() 44 ret = -EINVAL; in check_offs_len() 48 if (mtd_mod_by_eb(len, mtd)) { in check_offs_len() 50 ret = -EINVAL; in check_offs_len() [all …]
|
D | ms02-nv.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 10 #include <linux/mtd/mtd.h> 22 #include "ms02-nv.h" 26 "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n"; 28 MODULE_AUTHOR("Maciej W. Rozycki <macro@linux-mips.org>"); 29 MODULE_DESCRIPTION("DEC MS02-NV NVRAM module driver"); 34 * Addresses we probe for an MS02-NV at. Modules may be located 45 static const char ms02nv_name[] = "DEC MS02-NV NVRAM"; 47 static const char ms02nv_res_user_ram[] = "General-purpose RAM"; 53 static int ms02nv_read(struct mtd_info *mtd, loff_t from, in ms02nv_read() argument [all …]
|
/Linux-v6.1/drivers/mtd/maps/ |
D | sa1100-flash.c | 1 // SPDX-License-Identifier: GPL-2.0-only 18 #include <linux/mtd/mtd.h> 19 #include <linux/mtd/map.h> 20 #include <linux/mtd/partitions.h> 21 #include <linux/mtd/concat.h> 28 char name[16]; member 30 struct mtd_info *mtd; member 35 struct mtd_info *mtd; member 50 subdev->plat->set_vpp(1); in sa1100_set_vpp() 52 if (--sa1100_vpp_refcnt == 0) /* last nested 'off' */ in sa1100_set_vpp() [all …]
|
D | sun_uflash.c | 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* sun_uflash.c - Driver for user-programmable flash on 5 * This driver does NOT provide access to the OBP-flash for 6 * safety reasons-- use <linux>/drivers/sbus/char/flash.c instead. 23 #include <linux/mtd/mtd.h> 24 #include <linux/mtd/map.h> 31 #define UFLASH_BUSWIDTH 1 /* EBus is 8-bit */ 34 MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets"); 39 const char *name; /* device name */ member 40 struct map_info map; /* mtd map info */ [all …]
|
D | pxa2xx-flash.c | 1 // SPDX-License-Identifier: GPL-2.0-only 14 #include <linux/mtd/mtd.h> 15 #include <linux/mtd/map.h> 16 #include <linux/mtd/partitions.h> 26 unsigned long start = (unsigned long)map->cached + from; in pxa2xx_map_inval_cache() 29 start &= ~(CACHELINESIZE - 1); in pxa2xx_map_inval_cache() 38 struct mtd_info *mtd; member 46 struct flash_platform_data *flash = dev_get_platdata(&pdev->dev); in pxa2xx_flash_probe() 52 return -ENODEV; in pxa2xx_flash_probe() 56 return -ENOMEM; in pxa2xx_flash_probe() [all …]
|
/Linux-v6.1/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); 30 .name = "map_rom", 38 erase_size = of_get_property(map->device_node, "erase-size", NULL); in default_erasesize() 40 return !erase_size ? map->size : be32_to_cpu(*erase_size); in default_erasesize() 45 struct mtd_info *mtd; in map_rom_probe() local 47 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_rom_probe() [all …]
|
D | map_absent.c | 1 // SPDX-License-Identifier: GPL-2.0-only 6 * This map driver is used to allocate "placeholder" MTD 9 * registration of MTD device nodes regardless of probe outcome. 17 * Any device 'probed' with this driver will return -ENODEV 27 #include <linux/mtd/mtd.h> 28 #include <linux/mtd/map.h> 41 .name = "map_absent", 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() [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); 30 .name = "map_ram", 36 struct mtd_info *mtd; in map_ram_probe() local 49 map_write8(map, 0x55, map->size-1); in map_ram_probe() 50 if (map_read8(map, map->size-1) != 0x55) in map_ram_probe() 53 map_write8(map, 0xAA, map->size-1); in map_ram_probe() 54 if (map_read8(map, map->size-1) != 0xAA) in map_ram_probe() [all …]
|
D | chipreg.c | 1 // SPDX-License-Identifier: GPL-2.0-only 12 #include <linux/mtd/map.h> 13 #include <linux/mtd/mtd.h> 21 list_add(&drv->list, &chip_drvs_list); in register_mtd_chip_driver() 28 list_del(&drv->list); in unregister_mtd_chip_driver() 32 static struct mtd_chip_driver *get_mtd_chip_driver (const char *name) in get_mtd_chip_driver() argument 39 if (!strcmp(this->name, name)) { in get_mtd_chip_driver() 44 if (ret && !try_module_get(ret->module)) in get_mtd_chip_driver() 55 struct mtd_info *do_map_probe(const char *name, struct map_info *map) in do_map_probe() argument 60 drv = get_mtd_chip_driver(name); in do_map_probe() [all …]
|
/Linux-v6.1/drivers/mtd/ubi/ |
D | gluebi.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 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> 28 #include "ubi-media.h" 32 current->pid, __func__, ##__VA_ARGS__) 35 * struct gluebi_device - a gluebi device description data structure. [all …]
|
/Linux-v6.1/drivers/net/ethernet/sfc/falcon/ |
D | mtd.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * Copyright 2005-2006 Fen Systems Ltd. 5 * Copyright 2006-2013 Solarflare Communications Inc. 9 #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() [all …]
|
/Linux-v6.1/drivers/net/ethernet/sfc/ |
D | mtd.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * Copyright 2005-2006 Fen Systems Ltd. 5 * Copyright 2006-2013 Solarflare Communications Inc. 9 #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() [all …]
|
/Linux-v6.1/drivers/net/ethernet/sfc/siena/ |
D | mtd.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * Copyright 2005-2006 Fen Systems Ltd. 5 * Copyright 2006-2013 Solarflare Communications Inc. 9 #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() [all …]
|