trabucayre / openFPGALoader

Universal utility for programming FPGA
https://trabucayre.github.io/openFPGALoader/
Apache License 2.0
1.15k stars 248 forks source link

[Request] Add support for ECP5 key programming #207

Open el-coder-sb opened 2 years ago

el-coder-sb commented 2 years ago

Would be great to support key programming for the Lattice ECP5 (key is OTP and non-volatile).

In ECP5 FPGA-TN-02202-1.7 are some information about key programming. The following parts might be of importance:

The OTP fuses require a complicated if-then-else pass/fail decision tree programming flow. The following files cannot support programming of the OTP fuses because of their simple go/no-go only pass/fail format.

  • SVF files for IEEE 1149.1 BSCAN tools

Instead, Lattice provides users the following methods to program the key code: ...

  • Onboard programming using STAPL files for third-party BSCAN tools

If there is a simple way to run STAPL file with openFPGALoader this way might work.

Nevertheless we made experience that programming keys does work with simple SVF files as well. That´s why I think that enabling svf support for lattice devices would do the job. It seems to me like openFPGALoader already supports this for Intel FPGAs, is that right?

Furthermore just some quick information about key programming on Lattice FPGA: There is no bitstream file o similar thing. It does exist only a xcf file (file format for Lattice Diamond Programmer) which contains the key and the operation string. But one can convert this into a svf file.

trabucayre commented 2 years ago

It's true: since encrypted is handled by openFPGALoader it make sense to have abillity to program key into the dedicated register. STAPL is a bit complex file type (obfuscatied?) it's more logic to implement correct alogrithm. I have to read specifics documentations and maybe to compare with the way used for machXO devices. Thanks