Contiki-NG
Loading...
Searching...
No Matches
tz-ns-cfg.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2026, RISE Research Institutes of Sweden
3
* All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
7
* are met:
8
*
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
*
12
* 2. Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
15
*
16
* 3. Neither the name of the copyright holder nor the names of its
17
* contributors may be used to endorse or promote products derived
18
* from this software without specific prior written permission.
19
*
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31
* OF THE POSSIBILITY OF SUCH DAMAGE.
32
*/
33
34
/**
35
* \file
36
* Normal-world nRF5340 hooks for the TrustZone API.
37
*
38
* Provides the NS-side wake mechanism that the secure side pends
39
* via tz_arch_signal_ns. EGU0_IRQn is borrowed as a software-only
40
* doorbell: the EGU peripheral itself is unused, only its NVIC slot.
41
*/
42
43
#include "contiki.h"
44
#include "
trustzone/normal/tz-normal.h
"
45
46
#include <nrfx.h>
47
48
/*---------------------------------------------------------------------------*/
49
void
50
tz_arch_init_ns_signal
(
void
)
51
{
52
/*
53
* Do not clear pending before enabling: the only source of an EGU0
54
* pending bit is a deliberate tz_arch_signal_ns() from secure code,
55
* so clearing here would silently discard a legitimate wake request.
56
*/
57
NVIC_EnableIRQ(EGU0_IRQn);
58
}
59
/*---------------------------------------------------------------------------*/
60
void
61
EGU0_IRQHandler(
void
)
62
{
63
tz_normal_request_poll();
64
}
65
/*---------------------------------------------------------------------------*/
tz-normal.h
Normal-world TrustZone API hooks.
tz_arch_init_ns_signal
void tz_arch_init_ns_signal(void)
Initialize the platform-specific mechanism that delivers secure-side wake-up requests to the normal w...
Definition
tz-ns-cfg.c:50
arch
cpu
nrf
nrf5340
tz-ns-cfg.c
Generated on Wed Jun 3 2026 15:14:14 for Contiki-NG by
1.10.0