From 2ff0c6438b0c07a97cc06e600f687475cdf27831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurora=20Sletnes=20Bj=C3=B8rlo?= Date: Tue, 15 Dec 2020 13:27:15 +0100 Subject: [PATCH 1/8] west.yml: Update nrf_hw_models version to include nrf53 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update nrf_hw_models version to include nrf53 support. Signed-off-by: Aurora Sletnes Bjørlo --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 334366aa523cc..abf62c1ab13f2 100644 --- a/west.yml +++ b/west.yml @@ -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 From 651fbbed354993fd629fc09d6aba62af94eff8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurora=20Sletnes=20Bj=C3=B8rlo?= Date: Wed, 4 Nov 2020 10:09:28 +0100 Subject: [PATCH 2/8] nrf5x_bsim: Rename board folder nrf52_bsim -> nrf5x_bsim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This folder will contain common content for both nrf52_bsim and nrf53_cpunet_bsim. Signed-off-by: Aurora Sletnes Bjørlo --- boards/posix/{nrf52_bsim => nrf5x_bsim}/CMakeLists.txt | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/Kconfig | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/Kconfig.board | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/Kconfig.defconfig | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/argparse.c | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/argparse.h | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/board.cmake | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/board_irq.h | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/board_soc.h | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/bstests.h | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/bstests_entry.c | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/cmdline.h | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/cmsis.c | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/cmsis.h | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/cpu_wait.c | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/doc/index.rst | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/irq_handler.c | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/main.c | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/nrf52_bsim.dts | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/nrf52_bsim.yaml | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/nrf52_bsim_defconfig | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/time_machine.c | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/time_machine.h | 0 boards/posix/{nrf52_bsim => nrf5x_bsim}/trace_hook.c | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/CMakeLists.txt (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/Kconfig (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/Kconfig.board (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/Kconfig.defconfig (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/argparse.c (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/argparse.h (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/board.cmake (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/board_irq.h (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/board_soc.h (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/bstests.h (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/bstests_entry.c (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/cmdline.h (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/cmsis.c (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/cmsis.h (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/cpu_wait.c (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/doc/index.rst (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/irq_handler.c (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/main.c (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/nrf52_bsim.dts (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/nrf52_bsim.yaml (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/nrf52_bsim_defconfig (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/time_machine.c (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/time_machine.h (100%) rename boards/posix/{nrf52_bsim => nrf5x_bsim}/trace_hook.c (100%) diff --git a/boards/posix/nrf52_bsim/CMakeLists.txt b/boards/posix/nrf5x_bsim/CMakeLists.txt similarity index 100% rename from boards/posix/nrf52_bsim/CMakeLists.txt rename to boards/posix/nrf5x_bsim/CMakeLists.txt diff --git a/boards/posix/nrf52_bsim/Kconfig b/boards/posix/nrf5x_bsim/Kconfig similarity index 100% rename from boards/posix/nrf52_bsim/Kconfig rename to boards/posix/nrf5x_bsim/Kconfig diff --git a/boards/posix/nrf52_bsim/Kconfig.board b/boards/posix/nrf5x_bsim/Kconfig.board similarity index 100% rename from boards/posix/nrf52_bsim/Kconfig.board rename to boards/posix/nrf5x_bsim/Kconfig.board diff --git a/boards/posix/nrf52_bsim/Kconfig.defconfig b/boards/posix/nrf5x_bsim/Kconfig.defconfig similarity index 100% rename from boards/posix/nrf52_bsim/Kconfig.defconfig rename to boards/posix/nrf5x_bsim/Kconfig.defconfig diff --git a/boards/posix/nrf52_bsim/argparse.c b/boards/posix/nrf5x_bsim/argparse.c similarity index 100% rename from boards/posix/nrf52_bsim/argparse.c rename to boards/posix/nrf5x_bsim/argparse.c diff --git a/boards/posix/nrf52_bsim/argparse.h b/boards/posix/nrf5x_bsim/argparse.h similarity index 100% rename from boards/posix/nrf52_bsim/argparse.h rename to boards/posix/nrf5x_bsim/argparse.h diff --git a/boards/posix/nrf52_bsim/board.cmake b/boards/posix/nrf5x_bsim/board.cmake similarity index 100% rename from boards/posix/nrf52_bsim/board.cmake rename to boards/posix/nrf5x_bsim/board.cmake diff --git a/boards/posix/nrf52_bsim/board_irq.h b/boards/posix/nrf5x_bsim/board_irq.h similarity index 100% rename from boards/posix/nrf52_bsim/board_irq.h rename to boards/posix/nrf5x_bsim/board_irq.h diff --git a/boards/posix/nrf52_bsim/board_soc.h b/boards/posix/nrf5x_bsim/board_soc.h similarity index 100% rename from boards/posix/nrf52_bsim/board_soc.h rename to boards/posix/nrf5x_bsim/board_soc.h diff --git a/boards/posix/nrf52_bsim/bstests.h b/boards/posix/nrf5x_bsim/bstests.h similarity index 100% rename from boards/posix/nrf52_bsim/bstests.h rename to boards/posix/nrf5x_bsim/bstests.h diff --git a/boards/posix/nrf52_bsim/bstests_entry.c b/boards/posix/nrf5x_bsim/bstests_entry.c similarity index 100% rename from boards/posix/nrf52_bsim/bstests_entry.c rename to boards/posix/nrf5x_bsim/bstests_entry.c diff --git a/boards/posix/nrf52_bsim/cmdline.h b/boards/posix/nrf5x_bsim/cmdline.h similarity index 100% rename from boards/posix/nrf52_bsim/cmdline.h rename to boards/posix/nrf5x_bsim/cmdline.h diff --git a/boards/posix/nrf52_bsim/cmsis.c b/boards/posix/nrf5x_bsim/cmsis.c similarity index 100% rename from boards/posix/nrf52_bsim/cmsis.c rename to boards/posix/nrf5x_bsim/cmsis.c diff --git a/boards/posix/nrf52_bsim/cmsis.h b/boards/posix/nrf5x_bsim/cmsis.h similarity index 100% rename from boards/posix/nrf52_bsim/cmsis.h rename to boards/posix/nrf5x_bsim/cmsis.h diff --git a/boards/posix/nrf52_bsim/cpu_wait.c b/boards/posix/nrf5x_bsim/cpu_wait.c similarity index 100% rename from boards/posix/nrf52_bsim/cpu_wait.c rename to boards/posix/nrf5x_bsim/cpu_wait.c diff --git a/boards/posix/nrf52_bsim/doc/index.rst b/boards/posix/nrf5x_bsim/doc/index.rst similarity index 100% rename from boards/posix/nrf52_bsim/doc/index.rst rename to boards/posix/nrf5x_bsim/doc/index.rst diff --git a/boards/posix/nrf52_bsim/irq_handler.c b/boards/posix/nrf5x_bsim/irq_handler.c similarity index 100% rename from boards/posix/nrf52_bsim/irq_handler.c rename to boards/posix/nrf5x_bsim/irq_handler.c diff --git a/boards/posix/nrf52_bsim/main.c b/boards/posix/nrf5x_bsim/main.c similarity index 100% rename from boards/posix/nrf52_bsim/main.c rename to boards/posix/nrf5x_bsim/main.c diff --git a/boards/posix/nrf52_bsim/nrf52_bsim.dts b/boards/posix/nrf5x_bsim/nrf52_bsim.dts similarity index 100% rename from boards/posix/nrf52_bsim/nrf52_bsim.dts rename to boards/posix/nrf5x_bsim/nrf52_bsim.dts diff --git a/boards/posix/nrf52_bsim/nrf52_bsim.yaml b/boards/posix/nrf5x_bsim/nrf52_bsim.yaml similarity index 100% rename from boards/posix/nrf52_bsim/nrf52_bsim.yaml rename to boards/posix/nrf5x_bsim/nrf52_bsim.yaml diff --git a/boards/posix/nrf52_bsim/nrf52_bsim_defconfig b/boards/posix/nrf5x_bsim/nrf52_bsim_defconfig similarity index 100% rename from boards/posix/nrf52_bsim/nrf52_bsim_defconfig rename to boards/posix/nrf5x_bsim/nrf52_bsim_defconfig diff --git a/boards/posix/nrf52_bsim/time_machine.c b/boards/posix/nrf5x_bsim/time_machine.c similarity index 100% rename from boards/posix/nrf52_bsim/time_machine.c rename to boards/posix/nrf5x_bsim/time_machine.c diff --git a/boards/posix/nrf52_bsim/time_machine.h b/boards/posix/nrf5x_bsim/time_machine.h similarity index 100% rename from boards/posix/nrf52_bsim/time_machine.h rename to boards/posix/nrf5x_bsim/time_machine.h diff --git a/boards/posix/nrf52_bsim/trace_hook.c b/boards/posix/nrf5x_bsim/trace_hook.c similarity index 100% rename from boards/posix/nrf52_bsim/trace_hook.c rename to boards/posix/nrf5x_bsim/trace_hook.c From f9a6abb5dc6b793529d6d2154a40fa908ec6286e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurora=20Sletnes=20Bj=C3=B8rlo?= Date: Wed, 4 Nov 2020 10:24:02 +0100 Subject: [PATCH 3/8] nrf5x_bsim: Add the board nrf53_cpunet_bsim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The board models the nrf53840 cpunet. Signed-off-by: Aurora Sletnes Bjørlo --- boards/posix/nrf5x_bsim/Kconfig | 14 +++-- boards/posix/nrf5x_bsim/Kconfig.board | 28 ++++++++++ boards/posix/nrf5x_bsim/Kconfig.defconfig | 7 +-- boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.dts | 51 +++++++++++++++++++ .../posix/nrf5x_bsim/nrf53_cpunet_bsim.yaml | 11 ++++ .../nrf5x_bsim/nrf53_cpunet_bsim_defconfig | 10 ++++ soc/Kconfig | 6 +++ 7 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.dts create mode 100644 boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.yaml create mode 100644 boards/posix/nrf5x_bsim/nrf53_cpunet_bsim_defconfig diff --git a/boards/posix/nrf5x_bsim/Kconfig b/boards/posix/nrf5x_bsim/Kconfig index 159327977bf5b..27a879e264895 100644 --- a/boards/posix/nrf5x_bsim/Kconfig +++ b/boards/posix/nrf5x_bsim/Kconfig @@ -1,14 +1,14 @@ # 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 @@ -16,7 +16,7 @@ config PRINTK_HOOK_INIT_PRIORITY 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 @@ -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 diff --git a/boards/posix/nrf5x_bsim/Kconfig.board b/boards/posix/nrf5x_bsim/Kconfig.board index 10074c709fe4a..c33b496d54f98 100644 --- a/boards/posix/nrf5x_bsim/Kconfig.board +++ b/boards/posix/nrf5x_bsim/Kconfig.board @@ -27,3 +27,31 @@ config BOARD_NRF52_BSIM 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 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 diff --git a/boards/posix/nrf5x_bsim/Kconfig.defconfig b/boards/posix/nrf5x_bsim/Kconfig.defconfig index 1b9795e712d25..1e66ab85e3bcd 100644 --- a/boards/posix/nrf5x_bsim/Kconfig.defconfig +++ b/boards/posix/nrf5x_bsim/Kconfig.defconfig @@ -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 @@ -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 @@ -26,4 +27,4 @@ config LOG_BACKEND_NATIVE_POSIX endif # LOG -endif # BOARD_NRF52_BSIM +endif # BOARD_NRF52_BSIM || BOARD_NRF53_CPUNET_BSIM diff --git a/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.dts b/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.dts new file mode 100644 index 0000000000000..c4d8bd1ad97c0 --- /dev/null +++ b/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.dts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 Linaro Limited. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include + +/ { + 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; +}; diff --git a/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.yaml b/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.yaml new file mode 100644 index 0000000000000..5a52a69bd3038 --- /dev/null +++ b/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim.yaml @@ -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 diff --git a/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim_defconfig b/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim_defconfig new file mode 100644 index 0000000000000..d0f4fb926f498 --- /dev/null +++ b/boards/posix/nrf5x_bsim/nrf53_cpunet_bsim_defconfig @@ -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 diff --git a/soc/Kconfig b/soc/Kconfig index dd472f3180722..e4e0712f3446b 100644 --- a/soc/Kconfig +++ b/soc/Kconfig @@ -30,6 +30,12 @@ config SOC_COMPATIBLE_NRF52X config SOC_COMPATIBLE_NRF52832 bool +config SOC_COMPATIBLE_NRF53X_CPUNET + bool + +config SOC_COMPATIBLE_NRF5340_CPUNET + bool + # # SOC_*_LD: SoC specific Linker script additions # From 9df53266eb673ffdaf49fa5449c258b58f1080a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurora=20Sletnes=20Bj=C3=B8rlo?= Date: Mon, 14 Dec 2020 11:59:49 +0100 Subject: [PATCH 4/8] nrf5x_bsim: Add irq logging for nrf53 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure correct logging of irq with nrf53. Signed-off-by: Aurora Sletnes Bjørlo --- boards/posix/nrf5x_bsim/irq_handler.c | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/boards/posix/nrf5x_bsim/irq_handler.c b/boards/posix/nrf5x_bsim/irq_handler.c index d8b83cdc8e262..44ed92421db6f 100644 --- a/boards/posix/nrf5x_bsim/irq_handler.c +++ b/boards/posix/nrf5x_bsim/irq_handler.c @@ -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*/ + "", /*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 */ @@ -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) { From c878e43d8ba60794dc2f16cfaa022b4a5f0b1875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurora=20Sletnes=20Bj=C3=B8rlo?= Date: Mon, 14 Dec 2020 12:39:18 +0100 Subject: [PATCH 5/8] nrf5x_bsim: Add defines for COMPATIBLE_NRF53X_CPUNET MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Select COMPATIBLE_NRF53X_CPUNET in SOC_NRF5340_CPUNET. Also add defined(CONFIG_SOC_SERIES_NRF53X) where we have defined(NRF53_SERIES). Signed-off-by: Aurora Sletnes Bjørlo --- soc/arm/nordic_nrf/nrf53/Kconfig.soc | 1 + subsys/bluetooth/controller/hci/nordic/hci_vendor.h | 2 +- .../bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c | 3 ++- .../controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h | 2 +- subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/swi.h | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index 405656166224b..7549622b51a67 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -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 diff --git a/subsys/bluetooth/controller/hci/nordic/hci_vendor.h b/subsys/bluetooth/controller/hci/nordic/hci_vendor.h index 4d3245728ed02..cee2bd32291e0 100644 --- a/subsys/bluetooth/controller/hci/nordic/hci_vendor.h +++ b/subsys/bluetooth/controller/hci/nordic/hci_vendor.h @@ -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 diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c index 2317f0da2ab3e..b6bc7e760b724 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c @@ -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 */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h index 71d824bdac2a5..effd3baacfd2a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi.h @@ -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 diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/swi.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/swi.h index 3ead9e19e0d98..a012f68710d02 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/swi.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/swi.h @@ -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 From 479c690e282baa23b0cc3b98b8d8ea726b070e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurora=20Sletnes=20Bj=C3=B8rlo?= Date: Tue, 15 Dec 2020 14:03:44 +0100 Subject: [PATCH 6/8] CODEOWNERS: rename nrf52_bsim to nrf5x_bsim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename nrf52_bsim to nrf5x_bsim to match with change due to added nrf53_bsim. Signed-off-by: Aurora Sletnes Bjørlo --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 5d74c58399c80..35c28a182fbd5 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -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 From aa8347a8879039f02b4cdea02742692efd40de87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurora=20Sletnes=20Bj=C3=B8rlo?= Date: Wed, 10 Feb 2021 10:16:46 +0100 Subject: [PATCH 7/8] modules: CMakeLists: Add definition for CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So that the nrfx drivers can be compiled for a simulated nrf53 cpunet target. Signed-off-by: Aurora Sletnes Bjørlo --- modules/hal_nordic/nrfx/CMakeLists.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 2eb595c743acc..b3de631e9ea40 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -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) From e201fb1efb7701a9b9f6a1758fe4bd9ee1a78ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurora=20Sletnes=20Bj=C3=B8rlo?= Date: Wed, 10 Feb 2021 14:19:46 +0100 Subject: [PATCH 8/8] nrf5x_bsim: Add and choose SOC_COMPATIBLE_BSIM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add to the SOC_COMPATIBLE options a common option to choose compatibility with a simulated BabbleSim target. Also choose this option for the simulated targets nrf52_bsim and nrf53_cpunet_bsim. Signed-off-by: Aurora Sletnes Bjørlo --- boards/posix/nrf5x_bsim/Kconfig.board | 2 ++ soc/Kconfig | 3 +++ 2 files changed, 5 insertions(+) diff --git a/boards/posix/nrf5x_bsim/Kconfig.board b/boards/posix/nrf5x_bsim/Kconfig.board index c33b496d54f98..de652f97c7929 100644 --- a/boards/posix/nrf5x_bsim/Kconfig.board +++ b/boards/posix/nrf5x_bsim/Kconfig.board @@ -7,6 +7,7 @@ config BOARD_NRF52_BSIM 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 @@ -35,6 +36,7 @@ config BOARD_NRF53_CPUNET_BSIM 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 diff --git a/soc/Kconfig b/soc/Kconfig index e4e0712f3446b..7978eb4c8a7f7 100644 --- a/soc/Kconfig +++ b/soc/Kconfig @@ -36,6 +36,9 @@ config SOC_COMPATIBLE_NRF53X_CPUNET config SOC_COMPATIBLE_NRF5340_CPUNET bool +config SOC_COMPATIBLE_BSIM + bool + # # SOC_*_LD: SoC specific Linker script additions #