Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: aspeed: Enable Quad SPI mode for page program

Ensure the controller switches to quad I/O mode when
spi-tx-bus-width dts property is 4 and the Quad SPI program
opcode (32h or 34h) is used. Without this change, high-bit
data will be lost during page programming.

Signed-off-by: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Link: https://patch.msgid.link/20251114101042.1520997-3-chin-ting_kuo@aspeedtech.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Chin-Ting Kuo and committed by
Mark Brown
716d0a0a c94f1347

+4
+4
drivers/spi/spi-aspeed-smc.c
··· 263 263 const struct spi_mem_op *op) 264 264 { 265 265 int ret; 266 + int io_mode = aspeed_spi_get_io_mode(op); 266 267 267 268 aspeed_spi_start_user(chip); 268 269 ret = aspeed_spi_send_cmd_addr(chip, op->addr.nbytes, op->addr.val, op->cmd.opcode); 269 270 if (ret < 0) 270 271 goto stop_user; 272 + 273 + aspeed_spi_set_io_mode(chip, io_mode); 274 + 271 275 aspeed_spi_write_to_ahb(chip->ahb_base, op->data.buf.out, op->data.nbytes); 272 276 stop_user: 273 277 aspeed_spi_stop_user(chip);