-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
secure_services_ns.c
40 lines (34 loc) · 1.21 KB
/
secure_services_ns.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
*/
#include <autoconf.h>
#include <secure_services.h>
#include <toolchain.h>
#include <fw_info.h>
#ifdef CONFIG_SPM_SERVICE_REBOOT
NRF_NSE(void, spm_request_system_reboot);
/* Overrides the weak ARM implementation:
* Call into secure firmware if in the non-secure firmware since the non-secure
* firmware is not allowed to directly reboot the system.
*/
void sys_arch_reboot(int type)
{
ARG_UNUSED(type);
spm_request_system_reboot();
}
#endif /* CONFIG_SPM_SERVICE_REBOOT */
#ifdef CONFIG_SPM_SERVICE_RNG
NRF_NSE(int, spm_request_random_number, uint8_t *output, size_t len,
size_t *olen);
#endif /* CONFIG_SPM_SERVICE_RNG */
#ifdef CONFIG_SPM_SERVICE_READ
NRF_NSE(int, spm_request_read, void *destination, uint32_t addr, size_t len);
#endif /* CONFIG_SPM_SERVICE_READ */
#ifdef CONFIG_SPM_SERVICE_FIND_FIRMWARE_INFO
NRF_NSE(int, spm_firmware_info, uint32_t fw_address, struct fw_info *info);
#endif /* CONFIG_SPM_SERVICE_FIND_FIRMWARE_INFO */
#ifdef CONFIG_SPM_SERVICE_PREVALIDATE
NRF_NSE(int, spm_prevalidate_b1_upgrade, uint32_t dst_addr, uint32_t src_addr);
#endif /* CONFIG_SPM_SERVICE_PREVALIDATE */