Commit Graph

20 Commits

Author SHA1 Message Date
Michael Cardell Widerkrantz
709a4449ff
testfw: clang format 2023-03-16 15:08:36 +01:00
Michael Cardell Widerkrantz
8665031bb4
fw/testfw: Simplify hexdump 2023-03-16 14:26:13 +01:00
Daniel Lublin
7a97f1ee5f
Add more complete fw_ram test; let testfw have stack in RAM
Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-03-14 11:21:47 +01:00
Daniel Lublin
c1fffcb70b
Keep uninitialized var in main, not globally, preventing any BSS
Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-03-14 10:25:02 +01:00
Michael Cardell Widerkrantz
56e34b3add
fw/testfw: Use fw_ram for firmware stack
This means firmware's stack shouldn't be accessible to programs
running in app_mode.

It also means we don't need to take special care of secure_ctx which
can now be an ordinary stack variable.

Nonetheless we zero out secure_ctx after final use and inline some
assembler to zero out the entire fw_ram after use, just before
switching to app_mode.

Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-03-14 10:25:02 +01:00
Michael Cardell Widerkrantz
b34fdbcd37
testfw: Use wordcpy_s() and memcpy_s()
Use new wordcpy_s() and memcpy_s() functions from lib.c.

Add a local memcpy() which compiling with -Os seems to demand. Why?

Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-03-14 10:25:01 +01:00
Daniel Lublin
eea8923170 Update fw & testfw to new api
Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-01-30 15:48:57 +01:00
Daniel Lublin
c1b71b7ba6
testfw: test that UDI can't be read app-mode 2022-12-20 12:06:07 +01:00
Daniel Lublin
11c8eec7b8
testfw: use define and simplify 2022-12-20 12:06:07 +01:00
Daniel Lublin
9b9a125c66
Purge UDA; never implemented, now deprecated
Fixes #58

Signed-off-by: Daniel Lublin <daniel@lublin.se>
2022-12-19 14:32:01 +01:00
Michael Cardell Widerkrantz
08e1438d1e
fw: Add support for blake2s MMIO
In firmware we store the address to firmware blake2s() function at
TK1_MMIO_TK1_BLAKE2S so app can use this firmware function sort of
like a system call but without context switch.
2022-12-15 12:59:52 +01:00
Michael Cardell Widerkrantz
3220d1c119
testfw: Remove test_ prefix on UART functions 2022-12-02 16:12:25 +01:00
Daniel Lublin
85ef93cd3c
Clarify switch_app reads and writes; add read test to testfw 2022-10-26 11:38:58 +02:00
Daniel Lublin
4b4f014d38
Rename to TK1 2022-10-26 09:20:02 +02:00
Daniel Lublin
65f2272a45
Add TRNG to testfw, document 2022-10-20 12:05:19 +02:00
Michael Cardell Widerkrantz
c52f7d52cd
testfw: Add timer tests 2022-10-20 11:34:01 +02:00
Daniel Lublin
69c3f77e5e
testfw: tidy, clean-up, fmt 2022-10-17 11:15:26 +02:00
Joachim Strömbergson
5e5550461f
Removing confusing negation in message 2022-10-13 13:56:12 +02:00
Joachim Strömbergson
1f2a585aba
Add test case for fw_ram 2022-10-13 13:16:11 +02:00
Joachim Strömbergson
715de60f4a Make initial public release 2022-09-19 08:51:11 +02:00