/linux-6.14.4/Documentation/driver-api/mmc/ |
D | mmc-dev-attrs.rst | 11 force_ro Enforce read-only access even if write protect switch is off. 17 All attributes are read-only. 34 erase_size Erase group size 35 preferred_erase_size Preferred erase size 36 raw_rpmb_size_mult RPMB partition size 45 Note on Erase Size and Preferred Erase Size: 47 "erase_size" is the minimum size, in bytes, of an erase 48 operation. For MMC, "erase_size" is the erase group size 50 to trim or secure trim operations where the minimum size is 52 if the card is block-addressed, 0 otherwise. [all …]
|
/linux-6.14.4/drivers/mtd/ |
D | mtdconcat.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Copyright © 2002-2010 David Woodhouse <[email protected]> 16 #include <linux/backing-dev.h> 36 * how to calculate the size required for the above structure, 61 for (i = 0; i < concat->num_subdev; i++) { in concat_read() 62 struct mtd_info *subdev = concat->subdev[i]; in concat_read() 63 size_t size, retsize; in concat_read() local 65 if (from >= subdev->size) { in concat_read() 67 size = 0; in concat_read() 68 from -= subdev->size; in concat_read() [all …]
|
D | mtdpstore.c | 1 // SPDX-License-Identifier: GPL-2.0 3 #define dev_fmt(fmt) "mtdoops-pstore: " fmt 30 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_isbad() 33 off = ALIGN_DOWN(off, mtd->erasesize); in mtdpstore_block_isbad() 34 blknum = div_u64(off, mtd->erasesize); in mtdpstore_block_isbad() 36 if (test_bit(blknum, cxt->badmap)) in mtdpstore_block_isbad() 40 dev_err(&mtd->dev, "mtd_block_isbad failed, aborting\n"); in mtdpstore_block_isbad() 43 set_bit(blknum, cxt->badmap); in mtdpstore_block_isbad() 52 struct mtd_info *mtd = cxt->mtd; in mtdpstore_panic_block_isbad() 55 off = ALIGN_DOWN(off, mtd->erasesize); in mtdpstore_panic_block_isbad() [all …]
|
D | mtdblock.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright © 1999-2010 David Woodhouse <[email protected]> 6 * Copyright © 2000-2003 Nicolas Pitre <[email protected]> 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 47 struct erase_info erase; in erase_write() local 52 * First, let's erase the flash block. in erase_write() 54 erase.addr = pos; in erase_write() 55 erase.len = len; in erase_write() 57 ret = mtd_erase(mtd, &erase); in erase_write() [all …]
|
D | mtdoops.c | 1 // SPDX-License-Identifier: GPL-2.0-only 25 /* Maximum MTD partition size */ 31 "record size for MTD OOPS pages in bytes (default 4096)"); 70 set_bit(page, cxt->oops_page_used); in mark_page_used() 75 clear_bit(page, cxt->oops_page_used); in mark_page_unused() 80 return test_bit(page, cxt->oops_page_used); in page_is_used() 85 struct mtd_info *mtd = cxt->mtd; in mtdoops_erase_block() 86 u32 start_page_offset = mtd_div_by_eb(offset, mtd) * mtd->erasesize; in mtdoops_erase_block() 88 u32 erase_pages = mtd->erasesize / record_size; in mtdoops_erase_block() 89 struct erase_info erase; in mtdoops_erase_block() local [all …]
|
D | rfd_ftl.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * rfd_ftl.c -- resident flash disk (flash translation layer) 28 MODULE_PARM_DESC(block_size, "Block size to use by RFD, defaults to erase unit size"); 40 /* An erase unit should start with this value */ 74 u_int block_size; /* size of erase unit */ 75 u_int total_blocks; /* number of erase units */ 76 u_int header_sectors_per_block; /* header sectors in erase unit */ 77 u_int data_sectors_per_block; /* data sectors in erase unit */ 95 struct block *block = &part->blocks[block_no]; in build_block_map() 98 block->offset = part->block_size * block_no; in build_block_map() [all …]
|
D | mtdswap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 11 * support and lock-less operation written by Adrian Hunter. 45 * Frequency value 6 means 1/6 of the GC passes will pick an erase block based 48 * The lower freq2 should be chosen so that it makes sure the maximum erase 50 * trying to make erase differences large. 59 #define BLOCK_ERROR (UINT_MAX - 1) 60 #define BLOCK_MAX (UINT_MAX - 2) 80 rb)->erase_count) 82 rb)->erase_count) 141 #define MTDSWAP_ERASE_RETRIES 3 /* Before marking erase block bad */ [all …]
|
/linux-6.14.4/drivers/mtd/spi-nor/ |
D | core.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 15 * have the page size defined within their SFDP tables. 203 * struct spi_nor_erase_type - Structure to describe a SPI NOR erase type 204 * @size: the size of the sector/block erased by the erase type. 205 * JEDEC JESD216B imposes erase sizes to be a power of 2. 206 * @size_shift: @size is a power of 2, the shift is stored in 208 * @size_mask: the size mask based on @size_shift. 209 * @opcode: the SPI command op code to erase the sector/block. 210 * @idx: Erase Type index as sorted in the Basic Flash Parameter 212 * Erase Types with the ones identified in the SFDP [all …]
|
D | sfdp.c | 1 // SPDX-License-Identifier: GPL-2.0 8 #include <linux/mtd/spi-nor.h> 14 #define SFDP_PARAM_HEADER_ID(p) (((p)->id_msb << 8) | (p)->id_lsb) 16 (((p)->parameter_table_pointer[2] << 16) | \ 17 ((p)->parameter_table_pointer[1] << 8) | \ 18 ((p)->parameter_table_pointer[0] << 0)) 19 #define SFDP_PARAM_HEADER_PARAM_LEN(p) ((p)->length * 4) 23 #define SFDP_4BAIT_ID 0xff84 /* 4-byte Address Instruction Table */ 31 * Register Map Offsets for Multi-Chip 41 u8 nph; /* 0-base number of parameter headers */ [all …]
|
D | core.c | 1 // SPDX-License-Identifier: GPL-2.0 17 #include <linux/mtd/spi-nor.h> 31 * For everything but full-chip erase; probably could be much smaller, but kept 37 * For full-chip erase, calibrated to a 2MB flash (M25P16); should be scaled up 48 * spi_nor_get_cmd_ext() - Get the command opcode extension based on the 61 switch (nor->cmd_ext_type) { in spi_nor_get_cmd_ext() 63 return ~op->cmd.opcode; in spi_nor_get_cmd_ext() 66 return op->cmd.opcode; in spi_nor_get_cmd_ext() 69 dev_err(nor->dev, "Unknown command extension type\n"); in spi_nor_get_cmd_ext() 75 * spi_nor_spimem_setup_op() - Set up common properties of a spi-mem op. [all …]
|
D | micron-st.c | 1 // SPDX-License-Identifier: GPL-2.0 7 #include <linux/mtd/spi-nor.h> 14 #define SPINOR_OP_MT_DIE_ERASE 0xc4 /* Chip (die) erase opcode */ 28 #define FSR_E_ERR BIT(5) /* Erase operation status */ 54 u8 *buf = nor->bouncebuf; in micron_st_nor_octal_dtr_en() 56 u8 addr_mode_nbytes = nor->params->addr_mode_nbytes; in micron_st_nor_octal_dtr_en() 63 ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); in micron_st_nor_octal_dtr_en() 71 ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); in micron_st_nor_octal_dtr_en() 78 dev_dbg(nor->dev, "error %d reading JEDEC ID after enabling 8D-8D-8D mode\n", ret); in micron_st_nor_octal_dtr_en() 82 if (memcmp(buf, nor->info->id->bytes, nor->info->id->len)) in micron_st_nor_octal_dtr_en() [all …]
|
/linux-6.14.4/drivers/net/wwan/iosm/ |
D | iosm_ipc_flash.h | 1 /* SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2020-2021 Intel Corporation. 9 /* Buffer size used to read the fls image */ 11 /* Full erase start address */ 13 /* Erase length for NAND flash */ 15 /* EBL response Header size */ 17 /* EBL payload size */ 19 /* Total EBL pack size */ 21 /* EBL payload size */ 23 /* Total EBL pack size */ [all …]
|
D | iosm_ipc_flash.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2020-2021 Intel Corporation. 21 return -EINVAL; in ipc_flash_proc_format_ebl_pack() 23 flash_req->pack_id = cpu_to_le16(pack_id); in ipc_flash_proc_format_ebl_pack() 24 flash_req->msg_length = cpu_to_le32(payload_length); in ipc_flash_proc_format_ebl_pack() 31 flash_req->checksum = cpu_to_le16(checksum); in ipc_flash_proc_format_ebl_pack() 47 if (!err_info->error[i].error_code) { in ipc_flash_proc_check_ebl_rsp() 49 err_info->error[i].error_class, in ipc_flash_proc_check_ebl_rsp() 50 err_info->error[i].error_code); in ipc_flash_proc_check_ebl_rsp() 53 return -EINVAL; in ipc_flash_proc_check_ebl_rsp() [all …]
|
D | iosm_ipc_devlink.h | 1 /* SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2020-2021 Intel Corporation. 23 /* Reserve header size */ 25 /* Devlink Image Header size */ 29 /* EBL response size */ 35 /* Default Coredump file size */ 44 * enum iosm_devlink_param_id - Enum type to different devlink params 46 * @IOSM_DEVLINK_PARAM_ID_ERASE_FULL_FLASH: Set if full erase required 55 * enum iosm_rpsi_cmd_code - Enum type for RPSI command list 58 * file size info from PSI [all …]
|
/linux-6.14.4/drivers/mtd/chips/ |
D | cfi_util.c | 1 // SPDX-License-Identifier: GPL-2.0 44 unsigned type = cfi->device_type; in cfi_build_cmd_addr() 88 /* First, determine what the bit-pattern should be for a single in cfi_build_cmd() 103 /* Now replicate it across the size of an unsigned long, or in cfi_build_cmd() 122 /* And finally, for the multi-word case, replicate it in cfi_build_cmd() 178 /* Last, determine what the bit-pattern should be for a single in cfi_merge_status() 199 * If prev_val is non-null, it will be set to the value at the command address, 215 return addr - base; in cfi_send_gen_cmd() 222 int osf = cfi->interleave * cfi->device_type; /* scale factor */ in cfi_qry_present() 250 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); in cfi_qry_mode_on() [all …]
|
D | cfi_cmdset_0020.c | 1 // SPDX-License-Identifier: GPL-2.0 9 * - completely revamped method functions so they are aware and 11 * - scalability vs code size is completely set at compile-time 13 * - optimized write buffer method 14 * 06/21/2002 Joern Engel <[email protected]-wedel.de> and others 15 * - modified Intel Command Set 0x0001 to support ST Advanced Architecture 17 * - added a writev function 18 * 07/13/2005 Joern Engel <[email protected]-wedel.de> 19 * - Plugged memory leak in cfi_staa_writev(). 69 printk(" Feature/Command Support: %4.4X\n", extp->FeatureSupport); in cfi_tell_features() [all …]
|
/linux-6.14.4/Documentation/driver-api/mtd/ |
D | spi-nor.rst | 6 ----------------------------------- 11 standard set of internal read-only parameter tables. 17 on its SFDP data. All one has to do is to specify the "jedec,spi-nor" 28 ----------------------------- 31 section, after the ``---`` marker. 41 root@1:~# cat /sys/bus/spi/devices/spi0.0/spi-nor/partname 43 root@1:~# cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id 45 root@1:~# cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer 47 root@1:~# xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 69 root@1:~# sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp [all …]
|
/linux-6.14.4/include/uapi/mtd/ |
D | ubi-user.h | 1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 33 * &struct ubi_attach_req object - UBI will attach the MTD device specified in 54 * device should be used. A pointer to the 32-bit volume ID hast to be passed 57 * UBI volume re-size 60 * To re-size a volume, the %UBI_IOCRSVOL ioctl command of the UBI character 64 * UBI volumes re-name 67 * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command 75 * corresponding UBI volume character device. A pointer to a 64-bit update 76 * size should be passed to the ioctl. After this, UBI expects user to write [all …]
|
/linux-6.14.4/drivers/mtd/devices/ |
D | powernv_flash.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 42 * Don't return -ERESTARTSYS if we can't get a token, the MTD core 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() 60 if (token != -ERESTARTSYS) in powernv_flash_async_op() 63 token = -EINTR; in powernv_flash_async_op() 69 rc = opal_flash_read(info->id, offset, __pa(buf), len, token); in powernv_flash_async_op() 72 rc = opal_flash_write(info->id, offset, __pa(buf), len, token); in powernv_flash_async_op() 75 rc = opal_flash_erase(info->id, offset, len, token); in powernv_flash_async_op() 80 return -EIO; in powernv_flash_async_op() [all …]
|
/linux-6.14.4/drivers/misc/eeprom/ |
D | eeprom_93xx46.c | 1 // SPDX-License-Identifier: GPL-2.0-only 23 #include <linux/nvmem-provider.h> 87 int size; member 92 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_SINGLE_WORD_READ; in has_quirk_single_word_read() 97 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH; in has_quirk_instruction_length() 102 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE; in has_quirk_extra_read_cycle() 113 if (unlikely(off >= edev->size)) in eeprom_93xx46_read() 115 if ((off + count) > edev->size) in eeprom_93xx46_read() 116 count = edev->size - off; in eeprom_93xx46_read() 120 mutex_lock(&edev->lock); in eeprom_93xx46_read() [all …]
|
/linux-6.14.4/drivers/firmware/microchip/ |
D | mpfs-auto-update.c | 1 // SPDX-License-Identifier: GPL-2.0 8 * Copyright (c) 2022-2023 Microchip Corporation. All rights reserved. 44 * |------------------------------| 0x0000000 47 * |------------------------------| 0x0000400 51 * |------------------------------| 0x0100400 54 * |------------------------------| 0x1500400 57 * |------------------------------| 0x2900400 59 * | Reserved for multi-image IAP | 61 * |------------------------------| 0x3D00400 64 * |------------------------------| 0x? [all …]
|
/linux-6.14.4/include/linux/ |
D | pstore_zone.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 12 * struct pstore_zone_info - pstore/zone back-end driver structure 14 * @owner: Module which is responsible for this back-end driver. 15 * @name: Name of the back-end driver. 16 * @total_size: The total size in bytes pstore/zone can use. It must be greater 18 * @kmsg_size: The size of oops/panic zone. Zero means disabled, otherwise, 21 * @pmsg_size: The size of pmsg zone which is the same as @kmsg_size. 22 * @console_size:The size of console zone which is the same as @kmsg_size. 23 * @ftrace_size:The size of ftrace zone which is the same as @kmsg_size. 25 * @size and @offset are relative value to storage. [all …]
|
/linux-6.14.4/drivers/mtd/ubi/ |
D | ubi-media.h | 1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ 10 * This file defines the layout of UBI headers and all the other UBI on-flash 22 /* The highest erase counter value supported by this implementation */ 28 /* Erase counter header magic number (ASCII "UBI#") */ 47 * @UBI_VTBL_AUTORESIZE_FLG: auto-resize this volume 51 * check. Main use-case for this flag is 52 * boot-time reduction 55 * table. UBI automatically re-sizes the volume which has this flag and makes 56 * the volume to be of largest possible size. This means that if after the 66 * The auto-resize feature is useful for device production purposes. For [all …]
|
/linux-6.14.4/include/linux/mtd/ |
D | qinfo.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 14 * @ManufactId - Chip Manufacture ID 15 * @DevId - Chip Device ID 16 * @qinfo - pointer to qinfo records describing the chip 17 * @numchips - number of chips including virual RWW partitions 18 * @chipshift - Chip/partition size 2^chipshift 19 * @chips - per-chip data structure 32 * @major - major number of qinfo record 33 * @major - minor number of qinfo record 34 * @id_str - descriptive string to access the record [all …]
|
/linux-6.14.4/include/uapi/linux/ |
D | virtio_blk.h | 34 #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ 37 #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ 38 #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ 43 #define VIRTIO_BLK_F_SECURE_ERASE 16 /* Secure Erase is supported */ 61 /* The capacity (in 512-byte sectors). */ 63 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ 74 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ 82 /* minimum I/O size without performance penalty in logical blocks. */ 84 /* optimal sustained I/O size in logical blocks. */ 96 * The maximum discard sectors (in 512-byte sectors) for [all …]
|