pad = getattr(pins, "dq%d" % i)
comb += pad.o.eq(self.dq_out[i])
comb += pad.oe.eq(self.dq_direction[i])
- comb += pad.o_clk.eq(ClockSignal())
comb += self.dq_in[i].eq(pad.i)
- comb += pad.i_clk.eq(ClockSignal())
+ # ECP5 needs special handling for the SPI clock, sigh.
+ if self.lattice_ecp5_usrmclk:
+ comb += pad.o_clk.eq(ClockSignal())
+ comb += pad.i_clk.eq(ClockSignal())
# XXX invert handled by SPIFlashResource
comb += pins.cs_n.eq(self.cs_n_out)
# ECP5 needs special handling for the SPI clock, sigh.