soc: nordic_nrf: nrf91: Add support for nRF9161 SiP / nRF9120 SoC

The nRF9161 is technically a SiP (System-in-Package) that consists of
the nRF9120 SoC and additional components like PMIC, FEM, and XTAL,
so for nrfx/MDK the nRF9120 SoC is to be selected as the build target,
but since the nRF9161 is what a user can actually see on a board, using
only nRF9120 in the Zephyr build infrastructure might be confusing.
That's why in the top level of SoC definitions (for user-configurable
options in Kconfig, for example) the nRF9161 term is used and nRF9120
underneath.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2023-04-14 11:38:27 +02:00 committed by Marti Bolivar
commit 2a4373ce0d
13 changed files with 91 additions and 15 deletions

View file

@ -41,8 +41,8 @@
#size-cells = <1>;
ranges = <0x0 0x50000000 0x10000000>;
/* Common nRF9160 peripheral description */
#include "nrf9160_common.dtsi"
/* Common nRF91 peripherals description. */
#include "nrf91_peripherals.dtsi"
};
/* Additional Secure peripherals */

View file

@ -5,7 +5,7 @@
*/
#include <mem.h>
#include <nordic/nrf9160.dtsi>
#include <nordic/nrf91.dtsi>
&flash0 {
reg = <0x00000000 DT_SIZE_K(1024)>;

View file

@ -5,7 +5,7 @@
*/
#include <mem.h>
#include <nordic/nrf9160ns.dtsi>
#include <nordic/nrf91ns.dtsi>
&flash0 {
reg = <0x00000000 DT_SIZE_K(1024)>;

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <mem.h>
#include <nordic/nrf91.dtsi>
&flash0 {
reg = <0x00000000 DT_SIZE_K(1024)>;
};
&sram0 {
reg = <0x20000000 DT_SIZE_K(256)>;
};
/ {
soc {
compatible = "nordic,nRF9161-SICA", "nordic,nRF9120", "nordic,nRF91", "simple-bus";
};
};

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <mem.h>
#include <nordic/nrf91ns.dtsi>
&flash0 {
reg = <0x00000000 DT_SIZE_K(1024)>;
};
&sram0 {
reg = <0x20000000 DT_SIZE_K(256)>;
};
/ {
soc {
compatible = "nordic,nRF9161-SICA", "nordic,nRF9120", "nordic,nRF91", "simple-bus";
};
};

View file

@ -42,8 +42,8 @@
#size-cells = <1>;
ranges = <0x0 0x40000000 0x10000000>;
/* Include common nRF9160 peripheral description */
#include "nrf9160_common.dtsi"
/* Common nRF91 peripherals description. */
#include "nrf91_peripherals.dtsi"
};
/* Additional Non-Secure peripherals */

View file

@ -29,6 +29,7 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_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_NRF9120 NRF9120_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160 NRF9160_XXAA)
zephyr_compile_definitions_ifdef(CONFIG_NRF_APPROTECT_LOCK
@ -44,7 +45,7 @@ zephyr_library_compile_definitions_ifdef(CONFIG_NRF_TRACE_PORT
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF5340_CPUAPP
NRF_SKIP_FICR_NS_COPY_TO_RAM)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160
zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF91X
NRF_SKIP_FICR_NS_COPY_TO_RAM)
# Connect Kconfig compilation option for Non-Secure software with option required by MDK/nrfx
@ -61,7 +62,7 @@ zephyr_library_sources_ifdef(CONFIG_SOC_NRF52833 ${MDK_DIR}/system_nrf5283
zephyr_library_sources_ifdef(CONFIG_SOC_NRF52840 ${MDK_DIR}/system_nrf52840.c)
zephyr_library_sources_ifdef(CONFIG_SOC_NRF5340_CPUAPP ${MDK_DIR}/system_nrf5340_application.c)
zephyr_library_sources_ifdef(CONFIG_SOC_NRF5340_CPUNET ${MDK_DIR}/system_nrf5340_network.c)
zephyr_library_sources_ifdef(CONFIG_SOC_NRF9160 ${MDK_DIR}/system_nrf9160.c)
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_NRF91X ${MDK_DIR}/system_nrf91.c)
zephyr_library_sources(nrfx_glue.c)
zephyr_library_sources(${HELPERS_DIR}/nrfx_flag32_allocator.c)

View file

@ -44,14 +44,14 @@ config CPU_HAS_NRF_IDAU
if CPU_HAS_NRF_IDAU
config NRF_SPU_FLASH_REGION_SIZE
hex
default 0x8000 if SOC_NRF9160
default 0x8000 if SOC_SERIES_NRF91X
default 0x4000 if SOC_NRF5340_CPUAPP
help
FLASH region size for the NRF_SPU peripheral
config NRF_SPU_RAM_REGION_SIZE
hex
default 0x2000 if SOC_NRF9160 || SOC_NRF5340_CPUAPP
default 0x2000 if SOC_SERIES_NRF91X || SOC_NRF5340_CPUAPP
help
RAM region size for the NRF_SPU peripheral
endif

View file

@ -63,7 +63,8 @@ config NFCT_PINS_AS_GPIOS
choice NRF_APPROTECT_HANDLING
bool "APPROTECT handling"
depends on SOC_SERIES_NRF52X || SOC_NRF5340_CPUNET || \
(SOC_NRF5340_CPUAPP && !TRUSTED_EXECUTION_NONSECURE)
(SOC_NRF5340_CPUAPP && !TRUSTED_EXECUTION_NONSECURE) || \
SOC_SERIES_NRF91X
default NRF_APPROTECT_USE_UICR
help
Specifies how the SystemInit() function should handle the APPROTECT

View file

@ -0,0 +1,14 @@
# Nordic Semiconductor nRF9161 MCU
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
if SOC_NRF9161_SICA
config SOC
default "nRF9161_SICA"
config NUM_IRQS
default 65
endif # SOC_NRF9161_SICA

View file

@ -3,21 +3,37 @@
# Copyright (c) 2018 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
if SOC_SERIES_NRF91X
config SOC_NRF9120
bool
config SOC_NRF9160
depends on SOC_SERIES_NRF91X
bool
choice
prompt "nRF91x MCU Selection"
depends on SOC_SERIES_NRF91X
config SOC_NRF9160_SICA
bool "NRF9160_SICA"
select SOC_NRF9160
# The nRF9161 is technically a SiP (System-in-Package) that consists of
# the nRF9120 SoC and additional components like PMIC, FEM, and XTAL,
# so for nrfx/MDK the nRF9120 SoC is to be indicated as the build target,
# but since the nRF9161 is what a user can actually see on a board, using
# only nRF9120 in the Zephyr build infrastructure might be confusing.
# That's why in the top level of SoC definitions (for user-configurable
# options in Kconfig, for example) the nRF9161 term is used and nRF9120
# underneath.
config SOC_NRF9161_SICA
bool "NRF9161_SICA"
select SOC_NRF9120
endchoice
config NRF_ENABLE_ICACHE
bool "Instruction cache (I-Cache)"
depends on SOC_NRF9160
default y
endif # SOC_SERIES_NRF91X

View file

@ -83,7 +83,7 @@ manifest:
groups:
- hal
- name: hal_nordic
revision: c4044b04b8bf04f11e3051d5f7a41f3d636b6b0c
revision: 140140ea047f441fe076d26f79eb54dc9a38bcb6
path: modules/hal/nordic
groups:
- hal