Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
/boards/nios2/altera_max10/ @nashif
/boards/arm/stm32_min_dev/ @cbsiddharth
/boards/posix/ @aescolar @daor-oti
/boards/posix/nrf52_bsim/ @aescolar @wopu-ot
/boards/posix/nrf5x_bsim/ @aescolar @wopu-ot
/boards/riscv/ @kgugala @pgielda
/boards/riscv/rv32m1_vega/ @MaureenHelm
/boards/shields/ @erwango
Expand Down
29 changes: 0 additions & 29 deletions boards/posix/nrf52_bsim/Kconfig.board

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# SPDX-License-Identifier: Apache-2.0

if BOARD_NRF52_BSIM
if BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM

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

comment "NRF52_BSIM options"
comment "NRF5X_BSIM options"

config PRINTK_HOOK_INIT_PRIORITY
int
default 50
help
Just the driver init priority

endif # BOARD_NRF52_BSIM
endif # BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM


# This would eventually be shared by a possible family of simulated NRF boards
Expand All @@ -34,3 +34,9 @@ config SOC_SERIES_BSIM_NRF52X
depends on SOC_SERIES_BSIM_NRFXX
help
Any NRF52 simulated SOC with BabbleSim, based on the POSIX arch

config SOC_SERIES_BSIM_NRF53X
bool
depends on SOC_SERIES_BSIM_NRFXX
help
Any NRF53 simulated SOC with BabbleSim, based on the POSIX arch
59 changes: 59 additions & 0 deletions boards/posix/nrf5x_bsim/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# SPDX-License-Identifier: Apache-2.0

config BOARD_NRF52_BSIM
bool "NRF52 simulation model"
select SOC_SERIES_BSIM_NRFXX
select SOC_SERIES_BSIM_NRF52X
select SOC_COMPATIBLE_NRF
select SOC_COMPATIBLE_NRF52X
select SOC_COMPATIBLE_NRF52832
select SOC_COMPATIBLE_BSIM
select CONSOLE_HAS_DRIVER
select NRF_RTC_TIMER
select CLOCK_CONTROL
# Indicate that the nRF RNG peripheral is present (actually a model
# of it), so that the corresponding driver becomes available (see
# dependencies of the ENTROPY_NRF5_RNG option).
select HAS_HW_NRF_RNG
# Indicate that CCM supports 8 bit length field, to support full
# length LL PDUs.
select HAS_HW_NRF_CCM_LFLEN_8BIT
# Indicate 2M support so that Phy procedure can be enabled.
select HAS_HW_NRF_RADIO_BLE_2M
# Do the same for the CLOCK and POWER peripherals, so that the nrfx
# drivers for them can be used.
select HAS_HW_NRF_CLOCK
select HAS_HW_NRF_POWER
select HAS_NRFX
help
Will produce a console Linux process which can be executed natively.
It needs the BabbleSim simulator both in compile time and to execute

config BOARD_NRF53_CPUNET_BSIM
bool "NRF53 simulation model"
select SOC_SERIES_BSIM_NRFXX
select SOC_SERIES_BSIM_NRF53X
select SOC_COMPATIBLE_NRF
select SOC_COMPATIBLE_NRF53X_CPUNET
select SOC_COMPATIBLE_NRF5340_CPUNET
select SOC_COMPATIBLE_BSIM
select CONSOLE_HAS_DRIVER
select NRF_RTC_TIMER
select CLOCK_CONTROL
# Indicate that the nRF RNG peripheral is present (actually a model
# of it), so that the corresponding driver becomes available (see
# dependencies of the ENTROPY_NRF5_RNG option).
select HAS_HW_NRF_RNG
# Indicate that CCM supports 8 bit length field, to support full
# length LL PDUs.
select HAS_HW_NRF_CCM_LFLEN_8BIT
# Indicate 2M support so that Phy procedure can be enabled.
select HAS_HW_NRF_RADIO_BLE_2M
# Do the same for the CLOCK and POWER peripherals, so that the nrfx
# drivers for them can be used.
select HAS_HW_NRF_CLOCK
select HAS_HW_NRF_POWER
select HAS_NRFX
help
Will produce a console Linux process which can be executed natively.
It needs the BabbleSim simulator both in compile time and to execute
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

if BOARD_NRF52_BSIM
if BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM

config BUILD_OUTPUT_BIN
default n
Expand All @@ -12,7 +12,8 @@ config OUTPUT_PRINT_MEMORY_USAGE
default n

config BOARD
default "nrf52_bsim"
default "nrf52_bsim" if BOARD_NRF52_BSIM
default "nrf53_cpunet_bsim" if BOARD_NRF53_CPUNET_BSIM

config BT_CTLR
default y
Expand All @@ -26,4 +27,4 @@ config LOG_BACKEND_NATIVE_POSIX

endif # LOG

endif # BOARD_NRF52_BSIM
endif # BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,42 @@ static struct _isr_list irq_vector_table[NRF_HW_NBR_IRQs];

static int currently_running_irq = -1;

#if defined(CONFIG_SOC_SERIES_NRF53X) || \
defined(CONFIG_SOC_COMPATIBLE_NRF53X_CPUNET) || \
defined(NRF53_SERIES)
const char *irqnames[] = { /*just for the traces*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may consider adding the remaining IRQ names as well, see nrf5340_network.h.

  • IPC
  • EGU

"", /*0 */
"", /*1 */
"", /*2 */
"", /*3 */
"", /*4 */
"POWER_CLOCK", /*5 */
"", /*6 */
"", /*7 */
"RADIO", /*8 */
"RNG", /*9 */
"GPIOTE", /*10*/
"WDT", /*11*/
"TIMER0", /*12*/
"ECB", /*13*/
"CCM_AAR", /*14*/
"", /*15*/
"TEMP", /*16*/
"RTC0", /*17*/
"IPC", /*18*/
"UART0, SPI0, SPI1, TWI0, TWI1", /*19*/
"EGU0", /*20*/
"", /*21*/
"RTC1", /*22*/
"", /*23*/
"TIMER1", /*24*/
"TIMER2", /*25*/
"SWI0", /*26*/
"SWI1", /*27*/
"SWI2", /*28*/
"SWI3" /*29*/
};
#else
const char *irqnames[] = { /*just for the traces*/
"POWER_CLOCK", /*0 */
"RADIO", /*1 */
Expand Down Expand Up @@ -68,6 +104,7 @@ const char *irqnames[] = { /*just for the traces*/
"I2S", /*35*/
"FPU" /*36*/
};
#endif /*nrf53*/

static inline void vector_to_irq(int irq_nbr, int *may_swap)
{
Expand Down
File renamed without changes.
51 changes: 51 additions & 0 deletions boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2020 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <arm/nordic/nrf5340_cpunet.dtsi>

/ {
model = "nrf53 cpunet bsim";
compatible = "bsim,nrf5340_cpunet";

/* We need to remove aliases to nodes we delete */
aliases {
/delete-property/ i2c-0;
/delete-property/ spi-0;
/delete-property/ uart-0;
/delete-property/ gpio-0;
/delete-property/ gpio-1;
/delete-property/ gpiote-0;
/delete-property/ wdt-0;
};

chosen {
/delete-property/ zephyr,flash-controller;
};

cpus {
cpu@1 {
/delete-node/ mpu@e000ed90;
};
};

soc {
/delete-node/ memory@20000000;
/delete-node/ memory@21000000;
/delete-node/ uart@41013000;
/delete-node/ gpiote@4100a000;
/delete-node/ gpio@418c0500;
/delete-node/ gpio@418c0800;
/delete-node/ i2c@41013000;
/delete-node/ spi@41013000;
/delete-node/ temp@41010000;
/delete-node/ watchdog@4100b000;
};

/delete-node/ flash-controller@41080000;
/delete-node/ sw-pwm;
};
11 changes: 11 additions & 0 deletions boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
identifier: nrf53_cpunet_bsim
name: NRF53 CPUNET BabbleSim board
type: native
arch: posix
env:
- BSIM_OUT_PATH
toolchain:
- zephyr
testing:
ignore_tags:
- drivers
10 changes: 10 additions & 0 deletions boards/posix/nrf5x_bsim/nrf53_cpunet_bsim_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_POSIX=y
CONFIG_BOARD_NRF53_CPUNET_BSIM=y
CONFIG_CONSOLE=y
CONFIG_NO_OPTIMIZATIONS=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32768
# For this board we can log immediately without any problem
# Doing so will be nicer for debugging
CONFIG_LOG_MODE_IMMEDIATE=y
25 changes: 13 additions & 12 deletions modules/hal_nordic/nrfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ zephyr_include_directories(${MDK_DIR})
zephyr_include_directories(.)

# Define MDK defines globally
zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF51X NRF51)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52805 NRF52805_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52810 NRF52810_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52811 NRF52811_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52820 NRF52820_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52832 NRF52832_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF52832 NRF52832_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52833 NRF52833_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52840 NRF52840_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF5340_CPUAPP NRF5340_XXAA_APPLICATION)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF5340_CPUNET NRF5340_XXAA_NETWORK)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160 NRF9160_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF51X NRF51)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52805 NRF52805_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52810 NRF52810_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52811 NRF52811_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52820 NRF52820_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52832 NRF52832_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF52832 NRF52832_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52833 NRF52833_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52840 NRF52840_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF5340_CPUAPP NRF5340_XXAA_APPLICATION)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF5340_CPUNET NRF5340_XXAA_NETWORK)
zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET NRF5340_XXAA_NETWORK)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160 NRF9160_XXAA)

# Connect Kconfig compilation option for Non-Secure software with option required by MDK/nrfx
zephyr_compile_definitions_ifdef(CONFIG_ARM_NONSECURE_FIRMWARE NRF_TRUSTZONE_NONSECURE)
Expand Down
9 changes: 9 additions & 0 deletions soc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ config SOC_COMPATIBLE_NRF52X
config SOC_COMPATIBLE_NRF52832
bool

config SOC_COMPATIBLE_NRF53X_CPUNET
bool

config SOC_COMPATIBLE_NRF5340_CPUNET
bool

config SOC_COMPATIBLE_BSIM
bool

#
# SOC_*_LD: SoC specific Linker script additions
#
Expand Down
1 change: 1 addition & 0 deletions soc/arm/nordic_nrf/nrf53/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ config SOC_NRF5340_CPUAPP

config SOC_NRF5340_CPUNET
depends on SOC_SERIES_NRF53X
select SOC_COMPATIBLE_NRF53X_CPUNET
bool
select HAS_HW_NRF_ACL
select HAS_HW_NRF_CLOCK
Expand Down
2 changes: 1 addition & 1 deletion subsys/bluetooth/controller/hci/nordic/hci_vendor.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define BT_HCI_VS_HW_VAR BT_HCI_VS_HW_VAR_NORDIC_NRF51X
#elif defined(CONFIG_SOC_COMPATIBLE_NRF52X)
#define BT_HCI_VS_HW_VAR BT_HCI_VS_HW_VAR_NORDIC_NRF52X
#elif defined(CONFIG_SOC_SERIES_NRF53X)
#elif defined(CONFIG_SOC_SERIES_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF53X_CPUNET)
#define BT_HCI_VS_HW_VAR BT_HCI_VS_HW_VAR_NORDIC_NRF53X
#endif
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ void radio_pkt_configure(uint8_t bits_len, uint8_t max_len, uint8_t flags)
bits_len = 5U;
}
#elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) || \
defined(CONFIG_SOC_SERIES_NRF53X)
defined(CONFIG_SOC_SERIES_NRF53X) || \
defined(CONFIG_SOC_COMPATIBLE_NRF53X_CPUNET)
extra = 0U;

phy = (flags >> 1) & 0x07; /* phy */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ static inline void hal_radio_sw_switch_ppi_group_setup(void)

#endif /* !CONFIG_BT_CTLR_TIFS_HW */

#elif defined(CONFIG_SOC_NRF5340_CPUNET)
#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X_CPUNET)

#include <hal/nrf_dppi.h>

Expand Down
4 changes: 2 additions & 2 deletions subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/swi.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#endif

/* nRF53 Series IRQ mapping */
#elif defined(CONFIG_SOC_SERIES_NRF53X)
#elif defined(CONFIG_SOC_SERIES_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF53X_CPUNET)

/* nRF53 Series Engineering D and Revision 1 IRQ mapping */
#if defined(CONFIG_SOC_NRF5340_CPUNET) && \
#if (defined(CONFIG_SOC_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF53X_CPUNET)) && \
!defined(CONFIG_BOARD_NRF5340PDK_NRF5340_CPUNET)

#define HAL_SWI_RADIO_IRQ SWI2_IRQn
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ manifest:
revision: 75e671550ac1acb502f315fe4952514dc73f7bfb
- name: nrf_hw_models
path: modules/bsim_hw_models/nrf_hw_models
revision: a47e326ca772ddd14cc3b9d4ca30a9ab44ecca16
revision: pull/18/head
- name: hal_xtensa
revision: 2f04b615cd5ad3a1b8abef33f9bdd10cc1990ed6
path: modules/hal/xtensa
Expand Down