added spi 1-bit mode, code from litex#88
Conversation
jordens
left a comment
There was a problem hiding this comment.
There mus be a way to support this without duplicating the entire code.
|
There might be but is it worth? This solution is cleaner IMHO. |
|
Thanks for submitting this PR. |
| self.specials.dq = dq.get_tristate(pads.dq) | ||
| else: | ||
| dq = SpiIF(pads.miso, pads.mosi, Signal()) | ||
| with_bitbang = False |
There was a problem hiding this comment.
Disabling with_bitbang silently like this doesn't sound like a good idea.
There was a problem hiding this comment.
ok, what about:
assert with_bitbang == False, "Bitbang not supported with 1-bit SPI flash."
?
| else: | ||
| dq = SpiIF(pads.miso, pads.mosi, Signal()) | ||
| assert with_bitbang == False, \ | ||
| "Bitbang not supported with 1-bit SPI flash." |
There was a problem hiding this comment.
Because it was not working out of the box because of this line:
https://github.com/m-labs/misoc/blob/master/misoc/cores/spi_flash.py#L85
so I didn't implement it.
If you can explain the code, I can try to implement it.
|
@danielkucera ping |
|
@jordens what ping? I don't understand the bitbang code and with bitbang enabled, the code was failing. So I added an assert. Take it, leave it or explain the code. |
|
@danielkucera The line you refer to does exactly what you are doing (take miso for 1-wide SPI) just in bitbang mode. The bigbang code is originally by @fallen but has gone through a few hands. |
|
@jordens , I've read it about 50 times but still I don't understand. Moreover I cannot test the code in 2,4-bit mode because I don't have such hardware so I'd rather not do any additional changes to the code. |
as suggested in #87