/drivers/mtd/ |
D | sm_ftl.c | 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 223 if (ecc_sw_hamming_correct(buffer, ecc, oob->ecc1, SM_SMALL_PAGE, in sm_correct_sector() [all …]
|
D | nftlcore.c | 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() 381 oob.u.c.unused = 0xffffffff; in NFTL_foldchain() 383 8, &retlen, (char *)&oob.u); in NFTL_foldchain() 420 memset(&oob, 0xff, sizeof(struct nftl_oob)); in NFTL_foldchain() [all …]
|
D | inftlcore.c | 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() 352 movebuf, (char *)&oob); in INFTL_foldchain() 466 struct inftl_oob oob; in INFTL_findwriteunit() local 574 + 8, 8, &retlen, (char *)&oob.u); in INFTL_findwriteunit() [all …]
|
/drivers/mtd/parsers/ |
D | sharpslpart.c | 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() 142 oob[NAND_NOOB_LOGADDR_11] == oob[NAND_NOOB_LOGADDR_21]) { in sharpsl_nand_get_logical_num() 145 } else if (oob[NAND_NOOB_LOGADDR_20] == oob[NAND_NOOB_LOGADDR_00] && in sharpsl_nand_get_logical_num() 146 oob[NAND_NOOB_LOGADDR_21] == oob[NAND_NOOB_LOGADDR_01]) { in sharpsl_nand_get_logical_num() 153 us = oob[good0] | oob[good1] << 8; in sharpsl_nand_get_logical_num() 171 u8 *oob; in sharpsl_nand_init_ftl() local 173 oob = kzalloc(mtd->oobsize, GFP_KERNEL); in sharpsl_nand_init_ftl() [all …]
|
/drivers/mtd/nand/raw/ |
D | sm_common.h | 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()
|
D | sunxi_nand.c | 727 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 733 oob); in sunxi_nfc_hw_ecc_get_prot_oob_bytes() 737 sunxi_nfc_randomize_bbm(nand, page, oob); in sunxi_nfc_hw_ecc_get_prot_oob_bytes() 741 const u8 *oob, int step, in sunxi_nfc_hw_ecc_set_prot_oob_bytes() argument 749 memcpy(user_data, oob, sizeof(user_data)); in sunxi_nfc_hw_ecc_set_prot_oob_bytes() 751 oob = user_data; in sunxi_nfc_hw_ecc_set_prot_oob_bytes() 754 writel(sunxi_nfc_buf_to_user_data(oob), in sunxi_nfc_hw_ecc_set_prot_oob_bytes() 771 static int sunxi_nfc_hw_ecc_correct(struct nand_chip *nand, u8 *data, u8 *oob, in sunxi_nfc_hw_ecc_correct() argument 796 if (oob) in sunxi_nfc_hw_ecc_correct() 797 memset(oob, pattern, ecc->bytes + 4); in sunxi_nfc_hw_ecc_correct() [all …]
|
D | nand_base.c | 384 static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, size_t len, in nand_fill_oob() argument 400 memcpy(chip->oob_poi + ops->ooboffs, oob, len); in nand_fill_oob() 401 return oob + len; in nand_fill_oob() 404 ret = mtd_ooblayout_set_databytes(mtd, oob, chip->oob_poi, in nand_fill_oob() 407 return oob + len; in nand_fill_oob() 2887 uint8_t *oob = chip->oob_poi; in nand_read_page_raw_syndrome() local 2902 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_raw_syndrome() 2907 oob += chip->ecc.prepad; in nand_read_page_raw_syndrome() 2910 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_raw_syndrome() 2914 oob += eccbytes; in nand_read_page_raw_syndrome() [all …]
|
D | sm_common.c | 103 struct sm_oob oob; in sm_block_markbad() local 106 memset(&oob, -1, SM_OOB_SIZE); in sm_block_markbad() 107 oob.block_status = 0x0F; in sm_block_markbad() 114 ops.oobbuf = (void *)&oob; in sm_block_markbad()
|
D | fsl_elbc_nand.c | 61 unsigned int oob; /* Non zero if operating on OOB data */ member 151 static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) in set_addr() argument 170 (oob ? FPAR_LP_MS : 0) | column); in set_addr() 180 (oob ? FPAR_SP_MS : 0) | column); in set_addr() 188 if (oob) in set_addr() 275 static void fsl_elbc_do_read(struct nand_chip *chip, int oob) in fsl_elbc_do_read() argument 298 if (oob) in fsl_elbc_do_read() 432 elbc_fcm_ctrl->oob = 1; in fsl_elbc_cmdfunc() 435 elbc_fcm_ctrl->oob = 0; in fsl_elbc_cmdfunc() 462 if (elbc_fcm_ctrl->oob) in fsl_elbc_cmdfunc() [all …]
|
D | rockchip-nand-controller.c | 602 u8 *oob; in rk_nfc_write_page_hwecc() local 646 oob = chip->oob_poi + (ecc->steps - 1) * NFC_SYS_DATA_SIZE; in rk_nfc_write_page_hwecc() 648 oob = chip->oob_poi + (i - 1) * NFC_SYS_DATA_SIZE; in rk_nfc_write_page_hwecc() 650 tmp = oob[0] | oob[1] << 8 | oob[2] << 16 | oob[3] << 24; in rk_nfc_write_page_hwecc() 768 u8 *oob; in rk_nfc_read_page_hwecc() local 820 oob = chip->oob_poi + (ecc->steps - 1) * NFC_SYS_DATA_SIZE; in rk_nfc_read_page_hwecc() 822 oob = chip->oob_poi + (i - 1) * NFC_SYS_DATA_SIZE; in rk_nfc_read_page_hwecc() 829 *oob++ = (u8)tmp; in rk_nfc_read_page_hwecc() 830 *oob++ = (u8)(tmp >> 8); in rk_nfc_read_page_hwecc() 831 *oob++ = (u8)(tmp >> 16); in rk_nfc_read_page_hwecc() [all …]
|
D | cadence-nand-controller.c | 1453 u8 *oob; in cadence_nand_write_page() local 1456 oob = chip->oob_poi; in cadence_nand_write_page() 1458 oob = cdns_ctrl->buf + mtd->writesize; in cadence_nand_write_page() 1462 page, (void *)buf, oob, in cadence_nand_write_page() 1556 const u8 *oob = chip->oob_poi; in cadence_nand_write_page_raw() local 1562 memcpy(tmp_buf + writesize, oob, oob_skip); in cadence_nand_write_page_raw() 1565 memcpy(tmp_buf + oob_data_offset, oob, in cadence_nand_write_page_raw() 1567 oob += cdns_chip->avail_oob_size; in cadence_nand_write_page_raw() 1582 memcpy(tmp_buf + pos, oob, len); in cadence_nand_write_page_raw() 1583 oob += len; in cadence_nand_write_page_raw() [all …]
|
D | fsl_ifc_nand.c | 49 unsigned int oob; /* Non zero if operating on OOB data */ member 138 static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) in set_addr() argument 149 ifc_out32((oob ? IFC_NAND_COL_MS : 0) | column, &ifc->ifc_nand.col0); in set_addr() 157 if (oob) in set_addr() 250 int oob, in fsl_ifc_do_read() argument 278 if (oob) in fsl_ifc_do_read() 384 ifc_nand_ctrl->oob = 0; in fsl_ifc_cmdfunc() 437 ifc_nand_ctrl->oob = 1; in fsl_ifc_cmdfunc() 440 set_addr(mtd, column, page_addr, ifc_nand_ctrl->oob); in fsl_ifc_cmdfunc() 446 if (ifc_nand_ctrl->oob) { in fsl_ifc_cmdfunc()
|
D | r852.c | 434 struct sm_oob *oob = (struct sm_oob *)ecc_code; in r852_ecc_calculate() local 446 oob->ecc1[0] = (ecc1) & 0xFF; in r852_ecc_calculate() 447 oob->ecc1[1] = (ecc1 >> 8) & 0xFF; in r852_ecc_calculate() 448 oob->ecc1[2] = (ecc1 >> 16) & 0xFF; in r852_ecc_calculate() 450 oob->ecc2[0] = (ecc2) & 0xFF; in r852_ecc_calculate() 451 oob->ecc2[1] = (ecc2 >> 8) & 0xFF; in r852_ecc_calculate() 452 oob->ecc2[2] = (ecc2 >> 16) & 0xFF; in r852_ecc_calculate()
|
D | cafe_nand.c | 387 u8 *oob = chip->oob_poi; in cafe_nand_read_page() local 416 oob[0] ^= pat[i] << 4; in cafe_nand_read_page() 419 oob[3*p/2 - 2048] ^= pat[i] >> 4; in cafe_nand_read_page() 420 oob[3*p/2 - 2047] ^= pat[i] << 4; in cafe_nand_read_page() 422 oob[3*p/2 - 2049] ^= pat[i] >> 8; in cafe_nand_read_page() 423 oob[3*p/2 - 2048] ^= pat[i]; in cafe_nand_read_page()
|
D | mxc_nand.c | 127 int (*read_page)(struct nand_chip *chip, void *buf, void *oob, bool ecc, 711 static int mxc_nand_read_page_v1(struct nand_chip *chip, void *buf, void *oob, in mxc_nand_read_page_v1() argument 763 if (oob) in mxc_nand_read_page_v1() 764 copy_spare(mtd, true, oob); in mxc_nand_read_page_v1() 770 void *oob, bool ecc, int page) in mxc_nand_read_page_v2_v3() argument 792 if (oob) in mxc_nand_read_page_v2_v3() 793 copy_spare(mtd, true, oob); in mxc_nand_read_page_v2_v3()
|
D | vf610_nfc.c | 508 uint8_t *oob, int page) in vf610_nfc_correct_data() argument 524 nand_read_oob_op(&nfc->chip, page, 0, oob, mtd->oobsize); in vf610_nfc_correct_data() 531 return nand_check_erased_ecc_chunk(dat, nfc->chip.ecc.size, oob, in vf610_nfc_correct_data()
|
D | fsmc_nand.c | 722 u8 *oob = (u8 *)&ecc_oob[0]; in fsmc_read_page_hwecc() local 750 nand_read_oob_op(chip, page, off, oob + j, len); in fsmc_read_page_hwecc() 754 memcpy(&ecc_code[i], oob, chip->ecc.bytes); in fsmc_read_page_hwecc()
|
D | nand_bbt.c | 354 uint8_t *buf, uint8_t *oob) in scan_write_bbt() argument 363 ops.oobbuf = oob; in scan_write_bbt()
|
D | tegra_nand.c | 725 u8 *oob = chip->oob_poi + nand->ecc.offset + in tegra_nand_read_page_hwecc() local 729 oob, chip->ecc.bytes, in tegra_nand_read_page_hwecc()
|
/drivers/mtd/nand/raw/brcmnand/ |
D | brcmnand.c | 250 u8 *oob; member 258 u8 *oob, u32 len, u8 dma_cmd); 1442 static int read_oob_from_regs(struct brcmnand_controller *ctrl, int i, u8 *oob, in read_oob_from_regs() argument 1454 oob[j] = oob_reg_read(ctrl, j); in read_oob_from_regs() 1466 const u8 *oob, int sas, int sector_1k) in write_oob_to_regs() argument 1484 (oob[j + 0] << 24) | in write_oob_to_regs() 1485 (oob[j + 1] << 16) | in write_oob_to_regs() 1486 (oob[j + 2] << 8) | in write_oob_to_regs() 1487 (oob[j + 3] << 0)); in write_oob_to_regs() 1491 plast[k++] = oob[j++]; in write_oob_to_regs() [all …]
|
/drivers/mtd/tests/ |
D | readtest.c | 83 int pg, oob; in dump_eraseblock() local 101 for (oob = 0; oob < n;) { in dump_eraseblock() 105 for (j = 0; j < 32 && oob < n; j++, oob++, i++) in dump_eraseblock()
|
/drivers/mtd/devices/ |
D | docg3.c | 1224 const u_char *oob, int autoecc) in doc_write_page() argument 1246 if (oob && autoecc) { in doc_write_page() 1247 doc_write_page_putbytes(docg3, DOC_LAYOUT_OOB_PAGEINFO_SZ, oob); in doc_write_page() 1249 oob += DOC_LAYOUT_OOB_UNUSED_OFS; in doc_write_page() 1261 doc_write_page_putbytes(docg3, DOC_LAYOUT_OOB_UNUSED_SZ, oob); in doc_write_page() 1263 if (oob && !autoecc) in doc_write_page() 1264 doc_write_page_putbytes(docg3, DOC_LAYOUT_OOB_SIZE, oob); in doc_write_page() 1382 u8 oob[DOC_LAYOUT_OOB_SIZE]; in doc_write_oob() local 1430 memset(oob, 0, sizeof(oob)); in doc_write_oob() 1432 memcpy(oob, docg3->oob_write_buf, DOC_LAYOUT_OOB_SIZE); in doc_write_oob() [all …]
|
/drivers/mtd/nand/raw/gpmi-nand/ |
D | gpmi-nand.c | 1616 uint8_t *oob = chip->oob_poi; in gpmi_ecc_read_page_raw() local 1640 memcpy(oob, tmp_buf, nfc_geo->metadata_size); in gpmi_ecc_read_page_raw() 1658 nand_extract_bits(oob, oob_bit_off, tmp_buf, in gpmi_ecc_read_page_raw() 1669 memcpy(oob + oob_byte_off, in gpmi_ecc_read_page_raw() 1698 uint8_t *oob = chip->oob_poi; in gpmi_ecc_write_page_raw() local 1716 memcpy(tmp_buf, oob, nfc_geo->metadata_size); in gpmi_ecc_write_page_raw() 1733 nand_extract_bits(tmp_buf, dst_bit_off, oob, in gpmi_ecc_write_page_raw() 1744 oob + oob_byte_off, mtd->oobsize - oob_byte_off); in gpmi_ecc_write_page_raw()
|
/drivers/net/ethernet/microsoft/mana/ |
D | mana_en.c | 968 struct mana_rxcomp_oob *oob = (struct mana_rxcomp_oob *)cqe->cqe_data; in mana_process_rx_cqe() local 978 switch (oob->cqe_hdr.cqe_type) { in mana_process_rx_cqe() 998 oob->cqe_hdr.cqe_type); in mana_process_rx_cqe() 1002 if (oob->cqe_hdr.cqe_type != CQE_RX_OKAY) in mana_process_rx_cqe() 1005 pktlen = oob->ppi[0].pkt_len; in mana_process_rx_cqe() 1046 mana_rx_skb(old_buf, oob, rxq); in mana_process_rx_cqe()
|
/drivers/mtd/nand/onenand/ |
D | onenand_base.c | 1795 const u_char *oob = ops->oobbuf; in onenand_write_ops_nolock() local 1843 if (oob) { in onenand_write_ops_nolock() 1850 onenand_fill_auto_oob(mtd, oobbuf, oob, oobcolumn, thisooblen); in onenand_write_ops_nolock() 1852 memcpy(oobbuf + oobcolumn, oob, thisooblen); in onenand_write_ops_nolock() 1855 oob += thisooblen; in onenand_write_ops_nolock()
|