mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-02 19:56:11 -04:00
fw: Introduce reset()
- New function reset.c:reset(). Move code from syscall handler switch to this function. - Rename resetinfo.h to reset.h.
This commit is contained in:
parent
9d1bbffbaa
commit
f373ad3f68
9 changed files with 57 additions and 36 deletions
30
hw/application_fpga/fw/tk1/reset.h
Normal file
30
hw/application_fpga/fw/tk1/reset.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright (C) 2025 - Tillitis AB
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
#ifndef TKEY_RESET_H
|
||||
#define TKEY_RESET_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define TK1_MMIO_RESETINFO_BASE 0xd0000f00
|
||||
#define TK1_MMIO_RESETINFO_SIZE 0x100
|
||||
|
||||
enum reset_start {
|
||||
START_DEFAULT = 0, // Probably cold boot
|
||||
START_FLASH0 = 1,
|
||||
START_FLASH1 = 2,
|
||||
START_FLASH0_VER = 3,
|
||||
START_FLASH1_VER = 4,
|
||||
START_CLIENT = 5,
|
||||
START_CLIENT_VER = 6,
|
||||
};
|
||||
|
||||
struct reset {
|
||||
uint32_t type; // Reset type
|
||||
uint8_t app_digest[32]; // Program digest
|
||||
uint8_t next_app_data[220]; // Data to leave around for next app
|
||||
};
|
||||
|
||||
int reset(struct reset *userreset, size_t nextlen);
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue