@@ -2614,6 +2614,12 @@ int nand_read_page_raw(struct nand_chip *chip, uint8_t *buf, int oob_required,
struct mtd_info *mtd = nand_to_mtd(chip);
int ret;
+ if (nand_pack_ops(chip)) {
+ int len = mtd->writesize + (oob_required ? mtd->oobsize : 0);
+
+ return nand_read_page_op(chip, page, 0, buf, len);
+ }
+
ret = nand_read_page_op(chip, page, 0, buf, mtd->writesize);
if (ret)
return ret;
@@ -3189,7 +3195,7 @@ static int nand_do_read_ops(struct nand_chip *chip, loff_t from,
bytes = min(mtd->writesize - col, readlen);
aligned = (bytes == mtd->writesize);
- if (!aligned)
+ if (!aligned || nand_pack_ops(chip))
use_bounce_buf = 1;
else if (chip->options & NAND_USE_DMA_BUFFER)
use_bounce_buf = !virt_addr_valid(buf) ||
@@ -3621,6 +3627,12 @@ int nand_write_page_raw(struct nand_chip *chip, const uint8_t *buf,
struct mtd_info *mtd = nand_to_mtd(chip);
int ret;
+ if (nand_pack_ops(chip)) {
+ int len = mtd->writesize + (oob_required ? mtd->oobsize : 0);
+
+ return nand_prog_page_op(chip, page, 0, buf, len);
+ }
+
ret = nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
if (ret)
return ret;
@@ -4018,7 +4030,7 @@ static int nand_do_write_ops(struct nand_chip *chip, loff_t to,
int use_bounce_buf;
int part_pagewr = (column || writelen < mtd->writesize);
- if (part_pagewr)
+ if (part_pagewr || nand_pack_ops(chip))
use_bounce_buf = 1;
else if (chip->options & NAND_USE_DMA_BUFFER)
use_bounce_buf = !virt_addr_valid(buf) ||
nand_read/write_page_raw() helpers are extensively used when working with software ECC engines, hence they must support almost any kind of controller. Now that we have a way to distinguish between a controller that supports split operations and one that do not, let's support both. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> --- drivers/mtd/nand/raw/nand_base.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)