| /kernel/linux/linux-5.10/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/drivers/mtd/spi-nor/ |
| D | core.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 86 * struct spi_nor_erase_type - Structure to describe a SPI NOR erase type 87 * @size: the size of the sector/block erased by the erase type. 88 * JEDEC JESD216B imposes erase sizes to be a power of 2. 89 * @size_shift: @size is a power of 2, the shift is stored in 91 * @size_mask: the size mask based on @size_shift. 92 * @opcode: the SPI command op code to erase the sector/block. 93 * @idx: Erase Type index as sorted in the Basic Flash Parameter 95 * Erase Types with the ones identified in the SFDP 99 u32 size; member [all …]
|
| D | sfdp.c | 1 // SPDX-License-Identifier: GPL-2.0 9 #include <linux/mtd/spi-nor.h> 13 #define SFDP_PARAM_HEADER_ID(p) (((p)->id_msb << 8) | (p)->id_lsb) 15 (((p)->parameter_table_pointer[2] << 16) | \ 16 ((p)->parameter_table_pointer[1] << 8) | \ 17 ((p)->parameter_table_pointer[0] << 0)) 21 #define SFDP_4BAIT_ID 0xff84 /* 4-byte Address Instruction Table */ 29 u8 nph; /* 0-base number of parameter headers */ 38 /* The Fast Read x-y-z hardware capability in params->hwcaps.mask. */ 43 * whether the Fast Read x-y-z command is supported. [all …]
|
| D | core.c | 1 // SPDX-License-Identifier: GPL-2.0 23 #include <linux/mtd/spi-nor.h> 30 * For everything but full-chip erase; probably could be much smaller, but kept 36 * For full-chip erase, calibrated to a 2MB flash (M25P16); should be scaled up 44 * spi_nor_spimem_bounce() - check if a bounce buffer is needed for the data 55 /* op->data.buf.in occupies the same memory as op->data.buf.out */ in spi_nor_spimem_bounce() 56 if (object_is_on_stack(op->data.buf.in) || in spi_nor_spimem_bounce() 57 !virt_addr_valid(op->data.buf.in)) { in spi_nor_spimem_bounce() 58 if (op->data.nbytes > nor->bouncebuf_size) in spi_nor_spimem_bounce() 59 op->data.nbytes = nor->bouncebuf_size; in spi_nor_spimem_bounce() [all …]
|
| /kernel/linux/linux-5.10/drivers/mtd/ |
| D | mtdconcat.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Copyright © 2002-2010 David Woodhouse <dwmw2@infradead.org> 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 <dwmw2@infradead.org> 6 * Copyright © 2000-2003 Nicolas Pitre <nico@fluxnic.net> 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 …]
|
| /kernel/linux/linux-6.6/drivers/mtd/ |
| D | mtdconcat.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Copyright © 2002-2010 David Woodhouse <dwmw2@infradead.org> 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 <dwmw2@infradead.org> 6 * Copyright © 2000-2003 Nicolas Pitre <nico@fluxnic.net> 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 …]
|
| /kernel/linux/linux-6.6/drivers/mtd/spi-nor/ |
| 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.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 195 * struct spi_nor_erase_type - Structure to describe a SPI NOR erase type 196 * @size: the size of the sector/block erased by the erase type. 197 * JEDEC JESD216B imposes erase sizes to be a power of 2. 198 * @size_shift: @size is a power of 2, the shift is stored in 200 * @size_mask: the size mask based on @size_shift. 201 * @opcode: the SPI command op code to erase the sector/block. 202 * @idx: Erase Type index as sorted in the Basic Flash Parameter 204 * Erase Types with the ones identified in the SFDP 208 u32 size; member [all …]
|
| D | core.c | 1 // SPDX-License-Identifier: GPL-2.0 17 #include <linux/mtd/spi-nor.h> 30 * For everything but full-chip erase; probably could be much smaller, but kept 36 * For full-chip erase, calibrated to a 2MB flash (M25P16); should be scaled up 47 * spi_nor_get_cmd_ext() - Get the command opcode extension based on the 60 switch (nor->cmd_ext_type) { in spi_nor_get_cmd_ext() 62 return ~op->cmd.opcode; in spi_nor_get_cmd_ext() 65 return op->cmd.opcode; in spi_nor_get_cmd_ext() 68 dev_err(nor->dev, "Unknown command extension type\n"); in spi_nor_get_cmd_ext() 74 * spi_nor_spimem_setup_op() - Set up common properties of a spi-mem op. [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/drivers/mtd/chips/ |
| D | cfi_util.c | 45 unsigned type = cfi->device_type; in cfi_build_cmd_addr() 89 /* First, determine what the bit-pattern should be for a single in cfi_build_cmd() 104 /* Now replicate it across the size of an unsigned long, or in cfi_build_cmd() 123 /* And finally, for the multi-word case, replicate it in cfi_build_cmd() 179 /* Last, determine what the bit-pattern should be for a single in cfi_merge_status() 200 * If prev_val is non-null, it will be set to the value at the command address, 216 return addr - base; in cfi_send_gen_cmd() 223 int osf = cfi->interleave * cfi->device_type; /* scale factor */ in cfi_qry_present() 251 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); in cfi_qry_mode_on() 252 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); in cfi_qry_mode_on() [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/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 …]
|
| D | lart.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART. 13 * - Order Number: 290644-005 14 * - January 2000 17 * - http://www.linux-mtd.infradead.org/ 70 #define BUSWIDTH 4 /* don't change this - a lot of the code _will_ break if you change this */ 71 #define FLASH_OFFSET 0xe8000000 /* see linux/arch/arm/mach-sa1100/lart.c */ 93 #define ERASE_SETUP 0x00200020 /* Block Erase */ 94 #define ERASE_CONFIRM 0x00D000D0 /* Block Erase and Program Resume */ 99 #define STATUS_ERASE_ERR 0x00200020 /* Erase Status (ES) */ [all …]
|
| /kernel/linux/linux-6.6/drivers/misc/eeprom/ |
| D | eeprom_93xx46.c | 1 // SPDX-License-Identifier: GPL-2.0-only 20 #include <linux/nvmem-provider.h> 65 int size; member 70 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_SINGLE_WORD_READ; in has_quirk_single_word_read() 75 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH; in has_quirk_instruction_length() 80 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE; in has_quirk_extra_read_cycle() 91 if (unlikely(off >= edev->size)) in eeprom_93xx46_read() 93 if ((off + count) > edev->size) in eeprom_93xx46_read() 94 count = edev->size - off; in eeprom_93xx46_read() 98 mutex_lock(&edev->lock); in eeprom_93xx46_read() [all …]
|
| /kernel/linux/linux-5.10/drivers/misc/eeprom/ |
| D | eeprom_93xx46.c | 1 // SPDX-License-Identifier: GPL-2.0-only 19 #include <linux/nvmem-provider.h> 49 int size; member 54 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_SINGLE_WORD_READ; in has_quirk_single_word_read() 59 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH; in has_quirk_instruction_length() 64 return edev->pdata->quirks & EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE; in has_quirk_extra_read_cycle() 74 if (unlikely(off >= edev->size)) in eeprom_93xx46_read() 76 if ((off + count) > edev->size) in eeprom_93xx46_read() 77 count = edev->size - off; in eeprom_93xx46_read() 81 mutex_lock(&edev->lock); in eeprom_93xx46_read() [all …]
|
| /kernel/linux/linux-5.10/include/linux/mtd/ |
| D | spi-nor.h | 1 /* SPDX-License-Identifier: GPL-2.0+ */ 12 #include <linux/spi/spi-mem.h> 19 * requires a 4-byte (32-bit) address. 42 #define SPINOR_OP_BE_4K 0x20 /* Erase 4KiB block */ 43 #define SPINOR_OP_BE_4K_PMC 0xd7 /* Erase 4KiB block on PMC chips */ 44 #define SPINOR_OP_BE_32K 0x52 /* Erase 32KiB block */ 45 #define SPINOR_OP_CHIP_ERASE 0xc7 /* Erase whole flash chip */ 46 #define SPINOR_OP_SE 0xd8 /* Sector erase (usually 64KiB) */ 55 /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */ 69 #define SPINOR_OP_BE_4K_4B 0x21 /* Erase 4KiB block */ [all …]
|
| /kernel/linux/linux-6.6/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 …]
|