From eea10f51294af8529b278ea88660037d065495b4 Mon Sep 17 00:00:00 2001 From: Albert Ou Date: Tue, 2 May 2017 12:07:37 -0700 Subject: [PATCH] spi: Fix io.port.dq(3) output enable Issue: The output enable signal for DQ[3] is not driven properly. Symptoms: Output data from master to slave is not properly transmitted in quad mode. Data received from the slave is unaffected. Workaround: When interfacing with SPI flash devices, do not use the "Quad Input/Output Fast Read" command (opcode 0xEB) while in the Extended SPI protocol. Do not use the Native Quad SPI protocol. --- src/main/scala/devices/spi/SPIPhysical.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/devices/spi/SPIPhysical.scala b/src/main/scala/devices/spi/SPIPhysical.scala index 802233d..a9ce076 100644 --- a/src/main/scala/devices/spi/SPIPhysical.scala +++ b/src/main/scala/devices/spi/SPIPhysical.scala @@ -82,7 +82,7 @@ class SPIPhysical(c: SPIParamsBase) extends Module { } val tx = (ctrl.fmt.iodir === SPIDirection.Tx) - val txen_in = (proto.head +: proto.tail.map(_ && tx)).scanRight(Bool(false))(_ || _) + val txen_in = (proto.head +: proto.tail.map(_ && tx)).scanRight(Bool(false))(_ || _).init val txen = txen_in :+ txen_in.last io.port.sck := sck -- 2.30.2