Home
last modified time | relevance | path

Searched full:oob (Results 1 – 25 of 373) sorted by relevance

12345678910>>...15

/kernel/linux/linux-4.19/drivers/mtd/parsers/
Dsharpslpart.c35 /* oob structure */
69 /* verify that the OOB bytes 8 to 15 are free and available for the FTL */
115 * The logical block number assigned to a physical block is stored in the OOB
128 * ECC BB xyxy oob[8]==oob[10] && oob[9]==oob[11] -> byte0=8 byte1=9
129 * ECC BB xyxy oob[10]==oob[12] && oob[11]==oob[13] -> byte0=10 byte1=11
130 * ECC BB xy xy oob[12]==oob[8] && oob[13]==oob[9] -> byte0=12 byte1=13
132 static int sharpsl_nand_get_logical_num(u8 *oob) in sharpsl_nand_get_logical_num() argument
137 if (oob[NAND_NOOB_LOGADDR_00] == oob[NAND_NOOB_LOGADDR_10] && in sharpsl_nand_get_logical_num()
138 oob[NAND_NOOB_LOGADDR_01] == oob[NAND_NOOB_LOGADDR_11]) { in sharpsl_nand_get_logical_num()
141 } else if (oob[NAND_NOOB_LOGADDR_10] == oob[NAND_NOOB_LOGADDR_20] && in sharpsl_nand_get_logical_num()
[all …]
/kernel/linux/linux-5.10/drivers/mtd/parsers/
Dsharpslpart.c35 /* oob structure */
69 /* verify that the OOB bytes 8 to 15 are free and available for the FTL */
115 * The logical block number assigned to a physical block is stored in the OOB
128 * ECC BB xyxy oob[8]==oob[10] && oob[9]==oob[11] -> byte0=8 byte1=9
129 * ECC BB xyxy oob[10]==oob[12] && oob[11]==oob[13] -> byte0=10 byte1=11
130 * ECC BB xy xy oob[12]==oob[8] && oob[13]==oob[9] -> byte0=12 byte1=13
132 static int sharpsl_nand_get_logical_num(u8 *oob) in sharpsl_nand_get_logical_num() argument
137 if (oob[NAND_NOOB_LOGADDR_00] == oob[NAND_NOOB_LOGADDR_10] && in sharpsl_nand_get_logical_num()
138 oob[NAND_NOOB_LOGADDR_01] == oob[NAND_NOOB_LOGADDR_11]) { in sharpsl_nand_get_logical_num()
141 } else if (oob[NAND_NOOB_LOGADDR_10] == oob[NAND_NOOB_LOGADDR_20] && in sharpsl_nand_get_logical_num()
[all …]
/kernel/linux/linux-4.19/drivers/mtd/nand/raw/
Dsm_common.h12 /* Full oob structure as written on the flash */
27 /* oob area is also 16 bytes, but might be from two pages */
42 static inline int sm_sector_valid(struct sm_oob *oob) in sm_sector_valid() argument
44 return hweight16(oob->data_status) >= 5; in sm_sector_valid()
47 static inline int sm_block_valid(struct sm_oob *oob) in sm_block_valid() argument
49 return hweight16(oob->block_status) >= 7; in sm_block_valid()
52 static inline int sm_block_erased(struct sm_oob *oob) in sm_block_erased() argument
58 if (!memcmp(oob, erased_pattern, sizeof(*oob))) in sm_block_erased()
Dnand_base.c56 /* Define default oob placement schemes for large and small page devices */
508 * specify how to write bad block markers to OOB (chip->block_markbad).
512 * (1) erase the affected block, to allow OOB marker to be written cleanly
513 * (2) write bad block marker to OOB area of affected block (unless flag
528 /* Attempt erase before marking OOB */ in nand_block_markbad_lowlevel()
534 /* Write bad block marker to OOB */ in nand_block_markbad_lowlevel()
776 /* OOB area */ in nand_command()
1411 * On small page NANDs, there's a dedicated command to access the OOB in nand_fill_column_cycles()
1412 * area, and the column address is relative to the start of the OOB in nand_fill_column_cycles()
1678 * nand_read_oob_op - Do a READ OOB operation
[all …]
Ddenali.c429 * happened in OOB, so we ignore it. It's no need for in denali_sw_ecc_fixup()
653 /* BBM at the beginning of the OOB area */ in denali_oob_xfer()
661 /* OOB ECC */ in denali_oob_xfer()
692 /* OOB free */ in denali_oob_xfer()
743 uint8_t *oob = chip->oob_poi; in denali_read_page_raw() local
745 /* BBM at the beginning of the OOB area */ in denali_read_page_raw()
746 memcpy(oob, tmp_buf + writesize, oob_skip); in denali_read_page_raw()
747 oob += oob_skip; in denali_read_page_raw()
749 /* OOB ECC */ in denali_read_page_raw()
759 memcpy(oob, tmp_buf + pos, len); in denali_read_page_raw()
[all …]
Dsunxi_nand.c633 * the randomizer engine does internally before de/scrambling OOB data.
818 static void sunxi_nfc_hw_ecc_get_prot_oob_bytes(struct mtd_info *mtd, u8 *oob, in sunxi_nfc_hw_ecc_get_prot_oob_bytes() argument
825 oob); in sunxi_nfc_hw_ecc_get_prot_oob_bytes()
829 sunxi_nfc_randomize_bbm(mtd, page, oob); in sunxi_nfc_hw_ecc_get_prot_oob_bytes()
833 const u8 *oob, int step, in sunxi_nfc_hw_ecc_set_prot_oob_bytes() argument
842 memcpy(user_data, oob, sizeof(user_data)); in sunxi_nfc_hw_ecc_set_prot_oob_bytes()
844 oob = user_data; in sunxi_nfc_hw_ecc_set_prot_oob_bytes()
847 writel(sunxi_nfc_buf_to_user_data(oob), in sunxi_nfc_hw_ecc_set_prot_oob_bytes()
862 static int sunxi_nfc_hw_ecc_correct(struct mtd_info *mtd, u8 *data, u8 *oob, in sunxi_nfc_hw_ecc_correct() argument
888 if (oob) in sunxi_nfc_hw_ecc_correct()
[all …]
/kernel/linux/linux-5.10/drivers/mtd/nand/raw/
Dsm_common.h9 /* Full oob structure as written on the flash */
24 /* oob area is also 16 bytes, but might be from two pages */
39 static inline int sm_sector_valid(struct sm_oob *oob) in sm_sector_valid() argument
41 return hweight16(oob->data_status) >= 5; in sm_sector_valid()
44 static inline int sm_block_valid(struct sm_oob *oob) in sm_block_valid() argument
46 return hweight16(oob->block_status) >= 7; in sm_block_valid()
49 static inline int sm_block_erased(struct sm_oob *oob) in sm_block_erased() argument
55 if (!memcmp(oob, erased_pattern, sizeof(*oob))) in sm_block_erased()
Dnand_base.c337 * nand_fill_oob - [INTERN] Transfer client buffer to oob
339 * @oob: oob data buffer
340 * @len: oob data write length
341 * @ops: oob ops structure
343 static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, size_t len, in nand_fill_oob() argument
350 * Initialise to all 0xFF, to avoid the possibility of left over OOB in nand_fill_oob()
351 * data from a previous OOB read. in nand_fill_oob()
359 memcpy(chip->oob_poi + ops->ooboffs, oob, len); in nand_fill_oob()
360 return oob + len; in nand_fill_oob()
363 ret = mtd_ooblayout_set_databytes(mtd, oob, chip->oob_poi, in nand_fill_oob()
[all …]
Dsunxi_nand.c534 * the randomizer engine does internally before de/scrambling OOB data.
716 static void sunxi_nfc_hw_ecc_get_prot_oob_bytes(struct nand_chip *nand, u8 *oob, in sunxi_nfc_hw_ecc_get_prot_oob_bytes() argument
722 oob); in sunxi_nfc_hw_ecc_get_prot_oob_bytes()
726 sunxi_nfc_randomize_bbm(nand, page, oob); in sunxi_nfc_hw_ecc_get_prot_oob_bytes()
730 const u8 *oob, int step, in sunxi_nfc_hw_ecc_set_prot_oob_bytes() argument
738 memcpy(user_data, oob, sizeof(user_data)); in sunxi_nfc_hw_ecc_set_prot_oob_bytes()
740 oob = user_data; in sunxi_nfc_hw_ecc_set_prot_oob_bytes()
743 writel(sunxi_nfc_buf_to_user_data(oob), in sunxi_nfc_hw_ecc_set_prot_oob_bytes()
760 static int sunxi_nfc_hw_ecc_correct(struct nand_chip *nand, u8 *data, u8 *oob, in sunxi_nfc_hw_ecc_correct() argument
785 if (oob) in sunxi_nfc_hw_ecc_correct()
[all …]
/kernel/linux/linux-4.19/drivers/mtd/
Dsm_ftl.c130 /* ----------------------- oob helpers -------------------------------------- */
151 static int sm_read_lba(struct sm_oob *oob) in sm_read_lba() argument
160 if (!memcmp(oob, erased_pattern, SM_OOB_SIZE)) in sm_read_lba()
164 lba_test = *(uint16_t *)oob->lba_copy1 ^ *(uint16_t*)oob->lba_copy2; in sm_read_lba()
169 lba = sm_get_lba(oob->lba_copy1); in sm_read_lba()
172 lba = sm_get_lba(oob->lba_copy2); in sm_read_lba()
177 static void sm_write_lba(struct sm_oob *oob, uint16_t lba) in sm_write_lba() argument
189 oob->lba_copy1[0] = oob->lba_copy2[0] = tmp[0]; in sm_write_lba()
190 oob->lba_copy1[1] = oob->lba_copy2[1] = tmp[1]; in sm_write_lba()
220 static int sm_correct_sector(uint8_t *buffer, struct sm_oob *oob) in sm_correct_sector() argument
[all …]
Dnftlcore.c134 * Read oob data from flash
155 * Write oob data to flash
178 * Write data and oob to flash
181 size_t *retlen, uint8_t *buf, uint8_t *oob) in nftl_write() argument
190 ops.oobbuf = oob; in nftl_write()
254 struct nftl_oob oob; in NFTL_foldchain() local
281 (char *)&oob); in NFTL_foldchain()
283 foldmark = oob.u.c.FoldMark | oob.u.c.FoldMark1; in NFTL_foldchain()
294 status = oob.b.Status | oob.b.Status1; in NFTL_foldchain()
393 oob.u.c.FoldMark = oob.u.c.FoldMark1 = cpu_to_le16(FOLD_MARK_IN_PROGRESS); in NFTL_foldchain()
[all …]
Dinftlcore.c147 * Read oob data from flash
167 * Write oob data to flash
187 * Write data and oob to flash
190 size_t *retlen, uint8_t *buf, uint8_t *oob) in inftl_write() argument
198 ops.oobbuf = oob; in inftl_write()
257 struct inftl_oob oob; in INFTL_foldchain() local
287 (char *)&oob) < 0) in INFTL_foldchain()
290 status = oob.b.Status | oob.b.Status1; in INFTL_foldchain()
360 memset(&oob, 0xff, sizeof(struct inftl_oob)); in INFTL_foldchain()
361 oob.b.Status = oob.b.Status1 = SECTOR_USED; in INFTL_foldchain()
[all …]
/kernel/linux/linux-5.10/drivers/mtd/
Dsm_ftl.c127 /* ----------------------- oob helpers -------------------------------------- */
148 static int sm_read_lba(struct sm_oob *oob) in sm_read_lba() argument
157 if (!memcmp(oob, erased_pattern, SM_OOB_SIZE)) in sm_read_lba()
161 lba_test = *(uint16_t *)oob->lba_copy1 ^ *(uint16_t*)oob->lba_copy2; in sm_read_lba()
166 lba = sm_get_lba(oob->lba_copy1); in sm_read_lba()
169 lba = sm_get_lba(oob->lba_copy2); in sm_read_lba()
174 static void sm_write_lba(struct sm_oob *oob, uint16_t lba) in sm_write_lba() argument
186 oob->lba_copy1[0] = oob->lba_copy2[0] = tmp[0]; in sm_write_lba()
187 oob->lba_copy1[1] = oob->lba_copy2[1] = tmp[1]; in sm_write_lba()
217 static int sm_correct_sector(uint8_t *buffer, struct sm_oob *oob) in sm_correct_sector() argument
[all …]
Dnftlcore.c121 * Read oob data from flash
142 * Write oob data to flash
165 * Write data and oob to flash
168 size_t *retlen, uint8_t *buf, uint8_t *oob) in nftl_write() argument
177 ops.oobbuf = oob; in nftl_write()
241 struct nftl_oob oob; in NFTL_foldchain() local
268 (char *)&oob); in NFTL_foldchain()
270 foldmark = oob.u.c.FoldMark | oob.u.c.FoldMark1; in NFTL_foldchain()
281 status = oob.b.Status | oob.b.Status1; in NFTL_foldchain()
380 oob.u.c.FoldMark = oob.u.c.FoldMark1 = cpu_to_le16(FOLD_MARK_IN_PROGRESS); in NFTL_foldchain()
[all …]
Dinftlcore.c134 * Read oob data from flash
154 * Write oob data to flash
174 * Write data and oob to flash
177 size_t *retlen, uint8_t *buf, uint8_t *oob) in inftl_write() argument
185 ops.oobbuf = oob; in inftl_write()
244 struct inftl_oob oob; in INFTL_foldchain() local
274 (char *)&oob) < 0) in INFTL_foldchain()
277 status = oob.b.Status | oob.b.Status1; in INFTL_foldchain()
347 memset(&oob, 0xff, sizeof(struct inftl_oob)); in INFTL_foldchain()
348 oob.b.Status = oob.b.Status1 = SECTOR_USED; in INFTL_foldchain()
[all …]
/kernel/linux/linux-4.19/Documentation/mtd/nand/
Dpxa3xx-nand.txt30 OOB, one per chunk read.
70 OOB
73 Because of the above scheme, and because the "spare" OOB is really located in
74 the middle of a page, spare OOB cannot be read or write independently of the
75 data area. In other words, in order to read the OOB (aka READOOB), the entire
78 In the same sense, in order to write to the spare OOB the driver has to write
85 data/OOB/data/OOB way, the controller has a view of the flash page that's
91 | Data |x OOB |
97 | Data | OOB | Data x | OOB |
101 searched within the 'data' region, and not in the usual OOB region.
[all …]
/kernel/linux/linux-4.19/include/linux/mtd/
Dbbm.h38 * @offs: offset of the pattern in the oob area of the page
39 * @veroffs: offset of the bbt version counter in the oob are of the page
52 * that the pattern and the version count are always located in the oob area
87 * unavailable, for example, if the NAND controller has a different data and OOB
101 * Use a flash based bad block table. By default, OOB identifier is saved in
102 * OOB area. This option is passed to the default bad block table function.
106 * Do not store flash based bad block table marker in the OOB area; store it
111 * Do not write new bad block markers to OOB; useful, e.g., when ECC covers
127 * Constants for oob configuration
143 * @badblockpos: [INTERN] position of the bad block marker in the oob area
Dmtd.h56 * struct mtd_oob_ops - oob operation operands
63 * @ooblen: number of oob bytes to write/read
64 * @oobretlen: number of oob bytes written/read
65 * @ooboffs: offset of oob data in the oob area (only relevant when
67 * @datbuf: data buffer - if NULL only oob data are read/written
68 * @oobbuf: oob data buffer
70 * Note, some MTD drivers do not allow you to write more than one OOB area at
90 * struct mtd_oob_region - oob region definition
94 * This structure describes a region of the OOB area, and is used
96 * Each section is defined by an offset within the OOB area and a
[all …]
/kernel/linux/linux-5.10/include/linux/mtd/
Dbbm.h24 * @offs: offset of the pattern in the oob area of the page
25 * @veroffs: offset of the bbt version counter in the oob are of the page
38 * that the pattern and the version count are always located in the oob area
73 * unavailable, for example, if the NAND controller has a different data and OOB
84 * Use a flash based bad block table. By default, OOB identifier is saved in
85 * OOB area. This option is passed to the default bad block table function.
89 * Do not store flash based bad block table marker in the OOB area; store it
94 * Do not write new bad block markers to OOB; useful, e.g., when ECC covers
/kernel/linux/linux-5.10/include/uapi/mtd/
Dmtd-abi.h52 * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default)
53 * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas
73 * @ooblen: length of OOB buffer
75 * @usr_oob: user-provided OOB buffer
79 * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB
80 * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to
134 __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */
174 /* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */
196 /* Write data to OOB (64-bit version) */
198 /* Read data from OOB (64-bit version) */
[all …]
/kernel/linux/linux-4.19/include/uapi/mtd/
Dmtd-abi.h52 * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default)
53 * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas
73 * @ooblen: length of OOB buffer
75 * @usr_oob: user-provided OOB buffer
79 * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB
80 * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to
133 __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */
173 /* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */
195 /* Write data to OOB (64-bit version) */
197 /* Read data from OOB (64-bit version) */
[all …]
/kernel/linux/linux-5.10/drivers/mtd/tests/
Dreadtest.c63 pr_err("error: read oob failed at " in read_eraseblock_by_page()
83 int pg, oob; in dump_eraseblock() local
98 pr_info("dumping oob from eraseblock %d\n", ebnum); in dump_eraseblock()
101 for (oob = 0; oob < n;) { in dump_eraseblock()
105 for (j = 0; j < 32 && oob < n; j++, oob++, i++) in dump_eraseblock()
149 "eraseblock %u, OOB size %u\n", in mtd_readtest_init()
/kernel/linux/linux-4.19/drivers/mtd/devices/
Ddocg3.c54 * - a 1 byte Hamming code stored in the OOB for each page
55 * - a 7 bytes BCH code stored in the OOB for each page
608 * reading OOB only or write status byte).
639 * It's in fact recv_ecc ^ calc_ecc, where recv_ecc was read from OOB
873 * @ops: the mtd oob structure
875 * Reads flash memory OOB area of pages.
902 doc_dbg("doc_read_oob(from=%lld, mode=%d, data=(%p:%zu), oob=(%p:%zu))\n", in doc_read_oob()
942 doc_dbg("OOB - INFO: %*phC\n", 7, oobbuf); in doc_read_oob()
943 doc_dbg("OOB - HAMMING: %02x\n", oobbuf[7]); in doc_read_oob()
944 doc_dbg("OOB - BCH_ECC: %*phC\n", 7, oobbuf + 8); in doc_read_oob()
[all …]
/kernel/linux/linux-5.10/drivers/mtd/devices/
Ddocg3.c40 * - a 1 byte Hamming code stored in the OOB for each page
41 * - a 7 bytes BCH code stored in the OOB for each page
594 * reading OOB only or write status byte).
625 * It's in fact recv_ecc ^ calc_ecc, where recv_ecc was read from OOB
859 * @ops: the mtd oob structure
861 * Reads flash memory OOB area of pages.
888 doc_dbg("doc_read_oob(from=%lld, mode=%d, data=(%p:%zu), oob=(%p:%zu))\n", in doc_read_oob()
928 doc_dbg("OOB - INFO: %*phC\n", 7, oobbuf); in doc_read_oob()
929 doc_dbg("OOB - HAMMING: %02x\n", oobbuf[7]); in doc_read_oob()
930 doc_dbg("OOB - BCH_ECC: %*phC\n", 7, oobbuf + 8); in doc_read_oob()
[all …]
/kernel/linux/linux-4.19/drivers/mtd/tests/
Dreadtest.c75 pr_err("error: read oob failed at " in read_eraseblock_by_page()
95 int pg, oob; in dump_eraseblock() local
110 pr_info("dumping oob from eraseblock %d\n", ebnum); in dump_eraseblock()
113 for (oob = 0; oob < n;) { in dump_eraseblock()
117 for (j = 0; j < 32 && oob < n; j++, oob++, i++) in dump_eraseblock()
161 "eraseblock %u, OOB size %u\n", in mtd_readtest_init()

12345678910>>...15