/openbmc/u-boot/drivers/mtd/ |
H A D | mtdconcat.c | 1 // SPDX-License-Identifier: GPL-2.0+ 6 * Copyright © 2002-2010 David Woodhouse <dwmw2@infradead.org> 18 #include <linux/backing-dev.h> 43 * how to calculate the size required for the above structure, 72 for (i = 0; i < concat->num_subdev; i++) { in concat_read() 73 struct mtd_info *subdev = concat->subdev[i]; in concat_read() 74 size_t size, retsize; in concat_read() local 76 if (from >= subdev->size) { in concat_read() 78 size = 0; in concat_read() 79 from -= subdev->size; in concat_read() [all …]
|
H A D | pic32_flash.c | 1 // SPDX-License-Identifier: GPL-2.0+ 52 writel(nvmop, &nvm_regs_p->ctrl.raw); in flash_initiate_operation() 55 writel(NVM_WREN, &nvm_regs_p->ctrl.set); in flash_initiate_operation() 58 writel(LOCK_KEY, &nvm_regs_p->key.raw); in flash_initiate_operation() 59 writel(UNLOCK_KEY1, &nvm_regs_p->key.raw); in flash_initiate_operation() 60 writel(UNLOCK_KEY2, &nvm_regs_p->key.raw); in flash_initiate_operation() 63 writel(NVM_WR, &nvm_regs_p->ctrl.set); in flash_initiate_operation() 68 int ret = wait_for_bit_le32(&nvm_regs_p->ctrl.raw, in flash_wait_till_busy() 78 tmp = readl(&nvm_regs_p->ctrl.raw); in flash_complete_operation() 80 printf("Error in Block Erase - Lock Bit may be set!\n"); in flash_complete_operation() [all …]
|
/openbmc/linux/Documentation/driver-api/mmc/ |
H A 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 …]
|
/openbmc/linux/drivers/mtd/ |
H A 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 …]
|
H A 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 …]
|
/openbmc/linux/drivers/mtd/spi-nor/ |
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
/openbmc/phosphor-mboxd/ |
H A D | mboxd_flash.c | 1 // SPDX-License-Identifier: Apache-2.0 27 #include <mtd/mtd-abi.h> 40 return -1; in init_flash_dev() 50 rc = -errno; in init_flash_dev() 53 context->fds[MTD_FD].fd = fd; in init_flash_dev() 56 if (ioctl(fd, MEMGETINFO, &context->mtd_info) == -1) { in init_flash_dev() 59 rc = -1; in init_flash_dev() 63 if (context->flash_size == 0) { in init_flash_dev() 69 * it is required that the image size be used for in init_flash_dev() 70 * context->flash_size, and not the size of the flash device. in init_flash_dev() [all …]
|
H A D | mboxd_windows.c | 1 // SPDX-License-Identifier: Apache-2.0 26 #include <mtd/mtd-abi.h> 37 * init_window_state() - Initialise a new window to a known state 39 * @size: The size of the window 41 static void init_window_state(struct window_context *window, uint32_t size) in init_window_state() argument 43 window->mem = NULL; in init_window_state() 44 window->flash_offset = FLASH_OFFSET_UNINIT; in init_window_state() 45 window->size = size; in init_window_state() 46 window->dirty_bmap = NULL; in init_window_state() 47 window->age = 0; in init_window_state() [all …]
|
/openbmc/hiomapd/mtd/ |
H A D | backend.c | 1 // SPDX-License-Identifier: Apache-2.0 11 #include <mtd/mtd-abi.h> 35 #pragma GCC diagnostic ignored "-Wpointer-arith" 50 rc = -errno; in mtd_dev_init() 56 priv->fd = open(path, O_RDWR); in mtd_dev_init() 57 if (priv->fd < 0) { in mtd_dev_init() 60 rc = -errno; in mtd_dev_init() 65 if (ioctl(priv->fd, MEMGETINFO, &priv->mtd_info) == -1) { in mtd_dev_init() 66 rc = -errno; in mtd_dev_init() 67 close(priv->fd); in mtd_dev_init() [all …]
|
/openbmc/linux/drivers/net/wwan/iosm/ |
H A 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 …]
|
/openbmc/u-boot/include/ |
H A D | ubispl.h | 1 /* SPDX-License-Identifier: GPL 2.0+ OR BSD-3-Clause */ 13 * Defines the maximum number of logical erase blocks per loadable 14 * (static) volume to size the ubispl internal arrays. 18 * Defines the maximum physical erase block size to size the fastmap 23 * Define the maximum number of physical erase blocks to size the 32 * loaded in the above example are ids 0 - 7 47 * struct ubispl_info - description structure for fast ubi scan 49 * @peb_size: Physical erase block size 51 * @leb_start: Start of the logical erase block, i.e. offset of data 52 * @peb_count: Number of physical erase blocks in the UBI FLASH area [all …]
|
/openbmc/u-boot/doc/ |
H A D | README.nand | 1 # SPDX-License-Identifier: GPL-2.0+ 21 nand erase off|partition size 22 nand erase clean [off|partition size] 23 Erase `size' bytes starting at offset `off'. Alternatively partition 24 name can be specified, in this case size will be eventually limited 25 to not exceed partition size (this behaviour applies also to read 26 and write commands). Only complete erase blocks can be erased. 28 If `erase' is specified without an offset or size, the entire flash 29 is erased. If `erase' is specified with partition but without an 30 size, the entire partition is erased. [all …]
|
/openbmc/estoraged/include/ |
H A D | verifyDriveGeometry.hpp | 3 #include "erase.hpp" 11 class VerifyDriveGeometry : public Erase 14 /** @brief Creates a verifyDriveGeomentry erase object. 16 * @param[in] inDevPath - the linux device path for the block device. 18 VerifyDriveGeometry(std::string_view inDevPath) : Erase(inDevPath) {} in VerifyDriveGeometry() 23 * @param[in] eraseMaxGeometry - the max expected size to erase. 24 * @param[in] eraseMinGeometry - the min expected size to erase. 25 * @param[in] bytes - Size of the block device.
|
/openbmc/hiomapd/ |
H A D | backend.h | 1 /* SPDX-License-Identifier: Apache-2.0 */ 13 #include <mtd/mtd-abi.h> 31 /* Flash size from command line (bytes) */ 34 /* Erase size (as a shift) */ 36 /* Block size (as a shift) */ 42 * init() - Main initialization function for backing device 44 * @data: Additional backend-implementation-specifc data 50 * free() - Main teardown function for backing device 56 * copy() - Copy data from the flash device into a provided buffer 59 * @mem: The buffer to copy into (must be of atleast 'size' bytes) [all …]
|
/openbmc/qemu/hw/block/ |
H A D | pflash_cfi02.c | 23 * - flash read 24 * - flash write 25 * - flash ID read 26 * - sector erase 27 * - chip erase 28 * - unlock bypass command 29 * - CFI queries 38 #include "hw/qdev-properties.h" 39 #include "hw/qdev-properties-system.h" 41 #include "qemu/error-report.h" [all …]
|
/openbmc/hiomapd/file/ |
H A D | backend.c | 1 // SPDX-License-Identifier: Apache-2.0 12 #include <mtd/mtd-abi.h> 39 #pragma GCC diagnostic ignored "-Wpointer-arith" 55 return -EINVAL; in file_dev_init() 60 return -errno; in file_dev_init() 64 priv->fd = open(path, O_RDWR); in file_dev_init() 65 if (priv->fd < 0) { in file_dev_init() 68 rc = -errno; in file_dev_init() 73 rc = ioctl(priv->fd, MEMGETINFO, &info); in file_dev_init() 74 if (rc != -1) { in file_dev_init() [all …]
|
/openbmc/u-boot/doc/SPI/ |
H A D | README.ti_qspi_dra_test | 1 ------------------------------------------------- 2 Simple steps used to test the QSPI at U-Boot 3 ------------------------------------------------- 5 For #1, build the patched U-Boot and load MLO/u-boot.img 7 ---------------------------------- 9 ---------------------------------- 11 U-Boot# mmc dev 0 13 U-Boot# fatload mmc 0 0x82000000 MLO 16 U-Boot# fatload mmc 0 0x83000000 u-boot.img 17 reading u-boot.img [all …]
|
/openbmc/u-boot/arch/arm/cpu/armv8/fsl-layerscape/doc/ |
H A D | README.qspi | 2 ------------------- 15 ------------------- 16 Booting from QSPI requires two images, RCW and u-boot-dtb.bin. 19 to the address for u-boot in QSPI flash. 22 Example of using u-boot command 25 SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB 26 => sf erase 0 +<size of rcw image> 28 => sf write <rcw image in memory> 0 <size of rcw image> 31 To get the QSPI image, build u-boot with QSPI config, for example, 32 <board_name>_qspi_defconfig. The image needed is u-boot-dtb.bin. [all …]
|
/openbmc/u-boot/test/py/tests/ |
H A D | test_sf.py | 1 # SPDX-License-Identifier: GPL-2.0 31 # If present, specifies the size to use for read/write operations. 32 # If missing, the SPI Flash page size is used as a default (based on 51 u_boot_console: A U-Boot console connection. 75 m = re.search('page size (.+?) Bytes', output) 76 assert m, 'SPI Flash page size not recognized' 79 m = re.search('erase size (.+?) KiB', output) 80 assert m, 'SPI Flash erase size not recognized' 85 assert m, 'SPI Flash total size not recognized' 94 'offset not multiple of erase size.' [all …]
|
/openbmc/qemu/hw/nvram/ |
H A D | eeprom93xx.c | 4 * Copyright (c) 2006-2007 Stefan Weil 21 * NMC93C06 256-Bit (16 x 16) 22 * NMC93C46 1024-Bit (64 x 16) 28 * eeprom93xx_new - add a new EEPROM (with 16, 64 or 256 words) 29 * eeprom93xx_free - destroy EEPROM 30 * eeprom93xx_read - read data from the EEPROM 31 * eeprom93xx_write - write data to the EEPROM 32 * eeprom93xx_data - get EEPROM data array for external manipulation 35 * - No emulation of EEPROM timings. 40 #include "migration/qemu-file-types.h" [all …]
|
/openbmc/u-boot/drivers/mtd/nand/raw/ |
H A D | nand_util.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2006 by Weiss-Electronic GmbH. 10 * @references: borrowed heavily from Linux mtd-utils code: 16 * Artem Bityutskiy <dedekind1@gmail.com> from mtd-utils 41 * nand_erase_opts: - erase NAND flash with support for various options 44 * @param mtd nand mtd instance to erase 55 erase_info_t erase; in nand_erase_opts() local 58 int percent_complete = -1; in nand_erase_opts() 59 const char *mtd_device = mtd->name; in nand_erase_opts() 63 if ((opts->offset & (mtd->erasesize - 1)) != 0) { in nand_erase_opts() [all …]
|
/openbmc/linux/drivers/mtd/chips/ |
H A 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 …]
|
/openbmc/linux/drivers/mtd/devices/ |
H A 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 …]
|