Skip to content

Commit f0bac93

Browse files
joerchanrlubos
authored andcommitted
[nrf fromtree] platform: nordic_nrf: Add nrf9161 DK and nrf9120 SoC support
Add support for the nrf9161 development kit and the nrf9120 SoC. Change-Id: I6e3c0a01b80e6d14b4bbc6befb7ab7e75b31ac4b Signed-off-by: Joakim Andersson <[email protected]> (cherry picked from commit 4580baf)
1 parent 5c1378c commit f0bac93

File tree

13 files changed

+377
-0
lines changed

13 files changed

+377
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (c) 2023, Nordic Semiconductor ASA.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
7+
# preload.cmake is used to set things that related to the platform that are both
8+
# immutable and global, which is to say they should apply to any kind of project
9+
# that uses this platform. In practise this is normally compiler definitions and
10+
# variables related to hardware.
11+
12+
# Set architecture and CPU
13+
set(TFM_SYSTEM_PROCESSOR cortex-m33)
14+
set(TFM_SYSTEM_ARCHITECTURE armv8-m.main)
15+
set(TFM_SYSTEM_DSP OFF)
16+
set(CONFIG_TFM_FP_ARCH "fpv5-sp-d16")
17+
18+
add_compile_definitions(
19+
NRF9120_XXAA
20+
NRF91_SERIES
21+
)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# Copyright (c) 2023, Nordic Semiconductor ASA.
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_policy(SET CMP0076 NEW)
8+
set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
9+
set(NRF_BOARD_SELECTED True)
10+
11+
add_subdirectory(../common/nrf91 nrf91)
12+
13+
target_include_directories(platform_region_defs
14+
INTERFACE
15+
../common/nrf91/partition
16+
)
17+
18+
target_sources(platform_s
19+
PRIVATE
20+
$<$<BOOL:${TFM_PARTITION_PLATFORM}>:${CMAKE_CURRENT_SOURCE_DIR}/services/src/tfm_platform_system.c>
21+
)
22+
23+
target_include_directories(platform_s
24+
PUBLIC
25+
.
26+
../common/nrf91/partition
27+
services/include
28+
)
29+
30+
target_include_directories(platform_ns
31+
PUBLIC
32+
.
33+
)
34+
35+
if(BL2)
36+
target_include_directories(platform_bl2
37+
PUBLIC
38+
../common/nrf91/partition
39+
PRIVATE
40+
.
41+
)
42+
endif()
43+
44+
if (TFM_PARTITION_PLATFORM)
45+
install(FILES services/include/tfm_ioctl_api.h
46+
DESTINATION ${TFM_INSTALL_PATH}/interface/include)
47+
endif()
48+
49+
#========================= tfm_spm ============================================#
50+
51+
target_sources(tfm_spm
52+
PRIVATE
53+
tfm_hal_platform.c
54+
)
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
8+
9+
#ifndef __RTE_DEVICE_H
10+
#define __RTE_DEVICE_H
11+
12+
// <e> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART0]
13+
// <i> Configuration settings for Driver_USART0 in component ::Drivers:USART
14+
#define RTE_USART0 1
15+
// <h> Pin Selection (0xFFFFFFFF means Disconnected)
16+
// <o> TXD
17+
#define RTE_USART0_TXD_PIN 27
18+
// <o> RXD
19+
#define RTE_USART0_RXD_PIN 26
20+
// <o> RTS
21+
#define RTE_USART0_RTS_PIN 14
22+
// <o> CTS
23+
#define RTE_USART0_CTS_PIN 15
24+
// </h> Pin Configuration
25+
// </e> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART0]
26+
27+
// <e> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART1]
28+
// <i> Configuration settings for Driver_USART1 in component ::Drivers:USART
29+
#define RTE_USART1 1
30+
// <h> Pin Selection (0xFFFFFFFF means Disconnected)
31+
// <o> TXD
32+
#define RTE_USART1_TXD_PIN 29
33+
// <o> RXD
34+
#define RTE_USART1_RXD_PIN 28
35+
// <o> RTS
36+
#define RTE_USART1_RTS_PIN 16
37+
// <o> CTS
38+
#define RTE_USART1_CTS_PIN 17
39+
// </h> Pin Configuration
40+
// </e> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART1]
41+
42+
// <e> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART2]
43+
// <i> Configuration settings for Driver_USART2 in component ::Drivers:USART
44+
#define RTE_USART2 0
45+
// <h> Pin Selection (0xFFFFFFFF means Disconnected)
46+
// <o> TXD
47+
#define RTE_USART2_TXD_PIN 0xFFFFFFFF
48+
// <o> RXD
49+
#define RTE_USART2_RXD_PIN 0xFFFFFFFF
50+
// <o> RTS
51+
#define RTE_USART2_RTS_PIN 0xFFFFFFFF
52+
// <o> CTS
53+
#define RTE_USART2_CTS_PIN 0xFFFFFFFF
54+
// </h> Pin Configuration
55+
// </e> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART2]
56+
57+
// <e> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART3]
58+
// <i> Configuration settings for Driver_USART3 in component ::Drivers:USART
59+
#define RTE_USART3 0
60+
// <h> Pin Selection (0xFFFFFFFF means Disconnected)
61+
// <o> TXD
62+
#define RTE_USART3_TXD_PIN 0xFFFFFFFF
63+
// <o> RXD
64+
#define RTE_USART3_RXD_PIN 0xFFFFFFFF
65+
// <o> RTS
66+
#define RTE_USART3_RTS_PIN 0xFFFFFFFF
67+
// <o> CTS
68+
#define RTE_USART3_RTS_PIN 0xFFFFFFFF
69+
// </h> Pin Configuration
70+
// </e> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART3]
71+
72+
// <e> FLASH (Flash Memory) [Driver_FLASH0]
73+
// <i> Configuration settings for Driver_FLASH0 in component ::Drivers:FLASH
74+
#define RTE_FLASH0 1
75+
// </e> FLASH (Flash Memory) [Driver_FLASH0]
76+
77+
#endif /* __RTE_DEVICE_H */
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Copyright (c) 2023, Nordic Semiconductor ASA.
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
set(PLATFORM_PATH platform/ext/target/${TFM_PLATFORM}/..)
8+
9+
include(${PLATFORM_PATH}/common/nrf91/config.cmake)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#ifndef __CONFIG_TFM_TARGET_H__
8+
#define __CONFIG_TFM_TARGET_H__
9+
10+
/* Include optional claims in initial attestation token */
11+
#undef ATTEST_INCLUDE_OPTIONAL_CLAIMS
12+
#define ATTEST_INCLUDE_OPTIONAL_CLAIMS 0
13+
14+
#endif /* __CONFIG_TFM_TARGET_H__ */
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#ifndef __ARM_LTD_DEVICE_CFG_H__
8+
#define __ARM_LTD_DEVICE_CFG_H__
9+
10+
/**
11+
* \file device_cfg.h
12+
* \brief
13+
* This is the default device configuration file with all peripherals
14+
* defined and configured to be use via the secure and/or non-secure base
15+
* address.
16+
*/
17+
18+
#define DEFAULT_UART_BAUDRATE 115200
19+
20+
#endif /* __ARM_LTD_DEVICE_CFG_H__ */
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#ifndef NRF_BOARD_H__
8+
#define NRF_BOARD_H__
9+
10+
#include <hal/nrf_gpio.h>
11+
12+
#define BUTTON1_PIN (8UL)
13+
#define BUTTON1_ACTIVE_LEVEL (0UL)
14+
#define BUTTON1_PULL (NRF_GPIO_PIN_PULLUP)
15+
#define LED1_PIN (2UL)
16+
#define LED1_ACTIVE_LEVEL (1UL)
17+
18+
#endif // NRF_BOARD_H__
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Copyright (c) 2023, Nordic Semiconductor ASA.
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
set(PLATFORM_PATH platform/ext/target/${TFM_PLATFORM}/..)
8+
9+
include(${PLATFORM_PATH}/common/nrf9120/preload.cmake)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/** @file
8+
* @brief TFM IOCTL API header.
9+
*/
10+
11+
12+
#ifndef TFM_IOCTL_API_H__
13+
#define TFM_IOCTL_API_H__
14+
15+
/**
16+
* @defgroup tfm_ioctl_api TFM IOCTL API
17+
* @{
18+
*
19+
*/
20+
21+
#include <limits.h>
22+
#include <stdint.h>
23+
#include <tfm_api.h>
24+
#include <tfm_platform_api.h>
25+
26+
/* Include core IOCTL services */
27+
#include <tfm_ioctl_core_api.h>
28+
29+
#ifdef __cplusplus
30+
extern "C" {
31+
#endif
32+
33+
/* Board specific IOCTL services can be added here */
34+
35+
#ifdef __cplusplus
36+
}
37+
#endif
38+
39+
/**
40+
* @}
41+
*/
42+
43+
#endif /* TFM_IOCTL_API_H__ */
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#ifndef TFM_READ_RANGES_H__
8+
#define TFM_READ_RANGES_H__
9+
10+
#include <tfm_ioctl_core_api.h>
11+
12+
#include "nrf.h"
13+
14+
#define FICR_BASE NRF_FICR_S_BASE
15+
16+
#define FICR_INFO_ADDR (FICR_BASE + offsetof(NRF_FICR_Type, INFO))
17+
#define FICR_INFO_SIZE (sizeof(FICR_INFO_Type))
18+
19+
/* Used by nrf_erratas.h */
20+
#define FICR_RESTRICTED_ADDR (FICR_BASE + 0x130)
21+
#define FICR_RESTRICTED_SIZE 0x8
22+
23+
static const struct tfm_read_service_range ranges[] = {
24+
{ .start = FICR_INFO_ADDR, .size = FICR_INFO_SIZE },
25+
{ .start = FICR_RESTRICTED_ADDR, .size = FICR_RESTRICTED_SIZE },
26+
};
27+
28+
#endif /* TFM_READ_RANGES_H__ */

0 commit comments

Comments
 (0)