Open el-coder-sb opened 2 years ago
Sorry for delay. spiOverJtag for altera use an virtual jtag primitive: the use of this is to address one primitive based on the address (more than one primitive may be present into the gateware): it's why shiftIR is used, the shiftDR following is used to send command. VDR is after, used to send a buffer (for example when you write a page you have to send 3bytes for address followed by data 256bytes). The primitive provides some specifics signals used to control CS. It's always possible to send a burst command + address + buffer directly using virtualDR but I'm not sure it's possible to correctly address primitive used by spiOverJtag nor controling CS. I'm agree in some case with this approach openFPGALoader spend too much time with the Jtag FSM.
In fact I'm not really happy by this implementation: there is some known issues (with chain with more than one device for example) but cyclone hasn't internal OSC so it's maybe not possible to have better approach. But at least I have to check if it's possible to drop VDR when transaction is limited to command without data.
Concerning altera's way to program external flash: it's seems to have a dedicated (not documented) bloc used as passtrhu.
but cyclone hasn't internal OSC so it's maybe not possible to have better approach
Cyclone III/IV/10LP has internal OSC: cycloneiii_oscillator(oscena,clkout), cycloneiv_oscillator(oscena,clkout), cyclone10lp_oscillator(oscena,clkout), cyclone***_oscillator(oscena,clkout)
, 40-80 MHz.
It's true: I suppose I have to create two variant: one for cyclone with oscillator and one for family without.
I noticed that IMHO there are unneccessary shiftVIR calls. Removing them (in consecutive calls) could speed up the flash programming.
My opinion is based on results comparing svf file, generated with Quartus, with the oFL behavior.
shiftVIR vs shiftVDR
First I´d like to discuss something related to this topic: In the svf file the write_enable and bulk_erase commands are shifted after selecting USER0 VDR. While oFL does it after selecting USER1 VIR, right? (e.g. Altera::spi_put)
What does determine which register to use? Why are there differences between oFL and Quartus?
I´d like to get some further understanding on this.
svf file:
Altera::spi_put without calling shiftVIR
Regarding the unnecessary shiftVIR calls: As you can see between two page program operations there is no SIR shifting at all. May be this can be done in oFL this way?
As mentioned above I need some further understanding. Afterwards I should be able to provide some patches/help.
svf file: