Lines Matching defs:buf
503 uint8_t buf[2] = { 0, 0 };
507 ops.oobbuf = buf;
1132 unsigned int offset_in_page, void *buf,
1144 NAND_OP_DATA_IN(len, buf, 0),
1175 unsigned int offset_in_page, void *buf,
1187 NAND_OP_DATA_IN(len, buf, 0),
1229 unsigned int offset_in_page, void *buf,
1243 NAND_OP_DATA_IN(len, buf, 0),
1251 NAND_OP_DATA_IN(len, buf, 0),
1313 * @buf: buffer used to store the data
1322 unsigned int offset_in_page, void *buf, unsigned int len)
1326 if (len && !buf)
1337 buf, len, false);
1340 offset_in_page, buf,
1345 buf, len);
1350 chip->legacy.read_buf(chip, buf, len);
1360 * @buf: buffer used to store the data
1368 int nand_read_param_page_op(struct nand_chip *chip, u8 page, void *buf,
1372 u8 *p = buf;
1374 if (len && !buf)
1386 NAND_OP_8BIT_DATA_IN(len, buf, 0),
1408 * @buf: buffer used to store the data
1418 unsigned int offset_in_page, void *buf,
1423 if (len && !buf)
1442 NAND_OP_DATA_IN(len, buf, 0),
1462 chip->legacy.read_buf(chip, buf, len);
1473 * @buf: buffer used to store the data
1482 unsigned int offset_in_oob, void *buf, unsigned int len)
1486 if (len && !buf)
1495 buf, len);
1499 chip->legacy.read_buf(chip, buf, len);
1506 unsigned int offset_in_page, const void *buf,
1522 NAND_OP_DATA_OUT(len, buf, 0),
1576 * @buf: buffer containing the data to write to the page
1585 unsigned int offset_in_page, const void *buf,
1590 if (len && !buf)
1597 return nand_exec_prog_page_op(chip, page, offset_in_page, buf,
1602 if (buf)
1603 chip->legacy.write_buf(chip, buf, len);
1662 * @buf: buffer containing the data to write to the page
1671 unsigned int offset_in_page, const void *buf,
1678 if (!len || !buf)
1685 ret = nand_exec_prog_page_op(chip, page, offset_in_page, buf,
1696 chip->legacy.write_buf(chip, buf, len);
1716 * @buf: buffer containing the data to send to the NAND
1727 const void *buf, unsigned int len,
1732 if (len && !buf)
1749 NAND_OP_DATA_OUT(len, buf, 0),
1769 chip->legacy.write_buf(chip, buf, len);
1779 * @buf: buffer used to store the ID
1788 int nand_readid_op(struct nand_chip *chip, u8 addr, void *buf,
1792 u8 *id = buf, *ddrbuf = NULL;
1794 if (len && !buf)
1804 NAND_OP_8BIT_DATA_IN(len, buf, 0),
1816 instrs[2].ctx.data.buf.in = ddrbuf;
1871 instrs[1].ctx.data.buf.in = ddrstatus;
2066 instrs[3].ctx.data.buf.in = ddrbuf;
2142 * @buf: buffer used to store the data
2154 int nand_read_data_op(struct nand_chip *chip, void *buf, unsigned int len,
2157 if (!len || !buf)
2164 NAND_OP_DATA_IN(len, buf, 0),
2185 instrs[0].ctx.data.buf.in = ddrbuf;
2196 u8 *dst = buf;
2211 u8 *p = buf;
2217 chip->legacy.read_buf(chip, buf, len);
2227 * @buf: buffer containing the data to send on the bus
2237 int nand_write_data_op(struct nand_chip *chip, const void *buf,
2240 if (!len || !buf)
2245 NAND_OP_DATA_OUT(len, buf, 0),
2255 const u8 *p = buf;
2261 chip->legacy.write_buf(chip, buf, len);
2632 * ->data->buf.{in,out} field of data instructions. This is wrong as data
2762 * @buf: buffer to test
2779 static int nand_check_erased_buf(void *buf, int len, int bitflips_threshold)
2781 const unsigned char *bitmap = buf;
2894 * @buf: buffer to store read data
2900 int nand_read_page_raw_notsupp(struct nand_chip *chip, u8 *buf,
2909 * @buf: buffer to store read data
2915 int nand_read_page_raw(struct nand_chip *chip, uint8_t *buf, int oob_required,
2921 ret = nand_read_page_op(chip, page, 0, buf, mtd->writesize);
2939 * @buf: buffer to store read data
2951 int nand_monolithic_read_page_raw(struct nand_chip *chip, u8 *buf,
2956 u8 *read_buf = buf;
2962 if (buf != chip->data_buf)
2970 if (buf != chip->data_buf)
2971 memcpy(buf, read_buf, mtd->writesize);
2980 * @buf: buffer to store read data
2986 static int nand_read_page_raw_syndrome(struct nand_chip *chip, uint8_t *buf,
3000 ret = nand_read_data_op(chip, buf, eccsize, false, false);
3004 buf += eccsize;
3044 * @buf: buffer to store read data
3048 static int nand_read_page_swecc(struct nand_chip *chip, uint8_t *buf,
3055 uint8_t *p = buf;
3060 chip->ecc.read_page_raw(chip, buf, 1, page);
3071 p = buf;
3201 * @buf: buffer to store read data
3207 static int nand_read_page_hwecc(struct nand_chip *chip, uint8_t *buf,
3214 uint8_t *p = buf;
3244 p = buf;
3273 * @buf: buffer to store read data
3280 int nand_read_page_hwecc_oob_first(struct nand_chip *chip, uint8_t *buf,
3287 uint8_t *p = buf;
3339 * @buf: buffer to store read data
3346 static int nand_read_page_syndrome(struct nand_chip *chip, uint8_t *buf,
3354 uint8_t *p = buf;
3553 uint8_t *bufpoi, *oob, *buf;
3571 buf = ops->datbuf;
3586 use_bounce_buf = !virt_addr_valid(buf) ||
3587 !IS_ALIGNED((unsigned long)buf,
3594 bufpoi = use_bounce_buf ? chip->data_buf : buf;
3597 pr_debug("%s: using read bounce buffer for buf@%p\n",
3598 __func__, buf);
3637 memcpy(buf, bufpoi + col, bytes);
3669 buf += bytes;
3672 memcpy(buf, chip->data_buf + col, bytes);
3673 buf += bytes;
3892 uint8_t *buf = ops->oobbuf;
3923 buf = nand_transfer_oob(chip, buf, ops, len);
4002 * @buf: data buffer
4008 int nand_write_page_raw_notsupp(struct nand_chip *chip, const u8 *buf,
4017 * @buf: data buffer
4023 int nand_write_page_raw(struct nand_chip *chip, const uint8_t *buf,
4029 ret = nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
4047 * @buf: data buffer to write
4060 int nand_monolithic_write_page_raw(struct nand_chip *chip, const u8 *buf,
4065 u8 *write_buf = (u8 *)buf;
4070 if (buf != chip->data_buf) {
4072 memcpy(write_buf, buf, mtd->writesize);
4083 * @buf: data buffer
4090 const uint8_t *buf, int oob_required,
4104 ret = nand_write_data_op(chip, buf, eccsize, false);
4108 buf += eccsize;
4147 * @buf: data buffer
4151 static int nand_write_page_swecc(struct nand_chip *chip, const uint8_t *buf,
4159 const uint8_t *p = buf;
4170 return chip->ecc.write_page_raw(chip, buf, 1, page);
4176 * @buf: data buffer
4180 static int nand_write_page_hwecc(struct nand_chip *chip, const uint8_t *buf,
4188 const uint8_t *p = buf;
4222 * @buf: data buffer
4227 uint32_t data_len, const uint8_t *buf,
4250 ret = nand_write_data_op(chip, buf, ecc_size, false);
4258 chip->ecc.calculate(chip, buf, ecc_calc);
4265 buf += ecc_size;
4290 * @buf: data buffer
4297 static int nand_write_page_syndrome(struct nand_chip *chip, const uint8_t *buf,
4304 const uint8_t *p = buf;
4362 * @buf: the data to write
4368 int data_len, const uint8_t *buf, int oob_required,
4381 status = chip->ecc.write_page_raw(chip, buf, oob_required,
4384 status = chip->ecc.write_subpage(chip, offset, data_len, buf,
4387 status = chip->ecc.write_page(chip, buf, oob_required, page);
4416 uint8_t *buf = ops->datbuf;
4462 uint8_t *wbuf = buf;
4469 use_bounce_buf = !virt_addr_valid(buf) ||
4470 !IS_ALIGNED((unsigned long)buf,
4480 pr_debug("%s: using write bounce buffer for buf@%p\n",
4481 __func__, buf);
4486 memcpy(&wbuf[column], buf, bytes);
4509 buf += bytes;
4536 * @buf: the data to write
4542 size_t *retlen, const uint8_t *buf)
4556 ops.datbuf = (uint8_t *)buf;
5751 const unsigned char *buf,
5756 return nand_ecc_sw_hamming_calculate(base, buf, code);
5761 unsigned char *buf,
5767 return nand_ecc_sw_hamming_correct(base, buf, read_ecc, calc_ecc);
5805 const unsigned char *buf,
5810 return nand_ecc_sw_bch_calculate(base, buf, code);
5813 int rawnand_sw_bch_correct(struct nand_chip *chip, unsigned char *buf,
5818 return nand_ecc_sw_bch_correct(base, buf, read_ecc, calc_ecc);