diff --git a/boards/arm/thingy91_nrf9160/CMakeLists.txt b/boards/arm/thingy91_nrf9160/CMakeLists.txt index c8c7a866f50a..904f24325689 100644 --- a/boards/arm/thingy91_nrf9160/CMakeLists.txt +++ b/boards/arm/thingy91_nrf9160/CMakeLists.txt @@ -4,19 +4,10 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -if(CONFIG_BOARD_THINGY91_NRF9160 AND NOT DEFINED CONFIG_MCUBOOT) - zephyr_library() - zephyr_library_sources(adp5360_init.c) -endif() +zephyr_library() +zephyr_library_sources_ifdef(CONFIG_ADP536X adp5360_init.c) if(CONFIG_BOARD_THINGY91_NRF9160_NS) - # If TF-M is used, the ADP5360 configuration must be done in non-secure - # as we can't instruct TF-M to run it. - if(CONFIG_BUILD_WITH_TFM) - zephyr_library() - zephyr_library_sources(adp5360_init.c) - endif() - # Use static partition layout to ensure the partition layout remains # unchanged after DFU. This needs to be made globally available # because it is used in other CMake files. diff --git a/boards/arm/thingy91_nrf9160/Kconfig.defconfig b/boards/arm/thingy91_nrf9160/Kconfig.defconfig index 477f48fdad9d..bdc58846d231 100644 --- a/boards/arm/thingy91_nrf9160/Kconfig.defconfig +++ b/boards/arm/thingy91_nrf9160/Kconfig.defconfig @@ -9,8 +9,10 @@ if BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS config BOARD default "thingy91_nrf9160" +# Enable Zephyr power regulator ADP536x config REGULATOR - default y if !MCUBOOT + default y + depends on !IS_BOOTLOADER_IMG # By default, if we build for a Non-Secure version of the board, # enable building with TF-M as the Secure Execution Environment. diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_defconfig b/boards/arm/thingy91_nrf9160/thingy91_nrf9160_defconfig index 58ff7f914ca8..a00903ba4bae 100644 --- a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_defconfig +++ b/boards/arm/thingy91_nrf9160/thingy91_nrf9160_defconfig @@ -21,11 +21,5 @@ CONFIG_SERIAL=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -# Enable I2C -CONFIG_I2C=y - -# Enable power management IC ADP536x -CONFIG_ADP536X=y - # Disable entropy driver, as it's not yet implemented for nRF9160 CONFIG_ENTROPY_NRF5_RNG=n diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns_defconfig b/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns_defconfig index f61bee0ca430..ab3363ea925e 100644 --- a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns_defconfig +++ b/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns_defconfig @@ -24,15 +24,9 @@ CONFIG_SERIAL=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -# Enable I2C -CONFIG_I2C=y - # Enable SPI CONFIG_SPI=y -# Enable power management IC ADP536x -CONFIG_ADP536X=y - # Disable entropy driver, as it's not yet implemented for nRF9160 CONFIG_ENTROPY_NRF5_RNG=n diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 953ff3c302d8..af6c0c5c7bdf 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -599,7 +599,9 @@ nRF Security Other libraries --------------- -|no_changes_yet_note| +* :ref:`lib_adp536x` library: + + * Fixed issue where the adp536x driver was included in the immutable bootloader on Thingy:91 when :kconfig:option:`CONFIG_SECURE_BOOT` was enabled. Common Application Framework (CAF) ---------------------------------- diff --git a/lib/adp536x/Kconfig b/lib/adp536x/Kconfig index fa6e6a327b87..39a8abfcf7bb 100644 --- a/lib/adp536x/Kconfig +++ b/lib/adp536x/Kconfig @@ -7,5 +7,9 @@ config ADP536X bool "ADP536x" + default y + depends on !IS_BOOTLOADER_IMG + depends on DT_HAS_ADI_ADP5360_ENABLED + select I2C help Enable ADP536x diff --git a/subsys/bootloader/Kconfig b/subsys/bootloader/Kconfig index ae3ad5f57fbd..518a2cba9807 100644 --- a/subsys/bootloader/Kconfig +++ b/subsys/bootloader/Kconfig @@ -238,6 +238,13 @@ config SB_BPROT_IN_DEBUG endif # SECURE_BOOT_DEBUG endif # IS_SECURE_BOOTLOADER +config IS_BOOTLOADER_IMG + bool + default y if IS_SECURE_BOOTLOADER || MCUBOOT + help + Helper symbol which is set when the current image is a bootloader. This includes mcuboot + and the secure bootloader. + config NRF53_UPGRADE_NETWORK_CORE bool "Support updating nRF53 Network Core application" default y