From 77be1f2fa6a18afc0d9111b2e4880fd4bacca02a Mon Sep 17 00:00:00 2001 From: Premal Gajjar Date: Mon, 24 Feb 2025 19:16:13 +0530 Subject: [PATCH] =?UTF-8?q?Fix=20TXFIFO=20register=20write=20and=20timeout?= =?UTF-8?q?=20message=20Changes:=20-=20Fixed=20incorrect=20register=20writ?= =?UTF-8?q?e=20for=20TXFIFO=20invalidation=20(FSPI=5FIPRXFCR=20=E2=86=92?= =?UTF-8?q?=20FSPI=5FIPTXFCR).=20-=20Corrected=20error=20message=20for=20T?= =?UTF-8?q?XFIFO=20wait=20timeout=20(FSPI=5FINTR=5FIPRXWA=20=E2=86=92=20FS?= =?UTF-8?q?PI=5FINTR=5FIPTXWE).=20-=20Corrected=20comment=20for=20TXFIFO?= =?UTF-8?q?=20available=20(RXFIFO=20->=20TXFIFO)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: imp@FreeBSD.org Reviewed-by: jlduran@FreeBSD.org Pull-request: https://github.com/freebsd/freebsd-src/pull/1604 --- sys/dev/flash/flexspi/flex_spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/flash/flexspi/flex_spi.c b/sys/dev/flash/flexspi/flex_spi.c index 9382b237ee7..44246f4b1c2 100644 --- a/sys/dev/flash/flexspi/flex_spi.c +++ b/sys/dev/flash/flexspi/flex_spi.c @@ -329,20 +329,20 @@ flex_spi_write_txfifo(struct flex_spi_softc *sc, uint8_t *buf, uint8_t size) int i, ret, reg; /* invalid the TXFIFO */ - write_reg(sc, FSPI_IPRXFCR, FSPI_IPTXFCR_CLR); + write_reg(sc, FSPI_IPTXFCR, FSPI_IPTXFCR_CLR); /* * Default value of water mark level is 8 bytes, hence in single * read request controller can read max 8 bytes of data. */ for (i = 0; i < size; i += 4) { - /* Wait for RXFIFO available */ + /* Wait for TXFIFO available */ if (i % 8 == 0) { ret = reg_read_poll_tout(sc, FSPI_INTR, FSPI_INTR_IPTXWE, 1, 50000, 1); if (ret) device_printf(sc->dev, - "timed out waiting for FSPI_INTR_IPRXWA\n"); + "timed out waiting for FSPI_INTR_IPTXWE\n"); } if (size >= (i + 4))