Skip to content

Commit f9a6abb

Browse files
committed
nrf5x_bsim: Add the board nrf53_cpunet_bsim
The board models the nrf53840 cpunet. Signed-off-by: Aurora Sletnes Bjørlo <[email protected]>
1 parent 651fbbe commit f9a6abb

File tree

7 files changed

+120
-7
lines changed

7 files changed

+120
-7
lines changed

boards/posix/nrf5x_bsim/Kconfig

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
if BOARD_NRF52_BSIM
3+
if BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM
44

55
# The following file is normally parsed only for the ARM architecture, which is
66
# used by Nordic SoCs, so to make the symbols defined in this file available for
7-
# the simulated nrf52_bsim board, which uses the POSIX architecture, the file
7+
# the simulated nrf5x_bsim board, which uses the POSIX architecture, the file
88
# must be read also from here.
99
source "soc/arm/nordic_nrf/Kconfig.peripherals"
1010

11-
comment "NRF52_BSIM options"
11+
comment "NRF5X_BSIM options"
1212

1313
config PRINTK_HOOK_INIT_PRIORITY
1414
int
1515
default 50
1616
help
1717
Just the driver init priority
1818

19-
endif # BOARD_NRF52_BSIM
19+
endif # BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM
2020

2121

2222
# This would eventually be shared by a possible family of simulated NRF boards
@@ -34,3 +34,9 @@ config SOC_SERIES_BSIM_NRF52X
3434
depends on SOC_SERIES_BSIM_NRFXX
3535
help
3636
Any NRF52 simulated SOC with BabbleSim, based on the POSIX arch
37+
38+
config SOC_SERIES_BSIM_NRF53X
39+
bool
40+
depends on SOC_SERIES_BSIM_NRFXX
41+
help
42+
Any NRF53 simulated SOC with BabbleSim, based on the POSIX arch

boards/posix/nrf5x_bsim/Kconfig.board

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,31 @@ config BOARD_NRF52_BSIM
2727
help
2828
Will produce a console Linux process which can be executed natively.
2929
It needs the BabbleSim simulator both in compile time and to execute
30+
31+
config BOARD_NRF53_CPUNET_BSIM
32+
bool "NRF53 simulation model"
33+
select SOC_SERIES_BSIM_NRFXX
34+
select SOC_SERIES_BSIM_NRF53X
35+
select SOC_COMPATIBLE_NRF
36+
select SOC_COMPATIBLE_NRF53X_CPUNET
37+
select SOC_COMPATIBLE_NRF5340_CPUNET
38+
select CONSOLE_HAS_DRIVER
39+
select NRF_RTC_TIMER
40+
select CLOCK_CONTROL
41+
# Indicate that the nRF RNG peripheral is present (actually a model
42+
# of it), so that the corresponding driver becomes available (see
43+
# dependencies of the ENTROPY_NRF5_RNG option).
44+
select HAS_HW_NRF_RNG
45+
# Indicate that CCM supports 8 bit length field, to support full
46+
# length LL PDUs.
47+
select HAS_HW_NRF_CCM_LFLEN_8BIT
48+
# Indicate 2M support so that Phy procedure can be enabled.
49+
select HAS_HW_NRF_RADIO_BLE_2M
50+
# Do the same for the CLOCK and POWER peripherals, so that the nrfx
51+
# drivers for them can be used.
52+
select HAS_HW_NRF_CLOCK
53+
select HAS_HW_NRF_POWER
54+
select HAS_NRFX
55+
help
56+
Will produce a console Linux process which can be executed natively.
57+
It needs the BabbleSim simulator both in compile time and to execute

boards/posix/nrf5x_bsim/Kconfig.defconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
if BOARD_NRF52_BSIM
3+
if BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM
44

55
config BUILD_OUTPUT_BIN
66
default n
@@ -12,7 +12,8 @@ config OUTPUT_PRINT_MEMORY_USAGE
1212
default n
1313

1414
config BOARD
15-
default "nrf52_bsim"
15+
default "nrf52_bsim" if BOARD_NRF52_BSIM
16+
default "nrf53_cpunet_bsim" if BOARD_NRF53_CPUNET_BSIM
1617

1718
config BT_CTLR
1819
default y
@@ -26,4 +27,4 @@ config LOG_BACKEND_NATIVE_POSIX
2627

2728
endif # LOG
2829

29-
endif # BOARD_NRF52_BSIM
30+
endif # BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2020 Linaro Limited.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <arm/nordic/nrf5340_cpunet.dtsi>
10+
11+
/ {
12+
model = "nrf53 cpunet bsim";
13+
compatible = "bsim,nrf5340_cpunet";
14+
15+
/* We need to remove aliases to nodes we delete */
16+
aliases {
17+
/delete-property/ i2c-0;
18+
/delete-property/ spi-0;
19+
/delete-property/ uart-0;
20+
/delete-property/ gpio-0;
21+
/delete-property/ gpio-1;
22+
/delete-property/ gpiote-0;
23+
/delete-property/ wdt-0;
24+
};
25+
26+
chosen {
27+
/delete-property/ zephyr,flash-controller;
28+
};
29+
30+
cpus {
31+
cpu@1 {
32+
/delete-node/ mpu@e000ed90;
33+
};
34+
};
35+
36+
soc {
37+
/delete-node/ memory@20000000;
38+
/delete-node/ memory@21000000;
39+
/delete-node/ uart@41013000;
40+
/delete-node/ gpiote@4100a000;
41+
/delete-node/ gpio@418c0500;
42+
/delete-node/ gpio@418c0800;
43+
/delete-node/ i2c@41013000;
44+
/delete-node/ spi@41013000;
45+
/delete-node/ temp@41010000;
46+
/delete-node/ watchdog@4100b000;
47+
};
48+
49+
/delete-node/ flash-controller@41080000;
50+
/delete-node/ sw-pwm;
51+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
identifier: nrf53_cpunet_bsim
2+
name: NRF53 CPUNET BabbleSim board
3+
type: native
4+
arch: posix
5+
env:
6+
- BSIM_OUT_PATH
7+
toolchain:
8+
- zephyr
9+
testing:
10+
ignore_tags:
11+
- drivers
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_SOC_POSIX=y
4+
CONFIG_BOARD_NRF53_CPUNET_BSIM=y
5+
CONFIG_CONSOLE=y
6+
CONFIG_NO_OPTIMIZATIONS=y
7+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32768
8+
# For this board we can log immediately without any problem
9+
# Doing so will be nicer for debugging
10+
CONFIG_LOG_MODE_IMMEDIATE=y

soc/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ config SOC_COMPATIBLE_NRF52X
3030
config SOC_COMPATIBLE_NRF52832
3131
bool
3232

33+
config SOC_COMPATIBLE_NRF53X_CPUNET
34+
bool
35+
36+
config SOC_COMPATIBLE_NRF5340_CPUNET
37+
bool
38+
3339
#
3440
# SOC_*_LD: SoC specific Linker script additions
3541
#

0 commit comments

Comments
 (0)