| /OK3568_Linux_fs/u-boot/drivers/mtd/ |
| H A D | mtdcore.c | 2 * Core registration and callback routines for MTD 35 #include <linux/mtd/mtd.h> 36 #include <linux/mtd/partitions.h> 74 .name = "mtd", 179 /* REVISIT once MTD uses the driver model better, whoever allocates 184 struct mtd_info __maybe_unused *mtd = dev_get_drvdata(dev); in mtd_release() local 185 dev_t index = MTD_DEVT(mtd->index); in mtd_release() 194 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_suspend() local 196 return mtd ? mtd_suspend(mtd) : 0; in mtd_cls_suspend() 201 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_resume() local [all …]
|
| H A D | mtdcore.su | |
| H A D | mtd_blk.c | 19 #include <linux/mtd/spi-nor.h> 21 #include <linux/mtd/nand.h> 38 struct mtd_info *mtd = NULL; in mtd_blk_map_table_init() local 47 mtd = desc->bdev->priv; in mtd_blk_map_table_init() 53 if (!mtd) { in mtd_blk_map_table_init() 56 blk_total = (mtd->size + mtd->erasesize - 1) >> mtd->erasesize_shift; in mtd_blk_map_table_init() 65 blk_begin = (u32)offset >> mtd->erasesize_shift; in mtd_blk_map_table_init() 66 blk_cnt = ((u32)((offset & mtd->erasesize_mask) + length + \ in mtd_blk_map_table_init() 67 mtd->erasesize - 1) >> mtd->erasesize_shift); in mtd_blk_map_table_init() 84 if (!mtd_block_isbad(mtd, (blk_begin + j) << mtd->erasesize_shift)) { in mtd_blk_map_table_init() [all …]
|
| H A D | mtdpart.c | 2 * Simple MTD partitioning layer 27 #include <linux/mtd/mtd.h> 28 #include <linux/mtd/partitions.h> 88 * @partition: MTD partition structure to fill 188 * Stateless function that takes a @parent MTD device, a string @_mtdparts 190 * the corresponding MTD partition structure array @_parts. Both the name and 194 * @parent: MTD device which contains the partitions 286 * MTD methods which simply translate the effective address and pass through 290 static int part_read(struct mtd_info *mtd, loff_t from, size_t len, in part_read() argument 296 stats = mtd->parent->ecc_stats; in part_read() [all …]
|
| H A D | altera_qspi.c | 13 #include <mtd.h> 59 static void altera_qspi_get_locked_range(struct mtd_info *mtd, loff_t *ofs, 64 struct mtd_info *mtd = info->mtd; in flash_print_info() local 70 altera_qspi_get_locked_range(mtd, &ofs, &len); in flash_print_info() 86 struct mtd_info *mtd = info->mtd; in flash_erase() local 91 instr.mtd = mtd; in flash_erase() 92 instr.addr = mtd->erasesize * s_first; in flash_erase() 93 instr.len = mtd->erasesize * (s_last + 1 - s_first); in flash_erase() 95 ret = mtd_erase(mtd, &instr); in flash_erase() 106 struct mtd_info *mtd = info->mtd; in write_buff() local [all …]
|
| H A D | cfi_mtd.c | 14 #include <linux/mtd/mtd.h> 15 #include <linux/mtd/concat.h> 16 #include <mtd/cfi_flash.h> 24 static int cfi_mtd_erase(struct mtd_info *mtd, struct erase_info *instr) in cfi_mtd_erase() argument 26 flash_info_t *fi = mtd->priv; in cfi_mtd_erase() 68 static int cfi_mtd_read(struct mtd_info *mtd, loff_t from, size_t len, in cfi_mtd_read() argument 71 flash_info_t *fi = mtd->priv; in cfi_mtd_read() 80 static int cfi_mtd_write(struct mtd_info *mtd, loff_t to, size_t len, in cfi_mtd_write() argument 83 flash_info_t *fi = mtd->priv; in cfi_mtd_write() 99 static void cfi_mtd_sync(struct mtd_info *mtd) in cfi_mtd_sync() argument [all …]
|
| H A D | mtdpart.su | |
| /OK3568_Linux_fs/kernel/drivers/mtd/ |
| H A 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", 87 /* REVISIT once MTD uses the driver model better, whoever allocates [all …]
|
| H A 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 …]
|
| /OK3568_Linux_fs/kernel/include/linux/mtd/ |
| H A 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 …]
|
| /OK3568_Linux_fs/u-boot/drivers/mtd/nand/raw/ |
| H A D | nand_base.su | |
| H A D | mxs_nand_spl.c | 12 static struct mtd_info *mtd; variable 15 static void mxs_nand_command(struct mtd_info *mtd, unsigned int command, in mxs_nand_command() argument 18 register struct nand_chip *chip = mtd_to_nand(mtd); in mxs_nand_command() 22 chip->cmd_ctrl(mtd, command, NAND_CLE); in mxs_nand_command() 26 chip->cmd_ctrl(mtd, column, NAND_ALE); in mxs_nand_command() 27 chip->cmd_ctrl(mtd, column >> 8, NAND_ALE); in mxs_nand_command() 30 chip->cmd_ctrl(mtd, page_addr, NAND_ALE); in mxs_nand_command() 31 chip->cmd_ctrl(mtd, page_addr >> 8, NAND_ALE); in mxs_nand_command() 34 chip->cmd_ctrl(mtd, page_addr >> 16, NAND_ALE); in mxs_nand_command() 36 chip->cmd_ctrl(mtd, NAND_CMD_NONE, 0); in mxs_nand_command() [all …]
|
| H A D | nand_util.c | 2 * drivers/mtd/nand/raw/nand_util.c 9 * @references: borrowed heavily from Linux mtd-utils code: 15 * Artem Bityutskiy <dedekind1@gmail.com> from mtd-utils 30 #include <linux/mtd/mtd.h> 45 * @param mtd nand mtd instance to erase 49 * This code is ported from flash_eraseall.c from Linux mtd utils by 52 int nand_erase_opts(struct mtd_info *mtd, in nand_erase_opts() argument 60 const char *mtd_device = mtd->name; in nand_erase_opts() 62 struct nand_chip *chip = mtd_to_nand(mtd); in nand_erase_opts() 64 if ((opts->offset & (mtd->erasesize - 1)) != 0) { in nand_erase_opts() [all …]
|
| H A D | nand_base.c | 3 * This is the generic MTD driver for NAND flash devices. It should be 7 * http://www.linux-mtd.infradead.org/doc/nand.html 20 * Check, if mtd->ecctype should be set to MTD_ECC_HW 39 #include <linux/mtd/mtd.h> 40 #include <linux/mtd/rawnand.h> 41 #include <linux/mtd/nand_ecc.h> 42 #include <linux/mtd/nand_bch.h> 44 #include <linux/mtd/partitions.h> 95 static int nand_get_device(struct mtd_info *mtd, int new_state); 97 static int nand_do_write_oob(struct mtd_info *mtd, loff_t to, [all …]
|
| H A D | vf610_nfc.c | 28 #include <linux/mtd/mtd.h> 29 #include <linux/mtd/rawnand.h> 30 #include <linux/mtd/partitions.h> 198 static inline u32 vf610_nfc_read(struct mtd_info *mtd, uint reg) in vf610_nfc_read() argument 200 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_read() 205 static inline void vf610_nfc_write(struct mtd_info *mtd, uint reg, u32 val) in vf610_nfc_write() argument 207 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_write() 212 static inline void vf610_nfc_set(struct mtd_info *mtd, uint reg, u32 bits) in vf610_nfc_set() argument 214 vf610_nfc_write(mtd, reg, vf610_nfc_read(mtd, reg) | bits); in vf610_nfc_set() 217 static inline void vf610_nfc_clear(struct mtd_info *mtd, uint reg, u32 bits) in vf610_nfc_clear() argument [all …]
|
| /OK3568_Linux_fs/u-boot/include/linux/mtd/ |
| H A D | mtd.h | 17 #include <mtd/mtd-abi.h> 22 #include <mtd/mtd-abi.h> 47 struct mtd_info *mtd; member 63 uint64_t offset; /* At which this region starts, from the beginning of the MTD */ 135 int (*ecc)(struct mtd_info *mtd, int section, 137 int (*rfree)(struct mtd_info *mtd, int section, 143 * similar, smaller struct nand_ecclayout_user (in mtd-abi.h) that is retained 159 uint64_t size; // Total size of the MTD 176 * Size of the write buffer used by the MTD. MTD devices having a write 179 * buffer the MTD driver can (but doesn't have to) do 2 writesize [all …]
|
| /OK3568_Linux_fs/kernel/drivers/mtd/nand/onenand/ |
| H A 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 …]
|
| /OK3568_Linux_fs/u-boot/drivers/mtd/onenand/ |
| H A D | onenand_base.c | 2 * linux/drivers/mtd/onenand/onenand_base.c 25 #include <linux/mtd/mtd.h> 26 #include "linux/mtd/flashchip.h" 27 #include <linux/mtd/onenand.h> 290 * @param mtd MTD device structure 293 int flexonenand_region(struct mtd_info *mtd, loff_t addr) in flexonenand_region() argument 297 for (i = 0; i < mtd->numeraseregions; i++) in flexonenand_region() 298 if (addr < mtd->eraseregions[i].offset) in flexonenand_region() 317 * @param mtd MTD device structure 325 static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, in onenand_command() argument [all …]
|
| /OK3568_Linux_fs/u-boot/cmd/ |
| H A D | mtd.c | 3 * mtd.c 14 #include <mtd.h> 20 static uint mtd_len_to_pages(struct mtd_info *mtd, u64 len) in mtd_len_to_pages() argument 22 do_div(len, mtd->writesize); in mtd_len_to_pages() 27 static bool mtd_is_aligned_with_min_io_size(struct mtd_info *mtd, u64 size) in mtd_is_aligned_with_min_io_size() argument 29 return !do_div(size, mtd->writesize); in mtd_is_aligned_with_min_io_size() 32 static bool mtd_is_aligned_with_block_size(struct mtd_info *mtd, u64 size) in mtd_is_aligned_with_block_size() argument 34 return !do_div(size, mtd->erasesize); in mtd_is_aligned_with_block_size() 54 static void mtd_dump_device_buf(struct mtd_info *mtd, u64 start_off, in mtd_dump_device_buf() argument 57 bool has_pages = mtd->type == MTD_NANDFLASH || in mtd_dump_device_buf() [all …]
|
| /OK3568_Linux_fs/u-boot/spl/drivers/mtd/ |
| H A D | mtdcore.su | |
| H A D | mtdpart.su | |
| /OK3568_Linux_fs/kernel/drivers/rkflash/ |
| H A D | sfc_nand_mtd.c | 6 #include <linux/mtd/cfi.h> 7 #include <linux/mtd/mtd.h> 8 #include <linux/mtd/partitions.h> 24 offsetof(struct snand_mtd_dev, mtd)); in mtd_to_priv() 27 int sfc_nand_erase_mtd(struct mtd_info *mtd, u32 addr) in sfc_nand_erase_mtd() argument 31 ret = sfc_nand_erase_block(0, addr >> mtd->writesize_shift); in sfc_nand_erase_mtd() 40 static int sfc_nand_write_mtd(struct mtd_info *mtd, loff_t to, in sfc_nand_write_mtd() argument 43 struct snand_mtd_dev *p_dev = mtd_to_priv(mtd); in sfc_nand_write_mtd() 49 if ((to + remaining) > mtd->size || to & mtd->writesize_mask || in sfc_nand_write_mtd() 50 remaining & mtd->writesize_mask || ops->ooblen) { in sfc_nand_write_mtd() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/mtd/ubi/ |
| H A 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 …]
|
| /OK3568_Linux_fs/kernel/drivers/mtd/nand/raw/ |
| H A 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 …]
|
| /OK3568_Linux_fs/kernel/Documentation/ABI/testing/ |
| H A 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 …]
|