/openbmc/u-boot/cmd/ |
H A D | mtd.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * mtd.c 16 #include <mtd.h> 20 static struct mtd_info *get_mtd_by_name(const char *name) in get_mtd_by_name() argument 22 struct mtd_info *mtd; in get_mtd_by_name() local 26 mtd = get_mtd_device_nm(name); in get_mtd_by_name() 27 if (IS_ERR_OR_NULL(mtd)) in get_mtd_by_name() 28 printf("MTD device %s not found, ret %ld\n", name, in get_mtd_by_name() 29 PTR_ERR(mtd)); in get_mtd_by_name() 31 return mtd; in get_mtd_by_name() [all …]
|
/openbmc/u-boot/drivers/mtd/ |
H A D | mtdpart.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Simple MTD partitioning layer 7 * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> 26 #include <linux/mtd/mtd.h> 27 #include <linux/mtd/partitions.h> 43 * kstrdup - allocate space for and copy an existing string 70 list_for_each_entry(slave, &master->partitions, node) { in mtd_partitions_used() 71 if (slave->usecount) in mtd_partitions_used() 79 * mtd_parse_partition - Parse @mtdparts partition definition, fill @partition 82 * The partition name is allocated and must be freed by the caller. [all …]
|
H A D | mtdcore.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Core registration and callback routines for MTD 6 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> 25 #include <linux/backing-dev.h> 34 #include <linux/mtd/mtd.h> 35 #include <linux/mtd/partitions.h> 41 * backing device capabilities for non-mappable devices (such as NAND flash) 42 * - permits private mappings, copies are taken of the data 50 * - permits private mappings, copies are taken of the data 51 * - permits non-writable shared mappings [all …]
|
H A D | mtdconcat.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * MTD device concatenation layer 6 * Copyright © 2002-2010 David Woodhouse <dwmw2@infradead.org> 18 #include <linux/backing-dev.h> 25 #include <linux/mtd/mtd.h> 26 #include <linux/mtd/concat.h> 37 struct mtd_info mtd; member 50 * Given a pointer to the MTD object in the mtd_concat structure, 56 * MTD methods which look up the relevant subdevice, translate the 61 concat_read(struct mtd_info *mtd, loff_t from, size_t len, in concat_read() argument [all …]
|
/openbmc/linux/drivers/mtd/parsers/ |
H A 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 …]
|
H A D | tplink_safeloader.c | 1 // SPDX-License-Identifier: GPL-2.0-only 8 #include <linux/mtd/mtd.h> 9 #include <linux/mtd/partitions.h> 21 static void *mtd_parser_tplink_safeloader_read_table(struct mtd_info *mtd) in mtd_parser_tplink_safeloader_read_table() argument 31 np = mtd_get_of_node(mtd); in mtd_parser_tplink_safeloader_read_table() 32 if (mtd_is_partition(mtd)) in mtd_parser_tplink_safeloader_read_table() 37 if (of_property_read_u32(np, "partitions-table-offset", &offset)) { in mtd_parser_tplink_safeloader_read_table() 42 err = mtd_read(mtd, offset, sizeof(hdr), &bytes_read, (uint8_t *)&hdr); in mtd_parser_tplink_safeloader_read_table() 44 pr_err("Failed to read from %s at 0x%x\n", mtd->name, offset); in mtd_parser_tplink_safeloader_read_table() 54 err = mtd_read(mtd, offset + sizeof(hdr), size, &bytes_read, buf); in mtd_parser_tplink_safeloader_read_table() [all …]
|
H A 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 …]
|
/openbmc/linux/drivers/mtd/ |
H A 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> 23 * get a superblock on an MTD-backed filesystem 26 struct mtd_info *mtd, in mtd_get_sb() argument 33 sb = sget_dev(fc, MKDEV(MTD_BLOCK_MAJOR, mtd->index)); in mtd_get_sb() 37 if (sb->s_root) { in mtd_get_sb() [all …]
|
H A 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> 31 #include <linux/nvmem-provider.h> 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 [all …]
|
H A 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() 35 void release_mtd_partition(struct mtd_info *mtd) in release_mtd_partition() argument [all …]
|
H A 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 …]
|
H A 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 …]
|
/openbmc/linux/drivers/mtd/devices/ |
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
/openbmc/linux/drivers/mtd/maps/ |
H A 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 …]
|
H A 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 …]
|
/openbmc/u-boot/drivers/fastboot/ |
H A D | fb_nand.c | 1 // SPDX-License-Identifier: GPL-2.0+ 11 #include <image-sparse.h> 13 #include <linux/mtd/mtd.h> 18 struct mtd_info *mtd; member 22 __weak int board_fastboot_erase_partition_setup(char *name) in board_fastboot_erase_partition_setup() argument 27 __weak int board_fastboot_write_partition_setup(char *name) in board_fastboot_write_partition_setup() argument 33 struct mtd_info **mtd, in fb_nand_lookup() argument 43 pr_err("Cannot initialize MTD partitions\n"); in fb_nand_lookup() 55 if (dev->id->type != MTD_DEV_TYPE_NAND) { in fb_nand_lookup() 59 return -EINVAL; in fb_nand_lookup() [all …]
|
/openbmc/linux/drivers/mtd/chips/ |
H A D | map_rom.c | 1 // SPDX-License-Identifier: GPL-2.0 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); 31 .name = "map_rom", 39 erase_size = of_get_property(map->device_node, "erase-size", NULL); in default_erasesize() 41 return !erase_size ? map->size : be32_to_cpu(*erase_size); in default_erasesize() 46 struct mtd_info *mtd; in map_rom_probe() local [all …]
|
H A 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 …]
|
H A D | map_ram.c | 1 // SPDX-License-Identifier: GPL-2.0 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); 31 .name = "map_ram", 37 struct mtd_info *mtd; in map_ram_probe() local 50 map_write8(map, 0x55, map->size-1); in map_ram_probe() 51 if (map_read8(map, map->size-1) != 0x55) in map_ram_probe() 54 map_write8(map, 0xAA, map->size-1); in map_ram_probe() [all …]
|
H A 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 …]
|
/openbmc/linux/drivers/mtd/ubi/ |
H A 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 …]
|
/openbmc/linux/drivers/net/ethernet/sfc/falcon/ |
H A 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 …]
|