tillitis / tillitis-key1

Board designs, FPGA verilog, firmware for TKey, the flexible and open USB security key 🔑
https://www.tillitis.se
394 stars 24 forks source link

FPGA: Add system reset API #242

Closed secworks closed 1 month ago

secworks commented 3 months ago
  Add API address to trigger system reset.
  When written to will send system_reset signal
  to the reset generator, which then perform a complete
  reset cycle of the FPGA system.
secworks commented 3 months ago

Note that this implementation does not look at the mode. This means that both a device app and FW could trigger reset. Not sure if that is something want. It made the implementation less complex.

Also, this function dropped the clock frequency somewhat. We could try an add a register to cut combinational logic.

dehanj commented 3 months ago

Are we missing a define in tk1_mem.h?

Should it be defined like this in tk1_mem.h?

define TK1_MMIO_TK1_SYSTEM_RESET 0xff0001C0

secworks commented 3 months ago

Are we missing a define in tk1_mem.h?

Should it be defined like this in tk1_mem.h? #define TK1_MMIO_TK1_SYSTEM_RESET 0xff0001C0

Ah! Yes. And Yes.

dehanj commented 3 months ago

Did a quick test and from what I can see it works as how I expected it to.

mchack-work commented 3 months ago

I'd like to see an update to hw/application_fpga/core/tk1/README.md describing the API to do a system reset, hopefully also describing exactly what is being reset.

secworks commented 2 months ago

Added description of system reset API in README. Including what is reset and what happens after a reset has been triggered.

dehanj commented 1 month ago

Rebased, squashed, verified.