From 4a3fdb2540f96325f8d3ed222dfa780261354184 Mon Sep 17 00:00:00 2001 From: Wills Wang Date: Mon, 6 Feb 2023 14:10:30 +0800 Subject: [PATCH] fix spi nand write error on HYF4GQ4U --- spinand.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spinand.c b/spinand.c index 5b56dea..8510b83 100644 --- a/spinand.c +++ b/spinand.c @@ -400,6 +400,9 @@ static void spinand_helper_write(struct xfel_ctx_t * ctx, struct spinand_pdata_t addr += n; buf += n; count -= n; + + if(!count) + break; } cbuf[clen++] = SPI_CMD_END; fel_write(ctx, pdat->swapbuf, txbuf, txlen);