From: Albert Ou Date: Tue, 2 May 2017 19:07:37 +0000 (-0700) Subject: spi: Fix io.port.dq(3) output enable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eea10f51294af8529b278ea88660037d065495b4;p=sifive-blocks.git 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. --- 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