/linux/drivers/mtd/ubi/ |
H A D | vtbl.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 10 * This file includes volume table manipulation code. The volume table is an 11 * on-flash table containing volume meta-data like name, number of reserved 12 * physical eraseblocks, type, etc. The volume table is stored in the so-called 13 * "layout volume". 15 * The layout volume is an internal volume which is organized as follows. It 16 * consists of two logical eraseblocks - LEB 0 and LEB 1. Each logical 17 * eraseblock stores one volume table copy, i.e. LEB 0 and LEB 1 duplicate each 18 * other. This redundancy guarantees robustness to unclean reboots. The volume 19 * table is basically an array of volume table records. Each record contains [all …]
|
H A D | vmt.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 9 * This file contains implementation of volume creation, deletion, updating and 17 #include "ubi.h" 19 static int self_check_volumes(struct ubi_device *ubi); 24 /* Device attributes corresponding to files in '/<sysfs>/class/ubi/ubiX_Y' */ 43 * "Show" method for files in '/<sysfs>/class/ubi/ubiX_Y/'. 46 * A. process 1 opens a sysfs file related to volume Y, say 47 * /<sysfs>/class/ubi/ubiX_Y/reserved_ebs; 48 * B. process 2 removes volume Y; 49 * C. process 1 starts reading the /<sysfs>/class/ubi/ubiX_Y/reserved_ebs file; [all …]
|
H A D | kapi.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 /* This file mostly implements UBI kernel API functions */ 16 #include "ubi.h" 19 * ubi_do_get_device_info - get information about UBI device. 20 * @ubi: UBI device description object 23 * This function is the same as 'ubi_get_device_info()', but it assumes the UBI 26 void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di) in ubi_do_get_device_info() argument 28 di->ubi_num = ubi->ubi_num; in ubi_do_get_device_info() 29 di->leb_size = ubi->leb_size; in ubi_do_get_device_info() 30 di->leb_start = ubi->leb_start; in ubi_do_get_device_info() [all …]
|
H A 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 19 /* The version of UBI images supported by this implementation */ 28 /* Erase counter header magic number (ASCII "UBI#") */ 30 /* Volume identifier header magic number (ASCII "UBI!") */ 34 * Volume type constants used in the volume identifier header. 36 * @UBI_VID_DYNAMIC: dynamic volume 37 * @UBI_VID_STATIC: static volume 45 * Volume flags used in the volume table record. 47 * @UBI_VTBL_AUTORESIZE_FLG: auto-resize this volume [all …]
|
H A D | upd.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 * Jan 2007: Alexander Schmidt, hacked per-volume update. 12 * This file contains implementation of the volume update and atomic LEB change 15 * The update operation is based on the per-volume update marker which is 16 * stored in the volume table. The update marker is set before the update 18 * interrupted by an unclean re-boot or due to some other reasons, the update 19 * marker stays on the flash media and UBI finds it when it attaches the MTD 20 * device next time. If the update marker is set for a volume, the volume is 25 * transaction with a roll-back capability. 31 #include "ubi.h" [all …]
|
H A D | attach.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 9 * UBI attaching sub-system. 11 * This sub-system is responsible for attaching MTD devices and it also 16 * objects which are kept in volume RB-tree with root at the @volumes field. 17 * The RB-tree is indexed by the volume ID. 20 * objects are kept in per-volume RB-trees with the root at the corresponding 21 * &struct ubi_ainf_volume object. To put it differently, we keep an RB-tree of 22 * per-volume objects and each of these objects is the root of RB-tree of 23 * per-LEB objects. 32 * UBI protects EC and VID headers with CRC-32 checksums, so it can detect [all …]
|
H A D | eba.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 9 * The UBI Eraseblock Association (EBA) sub-system. 11 * This sub-system is responsible for I/O to/from logical eraseblock. 17 * The EBA sub-system implements per-logical eraseblock locking. Before 19 * per-logical eraseblock locking is implemented by means of the lock tree. The 20 * lock tree is an RB-tree which refers all the currently locked logical 26 * stored in the volume identifier header. This means that each VID header has 34 #include "ubi.h" 37 * struct ubi_eba_entry - structure encoding a single LEB -> PEB association 40 * This structure is encoding a LEB -> PEB association. Note that the LEB [all …]
|
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 12 * UBI. 15 * size (@mtd->writesize) is equivalent to the UBI minimal I/O unit. The 16 * eraseblock size is equivalent to the logical eraseblock size of the volume. 26 #include <linux/mtd/ubi.h> 28 #include "ubi-media.h" 32 current->pid, __func__, ##__VA_ARGS__) 35 * struct gluebi_device - a gluebi device description data structure. [all …]
|
H A D | debug.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 #include "ubi.h" 13 #include <linux/fault-inject.h> 46 * ubi_dump_flash - dump a region of flash. in FAIL_ACTION() 47 * @ubi: UBI device description object in FAIL_ACTION() 52 void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len) in FAIL_ACTION() 57 loff_t addr = (loff_t)pnum * ubi->peb_size + offset; in FAIL_ACTION() 62 err = mtd_read(ubi->mtd, addr, len, &read, buf); in FAIL_ACTION() 63 if (err && err != -EUCLEAN) { in FAIL_ACTION() 64 ubi_err(ubi, "err %d while reading %d bytes from PEB %d:%d, read %zd bytes", in FAIL_ACTION() [all …]
|
H A D | misc.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 /* Here we keep miscellaneous functions which are used all over the UBI code */ 10 #include "ubi.h" 13 * ubi_calc_data_len - calculate how much real data is stored in a buffer. 14 * @ubi: UBI device description object 22 int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf, in ubi_calc_data_len() argument 27 ubi_assert(!(length & (ubi->min_io_size - 1))); in ubi_calc_data_len() 29 for (i = length - 1; i >= 0; i--) in ubi_calc_data_len() 34 length = ALIGN(i + 1, ubi->min_io_size); in ubi_calc_data_len() 39 * ubi_check_volume - check the contents of a static volume. [all …]
|
H A D | io.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 10 * UBI input/output sub-system. 12 * This sub-system provides a uniform way to work with all kinds of the 14 * writing UBI headers. 18 * sub-system validates every single header it reads from the flash media. 26 * changed. For example, for different reasons (e.g., optimization) UBI may be 28 * offset. Of course, if the offset of the VID header is unaligned, UBI adds 32 * About minimal I/O units. In general, UBI assumes flash device model where 35 * @ubi->mtd->writesize field. But as an exception, UBI admits use of another 40 * write operations to one NAND page. In this case UBI can fit EC and VID [all …]
|
H A D | fastmap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 10 #include "ubi.h" 13 * init_seen - allocate memory for used for debugging. 14 * @ubi: UBI device description object 16 static inline unsigned long *init_seen(struct ubi_device *ubi) in init_seen() argument 20 if (!ubi_dbg_chk_fastmap(ubi)) in init_seen() 23 ret = bitmap_zalloc(ubi->peb_count, GFP_NOFS); in init_seen() 25 return ERR_PTR(-ENOMEM); in init_seen() 31 * free_seen - free the seen logic integer array. 32 * @seen: integer array of @ubi->peb_count size [all …]
|
H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 3 tristate "Enable UBI - Unsorted block images" 6 UBI is a software layer above MTD layer which admits use of LVM-like 10 (www.linux-mtd.infradead.org). 15 int "UBI wear-leveling threshold" 21 of UBI devices. When this threshold is exceeded, UBI starts performing 26 other flashes which have eraseblock life-cycle 100000 or more. 28 life-cycle less than 10000, the threshold should be lessened (e.g., 36 This option specifies the maximum bad physical eraseblocks UBI 44 as "1024 * (1 - MinNVB / MaxNVB)", which gives 20 for most NANDs [all …]
|
/linux/Documentation/ABI/stable/ |
H A D | sysfs-class-ubi | 1 What: /sys/class/ubi/ 6 The ubi/ class sub-directory belongs to the UBI subsystem and 7 provides general UBI information, per-UBI device information 8 and per-UBI volume information. 10 What: /sys/class/ubi/version 15 This file contains version of the latest supported UBI on-media 17 However, if in the future UBI needs on-flash format changes 20 future backward-compatible (but forward-incompatible) 29 UBI devices (UBI device 0, 1, etc). They contain general UBI 30 device information and per UBI volume information (each UBI [all …]
|
/linux/include/linux/mtd/ |
H A D | ubi.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 14 #include <mtd/ubi-user.h> 17 #define UBI_ALL -1 26 * enum ubi_open_mode - UBI volume open mode constants. 28 * UBI_READONLY: read-only mode 29 * UBI_READWRITE: read-write mode 31 * UBI_METAONLY: modify only the volume meta-data, 32 * i.e. the data stored in the volume table, but not in any of volume LEBs. 42 * struct ubi_volume_info - UBI volume description data structure. 43 * @vol_id: volume ID [all …]
|
/linux/Documentation/filesystems/ |
H A D | ubifs.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 UBI File System 10 UBIFS file-system stands for UBI File System. UBI stands for "Unsorted 13 is completely different to any traditional file-system in Linux, like 14 Ext2, XFS, JFS, etc. UBIFS represents a separate class of file-systems 16 file-system of this class is JFFS2. 24 2 MTD devices support 3 main operations - read from some offset within an 26 eraseblock. Block devices support 2 main operations - read a whole 29 re-write its contents. Blocks may be just re-written. 30 4 Eraseblocks become worn out after some number of erase cycles - [all …]
|
H A D | ubifs-authentication.rst | 1 .. SPDX-License-Identifier: GPL-2.0 24 binary to perform a malicious action when executed [DMC-CBC-ATTACK]. Since 28 Other full disk encryption systems like dm-crypt cover all filesystem metadata, 31 time. For dm-crypt and other filesystems that build upon the Linux block IO 32 layer, the dm-integrity or dm-verity subsystems [DM-INTEGRITY, DM-VERITY] 34 These can also be combined with dm-crypt [CRYPTSETUP2]. 43 MTD, UBI & UBIFS 44 ---------------- 48 work on top of MTD is UBI (Unsorted Block Images). It provides volume management 50 addition, it deals with flash-specific wear-leveling and transparent I/O error [all …]
|
/linux/Documentation/devicetree/bindings/mtd/partitions/ |
H A D | linux,ubi.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 4 $id: http://devicetree.org/schemas/mtd/partitions/linux,ubi.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 UBI ("Unsorted Block Images") is a volume management system for raw 12 physical flash device and spreads the I/O load (i.e wear-leveling) 16 - Daniel Golle <daniel@makrotopia.org> 19 - $ref: partition.yaml# 23 const: linux,ubi 27 description: UBI Volumes [all …]
|
H A D | ubi-volume.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 4 $id: http://devicetree.org/schemas/mtd/partitions/ubi-volume.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: UBI volume 10 This binding describes a single UBI volume. Volumes can be matches either 14 - Daniel Golle <daniel@makrotopia.org> 20 Match UBI volume ID 25 Match UBI volume ID 27 nvmem-layout: [all …]
|
/linux/fs/ubifs/ |
H A D | super.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (C) 2006-2008 Nokia Corporation. 35 return -EINVAL; in ubifs_default_version_set() 60 * validate_inode - validate inode. 61 * @c: UBIFS file-system description object 67 * a non-zero error code if not. 74 if (inode->i_size > c->max_inode_sz) { in validate_inode() 76 (long long)inode->i_size); in validate_inode() 80 if (ui->compr_type >= UBIFS_COMPR_TYPES_CNT) { in validate_inode() 81 ubifs_err(c, "unknown compression type %d", ui->compr_type); in validate_inode() [all …]
|
H A D | debug.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 5 * Copyright (C) 2006-2008 Nokia Corporation. 21 * The UBIFS debugfs directory name pattern and maximum name length (3 for "ubi" 22 * + 1 for "_" and 2 for UBI device numbers and 3 for volume number and 1 for 25 #define UBIFS_DFS_DIR_NAME "ubi%d_%d" 29 * ubifs_debug_info - per-FS debugging information. 30 * @old_zroot: old index root - used by 'dbg_check_old_index()' 31 * @old_zroot_level: old index root level - used by 'dbg_check_old_index()' 32 * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()' 34 * @pc_happened: non-zero if an emulated power cut happened [all …]
|
H A D | sb.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (C) 2006-2008 Nokia Corporation. 13 * LEB of the volume and is never changed by UBIFS. Only user-space tools may 69 * create_default_filesystem - format empty UBI volume. 70 * @c: UBIFS file-system description object 72 * This function creates default empty file-system. Returns zero in case of 94 /* Some functions called from here depend on the @c->key_len filed */ in create_default_filesystem() 95 c->key_len = UBIFS_SK_LEN; in create_default_filesystem() 98 * First of all, we have to calculate default file-system geometry - in create_default_filesystem() 101 if (c->leb_cnt < 0x7FFFFFFF / DEFAULT_JNL_PERCENT) in create_default_filesystem() [all …]
|
H A D | ubifs.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 5 * Copyright (C) 2006-2008 Nokia Corporation 24 #include <linux/mtd/ubi.h> 26 #include <linux/backing-dev.h> 38 #include "ubifs-media.h" 48 #define UBIFS_BLOCKS_PER_PAGE_SHIFT (PAGE_SHIFT - UBIFS_BLOCK_SHIFT) 56 * least 2 LEBs: one for the index head and one for in-the-gaps method (which 66 * Currently we do not support inode number overlapping and re-using, so this 69 * 64-bit inode numbers, but this means more overhead. 78 * Background thread name pattern. The numbers are UBI device and volume [all …]
|
/linux/Documentation/devicetree/bindings/nvmem/layouts/ |
H A D | u-boot,env.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 4 $id: http://devicetree.org/schemas/nvmem/layouts/u-boot,env.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: U-Boot environment variables layout 10 U-Boot uses environment variables to store device parameters and 14 Data is stored using U-Boot specific formats (variant specific header and NUL 15 separated key-value pairs). 19 2. UBI volume 27 - Rafał Miłecki <rafal@milecki.pl> [all …]
|
/linux/drivers/net/wireless/ath/ath9k/ |
H A D | ath9k_pci_owl_loader.c | 1 // SPDX-License-Identifier: ISC 11 * Atheros chip stored on UBI Volume on NAND. Hence, this module can be used to 12 * initialize the chip when the user-space is ready to extract the init code. 21 #include <linux/nvmem-consumer.h> 51 dev_err(&pdev->dev, "eeprom has an invalid size.\n"); in ath9k_pci_fixup() 52 return -EINVAL; in ath9k_pci_fixup() 57 dev_err(&pdev->dev, "invalid calibration data\n"); in ath9k_pci_fixup() 58 return -EINVAL; in ath9k_pci_fixup() 61 dev_dbg(&pdev->dev, "calibration data needs swapping\n"); in ath9k_pci_fixup() 65 dev_info(&pdev->dev, "fixup device configuration\n"); in ath9k_pci_fixup() [all …]
|