From 610f7178d9722235d10808715bb925a99a954ae5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 001/881] Revert "[nrf fromlist] kconfig: Load Kconfig env file better" This reverts commit 25ced410af6caf6fea810b49ef4cf9b3bcb40b2b. Signed-off-by: Jukka Rissanen --- Kconfig.zephyr | 1 + cmake/modules/kconfig.cmake | 5 +---- doc/_extensions/zephyr/kconfig/__init__.py | 6 ++---- scripts/ci/check_compliance.py | 8 ++------ scripts/zephyr_module.py | 18 +++--------------- share/sysbuild/Kconfig | 2 ++ 6 files changed, 11 insertions(+), 29 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 994730d1933..ace2652550d 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -6,6 +6,7 @@ # SPDX-License-Identifier: Apache-2.0 source "Kconfig.constants" +source "$(KCONFIG_ENV_FILE)" osource "$(APPLICATION_SOURCE_DIR)/VERSION" diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index c65f407502a..1e2cf75f54b 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -132,13 +132,10 @@ endif() # APP_DIR: Path to the main image (sysbuild) or synonym for APPLICATION_SOURCE_DIR (non-sysbuild) zephyr_get(APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR) -# Load the module Kconfig file into CMake -include("${KCONFIG_BINARY_DIR}/kconfig_module_dirs.cmake") - set(COMMON_KCONFIG_ENV_SETTINGS PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + KCONFIG_ENV_FILE=${KCONFIG_BINARY_DIR}/kconfig_module_dirs.env srctree=${ZEPHYR_BASE} - ${kconfig_env_dirs} KERNELVERSION=${KERNELVERSION} APPVERSION=${APP_VERSION_STRING} APP_VERSION_EXTENDED_STRING=${APP_VERSION_EXTENDED_STRING} diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index 63459a61ade..a76ac87f887 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -44,7 +44,6 @@ from typing import Any from docutils import nodes -from dotenv import load_dotenv from sphinx.addnodes import pending_xref from sphinx.application import Sphinx from sphinx.builders import Builder @@ -82,8 +81,7 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d sysbuild_kconfig = "" for module in modules: kconfig_module_dirs += zephyr_module.process_kconfig_module_dir(module.project, - module.meta, - False) + module.meta) kconfig += zephyr_module.process_kconfig(module.project, module.meta) sysbuild_kconfig += zephyr_module.process_sysbuildkconfig(module.project, module.meta) @@ -160,7 +158,7 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d os.environ["BOARD"] = "boards" os.environ["KCONFIG_BOARD_DIR"] = str(Path(td) / "boards") - load_dotenv(str(Path(td) / "kconfig_module_dirs.env")) + os.environ["KCONFIG_ENV_FILE"] = str(Path(td) / "kconfig_module_dirs.env") # Sysbuild runs first os.environ["CONFIG_"] = "SB_CONFIG_" diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index b0f4ccebb1e..a557c78af1e 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -23,8 +23,6 @@ import unidiff import yaml -from dotenv import load_dotenv - from yamllint import config, linter from junitparser import TestCase, TestSuite, JUnitXml, Skipped, Error, Failure @@ -732,14 +730,14 @@ def parse_kconfig(self): os.environ["KCONFIG_BINARY_DIR"] = kconfiglib_dir os.environ['DEVICETREE_CONF'] = "dummy" os.environ['TOOLCHAIN_HAS_NEWLIB'] = "y" - kconfig_env_file = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") + os.environ['KCONFIG_ENV_FILE'] = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") # Older name for DEVICETREE_CONF, for compatibility with older Zephyr # versions that don't have the renaming os.environ["GENERATED_DTS_BOARD_CONF"] = "dummy" # For multi repo support - self.get_modules(kconfig_env_file, + self.get_modules(os.environ['KCONFIG_ENV_FILE'], os.path.join(kconfiglib_dir, "Kconfig.modules"), os.path.join(kconfiglib_dir, "Kconfig.sysbuild.modules"), os.path.join(kconfiglib_dir, "settings_file.txt")) @@ -753,8 +751,6 @@ def parse_kconfig(self): # symbols within Kconfig files os.environ["KCONFIG_WARN_UNDEF"] = "y" - load_dotenv(kconfig_env_file) - try: # Note this will both print warnings to stderr _and_ return # them: so some warnings might get printed diff --git a/scripts/zephyr_module.py b/scripts/zephyr_module.py index 8a451db63fa..8bf2d00793d 100755 --- a/scripts/zephyr_module.py +++ b/scripts/zephyr_module.py @@ -386,13 +386,10 @@ def kconfig_snippet(meta, path, kconfig_file=None, blobs=False, taint_blobs=Fals return '\n'.join(snippet) -def process_kconfig_module_dir(module, meta, cmake_output): +def process_kconfig_module_dir(module, meta): module_path = PurePath(module) name_sanitized = meta['name-sanitized'] - - if cmake_output is False: - return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' - return f'list(APPEND kconfig_env_dirs ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()})\n' + return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' def process_kconfig(module, meta): @@ -868,7 +865,6 @@ def main(): args = parser.parse_args() kconfig_module_dirs = "" - kconfig_module_dirs_cmake = "set(kconfig_env_dirs)\n" kconfig = "" cmake = "" sysbuild_kconfig = "" @@ -881,8 +877,7 @@ def main(): args.modules, args.extra_modules) for module in modules: - kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta, False) - kconfig_module_dirs_cmake += process_kconfig_module_dir(module.project, module.meta, True) + kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta) kconfig += process_kconfig(module.project, module.meta) cmake += process_cmake(module.project, module.meta) sysbuild_kconfig += process_sysbuildkconfig( @@ -894,20 +889,13 @@ def main(): if args.kconfig_out or args.sysbuild_kconfig_out: if args.kconfig_out: kconfig_module_dirs_out = PurePath(args.kconfig_out).parent / 'kconfig_module_dirs.env' - kconfig_module_dirs_cmake_out = PurePath(args.kconfig_out).parent / \ - 'kconfig_module_dirs.cmake' elif args.sysbuild_kconfig_out: kconfig_module_dirs_out = PurePath(args.sysbuild_kconfig_out).parent / \ 'kconfig_module_dirs.env' - kconfig_module_dirs_cmake_out = PurePath(args.sysbuild_kconfig_out).parent / \ - 'kconfig_module_dirs.cmake' with open(kconfig_module_dirs_out, 'w', encoding="utf-8") as fp: fp.write(kconfig_module_dirs) - with open(kconfig_module_dirs_cmake_out, 'w', encoding="utf-8") as fp: - fp.write(kconfig_module_dirs_cmake) - if args.kconfig_out: with open(args.kconfig_out, 'w', encoding="utf-8") as fp: fp.write(kconfig) diff --git a/share/sysbuild/Kconfig b/share/sysbuild/Kconfig index 5f689e07399..6bf51245771 100644 --- a/share/sysbuild/Kconfig +++ b/share/sysbuild/Kconfig @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 +source "$(KCONFIG_ENV_FILE)" + config BOARD string default "$(BOARD)" From b202b9c4eca7d4681b0d9840a5481ef867aa083d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 002/881] Revert "[nrf fromlist] scripts: requirements: Add python-dotenv" This reverts commit 2fc387e0dd4d8292bdf4f0683a7044639a810f65. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.in | 1 - scripts/requirements-actions.txt | 4 ---- scripts/requirements-build-test.txt | 2 -- scripts/requirements-compliance.txt | 1 - 4 files changed, 8 deletions(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 6baf9dc9e3f..997afed3871 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -22,7 +22,6 @@ pykwalify pylint>=3 pyserial pytest -python-dotenv python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" pyyaml diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 21505203bfa..8c28b2d22f7 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -880,10 +880,6 @@ python-debian==1.0.1 \ --hash=sha256:3ada9b83a3d671b58081782c0969cffa0102f6ce433fbbc7cf21275b8b5cc771 \ --hash=sha256:8f137c230c1d9279c2ac892b35915068b2aca090c9fd3da5671ff87af32af12c # via reuse -python-dotenv==1.1.1 \ - --hash=sha256:31f23644fe2602f88ff55e1f5c79ba497e01224ee7737937930c448e4d0e24dc \ - --hash=sha256:a8a6399716257f45be6a007360200409fce5cda2661e3dec71d23dc15f6189ab - # via -r requirements-actions.in python-magic==0.4.27 ; sys_platform != 'win32' \ --hash=sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b \ --hash=sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3 diff --git a/scripts/requirements-build-test.txt b/scripts/requirements-build-test.txt index e6264b11ea5..2ce1227e3e7 100644 --- a/scripts/requirements-build-test.txt +++ b/scripts/requirements-build-test.txt @@ -19,5 +19,3 @@ mypy # used for JUnit XML parsing in CTest harness junitparser>=3.0.0 - -python-dotenv diff --git a/scripts/requirements-compliance.txt b/scripts/requirements-compliance.txt index 6d90ac4b258..3c3841cf33e 100644 --- a/scripts/requirements-compliance.txt +++ b/scripts/requirements-compliance.txt @@ -8,7 +8,6 @@ junitparser>=4.0.1 lxml>=5.3.0 pykwalify pylint>=3 -python-dotenv python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" ruff==0.11.11 From dc33a19bf0c22e7b05c907e566353038d349f5a5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 003/881] Revert "[nrf fromtree] scripts: ci: check_compliance: no need for lxml anymore" This reverts commit 9a9fe4d379938c28208e0556dc5897dba8de5570. Signed-off-by: Jukka Rissanen --- scripts/ci/check_compliance.py | 8 ++++++++ scripts/requirements-build-test.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index a557c78af1e..f1da73f3ec0 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -2288,6 +2288,14 @@ def _main(args): def main(argv=None): args = parse_args(argv) + try: + # pylint: disable=unused-import + from lxml import etree + except ImportError: + print("\nERROR: Python module lxml not installed, unable to proceed") + print("See https://github.com/weiwei/junitparser/issues/99") + return 1 + try: n_fails = _main(args) except BaseException: diff --git a/scripts/requirements-build-test.txt b/scripts/requirements-build-test.txt index 2ce1227e3e7..76cee431f88 100644 --- a/scripts/requirements-build-test.txt +++ b/scripts/requirements-build-test.txt @@ -18,4 +18,4 @@ pytest mypy # used for JUnit XML parsing in CTest harness -junitparser>=3.0.0 +junitparser From dcebcdaf45d6232d0dfd25469dc5b8f30752c03f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 004/881] Revert "[nrf fromtree] scripts: requirements-action: Require PyGithub >= 2.7.0" This reverts commit e6b70b6612cbb5f5147248223b02c4789b7b98b8. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.in | 2 +- scripts/requirements-actions.txt | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 997afed3871..492a1a4fa84 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -17,7 +17,7 @@ natsort ply>=3.10 psutil>=5.6.6 pyelftools>=0.29 -pygithub>=2.7.0 +pygithub pykwalify pylint>=3 pyserial diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 8c28b2d22f7..4a987e9f0de 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -302,6 +302,10 @@ cryptography==45.0.5 \ --hash=sha256:e74d30ec9c7cb2f404af331d5b4099a9b322a8a6b25c4632755c8757345baac5 \ --hash=sha256:f3562c2f23c612f2e4a6964a61d942f891d29ee320edb62ff48ffb99f3de9ae8 # via pyjwt +deprecated==1.2.18 \ + --hash=sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d \ + --hash=sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec + # via pygithub dill==0.4.0 \ --hash=sha256:0633f1d2df477324f53a895b02c901fb961bdbf65a17122586ea7019292cbcf0 \ --hash=sha256:44f54bf6412c2c8464c14e8243eb163690a9800dbe2c367330883b19c7561049 @@ -812,9 +816,9 @@ pyelftools==0.32 \ --hash=sha256:013df952a006db5e138b1edf6d8a68ecc50630adbd0d83a2d41e7f846163d738 \ --hash=sha256:6de90ee7b8263e740c8715a925382d4099b354f29ac48ea40d840cf7aa14ace5 # via -r requirements-actions.in -pygithub==2.8.1 \ - --hash=sha256:23a0a5bca93baef082e03411bf0ce27204c32be8bfa7abc92fe4a3e132936df0 \ - --hash=sha256:341b7c78521cb07324ff670afd1baa2bf5c286f8d9fd302c1798ba594a5400c9 +pygithub==2.6.1 \ + --hash=sha256:6f2fa6d076ccae475f9fc392cc6cdbd54db985d4f69b8833a28397de75ed6ca3 \ + --hash=sha256:b5c035392991cca63959e9453286b41b54d83bf2de2daa7d7ff7e4312cebf3bf # via -r requirements-actions.in pygments==2.19.2 \ --hash=sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887 \ @@ -1340,7 +1344,9 @@ wrapt==1.17.2 \ --hash=sha256:f917c1180fdb8623c2b75a99192f4025e412597c50b2ac870f156de8fb101119 \ --hash=sha256:fc78a84e2dfbc27afe4b2bd7c80c8db9bca75cc5b85df52bfe634596a1da846b \ --hash=sha256:ff04ef6eec3eee8a5efef2401495967a916feaa353643defcc03fc74fe213b58 - # via python-can + # via + # deprecated + # python-can xlsxwriter==3.2.5 \ --hash=sha256:4f4824234e1eaf9d95df9a8fe974585ff91d0f5e3d3f12ace5b71e443c1c6abd \ --hash=sha256:7e88469d607cdc920151c0ab3ce9cf1a83992d4b7bc730c5ffdd1a12115a7dbe From 6224c2eddec362ef52cd5c05413475596486611c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 005/881] Revert "[nrf fromtree] scripts: requirements: remove lxml dependency" This reverts commit 37ca03ef3c9b618f44fb2f38acebdb377b3cda55. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.in | 1 + scripts/requirements-actions.txt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 492a1a4fa84..4488b9565d9 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -12,6 +12,7 @@ ijson intelhex junit2html junitparser>=4.0.1 +lxml>=5.3.0 mypy natsort ply>=3.10 diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 4a987e9f0de..a635c73b768 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -583,7 +583,9 @@ lxml==6.0.0 \ --hash=sha256:f720a14aa102a38907c6d5030e3d66b3b680c3e6f6bc95473931ea3c00c59967 \ --hash=sha256:f8d19565ae3eb956d84da3ef367aa7def14a2735d05bd275cd54c0301f0d0d6c \ --hash=sha256:f97487996a39cb18278ca33f7be98198f278d0bc3c5d0fd4d7b3d63646ca3c8a - # via gcovr + # via + # -r requirements-actions.in + # gcovr markupsafe==3.0.2 \ --hash=sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4 \ --hash=sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30 \ From 29b1c81f4a37453a8f9ff21be6345e83bdfef3d4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 006/881] Revert "[nrf fromtree] scripts: requirements: Remove mock" This reverts commit 6b25d16bb67034e389f4142f4f9325bc3b867ed6. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.in | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 4488b9565d9..bb499b644a0 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -13,6 +13,7 @@ intelhex junit2html junitparser>=4.0.1 lxml>=5.3.0 +mock mypy natsort ply>=3.10 From 47d7f59e70343d90d0b7ddc33554f122df1177e5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 007/881] Revert "[nrf fromtree] scripts: requirements: Add back tomli" This reverts commit 70777ba23a9e67553dff61435150da7fe4b4a9d6. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.txt | 39 -------------------------------- 1 file changed, 39 deletions(-) diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index a635c73b768..cc6873a7061 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -1174,45 +1174,6 @@ tabulate==0.9.0 \ --hash=sha256:0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c \ --hash=sha256:024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f # via -r requirements-actions.in -tomli==2.2.1 ; python_full_version < '3.11' \ - --hash=sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6 \ - --hash=sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd \ - --hash=sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c \ - --hash=sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b \ - --hash=sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8 \ - --hash=sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6 \ - --hash=sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77 \ - --hash=sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff \ - --hash=sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea \ - --hash=sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192 \ - --hash=sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249 \ - --hash=sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee \ - --hash=sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4 \ - --hash=sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98 \ - --hash=sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8 \ - --hash=sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4 \ - --hash=sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281 \ - --hash=sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744 \ - --hash=sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69 \ - --hash=sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13 \ - --hash=sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140 \ - --hash=sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e \ - --hash=sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e \ - --hash=sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc \ - --hash=sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff \ - --hash=sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec \ - --hash=sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2 \ - --hash=sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222 \ - --hash=sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106 \ - --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ - --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ - --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 - # via - # mypy - # pylint - # pyproject-api - # pytest - # tox tomlkit==0.13.3 \ --hash=sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1 \ --hash=sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0 From 052a4417439402a9195b9cd6543572959d1162bb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 008/881] Revert "[nrf fromtree] scripts: requirements: drop tomli dependency" This reverts commit e06d9e82cd78b692bbbd99b2997f4e2e4d87444e. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.in | 1 + scripts/requirements-actions.txt | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index bb499b644a0..9d56d56f2a3 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -33,6 +33,7 @@ setuptools>=70.2.0 spdx-tools sphinx-lint tabulate +tomli>=1.1.0 tox tqdm>=4.67.1 unidiff diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index cc6873a7061..1af5b8267d5 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -1174,6 +1174,46 @@ tabulate==0.9.0 \ --hash=sha256:0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c \ --hash=sha256:024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f # via -r requirements-actions.in +tomli==2.2.1 \ + --hash=sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6 \ + --hash=sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd \ + --hash=sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c \ + --hash=sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b \ + --hash=sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8 \ + --hash=sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6 \ + --hash=sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77 \ + --hash=sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff \ + --hash=sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea \ + --hash=sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192 \ + --hash=sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249 \ + --hash=sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee \ + --hash=sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4 \ + --hash=sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98 \ + --hash=sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8 \ + --hash=sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4 \ + --hash=sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281 \ + --hash=sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744 \ + --hash=sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69 \ + --hash=sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13 \ + --hash=sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140 \ + --hash=sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e \ + --hash=sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e \ + --hash=sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc \ + --hash=sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff \ + --hash=sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec \ + --hash=sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2 \ + --hash=sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222 \ + --hash=sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106 \ + --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ + --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ + --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 + # via + # -r requirements-actions.in + # mypy + # pylint + # pyproject-api + # pytest + # tox tomlkit==0.13.3 \ --hash=sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1 \ --hash=sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0 From f9f353e9a41c008fdda469f7bc4a4dfff71ece43 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:54 +0300 Subject: [PATCH 009/881] Revert "[nrf fromtree] scripts: requirements: remove dependency to mock package" This reverts commit 9648cfc0fa26d064bb650573c9ea752b077cb5b8. Signed-off-by: Jukka Rissanen --- scripts/build/check_init_priorities_test.py | 2 +- scripts/requirements-actions.txt | 4 ++++ scripts/requirements-build-test.txt | 3 +++ scripts/tests/build_helpers/test_domains.py | 2 +- scripts/tests/twister/test_cmakecache.py | 2 +- scripts/tests/twister/test_config_parser.py | 2 +- scripts/tests/twister/test_environment.py | 2 +- scripts/tests/twister/test_handlers.py | 2 +- scripts/tests/twister/test_hardwaremap.py | 2 +- scripts/tests/twister/test_harness.py | 2 +- scripts/tests/twister/test_jobserver.py | 2 +- scripts/tests/twister/test_log_helper.py | 2 +- scripts/tests/twister/test_platform.py | 2 +- scripts/tests/twister/test_quarantine.py | 2 +- scripts/tests/twister/test_runner.py | 2 +- scripts/tests/twister/test_scl.py | 2 +- scripts/tests/twister/test_testinstance.py | 2 +- scripts/tests/twister/test_testplan.py | 2 +- scripts/tests/twister/test_testsuite.py | 2 +- scripts/tests/twister/test_twister.py | 2 +- scripts/tests/twister_blackbox/conftest.py | 2 +- scripts/tests/twister_blackbox/test_addon.py | 3 +-- scripts/tests/twister_blackbox/test_config.py | 2 +- scripts/tests/twister_blackbox/test_coverage.py | 2 +- scripts/tests/twister_blackbox/test_device.py | 2 +- scripts/tests/twister_blackbox/test_disable.py | 3 +-- scripts/tests/twister_blackbox/test_error.py | 2 +- scripts/tests/twister_blackbox/test_filter.py | 2 +- scripts/tests/twister_blackbox/test_footprint.py | 2 +- scripts/tests/twister_blackbox/test_hardwaremap.py | 3 +-- scripts/tests/twister_blackbox/test_outfile.py | 2 +- scripts/tests/twister_blackbox/test_output.py | 2 +- scripts/tests/twister_blackbox/test_platform.py | 2 +- scripts/tests/twister_blackbox/test_printouts.py | 2 +- scripts/tests/twister_blackbox/test_quarantine.py | 2 +- scripts/tests/twister_blackbox/test_report.py | 2 +- scripts/tests/twister_blackbox/test_runner.py | 2 +- scripts/tests/twister_blackbox/test_shuffle.py | 2 +- scripts/tests/twister_blackbox/test_testlist.py | 2 +- scripts/tests/twister_blackbox/test_testplan.py | 2 +- scripts/tests/twister_blackbox/test_tooling.py | 3 +-- 41 files changed, 46 insertions(+), 43 deletions(-) diff --git a/scripts/build/check_init_priorities_test.py b/scripts/build/check_init_priorities_test.py index 7ada2349839..16cf9af7406 100755 --- a/scripts/build/check_init_priorities_test.py +++ b/scripts/build/check_init_priorities_test.py @@ -6,7 +6,7 @@ Tests for check_init_priorities """ -from unittest import mock +import mock import pathlib import unittest diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 1af5b8267d5..7e925010918 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -653,6 +653,10 @@ mccabe==0.7.0 \ --hash=sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325 \ --hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e # via pylint +mock==5.2.0 \ + --hash=sha256:4e460e818629b4b173f32d08bf30d3af8123afbb8e04bb5707a1fd4799e503f0 \ + --hash=sha256:7ba87f72ca0e915175596069dbbcc7c75af7b5e9b9bc107ad6349ede0819982f + # via -r requirements-actions.in msgpack==1.1.1 ; sys_platform != 'win32' \ --hash=sha256:196a736f0526a03653d829d7d4c5500a97eea3648aebfd4b6743875f28aa2af8 \ --hash=sha256:1abfc6e949b352dadf4bce0eb78023212ec5ac42f6abfd469ce91d783c149c2a \ diff --git a/scripts/requirements-build-test.txt b/scripts/requirements-build-test.txt index 76cee431f88..0d540dd05c3 100644 --- a/scripts/requirements-build-test.txt +++ b/scripts/requirements-build-test.txt @@ -17,5 +17,8 @@ coverage pytest mypy +# used for mocking functions in pytest +mock>=4.0.1 + # used for JUnit XML parsing in CTest harness junitparser diff --git a/scripts/tests/build_helpers/test_domains.py b/scripts/tests/build_helpers/test_domains.py index de784734bac..b22fff44916 100644 --- a/scripts/tests/build_helpers/test_domains.py +++ b/scripts/tests/build_helpers/test_domains.py @@ -6,10 +6,10 @@ Tests for domains.py classes """ +import mock import os import sys from contextlib import nullcontext -from unittest import mock import pytest diff --git a/scripts/tests/twister/test_cmakecache.py b/scripts/tests/twister/test_cmakecache.py index 51a09a58102..ebfb440423b 100644 --- a/scripts/tests/twister/test_cmakecache.py +++ b/scripts/tests/twister/test_cmakecache.py @@ -6,7 +6,7 @@ Tests for cmakecache.py classes' methods """ -from unittest import mock +import mock import pytest from contextlib import nullcontext diff --git a/scripts/tests/twister/test_config_parser.py b/scripts/tests/twister/test_config_parser.py index dcc1495ab7c..48a2d5a7db5 100644 --- a/scripts/tests/twister/test_config_parser.py +++ b/scripts/tests/twister/test_config_parser.py @@ -9,7 +9,7 @@ import os import pytest -from unittest import mock +import mock import scl from twisterlib.config_parser import TwisterConfigParser, extract_fields_from_arg_list, ConfigurationError diff --git a/scripts/tests/twister/test_environment.py b/scripts/tests/twister/test_environment.py index 95b799bc8b7..3a4e090598b 100644 --- a/scripts/tests/twister/test_environment.py +++ b/scripts/tests/twister/test_environment.py @@ -7,7 +7,7 @@ Tests for environment.py classes' methods """ -from unittest import mock +import mock import os import pytest import shutil diff --git a/scripts/tests/twister/test_handlers.py b/scripts/tests/twister/test_handlers.py index fbe22bb906f..e4710060a35 100644 --- a/scripts/tests/twister/test_handlers.py +++ b/scripts/tests/twister/test_handlers.py @@ -8,7 +8,7 @@ """ import itertools -from unittest import mock +import mock import os import pytest import signal diff --git a/scripts/tests/twister/test_hardwaremap.py b/scripts/tests/twister/test_hardwaremap.py index c8f82679211..5dc61dc1d9e 100644 --- a/scripts/tests/twister/test_hardwaremap.py +++ b/scripts/tests/twister/test_hardwaremap.py @@ -6,7 +6,7 @@ Tests for hardwaremap.py classes' methods """ -from unittest import mock +import mock import pytest import sys diff --git a/scripts/tests/twister/test_harness.py b/scripts/tests/twister/test_harness.py index edc2a96c8a1..3283ff2085a 100644 --- a/scripts/tests/twister/test_harness.py +++ b/scripts/tests/twister/test_harness.py @@ -6,7 +6,7 @@ """ This test file contains testsuites for the Harness classes of twister """ -from unittest import mock +import mock import sys import os import pytest diff --git a/scripts/tests/twister/test_jobserver.py b/scripts/tests/twister/test_jobserver.py index d365313199d..554df8545fb 100644 --- a/scripts/tests/twister/test_jobserver.py +++ b/scripts/tests/twister/test_jobserver.py @@ -7,7 +7,7 @@ """ import functools -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister/test_log_helper.py b/scripts/tests/twister/test_log_helper.py index 31d7c6148da..9373be5da2f 100644 --- a/scripts/tests/twister/test_log_helper.py +++ b/scripts/tests/twister/test_log_helper.py @@ -7,7 +7,7 @@ """ import logging -from unittest import mock +import mock import pytest from importlib import reload diff --git a/scripts/tests/twister/test_platform.py b/scripts/tests/twister/test_platform.py index 1ff7f0bb8fd..cdbfd15d20c 100644 --- a/scripts/tests/twister/test_platform.py +++ b/scripts/tests/twister/test_platform.py @@ -8,7 +8,7 @@ ''' import sys import os -from unittest import mock +import mock import pytest from contextlib import nullcontext diff --git a/scripts/tests/twister/test_quarantine.py b/scripts/tests/twister/test_quarantine.py index 6165a755544..ea6b3cf677e 100644 --- a/scripts/tests/twister/test_quarantine.py +++ b/scripts/tests/twister/test_quarantine.py @@ -6,7 +6,7 @@ Tests for quarantine.py classes' methods """ -from unittest import mock +import mock import os import pytest import textwrap diff --git a/scripts/tests/twister/test_runner.py b/scripts/tests/twister/test_runner.py index 3d2149664cf..e689095fc7c 100644 --- a/scripts/tests/twister/test_runner.py +++ b/scripts/tests/twister/test_runner.py @@ -7,7 +7,7 @@ """ import errno -from unittest import mock +import mock import os import pathlib import pytest diff --git a/scripts/tests/twister/test_scl.py b/scripts/tests/twister/test_scl.py index 4a376257b1d..14a0c447192 100644 --- a/scripts/tests/twister/test_scl.py +++ b/scripts/tests/twister/test_scl.py @@ -7,7 +7,7 @@ """ import logging -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister/test_testinstance.py b/scripts/tests/twister/test_testinstance.py index df8286fe092..271d55e76a0 100644 --- a/scripts/tests/twister/test_testinstance.py +++ b/scripts/tests/twister/test_testinstance.py @@ -11,7 +11,7 @@ import os import sys import pytest -from unittest import mock +import mock ZEPHYR_BASE = os.getenv("ZEPHYR_BASE") sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister")) diff --git a/scripts/tests/twister/test_testplan.py b/scripts/tests/twister/test_testplan.py index 62733ed00dd..73b2673b08e 100644 --- a/scripts/tests/twister/test_testplan.py +++ b/scripts/tests/twister/test_testplan.py @@ -8,7 +8,7 @@ ''' import sys import os -from unittest import mock +import mock import pytest from contextlib import nullcontext diff --git a/scripts/tests/twister/test_testsuite.py b/scripts/tests/twister/test_testsuite.py index 635b2aaa99f..83231c0f48a 100644 --- a/scripts/tests/twister/test_testsuite.py +++ b/scripts/tests/twister/test_testsuite.py @@ -7,7 +7,7 @@ """ import mmap -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister/test_twister.py b/scripts/tests/twister/test_twister.py index 0e5118751dd..23a3e6d17db 100644 --- a/scripts/tests/twister/test_twister.py +++ b/scripts/tests/twister/test_twister.py @@ -9,7 +9,7 @@ import os import sys -from unittest import mock +import mock import pytest from pathlib import Path diff --git a/scripts/tests/twister_blackbox/conftest.py b/scripts/tests/twister_blackbox/conftest.py index 615e2f986b7..0fd73927c6f 100644 --- a/scripts/tests/twister_blackbox/conftest.py +++ b/scripts/tests/twister_blackbox/conftest.py @@ -7,7 +7,7 @@ import logging import shutil -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_addon.py b/scripts/tests/twister_blackbox/test_addon.py index bb7fe84b6b8..ecd34501b73 100644 --- a/scripts/tests/twister_blackbox/test_addon.py +++ b/scripts/tests/twister_blackbox/test_addon.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pkg_resources import pytest @@ -16,7 +16,6 @@ import subprocess import sys -# pylint: disable=no-name-in-module from conftest import ZEPHYR_BASE, TEST_DATA, sample_filename_mock, testsuite_filename_mock from twisterlib.testplan import TestPlan diff --git a/scripts/tests/twister_blackbox/test_config.py b/scripts/tests/twister_blackbox/test_config.py index 1b34e637ff4..2cad497055f 100644 --- a/scripts/tests/twister_blackbox/test_config.py +++ b/scripts/tests/twister_blackbox/test_config.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_coverage.py b/scripts/tests/twister_blackbox/test_coverage.py index c1f85c05057..aeb41e63daf 100644 --- a/scripts/tests/twister_blackbox/test_coverage.py +++ b/scripts/tests/twister_blackbox/test_coverage.py @@ -7,7 +7,7 @@ """ import importlib import re -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_device.py b/scripts/tests/twister_blackbox/test_device.py index c35daa337e4..790e0774e30 100644 --- a/scripts/tests/twister_blackbox/test_device.py +++ b/scripts/tests/twister_blackbox/test_device.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_disable.py b/scripts/tests/twister_blackbox/test_disable.py index 3cbc7d31428..26e804af9d4 100644 --- a/scripts/tests/twister_blackbox/test_disable.py +++ b/scripts/tests/twister_blackbox/test_disable.py @@ -8,12 +8,11 @@ import importlib import pytest -from unittest import mock +import mock import os import sys import re -# pylint: disable=no-name-in-module from conftest import ZEPHYR_BASE, TEST_DATA, testsuite_filename_mock from twisterlib.testplan import TestPlan diff --git a/scripts/tests/twister_blackbox/test_error.py b/scripts/tests/twister_blackbox/test_error.py index 93d589fefdf..4a28f7fb178 100644 --- a/scripts/tests/twister_blackbox/test_error.py +++ b/scripts/tests/twister_blackbox/test_error.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_filter.py b/scripts/tests/twister_blackbox/test_filter.py index c65dda1604c..f7e3ff8f21f 100644 --- a/scripts/tests/twister_blackbox/test_filter.py +++ b/scripts/tests/twister_blackbox/test_filter.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_footprint.py b/scripts/tests/twister_blackbox/test_footprint.py index b9e072a2666..35824d792b1 100644 --- a/scripts/tests/twister_blackbox/test_footprint.py +++ b/scripts/tests/twister_blackbox/test_footprint.py @@ -8,7 +8,7 @@ import importlib import json -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_hardwaremap.py b/scripts/tests/twister_blackbox/test_hardwaremap.py index ce3493415a9..c1f6ff1eaf8 100644 --- a/scripts/tests/twister_blackbox/test_hardwaremap.py +++ b/scripts/tests/twister_blackbox/test_hardwaremap.py @@ -6,12 +6,11 @@ Blackbox tests for twister's command line functions """ import importlib -from unittest import mock +import mock import os import pytest import sys -# pylint: disable=no-name-in-module from conftest import ZEPHYR_BASE, testsuite_filename_mock, clear_log_in_test from twisterlib.testplan import TestPlan diff --git a/scripts/tests/twister_blackbox/test_outfile.py b/scripts/tests/twister_blackbox/test_outfile.py index bdaa5d3291d..590e0c8f58a 100644 --- a/scripts/tests/twister_blackbox/test_outfile.py +++ b/scripts/tests/twister_blackbox/test_outfile.py @@ -8,7 +8,7 @@ import importlib import re -from unittest import mock +import mock import os import shutil import pytest diff --git a/scripts/tests/twister_blackbox/test_output.py b/scripts/tests/twister_blackbox/test_output.py index c6a77020638..5babfa96620 100644 --- a/scripts/tests/twister_blackbox/test_output.py +++ b/scripts/tests/twister_blackbox/test_output.py @@ -8,7 +8,7 @@ import importlib import re -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_platform.py b/scripts/tests/twister_blackbox/test_platform.py index 33239d5fcc0..0c644dcff5a 100644 --- a/scripts/tests/twister_blackbox/test_platform.py +++ b/scripts/tests/twister_blackbox/test_platform.py @@ -8,7 +8,7 @@ import importlib import re -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_printouts.py b/scripts/tests/twister_blackbox/test_printouts.py index f383fe09744..8f07a0fd3aa 100644 --- a/scripts/tests/twister_blackbox/test_printouts.py +++ b/scripts/tests/twister_blackbox/test_printouts.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_quarantine.py b/scripts/tests/twister_blackbox/test_quarantine.py index 63e6de53cc5..61cfa9634e3 100644 --- a/scripts/tests/twister_blackbox/test_quarantine.py +++ b/scripts/tests/twister_blackbox/test_quarantine.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import re diff --git a/scripts/tests/twister_blackbox/test_report.py b/scripts/tests/twister_blackbox/test_report.py index ab2aec447ec..83d5942c855 100644 --- a/scripts/tests/twister_blackbox/test_report.py +++ b/scripts/tests/twister_blackbox/test_report.py @@ -8,7 +8,7 @@ import importlib import json -from unittest import mock +import mock import os import pytest import shutil diff --git a/scripts/tests/twister_blackbox/test_runner.py b/scripts/tests/twister_blackbox/test_runner.py index 09286663475..57ecef3fbfe 100644 --- a/scripts/tests/twister_blackbox/test_runner.py +++ b/scripts/tests/twister_blackbox/test_runner.py @@ -8,7 +8,7 @@ # pylint: disable=duplicate-code import importlib -from unittest import mock +import mock import os import pytest import re diff --git a/scripts/tests/twister_blackbox/test_shuffle.py b/scripts/tests/twister_blackbox/test_shuffle.py index ba19faf64b6..f45724b7b55 100644 --- a/scripts/tests/twister_blackbox/test_shuffle.py +++ b/scripts/tests/twister_blackbox/test_shuffle.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_testlist.py b/scripts/tests/twister_blackbox/test_testlist.py index 410c417e14c..ad8eaeddfaf 100644 --- a/scripts/tests/twister_blackbox/test_testlist.py +++ b/scripts/tests/twister_blackbox/test_testlist.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_testplan.py b/scripts/tests/twister_blackbox/test_testplan.py index 701acf94ddf..8834e03ead0 100644 --- a/scripts/tests/twister_blackbox/test_testplan.py +++ b/scripts/tests/twister_blackbox/test_testplan.py @@ -7,7 +7,7 @@ """ import importlib -from unittest import mock +import mock import os import pytest import sys diff --git a/scripts/tests/twister_blackbox/test_tooling.py b/scripts/tests/twister_blackbox/test_tooling.py index d844ec824de..3979517e2da 100644 --- a/scripts/tests/twister_blackbox/test_tooling.py +++ b/scripts/tests/twister_blackbox/test_tooling.py @@ -8,13 +8,12 @@ # pylint: disable=duplicate-code import importlib -from unittest import mock +import mock import os import pytest import sys import json -# pylint: disable=no-name-in-module from conftest import ZEPHYR_BASE, TEST_DATA, sample_filename_mock, testsuite_filename_mock from twisterlib.statuses import TwisterStatus from twisterlib.testplan import TestPlan From a3e7a1d1fb9f07653c900448c5c263ce98b0db9d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 010/881] Revert "[nrf fromtree] scripts: tests: apply ruff linting to test_domains.py" This reverts commit e683d5798f4796909e8f573cabffae5a69cd16b0. Signed-off-by: Jukka Rissanen --- scripts/tests/build_helpers/test_domains.py | 96 +++++++++------------ 1 file changed, 41 insertions(+), 55 deletions(-) diff --git a/scripts/tests/build_helpers/test_domains.py b/scripts/tests/build_helpers/test_domains.py index b22fff44916..0ebdeaf6cb2 100644 --- a/scripts/tests/build_helpers/test_domains.py +++ b/scripts/tests/build_helpers/test_domains.py @@ -8,49 +8,45 @@ import mock import os -import sys -from contextlib import nullcontext - import pytest +import sys ZEPHYR_BASE = os.getenv("ZEPHYR_BASE") sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/build_helpers")) -import domains # noqa: E402 +import domains + +from contextlib import nullcontext + TESTDATA_1 = [ ('', False, 1, ['domains.yaml file not found: domains.yaml']), ( - """ +""" default: None build_dir: some/dir domains: [] """, - True, - None, - [], + True, None, [] ), ] - @pytest.mark.parametrize( 'f_contents, f_exists, exit_code, expected_logs', TESTDATA_1, - ids=['no file', 'valid'], + ids=['no file', 'valid'] ) def test_from_file(caplog, f_contents, f_exists, exit_code, expected_logs): def mock_open(*args, **kwargs): if f_exists: return mock.mock_open(read_data=f_contents)(args, kwargs) - raise FileNotFoundError('domains.yaml not found.') + raise FileNotFoundError(f'domains.yaml not found.') init_mock = mock.Mock(return_value=None) - with ( - mock.patch('domains.Domains.__init__', init_mock), - mock.patch('builtins.open', mock_open), - pytest.raises(SystemExit) if exit_code else nullcontext() as s_exit, - ): + with mock.patch('domains.Domains.__init__', init_mock), \ + mock.patch('builtins.open', mock_open), \ + pytest.raises(SystemExit) if exit_code else nullcontext() as s_exit: result = domains.Domains.from_file('domains.yaml') if exit_code: @@ -64,7 +60,7 @@ def mock_open(*args, **kwargs): TESTDATA_2 = [ ( - """ +""" default: some default build_dir: my/dir domains: @@ -74,14 +70,10 @@ def mock_open(*args, **kwargs): build_dir: dir/3 flash_order: I don\'t think this is correct """, - 1, - None, - None, - None, - None, + 1, None, None, None, None ), ( - """ +""" build_dir: build/dir domains: - name: a domain @@ -97,15 +89,16 @@ def mock_open(*args, **kwargs): 'build/dir', [('default_domain', 'dir/2'), ('a domain', 'dir/1')], ('default_domain', 'dir/2'), - {'a domain': ('a domain', 'dir/1'), 'default_domain': ('default_domain', 'dir/2')}, + {'a domain': ('a domain', 'dir/1'), + 'default_domain': ('default_domain', 'dir/2')} ), ] - @pytest.mark.parametrize( - 'data, exit_code, expected_build_dir, expected_flash_order, expected_default, expected_domains', + 'data, exit_code, expected_build_dir, expected_flash_order,' \ + ' expected_default, expected_domains', TESTDATA_2, - ids=['invalid', 'valid'], + ids=['invalid', 'valid'] ) def test_from_yaml( caplog, @@ -114,15 +107,13 @@ def test_from_yaml( expected_build_dir, expected_flash_order, expected_default, - expected_domains, + expected_domains ): def mock_domain(name, build_dir, *args, **kwargs): return name, build_dir - with ( - mock.patch('domains.Domain', side_effect=mock_domain), - pytest.raises(SystemExit) if exit_code else nullcontext() as exit_st, - ): + with mock.patch('domains.Domain', side_effect=mock_domain), \ + pytest.raises(SystemExit) if exit_code else nullcontext() as exit_st: doms = domains.Domains.from_yaml(data) if exit_code: @@ -142,40 +133,35 @@ def mock_domain(name, build_dir, *args, **kwargs): ( None, True, - [ - ('some', os.path.join('dir', '2')), - ('order', os.path.join('dir', '1')), - ], + [('some', os.path.join('dir', '2')), + ('order', os.path.join('dir', '1'))] ), ( None, False, - [ - ('order', os.path.join('dir', '1')), - ('some', os.path.join('dir', '2')), - ], + [('order', os.path.join('dir', '1')), + ('some', os.path.join('dir', '2'))] ), ( ['some'], False, - [('some', os.path.join('dir', '2'))], + [('some', os.path.join('dir', '2'))] ), ] - @pytest.mark.parametrize( 'names, default_flash_order, expected_result', TESTDATA_3, - ids=['order only', 'no parameters', 'valid'], + ids=['order only', 'no parameters', 'valid'] ) def test_get_domains( caplog, names, default_flash_order, - expected_result, + expected_result ): doms = domains.Domains( - """ +""" domains: - name: dummy build_dir: dummy @@ -185,11 +171,11 @@ def test_get_domains( ) doms._flash_order = [ ('some', os.path.join('dir', '2')), - ('order', os.path.join('dir', '1')), + ('order', os.path.join('dir', '1')) ] doms._domains = { 'order': ('order', os.path.join('dir', '1')), - 'some': ('some', os.path.join('dir', '2')), + 'some': ('some', os.path.join('dir', '2')) } result = doms.get_domains(names, default_flash_order) @@ -197,36 +183,36 @@ def test_get_domains( assert result == expected_result + TESTDATA_3 = [ ( 'other', 1, ['domain "other" not found, valid domains are: order, some'], - None, + None ), ( 'some', None, [], - ('some', os.path.join('dir', '2')), + ('some', os.path.join('dir', '2')) ), ] - @pytest.mark.parametrize( 'name, exit_code, expected_logs, expected_result', TESTDATA_3, - ids=['domain not found', 'valid'], + ids=['domain not found', 'valid'] ) def test_get_domain( caplog, name, exit_code, expected_logs, - expected_result, + expected_result ): doms = domains.Domains( - """ +""" domains: - name: dummy build_dir: dummy @@ -236,11 +222,11 @@ def test_get_domain( ) doms._flash_order = [ ('some', os.path.join('dir', '2')), - ('order', os.path.join('dir', '1')), + ('order', os.path.join('dir', '1')) ] doms._domains = { 'order': ('order', os.path.join('dir', '1')), - 'some': ('some', os.path.join('dir', '2')), + 'some': ('some', os.path.join('dir', '2')) } with pytest.raises(SystemExit) if exit_code else nullcontext() as s_exit: From 121e99957581ae1deef94f6a31f570a9381fe261 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 011/881] Revert "[nrf fromtree] scripts: west_commands: canopen: replace progress by tqdm" This reverts commit 3c345c44e824012c8b9a524b5c214987a674ba0f. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.in | 2 +- scripts/requirements-actions.txt | 9 ++++----- scripts/requirements-base.txt | 1 + scripts/west_commands/runners/canopen_program.py | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 9d56d56f2a3..4bdb9b0fbda 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -17,6 +17,7 @@ mock mypy natsort ply>=3.10 +progress psutil>=5.6.6 pyelftools>=0.29 pygithub @@ -35,7 +36,6 @@ sphinx-lint tabulate tomli>=1.1.0 tox -tqdm>=4.67.1 unidiff vermin west>=0.14.0 diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 7e925010918..7588db2575f 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -261,7 +261,6 @@ colorama==0.4.6 \ # pylint # pytest # tox - # tqdm # west cryptography==45.0.5 \ --hash=sha256:0027d566d65a38497bc37e0dd7c2f8ceda73597d2ac9ba93810204f56f52ebc7 \ @@ -798,6 +797,10 @@ polib==1.2.0 \ --hash=sha256:1c77ee1b81feb31df9bca258cbc58db1bbb32d10214b173882452c73af06d62d \ --hash=sha256:f3ef94aefed6e183e342a8a269ae1fc4742ba193186ad76f175938621dbfc26b # via sphinx-lint +progress==1.6.1 \ + --hash=sha256:5239f22f305c12fdc8ce6e0e47f70f21622a935e16eafc4535617112e7c7ea0b \ + --hash=sha256:c1ba719f862ce885232a759eab47971fe74dfc7bb76ab8a51ef5940bad35086c + # via -r requirements-actions.in psutil==7.0.0 \ --hash=sha256:101d71dc322e3cffd7cea0650b09b3d08b8e7c4109dd6809fe452dfd00e58b25 \ --hash=sha256:1e744154a6580bc968a0195fd25e80432d3afec619daf145b9e5ba16cc1d688e \ @@ -1228,10 +1231,6 @@ tox==4.27.0 \ --hash=sha256:2b8a7fb986b82aa2c830c0615082a490d134e0626dbc9189986da46a313c4f20 \ --hash=sha256:b97d5ecc0c0d5755bcc5348387fef793e1bfa68eb33746412f4c60881d7f5f57 # via -r requirements-actions.in -tqdm==4.67.1 \ - --hash=sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2 \ - --hash=sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2 - # via -r requirements-actions.in typing-extensions==4.14.0 \ --hash=sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4 \ --hash=sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af diff --git a/scripts/requirements-base.txt b/scripts/requirements-base.txt index 52732068f39..efa58d8c19d 100644 --- a/scripts/requirements-base.txt +++ b/scripts/requirements-base.txt @@ -16,6 +16,7 @@ pykwalify # used by west_commands canopen packaging +progress patool>=2.0.0 psutil>=5.6.6 pylink-square diff --git a/scripts/west_commands/runners/canopen_program.py b/scripts/west_commands/runners/canopen_program.py index e72b1dbbd66..081a2652bfc 100644 --- a/scripts/west_commands/runners/canopen_program.py +++ b/scripts/west_commands/runners/canopen_program.py @@ -12,7 +12,7 @@ try: import canopen - from tqdm import tqdm + from progress.bar import Bar MISSING_REQUIREMENTS = False except ImportError: MISSING_REQUIREMENTS = True @@ -284,17 +284,17 @@ def download(self, bin_file): outfile = self.data_sdo.open('wb', buffering=self.download_buffer_size, size=size, block_transfer=self.block_transfer) - progress = tqdm(total=size, unit='B', unit_scale=True) + progress = Bar('%(percent)d%%', max=size, suffix='%(index)d/%(max)dB') while True: chunk = infile.read(self.download_buffer_size // 2) if not chunk: break outfile.write(chunk) - progress.update(len(chunk)) + progress.next(n=len(chunk)) except Exception as err: raise ValueError('Failed to download program') from err finally: - progress.close() + progress.finish() infile.close() outfile.close() From e632fd8bdbb9a3e12dd3d0c94ac1c2ca6362124d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 012/881] Revert "[nrf fromtree] scripts: requirements-base: pin patool to >=2.0.0" This reverts commit 68ea99f2febae85ad8639d023d9d223c7d317a04. Signed-off-by: Jukka Rissanen --- scripts/requirements-base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/requirements-base.txt b/scripts/requirements-base.txt index efa58d8c19d..2b35d3df097 100644 --- a/scripts/requirements-base.txt +++ b/scripts/requirements-base.txt @@ -17,7 +17,7 @@ pykwalify canopen packaging progress -patool>=2.0.0 +patool psutil>=5.6.6 pylink-square pyserial From 73e5fcd5b5c23c755b4c5eb05155b83d8b8843fb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 013/881] Revert "[nrf fromtree] Revert "doc: ci: Zephyr now requires Python 3.12 or higher"" This reverts commit 654c27e193d4815a4d984375ddc418f19c582fc4. Signed-off-by: Jukka Rissanen --- cmake/modules/python.cmake | 2 +- doc/develop/getting_started/index.rst | 2 +- doc/releases/migration-guide-4.2.rst | 5 + doc/requirements.txt | 322 ++++++++++----------- scripts/ci/check_compliance.py | 2 +- scripts/requirements-actions.txt | 389 ++++++++++++++------------ 6 files changed, 366 insertions(+), 356 deletions(-) diff --git a/cmake/modules/python.cmake b/cmake/modules/python.cmake index e01d3192120..1438c3fcdaa 100644 --- a/cmake/modules/python.cmake +++ b/cmake/modules/python.cmake @@ -11,7 +11,7 @@ if (WIN32) set(ENV{PYTHONIOENCODING} "utf-8") endif() -set(PYTHON_MINIMUM_REQUIRED 3.10) +set(PYTHON_MINIMUM_REQUIRED 3.12) if(NOT DEFINED Python3_EXECUTABLE AND DEFINED WEST_PYTHON) set(Python3_EXECUTABLE "${WEST_PYTHON}") diff --git a/doc/develop/getting_started/index.rst b/doc/develop/getting_started/index.rst index 78f43e70b5f..5ba0d070fca 100644 --- a/doc/develop/getting_started/index.rst +++ b/doc/develop/getting_started/index.rst @@ -62,7 +62,7 @@ The current minimum required version for the main dependencies are: - 3.20.5 * - `Python `_ - - 3.10 + - 3.12 * - `Devicetree compiler `_ - 1.4.6 diff --git a/doc/releases/migration-guide-4.2.rst b/doc/releases/migration-guide-4.2.rst index 9b31f4a1634..26e4bd655e7 100644 --- a/doc/releases/migration-guide-4.2.rst +++ b/doc/releases/migration-guide-4.2.rst @@ -20,6 +20,11 @@ the :ref:`release notes`. :local: :depth: 2 +Common +****** + +* The minimum required Python version is now 3.12 (from 3.10). + Build System ************ diff --git a/doc/requirements.txt b/doc/requirements.txt index 255ff1321a5..3d424a5627e 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --universal --python-version 3.10 --generate-hashes requirements.in --output-file requirements.txt +# uv pip compile --universal --python-version 3.12 --generate-hashes requirements.in --output-file requirements.txt alabaster==1.0.0 \ --hash=sha256:c00dca57bca26fa62a6d7d0a9fcce65f3e026e9bfe33e9c538fd3fbb2144fd9e \ --hash=sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b @@ -145,12 +145,6 @@ docutils==0.21.2 \ doxmlparser==1.14.0 \ --hash=sha256:1037dcc4aadf908feb2d908685159972bb2975322fbe2b120f5cac5a938f0b14 # via -r requirements.in -exceptiongroup==1.3.0 ; python_full_version < '3.11' \ - --hash=sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10 \ - --hash=sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88 - # via - # anyio - # pytest h11==0.16.0 \ --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 @@ -173,97 +167,139 @@ jinja2==3.1.6 \ --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 # via sphinx -lxml==6.0.0 \ - --hash=sha256:013090383863b72c62a702d07678b658fa2567aa58d373d963cca245b017e065 \ - --hash=sha256:032e65120339d44cdc3efc326c9f660f5f7205f3a535c1fdbf898b29ea01fb72 \ - --hash=sha256:048a930eb4572829604982e39a0c7289ab5dc8abc7fc9f5aabd6fbc08c154e93 \ - --hash=sha256:04d67ceee6db4bcb92987ccb16e53bef6b42ced872509f333c04fb58a3315256 \ - --hash=sha256:059c4cbf3973a621b62ea3132934ae737da2c132a788e6cfb9b08d63a0ef73f9 \ - --hash=sha256:0e32698462aacc5c1cf6bdfebc9c781821b7e74c79f13e5ffc8bfe27c42b1abf \ - --hash=sha256:1676b56d48048a62ef77a250428d1f31f610763636e0784ba67a9740823988ca \ - --hash=sha256:17f090a9bc0ce8da51a5632092f98a7e7f84bca26f33d161a98b57f7fb0004ca \ - --hash=sha256:185efc2fed89cdd97552585c624d3c908f0464090f4b91f7d92f8ed2f3b18f54 \ - --hash=sha256:1fa377b827ca2023244a06554c6e7dc6828a10aaf74ca41965c5d8a4925aebb4 \ - --hash=sha256:2181e4b1d07dde53986023482673c0f1fba5178ef800f9ab95ad791e8bdded6a \ - --hash=sha256:219e0431ea8006e15005767f0351e3f7f9143e793e58519dc97fe9e07fae5563 \ - --hash=sha256:21db1ec5525780fd07251636eb5f7acb84003e9382c72c18c542a87c416ade03 \ - --hash=sha256:246b40f8a4aec341cbbf52617cad8ab7c888d944bfe12a6abd2b1f6cfb6f6082 \ - --hash=sha256:2793a627e95d119e9f1e19720730472f5543a6d84c50ea33313ce328d870f2dd \ - --hash=sha256:2930aa001a3776c3e2601cb8e0a15d21b8270528d89cc308be4843ade546b9ab \ - --hash=sha256:2ae06fbab4f1bb7db4f7c8ca9897dc8db4447d1a2b9bee78474ad403437bcc29 \ - --hash=sha256:2b4790b558bee331a933e08883c423f65bbcd07e278f91b2272489e31ab1e2b4 \ - --hash=sha256:2cfcf84f1defed7e5798ef4f88aa25fcc52d279be731ce904789aa7ccfb7e8d2 \ - --hash=sha256:2dd1cc3ea7e60bfb31ff32cafe07e24839df573a5e7c2d33304082a5019bcd58 \ - --hash=sha256:2f34687222b78fff795feeb799a7d44eca2477c3d9d3a46ce17d51a4f383e32e \ - --hash=sha256:310b719b695b3dd442cdfbbe64936b2f2e231bb91d998e99e6f0daf991a3eba3 \ - --hash=sha256:34190a1ec4f1e84af256495436b2d196529c3f2094f0af80202947567fdbf2e7 \ - --hash=sha256:35bc626eec405f745199200ccb5c6b36f202675d204aa29bb52e27ba2b71dea8 \ - --hash=sha256:36531f81c8214e293097cd2b7873f178997dae33d3667caaae8bdfb9666b76c0 \ - --hash=sha256:390240baeb9f415a82eefc2e13285016f9c8b5ad71ec80574ae8fa9605093cd7 \ - --hash=sha256:40442e2a4456e9910875ac12951476d36c0870dcb38a68719f8c4686609897c4 \ - --hash=sha256:4337e4aec93b7c011f7ee2e357b0d30562edd1955620fdd4aeab6aacd90d43c5 \ - --hash=sha256:43cfbb7db02b30ad3926e8fceaef260ba2fb7df787e38fa2df890c1ca7966c3b \ - --hash=sha256:43fe5af2d590bf4691531b1d9a2495d7aab2090547eaacd224a3afec95706d76 \ - --hash=sha256:46b9ed911f36bfeb6338e0b482e7fe7c27d362c52fde29f221fddbc9ee2227e7 \ - --hash=sha256:4d23854ecf381ab1facc8f353dcd9adeddef3652268ee75297c1164c987c11dc \ - --hash=sha256:4eb114a0754fd00075c12648d991ec7a4357f9cb873042cc9a77bf3a7e30c9db \ - --hash=sha256:4ee56288d0df919e4aac43b539dd0e34bb55d6a12a6562038e8d6f3ed07f9e36 \ - --hash=sha256:51a5e4c61a4541bd1cd3ba74766d0c9b6c12d6a1a4964ef60026832aac8e79b3 \ - --hash=sha256:522fe7abb41309e9543b0d9b8b434f2b630c5fdaf6482bee642b34c8c70079c8 \ - --hash=sha256:54c4855eabd9fc29707d30141be99e5cd1102e7d2258d2892314cf4c110726c3 \ - --hash=sha256:5592401cdf3dc682194727c1ddaa8aa0f3ddc57ca64fd03226a430b955eab6f6 \ - --hash=sha256:58ffd35bd5425c3c3b9692d078bf7ab851441434531a7e517c4984d5634cd65b \ - --hash=sha256:5967fe415b1920a3877a4195e9a2b779249630ee49ece22021c690320ff07452 \ - --hash=sha256:5fcd7d3b1d8ecb91445bd71b9c88bdbeae528fefee4f379895becfc72298d181 \ - --hash=sha256:63b634facdfbad421d4b61c90735688465d4ab3a8853ac22c76ccac2baf98d97 \ - --hash=sha256:690b20e3388a7ec98e899fd54c924e50ba6693874aa65ef9cb53de7f7de9d64a \ - --hash=sha256:6da7cd4f405fd7db56e51e96bff0865b9853ae70df0e6720624049da76bde2da \ - --hash=sha256:7488a43033c958637b1a08cddc9188eb06d3ad36582cebc7d4815980b47e27ef \ - --hash=sha256:74e748012f8c19b47f7d6321ac929a9a94ee92ef12bc4298c47e8b7219b26541 \ - --hash=sha256:78718d8454a6e928470d511bf8ac93f469283a45c354995f7d19e77292f26108 \ - --hash=sha256:7bf61bc4345c1895221357af8f3e89f8c103d93156ef326532d35c707e2fb19d \ - --hash=sha256:7da298e1659e45d151b4028ad5c7974917e108afb48731f4ed785d02b6818994 \ - --hash=sha256:84ef591495ffd3f9dcabffd6391db7bb70d7230b5c35ef5148354a134f56f2be \ - --hash=sha256:85b14a4689d5cff426c12eefe750738648706ea2753b20c2f973b2a000d3d261 \ - --hash=sha256:8a2e76efbf8772add72d002d67a4c3d0958638696f541734304c7f28217a9cab \ - --hash=sha256:8cb26f51c82d77483cdcd2b4a53cda55bbee29b3c2f3ddeb47182a2a9064e4eb \ - --hash=sha256:8db5dc617cb937ae17ff3403c3a70a7de9df4852a046f93e71edaec678f721d0 \ - --hash=sha256:9ab542c91f5a47aaa58abdd8ea84b498e8e49fe4b883d67800017757a3eb78e8 \ - --hash=sha256:9da022c14baeec36edfcc8daf0e281e2f55b950249a455776f0d1adeeada4734 \ - --hash=sha256:9f4b481b6cc3a897adb4279216695150bbe7a44c03daba3c894f49d2037e0a24 \ - --hash=sha256:a52a4704811e2623b0324a18d41ad4b9fabf43ce5ff99b14e40a520e2190c851 \ - --hash=sha256:a55da151d0b0c6ab176b4e761670ac0e2667817a1e0dadd04a01d0561a219349 \ - --hash=sha256:a674c0948789e9136d69065cc28009c1b1874c6ea340253db58be7622ce6398f \ - --hash=sha256:ae74f7c762270196d2dda56f8dd7309411f08a4084ff2dfcc0b095a218df2e06 \ - --hash=sha256:afd27d8629ae94c5d863e32ab0e1d5590371d296b87dae0a751fb22bf3685741 \ - --hash=sha256:b2d71cdefda9424adff9a3607ba5bbfc60ee972d73c21c7e3c19e71037574816 \ - --hash=sha256:b34339898bb556a2351a1830f88f751679f343eabf9cf05841c95b165152c9e7 \ - --hash=sha256:b372d10d17a701b0945f67be58fae4664fd056b85e0ff0fbc1e6c951cdbc0512 \ - --hash=sha256:b3c98d5b24c6095e89e03d65d5c574705be3d49c0d8ca10c17a8a4b5201b72f5 \ - --hash=sha256:b8dd6dd0e9c1992613ccda2bcb74fc9d49159dbe0f0ca4753f37527749885c25 \ - --hash=sha256:bd5913b4972681ffc9718bc2d4c53cde39ef81415e1671ff93e9aa30b46595e7 \ - --hash=sha256:c0b5fa5eda84057a4f1bbb4bb77a8c28ff20ae7ce211588d698ae453e13c6281 \ - --hash=sha256:c16304bba98f48a28ae10e32a8e75c349dd742c45156f297e16eeb1ba9287a1f \ - --hash=sha256:c24b8efd9c0f62bad0439283c2c795ef916c5a6b75f03c17799775c7ae3c0c9e \ - --hash=sha256:c2a5e8d207311a0170aca0eb6b160af91adc29ec121832e4ac151a57743a1e1e \ - --hash=sha256:c352fc8f36f7e9727db17adbf93f82499457b3d7e5511368569b4c5bd155a922 \ - --hash=sha256:c86df1c9af35d903d2b52d22ea3e66db8058d21dc0f59842ca5deb0595921141 \ - --hash=sha256:ca50bd612438258a91b5b3788c6621c1f05c8c478e7951899f492be42defc0da \ - --hash=sha256:d18a25b19ca7307045581b18b3ec9ead2b1db5ccd8719c291f0cd0a5cec6cb81 \ - --hash=sha256:d4f0c66df4386b75d2ab1e20a489f30dc7fd9a06a896d64980541506086be1f1 \ - --hash=sha256:d7ae472f74afcc47320238b5dbfd363aba111a525943c8a34a1b657c6be934c3 \ - --hash=sha256:db0efd6bae1c4730b9c863fc4f5f3c0fa3e8f05cae2c44ae141cb9dfc7d091dc \ - --hash=sha256:dbdd7679a6f4f08152818043dbb39491d1af3332128b3752c3ec5cebc0011a72 \ - --hash=sha256:e0b1520ef900e9ef62e392dd3d7ae4f5fa224d1dd62897a792cf353eb20b6cae \ - --hash=sha256:e2030956cf4886b10be9a0285c6802e078ec2391e1dd7ff3eb509c2c95a69b76 \ - --hash=sha256:e35e8aaaf3981489f42884b59726693de32dabfc438ac10ef4eb3409961fd402 \ - --hash=sha256:e380e85b93f148ad28ac15f8117e2fd8e5437aa7732d65e260134f83ce67911b \ - --hash=sha256:edf6e4c8fe14dfe316939711e3ece3f9a20760aabf686051b537a7562f4da91a \ - --hash=sha256:f3389924581d9a770c6caa4df4e74b606180869043b9073e2cec324bad6e306e \ - --hash=sha256:f64ccf593916e93b8d36ed55401bb7fe9c7d5de3180ce2e10b08f82a8f397316 \ - --hash=sha256:f720a14aa102a38907c6d5030e3d66b3b680c3e6f6bc95473931ea3c00c59967 \ - --hash=sha256:f8d19565ae3eb956d84da3ef367aa7def14a2735d05bd275cd54c0301f0d0d6c \ - --hash=sha256:f97487996a39cb18278ca33f7be98198f278d0bc3c5d0fd4d7b3d63646ca3c8a +lxml==5.4.0 \ + --hash=sha256:00b8686694423ddae324cf614e1b9659c2edb754de617703c3d29ff568448df5 \ + --hash=sha256:073eb6dcdf1f587d9b88c8c93528b57eccda40209cf9be549d469b942b41d70b \ + --hash=sha256:09846782b1ef650b321484ad429217f5154da4d6e786636c38e434fa32e94e49 \ + --hash=sha256:0a01ce7d8479dce84fc03324e3b0c9c90b1ece9a9bb6a1b6c9025e7e4520e78c \ + --hash=sha256:0be91891bdb06ebe65122aa6bf3fc94489960cf7e03033c6f83a90863b23c58b \ + --hash=sha256:0cef4feae82709eed352cd7e97ae062ef6ae9c7b5dbe3663f104cd2c0e8d94ba \ + --hash=sha256:0e108352e203c7afd0eb91d782582f00a0b16a948d204d4dec8565024fafeea5 \ + --hash=sha256:0ea0252b51d296a75f6118ed0d8696888e7403408ad42345d7dfd0d1e93309a7 \ + --hash=sha256:0fce1294a0497edb034cb416ad3e77ecc89b313cff7adbee5334e4dc0d11f422 \ + --hash=sha256:1320091caa89805df7dcb9e908add28166113dcd062590668514dbd510798c88 \ + --hash=sha256:142accb3e4d1edae4b392bd165a9abdee8a3c432a2cca193df995bc3886249c8 \ + --hash=sha256:14479c2ad1cb08b62bb941ba8e0e05938524ee3c3114644df905d2331c76cd57 \ + --hash=sha256:151d6c40bc9db11e960619d2bf2ec5829f0aaffb10b41dcf6ad2ce0f3c0b2325 \ + --hash=sha256:15a665ad90054a3d4f397bc40f73948d48e36e4c09f9bcffc7d90c87410e478a \ + --hash=sha256:1a42b3a19346e5601d1b8296ff6ef3d76038058f311902edd574461e9c036982 \ + --hash=sha256:1af80c6316ae68aded77e91cd9d80648f7dd40406cef73df841aa3c36f6907c8 \ + --hash=sha256:1b717b00a71b901b4667226bba282dd462c42ccf618ade12f9ba3674e1fabc55 \ + --hash=sha256:1dc4ca99e89c335a7ed47d38964abcb36c5910790f9bd106f2a8fa2ee0b909d2 \ + --hash=sha256:20e16c08254b9b6466526bc1828d9370ee6c0d60a4b64836bc3ac2917d1e16df \ + --hash=sha256:226046e386556a45ebc787871d6d2467b32c37ce76c2680f5c608e25823ffc84 \ + --hash=sha256:24974f774f3a78ac12b95e3a20ef0931795ff04dbb16db81a90c37f589819551 \ + --hash=sha256:24f6df5f24fc3385f622c0c9d63fe34604893bc1a5bdbb2dbf5870f85f9a404a \ + --hash=sha256:27a9ded0f0b52098ff89dd4c418325b987feed2ea5cc86e8860b0f844285d740 \ + --hash=sha256:29f451a4b614a7b5b6c2e043d7b64a15bd8304d7e767055e8ab68387a8cacf4e \ + --hash=sha256:2b31a3a77501d86d8ade128abb01082724c0dfd9524f542f2f07d693c9f1175f \ + --hash=sha256:2c62891b1ea3094bb12097822b3d44b93fc6c325f2043c4d2736a8ff09e65f60 \ + --hash=sha256:2dc191e60425ad70e75a68c9fd90ab284df64d9cd410ba8d2b641c0c45bc006e \ + --hash=sha256:31e63621e073e04697c1b2d23fcb89991790eef370ec37ce4d5d469f40924ed6 \ + --hash=sha256:32697d2ea994e0db19c1df9e40275ffe84973e4232b5c274f47e7c1ec9763cdd \ + --hash=sha256:3a3178b4873df8ef9457a4875703488eb1622632a9cee6d76464b60e90adbfcd \ + --hash=sha256:3b9c2754cef6963f3408ab381ea55f47dabc6f78f4b8ebb0f0b25cf1ac1f7609 \ + --hash=sha256:3d3c30ba1c9b48c68489dc1829a6eede9873f52edca1dda900066542528d6b20 \ + --hash=sha256:3e6d5557989cdc3ebb5302bbdc42b439733a841891762ded9514e74f60319ad6 \ + --hash=sha256:4025bf2884ac4370a3243c5aa8d66d3cb9e15d3ddd0af2d796eccc5f0244390e \ + --hash=sha256:4291d3c409a17febf817259cb37bc62cb7eb398bcc95c1356947e2871911ae61 \ + --hash=sha256:4329422de653cdb2b72afa39b0aa04252fca9071550044904b2e7036d9d97fe4 \ + --hash=sha256:43d549b876ce64aa18b2328faff70f5877f8c6dede415f80a2f799d31644d776 \ + --hash=sha256:460508a4b07364d6abf53acaa0a90b6d370fafde5693ef37602566613a9b0779 \ + --hash=sha256:47fb24cc0f052f0576ea382872b3fc7e1f7e3028e53299ea751839418ade92a6 \ + --hash=sha256:48b4afaf38bf79109bb060d9016fad014a9a48fb244e11b94f74ae366a64d252 \ + --hash=sha256:497cab4d8254c2a90bf988f162ace2ddbfdd806fce3bda3f581b9d24c852e03c \ + --hash=sha256:4aa412a82e460571fad592d0f93ce9935a20090029ba08eca05c614f99b0cc92 \ + --hash=sha256:4b7ce10634113651d6f383aa712a194179dcd496bd8c41e191cec2099fa09de5 \ + --hash=sha256:4cd915c0fb1bed47b5e6d6edd424ac25856252f09120e3e8ba5154b6b921860e \ + --hash=sha256:4d885698f5019abe0de3d352caf9466d5de2baded00a06ef3f1216c1a58ae78f \ + --hash=sha256:4f5322cf38fe0e21c2d73901abf68e6329dc02a4994e483adbcf92b568a09a54 \ + --hash=sha256:50441c9de951a153c698b9b99992e806b71c1f36d14b154592580ff4a9d0d877 \ + --hash=sha256:529024ab3a505fed78fe3cc5ddc079464e709f6c892733e3f5842007cec8ac6e \ + --hash=sha256:53370c26500d22b45182f98847243efb518d268374a9570409d2e2276232fd37 \ + --hash=sha256:53d9469ab5460402c19553b56c3648746774ecd0681b1b27ea74d5d8a3ef5590 \ + --hash=sha256:56dbdbab0551532bb26c19c914848d7251d73edb507c3079d6805fa8bba5b706 \ + --hash=sha256:5a99d86351f9c15e4a901fc56404b485b1462039db59288b203f8c629260a142 \ + --hash=sha256:5cca36a194a4eb4e2ed6be36923d3cffd03dcdf477515dea687185506583d4c9 \ + --hash=sha256:5f11a1526ebd0dee85e7b1e39e39a0cc0d9d03fb527f56d8457f6df48a10dc0c \ + --hash=sha256:61c7bbf432f09ee44b1ccaa24896d21075e533cd01477966a5ff5a71d88b2f56 \ + --hash=sha256:639978bccb04c42677db43c79bdaa23785dc7f9b83bfd87570da8207872f1ce5 \ + --hash=sha256:63e7968ff83da2eb6fdda967483a7a023aa497d85ad8f05c3ad9b1f2e8c84987 \ + --hash=sha256:664cdc733bc87449fe781dbb1f309090966c11cc0c0cd7b84af956a02a8a4729 \ + --hash=sha256:67ed8a40665b84d161bae3181aa2763beea3747f748bca5874b4af4d75998f87 \ + --hash=sha256:67f779374c6b9753ae0a0195a892a1c234ce8416e4448fe1e9f34746482070a7 \ + --hash=sha256:6854f8bd8a1536f8a1d9a3655e6354faa6406621cf857dc27b681b69860645c7 \ + --hash=sha256:696ea9e87442467819ac22394ca36cb3d01848dad1be6fac3fb612d3bd5a12cf \ + --hash=sha256:6ef80aeac414f33c24b3815ecd560cee272786c3adfa5f31316d8b349bfade28 \ + --hash=sha256:72ac9762a9f8ce74c9eed4a4e74306f2f18613a6b71fa065495a67ac227b3056 \ + --hash=sha256:75133890e40d229d6c5837b0312abbe5bac1c342452cf0e12523477cd3aa21e7 \ + --hash=sha256:7605c1c32c3d6e8c990dd28a0970a3cbbf1429d5b92279e37fda05fb0c92190e \ + --hash=sha256:773e27b62920199c6197130632c18fb7ead3257fce1ffb7d286912e56ddb79e0 \ + --hash=sha256:795f61bcaf8770e1b37eec24edf9771b307df3af74d1d6f27d812e15a9ff3872 \ + --hash=sha256:79d5bfa9c1b455336f52343130b2067164040604e41f6dc4d8313867ed540079 \ + --hash=sha256:7a62cc23d754bb449d63ff35334acc9f5c02e6dae830d78dab4dd12b78a524f4 \ + --hash=sha256:7be701c24e7f843e6788353c055d806e8bd8466b52907bafe5d13ec6a6dbaecd \ + --hash=sha256:7ca56ebc2c474e8f3d5761debfd9283b8b18c76c4fc0967b74aeafba1f5647f9 \ + --hash=sha256:7ce1a171ec325192c6a636b64c94418e71a1964f56d002cc28122fceff0b6121 \ + --hash=sha256:891f7f991a68d20c75cb13c5c9142b2a3f9eb161f1f12a9489c82172d1f133c0 \ + --hash=sha256:8f82125bc7203c5ae8633a7d5d20bcfdff0ba33e436e4ab0abc026a53a8960b7 \ + --hash=sha256:91505d3ddebf268bb1588eb0f63821f738d20e1e7f05d3c647a5ca900288760b \ + --hash=sha256:942a5d73f739ad7c452bf739a62a0f83e2578afd6b8e5406308731f4ce78b16d \ + --hash=sha256:9454b8d8200ec99a224df8854786262b1bd6461f4280064c807303c642c05e76 \ + --hash=sha256:9459e6892f59ecea2e2584ee1058f5d8f629446eab52ba2305ae13a32a059530 \ + --hash=sha256:9776af1aad5a4b4a1317242ee2bea51da54b2a7b7b48674be736d463c999f37d \ + --hash=sha256:97dac543661e84a284502e0cf8a67b5c711b0ad5fb661d1bd505c02f8cf716d7 \ + --hash=sha256:98a3912194c079ef37e716ed228ae0dcb960992100461b704aea4e93af6b0bb9 \ + --hash=sha256:9b4a3bd174cc9cdaa1afbc4620c049038b441d6ba07629d89a83b408e54c35cd \ + --hash=sha256:9c886b481aefdf818ad44846145f6eaf373a20d200b5ce1a5c8e1bc2d8745410 \ + --hash=sha256:9ceaf423b50ecfc23ca00b7f50b64baba85fb3fb91c53e2c9d00bc86150c7e40 \ + --hash=sha256:a11a96c3b3f7551c8a8109aa65e8594e551d5a84c76bf950da33d0fb6dfafab7 \ + --hash=sha256:a3bcdde35d82ff385f4ede021df801b5c4a5bcdfb61ea87caabcebfc4945dc1b \ + --hash=sha256:a7fb111eef4d05909b82152721a59c1b14d0f365e2be4c742a473c5d7372f4f5 \ + --hash=sha256:a81e1196f0a5b4167a8dafe3a66aa67c4addac1b22dc47947abd5d5c7a3f24b5 \ + --hash=sha256:a8c9b7f16b63e65bbba889acb436a1034a82d34fa09752d754f88d708eca80e1 \ + --hash=sha256:a8ef956fce64c8551221f395ba21d0724fed6b9b6242ca4f2f7beb4ce2f41997 \ + --hash=sha256:ab339536aa798b1e17750733663d272038bf28069761d5be57cb4a9b0137b4f8 \ + --hash=sha256:ac7ba71f9561cd7d7b55e1ea5511543c0282e2b6450f122672a2694621d63b7e \ + --hash=sha256:aea53d51859b6c64e7c51d522c03cc2c48b9b5d6172126854cc7f01aa11f52bc \ + --hash=sha256:aea7c06667b987787c7d1f5e1dfcd70419b711cdb47d6b4bb4ad4b76777a0563 \ + --hash=sha256:aefe1a7cb852fa61150fcb21a8c8fcea7b58c4cb11fbe59c97a0a4b31cae3c8c \ + --hash=sha256:b0989737a3ba6cf2a16efb857fb0dfa20bc5c542737fddb6d893fde48be45433 \ + --hash=sha256:b108134b9667bcd71236c5a02aad5ddd073e372fb5d48ea74853e009fe38acb6 \ + --hash=sha256:b12cb6527599808ada9eb2cd6e0e7d3d8f13fe7bbb01c6311255a15ded4c7ab4 \ + --hash=sha256:b5aff6f3e818e6bdbbb38e5967520f174b18f539c2b9de867b1e7fde6f8d95a4 \ + --hash=sha256:b67319b4aef1a6c56576ff544b67a2a6fbd7eaee485b241cabf53115e8908b8f \ + --hash=sha256:b7c86884ad23d61b025989d99bfdd92a7351de956e01c61307cb87035960bcb1 \ + --hash=sha256:b92b69441d1bd39f4940f9eadfa417a25862242ca2c396b406f9272ef09cdcaa \ + --hash=sha256:bcb7a1096b4b6b24ce1ac24d4942ad98f983cd3810f9711bcd0293f43a9d8b9f \ + --hash=sha256:bda3ea44c39eb74e2488297bb39d47186ed01342f0022c8ff407c250ac3f498e \ + --hash=sha256:be2ba4c3c5b7900246a8f866580700ef0d538f2ca32535e991027bdaba944063 \ + --hash=sha256:c5681160758d3f6ac5b4fea370495c48aac0989d6a0f01bb9a72ad8ef5ab75c4 \ + --hash=sha256:c5d32f5284012deaccd37da1e2cd42f081feaa76981f0eaa474351b68df813c5 \ + --hash=sha256:c6364038c519dffdbe07e3cf42e6a7f8b90c275d4d1617a69bb59734c1a2d571 \ + --hash=sha256:c70e93fba207106cb16bf852e421c37bbded92acd5964390aad07cb50d60f5cf \ + --hash=sha256:ca755eebf0d9e62d6cb013f1261e510317a41bf4650f22963474a663fdfe02aa \ + --hash=sha256:cccd007d5c95279e529c146d095f1d39ac05139de26c098166c4beb9374b0f4d \ + --hash=sha256:ce31158630a6ac85bddd6b830cffd46085ff90498b397bd0a259f59d27a12188 \ + --hash=sha256:ce9c671845de9699904b1e9df95acfe8dfc183f2310f163cdaa91a3535af95de \ + --hash=sha256:d12832e1dbea4be280b22fd0ea7c9b87f0d8fc51ba06e92dc62d52f804f78ebd \ + --hash=sha256:d2ed1b3cb9ff1c10e6e8b00941bb2e5bb568b307bfc6b17dffbbe8be5eecba86 \ + --hash=sha256:d5663bc1b471c79f5c833cffbc9b87d7bf13f87e055a5c86c363ccd2348d7e82 \ + --hash=sha256:d90b729fd2732df28130c064aac9bb8aff14ba20baa4aee7bd0795ff1187545f \ + --hash=sha256:dc0af80267edc68adf85f2a5d9be1cdf062f973db6790c1d065e45025fa26140 \ + --hash=sha256:de5b4e1088523e2b6f730d0509a9a813355b7f5659d70eb4f319c76beea2e250 \ + --hash=sha256:de6f6bb8a7840c7bf216fb83eec4e2f79f7325eca8858167b68708b929ab2172 \ + --hash=sha256:df53330a3bff250f10472ce96a9af28628ff1f4efc51ccba351a8820bca2a8ba \ + --hash=sha256:e094ec83694b59d263802ed03a8384594fcce477ce484b0cbcd0008a211ca751 \ + --hash=sha256:e794f698ae4c5084414efea0f5cc9f4ac562ec02d66e1484ff822ef97c2cadff \ + --hash=sha256:e7bc6df34d42322c5289e37e9971d6ed114e3776b45fa879f734bded9d1fea9c \ + --hash=sha256:eaf24066ad0b30917186420d51e2e3edf4b0e2ea68d8cd885b14dc8afdcf6556 \ + --hash=sha256:ecf4c4b83f1ab3d5a7ace10bafcb6f11df6156857a3c418244cef41ca9fa3e44 \ + --hash=sha256:ef5a7178fcc73b7d8c07229e89f8eb45b2908a9238eb90dcfc46571ccf0383b8 \ + --hash=sha256:f5cb182f6396706dc6cc1896dd02b1c889d644c081b0cdec38747573db88a7d7 \ + --hash=sha256:fa0e294046de09acd6146be0ed6727d1f42ded4ce3ea1e9a19c11b6774eea27c \ + --hash=sha256:fb54f7c6bafaa808f27166569b1511fc42701a7713858dddc08afdde9746849e \ + --hash=sha256:fd3be6481ef54b8cfd0e1e953323b7aa9d9789b94842d0e5b142ef4bb7999539 # via doxmlparser markupsafe==3.0.2 \ --hash=sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4 \ @@ -338,9 +374,9 @@ pluggy==1.6.0 \ --hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \ --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 # via pytest -pygments==2.19.2 \ - --hash=sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887 \ - --hash=sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b +pygments==2.19.1 \ + --hash=sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f \ + --hash=sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c # via # -r requirements.in # pytest @@ -421,7 +457,7 @@ requests==2.32.4 \ --hash=sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c \ --hash=sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422 # via sphinx -roman-numerals-py==3.1.0 ; python_full_version >= '3.11' \ +roman-numerals-py==3.1.0 \ --hash=sha256:9da2ad2fb670bcf24e81070ceb3be72f6c11c440d73bd579fbeca1e9f330954c \ --hash=sha256:be4bf804f083a4ce001b5eb7e3c0862479d10f94c936f6c4e5f250aa5ff5bd2d # via sphinx @@ -495,30 +531,16 @@ snowballstemmer==3.0.1 \ --hash=sha256:6cd7b3897da8d6c9ffb968a6781fa6532dce9c3618a4b127d920dab764a19064 \ --hash=sha256:6d5eeeec8e9f84d4d56b847692bacf79bc2c8e90c7f80ca4444ff8b6f2e52895 # via sphinx -sphinx==8.1.3 ; python_full_version < '3.11' \ - --hash=sha256:09719015511837b76bf6e03e42eb7595ac8c2e41eeb9c29c5b755c6b677992a2 \ - --hash=sha256:43c1911eecb0d3e161ad78611bc905d1ad0e523e4ddc202a58a821773dc4c927 - # via - # -r requirements.in - # sphinx-autobuild - # sphinx-copybutton - # sphinx-last-updated-by-git - # sphinx-notfound-page - # sphinx-rtd-theme - # sphinx-tabs - # sphinx-togglebutton - # sphinxcontrib-jquery - # sphinxcontrib-svg2pdfconverter -sphinx==8.2.3 ; python_full_version >= '3.11' \ +sphinx==8.2.3 \ --hash=sha256:398ad29dee7f63a75888314e9424d40f52ce5a6a87ae88e7071e80af296ec348 \ --hash=sha256:4405915165f13521d875a8c29c8970800a0141c14cc5416a38feca4ea5d9b9c3 # via # -r requirements.in # sphinx-autobuild # sphinx-copybutton - # sphinx-last-updated-by-git # sphinx-notfound-page # sphinx-rtd-theme + # sphinx-sitemap # sphinx-tabs # sphinx-togglebutton # sphinxcontrib-jquery @@ -531,10 +553,6 @@ sphinx-copybutton==0.5.2 \ --hash=sha256:4cf17c82fb9646d1bc9ca92ac280813a3b605d8c421225fd9913154103ee1fbd \ --hash=sha256:fb543fd386d917746c9a2c50360c7905b605726b9355cd26e9974857afeae06e # via -r requirements.in -sphinx-last-updated-by-git==0.3.8 \ - --hash=sha256:6382c8285ac1f222483a58569b78c0371af5e55f7fbf9c01e5e8a72d6fdfa499 \ - --hash=sha256:c145011f4609d841805b69a9300099fc02fed8f5bb9e5bcef77d97aea97b7761 - # via sphinx-sitemap sphinx-notfound-page==1.1.0 \ --hash=sha256:835dc76ff7914577a1f58d80a2c8418fb6138c0932c8da8adce4d9096fbcd389 \ --hash=sha256:913e1754370bb3db201d9300d458a8b8b5fb22e9246a816643a819a9ea2b8067 @@ -543,9 +561,9 @@ sphinx-rtd-theme==3.0.2 \ --hash=sha256:422ccc750c3a3a311de4ae327e82affdaf59eb695ba4936538552f3b00f4ee13 \ --hash=sha256:b7457bc25dda723b20b086a670b9953c859eab60a2a03ee8eb2bb23e176e5f85 # via -r requirements.in -sphinx-sitemap==2.7.2 \ - --hash=sha256:1a6a8dcecb0ffb85fd37678f785cfcc40adfe3eebafb05e678971e5260b117e4 \ - --hash=sha256:819e028e27579b47efa0e2f863b87136b711c45f13e84730610e80316f6883da +sphinx-sitemap==2.6.0 \ + --hash=sha256:5e0c66b9f2e371ede80c659866a9eaad337d46ab02802f9c7e5f7bc5893c28d2 \ + --hash=sha256:7478e417d141f99c9af27ccd635f44c03a471a08b20e778a0f9daef7ace1d30b # via -r requirements.in sphinx-tabs==3.4.7 \ --hash=sha256:991ad4a424ff54119799ba1491701aa8130dd43509474aef45a81c42d889784d \ @@ -587,61 +605,21 @@ sphinxcontrib-svg2pdfconverter==1.3.0 \ --hash=sha256:5df6b0895e2e2101d720bfd08841bb56d74c57b1f86229a7c18b771dfdf4ffbb \ --hash=sha256:6411a4cc2f57eed96a0d7bbfa139f68cbe7983018881e1e6d7c46053cd69911f # via -r requirements.in -starlette==0.47.1 \ - --hash=sha256:5e11c9f5c7c3f24959edbf2dffdc01bba860228acf657129467d8a7468591527 \ - --hash=sha256:aef012dd2b6be325ffa16698f9dc533614fb1cebd593a906b90dc1025529a79b +starlette==0.47.0 \ + --hash=sha256:1f64887e94a447fed5f23309fb6890ef23349b7e478faa7b24a851cd4eb844af \ + --hash=sha256:9d052d4933683af40ffd47c7465433570b4949dc937e20ad1d73b34e72f10c37 # via sphinx-autobuild -tomli==2.2.1 ; python_full_version < '3.11' \ - --hash=sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6 \ - --hash=sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd \ - --hash=sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c \ - --hash=sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b \ - --hash=sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8 \ - --hash=sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6 \ - --hash=sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77 \ - --hash=sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff \ - --hash=sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea \ - --hash=sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192 \ - --hash=sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249 \ - --hash=sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee \ - --hash=sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4 \ - --hash=sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98 \ - --hash=sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8 \ - --hash=sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4 \ - --hash=sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281 \ - --hash=sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744 \ - --hash=sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69 \ - --hash=sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13 \ - --hash=sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140 \ - --hash=sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e \ - --hash=sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e \ - --hash=sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc \ - --hash=sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff \ - --hash=sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec \ - --hash=sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2 \ - --hash=sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222 \ - --hash=sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106 \ - --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ - --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ - --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 - # via - # pytest - # sphinx typing-extensions==4.14.0 ; python_full_version < '3.13' \ --hash=sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4 \ --hash=sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af - # via - # anyio - # exceptiongroup - # starlette - # uvicorn + # via anyio urllib3==2.5.0 \ --hash=sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760 \ --hash=sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc # via requests -uvicorn==0.35.0 \ - --hash=sha256:197535216b25ff9b785e29a0b79199f55222193d47f820816e7da751e9bc8d4a \ - --hash=sha256:bc662f087f7cf2ce11a1d7fd70b90c9f98ef2e2831556dd078d131b96cc94a01 +uvicorn==0.34.3 \ + --hash=sha256:16246631db62bdfbf069b0645177d6e8a77ba950cfedbfd093acef9444e4d885 \ + --hash=sha256:35919a9a979d7a59334b6b10e05d77c1d0d574c50e0fc98b8b1a0f165708b55a # via sphinx-autobuild watchfiles==1.1.0 \ --hash=sha256:00645eb79a3faa70d9cb15c8d4187bb72970b2470e938670240c7998dad9f13a \ diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index f1da73f3ec0..c32a40fd35c 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -2008,7 +2008,7 @@ class PythonCompatCheck(ComplianceTest): name = "PythonCompat" doc = "Check that Python files are compatible with Zephyr minimum supported Python version." - MAX_VERSION = (3, 10) + MAX_VERSION = (3, 12) MAX_VERSION_STR = f"{MAX_VERSION[0]}.{MAX_VERSION[1]}" def run(self): diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 7588db2575f..e9faf32c7f9 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --universal --python-version 3.10 --generate-hashes requirements-actions.in --output-file requirements-actions.txt +# uv pip compile --universal --python-version 3.12 --generate-hashes requirements-actions.in --output-file requirements-actions.txt anytree==2.13.0 \ --hash=sha256:4cbcf10df36b1f1cba131b7e487ff3edafc9d6e932a3c70071b5b768bab901ff \ --hash=sha256:c9d3aa6825fdd06af7ebb05b4ef291d2db63e62bb1f9b7d9b71354be9d362714 @@ -16,9 +16,9 @@ attrs==25.3.0 \ --hash=sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3 \ --hash=sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b # via reuse -awscli==1.41.2 \ - --hash=sha256:2c219f88a810c2908954ac50b52f3791c875a3c3a439d16e5a8eac31190c95b7 \ - --hash=sha256:428c5ff8a9c970405848ca49d7f4727e7afcfef5a93abd9227af730f77d24e03 +awscli==1.40.38 \ + --hash=sha256:3f90f2815e3b72691785d2bbd4f2c3dcbde311c55e1f5633a37cc3e514ba6fdb \ + --hash=sha256:ec9b69ff4600ef151df3336f0e7af4cf30280d27f9d8e67e09c4b386ceb1f154 # via -r requirements-actions.in beartype==0.21.0 \ --hash=sha256:b6a1bd56c72f31b0a496a36cc55df6e2f475db166ad07fa4acc7e74f4c7f34c0 \ @@ -34,9 +34,9 @@ boolean-py==5.0 \ # via # license-expression # reuse -botocore==1.39.2 \ - --hash=sha256:474445fa8b281dd5db8fc62184f0f6e494d4f1efb96fe10312490583e67a9dd0 \ - --hash=sha256:921cab9aa6e1e4ceddcece5b55b57daae7722168e74409f1aafcc2c5589df676 +botocore==1.38.39 \ + --hash=sha256:2305f688e9328af473a504197584112f228513e06412038d83205ce8d1456f40 \ + --hash=sha256:ee3aa03af1dabed4f3710cd64f6d9d488281eee720710bf1cf9f2b2fd30025ae # via # awscli # s3transfer @@ -227,23 +227,23 @@ charset-normalizer==3.4.2 \ # via # python-debian # requests -clang-format==20.1.7 \ - --hash=sha256:11431cb437ed22be85744ea47b3a6801bc61de7ac4b775bf1cb89ee190c992d4 \ - --hash=sha256:1dad1e6f9eb732b76046bf5810c6ee78b9e6cd6b3616cb75d9bde06ecd3222e6 \ - --hash=sha256:29f5fe39e60579ca253d31c1122ce06a80716400ec7e5dc38833da80f88dbbd5 \ - --hash=sha256:2b0d76b9bf1f993bad33d2216b5fce4c407bc748fa31659ab7f51ca60df113c9 \ - --hash=sha256:4a9b909b1a9eb0b91aae51fdeeeb013ce20f9079d2e0fa8b8381e97c268dc889 \ - --hash=sha256:4c05114a10efe85c11fde518fe0fadc2977ce4a997a26ceaac88521daee83bbd \ - --hash=sha256:6db0b7271af8cbc2656b3b6b31e4276d5c6b8ceafb1981760f4738cfbe0a9e43 \ - --hash=sha256:70a904719a1bd6653d77ddc6d7b40418845912a1a2a419b9116b819a6b619f8c \ - --hash=sha256:7bd56bd0f519959488977dcddddba4e4fd07cba6225ed09ad658caa1f7286d1f \ - --hash=sha256:99cbfb99dab836027498190f55e543bed51bae33ae6dc256861e7aa91368de98 \ - --hash=sha256:9cd4d64dc0e34b23badad0ce3a235fb5c8ac63651d9f91d1c806356212cbca6c \ - --hash=sha256:b27ed7fe674e8a77461c8d5b117ed96021aa18233917b3fe54b95391e0b22d04 \ - --hash=sha256:bd144f093b4a3ac8a0f0d0ebb9b013974884d9da0627b9905949c6f3213aa850 \ - --hash=sha256:d11c62d38b9144d30021b884b0f95e7270a6bcbf4f22bdd7dae94a531d82fbba \ - --hash=sha256:d79484ce2c8f621242046c4bb0aefd49445ec5c7bc3c404af97490289791b777 \ - --hash=sha256:e5257e8188569e4e47fceb3ba3317b0b44dc5ab5046c8cc2d58c626430c747a6 +clang-format==20.1.6 \ + --hash=sha256:0ea008a20951527d35a1e2b8febdca3c47c6f8e9a1bd174601c891e20053ef2e \ + --hash=sha256:11530ff352c64176ba4297ad398452d9fcd442b4a8bb2a804cc7915bc94b96e1 \ + --hash=sha256:12626f058755198b92b26076312cc1052f8dd7868bd6cf61b65d2911154ef6df \ + --hash=sha256:15dbc113b4d2f1eb545adb9b815b96c2d64aff947de9453802e47ef1c5267996 \ + --hash=sha256:2ea00197fe650f29b77dd870cd87891e15d9d2dac75c4e9072f4eee99a928dcb \ + --hash=sha256:5351f353062bb0df9c31b4e84c8a9d6b472f9f0727ebd5ab1f96fd3e792756fa \ + --hash=sha256:58b3ef54bc32304990f1890cc982607f69359e46b0e98350718125bea24566de \ + --hash=sha256:779153a039c8552438dd9a3925f5dad20d8b5a812329703f98cd5da7bb91556c \ + --hash=sha256:8ce12618431d8955026c30a2d19a3ae9ddc6d918ad24a4e00a10f8f130454469 \ + --hash=sha256:8ce920b103447d21ff44d41a7ad412794bde1b737426a126c8ab141f00bbfba8 \ + --hash=sha256:bfc4a9922ee1f7c0ec5a8250cb72e755a1ddc73e5d50866efe00561be6fc69eb \ + --hash=sha256:c93c8b7feed66521349918f741b40ef6eaf85dfa1b5eb1303a49ed4608fd882a \ + --hash=sha256:ce8f5bbacba3f05adc2cd64a1780e36c81b54a2caa0b4c618c611b2b45124930 \ + --hash=sha256:d1d64ccfb14dcd93cd98321191e9fbaef049774d050f0c084b7aede41e79fee2 \ + --hash=sha256:d84fffa03432c400bb560f3c8181c2dfa6be05b9b866f7d0180dfb41e0f91907 \ + --hash=sha256:e1e59c3a23d033df261ce8048c96f0493285cff1b65d3f519b77a47854653d27 # via -r requirements-actions.in click==8.1.3 \ --hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \ @@ -262,44 +262,44 @@ colorama==0.4.6 \ # pytest # tox # west -cryptography==45.0.5 \ - --hash=sha256:0027d566d65a38497bc37e0dd7c2f8ceda73597d2ac9ba93810204f56f52ebc7 \ - --hash=sha256:101ee65078f6dd3e5a028d4f19c07ffa4dd22cce6a20eaa160f8b5219911e7d8 \ - --hash=sha256:12e55281d993a793b0e883066f590c1ae1e802e3acb67f8b442e721e475e6463 \ - --hash=sha256:14d96584701a887763384f3c47f0ca7c1cce322aa1c31172680eb596b890ec30 \ - --hash=sha256:1e1da5accc0c750056c556a93c3e9cb828970206c68867712ca5805e46dc806f \ - --hash=sha256:206210d03c1193f4e1ff681d22885181d47efa1ab3018766a7b32a7b3d6e6afd \ - --hash=sha256:2089cc8f70a6e454601525e5bf2779e665d7865af002a5dec8d14e561002e135 \ - --hash=sha256:3a264aae5f7fbb089dbc01e0242d3b67dffe3e6292e1f5182122bdf58e65215d \ - --hash=sha256:3af26738f2db354aafe492fb3869e955b12b2ef2e16908c8b9cb928128d42c57 \ - --hash=sha256:3fcfbefc4a7f332dece7272a88e410f611e79458fab97b5efe14e54fe476f4fd \ - --hash=sha256:460f8c39ba66af7db0545a8c6f2eabcbc5a5528fc1cf6c3fa9a1e44cec33385e \ - --hash=sha256:57c816dfbd1659a367831baca4b775b2a5b43c003daf52e9d57e1d30bc2e1b0e \ - --hash=sha256:5aa1e32983d4443e310f726ee4b071ab7569f58eedfdd65e9675484a4eb67bd1 \ - --hash=sha256:6ff8728d8d890b3dda5765276d1bc6fb099252915a2cd3aff960c4c195745dd0 \ - --hash=sha256:7259038202a47fdecee7e62e0fd0b0738b6daa335354396c6ddebdbe1206af2a \ - --hash=sha256:72e76caa004ab63accdf26023fccd1d087f6d90ec6048ff33ad0445abf7f605a \ - --hash=sha256:7760c1c2e1a7084153a0f68fab76e754083b126a47d0117c9ed15e69e2103492 \ - --hash=sha256:8c4a6ff8a30e9e3d38ac0539e9a9e02540ab3f827a3394f8852432f6b0ea152e \ - --hash=sha256:9024beb59aca9d31d36fcdc1604dd9bbeed0a55bface9f1908df19178e2f116e \ - --hash=sha256:90cb0a7bb35959f37e23303b7eed0a32280510030daba3f7fdfbb65defde6a97 \ - --hash=sha256:91098f02ca81579c85f66df8a588c78f331ca19089763d733e34ad359f474174 \ - --hash=sha256:926c3ea71a6043921050eaa639137e13dbe7b4ab25800932a8498364fc1abec9 \ - --hash=sha256:982518cd64c54fcada9d7e5cf28eabd3ee76bd03ab18e08a48cad7e8b6f31b18 \ - --hash=sha256:9b4cf6318915dccfe218e69bbec417fdd7c7185aa7aab139a2c0beb7468c89f0 \ - --hash=sha256:ad0caded895a00261a5b4aa9af828baede54638754b51955a0ac75576b831b27 \ - --hash=sha256:b85980d1e345fe769cfc57c57db2b59cff5464ee0c045d52c0df087e926fbe63 \ - --hash=sha256:b8fa8b0a35a9982a3c60ec79905ba5bb090fc0b9addcfd3dc2dd04267e45f25e \ - --hash=sha256:b9e38e0a83cd51e07f5a48ff9691cae95a79bea28fe4ded168a8e5c6c77e819d \ - --hash=sha256:bd4c45986472694e5121084c6ebbd112aa919a25e783b87eb95953c9573906d6 \ - --hash=sha256:be97d3a19c16a9be00edf79dca949c8fa7eff621763666a145f9f9535a5d7f42 \ - --hash=sha256:c648025b6840fe62e57107e0a25f604db740e728bd67da4f6f060f03017d5097 \ - --hash=sha256:d05a38884db2ba215218745f0781775806bde4f32e07b135348355fe8e4991d9 \ - --hash=sha256:dd420e577921c8c2d31289536c386aaa30140b473835e97f83bc71ea9d2baf2d \ - --hash=sha256:e357286c1b76403dd384d938f93c46b2b058ed4dfcdce64a770f0537ed3feb6f \ - --hash=sha256:e6c00130ed423201c5bc5544c23359141660b07999ad82e34e7bb8f882bb78e0 \ - --hash=sha256:e74d30ec9c7cb2f404af331d5b4099a9b322a8a6b25c4632755c8757345baac5 \ - --hash=sha256:f3562c2f23c612f2e4a6964a61d942f891d29ee320edb62ff48ffb99f3de9ae8 +cryptography==45.0.4 \ + --hash=sha256:0339a692de47084969500ee455e42c58e449461e0ec845a34a6a9b9bf7df7fb8 \ + --hash=sha256:03dbff8411206713185b8cebe31bc5c0eb544799a50c09035733716b386e61a4 \ + --hash=sha256:06509dc70dd71fa56eaa138336244e2fbaf2ac164fc9b5e66828fccfd2b680d6 \ + --hash=sha256:0cf13c77d710131d33e63626bd55ae7c0efb701ebdc2b3a7952b9b23a0412862 \ + --hash=sha256:23b9c3ea30c3ed4db59e7b9619272e94891f8a3a5591d0b656a7582631ccf750 \ + --hash=sha256:25eb4d4d3e54595dc8adebc6bbd5623588991d86591a78c2548ffb64797341e2 \ + --hash=sha256:2882338b2a6e0bd337052e8b9007ced85c637da19ef9ecaf437744495c8c2999 \ + --hash=sha256:3530382a43a0e524bc931f187fc69ef4c42828cf7d7f592f7f249f602b5a4ab0 \ + --hash=sha256:425a9a6ac2823ee6e46a76a21a4e8342d8fa5c01e08b823c1f19a8b74f096069 \ + --hash=sha256:46cf7088bf91bdc9b26f9c55636492c1cce3e7aaf8041bbf0243f5e5325cfb2d \ + --hash=sha256:4828190fb6c4bcb6ebc6331f01fe66ae838bb3bd58e753b59d4b22eb444b996c \ + --hash=sha256:49fe9155ab32721b9122975e168a6760d8ce4cffe423bcd7ca269ba41b5dfac1 \ + --hash=sha256:4ca0f52170e821bc8da6fc0cc565b7bb8ff8d90d36b5e9fdd68e8a86bdf72036 \ + --hash=sha256:51dfbd4d26172d31150d84c19bbe06c68ea4b7f11bbc7b3a5e146b367c311349 \ + --hash=sha256:5f31e6b0a5a253f6aa49be67279be4a7e5a4ef259a9f33c69f7d1b1191939872 \ + --hash=sha256:627ba1bc94f6adf0b0a2e35d87020285ead22d9f648c7e75bb64f367375f3b22 \ + --hash=sha256:680806cf63baa0039b920f4976f5f31b10e772de42f16310a6839d9f21a26b0d \ + --hash=sha256:6a3511ae33f09094185d111160fd192c67aa0a2a8d19b54d36e4c78f651dc5ad \ + --hash=sha256:6a5bf57554e80f75a7db3d4b1dacaa2764611ae166ab42ea9a72bcdb5d577637 \ + --hash=sha256:6b613164cb8425e2f8db5849ffb84892e523bf6d26deb8f9bb76ae86181fa12b \ + --hash=sha256:7405ade85c83c37682c8fe65554759800a4a8c54b2d96e0f8ad114d31b808d57 \ + --hash=sha256:7aad98a25ed8ac917fdd8a9c1e706e5a0956e06c498be1f713b61734333a4507 \ + --hash=sha256:7bedbe4cc930fa4b100fc845ea1ea5788fcd7ae9562e669989c11618ae8d76ee \ + --hash=sha256:7ef2dde4fa9408475038fc9aadfc1fb2676b174e68356359632e980c661ec8f6 \ + --hash=sha256:817ee05c6c9f7a69a16200f0c90ab26d23a87701e2a284bd15156783e46dbcc8 \ + --hash=sha256:944e9ccf67a9594137f942d5b52c8d238b1b4e46c7a0c2891b7ae6e01e7c80a4 \ + --hash=sha256:964bcc28d867e0f5491a564b7debb3ffdd8717928d315d12e0d7defa9e43b723 \ + --hash=sha256:96d4819e25bf3b685199b304a0029ce4a3caf98947ce8a066c9137cc78ad2c58 \ + --hash=sha256:a77c6fb8d76e9c9f99f2f3437c1a4ac287b34eaf40997cfab1e9bd2be175ac39 \ + --hash=sha256:b0a97c927497e3bc36b33987abb99bf17a9a175a19af38a892dc4bbb844d7ee2 \ + --hash=sha256:b97737a3ffbea79eebb062eb0d67d72307195035332501722a9ca86bab9e3ab2 \ + --hash=sha256:bbc505d1dc469ac12a0a064214879eac6294038d6b24ae9f71faae1448a9608d \ + --hash=sha256:c22fe01e53dc65edd1945a2e6f0015e887f84ced233acecb64b4daadb32f5c97 \ + --hash=sha256:ce1678a2ccbe696cf3af15a75bb72ee008d7ff183c9228592ede9db467e64f1b \ + --hash=sha256:e00a6c10a5c53979d6242f123c0a97cff9f3abed7f064fc412c36dc521b5f257 \ + --hash=sha256:eaa3e28ea2235b33220b949c5a0d6cf79baa80eab2eb5607ca8ab7525331b9ff \ + --hash=sha256:f3fe7a5ae34d5a414957cc7f457e2b92076e72938423ac64d215722f6cf49a9e # via pyjwt deprecated==1.2.18 \ --hash=sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d \ @@ -331,9 +331,7 @@ elasticsearch==8.18.1 \ exceptiongroup==1.3.0 \ --hash=sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10 \ --hash=sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88 - # via - # -r requirements-actions.in - # pytest + # via -r requirements-actions.in filelock==3.18.0 \ --hash=sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2 \ --hash=sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de @@ -459,10 +457,6 @@ intelhex==2.3.0 \ --hash=sha256:87cc5225657524ec6361354be928adfd56bcf2a3dcc646c40f8f094c39c07db4 \ --hash=sha256:892b7361a719f4945237da8ccf754e9513db32f5628852785aea108dcd250093 # via -r requirements-actions.in -isodate==0.7.2 ; python_full_version < '3.11' \ - --hash=sha256:28009937d8031054830160fce6d409ed342816b543597cece116d966c6d99e15 \ - --hash=sha256:4cd1aa0f43ca76f4a6c6c0292a85f40b35ec2e43e315b59f06e6d32171a953e6 - # via rdflib isort==6.0.1 \ --hash=sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450 \ --hash=sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615 @@ -481,107 +475,149 @@ jmespath==1.0.1 \ junit2html==31.0.2 \ --hash=sha256:c7fd1f253d423f0df031d0cee8ef7d4d98d9f8bf6383a2d40dca639686814866 # via -r requirements-actions.in -junitparser==4.0.2 \ - --hash=sha256:94c3570e41fcaedc64cc3c634ca99457fe41a84dd1aa8ff74e9e12e66223a155 \ - --hash=sha256:d5d07cece6d4a600ff3b7b96c8db5ffa45a91eed695cb86c45c3db113c1ca0f8 +junitparser==3.2.0 \ + --hash=sha256:b05e89c27e7b74b3c563a078d6e055d95cf397444f8f689b0ca616ebda0b3c65 \ + --hash=sha256:e14fdc0a999edfc15889b637390e8ef6ca09a49532416d3bd562857d42d4b96d # via -r requirements-actions.in -license-expression==30.4.3 \ - --hash=sha256:49f439fea91c4d1a642f9f2902b58db1d42396c5e331045f41ce50df9b40b1f2 \ - --hash=sha256:fd3db53418133e0eef917606623bc125fbad3d1225ba8d23950999ee87c99280 +license-expression==30.4.1 \ + --hash=sha256:679646bc3261a17690494a3e1cada446e5ee342dbd87dcfa4a0c24cc5dce13ee \ + --hash=sha256:9f02105f9e0fcecba6a85dfbbed7d94ea1c3a70cf23ddbfb5adf3438a6f6fce0 # via # reuse # spdx-tools -lxml==6.0.0 \ - --hash=sha256:013090383863b72c62a702d07678b658fa2567aa58d373d963cca245b017e065 \ - --hash=sha256:032e65120339d44cdc3efc326c9f660f5f7205f3a535c1fdbf898b29ea01fb72 \ - --hash=sha256:048a930eb4572829604982e39a0c7289ab5dc8abc7fc9f5aabd6fbc08c154e93 \ - --hash=sha256:04d67ceee6db4bcb92987ccb16e53bef6b42ced872509f333c04fb58a3315256 \ - --hash=sha256:059c4cbf3973a621b62ea3132934ae737da2c132a788e6cfb9b08d63a0ef73f9 \ - --hash=sha256:0e32698462aacc5c1cf6bdfebc9c781821b7e74c79f13e5ffc8bfe27c42b1abf \ - --hash=sha256:1676b56d48048a62ef77a250428d1f31f610763636e0784ba67a9740823988ca \ - --hash=sha256:17f090a9bc0ce8da51a5632092f98a7e7f84bca26f33d161a98b57f7fb0004ca \ - --hash=sha256:185efc2fed89cdd97552585c624d3c908f0464090f4b91f7d92f8ed2f3b18f54 \ - --hash=sha256:1fa377b827ca2023244a06554c6e7dc6828a10aaf74ca41965c5d8a4925aebb4 \ - --hash=sha256:2181e4b1d07dde53986023482673c0f1fba5178ef800f9ab95ad791e8bdded6a \ - --hash=sha256:219e0431ea8006e15005767f0351e3f7f9143e793e58519dc97fe9e07fae5563 \ - --hash=sha256:21db1ec5525780fd07251636eb5f7acb84003e9382c72c18c542a87c416ade03 \ - --hash=sha256:246b40f8a4aec341cbbf52617cad8ab7c888d944bfe12a6abd2b1f6cfb6f6082 \ - --hash=sha256:2793a627e95d119e9f1e19720730472f5543a6d84c50ea33313ce328d870f2dd \ - --hash=sha256:2930aa001a3776c3e2601cb8e0a15d21b8270528d89cc308be4843ade546b9ab \ - --hash=sha256:2ae06fbab4f1bb7db4f7c8ca9897dc8db4447d1a2b9bee78474ad403437bcc29 \ - --hash=sha256:2b4790b558bee331a933e08883c423f65bbcd07e278f91b2272489e31ab1e2b4 \ - --hash=sha256:2cfcf84f1defed7e5798ef4f88aa25fcc52d279be731ce904789aa7ccfb7e8d2 \ - --hash=sha256:2dd1cc3ea7e60bfb31ff32cafe07e24839df573a5e7c2d33304082a5019bcd58 \ - --hash=sha256:2f34687222b78fff795feeb799a7d44eca2477c3d9d3a46ce17d51a4f383e32e \ - --hash=sha256:310b719b695b3dd442cdfbbe64936b2f2e231bb91d998e99e6f0daf991a3eba3 \ - --hash=sha256:34190a1ec4f1e84af256495436b2d196529c3f2094f0af80202947567fdbf2e7 \ - --hash=sha256:35bc626eec405f745199200ccb5c6b36f202675d204aa29bb52e27ba2b71dea8 \ - --hash=sha256:36531f81c8214e293097cd2b7873f178997dae33d3667caaae8bdfb9666b76c0 \ - --hash=sha256:390240baeb9f415a82eefc2e13285016f9c8b5ad71ec80574ae8fa9605093cd7 \ - --hash=sha256:40442e2a4456e9910875ac12951476d36c0870dcb38a68719f8c4686609897c4 \ - --hash=sha256:4337e4aec93b7c011f7ee2e357b0d30562edd1955620fdd4aeab6aacd90d43c5 \ - --hash=sha256:43cfbb7db02b30ad3926e8fceaef260ba2fb7df787e38fa2df890c1ca7966c3b \ - --hash=sha256:43fe5af2d590bf4691531b1d9a2495d7aab2090547eaacd224a3afec95706d76 \ - --hash=sha256:46b9ed911f36bfeb6338e0b482e7fe7c27d362c52fde29f221fddbc9ee2227e7 \ - --hash=sha256:4d23854ecf381ab1facc8f353dcd9adeddef3652268ee75297c1164c987c11dc \ - --hash=sha256:4eb114a0754fd00075c12648d991ec7a4357f9cb873042cc9a77bf3a7e30c9db \ - --hash=sha256:4ee56288d0df919e4aac43b539dd0e34bb55d6a12a6562038e8d6f3ed07f9e36 \ - --hash=sha256:51a5e4c61a4541bd1cd3ba74766d0c9b6c12d6a1a4964ef60026832aac8e79b3 \ - --hash=sha256:522fe7abb41309e9543b0d9b8b434f2b630c5fdaf6482bee642b34c8c70079c8 \ - --hash=sha256:54c4855eabd9fc29707d30141be99e5cd1102e7d2258d2892314cf4c110726c3 \ - --hash=sha256:5592401cdf3dc682194727c1ddaa8aa0f3ddc57ca64fd03226a430b955eab6f6 \ - --hash=sha256:58ffd35bd5425c3c3b9692d078bf7ab851441434531a7e517c4984d5634cd65b \ - --hash=sha256:5967fe415b1920a3877a4195e9a2b779249630ee49ece22021c690320ff07452 \ - --hash=sha256:5fcd7d3b1d8ecb91445bd71b9c88bdbeae528fefee4f379895becfc72298d181 \ - --hash=sha256:63b634facdfbad421d4b61c90735688465d4ab3a8853ac22c76ccac2baf98d97 \ - --hash=sha256:690b20e3388a7ec98e899fd54c924e50ba6693874aa65ef9cb53de7f7de9d64a \ - --hash=sha256:6da7cd4f405fd7db56e51e96bff0865b9853ae70df0e6720624049da76bde2da \ - --hash=sha256:7488a43033c958637b1a08cddc9188eb06d3ad36582cebc7d4815980b47e27ef \ - --hash=sha256:74e748012f8c19b47f7d6321ac929a9a94ee92ef12bc4298c47e8b7219b26541 \ - --hash=sha256:78718d8454a6e928470d511bf8ac93f469283a45c354995f7d19e77292f26108 \ - --hash=sha256:7bf61bc4345c1895221357af8f3e89f8c103d93156ef326532d35c707e2fb19d \ - --hash=sha256:7da298e1659e45d151b4028ad5c7974917e108afb48731f4ed785d02b6818994 \ - --hash=sha256:84ef591495ffd3f9dcabffd6391db7bb70d7230b5c35ef5148354a134f56f2be \ - --hash=sha256:85b14a4689d5cff426c12eefe750738648706ea2753b20c2f973b2a000d3d261 \ - --hash=sha256:8a2e76efbf8772add72d002d67a4c3d0958638696f541734304c7f28217a9cab \ - --hash=sha256:8cb26f51c82d77483cdcd2b4a53cda55bbee29b3c2f3ddeb47182a2a9064e4eb \ - --hash=sha256:8db5dc617cb937ae17ff3403c3a70a7de9df4852a046f93e71edaec678f721d0 \ - --hash=sha256:9ab542c91f5a47aaa58abdd8ea84b498e8e49fe4b883d67800017757a3eb78e8 \ - --hash=sha256:9da022c14baeec36edfcc8daf0e281e2f55b950249a455776f0d1adeeada4734 \ - --hash=sha256:9f4b481b6cc3a897adb4279216695150bbe7a44c03daba3c894f49d2037e0a24 \ - --hash=sha256:a52a4704811e2623b0324a18d41ad4b9fabf43ce5ff99b14e40a520e2190c851 \ - --hash=sha256:a55da151d0b0c6ab176b4e761670ac0e2667817a1e0dadd04a01d0561a219349 \ - --hash=sha256:a674c0948789e9136d69065cc28009c1b1874c6ea340253db58be7622ce6398f \ - --hash=sha256:ae74f7c762270196d2dda56f8dd7309411f08a4084ff2dfcc0b095a218df2e06 \ - --hash=sha256:afd27d8629ae94c5d863e32ab0e1d5590371d296b87dae0a751fb22bf3685741 \ - --hash=sha256:b2d71cdefda9424adff9a3607ba5bbfc60ee972d73c21c7e3c19e71037574816 \ - --hash=sha256:b34339898bb556a2351a1830f88f751679f343eabf9cf05841c95b165152c9e7 \ - --hash=sha256:b372d10d17a701b0945f67be58fae4664fd056b85e0ff0fbc1e6c951cdbc0512 \ - --hash=sha256:b3c98d5b24c6095e89e03d65d5c574705be3d49c0d8ca10c17a8a4b5201b72f5 \ - --hash=sha256:b8dd6dd0e9c1992613ccda2bcb74fc9d49159dbe0f0ca4753f37527749885c25 \ - --hash=sha256:bd5913b4972681ffc9718bc2d4c53cde39ef81415e1671ff93e9aa30b46595e7 \ - --hash=sha256:c0b5fa5eda84057a4f1bbb4bb77a8c28ff20ae7ce211588d698ae453e13c6281 \ - --hash=sha256:c16304bba98f48a28ae10e32a8e75c349dd742c45156f297e16eeb1ba9287a1f \ - --hash=sha256:c24b8efd9c0f62bad0439283c2c795ef916c5a6b75f03c17799775c7ae3c0c9e \ - --hash=sha256:c2a5e8d207311a0170aca0eb6b160af91adc29ec121832e4ac151a57743a1e1e \ - --hash=sha256:c352fc8f36f7e9727db17adbf93f82499457b3d7e5511368569b4c5bd155a922 \ - --hash=sha256:c86df1c9af35d903d2b52d22ea3e66db8058d21dc0f59842ca5deb0595921141 \ - --hash=sha256:ca50bd612438258a91b5b3788c6621c1f05c8c478e7951899f492be42defc0da \ - --hash=sha256:d18a25b19ca7307045581b18b3ec9ead2b1db5ccd8719c291f0cd0a5cec6cb81 \ - --hash=sha256:d4f0c66df4386b75d2ab1e20a489f30dc7fd9a06a896d64980541506086be1f1 \ - --hash=sha256:d7ae472f74afcc47320238b5dbfd363aba111a525943c8a34a1b657c6be934c3 \ - --hash=sha256:db0efd6bae1c4730b9c863fc4f5f3c0fa3e8f05cae2c44ae141cb9dfc7d091dc \ - --hash=sha256:dbdd7679a6f4f08152818043dbb39491d1af3332128b3752c3ec5cebc0011a72 \ - --hash=sha256:e0b1520ef900e9ef62e392dd3d7ae4f5fa224d1dd62897a792cf353eb20b6cae \ - --hash=sha256:e2030956cf4886b10be9a0285c6802e078ec2391e1dd7ff3eb509c2c95a69b76 \ - --hash=sha256:e35e8aaaf3981489f42884b59726693de32dabfc438ac10ef4eb3409961fd402 \ - --hash=sha256:e380e85b93f148ad28ac15f8117e2fd8e5437aa7732d65e260134f83ce67911b \ - --hash=sha256:edf6e4c8fe14dfe316939711e3ece3f9a20760aabf686051b537a7562f4da91a \ - --hash=sha256:f3389924581d9a770c6caa4df4e74b606180869043b9073e2cec324bad6e306e \ - --hash=sha256:f64ccf593916e93b8d36ed55401bb7fe9c7d5de3180ce2e10b08f82a8f397316 \ - --hash=sha256:f720a14aa102a38907c6d5030e3d66b3b680c3e6f6bc95473931ea3c00c59967 \ - --hash=sha256:f8d19565ae3eb956d84da3ef367aa7def14a2735d05bd275cd54c0301f0d0d6c \ - --hash=sha256:f97487996a39cb18278ca33f7be98198f278d0bc3c5d0fd4d7b3d63646ca3c8a +lxml==5.4.0 \ + --hash=sha256:00b8686694423ddae324cf614e1b9659c2edb754de617703c3d29ff568448df5 \ + --hash=sha256:073eb6dcdf1f587d9b88c8c93528b57eccda40209cf9be549d469b942b41d70b \ + --hash=sha256:09846782b1ef650b321484ad429217f5154da4d6e786636c38e434fa32e94e49 \ + --hash=sha256:0a01ce7d8479dce84fc03324e3b0c9c90b1ece9a9bb6a1b6c9025e7e4520e78c \ + --hash=sha256:0be91891bdb06ebe65122aa6bf3fc94489960cf7e03033c6f83a90863b23c58b \ + --hash=sha256:0cef4feae82709eed352cd7e97ae062ef6ae9c7b5dbe3663f104cd2c0e8d94ba \ + --hash=sha256:0e108352e203c7afd0eb91d782582f00a0b16a948d204d4dec8565024fafeea5 \ + --hash=sha256:0ea0252b51d296a75f6118ed0d8696888e7403408ad42345d7dfd0d1e93309a7 \ + --hash=sha256:0fce1294a0497edb034cb416ad3e77ecc89b313cff7adbee5334e4dc0d11f422 \ + --hash=sha256:1320091caa89805df7dcb9e908add28166113dcd062590668514dbd510798c88 \ + --hash=sha256:142accb3e4d1edae4b392bd165a9abdee8a3c432a2cca193df995bc3886249c8 \ + --hash=sha256:14479c2ad1cb08b62bb941ba8e0e05938524ee3c3114644df905d2331c76cd57 \ + --hash=sha256:151d6c40bc9db11e960619d2bf2ec5829f0aaffb10b41dcf6ad2ce0f3c0b2325 \ + --hash=sha256:15a665ad90054a3d4f397bc40f73948d48e36e4c09f9bcffc7d90c87410e478a \ + --hash=sha256:1a42b3a19346e5601d1b8296ff6ef3d76038058f311902edd574461e9c036982 \ + --hash=sha256:1af80c6316ae68aded77e91cd9d80648f7dd40406cef73df841aa3c36f6907c8 \ + --hash=sha256:1b717b00a71b901b4667226bba282dd462c42ccf618ade12f9ba3674e1fabc55 \ + --hash=sha256:1dc4ca99e89c335a7ed47d38964abcb36c5910790f9bd106f2a8fa2ee0b909d2 \ + --hash=sha256:20e16c08254b9b6466526bc1828d9370ee6c0d60a4b64836bc3ac2917d1e16df \ + --hash=sha256:226046e386556a45ebc787871d6d2467b32c37ce76c2680f5c608e25823ffc84 \ + --hash=sha256:24974f774f3a78ac12b95e3a20ef0931795ff04dbb16db81a90c37f589819551 \ + --hash=sha256:24f6df5f24fc3385f622c0c9d63fe34604893bc1a5bdbb2dbf5870f85f9a404a \ + --hash=sha256:27a9ded0f0b52098ff89dd4c418325b987feed2ea5cc86e8860b0f844285d740 \ + --hash=sha256:29f451a4b614a7b5b6c2e043d7b64a15bd8304d7e767055e8ab68387a8cacf4e \ + --hash=sha256:2b31a3a77501d86d8ade128abb01082724c0dfd9524f542f2f07d693c9f1175f \ + --hash=sha256:2c62891b1ea3094bb12097822b3d44b93fc6c325f2043c4d2736a8ff09e65f60 \ + --hash=sha256:2dc191e60425ad70e75a68c9fd90ab284df64d9cd410ba8d2b641c0c45bc006e \ + --hash=sha256:31e63621e073e04697c1b2d23fcb89991790eef370ec37ce4d5d469f40924ed6 \ + --hash=sha256:32697d2ea994e0db19c1df9e40275ffe84973e4232b5c274f47e7c1ec9763cdd \ + --hash=sha256:3a3178b4873df8ef9457a4875703488eb1622632a9cee6d76464b60e90adbfcd \ + --hash=sha256:3b9c2754cef6963f3408ab381ea55f47dabc6f78f4b8ebb0f0b25cf1ac1f7609 \ + --hash=sha256:3d3c30ba1c9b48c68489dc1829a6eede9873f52edca1dda900066542528d6b20 \ + --hash=sha256:3e6d5557989cdc3ebb5302bbdc42b439733a841891762ded9514e74f60319ad6 \ + --hash=sha256:4025bf2884ac4370a3243c5aa8d66d3cb9e15d3ddd0af2d796eccc5f0244390e \ + --hash=sha256:4291d3c409a17febf817259cb37bc62cb7eb398bcc95c1356947e2871911ae61 \ + --hash=sha256:4329422de653cdb2b72afa39b0aa04252fca9071550044904b2e7036d9d97fe4 \ + --hash=sha256:43d549b876ce64aa18b2328faff70f5877f8c6dede415f80a2f799d31644d776 \ + --hash=sha256:460508a4b07364d6abf53acaa0a90b6d370fafde5693ef37602566613a9b0779 \ + --hash=sha256:47fb24cc0f052f0576ea382872b3fc7e1f7e3028e53299ea751839418ade92a6 \ + --hash=sha256:48b4afaf38bf79109bb060d9016fad014a9a48fb244e11b94f74ae366a64d252 \ + --hash=sha256:497cab4d8254c2a90bf988f162ace2ddbfdd806fce3bda3f581b9d24c852e03c \ + --hash=sha256:4aa412a82e460571fad592d0f93ce9935a20090029ba08eca05c614f99b0cc92 \ + --hash=sha256:4b7ce10634113651d6f383aa712a194179dcd496bd8c41e191cec2099fa09de5 \ + --hash=sha256:4cd915c0fb1bed47b5e6d6edd424ac25856252f09120e3e8ba5154b6b921860e \ + --hash=sha256:4d885698f5019abe0de3d352caf9466d5de2baded00a06ef3f1216c1a58ae78f \ + --hash=sha256:4f5322cf38fe0e21c2d73901abf68e6329dc02a4994e483adbcf92b568a09a54 \ + --hash=sha256:50441c9de951a153c698b9b99992e806b71c1f36d14b154592580ff4a9d0d877 \ + --hash=sha256:529024ab3a505fed78fe3cc5ddc079464e709f6c892733e3f5842007cec8ac6e \ + --hash=sha256:53370c26500d22b45182f98847243efb518d268374a9570409d2e2276232fd37 \ + --hash=sha256:53d9469ab5460402c19553b56c3648746774ecd0681b1b27ea74d5d8a3ef5590 \ + --hash=sha256:56dbdbab0551532bb26c19c914848d7251d73edb507c3079d6805fa8bba5b706 \ + --hash=sha256:5a99d86351f9c15e4a901fc56404b485b1462039db59288b203f8c629260a142 \ + --hash=sha256:5cca36a194a4eb4e2ed6be36923d3cffd03dcdf477515dea687185506583d4c9 \ + --hash=sha256:5f11a1526ebd0dee85e7b1e39e39a0cc0d9d03fb527f56d8457f6df48a10dc0c \ + --hash=sha256:61c7bbf432f09ee44b1ccaa24896d21075e533cd01477966a5ff5a71d88b2f56 \ + --hash=sha256:639978bccb04c42677db43c79bdaa23785dc7f9b83bfd87570da8207872f1ce5 \ + --hash=sha256:63e7968ff83da2eb6fdda967483a7a023aa497d85ad8f05c3ad9b1f2e8c84987 \ + --hash=sha256:664cdc733bc87449fe781dbb1f309090966c11cc0c0cd7b84af956a02a8a4729 \ + --hash=sha256:67ed8a40665b84d161bae3181aa2763beea3747f748bca5874b4af4d75998f87 \ + --hash=sha256:67f779374c6b9753ae0a0195a892a1c234ce8416e4448fe1e9f34746482070a7 \ + --hash=sha256:6854f8bd8a1536f8a1d9a3655e6354faa6406621cf857dc27b681b69860645c7 \ + --hash=sha256:696ea9e87442467819ac22394ca36cb3d01848dad1be6fac3fb612d3bd5a12cf \ + --hash=sha256:6ef80aeac414f33c24b3815ecd560cee272786c3adfa5f31316d8b349bfade28 \ + --hash=sha256:72ac9762a9f8ce74c9eed4a4e74306f2f18613a6b71fa065495a67ac227b3056 \ + --hash=sha256:75133890e40d229d6c5837b0312abbe5bac1c342452cf0e12523477cd3aa21e7 \ + --hash=sha256:7605c1c32c3d6e8c990dd28a0970a3cbbf1429d5b92279e37fda05fb0c92190e \ + --hash=sha256:773e27b62920199c6197130632c18fb7ead3257fce1ffb7d286912e56ddb79e0 \ + --hash=sha256:795f61bcaf8770e1b37eec24edf9771b307df3af74d1d6f27d812e15a9ff3872 \ + --hash=sha256:79d5bfa9c1b455336f52343130b2067164040604e41f6dc4d8313867ed540079 \ + --hash=sha256:7a62cc23d754bb449d63ff35334acc9f5c02e6dae830d78dab4dd12b78a524f4 \ + --hash=sha256:7be701c24e7f843e6788353c055d806e8bd8466b52907bafe5d13ec6a6dbaecd \ + --hash=sha256:7ca56ebc2c474e8f3d5761debfd9283b8b18c76c4fc0967b74aeafba1f5647f9 \ + --hash=sha256:7ce1a171ec325192c6a636b64c94418e71a1964f56d002cc28122fceff0b6121 \ + --hash=sha256:891f7f991a68d20c75cb13c5c9142b2a3f9eb161f1f12a9489c82172d1f133c0 \ + --hash=sha256:8f82125bc7203c5ae8633a7d5d20bcfdff0ba33e436e4ab0abc026a53a8960b7 \ + --hash=sha256:91505d3ddebf268bb1588eb0f63821f738d20e1e7f05d3c647a5ca900288760b \ + --hash=sha256:942a5d73f739ad7c452bf739a62a0f83e2578afd6b8e5406308731f4ce78b16d \ + --hash=sha256:9454b8d8200ec99a224df8854786262b1bd6461f4280064c807303c642c05e76 \ + --hash=sha256:9459e6892f59ecea2e2584ee1058f5d8f629446eab52ba2305ae13a32a059530 \ + --hash=sha256:9776af1aad5a4b4a1317242ee2bea51da54b2a7b7b48674be736d463c999f37d \ + --hash=sha256:97dac543661e84a284502e0cf8a67b5c711b0ad5fb661d1bd505c02f8cf716d7 \ + --hash=sha256:98a3912194c079ef37e716ed228ae0dcb960992100461b704aea4e93af6b0bb9 \ + --hash=sha256:9b4a3bd174cc9cdaa1afbc4620c049038b441d6ba07629d89a83b408e54c35cd \ + --hash=sha256:9c886b481aefdf818ad44846145f6eaf373a20d200b5ce1a5c8e1bc2d8745410 \ + --hash=sha256:9ceaf423b50ecfc23ca00b7f50b64baba85fb3fb91c53e2c9d00bc86150c7e40 \ + --hash=sha256:a11a96c3b3f7551c8a8109aa65e8594e551d5a84c76bf950da33d0fb6dfafab7 \ + --hash=sha256:a3bcdde35d82ff385f4ede021df801b5c4a5bcdfb61ea87caabcebfc4945dc1b \ + --hash=sha256:a7fb111eef4d05909b82152721a59c1b14d0f365e2be4c742a473c5d7372f4f5 \ + --hash=sha256:a81e1196f0a5b4167a8dafe3a66aa67c4addac1b22dc47947abd5d5c7a3f24b5 \ + --hash=sha256:a8c9b7f16b63e65bbba889acb436a1034a82d34fa09752d754f88d708eca80e1 \ + --hash=sha256:a8ef956fce64c8551221f395ba21d0724fed6b9b6242ca4f2f7beb4ce2f41997 \ + --hash=sha256:ab339536aa798b1e17750733663d272038bf28069761d5be57cb4a9b0137b4f8 \ + --hash=sha256:ac7ba71f9561cd7d7b55e1ea5511543c0282e2b6450f122672a2694621d63b7e \ + --hash=sha256:aea53d51859b6c64e7c51d522c03cc2c48b9b5d6172126854cc7f01aa11f52bc \ + --hash=sha256:aea7c06667b987787c7d1f5e1dfcd70419b711cdb47d6b4bb4ad4b76777a0563 \ + --hash=sha256:aefe1a7cb852fa61150fcb21a8c8fcea7b58c4cb11fbe59c97a0a4b31cae3c8c \ + --hash=sha256:b0989737a3ba6cf2a16efb857fb0dfa20bc5c542737fddb6d893fde48be45433 \ + --hash=sha256:b108134b9667bcd71236c5a02aad5ddd073e372fb5d48ea74853e009fe38acb6 \ + --hash=sha256:b12cb6527599808ada9eb2cd6e0e7d3d8f13fe7bbb01c6311255a15ded4c7ab4 \ + --hash=sha256:b5aff6f3e818e6bdbbb38e5967520f174b18f539c2b9de867b1e7fde6f8d95a4 \ + --hash=sha256:b67319b4aef1a6c56576ff544b67a2a6fbd7eaee485b241cabf53115e8908b8f \ + --hash=sha256:b7c86884ad23d61b025989d99bfdd92a7351de956e01c61307cb87035960bcb1 \ + --hash=sha256:b92b69441d1bd39f4940f9eadfa417a25862242ca2c396b406f9272ef09cdcaa \ + --hash=sha256:bcb7a1096b4b6b24ce1ac24d4942ad98f983cd3810f9711bcd0293f43a9d8b9f \ + --hash=sha256:bda3ea44c39eb74e2488297bb39d47186ed01342f0022c8ff407c250ac3f498e \ + --hash=sha256:be2ba4c3c5b7900246a8f866580700ef0d538f2ca32535e991027bdaba944063 \ + --hash=sha256:c5681160758d3f6ac5b4fea370495c48aac0989d6a0f01bb9a72ad8ef5ab75c4 \ + --hash=sha256:c5d32f5284012deaccd37da1e2cd42f081feaa76981f0eaa474351b68df813c5 \ + --hash=sha256:c6364038c519dffdbe07e3cf42e6a7f8b90c275d4d1617a69bb59734c1a2d571 \ + --hash=sha256:c70e93fba207106cb16bf852e421c37bbded92acd5964390aad07cb50d60f5cf \ + --hash=sha256:ca755eebf0d9e62d6cb013f1261e510317a41bf4650f22963474a663fdfe02aa \ + --hash=sha256:cccd007d5c95279e529c146d095f1d39ac05139de26c098166c4beb9374b0f4d \ + --hash=sha256:ce31158630a6ac85bddd6b830cffd46085ff90498b397bd0a259f59d27a12188 \ + --hash=sha256:ce9c671845de9699904b1e9df95acfe8dfc183f2310f163cdaa91a3535af95de \ + --hash=sha256:d12832e1dbea4be280b22fd0ea7c9b87f0d8fc51ba06e92dc62d52f804f78ebd \ + --hash=sha256:d2ed1b3cb9ff1c10e6e8b00941bb2e5bb568b307bfc6b17dffbbe8be5eecba86 \ + --hash=sha256:d5663bc1b471c79f5c833cffbc9b87d7bf13f87e055a5c86c363ccd2348d7e82 \ + --hash=sha256:d90b729fd2732df28130c064aac9bb8aff14ba20baa4aee7bd0795ff1187545f \ + --hash=sha256:dc0af80267edc68adf85f2a5d9be1cdf062f973db6790c1d065e45025fa26140 \ + --hash=sha256:de5b4e1088523e2b6f730d0509a9a813355b7f5659d70eb4f319c76beea2e250 \ + --hash=sha256:de6f6bb8a7840c7bf216fb83eec4e2f79f7325eca8858167b68708b929ab2172 \ + --hash=sha256:df53330a3bff250f10472ce96a9af28628ff1f4efc51ccba351a8820bca2a8ba \ + --hash=sha256:e094ec83694b59d263802ed03a8384594fcce477ce484b0cbcd0008a211ca751 \ + --hash=sha256:e794f698ae4c5084414efea0f5cc9f4ac562ec02d66e1484ff822ef97c2cadff \ + --hash=sha256:e7bc6df34d42322c5289e37e9971d6ed114e3776b45fa879f734bded9d1fea9c \ + --hash=sha256:eaf24066ad0b30917186420d51e2e3edf4b0e2ea68d8cd885b14dc8afdcf6556 \ + --hash=sha256:ecf4c4b83f1ab3d5a7ace10bafcb6f11df6156857a3c418244cef41ca9fa3e44 \ + --hash=sha256:ef5a7178fcc73b7d8c07229e89f8eb45b2908a9238eb90dcfc46571ccf0383b8 \ + --hash=sha256:f5cb182f6396706dc6cc1896dd02b1c889d644c081b0cdec38747573db88a7d7 \ + --hash=sha256:fa0e294046de09acd6146be0ed6727d1f42ded4ce3ea1e9a19c11b6774eea27c \ + --hash=sha256:fb54f7c6bafaa808f27166569b1511fc42701a7713858dddc08afdde9746849e \ + --hash=sha256:fd3be6481ef54b8cfd0e1e953323b7aa9d9789b94842d0e5b142ef4bb7999539 # via # -r requirements-actions.in # gcovr @@ -797,9 +833,8 @@ polib==1.2.0 \ --hash=sha256:1c77ee1b81feb31df9bca258cbc58db1bbb32d10214b173882452c73af06d62d \ --hash=sha256:f3ef94aefed6e183e342a8a269ae1fc4742ba193186ad76f175938621dbfc26b # via sphinx-lint -progress==1.6.1 \ - --hash=sha256:5239f22f305c12fdc8ce6e0e47f70f21622a935e16eafc4535617112e7c7ea0b \ - --hash=sha256:c1ba719f862ce885232a759eab47971fe74dfc7bb76ab8a51ef5940bad35086c +progress==1.6 \ + --hash=sha256:c9c86e98b5c03fa1fe11e3b67c1feda4788b8d0fe7336c2ff7d5644ccfba34cd # via -r requirements-actions.in psutil==7.0.0 \ --hash=sha256:101d71dc322e3cffd7cea0650b09b3d08b8e7c4109dd6809fe452dfd00e58b25 \ @@ -829,9 +864,9 @@ pygithub==2.6.1 \ --hash=sha256:6f2fa6d076ccae475f9fc392cc6cdbd54db985d4f69b8833a28397de75ed6ca3 \ --hash=sha256:b5c035392991cca63959e9453286b41b54d83bf2de2daa7d7ff7e4312cebf3bf # via -r requirements-actions.in -pygments==2.19.2 \ - --hash=sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887 \ - --hash=sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b +pygments==2.19.1 \ + --hash=sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f \ + --hash=sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c # via # gcovr # pytest @@ -1214,13 +1249,7 @@ tomli==2.2.1 \ --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 - # via - # -r requirements-actions.in - # mypy - # pylint - # pyproject-api - # pytest - # tox + # via -r requirements-actions.in tomlkit==0.13.3 \ --hash=sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1 \ --hash=sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0 @@ -1235,13 +1264,11 @@ typing-extensions==4.14.0 \ --hash=sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4 \ --hash=sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af # via - # astroid # elasticsearch # exceptiongroup # mypy # pygithub # python-can - # tox unidiff==0.7.5 \ --hash=sha256:2e5f0162052248946b9f0970a40e9e124236bf86c82b70821143a6fc1dea2574 \ --hash=sha256:c93bf2265cc1ba2a520e415ab05da587370bc2a3ae9e0414329f54f0c2fc09e8 From ba7e9c33fc11191d447bbe151b9b18cb890f3fe7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 014/881] Revert "[nrf fromtree] scripts: check_compliance: Fix traceback in junitparser" This reverts commit 4ae5a61a99616ca8161296cb98e84c424130c1d7. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.in | 2 +- scripts/requirements-compliance.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 4bdb9b0fbda..0fbced12c51 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -11,7 +11,7 @@ gitpython>=3.1.41 ijson intelhex junit2html -junitparser>=4.0.1 +junitparser>=2 lxml>=5.3.0 mock mypy diff --git a/scripts/requirements-compliance.txt b/scripts/requirements-compliance.txt index 3c3841cf33e..19bdcb3071f 100644 --- a/scripts/requirements-compliance.txt +++ b/scripts/requirements-compliance.txt @@ -4,7 +4,7 @@ # zephyr-keep-sorted-start clang-format>=15.0.0 gitlint -junitparser>=4.0.1 +junitparser>=2 lxml>=5.3.0 pykwalify pylint>=3 From 372c675e3c517363989e41bf2e86c31701bd6628 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 015/881] Revert "[nrf fromtree] scripts: west: spdx: extract copyright info" This reverts commit 990fa0d507abc0fc4764f463d27619c049c3b208. Signed-off-by: Jukka Rissanen --- doc/develop/west/zephyr-cmds.rst | 7 ----- scripts/requirements-actions.in | 1 - scripts/requirements-actions.txt | 38 ++++---------------------- scripts/requirements-base.txt | 1 - scripts/west_commands/zspdx/scanner.py | 30 -------------------- 5 files changed, 5 insertions(+), 72 deletions(-) diff --git a/doc/develop/west/zephyr-cmds.rst b/doc/develop/west/zephyr-cmds.rst index 8049d5c4309..e40093c3dd1 100644 --- a/doc/develop/west/zephyr-cmds.rst +++ b/doc/develop/west/zephyr-cmds.rst @@ -130,13 +130,6 @@ Each file in the bill-of-materials is scanned, so that its hashes (SHA256 and SHA1) can be recorded, along with any detected licenses if an ``SPDX-License-Identifier`` comment appears in the file. -Copyright notices are extracted using the third-party :command:`reuse` tool from the REUSE group. -When found, these notices are added to SPDX documents as ``FileCopyrightText`` fields. - -.. note:: - Copyright extraction uses heuristics that may not capture complete notice text, so - ``FileCopyrightText`` content is best-effort. This aligns with SPDX specification recommendations. - SPDX Relationships are created to indicate dependencies between CMake build targets, build targets that are linked together, and source files that are compiled to generate the built library files. diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 0fbced12c51..0fb1eca5ad8 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -28,7 +28,6 @@ pytest python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" pyyaml -reuse ruff==0.11.11 setuptools>=70.2.0 spdx-tools diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index e9faf32c7f9..5dc02845288 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -12,10 +12,6 @@ astroid==3.3.10 \ --hash=sha256:104fb9cb9b27ea95e847a94c003be03a9e039334a8ebca5ee27dafaf5c5711eb \ --hash=sha256:c332157953060c6deb9caa57303ae0d20b0fbdb2e59b4a4f2a6ba49d0a7961ce # via pylint -attrs==25.3.0 \ - --hash=sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3 \ - --hash=sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b - # via reuse awscli==1.40.38 \ --hash=sha256:3f90f2815e3b72691785d2bbd4f2c3dcbde311c55e1f5633a37cc3e514ba6fdb \ --hash=sha256:ec9b69ff4600ef151df3336f0e7af4cf30280d27f9d8e67e09c4b386ceb1f154 @@ -24,16 +20,10 @@ beartype==0.21.0 \ --hash=sha256:b6a1bd56c72f31b0a496a36cc55df6e2f475db166ad07fa4acc7e74f4c7f34c0 \ --hash=sha256:f9a5078f5ce87261c2d22851d19b050b64f6a805439e8793aecf01ce660d3244 # via spdx-tools -binaryornot==0.4.4 \ - --hash=sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061 \ - --hash=sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4 - # via reuse boolean-py==5.0 \ --hash=sha256:60cbc4bad079753721d32649545505362c754e121570ada4658b852a3a318d95 \ --hash=sha256:ef28a70bd43115208441b53a045d1549e2f0ec6e3d08a9d142cbc41c1938e8d9 - # via - # license-expression - # reuse + # via license-expression botocore==1.38.39 \ --hash=sha256:2305f688e9328af473a504197584112f228513e06412038d83205ce8d1456f40 \ --hash=sha256:ee3aa03af1dabed4f3710cd64f6d9d488281eee720710bf1cf9f2b2fd30025ae @@ -128,9 +118,7 @@ cffi==1.17.1 \ chardet==5.2.0 \ --hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \ --hash=sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970 - # via - # binaryornot - # tox + # via tox charset-normalizer==3.4.2 \ --hash=sha256:005fa3432484527f9732ebd315da8da8001593e2cf46a3d817669f062c3d9ed4 \ --hash=sha256:046595208aae0120559a67693ecc65dd75d46f7bf687f159127046628178dc45 \ @@ -224,9 +212,7 @@ charset-normalizer==3.4.2 \ --hash=sha256:fb707f3e15060adf5b7ada797624a6c6e0138e2a26baa089df64c68ee98e040f \ --hash=sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a \ --hash=sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f - # via - # python-debian - # requests + # via requests clang-format==20.1.6 \ --hash=sha256:0ea008a20951527d35a1e2b8febdca3c47c6f8e9a1bd174601c891e20053ef2e \ --hash=sha256:11530ff352c64176ba4297ad398452d9fcd442b4a8bb2a804cc7915bc94b96e1 \ @@ -250,7 +236,6 @@ click==8.1.3 \ --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48 # via # gitlint-core - # reuse # spdx-tools colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ @@ -467,7 +452,6 @@ jinja2==3.1.6 \ # via # gcovr # junit2html - # reuse jmespath==1.0.1 \ --hash=sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 \ --hash=sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe @@ -482,9 +466,7 @@ junitparser==3.2.0 \ license-expression==30.4.1 \ --hash=sha256:679646bc3261a17690494a3e1cada446e5ee342dbd87dcfa4a0c24cc5dce13ee \ --hash=sha256:9f02105f9e0fcecba6a85dfbbed7d94ea1c3a70cf23ddbfb5adf3438a6f6fce0 - # via - # reuse - # spdx-tools + # via spdx-tools lxml==5.4.0 \ --hash=sha256:00b8686694423ddae324cf614e1b9659c2edb754de617703c3d29ff568448df5 \ --hash=sha256:073eb6dcdf1f587d9b88c8c93528b57eccda40209cf9be549d469b942b41d70b \ @@ -924,10 +906,6 @@ python-dateutil==2.9.0.post0 \ # botocore # elasticsearch # pykwalify -python-debian==1.0.1 \ - --hash=sha256:3ada9b83a3d671b58081782c0969cffa0102f6ce433fbbc7cf21275b8b5cc771 \ - --hash=sha256:8f137c230c1d9279c2ac892b35915068b2aca090c9fd3da5671ff87af32af12c - # via reuse python-magic==0.4.27 ; sys_platform != 'win32' \ --hash=sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b \ --hash=sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3 @@ -1101,10 +1079,6 @@ requests==2.32.4 \ --hash=sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c \ --hash=sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422 # via pygithub -reuse==5.0.2 \ - --hash=sha256:7a680f00324e87a72061677a892d8cbabfddf7adcf7a5376aeeed2d78995bbbb \ - --hash=sha256:878016ae5dd29c10bad4606d6676c12a268c12aa9fcfea66403598e16eed085c - # via -r requirements-actions.in rsa==4.7.2 \ --hash=sha256:78f9a9bf4e7be0c5ded4583326e7461e3a3c5aae24073648b4bdfa797d78c9d2 \ --hash=sha256:9d689e6ca1b3038bc82bf8d23e944b6b6037bc02301a574935b2dd946e0353b9 @@ -1253,9 +1227,7 @@ tomli==2.2.1 \ tomlkit==0.13.3 \ --hash=sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1 \ --hash=sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0 - # via - # pylint - # reuse + # via pylint tox==4.27.0 \ --hash=sha256:2b8a7fb986b82aa2c830c0615082a490d134e0626dbc9189986da46a313c4f20 \ --hash=sha256:b97d5ecc0c0d5755bcc5348387fef793e1bfa68eb33746412f4c60881d7f5f57 diff --git a/scripts/requirements-base.txt b/scripts/requirements-base.txt index 2b35d3df097..6e3cc0616cf 100644 --- a/scripts/requirements-base.txt +++ b/scripts/requirements-base.txt @@ -24,7 +24,6 @@ pyserial requests>=2.32.0 semver tqdm>=4.67.1 -reuse # for ram/rom reports anytree diff --git a/scripts/west_commands/zspdx/scanner.py b/scripts/west_commands/zspdx/scanner.py index 93c43095598..2a4ac792b9c 100644 --- a/scripts/west_commands/zspdx/scanner.py +++ b/scripts/west_commands/zspdx/scanner.py @@ -6,7 +6,6 @@ import os import re -from reuse.project import Project from west import log from zspdx.licenses import LICENSES @@ -178,32 +177,6 @@ def normalizeExpression(licsConcluded): return " AND ".join(revised) -def getCopyrightInfo(filePath): - """ - Scans the specified file for copyright information using REUSE tools. - - Arguments: - - filePath: path to file to scan - - Returns: list of copyright statements if found; empty list if not found - """ - log.dbg(f" - getting copyright info for {filePath}") - - try: - project = Project(os.path.dirname(filePath)) - infos = project.reuse_info_of(filePath) - copyrights = [] - - for info in infos: - if info.copyright_lines: - copyrights.extend(info.copyright_lines) - - return copyrights - except Exception as e: - log.wrn(f"Error getting copyright info for {filePath}: {e}") - return [] - - def scanDocument(cfg, doc): """ Scan for licenses and calculate hashes for all Files and Packages @@ -240,9 +213,6 @@ def scanDocument(cfg, doc): f.concludedLicense = expression f.licenseInfoInFile = splitExpression(expression) - if copyrights := getCopyrightInfo(f.abspath): - f.copyrightText = f"\n{'\n'.join(copyrights)}\n" - # check if any custom license IDs should be flagged for document for lic in f.licenseInfoInFile: checkLicenseValid(lic, doc) From a9ca37e9b1df9f108d3ad0882de719d0b72ba066 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 016/881] Revert "[nrf fromtree] doc: ci: Zephyr now requires Python 3.12 or higher" This reverts commit 3d07feb9692c2bb5bba03347e40f1151e000e8e2. Signed-off-by: Jukka Rissanen --- cmake/modules/python.cmake | 2 +- doc/develop/getting_started/index.rst | 2 +- doc/releases/migration-guide-4.2.rst | 5 - doc/requirements.txt | 801 +++++++++++++------------- scripts/ci/check_compliance.py | 2 +- scripts/requirements-actions.txt | 56 +- 6 files changed, 453 insertions(+), 415 deletions(-) diff --git a/cmake/modules/python.cmake b/cmake/modules/python.cmake index 1438c3fcdaa..e01d3192120 100644 --- a/cmake/modules/python.cmake +++ b/cmake/modules/python.cmake @@ -11,7 +11,7 @@ if (WIN32) set(ENV{PYTHONIOENCODING} "utf-8") endif() -set(PYTHON_MINIMUM_REQUIRED 3.12) +set(PYTHON_MINIMUM_REQUIRED 3.10) if(NOT DEFINED Python3_EXECUTABLE AND DEFINED WEST_PYTHON) set(Python3_EXECUTABLE "${WEST_PYTHON}") diff --git a/doc/develop/getting_started/index.rst b/doc/develop/getting_started/index.rst index 5ba0d070fca..78f43e70b5f 100644 --- a/doc/develop/getting_started/index.rst +++ b/doc/develop/getting_started/index.rst @@ -62,7 +62,7 @@ The current minimum required version for the main dependencies are: - 3.20.5 * - `Python `_ - - 3.12 + - 3.10 * - `Devicetree compiler `_ - 1.4.6 diff --git a/doc/releases/migration-guide-4.2.rst b/doc/releases/migration-guide-4.2.rst index 26e4bd655e7..9b31f4a1634 100644 --- a/doc/releases/migration-guide-4.2.rst +++ b/doc/releases/migration-guide-4.2.rst @@ -20,11 +20,6 @@ the :ref:`release notes`. :local: :depth: 2 -Common -****** - -* The minimum required Python version is now 3.12 (from 3.10). - Build System ************ diff --git a/doc/requirements.txt b/doc/requirements.txt index 3d424a5627e..c10b390651a 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --universal --python-version 3.12 --generate-hashes requirements.in --output-file requirements.txt +# uv pip compile --universal --python-version 3.10 --generate-hashes requirements.in --output-file requirements.txt alabaster==1.0.0 \ --hash=sha256:c00dca57bca26fa62a6d7d0a9fcce65f3e026e9bfe33e9c538fd3fbb2144fd9e \ --hash=sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b @@ -10,115 +10,115 @@ anyio==4.9.0 \ # via # starlette # watchfiles -anytree==2.13.0 \ - --hash=sha256:4cbcf10df36b1f1cba131b7e487ff3edafc9d6e932a3c70071b5b768bab901ff \ - --hash=sha256:c9d3aa6825fdd06af7ebb05b4ef291d2db63e62bb1f9b7d9b71354be9d362714 +anytree==2.12.1 \ + --hash=sha256:244def434ccf31b668ed282954e5d315b4e066c4940b94aff4a7962d85947830 \ + --hash=sha256:5ea9e61caf96db1e5b3d0a914378d2cd83c269dfce1fb8242ce96589fa3382f0 # via -r requirements.in babel==2.17.0 \ --hash=sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d \ --hash=sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2 # via sphinx -certifi==2025.6.15 \ - --hash=sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057 \ - --hash=sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b +certifi==2025.1.31 \ + --hash=sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651 \ + --hash=sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe # via requests -charset-normalizer==3.4.2 \ - --hash=sha256:005fa3432484527f9732ebd315da8da8001593e2cf46a3d817669f062c3d9ed4 \ - --hash=sha256:046595208aae0120559a67693ecc65dd75d46f7bf687f159127046628178dc45 \ - --hash=sha256:0c29de6a1a95f24b9a1aa7aefd27d2487263f00dfd55a77719b530788f75cff7 \ - --hash=sha256:0c8c57f84ccfc871a48a47321cfa49ae1df56cd1d965a09abe84066f6853b9c0 \ - --hash=sha256:0f5d9ed7f254402c9e7d35d2f5972c9bbea9040e99cd2861bd77dc68263277c7 \ - --hash=sha256:18dd2e350387c87dabe711b86f83c9c78af772c748904d372ade190b5c7c9d4d \ - --hash=sha256:1b1bde144d98e446b056ef98e59c256e9294f6b74d7af6846bf5ffdafd687a7d \ - --hash=sha256:1c95a1e2902a8b722868587c0e1184ad5c55631de5afc0eb96bc4b0d738092c0 \ - --hash=sha256:1cad5f45b3146325bb38d6855642f6fd609c3f7cad4dbaf75549bf3b904d3184 \ - --hash=sha256:21b2899062867b0e1fde9b724f8aecb1af14f2778d69aacd1a5a1853a597a5db \ - --hash=sha256:24498ba8ed6c2e0b56d4acbf83f2d989720a93b41d712ebd4f4979660db4417b \ - --hash=sha256:25a23ea5c7edc53e0f29bae2c44fcb5a1aa10591aae107f2a2b2583a9c5cbc64 \ - --hash=sha256:289200a18fa698949d2b39c671c2cc7a24d44096784e76614899a7ccf2574b7b \ - --hash=sha256:28a1005facc94196e1fb3e82a3d442a9d9110b8434fc1ded7a24a2983c9888d8 \ - --hash=sha256:32fc0341d72e0f73f80acb0a2c94216bd704f4f0bce10aedea38f30502b271ff \ - --hash=sha256:36b31da18b8890a76ec181c3cf44326bf2c48e36d393ca1b72b3f484113ea344 \ - --hash=sha256:3c21d4fca343c805a52c0c78edc01e3477f6dd1ad7c47653241cf2a206d4fc58 \ - --hash=sha256:3fddb7e2c84ac87ac3a947cb4e66d143ca5863ef48e4a5ecb83bd48619e4634e \ - --hash=sha256:43e0933a0eff183ee85833f341ec567c0980dae57c464d8a508e1b2ceb336471 \ - --hash=sha256:4a476b06fbcf359ad25d34a057b7219281286ae2477cc5ff5e3f70a246971148 \ - --hash=sha256:4e594135de17ab3866138f496755f302b72157d115086d100c3f19370839dd3a \ - --hash=sha256:50bf98d5e563b83cc29471fa114366e6806bc06bc7a25fd59641e41445327836 \ - --hash=sha256:5a9979887252a82fefd3d3ed2a8e3b937a7a809f65dcb1e068b090e165bbe99e \ - --hash=sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63 \ - --hash=sha256:5bf4545e3b962767e5c06fe1738f951f77d27967cb2caa64c28be7c4563e162c \ - --hash=sha256:6333b3aa5a12c26b2a4d4e7335a28f1475e0e5e17d69d55141ee3cab736f66d1 \ - --hash=sha256:65c981bdbd3f57670af8b59777cbfae75364b483fa8a9f420f08094531d54a01 \ - --hash=sha256:68a328e5f55ec37c57f19ebb1fdc56a248db2e3e9ad769919a58672958e8f366 \ - --hash=sha256:6a0289e4589e8bdfef02a80478f1dfcb14f0ab696b5a00e1f4b8a14a307a3c58 \ - --hash=sha256:6b66f92b17849b85cad91259efc341dce9c1af48e2173bf38a85c6329f1033e5 \ - --hash=sha256:6c9379d65defcab82d07b2a9dfbfc2e95bc8fe0ebb1b176a3190230a3ef0e07c \ - --hash=sha256:6fc1f5b51fa4cecaa18f2bd7a003f3dd039dd615cd69a2afd6d3b19aed6775f2 \ - --hash=sha256:70f7172939fdf8790425ba31915bfbe8335030f05b9913d7ae00a87d4395620a \ - --hash=sha256:721c76e84fe669be19c5791da68232ca2e05ba5185575086e384352e2c309597 \ - --hash=sha256:7222ffd5e4de8e57e03ce2cef95a4c43c98fcb72ad86909abdfc2c17d227fc1b \ - --hash=sha256:75d10d37a47afee94919c4fab4c22b9bc2a8bf7d4f46f87363bcf0573f3ff4f5 \ - --hash=sha256:76af085e67e56c8816c3ccf256ebd136def2ed9654525348cfa744b6802b69eb \ - --hash=sha256:770cab594ecf99ae64c236bc9ee3439c3f46be49796e265ce0cc8bc17b10294f \ - --hash=sha256:7a6ab32f7210554a96cd9e33abe3ddd86732beeafc7a28e9955cdf22ffadbab0 \ - --hash=sha256:7c48ed483eb946e6c04ccbe02c6b4d1d48e51944b6db70f697e089c193404941 \ - --hash=sha256:7f56930ab0abd1c45cd15be65cc741c28b1c9a34876ce8c17a2fa107810c0af0 \ - --hash=sha256:8075c35cd58273fee266c58c0c9b670947c19df5fb98e7b66710e04ad4e9ff86 \ - --hash=sha256:8272b73e1c5603666618805fe821edba66892e2870058c94c53147602eab29c7 \ - --hash=sha256:82d8fd25b7f4675d0c47cf95b594d4e7b158aca33b76aa63d07186e13c0e0ab7 \ - --hash=sha256:844da2b5728b5ce0e32d863af26f32b5ce61bc4273a9c720a9f3aa9df73b1455 \ - --hash=sha256:8755483f3c00d6c9a77f490c17e6ab0c8729e39e6390328e42521ef175380ae6 \ - --hash=sha256:915f3849a011c1f593ab99092f3cecfcb4d65d8feb4a64cf1bf2d22074dc0ec4 \ - --hash=sha256:926ca93accd5d36ccdabd803392ddc3e03e6d4cd1cf17deff3b989ab8e9dbcf0 \ - --hash=sha256:982bb1e8b4ffda883b3d0a521e23abcd6fd17418f6d2c4118d257a10199c0ce3 \ - --hash=sha256:98f862da73774290f251b9df8d11161b6cf25b599a66baf087c1ffe340e9bfd1 \ - --hash=sha256:9cbfacf36cb0ec2897ce0ebc5d08ca44213af24265bd56eca54bee7923c48fd6 \ - --hash=sha256:a370b3e078e418187da8c3674eddb9d983ec09445c99a3a263c2011993522981 \ - --hash=sha256:a955b438e62efdf7e0b7b52a64dc5c3396e2634baa62471768a64bc2adb73d5c \ - --hash=sha256:aa6af9e7d59f9c12b33ae4e9450619cf2488e2bbe9b44030905877f0b2324980 \ - --hash=sha256:aa88ca0b1932e93f2d961bf3addbb2db902198dca337d88c89e1559e066e7645 \ - --hash=sha256:aaeeb6a479c7667fbe1099af9617c83aaca22182d6cf8c53966491a0f1b7ffb7 \ - --hash=sha256:aaf27faa992bfee0264dc1f03f4c75e9fcdda66a519db6b957a3f826e285cf12 \ - --hash=sha256:b2680962a4848b3c4f155dc2ee64505a9c57186d0d56b43123b17ca3de18f0fa \ - --hash=sha256:b2d318c11350e10662026ad0eb71bb51c7812fc8590825304ae0bdd4ac283acd \ - --hash=sha256:b33de11b92e9f75a2b545d6e9b6f37e398d86c3e9e9653c4864eb7e89c5773ef \ - --hash=sha256:b3daeac64d5b371dea99714f08ffc2c208522ec6b06fbc7866a450dd446f5c0f \ - --hash=sha256:be1e352acbe3c78727a16a455126d9ff83ea2dfdcbc83148d2982305a04714c2 \ - --hash=sha256:bee093bf902e1d8fc0ac143c88902c3dfc8941f7ea1d6a8dd2bcb786d33db03d \ - --hash=sha256:c72fbbe68c6f32f251bdc08b8611c7b3060612236e960ef848e0a517ddbe76c5 \ - --hash=sha256:c9e36a97bee9b86ef9a1cf7bb96747eb7a15c2f22bdb5b516434b00f2a599f02 \ - --hash=sha256:cddf7bd982eaa998934a91f69d182aec997c6c468898efe6679af88283b498d3 \ - --hash=sha256:cf713fe9a71ef6fd5adf7a79670135081cd4431c2943864757f0fa3a65b1fafd \ - --hash=sha256:d11b54acf878eef558599658b0ffca78138c8c3655cf4f3a4a673c437e67732e \ - --hash=sha256:d41c4d287cfc69060fa91cae9683eacffad989f1a10811995fa309df656ec214 \ - --hash=sha256:d524ba3f1581b35c03cb42beebab4a13e6cdad7b36246bd22541fa585a56cccd \ - --hash=sha256:daac4765328a919a805fa5e2720f3e94767abd632ae410a9062dff5412bae65a \ - --hash=sha256:db4c7bf0e07fc3b7d89ac2a5880a6a8062056801b83ff56d8464b70f65482b6c \ - --hash=sha256:dc7039885fa1baf9be153a0626e337aa7ec8bf96b0128605fb0d77788ddc1681 \ - --hash=sha256:dccab8d5fa1ef9bfba0590ecf4d46df048d18ffe3eec01eeb73a42e0d9e7a8ba \ - --hash=sha256:dedb8adb91d11846ee08bec4c8236c8549ac721c245678282dcb06b221aab59f \ - --hash=sha256:e45ba65510e2647721e35323d6ef54c7974959f6081b58d4ef5d87c60c84919a \ - --hash=sha256:e53efc7c7cee4c1e70661e2e112ca46a575f90ed9ae3fef200f2a25e954f4b28 \ - --hash=sha256:e635b87f01ebc977342e2697d05b56632f5f879a4f15955dfe8cef2448b51691 \ - --hash=sha256:e70e990b2137b29dc5564715de1e12701815dacc1d056308e2b17e9095372a82 \ - --hash=sha256:e8082b26888e2f8b36a042a58307d5b917ef2b1cacab921ad3323ef91901c71a \ - --hash=sha256:e8323a9b031aa0393768b87f04b4164a40037fb2a3c11ac06a03ffecd3618027 \ - --hash=sha256:e92fca20c46e9f5e1bb485887d074918b13543b1c2a1185e69bb8d17ab6236a7 \ - --hash=sha256:eb30abc20df9ab0814b5a2524f23d75dcf83cde762c161917a2b4b7b55b1e518 \ - --hash=sha256:eba9904b0f38a143592d9fc0e19e2df0fa2e41c3c3745554761c5f6447eedabf \ - --hash=sha256:ef8de666d6179b009dce7bcb2ad4c4a779f113f12caf8dc77f0162c29d20490b \ - --hash=sha256:efd387a49825780ff861998cd959767800d54f8308936b21025326de4b5a42b9 \ - --hash=sha256:f0aa37f3c979cf2546b73e8222bbfa3dc07a641585340179d768068e3455e544 \ - --hash=sha256:f4074c5a429281bf056ddd4c5d3b740ebca4d43ffffe2ef4bf4d2d05114299da \ - --hash=sha256:f69a27e45c43520f5487f27627059b64aaf160415589230992cec34c5e18a509 \ - --hash=sha256:fb707f3e15060adf5b7ada797624a6c6e0138e2a26baa089df64c68ee98e040f \ - --hash=sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a \ - --hash=sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f +charset-normalizer==3.4.1 \ + --hash=sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537 \ + --hash=sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa \ + --hash=sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a \ + --hash=sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294 \ + --hash=sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b \ + --hash=sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd \ + --hash=sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601 \ + --hash=sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd \ + --hash=sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4 \ + --hash=sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d \ + --hash=sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2 \ + --hash=sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313 \ + --hash=sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd \ + --hash=sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa \ + --hash=sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8 \ + --hash=sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1 \ + --hash=sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2 \ + --hash=sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496 \ + --hash=sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d \ + --hash=sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b \ + --hash=sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e \ + --hash=sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a \ + --hash=sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4 \ + --hash=sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca \ + --hash=sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78 \ + --hash=sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408 \ + --hash=sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5 \ + --hash=sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3 \ + --hash=sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f \ + --hash=sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a \ + --hash=sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765 \ + --hash=sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6 \ + --hash=sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146 \ + --hash=sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6 \ + --hash=sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9 \ + --hash=sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd \ + --hash=sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c \ + --hash=sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f \ + --hash=sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545 \ + --hash=sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176 \ + --hash=sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770 \ + --hash=sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824 \ + --hash=sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f \ + --hash=sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf \ + --hash=sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487 \ + --hash=sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d \ + --hash=sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd \ + --hash=sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b \ + --hash=sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534 \ + --hash=sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f \ + --hash=sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b \ + --hash=sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9 \ + --hash=sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd \ + --hash=sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125 \ + --hash=sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9 \ + --hash=sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de \ + --hash=sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11 \ + --hash=sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d \ + --hash=sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35 \ + --hash=sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f \ + --hash=sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda \ + --hash=sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7 \ + --hash=sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a \ + --hash=sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971 \ + --hash=sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8 \ + --hash=sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41 \ + --hash=sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d \ + --hash=sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f \ + --hash=sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757 \ + --hash=sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a \ + --hash=sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886 \ + --hash=sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77 \ + --hash=sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76 \ + --hash=sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247 \ + --hash=sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85 \ + --hash=sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb \ + --hash=sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7 \ + --hash=sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e \ + --hash=sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6 \ + --hash=sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037 \ + --hash=sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1 \ + --hash=sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e \ + --hash=sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807 \ + --hash=sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407 \ + --hash=sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c \ + --hash=sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12 \ + --hash=sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3 \ + --hash=sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089 \ + --hash=sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd \ + --hash=sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e \ + --hash=sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00 \ + --hash=sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616 # via requests -click==8.2.1 \ - --hash=sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202 \ - --hash=sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b +click==8.1.8 \ + --hash=sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2 \ + --hash=sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a # via uvicorn colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ @@ -142,12 +142,18 @@ docutils==0.21.2 \ # sphinx-rtd-theme # sphinx-tabs # sphinx-togglebutton -doxmlparser==1.14.0 \ - --hash=sha256:1037dcc4aadf908feb2d908685159972bb2975322fbe2b120f5cac5a938f0b14 +doxmlparser==1.13.2 \ + --hash=sha256:65ab126e7d3f77b1bb15fa6886663614f68d0473b48831e1fb822f533243eb68 # via -r requirements.in -h11==0.16.0 \ - --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ - --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 +exceptiongroup==1.2.2 ; python_full_version < '3.11' \ + --hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b \ + --hash=sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc + # via + # anyio + # pytest +h11==0.14.0 \ + --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ + --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 # via uvicorn idna==3.10 \ --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ @@ -167,139 +173,145 @@ jinja2==3.1.6 \ --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 # via sphinx -lxml==5.4.0 \ - --hash=sha256:00b8686694423ddae324cf614e1b9659c2edb754de617703c3d29ff568448df5 \ - --hash=sha256:073eb6dcdf1f587d9b88c8c93528b57eccda40209cf9be549d469b942b41d70b \ - --hash=sha256:09846782b1ef650b321484ad429217f5154da4d6e786636c38e434fa32e94e49 \ - --hash=sha256:0a01ce7d8479dce84fc03324e3b0c9c90b1ece9a9bb6a1b6c9025e7e4520e78c \ - --hash=sha256:0be91891bdb06ebe65122aa6bf3fc94489960cf7e03033c6f83a90863b23c58b \ - --hash=sha256:0cef4feae82709eed352cd7e97ae062ef6ae9c7b5dbe3663f104cd2c0e8d94ba \ - --hash=sha256:0e108352e203c7afd0eb91d782582f00a0b16a948d204d4dec8565024fafeea5 \ - --hash=sha256:0ea0252b51d296a75f6118ed0d8696888e7403408ad42345d7dfd0d1e93309a7 \ - --hash=sha256:0fce1294a0497edb034cb416ad3e77ecc89b313cff7adbee5334e4dc0d11f422 \ - --hash=sha256:1320091caa89805df7dcb9e908add28166113dcd062590668514dbd510798c88 \ - --hash=sha256:142accb3e4d1edae4b392bd165a9abdee8a3c432a2cca193df995bc3886249c8 \ - --hash=sha256:14479c2ad1cb08b62bb941ba8e0e05938524ee3c3114644df905d2331c76cd57 \ - --hash=sha256:151d6c40bc9db11e960619d2bf2ec5829f0aaffb10b41dcf6ad2ce0f3c0b2325 \ - --hash=sha256:15a665ad90054a3d4f397bc40f73948d48e36e4c09f9bcffc7d90c87410e478a \ - --hash=sha256:1a42b3a19346e5601d1b8296ff6ef3d76038058f311902edd574461e9c036982 \ - --hash=sha256:1af80c6316ae68aded77e91cd9d80648f7dd40406cef73df841aa3c36f6907c8 \ - --hash=sha256:1b717b00a71b901b4667226bba282dd462c42ccf618ade12f9ba3674e1fabc55 \ - --hash=sha256:1dc4ca99e89c335a7ed47d38964abcb36c5910790f9bd106f2a8fa2ee0b909d2 \ - --hash=sha256:20e16c08254b9b6466526bc1828d9370ee6c0d60a4b64836bc3ac2917d1e16df \ - --hash=sha256:226046e386556a45ebc787871d6d2467b32c37ce76c2680f5c608e25823ffc84 \ - --hash=sha256:24974f774f3a78ac12b95e3a20ef0931795ff04dbb16db81a90c37f589819551 \ - --hash=sha256:24f6df5f24fc3385f622c0c9d63fe34604893bc1a5bdbb2dbf5870f85f9a404a \ - --hash=sha256:27a9ded0f0b52098ff89dd4c418325b987feed2ea5cc86e8860b0f844285d740 \ - --hash=sha256:29f451a4b614a7b5b6c2e043d7b64a15bd8304d7e767055e8ab68387a8cacf4e \ - --hash=sha256:2b31a3a77501d86d8ade128abb01082724c0dfd9524f542f2f07d693c9f1175f \ - --hash=sha256:2c62891b1ea3094bb12097822b3d44b93fc6c325f2043c4d2736a8ff09e65f60 \ - --hash=sha256:2dc191e60425ad70e75a68c9fd90ab284df64d9cd410ba8d2b641c0c45bc006e \ - --hash=sha256:31e63621e073e04697c1b2d23fcb89991790eef370ec37ce4d5d469f40924ed6 \ - --hash=sha256:32697d2ea994e0db19c1df9e40275ffe84973e4232b5c274f47e7c1ec9763cdd \ - --hash=sha256:3a3178b4873df8ef9457a4875703488eb1622632a9cee6d76464b60e90adbfcd \ - --hash=sha256:3b9c2754cef6963f3408ab381ea55f47dabc6f78f4b8ebb0f0b25cf1ac1f7609 \ - --hash=sha256:3d3c30ba1c9b48c68489dc1829a6eede9873f52edca1dda900066542528d6b20 \ - --hash=sha256:3e6d5557989cdc3ebb5302bbdc42b439733a841891762ded9514e74f60319ad6 \ - --hash=sha256:4025bf2884ac4370a3243c5aa8d66d3cb9e15d3ddd0af2d796eccc5f0244390e \ - --hash=sha256:4291d3c409a17febf817259cb37bc62cb7eb398bcc95c1356947e2871911ae61 \ - --hash=sha256:4329422de653cdb2b72afa39b0aa04252fca9071550044904b2e7036d9d97fe4 \ - --hash=sha256:43d549b876ce64aa18b2328faff70f5877f8c6dede415f80a2f799d31644d776 \ - --hash=sha256:460508a4b07364d6abf53acaa0a90b6d370fafde5693ef37602566613a9b0779 \ - --hash=sha256:47fb24cc0f052f0576ea382872b3fc7e1f7e3028e53299ea751839418ade92a6 \ - --hash=sha256:48b4afaf38bf79109bb060d9016fad014a9a48fb244e11b94f74ae366a64d252 \ - --hash=sha256:497cab4d8254c2a90bf988f162ace2ddbfdd806fce3bda3f581b9d24c852e03c \ - --hash=sha256:4aa412a82e460571fad592d0f93ce9935a20090029ba08eca05c614f99b0cc92 \ - --hash=sha256:4b7ce10634113651d6f383aa712a194179dcd496bd8c41e191cec2099fa09de5 \ - --hash=sha256:4cd915c0fb1bed47b5e6d6edd424ac25856252f09120e3e8ba5154b6b921860e \ - --hash=sha256:4d885698f5019abe0de3d352caf9466d5de2baded00a06ef3f1216c1a58ae78f \ - --hash=sha256:4f5322cf38fe0e21c2d73901abf68e6329dc02a4994e483adbcf92b568a09a54 \ - --hash=sha256:50441c9de951a153c698b9b99992e806b71c1f36d14b154592580ff4a9d0d877 \ - --hash=sha256:529024ab3a505fed78fe3cc5ddc079464e709f6c892733e3f5842007cec8ac6e \ - --hash=sha256:53370c26500d22b45182f98847243efb518d268374a9570409d2e2276232fd37 \ - --hash=sha256:53d9469ab5460402c19553b56c3648746774ecd0681b1b27ea74d5d8a3ef5590 \ - --hash=sha256:56dbdbab0551532bb26c19c914848d7251d73edb507c3079d6805fa8bba5b706 \ - --hash=sha256:5a99d86351f9c15e4a901fc56404b485b1462039db59288b203f8c629260a142 \ - --hash=sha256:5cca36a194a4eb4e2ed6be36923d3cffd03dcdf477515dea687185506583d4c9 \ - --hash=sha256:5f11a1526ebd0dee85e7b1e39e39a0cc0d9d03fb527f56d8457f6df48a10dc0c \ - --hash=sha256:61c7bbf432f09ee44b1ccaa24896d21075e533cd01477966a5ff5a71d88b2f56 \ - --hash=sha256:639978bccb04c42677db43c79bdaa23785dc7f9b83bfd87570da8207872f1ce5 \ - --hash=sha256:63e7968ff83da2eb6fdda967483a7a023aa497d85ad8f05c3ad9b1f2e8c84987 \ - --hash=sha256:664cdc733bc87449fe781dbb1f309090966c11cc0c0cd7b84af956a02a8a4729 \ - --hash=sha256:67ed8a40665b84d161bae3181aa2763beea3747f748bca5874b4af4d75998f87 \ - --hash=sha256:67f779374c6b9753ae0a0195a892a1c234ce8416e4448fe1e9f34746482070a7 \ - --hash=sha256:6854f8bd8a1536f8a1d9a3655e6354faa6406621cf857dc27b681b69860645c7 \ - --hash=sha256:696ea9e87442467819ac22394ca36cb3d01848dad1be6fac3fb612d3bd5a12cf \ - --hash=sha256:6ef80aeac414f33c24b3815ecd560cee272786c3adfa5f31316d8b349bfade28 \ - --hash=sha256:72ac9762a9f8ce74c9eed4a4e74306f2f18613a6b71fa065495a67ac227b3056 \ - --hash=sha256:75133890e40d229d6c5837b0312abbe5bac1c342452cf0e12523477cd3aa21e7 \ - --hash=sha256:7605c1c32c3d6e8c990dd28a0970a3cbbf1429d5b92279e37fda05fb0c92190e \ - --hash=sha256:773e27b62920199c6197130632c18fb7ead3257fce1ffb7d286912e56ddb79e0 \ - --hash=sha256:795f61bcaf8770e1b37eec24edf9771b307df3af74d1d6f27d812e15a9ff3872 \ - --hash=sha256:79d5bfa9c1b455336f52343130b2067164040604e41f6dc4d8313867ed540079 \ - --hash=sha256:7a62cc23d754bb449d63ff35334acc9f5c02e6dae830d78dab4dd12b78a524f4 \ - --hash=sha256:7be701c24e7f843e6788353c055d806e8bd8466b52907bafe5d13ec6a6dbaecd \ - --hash=sha256:7ca56ebc2c474e8f3d5761debfd9283b8b18c76c4fc0967b74aeafba1f5647f9 \ - --hash=sha256:7ce1a171ec325192c6a636b64c94418e71a1964f56d002cc28122fceff0b6121 \ - --hash=sha256:891f7f991a68d20c75cb13c5c9142b2a3f9eb161f1f12a9489c82172d1f133c0 \ - --hash=sha256:8f82125bc7203c5ae8633a7d5d20bcfdff0ba33e436e4ab0abc026a53a8960b7 \ - --hash=sha256:91505d3ddebf268bb1588eb0f63821f738d20e1e7f05d3c647a5ca900288760b \ - --hash=sha256:942a5d73f739ad7c452bf739a62a0f83e2578afd6b8e5406308731f4ce78b16d \ - --hash=sha256:9454b8d8200ec99a224df8854786262b1bd6461f4280064c807303c642c05e76 \ - --hash=sha256:9459e6892f59ecea2e2584ee1058f5d8f629446eab52ba2305ae13a32a059530 \ - --hash=sha256:9776af1aad5a4b4a1317242ee2bea51da54b2a7b7b48674be736d463c999f37d \ - --hash=sha256:97dac543661e84a284502e0cf8a67b5c711b0ad5fb661d1bd505c02f8cf716d7 \ - --hash=sha256:98a3912194c079ef37e716ed228ae0dcb960992100461b704aea4e93af6b0bb9 \ - --hash=sha256:9b4a3bd174cc9cdaa1afbc4620c049038b441d6ba07629d89a83b408e54c35cd \ - --hash=sha256:9c886b481aefdf818ad44846145f6eaf373a20d200b5ce1a5c8e1bc2d8745410 \ - --hash=sha256:9ceaf423b50ecfc23ca00b7f50b64baba85fb3fb91c53e2c9d00bc86150c7e40 \ - --hash=sha256:a11a96c3b3f7551c8a8109aa65e8594e551d5a84c76bf950da33d0fb6dfafab7 \ - --hash=sha256:a3bcdde35d82ff385f4ede021df801b5c4a5bcdfb61ea87caabcebfc4945dc1b \ - --hash=sha256:a7fb111eef4d05909b82152721a59c1b14d0f365e2be4c742a473c5d7372f4f5 \ - --hash=sha256:a81e1196f0a5b4167a8dafe3a66aa67c4addac1b22dc47947abd5d5c7a3f24b5 \ - --hash=sha256:a8c9b7f16b63e65bbba889acb436a1034a82d34fa09752d754f88d708eca80e1 \ - --hash=sha256:a8ef956fce64c8551221f395ba21d0724fed6b9b6242ca4f2f7beb4ce2f41997 \ - --hash=sha256:ab339536aa798b1e17750733663d272038bf28069761d5be57cb4a9b0137b4f8 \ - --hash=sha256:ac7ba71f9561cd7d7b55e1ea5511543c0282e2b6450f122672a2694621d63b7e \ - --hash=sha256:aea53d51859b6c64e7c51d522c03cc2c48b9b5d6172126854cc7f01aa11f52bc \ - --hash=sha256:aea7c06667b987787c7d1f5e1dfcd70419b711cdb47d6b4bb4ad4b76777a0563 \ - --hash=sha256:aefe1a7cb852fa61150fcb21a8c8fcea7b58c4cb11fbe59c97a0a4b31cae3c8c \ - --hash=sha256:b0989737a3ba6cf2a16efb857fb0dfa20bc5c542737fddb6d893fde48be45433 \ - --hash=sha256:b108134b9667bcd71236c5a02aad5ddd073e372fb5d48ea74853e009fe38acb6 \ - --hash=sha256:b12cb6527599808ada9eb2cd6e0e7d3d8f13fe7bbb01c6311255a15ded4c7ab4 \ - --hash=sha256:b5aff6f3e818e6bdbbb38e5967520f174b18f539c2b9de867b1e7fde6f8d95a4 \ - --hash=sha256:b67319b4aef1a6c56576ff544b67a2a6fbd7eaee485b241cabf53115e8908b8f \ - --hash=sha256:b7c86884ad23d61b025989d99bfdd92a7351de956e01c61307cb87035960bcb1 \ - --hash=sha256:b92b69441d1bd39f4940f9eadfa417a25862242ca2c396b406f9272ef09cdcaa \ - --hash=sha256:bcb7a1096b4b6b24ce1ac24d4942ad98f983cd3810f9711bcd0293f43a9d8b9f \ - --hash=sha256:bda3ea44c39eb74e2488297bb39d47186ed01342f0022c8ff407c250ac3f498e \ - --hash=sha256:be2ba4c3c5b7900246a8f866580700ef0d538f2ca32535e991027bdaba944063 \ - --hash=sha256:c5681160758d3f6ac5b4fea370495c48aac0989d6a0f01bb9a72ad8ef5ab75c4 \ - --hash=sha256:c5d32f5284012deaccd37da1e2cd42f081feaa76981f0eaa474351b68df813c5 \ - --hash=sha256:c6364038c519dffdbe07e3cf42e6a7f8b90c275d4d1617a69bb59734c1a2d571 \ - --hash=sha256:c70e93fba207106cb16bf852e421c37bbded92acd5964390aad07cb50d60f5cf \ - --hash=sha256:ca755eebf0d9e62d6cb013f1261e510317a41bf4650f22963474a663fdfe02aa \ - --hash=sha256:cccd007d5c95279e529c146d095f1d39ac05139de26c098166c4beb9374b0f4d \ - --hash=sha256:ce31158630a6ac85bddd6b830cffd46085ff90498b397bd0a259f59d27a12188 \ - --hash=sha256:ce9c671845de9699904b1e9df95acfe8dfc183f2310f163cdaa91a3535af95de \ - --hash=sha256:d12832e1dbea4be280b22fd0ea7c9b87f0d8fc51ba06e92dc62d52f804f78ebd \ - --hash=sha256:d2ed1b3cb9ff1c10e6e8b00941bb2e5bb568b307bfc6b17dffbbe8be5eecba86 \ - --hash=sha256:d5663bc1b471c79f5c833cffbc9b87d7bf13f87e055a5c86c363ccd2348d7e82 \ - --hash=sha256:d90b729fd2732df28130c064aac9bb8aff14ba20baa4aee7bd0795ff1187545f \ - --hash=sha256:dc0af80267edc68adf85f2a5d9be1cdf062f973db6790c1d065e45025fa26140 \ - --hash=sha256:de5b4e1088523e2b6f730d0509a9a813355b7f5659d70eb4f319c76beea2e250 \ - --hash=sha256:de6f6bb8a7840c7bf216fb83eec4e2f79f7325eca8858167b68708b929ab2172 \ - --hash=sha256:df53330a3bff250f10472ce96a9af28628ff1f4efc51ccba351a8820bca2a8ba \ - --hash=sha256:e094ec83694b59d263802ed03a8384594fcce477ce484b0cbcd0008a211ca751 \ - --hash=sha256:e794f698ae4c5084414efea0f5cc9f4ac562ec02d66e1484ff822ef97c2cadff \ - --hash=sha256:e7bc6df34d42322c5289e37e9971d6ed114e3776b45fa879f734bded9d1fea9c \ - --hash=sha256:eaf24066ad0b30917186420d51e2e3edf4b0e2ea68d8cd885b14dc8afdcf6556 \ - --hash=sha256:ecf4c4b83f1ab3d5a7ace10bafcb6f11df6156857a3c418244cef41ca9fa3e44 \ - --hash=sha256:ef5a7178fcc73b7d8c07229e89f8eb45b2908a9238eb90dcfc46571ccf0383b8 \ - --hash=sha256:f5cb182f6396706dc6cc1896dd02b1c889d644c081b0cdec38747573db88a7d7 \ - --hash=sha256:fa0e294046de09acd6146be0ed6727d1f42ded4ce3ea1e9a19c11b6774eea27c \ - --hash=sha256:fb54f7c6bafaa808f27166569b1511fc42701a7713858dddc08afdde9746849e \ - --hash=sha256:fd3be6481ef54b8cfd0e1e953323b7aa9d9789b94842d0e5b142ef4bb7999539 +lxml==5.3.1 \ + --hash=sha256:016b96c58e9a4528219bb563acf1aaaa8bc5452e7651004894a973f03b84ba81 \ + --hash=sha256:05123fad495a429f123307ac6d8fd6f977b71e9a0b6d9aeeb8f80c017cb17131 \ + --hash=sha256:057e30d0012439bc54ca427a83d458752ccda725c1c161cc283db07bcad43cf9 \ + --hash=sha256:06a20d607a86fccab2fc15a77aa445f2bdef7b49ec0520a842c5c5afd8381576 \ + --hash=sha256:094b28ed8a8a072b9e9e2113a81fda668d2053f2ca9f2d202c2c8c7c2d6516b1 \ + --hash=sha256:0bcfadea3cdc68e678d2b20cb16a16716887dd00a881e16f7d806c2138b8ff0c \ + --hash=sha256:0d6b2fa86becfa81f0a0271ccb9eb127ad45fb597733a77b92e8a35e53414914 \ + --hash=sha256:0f2cfae0688fd01f7056a17367e3b84f37c545fb447d7282cf2c242b16262607 \ + --hash=sha256:106b7b5d2977b339f1e97efe2778e2ab20e99994cbb0ec5e55771ed0795920c8 \ + --hash=sha256:133f3493253a00db2c870d3740bc458ebb7d937bd0a6a4f9328373e0db305709 \ + --hash=sha256:136bf638d92848a939fd8f0e06fcf92d9f2e4b57969d94faae27c55f3d85c05b \ + --hash=sha256:155e1a5693cf4b55af652f5c0f78ef36596c7f680ff3ec6eb4d7d85367259b2c \ + --hash=sha256:1637fa31ec682cd5760092adfabe86d9b718a75d43e65e211d5931809bc111e7 \ + --hash=sha256:172d65f7c72a35a6879217bcdb4bb11bc88d55fb4879e7569f55616062d387c2 \ + --hash=sha256:17b5d7f8acf809465086d498d62a981fa6a56d2718135bb0e4aa48c502055f5c \ + --hash=sha256:198bb4b4dd888e8390afa4f170d4fa28467a7eaf857f1952589f16cfbb67af27 \ + --hash=sha256:1b6f92e35e2658a5ed51c6634ceb5ddae32053182851d8cad2a5bc102a359b33 \ + --hash=sha256:1b92fe86e04f680b848fff594a908edfa72b31bfc3499ef7433790c11d4c8cd8 \ + --hash=sha256:1bcc211542f7af6f2dfb705f5f8b74e865592778e6cafdfd19c792c244ccce19 \ + --hash=sha256:1c93ed3c998ea8472be98fb55aed65b5198740bfceaec07b2eba551e55b7b9ae \ + --hash=sha256:203b1d3eaebd34277be06a3eb880050f18a4e4d60861efba4fb946e31071a295 \ + --hash=sha256:22ec2b3c191f43ed21f9545e9df94c37c6b49a5af0a874008ddc9132d49a2d9c \ + --hash=sha256:231cf4d140b22a923b1d0a0a4e0b4f972e5893efcdec188934cc65888fd0227b \ + --hash=sha256:236610b77589faf462337b3305a1be91756c8abc5a45ff7ca8f245a71c5dab70 \ + --hash=sha256:29bfc8d3d88e56ea0a27e7c4897b642706840247f59f4377d81be8f32aa0cfbf \ + --hash=sha256:2b8969dbc8d09d9cd2ae06362c3bad27d03f433252601ef658a49bd9f2b22d79 \ + --hash=sha256:2dd0b80ac2d8f13ffc906123a6f20b459cb50a99222d0da492360512f3e50f84 \ + --hash=sha256:2df7ed5edeb6bd5590914cd61df76eb6cce9d590ed04ec7c183cf5509f73530d \ + --hash=sha256:2e4a570f6a99e96c457f7bec5ad459c9c420ee80b99eb04cbfcfe3fc18ec6423 \ + --hash=sha256:2f1be45d4c15f237209bbf123a0e05b5d630c8717c42f59f31ea9eae2ad89394 \ + --hash=sha256:2f23cf50eccb3255b6e913188291af0150d89dab44137a69e14e4dcb7be981f1 \ + --hash=sha256:3031e4c16b59424e8d78522c69b062d301d951dc55ad8685736c3335a97fc270 \ + --hash=sha256:33e06717c00c788ab4e79bc4726ecc50c54b9bfb55355eae21473c145d83c2d2 \ + --hash=sha256:364de8f57d6eda0c16dcfb999af902da31396949efa0e583e12675d09709881b \ + --hash=sha256:3715cdf0dd31b836433af9ee9197af10e3df41d273c19bb249230043667a5dfd \ + --hash=sha256:3bb8149840daf2c3f97cebf00e4ed4a65a0baff888bf2605a8d0135ff5cf764e \ + --hash=sha256:3c3c8b55c7fc7b7e8877b9366568cc73d68b82da7fe33d8b98527b73857a225f \ + --hash=sha256:3d68eeef7b4d08a25e51897dac29bcb62aba830e9ac6c4e3297ee7c6a0cf6439 \ + --hash=sha256:3dddf0fb832486cc1ea71d189cb92eb887826e8deebe128884e15020bb6e3f61 \ + --hash=sha256:3edbb9c9130bac05d8c3fe150c51c337a471cc7fdb6d2a0a7d3a88e88a829314 \ + --hash=sha256:3effe081b3135237da6e4c4530ff2a868d3f80be0bda027e118a5971285d42d0 \ + --hash=sha256:422c179022ecdedbe58b0e242607198580804253da220e9454ffe848daa1cfd2 \ + --hash=sha256:42978a68d3825eaac55399eb37a4d52012a205c0c6262199b8b44fcc6fd686e8 \ + --hash=sha256:4399b4226c4785575fb20998dc571bc48125dc92c367ce2602d0d70e0c455eb0 \ + --hash=sha256:45fbb70ccbc8683f2fb58bea89498a7274af1d9ec7995e9f4af5604e028233fc \ + --hash=sha256:4867361c049761a56bd21de507cab2c2a608c55102311d142ade7dab67b34f32 \ + --hash=sha256:48fd46bf7155def2e15287c6f2b133a2f78e2d22cdf55647269977b873c65499 \ + --hash=sha256:4b0d5cdba1b655d5b18042ac9c9ff50bda33568eb80feaaca4fc237b9c4fbfde \ + --hash=sha256:4df0ec814b50275ad6a99bc82a38b59f90e10e47714ac9871e1b223895825468 \ + --hash=sha256:4e52e1b148867b01c05e21837586ee307a01e793b94072d7c7b91d2c2da02ffe \ + --hash=sha256:514fe78fc4b87e7a7601c92492210b20a1b0c6ab20e71e81307d9c2e377c64de \ + --hash=sha256:524ccfded8989a6595dbdda80d779fb977dbc9a7bc458864fc9a0c2fc15dc877 \ + --hash=sha256:528f3a0498a8edc69af0559bdcf8a9f5a8bf7c00051a6ef3141fdcf27017bbf5 \ + --hash=sha256:52d82b0d436edd6a1d22d94a344b9a58abd6c68c357ed44f22d4ba8179b37629 \ + --hash=sha256:5412500e0dc5481b1ee9cf6b38bb3b473f6e411eb62b83dc9b62699c3b7b79f7 \ + --hash=sha256:585c4dc429deebc4307187d2b71ebe914843185ae16a4d582ee030e6cfbb4d8a \ + --hash=sha256:5865b270b420eda7b68928d70bb517ccbe045e53b1a428129bb44372bf3d7dd5 \ + --hash=sha256:5881aaa4bf3a2d086c5f20371d3a5856199a0d8ac72dd8d0dbd7a2ecfc26ab73 \ + --hash=sha256:5885bc586f1edb48e5d68e7a4b4757b5feb2a496b64f462b4d65950f5af3364f \ + --hash=sha256:5a11b16a33656ffc43c92a5343a28dc71eefe460bcc2a4923a96f292692709f6 \ + --hash=sha256:5a997b784a639e05b9d4053ef3b20c7e447ea80814a762f25b8ed5a89d261eac \ + --hash=sha256:5be8f5e4044146a69c96077c7e08f0709c13a314aa5315981185c1f00235fe65 \ + --hash=sha256:63d57fc94eb0bbb4735e45517afc21ef262991d8758a8f2f05dd6e4174944519 \ + --hash=sha256:673b9d8e780f455091200bba8534d5f4f465944cbdd61f31dc832d70e29064a5 \ + --hash=sha256:67d2f8ad9dcc3a9e826bdc7802ed541a44e124c29b7d95a679eeb58c1c14ade8 \ + --hash=sha256:67f5e80adf0aafc7b5454f2c1cb0cde920c9b1f2cbd0485f07cc1d0497c35c5d \ + --hash=sha256:68018c4c67d7e89951a91fbd371e2e34cd8cfc71f0bb43b5332db38497025d51 \ + --hash=sha256:6c4dd3bfd0c82400060896717dd261137398edb7e524527438c54a8c34f736bf \ + --hash=sha256:71f31eda4e370f46af42fc9f264fafa1b09f46ba07bdbee98f25689a04b81c20 \ + --hash=sha256:7512b4d0fc5339d5abbb14d1843f70499cab90d0b864f790e73f780f041615d7 \ + --hash=sha256:75fa3d6946d317ffc7016a6fcc44f42db6d514b7fdb8b4b28cbe058303cb6e53 \ + --hash=sha256:779e851fd0e19795ccc8a9bb4d705d6baa0ef475329fe44a13cf1e962f18ff1e \ + --hash=sha256:796520afa499732191e39fc95b56a3b07f95256f2d22b1c26e217fb69a9db5b5 \ + --hash=sha256:7aae7a3d63b935babfdc6864b31196afd5145878ddd22f5200729006366bc4d5 \ + --hash=sha256:7b82e67c5feb682dbb559c3e6b78355f234943053af61606af126df2183b9ef9 \ + --hash=sha256:7c0536bd9178f754b277a3e53f90f9c9454a3bd108b1531ffff720e082d824f2 \ + --hash=sha256:7eda194dd46e40ec745bf76795a7cccb02a6a41f445ad49d3cf66518b0bd9cff \ + --hash=sha256:82a4bb10b0beef1434fb23a09f001ab5ca87895596b4581fd53f1e5145a8934a \ + --hash=sha256:85c4f11be9cf08917ac2a5a8b6e1ef63b2f8e3799cec194417e76826e5f1de9c \ + --hash=sha256:88b72eb7222d918c967202024812c2bfb4048deeb69ca328363fb8e15254c549 \ + --hash=sha256:89934f9f791566e54c1d92cdc8f8fd0009447a5ecdb1ec6b810d5f8c4955f6be \ + --hash=sha256:8b1942b3e4ed9ed551ed3083a2e6e0772de1e5e3aca872d955e2e86385fb7ff9 \ + --hash=sha256:8ffb141361108e864ab5f1813f66e4e1164181227f9b1f105b042729b6c15125 \ + --hash=sha256:8fffc08de02071c37865a155e5ea5fce0282e1546fd5bde7f6149fcaa32558ac \ + --hash=sha256:91fb6a43d72b4f8863d21f347a9163eecbf36e76e2f51068d59cd004c506f332 \ + --hash=sha256:928e75a7200a4c09e6efc7482a1337919cc61fe1ba289f297827a5b76d8969c2 \ + --hash=sha256:96eef5b9f336f623ffc555ab47a775495e7e8846dde88de5f941e2906453a1ce \ + --hash=sha256:a0611da6b07dd3720f492db1b463a4d1175b096b49438761cc9f35f0d9eaaef5 \ + --hash=sha256:a091026c3bf7519ab1e64655a3f52a59ad4a4e019a6f830c24d6430695b1cf6a \ + --hash=sha256:a22f66270bd6d0804b02cd49dae2b33d4341015545d17f8426f2c4e22f557a23 \ + --hash=sha256:a243132767150a44e6a93cd1dde41010036e1cbc63cc3e9fe1712b277d926ce3 \ + --hash=sha256:a31fa7536ec1fb7155a0cd3a4e3d956c835ad0a43e3610ca32384d01f079ea1c \ + --hash=sha256:a364e8e944d92dcbf33b6b494d4e0fb3499dcc3bd9485beb701aa4b4201fa414 \ + --hash=sha256:a4058f16cee694577f7e4dd410263cd0ef75644b43802a689c2b3c2a7e69453b \ + --hash=sha256:a4b382e0e636ed54cd278791d93fe2c4f370772743f02bcbe431a160089025c9 \ + --hash=sha256:a83d3adea1e0ee36dac34627f78ddd7f093bb9cfc0a8e97f1572a949b695cb98 \ + --hash=sha256:a8ade0363f776f87f982572c2860cc43c65ace208db49c76df0a21dde4ddd16e \ + --hash=sha256:aa59974880ab5ad8ef3afaa26f9bda148c5f39e06b11a8ada4660ecc9fb2feb3 \ + --hash=sha256:aa826340a609d0c954ba52fd831f0fba2a4165659ab0ee1a15e4aac21f302406 \ + --hash=sha256:aaca5a812f050ab55426c32177091130b1e49329b3f002a32934cd0245571307 \ + --hash=sha256:ae82fce1d964f065c32c9517309f0c7be588772352d2f40b1574a214bd6e6098 \ + --hash=sha256:aed57b541b589fa05ac248f4cb1c46cbb432ab82cbd467d1c4f6a2bdc18aecf9 \ + --hash=sha256:afa578b6524ff85fb365f454cf61683771d0170470c48ad9d170c48075f86725 \ + --hash=sha256:b0884e3f22d87c30694e625b1e62e6f30d39782c806287450d9dc2fdf07692fd \ + --hash=sha256:b2aca14c235c7a08558fe0a4786a1a05873a01e86b474dfa8f6df49101853a4e \ + --hash=sha256:b450d7cabcd49aa7ab46a3c6aa3ac7e1593600a1a0605ba536ec0f1b99a04322 \ + --hash=sha256:b725e70d15906d24615201e650d5b0388b08a5187a55f119f25874d0103f90dd \ + --hash=sha256:bfbbab9316330cf81656fed435311386610f78b6c93cc5db4bebbce8dd146675 \ + --hash=sha256:c093c7088b40d8266f57ed71d93112bd64c6724d31f0794c1e52cc4857c28e0e \ + --hash=sha256:c2e49dc23a10a1296b04ca9db200c44d3eb32c8d8ec532e8c1fd24792276522a \ + --hash=sha256:c4393600915c308e546dc7003d74371744234e8444a28622d76fe19b98fa59d1 \ + --hash=sha256:c5ae125276f254b01daa73e2c103363d3e99e3e10505686ac7d9d2442dd4627a \ + --hash=sha256:c6aacf00d05b38a5069826e50ae72751cb5bc27bdc4d5746203988e429b385bb \ + --hash=sha256:c76722b5ed4a31ba103e0dc77ab869222ec36efe1a614e42e9bcea88a36186fe \ + --hash=sha256:c809eef167bf4a57af4b03007004896f5c60bd38dc3852fcd97a26eae3d4c9e6 \ + --hash=sha256:c92ea6d9dd84a750b2bae72ff5e8cf5fdd13e58dda79c33e057862c29a8d5b50 \ + --hash=sha256:cb659702a45136c743bc130760c6f137870d4df3a9e14386478b8a0511abcfca \ + --hash=sha256:ce0930a963ff593e8bb6fda49a503911accc67dee7e5445eec972668e672a0f0 \ + --hash=sha256:d0751528b97d2b19a388b302be2a0ee05817097bab46ff0ed76feeec24951f78 \ + --hash=sha256:d184f85ad2bb1f261eac55cddfcf62a70dee89982c978e92b9a74a1bfef2e367 \ + --hash=sha256:d2a3e412ce1849be34b45922bfef03df32d1410a06d1cdeb793a343c2f1fd666 \ + --hash=sha256:d61ec60945d694df806a9aec88e8f29a27293c6e424f8ff91c80416e3c617645 \ + --hash=sha256:db0c742aad702fd5d0c6611a73f9602f20aec2007c102630c06d7633d9c8f09a \ + --hash=sha256:db4743e30d6f5f92b6d2b7c86b3ad250e0bad8dee4b7ad8a0c44bfb276af89a3 \ + --hash=sha256:dbf7bebc2275016cddf3c997bf8a0f7044160714c64a9b83975670a04e6d2252 \ + --hash=sha256:de1fc314c3ad6bc2f6bd5b5a5b9357b8c6896333d27fdbb7049aea8bd5af2d79 \ + --hash=sha256:df7e5edac4778127f2bf452e0721a58a1cfa4d1d9eac63bdd650535eb8543615 \ + --hash=sha256:e220f7b3e8656ab063d2eb0cd536fafef396829cafe04cb314e734f87649058f \ + --hash=sha256:e3c623923967f3e5961d272718655946e5322b8d058e094764180cdee7bab1af \ + --hash=sha256:e69add9b6b7b08c60d7ff0152c7c9a6c45b4a71a919be5abde6f98f1ea16421c \ + --hash=sha256:e8e0d177b1fe251c3b1b914ab64135475c5273c8cfd2857964b2e3bb0fe196a7 \ + --hash=sha256:ef45f31aec9be01379fc6c10f1d9c677f032f2bac9383c827d44f620e8a88407 \ + --hash=sha256:f1208c1c67ec9e151d78aa3435aa9b08a488b53d9cfac9b699f15255a3461ef2 \ + --hash=sha256:f12582b8d3b4c6be1d298c49cb7ae64a3a73efaf4c2ab4e37db182e3545815ac \ + --hash=sha256:f1de541a9893cf8a1b1db9bf0bf670a2decab42e3e82233d36a74eda7822b4c9 \ + --hash=sha256:f4eac0584cdc3285ef2e74eee1513a6001681fd9753b259e8159421ed28a72e5 \ + --hash=sha256:f7b64fcd670bca8800bc10ced36620c6bbb321e7bc1214b9c0c0df269c1dddc2 \ + --hash=sha256:fb7c61d4be18e930f75948705e9718618862e6fc2ed0d7159b2262be73f167a2 # via doxmlparser markupsafe==3.0.2 \ --hash=sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4 \ @@ -364,22 +376,21 @@ markupsafe==3.0.2 \ --hash=sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430 \ --hash=sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50 # via jinja2 -packaging==25.0 \ - --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \ - --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f +packaging==24.2 \ + --hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \ + --hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f # via # pytest # sphinx -pluggy==1.6.0 \ - --hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \ - --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 +pluggy==1.5.0 \ + --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ + --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 # via pytest pygments==2.19.1 \ --hash=sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f \ --hash=sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c # via # -r requirements.in - # pytest # sphinx # sphinx-tabs pykwalify==1.8.0 \ @@ -390,9 +401,9 @@ pyserial==3.5 \ --hash=sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb \ --hash=sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0 # via -r requirements.in -pytest==8.4.1 \ - --hash=sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7 \ - --hash=sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c +pytest==8.3.5 \ + --hash=sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820 \ + --hash=sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845 # via -r requirements.in python-dateutil==2.9.0.post0 \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ @@ -453,19 +464,19 @@ pyyaml==6.0.2 \ --hash=sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12 \ --hash=sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4 # via -r requirements.in -requests==2.32.4 \ - --hash=sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c \ - --hash=sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422 +requests==2.32.3 \ + --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ + --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 # via sphinx -roman-numerals-py==3.1.0 \ +roman-numerals-py==3.1.0 ; python_full_version >= '3.11' \ --hash=sha256:9da2ad2fb670bcf24e81070ceb3be72f6c11c440d73bd579fbeca1e9f330954c \ --hash=sha256:be4bf804f083a4ce001b5eb7e3c0862479d10f94c936f6c4e5f250aa5ff5bd2d # via sphinx -ruamel-yaml==0.18.14 \ - --hash=sha256:710ff198bb53da66718c7db27eec4fbcc9aa6ca7204e4c1df2f282b6fe5eb6b2 \ - --hash=sha256:7227b76aaec364df15936730efbf7d72b30c0b79b1d578bbb8e3dcb2d81f52b7 +ruamel-yaml==0.18.10 \ + --hash=sha256:20c86ab29ac2153f80a428e1254a8adf686d3383df04490514ca3b79a362db58 \ + --hash=sha256:30f22513ab2301b3d2b577adc121c6471f28734d3d9728581245f1e76468b4f1 # via pykwalify -ruamel-yaml-clib==0.2.12 ; python_full_version < '3.14' and platform_python_implementation == 'CPython' \ +ruamel-yaml-clib==0.2.12 ; python_full_version < '3.13' and platform_python_implementation == 'CPython' \ --hash=sha256:040ae85536960525ea62868b642bdb0c2cc6021c9f9d507810c0c604e66f5a7b \ --hash=sha256:0467c5965282c62203273b838ae77c0d29d7638c8a4e3a1c8bdd3602c10904e4 \ --hash=sha256:0b7e75b4965e1d4690e93021adfcecccbca7d61c7bddd8e22406ef2ff20d74ef \ @@ -513,25 +524,40 @@ ruamel-yaml-clib==0.2.12 ; python_full_version < '3.14' and platform_python_impl --hash=sha256:fc4b630cd3fa2cf7fce38afa91d7cfe844a9f75d7f0f36393fa98815e911d987 \ --hash=sha256:fd5415dded15c3822597455bc02bcd66e81ef8b7a48cb71a33628fc9fdde39df # via ruamel-yaml -setuptools==80.9.0 \ - --hash=sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922 \ - --hash=sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c +setuptools==78.1.0 \ + --hash=sha256:18fd474d4a82a5f83dac888df697af65afa82dec7323d09c3e37d1f14288da54 \ + --hash=sha256:3e386e96793c8702ae83d17b853fb93d3e09ef82ec62722e61da5cd22376dcd8 # via sphinx-togglebutton six==1.17.0 \ --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \ --hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81 # via + # anytree # doxmlparser # python-dateutil sniffio==1.3.1 \ --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc # via anyio -snowballstemmer==3.0.1 \ - --hash=sha256:6cd7b3897da8d6c9ffb968a6781fa6532dce9c3618a4b127d920dab764a19064 \ - --hash=sha256:6d5eeeec8e9f84d4d56b847692bacf79bc2c8e90c7f80ca4444ff8b6f2e52895 +snowballstemmer==2.2.0 \ + --hash=sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1 \ + --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a # via sphinx -sphinx==8.2.3 \ +sphinx==8.1.3 ; python_full_version < '3.11' \ + --hash=sha256:09719015511837b76bf6e03e42eb7595ac8c2e41eeb9c29c5b755c6b677992a2 \ + --hash=sha256:43c1911eecb0d3e161ad78611bc905d1ad0e523e4ddc202a58a821773dc4c927 + # via + # -r requirements.in + # sphinx-autobuild + # sphinx-copybutton + # sphinx-notfound-page + # sphinx-rtd-theme + # sphinx-sitemap + # sphinx-tabs + # sphinx-togglebutton + # sphinxcontrib-jquery + # sphinxcontrib-svg2pdfconverter +sphinx==8.2.3 ; python_full_version >= '3.11' \ --hash=sha256:398ad29dee7f63a75888314e9424d40f52ce5a6a87ae88e7071e80af296ec348 \ --hash=sha256:4405915165f13521d875a8c29c8970800a0141c14cc5416a38feca4ea5d9b9c3 # via @@ -605,129 +631,132 @@ sphinxcontrib-svg2pdfconverter==1.3.0 \ --hash=sha256:5df6b0895e2e2101d720bfd08841bb56d74c57b1f86229a7c18b771dfdf4ffbb \ --hash=sha256:6411a4cc2f57eed96a0d7bbfa139f68cbe7983018881e1e6d7c46053cd69911f # via -r requirements.in -starlette==0.47.0 \ - --hash=sha256:1f64887e94a447fed5f23309fb6890ef23349b7e478faa7b24a851cd4eb844af \ - --hash=sha256:9d052d4933683af40ffd47c7465433570b4949dc937e20ad1d73b34e72f10c37 +starlette==0.46.1 \ + --hash=sha256:3c88d58ee4bd1bb807c0d1acb381838afc7752f9ddaec81bbe4383611d833230 \ + --hash=sha256:77c74ed9d2720138b25875133f3a2dae6d854af2ec37dceb56aef370c1d8a227 # via sphinx-autobuild -typing-extensions==4.14.0 ; python_full_version < '3.13' \ - --hash=sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4 \ - --hash=sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af - # via anyio -urllib3==2.5.0 \ - --hash=sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760 \ - --hash=sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc +tomli==2.2.1 ; python_full_version < '3.11' \ + --hash=sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6 \ + --hash=sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd \ + --hash=sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c \ + --hash=sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b \ + --hash=sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8 \ + --hash=sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6 \ + --hash=sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77 \ + --hash=sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff \ + --hash=sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea \ + --hash=sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192 \ + --hash=sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249 \ + --hash=sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee \ + --hash=sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4 \ + --hash=sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98 \ + --hash=sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8 \ + --hash=sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4 \ + --hash=sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281 \ + --hash=sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744 \ + --hash=sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69 \ + --hash=sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13 \ + --hash=sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140 \ + --hash=sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e \ + --hash=sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e \ + --hash=sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc \ + --hash=sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff \ + --hash=sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec \ + --hash=sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2 \ + --hash=sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222 \ + --hash=sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106 \ + --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ + --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ + --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 + # via + # pytest + # sphinx +typing-extensions==4.13.0 ; python_full_version < '3.13' \ + --hash=sha256:0a4ac55a5820789d87e297727d229866c9650f6521b64206413c4fbada24d95b \ + --hash=sha256:c8dd92cc0d6425a97c18fbb9d1954e5ff92c1ca881a309c45f06ebc0b79058e5 + # via + # anyio + # uvicorn +urllib3==2.3.0 \ + --hash=sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df \ + --hash=sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d # via requests -uvicorn==0.34.3 \ - --hash=sha256:16246631db62bdfbf069b0645177d6e8a77ba950cfedbfd093acef9444e4d885 \ - --hash=sha256:35919a9a979d7a59334b6b10e05d77c1d0d574c50e0fc98b8b1a0f165708b55a +uvicorn==0.34.0 \ + --hash=sha256:023dc038422502fa28a09c7a30bf2b6991512da7dcdb8fd35fe57cfc154126f4 \ + --hash=sha256:404051050cd7e905de2c9a7e61790943440b3416f49cb409f965d9dcd0fa73e9 # via sphinx-autobuild -watchfiles==1.1.0 \ - --hash=sha256:00645eb79a3faa70d9cb15c8d4187bb72970b2470e938670240c7998dad9f13a \ - --hash=sha256:04e4ed5d1cd3eae68c89bcc1a485a109f39f2fd8de05f705e98af6b5f1861f1f \ - --hash=sha256:0a7d40b77f07be87c6faa93d0951a0fcd8cbca1ddff60a1b65d741bac6f3a9f6 \ - --hash=sha256:0ece16b563b17ab26eaa2d52230c9a7ae46cf01759621f4fbbca280e438267b3 \ - --hash=sha256:11ee4444250fcbeb47459a877e5e80ed994ce8e8d20283857fc128be1715dac7 \ - --hash=sha256:12b0a02a91762c08f7264e2e79542f76870c3040bbc847fb67410ab81474932a \ - --hash=sha256:12fe8eaffaf0faa7906895b4f8bb88264035b3f0243275e0bf24af0436b27259 \ - --hash=sha256:130fc497b8ee68dce163e4254d9b0356411d1490e868bd8790028bc46c5cc297 \ - --hash=sha256:17ab167cca6339c2b830b744eaf10803d2a5b6683be4d79d8475d88b4a8a4be1 \ - --hash=sha256:199207b2d3eeaeb80ef4411875a6243d9ad8bc35b07fc42daa6b801cc39cc41c \ - --hash=sha256:20ecc8abbd957046f1fe9562757903f5eaf57c3bce70929fda6c7711bb58074a \ - --hash=sha256:239736577e848678e13b201bba14e89718f5c2133dfd6b1f7846fa1b58a8532b \ - --hash=sha256:249590eb75ccc117f488e2fabd1bfa33c580e24b96f00658ad88e38844a040bb \ - --hash=sha256:27f30e14aa1c1e91cb653f03a63445739919aef84c8d2517997a83155e7a2fcc \ - --hash=sha256:29e7bc2eee15cbb339c68445959108803dc14ee0c7b4eea556400131a8de462b \ - --hash=sha256:328dbc9bff7205c215a7807da7c18dce37da7da718e798356212d22696404339 \ - --hash=sha256:32d6d4e583593cb8576e129879ea0991660b935177c0f93c6681359b3654bfa9 \ - --hash=sha256:3366f56c272232860ab45c77c3ca7b74ee819c8e1f6f35a7125556b198bbc6df \ - --hash=sha256:3434e401f3ce0ed6b42569128b3d1e3af773d7ec18751b918b89cd49c14eaafb \ - --hash=sha256:37d3d3f7defb13f62ece99e9be912afe9dd8a0077b7c45ee5a57c74811d581a4 \ - --hash=sha256:3a6fd40bbb50d24976eb275ccb55cd1951dfb63dbc27cae3066a6ca5f4beabd5 \ - --hash=sha256:3aba215958d88182e8d2acba0fdaf687745180974946609119953c0e112397dc \ - --hash=sha256:406520216186b99374cdb58bc48e34bb74535adec160c8459894884c983a149c \ - --hash=sha256:4281cd9fce9fc0a9dbf0fc1217f39bf9cf2b4d315d9626ef1d4e87b84699e7e8 \ - --hash=sha256:42f92befc848bb7a19658f21f3e7bae80d7d005d13891c62c2cd4d4d0abb3433 \ - --hash=sha256:48aa25e5992b61debc908a61ab4d3f216b64f44fdaa71eb082d8b2de846b7d12 \ - --hash=sha256:5007f860c7f1f8df471e4e04aaa8c43673429047d63205d1630880f7637bca30 \ - --hash=sha256:50a51a90610d0845a5931a780d8e51d7bd7f309ebc25132ba975aca016b576a0 \ - --hash=sha256:51556d5004887045dba3acdd1fdf61dddea2be0a7e18048b5e853dcd37149b86 \ - --hash=sha256:51b81e55d40c4b4aa8658427a3ee7ea847c591ae9e8b81ef94a90b668999353c \ - --hash=sha256:5366164391873ed76bfdf618818c82084c9db7fac82b64a20c44d335eec9ced5 \ - --hash=sha256:54062ef956807ba806559b3c3d52105ae1827a0d4ab47b621b31132b6b7e2866 \ - --hash=sha256:60022527e71d1d1fda67a33150ee42869042bce3d0fcc9cc49be009a9cded3fb \ - --hash=sha256:622d6b2c06be19f6e89b1d951485a232e3b59618def88dbeda575ed8f0d8dbf2 \ - --hash=sha256:62cc7a30eeb0e20ecc5f4bd113cd69dcdb745a07c68c0370cea919f373f65d9e \ - --hash=sha256:693ed7ec72cbfcee399e92c895362b6e66d63dac6b91e2c11ae03d10d503e575 \ - --hash=sha256:6d2404af8db1329f9a3c9b79ff63e0ae7131986446901582067d9304ae8aaf7f \ - --hash=sha256:7049e52167fc75fc3cc418fc13d39a8e520cbb60ca08b47f6cedb85e181d2f2a \ - --hash=sha256:7080c4bb3efd70a07b1cc2df99a7aa51d98685be56be6038c3169199d0a1c69f \ - --hash=sha256:7738027989881e70e3723c75921f1efa45225084228788fc59ea8c6d732eb30d \ - --hash=sha256:7a7bd57a1bb02f9d5c398c0c1675384e7ab1dd39da0ca50b7f09af45fa435277 \ - --hash=sha256:7b3443f4ec3ba5aa00b0e9fa90cf31d98321cbff8b925a7c7b84161619870bc9 \ - --hash=sha256:7c55b0f9f68590115c25272b06e63f0824f03d4fc7d6deed43d8ad5660cabdbf \ - --hash=sha256:7fd1b3879a578a8ec2076c7961076df540b9af317123f84569f5a9ddee64ce92 \ - --hash=sha256:8076a5769d6bdf5f673a19d51da05fc79e2bbf25e9fe755c47595785c06a8c72 \ - --hash=sha256:80f811146831c8c86ab17b640801c25dc0a88c630e855e2bef3568f30434d52b \ - --hash=sha256:8412eacef34cae2836d891836a7fff7b754d6bcac61f6c12ba5ca9bc7e427b68 \ - --hash=sha256:865c8e95713744cf5ae261f3067861e9da5f1370ba91fc536431e29b418676fa \ - --hash=sha256:86b1e28d4c37e89220e924305cd9f82866bb0ace666943a6e4196c5df4d58dcc \ - --hash=sha256:891c69e027748b4a73847335d208e374ce54ca3c335907d381fde4e41661b13b \ - --hash=sha256:8ac164e20d17cc285f2b94dc31c384bc3aa3dd5e7490473b3db043dd70fbccfd \ - --hash=sha256:8c5701dc474b041e2934a26d31d39f90fac8a3dee2322b39f7729867f932b1d4 \ - --hash=sha256:90ebb429e933645f3da534c89b29b665e285048973b4d2b6946526888c3eb2c7 \ - --hash=sha256:923fec6e5461c42bd7e3fd5ec37492c6f3468be0499bc0707b4bbbc16ac21792 \ - --hash=sha256:935f9edd022ec13e447e5723a7d14456c8af254544cefbc533f6dd276c9aa0d9 \ - --hash=sha256:95ab1594377effac17110e1352989bdd7bdfca9ff0e5eeccd8c69c5389b826d0 \ - --hash=sha256:9974d2f7dc561cce3bb88dfa8eb309dab64c729de85fba32e98d75cf24b66297 \ - --hash=sha256:9c733cda03b6d636b4219625a4acb5c6ffb10803338e437fb614fef9516825ef \ - --hash=sha256:9dc001c3e10de4725c749d4c2f2bdc6ae24de5a88a339c4bce32300a31ede179 \ - --hash=sha256:9f811079d2f9795b5d48b55a37aa7773680a5659afe34b54cc1d86590a51507d \ - --hash=sha256:a2726d7bfd9f76158c84c10a409b77a320426540df8c35be172444394b17f7ea \ - --hash=sha256:a479466da6db5c1e8754caee6c262cd373e6e6c363172d74394f4bff3d84d7b5 \ - --hash=sha256:a543492513a93b001975ae283a51f4b67973662a375a403ae82f420d2c7205ee \ - --hash=sha256:a89c75a5b9bc329131115a409d0acc16e8da8dfd5867ba59f1dd66ae7ea8fa82 \ - --hash=sha256:a8f6f72974a19efead54195bc9bed4d850fc047bb7aa971268fd9a8387c89011 \ - --hash=sha256:a9ccbf1f129480ed3044f540c0fdbc4ee556f7175e5ab40fe077ff6baf286d4e \ - --hash=sha256:aa0cc8365ab29487eb4f9979fd41b22549853389e22d5de3f134a6796e1b05a4 \ - --hash=sha256:adb4167043d3a78280d5d05ce0ba22055c266cf8655ce942f2fb881262ff3cdf \ - --hash=sha256:af06c863f152005c7592df1d6a7009c836a247c9d8adb78fef8575a5a98699db \ - --hash=sha256:b067915e3c3936966a8607f6fe5487df0c9c4afb85226613b520890049deea20 \ - --hash=sha256:b7c5f6fe273291f4d414d55b2c80d33c457b8a42677ad14b4b47ff025d0893e4 \ - --hash=sha256:b915daeb2d8c1f5cee4b970f2e2c988ce6514aace3c9296e58dd64dc9aa5d575 \ - --hash=sha256:ba0e3255b0396cac3cc7bbace76404dd72b5438bf0d8e7cefa2f79a7f3649caa \ - --hash=sha256:bda8136e6a80bdea23e5e74e09df0362744d24ffb8cd59c4a95a6ce3d142f79c \ - --hash=sha256:bfe3c517c283e484843cb2e357dd57ba009cff351edf45fb455b5fbd1f45b15f \ - --hash=sha256:c588c45da9b08ab3da81d08d7987dae6d2a3badd63acdb3e206a42dbfa7cb76f \ - --hash=sha256:c600e85f2ffd9f1035222b1a312aff85fd11ea39baff1d705b9b047aad2ce267 \ - --hash=sha256:c68e9f1fcb4d43798ad8814c4c1b61547b014b667216cb754e606bfade587018 \ - --hash=sha256:c9649dfc57cc1f9835551deb17689e8d44666315f2e82d337b9f07bd76ae3aa2 \ - --hash=sha256:cb45350fd1dc75cd68d3d72c47f5b513cb0578da716df5fba02fff31c69d5f2d \ - --hash=sha256:cbcf8630ef4afb05dc30107bfa17f16c0896bb30ee48fc24bf64c1f970f3b1fd \ - --hash=sha256:cbd949bdd87567b0ad183d7676feb98136cde5bb9025403794a4c0db28ed3a47 \ - --hash=sha256:cc08ef8b90d78bfac66f0def80240b0197008e4852c9f285907377b2947ffdcb \ - --hash=sha256:cd17a1e489f02ce9117b0de3c0b1fab1c3e2eedc82311b299ee6b6faf6c23a29 \ - --hash=sha256:d05686b5487cfa2e2c28ff1aa370ea3e6c5accfe6435944ddea1e10d93872147 \ - --hash=sha256:d0e10e6f8f6dc5762adee7dece33b722282e1f59aa6a55da5d493a97282fedd8 \ - --hash=sha256:d181ef50923c29cf0450c3cd47e2f0557b62218c50b2ab8ce2ecaa02bd97e670 \ - --hash=sha256:d1caf40c1c657b27858f9774d5c0e232089bca9cb8ee17ce7478c6e9264d2587 \ - --hash=sha256:d7642b9bc4827b5518ebdb3b82698ada8c14c7661ddec5fe719f3e56ccd13c97 \ - --hash=sha256:d9481174d3ed982e269c090f780122fb59cee6c3796f74efe74e70f7780ed94c \ - --hash=sha256:d9ba68ec283153dead62cbe81872d28e053745f12335d037de9cbd14bd1877f5 \ - --hash=sha256:da71945c9ace018d8634822f16cbc2a78323ef6c876b1d34bbf5d5222fd6a72e \ - --hash=sha256:dc44678a72ac0910bac46fa6a0de6af9ba1355669b3dfaf1ce5f05ca7a74364e \ - --hash=sha256:df32d59cb9780f66d165a9a7a26f19df2c7d24e3bd58713108b41d0ff4f929c6 \ - --hash=sha256:df670918eb7dd719642e05979fc84704af913d563fd17ed636f7c4783003fdcc \ - --hash=sha256:e78b6ed8165996013165eeabd875c5dfc19d41b54f94b40e9fff0eb3193e5e8e \ - --hash=sha256:ed8fc66786de8d0376f9f913c09e963c66e90ced9aa11997f93bdb30f7c872a8 \ - --hash=sha256:eff4b8d89f444f7e49136dc695599a591ff769300734446c0a86cba2eb2f9895 \ - --hash=sha256:f21af781a4a6fbad54f03c598ab620e3a77032c5878f3d780448421a6e1818c7 \ - --hash=sha256:f2bcdc54ea267fe72bfc7d83c041e4eb58d7d8dc6f578dfddb52f037ce62f432 \ - --hash=sha256:f2f0498b7d2a3c072766dba3274fe22a183dbea1f99d188f1c6c72209a1063dc \ - --hash=sha256:f7208ab6e009c627b7557ce55c465c98967e8caa8b11833531fdf95799372633 \ - --hash=sha256:f7590d5a455321e53857892ab8879dce62d1f4b04748769f5adf2e707afb9d4f \ - --hash=sha256:fa257a4d0d21fcbca5b5fcba9dca5a78011cb93c0323fb8855c6d2dfbc76eb77 \ - --hash=sha256:fba9b62da882c1be1280a7584ec4515d0a6006a94d6e5819730ec2eab60ffe12 \ - --hash=sha256:fe4371595edf78c41ef8ac8df20df3943e13defd0efcb732b2e393b5a8a7a71f +watchfiles==1.0.4 \ + --hash=sha256:02a526ee5b5a09e8168314c905fc545c9bc46509896ed282aeb5a8ba9bd6ca27 \ + --hash=sha256:05d341c71f3d7098920f8551d4df47f7b57ac5b8dad56558064c3431bdfc0b74 \ + --hash=sha256:076f293100db3b0b634514aa0d294b941daa85fc777f9c698adb1009e5aca0b1 \ + --hash=sha256:0799ae68dfa95136dde7c472525700bd48777875a4abb2ee454e3ab18e9fc712 \ + --hash=sha256:0986902677a1a5e6212d0c49b319aad9cc48da4bd967f86a11bde96ad9676ca1 \ + --hash=sha256:0bc80d91ddaf95f70258cf78c471246846c1986bcc5fd33ccc4a1a67fcb40f9a \ + --hash=sha256:13c2ce7b72026cfbca120d652f02c7750f33b4c9395d79c9790b27f014c8a5a2 \ + --hash=sha256:1941b4e39de9b38b868a69b911df5e89dc43767feeda667b40ae032522b9b5f1 \ + --hash=sha256:1eacd91daeb5158c598fe22d7ce66d60878b6294a86477a4715154990394c9b3 \ + --hash=sha256:229e6ec880eca20e0ba2f7e2249c85bae1999d330161f45c78d160832e026ee2 \ + --hash=sha256:22bb55a7c9e564e763ea06c7acea24fc5d2ee5dfc5dafc5cfbedfe58505e9f90 \ + --hash=sha256:278aaa395f405972e9f523bd786ed59dfb61e4b827856be46a42130605fd0899 \ + --hash=sha256:2a9f93f8439639dc244c4d2902abe35b0279102bca7bbcf119af964f51d53c19 \ + --hash=sha256:308ac265c56f936636e3b0e3f59e059a40003c655228c131e1ad439957592303 \ + --hash=sha256:31f1a379c9dcbb3f09cf6be1b7e83b67c0e9faabed0471556d9438a4a4e14202 \ + --hash=sha256:32b026a6ab64245b584acf4931fe21842374da82372d5c039cba6bf99ef722f3 \ + --hash=sha256:342622287b5604ddf0ed2d085f3a589099c9ae8b7331df3ae9845571586c4f3d \ + --hash=sha256:39f4914548b818540ef21fd22447a63e7be6e24b43a70f7642d21f1e73371590 \ + --hash=sha256:3f68d8e9d5a321163ddacebe97091000955a1b74cd43724e346056030b0bacee \ + --hash=sha256:43b168bba889886b62edb0397cab5b6490ffb656ee2fcb22dec8bfeb371a9e12 \ + --hash=sha256:47eb32ef8c729dbc4f4273baece89398a4d4b5d21a1493efea77a17059f4df8a \ + --hash=sha256:4810ea2ae622add560f4aa50c92fef975e475f7ac4900ce5ff5547b2434642d8 \ + --hash=sha256:4e997802d78cdb02623b5941830ab06f8860038faf344f0d288d325cc9c5d2ff \ + --hash=sha256:4ebbeca9360c830766b9f0df3640b791be569d988f4be6c06d6fae41f187f105 \ + --hash=sha256:4f8c4998506241dedf59613082d1c18b836e26ef2a4caecad0ec41e2a15e4226 \ + --hash=sha256:55ccfd27c497b228581e2838d4386301227fc0cb47f5a12923ec2fe4f97b95af \ + --hash=sha256:5717021b199e8353782dce03bd8a8f64438832b84e2885c4a645f9723bf656d9 \ + --hash=sha256:5c11ea22304d17d4385067588123658e9f23159225a27b983f343fcffc3e796a \ + --hash=sha256:5e0227b8ed9074c6172cf55d85b5670199c99ab11fd27d2c473aa30aec67ee42 \ + --hash=sha256:62c9953cf85529c05b24705639ffa390f78c26449e15ec34d5339e8108c7c407 \ + --hash=sha256:6ba473efd11062d73e4f00c2b730255f9c1bdd73cd5f9fe5b5da8dbd4a717205 \ + --hash=sha256:740d103cd01458f22462dedeb5a3382b7f2c57d07ff033fbc9465919e5e1d0f3 \ + --hash=sha256:74cb3ca19a740be4caa18f238298b9d472c850f7b2ed89f396c00a4c97e2d9ff \ + --hash=sha256:7b75fee5a16826cf5c46fe1c63116e4a156924d668c38b013e6276f2582230f0 \ + --hash=sha256:7cf684aa9bba4cd95ecb62c822a56de54e3ae0598c1a7f2065d51e24637a3c5d \ + --hash=sha256:8012bd820c380c3d3db8435e8cf7592260257b378b649154a7948a663b5f84e9 \ + --hash=sha256:857f5fc3aa027ff5e57047da93f96e908a35fe602d24f5e5d8ce64bf1f2fc733 \ + --hash=sha256:8b1f135238e75d075359cf506b27bf3f4ca12029c47d3e769d8593a2024ce161 \ + --hash=sha256:8d0d0630930f5cd5af929040e0778cf676a46775753e442a3f60511f2409f48f \ + --hash=sha256:90192cdc15ab7254caa7765a98132a5a41471cf739513cc9bcf7d2ffcc0ec7b2 \ + --hash=sha256:95b42cac65beae3a362629950c444077d1b44f1790ea2772beaea95451c086bb \ + --hash=sha256:9745a4210b59e218ce64c91deb599ae8775c8a9da4e95fb2ee6fe745fc87d01a \ + --hash=sha256:9d1ef56b56ed7e8f312c934436dea93bfa3e7368adfcf3df4c0da6d4de959a1e \ + --hash=sha256:9eea33ad8c418847dd296e61eb683cae1c63329b6d854aefcd412e12d94ee235 \ + --hash=sha256:9f25d0ba0fe2b6d2c921cf587b2bf4c451860086534f40c384329fb96e2044d1 \ + --hash=sha256:9fe37a2de80aa785d340f2980276b17ef697ab8db6019b07ee4fd28a8359d2f3 \ + --hash=sha256:a38320582736922be8c865d46520c043bff350956dfc9fbaee3b2df4e1740a4b \ + --hash=sha256:a462490e75e466edbb9fc4cd679b62187153b3ba804868452ef0577ec958f5ff \ + --hash=sha256:a5ae5706058b27c74bac987d615105da17724172d5aaacc6c362a40599b6de43 \ + --hash=sha256:aa216f87594f951c17511efe5912808dfcc4befa464ab17c98d387830ce07b60 \ + --hash=sha256:ab0311bb2ffcd9f74b6c9de2dda1612c13c84b996d032cd74799adb656af4e8b \ + --hash=sha256:ab594e75644421ae0a2484554832ca5895f8cab5ab62de30a1a57db460ce06c6 \ + --hash=sha256:aee397456a29b492c20fda2d8961e1ffb266223625346ace14e4b6d861ba9c80 \ + --hash=sha256:b045c800d55bc7e2cadd47f45a97c7b29f70f08a7c2fa13241905010a5493f94 \ + --hash=sha256:b77d5622ac5cc91d21ae9c2b284b5d5c51085a0bdb7b518dba263d0af006132c \ + --hash=sha256:ba5bb3073d9db37c64520681dd2650f8bd40902d991e7b4cfaeece3e32561d08 \ + --hash=sha256:bdef5a1be32d0b07dcea3318a0be95d42c98ece24177820226b56276e06b63b0 \ + --hash=sha256:c2acfa49dd0ad0bf2a9c0bb9a985af02e89345a7189be1efc6baa085e0f72d7c \ + --hash=sha256:c7cce76c138a91e720d1df54014a047e680b652336e1b73b8e3ff3158e05061e \ + --hash=sha256:cc27a65069bcabac4552f34fd2dce923ce3fcde0721a16e4fb1b466d63ec831f \ + --hash=sha256:cdbd912a61543a36aef85e34f212e5d2486e7c53ebfdb70d1e0b060cc50dd0bf \ + --hash=sha256:cdcc92daeae268de1acf5b7befcd6cfffd9a047098199056c72e4623f531de18 \ + --hash=sha256:d3452c1ec703aa1c61e15dfe9d482543e4145e7c45a6b8566978fbb044265a21 \ + --hash=sha256:d6097538b0ae5c1b88c3b55afa245a66793a8fec7ada6755322e465fb1a0e8cc \ + --hash=sha256:d8d3d9203705b5797f0af7e7e5baa17c8588030aaadb7f6a86107b7247303817 \ + --hash=sha256:e0611d244ce94d83f5b9aff441ad196c6e21b55f77f3c47608dcf651efe54c4a \ + --hash=sha256:f12969a3765909cf5dc1e50b2436eb2c0e676a3c75773ab8cc3aa6175c16e902 \ + --hash=sha256:f44a39aee3cbb9b825285ff979ab887a25c5d336e5ec3574f1506a4671556a8d \ + --hash=sha256:f9ce064e81fe79faa925ff03b9f4c1a98b0bbb4a1b8c1b015afa93030cb21a49 \ + --hash=sha256:fb2c46e275fbb9f0c92e7654b231543c7bbfa1df07cdc4b99fa73bedfde5c844 \ + --hash=sha256:fc2eb5d14a8e0d5df7b36288979176fbb39672d45184fc4b1c004d7c3ce29317 # via sphinx-autobuild websockets==15.0.1 \ --hash=sha256:0701bc3cfcb9164d04a14b149fd74be7347a530ad3bbf15ab2c678a2cd3dd9a2 \ diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index c32a40fd35c..f1da73f3ec0 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -2008,7 +2008,7 @@ class PythonCompatCheck(ComplianceTest): name = "PythonCompat" doc = "Check that Python files are compatible with Zephyr minimum supported Python version." - MAX_VERSION = (3, 12) + MAX_VERSION = (3, 10) MAX_VERSION_STR = f"{MAX_VERSION[0]}.{MAX_VERSION[1]}" def run(self): diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 5dc02845288..621d8dbc4ae 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --universal --python-version 3.12 --generate-hashes requirements-actions.in --output-file requirements-actions.txt +# uv pip compile --universal --python-version 3.10 --generate-hashes requirements-actions.in anytree==2.13.0 \ --hash=sha256:4cbcf10df36b1f1cba131b7e487ff3edafc9d6e932a3c70071b5b768bab901ff \ --hash=sha256:c9d3aa6825fdd06af7ebb05b4ef291d2db63e62bb1f9b7d9b71354be9d362714 @@ -12,9 +12,9 @@ astroid==3.3.10 \ --hash=sha256:104fb9cb9b27ea95e847a94c003be03a9e039334a8ebca5ee27dafaf5c5711eb \ --hash=sha256:c332157953060c6deb9caa57303ae0d20b0fbdb2e59b4a4f2a6ba49d0a7961ce # via pylint -awscli==1.40.38 \ - --hash=sha256:3f90f2815e3b72691785d2bbd4f2c3dcbde311c55e1f5633a37cc3e514ba6fdb \ - --hash=sha256:ec9b69ff4600ef151df3336f0e7af4cf30280d27f9d8e67e09c4b386ceb1f154 +awscli==1.40.36 \ + --hash=sha256:4a548d855cafad153e661defab601363ba8a5644873bf9f8dec31d5c0ebbb351 \ + --hash=sha256:960d92bf8b2f7efd142112f277eed7cc82d8af85fceefe4d321a620352b75ebd # via -r requirements-actions.in beartype==0.21.0 \ --hash=sha256:b6a1bd56c72f31b0a496a36cc55df6e2f475db166ad07fa4acc7e74f4c7f34c0 \ @@ -24,9 +24,9 @@ boolean-py==5.0 \ --hash=sha256:60cbc4bad079753721d32649545505362c754e121570ada4658b852a3a318d95 \ --hash=sha256:ef28a70bd43115208441b53a045d1549e2f0ec6e3d08a9d142cbc41c1938e8d9 # via license-expression -botocore==1.38.39 \ - --hash=sha256:2305f688e9328af473a504197584112f228513e06412038d83205ce8d1456f40 \ - --hash=sha256:ee3aa03af1dabed4f3710cd64f6d9d488281eee720710bf1cf9f2b2fd30025ae +botocore==1.38.37 \ + --hash=sha256:06ce46da5420ea7cf542ece4ff1ec9045922fef977adf4bbec618c96c7a478bf \ + --hash=sha256:f8ad063b7dcdbf12f2c1b5a4405f390ce52beff3b2861af2e5169816ee0146f2 # via # awscli # s3transfer @@ -316,7 +316,9 @@ elasticsearch==8.18.1 \ exceptiongroup==1.3.0 \ --hash=sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10 \ --hash=sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88 - # via -r requirements-actions.in + # via + # -r requirements-actions.in + # pytest filelock==3.18.0 \ --hash=sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2 \ --hash=sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de @@ -442,6 +444,10 @@ intelhex==2.3.0 \ --hash=sha256:87cc5225657524ec6361354be928adfd56bcf2a3dcc646c40f8f094c39c07db4 \ --hash=sha256:892b7361a719f4945237da8ccf754e9513db32f5628852785aea108dcd250093 # via -r requirements-actions.in +isodate==0.7.2 ; python_full_version < '3.11' \ + --hash=sha256:28009937d8031054830160fce6d409ed342816b543597cece116d966c6d99e15 \ + --hash=sha256:4cd1aa0f43ca76f4a6c6c0292a85f40b35ec2e43e315b59f06e6d32171a953e6 + # via rdflib isort==6.0.1 \ --hash=sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450 \ --hash=sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615 @@ -890,9 +896,9 @@ pyserial==3.5 \ --hash=sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb \ --hash=sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0 # via -r requirements-actions.in -pytest==8.4.1 \ - --hash=sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7 \ - --hash=sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c +pytest==8.4.0 \ + --hash=sha256:14d920b48472ea0dbf68e45b96cd1ffda4705f33307dcc86c676c1b5104838a6 \ + --hash=sha256:f40f825768ad76c0977cbacdf1fd37c6f7a468e460ea6a0636078f8972d4517e # via -r requirements-actions.in python-can==4.5.0 \ --hash=sha256:1eec66833c1ac76a7e3d636ee0f8b4ba2752e892bab1c56ce74308b2216b5445 \ @@ -1223,24 +1229,32 @@ tomli==2.2.1 \ --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 - # via -r requirements-actions.in + # via + # -r requirements-actions.in + # mypy + # pylint + # pyproject-api + # pytest + # tox tomlkit==0.13.3 \ --hash=sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1 \ --hash=sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0 # via pylint -tox==4.27.0 \ - --hash=sha256:2b8a7fb986b82aa2c830c0615082a490d134e0626dbc9189986da46a313c4f20 \ - --hash=sha256:b97d5ecc0c0d5755bcc5348387fef793e1bfa68eb33746412f4c60881d7f5f57 +tox==4.26.0 \ + --hash=sha256:75f17aaf09face9b97bd41645028d9f722301e912be8b4c65a3f938024560224 \ + --hash=sha256:a83b3b67b0159fa58e44e646505079e35a43317a62d2ae94725e0586266faeca # via -r requirements-actions.in typing-extensions==4.14.0 \ --hash=sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4 \ --hash=sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af # via + # astroid # elasticsearch # exceptiongroup # mypy # pygithub # python-can + # tox unidiff==0.7.5 \ --hash=sha256:2e5f0162052248946b9f0970a40e9e124236bf86c82b70821143a6fc1dea2574 \ --hash=sha256:c93bf2265cc1ba2a520e415ab05da587370bc2a3ae9e0414329f54f0c2fc09e8 @@ -1249,9 +1263,9 @@ uritools==5.0.0 \ --hash=sha256:68180cad154062bd5b5d9ffcdd464f8de6934414b25462ae807b00b8df9345de \ --hash=sha256:cead3a49ba8fbca3f91857343849d506d8639718f4a2e51b62e87393b493bd6f # via spdx-tools -urllib3==2.5.0 \ - --hash=sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760 \ - --hash=sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc +urllib3==2.4.0 \ + --hash=sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466 \ + --hash=sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813 # via # botocore # elastic-transport @@ -1352,9 +1366,9 @@ wrapt==1.17.2 \ # via # deprecated # python-can -xlsxwriter==3.2.5 \ - --hash=sha256:4f4824234e1eaf9d95df9a8fe974585ff91d0f5e3d3f12ace5b71e443c1c6abd \ - --hash=sha256:7e88469d607cdc920151c0ab3ce9cf1a83992d4b7bc730c5ffdd1a12115a7dbe +xlsxwriter==3.2.3 \ + --hash=sha256:593f8296e8a91790c6d0378ab08b064f34a642b3feb787cf6738236bd0a4860d \ + --hash=sha256:ad6fd41bdcf1b885876b1f6b7087560aecc9ae5a9cc2ba97dcac7ab2e210d3d5 # via -r requirements-actions.in xmltodict==0.14.2 \ --hash=sha256:201e7c28bb210e374999d1dde6382923ab0ed1a8a5faeece48ab525b7810a553 \ From bf921621d9abe51a50cc2fb17743ebbc20afa679 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 017/881] Revert "[nrf fromtree] tests: cmake: actually test SBOM files generation" This reverts commit dea8f87f84b3e1704bcb06c8abd114bde965093a. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.in | 1 - scripts/requirements-actions.txt | 392 ++++++++---------- scripts/requirements-run-test.txt | 3 - .../software_bill_of_materials/CMakeLists.txt | 33 +- .../software_bill_of_materials/testcase.yaml | 4 +- 5 files changed, 178 insertions(+), 255 deletions(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 0fb1eca5ad8..2094546f423 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -30,7 +30,6 @@ python-magic; sys_platform != "win32" pyyaml ruff==0.11.11 setuptools>=70.2.0 -spdx-tools sphinx-lint tabulate tomli>=1.1.0 diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 621d8dbc4ae..065d5992399 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -12,35 +12,27 @@ astroid==3.3.10 \ --hash=sha256:104fb9cb9b27ea95e847a94c003be03a9e039334a8ebca5ee27dafaf5c5711eb \ --hash=sha256:c332157953060c6deb9caa57303ae0d20b0fbdb2e59b4a4f2a6ba49d0a7961ce # via pylint -awscli==1.40.36 \ - --hash=sha256:4a548d855cafad153e661defab601363ba8a5644873bf9f8dec31d5c0ebbb351 \ - --hash=sha256:960d92bf8b2f7efd142112f277eed7cc82d8af85fceefe4d321a620352b75ebd +awscli==1.40.27 \ + --hash=sha256:92c84a3e9cbe3a7566bc738ad21201d9dad32dd7ab6a7a4906f7e1b29b9385ca \ + --hash=sha256:d1e1047cccd675b48ab215b4012c91673de73ba498f503fd6eda3de1a24995d7 # via -r requirements-actions.in -beartype==0.21.0 \ - --hash=sha256:b6a1bd56c72f31b0a496a36cc55df6e2f475db166ad07fa4acc7e74f4c7f34c0 \ - --hash=sha256:f9a5078f5ce87261c2d22851d19b050b64f6a805439e8793aecf01ce660d3244 - # via spdx-tools -boolean-py==5.0 \ - --hash=sha256:60cbc4bad079753721d32649545505362c754e121570ada4658b852a3a318d95 \ - --hash=sha256:ef28a70bd43115208441b53a045d1549e2f0ec6e3d08a9d142cbc41c1938e8d9 - # via license-expression -botocore==1.38.37 \ - --hash=sha256:06ce46da5420ea7cf542ece4ff1ec9045922fef977adf4bbec618c96c7a478bf \ - --hash=sha256:f8ad063b7dcdbf12f2c1b5a4405f390ce52beff3b2861af2e5169816ee0146f2 +botocore==1.38.28 \ + --hash=sha256:515e1a535a27f17e1381aec1fb48eaa2c2308258c4db0bfd09e4f1cd1f239c44 \ + --hash=sha256:63d5977a10a375c3fc11c8e15e1ae5a4daaf450af135d55c170cc537648edf25 # via # awscli # s3transfer -cachetools==6.1.0 \ - --hash=sha256:1c7bb3cf9193deaf3508b7c5f2a79986c13ea38965c5adcff1f84519cf39163e \ - --hash=sha256:b4c4f404392848db3ce7aac34950d17be4d864da4b8b66911008e430bc544587 +cachetools==6.0.0 \ + --hash=sha256:82e73ba88f7b30228b5507dce1a1f878498fc669d972aef2dde4f3a3c24f103e \ + --hash=sha256:f225782b84438f828328fc2ad74346522f27e5b1440f4e9fd18b20ebfd1aa2cf # via tox canopen==2.3.0 \ --hash=sha256:792084a93c138d5b2a406ddd2d4eb5ce208f03bd8fda60f81ad2bb8d56c6b827 \ --hash=sha256:7a62274af6ded7ee85ee96f4ada3afa38bc8607a91f306dcc202c3c8cf2850d7 # via -r requirements-actions.in -certifi==2025.6.15 \ - --hash=sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057 \ - --hash=sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b +certifi==2025.4.26 \ + --hash=sha256:0a816057ea3cdefcef70270d2c515e4506bbc954f417fa5ade2021213bb8f0c6 \ + --hash=sha256:30350364dfe371162649852c63336a15c70c6510c2ad5015b21c2345311805f3 # via # elastic-transport # requests @@ -213,30 +205,28 @@ charset-normalizer==3.4.2 \ --hash=sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a \ --hash=sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f # via requests -clang-format==20.1.6 \ - --hash=sha256:0ea008a20951527d35a1e2b8febdca3c47c6f8e9a1bd174601c891e20053ef2e \ - --hash=sha256:11530ff352c64176ba4297ad398452d9fcd442b4a8bb2a804cc7915bc94b96e1 \ - --hash=sha256:12626f058755198b92b26076312cc1052f8dd7868bd6cf61b65d2911154ef6df \ - --hash=sha256:15dbc113b4d2f1eb545adb9b815b96c2d64aff947de9453802e47ef1c5267996 \ - --hash=sha256:2ea00197fe650f29b77dd870cd87891e15d9d2dac75c4e9072f4eee99a928dcb \ - --hash=sha256:5351f353062bb0df9c31b4e84c8a9d6b472f9f0727ebd5ab1f96fd3e792756fa \ - --hash=sha256:58b3ef54bc32304990f1890cc982607f69359e46b0e98350718125bea24566de \ - --hash=sha256:779153a039c8552438dd9a3925f5dad20d8b5a812329703f98cd5da7bb91556c \ - --hash=sha256:8ce12618431d8955026c30a2d19a3ae9ddc6d918ad24a4e00a10f8f130454469 \ - --hash=sha256:8ce920b103447d21ff44d41a7ad412794bde1b737426a126c8ab141f00bbfba8 \ - --hash=sha256:bfc4a9922ee1f7c0ec5a8250cb72e755a1ddc73e5d50866efe00561be6fc69eb \ - --hash=sha256:c93c8b7feed66521349918f741b40ef6eaf85dfa1b5eb1303a49ed4608fd882a \ - --hash=sha256:ce8f5bbacba3f05adc2cd64a1780e36c81b54a2caa0b4c618c611b2b45124930 \ - --hash=sha256:d1d64ccfb14dcd93cd98321191e9fbaef049774d050f0c084b7aede41e79fee2 \ - --hash=sha256:d84fffa03432c400bb560f3c8181c2dfa6be05b9b866f7d0180dfb41e0f91907 \ - --hash=sha256:e1e59c3a23d033df261ce8048c96f0493285cff1b65d3f519b77a47854653d27 +clang-format==20.1.5 \ + --hash=sha256:16c99e744009822d8574b163d679d3a13c81d26beb8512e55a74651b8972f64d \ + --hash=sha256:269d0a12cf6177f2bb806f73130189efac311bd2d24bd5ab8e12f9486b31f591 \ + --hash=sha256:4412731a18ed0749b8357c41bbe277baed514b117345f1f8e3dbc61bf7b6d78e \ + --hash=sha256:45e23bceb0ec646acd14a6274ea92ddc6d959bed4a8c1c338346e4da403b1c96 \ + --hash=sha256:5af73b84c98461bdab8f0b6c1bc49a7935a3362c3183315421607805a0b3e03b \ + --hash=sha256:626e29e1014e044166d856ef439955622e5e6ba50662fe4b4142f41ecebafefe \ + --hash=sha256:6f0d7e54f25374c7849ec639f2e666b35c18bfe76cdacb7e3fdfc92647c99387 \ + --hash=sha256:7abe250990f6eaf89a201cf89f296c18bdb2c135dd44b949a6007ffd31c4522c \ + --hash=sha256:8e0b8e8bdf513f8ac27b82ec940440d836177836d5bc30d1002632e7f4308aab \ + --hash=sha256:9d2b233edaa1323ea9e736f598ba6a845ecb5fa3d21fe88dbb5be12974b8cc78 \ + --hash=sha256:9f82d954ed96cb01a5b6fdcbd87339837b2a310ce65dcd89c88821b6207b6e00 \ + --hash=sha256:c9dbc67e23bafa578367b815425573697a7e3d342e5aed17ae02cb0108007e74 \ + --hash=sha256:cffbcc410ef535a60ab918699ac38d22fa231059cba2bc6c1226a5de69af2c38 \ + --hash=sha256:dba394d7fb285d1adb48a9a46f7241afd2bd8569d63efc76ffe3c381f72c3c7e \ + --hash=sha256:e389a7aa1e99988764060e8fd06b71517dd5d86e3d5285cb9f8eefb1823b4233 \ + --hash=sha256:ee886b41fd7a671a38d207af05006a187b7fc0f5e2463d66fce8c8b4f4cd30c7 # via -r requirements-actions.in click==8.1.3 \ --hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \ --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48 - # via - # gitlint-core - # spdx-tools + # via gitlint-core colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 @@ -247,44 +237,44 @@ colorama==0.4.6 \ # pytest # tox # west -cryptography==45.0.4 \ - --hash=sha256:0339a692de47084969500ee455e42c58e449461e0ec845a34a6a9b9bf7df7fb8 \ - --hash=sha256:03dbff8411206713185b8cebe31bc5c0eb544799a50c09035733716b386e61a4 \ - --hash=sha256:06509dc70dd71fa56eaa138336244e2fbaf2ac164fc9b5e66828fccfd2b680d6 \ - --hash=sha256:0cf13c77d710131d33e63626bd55ae7c0efb701ebdc2b3a7952b9b23a0412862 \ - --hash=sha256:23b9c3ea30c3ed4db59e7b9619272e94891f8a3a5591d0b656a7582631ccf750 \ - --hash=sha256:25eb4d4d3e54595dc8adebc6bbd5623588991d86591a78c2548ffb64797341e2 \ - --hash=sha256:2882338b2a6e0bd337052e8b9007ced85c637da19ef9ecaf437744495c8c2999 \ - --hash=sha256:3530382a43a0e524bc931f187fc69ef4c42828cf7d7f592f7f249f602b5a4ab0 \ - --hash=sha256:425a9a6ac2823ee6e46a76a21a4e8342d8fa5c01e08b823c1f19a8b74f096069 \ - --hash=sha256:46cf7088bf91bdc9b26f9c55636492c1cce3e7aaf8041bbf0243f5e5325cfb2d \ - --hash=sha256:4828190fb6c4bcb6ebc6331f01fe66ae838bb3bd58e753b59d4b22eb444b996c \ - --hash=sha256:49fe9155ab32721b9122975e168a6760d8ce4cffe423bcd7ca269ba41b5dfac1 \ - --hash=sha256:4ca0f52170e821bc8da6fc0cc565b7bb8ff8d90d36b5e9fdd68e8a86bdf72036 \ - --hash=sha256:51dfbd4d26172d31150d84c19bbe06c68ea4b7f11bbc7b3a5e146b367c311349 \ - --hash=sha256:5f31e6b0a5a253f6aa49be67279be4a7e5a4ef259a9f33c69f7d1b1191939872 \ - --hash=sha256:627ba1bc94f6adf0b0a2e35d87020285ead22d9f648c7e75bb64f367375f3b22 \ - --hash=sha256:680806cf63baa0039b920f4976f5f31b10e772de42f16310a6839d9f21a26b0d \ - --hash=sha256:6a3511ae33f09094185d111160fd192c67aa0a2a8d19b54d36e4c78f651dc5ad \ - --hash=sha256:6a5bf57554e80f75a7db3d4b1dacaa2764611ae166ab42ea9a72bcdb5d577637 \ - --hash=sha256:6b613164cb8425e2f8db5849ffb84892e523bf6d26deb8f9bb76ae86181fa12b \ - --hash=sha256:7405ade85c83c37682c8fe65554759800a4a8c54b2d96e0f8ad114d31b808d57 \ - --hash=sha256:7aad98a25ed8ac917fdd8a9c1e706e5a0956e06c498be1f713b61734333a4507 \ - --hash=sha256:7bedbe4cc930fa4b100fc845ea1ea5788fcd7ae9562e669989c11618ae8d76ee \ - --hash=sha256:7ef2dde4fa9408475038fc9aadfc1fb2676b174e68356359632e980c661ec8f6 \ - --hash=sha256:817ee05c6c9f7a69a16200f0c90ab26d23a87701e2a284bd15156783e46dbcc8 \ - --hash=sha256:944e9ccf67a9594137f942d5b52c8d238b1b4e46c7a0c2891b7ae6e01e7c80a4 \ - --hash=sha256:964bcc28d867e0f5491a564b7debb3ffdd8717928d315d12e0d7defa9e43b723 \ - --hash=sha256:96d4819e25bf3b685199b304a0029ce4a3caf98947ce8a066c9137cc78ad2c58 \ - --hash=sha256:a77c6fb8d76e9c9f99f2f3437c1a4ac287b34eaf40997cfab1e9bd2be175ac39 \ - --hash=sha256:b0a97c927497e3bc36b33987abb99bf17a9a175a19af38a892dc4bbb844d7ee2 \ - --hash=sha256:b97737a3ffbea79eebb062eb0d67d72307195035332501722a9ca86bab9e3ab2 \ - --hash=sha256:bbc505d1dc469ac12a0a064214879eac6294038d6b24ae9f71faae1448a9608d \ - --hash=sha256:c22fe01e53dc65edd1945a2e6f0015e887f84ced233acecb64b4daadb32f5c97 \ - --hash=sha256:ce1678a2ccbe696cf3af15a75bb72ee008d7ff183c9228592ede9db467e64f1b \ - --hash=sha256:e00a6c10a5c53979d6242f123c0a97cff9f3abed7f064fc412c36dc521b5f257 \ - --hash=sha256:eaa3e28ea2235b33220b949c5a0d6cf79baa80eab2eb5607ca8ab7525331b9ff \ - --hash=sha256:f3fe7a5ae34d5a414957cc7f457e2b92076e72938423ac64d215722f6cf49a9e +cryptography==45.0.3 \ + --hash=sha256:00094838ecc7c6594171e8c8a9166124c1197b074cfca23645cee573910d76bc \ + --hash=sha256:050ce5209d5072472971e6efbfc8ec5a8f9a841de5a4db0ebd9c2e392cb81972 \ + --hash=sha256:232954730c362638544758a8160c4ee1b832dc011d2c41a306ad8f7cccc5bb0b \ + --hash=sha256:25286aacb947286620a31f78f2ed1a32cded7be5d8b729ba3fb2c988457639e4 \ + --hash=sha256:2f8f8f0b73b885ddd7f3d8c2b2234a7d3ba49002b0223f58cfde1bedd9563c56 \ + --hash=sha256:38deed72285c7ed699864f964a3f4cf11ab3fb38e8d39cfcd96710cd2b5bb716 \ + --hash=sha256:3ad69eeb92a9de9421e1f6685e85a10fbcfb75c833b42cc9bc2ba9fb00da4710 \ + --hash=sha256:5555365a50efe1f486eed6ac7062c33b97ccef409f5970a0b6f205a7cfab59c8 \ + --hash=sha256:555e5e2d3a53b4fabeca32835878b2818b3f23966a4efb0d566689777c5a12c8 \ + --hash=sha256:57a6500d459e8035e813bd8b51b671977fb149a8c95ed814989da682314d0782 \ + --hash=sha256:5833bb4355cb377ebd880457663a972cd044e7f49585aee39245c0d592904578 \ + --hash=sha256:71320fbefd05454ef2d457c481ba9a5b0e540f3753354fff6f780927c25d19b0 \ + --hash=sha256:7573d9eebaeceeb55285205dbbb8753ac1e962af3d9640791d12b36864065e71 \ + --hash=sha256:92d5f428c1a0439b2040435a1d6bc1b26ebf0af88b093c3628913dd464d13fa1 \ + --hash=sha256:97787952246a77d77934d41b62fb1b6f3581d83f71b44796a4158d93b8f5c490 \ + --hash=sha256:9bb5bf55dcb69f7067d80354d0a348368da907345a2c448b0babc4215ccd3497 \ + --hash=sha256:9cc80ce69032ffa528b5e16d217fa4d8d4bb7d6ba8659c1b4d74a1b0f4235fca \ + --hash=sha256:9e4253ed8f5948a3589b3caee7ad9a5bf218ffd16869c516535325fece163dcc \ + --hash=sha256:9eda14f049d7f09c2e8fb411dda17dd6b16a3c76a1de5e249188a32aeb92de19 \ + --hash=sha256:a2b56de3417fd5f48773ad8e91abaa700b678dc7fe1e0c757e1ae340779acf7b \ + --hash=sha256:af3f92b1dc25621f5fad065288a44ac790c5798e986a34d393ab27d2b27fcff9 \ + --hash=sha256:c5edcb90da1843df85292ef3a313513766a78fbbb83f584a5a58fb001a5a9d57 \ + --hash=sha256:c824c9281cb628015bfc3c59335163d4ca0540d49de4582d6c2637312907e4b1 \ + --hash=sha256:c92519d242703b675ccefd0f0562eb45e74d438e001f8ab52d628e885751fb06 \ + --hash=sha256:ca932e11218bcc9ef812aa497cdf669484870ecbcf2d99b765d6c27a86000942 \ + --hash=sha256:cb6ab89421bc90e0422aca911c69044c2912fc3debb19bb3c1bfe28ee3dff6ab \ + --hash=sha256:cfd84777b4b6684955ce86156cfb5e08d75e80dc2585e10d69e47f014f0a5342 \ + --hash=sha256:d377dde61c5d67eb4311eace661c3efda46c62113ff56bf05e2d679e02aebb5b \ + --hash=sha256:d54ae41e6bd70ea23707843021c778f151ca258081586f0cfa31d936ae43d1b2 \ + --hash=sha256:dc10ec1e9f21f33420cc05214989544727e776286c1c16697178978327b95c9c \ + --hash=sha256:ec21313dd335c51d7877baf2972569f40a4291b76a0ce51391523ae358d05899 \ + --hash=sha256:ec64ee375b5aaa354b2b273c921144a660a511f9df8785e6d1c942967106438e \ + --hash=sha256:ed43d396f42028c1f47b5fec012e9e12631266e3825e95c00e3cf94d472dac49 \ + --hash=sha256:edd6d51869beb7f0d472e902ef231a9b7689508e83880ea16ca3311a00bf5ce7 \ + --hash=sha256:f22af3c78abfbc7cbcdf2c55d23c3e022e1a462ee2481011d518c7fb9c9f3d65 \ + --hash=sha256:fae1e637f527750811588e4582988932c222f8251f7b7ea93739acb624e1487f \ + --hash=sha256:fed5aaca1750e46db870874c9c273cd5182a9e9deb16f06f7bdffdb5c2bde4b9 # via pyjwt deprecated==1.2.18 \ --hash=sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d \ @@ -444,10 +434,6 @@ intelhex==2.3.0 \ --hash=sha256:87cc5225657524ec6361354be928adfd56bcf2a3dcc646c40f8f094c39c07db4 \ --hash=sha256:892b7361a719f4945237da8ccf754e9513db32f5628852785aea108dcd250093 # via -r requirements-actions.in -isodate==0.7.2 ; python_full_version < '3.11' \ - --hash=sha256:28009937d8031054830160fce6d409ed342816b543597cece116d966c6d99e15 \ - --hash=sha256:4cd1aa0f43ca76f4a6c6c0292a85f40b35ec2e43e315b59f06e6d32171a953e6 - # via rdflib isort==6.0.1 \ --hash=sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450 \ --hash=sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615 @@ -469,10 +455,6 @@ junitparser==3.2.0 \ --hash=sha256:b05e89c27e7b74b3c563a078d6e055d95cf397444f8f689b0ca616ebda0b3c65 \ --hash=sha256:e14fdc0a999edfc15889b637390e8ef6ca09a49532416d3bd562857d42d4b96d # via -r requirements-actions.in -license-expression==30.4.1 \ - --hash=sha256:679646bc3261a17690494a3e1cada446e5ee342dbd87dcfa4a0c24cc5dce13ee \ - --hash=sha256:9f02105f9e0fcecba6a85dfbbed7d94ea1c3a70cf23ddbfb5adf3438a6f6fce0 - # via spdx-tools lxml==5.4.0 \ --hash=sha256:00b8686694423ddae324cf614e1b9659c2edb754de617703c3d29ff568448df5 \ --hash=sha256:073eb6dcdf1f587d9b88c8c93528b57eccda40209cf9be549d469b942b41d70b \ @@ -680,100 +662,105 @@ mock==5.2.0 \ --hash=sha256:4e460e818629b4b173f32d08bf30d3af8123afbb8e04bb5707a1fd4799e503f0 \ --hash=sha256:7ba87f72ca0e915175596069dbbcc7c75af7b5e9b9bc107ad6349ede0819982f # via -r requirements-actions.in -msgpack==1.1.1 ; sys_platform != 'win32' \ - --hash=sha256:196a736f0526a03653d829d7d4c5500a97eea3648aebfd4b6743875f28aa2af8 \ - --hash=sha256:1abfc6e949b352dadf4bce0eb78023212ec5ac42f6abfd469ce91d783c149c2a \ - --hash=sha256:1b13fe0fb4aac1aa5320cd693b297fe6fdef0e7bea5518cbc2dd5299f873ae90 \ - --hash=sha256:1d75f3807a9900a7d575d8d6674a3a47e9f227e8716256f35bc6f03fc597ffbf \ - --hash=sha256:2fbbc0b906a24038c9958a1ba7ae0918ad35b06cb449d398b76a7d08470b0ed9 \ - --hash=sha256:33be9ab121df9b6b461ff91baac6f2731f83d9b27ed948c5b9d1978ae28bf157 \ - --hash=sha256:353b6fc0c36fde68b661a12949d7d49f8f51ff5fa019c1e47c87c4ff34b080ed \ - --hash=sha256:36043272c6aede309d29d56851f8841ba907a1a3d04435e43e8a19928e243c1d \ - --hash=sha256:3765afa6bd4832fc11c3749be4ba4b69a0e8d7b728f78e68120a157a4c5d41f0 \ - --hash=sha256:3a89cd8c087ea67e64844287ea52888239cbd2940884eafd2dcd25754fb72232 \ - --hash=sha256:40eae974c873b2992fd36424a5d9407f93e97656d999f43fca9d29f820899084 \ - --hash=sha256:4147151acabb9caed4e474c3344181e91ff7a388b888f1e19ea04f7e73dc7ad5 \ - --hash=sha256:435807eeb1bc791ceb3247d13c79868deb22184e1fc4224808750f0d7d1affc1 \ - --hash=sha256:4835d17af722609a45e16037bb1d4d78b7bdf19d6c0128116d178956618c4e88 \ - --hash=sha256:4a28e8072ae9779f20427af07f53bbb8b4aa81151054e882aee333b158da8752 \ - --hash=sha256:4d3237b224b930d58e9d83c81c0dba7aacc20fcc2f89c1e5423aa0529a4cd142 \ - --hash=sha256:4df2311b0ce24f06ba253fda361f938dfecd7b961576f9be3f3fbd60e87130ac \ - --hash=sha256:4fd6b577e4541676e0cc9ddc1709d25014d3ad9a66caa19962c4f5de30fc09ef \ - --hash=sha256:500e85823a27d6d9bba1d057c871b4210c1dd6fb01fbb764e37e4e8847376323 \ - --hash=sha256:5692095123007180dca3e788bb4c399cc26626da51629a31d40207cb262e67f4 \ - --hash=sha256:5fd1b58e1431008a57247d6e7cc4faa41c3607e8e7d4aaf81f7c29ea013cb458 \ - --hash=sha256:61abccf9de335d9efd149e2fff97ed5974f2481b3353772e8e2dd3402ba2bd57 \ - --hash=sha256:61e35a55a546a1690d9d09effaa436c25ae6130573b6ee9829c37ef0f18d5e78 \ - --hash=sha256:6640fd979ca9a212e4bcdf6eb74051ade2c690b862b679bfcb60ae46e6dc4bfd \ - --hash=sha256:6d489fba546295983abd142812bda76b57e33d0b9f5d5b71c09a583285506f69 \ - --hash=sha256:6f64ae8fe7ffba251fecb8408540c34ee9df1c26674c50c4544d72dbf792e5ce \ - --hash=sha256:71ef05c1726884e44f8b1d1773604ab5d4d17729d8491403a705e649116c9558 \ - --hash=sha256:77b79ce34a2bdab2594f490c8e80dd62a02d650b91a75159a63ec413b8d104cd \ - --hash=sha256:78426096939c2c7482bf31ef15ca219a9e24460289c00dd0b94411040bb73ad2 \ - --hash=sha256:79c408fcf76a958491b4e3b103d1c417044544b68e96d06432a189b43d1215c8 \ - --hash=sha256:7a17ac1ea6ec3c7687d70201cfda3b1e8061466f28f686c24f627cae4ea8efd0 \ - --hash=sha256:7da8831f9a0fdb526621ba09a281fadc58ea12701bc709e7b8cbc362feabc295 \ - --hash=sha256:870b9a626280c86cff9c576ec0d9cbcc54a1e5ebda9cd26dab12baf41fee218c \ - --hash=sha256:88d1e966c9235c1d4e2afac21ca83933ba59537e2e2727a999bf3f515ca2af26 \ - --hash=sha256:88daaf7d146e48ec71212ce21109b66e06a98e5e44dca47d853cbfe171d6c8d2 \ - --hash=sha256:8a8b10fdb84a43e50d38057b06901ec9da52baac6983d3f709d8507f3889d43f \ - --hash=sha256:8b17ba27727a36cb73aabacaa44b13090feb88a01d012c0f4be70c00f75048b4 \ - --hash=sha256:8b65b53204fe1bd037c40c4148d00ef918eb2108d24c9aaa20bc31f9810ce0a8 \ - --hash=sha256:8ddb2bcfd1a8b9e431c8d6f4f7db0773084e107730ecf3472f1dfe9ad583f3d9 \ - --hash=sha256:96decdfc4adcbc087f5ea7ebdcfd3dee9a13358cae6e81d54be962efc38f6338 \ - --hash=sha256:996f2609ddf0142daba4cefd767d6db26958aac8439ee41db9cc0db9f4c4c3a6 \ - --hash=sha256:9d592d06e3cc2f537ceeeb23d38799c6ad83255289bb84c2e5792e5a8dea268a \ - --hash=sha256:a32747b1b39c3ac27d0670122b57e6e57f28eefb725e0b625618d1b59bf9d1e0 \ - --hash=sha256:a494554874691720ba5891c9b0b39474ba43ffb1aaf32a5dac874effb1619e1a \ - --hash=sha256:a8ef6e342c137888ebbfb233e02b8fbd689bb5b5fcc59b34711ac47ebd504478 \ - --hash=sha256:ae497b11f4c21558d95de9f64fff7053544f4d1a17731c866143ed6bb4591238 \ - --hash=sha256:b1ce7f41670c5a69e1389420436f41385b1aa2504c3b0c30620764b15dded2e7 \ - --hash=sha256:b8f93dcddb243159c9e4109c9750ba5b335ab8d48d9522c5308cd05d7e3ce600 \ - --hash=sha256:ba0c325c3f485dc54ec298d8b024e134acf07c10d494ffa24373bea729acf704 \ - --hash=sha256:bb29aaa613c0a1c40d1af111abf025f1732cab333f96f285d6a93b934738a68a \ - --hash=sha256:bba1be28247e68994355e028dcd668316db30c1f758d3241a7b903ac78dcd285 \ - --hash=sha256:cb643284ab0ed26f6957d969fe0dd8bb17beb567beb8998140b5e38a90974f6c \ - --hash=sha256:d182dac0221eb8faef2e6f44701812b467c02674a322c739355c39e94730cdbf \ - --hash=sha256:d275a9e3c81b1093c060c3837e580c37f47c51eca031f7b5fb76f7b8470f5f9b \ - --hash=sha256:d8b55ea20dc59b181d3f47103f113e6f28a5e1c89fd5b67b9140edb442ab67f2 \ - --hash=sha256:da8f41e602574ece93dbbda1fab24650d6bf2a24089f9e9dbb4f5730ec1e58ad \ - --hash=sha256:e4141c5a32b5e37905b5940aacbc59739f036930367d7acce7a64e4dec1f5e0b \ - --hash=sha256:f5be6b6bc52fad84d010cb45433720327ce886009d862f46b26d4d154001994b \ - --hash=sha256:f6d58656842e1b2ddbe07f43f56b10a60f2ba5826164910968f5933e5178af75 +msgpack==1.1.0 ; sys_platform != 'win32' \ + --hash=sha256:06f5fd2f6bb2a7914922d935d3b8bb4a7fff3a9a91cfce6d06c13bc42bec975b \ + --hash=sha256:071603e2f0771c45ad9bc65719291c568d4edf120b44eb36324dcb02a13bfddf \ + --hash=sha256:0907e1a7119b337971a689153665764adc34e89175f9a34793307d9def08e6ca \ + --hash=sha256:0f92a83b84e7c0749e3f12821949d79485971f087604178026085f60ce109330 \ + --hash=sha256:115a7af8ee9e8cddc10f87636767857e7e3717b7a2e97379dc2054712693e90f \ + --hash=sha256:13599f8829cfbe0158f6456374e9eea9f44eee08076291771d8ae93eda56607f \ + --hash=sha256:17fb65dd0bec285907f68b15734a993ad3fc94332b5bb21b0435846228de1f39 \ + --hash=sha256:2137773500afa5494a61b1208619e3871f75f27b03bcfca7b3a7023284140247 \ + --hash=sha256:3180065ec2abbe13a4ad37688b61b99d7f9e012a535b930e0e683ad6bc30155b \ + --hash=sha256:398b713459fea610861c8a7b62a6fec1882759f308ae0795b5413ff6a160cf3c \ + --hash=sha256:3d364a55082fb2a7416f6c63ae383fbd903adb5a6cf78c5b96cc6316dc1cedc7 \ + --hash=sha256:3df7e6b05571b3814361e8464f9304c42d2196808e0119f55d0d3e62cd5ea044 \ + --hash=sha256:41c991beebf175faf352fb940bf2af9ad1fb77fd25f38d9142053914947cdbf6 \ + --hash=sha256:42f754515e0f683f9c79210a5d1cad631ec3d06cea5172214d2176a42e67e19b \ + --hash=sha256:452aff037287acb1d70a804ffd022b21fa2bb7c46bee884dbc864cc9024128a0 \ + --hash=sha256:4676e5be1b472909b2ee6356ff425ebedf5142427842aa06b4dfd5117d1ca8a2 \ + --hash=sha256:46c34e99110762a76e3911fc923222472c9d681f1094096ac4102c18319e6468 \ + --hash=sha256:471e27a5787a2e3f974ba023f9e265a8c7cfd373632247deb225617e3100a3c7 \ + --hash=sha256:4a1964df7b81285d00a84da4e70cb1383f2e665e0f1f2a7027e683956d04b734 \ + --hash=sha256:4b51405e36e075193bc051315dbf29168d6141ae2500ba8cd80a522964e31434 \ + --hash=sha256:4d1b7ff2d6146e16e8bd665ac726a89c74163ef8cd39fa8c1087d4e52d3a2325 \ + --hash=sha256:53258eeb7a80fc46f62fd59c876957a2d0e15e6449a9e71842b6d24419d88ca1 \ + --hash=sha256:534480ee5690ab3cbed89d4c8971a5c631b69a8c0883ecfea96c19118510c846 \ + --hash=sha256:58638690ebd0a06427c5fe1a227bb6b8b9fdc2bd07701bec13c2335c82131a88 \ + --hash=sha256:58dfc47f8b102da61e8949708b3eafc3504509a5728f8b4ddef84bd9e16ad420 \ + --hash=sha256:59caf6a4ed0d164055ccff8fe31eddc0ebc07cf7326a2aaa0dbf7a4001cd823e \ + --hash=sha256:5dbad74103df937e1325cc4bfeaf57713be0b4f15e1c2da43ccdd836393e2ea2 \ + --hash=sha256:5e1da8f11a3dd397f0a32c76165cf0c4eb95b31013a94f6ecc0b280c05c91b59 \ + --hash=sha256:646afc8102935a388ffc3914b336d22d1c2d6209c773f3eb5dd4d6d3b6f8c1cb \ + --hash=sha256:64fc9068d701233effd61b19efb1485587560b66fe57b3e50d29c5d78e7fef68 \ + --hash=sha256:65553c9b6da8166e819a6aa90ad15288599b340f91d18f60b2061f402b9a4915 \ + --hash=sha256:685ec345eefc757a7c8af44a3032734a739f8c45d1b0ac45efc5d8977aa4720f \ + --hash=sha256:6ad622bf7756d5a497d5b6836e7fc3752e2dd6f4c648e24b1803f6048596f701 \ + --hash=sha256:73322a6cc57fcee3c0c57c4463d828e9428275fb85a27aa2aa1a92fdc42afd7b \ + --hash=sha256:74bed8f63f8f14d75eec75cf3d04ad581da6b914001b474a5d3cd3372c8cc27d \ + --hash=sha256:79ec007767b9b56860e0372085f8504db5d06bd6a327a335449508bbee9648fa \ + --hash=sha256:7a946a8992941fea80ed4beae6bff74ffd7ee129a90b4dd5cf9c476a30e9708d \ + --hash=sha256:7ad442d527a7e358a469faf43fda45aaf4ac3249c8310a82f0ccff9164e5dccd \ + --hash=sha256:7c9a35ce2c2573bada929e0b7b3576de647b0defbd25f5139dcdaba0ae35a4cc \ + --hash=sha256:7e7b853bbc44fb03fbdba34feb4bd414322180135e2cb5164f20ce1c9795ee48 \ + --hash=sha256:879a7b7b0ad82481c52d3c7eb99bf6f0645dbdec5134a4bddbd16f3506947feb \ + --hash=sha256:8a706d1e74dd3dea05cb54580d9bd8b2880e9264856ce5068027eed09680aa74 \ + --hash=sha256:8a84efb768fb968381e525eeeb3d92857e4985aacc39f3c47ffd00eb4509315b \ + --hash=sha256:8cf9e8c3a2153934a23ac160cc4cba0ec035f6867c8013cc6077a79823370346 \ + --hash=sha256:8da4bf6d54ceed70e8861f833f83ce0814a2b72102e890cbdfe4b34764cdd66e \ + --hash=sha256:8e59bca908d9ca0de3dc8684f21ebf9a690fe47b6be93236eb40b99af28b6ea6 \ + --hash=sha256:914571a2a5b4e7606997e169f64ce53a8b1e06f2cf2c3a7273aa106236d43dd5 \ + --hash=sha256:a51abd48c6d8ac89e0cfd4fe177c61481aca2d5e7ba42044fd218cfd8ea9899f \ + --hash=sha256:a52a1f3a5af7ba1c9ace055b659189f6c669cf3657095b50f9602af3a3ba0fe5 \ + --hash=sha256:ad33e8400e4ec17ba782f7b9cf868977d867ed784a1f5f2ab46e7ba53b6e1e1b \ + --hash=sha256:b4c01941fd2ff87c2a934ee6055bda4ed353a7846b8d4f341c428109e9fcde8c \ + --hash=sha256:bce7d9e614a04d0883af0b3d4d501171fbfca038f12c77fa838d9f198147a23f \ + --hash=sha256:c40ffa9a15d74e05ba1fe2681ea33b9caffd886675412612d93ab17b58ea2fec \ + --hash=sha256:c5a91481a3cc573ac8c0d9aace09345d989dc4a0202b7fcb312c88c26d4e71a8 \ + --hash=sha256:c921af52214dcbb75e6bdf6a661b23c3e6417f00c603dd2070bccb5c3ef499f5 \ + --hash=sha256:d46cf9e3705ea9485687aa4001a76e44748b609d260af21c4ceea7f2212a501d \ + --hash=sha256:d8ce0b22b890be5d252de90d0e0d119f363012027cf256185fc3d474c44b1b9e \ + --hash=sha256:dd432ccc2c72b914e4cb77afce64aab761c1137cc698be3984eee260bcb2896e \ + --hash=sha256:e0856a2b7e8dcb874be44fea031d22e5b3a19121be92a1e098f46068a11b0870 \ + --hash=sha256:e1f3c3d21f7cf67bcf2da8e494d30a75e4cf60041d98b3f79875afb5b96f3a3f \ + --hash=sha256:f1ba6136e650898082d9d5a5217d5906d1e138024f836ff48691784bbe1adf96 \ + --hash=sha256:f3e9b4936df53b970513eac1758f3882c88658a220b58dcc1e39606dccaaf01c \ + --hash=sha256:f80bc7d47f76089633763f952e67f8214cb7b3ee6bfa489b3cb6a84cfac114cd \ + --hash=sha256:fd2906780f25c8ed5d7b323379f6138524ba793428db5d0e9d226d3fa6aa1788 # via python-can -mypy==1.16.1 \ - --hash=sha256:051e1677689c9d9578b9c7f4d206d763f9bbd95723cd1416fad50db49d52f359 \ - --hash=sha256:08e850ea22adc4d8a4014651575567b0318ede51e8e9fe7a68f25391af699507 \ - --hash=sha256:09aa4f91ada245f0a45dbc47e548fd94e0dd5a8433e0114917dc3b526912a30c \ - --hash=sha256:0a7cfb0fe29fe5a9841b7c8ee6dffb52382c45acdf68f032145b75620acfbd6f \ - --hash=sha256:0ab5eca37b50188163fa7c1b73c685ac66c4e9bdee4a85c9adac0e91d8895e15 \ - --hash=sha256:1256688e284632382f8f3b9e2123df7d279f603c561f099758e66dd6ed4e8bd6 \ - --hash=sha256:13c7cd5b1cb2909aa318a90fd1b7e31f17c50b242953e7dd58345b2a814f6383 \ - --hash=sha256:1f0435cf920e287ff68af3d10a118a73f212deb2ce087619eb4e648116d1fe9b \ - --hash=sha256:211287e98e05352a2e1d4e8759c5490925a7c784ddc84207f4714822f8cf99b6 \ - --hash=sha256:22d76a63a42619bfb90122889b903519149879ddbf2ba4251834727944c8baca \ - --hash=sha256:2c7ce0662b6b9dc8f4ed86eb7a5d505ee3298c04b40ec13b30e572c0e5ae17c4 \ - --hash=sha256:352025753ef6a83cb9e7f2427319bb7875d1fdda8439d1e23de12ab164179574 \ - --hash=sha256:44e7acddb3c48bd2713994d098729494117803616e116032af192871aed80b79 \ - --hash=sha256:472e4e4c100062488ec643f6162dd0d5208e33e2f34544e1fc931372e806c0cc \ - --hash=sha256:4f58ac32771341e38a853c5d0ec0dfe27e18e27da9cdb8bbc882d2249c71a3ee \ - --hash=sha256:58e07fb958bc5d752a280da0e890c538f1515b79a65757bbdc54252ba82e0b40 \ - --hash=sha256:5e198ab3f55924c03ead626ff424cad1732d0d391478dfbf7bb97b34602395da \ - --hash=sha256:5fc2ac4027d0ef28d6ba69a0343737a23c4d1b83672bf38d1fe237bdc0643b37 \ - --hash=sha256:66df38405fd8466ce3517eda1f6640611a0b8e70895e2a9462d1d4323c5eb4b9 \ - --hash=sha256:6bd00a0a2094841c5e47e7374bb42b83d64c527a502e3334e1173a0c24437bab \ - --hash=sha256:7fc688329af6a287567f45cc1cefb9db662defeb14625213a5b7da6e692e2069 \ - --hash=sha256:86042bbf9f5a05ea000d3203cf87aa9d0ccf9a01f73f71c58979eb9249f46d72 \ - --hash=sha256:87ff2c13d58bdc4bbe7dc0dedfe622c0f04e2cb2a492269f3b418df2de05c536 \ - --hash=sha256:af4792433f09575d9eeca5c63d7d90ca4aeceda9d8355e136f80f8967639183d \ - --hash=sha256:b4f0fed1022a63c6fec38f28b7fc77fca47fd490445c69d0a66266c59dd0b88a \ - --hash=sha256:d5d2309511cc56c021b4b4e462907c2b12f669b2dbeb68300110ec27723971be \ - --hash=sha256:ddc91eb318c8751c69ddb200a5937f1232ee8efb4e64e9f4bc475a33719de438 \ - --hash=sha256:dedb6229b2c9086247e21a83c309754b9058b438704ad2f6807f0d8227f6ebdd \ - --hash=sha256:ea16e2a7d2714277e349e24d19a782a663a34ed60864006e8585db08f8ad1782 \ - --hash=sha256:ea7469ee5902c95542bea7ee545f7006508c65c8c54b06dc2c92676ce526f3ea \ - --hash=sha256:f895078594d918f93337a505f8add9bd654d1a24962b4c6ed9390e12531eb31b \ - --hash=sha256:ff9fa5b16e4c1364eb89a4d16bcda9987f05d39604e1e6c35378a2987c1aac2d +mypy==1.16.0 \ + --hash=sha256:021a68568082c5b36e977d54e8f1de978baf401a33884ffcea09bd8e88a98f4c \ + --hash=sha256:089bedc02307c2548eb51f426e085546db1fa7dd87fbb7c9fa561575cf6eb1ff \ + --hash=sha256:09a8da6a0ee9a9770b8ff61b39c0bb07971cda90e7297f4213741b48a0cc8d93 \ + --hash=sha256:0b07e107affb9ee6ce1f342c07f51552d126c32cd62955f59a7db94a51ad12c0 \ + --hash=sha256:15486beea80be24ff067d7d0ede673b001d0d684d0095803b3e6e17a886a2a92 \ + --hash=sha256:29e1499864a3888bca5c1542f2d7232c6e586295183320caa95758fc84034031 \ + --hash=sha256:2e7e0ad35275e02797323a5aa1be0b14a4d03ffdb2e5f2b0489fa07b89c67b21 \ + --hash=sha256:4086883a73166631307fdd330c4a9080ce24913d4f4c5ec596c601b3a4bdd777 \ + --hash=sha256:54066fed302d83bf5128632d05b4ec68412e1f03ef2c300434057d66866cea4b \ + --hash=sha256:55f9076c6ce55dd3f8cd0c6fff26a008ca8e5131b89d5ba6d86bd3f47e736eeb \ + --hash=sha256:6a2322896003ba66bbd1318c10d3afdfe24e78ef12ea10e2acd985e9d684a666 \ + --hash=sha256:7909541fef256527e5ee9c0a7e2aeed78b6cda72ba44298d1334fe7881b05c5c \ + --hash=sha256:82d056e6faa508501af333a6af192c700b33e15865bda49611e3d7d8358ebea2 \ + --hash=sha256:84b94283f817e2aa6350a14b4a8fb2a35a53c286f97c9d30f53b63620e7af8ab \ + --hash=sha256:936ccfdd749af4766be824268bfe22d1db9eb2f34a3ea1d00ffbe5b5265f5491 \ + --hash=sha256:9f826aaa7ff8443bac6a494cf743f591488ea940dd360e7dd330e30dd772a5ab \ + --hash=sha256:a5fcfdb7318c6a8dd127b14b1052743b83e97a970f0edb6c913211507a255e20 \ + --hash=sha256:a7e32297a437cc915599e0578fa6bc68ae6a8dc059c9e009c628e1c47f91495d \ + --hash=sha256:a9e056237c89f1587a3be1a3a70a06a698d25e2479b9a2f57325ddaaffc3567b \ + --hash=sha256:afe420c9380ccec31e744e8baff0d406c846683681025db3531b32db56962d52 \ + --hash=sha256:b4968f14f44c62e2ec4a038c8797a87315be8df7740dc3ee8d3bfe1c6bf5dba8 \ + --hash=sha256:bd4e1ebe126152a7bbaa4daedd781c90c8f9643c79b9748caa270ad542f12bec \ + --hash=sha256:c5436d11e89a3ad16ce8afe752f0f373ae9620841c50883dc96f8b8805620b13 \ + --hash=sha256:c6fb60cbd85dc65d4d63d37cb5c86f4e3a301ec605f606ae3a9173e5cf34997b \ + --hash=sha256:d045d33c284e10a038f5e29faca055b90eee87da3fc63b8889085744ebabb5a1 \ + --hash=sha256:e71d6f0090c2256c713ed3d52711d01859c82608b5d68d4fa01a3fe30df95571 \ + --hash=sha256:eb14a4a871bb8efb1e4a50360d4e3c8d6c601e7a31028a2c79f9bb659b63d730 \ + --hash=sha256:eb5fbc8063cb4fde7787e4c0406aa63094a34a2daf4673f359a1fb64050e9cb2 \ + --hash=sha256:f2622af30bf01d8fc36466231bdd203d120d7a599a6d88fb22bdcb9dbff84090 \ + --hash=sha256:f2ed0e0847a80655afa2c121835b848ed101cc7b8d8d6ecc5205aedc732b1436 \ + --hash=sha256:f56236114c425620875c7cf71700e3d60004858da856c6fc78998ffe767b73d3 \ + --hash=sha256:feec38097f71797da0231997e0de3a58108c51845399669ebc532c815f93866b # via -r requirements-actions.in mypy-extensions==1.1.0 \ --hash=sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505 \ @@ -814,9 +801,7 @@ pluggy==1.6.0 \ ply==3.11 \ --hash=sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3 \ --hash=sha256:096f9b8350b65ebd2fd1346b12452efe5b9607f7482813ffca50c22722a807ce - # via - # -r requirements-actions.in - # spdx-tools + # via -r requirements-actions.in polib==1.2.0 \ --hash=sha256:1c77ee1b81feb31df9bca258cbc58db1bbb32d10214b173882452c73af06d62d \ --hash=sha256:f3ef94aefed6e183e342a8a269ae1fc4742ba193186ad76f175938621dbfc26b @@ -884,10 +869,6 @@ pynacl==1.5.0 \ --hash=sha256:a422368fc821589c228f4c49438a368831cb5bbc0eab5ebe1d7fac9dded6567b \ --hash=sha256:e46dae94e34b085175f8abb3b0aaa7da40767865ac82c928eeb9e57e1ea8a543 # via pygithub -pyparsing==3.2.3 \ - --hash=sha256:a749938e02d6fd0b59b356ca504a24982314bb090c383e3cf201c95ef7e2bfcf \ - --hash=sha256:b9c13f1ab8b3b542f72e28f634bad4de758ab3ce4546e4301970ad6fa77c38be - # via rdflib pyproject-api==1.9.1 \ --hash=sha256:43c9918f49daab37e302038fc1aed54a8c7a91a9fa935d00b9a485f37e0f5335 \ --hash=sha256:7d6238d92f8962773dd75b5f0c4a6a27cce092a14b623b811dba656f3b628948 @@ -978,13 +959,8 @@ pyyaml==6.0.2 \ # via # -r requirements-actions.in # awscli - # spdx-tools # west # yamllint -rdflib==7.1.4 \ - --hash=sha256:72f4adb1990fa5241abd22ddaf36d7cafa5d91d9ff2ba13f3086d339b213d997 \ - --hash=sha256:fed46e24f26a788e2ab8e445f7077f00edcf95abb73bcef4b86cefa8b62dd174 - # via spdx-tools regex==2024.11.6 \ --hash=sha256:02a02d2bb04fec86ad61f3ea7f49c015a0681bf76abb9857f945d26159d2968c \ --hash=sha256:02e28184be537f0e75c1f9b2f8847dc51e08e6e171c6bde130b2687e0c33cf60 \ @@ -1081,17 +1057,17 @@ regex==2024.11.6 \ --hash=sha256:fdd6028445d2460f33136c55eeb1f601ab06d74cb3347132e1c24250187500d9 \ --hash=sha256:ff590880083d60acc0433f9c3f713c51f7ac6ebb9adf889c79a261ecf541aa91 # via sphinx-lint -requests==2.32.4 \ - --hash=sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c \ - --hash=sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422 +requests==2.32.3 \ + --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ + --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 # via pygithub rsa==4.7.2 \ --hash=sha256:78f9a9bf4e7be0c5ded4583326e7461e3a3c5aae24073648b4bdfa797d78c9d2 \ --hash=sha256:9d689e6ca1b3038bc82bf8d23e944b6b6037bc02301a574935b2dd946e0353b9 # via awscli -ruamel-yaml==0.18.14 \ - --hash=sha256:710ff198bb53da66718c7db27eec4fbcc9aa6ca7204e4c1df2f282b6fe5eb6b2 \ - --hash=sha256:7227b76aaec364df15936730efbf7d72b30c0b79b1d578bbb8e3dcb2d81f52b7 +ruamel-yaml==0.18.12 \ + --hash=sha256:5a38fd5ce39d223bebb9e3a6779e86b9427a03fb0bf9f270060f8b149cffe5e2 \ + --hash=sha256:790ba4c48b6a6e6b12b532a7308779eb12d2aaab3a80fdb8389216f28ea2b287 # via pykwalify ruamel-yaml-clib==0.2.12 ; python_full_version < '3.14' and platform_python_implementation == 'CPython' \ --hash=sha256:040ae85536960525ea62868b642bdb0c2cc6021c9f9d507810c0c604e66f5a7b \ @@ -1165,10 +1141,6 @@ s3transfer==0.13.0 \ --hash=sha256:0148ef34d6dd964d0d8cf4311b2b21c474693e57c2e069ec708ce043d2b527be \ --hash=sha256:f5e6db74eb7776a37208001113ea7aa97695368242b364d73e91c981ac522177 # via awscli -semantic-version==2.10.0 \ - --hash=sha256:bdabb6d336998cbb378d4b9db3a4b56a1e3235701dc05ea2690d9a997ed5041c \ - --hash=sha256:de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177 - # via spdx-tools setuptools==80.9.0 \ --hash=sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922 \ --hash=sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c @@ -1184,10 +1156,6 @@ smmap==5.0.2 \ --hash=sha256:26ea65a03958fa0c8a1c7e8c7a58fdc77221b8910f6be2131affade476898ad5 \ --hash=sha256:b30115f0def7d7531d22a0fb6502488d879e75b260a9db4d0819cfb25403af5e # via gitdb -spdx-tools==0.8.3 \ - --hash=sha256:638fd9bd8be61901316eb6d063574e16d5403a1870073ec4d9241426a997501a \ - --hash=sha256:68b8f9ce2893b5216bd90b2e63f1c821c2884e4ebc4fd295ebbf1fa8b8a94b93 - # via -r requirements-actions.in sphinx-lint==1.0.0 \ --hash=sha256:6117a0f340b2dc73eadfc57db7531d4477e0929f92a0c1a2f61e6edbc272f0bc \ --hash=sha256:6eafdb44172ce526f405bf36c713eb246f1340ec2d667e7298e2487ed76decd2 @@ -1236,9 +1204,9 @@ tomli==2.2.1 \ # pyproject-api # pytest # tox -tomlkit==0.13.3 \ - --hash=sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1 \ - --hash=sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0 +tomlkit==0.13.2 \ + --hash=sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde \ + --hash=sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79 # via pylint tox==4.26.0 \ --hash=sha256:75f17aaf09face9b97bd41645028d9f722301e912be8b4c65a3f938024560224 \ @@ -1259,10 +1227,6 @@ unidiff==0.7.5 \ --hash=sha256:2e5f0162052248946b9f0970a40e9e124236bf86c82b70821143a6fc1dea2574 \ --hash=sha256:c93bf2265cc1ba2a520e415ab05da587370bc2a3ae9e0414329f54f0c2fc09e8 # via -r requirements-actions.in -uritools==5.0.0 \ - --hash=sha256:68180cad154062bd5b5d9ffcdd464f8de6934414b25462ae807b00b8df9345de \ - --hash=sha256:cead3a49ba8fbca3f91857343849d506d8639718f4a2e51b62e87393b493bd6f - # via spdx-tools urllib3==2.4.0 \ --hash=sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466 \ --hash=sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813 @@ -1370,10 +1334,6 @@ xlsxwriter==3.2.3 \ --hash=sha256:593f8296e8a91790c6d0378ab08b064f34a642b3feb787cf6738236bd0a4860d \ --hash=sha256:ad6fd41bdcf1b885876b1f6b7087560aecc9ae5a9cc2ba97dcac7ab2e210d3d5 # via -r requirements-actions.in -xmltodict==0.14.2 \ - --hash=sha256:201e7c28bb210e374999d1dde6382923ab0ed1a8a5faeece48ab525b7810a553 \ - --hash=sha256:20cc7d723ed729276e808f26fb6b3599f786cbc37e06c65e192ba77c40f20aac - # via spdx-tools yamllint==1.37.1 \ --hash=sha256:364f0d79e81409f591e323725e6a9f4504c8699ddf2d7263d8d2b539cd66a583 \ --hash=sha256:81f7c0c5559becc8049470d86046b36e96113637bcbe4753ecef06977c00245d diff --git a/scripts/requirements-run-test.txt b/scripts/requirements-run-test.txt index 4b09fd1aa3a..08ff89b0c54 100644 --- a/scripts/requirements-run-test.txt +++ b/scripts/requirements-run-test.txt @@ -16,6 +16,3 @@ psutil>=5.6.6 # used for CAN <=> host testing python-can>=4.3.0 - -# used for SPDX files validation -spdx-tools diff --git a/tests/application_development/software_bill_of_materials/CMakeLists.txt b/tests/application_development/software_bill_of_materials/CMakeLists.txt index 4c07f6bb238..90fa8976b91 100644 --- a/tests/application_development/software_bill_of_materials/CMakeLists.txt +++ b/tests/application_development/software_bill_of_materials/CMakeLists.txt @@ -10,35 +10,4 @@ target_sources(app PRIVATE ${ZEPHYR_BASE}/misc/empty_file.c) enable_testing() include(CTest) -set( - SPDX_FILES - app.spdx - zephyr.spdx - build.spdx - modules-deps.spdx -) - -set(SPDX_VERSIONS_TO_TEST "2.2" "2.3") - -foreach(spdx_version ${SPDX_VERSIONS_TO_TEST}) - string(REPLACE "." "_" version_suffix ${spdx_version}) - - add_test( - NAME spdx_gen_${version_suffix} - COMMAND west spdx -d ${CMAKE_BINARY_DIR} --spdx-version ${spdx_version} - ) - - foreach(spdx_file ${SPDX_FILES}) - get_filename_component(basename ${spdx_file} NAME_WE) - - add_test( - NAME spdx_validate_${basename}_${version_suffix} - COMMAND pyspdxtools -i ${CMAKE_BINARY_DIR}/spdx/${spdx_file} - ) - - set_tests_properties( - spdx_validate_${basename}_${version_suffix} - PROPERTIES DEPENDS spdx_gen_${version_suffix} - ) - endforeach() -endforeach() +add_test(NAME spdx_gen COMMAND west spdx -d ${CMAKE_BINARY_DIR}) diff --git a/tests/application_development/software_bill_of_materials/testcase.yaml b/tests/application_development/software_bill_of_materials/testcase.yaml index 3fd2eab28e2..8436b69fdbe 100644 --- a/tests/application_development/software_bill_of_materials/testcase.yaml +++ b/tests/application_development/software_bill_of_materials/testcase.yaml @@ -2,9 +2,7 @@ common: tags: - spdx integration_platforms: - - qemu_cortex_m3 - platform_allow: - - qemu_cortex_m3 + - native_sim harness: ctest tests: buildsystem.sbom.spdx: {} From d1fd26ca0b6ffc040b0b509bbc9d9081caeaff43 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 018/881] Revert "[nrf fromtree] scripts: ci: add vermin (min python version check)" This reverts commit 3bd95f869510e3b0be9bdd03c8ec9e66455c22c4. Signed-off-by: Jukka Rissanen --- .gitignore | 1 - scripts/ci/check_compliance.py | 60 ----------------------------- scripts/requirements-actions.in | 1 - scripts/requirements-actions.txt | 4 -- scripts/requirements-compliance.txt | 1 - 5 files changed, 67 deletions(-) diff --git a/.gitignore b/.gitignore index c24356df575..aab3981f52f 100644 --- a/.gitignore +++ b/.gitignore @@ -102,7 +102,6 @@ MaintainersFormat.txt ModulesMaintainers.txt Nits.txt Pylint.txt -PythonCompat.txt Ruff.txt SphinxLint.txt SysbuildKconfig.txt diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index f1da73f3ec0..d5f13ee84fc 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -2001,66 +2001,6 @@ def run(self): desc = f"Run 'ruff format {file}'" self.fmtd_failure("error", "Python format error", file, desc=desc) -class PythonCompatCheck(ComplianceTest): - """ - Python Compatibility Check - """ - name = "PythonCompat" - doc = "Check that Python files are compatible with Zephyr minimum supported Python version." - - MAX_VERSION = (3, 10) - MAX_VERSION_STR = f"{MAX_VERSION[0]}.{MAX_VERSION[1]}" - - def run(self): - py_files = [f for f in get_files(filter="d") if f.endswith(".py")] - if not py_files: - return - cmd = ["vermin", "-f", "parsable", "--violations", - f"-t={self.MAX_VERSION_STR}", "--no-make-paths-absolute"] + py_files - try: - result = subprocess.run(cmd, - check=False, - capture_output=True, - cwd=GIT_TOP) - except Exception as ex: - self.error(f"Failed to run vermin: {ex}") - output = result.stdout.decode("utf-8") - failed = False - for line in output.splitlines(): - parts = line.split(":") - if len(parts) < 6: - continue - filename, line_number, column, _, py3ver, feature = parts[:6] - if not line_number: - # Ignore all file-level messages - continue - - desc = None - if py3ver.startswith('!'): - desc = f"{feature} is known to be incompatible with Python 3." - elif py3ver.startswith('~'): - # "no known reason it won't work", just skip - continue - else: - major, minor = map(int, py3ver.split(".")[:2]) - if (major, minor) > self.MAX_VERSION: - desc = f"{feature} requires Python {major}.{minor}, which is higher than " \ - f"Zephyr's minimum supported Python version ({self.MAX_VERSION_STR})." - - if desc is not None: - self.fmtd_failure( - "error", - "PythonCompat", - filename, - line=int(line_number), - col=int(column) if column else None, - desc=desc, - ) - failed = True - if failed: - self.failure("Some Python files use features that are not compatible with Python " \ - f"{self.MAX_VERSION_STR}.") - class TextEncoding(ComplianceTest): """ diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 2094546f423..bf4a50e2aa2 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -35,7 +35,6 @@ tabulate tomli>=1.1.0 tox unidiff -vermin west>=0.14.0 xlsxwriter yamllint diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 065d5992399..b1997b68439 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -1235,10 +1235,6 @@ urllib3==2.4.0 \ # elastic-transport # pygithub # requests -vermin==1.6.0 \ - --hash=sha256:6266ca02f55d1c2aa189a610017c132eb2d1934f09e72a955b1eb3820ee6d4ef \ - --hash=sha256:f1fa9ee40f59983dc40e0477eb2b1fa8061a3df4c3b2bcf349add462a5610efb - # via -r requirements-actions.in virtualenv==20.31.2 \ --hash=sha256:36efd0d9650ee985f0cad72065001e66d49a6f24eb44d98980f630686243cf11 \ --hash=sha256:e10c0a9d02835e592521be48b332b6caee6887f332c111aa79a09b9e79efc2af diff --git a/scripts/requirements-compliance.txt b/scripts/requirements-compliance.txt index 19bdcb3071f..a7134e7ff00 100644 --- a/scripts/requirements-compliance.txt +++ b/scripts/requirements-compliance.txt @@ -13,6 +13,5 @@ python-magic; sys_platform != "win32" ruff==0.11.11 sphinx-lint unidiff -vermin yamllint # zephyr-keep-sorted-stop From 841c28c9143b7394052075289d2dc15bdc0e5e64 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 019/881] Revert "[nrf fromtree] scripts: requirements: update pinned dependencies" This reverts commit cff056bd234fb91722e269d97254efcf846364e4. Signed-off-by: Jukka Rissanen --- scripts/requirements-actions.txt | 34 +++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index b1997b68439..61b88c95404 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -12,13 +12,13 @@ astroid==3.3.10 \ --hash=sha256:104fb9cb9b27ea95e847a94c003be03a9e039334a8ebca5ee27dafaf5c5711eb \ --hash=sha256:c332157953060c6deb9caa57303ae0d20b0fbdb2e59b4a4f2a6ba49d0a7961ce # via pylint -awscli==1.40.27 \ - --hash=sha256:92c84a3e9cbe3a7566bc738ad21201d9dad32dd7ab6a7a4906f7e1b29b9385ca \ - --hash=sha256:d1e1047cccd675b48ab215b4012c91673de73ba498f503fd6eda3de1a24995d7 +awscli==1.40.24 \ + --hash=sha256:6dbd7baebd5e01cd983dc8a816dfaa09155ce1825099ee09fd2044ea60024a3e \ + --hash=sha256:a5d8dffa523f332839ec95501364df45d763c3000f9a61247324e6cfa46a3bf2 # via -r requirements-actions.in -botocore==1.38.28 \ - --hash=sha256:515e1a535a27f17e1381aec1fb48eaa2c2308258c4db0bfd09e4f1cd1f239c44 \ - --hash=sha256:63d5977a10a375c3fc11c8e15e1ae5a4daaf450af135d55c170cc537648edf25 +botocore==1.38.25 \ + --hash=sha256:5a960bd990a11cdb78865e908a58ed712d87d9b419f55ad21c99d7d21f0d6726 \ + --hash=sha256:8c73e97d9662a6c92be33dab66cd1e2b59797154c7ec379ce3bb5d6779d9d78c # via # awscli # s3transfer @@ -840,9 +840,7 @@ pygithub==2.6.1 \ pygments==2.19.1 \ --hash=sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f \ --hash=sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c - # via - # gcovr - # pytest + # via gcovr pyjwt==2.10.1 \ --hash=sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953 \ --hash=sha256:dcdd193e30abefd5debf142f9adfcdd2b58004e644f25406ffaebd50bd98dacb @@ -877,9 +875,9 @@ pyserial==3.5 \ --hash=sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb \ --hash=sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0 # via -r requirements-actions.in -pytest==8.4.0 \ - --hash=sha256:14d920b48472ea0dbf68e45b96cd1ffda4705f33307dcc86c676c1b5104838a6 \ - --hash=sha256:f40f825768ad76c0977cbacdf1fd37c6f7a468e460ea6a0636078f8972d4517e +pytest==8.3.5 \ + --hash=sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820 \ + --hash=sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845 # via -r requirements-actions.in python-can==4.5.0 \ --hash=sha256:1eec66833c1ac76a7e3d636ee0f8b4ba2752e892bab1c56ce74308b2216b5445 \ @@ -1065,9 +1063,9 @@ rsa==4.7.2 \ --hash=sha256:78f9a9bf4e7be0c5ded4583326e7461e3a3c5aae24073648b4bdfa797d78c9d2 \ --hash=sha256:9d689e6ca1b3038bc82bf8d23e944b6b6037bc02301a574935b2dd946e0353b9 # via awscli -ruamel-yaml==0.18.12 \ - --hash=sha256:5a38fd5ce39d223bebb9e3a6779e86b9427a03fb0bf9f270060f8b149cffe5e2 \ - --hash=sha256:790ba4c48b6a6e6b12b532a7308779eb12d2aaab3a80fdb8389216f28ea2b287 +ruamel-yaml==0.18.11 \ + --hash=sha256:b586a3416676566ed45bf679a0909719f7ea7b58c03a9b6e03f905a1e2cd5076 \ + --hash=sha256:eca06c9fce6ee3220845c4c54e58376586e041a6127e4d1958e12a3142084897 # via pykwalify ruamel-yaml-clib==0.2.12 ; python_full_version < '3.14' and platform_python_implementation == 'CPython' \ --hash=sha256:040ae85536960525ea62868b642bdb0c2cc6021c9f9d507810c0c604e66f5a7b \ @@ -1212,9 +1210,9 @@ tox==4.26.0 \ --hash=sha256:75f17aaf09face9b97bd41645028d9f722301e912be8b4c65a3f938024560224 \ --hash=sha256:a83b3b67b0159fa58e44e646505079e35a43317a62d2ae94725e0586266faeca # via -r requirements-actions.in -typing-extensions==4.14.0 \ - --hash=sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4 \ - --hash=sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af +typing-extensions==4.13.2 \ + --hash=sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c \ + --hash=sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef # via # astroid # elasticsearch From 505dc77ea18308773492911700911d1bc15b4115 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 020/881] Revert "[nrf fromtree] scripts/kconfig/cmake: Generate/use env file for zephyr module paths" This reverts commit 0e3da0add10c30ded8d05a9084d0721ccffe53dc. Signed-off-by: Jukka Rissanen --- Kconfig.zephyr | 1 - cmake/modules/kconfig.cmake | 1 - doc/_extensions/zephyr/kconfig/__init__.py | 7 ---- scripts/ci/check_compliance.py | 16 +++------- scripts/zephyr_module.py | 37 +++++++--------------- share/sysbuild/Kconfig | 2 -- 6 files changed, 16 insertions(+), 48 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index ace2652550d..994730d1933 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -6,7 +6,6 @@ # SPDX-License-Identifier: Apache-2.0 source "Kconfig.constants" -source "$(KCONFIG_ENV_FILE)" osource "$(APPLICATION_SOURCE_DIR)/VERSION" diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index 1e2cf75f54b..ac5f1b83e4c 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -134,7 +134,6 @@ zephyr_get(APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR) set(COMMON_KCONFIG_ENV_SETTINGS PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} - KCONFIG_ENV_FILE=${KCONFIG_BINARY_DIR}/kconfig_module_dirs.env srctree=${ZEPHYR_BASE} KERNELVERSION=${KERNELVERSION} APPVERSION=${APP_VERSION_STRING} diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index a76ac87f887..dfb7a567da8 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -76,18 +76,12 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d modules = zephyr_module.parse_modules(ZEPHYR_BASE) # generate Kconfig.modules file - kconfig_module_dirs = "" kconfig = "" sysbuild_kconfig = "" for module in modules: - kconfig_module_dirs += zephyr_module.process_kconfig_module_dir(module.project, - module.meta) kconfig += zephyr_module.process_kconfig(module.project, module.meta) sysbuild_kconfig += zephyr_module.process_sysbuildkconfig(module.project, module.meta) - with open(Path(td) / "kconfig_module_dirs.env", "w") as f: - f.write(kconfig_module_dirs) - with open(Path(td) / "Kconfig.modules", "w") as f: f.write(kconfig) @@ -158,7 +152,6 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d os.environ["BOARD"] = "boards" os.environ["KCONFIG_BOARD_DIR"] = str(Path(td) / "boards") - os.environ["KCONFIG_ENV_FILE"] = str(Path(td) / "kconfig_module_dirs.env") # Sysbuild runs first os.environ["CONFIG_"] = "SB_CONFIG_" diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index d5f13ee84fc..5958fa52a7d 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -515,7 +515,7 @@ def run(self): self.check_no_undef_outside_kconfig(kconf) self.check_disallowed_defconfigs(kconf) - def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, settings_file): + def get_modules(self, modules_file, sysbuild_modules_file, settings_file): """ Get a list of modules and put them in a file that is parsed by Kconfig @@ -730,15 +730,13 @@ def parse_kconfig(self): os.environ["KCONFIG_BINARY_DIR"] = kconfiglib_dir os.environ['DEVICETREE_CONF'] = "dummy" os.environ['TOOLCHAIN_HAS_NEWLIB'] = "y" - os.environ['KCONFIG_ENV_FILE'] = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") # Older name for DEVICETREE_CONF, for compatibility with older Zephyr # versions that don't have the renaming os.environ["GENERATED_DTS_BOARD_CONF"] = "dummy" # For multi repo support - self.get_modules(os.environ['KCONFIG_ENV_FILE'], - os.path.join(kconfiglib_dir, "Kconfig.modules"), + self.get_modules(os.path.join(kconfiglib_dir, "Kconfig.modules"), os.path.join(kconfiglib_dir, "Kconfig.sysbuild.modules"), os.path.join(kconfiglib_dir, "settings_file.txt")) # For Kconfig.dts support @@ -1323,17 +1321,13 @@ class KconfigBasicNoModulesCheck(KconfigBasicCheck): """ name = "KconfigBasicNoModules" path_hint = "" - EMPTY_FILE_CONTENTS = "# Empty\n" - - def get_modules(self, module_dirs_file, modules_file, sysbuild_modules_file, settings_file): - with open(module_dirs_file, 'w') as fp_module_file: - fp_module_file.write(self.EMPTY_FILE_CONTENTS) + def get_modules(self, modules_file, sysbuild_modules_file, settings_file): with open(modules_file, 'w') as fp_module_file: - fp_module_file.write(self.EMPTY_FILE_CONTENTS) + fp_module_file.write("# Empty\n") with open(sysbuild_modules_file, 'w') as fp_module_file: - fp_module_file.write(self.EMPTY_FILE_CONTENTS) + fp_module_file.write("# Empty\n") class KconfigHWMv2Check(KconfigBasicCheck): diff --git a/scripts/zephyr_module.py b/scripts/zephyr_module.py index 8bf2d00793d..aeda845639e 100755 --- a/scripts/zephyr_module.py +++ b/scripts/zephyr_module.py @@ -386,12 +386,6 @@ def kconfig_snippet(meta, path, kconfig_file=None, blobs=False, taint_blobs=Fals return '\n'.join(snippet) -def process_kconfig_module_dir(module, meta): - module_path = PurePath(module) - name_sanitized = meta['name-sanitized'] - return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' - - def process_kconfig(module, meta): blobs = process_blobs(module, meta) taint_blobs = any(b['status'] != BLOB_NOT_PRESENT for b in blobs) @@ -399,9 +393,11 @@ def process_kconfig(module, meta): module_path = PurePath(module) module_yml = module_path.joinpath('zephyr/module.yml') kconfig_extern = section.get('kconfig-ext', False) + name_sanitized = meta['name-sanitized'] + snippet = f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR := {module_path.as_posix()}\n' if kconfig_extern: - return kconfig_snippet(meta, module_path, blobs=blobs, taint_blobs=taint_blobs) + return snippet + kconfig_snippet(meta, module_path, blobs=blobs, taint_blobs=taint_blobs) kconfig_setting = section.get('kconfig', None) if not validate_setting(kconfig_setting, module): @@ -411,11 +407,10 @@ def process_kconfig(module, meta): kconfig_file = os.path.join(module, kconfig_setting or 'zephyr/Kconfig') if os.path.isfile(kconfig_file): - return kconfig_snippet(meta, module_path, Path(kconfig_file), - blobs=blobs, taint_blobs=taint_blobs) + return snippet + kconfig_snippet(meta, module_path, Path(kconfig_file), + blobs=blobs, taint_blobs=taint_blobs) else: - name_sanitized = meta['name-sanitized'] - return '\n'.join(kconfig_module_opts(name_sanitized, blobs, taint_blobs)) + '\n' + return snippet + '\n'.join(kconfig_module_opts(name_sanitized, blobs, taint_blobs)) + '\n' def process_sysbuildkconfig(module, meta): @@ -424,9 +419,10 @@ def process_sysbuildkconfig(module, meta): module_yml = module_path.joinpath('zephyr/module.yml') kconfig_extern = section.get('sysbuild-kconfig-ext', False) name_sanitized = meta['name-sanitized'] + snippet = f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR := {module_path.as_posix()}\n' if kconfig_extern: - return kconfig_snippet(meta, module_path, sysbuild=True) + return snippet + kconfig_snippet(meta, module_path, sysbuild=True) kconfig_setting = section.get('sysbuild-kconfig', None) if not validate_setting(kconfig_setting, module): @@ -437,9 +433,10 @@ def process_sysbuildkconfig(module, meta): if kconfig_setting is not None: kconfig_file = os.path.join(module, kconfig_setting) if os.path.isfile(kconfig_file): - return kconfig_snippet(meta, module_path, Path(kconfig_file)) + return snippet + kconfig_snippet(meta, module_path, Path(kconfig_file)) - return (f'config ZEPHYR_{name_sanitized.upper()}_MODULE\n' + return snippet + \ + (f'config ZEPHYR_{name_sanitized.upper()}_MODULE\n' f' bool\n' f' default y\n') @@ -864,7 +861,6 @@ def main(): help='Path to zephyr repository') args = parser.parse_args() - kconfig_module_dirs = "" kconfig = "" cmake = "" sysbuild_kconfig = "" @@ -877,7 +873,6 @@ def main(): args.modules, args.extra_modules) for module in modules: - kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta) kconfig += process_kconfig(module.project, module.meta) cmake += process_cmake(module.project, module.meta) sysbuild_kconfig += process_sysbuildkconfig( @@ -886,16 +881,6 @@ def main(): settings += process_settings(module.project, module.meta) twister += process_twister(module.project, module.meta) - if args.kconfig_out or args.sysbuild_kconfig_out: - if args.kconfig_out: - kconfig_module_dirs_out = PurePath(args.kconfig_out).parent / 'kconfig_module_dirs.env' - elif args.sysbuild_kconfig_out: - kconfig_module_dirs_out = PurePath(args.sysbuild_kconfig_out).parent / \ - 'kconfig_module_dirs.env' - - with open(kconfig_module_dirs_out, 'w', encoding="utf-8") as fp: - fp.write(kconfig_module_dirs) - if args.kconfig_out: with open(args.kconfig_out, 'w', encoding="utf-8") as fp: fp.write(kconfig) diff --git a/share/sysbuild/Kconfig b/share/sysbuild/Kconfig index 6bf51245771..5f689e07399 100644 --- a/share/sysbuild/Kconfig +++ b/share/sysbuild/Kconfig @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 -source "$(KCONFIG_ENV_FILE)" - config BOARD string default "$(BOARD)" From 3331489df1c35373813e7ec2aa95e5c500719b7a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 021/881] Revert "[nrf fromtree] kconfig: Use $(...) instead of ${...} for getting variables" This reverts commit 32dce2ffd63fd3436794ef27b2fed2c5d1c1d9e5. Signed-off-by: Jukka Rissanen --- Kconfig.zephyr | 4 ++-- boards/qemu/x86/Kconfig.defconfig | 2 +- doc/build/sysbuild/images.rst | 6 +++--- drivers/usb/uvb/Kconfig | 2 +- kernel/Kconfig | 2 +- lib/runtime/Kconfig | 2 +- modules/nrf_wifi/bus/Kconfig | 2 +- modules/trusted-firmware-m/Kconfig.tfm | 18 +++++++++--------- samples/drivers/mbox/Kconfig.sysbuild | 8 ++++---- samples/sysbuild/hello_world/Kconfig.sysbuild | 2 +- share/sysbuild/images/firmware_loader/Kconfig | 2 +- subsys/bluetooth/Kconfig.logging | 6 +++--- subsys/testsuite/Kconfig | 2 +- tests/boards/nrf/nrfs/Kconfig.sysbuild | 2 +- .../audio_samples/bap_broadcast_sink/Kconfig | 2 +- .../bap_broadcast_sink/Kconfig.sysbuild | 2 +- .../bap_unicast_client/Kconfig.sysbuild | 2 +- .../audio_samples/cap/acceptor/Kconfig | 2 +- .../cap/acceptor/Kconfig.sysbuild | 2 +- .../audio_samples/cap/initiator/Kconfig | 2 +- .../cap/initiator/Kconfig.sysbuild | 2 +- .../ccp/call_control_client/Kconfig.sysbuild | 2 +- .../ccp/call_control_server/Kconfig.sysbuild | 2 +- .../samples/central_hr_peripheral_hr/Kconfig | 2 +- .../central_hr_peripheral_hr/Kconfig.sysbuild | 2 +- tests/bsim/net/sockets/echo_test/Kconfig | 2 +- tests/cmake/sysbuild_snippets/Kconfig.sysbuild | 2 +- tests/subsys/ipc/ipc_sessions/Kconfig.sysbuild | 2 +- 28 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 994730d1933..4993e56c8b2 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -7,7 +7,7 @@ source "Kconfig.constants" -osource "$(APPLICATION_SOURCE_DIR)/VERSION" +osource "${APPLICATION_SOURCE_DIR}/VERSION" # Include Kconfig.defconfig files first so that they can override defaults and # other symbol/choice properties by adding extra symbol/choice definitions. @@ -967,7 +967,7 @@ config BUILD_OUTPUT_STRIP_PATHS bool "Strip absolute paths from binaries" default y help - If the compiler supports it, strip the $(ZEPHYR_BASE) prefix from the + If the compiler supports it, strip the ${ZEPHYR_BASE} prefix from the __FILE__ macro used in __ASSERT*, in the .noinit."/home/joe/zephyr/fu/bar.c" section names and in any application code. diff --git a/boards/qemu/x86/Kconfig.defconfig b/boards/qemu/x86/Kconfig.defconfig index 5a039094f83..5afe94d68e5 100644 --- a/boards/qemu/x86/Kconfig.defconfig +++ b/boards/qemu/x86/Kconfig.defconfig @@ -100,7 +100,7 @@ config HAVE_CUSTOM_LINKER_SCRIPT default y config CUSTOM_LINKER_SCRIPT - default "$(ZEPHYR_BASE)/boards/qemu/x86/qemu_x86_tiny.ld" + default "${ZEPHYR_BASE}/boards/qemu/x86/qemu_x86_tiny.ld" config X86_EXTRA_PAGE_TABLE_PAGES # This is needed for gen_mmu.py to map the flash into memory diff --git a/doc/build/sysbuild/images.rst b/doc/build/sysbuild/images.rst index 00075894cef..3ccfd873e16 100644 --- a/doc/build/sysbuild/images.rst +++ b/doc/build/sysbuild/images.rst @@ -151,13 +151,13 @@ more complex to create but is the preferred method for adding images to upstream config OTHER_APP_IMAGE_PATH string - default "$(ZEPHYR_MY_IMAGE_MODULE_DIR)/path/to/my_image" if OTHER_APP_IMAGE_MY_IMAGE + default "${ZEPHYR_MY_IMAGE_MODULE_DIR}/path/to/my_image" if OTHER_APP_IMAGE_MY_IMAGE help Source directory of other app image. .. note:: - Remember to have ``source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig"`` in the file if this + Remember to have ``source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"`` in the file if this is being applied in an application ``Kconfig.sysbuild`` file. .. group-tab:: ``sysbuild.cmake`` @@ -212,7 +212,7 @@ This can then be extended by :ref:`modules` like so: default "my_second_image" if OTHER_APP_IMAGE_MY_SECOND_IMAGE config OTHER_APP_IMAGE_PATH - default "$(ZEPHYR_MY_SECOND_IMAGE_MODULE_DIR)/path/to/my_second_image" if OTHER_APP_IMAGE_MY_SECOND_IMAGE + default "${ZEPHYR_MY_SECOND_IMAGE_MODULE_DIR}/path/to/my_second_image" if OTHER_APP_IMAGE_MY_SECOND_IMAGE As can be seen, no additional CMake changes are needed to add an alternative image as the base CMake code will add the replacement image instead of the original image, if selected. diff --git a/drivers/usb/uvb/Kconfig b/drivers/usb/uvb/Kconfig index 039296dd3ba..77e893cff50 100644 --- a/drivers/usb/uvb/Kconfig +++ b/drivers/usb/uvb/Kconfig @@ -22,6 +22,6 @@ config UVB_MAX_MESSAGES module = UVB module-str = USB virtual bus service -source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" endif # UVB diff --git a/kernel/Kconfig b/kernel/Kconfig index 9afeeaa5e67..c2976b9f281 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -942,7 +942,7 @@ config STACK_CANARIES_ALL config STACK_CANARIES_EXPLICIT bool "Explicit protection" depends on ENTROPY_GENERATOR || TEST_RANDOM_GENERATOR - depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" + depends on "${ZEPHYR_TOOLCHAIN_VARIANT}" = "zephyr" select NEED_LIBC_MEM_PARTITION if !STACK_CANARIES_TLS select REQUIRES_STACK_CANARIES help diff --git a/lib/runtime/Kconfig b/lib/runtime/Kconfig index 9be8ac5b7ae..afb78f5b82b 100644 --- a/lib/runtime/Kconfig +++ b/lib/runtime/Kconfig @@ -4,7 +4,7 @@ config COMPILER_RT_SUPPORTED bool default y - depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm" + depends on "${ZEPHYR_TOOLCHAIN_VARIANT}" = "llvm" help Selected when the compiler supports compiler-rt runtime library. diff --git a/modules/nrf_wifi/bus/Kconfig b/modules/nrf_wifi/bus/Kconfig index 430cf3ba9ff..3fed449bb80 100644 --- a/modules/nrf_wifi/bus/Kconfig +++ b/modules/nrf_wifi/bus/Kconfig @@ -43,7 +43,7 @@ config NRF71_ON_IPC module = WIFI_NRF70_BUSLIB module-dep = LOG module-str = Log level for Wi-Fi nRF70 bus library -source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" config WIFI_NRF70_BUSLIB_LOG_LEVEL # Enable error by default diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 55e08ee45e4..97591ac8a83 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -23,11 +23,11 @@ config TFM_BOARD default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9160" if SOC_NRF9160 - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9120" if SOC_NRF9120 - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l15_cpuapp" if SOC_NRF54L15_CPUAPP - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP + default "${ZEPHYR_BASE}/modules/trusted-firmware-m/nordic/nrf9160" if SOC_NRF9160 + default "${ZEPHYR_BASE}/modules/trusted-firmware-m/nordic/nrf9120" if SOC_NRF9120 + default "${ZEPHYR_BASE}/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP + default "${ZEPHYR_BASE}/modules/trusted-firmware-m/nordic/nrf54l15_cpuapp" if SOC_NRF54L15_CPUAPP + default "${ZEPHYR_BASE}/modules/trusted-firmware-m/nordic/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP help The board name used for building TFM. Building with TFM requires that TFM has been ported to the given board/SoC. @@ -256,7 +256,7 @@ config TFM_BL2_SIGNING_KEY_PATH string "Path to private key used to sign BL2 firmware images." help Path to binary BL2 signing private key - Default is $(ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR)/bl1/bl1_2/bl1_dummy_rotpk + Default is ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/bl1/bl1_2/bl1_dummy_rotpk if it has not been changed on TF-M side for your board endif # TFM_BL1 @@ -281,7 +281,7 @@ config TFM_MCUBOOT_SIGNATURE_TYPE config TFM_KEY_FILE_S string "Path to private key used to sign secure firmware images." - default "$(ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR)/bl2/ext/mcuboot/root-${CONFIG_TFM_MCUBOOT_SIGNATURE_TYPE}.pem" + default "${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/bl2/ext/mcuboot/root-${CONFIG_TFM_MCUBOOT_SIGNATURE_TYPE}.pem" help The path and filename for the .pem file containing the private key that should be used by the BL2 bootloader when signing secure @@ -290,7 +290,7 @@ config TFM_KEY_FILE_S config TFM_KEY_FILE_NS string "Path to private key used to sign non-secure firmware images." - default "$(ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR)/bl2/ext/mcuboot/root-${CONFIG_TFM_MCUBOOT_SIGNATURE_TYPE}_1.pem" + default "${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/bl2/ext/mcuboot/root-${CONFIG_TFM_MCUBOOT_SIGNATURE_TYPE}_1.pem" help The path and filename for the .pem file containing the private key that should be used by the BL2 bootloader when signing non-secure @@ -334,7 +334,7 @@ endchoice config TFM_ETHOS_DRIVER_PATH_LOCAL string "Path to a locally available Ethos-U driver or an empty string" depends on SOC_SERIES_MPS3 || SOC_SERIES_MPS4 - default "$(ZEPHYR_HAL_ETHOS_U_MODULE_DIR)" + default "${ZEPHYR_HAL_ETHOS_U_MODULE_DIR}" help Path to a locally available Ethos-U driver to be used for TF-M builds or an empty string to allow TF-M to automatically fetch the Ethos-U diff --git a/samples/drivers/mbox/Kconfig.sysbuild b/samples/drivers/mbox/Kconfig.sysbuild index 5cffe27038f..e5408e9bd4d 100644 --- a/samples/drivers/mbox/Kconfig.sysbuild +++ b/samples/drivers/mbox/Kconfig.sysbuild @@ -23,8 +23,8 @@ config REMOTE_BOARD default "nrf54lm20dk/nrf54lm20a/cpuflpr" if $(BOARD) = "nrf54lm20dk" default "ophelia4ev/cpuflpr" if $(BOARD) = "ophelia4ev" default "stm32h747i_disco/stm32h747xx/m4" if $(BOARD) = "stm32h747i_disco" - default "esp32_devkitc/esp32/appcpu" if "$(BOARD)$(BOARD_QUALIFIERS)" = "esp32_devkitc/esp32/procpu" - default "esp32s3_devkitm/esp32s3/appcpu" if "$(BOARD)$(BOARD_QUALIFIERS)" = "esp32s3_devkitm/esp32s3/procpu" - default "esp32c6_devkitc/esp32c6/lpcore" if "$(BOARD)$(BOARD_QUALIFIERS)" = "esp32c6_devkitc/esp32c6/hpcore" - default "bl54l15_dvk/nrf54l15/cpuflpr" if "$(BOARD)$(BOARD_QUALIFIERS)" = "bl54l15_dvk/nrf54l15/cpuapp" + default "esp32_devkitc/esp32/appcpu" if "$(BOARD)${BOARD_QUALIFIERS}" = "esp32_devkitc/esp32/procpu" + default "esp32s3_devkitm/esp32s3/appcpu" if "$(BOARD)${BOARD_QUALIFIERS}" = "esp32s3_devkitm/esp32s3/procpu" + default "esp32c6_devkitc/esp32c6/lpcore" if "$(BOARD)${BOARD_QUALIFIERS}" = "esp32c6_devkitc/esp32c6/hpcore" + default "bl54l15_dvk/nrf54l15/cpuflpr" if "$(BOARD)${BOARD_QUALIFIERS}" = "bl54l15_dvk/nrf54l15/cpuapp" default "bl54l15u_dvk/nrf54l15/cpuflpr" if $(BOARD) = "bl54l15u_dvk" diff --git a/samples/sysbuild/hello_world/Kconfig.sysbuild b/samples/sysbuild/hello_world/Kconfig.sysbuild index 53ed4507b76..edec01b94c9 100644 --- a/samples/sysbuild/hello_world/Kconfig.sysbuild +++ b/samples/sysbuild/hello_world/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig" +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" config REMOTE_BOARD string "The board used for remote target" diff --git a/share/sysbuild/images/firmware_loader/Kconfig b/share/sysbuild/images/firmware_loader/Kconfig index 2ff27251b92..a5c4283ad5c 100644 --- a/share/sysbuild/images/firmware_loader/Kconfig +++ b/share/sysbuild/images/firmware_loader/Kconfig @@ -32,6 +32,6 @@ config FIRMWARE_LOADER_IMAGE_NAME config FIRMWARE_LOADER_IMAGE_PATH string - default "$(ZEPHYR_BASE)/samples/subsys/mgmt/mcumgr/smp_svr" if FIRMWARE_LOADER_IMAGE_SMP_SVR + default "${ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr" if FIRMWARE_LOADER_IMAGE_SMP_SVR help Source directory of firmware loader image. diff --git a/subsys/bluetooth/Kconfig.logging b/subsys/bluetooth/Kconfig.logging index 850fb987230..7ccaf55c2d6 100644 --- a/subsys/bluetooth/Kconfig.logging +++ b/subsys/bluetooth/Kconfig.logging @@ -358,7 +358,7 @@ endif # BT_VOCS_CLIENT if BT_PBP module = BT_PBP module-str = "Public Broadcast Profile" -source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" endif # BT_PBP endmenu # Audio @@ -539,7 +539,7 @@ endif # BT_IAS_CLIENT if BT_IAS module = BT_IAS module-str = IAS -source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" endif # BT_IAS # OTS (subsys/bluetooth/services/ots/Kconfig) @@ -553,7 +553,7 @@ endif # BT_OTS_CLIENT if BT_OTS module = BT_OTS module-str = BT_OTS -source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" endif # BT_OTS endmenu # Services diff --git a/subsys/testsuite/Kconfig b/subsys/testsuite/Kconfig index 9e72a5696fd..dd1aff5b625 100644 --- a/subsys/testsuite/Kconfig +++ b/subsys/testsuite/Kconfig @@ -56,7 +56,7 @@ config COVERAGE_NATIVE_GCOV config COVERAGE_NATIVE_SOURCE bool "Host compiler source based code coverage" depends on NATIVE_BUILD - depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm" + depends on "${ZEPHYR_TOOLCHAIN_VARIANT}" = "llvm" help Build natively with the compiler source based coverage options. Today this is only supported with LLVM diff --git a/tests/boards/nrf/nrfs/Kconfig.sysbuild b/tests/boards/nrf/nrfs/Kconfig.sysbuild index 6c4c8618f3e..6cc7dc9575a 100644 --- a/tests/boards/nrf/nrfs/Kconfig.sysbuild +++ b/tests/boards/nrf/nrfs/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig" +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" config REMOTE_BOARD string diff --git a/tests/bsim/bluetooth/audio_samples/bap_broadcast_sink/Kconfig b/tests/bsim/bluetooth/audio_samples/bap_broadcast_sink/Kconfig index 2b474ba2a4c..040286af18c 100644 --- a/tests/bsim/bluetooth/audio_samples/bap_broadcast_sink/Kconfig +++ b/tests/bsim/bluetooth/audio_samples/bap_broadcast_sink/Kconfig @@ -1,4 +1,4 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/bap_broadcast_sink/Kconfig" +source "${ZEPHYR_BASE}/samples/bluetooth/bap_broadcast_sink/Kconfig" diff --git a/tests/bsim/bluetooth/audio_samples/bap_broadcast_sink/Kconfig.sysbuild b/tests/bsim/bluetooth/audio_samples/bap_broadcast_sink/Kconfig.sysbuild index 5f0b50c7563..b6f4d0678e8 100644 --- a/tests/bsim/bluetooth/audio_samples/bap_broadcast_sink/Kconfig.sysbuild +++ b/tests/bsim/bluetooth/audio_samples/bap_broadcast_sink/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/bap_broadcast_sink/Kconfig.sysbuild" +source "${ZEPHYR_BASE}/samples/bluetooth/bap_broadcast_sink/Kconfig.sysbuild" config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX int diff --git a/tests/bsim/bluetooth/audio_samples/bap_unicast_client/Kconfig.sysbuild b/tests/bsim/bluetooth/audio_samples/bap_unicast_client/Kconfig.sysbuild index 54467d2a2d2..6db98670507 100644 --- a/tests/bsim/bluetooth/audio_samples/bap_unicast_client/Kconfig.sysbuild +++ b/tests/bsim/bluetooth/audio_samples/bap_unicast_client/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/bap_unicast_client/Kconfig.sysbuild" +source "${ZEPHYR_BASE}/samples/bluetooth/bap_unicast_client/Kconfig.sysbuild" config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX int diff --git a/tests/bsim/bluetooth/audio_samples/cap/acceptor/Kconfig b/tests/bsim/bluetooth/audio_samples/cap/acceptor/Kconfig index 7c94a093305..8a2dcf8e5ae 100644 --- a/tests/bsim/bluetooth/audio_samples/cap/acceptor/Kconfig +++ b/tests/bsim/bluetooth/audio_samples/cap/acceptor/Kconfig @@ -1,4 +1,4 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/cap_acceptor/Kconfig" +source "${ZEPHYR_BASE}/samples/bluetooth/cap_acceptor/Kconfig" diff --git a/tests/bsim/bluetooth/audio_samples/cap/acceptor/Kconfig.sysbuild b/tests/bsim/bluetooth/audio_samples/cap/acceptor/Kconfig.sysbuild index a73e90e4288..3b2c35e65c5 100644 --- a/tests/bsim/bluetooth/audio_samples/cap/acceptor/Kconfig.sysbuild +++ b/tests/bsim/bluetooth/audio_samples/cap/acceptor/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2023-2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/cap_acceptor/Kconfig.sysbuild" +source "${ZEPHYR_BASE}/samples/bluetooth/cap_acceptor/Kconfig.sysbuild" config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX int diff --git a/tests/bsim/bluetooth/audio_samples/cap/initiator/Kconfig b/tests/bsim/bluetooth/audio_samples/cap/initiator/Kconfig index b21d8aad490..7027c92b590 100644 --- a/tests/bsim/bluetooth/audio_samples/cap/initiator/Kconfig +++ b/tests/bsim/bluetooth/audio_samples/cap/initiator/Kconfig @@ -1,4 +1,4 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/cap_initiator/Kconfig" +source "${ZEPHYR_BASE}/samples/bluetooth/cap_initiator/Kconfig" diff --git a/tests/bsim/bluetooth/audio_samples/cap/initiator/Kconfig.sysbuild b/tests/bsim/bluetooth/audio_samples/cap/initiator/Kconfig.sysbuild index fb7ee3a61da..c9f3abf294f 100644 --- a/tests/bsim/bluetooth/audio_samples/cap/initiator/Kconfig.sysbuild +++ b/tests/bsim/bluetooth/audio_samples/cap/initiator/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2023-2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/cap_initiator/Kconfig.sysbuild" +source "${ZEPHYR_BASE}/samples/bluetooth/cap_initiator/Kconfig.sysbuild" config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX int diff --git a/tests/bsim/bluetooth/audio_samples/ccp/call_control_client/Kconfig.sysbuild b/tests/bsim/bluetooth/audio_samples/ccp/call_control_client/Kconfig.sysbuild index fa711c8f6d3..2fdcdcf687c 100644 --- a/tests/bsim/bluetooth/audio_samples/ccp/call_control_client/Kconfig.sysbuild +++ b/tests/bsim/bluetooth/audio_samples/ccp/call_control_client/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2023-2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/ccp_call_control_client/Kconfig.sysbuild" +source "${ZEPHYR_BASE}/samples/bluetooth/ccp_call_control_client/Kconfig.sysbuild" config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX int diff --git a/tests/bsim/bluetooth/audio_samples/ccp/call_control_server/Kconfig.sysbuild b/tests/bsim/bluetooth/audio_samples/ccp/call_control_server/Kconfig.sysbuild index 8fe269f15e1..f2b0bb8c607 100644 --- a/tests/bsim/bluetooth/audio_samples/ccp/call_control_server/Kconfig.sysbuild +++ b/tests/bsim/bluetooth/audio_samples/ccp/call_control_server/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2023-2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/bluetooth/ccp_call_control_server/Kconfig.sysbuild" +source "${ZEPHYR_BASE}/samples/bluetooth/ccp_call_control_server/Kconfig.sysbuild" config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX int diff --git a/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/Kconfig b/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/Kconfig index 196e362034e..e2cbc2de917 100644 --- a/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/Kconfig +++ b/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/Kconfig @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # source sample's Kconfig, if any -# source "$(ZEPHYR_BASE)/samples/bluetooth/central_hr/Kconfig" +# source "${ZEPHYR_BASE}/samples/bluetooth/central_hr/Kconfig" # OR # source Zephyr Kernel's Kconfig, as below (not both) menu "Zephyr Kernel" diff --git a/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/Kconfig.sysbuild b/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/Kconfig.sysbuild index c0dcdf6e24e..8a4e25038c4 100644 --- a/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/Kconfig.sysbuild +++ b/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/Kconfig.sysbuild @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # source the samples' Kconfig.sysbuild, if any -source "$(ZEPHYR_BASE)/samples/bluetooth/central_hr/Kconfig.sysbuild" +source "${ZEPHYR_BASE}/samples/bluetooth/central_hr/Kconfig.sysbuild" config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX int diff --git a/tests/bsim/net/sockets/echo_test/Kconfig b/tests/bsim/net/sockets/echo_test/Kconfig index 2a5bde5e9d0..7c48b4fca91 100644 --- a/tests/bsim/net/sockets/echo_test/Kconfig +++ b/tests/bsim/net/sockets/echo_test/Kconfig @@ -1,4 +1,4 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -source "$(ZEPHYR_BASE)/samples/net/sockets/echo_client/Kconfig" +source "${ZEPHYR_BASE}/samples/net/sockets/echo_client/Kconfig" diff --git a/tests/cmake/sysbuild_snippets/Kconfig.sysbuild b/tests/cmake/sysbuild_snippets/Kconfig.sysbuild index bf3fb5fc4b3..e3691432511 100644 --- a/tests/cmake/sysbuild_snippets/Kconfig.sysbuild +++ b/tests/cmake/sysbuild_snippets/Kconfig.sysbuild @@ -19,4 +19,4 @@ config EXPECTED_APP_TEST_FOO_VAL help Expected application value for the test. -source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig" +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/tests/subsys/ipc/ipc_sessions/Kconfig.sysbuild b/tests/subsys/ipc/ipc_sessions/Kconfig.sysbuild index ad83e2107b6..3c064f59d52 100644 --- a/tests/subsys/ipc/ipc_sessions/Kconfig.sysbuild +++ b/tests/subsys/ipc/ipc_sessions/Kconfig.sysbuild @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig" +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" config REMOTE_BOARD string "The board used for remote target" From 776f8afc71e10f89aa0d17d73f61ef13444629f8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 022/881] Revert "[nrf fromtree] samples: mbox: Add support for ESP32C6" This reverts commit d550fd27201c099371377c1dbfae9ee03b22171b. Signed-off-by: Jukka Rissanen --- samples/drivers/mbox/CMakeLists.txt | 1 - samples/drivers/mbox/Kconfig.sysbuild | 1 - .../mbox/boards/esp32c6_devkitc_hpcore.conf | 1 - .../boards/esp32c6_devkitc_hpcore.overlay | 26 ------------------- samples/drivers/mbox/remote/CMakeLists.txt | 1 - .../boards/esp32c6_devkitc_lpcore.overlay | 26 ------------------- 6 files changed, 56 deletions(-) delete mode 100644 samples/drivers/mbox/boards/esp32c6_devkitc_hpcore.conf delete mode 100644 samples/drivers/mbox/boards/esp32c6_devkitc_hpcore.overlay delete mode 100644 samples/drivers/mbox/remote/boards/esp32c6_devkitc_lpcore.overlay diff --git a/samples/drivers/mbox/CMakeLists.txt b/samples/drivers/mbox/CMakeLists.txt index dc03717d2ce..e5d5e612c79 100644 --- a/samples/drivers/mbox/CMakeLists.txt +++ b/samples/drivers/mbox/CMakeLists.txt @@ -23,7 +23,6 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_MCX_N9XX_EVK_MCXN947_CPU0 OR CONFIG_BOARD_ESP32_DEVKITC_ESP32_PROCPU OR CONFIG_BOARD_ESP32S3_DEVKITM_ESP32S3_PROCPU OR - CONFIG_BOARD_ESP32C6_DEVKITC_ESP32C6_HPCORE OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUAPP OR CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUAPP OR diff --git a/samples/drivers/mbox/Kconfig.sysbuild b/samples/drivers/mbox/Kconfig.sysbuild index e5408e9bd4d..2a79840f389 100644 --- a/samples/drivers/mbox/Kconfig.sysbuild +++ b/samples/drivers/mbox/Kconfig.sysbuild @@ -25,6 +25,5 @@ config REMOTE_BOARD default "stm32h747i_disco/stm32h747xx/m4" if $(BOARD) = "stm32h747i_disco" default "esp32_devkitc/esp32/appcpu" if "$(BOARD)${BOARD_QUALIFIERS}" = "esp32_devkitc/esp32/procpu" default "esp32s3_devkitm/esp32s3/appcpu" if "$(BOARD)${BOARD_QUALIFIERS}" = "esp32s3_devkitm/esp32s3/procpu" - default "esp32c6_devkitc/esp32c6/lpcore" if "$(BOARD)${BOARD_QUALIFIERS}" = "esp32c6_devkitc/esp32c6/hpcore" default "bl54l15_dvk/nrf54l15/cpuflpr" if "$(BOARD)${BOARD_QUALIFIERS}" = "bl54l15_dvk/nrf54l15/cpuapp" default "bl54l15u_dvk/nrf54l15/cpuflpr" if $(BOARD) = "bl54l15u_dvk" diff --git a/samples/drivers/mbox/boards/esp32c6_devkitc_hpcore.conf b/samples/drivers/mbox/boards/esp32c6_devkitc_hpcore.conf deleted file mode 100644 index 7d425a10aa2..00000000000 --- a/samples/drivers/mbox/boards/esp32c6_devkitc_hpcore.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_ULP_COPROC_ENABLED=y diff --git a/samples/drivers/mbox/boards/esp32c6_devkitc_hpcore.overlay b/samples/drivers/mbox/boards/esp32c6_devkitc_hpcore.overlay deleted file mode 100644 index a597cd0f12a..00000000000 --- a/samples/drivers/mbox/boards/esp32c6_devkitc_hpcore.overlay +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - zephyr,ipc_shm = &shmlp; - zephyr,ipc = &mbox0; - }; - - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&mbox0 0>, <&mbox0 1>; - mbox-names = "tx", "rx"; - }; -}; - -&mbox0 { - status = "okay"; -}; - -&lp_uart { - status = "okay"; -}; diff --git a/samples/drivers/mbox/remote/CMakeLists.txt b/samples/drivers/mbox/remote/CMakeLists.txt index a2c07a2dd2a..bd4c9e2e20e 100644 --- a/samples/drivers/mbox/remote/CMakeLists.txt +++ b/samples/drivers/mbox/remote/CMakeLists.txt @@ -21,7 +21,6 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET OR CONFIG_BOARD_MCX_N9XX_EVK_MCXN947_CPU1 OR CONFIG_BOARD_ESP32_DEVKITC_ESP32_APPCPU OR CONFIG_BOARD_ESP32S3_DEVKITM_ESP32S3_APPCPU OR - CONFIG_BOARD_ESP32C6_DEVKITC_ESP32C6_LPCORE OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUFLPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR diff --git a/samples/drivers/mbox/remote/boards/esp32c6_devkitc_lpcore.overlay b/samples/drivers/mbox/remote/boards/esp32c6_devkitc_lpcore.overlay deleted file mode 100644 index 4717edbd985..00000000000 --- a/samples/drivers/mbox/remote/boards/esp32c6_devkitc_lpcore.overlay +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 Felipe Neves. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - zephyr,ipc_shm = &shmlp; - zephyr,ipc = &mbox0; - }; - - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&mbox0 1>, <&mbox0 0>; - mbox-names = "tx", "rx"; - }; -}; - -&mbox0 { - status = "okay"; -}; - -&lp_uart { - status = "okay"; -}; From dc05edb1a985dae6ea59e8977c97de5181ae4145 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 023/881] Revert "[nrf fromtree] modules: ethos_u: arm: update for MPS4" This reverts commit 370ff7bb18ab2d78790006b8e3fee8586d57adf8. Signed-off-by: Jukka Rissanen --- modules/hal_ethos_u/Kconfig | 5 ++--- modules/trusted-firmware-m/Kconfig.tfm | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/hal_ethos_u/Kconfig b/modules/hal_ethos_u/Kconfig index e7b045c2352..4ca5136cf02 100644 --- a/modules/hal_ethos_u/Kconfig +++ b/modules/hal_ethos_u/Kconfig @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2021-2022, 2024-2025 Arm Limited and/or its +# SPDX-FileCopyrightText: Copyright 2021-2022, 2024 Arm Limited and/or its # affiliates # SPDX-License-Identifier: Apache-2.0 @@ -13,8 +13,7 @@ if ARM_ETHOS_U menu "Arm Ethos-U NPU configuration" choice ARM_ETHOS_U_NPU_CONFIG prompt "Arm Ethos-U NPU configuration" - default ARM_ETHOS_U55_128 if SOC_SERIES_MPS3 - default ARM_ETHOS_U85_256 if SOC_SERIES_MPS4 + default ARM_ETHOS_U55_128 config ARM_ETHOS_U55_64 bool "using Ethos-U55 with 64 macs" config ARM_ETHOS_U55_128 diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 97591ac8a83..d1cf81f8f0a 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -2,7 +2,7 @@ # Copyright (c) 2019, 2020 Linaro Limited # Copyright (c) 2020, 2021 Nordic Semiconductor ASA -# Copyright 2024-2025 Arm Limited and/or its affiliates +# Copyright 2024 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 config ZEPHYR_TRUSTED_FIRMWARE_M_MODULE @@ -333,7 +333,7 @@ endchoice config TFM_ETHOS_DRIVER_PATH_LOCAL string "Path to a locally available Ethos-U driver or an empty string" - depends on SOC_SERIES_MPS3 || SOC_SERIES_MPS4 + depends on SOC_SERIES_MPS3 default "${ZEPHYR_HAL_ETHOS_U_MODULE_DIR}" help Path to a locally available Ethos-U driver to be used for TF-M builds or From 2c02aed5884b950ba7461bada27c921b95aa358e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 024/881] Revert "[nrf fromtree] boards: mps4: Add initial support for corstone315" This reverts commit c7861ae07c2282aed1d25532b179bbf83a3102d4. Signed-off-by: Jukka Rissanen --- boards/arm/mps4/Kconfig.defconfig | 4 +- boards/arm/mps4/Kconfig.mps4 | 1 - boards/arm/mps4/board.cmake | 10 +- boards/arm/mps4/board.yml | 5 - boards/arm/mps4/mps4_corstone315_fvp.dts | 97 ----------------- boards/arm/mps4/mps4_corstone315_fvp.yaml | 26 ----- .../arm/mps4/mps4_corstone315_fvp_defconfig | 19 ---- boards/arm/mps4/mps4_corstone315_fvp_ns.dts | 102 ------------------ boards/arm/mps4/mps4_corstone315_fvp_ns.yaml | 15 --- .../mps4/mps4_corstone315_fvp_ns_defconfig | 19 ---- soc/arm/mps4/Kconfig | 12 --- .../mps4/Kconfig.defconfig.mps4_corstone315 | 9 -- soc/arm/mps4/Kconfig.soc | 5 - soc/arm/soc.yml | 1 - 14 files changed, 5 insertions(+), 320 deletions(-) delete mode 100644 boards/arm/mps4/mps4_corstone315_fvp.dts delete mode 100644 boards/arm/mps4/mps4_corstone315_fvp.yaml delete mode 100644 boards/arm/mps4/mps4_corstone315_fvp_defconfig delete mode 100644 boards/arm/mps4/mps4_corstone315_fvp_ns.dts delete mode 100644 boards/arm/mps4/mps4_corstone315_fvp_ns.yaml delete mode 100644 boards/arm/mps4/mps4_corstone315_fvp_ns_defconfig delete mode 100644 soc/arm/mps4/Kconfig.defconfig.mps4_corstone315 diff --git a/boards/arm/mps4/Kconfig.defconfig b/boards/arm/mps4/Kconfig.defconfig index 96cbd9472ea..b4e98775386 100644 --- a/boards/arm/mps4/Kconfig.defconfig +++ b/boards/arm/mps4/Kconfig.defconfig @@ -1,7 +1,7 @@ # Copyright 2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 -if BOARD_MPS4_CORSTONE315_FVP || BOARD_MPS4_CORSTONE320_FVP +if BOARD_MPS4_CORSTONE320_FVP if SERIAL @@ -10,7 +10,7 @@ config UART_INTERRUPT_DRIVEN endif # SERIAL -if ROMSTART_RELOCATION_ROM && (BOARD_MPS4_CORSTONE315_FVP || BOARD_MPS4_CORSTONE320_FVP) +if ROMSTART_RELOCATION_ROM && BOARD_MPS4_CORSTONE320_FVP config ROMSTART_REGION_ADDRESS default $(dt_nodelabel_reg_addr_hex,itcm) diff --git a/boards/arm/mps4/Kconfig.mps4 b/boards/arm/mps4/Kconfig.mps4 index 46ce14cc062..ffb494cf337 100644 --- a/boards/arm/mps4/Kconfig.mps4 +++ b/boards/arm/mps4/Kconfig.mps4 @@ -3,5 +3,4 @@ config BOARD_MPS4 select SOC_SERIES_MPS4 - select SOC_MPS4_CORSTONE315 if BOARD_MPS4_CORSTONE315_FVP || BOARD_MPS4_CORSTONE315_FVP_NS select SOC_MPS4_CORSTONE320 if BOARD_MPS4_CORSTONE320_FVP || BOARD_MPS4_CORSTONE320_FVP_NS diff --git a/boards/arm/mps4/board.cmake b/boards/arm/mps4/board.cmake index 4e5044ab1b7..6497c65c426 100644 --- a/boards/arm/mps4/board.cmake +++ b/boards/arm/mps4/board.cmake @@ -7,15 +7,10 @@ # -if(CONFIG_BOARD_MPS4_CORSTONE315_FVP OR CONFIG_BOARD_MPS4_CORSTONE315_FVP_NS) - set(SUPPORTED_EMU_PLATFORMS armfvp) - set(ARMFVP_BIN_NAME FVP_Corstone_SSE-315) -elseif(CONFIG_BOARD_MPS4_CORSTONE320_FVP OR CONFIG_BOARD_MPS4_CORSTONE320_FVP_NS) +if(CONFIG_BOARD_MPS4_CORSTONE320_FVP OR CONFIG_BOARD_MPS4_CORSTONE320_FVP_NS) set(SUPPORTED_EMU_PLATFORMS armfvp) set(ARMFVP_BIN_NAME FVP_Corstone_SSE-320) -endif() - -if(CONFIG_BOARD_MPS4_CORSTONE315_FVP OR CONFIG_BOARD_MPS4_CORSTONE320_FVP) + if(CONFIG_BOARD_MPS4_CORSTONE320_FVP) set(ARMFVP_FLAGS # default is '0x11000000' but should match cpu.INITSVTOR which is 0. -C mps4_board.subsystem.iotss3_systemcontrol.INITSVTOR_RST=0 @@ -24,6 +19,7 @@ if(CONFIG_BOARD_MPS4_CORSTONE315_FVP OR CONFIG_BOARD_MPS4_CORSTONE320_FVP) # few MPU tests to fail. -C mps4_board.subsystem.cpu0.MPU_S=16 ) + endif() endif() if(CONFIG_BUILD_WITH_TFM) diff --git a/boards/arm/mps4/board.yml b/boards/arm/mps4/board.yml index 760321039f6..8c2b411846f 100644 --- a/boards/arm/mps4/board.yml +++ b/boards/arm/mps4/board.yml @@ -3,11 +3,6 @@ board: full_name: MPS4 vendor: arm socs: - - name: 'corstone315' - variants: - - name: 'fvp' - variants: - - name: 'ns' - name: 'corstone320' variants: - name: 'fvp' diff --git a/boards/arm/mps4/mps4_corstone315_fvp.dts b/boards/arm/mps4/mps4_corstone315_fvp.dts deleted file mode 100644 index 98c87ce7ed7..00000000000 --- a/boards/arm/mps4/mps4_corstone315_fvp.dts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include -#include -#include - -/ { - compatible = "arm,mps4-fvp"; - #address-cells = <1>; - #size-cells = <1>; - - chosen { - zephyr,console = &uart0; - zephyr,shell-uart = &uart0; - zephyr,sram = &sram; - zephyr,flash = &isram; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-m85"; - reg = <0>; - #address-cells = <1>; - #size-cells = <1>; - - mpu: mpu@e000ed90 { - compatible = "arm,armv8.1m-mpu"; - reg = <0xe000ed90 0x40>; - }; - }; - }; - - ethosu { - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <&nvic>; - - ethosu0: ethosu@50004000 { - compatible = "arm,ethos-u"; - reg = <0x50004000>; - interrupts = <16 3>; - secure-enable; - privilege-enable; - status = "okay"; - }; - }; - - /* We utilize the secure addresses, if you subtract 0x10000000 - * you'll get the non-secure alias - */ - itcm: itcm@10000000 { /* alias @ 0x0 */ - compatible = "zephyr,memory-region"; - reg = <0x10000000 DT_SIZE_K(32)>; - zephyr,memory-region = "ITCM"; - }; - - sram: sram@12000000 { /* alias @ 0x01000000 */ - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x12000000 DT_SIZE_M(2)>; - zephyr,memory-region = "SRAM"; - }; - - dtcm: dtcm@30000000 { /* alias @ 0x20000000 */ - compatible = "zephyr,memory-region"; - reg = <0x30000000 DT_SIZE_K(32)>; - zephyr,memory-region = "DTCM"; - }; - - isram: sram@31000000 { /* alias @ 0x21000000 */ - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x31000000 DT_SIZE_M(4)>; - zephyr,memory-region = "ISRAM"; - }; - - soc { - peripheral@50000000 { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x50000000 0x10000000>; - - #include "mps4_common_soc_peripheral.dtsi" - }; - }; -}; - -#include "mps4_common.dtsi" diff --git a/boards/arm/mps4/mps4_corstone315_fvp.yaml b/boards/arm/mps4/mps4_corstone315_fvp.yaml deleted file mode 100644 index 4af1421bcbc..00000000000 --- a/boards/arm/mps4/mps4_corstone315_fvp.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -identifier: mps4/corstone315/fvp -name: Arm MPS4-Corstone315-FVP -type: mcu -arch: arm -ram: 2048 -flash: 4096 -simulation: - - name: armfvp - exec: FVP_Corstone_SSE-315 -toolchain: - - gnuarmemb - - zephyr -supported: - - gpio -testing: - default: true - timeout_multiplier: 4 - ignore_tags: - - drivers - - bluetooth - - net - - timer -vendor: arm diff --git a/boards/arm/mps4/mps4_corstone315_fvp_defconfig b/boards/arm/mps4/mps4_corstone315_fvp_defconfig deleted file mode 100644 index 26d5a732e49..00000000000 --- a/boards/arm/mps4/mps4_corstone315_fvp_defconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_RUNTIME_NMI=y -CONFIG_ARM_TRUSTZONE_M=y -CONFIG_ARM_MPU=y - -# GPIOs -CONFIG_GPIO=y - -# Serial -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y -CONFIG_SERIAL=y - -# Build a Secure firmware image -CONFIG_TRUSTED_EXECUTION_SECURE=y -# ROMSTART_REGION address and size are defined in Kconfig.defconfig -CONFIG_ROMSTART_RELOCATION_ROM=y diff --git a/boards/arm/mps4/mps4_corstone315_fvp_ns.dts b/boards/arm/mps4/mps4_corstone315_fvp_ns.dts deleted file mode 100644 index cb5a38baf47..00000000000 --- a/boards/arm/mps4/mps4_corstone315_fvp_ns.dts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include -#include -#include - -/ { - compatible = "arm,mps4-fvp"; - #address-cells = <1>; - #size-cells = <1>; - - chosen { - zephyr,console = &uart0; - zephyr,shell-uart = &uart0; - zephyr,sram = &ram; - zephyr,flash = &code; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-m85"; - reg = <0>; - #address-cells = <1>; - #size-cells = <1>; - - mpu: mpu@e000ed90 { - compatible = "arm,armv8.1m-mpu"; - reg = <0xe000ed90 0x40>; - }; - }; - }; - - /* We utilize the non-secure addresses, if you add 0x10000000 - * you'll get the secure alias - */ - itcm: itcm@0 { - compatible = "zephyr,memory-region"; - reg = <0x0 DT_SIZE_K(32)>; - zephyr,memory-region = "ITCM"; - }; - - sram: sram@1000000 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x1000000 DT_SIZE_M(2)>; - zephyr,memory-region = "SRAM"; - }; - - dtcm: dtcm@20000000 { - compatible = "zephyr,memory-region"; - reg = <0x20000000 DT_SIZE_K(512)>; - zephyr,memory-region = "DTCM"; - }; - - isram: sram@21000000 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x21000000 DT_SIZE_M(4)>; - zephyr,memory-region = "ISRAM"; - }; - - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - /* The memory regions defined below must match what the TF-M - * project has defined for that board - a single image boot is - * assumed. Please see the memory layout in: - * https://git.trustedfirmware.org/plugins/gitiles/TF-M/trusted-firmware-m.git/+/HEAD/platform/ext/target/arm/mps4/common/partition/flash_layout.h - */ - - code: memory@28080000 { - reg = <0x28080000 DT_SIZE_K(512)>; - }; - - ram: memory@21020000 { - reg = <0x21020000 DT_SIZE_M(1)>; - }; - }; - - soc { - peripheral@40000000 { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x40000000 0x10000000>; - - #include "mps4_common_soc_peripheral.dtsi" - }; - }; -}; - -#include "mps4_common.dtsi" diff --git a/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml b/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml deleted file mode 100644 index 01bee24100a..00000000000 --- a/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -identifier: mps4/corstone315/fvp/ns -name: Arm MPS4-Corstone315-FVP_ns -type: mcu -arch: arm -ram: 1024 -flash: 512 -toolchain: - - gnuarmemb - - zephyr -testing: - only_tags: - - trusted-firmware-m diff --git a/boards/arm/mps4/mps4_corstone315_fvp_ns_defconfig b/boards/arm/mps4/mps4_corstone315_fvp_ns_defconfig deleted file mode 100644 index d59d419011b..00000000000 --- a/boards/arm/mps4/mps4_corstone315_fvp_ns_defconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_ARM_TRUSTZONE_M=y -CONFIG_RUNTIME_NMI=y -CONFIG_ARM_MPU=y - -# GPIOs -CONFIG_GPIO=y - -# Serial -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y -CONFIG_SERIAL=y - -# Build a Non-secure firmware image -CONFIG_TRUSTED_EXECUTION_SECURE=n -CONFIG_TRUSTED_EXECUTION_NONSECURE=y -CONFIG_BUILD_WITH_TFM=y diff --git a/soc/arm/mps4/Kconfig b/soc/arm/mps4/Kconfig index ea733d1566d..0054f715208 100644 --- a/soc/arm/mps4/Kconfig +++ b/soc/arm/mps4/Kconfig @@ -5,17 +5,6 @@ config SOC_SERIES_MPS4 select ARM select GPIO_MMIO32 if GPIO -config SOC_MPS4_CORSTONE315 - select CPU_CORTEX_M85 - select CPU_HAS_ARM_SAU - select CPU_HAS_ARM_MPU - select CPU_HAS_FPU - select ARMV8_M_DSP - select ARMV8_1_M_MVEI - select ARMV8_1_M_MVEF - select ARMV8_1_M_PMU - select ARM_MPU_PXN if ARM_MPU - config SOC_MPS4_CORSTONE320 select CPU_CORTEX_M85 select CPU_HAS_ARM_SAU @@ -29,5 +18,4 @@ config SOC_MPS4_CORSTONE320 config ARMV8_1_M_PMU_EVENTCNT int - default 8 if SOC_MPS4_CORSTONE315 default 8 if SOC_MPS4_CORSTONE320 diff --git a/soc/arm/mps4/Kconfig.defconfig.mps4_corstone315 b/soc/arm/mps4/Kconfig.defconfig.mps4_corstone315 deleted file mode 100644 index 191b5d45df4..00000000000 --- a/soc/arm/mps4/Kconfig.defconfig.mps4_corstone315 +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -if SOC_MPS4_CORSTONE315 - -config NUM_IRQS - default 232 - -endif diff --git a/soc/arm/mps4/Kconfig.soc b/soc/arm/mps4/Kconfig.soc index 98087bb3676..a557d287f0e 100644 --- a/soc/arm/mps4/Kconfig.soc +++ b/soc/arm/mps4/Kconfig.soc @@ -10,14 +10,9 @@ config SOC_SERIES_MPS4 config SOC_SERIES default "mps4" if SOC_SERIES_MPS4 -config SOC_MPS4_CORSTONE315 - bool - select SOC_SERIES_MPS4 - config SOC_MPS4_CORSTONE320 bool select SOC_SERIES_MPS4 config SOC - default "corstone315" if SOC_MPS4_CORSTONE315 default "corstone320" if SOC_MPS4_CORSTONE320 diff --git a/soc/arm/soc.yml b/soc/arm/soc.yml index 821da33e9cf..2caf077656a 100644 --- a/soc/arm/soc.yml +++ b/soc/arm/soc.yml @@ -17,7 +17,6 @@ family: - name: corstone310 - name: mps4 socs: - - name: corstone315 - name: corstone320 - name: musca socs: From 330c1c3fd58de4b0bcd2638c1d949af36201ccc0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:55 +0300 Subject: [PATCH 025/881] Revert "[nrf fromtree] pinctrl: add support for mps4" This reverts commit a11bf865174f193c117476c330f60e6a4a6ffc59. Signed-off-by: Jukka Rissanen --- boards/arm/mps4/mps4-pinctrl.dtsi | 68 --------------- boards/arm/mps4/mps4_common.dtsi | 2 - .../arm/mps4/mps4_common_soc_peripheral.dtsi | 9 -- drivers/pinctrl/CMakeLists.txt | 1 - drivers/pinctrl/Kconfig | 1 - drivers/pinctrl/Kconfig.arm_mps4 | 9 -- drivers/pinctrl/pinctrl_arm_mps4.c | 36 -------- dts/bindings/pinctrl/arm,mps4-pinctrl.yaml | 82 ------------------- .../dt-bindings/pinctrl/arm-mps4-pinctrl.h | 40 --------- soc/arm/mps4/pinctrl_soc.h | 51 ------------ 10 files changed, 299 deletions(-) delete mode 100644 boards/arm/mps4/mps4-pinctrl.dtsi delete mode 100644 drivers/pinctrl/Kconfig.arm_mps4 delete mode 100644 drivers/pinctrl/pinctrl_arm_mps4.c delete mode 100644 dts/bindings/pinctrl/arm,mps4-pinctrl.yaml delete mode 100644 include/zephyr/dt-bindings/pinctrl/arm-mps4-pinctrl.h delete mode 100644 soc/arm/mps4/pinctrl_soc.h diff --git a/boards/arm/mps4/mps4-pinctrl.dtsi b/boards/arm/mps4/mps4-pinctrl.dtsi deleted file mode 100644 index e8b7e720703..00000000000 --- a/boards/arm/mps4/mps4-pinctrl.dtsi +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&pinctrl { - /omit-if-no-ref/ uart3_default: uart3_default { - group1 { - pinmux = ; - }; - - group2 { - pinmux = ; - input-enable; - }; - }; - - /omit-if-no-ref/ uart4_default: uart4_default { - group1 { - pinmux = ; - }; - - group2 { - pinmux = ; - input-enable; - }; - }; - - /omit-if-no-ref/ spi3_default: spi3_default { - group1 { - pinmux = , , - ; - }; - - group2 { - pinmux = ; - input-enable; - }; - }; - - /omit-if-no-ref/ spi4_default: spi4_default { - group1 { - pinmux = , , ; - }; - - group2 { - pinmux = ; - input-enable; - }; - }; - - /omit-if-no-ref/ sbcon2_default: sbcon2_default { - group1 { - pinmux = , ; - input-enable; - }; - }; - - /omit-if-no-ref/ sbcon3_default: sbcon3_default { - group1 { - pinmux = , ; - input-enable; - }; - }; -}; diff --git a/boards/arm/mps4/mps4_common.dtsi b/boards/arm/mps4/mps4_common.dtsi index ad97dae06af..c2958fc5c07 100644 --- a/boards/arm/mps4/mps4_common.dtsi +++ b/boards/arm/mps4/mps4_common.dtsi @@ -117,5 +117,3 @@ &nvic { arm,num-irq-priority-bits = <3>; }; - -#include "mps4-pinctrl.dtsi" diff --git a/boards/arm/mps4/mps4_common_soc_peripheral.dtsi b/boards/arm/mps4/mps4_common_soc_peripheral.dtsi index 6cc3f405ea7..d94339e4c05 100644 --- a/boards/arm/mps4/mps4_common_soc_peripheral.dtsi +++ b/boards/arm/mps4/mps4_common_soc_peripheral.dtsi @@ -187,8 +187,6 @@ uart3: uart@8206000 { interrupt-names = "tx", "rx"; clocks = <&sysclk>; current-speed = <115200>; - pinctrl-0 = <&uart3_default>; - pinctrl-names = "default"; }; uart4: uart@8207000 { @@ -198,8 +196,6 @@ uart4: uart@8207000 { interrupt-names = "tx", "rx"; clocks = <&sysclk>; current-speed = <115200>; - pinctrl-0 = <&uart4_default>; - pinctrl-names = "default"; }; uart5: uart@8208000 { @@ -211,8 +207,3 @@ uart5: uart@8208000 { clocks = <&sysclk>; current-speed = <115200>; }; - -pinctrl: pinctrl { - compatible = "arm,mps4-pinctrl"; - status = "okay"; -}; diff --git a/drivers/pinctrl/CMakeLists.txt b/drivers/pinctrl/CMakeLists.txt index 839c288c394..b325217c6a9 100644 --- a/drivers/pinctrl/CMakeLists.txt +++ b/drivers/pinctrl/CMakeLists.txt @@ -8,7 +8,6 @@ zephyr_library_sources_ifdef(CONFIG_PINCTRL_TELINK_B91 pinctrl_b91.c) zephyr_library_sources_ifdef(CONFIG_PINCTRL_AMBIQ pinctrl_ambiq.c) zephyr_library_sources_ifdef(CONFIG_PINCTRL_ARM_MPS2 pinctrl_arm_mps2.c) zephyr_library_sources_ifdef(CONFIG_PINCTRL_ARM_MPS3 pinctrl_arm_mps3.c) -zephyr_library_sources_ifdef(CONFIG_PINCTRL_ARM_MPS4 pinctrl_arm_mps4.c) zephyr_library_sources_ifdef(CONFIG_PINCTRL_ARM_V2M_BEETLE pinctrl_arm_v2m_beetle.c) zephyr_library_sources_ifdef(CONFIG_PINCTRL_BFLB pinctrl_bflb.c) zephyr_library_sources_ifdef(CONFIG_PINCTRL_GD32_AF pinctrl_gd32_af.c) diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index e13c4e427ff..a47c4392a78 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -39,7 +39,6 @@ source "drivers/pinctrl/Kconfig.bflb" source "drivers/pinctrl/Kconfig.ambiq" source "drivers/pinctrl/Kconfig.arm_mps2" source "drivers/pinctrl/Kconfig.arm_mps3" -source "drivers/pinctrl/Kconfig.arm_mps4" source "drivers/pinctrl/Kconfig.arm_v2m_beetle" source "drivers/pinctrl/Kconfig.gd32" source "drivers/pinctrl/Kconfig.it8xxx2" diff --git a/drivers/pinctrl/Kconfig.arm_mps4 b/drivers/pinctrl/Kconfig.arm_mps4 deleted file mode 100644 index ab610a411ba..00000000000 --- a/drivers/pinctrl/Kconfig.arm_mps4 +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -config PINCTRL_ARM_MPS4 - bool "Arm MPS4 pin controller driver" - default y - depends on DT_HAS_ARM_MPS4_PINCTRL_ENABLED - help - Arm MPS4 pinctrl driver diff --git a/drivers/pinctrl/pinctrl_arm_mps4.c b/drivers/pinctrl/pinctrl_arm_mps4.c deleted file mode 100644 index 3a0215b53e6..00000000000 --- a/drivers/pinctrl/pinctrl_arm_mps4.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "zephyr/device.h" -#include "zephyr/drivers/gpio.h" -#include -#include -#include - -static const struct device *const gpio_ports[] = {DEVICE_DT_GET_OR_NULL(DT_NODELABEL(gpio0)), - DEVICE_DT_GET_OR_NULL(DT_NODELABEL(gpio1))}; - -static int pinctrl_configure_pin(const pinctrl_soc_pin_t *pin) -{ - uint32_t flags = pin->input_enable ? GPIO_INPUT : GPIO_OUTPUT; - - /* Each gpio has 16 pins, so divide by 16 to get specific gpio*/ - const struct device *gpio_dev = gpio_ports[pin->pin_num >> 4]; - - return cmsdk_ahb_gpio_config(gpio_dev, pin->pin_num % 16, flags); -} - -int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg) -{ - ARG_UNUSED(reg); - for (uint8_t i = 0U; i < pin_cnt; i++) { - if (pinctrl_configure_pin(&pins[i]) == -ENOTSUP) { - return -ENOTSUP; - } - } - - return 0; -} diff --git a/dts/bindings/pinctrl/arm,mps4-pinctrl.yaml b/dts/bindings/pinctrl/arm,mps4-pinctrl.yaml deleted file mode 100644 index d08e37cdab2..00000000000 --- a/dts/bindings/pinctrl/arm,mps4-pinctrl.yaml +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -description: | - The Arm Mps4 pin controller is a node responsible for controlling - pin function selection and pin properties, such as routing a UART3 TX - to pin 1. - - The node has the 'pinctrl' node label set in your SoC's devicetree, - so you can modify it like this: - - &pinctrl { - /* your modifications go here */ - }; - - All device pin configurations should be placed in child nodes of the - 'pinctrl' node, as shown in this example: - - &pinctrl { - /* configuration for the usart0 "default" state */ - uart3_default: uart3_default { - /* group 1 */ - group1 { - /* configure P1 as UART3 TX */ - pinmux = ; - }; - /* group 2 */ - group2 { - /* configure P0 as UART3 RX */ - pinmux = ; - /* enable input on pin 1 */ - input-enable; - }; - }; - }; - - The 'uart3_default' child node encodes the pin configurations for a - particular state of a device; in this case, the default (that is, active) - state. - - As shown, pin configurations are organized in groups within each child node. - Each group can specify a list of pin function selections in the 'pinmux' - property. Here is a list of supported standard pin properties: - - input-enable - - A group can also specify shared pin properties common to all the specified - pins, such as the 'input-enable' property in group 2. - - To link pin configurations with a device, use a pinctrl-N property for some - number N, like this example you could place in your board's DTS file: - - #include "board-pinctrl.dtsi" - - &uart3 { - pinctrl-0 = <&uart3_default>; - pinctrl-1 = <&uart3_sleep>; - pinctrl-names = "default", "sleep"; - }; - - -compatible: "arm,mps4-pinctrl" - -include: base.yaml - -child-binding: - description: | - Definitions for a pinctrl state. - child-binding: - - include: - - name: pincfg-node.yaml - property-allowlist: - - input-enable - - properties: - pinmux: - required: true - type: array - description: | - An array of pins sharing the same group properties. Each - element of the array is an integer constructed from the - pin number and the alternative function of the pin. diff --git a/include/zephyr/dt-bindings/pinctrl/arm-mps4-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/arm-mps4-pinctrl.h deleted file mode 100644 index a2d211499a7..00000000000 --- a/include/zephyr/dt-bindings/pinctrl/arm-mps4-pinctrl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#define MPS4_ALT_FUNC_POS 0 -#define MPS4_ALT_FUNC_MASK 0x7 - -#define MPS4_EXP_NUM_POS 3 -#define MPS4_EXP_NUM_MASK 0x1F8 - -#define MPS4_PINCTRL_FUNC_UART 0 -#define MPS4_PINCTRL_FUNC_GPIO 1 -#define MPS4_PINCTRL_FUNC_I2C 2 -#define MPS4_PINCTRL_FUNC_SPI 3 - -#define MPS4_PINMUX(alt_func, exp_num) (exp_num << MPS4_EXP_NUM_POS | \ - alt_func << MPS4_ALT_FUNC_POS) - -/* GPIO 0 */ -#define UART3_RXD_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_UART, 0) -#define UART3_TXD_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_UART, 1) -#define SPI3_SS_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_SPI, 10) -#define SPI3_MOSI_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_SPI, 11) -#define SPI3_MISO_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_SPI, 12) -#define SPI3_SCK_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_SPI, 13) -#define SBCON2_SDA_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_I2C, 14) -#define SBCON2_SCL_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_I2C, 15) - - -/* GPIO 1 */ -#define UART4_RXD_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_UART, 16) -#define UART4_TXD_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_UART, 17) -#define SPI4_SS_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_SPI, 26) -#define SPI4_MOSI_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_SPI, 27) -#define SPI4_MISO_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_SPI, 28) -#define SPI4_SCK_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_SPI, 29) -#define SBCON3_SDA_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_I2C, 30) -#define SBCON3_SCL_EXP MPS4_PINMUX(MPS4_PINCTRL_FUNC_I2C, 31) diff --git a/soc/arm/mps4/pinctrl_soc.h b/soc/arm/mps4/pinctrl_soc.h deleted file mode 100644 index a88e0cee7df..00000000000 --- a/soc/arm/mps4/pinctrl_soc.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/** - * @brief Type to hold a pin's pinctrl configuration. - */ -struct mps4_pinctrl_soc_pin { - /** Pin number 0..52 */ - uint32_t pin_num : 6; - /** Alternative function (UART, SPI, etc.) */ - uint32_t alt_func : 3; - /** Enable the pin as an input */ - uint32_t input_enable : 1; -}; - -typedef struct mps4_pinctrl_soc_pin pinctrl_soc_pin_t; - -/** - * @brief Utility macro to initialize each pin. - * - * @param node_id Node identifier. - * @param prop Property name. - * @param idx Property entry index. - */ -#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \ - { \ - MPS4_GET_PIN_NUM(DT_PROP_BY_IDX(node_id, prop, idx)), \ - MPS4_GET_PIN_ALT_FUNC(DT_PROP_BY_IDX(node_id, prop, idx)), \ - DT_PROP(node_id, input_enable), \ - }, - -/** - * @brief Utility macro to initialize state pins contained in a given property. - * - * @param node_id Node identifier. - * @param prop Property name describing state pins. - */ -#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \ - {DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), \ - DT_FOREACH_PROP_ELEM, pinmux, \ - Z_PINCTRL_STATE_PIN_INIT)} - -#define MPS4_GET_PIN_NUM(pinctrl) \ - (((pinctrl) >> MPS4_EXP_NUM_POS) & MPS4_EXP_NUM_MASK) -#define MPS4_GET_PIN_ALT_FUNC(pinctrl) \ - (((pinctrl) >> MPS4_ALT_FUNC_POS) & MPS4_ALT_FUNC_MASK) From bf61356f5d27fe7db03a6808c2ef00ed06e59008 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 026/881] Revert "[nrf fromtree] boards: arm: add support for MPS4 Corstone-320" This reverts commit e3f5d4388cbe0cfb72220414db48ac7cac472456. Signed-off-by: Jukka Rissanen --- boards/arm/mps4/Kconfig.defconfig | 23 -- boards/arm/mps4/Kconfig.mps4 | 6 - boards/arm/mps4/board.cmake | 45 ---- boards/arm/mps4/board.yml | 10 - boards/arm/mps4/mps4_common.dtsi | 119 ---------- .../arm/mps4/mps4_common_soc_peripheral.dtsi | 209 ------------------ boards/arm/mps4/mps4_corstone320_fvp.dts | 97 -------- boards/arm/mps4/mps4_corstone320_fvp.yaml | 25 --- .../arm/mps4/mps4_corstone320_fvp_defconfig | 19 -- boards/arm/mps4/mps4_corstone320_fvp_ns.dts | 102 --------- boards/arm/mps4/mps4_corstone320_fvp_ns.yaml | 15 -- .../mps4/mps4_corstone320_fvp_ns_defconfig | 19 -- soc/arm/mps4/CMakeLists.txt | 6 - soc/arm/mps4/Kconfig | 21 -- soc/arm/mps4/Kconfig.defconfig | 11 - .../mps4/Kconfig.defconfig.mps4_corstone320 | 9 - soc/arm/mps4/Kconfig.soc | 18 -- soc/arm/mps4/soc.h | 12 - soc/arm/soc.yml | 3 - 19 files changed, 769 deletions(-) delete mode 100644 boards/arm/mps4/Kconfig.defconfig delete mode 100644 boards/arm/mps4/Kconfig.mps4 delete mode 100644 boards/arm/mps4/board.cmake delete mode 100644 boards/arm/mps4/board.yml delete mode 100644 boards/arm/mps4/mps4_common.dtsi delete mode 100644 boards/arm/mps4/mps4_common_soc_peripheral.dtsi delete mode 100644 boards/arm/mps4/mps4_corstone320_fvp.dts delete mode 100644 boards/arm/mps4/mps4_corstone320_fvp.yaml delete mode 100644 boards/arm/mps4/mps4_corstone320_fvp_defconfig delete mode 100644 boards/arm/mps4/mps4_corstone320_fvp_ns.dts delete mode 100644 boards/arm/mps4/mps4_corstone320_fvp_ns.yaml delete mode 100644 boards/arm/mps4/mps4_corstone320_fvp_ns_defconfig delete mode 100644 soc/arm/mps4/CMakeLists.txt delete mode 100644 soc/arm/mps4/Kconfig delete mode 100644 soc/arm/mps4/Kconfig.defconfig delete mode 100644 soc/arm/mps4/Kconfig.defconfig.mps4_corstone320 delete mode 100644 soc/arm/mps4/Kconfig.soc delete mode 100644 soc/arm/mps4/soc.h diff --git a/boards/arm/mps4/Kconfig.defconfig b/boards/arm/mps4/Kconfig.defconfig deleted file mode 100644 index b4e98775386..00000000000 --- a/boards/arm/mps4/Kconfig.defconfig +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_MPS4_CORSTONE320_FVP - -if SERIAL - -config UART_INTERRUPT_DRIVEN - default y - -endif # SERIAL - -if ROMSTART_RELOCATION_ROM && BOARD_MPS4_CORSTONE320_FVP - -config ROMSTART_REGION_ADDRESS - default $(dt_nodelabel_reg_addr_hex,itcm) - -config ROMSTART_REGION_SIZE - default $(dt_nodelabel_reg_size_hex,itcm,0,k) - -endif - -endif diff --git a/boards/arm/mps4/Kconfig.mps4 b/boards/arm/mps4/Kconfig.mps4 deleted file mode 100644 index ffb494cf337..00000000000 --- a/boards/arm/mps4/Kconfig.mps4 +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_MPS4 - select SOC_SERIES_MPS4 - select SOC_MPS4_CORSTONE320 if BOARD_MPS4_CORSTONE320_FVP || BOARD_MPS4_CORSTONE320_FVP_NS diff --git a/boards/arm/mps4/board.cmake b/boards/arm/mps4/board.cmake deleted file mode 100644 index 6497c65c426..00000000000 --- a/boards/arm/mps4/board.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -# -# Default emulation: -# FVP is used by default for corstone320/fvp. -# - - -if(CONFIG_BOARD_MPS4_CORSTONE320_FVP OR CONFIG_BOARD_MPS4_CORSTONE320_FVP_NS) - set(SUPPORTED_EMU_PLATFORMS armfvp) - set(ARMFVP_BIN_NAME FVP_Corstone_SSE-320) - if(CONFIG_BOARD_MPS4_CORSTONE320_FVP) - set(ARMFVP_FLAGS - # default is '0x11000000' but should match cpu.INITSVTOR which is 0. - -C mps4_board.subsystem.iotss3_systemcontrol.INITSVTOR_RST=0 - # default is 0x8, this change is needed since we split flash into itcm - # and sram and it reduces the number of available mpu regions causing a - # few MPU tests to fail. - -C mps4_board.subsystem.cpu0.MPU_S=16 - ) - endif() -endif() - -if(CONFIG_BUILD_WITH_TFM) - set(ARMFVP_FLAGS ${ARMFVP_FLAGS} -a ${APPLICATION_BINARY_DIR}/zephyr/tfm_merged.hex) -endif() - -# FVP Parameters -# -C indicate a config option in the form of: -# instance.parameter=value -# Run the FVP with --list-params to list all options -set(ARMFVP_FLAGS ${ARMFVP_FLAGS} - -C mps4_board.uart0.out_file=- - -C mps4_board.uart0.unbuffered_output=1 - -C mps4_board.uart1.out_file=- - -C mps4_board.uart1.unbuffered_output=1 - -C mps4_board.uart2.out_file=- - -C mps4_board.uart2.unbuffered_output=1 - -C mps4_board.visualisation.disable-visualisation=1 - -C mps4_board.telnetterminal0.start_telnet=0 - -C mps4_board.telnetterminal1.start_telnet=0 - -C mps4_board.telnetterminal2.start_telnet=0 - -C vis_hdlcd.disable_visualisation=1 - ) diff --git a/boards/arm/mps4/board.yml b/boards/arm/mps4/board.yml deleted file mode 100644 index 8c2b411846f..00000000000 --- a/boards/arm/mps4/board.yml +++ /dev/null @@ -1,10 +0,0 @@ -board: - name: mps4 - full_name: MPS4 - vendor: arm - socs: - - name: 'corstone320' - variants: - - name: 'fvp' - variants: - - name: 'ns' diff --git a/boards/arm/mps4/mps4_common.dtsi b/boards/arm/mps4/mps4_common.dtsi deleted file mode 100644 index c2958fc5c07..00000000000 --- a/boards/arm/mps4/mps4_common.dtsi +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* /dts-v1/; */ - -#include -#include -#include -#include -#include - -/ { - aliases { - led0 = &led_0; - led1 = &led_1; - sw0 = &user_button_0; - sw1 = &user_button_1; - }; - - leds { - compatible = "gpio-leds"; - - led_0: led_0 { - gpios = <&gpio_led0 0>; - label = "USERLED0"; - }; - - led_1: led_1 { - gpios = <&gpio_led0 1>; - label = "USERLED1"; - }; - - led_2: led_2 { - gpios = <&gpio_led0 2>; - label = "USERLED2"; - }; - - led_3: led_3 { - gpios = <&gpio_led0 3>; - label = "USERLED3"; - }; - - led_4: led_4 { - gpios = <&gpio_led0 4>; - label = "USERLED4"; - }; - - led_5: led_5 { - gpios = <&gpio_led0 5>; - label = "USERLED5"; - }; - - led_6: led_6 { - gpios = <&gpio_led0 6>; - label = "USERLED6"; - }; - - led_7: led_7 { - gpios = <&gpio_led0 7>; - label = "USERLED7"; - }; - - led_8: led_8 { - gpios = <&gpio_led0 8>; - label = "PB1LED"; - }; - - led_9: led_9 { - gpios = <&gpio_led0 9>; - label = "PB2LED"; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - - user_button_0: button_0 { - label = "USERPB0"; - gpios = <&gpio_button 0>; - zephyr,code = ; - }; - - user_button_1: button_1 { - label = "USERPB1"; - gpios = <&gpio_button 1>; - zephyr,code = ; - }; - }; - - null_ptr_detect: null_ptr_detect@0 { - compatible = "zephyr,memory-region"; - /* 0 - CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION_PAGE_SIZE> */ - reg = <0x0 0x400>; - zephyr,memory-region = "NULL_PTR_DETECT"; - zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_FLASH) )>; - }; - - /* DDR4 - 2G, alternates non-secure/secure every 256M */ - ddr4: memory@60000000 { - device_type = "memory"; - compatible = "zephyr,memory-region"; - reg = <0x60000000 DT_SIZE_M(256) - 0x70000000 DT_SIZE_M(256) - 0x80000000 DT_SIZE_M(256) - 0x90000000 DT_SIZE_M(256) - 0xa0000000 DT_SIZE_M(256) - 0xb0000000 DT_SIZE_M(256) - 0xc0000000 DT_SIZE_M(256) - 0xd0000000 DT_SIZE_M(256)>; - zephyr,memory-region = "DDR4"; - }; -}; - -&nvic { - arm,num-irq-priority-bits = <3>; -}; diff --git a/boards/arm/mps4/mps4_common_soc_peripheral.dtsi b/boards/arm/mps4/mps4_common_soc_peripheral.dtsi deleted file mode 100644 index d94339e4c05..00000000000 --- a/boards/arm/mps4/mps4_common_soc_peripheral.dtsi +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -sysclk: system-clock { - compatible = "fixed-clock"; - clock-frequency = <25000000>; - #clock-cells = <0>; -}; - -gpio0: gpio@100000 { - compatible = "arm,cmsdk-gpio"; - reg = <0x100000 0x1000>; - interrupts = <69 3>; - gpio-controller; - #gpio-cells = <2>; -}; - -gpio1: gpio@101000 { - compatible = "arm,cmsdk-gpio"; - reg = <0x101000 0x1000>; - interrupts = <70 3>; - gpio-controller; - #gpio-cells = <2>; -}; - -gpio2: gpio@102000 { - compatible = "arm,cmsdk-gpio"; - reg = <0x102000 0x1000>; - interrupts = <71 3>; - gpio-controller; - #gpio-cells = <2>; -}; - -gpio3: gpio@103000 { - compatible = "arm,cmsdk-gpio"; - reg = <0x103000 0x1000>; - interrupts = <72 3>; - gpio-controller; - #gpio-cells = <2>; -}; - -eth0: eth@400000 { - /* Linux has "smsc,lan9115" */ - compatible = "smsc,lan9220"; - /* Actual reg range is ~0x200 */ - reg = <0x400000 0x100000>; - interrupts = <49 3>; -}; - -i2c_touch: i2c@8100000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x8100000 0x1000>; -}; - -i2c_audio_conf: i2c@8101000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x8101000 0x1000>; -}; - -spi_adc: spi@8102000 { - compatible = "arm,pl022"; - reg = <0x8102000 DT_SIZE_K(4)>; - interrupts = <53 3>; - interrupt-names = "shield_adc"; - clocks = <&sysclk>; - #address-cells = <1>; - #size-cells = <0>; -}; - -spi_shield0: spi@8103000 { - compatible = "arm,pl022"; - reg = <0x8103000 DT_SIZE_K(4)>; - interrupts = <54 3>; - interrupt-names = "shield0_spi"; - clocks = <&sysclk>; - #address-cells = <1>; - #size-cells = <0>; - pinctrl-0 = <&spi3_default>; - pinctrl-names = "default"; -}; - -spi_shield1: spi@8104000 { - compatible = "arm,pl022"; - reg = <0x8104000 DT_SIZE_K(4)>; - interrupts = <55 3>; - interrupt-names = "shield1_spi"; - clocks = <&sysclk>; - #address-cells = <1>; - #size-cells = <0>; - pinctrl-0 = <&spi4_default>; - pinctrl-names = "default"; -}; - -i2c_shield0: i2c@8105000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x8105000 0x1000>; - pinctrl-0 = <&sbcon2_default>; - pinctrl-names = "default"; -}; - -i2c_shield1: i2c@8106000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x8106000 0x1000>; - pinctrl-0 = <&sbcon3_default>; - pinctrl-names = "default"; -}; - -i2c_ddr4_eeprom: i2c@8108000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x8108000 0x1000>; -}; - -gpio_led0: mps4_fpgaio@8202000 { - compatible = "arm,mmio32-gpio"; - reg = <0x8202000 0x4>; - gpio-controller; - #gpio-cells = <1>; - ngpios = <8>; -}; - -gpio_button: mps4_fpgaio@8202008 { - compatible = "arm,mmio32-gpio"; - reg = <0x8202008 0x4>; - gpio-controller; - #gpio-cells = <1>; - ngpios = <2>; - direction-input; -}; - -gpio_misc: mps4_fpgaio@820204c { - compatible = "arm,mmio32-gpio"; - reg = <0x820204c 0x4>; - gpio-controller; - #gpio-cells = <1>; - ngpios = <3>; -}; - -uart0: uart@8203000 { - compatible = "arm,cmsdk-uart"; - reg = <0x8203000 0x1000>; - interrupts = <34 3 33 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; -}; - -uart1: uart@8204000 { - compatible = "arm,cmsdk-uart"; - reg = <0x8204000 0x1000>; - interrupts = <36 3 35 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; -}; - -uart2: uart@8205000 { - compatible = "arm,cmsdk-uart"; - reg = <0x8205000 0x1000>; - interrupts = <38 3 37 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; -}; - -uart3: uart@8206000 { - compatible = "arm,cmsdk-uart"; - reg = <0x8206000 0x1000>; - interrupts = <40 3 39 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; -}; - -uart4: uart@8207000 { - compatible = "arm,cmsdk-uart"; - reg = <0x8207000 0x1000>; - interrupts = <42 3 41 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; -}; - -uart5: uart@8208000 { - compatible = "arm,cmsdk-uart"; - status = "disabled"; - reg = <0x8208000 0x1000>; - interrupt-names = "tx", "rx"; - interrupts = <126 3 125 3>; - clocks = <&sysclk>; - current-speed = <115200>; -}; diff --git a/boards/arm/mps4/mps4_corstone320_fvp.dts b/boards/arm/mps4/mps4_corstone320_fvp.dts deleted file mode 100644 index 98c87ce7ed7..00000000000 --- a/boards/arm/mps4/mps4_corstone320_fvp.dts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include -#include -#include - -/ { - compatible = "arm,mps4-fvp"; - #address-cells = <1>; - #size-cells = <1>; - - chosen { - zephyr,console = &uart0; - zephyr,shell-uart = &uart0; - zephyr,sram = &sram; - zephyr,flash = &isram; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-m85"; - reg = <0>; - #address-cells = <1>; - #size-cells = <1>; - - mpu: mpu@e000ed90 { - compatible = "arm,armv8.1m-mpu"; - reg = <0xe000ed90 0x40>; - }; - }; - }; - - ethosu { - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <&nvic>; - - ethosu0: ethosu@50004000 { - compatible = "arm,ethos-u"; - reg = <0x50004000>; - interrupts = <16 3>; - secure-enable; - privilege-enable; - status = "okay"; - }; - }; - - /* We utilize the secure addresses, if you subtract 0x10000000 - * you'll get the non-secure alias - */ - itcm: itcm@10000000 { /* alias @ 0x0 */ - compatible = "zephyr,memory-region"; - reg = <0x10000000 DT_SIZE_K(32)>; - zephyr,memory-region = "ITCM"; - }; - - sram: sram@12000000 { /* alias @ 0x01000000 */ - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x12000000 DT_SIZE_M(2)>; - zephyr,memory-region = "SRAM"; - }; - - dtcm: dtcm@30000000 { /* alias @ 0x20000000 */ - compatible = "zephyr,memory-region"; - reg = <0x30000000 DT_SIZE_K(32)>; - zephyr,memory-region = "DTCM"; - }; - - isram: sram@31000000 { /* alias @ 0x21000000 */ - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x31000000 DT_SIZE_M(4)>; - zephyr,memory-region = "ISRAM"; - }; - - soc { - peripheral@50000000 { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x50000000 0x10000000>; - - #include "mps4_common_soc_peripheral.dtsi" - }; - }; -}; - -#include "mps4_common.dtsi" diff --git a/boards/arm/mps4/mps4_corstone320_fvp.yaml b/boards/arm/mps4/mps4_corstone320_fvp.yaml deleted file mode 100644 index 624c8580812..00000000000 --- a/boards/arm/mps4/mps4_corstone320_fvp.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -identifier: mps4/corstone320/fvp -name: Arm MPS4-Corstone320-FVP -type: mcu -arch: arm -ram: 2048 -flash: 4096 -simulation: - - name: armfvp - exec: FVP_Corstone_SSE-320 -toolchain: - - gnuarmemb - - zephyr -supported: - - gpio -testing: - default: true - ignore_tags: - - drivers - - bluetooth - - net - - timer -vendor: arm diff --git a/boards/arm/mps4/mps4_corstone320_fvp_defconfig b/boards/arm/mps4/mps4_corstone320_fvp_defconfig deleted file mode 100644 index 26d5a732e49..00000000000 --- a/boards/arm/mps4/mps4_corstone320_fvp_defconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_RUNTIME_NMI=y -CONFIG_ARM_TRUSTZONE_M=y -CONFIG_ARM_MPU=y - -# GPIOs -CONFIG_GPIO=y - -# Serial -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y -CONFIG_SERIAL=y - -# Build a Secure firmware image -CONFIG_TRUSTED_EXECUTION_SECURE=y -# ROMSTART_REGION address and size are defined in Kconfig.defconfig -CONFIG_ROMSTART_RELOCATION_ROM=y diff --git a/boards/arm/mps4/mps4_corstone320_fvp_ns.dts b/boards/arm/mps4/mps4_corstone320_fvp_ns.dts deleted file mode 100644 index c511a7cc700..00000000000 --- a/boards/arm/mps4/mps4_corstone320_fvp_ns.dts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include -#include -#include - -/ { - compatible = "arm,mps4-fvp"; - #address-cells = <1>; - #size-cells = <1>; - - chosen { - zephyr,console = &uart0; - zephyr,shell-uart = &uart0; - zephyr,sram = &ram; - zephyr,flash = &code; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-m85"; - reg = <0>; - #address-cells = <1>; - #size-cells = <1>; - - mpu: mpu@e000ed90 { - compatible = "arm,armv8.1m-mpu"; - reg = <0xe000ed90 0x40>; - }; - }; - }; - - /* We utilize the secure addresses, if you subtract 0x10000000 - * you'll get the non-secure alias - */ - itcm: itcm@0 { - compatible = "zephyr,memory-region"; - reg = <0x0 DT_SIZE_K(32)>; - zephyr,memory-region = "ITCM"; - }; - - sram: sram@1000000 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x1000000 DT_SIZE_M(2)>; - zephyr,memory-region = "SRAM"; - }; - - dtcm: dtcm@20000000 { - compatible = "zephyr,memory-region"; - reg = <0x20000000 DT_SIZE_K(512)>; - zephyr,memory-region = "DTCM"; - }; - - isram: sram@21000000 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x21000000 DT_SIZE_M(4)>; - zephyr,memory-region = "ISRAM"; - }; - - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - /* The memory regions defined below must match what the TF-M - * project has defined for that board - a single image boot is - * assumed. Please see the memory layout in: - * https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/platform/ext/target/mps4/corstone320/common/partition/flash_layout.h - */ - - code: memory@28080000 { - reg = <0x28080000 DT_SIZE_K(512)>; - }; - - ram: memory@21020000 { - reg = <0x21020000 DT_SIZE_M(1)>; - }; - }; - - soc { - peripheral@40000000 { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x40000000 0x10000000>; - - #include "mps4_common_soc_peripheral.dtsi" - }; - }; -}; - -#include "mps4_common.dtsi" diff --git a/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml b/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml deleted file mode 100644 index 45ee954a337..00000000000 --- a/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -identifier: mps4/corstone320/fvp/ns -name: Arm MPS4-Corstone320-FVP_ns -type: mcu -arch: arm -ram: 1024 -flash: 512 -toolchain: - - gnuarmemb - - zephyr -testing: - only_tags: - - trusted-firmware-m diff --git a/boards/arm/mps4/mps4_corstone320_fvp_ns_defconfig b/boards/arm/mps4/mps4_corstone320_fvp_ns_defconfig deleted file mode 100644 index d59d419011b..00000000000 --- a/boards/arm/mps4/mps4_corstone320_fvp_ns_defconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_ARM_TRUSTZONE_M=y -CONFIG_RUNTIME_NMI=y -CONFIG_ARM_MPU=y - -# GPIOs -CONFIG_GPIO=y - -# Serial -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y -CONFIG_SERIAL=y - -# Build a Non-secure firmware image -CONFIG_TRUSTED_EXECUTION_SECURE=n -CONFIG_TRUSTED_EXECUTION_NONSECURE=y -CONFIG_BUILD_WITH_TFM=y diff --git a/soc/arm/mps4/CMakeLists.txt b/soc/arm/mps4/CMakeLists.txt deleted file mode 100644 index 1cc200dafbb..00000000000 --- a/soc/arm/mps4/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -zephyr_include_directories(.) - -set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") diff --git a/soc/arm/mps4/Kconfig b/soc/arm/mps4/Kconfig deleted file mode 100644 index 0054f715208..00000000000 --- a/soc/arm/mps4/Kconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -config SOC_SERIES_MPS4 - select ARM - select GPIO_MMIO32 if GPIO - -config SOC_MPS4_CORSTONE320 - select CPU_CORTEX_M85 - select CPU_HAS_ARM_SAU - select CPU_HAS_ARM_MPU - select CPU_HAS_FPU - select ARMV8_M_DSP - select ARMV8_1_M_MVEI - select ARMV8_1_M_MVEF - select ARMV8_1_M_PMU - select ARM_MPU_PXN if ARM_MPU - -config ARMV8_1_M_PMU_EVENTCNT - int - default 8 if SOC_MPS4_CORSTONE320 diff --git a/soc/arm/mps4/Kconfig.defconfig b/soc/arm/mps4/Kconfig.defconfig deleted file mode 100644 index 667eaadb35c..00000000000 --- a/soc/arm/mps4/Kconfig.defconfig +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -if SOC_SERIES_MPS4 - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default $(dt_node_int_prop_int,$(dt_nodelabel_path,sysclk),clock-frequency) - -rsource "Kconfig.defconfig.mps4*" - -endif # SOC_SERIES_MPS4 diff --git a/soc/arm/mps4/Kconfig.defconfig.mps4_corstone320 b/soc/arm/mps4/Kconfig.defconfig.mps4_corstone320 deleted file mode 100644 index f7348d7fcad..00000000000 --- a/soc/arm/mps4/Kconfig.defconfig.mps4_corstone320 +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -if SOC_MPS4_CORSTONE320 - -config NUM_IRQS - default 232 - -endif diff --git a/soc/arm/mps4/Kconfig.soc b/soc/arm/mps4/Kconfig.soc deleted file mode 100644 index a557d287f0e..00000000000 --- a/soc/arm/mps4/Kconfig.soc +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2025 Arm Limited and/or its affiliates -# SPDX-License-Identifier: Apache-2.0 - -config SOC_SERIES_MPS4 - bool - select SOC_FAMILY_ARM - help - Enable support for ARM MPS4 MCU Series - -config SOC_SERIES - default "mps4" if SOC_SERIES_MPS4 - -config SOC_MPS4_CORSTONE320 - bool - select SOC_SERIES_MPS4 - -config SOC - default "corstone320" if SOC_MPS4_CORSTONE320 diff --git a/soc/arm/mps4/soc.h b/soc/arm/mps4/soc.h deleted file mode 100644 index 14ceadbd20a..00000000000 --- a/soc/arm/mps4/soc.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright 2025 Arm Limited and/or its affiliates - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef _SOC_H_ -#define _SOC_H_ - -#include - -#endif /* _SOC_H_ */ diff --git a/soc/arm/soc.yml b/soc/arm/soc.yml index 2caf077656a..866f34dafd4 100644 --- a/soc/arm/soc.yml +++ b/soc/arm/soc.yml @@ -15,9 +15,6 @@ family: socs: - name: corstone300 - name: corstone310 - - name: mps4 - socs: - - name: corstone320 - name: musca socs: - name: musca_b1 From 973cf7ccc486ab71376834103779db9ba0d4667c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 027/881] Revert "[nrf fromtree] scripts: zephyr_module: Add variable with module path" This reverts commit ccc8d2b94034e89c93f3c14d9acfacfeb5829e85. Signed-off-by: Jukka Rissanen --- cmake/modules/kconfig.cmake | 8 +++++++- scripts/zephyr_module.py | 24 ++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index ac5f1b83e4c..def17f16ae6 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -99,9 +99,15 @@ zephyr_file(CONF_FILES ${BOARD_EXTENSION_DIRS} KCONF board_extension_conf_files # separated list instead. string(REPLACE ";" "?" DTS_ROOT_BINDINGS "${DTS_ROOT_BINDINGS}") -# Export each `ZEPHYR__KCONFIG` to Kconfig. +# Export each `ZEPHYR__MODULE_DIR` to Kconfig. +# This allows Kconfig files to refer relative from a modules root as: +# source "$(ZEPHYR_FOO_MODULE_DIR)/Kconfig" foreach(module_name ${ZEPHYR_MODULE_NAMES}) zephyr_string(SANITIZE TOUPPER MODULE_NAME_UPPER ${module_name}) + list(APPEND + ZEPHYR_KCONFIG_MODULES_DIR + "ZEPHYR_${MODULE_NAME_UPPER}_MODULE_DIR=${ZEPHYR_${MODULE_NAME_UPPER}_MODULE_DIR}" + ) if(ZEPHYR_${MODULE_NAME_UPPER}_KCONFIG) list(APPEND diff --git a/scripts/zephyr_module.py b/scripts/zephyr_module.py index aeda845639e..8aabe676784 100755 --- a/scripts/zephyr_module.py +++ b/scripts/zephyr_module.py @@ -393,11 +393,8 @@ def process_kconfig(module, meta): module_path = PurePath(module) module_yml = module_path.joinpath('zephyr/module.yml') kconfig_extern = section.get('kconfig-ext', False) - name_sanitized = meta['name-sanitized'] - snippet = f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR := {module_path.as_posix()}\n' - if kconfig_extern: - return snippet + kconfig_snippet(meta, module_path, blobs=blobs, taint_blobs=taint_blobs) + return kconfig_snippet(meta, module_path, blobs=blobs, taint_blobs=taint_blobs) kconfig_setting = section.get('kconfig', None) if not validate_setting(kconfig_setting, module): @@ -407,10 +404,12 @@ def process_kconfig(module, meta): kconfig_file = os.path.join(module, kconfig_setting or 'zephyr/Kconfig') if os.path.isfile(kconfig_file): - return snippet + kconfig_snippet(meta, module_path, Path(kconfig_file), - blobs=blobs, taint_blobs=taint_blobs) + return kconfig_snippet(meta, module_path, Path(kconfig_file), + blobs=blobs, taint_blobs=taint_blobs) else: - return snippet + '\n'.join(kconfig_module_opts(name_sanitized, blobs, taint_blobs)) + '\n' + name_sanitized = meta['name-sanitized'] + snippet = kconfig_module_opts(name_sanitized, blobs, taint_blobs) + return '\n'.join(snippet) + '\n' def process_sysbuildkconfig(module, meta): @@ -418,11 +417,8 @@ def process_sysbuildkconfig(module, meta): module_path = PurePath(module) module_yml = module_path.joinpath('zephyr/module.yml') kconfig_extern = section.get('sysbuild-kconfig-ext', False) - name_sanitized = meta['name-sanitized'] - snippet = f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR := {module_path.as_posix()}\n' - if kconfig_extern: - return snippet + kconfig_snippet(meta, module_path, sysbuild=True) + return kconfig_snippet(meta, module_path, sysbuild=True) kconfig_setting = section.get('sysbuild-kconfig', None) if not validate_setting(kconfig_setting, module): @@ -433,10 +429,10 @@ def process_sysbuildkconfig(module, meta): if kconfig_setting is not None: kconfig_file = os.path.join(module, kconfig_setting) if os.path.isfile(kconfig_file): - return snippet + kconfig_snippet(meta, module_path, Path(kconfig_file)) + return kconfig_snippet(meta, module_path, Path(kconfig_file)) - return snippet + \ - (f'config ZEPHYR_{name_sanitized.upper()}_MODULE\n' + name_sanitized = meta['name-sanitized'] + return (f'config ZEPHYR_{name_sanitized.upper()}_MODULE\n' f' bool\n' f' default y\n') From 933f4f629fa90c9e20c80db6aeaca15dbbc83b2a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 028/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Fix XIP_DEV_CFG_MASK definition" This reverts commit 9f038bf1860117b8e039a2347a1abaebb38807c5. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index a634b3d9118..f08f8b68a1d 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -16,11 +16,11 @@ LOG_MODULE_REGISTER(flash_mspi_nor, CONFIG_FLASH_LOG_LEVEL); -#define XIP_DEV_CFG_MASK (MSPI_DEVICE_CONFIG_CMD_LEN | \ - MSPI_DEVICE_CONFIG_ADDR_LEN | \ - MSPI_DEVICE_CONFIG_READ_CMD | \ - MSPI_DEVICE_CONFIG_WRITE_CMD | \ - MSPI_DEVICE_CONFIG_RX_DUMMY | \ +#define XIP_DEV_CFG_MASK (MSPI_DEVICE_CONFIG_CMD_LEN || \ + MSPI_DEVICE_CONFIG_ADDR_LEN || \ + MSPI_DEVICE_CONFIG_READ_CMD || \ + MSPI_DEVICE_CONFIG_WRITE_CMD || \ + MSPI_DEVICE_CONFIG_RX_DUMMY || \ MSPI_DEVICE_CONFIG_TX_DUMMY) #define NON_XIP_DEV_CFG_MASK (MSPI_DEVICE_CONFIG_ALL & ~XIP_DEV_CFG_MASK) From 1a789b6baf3f631c12e7d6c487d92479db681c7c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 029/881] Revert "[nrf fromtree] samples: code_relocation_nocopy: Update configuration for nRF54H20 DK" This reverts commit b21162108c368ed4c50eb7373223e3e7f0a093c1. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 13 ++++--------- .../code_relocation_nocopy/sample.yaml | 1 - 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/samples/application_development/code_relocation_nocopy/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/application_development/code_relocation_nocopy/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 789c47d3a47..98d67e2ad08 100644 --- a/samples/application_development/code_relocation_nocopy/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/application_development/code_relocation_nocopy/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -2,16 +2,11 @@ status = "okay"; }; -&gpio6 { - status = "okay"; -}; - -&exmif { - status = "okay"; -}; - &mx25uw63 { - status = "okay"; + read-command = <0xEC13>; + command-length = "INSTR_2_BYTE"; + address-length = "ADDR_4_BYTE"; + rx-dummy = <20>; xip-config = <1 0 0x20000000 0>; }; diff --git a/samples/application_development/code_relocation_nocopy/sample.yaml b/samples/application_development/code_relocation_nocopy/sample.yaml index 62929419c53..37e009bc987 100644 --- a/samples/application_development/code_relocation_nocopy/sample.yaml +++ b/samples/application_development/code_relocation_nocopy/sample.yaml @@ -6,7 +6,6 @@ tests: platform_allow: - qemu_cortex_m3 - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - stm32f769i_disco - stm32h7b3i_dk - stm32h573i_dk From 8a746e16699a304f7a6e5fe0121161d10917045f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 030/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Add support for DDR in mx25u family" This reverts commit 8a2d4d752ce6cb8e801197aa0dca0184a2ce28cf. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor_quirks.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/flash/flash_mspi_nor_quirks.h b/drivers/flash/flash_mspi_nor_quirks.h index d58fbea4ff9..e6989496b32 100644 --- a/drivers/flash/flash_mspi_nor_quirks.h +++ b/drivers/flash/flash_mspi_nor_quirks.h @@ -123,30 +123,21 @@ struct flash_mspi_nor_quirks flash_quirks_mxicy_mx25r = { #if DT_HAS_COMPAT_STATUS_OKAY(mxicy_mx25u) +#define MXICY_MX25R_OE_MASK BIT(0) + +static uint8_t mxicy_mx25u_oe_payload = MXICY_MX25R_OE_MASK; + static inline int mxicy_mx25u_post_switch_mode(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode; - uint8_t opi_enable; int rc; if (io_mode != MSPI_IO_MODE_OCTAL) { return 0; } - /* - * TODO - replace this with a generic routine that uses information - * from SFDP header FF87 (Status, Control and Configuration - * Register Map) - */ - - if (dev_config->mspi_nor_cfg.data_rate == MSPI_DATA_RATE_DUAL) { - opi_enable = BIT(1); - } else { - opi_enable = BIT(0); - } - /* Write enable */ rc = cmd_wren(dev); if (rc < 0) { @@ -157,8 +148,8 @@ static inline int mxicy_mx25u_post_switch_mode(const struct device *dev) set_up_xfer(dev, MSPI_TX); dev_data->xfer.addr_length = 4; dev_data->packet.address = 0; - dev_data->packet.data_buf = &opi_enable; - dev_data->packet.num_bytes = sizeof(opi_enable); + dev_data->packet.data_buf = &mxicy_mx25u_oe_payload; + dev_data->packet.num_bytes = sizeof(mxicy_mx25u_oe_payload); return perform_xfer(dev, SPI_NOR_CMD_WR_CFGREG2, false); } From b58ac991c2c6739f7110e51e75d16662bee23d4a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 031/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Add support for "supply-gpios" property" This reverts commit 0d565bb9fc3d0e46b080624c04709d25e9457638. Signed-off-by: Jukka Rissanen --- drivers/flash/Kconfig.mspi | 3 +- drivers/flash/flash_mspi_nor.c | 97 +++++++++------------------- drivers/flash/flash_mspi_nor.h | 6 -- dts/bindings/mtd/jedec,mspi-nor.yaml | 2 - 4 files changed, 33 insertions(+), 75 deletions(-) diff --git a/drivers/flash/Kconfig.mspi b/drivers/flash/Kconfig.mspi index 5740f3618d7..cab2f3a2bcd 100644 --- a/drivers/flash/Kconfig.mspi +++ b/drivers/flash/Kconfig.mspi @@ -35,8 +35,7 @@ menuconfig FLASH_MSPI_NOR select FLASH_MSPI select FLASH_HAS_EXPLICIT_ERASE select FLASH_JESD216 - select GPIO if $(dt_compat_any_has_prop,$(DT_COMPAT_JEDEC_MSPI_NOR),reset-gpios) \ - || $(dt_compat_any_has_prop,$(DT_COMPAT_JEDEC_MSPI_NOR),supply-gpios) + select GPIO if $(dt_compat_any_has_prop,$(DT_COMPAT_JEDEC_MSPI_NOR),reset-gpios) if FLASH_MSPI_NOR diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index f08f8b68a1d..cf283b9302a 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -848,54 +848,39 @@ static int switch_to_target_io_mode(const struct device *dev) &dev_config->mspi_nor_cfg); } -#if defined(WITH_SUPPLY_GPIO) -static int power_supply(const struct device *dev) -{ - const struct flash_mspi_nor_config *dev_config = dev->config; - int rc; - - if (!gpio_is_ready_dt(&dev_config->supply)) { - LOG_ERR("Device %s is not ready", - dev_config->supply.port->name); - return -ENODEV; - } - - rc = gpio_pin_configure_dt(&dev_config->supply, GPIO_OUTPUT_ACTIVE); - if (rc < 0) { - LOG_ERR("Failed to activate power supply GPIO: %d", rc); - return -EIO; - } - - return 0; -} -#endif - #if defined(WITH_RESET_GPIO) static int gpio_reset(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; int rc; - if (!gpio_is_ready_dt(&dev_config->reset)) { - LOG_ERR("Device %s is not ready", - dev_config->reset.port->name); - return -ENODEV; - } + if (dev_config->reset.port) { + if (!gpio_is_ready_dt(&dev_config->reset)) { + LOG_ERR("Device %s is not ready", + dev_config->reset.port->name); + return -ENODEV; + } - rc = gpio_pin_configure_dt(&dev_config->reset, GPIO_OUTPUT_ACTIVE); - if (rc < 0) { - LOG_ERR("Failed to activate RESET: %d", rc); - return -EIO; - } + rc = gpio_pin_configure_dt(&dev_config->reset, + GPIO_OUTPUT_ACTIVE); + if (rc < 0) { + LOG_ERR("Failed to activate RESET: %d", rc); + return -EIO; + } - if (dev_config->reset_pulse_us != 0) { - k_busy_wait(dev_config->reset_pulse_us); - } + if (dev_config->reset_pulse_us != 0) { + k_busy_wait(dev_config->reset_pulse_us); + } - rc = gpio_pin_set_dt(&dev_config->reset, 0); - if (rc < 0) { - LOG_ERR("Failed to deactivate RESET: %d", rc); - return -EIO; + rc = gpio_pin_set_dt(&dev_config->reset, 0); + if (rc < 0) { + LOG_ERR("Failed to deactivate RESET: %d", rc); + return -EIO; + } + + if (dev_config->reset_recovery_us != 0) { + k_busy_wait(dev_config->reset_recovery_us); + } } return 0; @@ -965,6 +950,10 @@ static int soft_reset(const struct device *dev) return rc; } + if (dev_config->reset_recovery_us != 0) { + k_busy_wait(dev_config->reset_recovery_us); + } + return 0; } #endif /* WITH_SOFT_RESET */ @@ -976,7 +965,6 @@ static int flash_chip_init(const struct device *dev) uint8_t id[JESD216_READ_ID_LEN] = {0}; uint16_t dts_cmd = 0; uint32_t sfdp_signature; - bool flash_reset = false; int rc; rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, @@ -989,25 +977,12 @@ static int flash_chip_init(const struct device *dev) dev_data->in_target_io_mode = false; -#if defined(WITH_SUPPLY_GPIO) - if (dev_config->supply.port) { - rc = power_supply(dev); - if (rc < 0) { - return rc; - } - - flash_reset = true; - } -#endif - #if defined(WITH_RESET_GPIO) - if (dev_config->reset.port) { - rc = gpio_reset(dev); - if (rc < 0) { - return rc; - } + rc = gpio_reset(dev); - flash_reset = true; + if (rc < 0) { + LOG_ERR("Failed to reset with GPIO: %d", rc); + return rc; } #endif @@ -1017,15 +992,9 @@ static int flash_chip_init(const struct device *dev) if (rc < 0) { return rc; } - - flash_reset = true; } #endif - if (flash_reset && dev_config->reset_recovery_us != 0) { - k_busy_wait(dev_config->reset_recovery_us); - } - if (dev_config->quirks != NULL && dev_config->quirks->pre_init != NULL) { rc = dev_config->quirks->pre_init(dev); @@ -1298,8 +1267,6 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ .mspi_nor_init_cfg = FLASH_INITIAL_CONFIG(inst), \ IF_ENABLED(CONFIG_MSPI_XIP, \ (.xip_cfg = MSPI_XIP_CONFIG_DT_INST(inst),)) \ - IF_ENABLED(WITH_SUPPLY_GPIO, \ - (.supply = GPIO_DT_SPEC_INST_GET_OR(inst, supply_gpios, {0}),)) \ IF_ENABLED(WITH_RESET_GPIO, \ (.reset = GPIO_DT_SPEC_INST_GET_OR(inst, reset_gpios, {0}), \ .reset_pulse_us = DT_INST_PROP_OR(inst, t_reset_pulse, 0) \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 480bccce472..a3218643982 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -16,9 +16,6 @@ extern "C" { #include "jesd216.h" #include "spi_nor.h" -#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(supply_gpios) -#define WITH_SUPPLY_GPIO 1 -#endif #if DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios) #define WITH_RESET_GPIO 1 #endif @@ -78,9 +75,6 @@ struct flash_mspi_nor_config { #if defined(CONFIG_MSPI_XIP) struct mspi_xip_cfg xip_cfg; #endif -#if defined(WITH_SUPPLY_GPIO) - struct gpio_dt_spec supply; -#endif #if defined(WITH_RESET_GPIO) struct gpio_dt_spec reset; uint32_t reset_pulse_us; diff --git a/dts/bindings/mtd/jedec,mspi-nor.yaml b/dts/bindings/mtd/jedec,mspi-nor.yaml index 348e11cd983..01eba90ecb2 100644 --- a/dts/bindings/mtd/jedec,mspi-nor.yaml +++ b/dts/bindings/mtd/jedec,mspi-nor.yaml @@ -35,8 +35,6 @@ properties: type: int description: | Minimum time, in nanoseconds, the flash chip needs to recover after reset. - Such delay is performed when a GPIO or software reset is done, or after - power is supplied to the chip if the "supply-gpios" property is specified. transfer-timeout: type: int From ef66faf13807cbebc0e41509effd517fd5ffbe8e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 032/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Remove undesirable initial Quad disabling" This reverts commit 8b1bd678d432d313f4beccc9e969367119fd7ac4. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index cf283b9302a..8dbc2db08cc 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -962,6 +962,7 @@ static int flash_chip_init(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; + enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode; uint8_t id[JESD216_READ_ID_LEN] = {0}; uint16_t dts_cmd = 0; uint32_t sfdp_signature; @@ -977,6 +978,28 @@ static int flash_chip_init(const struct device *dev) dev_data->in_target_io_mode = false; + /* Some chips reuse RESET pin for data in Quad modes: + * force single line mode before resetting. + */ + if (dev_data->switch_info.quad_enable_req != JESD216_DW15_QER_VAL_NONE && + (io_mode == MSPI_IO_MODE_SINGLE || + io_mode == MSPI_IO_MODE_QUAD_1_1_4 || + io_mode == MSPI_IO_MODE_QUAD_1_4_4)) { + rc = quad_enable_set(dev, false); + + if (rc < 0) { + LOG_ERR("Failed to switch to single line mode: %d", rc); + return rc; + } + + rc = wait_until_ready(dev, K_USEC(1)); + + if (rc < 0) { + LOG_ERR("Failed waiting for device after switch to single line: %d", rc); + return rc; + } + } + #if defined(WITH_RESET_GPIO) rc = gpio_reset(dev); From 07d18a7eb14f1c14559bf8109820403edcb9c63d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 033/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Add Soft Reset" This reverts commit bdd7c438aeaf83e8416d4108c533581ebcd5a8a1. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor.c | 87 +--------------------------- drivers/flash/flash_mspi_nor.h | 6 +- drivers/flash/flash_mspi_nor_sfdp.h | 7 --- dts/bindings/mtd/jedec,mspi-nor.yaml | 6 -- 4 files changed, 4 insertions(+), 102 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 8dbc2db08cc..b4b5589a14f 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -887,77 +887,6 @@ static int gpio_reset(const struct device *dev) } #endif -#if defined(WITH_SOFT_RESET) -static int soft_reset_66_99(const struct device *dev) -{ - int rc; - - set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_RESET_EN, false); - if (rc < 0) { - LOG_ERR("CMD_RESET_EN failed: %d", rc); - return rc; - } - - set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_RESET_MEM, false); - if (rc < 0) { - LOG_ERR("CMD_RESET_MEM failed: %d", rc); - return rc; - } - - return 0; -} - -static int soft_reset(const struct device *dev) -{ - const struct flash_mspi_nor_config *dev_config = dev->config; - struct flash_mspi_nor_data *dev_data = dev->data; - int rc; - - /* If the flash may expect commands sent in multi-line mode, - * send additionally the reset sequence this way. - */ - if (dev_config->multi_io_cmd) { - rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - MSPI_DEVICE_CONFIG_IO_MODE, - &dev_config->mspi_nor_cfg); - if (rc < 0) { - LOG_ERR("%s: dev_config() failed: %d", __func__, rc); - return rc; - } - - dev_data->in_target_io_mode = true; - - rc = soft_reset_66_99(dev); - if (rc < 0) { - return rc; - } - - rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - MSPI_DEVICE_CONFIG_IO_MODE, - &dev_config->mspi_nor_init_cfg); - if (rc < 0) { - LOG_ERR("%s: dev_config() failed: %d", __func__, rc); - return rc; - } - - dev_data->in_target_io_mode = false; - } - - rc = soft_reset_66_99(dev); - if (rc < 0) { - return rc; - } - - if (dev_config->reset_recovery_us != 0) { - k_busy_wait(dev_config->reset_recovery_us); - } - - return 0; -} -#endif /* WITH_SOFT_RESET */ - static int flash_chip_init(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; @@ -1009,15 +938,6 @@ static int flash_chip_init(const struct device *dev) } #endif -#if defined(WITH_SOFT_RESET) - if (dev_config->initial_soft_reset) { - rc = soft_reset(dev); - if (rc < 0) { - return rc; - } - } -#endif - if (dev_config->quirks != NULL && dev_config->quirks->pre_init != NULL) { rc = dev_config->quirks->pre_init(dev); @@ -1292,10 +1212,10 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ (.xip_cfg = MSPI_XIP_CONFIG_DT_INST(inst),)) \ IF_ENABLED(WITH_RESET_GPIO, \ (.reset = GPIO_DT_SPEC_INST_GET_OR(inst, reset_gpios, {0}), \ - .reset_pulse_us = DT_INST_PROP_OR(inst, t_reset_pulse, 0) \ - / 1000,)) \ + .reset_pulse_us = DT_INST_PROP_OR(inst, t_reset_pulse, 0) \ + / 1000, \ .reset_recovery_us = DT_INST_PROP_OR(inst, t_reset_recovery, 0) \ - / 1000, \ + / 1000,)) \ .transfer_timeout = DT_INST_PROP(inst, transfer_timeout), \ FLASH_PAGE_LAYOUT_DEFINE(inst) \ .jedec_id = DT_INST_PROP_OR(inst, jedec_id, {0}), \ @@ -1308,7 +1228,6 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ .multiperipheral_bus = DT_PROP(DT_INST_BUS(inst), \ software_multiperipheral), \ IO_MODE_FLAGS(DT_INST_ENUM_IDX(inst, mspi_io_mode)), \ - .initial_soft_reset = DT_INST_PROP(inst, initial_soft_reset), \ }; \ FLASH_PAGE_LAYOUT_CHECK(inst) \ DEVICE_DT_INST_DEFINE(inst, \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index a3218643982..13b12d58221 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -19,9 +19,6 @@ extern "C" { #if DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios) #define WITH_RESET_GPIO 1 #endif -#if DT_ANY_INST_HAS_BOOL_STATUS_OKAY(initial_soft_reset) -#define WITH_SOFT_RESET 1 -#endif #define CMD_EXTENSION_NONE 0 #define CMD_EXTENSION_SAME 1 @@ -78,8 +75,8 @@ struct flash_mspi_nor_config { #if defined(WITH_RESET_GPIO) struct gpio_dt_spec reset; uint32_t reset_pulse_us; -#endif uint32_t reset_recovery_us; +#endif uint32_t transfer_timeout; #if defined(CONFIG_FLASH_PAGE_LAYOUT) struct flash_pages_layout layout; @@ -94,7 +91,6 @@ struct flash_mspi_nor_config { bool multiperipheral_bus : 1; bool multi_io_cmd : 1; bool single_io_addr : 1; - bool initial_soft_reset : 1; }; struct flash_mspi_nor_data { diff --git a/drivers/flash/flash_mspi_nor_sfdp.h b/drivers/flash/flash_mspi_nor_sfdp.h index 8dbecff01e8..e8291a7af2a 100644 --- a/drivers/flash/flash_mspi_nor_sfdp.h +++ b/drivers/flash/flash_mspi_nor_sfdp.h @@ -6,8 +6,6 @@ #ifdef CONFIG_FLASH_MSPI_NOR_USE_SFDP -#define BFP_DW16_SOFT_RESET_66_99 BIT(4) - #define BFP_DW16_4B_ADDR_ENTER_B7 BIT(0) #define BFP_DW16_4B_ADDR_ENTER_06_B7 BIT(1) #define BFP_DW16_4B_ADDR_PER_CMD BIT(5) @@ -361,11 +359,6 @@ BFP_DW16_4B_ADDR_PER_CMD | \ BFP_DW16_4B_ADDR_ALWAYS)), \ "No supported method of entering 4-byte addressing mode for " \ - DT_NODE_FULL_NAME(DT_DRV_INST(inst))); \ - BUILD_ASSERT(!DT_INST_PROP(inst, initial_soft_reset) || \ - (SFDP_FIELD(inst, sfdp_bfp, 16, GENMASK(13, 8)) \ - & BFP_DW16_SOFT_RESET_66_99), \ - "Cannot use 66h/99h soft reset sequence for " \ DT_NODE_FULL_NAME(DT_DRV_INST(inst))) #else diff --git a/dts/bindings/mtd/jedec,mspi-nor.yaml b/dts/bindings/mtd/jedec,mspi-nor.yaml index 01eba90ecb2..40bfe353943 100644 --- a/dts/bindings/mtd/jedec,mspi-nor.yaml +++ b/dts/bindings/mtd/jedec,mspi-nor.yaml @@ -52,9 +52,3 @@ properties: codes for commands that require addresses (like Read, Page Program, or Erase) if those are supported by the flash chip, or if necessary, it will switch the chip to 4-byte addressing mode. - - initial-soft-reset: - type: boolean - description: | - When set, the flash driver performs software reset of the flash chip - at initialization. From 693c9a56685ea7b23fbbb1e696cf0402679ee013 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 034/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Complete handling of QER, add handling of OER" This reverts commit 79bc3aa74768e2d203f73cd9ce9efbdca4b36186. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor.c | 151 ++++---------------------- drivers/flash/flash_mspi_nor_quirks.h | 6 + 2 files changed, 25 insertions(+), 132 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index b4b5589a14f..abf9bb85fc8 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -638,138 +638,31 @@ static int dev_pm_action_cb(const struct device *dev, static int quad_enable_set(const struct device *dev, bool enable) { struct flash_mspi_nor_data *dev_data = dev->data; - uint8_t op_code; - uint8_t qe_bit; - uint8_t status_reg; - uint8_t payload_len; - uint8_t payload[2]; int rc; - switch (dev_data->switch_info.quad_enable_req) { - case JESD216_DW15_QER_VAL_S1B6: - op_code = SPI_NOR_CMD_RDSR; - qe_bit = BIT(6); - break; - case JESD216_DW15_QER_VAL_S2B7: - /* Use special Read status register 2 instruction. */ - op_code = 0x3F; - qe_bit = BIT(7); - break; - case JESD216_DW15_QER_VAL_S2B1v1: - case JESD216_DW15_QER_VAL_S2B1v4: - case JESD216_DW15_QER_VAL_S2B1v5: - case JESD216_DW15_QER_VAL_S2B1v6: - op_code = SPI_NOR_CMD_RDSR2; - qe_bit = BIT(1); - break; - default: - LOG_ERR("Unknown Quad Enable Requirement: %u", - dev_data->switch_info.quad_enable_req); - return -ENOTSUP; - } - - rc = cmd_rdsr(dev, op_code, &status_reg); + rc = cmd_wren(dev); if (rc < 0) { + LOG_ERR("Failed to set write enable: %d", rc); return rc; } - if (((status_reg & qe_bit) != 0) == enable) { - /* Nothing to do, the QE bit is already set properly. */ - return 0; - } - - status_reg ^= qe_bit; - - switch (dev_data->switch_info.quad_enable_req) { - default: - case JESD216_DW15_QER_VAL_S1B6: - payload_len = 1; - op_code = SPI_NOR_CMD_WRSR; - break; - case JESD216_DW15_QER_VAL_S2B7: - payload_len = 1; - /* Use special Write status register 2 instruction. */ - op_code = 0x3E; - break; - case JESD216_DW15_QER_VAL_S2B1v1: - case JESD216_DW15_QER_VAL_S2B1v4: - case JESD216_DW15_QER_VAL_S2B1v5: - payload_len = 2; - op_code = SPI_NOR_CMD_WRSR; - break; - case JESD216_DW15_QER_VAL_S2B1v6: - payload_len = 1; - op_code = SPI_NOR_CMD_WRSR2; - break; - } - - if (payload_len == 1) { - payload[0] = status_reg; - } else { - payload[1] = status_reg; + if (dev_data->switch_info.quad_enable_req == JESD216_DW15_QER_VAL_S1B6) { + uint8_t mode_payload = enable ? BIT(6) : 0; - /* When the Write Status command is to be sent with two data - * bytes (this is the case for S2B1v1, S2B1v4, and S2B1v5 QER - * values), the first status register needs to be read and - * sent as the first byte, so that its value is not modified. - */ - rc = cmd_rdsr(dev, SPI_NOR_CMD_RDSR, &payload[0]); + rc = cmd_wrsr(dev, SPI_NOR_CMD_WRSR, 1, &mode_payload); if (rc < 0) { + LOG_ERR("Failed to enable/disable quad mode: %d", rc); return rc; } - } - - rc = cmd_wrsr(dev, op_code, payload_len, payload); - if (rc < 0) { - return rc; - } - - return 0; -} - -static int octal_enable_set(const struct device *dev, bool enable) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - uint8_t op_code; - uint8_t oe_bit; - uint8_t status_reg; - int rc; - - if (dev_data->switch_info.octal_enable_req != OCTAL_ENABLE_REQ_S2B3) { - LOG_ERR("Unknown Octal Enable Requirement: %u", - dev_data->switch_info.octal_enable_req); + } else { + /* TODO: handle all DW15 QER values */ return -ENOTSUP; } - oe_bit = BIT(3); - - /* Use special Read status register 2 instruction 0x65 with one address - * byte 0x02 and one dummy byte. - */ - op_code = 0x65; - set_up_xfer(dev, MSPI_RX); - dev_data->xfer.rx_dummy = 8; - dev_data->xfer.addr_length = 1; - dev_data->packet.address = 0x02; - dev_data->packet.num_bytes = sizeof(uint8_t); - dev_data->packet.data_buf = &status_reg; - rc = perform_xfer(dev, op_code, false); - if (rc < 0) { - LOG_ERR("cmd_rdsr 0x%02x failed: %d", op_code, rc); - return rc; - } - - if (((status_reg & oe_bit) != 0) == enable) { - /* Nothing to do, the OE bit is already set properly. */ - return 0; - } - - status_reg ^= oe_bit; + rc = wait_until_ready(dev, K_USEC(1)); - /* Use special Write status register 2 instruction to clear the bit. */ - op_code = (status_reg & oe_bit) ? SPI_NOR_CMD_WRSR2 : 0x3E; - rc = cmd_wrsr(dev, op_code, 1, &status_reg); if (rc < 0) { + LOG_ERR("Failed waiting until device ready after enabling quad: %d", rc); return rc; } @@ -806,24 +699,18 @@ static int switch_to_target_io_mode(const struct device *dev) int rc = 0; if (dev_data->switch_info.quad_enable_req != JESD216_DW15_QER_VAL_NONE) { - bool quad_needed = io_mode == MSPI_IO_MODE_QUAD_1_1_4 || - io_mode == MSPI_IO_MODE_QUAD_1_4_4; - - rc = quad_enable_set(dev, quad_needed); - if (rc < 0) { - LOG_ERR("Failed to modify Quad Enable bit: %d", rc); - return rc; + /* For Quad 1-1-4 and 1-4-4, entering or leaving mode is defined + * in JEDEC216 BFP DW15 QER + */ + if (io_mode == MSPI_IO_MODE_SINGLE) { + rc = quad_enable_set(dev, false); + } else if (io_mode == MSPI_IO_MODE_QUAD_1_1_4 || + io_mode == MSPI_IO_MODE_QUAD_1_4_4) { + rc = quad_enable_set(dev, true); } - } - if (dev_data->switch_info.octal_enable_req != OCTAL_ENABLE_REQ_NONE) { - bool octal_needed = io_mode == MSPI_IO_MODE_OCTAL_1_1_8 || - io_mode == MSPI_IO_MODE_OCTAL_1_8_8; - - rc = octal_enable_set(dev, octal_needed); if (rc < 0) { - LOG_ERR("Failed to modify Octal Enable bit: %d", rc); - return rc; + LOG_ERR("Failed to modify Quad Enable bit: %d", rc); } } diff --git a/drivers/flash/flash_mspi_nor_quirks.h b/drivers/flash/flash_mspi_nor_quirks.h index e6989496b32..391a075131d 100644 --- a/drivers/flash/flash_mspi_nor_quirks.h +++ b/drivers/flash/flash_mspi_nor_quirks.h @@ -70,6 +70,12 @@ static inline int mxicy_mx25r_post_switch_mode(const struct device *dev) return 0; } + /* Wait for previous write to finish */ + rc = wait_until_ready(dev, K_USEC(1)); + if (rc < 0) { + return rc; + } + /* Write enable */ rc = cmd_wren(dev); if (rc < 0) { From 25b76c31d10051b40fcffaa8d71ce4a8f70355d2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 035/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Refactor handling of commands" This reverts commit 034396afc6d0dc498bd5e8f075f84ae258e58651. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor.c | 771 ++++++++++---------------- drivers/flash/flash_mspi_nor.h | 199 ++++++- drivers/flash/flash_mspi_nor_quirks.h | 68 ++- drivers/flash/flash_mspi_nor_sfdp.h | 17 +- dts/bindings/mtd/jedec,mspi-nor.yaml | 24 +- 5 files changed, 528 insertions(+), 551 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index abf9bb85fc8..125aedfa250 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -16,30 +16,12 @@ LOG_MODULE_REGISTER(flash_mspi_nor, CONFIG_FLASH_LOG_LEVEL); -#define XIP_DEV_CFG_MASK (MSPI_DEVICE_CONFIG_CMD_LEN || \ - MSPI_DEVICE_CONFIG_ADDR_LEN || \ - MSPI_DEVICE_CONFIG_READ_CMD || \ - MSPI_DEVICE_CONFIG_WRITE_CMD || \ - MSPI_DEVICE_CONFIG_RX_DUMMY || \ - MSPI_DEVICE_CONFIG_TX_DUMMY) - -#define NON_XIP_DEV_CFG_MASK (MSPI_DEVICE_CONFIG_ALL & ~XIP_DEV_CFG_MASK) - -static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir); -static int perform_xfer(const struct device *dev, - uint8_t cmd, bool mem_access); -static int cmd_rdsr(const struct device *dev, uint8_t op_code, uint8_t *sr); -static int wait_until_ready(const struct device *dev, k_timeout_t poll_period); -static int cmd_wren(const struct device *dev); -static int cmd_wrsr(const struct device *dev, uint8_t op_code, - uint8_t sr_cnt, uint8_t *sr); - #include "flash_mspi_nor_quirks.h" -static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir) +void flash_mspi_command_set(const struct device *dev, const struct flash_mspi_nor_cmd *cmd) { - const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; + const struct flash_mspi_nor_config *dev_config = dev->config; memset(&dev_data->xfer, 0, sizeof(dev_data->xfer)); memset(&dev_data->packet, 0, sizeof(dev_data->packet)); @@ -49,186 +31,32 @@ static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir) dev_data->xfer.num_packet = 1; dev_data->xfer.timeout = dev_config->transfer_timeout; - dev_data->packet.dir = dir; -} - -static void set_up_xfer_with_addr(const struct device *dev, - enum mspi_xfer_direction dir, - uint32_t addr) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - - set_up_xfer(dev, dir); - dev_data->xfer.addr_length = dev_data->cmd_info.uses_4byte_addr - ? 4 : 3; - dev_data->packet.address = addr; -} - -static uint16_t get_extended_command(const struct device *dev, - uint8_t cmd) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - uint8_t cmd_extension = cmd; - - if (dev_data->cmd_info.cmd_extension == CMD_EXTENSION_INVERSE) { - cmd_extension = ~cmd_extension; - } + dev_data->xfer.cmd_length = cmd->cmd_length; + dev_data->xfer.addr_length = cmd->addr_length; + dev_data->xfer.tx_dummy = (cmd->dir == MSPI_TX) ? + cmd->tx_dummy : dev_config->mspi_nor_cfg.tx_dummy; + dev_data->xfer.rx_dummy = (cmd->dir == MSPI_RX) ? + cmd->rx_dummy : dev_config->mspi_nor_cfg.rx_dummy; - return ((uint16_t)cmd << 8) | cmd_extension; + dev_data->packet.dir = cmd->dir; + dev_data->packet.cmd = cmd->cmd; } -static int perform_xfer(const struct device *dev, - uint8_t cmd, bool mem_access) +static int dev_cfg_apply(const struct device *dev, const struct mspi_dev_cfg *cfg) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; - const struct mspi_dev_cfg *cfg = NULL; - int rc; - - if (dev_data->cmd_info.cmd_extension != CMD_EXTENSION_NONE && - dev_data->in_target_io_mode) { - dev_data->xfer.cmd_length = 2; - dev_data->packet.cmd = get_extended_command(dev, cmd); - } else { - dev_data->xfer.cmd_length = 1; - dev_data->packet.cmd = cmd; - } - - if (dev_config->multi_io_cmd || - dev_config->mspi_nor_cfg.io_mode == MSPI_IO_MODE_SINGLE) { - /* If multiple IO lines are used in all the transfer phases - * or in none of them, there's no need to switch the IO mode. - */ - } else if (mem_access) { - /* For commands accessing the flash memory (read and program), - * ensure that the target IO mode is active. - */ - if (!dev_data->in_target_io_mode) { - cfg = &dev_config->mspi_nor_cfg; - } - } else { - /* For all other commands, switch to Single IO mode if a given - * command needs the data or address phase and in the target IO - * mode multiple IO lines are used in these phases. - */ - if (dev_data->in_target_io_mode) { - if (dev_data->packet.num_bytes != 0 || - (dev_data->xfer.addr_length != 0 && - !dev_config->single_io_addr)) { - /* Only the IO mode is to be changed, so the - * initial configuration structure can be used - * for this operation. - */ - cfg = &dev_config->mspi_nor_init_cfg; - } - } - } - - if (cfg) { - rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - MSPI_DEVICE_CONFIG_IO_MODE, cfg); - if (rc < 0) { - LOG_ERR("%s: dev_config() failed: %d", __func__, rc); - return rc; - } - - dev_data->in_target_io_mode = mem_access; - } - - rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, - &dev_data->xfer); - if (rc < 0) { - LOG_ERR("%s: transceive() failed: %d", __func__, rc); - return rc; - } - - return 0; -} - -static int cmd_rdsr(const struct device *dev, uint8_t op_code, uint8_t *sr) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - int rc; - - set_up_xfer(dev, MSPI_RX); - if (dev_data->in_target_io_mode) { - dev_data->xfer.rx_dummy = dev_data->cmd_info.rdsr_dummy; - dev_data->xfer.addr_length = dev_data->cmd_info.rdsr_addr_4 - ? 4 : 0; - } - dev_data->packet.num_bytes = sizeof(uint8_t); - dev_data->packet.data_buf = sr; - rc = perform_xfer(dev, op_code, false); - if (rc < 0) { - LOG_ERR("%s 0x%02x failed: %d", __func__, op_code, rc); - return rc; - } - - return 0; -} - -static int wait_until_ready(const struct device *dev, k_timeout_t poll_period) -{ - int rc; - uint8_t status_reg; - - while (true) { - rc = cmd_rdsr(dev, SPI_NOR_CMD_RDSR, &status_reg); - if (rc < 0) { - LOG_ERR("%s - status xfer failed: %d", __func__, rc); - return rc; - } - - if (!(status_reg & SPI_NOR_WIP_BIT)) { - break; - } - - k_sleep(poll_period); - } - - return 0; -} - -static int cmd_wren(const struct device *dev) -{ - int rc; - - set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_WREN, false); - if (rc < 0) { - LOG_ERR("%s failed: %d", __func__, rc); - return rc; - } - - return 0; -} -static int cmd_wrsr(const struct device *dev, uint8_t op_code, - uint8_t sr_cnt, uint8_t *sr) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - int rc; - - rc = cmd_wren(dev); - if (rc < 0) { - return rc; - } - - set_up_xfer(dev, MSPI_TX); - dev_data->packet.num_bytes = sr_cnt; - dev_data->packet.data_buf = sr; - rc = perform_xfer(dev, op_code, false); - if (rc < 0) { - LOG_ERR("%s 0x%02x failed: %d", __func__, op_code, rc); - return rc; + if (dev_data->curr_cfg == cfg) { + return 0; } - rc = wait_until_ready(dev, K_USEC(1)); + int rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, + MSPI_DEVICE_CONFIG_ALL, cfg); if (rc < 0) { - return rc; + LOG_ERR("Failed to set device config: %p error: %d", cfg, rc); } - - return 0; + return rc; } static int acquire(const struct device *dev) @@ -243,26 +71,15 @@ static int acquire(const struct device *dev) if (rc < 0) { LOG_ERR("pm_device_runtime_get() failed: %d", rc); } else { - enum mspi_dev_cfg_mask mask; - - if (dev_config->multiperipheral_bus) { - mask = NON_XIP_DEV_CFG_MASK; - } else { - mask = MSPI_DEVICE_CONFIG_NONE; - } - /* This acquires the MSPI controller and reconfigures it * if needed for the flash device. */ rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - mask, &dev_config->mspi_nor_cfg); + dev_config->mspi_nor_cfg_mask, + &dev_config->mspi_nor_cfg); if (rc < 0) { LOG_ERR("mspi_dev_config() failed: %d", rc); } else { - if (dev_config->multiperipheral_bus) { - dev_data->in_target_io_mode = true; - } - return 0; } @@ -300,34 +117,10 @@ static inline uint16_t dev_page_size(const struct device *dev) return dev_config->page_size; } -static inline -const struct jesd216_erase_type *dev_erase_types(const struct device *dev) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - - return dev_data->erase_types; -} - -static uint8_t get_rx_dummy(const struct device *dev) -{ - const struct flash_mspi_nor_config *dev_config = dev->config; - struct flash_mspi_nor_data *dev_data = dev->data; - - /* If the number of RX dummy cycles is specified in dts, use that value. */ - if (dev_config->rx_dummy_specified) { - return dev_config->mspi_nor_cfg.rx_dummy; - } - - /* Since it's not yet possible to specify mode bits with MSPI API, - * treat mode bit cycles as just dummy. - */ - return dev_data->cmd_info.read_mode_bit_cycles + - dev_data->cmd_info.read_dummy_cycles; -} - static int api_read(const struct device *dev, off_t addr, void *dest, size_t size) { + const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const uint32_t flash_size = dev_flash_size(dev); int rc; @@ -345,11 +138,23 @@ static int api_read(const struct device *dev, off_t addr, void *dest, return rc; } - set_up_xfer_with_addr(dev, MSPI_RX, addr); - dev_data->xfer.rx_dummy = get_rx_dummy(dev); + if (dev_config->jedec_cmds->read.force_single) { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); + } else { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); + } + + if (rc < 0) { + return rc; + } + + /* TODO: get rid of all these hard-coded values for MX25Ux chips */ + flash_mspi_command_set(dev, &dev_config->jedec_cmds->read); + dev_data->packet.address = addr; dev_data->packet.data_buf = dest; dev_data->packet.num_bytes = size; - rc = perform_xfer(dev, dev_data->cmd_info.read_cmd, true); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); release(dev); @@ -361,9 +166,85 @@ static int api_read(const struct device *dev, off_t addr, void *dest, return 0; } +static int status_get(const struct device *dev, uint8_t *status) +{ + const struct flash_mspi_nor_config *dev_config = dev->config; + struct flash_mspi_nor_data *dev_data = dev->data; + int rc; + + /* Enter command mode */ + if (dev_config->jedec_cmds->status.force_single) { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); + } else { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); + } + + if (rc < 0) { + LOG_ERR("Switching to dev_cfg failed: %d", rc); + return rc; + } + + flash_mspi_command_set(dev, &dev_config->jedec_cmds->status); + dev_data->packet.data_buf = status; + dev_data->packet.num_bytes = sizeof(uint8_t); + + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); + + if (rc < 0) { + LOG_ERR("Status xfer failed: %d", rc); + return rc; + } + + return rc; +} + +static int wait_until_ready(const struct device *dev, k_timeout_t poll_period) +{ + int rc; + uint8_t status_reg; + + while (true) { + rc = status_get(dev, &status_reg); + + if (rc < 0) { + LOG_ERR("Wait until ready - status xfer failed: %d", rc); + return rc; + } + + if (!(status_reg & SPI_NOR_WIP_BIT)) { + break; + } + + k_sleep(poll_period); + } + + return 0; +} + +static int write_enable(const struct device *dev) +{ + const struct flash_mspi_nor_config *dev_config = dev->config; + struct flash_mspi_nor_data *dev_data = dev->data; + int rc; + + if (dev_config->jedec_cmds->write_en.force_single) { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); + } else { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); + } + + if (rc < 0) { + return rc; + } + + flash_mspi_command_set(dev, &dev_config->jedec_cmds->write_en); + return mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); +} + static int api_write(const struct device *dev, off_t addr, const void *src, size_t size) { + const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const uint32_t flash_size = dev_flash_size(dev); const uint16_t page_size = dev_page_size(dev); @@ -388,14 +269,27 @@ static int api_write(const struct device *dev, off_t addr, const void *src, uint16_t page_left = page_size - page_offset; uint16_t to_write = (uint16_t)MIN(size, page_left); - if (cmd_wren(dev) < 0) { + if (write_enable(dev) < 0) { + LOG_ERR("Write enable xfer failed: %d", rc); break; } - set_up_xfer_with_addr(dev, MSPI_TX, addr); + if (dev_config->jedec_cmds->page_program.force_single) { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); + } else { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); + } + + if (rc < 0) { + return rc; + } + + flash_mspi_command_set(dev, &dev_config->jedec_cmds->page_program); + dev_data->packet.address = addr; dev_data->packet.data_buf = (uint8_t *)src; dev_data->packet.num_bytes = to_write; - rc = perform_xfer(dev, dev_data->cmd_info.pp_cmd, true); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); if (rc < 0) { LOG_ERR("Page program xfer failed: %d", rc); break; @@ -416,28 +310,9 @@ static int api_write(const struct device *dev, off_t addr, const void *src, return rc; } -static const struct jesd216_erase_type *find_best_erase_type( - const struct device *dev, off_t addr, size_t size) -{ - const struct jesd216_erase_type *erase_types = dev_erase_types(dev); - const struct jesd216_erase_type *best_et = NULL; - - for (int i = 0; i < JESD216_NUM_ERASE_TYPES; ++i) { - const struct jesd216_erase_type *et = &erase_types[i]; - - if ((et->exp != 0) - && SPI_NOR_IS_ALIGNED(addr, et->exp) - && (size >= BIT(et->exp)) - && ((best_et == NULL) || (et->exp > best_et->exp))) { - best_et = et; - } - } - - return best_et; -} - static int api_erase(const struct device *dev, off_t addr, size_t size) { + const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const uint32_t flash_size = dev_flash_size(dev); int rc = 0; @@ -460,33 +335,45 @@ static int api_erase(const struct device *dev, off_t addr, size_t size) } while (size > 0) { - if (cmd_wren(dev) < 0) { + rc = write_enable(dev); + if (rc < 0) { + LOG_ERR("Write enable failed."); break; } if (size == flash_size) { /* Chip erase. */ - set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_CE, false); + if (dev_config->jedec_cmds->chip_erase.force_single) { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); + } else { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); + } + + if (rc < 0) { + return rc; + } + flash_mspi_command_set(dev, &dev_config->jedec_cmds->chip_erase); size -= flash_size; } else { - const struct jesd216_erase_type *best_et = - find_best_erase_type(dev, addr, size); - - if (best_et != NULL) { - set_up_xfer_with_addr(dev, MSPI_TX, addr); - rc = perform_xfer(dev, best_et->cmd, false); - - addr += BIT(best_et->exp); - size -= BIT(best_et->exp); + /* Sector erase. */ + if (dev_config->jedec_cmds->sector_erase.force_single) { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); } else { - LOG_ERR("Can't erase %zu at 0x%lx", - size, (long)addr); - rc = -EINVAL; - break; + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); } + + if (rc < 0) { + return rc; + } + + flash_mspi_command_set(dev, &dev_config->jedec_cmds->sector_erase); + dev_data->packet.address = addr; + addr += SPI_NOR_SECTOR_SIZE; + size -= SPI_NOR_SECTOR_SIZE; } + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); if (rc < 0) { LOG_ERR("Erase command 0x%02x xfer failed: %d", dev_data->packet.cmd, rc); @@ -523,49 +410,30 @@ struct flash_parameters *api_get_parameters(const struct device *dev) return ¶meters; } -static int sfdp_read(const struct device *dev, off_t addr, void *dest, - size_t size) +static int read_jedec_id(const struct device *dev, uint8_t *id) { + const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; int rc; - set_up_xfer(dev, MSPI_RX); - if (dev_data->in_target_io_mode) { - dev_data->xfer.rx_dummy = dev_data->cmd_info.sfdp_dummy_20 - ? 20 : 8; - dev_data->xfer.addr_length = dev_data->cmd_info.sfdp_addr_4 - ? 4 : 3; + if (dev_config->jedec_cmds->id.force_single) { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); } else { - dev_data->xfer.rx_dummy = 8; - dev_data->xfer.addr_length = 3; + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); } - dev_data->packet.address = addr; - dev_data->packet.data_buf = dest; - dev_data->packet.num_bytes = size; - rc = perform_xfer(dev, JESD216_CMD_READ_SFDP, false); + if (rc < 0) { - LOG_ERR("Read SFDP xfer failed: %d", rc); + return rc; } - return rc; -} - -static int read_jedec_id(const struct device *dev, uint8_t *id) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - int rc; - - set_up_xfer(dev, MSPI_RX); - if (dev_data->in_target_io_mode) { - dev_data->xfer.rx_dummy = dev_data->cmd_info.rdid_dummy; - dev_data->xfer.addr_length = dev_data->cmd_info.rdid_addr_4 - ? 4 : 0; - } + flash_mspi_command_set(dev, &dev_config->jedec_cmds->id); dev_data->packet.data_buf = id; dev_data->packet.num_bytes = JESD216_READ_ID_LEN; - rc = perform_xfer(dev, SPI_NOR_CMD_RDID, false); + + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); if (rc < 0) { - LOG_ERR("Read JEDEC ID failed: %d", rc); + LOG_ERR("Read JEDEC ID failed: %d\n", rc); } return rc; @@ -587,6 +455,8 @@ static void api_page_layout(const struct device *dev, static int api_sfdp_read(const struct device *dev, off_t addr, void *dest, size_t size) { + const struct flash_mspi_nor_config *dev_config = dev->config; + struct flash_mspi_nor_data *dev_data = dev->data; int rc; if (size == 0) { @@ -598,7 +468,26 @@ static int api_sfdp_read(const struct device *dev, off_t addr, void *dest, return rc; } - rc = sfdp_read(dev, addr, dest, size); + if (dev_config->jedec_cmds->sfdp.force_single) { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); + } else { + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); + } + + if (rc < 0) { + return rc; + } + + flash_mspi_command_set(dev, &dev_config->jedec_cmds->sfdp); + dev_data->packet.address = addr; + dev_data->packet.data_buf = dest; + dev_data->packet.num_bytes = size; + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); + if (rc < 0) { + printk("Read SFDP xfer failed: %d\n", rc); + return rc; + } release(dev); @@ -637,19 +526,31 @@ static int dev_pm_action_cb(const struct device *dev, static int quad_enable_set(const struct device *dev, bool enable) { + const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; int rc; - rc = cmd_wren(dev); + flash_mspi_command_set(dev, &commands_single.write_en); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); if (rc < 0) { LOG_ERR("Failed to set write enable: %d", rc); return rc; } if (dev_data->switch_info.quad_enable_req == JESD216_DW15_QER_VAL_S1B6) { + const struct flash_mspi_nor_cmd cmd_status = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_WRSR, + .cmd_length = 1, + }; uint8_t mode_payload = enable ? BIT(6) : 0; - rc = cmd_wrsr(dev, SPI_NOR_CMD_WRSR, 1, &mode_payload); + flash_mspi_command_set(dev, &cmd_status); + dev_data->packet.data_buf = &mode_payload; + dev_data->packet.num_bytes = sizeof(mode_payload); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); + if (rc < 0) { LOG_ERR("Failed to enable/disable quad mode: %d", rc); return rc; @@ -669,29 +570,8 @@ static int quad_enable_set(const struct device *dev, bool enable) return 0; } -static int enter_4byte_addressing_mode(const struct device *dev) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - int rc; - - if (dev_data->switch_info.enter_4byte_addr == ENTER_4BYTE_ADDR_06_B7) { - rc = cmd_wren(dev); - if (rc < 0) { - return rc; - } - } - - set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, 0xB7, false); - if (rc < 0) { - LOG_ERR("Command 0xB7 failed: %d", rc); - return rc; - } - return 0; -} - -static int switch_to_target_io_mode(const struct device *dev) +static int default_io_mode(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; @@ -714,25 +594,16 @@ static int switch_to_target_io_mode(const struct device *dev) } } - if (dev_data->switch_info.enter_4byte_addr != ENTER_4BYTE_ADDR_NONE) { - rc = enter_4byte_addressing_mode(dev); - if (rc < 0) { - LOG_ERR("Failed to enter 4-byte addressing mode: %d", rc); - return rc; - } + if ((dev_config->quirks != NULL) && (dev_config->quirks->post_switch_mode != NULL)) { + rc = dev_config->quirks->post_switch_mode(dev); } - if (dev_config->quirks != NULL && - dev_config->quirks->post_switch_mode != NULL) { - rc = dev_config->quirks->post_switch_mode(dev); - if (rc < 0) { - return rc; - } + if (rc < 0) { + LOG_ERR("Failed to change IO mode: %d\n", rc); + return rc; } - return mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - NON_XIP_DEV_CFG_MASK, - &dev_config->mspi_nor_cfg); + return dev_cfg_apply(dev, &dev_config->mspi_nor_cfg); } #if defined(WITH_RESET_GPIO) @@ -780,20 +651,14 @@ static int flash_chip_init(const struct device *dev) struct flash_mspi_nor_data *dev_data = dev->data; enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode; uint8_t id[JESD216_READ_ID_LEN] = {0}; - uint16_t dts_cmd = 0; - uint32_t sfdp_signature; int rc; - rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - MSPI_DEVICE_CONFIG_ALL, - &dev_config->mspi_nor_init_cfg); + rc = dev_cfg_apply(dev, &dev_config->mspi_nor_init_cfg); + if (rc < 0) { - LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->in_target_io_mode = false; - /* Some chips reuse RESET pin for data in Quad modes: * force single line mode before resetting. */ @@ -830,114 +695,51 @@ static int flash_chip_init(const struct device *dev) rc = dev_config->quirks->pre_init(dev); } - /* Allow users to specify commands for Read and Page Program operations - * through dts to override what was taken from SFDP and perhaps altered - * in the pre_init quirk. Also the number of dummy cycles for the Read - * operation can be overridden this way, see get_rx_dummy(). - */ - if (dev_config->mspi_nor_cfg.read_cmd != 0) { - dts_cmd = (uint16_t)dev_config->mspi_nor_cfg.read_cmd; - if (dev_config->mspi_nor_cfg.cmd_length > 1) { - dev_data->cmd_info.read_cmd = (uint8_t)(dts_cmd >> 8); - } else { - dev_data->cmd_info.read_cmd = (uint8_t)dts_cmd; - } - } - if (dev_config->mspi_nor_cfg.write_cmd != 0) { - dts_cmd = (uint16_t)dev_config->mspi_nor_cfg.write_cmd; - if (dev_config->mspi_nor_cfg.cmd_length > 1) { - dev_data->cmd_info.pp_cmd = (uint8_t)(dts_cmd >> 8); - } else { - dev_data->cmd_info.pp_cmd = (uint8_t)dts_cmd; - } - } - if (dts_cmd != 0) { - if (dev_config->mspi_nor_cfg.cmd_length <= 1) { - dev_data->cmd_info.cmd_extension = CMD_EXTENSION_NONE; - } else if ((dts_cmd & 0xFF) == ((dts_cmd >> 8) & 0xFF)) { - dev_data->cmd_info.cmd_extension = CMD_EXTENSION_SAME; - } else { - dev_data->cmd_info.cmd_extension = CMD_EXTENSION_INVERSE; - } - } - - if (dev_config->jedec_id_specified) { - rc = read_jedec_id(dev, id); - if (rc < 0) { - LOG_ERR("Failed to read JEDEC ID: %d", rc); - return rc; - } + flash_mspi_command_set(dev, &commands_single.id); + dev_data->packet.data_buf = id; + dev_data->packet.num_bytes = sizeof(id); - if (memcmp(id, dev_config->jedec_id, sizeof(id)) != 0) { - LOG_ERR("JEDEC ID mismatch, read: %02x %02x %02x, " - "expected: %02x %02x %02x", - id[0], id[1], id[2], - dev_config->jedec_id[0], - dev_config->jedec_id[1], - dev_config->jedec_id[2]); - return -ENODEV; - } + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); + if (rc < 0) { + LOG_ERR("Failed to read JEDEC ID in initial line mode: %d", rc); + return rc; } - rc = switch_to_target_io_mode(dev); + rc = default_io_mode(dev); + if (rc < 0) { - LOG_ERR("Failed to switch to target io mode: %d", rc); + LOG_ERR("Failed to switch to default io mode: %d", rc); return rc; } - dev_data->in_target_io_mode = true; - - if (IS_ENABLED(CONFIG_FLASH_MSPI_NOR_USE_SFDP)) { - /* Read the SFDP signature to test if communication with - * the flash chip can be successfully performed after switching - * to target IO mode. - */ - rc = sfdp_read(dev, 0, &sfdp_signature, sizeof(sfdp_signature)); + /* Reading JEDEC ID for mode that forces single lane would be redundant, + * since it switches back to single lane mode. Use ID from previous read. + */ + if (!dev_config->jedec_cmds->id.force_single) { + rc = read_jedec_id(dev, id); if (rc < 0) { - LOG_ERR("Failed to read SFDP signature: %d", rc); + LOG_ERR("Failed to read JEDEC ID in final line mode: %d", rc); return rc; } + } - if (sfdp_signature != JESD216_SFDP_MAGIC) { - LOG_ERR("SFDP signature mismatch: %08x, expected: %08x", - sfdp_signature, JESD216_SFDP_MAGIC); - return -ENODEV; - } + if (memcmp(id, dev_config->jedec_id, sizeof(id)) != 0) { + LOG_ERR("JEDEC ID mismatch, read: %02x %02x %02x, " + "expected: %02x %02x %02x", + id[0], id[1], id[2], + dev_config->jedec_id[0], + dev_config->jedec_id[1], + dev_config->jedec_id[2]); + return -ENODEV; } #if defined(CONFIG_MSPI_XIP) /* Enable XIP access for this chip if specified so in DT. */ if (dev_config->xip_cfg.enable) { - struct mspi_dev_cfg mspi_cfg = { - .addr_length = dev_data->cmd_info.uses_4byte_addr - ? 4 : 3, - .rx_dummy = get_rx_dummy(dev), - }; - - if (dev_data->cmd_info.cmd_extension != CMD_EXTENSION_NONE) { - mspi_cfg.cmd_length = 2; - mspi_cfg.read_cmd = get_extended_command(dev, - dev_data->cmd_info.read_cmd); - mspi_cfg.write_cmd = get_extended_command(dev, - dev_data->cmd_info.pp_cmd); - } else { - mspi_cfg.cmd_length = 1; - mspi_cfg.read_cmd = dev_data->cmd_info.read_cmd; - mspi_cfg.write_cmd = dev_data->cmd_info.pp_cmd; - } - - rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - XIP_DEV_CFG_MASK, &mspi_cfg); - if (rc < 0) { - LOG_ERR("Failed to configure controller for XIP: %d", - rc); - return rc; - } - rc = mspi_xip_config(dev_config->bus, &dev_config->mspi_id, &dev_config->xip_cfg); if (rc < 0) { - LOG_ERR("Failed to enable XIP: %d", rc); return rc; } } @@ -981,39 +783,6 @@ static int drv_init(const struct device *dev) return rc; } - if (dev_data->cmd_info.read_cmd == 0) { - LOG_ERR("Read command not defined for %s, " - "use \"read-command\" property to specify it.", - dev->name); - return -EINVAL; - } - - if (dev_data->cmd_info.pp_cmd == 0) { - LOG_ERR("Page Program command not defined for %s, " - "use \"write-command\" property to specify it.", - dev->name); - return -EINVAL; - } - - LOG_DBG("%s - size: %u, page %u%s", - dev->name, dev_flash_size(dev), dev_page_size(dev), - dev_data->cmd_info.uses_4byte_addr ? ", 4-byte addressing" : ""); - LOG_DBG("- read command: 0x%02X with %u mode bit and %u dummy cycles", - dev_data->cmd_info.read_cmd, - dev_data->cmd_info.read_mode_bit_cycles, - dev_data->cmd_info.read_dummy_cycles); - LOG_DBG("- page program command: 0x%02X", - dev_data->cmd_info.pp_cmd); - LOG_DBG("- erase types:"); - for (int i = 0; i < JESD216_NUM_ERASE_TYPES; ++i) { - const struct jesd216_erase_type *et = &dev_erase_types(dev)[i]; - - if (et->exp != 0) { - LOG_DBG(" - command: 0x%02X, size: %lu", - et->cmd, BIT(et->exp)); - } - } - k_sem_init(&dev_data->acquired, 1, K_SEM_MAX_LIMIT); return pm_device_driver_init(dev, dev_pm_action_cb); @@ -1046,18 +815,39 @@ static DEVICE_API(flash, drv_api) = { .dqs_enable = false, \ } -#define FLASH_QUIRKS(inst) FLASH_MSPI_QUIRKS_GET(DT_DRV_INST(inst)) +/* Define copies of mspi_io_mode enum values, so they can be used inside + * the COND_CODE_1 macros. + */ +#define _MSPI_IO_MODE_SINGLE 0 +#define _MSPI_IO_MODE_QUAD_1_4_4 6 +#define _MSPI_IO_MODE_OCTAL 7 +BUILD_ASSERT(_MSPI_IO_MODE_SINGLE == MSPI_IO_MODE_SINGLE, + "Please align _MSPI_IO_MODE_SINGLE macro value"); +BUILD_ASSERT(_MSPI_IO_MODE_QUAD_1_4_4 == MSPI_IO_MODE_QUAD_1_4_4, + "Please align _MSPI_IO_MODE_QUAD_1_4_4 macro value"); +BUILD_ASSERT(_MSPI_IO_MODE_OCTAL == MSPI_IO_MODE_OCTAL, + "Please align _MSPI_IO_MODE_OCTAL macro value"); + +/* Define a non-existing extern symbol to get an understandable compile-time error + * if the IO mode is not supported by the driver. + */ +extern const struct flash_mspi_nor_cmds mspi_io_mode_not_supported; + +#define FLASH_CMDS(inst) COND_CODE_1( \ + IS_EQ(DT_INST_ENUM_IDX(inst, mspi_io_mode), _MSPI_IO_MODE_SINGLE), \ + (&commands_single), \ + (COND_CODE_1( \ + IS_EQ(DT_INST_ENUM_IDX(inst, mspi_io_mode), _MSPI_IO_MODE_QUAD_1_4_4), \ + (&commands_quad_1_4_4), \ + (COND_CODE_1( \ + IS_EQ(DT_INST_ENUM_IDX(inst, mspi_io_mode), _MSPI_IO_MODE_OCTAL), \ + (&commands_octal), \ + (&mspi_io_mode_not_supported) \ + )) \ + )) \ +) -#define IO_MODE_FLAGS(io_mode) \ - .multi_io_cmd = (io_mode == MSPI_IO_MODE_DUAL || \ - io_mode == MSPI_IO_MODE_QUAD || \ - io_mode == MSPI_IO_MODE_OCTAL || \ - io_mode == MSPI_IO_MODE_HEX || \ - io_mode == MSPI_IO_MODE_HEX_8_8_16 || \ - io_mode == MSPI_IO_MODE_HEX_8_16_16), \ - .single_io_addr = (io_mode == MSPI_IO_MODE_DUAL_1_1_2 || \ - io_mode == MSPI_IO_MODE_QUAD_1_1_4 || \ - io_mode == MSPI_IO_MODE_OCTAL_1_1_8) +#define FLASH_QUIRKS(inst) FLASH_MSPI_QUIRKS_GET(DT_DRV_INST(inst)) #if defined(CONFIG_FLASH_PAGE_LAYOUT) BUILD_ASSERT((CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE % 4096) == 0, @@ -1084,6 +874,13 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ #endif #define FLASH_MSPI_NOR_INST(inst) \ + BUILD_ASSERT((DT_INST_ENUM_IDX(inst, mspi_io_mode) == \ + MSPI_IO_MODE_SINGLE) || \ + (DT_INST_ENUM_IDX(inst, mspi_io_mode) == \ + MSPI_IO_MODE_QUAD_1_4_4) || \ + (DT_INST_ENUM_IDX(inst, mspi_io_mode) == \ + MSPI_IO_MODE_OCTAL), \ + "Only 1x, 1-4-4 and 8x I/O modes are supported for now"); \ SFDP_BUILD_ASSERTS(inst); \ PM_DEVICE_DT_INST_DEFINE(inst, dev_pm_action_cb); \ DEFAULT_ERASE_TYPES_DEFINE(inst); \ @@ -1095,6 +892,10 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ .mspi_id = MSPI_DEVICE_ID_DT_INST(inst), \ .mspi_nor_cfg = MSPI_DEVICE_CONFIG_DT_INST(inst), \ .mspi_nor_init_cfg = FLASH_INITIAL_CONFIG(inst), \ + .mspi_nor_cfg_mask = DT_PROP(DT_INST_BUS(inst), \ + software_multiperipheral) \ + ? MSPI_DEVICE_CONFIG_ALL \ + : MSPI_DEVICE_CONFIG_NONE, \ IF_ENABLED(CONFIG_MSPI_XIP, \ (.xip_cfg = MSPI_XIP_CONFIG_DT_INST(inst),)) \ IF_ENABLED(WITH_RESET_GPIO, \ @@ -1105,16 +906,12 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ / 1000,)) \ .transfer_timeout = DT_INST_PROP(inst, transfer_timeout), \ FLASH_PAGE_LAYOUT_DEFINE(inst) \ - .jedec_id = DT_INST_PROP_OR(inst, jedec_id, {0}), \ + .jedec_id = DT_INST_PROP(inst, jedec_id), \ + .jedec_cmds = FLASH_CMDS(inst), \ .quirks = FLASH_QUIRKS(inst), \ .default_erase_types = DEFAULT_ERASE_TYPES(inst), \ .default_cmd_info = DEFAULT_CMD_INFO(inst), \ .default_switch_info = DEFAULT_SWITCH_INFO(inst), \ - .jedec_id_specified = DT_INST_NODE_HAS_PROP(inst, jedec_id), \ - .rx_dummy_specified = DT_INST_NODE_HAS_PROP(inst, rx_dummy), \ - .multiperipheral_bus = DT_PROP(DT_INST_BUS(inst), \ - software_multiperipheral), \ - IO_MODE_FLAGS(DT_INST_ENUM_IDX(inst, mspi_io_mode)), \ }; \ FLASH_PAGE_LAYOUT_CHECK(inst) \ DEVICE_DT_INST_DEFINE(inst, \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 13b12d58221..9c96c334fbe 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -69,6 +69,7 @@ struct flash_mspi_nor_config { struct mspi_dev_id mspi_id; struct mspi_dev_cfg mspi_nor_cfg; struct mspi_dev_cfg mspi_nor_init_cfg; + enum mspi_dev_cfg_mask mspi_nor_cfg_mask; #if defined(CONFIG_MSPI_XIP) struct mspi_xip_cfg xip_cfg; #endif @@ -82,27 +83,213 @@ struct flash_mspi_nor_config { struct flash_pages_layout layout; #endif uint8_t jedec_id[SPI_NOR_MAX_ID_LEN]; + const struct flash_mspi_nor_cmds *jedec_cmds; struct flash_mspi_nor_quirks *quirks; const struct jesd216_erase_type *default_erase_types; struct flash_mspi_nor_cmd_info default_cmd_info; struct flash_mspi_nor_switch_info default_switch_info; - bool jedec_id_specified : 1; - bool rx_dummy_specified : 1; - bool multiperipheral_bus : 1; - bool multi_io_cmd : 1; - bool single_io_addr : 1; }; struct flash_mspi_nor_data { struct k_sem acquired; struct mspi_xfer_packet packet; struct mspi_xfer xfer; + struct mspi_dev_cfg *curr_cfg; struct jesd216_erase_type erase_types[JESD216_NUM_ERASE_TYPES]; struct flash_mspi_nor_cmd_info cmd_info; struct flash_mspi_nor_switch_info switch_info; - bool in_target_io_mode; }; +struct flash_mspi_nor_cmd { + enum mspi_xfer_direction dir; + uint32_t cmd; + uint16_t tx_dummy; + uint16_t rx_dummy; + uint8_t cmd_length; + uint8_t addr_length; + bool force_single; +}; + +struct flash_mspi_nor_cmds { + struct flash_mspi_nor_cmd id; + struct flash_mspi_nor_cmd write_en; + struct flash_mspi_nor_cmd read; + struct flash_mspi_nor_cmd status; + struct flash_mspi_nor_cmd config; + struct flash_mspi_nor_cmd page_program; + struct flash_mspi_nor_cmd sector_erase; + struct flash_mspi_nor_cmd chip_erase; + struct flash_mspi_nor_cmd sfdp; +}; + +const struct flash_mspi_nor_cmds commands_single = { + .id = { + .dir = MSPI_RX, + .cmd = JESD216_CMD_READ_ID, + .cmd_length = 1, + }, + .write_en = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_WREN, + .cmd_length = 1, + }, + .read = { + .dir = MSPI_RX, + .cmd = SPI_NOR_CMD_READ_FAST, + .cmd_length = 1, + .addr_length = 3, + .rx_dummy = 8, + }, + .status = { + .dir = MSPI_RX, + .cmd = SPI_NOR_CMD_RDSR, + .cmd_length = 1, + }, + .config = { + .dir = MSPI_RX, + .cmd = SPI_NOR_CMD_RDCR, + .cmd_length = 1, + }, + .page_program = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_PP, + .cmd_length = 1, + .addr_length = 3, + }, + .sector_erase = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_SE, + .cmd_length = 1, + .addr_length = 3, + }, + .chip_erase = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_CE, + .cmd_length = 1, + }, + .sfdp = { + .dir = MSPI_RX, + .cmd = JESD216_CMD_READ_SFDP, + .cmd_length = 1, + .addr_length = 3, + .rx_dummy = 8, + }, +}; + +const struct flash_mspi_nor_cmds commands_quad_1_4_4 = { + .id = { + .dir = MSPI_RX, + .cmd = JESD216_CMD_READ_ID, + .cmd_length = 1, + .force_single = true, + }, + .write_en = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_WREN, + .cmd_length = 1, + }, + .read = { + .dir = MSPI_RX, + .cmd = SPI_NOR_CMD_4READ, + .cmd_length = 1, + .addr_length = 3, + .rx_dummy = 6, + }, + .status = { + .dir = MSPI_RX, + .cmd = SPI_NOR_CMD_RDSR, + .cmd_length = 1, + .force_single = true, + }, + .config = { + .dir = MSPI_RX, + .cmd = SPI_NOR_CMD_RDCR, + .cmd_length = 1, + .force_single = true, + }, + .page_program = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_PP_1_4_4, + .cmd_length = 1, + .addr_length = 3, + }, + .sector_erase = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_SE, + .cmd_length = 1, + .addr_length = 3, + .force_single = true, + }, + .chip_erase = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_CE, + .cmd_length = 1, + }, + .sfdp = { + .dir = MSPI_RX, + .cmd = JESD216_CMD_READ_SFDP, + .cmd_length = 1, + .addr_length = 3, + .rx_dummy = 8, + .force_single = true, + }, +}; + +const struct flash_mspi_nor_cmds commands_octal = { + .id = { + .dir = MSPI_RX, + .cmd = JESD216_OCMD_READ_ID, + .cmd_length = 2, + .addr_length = 4, + .rx_dummy = 4 + }, + .write_en = { + .dir = MSPI_TX, + .cmd = SPI_NOR_OCMD_WREN, + .cmd_length = 2, + }, + .read = { + .dir = MSPI_RX, + .cmd = SPI_NOR_OCMD_RD, + .cmd_length = 2, + .addr_length = 4, + .rx_dummy = 20, + }, + .status = { + .dir = MSPI_RX, + .cmd = SPI_NOR_OCMD_RDSR, + .cmd_length = 2, + .addr_length = 4, + .rx_dummy = 4, + }, + .page_program = { + .dir = MSPI_TX, + .cmd = SPI_NOR_OCMD_PAGE_PRG, + .cmd_length = 2, + .addr_length = 4, + }, + .sector_erase = { + .dir = MSPI_TX, + .cmd = SPI_NOR_OCMD_SE, + .cmd_length = 2, + .addr_length = 4, + }, + .chip_erase = { + .dir = MSPI_TX, + .cmd = SPI_NOR_OCMD_CE, + .cmd_length = 2, + }, + .sfdp = { + .dir = MSPI_RX, + .cmd = JESD216_OCMD_READ_SFDP, + .cmd_length = 2, + .addr_length = 4, + .rx_dummy = 20, + }, +}; + +void flash_mspi_command_set(const struct device *dev, const struct flash_mspi_nor_cmd *cmd); + #ifdef __cplusplus } #endif diff --git a/drivers/flash/flash_mspi_nor_quirks.h b/drivers/flash/flash_mspi_nor_quirks.h index 391a075131d..f8a0a147e6b 100644 --- a/drivers/flash/flash_mspi_nor_quirks.h +++ b/drivers/flash/flash_mspi_nor_quirks.h @@ -71,29 +71,45 @@ static inline int mxicy_mx25r_post_switch_mode(const struct device *dev) } /* Wait for previous write to finish */ - rc = wait_until_ready(dev, K_USEC(1)); - if (rc < 0) { - return rc; - } + do { + flash_mspi_command_set(dev, &dev_config->jedec_cmds->status); + dev_data->packet.data_buf = &status; + dev_data->packet.num_bytes = sizeof(status); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); + if (rc < 0) { + return rc; + } + } while (status & SPI_NOR_WIP_BIT); /* Write enable */ - rc = cmd_wren(dev); + flash_mspi_command_set(dev, &commands_single.write_en); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); if (rc < 0) { return rc; } /* Write status and config registers */ - set_up_xfer(dev, MSPI_TX); + const struct flash_mspi_nor_cmd cmd_status = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_WRSR, + .cmd_length = 1, + }; + + flash_mspi_command_set(dev, &cmd_status); dev_data->packet.data_buf = mxicy_mx25r_hp_payload; dev_data->packet.num_bytes = sizeof(mxicy_mx25r_hp_payload); - rc = perform_xfer(dev, SPI_NOR_CMD_WRSR, false); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); if (rc < 0) { return rc; } /* Wait for write to end and verify status register */ do { - rc = cmd_rdsr(dev, SPI_NOR_CMD_RDSR, &status); + flash_mspi_command_set(dev, &dev_config->jedec_cmds->status); + dev_data->packet.data_buf = &status; + dev_data->packet.num_bytes = sizeof(status); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); if (rc < 0) { return rc; } @@ -104,10 +120,10 @@ static inline int mxicy_mx25r_post_switch_mode(const struct device *dev) } /* Verify configuration registers */ - set_up_xfer(dev, MSPI_RX); - dev_data->packet.num_bytes = sizeof(config); + flash_mspi_command_set(dev, &dev_config->jedec_cmds->config); dev_data->packet.data_buf = config; - rc = perform_xfer(dev, SPI_NOR_CMD_RDCR, false); + dev_data->packet.num_bytes = sizeof(config); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); if (rc < 0) { return rc; } @@ -145,18 +161,26 @@ static inline int mxicy_mx25u_post_switch_mode(const struct device *dev) } /* Write enable */ - rc = cmd_wren(dev); + flash_mspi_command_set(dev, &commands_single.write_en); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, + &dev_data->xfer); if (rc < 0) { return rc; } /* Write config register 2 */ - set_up_xfer(dev, MSPI_TX); - dev_data->xfer.addr_length = 4; - dev_data->packet.address = 0; + const struct flash_mspi_nor_cmd cmd_status = { + .dir = MSPI_TX, + .cmd = SPI_NOR_CMD_WR_CFGREG2, + .cmd_length = 1, + .addr_length = 4, + }; + + flash_mspi_command_set(dev, &cmd_status); dev_data->packet.data_buf = &mxicy_mx25u_oe_payload; dev_data->packet.num_bytes = sizeof(mxicy_mx25u_oe_payload); - return perform_xfer(dev, SPI_NOR_CMD_WR_CFGREG2, false); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); + return rc; } static int mxicy_mx25u_pre_init(const struct device *dev) @@ -184,12 +208,18 @@ static int mxicy_mx25u_pre_init(const struct device *dev) */ /* Read configured number of dummy cycles for memory reading commands. */ - set_up_xfer(dev, MSPI_RX); - dev_data->xfer.addr_length = 4; + const struct flash_mspi_nor_cmd cmd_rd_cr2 = { + .dir = MSPI_RX, + .cmd = SPI_NOR_CMD_RD_CFGREG2, + .cmd_length = 1, + .addr_length = 4, + }; + + flash_mspi_command_set(dev, &cmd_rd_cr2); dev_data->packet.address = 0x300; dev_data->packet.data_buf = &cfg_reg; dev_data->packet.num_bytes = sizeof(cfg_reg); - rc = perform_xfer(dev, SPI_NOR_CMD_RD_CFGREG2, false); + rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); if (rc < 0) { LOG_ERR("Failed to read Dummy Cycle from CFGREG2"); return rc; diff --git a/drivers/flash/flash_mspi_nor_sfdp.h b/drivers/flash/flash_mspi_nor_sfdp.h index e8291a7af2a..5fa07a51782 100644 --- a/drivers/flash/flash_mspi_nor_sfdp.h +++ b/drivers/flash/flash_mspi_nor_sfdp.h @@ -98,7 +98,6 @@ #define USES_4BYTE_ADDR(inst) \ (USES_OCTAL_IO(inst) || \ - DT_INST_PROP(inst, use_4byte_addressing) || \ BFP_DW1_ADDRESS_BYTES(inst) == JESD216_SFDP_BFP_DW1_ADDRBYTES_VAL_4B) #define BFP_ENTER_4BYTE_ADDR_METHODS(inst) \ @@ -346,26 +345,12 @@ BUILD_ASSERT(!USES_8D_8D_8D(inst) || \ BFP_DW18_CMD_EXT(inst) <= BFP_DW18_CMD_EXT_INV, \ "Unsupported Octal Command Extension mode in " \ - DT_NODE_FULL_NAME(DT_DRV_INST(inst))); \ - BUILD_ASSERT(!DT_INST_PROP(inst, use_4byte_addressing) || \ - (BFP_DW1_ADDRESS_BYTES(inst) \ - != JESD216_SFDP_BFP_DW1_ADDRBYTES_VAL_3B), \ - "Cannot use 4-byte addressing for " \ - DT_NODE_FULL_NAME(DT_DRV_INST(inst))); \ - BUILD_ASSERT(!DT_INST_PROP(inst, use_4byte_addressing) || \ - (BFP_ENTER_4BYTE_ADDR_METHODS(inst) \ - & (BFP_DW16_4B_ADDR_ENTER_B7 | \ - BFP_DW16_4B_ADDR_ENTER_06_B7 | \ - BFP_DW16_4B_ADDR_PER_CMD | \ - BFP_DW16_4B_ADDR_ALWAYS)), \ - "No supported method of entering 4-byte addressing mode for " \ DT_NODE_FULL_NAME(DT_DRV_INST(inst))) #else #define USES_4BYTE_ADDR(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL || \ - DT_INST_PROP(inst, use_4byte_addressing)) + (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL) #define DEFAULT_CMD_INFO(inst) { \ .pp_cmd = USES_4BYTE_ADDR(inst) \ diff --git a/dts/bindings/mtd/jedec,mspi-nor.yaml b/dts/bindings/mtd/jedec,mspi-nor.yaml index 40bfe353943..09660b84159 100644 --- a/dts/bindings/mtd/jedec,mspi-nor.yaml +++ b/dts/bindings/mtd/jedec,mspi-nor.yaml @@ -5,20 +5,7 @@ description: Generic NOR flash on MSPI bus compatible: "jedec,mspi-nor" -include: - - name: mspi-device.yaml - - name: jedec,spi-nor-common.yaml - property-allowlist: - - jedec-id - - size - - sfdp-bfp - - sfdp-ff05 - - sfdp-ff84 - - quad-enable-requirements - - has-dpd - - dpd-wakeup-sequence - - t-enter-dpd - - t-exit-dpd +include: [mspi-device.yaml, "jedec,spi-nor-common.yaml"] properties: reset-gpios: @@ -43,12 +30,3 @@ properties: Maximum time, in milliseconds, allowed for a single transfer on the MSPI bus in communication with the flash chip. The default value is the one that was previously hard-coded in the flash_mspi_nor driver. - - use-4byte-addressing: - type: boolean - description: | - Indicates that 4-byte addressing is to be used in communication with - the flash chip. The driver will use dedicated 4-byte address instruction - codes for commands that require addresses (like Read, Page Program, - or Erase) if those are supported by the flash chip, or if necessary, - it will switch the chip to 4-byte addressing mode. From 301a39d94d95a6a32dd2cf112db33a2f5f1824ec Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 036/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Get info from dts SFDP arrays" This reverts commit 6c308a75b2b934f22ac07f8474e84a2894e2ced6. Signed-off-by: Jukka Rissanen --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 7 - .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 7 - drivers/flash/Kconfig.mspi | 18 - drivers/flash/flash_mspi_nor.c | 46 +- drivers/flash/flash_mspi_nor.h | 50 +-- drivers/flash/flash_mspi_nor_quirks.h | 56 --- drivers/flash/flash_mspi_nor_sfdp.h | 399 ------------------ dts/bindings/mtd/jedec,jesd216.yaml | 12 - 8 files changed, 18 insertions(+), 577 deletions(-) delete mode 100644 drivers/flash/flash_mspi_nor_sfdp.h diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index e086601abae..2c86129c0f3 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -285,13 +285,6 @@ slot3_partition: &cpurad_slot1_partition { 30 b0 30 b0 f4 bd d5 5c 00 00 00 ff 10 10 00 20 00 00 00 00 00 00 7c 23 48 00 00 00 00 00 88 88 ]; - sfdp-ff05 = [ - 00 ee c0 69 72 72 71 71 00 d8 f7 f6 00 0a 00 00 - 14 45 98 80 - ]; - sfdp-ff84 = [ - 43 06 0f 00 21 dc ff ff - ]; size = <67108864>; has-dpd; t-enter-dpd = <10000>; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 8920d7966bb..1c8622c0780 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -265,13 +265,6 @@ ipc0: &cpuapp_cpurad_ipc { 30 b0 30 b0 f4 bd d5 5c 00 00 00 ff 10 10 00 20 00 00 00 00 00 00 7c 23 48 00 00 00 00 00 88 88 ]; - sfdp-ff05 = [ - 00 ee c0 69 72 72 71 71 00 d8 f7 f6 00 0a 00 00 - 14 45 98 80 - ]; - sfdp-ff84 = [ - 43 06 0f 00 21 dc ff ff - ]; size = <67108864>; has-dpd; t-enter-dpd = <10000>; diff --git a/drivers/flash/Kconfig.mspi b/drivers/flash/Kconfig.mspi index cab2f3a2bcd..d0f244957d2 100644 --- a/drivers/flash/Kconfig.mspi +++ b/drivers/flash/Kconfig.mspi @@ -39,24 +39,6 @@ menuconfig FLASH_MSPI_NOR if FLASH_MSPI_NOR -config FLASH_MSPI_NOR_USE_SFDP - bool "Use Serial Flash Discoverable Parameters (SFDP)" - default $(dt_compat_any_has_prop,$(DT_COMPAT_JEDEC_MSPI_NOR),sfdp-bfp) - help - Use information from SFDP for setting up flash command transfers - and for configuring the flash chip. - - Currently, only build time processing of SFDP structures is supported, - based on dts arrays provided as flash node properties like `sfdp-bfp`, - `sfdp-ff05`, and `sfdp-ff84`. Depending on the IO mode used, some or - all of these properties are required for building the flash driver. - Data for these properties can be obtained with the `drivers/jesd216` - sample. If a given SFDP table is not available in a flash chip, - the related property can be defined as an empty array - this will - prevent a related build assertion from failing and default values - will be assigned to parameters that would otherwise be read from - that SFDP table. - config FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE int "Page size to use for FLASH_LAYOUT feature" depends on FLASH_PAGE_LAYOUT diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 125aedfa250..5546ef904c0 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -12,12 +12,10 @@ #include #include "flash_mspi_nor.h" -#include "flash_mspi_nor_sfdp.h" +#include "flash_mspi_nor_quirks.h" LOG_MODULE_REGISTER(flash_mspi_nor, CONFIG_FLASH_LOG_LEVEL); -#include "flash_mspi_nor_quirks.h" - void flash_mspi_command_set(const struct device *dev, const struct flash_mspi_nor_cmd *cmd) { struct flash_mspi_nor_data *dev_data = dev->data; @@ -112,9 +110,7 @@ static inline uint32_t dev_flash_size(const struct device *dev) static inline uint16_t dev_page_size(const struct device *dev) { - const struct flash_mspi_nor_config *dev_config = dev->config; - - return dev_config->page_size; + return SPI_NOR_PAGE_SIZE; } static int api_read(const struct device *dev, off_t addr, void *dest, @@ -538,7 +534,7 @@ static int quad_enable_set(const struct device *dev, bool enable) return rc; } - if (dev_data->switch_info.quad_enable_req == JESD216_DW15_QER_VAL_S1B6) { + if (dev_config->dw15_qer == JESD216_DW15_QER_VAL_S1B6) { const struct flash_mspi_nor_cmd cmd_status = { .dir = MSPI_TX, .cmd = SPI_NOR_CMD_WRSR, @@ -574,11 +570,10 @@ static int quad_enable_set(const struct device *dev, bool enable) static int default_io_mode(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; - struct flash_mspi_nor_data *dev_data = dev->data; enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode; int rc = 0; - if (dev_data->switch_info.quad_enable_req != JESD216_DW15_QER_VAL_NONE) { + if (dev_config->dw15_qer != JESD216_DW15_QER_VAL_NONE) { /* For Quad 1-1-4 and 1-4-4, entering or leaving mode is defined * in JEDEC216 BFP DW15 QER */ @@ -662,7 +657,7 @@ static int flash_chip_init(const struct device *dev) /* Some chips reuse RESET pin for data in Quad modes: * force single line mode before resetting. */ - if (dev_data->switch_info.quad_enable_req != JESD216_DW15_QER_VAL_NONE && + if (dev_config->dw15_qer != JESD216_DW15_QER_VAL_NONE && (io_mode == MSPI_IO_MODE_SINGLE || io_mode == MSPI_IO_MODE_QUAD_1_1_4 || io_mode == MSPI_IO_MODE_QUAD_1_4_4)) { @@ -690,11 +685,6 @@ static int flash_chip_init(const struct device *dev) } #endif - if (dev_config->quirks != NULL && - dev_config->quirks->pre_init != NULL) { - rc = dev_config->quirks->pre_init(dev); - } - flash_mspi_command_set(dev, &commands_single.id); dev_data->packet.data_buf = id; dev_data->packet.num_bytes = sizeof(id); @@ -759,11 +749,6 @@ static int drv_init(const struct device *dev) return -ENODEV; } - memcpy(dev_data->erase_types, dev_config->default_erase_types, - sizeof(dev_data->erase_types)); - dev_data->cmd_info = dev_config->default_cmd_info; - dev_data->switch_info = dev_config->default_switch_info; - rc = pm_device_runtime_get(dev_config->bus); if (rc < 0) { LOG_ERR("pm_device_runtime_get() failed: %d", rc); @@ -815,6 +800,8 @@ static DEVICE_API(flash, drv_api) = { .dqs_enable = false, \ } +#define FLASH_SIZE_INST(inst) (DT_INST_PROP(inst, size) / 8) + /* Define copies of mspi_io_mode enum values, so they can be used inside * the COND_CODE_1 macros. */ @@ -849,17 +836,23 @@ extern const struct flash_mspi_nor_cmds mspi_io_mode_not_supported; #define FLASH_QUIRKS(inst) FLASH_MSPI_QUIRKS_GET(DT_DRV_INST(inst)) +#define FLASH_DW15_QER_VAL(inst) _CONCAT(JESD216_DW15_QER_VAL_, \ + DT_INST_STRING_TOKEN(inst, quad_enable_requirements)) +#define FLASH_DW15_QER(inst) COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, quad_enable_requirements), \ + (FLASH_DW15_QER_VAL(inst)), (JESD216_DW15_QER_VAL_NONE)) + + #if defined(CONFIG_FLASH_PAGE_LAYOUT) BUILD_ASSERT((CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE % 4096) == 0, "MSPI_NOR_FLASH_LAYOUT_PAGE_SIZE must be multiple of 4096"); #define FLASH_PAGE_LAYOUT_DEFINE(inst) \ .layout = { \ .pages_size = CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE, \ - .pages_count = FLASH_SIZE(inst) \ + .pages_count = FLASH_SIZE_INST(inst) \ / CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE, \ }, #define FLASH_PAGE_LAYOUT_CHECK(inst) \ -BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ +BUILD_ASSERT((FLASH_SIZE_INST(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ "MSPI_NOR_FLASH_LAYOUT_PAGE_SIZE incompatible with flash size, instance " #inst); #else #define FLASH_PAGE_LAYOUT_DEFINE(inst) @@ -881,14 +874,11 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ (DT_INST_ENUM_IDX(inst, mspi_io_mode) == \ MSPI_IO_MODE_OCTAL), \ "Only 1x, 1-4-4 and 8x I/O modes are supported for now"); \ - SFDP_BUILD_ASSERTS(inst); \ PM_DEVICE_DT_INST_DEFINE(inst, dev_pm_action_cb); \ - DEFAULT_ERASE_TYPES_DEFINE(inst); \ static struct flash_mspi_nor_data dev##inst##_data; \ static const struct flash_mspi_nor_config dev##inst##_config = { \ .bus = DEVICE_DT_GET(DT_INST_BUS(inst)), \ - .flash_size = FLASH_SIZE(inst), \ - .page_size = FLASH_PAGE_SIZE(inst), \ + .flash_size = FLASH_SIZE_INST(inst), \ .mspi_id = MSPI_DEVICE_ID_DT_INST(inst), \ .mspi_nor_cfg = MSPI_DEVICE_CONFIG_DT_INST(inst), \ .mspi_nor_init_cfg = FLASH_INITIAL_CONFIG(inst), \ @@ -909,9 +899,7 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ .jedec_id = DT_INST_PROP(inst, jedec_id), \ .jedec_cmds = FLASH_CMDS(inst), \ .quirks = FLASH_QUIRKS(inst), \ - .default_erase_types = DEFAULT_ERASE_TYPES(inst), \ - .default_cmd_info = DEFAULT_CMD_INFO(inst), \ - .default_switch_info = DEFAULT_SWITCH_INFO(inst), \ + .dw15_qer = FLASH_DW15_QER(inst), \ }; \ FLASH_PAGE_LAYOUT_CHECK(inst) \ DEVICE_DT_INST_DEFINE(inst, \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 9c96c334fbe..ad957f24bc7 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -20,52 +20,9 @@ extern "C" { #define WITH_RESET_GPIO 1 #endif -#define CMD_EXTENSION_NONE 0 -#define CMD_EXTENSION_SAME 1 -#define CMD_EXTENSION_INVERSE 2 - -#define OCTAL_ENABLE_REQ_NONE 0 -#define OCTAL_ENABLE_REQ_S2B3 1 - -#define ENTER_4BYTE_ADDR_NONE 0 -#define ENTER_4BYTE_ADDR_B7 1 -#define ENTER_4BYTE_ADDR_06_B7 2 - -struct flash_mspi_nor_cmd_info { - uint8_t read_cmd; - uint8_t read_mode_bit_cycles : 3; - uint8_t read_dummy_cycles : 5; - uint8_t pp_cmd; - bool uses_4byte_addr : 1; - /* BFP, 18th DWORD, bits 30-29 */ - uint8_t cmd_extension : 2; - /* xSPI Profile 1.0 (ID FF05), 1st DWORD: */ - /* - Read SFDP command address bytes: 4 (true) or 3 */ - bool sfdp_addr_4 : 1; - /* - Read SDFP command dummy cycles: 20 (true) or 8 */ - bool sfdp_dummy_20 : 1; - /* - Read Status Register command address bytes: 4 (true) or 0 */ - bool rdsr_addr_4 : 1; - /* - Read Status Register command dummy cycles: 0, 4, or 8 */ - uint8_t rdsr_dummy : 4; - /* - Read JEDEC ID command parameters; not sure where to get their - * values from, but since for many flash chips they are the same - * as for RDSR, those are taken as defaults, see DEFAULT_CMD_INFO() - */ - bool rdid_addr_4 : 1; - uint8_t rdid_dummy : 4; -}; - -struct flash_mspi_nor_switch_info { - uint8_t quad_enable_req : 3; - uint8_t octal_enable_req : 3; - uint8_t enter_4byte_addr : 2; -}; - struct flash_mspi_nor_config { const struct device *bus; uint32_t flash_size; - uint16_t page_size; struct mspi_dev_id mspi_id; struct mspi_dev_cfg mspi_nor_cfg; struct mspi_dev_cfg mspi_nor_init_cfg; @@ -85,9 +42,7 @@ struct flash_mspi_nor_config { uint8_t jedec_id[SPI_NOR_MAX_ID_LEN]; const struct flash_mspi_nor_cmds *jedec_cmds; struct flash_mspi_nor_quirks *quirks; - const struct jesd216_erase_type *default_erase_types; - struct flash_mspi_nor_cmd_info default_cmd_info; - struct flash_mspi_nor_switch_info default_switch_info; + uint8_t dw15_qer; }; struct flash_mspi_nor_data { @@ -95,9 +50,6 @@ struct flash_mspi_nor_data { struct mspi_xfer_packet packet; struct mspi_xfer xfer; struct mspi_dev_cfg *curr_cfg; - struct jesd216_erase_type erase_types[JESD216_NUM_ERASE_TYPES]; - struct flash_mspi_nor_cmd_info cmd_info; - struct flash_mspi_nor_switch_info switch_info; }; struct flash_mspi_nor_cmd { diff --git a/drivers/flash/flash_mspi_nor_quirks.h b/drivers/flash/flash_mspi_nor_quirks.h index f8a0a147e6b..eb40ad1938a 100644 --- a/drivers/flash/flash_mspi_nor_quirks.h +++ b/drivers/flash/flash_mspi_nor_quirks.h @@ -9,13 +9,6 @@ /* Flash chip specific quirks */ struct flash_mspi_nor_quirks { - /* Called at the beginning of the flash chip initialization, - * right after reset if any is performed. Can be used to alter - * structures that define communication with the chip, like - * `cmd_info`, `switch_info`, and `erase_types`, which are set - * to default values at this point. - */ - int (*pre_init)(const struct device *dev); /* Called after switching to default IO mode. */ int (*post_switch_mode)(const struct device *dev); }; @@ -183,56 +176,7 @@ static inline int mxicy_mx25u_post_switch_mode(const struct device *dev) return rc; } -static int mxicy_mx25u_pre_init(const struct device *dev) -{ - const struct flash_mspi_nor_config *dev_config = dev->config; - struct flash_mspi_nor_data *dev_data = dev->data; - static const uint8_t dummy_cycles[8] = { - 20, 18, 16, 14, 12, 10, 8, 6 - }; - uint8_t cfg_reg; - int rc; - - if (dev_config->mspi_nor_cfg.io_mode != MSPI_IO_MODE_OCTAL) { - return 0; - } - - if (dev_config->mspi_nor_cfg.data_rate == MSPI_DATA_RATE_SINGLE) { - dev_data->cmd_info.cmd_extension = CMD_EXTENSION_INVERSE; - } - - /* - * TODO - replace this with a generic routine that uses information - * from SFDP header FF87 (Status, Control and Configuration - * Register Map) - */ - - /* Read configured number of dummy cycles for memory reading commands. */ - const struct flash_mspi_nor_cmd cmd_rd_cr2 = { - .dir = MSPI_RX, - .cmd = SPI_NOR_CMD_RD_CFGREG2, - .cmd_length = 1, - .addr_length = 4, - }; - - flash_mspi_command_set(dev, &cmd_rd_cr2); - dev_data->packet.address = 0x300; - dev_data->packet.data_buf = &cfg_reg; - dev_data->packet.num_bytes = sizeof(cfg_reg); - rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, &dev_data->xfer); - if (rc < 0) { - LOG_ERR("Failed to read Dummy Cycle from CFGREG2"); - return rc; - } - - dev_data->cmd_info.read_mode_bit_cycles = 0; - dev_data->cmd_info.read_dummy_cycles = dummy_cycles[cfg_reg & 0x7]; - - return 0; -} - struct flash_mspi_nor_quirks flash_quirks_mxicy_mx25u = { - .pre_init = mxicy_mx25u_pre_init, .post_switch_mode = mxicy_mx25u_post_switch_mode, }; diff --git a/drivers/flash/flash_mspi_nor_sfdp.h b/drivers/flash/flash_mspi_nor_sfdp.h deleted file mode 100644 index 5fa07a51782..00000000000 --- a/drivers/flash/flash_mspi_nor_sfdp.h +++ /dev/null @@ -1,399 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifdef CONFIG_FLASH_MSPI_NOR_USE_SFDP - -#define BFP_DW16_4B_ADDR_ENTER_B7 BIT(0) -#define BFP_DW16_4B_ADDR_ENTER_06_B7 BIT(1) -#define BFP_DW16_4B_ADDR_PER_CMD BIT(5) -#define BFP_DW16_4B_ADDR_ALWAYS BIT(6) - -#define BFP_DW18_CMD_EXT_SAME 0 -#define BFP_DW18_CMD_EXT_INV 1 - -/* 32-bit words in SFDP arrays in devicetree are stored in little-endian byte - * order. See jedec,jesd216.yaml - */ -#define SFDP_DW_BYTE_0_IDX(dw_no) \ - UTIL_DEC(UTIL_DEC(UTIL_DEC(UTIL_DEC(UTIL_X2(UTIL_X2(dw_no)))))) -#define SFDP_DW_BYTE_1_IDX(dw_no) \ - UTIL_DEC(UTIL_DEC(UTIL_DEC(UTIL_X2(UTIL_X2(dw_no))))) -#define SFDP_DW_BYTE_2_IDX(dw_no) \ - UTIL_DEC(UTIL_DEC(UTIL_X2(UTIL_X2(dw_no)))) -#define SFDP_DW_BYTE_3_IDX(dw_no) \ - UTIL_DEC(UTIL_X2(UTIL_X2(dw_no))) -#define SFDP_DW_BYTE(inst, prop, dw_no, byte_idx) \ - DT_INST_PROP_BY_IDX(inst, prop, SFDP_DW_BYTE_##byte_idx##_IDX(dw_no)) -#define SFDP_DW_EXISTS(inst, prop, dw_no) \ - DT_INST_PROP_HAS_IDX(inst, prop, SFDP_DW_BYTE_3_IDX(dw_no)) - -#define SFDP_DW(inst, prop, dw_no) \ - COND_CODE_1(SFDP_DW_EXISTS(inst, prop, dw_no), \ - (((SFDP_DW_BYTE(inst, prop, dw_no, 3) << 24) | \ - (SFDP_DW_BYTE(inst, prop, dw_no, 2) << 16) | \ - (SFDP_DW_BYTE(inst, prop, dw_no, 1) << 8) | \ - (SFDP_DW_BYTE(inst, prop, dw_no, 0) << 0))), \ - (0)) - -#define SFDP_FIELD(inst, prop, dw_no, mask) \ - FIELD_GET(mask, SFDP_DW(inst, prop, dw_no)) - -#define USES_8D_8D_8D(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_DUAL) -#define USES_8S_8S_8S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_1S_8D_8D(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL_1_8_8 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_DUAL) -#define USES_1S_8S_8S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL_1_8_8 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_1S_1S_8S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL_1_1_8 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_4S_4D_4D(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_QUAD && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_DUAL) -#define USES_4S_4S_4S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_QUAD && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_1S_4D_4D(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_QUAD_1_4_4 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_DUAL) -#define USES_1S_4S_4S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_QUAD_1_4_4 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_1S_1S_4S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_QUAD_1_1_4 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_2S_2S_2S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_DUAL && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_1S_2D_2D(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_DUAL_1_2_2 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_DUAL) -#define USES_1S_2S_2S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_DUAL_1_2_2 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_1S_1S_2S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_DUAL_1_1_2 && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) -#define USES_1S_1D_1D(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_SINGLE && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_DUAL) -#define USES_1S_1S_1S(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_SINGLE && \ - DT_INST_ENUM_IDX(inst, mspi_data_rate) == MSPI_DATA_RATE_SINGLE) - -#define USES_OCTAL_IO(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL) - -#define BFP_DW1_ADDRESS_BYTES(inst) \ - SFDP_FIELD(inst, sfdp_bfp, 1, GENMASK(18, 17)) - -#define USES_4BYTE_ADDR(inst) \ - (USES_OCTAL_IO(inst) || \ - BFP_DW1_ADDRESS_BYTES(inst) == JESD216_SFDP_BFP_DW1_ADDRBYTES_VAL_4B) - -#define BFP_ENTER_4BYTE_ADDR_METHODS(inst) \ - SFDP_FIELD(inst, sfdp_bfp, 16, GENMASK(31, 24)) - -#define HAS_4BYTE_ADDR_CMDS(inst) \ - (BFP_ENTER_4BYTE_ADDR_METHODS(inst) & BFP_DW16_4B_ADDR_PER_CMD) - -#define BFP_DW18_CMD_EXT(inst) \ - SFDP_FIELD(inst, sfdp_bfp, 18, GENMASK(30, 29)) - -#define CMD_EXTENSION(inst) \ - (!USES_8D_8D_8D(inst) ? CMD_EXTENSION_NONE : \ - (BFP_DW18_CMD_EXT(inst) \ - == BFP_DW18_CMD_EXT_INV) ? CMD_EXTENSION_INVERSE \ - : CMD_EXTENSION_SAME) - -/* 1st DWORD of 4-byte Address Instruction Table (ID FF84) indicates commands - * that are supported by the chip. - */ -#define FF84_DW1_BIT(inst, bit) (SFDP_DW(inst, sfdp_ff84, 1) & BIT(bit)) - -#define SFDP_CMD_PP(inst) \ - USES_1S_4S_4S(inst) ? SPI_NOR_CMD_PP_1_4_4 : \ - USES_1S_1S_4S(inst) ? SPI_NOR_CMD_PP_1_1_4 : \ - SPI_NOR_CMD_PP -#define SFDP_CMD_PP_4B(inst) \ - USES_1S_8S_8S(inst) && FF84_DW1_BIT(inst, 24) ? 0x8E : \ - USES_1S_1S_8S(inst) && FF84_DW1_BIT(inst, 23) ? 0x84 : \ - USES_1S_4S_4S(inst) && FF84_DW1_BIT(inst, 8) ? SPI_NOR_CMD_PP_1_4_4_4B : \ - USES_1S_1S_4S(inst) && FF84_DW1_BIT(inst, 7) ? SPI_NOR_CMD_PP_1_1_4_4B : \ - FF84_DW1_BIT(inst, 6) ? SPI_NOR_CMD_PP_4B \ - : 0 -#define SFDP_CMD_FAST_READ(inst) \ - USES_1S_8D_8D(inst) ? 0 : \ - USES_1S_8S_8S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 17, GENMASK(15, 8)) : \ - USES_1S_1S_8S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 17, GENMASK(31, 24)) : \ - USES_4S_4D_4D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 23, GENMASK(31, 24)) : \ - USES_4S_4S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 7, GENMASK(31, 24)) : \ - USES_1S_4D_4D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 23, GENMASK(15, 8)) : \ - USES_1S_4S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 3, GENMASK(15, 8)) : \ - USES_1S_1S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 3, GENMASK(31, 24)) : \ - USES_2S_2S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 6, GENMASK(31, 24)) : \ - USES_1S_2D_2D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 22, GENMASK(31, 24)) : \ - USES_1S_2S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 4, GENMASK(31, 24)) : \ - USES_1S_1S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 4, GENMASK(15, 8)) : \ - USES_1S_1D_1D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 22, GENMASK(15, 8)) : \ - SPI_NOR_CMD_READ_FAST -#define SFDP_CMD_FAST_READ_4B(inst) \ - USES_8D_8D_8D(inst) ? 0xEE : \ - USES_8S_8S_8S(inst) ? 0xEC : \ - USES_1S_8D_8D(inst) && FF84_DW1_BIT(inst, 22) ? 0xFD : \ - USES_1S_8S_8S(inst) && FF84_DW1_BIT(inst, 21) ? 0xCC : \ - USES_1S_1S_8S(inst) && FF84_DW1_BIT(inst, 20) ? 0x7C : \ - USES_4S_4D_4D(inst) ? 0 : \ - USES_4S_4S_4S(inst) ? 0 : \ - USES_1S_4D_4D(inst) && FF84_DW1_BIT(inst, 15) ? 0xEE : \ - USES_1S_4S_4S(inst) && FF84_DW1_BIT(inst, 5) ? 0xEC : \ - USES_1S_1S_4S(inst) && FF84_DW1_BIT(inst, 4) ? 0x6C : \ - USES_2S_2S_2S(inst) ? 0 : \ - USES_1S_2D_2D(inst) && FF84_DW1_BIT(inst, 14) ? 0xBE : \ - USES_1S_2S_2S(inst) && FF84_DW1_BIT(inst, 3) ? 0xBC : \ - USES_1S_1S_2S(inst) && FF84_DW1_BIT(inst, 2) ? 0x3C : \ - USES_1S_1D_1D(inst) && FF84_DW1_BIT(inst, 13) ? 0x0E : \ - FF84_DW1_BIT(inst, 1) ? SPI_NOR_CMD_READ_FAST_4B : \ - 0 - -#define DEFAULT_CMD_INFO(inst) { \ - .pp_cmd = USES_4BYTE_ADDR(inst) && HAS_4BYTE_ADDR_CMDS(inst) \ - ? SFDP_CMD_PP_4B(inst) \ - : SFDP_CMD_PP(inst), \ - .read_cmd = USES_4BYTE_ADDR(inst) && HAS_4BYTE_ADDR_CMDS(inst) \ - ? SFDP_CMD_FAST_READ_4B(inst) \ - : SFDP_CMD_FAST_READ(inst), \ - .read_mode_bit_cycles = \ - USES_1S_8S_8S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 17, GENMASK(7, 5)) : \ - USES_1S_1S_8S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 17, GENMASK(23, 21)) : \ - USES_4S_4D_4D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 23, GENMASK(23, 21)) : \ - USES_4S_4S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 7, GENMASK(23, 21)) : \ - USES_1S_4D_4D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 23, GENMASK(7, 5)) : \ - USES_1S_4S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 3, GENMASK(7, 5)) : \ - USES_1S_1S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 3, GENMASK(23, 21)) : \ - USES_2S_2S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 6, GENMASK(23, 21)) : \ - USES_1S_2D_2D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 22, GENMASK(23, 21)) : \ - USES_1S_2S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 4, GENMASK(23, 21)) : \ - USES_1S_1S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 4, GENMASK(7, 5)) : \ - USES_1S_1D_1D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 22, GENMASK(7, 5)) : \ - USES_1S_1S_1S(inst) ? 0 : \ - 0, \ - .read_dummy_cycles = DT_INST_PROP_OR(inst, rx_dummy, \ - USES_8D_8D_8D(inst) ? SFDP_FIELD(inst, sfdp_ff05, 6, GENMASK(4, 0)) : \ - USES_8S_8S_8S(inst) ? SFDP_FIELD(inst, sfdp_ff05, 6, GENMASK(9, 5)) : \ - USES_1S_8S_8S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 17, GENMASK(4, 0)) : \ - USES_1S_1S_8S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 17, GENMASK(20, 16)) : \ - USES_4S_4D_4D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 23, GENMASK(20, 16)) : \ - USES_4S_4S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 7, GENMASK(20, 16)) : \ - USES_1S_4D_4D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 23, GENMASK(4, 0)) : \ - USES_1S_4S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 3, GENMASK(4, 0)) : \ - USES_1S_1S_4S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 3, GENMASK(20, 16)) : \ - USES_2S_2S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 6, GENMASK(20, 16)) : \ - USES_1S_2D_2D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 22, GENMASK(20, 16)) : \ - USES_1S_2S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 4, GENMASK(20, 16)) : \ - USES_1S_1S_2S(inst) ? SFDP_FIELD(inst, sfdp_bfp, 4, GENMASK(4, 0)) : \ - USES_1S_1D_1D(inst) ? SFDP_FIELD(inst, sfdp_bfp, 22, GENMASK(4, 0)) : \ - USES_1S_1S_1S(inst) ? 8 : \ - 0), \ - .uses_4byte_addr = USES_4BYTE_ADDR(inst), \ - .cmd_extension = CMD_EXTENSION(inst), \ - .sfdp_addr_4 = USES_OCTAL_IO(inst) \ - ? (SFDP_FIELD(inst, sfdp_ff05, 1, BIT(31)) == 0) \ - : false, \ - .sfdp_dummy_20 = USES_OCTAL_IO(inst) \ - ? (SFDP_FIELD(inst, sfdp_ff05, 1, BIT(30)) == 1) \ - : false, \ - .rdsr_addr_4 = USES_OCTAL_IO(inst) \ - ? (SFDP_FIELD(inst, sfdp_ff05, 1, BIT(29)) == 1) \ - : false, \ - .rdsr_dummy = USES_OCTAL_IO(inst) \ - ? (SFDP_FIELD(inst, sfdp_ff05, 1, BIT(28)) ? 8 : 4) \ - : 0, \ - .rdid_addr_4 = USES_OCTAL_IO(inst) \ - ? (SFDP_FIELD(inst, sfdp_ff05, 1, BIT(29)) == 1) \ - : false, \ - .rdid_dummy = USES_OCTAL_IO(inst) \ - ? (SFDP_FIELD(inst, sfdp_ff05, 1, BIT(28)) ? 8 : 4) \ - : 0, } - -/* Erase Types, 8th and 9th DWORD of BSP */ -#define BFP_DW8_CMD_ET_1(inst) SFDP_FIELD(inst, sfdp_bfp, 8, GENMASK(15, 8)) -#define BFP_DW8_EXP_ET_1(inst) SFDP_FIELD(inst, sfdp_bfp, 8, GENMASK(7, 0)) -#define BFP_DW8_CMD_ET_2(inst) SFDP_FIELD(inst, sfdp_bfp, 8, GENMASK(31, 24)) -#define BFP_DW8_EXP_ET_2(inst) SFDP_FIELD(inst, sfdp_bfp, 8, GENMASK(23, 16)) -#define BFP_DW9_CMD_ET_3(inst) SFDP_FIELD(inst, sfdp_bfp, 9, GENMASK(15, 8)) -#define BFP_DW9_EXP_ET_3(inst) SFDP_FIELD(inst, sfdp_bfp, 9, GENMASK(7, 0)) -#define BFP_DW9_CMD_ET_4(inst) SFDP_FIELD(inst, sfdp_bfp, 9, GENMASK(31, 24)) -#define BFP_DW9_EXP_ET_4(inst) SFDP_FIELD(inst, sfdp_bfp, 9, GENMASK(23, 16)) - -/* 4-byte Address instructions for Erase Types defined in 8th and 9th DWORD - * of BFP; 2nd DWORD of 4-byte Address Instruction Table (ID FF84) - */ -#define FF84_DW2_CMD_ET_1(inst) SFDP_FIELD(inst, sfdp_ff84, 2, GENMASK(7, 0)) -#define FF84_DW2_CMD_ET_2(inst) SFDP_FIELD(inst, sfdp_ff84, 2, GENMASK(15, 8)) -#define FF84_DW2_CMD_ET_3(inst) SFDP_FIELD(inst, sfdp_ff84, 2, GENMASK(23, 16)) -#define FF84_DW2_CMD_ET_4(inst) SFDP_FIELD(inst, sfdp_ff84, 2, GENMASK(31, 24)) -/* Support for Erase Types in 4-byte Address mode; table FF84, 1st DWORD */ -#define FF84_DW1_SUP_ET_1(inst) SFDP_FIELD(inst, sfdp_ff84, 1, BIT(9)) -#define FF84_DW1_SUP_ET_2(inst) SFDP_FIELD(inst, sfdp_ff84, 1, BIT(10)) -#define FF84_DW1_SUP_ET_3(inst) SFDP_FIELD(inst, sfdp_ff84, 1, BIT(11)) -#define FF84_DW1_SUP_ET_4(inst) SFDP_FIELD(inst, sfdp_ff84, 1, BIT(12)) - -#define DEFAULT_ERASE_TYPES_DEFINE(inst) \ - static const struct jesd216_erase_type \ - dev##inst##_erase_types[JESD216_NUM_ERASE_TYPES] = \ - COND_CODE_1(SFDP_DW_EXISTS(inst, sfdp_bfp, 8), \ - ({{ .cmd = BFP_DW8_CMD_ET_1(inst), \ - .exp = BFP_DW8_EXP_ET_1(inst), }, \ - { .cmd = BFP_DW8_CMD_ET_2(inst), \ - .exp = BFP_DW8_EXP_ET_2(inst), }, \ - { .cmd = BFP_DW9_CMD_ET_3(inst), \ - .exp = BFP_DW9_EXP_ET_3(inst), }, \ - { .cmd = BFP_DW9_CMD_ET_4(inst), \ - .exp = BFP_DW9_EXP_ET_4(inst), }}), \ - ({{ .cmd = SPI_NOR_CMD_SE, \ - .exp = 0x0C }})); \ - static const struct jesd216_erase_type \ - dev##inst##_erase_types_4b[JESD216_NUM_ERASE_TYPES] = \ - COND_CODE_1(UTIL_AND(SFDP_DW_EXISTS(inst, sfdp_ff84, 2), \ - SFDP_DW_EXISTS(inst, sfdp_bfp, 9)), \ - ({{ .cmd = FF84_DW2_CMD_ET_1(inst), \ - .exp = FF84_DW1_SUP_ET_1(inst) \ - ? BFP_DW8_EXP_ET_1(inst) \ - : 0, }, \ - { .cmd = FF84_DW2_CMD_ET_2(inst), \ - .exp = FF84_DW1_SUP_ET_2(inst) \ - ? BFP_DW8_EXP_ET_2(inst) \ - : 0, }, \ - { .cmd = FF84_DW2_CMD_ET_3(inst), \ - .exp = FF84_DW1_SUP_ET_3(inst) \ - ? BFP_DW9_EXP_ET_3(inst) \ - : 0, }, \ - { .cmd = FF84_DW2_CMD_ET_4(inst), \ - .exp = FF84_DW1_SUP_ET_4(inst) \ - ? BFP_DW9_EXP_ET_4(inst) \ - : 0, }}), \ - ({{ .cmd = SPI_NOR_CMD_SE_4B, \ - .exp = 0x0C }})) - -#define DEFAULT_ERASE_TYPES(inst) \ - USES_4BYTE_ADDR(inst) && HAS_4BYTE_ADDR_CMDS(inst) \ - ? dev##inst##_erase_types_4b \ - : dev##inst##_erase_types - -#define BFP_DW15_QER(inst) \ - SFDP_FIELD(inst, sfdp_bfp, 15, GENMASK(22, 20)) - -#define BFP_DW19_OER(inst) \ - SFDP_FIELD(inst, sfdp_bfp, 19, GENMASK(22, 20)) - -#define ENTER_4BYTE_ADDR(inst) \ - (!USES_4BYTE_ADDR(inst) ? ENTER_4BYTE_ADDR_NONE : \ - (BFP_ENTER_4BYTE_ADDR_METHODS(inst) \ - & (BFP_DW16_4B_ADDR_PER_CMD | \ - BFP_DW16_4B_ADDR_ALWAYS)) ? ENTER_4BYTE_ADDR_NONE : \ - (BFP_ENTER_4BYTE_ADDR_METHODS(inst) \ - & BFP_DW16_4B_ADDR_ENTER_B7) ? ENTER_4BYTE_ADDR_B7 : \ - (BFP_ENTER_4BYTE_ADDR_METHODS(inst) \ - & BFP_DW16_4B_ADDR_ENTER_06_B7) ? ENTER_4BYTE_ADDR_06_B7 : \ - ENTER_4BYTE_ADDR_NONE) - -#define DEFAULT_SWITCH_INFO(inst) { \ - .quad_enable_req = BFP_DW15_QER(inst), \ - .octal_enable_req = BFP_DW19_OER(inst), \ - .enter_4byte_addr = ENTER_4BYTE_ADDR(inst) } - -#define BFP_FLASH_SIZE(dw2) \ - ((dw2 & BIT(31)) \ - ? BIT(MIN(31, (dw2 & BIT_MASK(31)) - 3)) \ - : dw2 / 8) - -#define FLASH_SIZE(inst) \ - (DT_INST_NODE_HAS_PROP(inst, size) \ - ? DT_INST_PROP(inst, size) / 8 \ - : BFP_FLASH_SIZE(SFDP_DW(inst, sfdp_bfp, 2))) - -#define BFP_FLASH_PAGE_EXP(inst) SFDP_FIELD(inst, sfdp_bfp, 11, GENMASK(7, 4)) - -#define FLASH_PAGE_SIZE(inst) \ - (BFP_FLASH_PAGE_EXP(inst) \ - ? BIT(BFP_FLASH_PAGE_EXP(inst)) \ - : SPI_NOR_PAGE_SIZE) - -#define SFDP_BUILD_ASSERTS(inst) \ - BUILD_ASSERT(DT_INST_NODE_HAS_PROP(inst, sfdp_bfp), \ - "sfdp-bfp property needed in " \ - DT_NODE_FULL_NAME(DT_DRV_INST(inst))); \ - BUILD_ASSERT((DT_INST_ENUM_IDX(inst, mspi_io_mode) \ - != MSPI_IO_MODE_OCTAL) || \ - DT_INST_NODE_HAS_PROP(inst, sfdp_ff05), \ - "sfdp-ff05 property needed in " \ - DT_NODE_FULL_NAME(DT_DRV_INST(inst))); \ - BUILD_ASSERT(!USES_4BYTE_ADDR(inst) || \ - DT_INST_NODE_HAS_PROP(inst, sfdp_ff84), \ - "sfdp-ff84 property needed in " \ - DT_NODE_FULL_NAME(DT_DRV_INST(inst))); \ - BUILD_ASSERT(!USES_8D_8D_8D(inst) || \ - BFP_DW18_CMD_EXT(inst) <= BFP_DW18_CMD_EXT_INV, \ - "Unsupported Octal Command Extension mode in " \ - DT_NODE_FULL_NAME(DT_DRV_INST(inst))) - -#else - -#define USES_4BYTE_ADDR(inst) \ - (DT_INST_ENUM_IDX(inst, mspi_io_mode) == MSPI_IO_MODE_OCTAL) - -#define DEFAULT_CMD_INFO(inst) { \ - .pp_cmd = USES_4BYTE_ADDR(inst) \ - ? SPI_NOR_CMD_PP_4B \ - : SPI_NOR_CMD_PP, \ - .read_cmd = USES_4BYTE_ADDR(inst) \ - ? SPI_NOR_CMD_READ_FAST_4B \ - : SPI_NOR_CMD_READ_FAST, \ - .read_mode_bit_cycles = 0, \ - .read_dummy_cycles = 8, \ - .uses_4byte_addr = USES_4BYTE_ADDR(inst), \ - .cmd_extension = CMD_EXTENSION_NONE, \ - .sfdp_addr_4 = false, \ - .sfdp_dummy_20 = false, \ - .rdsr_addr_4 = false, \ - .rdsr_dummy = 0, \ - .rdid_addr_4 = false, \ - .rdid_dummy = 0, } - -#define DEFAULT_ERASE_TYPES_DEFINE(inst) \ - static const struct jesd216_erase_type \ - dev##inst##_erase_types[JESD216_NUM_ERASE_TYPES] = \ - {{ .cmd = SPI_NOR_CMD_SE, \ - .exp = 0x0C }}; \ - static const struct jesd216_erase_type \ - dev##inst##_erase_types_4b[JESD216_NUM_ERASE_TYPES] = \ - {{ .cmd = SPI_NOR_CMD_SE_4B, \ - .exp = 0x0C }} - -#define DEFAULT_ERASE_TYPES(inst) \ - USES_4BYTE_ADDR(inst) ? dev##inst##_erase_types_4b \ - : dev##inst##_erase_types - -#define DEFAULT_SWITCH_INFO(inst) { \ - .quad_enable_req = DT_INST_ENUM_IDX_OR(inst, quad_enable_requirements, \ - JESD216_DW15_QER_VAL_NONE), \ - .octal_enable_req = OCTAL_ENABLE_REQ_NONE, \ - .enter_4byte_addr = ENTER_4BYTE_ADDR_NONE } - -#define FLASH_SIZE(inst) (DT_INST_PROP(inst, size) / 8) - -#define FLASH_PAGE_SIZE(inst) SPI_NOR_PAGE_SIZE - -#define SFDP_BUILD_ASSERTS(inst) - -#endif /* CONFIG_FLASH_MSPI_NOR_USE_SFDP */ diff --git a/dts/bindings/mtd/jedec,jesd216.yaml b/dts/bindings/mtd/jedec,jesd216.yaml index d5f75c74dd3..c55440456c2 100644 --- a/dts/bindings/mtd/jedec,jesd216.yaml +++ b/dts/bindings/mtd/jedec,jesd216.yaml @@ -35,18 +35,6 @@ properties: information in cases were runtime retrieval of SFDP data is not desired. - sfdp-ff05: - type: uint8-array - description: | - Contains the 32-bit words in little-endian byte order from the JESD216 - SFDP xSPI Profile 1.0 table. - - sfdp-ff84: - type: uint8-array - description: | - Contains the 32-bit words in little-endian byte order from the JESD216 - SFDP 4-byte Address Instruction Parameter table. - quad-enable-requirements: type: string enum: From feda9ea6628f77ed5ec0c1b529d3b95b53479613 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 037/881] Revert "[nrf fromtree] drivers: flash_mspi: Implement flash API get_size" This reverts commit 086847880b782e4efcecf3e8256aca207b396cb9. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 5546ef904c0..ae22202e075 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -387,12 +387,6 @@ static int api_erase(const struct device *dev, off_t addr, size_t size) return rc; } -static int api_get_size(const struct device *dev, uint64_t *size) -{ - *size = dev_flash_size(dev); - return 0; -} - static const struct flash_parameters *api_get_parameters(const struct device *dev) { @@ -777,7 +771,6 @@ static DEVICE_API(flash, drv_api) = { .read = api_read, .write = api_write, .erase = api_erase, - .get_size = api_get_size, .get_parameters = api_get_parameters, #if defined(CONFIG_FLASH_PAGE_LAYOUT) .page_layout = api_page_layout, From add090ea613c23d7dc1be176df67e34d9caa5b72 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 038/881] Revert "[nrf fromtree] drivers: mspi_dw: Add support for DQS line" This reverts commit a2c68d47df855f27f48e7b594f3f5e2d7d532aaf. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 66f257839aa..f4e775ead43 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -691,6 +691,7 @@ static int _api_dev_config(const struct device *dev, } if (param_mask & MSPI_DEVICE_CONFIG_DATA_RATE) { + /* TODO: add support for DDR */ dev_data->spi_ctrlr0 &= ~(SPI_CTRLR0_SPI_DDR_EN_BIT | SPI_CTRLR0_INST_DDR_EN_BIT); switch (cfg->data_rate) { @@ -711,10 +712,10 @@ static int _api_dev_config(const struct device *dev, } if (param_mask & MSPI_DEVICE_CONFIG_DQS) { - dev_data->spi_ctrlr0 &= ~SPI_CTRLR0_SPI_RXDS_EN_BIT; - + /* TODO: add support for DQS */ if (cfg->dqs_enable) { - dev_data->spi_ctrlr0 |= SPI_CTRLR0_SPI_RXDS_EN_BIT; + LOG_ERR("DQS line is not supported."); + return -ENOTSUP; } } From a4418fc1793f1a234bf76e7483891a248f4b3505 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 039/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: Fix compilation with CONFIG_MSPI_XIP disabled" This reverts commit c89e1b0541b2e68a181f63736b42e76ff45fd925. Signed-off-by: Jukka Rissanen --- drivers/mspi/Kconfig.dw | 1 - drivers/mspi/mspi_dw.c | 32 ++++++++++++++------------------ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index 06d2e09c8af..d429cff044c 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -8,7 +8,6 @@ config MSPI_DW depends on DT_HAS_SNPS_DESIGNWARE_SSI_ENABLED select PINCTRL if $(dt_compat_any_has_prop,$(DT_COMPAT_SNPS_DESIGNWARE_SSI),pinctrl-0) imply MSPI_XIP - imply MSPI_TIMING if MSPI_DW diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index f4e775ead43..0c6d8d15166 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -1193,22 +1193,6 @@ static int api_transceive(const struct device *dev, return rc; } -#if defined(CONFIG_MSPI_TIMING) -static int api_timing_config(const struct device *dev, - const struct mspi_dev_id *dev_id, - const uint32_t param_mask, void *cfg) -{ - struct mspi_dw_data *dev_data = dev->data; - struct mspi_dw_timing_cfg *config = cfg; - - if (param_mask & MSPI_DW_RX_TIMING_CFG) { - dev_data->rx_sample_dly = config->rx_sample_dly; - return 0; - } - return -ENOTSUP; -} -#endif /* defined(CONFIG_MSPI_TIMING) */ - #if defined(CONFIG_MSPI_XIP) static int _api_xip_config(const struct device *dev, const struct mspi_dev_id *dev_id, @@ -1315,6 +1299,20 @@ static int _api_xip_config(const struct device *dev, return 0; } +static int api_timing_config(const struct device *dev, + const struct mspi_dev_id *dev_id, + const uint32_t param_mask, void *cfg) +{ + struct mspi_dw_data *dev_data = dev->data; + struct mspi_dw_timing_cfg *config = cfg; + + if (param_mask & MSPI_DW_RX_TIMING_CFG) { + dev_data->rx_sample_dly = config->rx_sample_dly; + return 0; + } + return -ENOTSUP; +} + static int api_xip_config(const struct device *dev, const struct mspi_dev_id *dev_id, const struct mspi_xip_cfg *cfg) @@ -1463,9 +1461,7 @@ static DEVICE_API(mspi, drv_api) = { .dev_config = api_dev_config, .get_channel_status = api_get_channel_status, .transceive = api_transceive, -#if defined(CONFIG_MSPI_TIMING) .timing_config = api_timing_config, -#endif #if defined(CONFIG_MSPI_XIP) .xip_config = api_xip_config, #endif From 1d64d7bd65e6ead1b694818ee81d4f5ca7fe32dc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 040/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: support configuration of TXD_DRIVE_EDGE setting" This reverts commit a6480d2bce7a558a54915ac9091f69e636cbcce5. Signed-off-by: Jukka Rissanen --- drivers/mspi/Kconfig.dw | 21 --------------------- drivers/mspi/mspi_dw.c | 5 +---- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index d429cff044c..1ab82da0e85 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -1,5 +1,4 @@ # Copyright (c) 2024 Nordic Semiconductor ASA -# Copyright (c) 2025 Tenstorrent AI ULC # SPDX-License-Identifier: Apache-2.0 config MSPI_DW @@ -8,23 +7,3 @@ config MSPI_DW depends on DT_HAS_SNPS_DESIGNWARE_SSI_ENABLED select PINCTRL if $(dt_compat_any_has_prop,$(DT_COMPAT_SNPS_DESIGNWARE_SSI),pinctrl-0) imply MSPI_XIP - -if MSPI_DW - -config MSPI_DW_TXD_DIV - int "Designware SSI TX Drive edge divisor" - default 4 - help - Division factor to apply to calculated BAUDR value when writing it - to the TXD_DRIVE_EDGE register in DDR mode. Note that the maximum - value of this register is (BAUDR / 2) - 1. - -config MSPI_DW_TXD_MUL - int "Designware SSI TX Drive edge multiplier" - default 1 - help - Multiplication factor to apply to calculated BAUDR value when writing - it to the TXD_DRIVE_EDGE register in DDR mode. Note that the maximum - value of this register is (BAUDR / 2) - 1. - -endif # MSPI_DW diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 0c6d8d15166..5370da453b0 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -956,10 +956,7 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) write_rx_sample_dly(dev, dev_data->rx_sample_dly); if (dev_data->spi_ctrlr0 & (SPI_CTRLR0_SPI_DDR_EN_BIT | SPI_CTRLR0_INST_DDR_EN_BIT)) { - int txd = (CONFIG_MSPI_DW_TXD_MUL * dev_data->baudr) / - CONFIG_MSPI_DW_TXD_DIV; - - write_txd_drive_edge(dev, txd); + write_txd_drive_edge(dev, dev_data->baudr / 4); } else { write_txd_drive_edge(dev, 0); } From f7f27083650448fb1bea2b5b92d2d85be41b6252 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 041/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: make sure controller is disabled at entry" This reverts commit c1dd79cdff9e19442c89ab717859b170ccf9db1d. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 5370da453b0..992c5dd1013 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -1437,9 +1437,6 @@ static int dev_init(const struct device *dev) } } - /* Make sure controller is disabled. */ - write_ssienr(dev, 0); - #if defined(CONFIG_PINCTRL) if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { rc = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); From c78a60597c12f23eb7e8fdb0e7a5a9ee63072333 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:56 +0300 Subject: [PATCH 042/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: support DDR mode" This reverts commit 9d9d507a7cd58fa12dfbc6fbde7f0f030ada6c07. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 992c5dd1013..bc2419e7f84 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -117,7 +117,6 @@ DEFINE_MM_REG_RD(risr, 0x34) DEFINE_MM_REG_RD_WR(dr, 0x60) DEFINE_MM_REG_WR(rx_sample_dly, 0xf0) DEFINE_MM_REG_WR(spi_ctrlr0, 0xf4) -DEFINE_MM_REG_WR(txd_drive_edge, 0xf8) #if defined(CONFIG_MSPI_XIP) DEFINE_MM_REG_WR(xip_incr_inst, 0x100) @@ -692,21 +691,8 @@ static int _api_dev_config(const struct device *dev, if (param_mask & MSPI_DEVICE_CONFIG_DATA_RATE) { /* TODO: add support for DDR */ - dev_data->spi_ctrlr0 &= ~(SPI_CTRLR0_SPI_DDR_EN_BIT | - SPI_CTRLR0_INST_DDR_EN_BIT); - switch (cfg->data_rate) { - case MSPI_DATA_RATE_SINGLE: - break; - case MSPI_DATA_RATE_DUAL: - dev_data->spi_ctrlr0 |= SPI_CTRLR0_INST_DDR_EN_BIT; - /* Also need to set DDR_EN bit */ - __fallthrough; - case MSPI_DATA_RATE_S_D_D: - dev_data->spi_ctrlr0 |= SPI_CTRLR0_SPI_DDR_EN_BIT; - break; - default: - LOG_ERR("Data rate %d not supported", - cfg->data_rate); + if (cfg->data_rate != MSPI_DATA_RATE_SINGLE) { + LOG_ERR("Only single data rate is supported."); return -ENOTSUP; } } @@ -954,12 +940,6 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) write_spi_ctrlr0(dev, dev_data->spi_ctrlr0); write_baudr(dev, dev_data->baudr); write_rx_sample_dly(dev, dev_data->rx_sample_dly); - if (dev_data->spi_ctrlr0 & (SPI_CTRLR0_SPI_DDR_EN_BIT | - SPI_CTRLR0_INST_DDR_EN_BIT)) { - write_txd_drive_edge(dev, dev_data->baudr / 4); - } else { - write_txd_drive_edge(dev, 0); - } if (xip_enabled) { write_ssienr(dev, SSIENR_SSIC_EN_BIT); From 51d3d35dc211d8060708af1b7e69b520ea329489 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 043/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: improve reliability of CS signal" This reverts commit c9a1136d6d54d5e13f988be6347e3e8864672e77. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index bc2419e7f84..262f4c6b2a2 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -940,6 +940,7 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) write_spi_ctrlr0(dev, dev_data->spi_ctrlr0); write_baudr(dev, dev_data->baudr); write_rx_sample_dly(dev, dev_data->rx_sample_dly); + write_ser(dev, BIT(dev_data->dev_id->dev_idx)); if (xip_enabled) { write_ssienr(dev, SSIENR_SSIC_EN_BIT); @@ -1026,17 +1027,8 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) } } - /* Prefill TX FIFO with any data we can */ - if (dev_data->dummy_bytes && tx_dummy_bytes(dev)) { - imr = IMR_RXFIM_BIT; - } else if (packet->dir == MSPI_TX && packet->num_bytes) { - tx_data(dev, packet); - } - /* Enable interrupts now and wait until the packet is done. */ write_imr(dev, imr); - /* Write SER to start transfer */ - write_ser(dev, BIT(dev_data->dev_id->dev_idx)); rc = k_sem_take(&dev_data->finished, timeout); if (read_risr(dev) & RISR_RXOIR_BIT) { @@ -1066,8 +1058,6 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) } else { write_ssienr(dev, 0); } - /* Clear SER */ - write_ser(dev, 0); if (dev_data->dev_id->ce.port) { int rc2; From 98cfe3e0852db0acaa480d002471c29b414b8649 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 044/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: add API to configure RX_DLY timing" This reverts commit e8027d3ae2bd52634012905066a5bb4bfa6e2fe2. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 19 ------------------ include/zephyr/drivers/mspi/mspi_dw.h | 29 --------------------------- 2 files changed, 48 deletions(-) delete mode 100644 include/zephyr/drivers/mspi/mspi_dw.h diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 262f4c6b2a2..d2c4376302f 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "mspi_dw.h" @@ -49,7 +48,6 @@ struct mspi_dw_data { uint32_t ctrlr0; uint32_t spi_ctrlr0; uint32_t baudr; - uint32_t rx_sample_dly; #if defined(CONFIG_MSPI_XIP) uint32_t xip_freq; @@ -115,7 +113,6 @@ DEFINE_MM_REG_WR(imr, 0x2c) DEFINE_MM_REG_RD(isr, 0x30) DEFINE_MM_REG_RD(risr, 0x34) DEFINE_MM_REG_RD_WR(dr, 0x60) -DEFINE_MM_REG_WR(rx_sample_dly, 0xf0) DEFINE_MM_REG_WR(spi_ctrlr0, 0xf4) #if defined(CONFIG_MSPI_XIP) @@ -939,7 +936,6 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) : 0); write_spi_ctrlr0(dev, dev_data->spi_ctrlr0); write_baudr(dev, dev_data->baudr); - write_rx_sample_dly(dev, dev_data->rx_sample_dly); write_ser(dev, BIT(dev_data->dev_id->dev_idx)); if (xip_enabled) { @@ -1266,20 +1262,6 @@ static int _api_xip_config(const struct device *dev, return 0; } -static int api_timing_config(const struct device *dev, - const struct mspi_dev_id *dev_id, - const uint32_t param_mask, void *cfg) -{ - struct mspi_dw_data *dev_data = dev->data; - struct mspi_dw_timing_cfg *config = cfg; - - if (param_mask & MSPI_DW_RX_TIMING_CFG) { - dev_data->rx_sample_dly = config->rx_sample_dly; - return 0; - } - return -ENOTSUP; -} - static int api_xip_config(const struct device *dev, const struct mspi_dev_id *dev_id, const struct mspi_xip_cfg *cfg) @@ -1425,7 +1407,6 @@ static DEVICE_API(mspi, drv_api) = { .dev_config = api_dev_config, .get_channel_status = api_get_channel_status, .transceive = api_transceive, - .timing_config = api_timing_config, #if defined(CONFIG_MSPI_XIP) .xip_config = api_xip_config, #endif diff --git a/include/zephyr/drivers/mspi/mspi_dw.h b/include/zephyr/drivers/mspi/mspi_dw.h deleted file mode 100644 index b51c9b9cdf0..00000000000 --- a/include/zephyr/drivers/mspi/mspi_dw.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2025 Tenstorrent AI ULC - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DRIVERS_MSPI_DW_H_ -#define ZEPHYR_INCLUDE_DRIVERS_MSPI_DW_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Designware MSPI configuration structure- this should be passed to the - * MSPI driver when calling mspi_timing_config - */ -struct mspi_dw_timing_cfg { - uint32_t rx_sample_dly; /* RX sample delay, written to RX_SAMPLE_DLY register */ -}; - -/* Configure RX_SAMPLE_DLY register for MSPI DW SSI */ -#define MSPI_DW_RX_TIMING_CFG BIT(0) - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_DRIVERS_MSPI_DW_H_ */ From d124790a144522dd22c0cb47593aae42b057ddfb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 045/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: support newer IP revisions" This reverts commit 17142bc74b809afdb01c0b74da72474c1573337f. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 9 ++------- drivers/mspi/mspi_dw.h | 22 ++++++---------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index d2c4376302f..f6c8c95eb6d 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -820,9 +820,8 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) dev_data->dummy_bytes = 0; dev_data->bytes_to_discard = 0; - dev_data->ctrlr0 &= ~(CTRLR0_TMOD_MASK) - & ~(CTRLR0_DFS_MASK) - & ~(CTRLR0_DFS32_MASK); + dev_data->ctrlr0 &= ~CTRLR0_TMOD_MASK + & ~CTRLR0_DFS_MASK; dev_data->spi_ctrlr0 &= ~SPI_CTRLR0_WAIT_CYCLES_MASK; @@ -831,20 +830,16 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) dev_data->xfer.addr_length != 0)) { dev_data->bytes_per_frame_exp = 0; dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_DFS_MASK, 7); - dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_DFS32_MASK, 7); } else { if ((packet->num_bytes % 4) == 0) { dev_data->bytes_per_frame_exp = 2; dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_DFS_MASK, 31); - dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_DFS32_MASK, 31); } else if ((packet->num_bytes % 2) == 0) { dev_data->bytes_per_frame_exp = 1; dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_DFS_MASK, 15); - dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_DFS32_MASK, 15); } else { dev_data->bytes_per_frame_exp = 0; dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_DFS_MASK, 7); - dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_DFS32_MASK, 7); } } diff --git a/drivers/mspi/mspi_dw.h b/drivers/mspi/mspi_dw.h index 28e4bed016e..c35778cb1c5 100644 --- a/drivers/mspi/mspi_dw.h +++ b/drivers/mspi/mspi_dw.h @@ -1,42 +1,32 @@ /* * Copyright (c) 2024 Nordic Semiconductor ASA - * Copyright (c) 2025 Tenstorrent AI ULC * * SPDX-License-Identifier: Apache-2.0 */ -#if DT_HAS_COMPAT_STATUS_OKAY(snps_designware_ssi_v2) -/* - * Later versions of the SSI have different register offsets. Define a macro - * to use these. - */ -#define SSI_VERSION_2 1 -#endif - /* * This header is part of mspi_dw.c extracted only for clarity. * It is not supposed to be included by any file other than mspi_dw.c. */ /* CTRLR0 - Control Register 0 */ -#define CTRLR0_SPI_FRF_MASK COND_CODE_1(SSI_VERSION_2, GENMASK(22, 21), GENMASK(23, 22)) +#define CTRLR0_SPI_FRF_MASK GENMASK(23, 22) #define CTRLR0_SPI_FRF_STANDARD 0UL #define CTRLR0_SPI_FRF_DUAL 1UL #define CTRLR0_SPI_FRF_QUAD 2UL #define CTRLR0_SPI_FRF_OCTAL 3UL -#define CTRLR0_TMOD_MASK COND_CODE_1(SSI_VERSION_2, GENMASK(9, 8), GENMASK(11, 10)) +#define CTRLR0_TMOD_MASK GENMASK(11, 10) #define CTRLR0_TMOD_TX_RX 0UL #define CTRLR0_TMOD_TX 1UL #define CTRLR0_TMOD_RX 2UL #define CTRLR0_TMOD_EEPROM 3UL -#define CTRLR0_SCPOL_BIT COND_CODE_1(SSI_VERSION_2, BIT(7), BIT(9)) -#define CTRLR0_SCPH_BIT COND_CODE_1(SSI_VERSION_2, BIT(6), BIT(8)) -#define CTRLR0_FRF_MASK COND_CODE_1(SSI_VERSION_2, GENMASK(5, 4), GENMASK(7, 6)) +#define CTRLR0_SCPOL_BIT BIT(9) +#define CTRLR0_SCPH_BIT BIT(8) +#define CTRLR0_FRF_MASK GENMASK(7, 6) #define CTRLR0_FRF_SPI 0UL #define CTRLR0_FRF_SSP 1UL #define CTRLR0_FRF_MICROWIRE 2UL -#define CTRLR0_DFS_MASK COND_CODE_1(SSI_VERSION_2, GENMASK(3, 0), GENMASK(4, 0)) -#define CTRLR0_DFS32_MASK COND_CODE_1(SSI_VERSION_2, GENMASK(20, 16), (0)) +#define CTRLR0_DFS_MASK GENMASK(4, 0) /* CTRLR1- Control Register 1 */ #define CTRLR1_NDF_MASK GENMASK(15, 0) From 283e26d8a4eaab2e0db0daf144c2290cbc6b8a66 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 046/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: properly support multi-level interrupts" This reverts commit 9f644bb7e7ab1b4e0d061330027e128d497a0b9a. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index f6c8c95eb6d..53937f0690c 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -1408,10 +1408,10 @@ static DEVICE_API(mspi, drv_api) = { }; #define MSPI_DW_INST_IRQ(idx, inst) \ - IRQ_CONNECT(DT_INST_IRQN_BY_IDX(inst, idx), \ + IRQ_CONNECT(DT_INST_IRQ_BY_IDX(inst, idx, irq), \ DT_INST_IRQ_BY_IDX(inst, idx, priority), \ mspi_dw_isr, DEVICE_DT_INST_GET(inst), 0); \ - irq_enable(DT_INST_IRQN_BY_IDX(inst, idx)) + irq_enable(DT_INST_IRQ_BY_IDX(inst, idx, irq)) #define MSPI_DW_MMIO_ROM_INIT(node_id) \ COND_CODE_1(DT_REG_HAS_NAME(node_id, core), \ From cb28beed4434a5e8a86fcd5fdcec2e2f40da0530 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 047/881] Revert "[nrf fromtree] drivers: mspi: mspi_dw: make pinctrl include conditional" This reverts commit ee801a9aad329624cd700363a3db9f6f3dedb3e8. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 53937f0690c..e57511b409a 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2024 Nordic Semiconductor ASA - * Copyright (c) 2025 Tenstorrent AI ULC * * SPDX-License-Identifier: Apache-2.0 */ @@ -9,9 +8,7 @@ #include #include -#if defined(CONFIG_PINCTRL) #include -#endif #include #include #include From bf269785b7a53945c08a1ac9a28d93033ec43c8b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 048/881] Revert "[nrf fromtree] drivers: mspi: supply empty vendor specific macros for generic case" This reverts commit ac96822f2db8f5a1b4045a2f64fec445892f44c7. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw_vendor_specific.h | 38 -------------------------- 1 file changed, 38 deletions(-) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index d32a53ac293..e34d8a5db60 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -1,6 +1,5 @@ /* * Copyright (c) 2024 Nordic Semiconductor ASA - * Copyright (c) 2025 Tenstorrent AI ULC * * SPDX-License-Identifier: Apache-2.0 */ @@ -97,41 +96,4 @@ static inline int vendor_specific_xip_disable(const struct device *dev, } #endif /* defined(CONFIG_MSPI_XIP) */ -#else -static inline void vendor_specific_init(const struct device *dev) -{ - ARG_UNUSED(dev); -} -static inline void vendor_specific_suspend(const struct device *dev) -{ - ARG_UNUSED(dev); -} -static inline void vendor_specific_resume(const struct device *dev) -{ - ARG_UNUSED(dev); -} -static inline void vendor_specific_irq_clear(const struct device *dev) -{ - ARG_UNUSED(dev); -} -static inline int vendor_specific_xip_enable(const struct device *dev, - const struct mspi_dev_id *dev_id, - const struct mspi_xip_cfg *cfg) -{ - ARG_UNUSED(dev); - ARG_UNUSED(dev_id); - ARG_UNUSED(cfg); - - return 0; -} -static inline int vendor_specific_xip_disable(const struct device *dev, - const struct mspi_dev_id *dev_id, - const struct mspi_xip_cfg *cfg) -{ - ARG_UNUSED(dev); - ARG_UNUSED(dev_id); - ARG_UNUSED(cfg); - - return 0; -} #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) */ From e94d781997a9f1c7a172b47c118fa8c0fb1a123e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 049/881] Revert "[nrf fromtree] tests: drivers: i2s: Add test for 8ch, 32bit, 48k TDM" This reverts commit 72e0c1852b32b48b3c3ebc0183bf960e3f1c1cc5. Signed-off-by: Jukka Rissanen --- tests/drivers/i2s/i2s_additional/Kconfig | 8 ---- .../nrf54h20dk_nrf54h20_cpuapp_aclk.overlay | 16 ------- tests/drivers/i2s/i2s_additional/src/main.c | 43 ++----------------- .../drivers/i2s/i2s_additional/testcase.yaml | 11 ----- 4 files changed, 3 insertions(+), 75 deletions(-) delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf54h20dk_nrf54h20_cpuapp_aclk.overlay diff --git a/tests/drivers/i2s/i2s_additional/Kconfig b/tests/drivers/i2s/i2s_additional/Kconfig index ee903546708..3c80dba4853 100644 --- a/tests/drivers/i2s/i2s_additional/Kconfig +++ b/tests/drivers/i2s/i2s_additional/Kconfig @@ -75,14 +75,6 @@ config I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED When set to 'y', test will check that i2s_configure() returns -EINVAL. When set to 'n', test will do the transmission. -config I2S_TEST_EIGHT_CHANNELS_32B_48K_UNSUPPORTED - bool "Skip test with 8 channels, 32 bit word size and 48k sample rate" - depends on !I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED - help - Skip test that is challenging due to high data throughput. - When set to 'y', test will be skipped. - When set to 'n', test will do the transmission. - config I2S_TEST_DATA_FORMAT_I2S_UNSUPPORTED bool "I2S_FMT_DATA_FORMAT_I2S is not supported by the driver" help diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54h20dk_nrf54h20_cpuapp_aclk.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54h20dk_nrf54h20_cpuapp_aclk.overlay deleted file mode 100644 index ad9e06d0793..00000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf54h20dk_nrf54h20_cpuapp_aclk.overlay +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&audiopll { - status = "okay"; - frequency = ; -}; - -&tdm130 { - mck-frequency = <12288000>; - mck-clock-source = "ACLK"; - sck-clock-source = "ACLK"; -}; diff --git a/tests/drivers/i2s/i2s_additional/src/main.c b/tests/drivers/i2s/i2s_additional/src/main.c index 0dcfc052bdf..e8852850cee 100644 --- a/tests/drivers/i2s/i2s_additional/src/main.c +++ b/tests/drivers/i2s/i2s_additional/src/main.c @@ -19,7 +19,7 @@ LOG_MODULE_REGISTER(i2s_add, LOG_LEVEL_INF); #define NUMBER_OF_CHANNELS 2 #define FRAME_CLK_FREQ 44100 -#define NUM_BLOCKS 4 +#define NUM_BLOCKS 20 #define TIMEOUT 1000 #define SAMPLES_COUNT 64 @@ -519,9 +519,9 @@ ZTEST(i2s_additional, test_02b_four_channels) #endif /* CONFIG_I2S_TEST_FOUR_CHANNELS_UNSUPPORTED */ } -/** @brief Test I2S transfer with eight channels, 16 bit and 44.1 kHz. +/** @brief Test I2S transfer with eight channels. */ -ZTEST(i2s_additional, test_02c_eight_channels_default) +ZTEST(i2s_additional, test_02c_eight_channels) { struct i2s_config i2s_cfg = default_i2s_cfg; @@ -549,43 +549,6 @@ ZTEST(i2s_additional, test_02c_eight_channels_default) #endif /* CONFIG_I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED */ } -/** @brief Test I2S transfer with eight channels, 32 bit and 48 kHz. - */ -ZTEST(i2s_additional, test_02d_eight_channels_high_throughput) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.channels = 8; - i2s_cfg.word_size = 32; - i2s_cfg.frame_clk_freq = 48000; - -#if defined(CONFIG_I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else /* CONFIG_I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED */ - -#if defined(CONFIG_I2S_TEST_EIGHT_CHANNELS_32B_48K_UNSUPPORTED) - /* Skip this test if driver supports 8ch but fails in this configuration. */ - ztest_test_skip(); -#endif - - /* Select format that supports eight channels. */ -#if !defined(CONFIG_I2S_TEST_DATA_FORMAT_PCM_LONG_UNSUPPORTED) - i2s_cfg.format = I2S_FMT_DATA_FORMAT_PCM_LONG; - TC_PRINT("Selected format is I2S_FMT_DATA_FORMAT_PCM_LONG\n"); -#elif !defined(CONFIG_I2S_TEST_DATA_FORMAT_PCM_SHORT_UNSUPPORTED) - i2s_cfg.format = I2S_FMT_DATA_FORMAT_PCM_SHORT; - TC_PRINT("Selected format is I2S_FMT_DATA_FORMAT_PCM_SHORT\n"); -#else -#error "Don't know what format supports eight channels." -#endif - - i2s_dir_both_transfer_long(&i2s_cfg); -#endif /* CONFIG_I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED */ -} - /** @brief Test I2S transfer with format I2S_FMT_DATA_FORMAT_I2S */ ZTEST(i2s_additional, test_03a_format_i2s) diff --git a/tests/drivers/i2s/i2s_additional/testcase.yaml b/tests/drivers/i2s/i2s_additional/testcase.yaml index 77a18c3ab9d..9dcb82d61f3 100644 --- a/tests/drivers/i2s/i2s_additional/testcase.yaml +++ b/tests/drivers/i2s/i2s_additional/testcase.yaml @@ -26,17 +26,6 @@ tests: drivers.i2s.additional.gpio_loopback.54h: harness_config: fixture: i2s_loopback - extra_configs: - - CONFIG_I2S_TEST_EIGHT_CHANNELS_32B_48K_UNSUPPORTED=y - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - - drivers.i2s.additional.gpio_loopback.54h.aclk: - harness_config: - fixture: i2s_loopback - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_aclk.overlay" platform_allow: - nrf54h20dk/nrf54h20/cpuapp integration_platforms: From 6f7695ca46a495e937799bc21320b560e65c7c55 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 050/881] Revert "[nrf fromtree] storage/stream_flash: Add test for buffered data size API" This reverts commit 3722a2f2a16b998bdab8a230dc943e9e6c8367c4. Signed-off-by: Jukka Rissanen --- .../storage/stream/stream_flash/src/main.c | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/tests/subsys/storage/stream/stream_flash/src/main.c b/tests/subsys/storage/stream/stream_flash/src/main.c index 944892e256f..b691a7e0792 100644 --- a/tests/subsys/storage/stream/stream_flash/src/main.c +++ b/tests/subsys/storage/stream/stream_flash/src/main.c @@ -276,42 +276,6 @@ ZTEST(lib_stream_flash, test_stream_flash_bytes_written) VERIFY_WRITTEN(BUF_LEN, BUF_LEN); } -ZTEST(lib_stream_flash, test_stream_flash_bytes_buffered) -{ - int rc; - size_t buffered; - - init_target(); - - /* Initially no bytes should be buffered */ - buffered = stream_flash_bytes_buffered(&ctx); - zassert_equal(buffered, 0, "expected no buffered bytes"); - - /* Write partial buffer */ - rc = stream_flash_buffered_write(&ctx, write_buf, BUF_LEN - 128, false); - zassert_equal(rc, 0, "expected success"); - - /* Verify buffered bytes */ - buffered = stream_flash_bytes_buffered(&ctx); - zassert_equal(buffered, BUF_LEN - 128, "expected buffered bytes"); - - /* Write remaining buffer */ - rc = stream_flash_buffered_write(&ctx, write_buf, 128, false); - zassert_equal(rc, 0, "expected success"); - - /* After auto-flush, no bytes should be buffered */ - buffered = stream_flash_bytes_buffered(&ctx); - zassert_equal(buffered, 0, "expected no buffered bytes"); - - /* Write more than buffer size to trigger auto-flush */ - rc = stream_flash_buffered_write(&ctx, write_buf, BUF_LEN + 128, false); - zassert_equal(rc, 0, "expected success"); - - /* Verify buffered bytes */ - buffered = stream_flash_bytes_buffered(&ctx); - zassert_equal(buffered, 128, "expected remaining buffered bytes after auto-flush"); -} - ZTEST(lib_stream_flash, test_stream_flash_buf_size_greater_than_page_size) { int rc; From 31a33428d04f91852b50237b592cee6d5c697898 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 051/881] Revert "[nrf fromtree] storage/stream_flash: Add API to query buffered data size" This reverts commit f1b68e8ddc1c02c29af0513aab38f1a2ecea0454. Signed-off-by: Jukka Rissanen --- include/zephyr/storage/stream_flash.h | 9 --------- subsys/storage/stream/stream_flash.c | 5 ----- 2 files changed, 14 deletions(-) diff --git a/include/zephyr/storage/stream_flash.h b/include/zephyr/storage/stream_flash.h index 6be67896013..5a1e096e6d1 100644 --- a/include/zephyr/storage/stream_flash.h +++ b/include/zephyr/storage/stream_flash.h @@ -106,15 +106,6 @@ int stream_flash_init(struct stream_flash_ctx *ctx, const struct device *fdev, */ size_t stream_flash_bytes_written(const struct stream_flash_ctx *ctx); -/** - * @brief Read number of bytes buffered for the next flash write. - * - * @param ctx context - * - * @return Number of payload bytes buffered for the next flash write. - */ -size_t stream_flash_bytes_buffered(const struct stream_flash_ctx *ctx); - /** * @brief Process input buffers to be written to flash device in single blocks. * Will store remainder between calls. diff --git a/subsys/storage/stream/stream_flash.c b/subsys/storage/stream/stream_flash.c index c611dde9dc4..8155ef3dfe3 100644 --- a/subsys/storage/stream/stream_flash.c +++ b/subsys/storage/stream/stream_flash.c @@ -307,11 +307,6 @@ size_t stream_flash_bytes_written(const struct stream_flash_ctx *ctx) return ctx->bytes_written; } -size_t stream_flash_bytes_buffered(const struct stream_flash_ctx *ctx) -{ - return ctx->buf_bytes; -} - #ifdef CONFIG_STREAM_FLASH_INSPECT struct _inspect_flash { size_t buf_len; From 8151b5fdee6820985d81d9777825543abe18cf2e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 052/881] Revert "[nrf fromlist] samples/smp_svr: Increase stack size required" This reverts commit 3143c022b78224f0edc1a7b3175caf92b8d01cca. Signed-off-by: Jukka Rissanen --- samples/subsys/mgmt/mcumgr/smp_svr/prj.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf b/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf index 925ac0c93a2..06a27644bac 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf +++ b/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf @@ -8,7 +8,7 @@ CONFIG_FLASH_MAP=y # Some command handlers require a large stack. CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304 -CONFIG_MAIN_STACK_SIZE=2176 +CONFIG_MAIN_STACK_SIZE=2048 # Ensure an MCUboot-compatible binary is generated. CONFIG_BOOTLOADER_MCUBOOT=y From 81ce3640bdc3726db509e1c63c6b02eb50eef961 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 053/881] Revert "[nrf fromlist] mgmt: mcumgr: grp: img_mgmt: Add support for SHA512 in images" This reverts commit 1bf6d60ee693a62e93c8c619cd7292996ae2e9f7. Signed-off-by: Jukka Rissanen --- .../include/mgmt/mcumgr/grp/img_mgmt/img_mgmt_priv.h | 8 -------- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 12 ++++++------ subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 11 ++++------- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/include/mgmt/mcumgr/grp/img_mgmt/img_mgmt_priv.h b/subsys/mgmt/mcumgr/grp/img_mgmt/include/mgmt/mcumgr/grp/img_mgmt/img_mgmt_priv.h index d584467ee2b..133a1abf054 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/include/mgmt/mcumgr/grp/img_mgmt/img_mgmt_priv.h +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/include/mgmt/mcumgr/grp/img_mgmt/img_mgmt_priv.h @@ -18,14 +18,6 @@ extern "C" { #endif -#ifdef CONFIG_MCUBOOT_BOOTLOADER_USES_SHA512 -#define IMAGE_TLV_SHA IMAGE_TLV_SHA512 -#define IMAGE_SHA_LEN 64 -#else -#define IMAGE_TLV_SHA IMAGE_TLV_SHA256 -#define IMAGE_SHA_LEN 32 -#endif - /** * @brief Ensures the spare slot (slot 1) is fully erased. * diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c index 05e3a9c6488..b53f1b21465 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -348,7 +348,7 @@ int img_mgmt_read_info(int image_slot, struct image_version *ver, uint8_t *hash, if (tlv.it_type == 0xff && tlv.it_len == 0xffff) { return IMG_MGMT_ERR_INVALID_TLV; } - if (tlv.it_type != IMAGE_TLV_SHA || tlv.it_len != IMAGE_SHA_LEN) { + if (tlv.it_type != IMAGE_TLV_SHA256 || tlv.it_len != IMAGE_HASH_LEN) { /* Non-hash TLV. Skip it. */ data_off += sizeof(tlv) + tlv.it_len; continue; @@ -362,10 +362,10 @@ int img_mgmt_read_info(int image_slot, struct image_version *ver, uint8_t *hash, data_off += sizeof(tlv); if (hash != NULL) { - if (data_off + IMAGE_SHA_LEN > data_end) { + if (data_off + IMAGE_HASH_LEN > data_end) { return IMG_MGMT_ERR_TLV_INVALID_SIZE; } - rc = img_mgmt_read(image_slot, data_off, hash, IMAGE_SHA_LEN); + rc = img_mgmt_read(image_slot, data_off, hash, IMAGE_HASH_LEN); if (rc != 0) { return rc; } @@ -408,13 +408,13 @@ int img_mgmt_find_by_hash(uint8_t *find, struct image_version *ver) { int i; - uint8_t hash[IMAGE_SHA_LEN]; + uint8_t hash[IMAGE_HASH_LEN]; for (i = 0; i < SLOTS_PER_IMAGE * CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER; i++) { if (img_mgmt_read_info(i, ver, hash, NULL) != 0) { continue; } - if (!memcmp(hash, find, IMAGE_SHA_LEN)) { + if (!memcmp(hash, find, IMAGE_HASH_LEN)) { return i; } } @@ -724,7 +724,7 @@ img_mgmt_upload_good_rsp(struct smp_streamer *ctxt) static int img_mgmt_upload_log(bool is_first, bool is_last, int status) { - uint8_t hash[IMAGE_SHA_LEN]; + uint8_t hash[IMAGE_HASH_LEN]; const uint8_t *hashp; int rc; diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index 984ed7fea27..384d0613739 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -434,11 +434,8 @@ static bool img_mgmt_state_encode_slot(struct smp_streamer *ctxt, uint32_t slot, zcbor_state_t *zse = ctxt->writer->zs; uint32_t flags; char vers_str[IMG_MGMT_VER_MAX_STR_LEN]; - uint8_t hash[IMAGE_SHA_LEN]; - struct zcbor_string zhash = { - .value = hash, - .len = IMAGE_SHA_LEN, - }; + uint8_t hash[IMAGE_HASH_LEN]; /* SHA256 hash */ + struct zcbor_string zhash = { .value = hash, .len = IMAGE_HASH_LEN }; struct image_version ver; bool ok; int rc = img_mgmt_read_info(slot, &ver, hash, &flags); @@ -782,14 +779,14 @@ img_mgmt_state_write(struct smp_streamer *ctxt) IMG_MGMT_ERR_INVALID_HASH); goto end; } - } else if (zhash.len != IMAGE_SHA_LEN) { + } else if (zhash.len != IMAGE_HASH_LEN) { /* The img_mgmt_find_by_hash does exact length compare * so just fail here. */ ok = smp_add_cmd_err(zse, MGMT_GROUP_ID_IMAGE, IMG_MGMT_ERR_INVALID_HASH); goto end; } else { - uint8_t hash[IMAGE_SHA_LEN]; + uint8_t hash[IMAGE_HASH_LEN]; memcpy(hash, zhash.value, zhash.len); From a4aed45713f5bb4e13d8591f31dd1053a65e9a7b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 054/881] Revert "[nrf fromtree] boards: nrf9280pdk: Add revision 0.2.0" This reverts commit b2b59e08ca03fe41222a3c3a6cad6fe11529b9c2. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf9280pdk/board.yml | 7 --- .../nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi | 53 ------------------- .../nrf9280pdk_nrf9280_cpuapp_0_2_0.overlay | 52 ------------------ .../nrf9280pdk_nrf9280_cpuppr_0_2_0.overlay | 7 --- .../nrf9280pdk_nrf9280_cpurad_0_2_0.overlay | 7 --- 5 files changed, 126 deletions(-) delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_0_2_0.overlay delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_0_2_0.overlay delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_0_2_0.overlay diff --git a/boards/nordic/nrf9280pdk/board.yml b/boards/nordic/nrf9280pdk/board.yml index 274b9a84a7b..2cce133d95c 100644 --- a/boards/nordic/nrf9280pdk/board.yml +++ b/boards/nordic/nrf9280pdk/board.yml @@ -9,10 +9,3 @@ board: cpucluster: cpuppr - name: iron cpucluster: cpuapp - revision: - format: major.minor.patch - default: 0.2.0 - exact: false - revisions: - - name: 0.1.0 - - name: 0.2.0 diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi deleted file mode 100644 index 41ca41e073e..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - /omit-if-no-ref/ uart135_default: uart135_default { - group1 { - psels = , - ; - }; - - group3 { - bias-pull-up; - psels = , - ; - }; - }; - - /omit-if-no-ref/ uart135_sleep: uart135_sleep { - group1 { - low-power-enable; - psels = , - , - , - ; - }; - }; - - /omit-if-no-ref/ uart136_default: uart136_default { - group1 { - psels = , - ; - }; - - group3 { - bias-pull-up; - psels = , - ; - }; - }; - - /omit-if-no-ref/ uart136_sleep: uart136_sleep { - group1 { - low-power-enable; - psels = , - , - , - ; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_0_2_0.overlay deleted file mode 100644 index 4fa3f667ead..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_0_2_0.overlay +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" - -/ { - aliases { - pwm-led0 = &pwm_led2; /* Alias for compatibility with samples that use pwm-led0 */ - }; - - leds { - compatible = "gpio-leds"; - - led0: led_0 { - gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - - led1: led_1 { - gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - - led2: led_2 { - gpios = <&gpio9 2 GPIO_ACTIVE_HIGH>; - label = "Green LED 2"; - }; - - led3: led_3 { - gpios = <&gpio9 3 GPIO_ACTIVE_HIGH>; - label = "Green LED 3"; - }; - }; - - pwmleds { - compatible = "pwm-leds"; - - /delete-node/ pwm_led_0; - - /* - * There is no valid hardware configuration to pass PWM signal on pins 0 and 1. - * First valid config is P9.2. This corresponds to LED 2. - * Signal on PWM130's channel 0 can be passed directly on GPIO Port 9 pin 2. - */ - pwm_led2: pwm_led_2 { - pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_0_2_0.overlay deleted file mode 100644 index f2d986e6cb0..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_0_2_0.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_0_2_0.overlay deleted file mode 100644 index f2d986e6cb0..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_0_2_0.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" From e9944922f6b83acd7884e058a471f82aad272528 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 055/881] Revert "[nrf fromtree] boards: nrf9280pdk: disable IEEE 802.15.4 support" This reverts commit bfbe1e06ca94859b94a2148db7a583f62dc0ac99. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 1c8622c0780..4a99911fa21 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -24,6 +24,7 @@ zephyr,flash = &mram1x; zephyr,sram = &cpuapp_data; zephyr,shell-uart = &uart136; + zephyr,ieee802154 = &cpuapp_ieee802154; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,entropy = &prng; @@ -283,6 +284,10 @@ ipc0: &cpuapp_cpurad_ipc { }; }; +&cpuapp_ieee802154 { + status = "okay"; +}; + zephyr_udc0: &usbhs { status = "okay"; }; From fefe02963563af99b5ce8cdb9c6b57dc73d5cafb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 056/881] Revert "[nrf fromtree] samples: Enable Direct XIP through sysbuild" This reverts commit 08ea5d1e78b749c8c31017b9ae0fe6b02fe590cd. Signed-off-by: Jukka Rissanen --- samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml b/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml index 4596e468207..fd6194cdc4f 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml +++ b/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml @@ -97,9 +97,9 @@ tests: # transport. Transport does not affect flags so it does not really matter which is selected, # flags should affect any transport the same way. sample.mcumgr.smp_svr.mcuboot_flags.direct_xip_withrevert: - extra_args: - - EXTRA_CONF_FILE="overlay-serial.conf" - - SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT=y + extra_args: EXTRA_CONF_FILE="overlay-serial.conf" + extra_configs: + - CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT=y platform_allow: - nrf52840dk/nrf52840 - pinnacle_100_dvk From 74d65ce126d31e2c8016c1796c0e8457e3575d32 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 057/881] Revert "[nrf fromtree] Revert "boards: nordic: nRF54L15DK: set HFXO clock latency to 854"" This reverts commit 0f36da36cf5b1bd30a2d426daa3141132352a319. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi index c030c2c5518..6740544b524 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi @@ -108,5 +108,9 @@ pinctrl-names = "default", "sleep"; }; +&hfxo { + startup-time-us = <854>; +}; + /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; From 6962d20dc22a8c3e5a4a1b4389865434d17aeb26 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:57 +0300 Subject: [PATCH 058/881] Revert "[nrf fromtree] flash: spi_nor: Fix VLA error when building with clang" This reverts commit 620baa90b08d140b0852eab72affcb8197e70b19. Signed-off-by: Jukka Rissanen --- drivers/flash/spi_nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/flash/spi_nor.c b/drivers/flash/spi_nor.c index b235c166f37..383a6065394 100644 --- a/drivers/flash/spi_nor.c +++ b/drivers/flash/spi_nor.c @@ -1376,7 +1376,7 @@ static int spi_nor_process_sfdp(const struct device *dev) if (id == JESD216_SFDP_PARAM_ID_BFP) { union { - uint32_t dw[20]; + uint32_t dw[MIN(php->len_dw, 20)]; struct jesd216_bfp bfp; } u_param; const struct jesd216_bfp *bfp = &u_param.bfp; From ed3747499e856cc345f4073670c57fd689610129 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 059/881] Revert "[nrf fromtree] drivers: adc: adc_nrfx_saadc: add nRF54LS05B analog pins" This reverts commit 886cc3ddf15affe198ee2e0908f09068a9eaf42e. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 06035e2c3c5..61497326174 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -76,13 +76,6 @@ static const uint32_t saadc_psels[NRF_SAADC_AIN7 + 1] = { [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), }; -#elif defined(NRF54LS05B_ENGA_XXAA) -static const uint32_t saadc_psels[NRF_SAADC_AIN3 + 1] = { - [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), -}; #endif #else From be931b31e37644247a20ca3dd4cd2e0661352b83 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 060/881] Revert "[nrf fromtree] soc: nordic: nrf54l: remove redundant inclusion of GLITCHDET" This reverts commit e53ffc9c2a33e81597f021a5e8459dbb6cabcf72. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54l/soc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54l/soc.c b/soc/nordic/nrf54l/soc.c index 76225d70ab7..85043985e51 100644 --- a/soc/nordic/nrf54l/soc.c +++ b/soc/nordic/nrf54l/soc.c @@ -29,6 +29,7 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); !defined(__ZEPHYR__) #include +#include #include #include #include From fe629c8518e15113d5e66851fc6b9cc021d521c8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 061/881] Revert "[nrf fromtree] manifest: update hal_nordic revision to integrate nrfx 3.14.0" This reverts commit 70886df2617f6620f9c38159ee36d702b78f8f1a. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 17e5d7cf22d..b8e6b93699e 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 54f33f10a0b826174fb145f155afa61ce5a44b93 + revision: a6579483deb33112cc763d05a4a3f8085883c1ac path: modules/hal/nordic groups: - hal From 675c3e1df323830709ecfe1e6a2bd76bae0672e9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 062/881] Revert "[nrf fromlist] manifest: tf-m-tests: bring in fix for TF-M 2.2.0" This reverts commit b48a1f26ef887cee5f3c20ee04c1b1db7f43f226. Signed-off-by: Jukka Rissanen --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 8e8d7904ac5..567f38b7a0e 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -41,7 +41,7 @@ manifest: groups: - optional - name: tf-m-tests - revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 + revision: a286347e6a5dd37a9a5e960450ffc0260d63fb27 path: modules/tee/tf-m/tf-m-tests remote: upstream groups: From 95e37b53b36b25d743aa6791cf189401149835a5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 063/881] Revert "[nrf fromtree] modules: trusted-firmware-m: Update in interface implementation" This reverts commit 143520e2b5171f3ec84c6cdf6223adc72b36fcba. Signed-off-by: Jukka Rissanen --- modules/trusted-firmware-m/interface/interface.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/trusted-firmware-m/interface/interface.c b/modules/trusted-firmware-m/interface/interface.c index 027985b9e9b..abff7efdc72 100644 --- a/modules/trusted-firmware-m/interface/interface.c +++ b/modules/trusted-firmware-m/interface/interface.c @@ -53,17 +53,13 @@ int32_t tfm_ns_interface_dispatch(veneer_fn fn, #endif } -#if defined(CONFIG_FPU_SHARING) struct fpu_ctx_full context_buffer; z_arm_save_fp_context(&context_buffer); -#endif result = fn(arg0, arg1, arg2, arg3); -#if defined(CONFIG_FPU_SHARING) z_arm_restore_fp_context(&context_buffer); -#endif if (!isr_mode) { #if !defined(CONFIG_ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS) From 280ff6fc59975305e0558a266f260c0d481d276f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 064/881] Revert "[nrf fromtree] arch: arm: cortex_m: Modifed FPU save and restore helpers" This reverts commit d9746f46a002b97126e4ff963d0df8dd9cea19c4. Signed-off-by: Jukka Rissanen --- arch/arm/core/cortex_m/fpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/core/cortex_m/fpu.c b/arch/arm/core/cortex_m/fpu.c index 0b8499afd6e..b937d725c28 100644 --- a/arch/arm/core/cortex_m/fpu.c +++ b/arch/arm/core/cortex_m/fpu.c @@ -16,7 +16,7 @@ void z_arm_save_fp_context(struct fpu_ctx_full *buffer) { -#if defined(CONFIG_FPU) +#if defined(CONFIG_FPU_SHARING) __ASSERT_NO_MSG(buffer != NULL); uint32_t CONTROL = __get_CONTROL(); @@ -44,7 +44,7 @@ void z_arm_save_fp_context(struct fpu_ctx_full *buffer) void z_arm_restore_fp_context(const struct fpu_ctx_full *buffer) { -#if defined(CONFIG_FPU) +#if defined(CONFIG_FPU_SHARING) if (buffer->ctx_saved) { /* Set FPCA first so it is set even if an interrupt happens * during restoration. From 596dec448c3db283f18062787e095434e3efa987 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 065/881] Revert "[nrf fromtree] tf-m: build: Treat warnings as errors" This reverts commit 5b5eafa8b75d9e881431e5d37436eccd79fd47eb. Signed-off-by: Jukka Rissanen --- modules/trusted-firmware-m/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 5e066130b26..c76812198a3 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -26,11 +26,6 @@ if (CONFIG_BUILD_WITH_TFM) endif() endif() - # Treat any warning as error - if (CONFIG_COMPILER_WARNINGS_AS_ERRORS) - list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_WARNINGS_ARE_ERRORS:BOOL=ON) - endif() - if (CONFIG_TFM_SFN) list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="SFN") else() # CONFIG_TFM_IPC From d4d64a5cc5141800f1a25b17ab9d224f93fb8ad7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 066/881] Revert "[nrf fromtree] samples: tfm: tfm_psa_test: Add temporary isolation workaround" This reverts commit 82dae59317f083e90a3323a09ea567e0bd1be37f. Signed-off-by: Jukka Rissanen --- samples/tfm_integration/tfm_psa_test/CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/samples/tfm_integration/tfm_psa_test/CMakeLists.txt b/samples/tfm_integration/tfm_psa_test/CMakeLists.txt index 8b05afab3aa..03f55dccad1 100644 --- a/samples/tfm_integration/tfm_psa_test/CMakeLists.txt +++ b/samples/tfm_integration/tfm_psa_test/CMakeLists.txt @@ -63,17 +63,6 @@ set_property(TARGET zephyr_property_target -DTEST_PSA_API=${TEST_PSA_API} ) -# Workaround: The TF-M tests require the large TF-M profile because it supports -# the full list of crypto algorithms needed, not because of the isolation level. -# For the TF-M tests the isolation level is irrelevant so we set it to 2 here so -# that we don't exclude the platforms which don't support the isolation level 3. -# This is a short lived workaround because the TF-M cmake logic will do this workaround -# automatically in the future. -set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS - -DTFM_ISOLATION_LEVEL=2 -) - include(ExternalProject) ExternalProject_Add(tfm_psa_arch_test_app From 5879aad5a5e0a335ba067f84f1aeb52a3c9d3320 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 067/881] Revert "[nrf fromtree] samples: tfm_psa_test: Set TFM_PROFILE" This reverts commit e3c8913c84e967527b184e0de20c6ee05c9b350d. Signed-off-by: Jukka Rissanen --- samples/tfm_integration/tfm_psa_test/prj.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/tfm_integration/tfm_psa_test/prj.conf b/samples/tfm_integration/tfm_psa_test/prj.conf index ba515d542c8..bab1254229d 100644 --- a/samples/tfm_integration/tfm_psa_test/prj.conf +++ b/samples/tfm_integration/tfm_psa_test/prj.conf @@ -5,7 +5,7 @@ # CONFIG_BUILD_WITH_TFM=y -CONFIG_TFM_PROFILE_TYPE_LARGE=y +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y CONFIG_TFM_USE_NS_APP=y CONFIG_QEMU_ICOUNT_SHIFT=1 From 55f091d8241ed5994f9893b35cd9c36d818c917b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 068/881] Revert "[nrf fromtree] tfm-tests: Bump tests to tfm-2.2.0" This reverts commit 3b39377992b19c8eddf0b4322e15a69d2f25c16e. Signed-off-by: Jukka Rissanen --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 567f38b7a0e..af2d68d0ef5 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -41,7 +41,7 @@ manifest: groups: - optional - name: tf-m-tests - revision: a286347e6a5dd37a9a5e960450ffc0260d63fb27 + revision: c712761dd5391bf3f38033643d28a736cae89a19 path: modules/tee/tf-m/tf-m-tests remote: upstream groups: From c72095cd0b969a726a9a2b84ba4c1ac46bf081d4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 069/881] Revert "[nrf fromtree] drivers: nrf_wifi: Disable VHT capabilities for softAP mode" This reverts commit 6e68865b19e49b0bc62215b4b1c7f5401422cccd. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index faaddd770c3..21f7600ca80 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1578,7 +1578,6 @@ enum nrf_wifi_status nrf_wifi_parse_sband( band->ht_cap.wpa_supp_ampdu_factor = event->ht_cap.nrf_wifi_ampdu_factor; band->ht_cap.wpa_supp_ampdu_density = event->ht_cap.nrf_wifi_ampdu_density; -#ifndef CONFIG_WIFI_NM_WPA_SUPPLICANT_AP band->vht_cap.wpa_supp_vht_supported = event->vht_cap.nrf_wifi_vht_supported; band->vht_cap.wpa_supp_cap = event->vht_cap.nrf_wifi_cap; @@ -1586,7 +1585,6 @@ enum nrf_wifi_status nrf_wifi_parse_sband( band->vht_cap.vht_mcs.rx_highest = event->vht_cap.vht_mcs.rx_highest; band->vht_cap.vht_mcs.tx_mcs_map = event->vht_cap.vht_mcs.tx_mcs_map; band->vht_cap.vht_mcs.tx_highest = event->vht_cap.vht_mcs.tx_highest; -#endif /* !CONFIG_WIFI_NM_WPA_SUPPLICANT_AP */ band->band = event->band; From 371d07670b411c09fbd45c69ae25f68c47d60de0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 070/881] Revert "[nrf fromtree] drivers: i2s: nrf_tdm: Allow using 8 channels" This reverts commit 7b7000067d43780fd2217d3ee536d7fe0740fcec. Signed-off-by: Jukka Rissanen --- drivers/i2s/i2s_nrf_tdm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index 45e5b3d1804..c65edb2717b 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -30,10 +30,6 @@ LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); */ #define NRFX_TDM_STATUS_TRANSFER_STOPPED BIT(1) -/* Maximum clock divider value. Corresponds to CKDIV2. */ -#define NRFX_TDM_MAX_SCK_DIV_VALUE TDM_CONFIG_SCK_DIV_SCKDIV_Max -#define NRFX_TDM_MAX_MCK_DIV_VALUE TDM_CONFIG_MCK_DIV_DIV_Max - #define NRFX_TDM_NUM_OF_CHANNELS (TDM_CONFIG_CHANNEL_NUM_NUM_Max + 1) #define NRFX_TDM_TX_CHANNELS_MASK \ @@ -818,11 +814,11 @@ static int trigger_start(const struct device *dev) nrf_tdm_sck_configure(drv_cfg->p_reg, drv_cfg->sck_src == ACLK ? NRF_TDM_SRC_ACLK : NRF_TDM_SRC_PCLK32M, - nrfx_cfg->sck_setup > NRFX_TDM_MAX_SCK_DIV_VALUE); + false); nrf_tdm_mck_configure(drv_cfg->p_reg, drv_cfg->mck_src == ACLK ? NRF_TDM_SRC_ACLK : NRF_TDM_SRC_PCLK32M, - nrfx_cfg->mck_setup > NRFX_TDM_MAX_MCK_DIV_VALUE); + false); /* If it is required to use certain HF clock, request it to be running * first. If not, start the transfer directly. */ From e058580ed695127b5a38633af6fcdd9952ddc7d7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 071/881] Revert "[nrf fromtree] modules: Add VID and CID Kconfigs" This reverts commit 94a6f0d75715310e3c3c808118335ba8e00818af. Signed-off-by: Jukka Rissanen --- cmake/mcuboot.cmake | 8 -------- modules/Kconfig.mcuboot | 34 ---------------------------------- 2 files changed, 42 deletions(-) diff --git a/cmake/mcuboot.cmake b/cmake/mcuboot.cmake index 6562193725d..964d694983b 100644 --- a/cmake/mcuboot.cmake +++ b/cmake/mcuboot.cmake @@ -124,14 +124,6 @@ function(zephyr_mcuboot_tasks) set(imgtool_args --key "${keyfile}" ${imgtool_args}) endif() - if(CONFIG_MCUBOOT_IMGTOOL_UUID_VID) - set(imgtool_args ${imgtool_args} --vid "${CONFIG_MCUBOOT_IMGTOOL_UUID_VID_NAME}") - endif() - - if(CONFIG_MCUBOOT_IMGTOOL_UUID_CID) - set(imgtool_args ${imgtool_args} --cid "${CONFIG_MCUBOOT_IMGTOOL_UUID_CID_NAME}") - endif() - if(CONFIG_MCUBOOT_IMGTOOL_OVERWRITE_ONLY) # Use overwrite-only instead of swap upgrades. set(imgtool_args --overwrite-only --align 1 ${imgtool_args}) diff --git a/modules/Kconfig.mcuboot b/modules/Kconfig.mcuboot index b4d7f517335..d6b4465de2d 100644 --- a/modules/Kconfig.mcuboot +++ b/modules/Kconfig.mcuboot @@ -120,40 +120,6 @@ config MCUBOOT_IMGTOOL_OVERWRITE_ONLY If enabled, --overwrite-only option passed to imgtool to avoid adding the swap status area size when calculating overflow. -config MCUBOOT_IMGTOOL_UUID_VID - bool "Append vendor unique identifier TLV" - help - If enabled, --vid option passed to imgtool with the value set by - the MCUBOOT_IMGTOOL_UUID_VID_NAME option. - -config MCUBOOT_IMGTOOL_UUID_VID_NAME - string "Vendor UUID" - depends on MCUBOOT_IMGTOOL_UUID_VID - help - The vendor unique identifier. - The following formats are supported: - - Domain name (i.e. amce.corp) - - Raw UUID (i.e. 12345678-1234-5678-1234-567812345678) - - Raw HEX UUID (i.e. 12345678123456781234567812345678) - -config MCUBOOT_IMGTOOL_UUID_CID - bool "Append image class unique identifier TLV" - help - If enabled, --cid option passed to imgtool with the value set by - the MCUBOOT_IMGTOOL_UUID_CID_NAME option. - -config MCUBOOT_IMGTOOL_UUID_CID_NAME - string "Image class UUID" - depends on MCUBOOT_IMGTOOL_UUID_CID - help - The image class unique identifier. - The following formats are supported: - - Image class name (i.e. nRF5340_door_lock_btperipheral). - This format requires MCUBOOT_IMGTOOL_UUID_VID_NAME to be defined - as the VID UUID is used as the namespace for image class UUID. - - Raw UUID (i.e. 12345678-1234-5678-1234-567812345678) - - Raw HEX UUID (i.e. 12345678123456781234567812345678) - config MCUBOOT_EXTRA_IMGTOOL_ARGS string "Extra arguments to pass to imgtool when signing" default "" From 573395f224bbf65474c5dce5cd603f2075c67547 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 072/881] Revert "[nrf fromlist] tests: drivers: clock_control_api: fix Kconfig logic" This reverts commit 64061358cc5d25b97af613202397dec7256f3271. Signed-off-by: Jukka Rissanen --- tests/drivers/clock_control/clock_control_api/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/clock_control/clock_control_api/Kconfig b/tests/drivers/clock_control/clock_control_api/Kconfig index 9315f3e337b..dc1e976d824 100644 --- a/tests/drivers/clock_control/clock_control_api/Kconfig +++ b/tests/drivers/clock_control/clock_control_api/Kconfig @@ -3,7 +3,7 @@ config TEST_NRF_HF_STARTUP_TIME_US int "Delay required for HF clock startup." - default 3000 if SOC_SERIES_NRF91X + default 3000 if CONFIG_SOC_SERIES_NRF91X default 500 depends on SOC_FAMILY_NORDIC_NRF help From 9965852a1612a35adce864793bd92282149213dc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 073/881] Revert "[nrf fromtree] soc: nordic: nrf54l: make SWO available" This reverts commit a9c15a8b8d74a49a0864cb95f6a1bb41f5141599. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54l/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index da178141478..bc88a62efb7 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -22,7 +22,6 @@ config SOC_NRF54L_CPUAPP_COMMON select HAS_HW_NRF_RADIO_IEEE802154 select HAS_POWEROFF select HAS_NORDIC_RAM_CTRL - select HAS_SWO config SOC_NRF54L05_CPUAPP select SOC_NRF54L_CPUAPP_COMMON From 830c64e855243cee8df06b65ec2a1d525af30c6f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 074/881] Revert "[nrf noup] doc: extensions: kconfig: Add SoC sysbuild Kconfigs" This reverts commit 1d73d0e3cb5ff37fd53c103bb49c1e9b92be75c5. Signed-off-by: Jukka Rissanen --- doc/_extensions/zephyr/kconfig/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index dfb7a567da8..eb1903b1898 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -106,9 +106,6 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d for folder in soc_folders: f.write('source "' + (Path(folder) / 'Kconfig.soc').as_posix() + '"\n') - if "nordic" in folder: - f.write('osource "' + (Path(folder) / 'Kconfig.sysbuild').as_posix() + '"\n') - with open(Path(td) / "soc" / "Kconfig", "w") as f: for folder in soc_folders: f.write('osource "' + (Path(folder) / 'Kconfig').as_posix() + '"\n') From 7f74ccbb7dd737644acc98de92f0d644dd83d038 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:58 +0300 Subject: [PATCH 075/881] Revert "[nrf fromtree] driver: nrf_wifi: TWT setup duration" This reverts commit d4d69a4a781859dd8691633988b6b8816b653dc9. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 10 ---------- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 1 - 2 files changed, 11 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 9b37c302872..4b3bb0d41ca 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -934,14 +934,4 @@ config NRF_WIFI_DYNAMIC_ED help This option enables support for proprietary algorithm to enhance performance in high-traffic channels. - -config NRF_WIFI_TWT_SETUP_TIMEOUT_MS - int "TWT setup timeout (ms)" - range 100 10000 - default 250 - help - Timeout duration (in milliseconds) for the TWT setup procedure. - The STA will transmit a TWT setup request every 100 milliseconds, - continuing until this timeout value is reached. If no response is - received before the timeout expires, the TWT setup is considered failed. endif # WIFI_NRF70 diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index e48ae31734a..e9755e80013 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -564,7 +564,6 @@ int nrf_wifi_set_twt(const struct device *dev, twt_info.dialog_token = twt_params->dialog_token; twt_info.twt_wake_ahead_duration = twt_params->setup.twt_wake_ahead_duration; - twt_info.twt_req_timeout = CONFIG_NRF_WIFI_TWT_SETUP_TIMEOUT_MS; status = nrf_wifi_sys_fmac_twt_setup(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, From bd136052d0f558ff24b0db85e928d43865b3beee Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 076/881] Revert "[nrf fromtree] manifest: Update nrf_wifi revision to fix raw tx" This reverts commit 93c862443b731d8668d31e476c0552db5bf3095b. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index b8e6b93699e..4d20267c8b4 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 5fffeab6496932abb10f9dae53ed3686967aa050 + revision: 787eea1a3c8dd13c86214e204a919e6f9bcebf91 path: modules/lib/nrf_wifi - name: open-amp revision: f7f4d083c7909a39d86e217376c69b416ec4faf3 From 057629a0e51d649d991ccde45626feb53942502a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 077/881] Revert "[nrf fromlist] tests: drivers: timer: nrf_grtc_timer: wait for coverage dump" This reverts commit 103b06acfc2bf2d3c1f6414e5c3448e74d477ae6. Signed-off-by: Jukka Rissanen --- tests/drivers/timer/nrf_grtc_timer/src/main.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index 7e2b440a9aa..9de554256b4 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -393,13 +393,6 @@ static void grtc_stress_test(bool busy_sim_en) if (counter_dev) { counter_stop(counter_dev); } - -#ifdef CONFIG_COVERAGE - /* Wait a few seconds before exit, giving the test the - * opportunity to dump some output before coverage data gets emitted - */ - k_sleep(K_MSEC(5000)); -#endif } ZTEST(nrf_grtc_timer, test_stress) From 7dc0f9c4eb3468bb4943c567a91bedc523040ea1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 078/881] Revert "[nrf noup] soc: nrf54h: work around missing power domain handling" This reverts commit 20d89eb11a79ec9ca6ee80372af2a725028765ac. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/Kconfig | 5 ----- soc/nordic/nrf54h/soc.c | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index b117ee45ad8..e227a299910 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -95,11 +95,6 @@ config SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR help Verify that VTOR is not 0xFFFFFFFF before booting the Radiocore. -config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND - bool "Disable all GPIO pin retention on boot" - default y - depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD - config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 7c3bc65768f..a3f67711e45 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -14,7 +14,6 @@ #include #endif -#include #include #include #include @@ -174,17 +173,6 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } - - /* This is a workaround for not yet having upstream patches for properly handling - * pin retention. It should be removed as part of the next upmerge. - */ - if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) { - NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST; - - for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) { - nrf_gpio_port_retain_set(gpio_regs[i], 0); - } - } } #if defined(CONFIG_SOC_LATE_INIT_HOOK) From 4dd4e7603919a6a5b38b707940c3b02dd5148438 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 079/881] Revert "[nrf fromlist] soc: nordic: nrf54h: turn off NRFS DVFS service" This reverts commit 59e68646df7213ce3e782f781fdb872cfdc42f7d. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index e227a299910..56b64f293ba 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -28,6 +28,7 @@ config SOC_NRF54H20_CPUAPP_COMMON select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select NRFS_HAS_AUDIOPLL_SERVICE select NRFS_HAS_CLOCK_SERVICE + select NRFS_HAS_DVFS_SERVICE select NRFS_HAS_GDFS_SERVICE select NRFS_HAS_GDPWR_SERVICE select NRFS_HAS_MRAM_SERVICE From 36f9161d29956836f22ac81af47530f7e687201a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 080/881] Revert "[nrf fromtree] drivers: clock control: ironside dvfs hsfll" This reverts commit f4f709d6ba80666656e87fb2428d23bac9cc3698. Signed-off-by: Jukka Rissanen --- drivers/clock_control/CMakeLists.txt | 1 - drivers/clock_control/Kconfig.nrf | 20 -- .../clock_control_nrf_iron_hsfll_local.c | 244 ------------------ .../clock/nordic,nrf-iron-hsfll-local.yaml | 59 ----- dts/vendor/nordic/nrf54h20.dtsi | 2 +- .../nrf_clock_control/src/main.c | 3 +- 6 files changed, 2 insertions(+), 327 deletions(-) delete mode 100644 drivers/clock_control/clock_control_nrf_iron_hsfll_local.c delete mode 100644 dts/bindings/clock/nordic,nrf-iron-hsfll-local.yaml diff --git a/drivers/clock_control/CMakeLists.txt b/drivers/clock_control/CMakeLists.txt index 59e7e3e3026..0bf5e0075eb 100644 --- a/drivers/clock_control/CMakeLists.txt +++ b/drivers/clock_control/CMakeLists.txt @@ -53,7 +53,6 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF2_COMMON clock_cont zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_FLL16M clock_control_nrf_fll16m.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF54H_HFXO clock_control_nrf54h_hfxo.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL clock_control_nrf_hsfll_local.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL clock_control_nrf_iron_hsfll_local.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_LFCLK clock_control_nrf_lfclk.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_AUXPLL clock_control_nrf_auxpll.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_BOUFFALOLAB_BL60X clock_control_bl60x.c) diff --git a/drivers/clock_control/Kconfig.nrf b/drivers/clock_control/Kconfig.nrf index 53f03cf6bcd..a7c1be10a12 100644 --- a/drivers/clock_control/Kconfig.nrf +++ b/drivers/clock_control/Kconfig.nrf @@ -282,26 +282,6 @@ config CLOCK_CONTROL_NRF_HSFLL_LOCAL_NRFS_DVFS_TIMEOUT_MS endif # CLOCK_CONTROL_NRF_HSFLL_LOCAL -config CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL - bool "NRF IronSide HSFLL LOCAL driver support" - depends on DT_HAS_NORDIC_NRF_IRON_HSFLL_LOCAL_ENABLED - select NRF_IRONSIDE_DVFS_SERVICE - select CLOCK_CONTROL_NRF2_COMMON - default y - -if CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL - -config CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_REQ_LOW_FREQ - bool "Local domain scale down after init" - help - Request the lowest operating point after DVFS initialization. - -config CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_DVFS_TIMEOUT_MS - int "Timeout waiting for dvfs request to complete" - default 2000 - -endif # CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL - config CLOCK_CONTROL_NRF_LFCLK bool "NRF LFCLK driver support" depends on DT_HAS_NORDIC_NRF_LFCLK_ENABLED diff --git a/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c b/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c deleted file mode 100644 index ba4e2a3f6be..00000000000 --- a/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf_iron_hsfll_local - -#include "clock_control_nrf2_common.h" -#include -#include - -#include -LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); - -BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, "multiple instances not supported"); - -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE -#include - -#define HSFLL_FREQ_LOW MHZ(64) -#define HSFLL_FREQ_MEDLOW MHZ(128) -#define HSFLL_FREQ_HIGH MHZ(320) - -#define IRONSIDE_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_DVFS_TIMEOUT_MS) - -/* Clock options sorted from lowest to highest frequency */ -static const struct clock_options { - uint32_t frequency; - enum ironside_dvfs_oppoint setting; -} clock_options[] = { - { - .frequency = HSFLL_FREQ_LOW, - .setting = IRONSIDE_DVFS_OPP_LOW, - }, - { - .frequency = HSFLL_FREQ_MEDLOW, - .setting = IRONSIDE_DVFS_OPP_MEDLOW, - }, - { - .frequency = HSFLL_FREQ_HIGH, - .setting = IRONSIDE_DVFS_OPP_HIGH, - }, -}; - -struct hsfll_dev_data { - STRUCT_CLOCK_CONFIG(hsfll, ARRAY_SIZE(clock_options)) clk_cfg; - struct k_timer timer; -}; - -static void hsfll_update_timeout_handler(struct k_timer *timer) -{ - struct hsfll_dev_data *dev_data = CONTAINER_OF(timer, struct hsfll_dev_data, timer); - - clock_config_update_end(&dev_data->clk_cfg, -ETIMEDOUT); -} - -static void hsfll_work_handler(struct k_work *work) -{ - struct hsfll_dev_data *dev_data = CONTAINER_OF(work, struct hsfll_dev_data, clk_cfg.work); - enum ironside_dvfs_oppoint required_setting; - uint8_t to_activate_idx; - int rc; - - to_activate_idx = clock_config_update_begin(work); - required_setting = clock_options[to_activate_idx].setting; - - k_timer_start(&dev_data->timer, IRONSIDE_DVFS_TIMEOUT, K_NO_WAIT); - - /* Request the DVFS service to change the OPP point. */ - rc = ironside_dvfs_change_oppoint(required_setting); - k_timer_stop(&dev_data->timer); - clock_config_update_end(&dev_data->clk_cfg, rc); -} - -static int hsfll_resolve_spec_to_idx(const struct nrf_clock_spec *req_spec) -{ - uint32_t req_frequency; - - if (req_spec->accuracy || req_spec->precision) { - LOG_ERR("invalid specification of accuracy or precision"); - return -EINVAL; - } - - req_frequency = req_spec->frequency == NRF_CLOCK_CONTROL_FREQUENCY_MAX - ? HSFLL_FREQ_HIGH - : req_spec->frequency; - - for (int i = 0; i < ARRAY_SIZE(clock_options); ++i) { - if (req_frequency > clock_options[i].frequency) { - continue; - } - - return i; - } - - LOG_ERR("invalid frequency"); - return -EINVAL; -} - -static void hsfll_get_spec_by_idx(uint8_t idx, struct nrf_clock_spec *spec) -{ - spec->frequency = clock_options[idx].frequency; - spec->accuracy = 0; - spec->precision = 0; -} - -static struct onoff_manager *hsfll_get_mgr_by_idx(const struct device *dev, uint8_t idx) -{ - struct hsfll_dev_data *dev_data = dev->data; - - return &dev_data->clk_cfg.onoff[idx].mgr; -} - -static struct onoff_manager *hsfll_find_mgr_by_spec(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - int idx; - - if (!spec) { - return hsfll_get_mgr_by_idx(dev, 0); - } - - idx = hsfll_resolve_spec_to_idx(spec); - return idx < 0 ? NULL : hsfll_get_mgr_by_idx(dev, idx); -} -#endif /* CONFIG_NRF_IRONSIDE_DVFS_SERVICE */ - -static int api_request_hsfll(const struct device *dev, const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE - struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); - - if (mgr) { - return clock_config_request(mgr, cli); - } - - return -EINVAL; -#else - return -ENOTSUP; -#endif -} - -static int api_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec) -{ -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE - struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); - - if (mgr) { - return onoff_release(mgr); - } - - return -EINVAL; -#else - return -ENOTSUP; -#endif -} - -static int api_cancel_or_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE - struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); - - if (mgr) { - return onoff_cancel_or_release(mgr, cli); - } - - return -EINVAL; -#else - return -ENOTSUP; -#endif -} - -static int api_resolve_hsfll(const struct device *dev, const struct nrf_clock_spec *req_spec, - struct nrf_clock_spec *res_spec) -{ -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE - int idx; - - idx = hsfll_resolve_spec_to_idx(req_spec); - if (idx < 0) { - return -EINVAL; - } - - hsfll_get_spec_by_idx(idx, res_spec); - return 0; -#else - return -ENOTSUP; -#endif -} - -static int hsfll_init(const struct device *dev) -{ -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE - struct hsfll_dev_data *dev_data = dev->data; - int rc; - - rc = clock_config_init(&dev_data->clk_cfg, ARRAY_SIZE(dev_data->clk_cfg.onoff), - hsfll_work_handler); - if (rc < 0) { - return rc; - } - - k_timer_init(&dev_data->timer, hsfll_update_timeout_handler, NULL); - -#endif - - return 0; -} - -static DEVICE_API(nrf_clock_control, hsfll_drv_api) = { - .std_api = { - .on = api_nosys_on_off, - .off = api_nosys_on_off, - }, - .request = api_request_hsfll, - .release = api_release_hsfll, - .cancel_or_release = api_cancel_or_release_hsfll, - .resolve = api_resolve_hsfll, -}; - -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE -static struct hsfll_dev_data hsfll_data; -#endif - -#ifdef CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_REQ_LOW_FREQ -static int dvfs_low_init(void) -{ - static const k_timeout_t timeout = IRONSIDE_DVFS_TIMEOUT; - static const struct device *hsfll_dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(DT_NODELABEL(cpu))); - static const struct nrf_clock_spec clk_spec = {.frequency = HSFLL_FREQ_LOW}; - - return nrf_clock_control_request_sync(hsfll_dev, &clk_spec, timeout); -} - -SYS_INIT(dvfs_low_init, APPLICATION, 0); -#endif - -DEVICE_DT_INST_DEFINE(0, hsfll_init, NULL, - COND_CODE_1(CONFIG_NRF_IRONSIDE_DVFS_SERVICE, - (&hsfll_data), - (NULL)), NULL, PRE_KERNEL_1, - CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &hsfll_drv_api); diff --git a/dts/bindings/clock/nordic,nrf-iron-hsfll-local.yaml b/dts/bindings/clock/nordic,nrf-iron-hsfll-local.yaml deleted file mode 100644 index 65769fb107f..00000000000 --- a/dts/bindings/clock/nordic,nrf-iron-hsfll-local.yaml +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic nRF local HSFLL with IronSide DVFS support - - The local HSFLL mixed-mode IP generates several clock frequencies in the range - from 64 MHz to 400 MHz (in steps of 16 MHz). - - Usage example: - - hsfll: clock@deadbeef { - compatible = "nordic,nrf-hsfll-local"; - reg = <0xdeadbeef 0x1000>; - clocks = <&fll16m>; - clock-frequency = ; - nordic,ficrs = <&ficr NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_VSUP>, - <&ficr NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_COARSE_0>, - <&ficr NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_FINE_0>; - nordic,ficr-names = "vsup", "coarse", "fine"; - }; - - Required FICR entries are for VSUP, COARSE and FINE trim values. - -compatible: "nordic,nrf-iron-hsfll-local" - -include: [base.yaml, fixed-clock.yaml, nordic-nrf-ficr-client.yaml] - -properties: - reg: - required: true - - clocks: - required: true - - clock-frequency: - enum: - - 64000000 - - 80000000 - - 96000000 - - 112000000 - - 128000000 - - 144000000 - - 160000000 - - 176000000 - - 192000000 - - 208000000 - - 224000000 - - 240000000 - - 256000000 - - 272000000 - - 288000000 - - 304000000 - - 320000000 - - 336000000 - - 352000000 - - 368000000 - - 384000000 - - 400000000 diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index d06cbde97e0..68884b8a567 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -268,7 +268,7 @@ ranges = <0x0 0x52000000 0x1000000>; cpuapp_hsfll: clock@d000 { - compatible = "nordic,nrf-iron-hsfll-local"; + compatible = "nordic,nrf-hsfll-local"; #clock-cells = <0>; reg = <0xd000 0x1000>; clocks = <&fll16m>; diff --git a/tests/drivers/clock_control/nrf_clock_control/src/main.c b/tests/drivers/clock_control/nrf_clock_control/src/main.c index 83fdc98ca19..395e6a0fc00 100644 --- a/tests/drivers/clock_control/nrf_clock_control/src/main.c +++ b/tests/drivers/clock_control/nrf_clock_control/src/main.c @@ -17,8 +17,7 @@ struct test_clk_context { size_t clk_specs_size; }; -#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL) || \ - defined(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL) +#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL) const struct nrf_clock_spec test_clk_specs_hsfll[] = { { .frequency = MHZ(128), From f17dcf3326696b0a42194806a1e385d81dbb79e3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 081/881] Revert "[nrf fromtree] dts: treewide: fix missing use of underscores" This reverts commit 78df52b6c28124714620ed8904a302232f20be7c. Signed-off-by: Jukka Rissanen --- boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts | 2 +- boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts | 2 +- boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dtsi | 4 ++-- boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi | 4 ++-- dts/arm/silabs/siwg917.dtsi | 2 +- dts/bindings/display/solomon,ssd1309fb-spi.yaml | 2 +- dts/bindings/led/ti,lp50xx.yaml | 2 +- dts/bindings/pwm/silabs,siwx91x-pwm.yaml | 4 ++-- dts/bindings/usb/nxp,uhc-ehci.yaml | 2 +- dts/bindings/usb/nxp,uhc-ip3516hs.yaml | 2 +- dts/bindings/watchdog/nxp,ewm.yaml | 4 ++-- tests/drivers/pwm/pwm_api/boards/siwx917_rb4338a.overlay | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts b/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts index 7b6fa3e1fc3..d9d46ed50ed 100644 --- a/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts +++ b/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts @@ -138,7 +138,7 @@ zephyr_uhc1: &usbhhs { pinctrl-0 = <&pinmux_usbhhs>; pinctrl-names = "default"; status = "okay"; - phy-handle = <&usbphy1>; + phy_handle = <&usbphy1>; }; &usbphy1 { diff --git a/boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts b/boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts index 5049eec3f5f..44caca0d327 100644 --- a/boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts +++ b/boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts @@ -165,7 +165,7 @@ zephyr_uhc1: &usbhhs { pinctrl-0 = <&pinmux_usbhhs>; pinctrl-names = "default"; status = "okay"; - phy-handle = <&usbphy1>; + phy_handle = <&usbphy1>; }; &usbphy1 { diff --git a/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dtsi b/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dtsi index 15731d8bdcd..0886b2ac912 100644 --- a/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dtsi +++ b/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dtsi @@ -213,12 +213,12 @@ zephyr_udc0: &usb1 { zephyr_uhc0: &usbh1 { status = "okay"; - phy-handle = <&usbphy1>; + phy_handle = <&usbphy1>; }; zephyr_uhc1: &usbh2 { status = "okay"; - phy-handle = <&usbphy2>; + phy_handle = <&usbphy2>; }; &usbphy1 { diff --git a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi index c81d10ea18a..4143a7b6430 100644 --- a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi +++ b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi @@ -190,12 +190,12 @@ zephyr_udc0: &usb1 { zephyr_uhc0: &usbh1 { status = "okay"; - phy-handle = <&usbphy1>; + phy_handle = <&usbphy1>; }; zephyr_uhc1: &usbh2 { status = "okay"; - phy-handle = <&usbphy2>; + phy_handle = <&usbphy2>; }; &usbphy1 { diff --git a/dts/arm/silabs/siwg917.dtsi b/dts/arm/silabs/siwg917.dtsi index c1b9c2ad995..b1404f475b2 100644 --- a/dts/arm/silabs/siwg917.dtsi +++ b/dts/arm/silabs/siwg917.dtsi @@ -307,7 +307,7 @@ interrupt-names = "pwm"; clocks = <&clock0 SIWX91X_CLK_PWM>; #pwm-cells = <2>; - silabs,ch-prescaler = <64 64 64 64>; + silabs,ch_prescaler = <64 64 64 64>; status = "disabled"; }; diff --git a/dts/bindings/display/solomon,ssd1309fb-spi.yaml b/dts/bindings/display/solomon,ssd1309fb-spi.yaml index 5d58bc732fd..4a24a35d7cd 100644 --- a/dts/bindings/display/solomon,ssd1309fb-spi.yaml +++ b/dts/bindings/display/solomon,ssd1309fb-spi.yaml @@ -8,7 +8,7 @@ compatible: "solomon,ssd1309fb" include: ["solomon,ssd1306fb-common.yaml", "spi-device.yaml"] properties: - data-cmd-gpios: + data_cmd-gpios: type: phandle-array required: true description: D/C# pin. diff --git a/dts/bindings/led/ti,lp50xx.yaml b/dts/bindings/led/ti,lp50xx.yaml index 1906d8f3417..91511dbd303 100644 --- a/dts/bindings/led/ti,lp50xx.yaml +++ b/dts/bindings/led/ti,lp50xx.yaml @@ -12,7 +12,7 @@ properties: type: boolean description: | If enabled the maximum current output is set to 35 mA (25.5 mA else). - log-scale-en: + log_scale_en: type: boolean description: | If enabled a logarithmic dimming scale curve is used for LED brightness diff --git a/dts/bindings/pwm/silabs,siwx91x-pwm.yaml b/dts/bindings/pwm/silabs,siwx91x-pwm.yaml index daec68e9ed7..b8a01f2027b 100644 --- a/dts/bindings/pwm/silabs,siwx91x-pwm.yaml +++ b/dts/bindings/pwm/silabs,siwx91x-pwm.yaml @@ -12,7 +12,7 @@ properties: "#pwm-cells": const: 2 - silabs,ch-prescaler: + silabs,ch_prescaler: type: array required: true description: | @@ -26,7 +26,7 @@ properties: - 32 - 64 - silabs,pwm-polarity: + silabs,pwm_polarity: type: int required: true description: | diff --git a/dts/bindings/usb/nxp,uhc-ehci.yaml b/dts/bindings/usb/nxp,uhc-ehci.yaml index 919625da151..5f8657fe722 100644 --- a/dts/bindings/usb/nxp,uhc-ehci.yaml +++ b/dts/bindings/usb/nxp,uhc-ehci.yaml @@ -8,5 +8,5 @@ compatible: "nxp,uhc-ehci" include: [usb-controller.yaml] properties: - phy-handle: + phy_handle: type: phandle diff --git a/dts/bindings/usb/nxp,uhc-ip3516hs.yaml b/dts/bindings/usb/nxp,uhc-ip3516hs.yaml index d9ebcae8abf..d09b5b9f056 100644 --- a/dts/bindings/usb/nxp,uhc-ip3516hs.yaml +++ b/dts/bindings/usb/nxp,uhc-ip3516hs.yaml @@ -8,5 +8,5 @@ compatible: "nxp,uhc-ip3516hs" include: [usb-controller.yaml, pinctrl-device.yaml] properties: - phy-handle: + phy_handle: type: phandle diff --git a/dts/bindings/watchdog/nxp,ewm.yaml b/dts/bindings/watchdog/nxp,ewm.yaml index 69ffdf86abc..5bd1e6a36eb 100644 --- a/dts/bindings/watchdog/nxp,ewm.yaml +++ b/dts/bindings/watchdog/nxp,ewm.yaml @@ -19,13 +19,13 @@ properties: description: Watchdog clock divider required: true - input-trigger-en: + input_trigger_en: type: boolean description: | When enabled the ewm_in signal can be used to assert the ewm. - input-trigger-active-high: + input_trigger_active_high: type: boolean description: | When enabled the ewm_in signal is active high. diff --git a/tests/drivers/pwm/pwm_api/boards/siwx917_rb4338a.overlay b/tests/drivers/pwm/pwm_api/boards/siwx917_rb4338a.overlay index 02f1c9da28d..91125d52963 100644 --- a/tests/drivers/pwm/pwm_api/boards/siwx917_rb4338a.overlay +++ b/tests/drivers/pwm/pwm_api/boards/siwx917_rb4338a.overlay @@ -26,6 +26,6 @@ pwm_channel1: pwm_channel1 { pwms = <&pwm 0 1000000>; }; - silabs,pwm-polarity = ; + silabs,pwm_polarity = ; status = "okay"; }; From 316cad474add3579cff9ac6e9eecb27dc771680a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 082/881] Revert "[nrf fromtree] samples: subsys: usb: hid-keyboard: Confirm operation with console" This reverts commit c1bf4336ce6d3a1bf6007c06c9ed8142183e16d1. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/hid-keyboard/sample.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/samples/subsys/usb/hid-keyboard/sample.yaml b/samples/subsys/usb/hid-keyboard/sample.yaml index f53ae514f97..6161ff90c2c 100644 --- a/samples/subsys/usb/hid-keyboard/sample.yaml +++ b/samples/subsys/usb/hid-keyboard/sample.yaml @@ -1,17 +1,11 @@ sample: name: USB HID keyboard sample common: + harness: button filter: dt_alias_exists("sw0") and dt_alias_exists("led0") depends_on: - usbd - gpio - tags: usb - timeout: 15 - harness: console - harness_config: - type: one_line - regex: - - "HID keyboard sample is initialized" integration_platforms: - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp @@ -23,13 +17,17 @@ common: - samd21_xpro - same54_xpro tests: - sample.usbd.hid-keyboard: {} + sample.usbd.hid-keyboard: + tags: usb sample.usbd.hid-keyboard.out-report: + tags: usb extra_args: - EXTRA_DTC_OVERLAY_FILE="out_report.overlay" sample.usbd.hid-keyboard.large-report: + tags: usb extra_args: - EXTRA_DTC_OVERLAY_FILE="large_in_report.overlay" sample.usbd.hid-keyboard.large-out-report: + tags: usb extra_args: - EXTRA_DTC_OVERLAY_FILE="large_out_report.overlay" From 12bbe29b287ee8b12a7ce35fc0c6b7de037178fe Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 083/881] Revert "[nrf fromtree] boards: nordic: nrf54lm20dk: Add usbd to supported features" This reverts commit 8cd3b935a445e21c0eafa76f438472460aaf706f. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml index e5a2b89087d..765845fa27f 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml @@ -20,5 +20,4 @@ supported: - i2s - pwm - spi - - usbd - watchdog From 298d8f1703f3215da85104c8c3e5e5b7c65103d7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 084/881] Revert "[nrf fromtree] samples: usb: move the legacy code out of the USB MSC sample" This reverts commit 928f44c8941d281cb934f7db038e6592cca73411. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/legacy/mass/CMakeLists.txt | 9 -- samples/subsys/usb/legacy/mass/README.rst | 32 ----- samples/subsys/usb/legacy/mass/app.overlay | 14 --- samples/subsys/usb/legacy/mass/prj.conf | 14 --- samples/subsys/usb/legacy/mass/sample.yaml | 10 -- samples/subsys/usb/legacy/mass/src/main.c | 27 ----- samples/subsys/usb/mass/README.rst | 2 +- samples/subsys/usb/mass/prj.conf | 21 ++-- samples/subsys/usb/mass/sample.yaml | 112 ++++++++++++++---- samples/subsys/usb/mass/src/main.c | 46 ++++--- samples/subsys/usb/mass/usbd_next_prj.conf | 15 +++ 11 files changed, 149 insertions(+), 153 deletions(-) delete mode 100644 samples/subsys/usb/legacy/mass/CMakeLists.txt delete mode 100644 samples/subsys/usb/legacy/mass/README.rst delete mode 100644 samples/subsys/usb/legacy/mass/app.overlay delete mode 100644 samples/subsys/usb/legacy/mass/prj.conf delete mode 100644 samples/subsys/usb/legacy/mass/sample.yaml delete mode 100644 samples/subsys/usb/legacy/mass/src/main.c create mode 100644 samples/subsys/usb/mass/usbd_next_prj.conf diff --git a/samples/subsys/usb/legacy/mass/CMakeLists.txt b/samples/subsys/usb/legacy/mass/CMakeLists.txt deleted file mode 100644 index f80c6eb9afa..00000000000 --- a/samples/subsys/usb/legacy/mass/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(mass) - -include(${ZEPHYR_BASE}/samples/subsys/usb/common/common.cmake) -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/samples/subsys/usb/legacy/mass/README.rst b/samples/subsys/usb/legacy/mass/README.rst deleted file mode 100644 index 8e3ae5319df..00000000000 --- a/samples/subsys/usb/legacy/mass/README.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. zephyr:code-sample:: legacy-usb-mass - :name: Legacy USB Mass Storage - :relevant-api: _usb_device_core_api - - Expose board's RAM as a USB disk using USB Mass Storage driver. - -Overview -******** - -This sample app demonstrates use of a USB Mass Storage driver by the Zephyr -project. This very simple driver enumerates a board with RAM disk into an USB -disk. This sample can be found under -:zephyr_file:`samples/subsys/usb/legacy/mass` in the Zephyr project tree. - -.. note:: - This samples demonstrate deprecated :ref:`usb_device_stack`. - -Requirements -************ - -This project requires a USB device driver, and either 96KiB of RAM or a FLASH device. - -Building and Running -******************** - -The configurations selects RAM-based disk without any file system. - -.. zephyr-app-commands:: - :zephyr-app: samples/subsys/usb/legacy/mass - :board: reel_board - :goals: build - :compact: diff --git a/samples/subsys/usb/legacy/mass/app.overlay b/samples/subsys/usb/legacy/mass/app.overlay deleted file mode 100644 index ff09a0f8ca7..00000000000 --- a/samples/subsys/usb/legacy/mass/app.overlay +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - ramdisk0 { - compatible = "zephyr,ram-disk"; - disk-name = "RAM"; - sector-size = <512>; - sector-count = <192>; - }; -}; diff --git a/samples/subsys/usb/legacy/mass/prj.conf b/samples/subsys/usb/legacy/mass/prj.conf deleted file mode 100644 index 0954afcd0ee..00000000000 --- a/samples/subsys/usb/legacy/mass/prj.conf +++ /dev/null @@ -1,14 +0,0 @@ -CONFIG_STDOUT_CONSOLE=y - -#USB related configs -CONFIG_USB_DEVICE_STACK=y -CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample" -CONFIG_USB_DEVICE_PID=0x0008 -CONFIG_LOG=y -CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y -CONFIG_USB_MASS_STORAGE=y -CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y -CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y -CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n - -CONFIG_MAIN_STACK_SIZE=1536 diff --git a/samples/subsys/usb/legacy/mass/sample.yaml b/samples/subsys/usb/legacy/mass/sample.yaml deleted file mode 100644 index f4d1bb2f96d..00000000000 --- a/samples/subsys/usb/legacy/mass/sample.yaml +++ /dev/null @@ -1,10 +0,0 @@ -sample: - name: Mass Storage -tests: - sample.usb.legacy.mass_ram_none: - min_ram: 128 - depends_on: usb_device - build_only: true - arch_exclude: posix - tags: - - usb diff --git a/samples/subsys/usb/legacy/mass/src/main.c b/samples/subsys/usb/legacy/mass/src/main.c deleted file mode 100644 index 52dfa00294e..00000000000 --- a/samples/subsys/usb/legacy/mass/src/main.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2016 Intel Corporation. - * Copyright (c) 2019-2020 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -#include -LOG_MODULE_REGISTER(main, LOG_LEVEL_INF); - -int main(void) -{ - int ret; - - ret = usb_enable(NULL); - if (ret != 0) { - LOG_ERR("Failed to enable USB"); - return 0; - } - - LOG_INF("The device is put in USB mass storage mode"); - - return 0; -} diff --git a/samples/subsys/usb/mass/README.rst b/samples/subsys/usb/mass/README.rst index 910c34e7c1e..b68f57497b2 100644 --- a/samples/subsys/usb/mass/README.rst +++ b/samples/subsys/usb/mass/README.rst @@ -1,6 +1,6 @@ .. zephyr:code-sample:: usb-mass :name: USB Mass Storage - :relevant-api: usbd_api usbd_msc_device file_system_api + :relevant-api: usbd_api usbd_msc_device _usb_device_core_api file_system_api Expose board's RAM or FLASH as a USB disk using USB Mass Storage driver. diff --git a/samples/subsys/usb/mass/prj.conf b/samples/subsys/usb/mass/prj.conf index dd9d784070d..0954afcd0ee 100644 --- a/samples/subsys/usb/mass/prj.conf +++ b/samples/subsys/usb/mass/prj.conf @@ -1,15 +1,14 @@ -CONFIG_USB_DEVICE_STACK_NEXT=y - CONFIG_STDOUT_CONSOLE=y -CONFIG_SERIAL=y -CONFIG_UART_LINE_CTRL=y -CONFIG_USBD_MSC_CLASS=y -CONFIG_USBD_MSC_LUNS_PER_INSTANCE=3 +#USB related configs +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample" +CONFIG_USB_DEVICE_PID=0x0008 CONFIG_LOG=y -CONFIG_USBD_LOG_LEVEL_WRN=y -CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y +CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y +CONFIG_USB_MASS_STORAGE=y +CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y +CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y +CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n -CONFIG_SAMPLE_USBD_PID=0x0008 -CONFIG_SAMPLE_USBD_PRODUCT="USBD MSC sample" -CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_MAIN_STACK_SIZE=1536 diff --git a/samples/subsys/usb/mass/sample.yaml b/samples/subsys/usb/mass/sample.yaml index 9f3a169be60..4dbf2126798 100644 --- a/samples/subsys/usb/mass/sample.yaml +++ b/samples/subsys/usb/mass/sample.yaml @@ -1,7 +1,25 @@ sample: name: Mass Storage tests: - sample.usbd.mass_ram_none: + sample.usb.mass_ram_none: + min_ram: 128 + depends_on: usb_device + arch_exclude: posix + extra_args: + - EXTRA_DTC_OVERLAY_FILE="ramdisk.overlay" + extra_configs: + - CONFIG_LOG_DEFAULT_LEVEL=3 + tags: + - msd + - usb + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "No file system selected" + - "The device is put in USB mass storage mode." + sample.usb_device_next.mass_ram_none: min_ram: 128 depends_on: usbd integration_platforms: @@ -14,8 +32,12 @@ tests: - mimxrt1060_evk/mimxrt1062/qspi - max32690evkit/max32690/m4 extra_args: + - CONF_FILE="usbd_next_prj.conf" - EXTRA_DTC_OVERLAY_FILE="ramdisk.overlay" + extra_configs: + - CONFIG_LOG_DEFAULT_LEVEL=3 tags: + - msd - usb harness: console harness_config: @@ -23,23 +45,43 @@ tests: ordered: true regex: - "No file system selected" - - "The device is put in USB mass storage mode" - sample.usbd.mass_ram_fat: + - "The device is put in USB mass storage mode." + sample.usb.mass_ram_fat: min_ram: 128 - depends_on: usbd - integration_platforms: - - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp - - frdm_k64f - - stm32f723e_disco - - nucleo_f413zh - - mimxrt685_evk/mimxrt685s/cm33 - - mimxrt1060_evk/mimxrt1062/qspi + depends_on: usb_device + arch_exclude: posix extra_args: - EXTRA_DTC_OVERLAY_FILE="ramdisk.overlay" extra_configs: + - CONFIG_LOG_DEFAULT_LEVEL=3 - CONFIG_APP_MSC_STORAGE_RAM=y tags: + - msd + - usb + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "End of files" + - "The device is put in USB mass storage mode." + sample.usb.mass_flash_fatfs: + min_ram: 32 + modules: + - fatfs + depends_on: usb_device + filter: dt_compat_enabled("nordic,qspi-nor") + platform_allow: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - adafruit_feather_nrf52840/nrf52840/sense + integration_platforms: + - nrf52840dk/nrf52840 + extra_configs: + - CONFIG_LOG_DEFAULT_LEVEL=3 + - CONFIG_APP_MSC_STORAGE_FLASH_FATFS=y + tags: + - msd - usb harness: console harness_config: @@ -47,8 +89,8 @@ tests: ordered: true regex: - "End of files" - - "The device is put in USB mass storage mode" - sample.usbd.mass_flash_fatfs: + - "The device is put in USB mass storage mode." + sample.usb_device_next.mass_flash_fatfs: min_ram: 32 modules: - fatfs @@ -60,18 +102,43 @@ tests: - adafruit_feather_nrf52840/nrf52840/sense integration_platforms: - nrf52840dk/nrf52840 + extra_args: CONF_FILE="usbd_next_prj.conf" extra_configs: + - CONFIG_LOG_DEFAULT_LEVEL=3 - CONFIG_APP_MSC_STORAGE_FLASH_FATFS=y tags: + - msd + - usb + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "End of files" + - "The device is put in USB mass storage mode." + sample.usb.mass_sdhc_fatfs: + min_ram: 32 + filter: dt_compat_enabled("zephyr,sdmmc-disk") + modules: + - fatfs + depends_on: + - usb_device + - sdhc + extra_configs: + - CONFIG_LOG_DEFAULT_LEVEL=3 + - CONFIG_APP_MSC_STORAGE_SDCARD=y + tags: + - msd - usb harness: console harness_config: + fixture: fixture_sdcard type: multi_line ordered: true regex: - "End of files" - - "The device is put in USB mass storage mode" - sample.usbd.mass_sdhc_fatfs: + - "The device is put in USB mass storage mode." + sample.usb_device_next.mass_sdhc_fatfs: min_ram: 32 filter: dt_compat_enabled("zephyr,sdmmc-disk") modules: @@ -80,8 +147,11 @@ tests: - usbd - sdhc extra_configs: + - CONFIG_LOG_DEFAULT_LEVEL=3 - CONFIG_APP_MSC_STORAGE_SDCARD=y + extra_args: CONF_FILE="usbd_next_prj.conf" tags: + - msd - usb harness: console harness_config: @@ -90,12 +160,12 @@ tests: ordered: true regex: - "End of files" - - "The device is put in USB mass storage mode" - sample.usbd.mass_flash_littlefs: + - "The device is put in USB mass storage mode." + sample.usb.mass_flash_littlefs: modules: - littlefs min_ram: 32 - depends_on: usbd + depends_on: usb_device filter: dt_compat_enabled("nordic,qspi-nor") platform_allow: - nrf52840dk/nrf52840 @@ -104,8 +174,10 @@ tests: integration_platforms: - nrf52840dk/nrf52840 extra_configs: + - CONFIG_LOG_DEFAULT_LEVEL=3 - CONFIG_APP_MSC_STORAGE_FLASH_LITTLEFS=y tags: + - msd - usb harness: console harness_config: @@ -113,4 +185,4 @@ tests: ordered: true regex: - "End of files" - - "The device is put in USB mass storage mode" + - "The device is put in USB mass storage mode." diff --git a/samples/subsys/usb/mass/src/main.c b/samples/subsys/usb/mass/src/main.c index 59a770a5154..df90560d835 100644 --- a/samples/subsys/usb/mass/src/main.c +++ b/samples/subsys/usb/mass/src/main.c @@ -9,12 +9,13 @@ #include #include +#include #include #include #include #include -LOG_MODULE_REGISTER(main, LOG_LEVEL_INF); +LOG_MODULE_REGISTER(main); #if CONFIG_DISK_DRIVER_FLASH #include @@ -40,6 +41,7 @@ FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(storage); static struct fs_mount_t fs_mnt; +#if defined(CONFIG_USB_DEVICE_STACK_NEXT) static struct usbd_context *sample_usbd; #if CONFIG_DISK_DRIVER_RAM @@ -54,6 +56,28 @@ USBD_DEFINE_MSC_LUN(nand, "NAND", "Zephyr", "FlashDisk", "0.00"); USBD_DEFINE_MSC_LUN(sd, "SD", "Zephyr", "SD", "0.00"); #endif +static int enable_usb_device_next(void) +{ + int err; + + sample_usbd = sample_usbd_init_device(NULL); + if (sample_usbd == NULL) { + LOG_ERR("Failed to initialize USB device"); + return -ENODEV; + } + + err = usbd_enable(sample_usbd); + if (err) { + LOG_ERR("Failed to enable device support"); + return err; + } + + LOG_DBG("USB device support enabled"); + + return 0; +} +#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */ + static int setup_flash(struct fs_mount_t *mnt) { int rc = 0; @@ -191,24 +215,16 @@ int main(void) setup_disk(); - sample_usbd = sample_usbd_init_device(NULL); - if (sample_usbd == NULL) { - LOG_ERR("Failed to initialize USB device"); - return -ENODEV; - } - - ret = usbd_enable(sample_usbd); - if (ret) { - LOG_ERR("Failed to enable device support"); - return ret; - } - +#if defined(CONFIG_USB_DEVICE_STACK_NEXT) + ret = enable_usb_device_next(); +#else + ret = usb_enable(NULL); +#endif if (ret != 0) { LOG_ERR("Failed to enable USB"); return 0; } - LOG_INF("The device is put in USB mass storage mode"); - + LOG_INF("The device is put in USB mass storage mode.\n"); return 0; } diff --git a/samples/subsys/usb/mass/usbd_next_prj.conf b/samples/subsys/usb/mass/usbd_next_prj.conf new file mode 100644 index 00000000000..dd9d784070d --- /dev/null +++ b/samples/subsys/usb/mass/usbd_next_prj.conf @@ -0,0 +1,15 @@ +CONFIG_USB_DEVICE_STACK_NEXT=y + +CONFIG_STDOUT_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_LINE_CTRL=y +CONFIG_USBD_MSC_CLASS=y +CONFIG_USBD_MSC_LUNS_PER_INSTANCE=3 + +CONFIG_LOG=y +CONFIG_USBD_LOG_LEVEL_WRN=y +CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y + +CONFIG_SAMPLE_USBD_PID=0x0008 +CONFIG_SAMPLE_USBD_PRODUCT="USBD MSC sample" +CONFIG_MAIN_STACK_SIZE=2048 From caf454c5632e4facc1e50ea19cd5805e5582e9bd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 085/881] Revert "[nrf fromtree] samples: subsys: usb: mass: Include rpi_pico.overlay" This reverts commit 758c8491095e71ff20ffe5c3b3b5dc6bc5a48410. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/mass/boards/rpi_pico_rp2040_w.overlay | 1 - 1 file changed, 1 deletion(-) delete mode 100644 samples/subsys/usb/mass/boards/rpi_pico_rp2040_w.overlay diff --git a/samples/subsys/usb/mass/boards/rpi_pico_rp2040_w.overlay b/samples/subsys/usb/mass/boards/rpi_pico_rp2040_w.overlay deleted file mode 100644 index 759ce77a4f8..00000000000 --- a/samples/subsys/usb/mass/boards/rpi_pico_rp2040_w.overlay +++ /dev/null @@ -1 +0,0 @@ -#include "rpi_pico.overlay" From 00e959a701a8a2a56e19dcb6649ee95d724369c9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 086/881] Revert "[nrf fromtree] samples: usb: move the legacy code out of the HID mouse sample" This reverts commit 82e0bf157cf68480d2b1f402e709063ed588dd52. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/hid-mouse/README.rst | 2 +- samples/subsys/usb/hid-mouse/prj.conf | 14 +- samples/subsys/usb/hid-mouse/sample.yaml | 9 + samples/subsys/usb/hid-mouse/src/main.c | 120 +++++++------ .../{app.overlay => usbd_next.overlay} | 0 .../subsys/usb/hid-mouse/usbd_next_prj.conf | 11 ++ .../usb/legacy/hid-mouse/CMakeLists.txt | 9 - .../subsys/usb/legacy/hid-mouse/README.rst | 114 ------------- samples/subsys/usb/legacy/hid-mouse/prj.conf | 13 -- .../subsys/usb/legacy/hid-mouse/sample.yaml | 15 -- .../subsys/usb/legacy/hid-mouse/src/main.c | 158 ------------------ 11 files changed, 101 insertions(+), 364 deletions(-) rename samples/subsys/usb/hid-mouse/{app.overlay => usbd_next.overlay} (100%) create mode 100644 samples/subsys/usb/hid-mouse/usbd_next_prj.conf delete mode 100644 samples/subsys/usb/legacy/hid-mouse/CMakeLists.txt delete mode 100644 samples/subsys/usb/legacy/hid-mouse/README.rst delete mode 100644 samples/subsys/usb/legacy/hid-mouse/prj.conf delete mode 100644 samples/subsys/usb/legacy/hid-mouse/sample.yaml delete mode 100644 samples/subsys/usb/legacy/hid-mouse/src/main.c diff --git a/samples/subsys/usb/hid-mouse/README.rst b/samples/subsys/usb/hid-mouse/README.rst index 0c1d908f05b..e2f099f98f4 100644 --- a/samples/subsys/usb/hid-mouse/README.rst +++ b/samples/subsys/usb/hid-mouse/README.rst @@ -1,6 +1,6 @@ .. zephyr:code-sample:: usb-hid-mouse :name: USB HID mouse - :relevant-api: usbd_api usbd_hid_device input_interface + :relevant-api: _usb_device_core_api usb_hid_device_api input_interface Implement a basic HID mouse device. diff --git a/samples/subsys/usb/hid-mouse/prj.conf b/samples/subsys/usb/hid-mouse/prj.conf index 9c8894b2126..b797a7382e8 100644 --- a/samples/subsys/usb/hid-mouse/prj.conf +++ b/samples/subsys/usb/hid-mouse/prj.conf @@ -1,11 +1,13 @@ -CONFIG_USB_DEVICE_STACK_NEXT=y -CONFIG_USBD_HID_SUPPORT=y +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_HID=y +CONFIG_USB_DEVICE_PRODUCT="Zephyr HID mouse sample" +CONFIG_USB_DEVICE_PID=0x0007 +CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n CONFIG_LOG=y -CONFIG_USBD_LOG_LEVEL_WRN=y -CONFIG_USBD_HID_LOG_LEVEL_WRN=y -CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y -CONFIG_SAMPLE_USBD_PID=0x0007 +CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y +CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_GPIO=y CONFIG_INPUT=y +CONFIG_INPUT_MODE_SYNCHRONOUS=y diff --git a/samples/subsys/usb/hid-mouse/sample.yaml b/samples/subsys/usb/hid-mouse/sample.yaml index 0a9e1af37f0..132c71c928b 100644 --- a/samples/subsys/usb/hid-mouse/sample.yaml +++ b/samples/subsys/usb/hid-mouse/sample.yaml @@ -6,6 +6,12 @@ common: depends_on: - gpio tests: + sample.usb.hid-mouse: + depends_on: + - usb_device + platform_exclude: + - frdm_mcxn947/mcxn947/cpu0 + tags: usb sample.usb_device_next.hid-mouse: depends_on: - usbd @@ -17,4 +23,7 @@ tests: - nucleo_f413zh - mimxrt1060_evk/mimxrt1062/qspi - max32690evkit/max32690/m4 + extra_args: + - CONF_FILE="usbd_next_prj.conf" + - EXTRA_DTC_OVERLAY_FILE="usbd_next.overlay" tags: usb diff --git a/samples/subsys/usb/hid-mouse/src/main.c b/samples/subsys/usb/hid-mouse/src/main.c index 967591b2a71..4e579832cf9 100644 --- a/samples/subsys/usb/hid-mouse/src/main.c +++ b/samples/subsys/usb/hid-mouse/src/main.c @@ -15,14 +15,16 @@ #include #include +#include #include -#include +#include #include LOG_MODULE_REGISTER(main, LOG_LEVEL_INF); static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); static const uint8_t hid_report_desc[] = HID_MOUSE_REPORT_DESC(2); +static enum usb_dc_status_code usb_status; #define MOUSE_BTN_LEFT 0 #define MOUSE_BTN_RIGHT 1 @@ -36,7 +38,22 @@ enum mouse_report_idx { }; K_MSGQ_DEFINE(mouse_msgq, MOUSE_REPORT_COUNT, 2, 1); -static bool mouse_ready; +static K_SEM_DEFINE(ep_write_sem, 0, 1); + +static inline void status_cb(enum usb_dc_status_code status, const uint8_t *param) +{ + usb_status = status; +} + +static ALWAYS_INLINE void rwup_if_suspended(void) +{ + if (IS_ENABLED(CONFIG_USB_DEVICE_REMOTE_WAKEUP)) { + if (usb_status == USB_DC_SUSPEND) { + usb_wakeup_request(); + return; + } + } +} static void input_cb(struct input_event *evt, void *user_data) { @@ -46,9 +63,11 @@ static void input_cb(struct input_event *evt, void *user_data) switch (evt->code) { case INPUT_KEY_0: + rwup_if_suspended(); WRITE_BIT(tmp[MOUSE_BTN_REPORT_IDX], MOUSE_BTN_LEFT, evt->value); break; case INPUT_KEY_1: + rwup_if_suspended(); WRITE_BIT(tmp[MOUSE_BTN_REPORT_IDX], MOUSE_BTN_RIGHT, evt->value); break; case INPUT_KEY_2: @@ -80,30 +99,42 @@ static void input_cb(struct input_event *evt, void *user_data) INPUT_CALLBACK_DEFINE(NULL, input_cb, NULL); -static void mouse_iface_ready(const struct device *dev, const bool ready) +#if defined(CONFIG_USB_DEVICE_STACK_NEXT) +static int enable_usb_device_next(void) { - LOG_INF("HID device %s interface is %s", - dev->name, ready ? "ready" : "not ready"); - mouse_ready = ready; -} + struct usbd_context *sample_usbd; + int err; -static int mouse_get_report(const struct device *dev, - const uint8_t type, const uint8_t id, const uint16_t len, - uint8_t *const buf) -{ - LOG_WRN("Get Report not implemented, Type %u ID %u", type, id); + sample_usbd = sample_usbd_init_device(NULL); + if (sample_usbd == NULL) { + LOG_ERR("Failed to initialize USB device"); + return -ENODEV; + } + + err = usbd_enable(sample_usbd); + if (err) { + LOG_ERR("Failed to enable device support"); + return err; + } + + LOG_DBG("USB device support enabled"); return 0; } +#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */ + +static void int_in_ready_cb(const struct device *dev) +{ + ARG_UNUSED(dev); + k_sem_give(&ep_write_sem); +} -struct hid_device_ops mouse_ops = { - .iface_ready = mouse_iface_ready, - .get_report = mouse_get_report, +static const struct hid_ops ops = { + .int_in_ready = int_in_ready_cb, }; int main(void) { - struct usbd_context *sample_usbd; const struct device *hid_dev; int ret; @@ -112,58 +143,51 @@ int main(void) return 0; } +#if defined(CONFIG_USB_DEVICE_STACK_NEXT) + hid_dev = DEVICE_DT_GET_ONE(zephyr_hid_device); +#else + hid_dev = device_get_binding("HID_0"); +#endif + if (hid_dev == NULL) { + LOG_ERR("Cannot get USB HID Device"); + return 0; + } + ret = gpio_pin_configure_dt(&led0, GPIO_OUTPUT); - if (ret != 0) { + if (ret < 0) { LOG_ERR("Failed to configure the LED pin, error: %d", ret); return 0; } - hid_dev = DEVICE_DT_GET_ONE(zephyr_hid_device); - if (!device_is_ready(hid_dev)) { - LOG_ERR("HID Device is not ready"); - return -EIO; - } + usb_hid_register_device(hid_dev, + hid_report_desc, sizeof(hid_report_desc), + &ops); - ret = hid_device_register(hid_dev, - hid_report_desc, sizeof(hid_report_desc), - &mouse_ops); - if (ret != 0) { - LOG_ERR("Failed to register HID Device, %d", ret); - return ret; - } + usb_hid_init(hid_dev); - sample_usbd = sample_usbd_init_device(NULL); - if (sample_usbd == NULL) { - LOG_ERR("Failed to initialize USB device"); - return -ENODEV; - } - - ret = usbd_enable(sample_usbd); +#if defined(CONFIG_USB_DEVICE_STACK_NEXT) + ret = enable_usb_device_next(); +#else + ret = usb_enable(status_cb); +#endif if (ret != 0) { - LOG_ERR("Failed to enable device support"); - return ret; + LOG_ERR("Failed to enable USB"); + return 0; } - LOG_DBG("USB device support enabled"); - while (true) { UDC_STATIC_BUF_DEFINE(report, MOUSE_REPORT_COUNT); k_msgq_get(&mouse_msgq, &report, K_FOREVER); - if (!mouse_ready) { - LOG_INF("USB HID device is not ready"); - continue; - } - - ret = hid_device_submit_report(hid_dev, MOUSE_REPORT_COUNT, report); + ret = hid_int_ep_write(hid_dev, report, MOUSE_REPORT_COUNT, NULL); if (ret) { - LOG_ERR("HID submit report error, %d", ret); + LOG_ERR("HID write error, %d", ret); } else { + k_sem_take(&ep_write_sem, K_FOREVER); /* Toggle LED on sent report */ (void)gpio_pin_toggle(led0.port, led0.pin); } } - return 0; } diff --git a/samples/subsys/usb/hid-mouse/app.overlay b/samples/subsys/usb/hid-mouse/usbd_next.overlay similarity index 100% rename from samples/subsys/usb/hid-mouse/app.overlay rename to samples/subsys/usb/hid-mouse/usbd_next.overlay diff --git a/samples/subsys/usb/hid-mouse/usbd_next_prj.conf b/samples/subsys/usb/hid-mouse/usbd_next_prj.conf new file mode 100644 index 00000000000..9c8894b2126 --- /dev/null +++ b/samples/subsys/usb/hid-mouse/usbd_next_prj.conf @@ -0,0 +1,11 @@ +CONFIG_USB_DEVICE_STACK_NEXT=y +CONFIG_USBD_HID_SUPPORT=y + +CONFIG_LOG=y +CONFIG_USBD_LOG_LEVEL_WRN=y +CONFIG_USBD_HID_LOG_LEVEL_WRN=y +CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y +CONFIG_SAMPLE_USBD_PID=0x0007 + +CONFIG_GPIO=y +CONFIG_INPUT=y diff --git a/samples/subsys/usb/legacy/hid-mouse/CMakeLists.txt b/samples/subsys/usb/legacy/hid-mouse/CMakeLists.txt deleted file mode 100644 index d2217c00a47..00000000000 --- a/samples/subsys/usb/legacy/hid-mouse/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(hid-mouse) - -include(${ZEPHYR_BASE}/samples/subsys/usb/common/common.cmake) -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/samples/subsys/usb/legacy/hid-mouse/README.rst b/samples/subsys/usb/legacy/hid-mouse/README.rst deleted file mode 100644 index aa82e23804a..00000000000 --- a/samples/subsys/usb/legacy/hid-mouse/README.rst +++ /dev/null @@ -1,114 +0,0 @@ -.. zephyr:code-sample:: legacy-usb-hid-mouse - :name: Legacy USB HID mouse - :relevant-api: _usb_device_core_api usb_hid_device_api input_interface - - Implement a basic HID mouse device. - -Overview -******** - -This sample app demonstrates use of a USB Human Interface Device (HID) driver -by the Zephyr project. This very simple driver enumerates a board with a button -into a mouse that has a left mouse button and optionally (depending on -the number of buttons on the board) a right mouse button, X-axis movement, -and Y-axis movement. -If the USB peripheral driver supports remote wakeup feature, wakeup request -will be performed on every button click if the bus is in suspended state. -This sample can be found under :zephyr_file:`samples/subsys/usb/legacy/hid-mouse` in the -Zephyr project tree. - -.. note:: - This samples demonstrate deprecated :ref:`usb_device_stack`. - -Requirements -************ - -This project requires an USB device driver and uses the :ref:`input` API. -There must be a :dtcompatible:`gpio-keys` group of buttons or keys defined at -the board level that can generate input events, otherwise the example will build -but not work as expected. - -The key mapping in the sample is as follows: - -- ``INPUT_KEY_0``: left button -- ``INPUT_KEY_1``: right button -- ``INPUT_KEY_2``: move the mouse along the x-axis -- ``INPUT_KEY_3``: move the mouse along the y-axis - -An LED must also be configured via the ``led0`` devicetree alias. You may also -see this error if you try to build this sample for an unsupported board: - -.. code-block:: none - - Unsupported board: led0 devicetree alias is not defined - -Building and Running -******************** - -This sample can be built for multiple boards, in this example we will build it -for the nucleo_f070rb board: - -.. zephyr-app-commands:: - :zephyr-app: samples/subsys/usb/legacy/hid-mouse - :board: nucleo_f070rb - :goals: build - :compact: - -After you have built and flashed the sample app image to your board, plug the -board into a host device, for example, a PC running Linux. -The board will be detected as shown by the Linux dmesg command: - -.. code-block:: console - - dmesg | tail -10 - usb 2-2: new full-speed USB device number 2 using at91_ohci - usb 2-2: New USB device found, idVendor=2fe3, idProduct=0007, bcdDevice= 2.03 - usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 - usb 2-2: Product: Zephyr HID mouse sample - usb 2-2: Manufacturer: ZEPHYR - usb 2-2: SerialNumber: 86FE679A598AC47A - input: ZEPHYR Zephyr HID mouse sample as /devices/soc0/ahb/600000.ohci/usb2/2-2/2-2:1.0/0003:2FE3:0100.0001/input/input0 - hid-generic 0003:2FE3:0100.0001: input: USB HID v1.10 Mouse [ZEPHYR Zephyr HID mouse sample] on usb-at91-2/input0 - -You can also monitor mouse events by using the standard Linux ``evtest`` command -(see the `Ubuntu evtest man page`_ for more information about this tool): - -.. _Ubuntu evtest man page: - http://manpages.ubuntu.com/manpages/trusty/man1/evtest.1.html - -.. code-block:: console - - sudo evtest /dev/input/event0 - Input driver version is 1.0.1 - Input device ID: bus 0x3 vendor 0x2fe3 product 0x7 version 0x110 - Input device name: "ZEPHYR Zephyr HID mouse sample" - Supported events: - Event type 0 (EV_SYN) - Event type 1 (EV_KEY) - Event code 272 (BTN_LEFT) - Event code 273 (BTN_RIGHT) - Event code 274 (BTN_MIDDLE) - Event type 2 (EV_REL) - Event code 0 (REL_X) - Event code 1 (REL_Y) - Event code 8 (REL_WHEEL) - Event type 4 (EV_MSC) - Event code 4 (MSC_SCAN) - Properties: - Testing ... (interrupt to exit) - -When you press the button on your board, it will act as if the left -mouse button was pressed, and this information will be displayed -by ``evtest``: - -.. code-block:: console - - Event: time 1167609663.618515, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001 - Event: time 1167609663.618515, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1 - Event: time 1167609663.618515, -------------- SYN_REPORT ------------ - Event: time 1167609663.730510, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001 - Event: time 1167609663.730510, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0 - Event: time 1167609663.730510, -------------- SYN_REPORT ------------ - -If your board has more than one button, they will act as right mouse button, -X-axis movement, and Y-axis movement. diff --git a/samples/subsys/usb/legacy/hid-mouse/prj.conf b/samples/subsys/usb/legacy/hid-mouse/prj.conf deleted file mode 100644 index b797a7382e8..00000000000 --- a/samples/subsys/usb/legacy/hid-mouse/prj.conf +++ /dev/null @@ -1,13 +0,0 @@ -CONFIG_USB_DEVICE_STACK=y -CONFIG_USB_DEVICE_HID=y -CONFIG_USB_DEVICE_PRODUCT="Zephyr HID mouse sample" -CONFIG_USB_DEVICE_PID=0x0007 -CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n - -CONFIG_LOG=y -CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y -CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y - -CONFIG_GPIO=y -CONFIG_INPUT=y -CONFIG_INPUT_MODE_SYNCHRONOUS=y diff --git a/samples/subsys/usb/legacy/hid-mouse/sample.yaml b/samples/subsys/usb/legacy/hid-mouse/sample.yaml deleted file mode 100644 index 4dc2da90798..00000000000 --- a/samples/subsys/usb/legacy/hid-mouse/sample.yaml +++ /dev/null @@ -1,15 +0,0 @@ -sample: - name: USB HID mouse sample -common: - harness: button - filter: dt_alias_exists("sw0") and dt_alias_exists("led0") - depends_on: - - gpio -tests: - sample.usb.legacy.hid-mouse: - depends_on: - - usb_device - build_only: true - platform_exclude: - - frdm_mcxn947/mcxn947/cpu0 - tags: usb diff --git a/samples/subsys/usb/legacy/hid-mouse/src/main.c b/samples/subsys/usb/legacy/hid-mouse/src/main.c deleted file mode 100644 index e668ce64758..00000000000 --- a/samples/subsys/usb/legacy/hid-mouse/src/main.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2018 qianfan Zhao - * Copyright (c) 2018, 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -LOG_MODULE_REGISTER(main, LOG_LEVEL_INF); - -static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); -static const uint8_t hid_report_desc[] = HID_MOUSE_REPORT_DESC(2); -static enum usb_dc_status_code usb_status; - -#define MOUSE_BTN_LEFT 0 -#define MOUSE_BTN_RIGHT 1 - -enum mouse_report_idx { - MOUSE_BTN_REPORT_IDX = 0, - MOUSE_X_REPORT_IDX = 1, - MOUSE_Y_REPORT_IDX = 2, - MOUSE_WHEEL_REPORT_IDX = 3, - MOUSE_REPORT_COUNT = 4, -}; - -K_MSGQ_DEFINE(mouse_msgq, MOUSE_REPORT_COUNT, 2, 1); -static K_SEM_DEFINE(ep_write_sem, 0, 1); - -static inline void status_cb(enum usb_dc_status_code status, const uint8_t *param) -{ - usb_status = status; -} - -static ALWAYS_INLINE void rwup_if_suspended(void) -{ - if (IS_ENABLED(CONFIG_USB_DEVICE_REMOTE_WAKEUP)) { - if (usb_status == USB_DC_SUSPEND) { - usb_wakeup_request(); - return; - } - } -} - -static void input_cb(struct input_event *evt, void *user_data) -{ - static uint8_t tmp[MOUSE_REPORT_COUNT]; - - ARG_UNUSED(user_data); - - switch (evt->code) { - case INPUT_KEY_0: - rwup_if_suspended(); - WRITE_BIT(tmp[MOUSE_BTN_REPORT_IDX], MOUSE_BTN_LEFT, evt->value); - break; - case INPUT_KEY_1: - rwup_if_suspended(); - WRITE_BIT(tmp[MOUSE_BTN_REPORT_IDX], MOUSE_BTN_RIGHT, evt->value); - break; - case INPUT_KEY_2: - if (evt->value) { - tmp[MOUSE_X_REPORT_IDX] += 10U; - } - - break; - case INPUT_KEY_3: - if (evt->value) { - tmp[MOUSE_Y_REPORT_IDX] += 10U; - } - - break; - default: - LOG_INF("Unrecognized input code %u value %d", - evt->code, evt->value); - return; - } - - if (k_msgq_put(&mouse_msgq, tmp, K_NO_WAIT) != 0) { - LOG_ERR("Failed to put new input event"); - } - - tmp[MOUSE_X_REPORT_IDX] = 0U; - tmp[MOUSE_Y_REPORT_IDX] = 0U; - -} - -INPUT_CALLBACK_DEFINE(NULL, input_cb, NULL); - -static void int_in_ready_cb(const struct device *dev) -{ - ARG_UNUSED(dev); - k_sem_give(&ep_write_sem); -} - -static const struct hid_ops ops = { - .int_in_ready = int_in_ready_cb, -}; - -int main(void) -{ - const struct device *hid_dev; - int ret; - - if (!gpio_is_ready_dt(&led0)) { - LOG_ERR("LED device %s is not ready", led0.port->name); - return 0; - } - - hid_dev = device_get_binding("HID_0"); - if (hid_dev == NULL) { - LOG_ERR("Cannot get USB HID Device"); - return 0; - } - - ret = gpio_pin_configure_dt(&led0, GPIO_OUTPUT); - if (ret < 0) { - LOG_ERR("Failed to configure the LED pin, error: %d", ret); - return 0; - } - - usb_hid_register_device(hid_dev, - hid_report_desc, sizeof(hid_report_desc), - &ops); - - usb_hid_init(hid_dev); - - ret = usb_enable(status_cb); - if (ret != 0) { - LOG_ERR("Failed to enable USB"); - return 0; - } - - while (true) { - uint8_t __aligned(sizeof(void *)) report[MOUSE_REPORT_COUNT]; - - k_msgq_get(&mouse_msgq, &report, K_FOREVER); - - ret = hid_int_ep_write(hid_dev, report, MOUSE_REPORT_COUNT, NULL); - if (ret) { - LOG_ERR("HID write error, %d", ret); - } else { - k_sem_take(&ep_write_sem, K_FOREVER); - /* Toggle LED on sent report */ - (void)gpio_pin_toggle(led0.port, led0.pin); - } - } - return 0; -} From 2efb9226876e835d0b8a54a1015da0675f9ec289 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 087/881] Revert "[nrf fromtree] samples: usb: move the legacy code out of the CDC ACM sample" This reverts commit 273273fe9cc22beb95197bc40c4290fa4ca79927. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/cdc_acm/README.rst | 6 +- samples/subsys/usb/cdc_acm/prj.conf | 19 +-- samples/subsys/usb/cdc_acm/sample.yaml | 18 ++ samples/subsys/usb/cdc_acm/src/main.c | 40 ++++- samples/subsys/usb/cdc_acm/usbd_next_prj.conf | 14 ++ .../subsys/usb/legacy/cdc_acm/CMakeLists.txt | 9 - samples/subsys/usb/legacy/cdc_acm/README.rst | 102 ------------ samples/subsys/usb/legacy/cdc_acm/app.overlay | 11 -- samples/subsys/usb/legacy/cdc_acm/prj.conf | 11 -- samples/subsys/usb/legacy/cdc_acm/sample.yaml | 7 - samples/subsys/usb/legacy/cdc_acm/src/main.c | 154 ------------------ 11 files changed, 81 insertions(+), 310 deletions(-) create mode 100644 samples/subsys/usb/cdc_acm/usbd_next_prj.conf delete mode 100644 samples/subsys/usb/legacy/cdc_acm/CMakeLists.txt delete mode 100644 samples/subsys/usb/legacy/cdc_acm/README.rst delete mode 100644 samples/subsys/usb/legacy/cdc_acm/app.overlay delete mode 100644 samples/subsys/usb/legacy/cdc_acm/prj.conf delete mode 100644 samples/subsys/usb/legacy/cdc_acm/sample.yaml delete mode 100644 samples/subsys/usb/legacy/cdc_acm/src/main.c diff --git a/samples/subsys/usb/cdc_acm/README.rst b/samples/subsys/usb/cdc_acm/README.rst index db95373b253..21ce853ae08 100644 --- a/samples/subsys/usb/cdc_acm/README.rst +++ b/samples/subsys/usb/cdc_acm/README.rst @@ -1,8 +1,8 @@ .. zephyr:code-sample:: usb-cdc-acm - :name: USB CDC ACM UART sample - :relevant-api: usbd_api uart_interface + :name: USB CDC-ACM + :relevant-api: usbd_api _usb_device_core_api uart_interface - Use USB CDC ACM UART driver to implement a serial port echo. + Use USB CDC-ACM driver to implement a serial port echo. Overview ******** diff --git a/samples/subsys/usb/cdc_acm/prj.conf b/samples/subsys/usb/cdc_acm/prj.conf index e0012027ec6..55e4fe9217f 100644 --- a/samples/subsys/usb/cdc_acm/prj.conf +++ b/samples/subsys/usb/cdc_acm/prj.conf @@ -1,14 +1,11 @@ -CONFIG_USB_DEVICE_STACK_NEXT=y - CONFIG_STDOUT_CONSOLE=y +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM sample" +CONFIG_USB_DEVICE_PID=0x0001 +CONFIG_LOG=y +CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y +CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y -CONFIG_USBD_CDC_ACM_CLASS=y - -CONFIG_LOG=y -CONFIG_USBD_LOG_LEVEL_ERR=y -CONFIG_UDC_DRIVER_LOG_LEVEL_ERR=y -CONFIG_USBD_CDC_ACM_LOG_LEVEL_ERR=y - -CONFIG_SAMPLE_USBD_PID=0x0001 -CONFIG_SAMPLE_USBD_PRODUCT="USBD CDC ACM sample" +CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n diff --git a/samples/subsys/usb/cdc_acm/sample.yaml b/samples/subsys/usb/cdc_acm/sample.yaml index b9256e74eee..875bfb335b5 100644 --- a/samples/subsys/usb/cdc_acm/sample.yaml +++ b/samples/subsys/usb/cdc_acm/sample.yaml @@ -1,9 +1,19 @@ sample: name: CDC ACM USB tests: + sample.usb.cdc-acm: + depends_on: usb_device + tags: usb + arch_exclude: posix + harness: console + harness_config: + type: one_line + regex: + - "Wait for DTR" sample.usb_device_next.cdc-acm: depends_on: usbd tags: usb + extra_args: CONF_FILE="usbd_next_prj.conf" integration_platforms: - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp @@ -24,6 +34,7 @@ tests: depends_on: usbd tags: usb extra_args: + - CONF_FILE="usbd_next_prj.conf" - DCONFIG_USBD_CDC_ACM_WORKQUEUE=y integration_platforms: - frdm_k64f @@ -32,3 +43,10 @@ tests: type: one_line regex: - "Wait for DTR" + sample.usb.cdc-acm.buildonly: + depends_on: usb_device + tags: usb + arch_allow: posix + build_only: true + integration_platforms: + - native_sim diff --git a/samples/subsys/usb/cdc_acm/src/main.c b/samples/subsys/usb/cdc_acm/src/main.c index c80d253966b..ab1cbdc6a4c 100644 --- a/samples/subsys/usb/cdc_acm/src/main.c +++ b/samples/subsys/usb/cdc_acm/src/main.c @@ -4,6 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +/** + * @file + * @brief Sample echo app for CDC ACM class + * + * Sample app for USB CDC ACM class driver. The received data is echoed back + * to the serial port. + */ + #include #include @@ -13,6 +21,7 @@ #include #include +#include #include #include LOG_MODULE_REGISTER(cdc_acm_echo, LOG_LEVEL_INF); @@ -39,6 +48,7 @@ static inline void print_baudrate(const struct device *dev) } } +#if defined(CONFIG_USB_DEVICE_STACK_NEXT) static struct usbd_context *sample_usbd; K_SEM_DEFINE(dtr_sem, 0, 1); @@ -96,6 +106,7 @@ static int enable_usb_device_next(void) return 0; } +#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */ static void interrupt_handler(const struct device *dev, void *user_data) { @@ -167,16 +178,37 @@ int main(void) return 0; } - ret = enable_usb_device_next(); +#if defined(CONFIG_USB_DEVICE_STACK_NEXT) + ret = enable_usb_device_next(); +#else + ret = usb_enable(NULL); +#endif + if (ret != 0) { - LOG_ERR("Failed to enable USB device support"); + LOG_ERR("Failed to enable USB"); return 0; } ring_buf_init(&ringbuf, sizeof(ring_buffer), ring_buffer); LOG_INF("Wait for DTR"); + +#if defined(CONFIG_USB_DEVICE_STACK_NEXT) k_sem_take(&dtr_sem, K_FOREVER); +#else + while (true) { + uint32_t dtr = 0U; + + uart_line_ctrl_get(uart_dev, UART_LINE_CTRL_DTR, &dtr); + if (dtr) { + break; + } else { + /* Give CPU resources to low priority threads. */ + k_sleep(K_MSEC(100)); + } + } +#endif + LOG_INF("DTR set"); /* They are optional, we use them to test the interrupt endpoint */ @@ -193,7 +225,11 @@ int main(void) /* Wait 100ms for the host to do all settings */ k_msleep(100); +#ifndef CONFIG_USB_DEVICE_STACK_NEXT + print_baudrate(uart_dev); +#endif uart_irq_callback_set(uart_dev, interrupt_handler); + /* Enable rx interrupts */ uart_irq_rx_enable(uart_dev); diff --git a/samples/subsys/usb/cdc_acm/usbd_next_prj.conf b/samples/subsys/usb/cdc_acm/usbd_next_prj.conf new file mode 100644 index 00000000000..f08928438b7 --- /dev/null +++ b/samples/subsys/usb/cdc_acm/usbd_next_prj.conf @@ -0,0 +1,14 @@ +CONFIG_USB_DEVICE_STACK_NEXT=y + +CONFIG_STDOUT_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_LINE_CTRL=y +CONFIG_USBD_CDC_ACM_CLASS=y + +CONFIG_LOG=y +CONFIG_USBD_LOG_LEVEL_WRN=y +CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y +CONFIG_USBD_CDC_ACM_LOG_LEVEL_ERR=y + +CONFIG_SAMPLE_USBD_PID=0x0001 +CONFIG_SAMPLE_USBD_PRODUCT="USBD CDC ACM sample" diff --git a/samples/subsys/usb/legacy/cdc_acm/CMakeLists.txt b/samples/subsys/usb/legacy/cdc_acm/CMakeLists.txt deleted file mode 100644 index c97b4990766..00000000000 --- a/samples/subsys/usb/legacy/cdc_acm/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(cdc_acm) - -include(${ZEPHYR_BASE}/samples/subsys/usb/common/common.cmake) -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/samples/subsys/usb/legacy/cdc_acm/README.rst b/samples/subsys/usb/legacy/cdc_acm/README.rst deleted file mode 100644 index 1e7a4d15300..00000000000 --- a/samples/subsys/usb/legacy/cdc_acm/README.rst +++ /dev/null @@ -1,102 +0,0 @@ -.. zephyr:code-sample:: legacy-usb-cdc-acm - :name: Legacy USB CDC ACM UART sample - :relevant-api: _usb_device_core_api uart_interface - - Use USB CDC ACM UART driver to implement a serial port echo. - -Overview -******** - -This sample app demonstrates use of a USB Communication Device Class (CDC) -Abstract Control Model (ACM) driver provided by the Zephyr project. -Received data from the serial port is echoed back to the same port -provided by this driver. - -.. note:: - This samples demonstrate deprecated :ref:`usb_device_stack`. - -This sample can be found under :zephyr_file:`samples/subsys/usb/legacy/cdc_acm` in the -Zephyr project tree. - -Requirements -************ - -This project requires an USB device driver, which is available for multiple -boards supported in Zephyr. - -Building and Running -******************** - -Reel Board -=========== - -To see the console output of the app, open a serial port emulator and -attach it to the USB to TTL Serial cable. Build and flash the project: - -.. zephyr-app-commands:: - :zephyr-app: samples/subsys/usb/legacy/cdc_acm - :board: reel_board - :goals: flash - :compact: - -Running -======= - -Plug the board into a host device, for example, a PC running Linux. -The board will be detected as shown by the Linux dmesg command: - -.. code-block:: console - - usb 9-1: new full-speed USB device number 112 using uhci_hcd - usb 9-1: New USB device found, idVendor=8086, idProduct=f8a1 - usb 9-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 - usb 9-1: Product: CDC-ACM - usb 9-1: Manufacturer: Intel - usb 9-1: SerialNumber: 00.01 - cdc_acm 9-1:1.0: ttyACM1: USB ACM device - -The app prints on serial output (UART1), used for the console: - -.. code-block:: console - - Wait for DTR - -Open a serial port emulator, for example minicom -and attach it to detected CDC ACM device: - -.. code-block:: console - - minicom --device /dev/ttyACM1 - -The app should respond on serial output with: - -.. code-block:: console - - DTR set, start test - Baudrate detected: 115200 - -And on ttyACM device, provided by zephyr USB device stack: - -.. code-block:: console - - Send characters to the UART device - Characters read: - -The characters entered in serial port emulator will be echoed back. - -Troubleshooting -=============== - -If the ModemManager runs on your operating system, it will try -to access the CDC ACM device and maybe you can see several characters -including "AT" on the terminal attached to the CDC ACM device. -You can add or extend the udev rule for your board to inform -ModemManager to skip the CDC ACM device. -For this example, it would look like this: - -.. code-block:: none - - ATTRS{idVendor}=="8086" ATTRS{idProduct}=="f8a1", ENV{ID_MM_DEVICE_IGNORE}="1" - -You can use -``/lib/udev/rules.d/77-mm-usb-device-blacklist.rules`` as reference. diff --git a/samples/subsys/usb/legacy/cdc_acm/app.overlay b/samples/subsys/usb/legacy/cdc_acm/app.overlay deleted file mode 100644 index c50d0fd9d69..00000000000 --- a/samples/subsys/usb/legacy/cdc_acm/app.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&zephyr_udc0 { - cdc_acm_uart0 { - compatible = "zephyr,cdc-acm-uart"; - }; -}; diff --git a/samples/subsys/usb/legacy/cdc_acm/prj.conf b/samples/subsys/usb/legacy/cdc_acm/prj.conf deleted file mode 100644 index 55e4fe9217f..00000000000 --- a/samples/subsys/usb/legacy/cdc_acm/prj.conf +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG_STDOUT_CONSOLE=y -CONFIG_USB_DEVICE_STACK=y -CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM sample" -CONFIG_USB_DEVICE_PID=0x0001 -CONFIG_LOG=y -CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y -CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y -CONFIG_SERIAL=y -CONFIG_UART_INTERRUPT_DRIVEN=y -CONFIG_UART_LINE_CTRL=y -CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n diff --git a/samples/subsys/usb/legacy/cdc_acm/sample.yaml b/samples/subsys/usb/legacy/cdc_acm/sample.yaml deleted file mode 100644 index b61deab71ff..00000000000 --- a/samples/subsys/usb/legacy/cdc_acm/sample.yaml +++ /dev/null @@ -1,7 +0,0 @@ -sample: - name: CDC ACM USB -tests: - sample.usb.legacy.cdc-acm: - depends_on: usb_device - tags: usb - build_only: true diff --git a/samples/subsys/usb/legacy/cdc_acm/src/main.c b/samples/subsys/usb/legacy/cdc_acm/src/main.c deleted file mode 100644 index d06161f0f5c..00000000000 --- a/samples/subsys/usb/legacy/cdc_acm/src/main.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2019 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -LOG_MODULE_REGISTER(cdc_acm_echo, LOG_LEVEL_INF); - -const struct device *const uart_dev = DEVICE_DT_GET_ONE(zephyr_cdc_acm_uart); - -#define RING_BUF_SIZE 1024 -uint8_t ring_buffer[RING_BUF_SIZE]; - -struct ring_buf ringbuf; - -static bool rx_throttled; - -static inline void print_baudrate(const struct device *dev) -{ - uint32_t baudrate; - int ret; - - ret = uart_line_ctrl_get(dev, UART_LINE_CTRL_BAUD_RATE, &baudrate); - if (ret) { - LOG_WRN("Failed to get baudrate, ret code %d", ret); - } else { - LOG_INF("Baudrate %u", baudrate); - } -} - -static void interrupt_handler(const struct device *dev, void *user_data) -{ - ARG_UNUSED(user_data); - - while (uart_irq_update(dev) && uart_irq_is_pending(dev)) { - if (!rx_throttled && uart_irq_rx_ready(dev)) { - int recv_len, rb_len; - uint8_t buffer[64]; - size_t len = MIN(ring_buf_space_get(&ringbuf), - sizeof(buffer)); - - if (len == 0) { - /* Throttle because ring buffer is full */ - uart_irq_rx_disable(dev); - rx_throttled = true; - continue; - } - - recv_len = uart_fifo_read(dev, buffer, len); - if (recv_len < 0) { - LOG_ERR("Failed to read UART FIFO"); - recv_len = 0; - }; - - rb_len = ring_buf_put(&ringbuf, buffer, recv_len); - if (rb_len < recv_len) { - LOG_ERR("Drop %u bytes", recv_len - rb_len); - } - - LOG_DBG("tty fifo -> ringbuf %d bytes", rb_len); - if (rb_len) { - uart_irq_tx_enable(dev); - } - } - - if (uart_irq_tx_ready(dev)) { - uint8_t buffer[64]; - int rb_len, send_len; - - rb_len = ring_buf_get(&ringbuf, buffer, sizeof(buffer)); - if (!rb_len) { - LOG_DBG("Ring buffer empty, disable TX IRQ"); - uart_irq_tx_disable(dev); - continue; - } - - if (rx_throttled) { - uart_irq_rx_enable(dev); - rx_throttled = false; - } - - send_len = uart_fifo_fill(dev, buffer, rb_len); - if (send_len < rb_len) { - LOG_ERR("Drop %d bytes", rb_len - send_len); - } - - LOG_DBG("ringbuf -> tty fifo %d bytes", send_len); - } - } -} - -int main(void) -{ - int ret; - - if (!device_is_ready(uart_dev)) { - LOG_ERR("CDC ACM device not ready"); - return 0; - } - - ret = usb_enable(NULL); - if (ret != 0) { - LOG_ERR("Failed to enable USB"); - return 0; - } - - ring_buf_init(&ringbuf, sizeof(ring_buffer), ring_buffer); - - LOG_INF("Wait for DTR"); - - while (true) { - uint32_t dtr = 0U; - - uart_line_ctrl_get(uart_dev, UART_LINE_CTRL_DTR, &dtr); - if (dtr) { - break; - } - - k_sleep(K_MSEC(100)); - } - - LOG_INF("DTR set"); - - /* They are optional, we use them to test the interrupt endpoint */ - ret = uart_line_ctrl_set(uart_dev, UART_LINE_CTRL_DCD, 1); - if (ret) { - LOG_WRN("Failed to set DCD, ret code %d", ret); - } - - ret = uart_line_ctrl_set(uart_dev, UART_LINE_CTRL_DSR, 1); - if (ret) { - LOG_WRN("Failed to set DSR, ret code %d", ret); - } - - /* Wait 100ms for the host to do all settings */ - k_msleep(100); - - print_baudrate(uart_dev); - - uart_irq_callback_set(uart_dev, interrupt_handler); - /* Enable rx interrupts */ - uart_irq_rx_enable(uart_dev); - - return 0; -} From 9b48b3cc8919f397fbd6b29189324c017491d177 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 088/881] Revert "[nrf fromlist] tests: drivers: spi: spi_loopback: skip timing test when COVERAGE" This reverts commit 5ca258a1523d6f9a9211c51770fa7e7be2fa27ad. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index ad45fd67991..bb8b9d283b2 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -291,9 +291,6 @@ ZTEST(spi_loopback, test_spi_complete_multiple) /* same as the test_spi_complete_multiple test, but seeing if there is any unreasonable latency */ ZTEST(spi_loopback, test_spi_complete_multiple_timed) { - /* Do not check timing when coverage is enabled */ - Z_TEST_SKIP_IFDEF(CONFIG_COVERAGE); - struct spi_dt_spec *spec = loopback_specs[spec_idx]; const struct spi_buf_set tx = spi_loopback_setup_xfer(tx_bufs_pool, 2, buffer_tx, BUF_SIZE, From eb783506b26458126e51ad36314784755104d8fb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 089/881] Revert "[nrf fromtree] modules: openthread: platform: logging: Take kconfig into account" This reverts commit 20d3002d636dc6cef77d1059dadc1510f99f640e. Signed-off-by: Jukka Rissanen --- modules/openthread/platform/logging.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/openthread/platform/logging.c b/modules/openthread/platform/logging.c index 2445c9c53ed..110bd2ecf54 100644 --- a/modules/openthread/platform/logging.c +++ b/modules/openthread/platform/logging.c @@ -5,10 +5,16 @@ */ #include -#include #include +#include #include +#include "openthread-core-zephyr-config.h" + +#define LOG_MODULE_NAME net_openthread +#define LOG_LEVEL LOG_LEVEL_DBG +#include +LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include "platform-zephyr.h" @@ -43,7 +49,7 @@ void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat int level = log_translate(aLogLevel); va_list param_list; - if (level < 0 || level > CONFIG_OPENTHREAD_PLATFORM_LOG_LEVEL) { + if (level < 0) { return; } From 3ce1e22b9aa4c31afbe4852db5283163bf910d9f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 090/881] Revert "[nrf noup] zms: add lookup cache hash function for legacy ZMS" This reverts commit 476ad665287a8b92e90ba1ec9a1ebd3241018b7a. Signed-off-by: Jukka Rissanen --- subsys/fs/zms/zms.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index 6d3a2b30a3a..bc0d4286739 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -13,12 +13,8 @@ #include #include "zms_priv.h" #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS -#ifdef CONFIG_SETTINGS_ZMS_LEGACY -#include -#else #include #endif -#endif #include LOG_MODULE_REGISTER(fs_zms, CONFIG_ZMS_LOG_LEVEL); @@ -36,40 +32,6 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at static inline size_t zms_lookup_cache_pos(zms_id_t id) { #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS -#ifdef CONFIG_SETTINGS_ZMS_LEGACY - /* - * 1. The ZMS settings backend uses up to (ZMS_NAME_ID_OFFSET - 1) ZMS IDs to - store keys and equal number of ZMS IDs to store values. - * 2. For each key-value pair, the value is stored at ZMS ID greater by exactly - * ZMS_NAME_ID_OFFSET than ZMS ID that holds the key. - * 3. The backend tries to minimize the range of ZMS IDs used to store keys. - * That is, ZMS IDs are allocated sequentially, and freed ZMS IDs are reused - * before allocating new ones. - * - * Therefore, to assure the least number of collisions in the lookup cache, - * the least significant bit of the hash indicates whether the given ZMS ID - * represents a key or a value, and remaining bits of the hash are set to - * the ordinal number of the key-value pair. Consequently, the hash function - * provides the following mapping: - * - * 1st settings key => hash 0 - * 1st settings value => hash 1 - * 2nd settings key => hash 2 - * 2nd settings value => hash 3 - * ... - */ - BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAMECNT_ID), "ZMS_NAMECNT_ID is not power of 2"); - BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAME_ID_OFFSET), "ZMS_NAME_ID_OFFSET is not power of 2"); - - uint32_t key_value_bit; - uint32_t key_value_ord; - uint32_t hash; - - key_value_bit = (id >> LOG2(ZMS_NAME_ID_OFFSET)) & 1; - key_value_ord = id & (ZMS_NAME_ID_OFFSET - 1); - - hash = ((key_value_ord << 1) | key_value_bit); -#else /* * 1. Settings subsystem is storing the name ID and the linked list node ID * with only one bit difference at BIT(0). @@ -95,7 +57,6 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; -#endif /* CONFIG_SETTINGS_ZMS_LEGACY */ #elif defined(CONFIG_ZMS_ID_64BIT) /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ From 6cadf54590c917e925f9fc9be07890722c388b71 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 091/881] Revert "[nrf fromlist] tests: zms: Add test coverage for ZMS_ID_64BIT" This reverts commit 9311d969c2e501e2f01249d92304193acc20cedb. Signed-off-by: Jukka Rissanen --- tests/subsys/fs/zms/src/main.c | 56 ++++--------------------------- tests/subsys/fs/zms/testcase.yaml | 6 ---- 2 files changed, 6 insertions(+), 56 deletions(-) diff --git a/tests/subsys/fs/zms/src/main.c b/tests/subsys/fs/zms/src/main.c index bcdb739161d..f307fe1b3a7 100644 --- a/tests/subsys/fs/zms/src/main.c +++ b/tests/subsys/fs/zms/src/main.c @@ -578,19 +578,17 @@ ZTEST_F(zms, test_zms_gc_corrupt_close_ate) int err; Z_TEST_SKIP_IFNDEF(CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES); - memset(&close_ate, 0xff, sizeof(struct zms_ate)); - close_ate.id = ZMS_HEAD_ID; + close_ate.id = 0xffffffff; close_ate.offset = fixture->fs.sector_size - sizeof(struct zms_ate) * 5; close_ate.len = 0; + close_ate.metadata = 0xffffffff; close_ate.cycle_cnt = 1; close_ate.crc8 = 0xff; /* Incorrect crc8 */ - memset(&empty_ate, 0, sizeof(struct zms_ate)); - empty_ate.id = ZMS_HEAD_ID; + empty_ate.id = 0xffffffff; + empty_ate.offset = 0; empty_ate.len = 0xffff; - empty_ate.metadata = FIELD_PREP(ZMS_VERSION_MASK, ZMS_DEFAULT_VERSION) | - FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | - FIELD_PREP(ZMS_ATE_FORMAT_MASK, ZMS_DEFAULT_ATE_FORMAT); + empty_ate.metadata = 0x4201; empty_ate.cycle_cnt = 1; empty_ate.crc8 = crc8_ccitt(0xff, (uint8_t *)&empty_ate + SIZEOF_FIELD(struct zms_ate, crc8), @@ -651,7 +649,7 @@ ZTEST_F(zms, test_zms_gc_corrupt_ate) struct zms_ate close_ate; int err; - close_ate.id = ZMS_HEAD_ID; + close_ate.id = 0xffffffff; close_ate.offset = fixture->fs.sector_size / 2; close_ate.len = 0; close_ate.crc8 = @@ -898,45 +896,3 @@ ZTEST_F(zms, test_zms_cache_hash_quality) ztest_test_skip(); #endif } - -/* - * Test 64 bit ZMS ID support. - */ -ZTEST_F(zms, test_zms_id_64bit) -{ - int err; - ssize_t len; - uint64_t data; - uint64_t filling_id = 0xdeadbeefULL; - - Z_TEST_SKIP_IFNDEF(CONFIG_ZMS_ID_64BIT); - - err = zms_mount(&fixture->fs); - zassert_true(err == 0, "zms_mount call failure: %d", err); - - /* Fill the first sector with writes of different IDs */ - - while (fixture->fs.data_wra + sizeof(data) + sizeof(struct zms_ate) <= - fixture->fs.ate_wra) { - data = filling_id; - len = zms_write(&fixture->fs, (zms_id_t)filling_id, &data, sizeof(data)); - zassert_true(len == sizeof(data), "zms_write failed: %d", len); - - /* Choose the next ID so that its lower 32 bits stay invariant. - * The purpose is to test that ZMS doesn't mistakenly cast the - * 64 bit ID to a 32 bit one somewhere. - */ - filling_id += BIT64(32); - } - - /* Read back the written entries and check that they're all unique */ - - for (uint64_t id = 0xdeadbeefULL; id < filling_id; id += BIT64(32)) { - len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 0); - zassert_true(len == sizeof(data), "zms_read_hist unexpected failure: %d", len); - zassert_equal(data, id, "read unexpected data: %llx instead of %llx", data, id); - - len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 1); - zassert_true(len == -ENOENT, "zms_read_hist unexpected failure: %d", len); - } -} diff --git a/tests/subsys/fs/zms/testcase.yaml b/tests/subsys/fs/zms/testcase.yaml index 14cb7e9c36a..4949e1be0c6 100644 --- a/tests/subsys/fs/zms/testcase.yaml +++ b/tests/subsys/fs/zms/testcase.yaml @@ -27,9 +27,3 @@ tests: platform_allow: - native_sim - qemu_x86 - filesystem.zms.id_64bit: - extra_configs: - - CONFIG_ZMS_ID_64BIT=y - - CONFIG_ZMS_LOOKUP_CACHE=y - - CONFIG_ZMS_LOOKUP_CACHE_SIZE=64 - platform_allow: qemu_x86 From 734cc04d18a41a058f36e48e70a6420c78decc5d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:11:59 +0300 Subject: [PATCH 092/881] Revert "[nrf fromlist] zms: Initial support for 64 bit IDs" This reverts commit 019a9ebb2b08eacf2876dd2a10e9b0c6db97f7a1. Signed-off-by: Jukka Rissanen --- include/zephyr/fs/zms.h | 21 ++------ subsys/fs/zms/Kconfig | 11 ---- subsys/fs/zms/zms.c | 108 ++++++++++++--------------------------- subsys/fs/zms/zms_priv.h | 35 +------------ 4 files changed, 40 insertions(+), 135 deletions(-) diff --git a/include/zephyr/fs/zms.h b/include/zephyr/fs/zms.h index 436f448f6b4..8b776b426f9 100644 --- a/include/zephyr/fs/zms.h +++ b/include/zephyr/fs/zms.h @@ -77,17 +77,6 @@ struct zms_fs { * @{ */ -/** - * @brief ID type used in the ZMS API. - * - * @note The width of this type depends on @kconfig{CONFIG_ZMS_ID_64BIT}. - */ -#if CONFIG_ZMS_ID_64BIT -typedef uint64_t zms_id_t; -#else -typedef uint32_t zms_id_t; -#endif - /** * @brief Mount a ZMS file system onto the device specified in `fs`. * @@ -138,7 +127,7 @@ int zms_clear(struct zms_fs *fs); * @retval -EINVAL if `len` is invalid. * @retval -ENOSPC if no space is left on the device. */ -ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len); +ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len); /** * @brief Delete an entry from the file system @@ -151,7 +140,7 @@ ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len); * @retval -ENXIO if there is a device error. * @retval -EIO if there is a memory read/write error. */ -int zms_delete(struct zms_fs *fs, zms_id_t id); +int zms_delete(struct zms_fs *fs, uint32_t id); /** * @brief Read an entry from the file system. @@ -169,7 +158,7 @@ int zms_delete(struct zms_fs *fs, zms_id_t id); * @retval -EIO if there is a memory read/write error. * @retval -ENOENT if there is no entry with the given `id`. */ -ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len); +ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len); /** * @brief Read a history entry from the file system. @@ -189,7 +178,7 @@ ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len); * @retval -EIO if there is a memory read/write error. * @retval -ENOENT if there is no entry with the given `id` and history counter. */ -ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt); +ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt); /** * @brief Gets the length of the data that is stored in an entry with a given `id` @@ -204,7 +193,7 @@ ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, ui * @retval -EIO if there is a memory read/write error. * @retval -ENOENT if there is no entry with the given id and history counter. */ -ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id); +ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id); /** * @brief Calculate the available free space in the file system. diff --git a/subsys/fs/zms/Kconfig b/subsys/fs/zms/Kconfig index 3beb3b0dc34..f371d75647f 100644 --- a/subsys/fs/zms/Kconfig +++ b/subsys/fs/zms/Kconfig @@ -15,15 +15,6 @@ config ZMS if ZMS -config ZMS_ID_64BIT - bool "64 bit ZMS IDs" - help - When this option is true, the `zms_id_t` values passed to ZMS APIs will be 64 bit, - as opposed to the default 32 bit. - This option will also change the format of allocation table entries (ATEs) in memory - to accommodate larger IDs. Currently, this will make ZMS unable to mount an existing - file system if it has been initialized with a different ATE format. - config ZMS_LOOKUP_CACHE bool "ZMS lookup cache" help @@ -42,7 +33,6 @@ config ZMS_LOOKUP_CACHE_SIZE config ZMS_DATA_CRC bool "ZMS data CRC" - depends on !ZMS_ID_64BIT config ZMS_CUSTOMIZE_BLOCK_SIZE bool "Customize the size of the buffer used internally for reads and writes" @@ -63,7 +53,6 @@ config ZMS_CUSTOM_BLOCK_SIZE config ZMS_LOOKUP_CACHE_FOR_SETTINGS bool "ZMS Storage lookup cache optimized for settings" depends on ZMS_LOOKUP_CACHE && SETTINGS_ZMS - depends on !ZMS_ID_64BIT help Enable usage of lookup cache based on hashes to get, the best ZMS performance, provided that the ZMS is used only for the purpose of providing the settings diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index bc0d4286739..80b86a41cdc 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -29,8 +29,10 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at #ifdef CONFIG_ZMS_LOOKUP_CACHE -static inline size_t zms_lookup_cache_pos(zms_id_t id) +static inline size_t zms_lookup_cache_pos(uint32_t id) { + uint32_t hash = id; + #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS /* * 1. Settings subsystem is storing the name ID and the linked list node ID @@ -50,27 +52,14 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) uint32_t key_value_bit; uint32_t key_value_hash; uint32_t key_value_ll; - uint32_t hash; key_value_bit = (id >> LOG2(ZMS_DATA_ID_OFFSET)) & 1; key_value_hash = (id & ZMS_HASH_MASK) >> (CONFIG_SETTINGS_ZMS_MAX_COLLISIONS_BITS + 1); key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; - -#elif defined(CONFIG_ZMS_ID_64BIT) - /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ - uint64_t hash = id; - - hash ^= hash >> 32; - hash *= 0x42ab4abe4c475039ULL; - hash ^= hash >> 31; - hash *= 0xfa90c4424c537791ULL; - hash ^= hash >> 32; #else /* 32-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ - uint32_t hash = id; - hash ^= hash >> 16; hash *= 0x7feb352dU; hash ^= hash >> 15; @@ -250,7 +239,7 @@ static int zms_flash_ate_wrt(struct zms_fs *fs, const struct zms_ate *entry) goto end; } #ifdef CONFIG_ZMS_LOOKUP_CACHE - /* ZMS_HEAD_ID is a special-purpose identifier. Exclude it from the cache */ + /* 0xFFFFFFFF is a special-purpose identifier. Exclude it from the cache */ if (entry->id != ZMS_HEAD_ID) { fs->lookup_cache[zms_lookup_cache_pos(entry->id)] = fs->ate_wra; } @@ -498,7 +487,7 @@ static bool zms_close_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) /* zms_empty_ate_valid validates an sector empty ate. * A valid sector empty ate should be: * - a valid ate - * - with len = 0xffff and id = ZMS_HEAD_ID + * - with len = 0xffff and id = 0xffffffff * return true if valid, false otherwise */ static bool zms_empty_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) @@ -511,7 +500,7 @@ static bool zms_empty_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) * Valid gc_done_ate: * - valid ate * - len = 0 - * - id = ZMS_HEAD_ID + * - id = 0xffffffff * return true if valid, false otherwise */ static bool zms_gc_done_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) @@ -520,18 +509,6 @@ static bool zms_gc_done_ate_valid(struct zms_fs *fs, const struct zms_ate *entry (entry->id == ZMS_HEAD_ID)); } -/* zms_sector_closed checks whether the current sector is closed, which would imply - * that the empty ATE and close ATE are both valid and have matching cycle counters - * - * return true if closed, false otherwise - */ -static bool zms_sector_closed(struct zms_fs *fs, struct zms_ate *empty_ate, - struct zms_ate *close_ate) -{ - return (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && - (empty_ate->cycle_cnt == close_ate->cycle_cnt)); -} - /* Read empty and close ATE of the sector where belongs address "addr" and * validates that the sector is closed. * retval: 0 if sector is not close @@ -549,7 +526,8 @@ static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct z return rc; } - if (zms_sector_closed(fs, empty_ate, close_ate)) { + if (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && + (empty_ate->cycle_cnt == close_ate->cycle_cnt)) { /* Closed sector validated */ return 1; } @@ -558,7 +536,7 @@ static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct z } /* store an entry in flash */ -static int zms_flash_write_entry(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) +static int zms_flash_write_entry(struct zms_fs *fs, uint32_t id, const void *data, size_t len) { int rc; struct zms_ate entry; @@ -571,13 +549,13 @@ static int zms_flash_write_entry(struct zms_fs *fs, zms_id_t id, const void *dat entry.cycle_cnt = fs->sector_cycle; if (len > ZMS_DATA_IN_ATE_SIZE) { -#ifdef CONFIG_ZMS_DATA_CRC - /* only compute CRC if data is to be stored outside of entry */ - entry.data_crc = crc32_ieee(data, len); -#endif + /* only compute CRC if len is greater than 8 bytes */ + if (IS_ENABLED(CONFIG_ZMS_DATA_CRC)) { + entry.data_crc = crc32_ieee(data, len); + } entry.offset = (uint32_t)SECTOR_OFFSET(fs->data_wra); } else if ((len > 0) && (len <= ZMS_DATA_IN_ATE_SIZE)) { - /* Copy data into entry for small data (at most ZMS_DATA_IN_ATE_SIZE bytes) */ + /* Copy data into entry for small data ( < 8B) */ memcpy(&entry.data, data, len); } @@ -710,12 +688,10 @@ static int zms_sector_close(struct zms_fs *fs) struct zms_ate close_ate; struct zms_ate garbage_ate; - /* Initialize all members to 0xff */ - memset(&close_ate, 0xff, sizeof(struct zms_ate)); - close_ate.id = ZMS_HEAD_ID; close_ate.len = 0U; close_ate.offset = (uint32_t)SECTOR_OFFSET(fs->ate_wra + fs->ate_size); + close_ate.metadata = 0xffffffff; close_ate.cycle_cnt = fs->sector_cycle; /* When we close the sector, we must write all non used ATE with @@ -764,13 +740,11 @@ static int zms_add_gc_done_ate(struct zms_fs *fs) { struct zms_ate gc_done_ate; - /* Initialize all members to 0xff */ - memset(&gc_done_ate, 0xff, sizeof(struct zms_ate)); - LOG_DBG("Adding gc done ate at %llx", fs->ate_wra); gc_done_ate.id = ZMS_HEAD_ID; gc_done_ate.len = 0U; gc_done_ate.offset = (uint32_t)SECTOR_OFFSET(fs->data_wra); + gc_done_ate.metadata = 0xffffffff; gc_done_ate.cycle_cnt = fs->sector_cycle; zms_ate_crc8_update(&gc_done_ate); @@ -819,17 +793,14 @@ static int zms_add_empty_ate(struct zms_fs *fs, uint64_t addr) int rc = 0; uint64_t previous_ate_wra; - /* Initialize all members to 0 */ - memset(&empty_ate, 0, sizeof(struct zms_ate)); - addr &= ADDR_SECT_MASK; LOG_DBG("Adding empty ate at %llx", (uint64_t)(addr + fs->sector_size - fs->ate_size)); empty_ate.id = ZMS_HEAD_ID; empty_ate.len = 0xffff; - empty_ate.metadata = FIELD_PREP(ZMS_VERSION_MASK, ZMS_DEFAULT_VERSION) | - FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | - FIELD_PREP(ZMS_ATE_FORMAT_MASK, ZMS_DEFAULT_ATE_FORMAT); + empty_ate.offset = 0U; + empty_ate.metadata = + FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | ZMS_DEFAULT_VERSION; rc = zms_get_sector_cycle(fs, addr, &cycle_cnt); if (rc == -ENOENT) { @@ -922,7 +893,7 @@ static int zms_get_sector_header(struct zms_fs *fs, uint64_t addr, struct zms_at * @retval 1 valid ATE with same ID found * @retval < 0 An error happened */ -static int zms_find_ate_with_id(struct zms_fs *fs, zms_id_t id, uint64_t start_addr, +static int zms_find_ate_with_id(struct zms_fs *fs, uint32_t id, uint64_t start_addr, uint64_t end_addr, struct zms_ate *ate, uint64_t *ate_addr) { int rc; @@ -1073,10 +1044,10 @@ static int zms_gc(struct zms_fs *fs) */ if (wlk_prev_addr == gc_prev_addr) { /* copy needed */ - LOG_DBG("Moving %lld, len %d", (long long)gc_ate.id, gc_ate.len); + LOG_DBG("Moving %d, len %d", gc_ate.id, gc_ate.len); if (gc_ate.len > ZMS_DATA_IN_ATE_SIZE) { - /* Copy Data only when len > ZMS_DATA_IN_ATE_SIZE + /* Copy Data only when len > 8 * Otherwise, Data is already inside ATE */ data_addr = (gc_prev_addr & ADDR_SECT_MASK); @@ -1180,28 +1151,16 @@ static int zms_init(struct zms_fs *fs) for (i = 0; i < fs->sector_count; i++) { addr = zms_close_ate_addr(fs, ((uint64_t)i << ADDR_SECT_SHIFT)); - /* read the header ATEs */ - rc = zms_get_sector_header(fs, addr, &empty_ate, &close_ate); - if (rc) { + /* verify if the sector is closed */ + sec_closed = zms_validate_closed_sector(fs, addr, &empty_ate, &close_ate); + if (sec_closed < 0) { + rc = sec_closed; goto end; } /* update cycle count */ fs->sector_cycle = empty_ate.cycle_cnt; - /* Check the ATE format indicator so that we know how to validate ATEs. - * The metadata field has the same offset and size in all ATE formats - * (the same is guaranteed for crc8 and cycle_cnt). - * Currently, ZMS can only recognize one of its supported ATE formats - * (the one chosen at build time), so their indicators are defined for - * the possibility of a future extension. - * If this indicator is unknown, then consider the header ATEs invalid, - * because we might not be dealing with ZMS contents at all. - */ - if (ZMS_GET_ATE_FORMAT(empty_ate.metadata) != ZMS_DEFAULT_ATE_FORMAT) { - continue; - } - - if (zms_sector_closed(fs, &empty_ate, &close_ate)) { + if (sec_closed == 1) { /* closed sector */ closed_sectors++; /* Let's verify that this is a ZMS storage system */ @@ -1259,8 +1218,7 @@ static int zms_init(struct zms_fs *fs) goto end; } - if ((ZMS_GET_ATE_FORMAT(empty_ate.metadata) == ZMS_DEFAULT_ATE_FORMAT) && - zms_empty_ate_valid(fs, &empty_ate)) { + if (zms_empty_ate_valid(fs, &empty_ate)) { /* Empty ATE is valid, let's verify that this is a ZMS storage system */ if (ZMS_GET_MAGIC_NUMBER(empty_ate.metadata) == ZMS_MAGIC_NUMBER) { zms_magic_exist = true; @@ -1500,7 +1458,7 @@ int zms_mount(struct zms_fs *fs) return 0; } -ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) +ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len) { int rc; size_t data_size; @@ -1640,12 +1598,12 @@ ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) return rc; } -int zms_delete(struct zms_fs *fs, zms_id_t id) +int zms_delete(struct zms_fs *fs, uint32_t id) { return zms_write(fs, id, NULL, 0); } -ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt) +ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt) { int rc; int prev_found = 0; @@ -1742,7 +1700,7 @@ ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, ui return rc; } -ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len) +ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len) { int rc; @@ -1755,7 +1713,7 @@ ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len) return MIN(rc, len); } -ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id) +ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id) { int rc; diff --git a/subsys/fs/zms/zms_priv.h b/subsys/fs/zms/zms_priv.h index 44cfb2f3d28..84f77296f4f 100644 --- a/subsys/fs/zms/zms_priv.h +++ b/subsys/fs/zms/zms_priv.h @@ -28,6 +28,7 @@ #endif #define ZMS_LOOKUP_CACHE_NO_ADDR GENMASK64(63, 0) +#define ZMS_HEAD_ID GENMASK(31, 0) #define ZMS_VERSION_MASK GENMASK(7, 0) #define ZMS_GET_VERSION(x) FIELD_GET(ZMS_VERSION_MASK, x) @@ -35,28 +36,14 @@ #define ZMS_MAGIC_NUMBER 0x42 /* murmur3a hash of "ZMS" (MSB) */ #define ZMS_MAGIC_NUMBER_MASK GENMASK(15, 8) #define ZMS_GET_MAGIC_NUMBER(x) FIELD_GET(ZMS_MAGIC_NUMBER_MASK, x) -#define ZMS_ATE_FORMAT_MASK GENMASK(19, 16) -#define ZMS_GET_ATE_FORMAT(x) FIELD_GET(ZMS_ATE_FORMAT_MASK, x) #define ZMS_MIN_ATE_NUM 5 #define ZMS_INVALID_SECTOR_NUM -1 - -#define ZMS_ATE_FORMAT_ID_32BIT 0 -#define ZMS_ATE_FORMAT_ID_64BIT 1 - -#if !defined(CONFIG_ZMS_ID_64BIT) -#define ZMS_DEFAULT_ATE_FORMAT ZMS_ATE_FORMAT_ID_32BIT -#define ZMS_HEAD_ID GENMASK(31, 0) -#else -#define ZMS_DEFAULT_ATE_FORMAT ZMS_ATE_FORMAT_ID_64BIT -#define ZMS_HEAD_ID GENMASK64(63, 0) -#endif /* CONFIG_ZMS_ID_64BIT */ +#define ZMS_DATA_IN_ATE_SIZE 8 /** * @ingroup zms_data_structures * ZMS Allocation Table Entry (ATE) structure - * - * @note This structure depends on @kconfig{CONFIG_ZMS_ID_64BIT}. */ struct zms_ate { /** crc8 check of the entry */ @@ -65,8 +52,6 @@ struct zms_ate { uint8_t cycle_cnt; /** data len within sector */ uint16_t len; - -#if ZMS_DEFAULT_ATE_FORMAT == ZMS_ATE_FORMAT_ID_32BIT /** data id */ uint32_t id; union { @@ -90,22 +75,6 @@ struct zms_ate { }; }; }; - -#elif ZMS_DEFAULT_ATE_FORMAT == ZMS_ATE_FORMAT_ID_64BIT - /** data id */ - uint64_t id; - union { - /** data field used to store small sized data */ - uint8_t data[4]; - /** data offset within sector */ - uint32_t offset; - /** Used to store metadata information such as storage version. */ - uint32_t metadata; - }; -#endif /* ZMS_DEFAULT_ATE_FORMAT */ - } __packed; -#define ZMS_DATA_IN_ATE_SIZE SIZEOF_FIELD(struct zms_ate, data) - #endif /* __ZMS_PRIV_H_ */ From f72c4b4d30d926a8ac7193521e0b7a4973454a37 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 093/881] Revert "[nrf fromtree] modules: hal_nordic: nrfs: Disabling subscription" This reverts commit 28bdaa3f38fbd01abb4d894fd1f2272306694a7a. Signed-off-by: Jukka Rissanen --- drivers/sensor/nordic/temp/Kconfig | 4 ++-- modules/hal_nordic/nrfs/Kconfig | 8 -------- modules/hal_nordic/nrfs/nrfs_config.h | 4 ---- soc/nordic/nrf92/Kconfig | 2 -- .../temp_sensor/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 + west.yml | 2 +- 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/sensor/nordic/temp/Kconfig b/drivers/sensor/nordic/temp/Kconfig index 6641fcf5cb2..e32fb1b8fdd 100644 --- a/drivers/sensor/nordic/temp/Kconfig +++ b/drivers/sensor/nordic/temp/Kconfig @@ -28,11 +28,11 @@ config TEMP_NRFS Enable driver for nRF temperature sensor accessed through the nRF Services (nrfs) layer. -if TEMP_NRFS && NRFS_TEMP_SERVICE_SUBSCRIPTION_ENABLED +if TEMP_NRFS module = TEMP_NRFS thread_priority = 10 thread_stack_size = 1024 source "drivers/sensor/Kconfig.trigger_template" -endif +endif # TEMP_NRFS diff --git a/modules/hal_nordic/nrfs/Kconfig b/modules/hal_nordic/nrfs/Kconfig index 166520d9d01..f5d4e92f94d 100644 --- a/modules/hal_nordic/nrfs/Kconfig +++ b/modules/hal_nordic/nrfs/Kconfig @@ -46,9 +46,6 @@ config NRFS_HAS_TEMP_SERVICE config NRFS_HAS_VBUS_DETECTOR_SERVICE bool -config NRFS_TEMP_SERVICE_HAS_SUBSCRIPTION_SERVICE - bool - config NRFS bool "nRF Services Support" select NRFS_LOCAL_DOMAIN if SOC_NRF54H20_CPUAPP || \ @@ -96,11 +93,6 @@ config NRFS_TEMP_SERVICE_ENABLED depends on NRFS_HAS_TEMP_SERVICE default y -config NRFS_TEMP_SERVICE_SUBSCRIPTION_ENABLED - bool "Subscription feature for the temperature service" - depends on NRFS_TEMP_SERVICE_HAS_SUBSCRIPTION_SERVICE - default y - config NRFS_VBUS_DETECTOR_SERVICE_ENABLED bool "VBUS detector for the USB peripheral" depends on NRFS_HAS_VBUS_DETECTOR_SERVICE diff --git a/modules/hal_nordic/nrfs/nrfs_config.h b/modules/hal_nordic/nrfs/nrfs_config.h index 3ef87a8af39..9d1a9b7b6b3 100644 --- a/modules/hal_nordic/nrfs/nrfs_config.h +++ b/modules/hal_nordic/nrfs/nrfs_config.h @@ -12,10 +12,6 @@ #define NRFS_TEMP_SERVICE_ENABLED #endif -#ifdef CONFIG_NRFS_TEMP_SERVICE_SUBSCRIPTION_ENABLED -#define NRFS_TEMP_SERVICE_SUBSCRIPTION_ENABLED -#endif - #ifdef CONFIG_NRFS_MRAM_SERVICE_ENABLED #define NRFS_MRAM_SERVICE_ENABLED #endif diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index eea33654f57..a7769c00b6f 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -28,7 +28,6 @@ config SOC_NRF9230_ENGB_CPUAPP select NRFS_HAS_PMIC_SERVICE select NRFS_HAS_TEMP_SERVICE select NRFS_HAS_VBUS_DETECTOR_SERVICE - select NRFS_TEMP_SERVICE_HAS_SUBSCRIPTION_SERVICE config SOC_NRF9230_ENGB_CPURAD select ARM @@ -47,7 +46,6 @@ config SOC_NRF9230_ENGB_CPURAD select NRFS_HAS_MRAM_SERVICE select NRFS_HAS_PMIC_SERVICE select NRFS_HAS_TEMP_SERVICE - select NRFS_TEMP_SERVICE_HAS_SUBSCRIPTION_SERVICE config SOC_NRF9230_ENGB_CPUPPR select RISCV_CORE_NORDIC_VPR diff --git a/tests/drivers/sensor/temp_sensor/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/sensor/temp_sensor/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 219e5ebb46e..371797173d9 100644 --- a/tests/drivers/sensor/temp_sensor/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/drivers/sensor/temp_sensor/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1 +1,2 @@ CONFIG_NRFS=y +CONFIG_TEMP_NRFS_TRIGGER_OWN_THREAD=y diff --git a/west.yml b/west.yml index 4d20267c8b4..b5ace932db2 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: a6579483deb33112cc763d05a4a3f8085883c1ac + revision: 2f5d4e5868ab573eac932fa4bc142565073c3c04 path: modules/hal/nordic groups: - hal From 01d7de0917b9dc12516f77ac104835f42413d5bb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 094/881] Revert "[nrf fromtree] bluetooth: host: gatt: destroy key after hash calc completes" This reverts commit 6b0cb071611744ed47c8ddd810443e23f954483b. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/gatt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index a99a497749f..12ec91c78e4 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -755,8 +755,6 @@ static int db_hash_finish(struct gen_hash_state *state) size_t mac_length; psa_status_t ret = psa_mac_sign_finish(&(state->operation), db_hash.hash, 16, &mac_length); - psa_destroy_key(state->key); - if (ret != PSA_SUCCESS) { LOG_ERR("CMAC finish failed %d", ret); return -EIO; From d1874a4f637f00aaba2f3e53e95e72a63104d2f5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 095/881] Revert "[nrf fromlist] boards: nordic: nrf54l15dk: Extend ext memory node with reset GPIO" This reverts commit f940b644def12ee10ae0285ea067236e7c375750. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi index f3c1d924d27..46f9d797b61 100644 --- a/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi @@ -134,7 +134,6 @@ has-dpd; t-enter-dpd = <10000>; t-exit-dpd = <35000>; - reset-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; }; }; From 046e49f31856f6471f36f95b5a9d467534e0679e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 096/881] Revert "[nrf fromtree] scripts: twister: handlers: Append dev-id for runner nrfutil_next" This reverts commit 4e2451d0397c2b95f5d393f72afd4bd6b58ee81e. Signed-off-by: Jukka Rissanen --- .../src/twister_harness/device/hardware_adapter.py | 2 +- scripts/pylib/twister/twisterlib/handlers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py b/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py index 37751f69d86..79a3a935644 100644 --- a/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py +++ b/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py @@ -76,7 +76,7 @@ def _prepare_runner_args(self) -> tuple[list[str], list[str]]: elif runner == "esp32": extra_args.append("--esp-device") extra_args.append(board_id) - elif runner in ('nrfjprog', 'nrfutil', 'nrfutil_next'): + elif runner in ('nrfjprog', 'nrfutil'): extra_args.append('--dev-id') extra_args.append(board_id) elif runner == 'openocd' and self.device_config.product in ['STM32 STLink', 'STLINK-V3']: diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index 30c40e01c8e..dc1ff258935 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -566,7 +566,7 @@ def _create_command(self, runner, hardware): board_id = hardware.probe_id or hardware.id product = hardware.product if board_id is not None: - if runner in ("pyocd", "nrfjprog", "nrfutil", "nrfutil_next"): + if runner in ("pyocd", "nrfjprog", "nrfutil"): command_extra_args.append("--dev-id") command_extra_args.append(board_id) elif runner == "esp32": From a546e7861080ccffd52c73c08f35e6f9b97a5c17 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 097/881] Revert "[nrf fromtree] boards: nordic: nrf54lm20dk: Extend ext memory node with reset GPIO" This reverts commit 58e6d5e8c487ce076048e0b54ed6776411b3999e. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index 1d916f8189e..3591a800948 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -166,6 +166,5 @@ zephyr_udc0: &usbhs { has-dpd; t-enter-dpd = <10000>; t-exit-dpd = <35000>; - reset-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; }; }; From 4a601262255094992702966f415d011024b52a14 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 098/881] Revert "[nrf fromlist] tests: zms: Minor improvements" This reverts commit 664645d0256abc6f5ab40a7b617775ce83d7ccb4. Signed-off-by: Jukka Rissanen --- tests/subsys/fs/zms/src/main.c | 9 +-------- tests/subsys/fs/zms/testcase.yaml | 9 ++++----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/subsys/fs/zms/src/main.c b/tests/subsys/fs/zms/src/main.c index f307fe1b3a7..14d6291970c 100644 --- a/tests/subsys/fs/zms/src/main.c +++ b/tests/subsys/fs/zms/src/main.c @@ -752,8 +752,6 @@ ZTEST_F(zms, test_zms_cache_init) num = num_matching_cache_entries(ate_addr, false, &fixture->fs); zassert_equal(num, 1, "invalid cache entry after restart"); -#else - ztest_test_skip(); #endif } @@ -782,8 +780,6 @@ ZTEST_F(zms, test_zms_cache_collission) zassert_equal(err, sizeof(data), "zms_read call failure: %d", err); zassert_equal(data, id, "incorrect data read"); } -#else - ztest_test_skip(); #endif } @@ -833,8 +829,6 @@ ZTEST_F(zms, test_zms_cache_gc) num = num_matching_cache_entries(2ULL << ADDR_SECT_SHIFT, true, &fixture->fs); zassert_equal(num, 2, "invalid cache content after gc"); -#else - ztest_test_skip(); #endif } @@ -892,7 +886,6 @@ ZTEST_F(zms, test_zms_cache_hash_quality) TC_PRINT("Cache occupancy: %u\n", (unsigned int)num); zassert_between_inclusive(num, MIN_CACHE_OCCUPANCY, CONFIG_ZMS_LOOKUP_CACHE_SIZE, "too low cache occupancy - poor hash quality"); -#else - ztest_test_skip(); + #endif } diff --git a/tests/subsys/fs/zms/testcase.yaml b/tests/subsys/fs/zms/testcase.yaml index 4949e1be0c6..bdee4529f2a 100644 --- a/tests/subsys/fs/zms/testcase.yaml +++ b/tests/subsys/fs/zms/testcase.yaml @@ -8,21 +8,20 @@ tests: extra_args: DTC_OVERLAY_FILE=boards/qemu_x86_ev_0x00.overlay platform_allow: qemu_x86 filesystem.zms.sim.no_erase: - extra_configs: - - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n + extra_args: CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n platform_allow: qemu_x86 filesystem.zms.sim.corrupt_close: - extra_configs: + extra_args: - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=y - CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y platform_allow: qemu_x86 filesystem.zms.cache: - extra_configs: + extra_args: - CONFIG_ZMS_LOOKUP_CACHE=y - CONFIG_ZMS_LOOKUP_CACHE_SIZE=64 platform_allow: native_sim filesystem.zms.data_crc: - extra_configs: + extra_args: - CONFIG_ZMS_DATA_CRC=y platform_allow: - native_sim From 190a5919c9e025b65e16c63bbd4f5db2cd0f6522 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 099/881] Revert "[nrf fromlist] drivers: adc: nrfx_saadc: Fix for negative samples correction" This reverts commit 778ca5fed933dba356bc3c8003915749775ac031. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 61497326174..50aef053fd9 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -550,11 +550,10 @@ static void correct_single_ended(const struct adc_sequence *sequence, nrf_saadc_ { int16_t *sample = (int16_t *)buffer; uint8_t selected_channels = sequence->channels; - uint8_t divide_mask = m_data.divide_single_ended_value; - uint8_t single_ended_mask = m_data.single_ended_channels; + uint8_t divide_single_ended_value = m_data.divide_single_ended_value; if (m_data.internal_timer_enabled) { - if (selected_channels & divide_mask) { + if (selected_channels & divide_single_ended_value) { for (int i = 0; i < num_samples; i++) { sample[i] /= 2; } @@ -565,22 +564,20 @@ static void correct_single_ended(const struct adc_sequence *sequence, nrf_saadc_ } } } - return; - } - - for (uint16_t channel_bit = BIT(0); channel_bit <= single_ended_mask; channel_bit <<= 1) { - if (!(channel_bit & selected_channels)) { - continue; - } - - if (channel_bit & single_ended_mask) { - if (channel_bit & divide_mask) { - *sample /= 2; - } else if (*sample < 0) { - *sample = 0; + } else { + uint8_t single_ended_channels = m_data.single_ended_channels; + + for (uint16_t channel_bit = BIT(0); channel_bit <= single_ended_channels; + channel_bit <<= 1) { + if (channel_bit & selected_channels & single_ended_channels) { + if (channel_bit & divide_single_ended_value) { + *sample /= 2; + } else if (*sample < 0) { + *sample = 0; + } } + sample++; } - sample++; } } From bdb3aca0f67bec833d9cc1dc0901588c49154a9d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 100/881] Revert "[nrf fromtree] drivers: adc: nrfx: enable negative values for single-ended ADC readings" This reverts commit 77197cecc0575a068c1bd79fcf0aee4eed5ff543. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 46 ++++++---------------- include/zephyr/dt-bindings/adc/nrf-saadc.h | 24 ----------- 2 files changed, 13 insertions(+), 57 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 50aef053fd9..8c21a34f110 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -100,7 +100,6 @@ BUILD_ASSERT((NRF_SAADC_AIN0 == NRF_SAADC_INPUT_AIN0) && struct driver_data { struct adc_context ctx; uint8_t single_ended_channels; - uint8_t divide_single_ended_value; uint8_t active_channel_cnt; void *mem_reg; void *user_buffer; @@ -192,6 +191,7 @@ static int input_assign(nrf_saadc_input_t *pin_p, if (channel_cfg->differential) { if (channel_cfg->input_negative > ARRAY_SIZE(saadc_psels) || + channel_cfg->input_negative < NRF_SAADC_AIN0 || (IS_ENABLED(CONFIG_NRF_PLATFORM_HALTIUM) && (channel_cfg->input_positive > NRF_SAADC_AIN7) != (channel_cfg->input_negative > NRF_SAADC_AIN7))) { @@ -199,17 +199,14 @@ static int input_assign(nrf_saadc_input_t *pin_p, channel_cfg->input_negative); return -EINVAL; } - *pin_n = channel_cfg->input_negative == NRF_SAADC_GND ? - NRF_SAADC_INPUT_DISABLED : - saadc_psels[channel_cfg->input_negative]; + *pin_n = saadc_psels[channel_cfg->input_negative]; } else { *pin_n = NRF_SAADC_INPUT_DISABLED; } #else *pin_p = channel_cfg->input_positive; - *pin_n = (channel_cfg->differential && (channel_cfg->input_negative != NRF_SAADC_GND)) - ? channel_cfg->input_negative - : NRF_SAADC_INPUT_DISABLED; + *pin_n = channel_cfg->differential ? channel_cfg->input_negative + : NRF_SAADC_INPUT_DISABLED; #endif LOG_DBG("ADC positive input: %d", *pin_p); LOG_DBG("ADC negative input: %d", *pin_n); @@ -359,18 +356,11 @@ static int adc_nrfx_channel_setup(const struct device *dev, * after ADC sequence ends. */ if (channel_cfg->differential) { - if (channel_cfg->input_negative == NRF_SAADC_GND) { - ch_cfg->mode = NRF_SAADC_MODE_SINGLE_ENDED; - m_data.single_ended_channels |= BIT(channel_cfg->channel_id); - m_data.divide_single_ended_value |= BIT(channel_cfg->channel_id); - } else { - ch_cfg->mode = NRF_SAADC_MODE_DIFFERENTIAL; - m_data.single_ended_channels &= ~BIT(channel_cfg->channel_id); - } + ch_cfg->mode = NRF_SAADC_MODE_DIFFERENTIAL; + m_data.single_ended_channels &= ~BIT(channel_cfg->channel_id); } else { ch_cfg->mode = NRF_SAADC_MODE_SINGLE_ENDED; m_data.single_ended_channels |= BIT(channel_cfg->channel_id); - m_data.divide_single_ended_value &= ~BIT(channel_cfg->channel_id); } nrfx_err_t ret = nrfx_saadc_channel_config(&cfg); @@ -549,32 +539,22 @@ static void correct_single_ended(const struct adc_sequence *sequence, nrf_saadc_ uint16_t num_samples) { int16_t *sample = (int16_t *)buffer; - uint8_t selected_channels = sequence->channels; - uint8_t divide_single_ended_value = m_data.divide_single_ended_value; if (m_data.internal_timer_enabled) { - if (selected_channels & divide_single_ended_value) { - for (int i = 0; i < num_samples; i++) { - sample[i] /= 2; - } - } else { - for (int i = 0; i < num_samples; i++) { - if (sample[i] < 0) { - sample[i] = 0; - } + for (int i = 0; i < num_samples; i++) { + if (sample[i] < 0) { + sample[i] = 0; } } } else { + uint8_t selected_channels = sequence->channels; uint8_t single_ended_channels = m_data.single_ended_channels; for (uint16_t channel_bit = BIT(0); channel_bit <= single_ended_channels; channel_bit <<= 1) { - if (channel_bit & selected_channels & single_ended_channels) { - if (channel_bit & divide_single_ended_value) { - *sample /= 2; - } else if (*sample < 0) { - *sample = 0; - } + if ((channel_bit & selected_channels & single_ended_channels) && + (*sample < 0)) { + *sample = 0; } sample++; } diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc.h b/include/zephyr/dt-bindings/adc/nrf-saadc.h index e5a86150cd4..4a3deb95cff 100644 --- a/include/zephyr/dt-bindings/adc/nrf-saadc.h +++ b/include/zephyr/dt-bindings/adc/nrf-saadc.h @@ -7,30 +7,6 @@ #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ #define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ -/** - * @brief Short ADC negative input to ground - * - * @details The nRF SAADC hardware only supports differential readings. - * The nRF SAADC SE (single ended) mode is differential with the negative - * input shorted to GND (ground). To use the nRF SAADC SE mode, set the - * negative input to NRF_SAADC_GND: - * - * @code{.dts} - * zephyr,input-positive = ; - * zephyr,input-negative = ; - * @endcode - * - * The nRF SAADC driver also supports using the nRF SAADC SE mode in - * emulated "single-ended" mode, as defined by zephyr. In this mode, - * negative readings will be clamped to 0 by software to emulate the - * behavior of an ADC in "single-ended" mode, as defined by zephyr. To - * do this, only define the positive input: - * - * @code{.dts} - * zephyr,input-positive = ; - * @endcode - */ -#define NRF_SAADC_GND 0 #define NRF_SAADC_AIN0 1 #define NRF_SAADC_AIN1 2 #define NRF_SAADC_AIN2 3 From 88e5c7bcbaa805aeb4291adc70fe5a34806aeba5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 101/881] Revert "[nrf fromtree] drivers: adc: nrfx_saadc: Add support for SAADC internal sampling timer" This reverts commit 605e7799371de1ff935617a1e95fa2f38c208c2c. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 169 ++++++++--------------------------- 1 file changed, 35 insertions(+), 134 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 8c21a34f110..100c3fa66ef 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define ADC_CONTEXT_USES_KERNEL_TIMER #include "adc_context.h" #include #include @@ -103,20 +104,15 @@ struct driver_data { uint8_t active_channel_cnt; void *mem_reg; void *user_buffer; - struct k_timer timer; - bool internal_timer_enabled; }; static struct driver_data m_data = { + ADC_CONTEXT_INIT_TIMER(m_data, ctx), ADC_CONTEXT_INIT_LOCK(m_data, ctx), ADC_CONTEXT_INIT_SYNC(m_data, ctx), .mem_reg = DMM_DEV_TO_REG(DT_NODELABEL(adc)), - .internal_timer_enabled = false, }; -/* Maximum value of the internal timer interval in microseconds. */ -#define ADC_INTERNAL_TIMER_INTERVAL_MAX_US 128U - /* Forward declaration */ static void event_handler(const nrfx_saadc_evt_t *event); @@ -366,7 +362,7 @@ static int adc_nrfx_channel_setup(const struct device *dev, nrfx_err_t ret = nrfx_saadc_channel_config(&cfg); if (ret != NRFX_SUCCESS) { - LOG_ERR("Cannot configure channel %d: 0x%08x", channel_cfg->channel_id, ret); + LOG_ERR("Cannot configure channel %d: %d", channel_cfg->channel_id, ret); return -EINVAL; } @@ -389,58 +385,22 @@ static void adc_context_start_sampling(struct adc_context *ctx) static void adc_context_update_buffer_pointer(struct adc_context *ctx, bool repeat) { - if (!m_data.internal_timer_enabled) { - void *samples_buffer; - - if (!repeat) { - m_data.user_buffer = - (uint16_t *)m_data.user_buffer + m_data.active_channel_cnt; - } - - int error = dmm_buffer_in_prepare( - m_data.mem_reg, m_data.user_buffer, - NRFX_SAADC_SAMPLES_TO_BYTES(m_data.active_channel_cnt), &samples_buffer); - if (error != 0) { - LOG_ERR("DMM buffer allocation failed err=%d", error); - adc_context_complete(ctx, -EIO); - return; - } - - nrfx_err_t nrfx_err = - nrfx_saadc_buffer_set(samples_buffer, m_data.active_channel_cnt); - if (nrfx_err != NRFX_SUCCESS) { - LOG_ERR("Failed to set buffer: 0x%08x", nrfx_err); - adc_context_complete(ctx, -EIO); - } - } -} - -static inline void adc_context_enable_timer(struct adc_context *ctx) -{ - if (!m_data.internal_timer_enabled) { - k_timer_start(&m_data.timer, K_NO_WAIT, K_USEC(ctx->options.interval_us)); - } else { - nrfx_err_t ret = nrfx_saadc_mode_trigger(); + void *samples_buffer; - if (ret != NRFX_SUCCESS) { - LOG_ERR("Cannot start sampling: 0x%08x", ret); - adc_context_complete(&m_data.ctx, -EIO); - } + if (!repeat) { + m_data.user_buffer = (uint16_t *)m_data.user_buffer + m_data.active_channel_cnt; } -} -static inline void adc_context_disable_timer(struct adc_context *ctx) -{ - if (!m_data.internal_timer_enabled) { - k_timer_stop(&m_data.timer); + int error = dmm_buffer_in_prepare( + m_data.mem_reg, m_data.user_buffer, + NRFX_SAADC_SAMPLES_TO_BYTES(m_data.active_channel_cnt), + &samples_buffer); + if (error != 0) { + LOG_ERR("DMM buffer allocation failed err=%d", error); + adc_context_complete(ctx, -EIO); } -} -static void external_timer_expired_handler(struct k_timer *timer_id) -{ - ARG_UNUSED(timer_id); - - adc_context_request_next_sampling(&m_data.ctx); + nrfx_saadc_buffer_set(samples_buffer, m_data.active_channel_cnt); } static int get_resolution(const struct adc_sequence *sequence, nrf_saadc_resolution_t *resolution) @@ -535,46 +495,24 @@ static bool has_single_ended(const struct adc_sequence *sequence) return sequence->channels & m_data.single_ended_channels; } -static void correct_single_ended(const struct adc_sequence *sequence, nrf_saadc_value_t *buffer, - uint16_t num_samples) +static void correct_single_ended(const struct adc_sequence *sequence, nrf_saadc_value_t *buffer) { + uint16_t channel_bit = BIT(0); + uint8_t selected_channels = sequence->channels; + uint8_t single_ended_channels = m_data.single_ended_channels; int16_t *sample = (int16_t *)buffer; - if (m_data.internal_timer_enabled) { - for (int i = 0; i < num_samples; i++) { - if (sample[i] < 0) { - sample[i] = 0; - } - } - } else { - uint8_t selected_channels = sequence->channels; - uint8_t single_ended_channels = m_data.single_ended_channels; - - for (uint16_t channel_bit = BIT(0); channel_bit <= single_ended_channels; - channel_bit <<= 1) { - if ((channel_bit & selected_channels & single_ended_channels) && - (*sample < 0)) { + while (channel_bit <= single_ended_channels) { + if (channel_bit & selected_channels) { + if ((channel_bit & single_ended_channels) && (*sample < 0)) { *sample = 0; } + sample++; } - } -} -/* The internal timer runs at 16 MHz, so to convert the interval in microseconds - * to the internal timer CC value, we can use the formula: - * interval_cc = interval_us * 16 MHz - * where 16 MHz is the frequency of the internal timer. - * - * The maximum value for interval_cc is 2047, which corresponds to - * approximately 7816 Hz ~ 128us. - * The minimum value for interval_cc is depends on the SoC. - */ -static inline uint16_t interval_to_cc(uint16_t interval_us) -{ - NRFX_ASSERT((interval_us <= ADC_INTERNAL_TIMER_INTERVAL_MAX_US) && (interval_us > 0)); - - return (interval_us * 16) - 1; + channel_bit <<= 1; + } } static int start_read(const struct device *dev, @@ -624,29 +562,10 @@ static int start_read(const struct device *dev, return error; } - if ((active_channel_cnt == 1) && (sequence->options != NULL) && - (sequence->options->callback == NULL) && - (sequence->options->interval_us <= ADC_INTERNAL_TIMER_INTERVAL_MAX_US) && - (sequence->options->interval_us > 0)) { - - nrfx_saadc_adv_config_t adv_config = { - .oversampling = oversampling, - .burst = NRF_SAADC_BURST_DISABLED, - .internal_timer_cc = interval_to_cc(sequence->options->interval_us), - .start_on_end = true, - }; - - m_data.internal_timer_enabled = true; - - nrfx_err = nrfx_saadc_advanced_mode_set(selected_channels, resolution, &adv_config, - event_handler); - } else { - m_data.internal_timer_enabled = false; - - nrfx_err = nrfx_saadc_simple_mode_set(selected_channels, resolution, oversampling, - event_handler); - } - + nrfx_err = nrfx_saadc_simple_mode_set(selected_channels, + resolution, + oversampling, + event_handler); if (nrfx_err != NRFX_SUCCESS) { return -EINVAL; } @@ -659,12 +578,10 @@ static int start_read(const struct device *dev, m_data.active_channel_cnt = active_channel_cnt; m_data.user_buffer = sequence->buffer; - error = dmm_buffer_in_prepare( - m_data.mem_reg, m_data.user_buffer, - (m_data.internal_timer_enabled - ? NRFX_SAADC_SAMPLES_TO_BYTES(1 + sequence->options->extra_samplings) - : NRFX_SAADC_SAMPLES_TO_BYTES(active_channel_cnt)), - &samples_buffer); + error = dmm_buffer_in_prepare(m_data.mem_reg, + m_data.user_buffer, + NRFX_SAADC_SAMPLES_TO_BYTES(active_channel_cnt), + &samples_buffer); if (error != 0) { LOG_ERR("DMM buffer allocation failed err=%d", error); return error; @@ -673,15 +590,7 @@ static int start_read(const struct device *dev, /* Buffer is filled in chunks, each chunk composed of number of samples equal to number * of active channels. Buffer pointer is advanced and reloaded after each chunk. */ - nrfx_err = nrfx_saadc_buffer_set( - samples_buffer, - (m_data.internal_timer_enabled - ? (1 + sequence->options->extra_samplings) - : active_channel_cnt)); - if (nrfx_err != NRFX_SUCCESS) { - LOG_ERR("Failed to set buffer: 0x%08x", nrfx_err); - return -EINVAL; - } + nrfx_saadc_buffer_set(samples_buffer, active_channel_cnt); adc_context_start_read(&m_data.ctx, sequence); @@ -724,15 +633,11 @@ static void event_handler(const nrfx_saadc_evt_t *event) if (event->type == NRFX_SAADC_EVT_DONE) { dmm_buffer_in_release( m_data.mem_reg, m_data.user_buffer, - (m_data.internal_timer_enabled - ? NRFX_SAADC_SAMPLES_TO_BYTES( - 1 + m_data.ctx.sequence.options->extra_samplings) - : NRFX_SAADC_SAMPLES_TO_BYTES(m_data.active_channel_cnt)), + NRFX_SAADC_SAMPLES_TO_BYTES(m_data.active_channel_cnt), event->data.done.p_buffer); if (has_single_ended(&m_data.ctx.sequence)) { - correct_single_ended(&m_data.ctx.sequence, m_data.user_buffer, - event->data.done.size); + correct_single_ended(&m_data.ctx.sequence, m_data.user_buffer); } nrfy_saadc_disable(NRF_SAADC); adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); @@ -742,8 +647,6 @@ static void event_handler(const nrfx_saadc_evt_t *event) LOG_ERR("Cannot start sampling: 0x%08x", err); adc_context_complete(&m_data.ctx, -EIO); } - } else if (event->type == NRFX_SAADC_EVT_FINISHED) { - adc_context_complete(&m_data.ctx, 0); } } @@ -751,8 +654,6 @@ static int init_saadc(const struct device *dev) { nrfx_err_t err; - k_timer_init(&m_data.timer, external_timer_expired_handler, NULL); - /* The priority value passed here is ignored (see nrfx_glue.h). */ err = nrfx_saadc_init(0); if (err != NRFX_SUCCESS) { From 5ee36ac1cc57f50082b4a4acee7cf336928288cb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 102/881] Revert "[nrf fromlist] boards: nordic: nrf54h20dk: ipc to cpusys with unbound" This reverts commit 6872776607a93ee279176a32a73f4e362ba066d9. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi index f7e7d63d548..f31d909b6f9 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi @@ -32,7 +32,6 @@ cpuapp_cpusys_ipc: ipc-2-12 { compatible = "zephyr,ipc-icmsg"; - unbound = "enable"; status = "disabled"; dcache-alignment = <32>; mboxes = <&cpuapp_bellboard 6>, @@ -57,7 +56,6 @@ cpurad_cpusys_ipc: ipc-3-12 { compatible = "zephyr,ipc-icmsg"; - unbound = "enable"; status = "disabled"; dcache-alignment = <32>; mboxes = <&cpurad_bellboard 6>, From d1ca928335db4cefdf45768585138fad150a4de1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 103/881] Revert "[nrf noup] tests: crypto: Add ENTROPY_GENERATOR in overlays" This reverts commit 6997770e93b3fc57c5325b430fb806f13d345f40. Signed-off-by: Jukka Rissanen --- .../mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ------ 5 files changed, 30 deletions(-) delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf deleted file mode 100644 index 70c601183dd..00000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index 70c601183dd..00000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index 70c601183dd..00000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 70c601183dd..00000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index 70c601183dd..00000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y From 0f844380e31cd9b002a2b6075659c69891e1f4c8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 104/881] Revert "[nrf fromtree] tests: vector_table_relocation: fix a mis-use of SRAM_SIZE" This reverts commit 1fe49abe2fccbdacdfbc9b2876d6ca0245963085. Signed-off-by: Jukka Rissanen --- .../application_development/vector_table_relocation/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/application_development/vector_table_relocation/src/main.c b/tests/application_development/vector_table_relocation/src/main.c index d5fa7c8ed47..d102f713df5 100644 --- a/tests/application_development/vector_table_relocation/src/main.c +++ b/tests/application_development/vector_table_relocation/src/main.c @@ -55,7 +55,7 @@ ZTEST(vector_table_relocation, test_vector_table_in_ram) printf("VTOR address: 0x%x\n", vtor_address); zassert_true(vtor_address >= CONFIG_SRAM_BASE_ADDRESS && - vtor_address <= CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE * 1024U, + vtor_address <= CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE, "Vector table is not in RAM! Address: 0x%x", vtor_address); } From bc6bf9915ed37914805234400936f3281e2be081 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 105/881] Revert "[nrf fromlist] net: zperf: Improve UDP multicast upload" This reverts commit f637c2ca51eee3c26bcc6a53619f4dd1c64d3b4f. Signed-off-by: Jukka Rissanen --- include/zephyr/net/zperf.h | 1 - subsys/net/lib/zperf/zperf_shell.c | 75 +++++++++-------------- subsys/net/lib/zperf/zperf_udp_uploader.c | 16 +---- 3 files changed, 33 insertions(+), 59 deletions(-) diff --git a/include/zephyr/net/zperf.h b/include/zephyr/net/zperf.h index 3b4e9bbb684..e26a6076f7a 100644 --- a/include/zephyr/net/zperf.h +++ b/include/zephyr/net/zperf.h @@ -90,7 +90,6 @@ struct zperf_results { uint64_t client_time_in_us; /**< Client connection time in microseconds */ uint32_t packet_size; /**< Packet size */ uint32_t nb_packets_errors; /**< Number of packet errors */ - bool is_multicast; /**< True if this session used IP multicast */ }; /** diff --git a/subsys/net/lib/zperf/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c index 5ebaada1b50..dca889b49a9 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -516,56 +516,41 @@ static void shell_udp_upload_print_stats(const struct shell *sh, client_rate_in_kbps = 0U; } - /* Print warning if no server stats in unicast case; for multicast, - * server stats are not expected. - */ - if (!rate_in_kbps && !results->is_multicast) { + if (!rate_in_kbps) { shell_fprintf(sh, SHELL_ERROR, "LAST PACKET NOT RECEIVED!!!\n"); } - if (results->is_multicast) { - shell_fprintf(sh, SHELL_NORMAL, "Statistics (client only)\n"); - shell_fprintf(sh, SHELL_NORMAL, "Duration:\t\t"); - print_number_64(sh, results->client_time_in_us, TIME_US, TIME_US_UNIT); - shell_fprintf(sh, SHELL_NORMAL, "\n"); - shell_fprintf(sh, SHELL_NORMAL, "Num packets:\t\t%u\n", - results->nb_packets_sent); - shell_fprintf(sh, SHELL_NORMAL, "Rate:\t\t\t"); - print_number(sh, client_rate_in_kbps, KBPS, KBPS_UNIT); - shell_fprintf(sh, SHELL_NORMAL, "\n"); - } else { - shell_fprintf(sh, SHELL_NORMAL, - "Statistics:\t\tserver\t(client)\n"); - shell_fprintf(sh, SHELL_NORMAL, "Duration:\t\t"); - print_number_64(sh, results->time_in_us, TIME_US, - TIME_US_UNIT); - shell_fprintf(sh, SHELL_NORMAL, "\t("); - print_number_64(sh, results->client_time_in_us, TIME_US, - TIME_US_UNIT); - shell_fprintf(sh, SHELL_NORMAL, ")\n"); - - shell_fprintf(sh, SHELL_NORMAL, "Num packets:\t\t%u\t(%u)\n", - results->nb_packets_rcvd, - results->nb_packets_sent); + shell_fprintf(sh, SHELL_NORMAL, + "Statistics:\t\tserver\t(client)\n"); + shell_fprintf(sh, SHELL_NORMAL, "Duration:\t\t"); + print_number_64(sh, results->time_in_us, TIME_US, + TIME_US_UNIT); + shell_fprintf(sh, SHELL_NORMAL, "\t("); + print_number_64(sh, results->client_time_in_us, TIME_US, + TIME_US_UNIT); + shell_fprintf(sh, SHELL_NORMAL, ")\n"); + + shell_fprintf(sh, SHELL_NORMAL, "Num packets:\t\t%u\t(%u)\n", + results->nb_packets_rcvd, + results->nb_packets_sent); - shell_fprintf(sh, SHELL_NORMAL, - "Num packets out order:\t%u\n", - results->nb_packets_outorder); - shell_fprintf(sh, SHELL_NORMAL, "Num packets lost:\t%u\n", - results->nb_packets_lost); - - shell_fprintf(sh, SHELL_NORMAL, "Jitter:\t\t\t"); - print_number(sh, results->jitter_in_us, TIME_US, - TIME_US_UNIT); - shell_fprintf(sh, SHELL_NORMAL, "\n"); - - shell_fprintf(sh, SHELL_NORMAL, "Rate:\t\t\t"); - print_number(sh, rate_in_kbps, KBPS, KBPS_UNIT); - shell_fprintf(sh, SHELL_NORMAL, "\t("); - print_number(sh, client_rate_in_kbps, KBPS, KBPS_UNIT); - shell_fprintf(sh, SHELL_NORMAL, ")\n"); - } + shell_fprintf(sh, SHELL_NORMAL, + "Num packets out order:\t%u\n", + results->nb_packets_outorder); + shell_fprintf(sh, SHELL_NORMAL, "Num packets lost:\t%u\n", + results->nb_packets_lost); + + shell_fprintf(sh, SHELL_NORMAL, "Jitter:\t\t\t"); + print_number(sh, results->jitter_in_us, TIME_US, + TIME_US_UNIT); + shell_fprintf(sh, SHELL_NORMAL, "\n"); + + shell_fprintf(sh, SHELL_NORMAL, "Rate:\t\t\t"); + print_number(sh, rate_in_kbps, KBPS, KBPS_UNIT); + shell_fprintf(sh, SHELL_NORMAL, "\t("); + print_number(sh, client_rate_in_kbps, KBPS, KBPS_UNIT); + shell_fprintf(sh, SHELL_NORMAL, ")\n"); #ifdef CONFIG_ZPERF_SESSION_PER_THREAD if (is_async) { diff --git a/subsys/net/lib/zperf/zperf_udp_uploader.c b/subsys/net/lib/zperf/zperf_udp_uploader.c index f4944d5777f..344ea39560b 100644 --- a/subsys/net/lib/zperf/zperf_udp_uploader.c +++ b/subsys/net/lib/zperf/zperf_udp_uploader.c @@ -105,14 +105,10 @@ static inline int zperf_upload_fin(int sock, continue; } - /* For multicast, do not wait for a server ack. Keep resending FIN - * for the configured number of attempts by forcing another loop - * iteration. + /* Multicast only send the negative sequence number packet + * and doesn't wait for a server ack */ - if (is_mcast_pkt) { - ret = 0; - continue; - } else { + if (!is_mcast_pkt) { /* Receive statistics */ ret = zsock_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &rcvtimeo, sizeof(rcvtimeo)); @@ -130,11 +126,6 @@ static inline int zperf_upload_fin(int sock, } } - /* In multicast, we never expect a stats reply. Stop here. */ - if (is_mcast_pkt) { - return 0; - } - /* Decode statistics */ if (ret > 0) { zperf_upload_decode_stat(stats, ret, results); @@ -308,7 +299,6 @@ static int udp_upload(int sock, int port, results->client_time_in_us = k_ticks_to_us_ceil64(end_time - start_time); results->packet_size = packet_size; - results->is_multicast = is_mcast_pkt; return 0; } From 3dd756c24c16b8446c3a730d2fe36aecd7600eab Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 106/881] Revert "[nrf fromtree] bootloader: mcuboot: Fix encryption not being selected in bootloader" This reverts commit 51f0b2c5c449b08826faef7cea0df23e9856ceed. Signed-off-by: Jukka Rissanen --- .../sysbuild/image_configurations/BOOTLOADER_image_default.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake b/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake index 1c09b452ee4..1267fc1e1ef 100644 --- a/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake +++ b/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake @@ -80,7 +80,6 @@ foreach(loopkeytype ${keytypes}) endforeach() if(SB_CONFIG_BOOT_ENCRYPTION) - set_config_bool(${image} CONFIG_BOOT_ENCRYPT_IMAGE y) set_config_string(${ZCMAKE_APPLICATION} CONFIG_BOOT_ENCRYPTION_KEY_FILE "${SB_CONFIG_BOOT_ENCRYPTION_KEY_FILE}") if(SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_128) set_config_bool(${ZCMAKE_APPLICATION} CONFIG_BOOT_ENCRYPT_ALG_AES_128 y) From f89584feaa241c75c0cf89fcf84d0a61159c8632 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 107/881] Revert "[nrf fromtree] bootloader: mcuboot: Changes needed to support AES256" This reverts commit f5564e36c6030a0e4c134642a44bd5b1ba69e599. Signed-off-by: Jukka Rissanen --- cmake/mcuboot.cmake | 7 ------- modules/Kconfig.mcuboot | 16 ---------------- .../BOOTLOADER_image_default.cmake | 9 --------- .../MAIN_image_default.cmake | 8 -------- share/sysbuild/images/bootloader/CMakeLists.txt | 4 ++++ share/sysbuild/images/bootloader/Kconfig | 16 ---------------- 6 files changed, 4 insertions(+), 56 deletions(-) diff --git a/cmake/mcuboot.cmake b/cmake/mcuboot.cmake index 964d694983b..ac37b175a31 100644 --- a/cmake/mcuboot.cmake +++ b/cmake/mcuboot.cmake @@ -159,13 +159,6 @@ function(zephyr_mcuboot_tasks) set(imgtool_args --sha 512 ${imgtool_args}) endif() - if(NOT "${keyfile_enc}" STREQUAL "") - if(CONFIG_MCUBOOT_ENCRYPTION_ALG_AES_256) - # Note: this overrides the default behavior of using AES-128 - set(imgtool_args ${imgtool_args} --encrypt-keylen 256) - endif() - endif() - # Extensionless prefix of any output file. set(output ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}) diff --git a/modules/Kconfig.mcuboot b/modules/Kconfig.mcuboot index d6b4465de2d..a95dc34b72f 100644 --- a/modules/Kconfig.mcuboot +++ b/modules/Kconfig.mcuboot @@ -89,22 +89,6 @@ config MCUBOOT_ENCRYPTION_KEY_FILE If left empty, you must encrypt the Zephyr binaries manually. -if MCUBOOT_ENCRYPTION_KEY_FILE != "" - -choice MCUBOOT_ENCRYPTION_ALG - prompt "Algorithm used for image encryption" - default MCUBOOT_ENCRYPTION_ALG_AES_128 - -config MCUBOOT_ENCRYPTION_ALG_AES_128 - bool "Use AES-128 for image encryption" - -config MCUBOOT_ENCRYPTION_ALG_AES_256 - bool "Use AES-256 for image encryption" - -endchoice # MCUBOOT_ENCRYPTION_ALG - -endif # MCUBOOT_ENCRYPTION_KEY_FILE != "" - config MCUBOOT_IMGTOOL_SIGN_VERSION string "Version to pass to imgtool when signing" default "$(APP_VERSION_TWEAK_STRING)" if "$(VERSION_MAJOR)" != "" diff --git a/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake b/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake index 1267fc1e1ef..9125de71fac 100644 --- a/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake +++ b/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake @@ -78,12 +78,3 @@ foreach(loopkeytype ${keytypes}) set_config_bool(${ZCMAKE_APPLICATION} ${loopkeytype} n) endif() endforeach() - -if(SB_CONFIG_BOOT_ENCRYPTION) - set_config_string(${ZCMAKE_APPLICATION} CONFIG_BOOT_ENCRYPTION_KEY_FILE "${SB_CONFIG_BOOT_ENCRYPTION_KEY_FILE}") - if(SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_128) - set_config_bool(${ZCMAKE_APPLICATION} CONFIG_BOOT_ENCRYPT_ALG_AES_128 y) - elseif(SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_256) - set_config_bool(${ZCMAKE_APPLICATION} CONFIG_BOOT_ENCRYPT_ALG_AES_256 y) - endif() -endif() diff --git a/share/sysbuild/image_configurations/MAIN_image_default.cmake b/share/sysbuild/image_configurations/MAIN_image_default.cmake index 96cb1835542..a6c29c8d756 100644 --- a/share/sysbuild/image_configurations/MAIN_image_default.cmake +++ b/share/sysbuild/image_configurations/MAIN_image_default.cmake @@ -51,12 +51,4 @@ if(SB_CONFIG_BOOTLOADER_MCUBOOT) set_config_bool(${ZCMAKE_APPLICATION} CONFIG_RETENTION_BOOT_MODE y) endif() endif() - - if(SB_CONFIG_BOOT_ENCRYPTION) - if(SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_128) - set_config_bool(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_ENCRYPTION_ALG_AES_128 y) - elseif(SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_256) - set_config_bool(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_ENCRYPTION_ALG_AES_256 y) - endif() - endif() endif() diff --git a/share/sysbuild/images/bootloader/CMakeLists.txt b/share/sysbuild/images/bootloader/CMakeLists.txt index 501a1f366f2..c82f0808c66 100644 --- a/share/sysbuild/images/bootloader/CMakeLists.txt +++ b/share/sysbuild/images/bootloader/CMakeLists.txt @@ -15,4 +15,8 @@ if(SB_CONFIG_BOOTLOADER_MCUBOOT) sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} ${image}) set_config_string(${image} CONFIG_BOOT_SIGNATURE_KEY_FILE "${SB_CONFIG_BOOT_SIGNATURE_KEY_FILE}") + set_config_bool(${image} CONFIG_BOOT_ENCRYPT_IMAGE "${SB_CONFIG_BOOT_ENCRYPTION}") + if(SB_CONFIG_BOOT_ENCRYPTION) + set_config_string(${image} CONFIG_BOOT_ENCRYPTION_KEY_FILE "${SB_CONFIG_BOOT_ENCRYPTION_KEY_FILE}") + endif() endif() diff --git a/share/sysbuild/images/bootloader/Kconfig b/share/sysbuild/images/bootloader/Kconfig index fa4eff374d6..7a416f2fe23 100644 --- a/share/sysbuild/images/bootloader/Kconfig +++ b/share/sysbuild/images/bootloader/Kconfig @@ -204,20 +204,4 @@ config BOOT_ENCRYPTION_KEY_FILE help Absolute path to encryption key file to use with MCUBoot. -if BOOT_ENCRYPTION - -choice BOOT_ENCRYPTION_ALG - prompt "Algorithm used for image encryption" - default BOOT_ENCRYPTION_ALG_AES_128 - -config BOOT_ENCRYPTION_ALG_AES_128 - bool "Use AES-128 for image encryption" - -config BOOT_ENCRYPTION_ALG_AES_256 - bool "Use AES-256 for image encryption" - -endchoice # BOOT_ENCRYPTION_ALG - -endif # BOOT_ENCRYPTION - endif From 974c60f388b0186c537fa87ab7f0299fb077445d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:00 +0300 Subject: [PATCH 108/881] Revert "[nrf fromlist] modules: openthread: configure router selection jitter" This reverts commit 53824876e35648dc8c2d6fb99e3756e7cd4d779f. Signed-off-by: Jukka Rissanen --- modules/openthread/Kconfig.thread | 9 --------- modules/openthread/openthread.c | 11 ----------- 2 files changed, 20 deletions(-) diff --git a/modules/openthread/Kconfig.thread b/modules/openthread/Kconfig.thread index 0633d8bc62d..01737ef7567 100644 --- a/modules/openthread/Kconfig.thread +++ b/modules/openthread/Kconfig.thread @@ -256,12 +256,3 @@ config OPENTHREAD_RCP_RESTORATION_MAX_COUNT default 2 help The maximum number of attempts to restore the RCP connection. - -config OPENTHREAD_ROUTER_SELECTION_JITTER_OVERRIDE - bool "Override default router selection jitter" - depends on OPENTHREAD_FTD - -config OPENTHREAD_ROUTER_SELECTION_JITTER - int "OpenThread router selection jitter in seconds" - depends on OPENTHREAD_ROUTER_SELECTION_JITTER_OVERRIDE - default 120 diff --git a/modules/openthread/openthread.c b/modules/openthread/openthread.c index e4124cda7f9..5bd7f27e8c8 100644 --- a/modules/openthread/openthread.c +++ b/modules/openthread/openthread.c @@ -33,7 +33,6 @@ LOG_MODULE_REGISTER(net_openthread_platform, CONFIG_OPENTHREAD_PLATFORM_LOG_LEVE #include #include #include -#include #include #include #include @@ -99,12 +98,6 @@ LOG_MODULE_REGISTER(net_openthread_platform, CONFIG_OPENTHREAD_PLATFORM_LOG_LEVE #define OT_POLL_PERIOD 0 #endif -#if defined(CONFIG_OPENTHREAD_ROUTER_SELECTION_JITTER) -#define OT_ROUTER_SELECTION_JITTER CONFIG_OPENTHREAD_ROUTER_SELECTION_JITTER -#else -#define OT_ROUTER_SELECTION_JITTER 0 -#endif - #define ZEPHYR_PACKAGE_NAME "Zephyr" #define PACKAGE_VERSION KERNEL_VERSION_STRING @@ -347,10 +340,6 @@ int openthread_init(void) } } - if (IS_ENABLED(CONFIG_OPENTHREAD_ROUTER_SELECTION_JITTER_OVERRIDE)) { - otThreadSetRouterSelectionJitter(openthread_instance, OT_ROUTER_SELECTION_JITTER); - } - openthread_mutex_unlock(); /* Start work queue for the OpenThread module */ From 924b13466ad95d3bd522dc47f0995ad174eba9a0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 109/881] Revert "[nrf fromtree] net: openthread: Add option to set RCP restoration count." This reverts commit e7e4f8bc6d9ca3d51de2a60a25fd3cce8698b767. Signed-off-by: Jukka Rissanen --- modules/openthread/CMakeLists.txt | 5 ----- modules/openthread/Kconfig.thread | 6 ------ 2 files changed, 11 deletions(-) diff --git a/modules/openthread/CMakeLists.txt b/modules/openthread/CMakeLists.txt index e6d4af11560..02af3687cf5 100644 --- a/modules/openthread/CMakeLists.txt +++ b/modules/openthread/CMakeLists.txt @@ -11,10 +11,6 @@ macro(kconfig_to_ot_option kconfig_option ot_config description) endif() endmacro() -macro(kconfig_to_ot_option_value kconfig_option ot_config description) - set(${ot_config} ${${kconfig_option}} CACHE STRING "${description}" FORCE) -endmacro() - # OpenThread options set(OT_BUILD_EXECUTABLES OFF CACHE BOOL "Disable OpenThread samples") set(OT_BUILTIN_MBEDTLS_MANAGEMENT OFF CACHE BOOL "Use Zephyr's mbedTLS heap") @@ -134,7 +130,6 @@ kconfig_to_ot_option(CONFIG_OPENTHREAD_UPTIME OT_UPTIME "Enable support for trac kconfig_to_ot_option(CONFIG_OPENTHREAD_VERHOEFF_CHECKSUM OT_VERHOEFF_CHECKSUM "Verhoeff checksum") kconfig_to_ot_option(CONFIG_OPENTHREAD_WAKEUP_COORDINATOR OT_WAKEUP_COORDINATOR "Enable Wake-up Coordinator role") kconfig_to_ot_option(CONFIG_OPENTHREAD_WAKEUP_END_DEVICE OT_WAKEUP_END_DEVICE "Enable Wake-up End Device role") -kconfig_to_ot_option_value(CONFIG_OPENTHREAD_RCP_RESTORATION_MAX_COUNT OT_RCP_RESTORATION_MAX_COUNT "Set the maximum number of RCP restoration attempts") if(CONFIG_OPENTHREAD_COPROCESSOR_VENDOR_HOOK_SOURCE) set(OT_NCP_VENDOR_HOOK_SOURCE ${CONFIG_OPENTHREAD_COPROCESSOR_VENDOR_HOOK_SOURCE} CACHE STRING "NCP vendor hook source file name" FORCE) diff --git a/modules/openthread/Kconfig.thread b/modules/openthread/Kconfig.thread index 01737ef7567..2bababd4fee 100644 --- a/modules/openthread/Kconfig.thread +++ b/modules/openthread/Kconfig.thread @@ -250,9 +250,3 @@ config OPENTHREAD_MLE_CHILD_TIMEOUT default 240 help The value of MLE child timeout in seconds. - -config OPENTHREAD_RCP_RESTORATION_MAX_COUNT - int "Openthread RCP restoration maximum count" - default 2 - help - The maximum number of attempts to restore the RCP connection. From 58f65383ffd656159299c248a4c6a78918c5f6f5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 110/881] Revert "[nrf noup] soc: nrf54l: Change logic for KMU reserved area" This reverts commit 793e93e14667c87968d75c1666a9a99b44a054c9. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54l/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/soc/nordic/nrf54l/CMakeLists.txt b/soc/nordic/nrf54l/CMakeLists.txt index d84330bffa6..d986fe9c20d 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -7,12 +7,10 @@ zephyr_library_sources( ) zephyr_include_directories(.) -dt_nodelabel(kmu_push_area_node NODELABEL nrf_kmu_reserved_push_area) - # We need a buffer in memory in a static location which can be used by # the KMU peripheral. The KMU has a static destination address, we chose # this address to be 0x20000000, which is the first address in the SRAM. -if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND NOT kmu_push_area_node) +if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND CONFIG_XIP) # Exclamation mark is printable character with the lowest number in ASCII table. # We are sure that this file will be included first. zephyr_linker_sources(RAM_SECTIONS SORT_KEY ! kmu_push_area_section.ld) From 6b0304cd155047c3e9229fa673ca8d64a1168a2b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 111/881] Revert "[nrf fromlist] scripts: parse module.yml for dts bindings" This reverts commit a922397417e49858aa7a6fd98d8ef79f6dee3666. Signed-off-by: Jukka Rissanen --- scripts/ci/check_compliance.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 5958fa52a7d..332f6cf08c3 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -345,24 +345,15 @@ def check_board_file(self, file, vendor_prefixes): def run(self): path = resolve_path_hint(self.path_hint) - module_ymls = [path / "zephyr" / "module.yml", path / "zephyr" / "module.yaml"] vendor_prefixes = {"others"} # add vendor prefixes from the main zephyr repo vendor_prefixes |= get_vendor_prefixes(ZEPHYR_BASE / "dts" / "bindings" / "vendor-prefixes.txt", self.error) - # add vendor prefixes from the current repo - dts_root = None - for module_yml in module_ymls: - if module_yml.is_file(): - with module_yml.open('r', encoding='utf-8') as f: - meta = yaml.load(f.read(), Loader=SafeLoader) - section = meta.get('build', dict()) - build_settings = section.get('settings', None) - if build_settings: - dts_root = build_settings.get('dts_root', None) - if dts_root: - vendor_prefix_file = Path(dts_root) / "dts" / "bindings" / "vendor-prefixes.txt" + # add vendor prefixes from the current repo + dts_roots = get_module_setting_root('dts', path / "zephyr" / "module.yml") + for dts_root in dts_roots: + vendor_prefix_file = dts_root / "dts" / "bindings" / "vendor-prefixes.txt" if vendor_prefix_file.exists(): vendor_prefixes |= get_vendor_prefixes(vendor_prefix_file, self.error) From e5c63e2ba23d1ebcea50dac1c50d539d40816149 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 112/881] Revert "[nrf fromtree] scripts: check_compliance: Fix resource leak" This reverts commit 2d0838c2fc9c8994e19a32a6bf50fd9dbbda30e8. Signed-off-by: Jukka Rissanen --- scripts/ci/check_compliance.py | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 332f6cf08c3..5a441c873f0 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -291,37 +291,37 @@ def run(self): cmd = [checkpatch] cmd.extend(['--mailback', '--no-tree', '-']) - with subprocess.Popen(('git', 'diff', '--no-ext-diff', COMMIT_RANGE), + diff = subprocess.Popen(('git', 'diff', '--no-ext-diff', COMMIT_RANGE), stdout=subprocess.PIPE, - cwd=GIT_TOP) as diff: - try: - subprocess.run(cmd, - check=True, - stdin=diff.stdout, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - shell=False, cwd=GIT_TOP) + cwd=GIT_TOP) + try: + subprocess.run(cmd, + check=True, + stdin=diff.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + shell=False, cwd=GIT_TOP) - except subprocess.CalledProcessError as ex: - output = ex.output.decode("utf-8") - regex = r'^\s*\S+:(\d+):\s*(ERROR|WARNING):(.+?):(.+)(?:\n|\r\n?)+' \ - r'^\s*#(\d+):\s*FILE:\s*(.+):(\d+):' + except subprocess.CalledProcessError as ex: + output = ex.output.decode("utf-8") + regex = r'^\s*\S+:(\d+):\s*(ERROR|WARNING):(.+?):(.+)(?:\n|\r\n?)+' \ + r'^\s*#(\d+):\s*FILE:\s*(.+):(\d+):' - matches = re.findall(regex, output, re.MULTILINE) + matches = re.findall(regex, output, re.MULTILINE) - # add a guard here for excessive number of errors, do not try and - # process each one of them and instead push this as one failure. - if len(matches) > 500: - self.failure(output) - return + # add a guard here for excessive number of errors, do not try and + # process each one of them and instead push this as one failure. + if len(matches) > 500: + self.failure(output) + return - for m in matches: - self.fmtd_failure(m[1].lower(), m[2], m[5], m[6], col=None, - desc=m[3]) + for m in matches: + self.fmtd_failure(m[1].lower(), m[2], m[5], m[6], col=None, + desc=m[3]) - # If the regex has not matched add the whole output as a failure - if len(matches) == 0: - self.failure(output) + # If the regex has not matched add the whole output as a failure + if len(matches) == 0: + self.failure(output) class BoardYmlCheck(ComplianceTest): From f0854c208e60c70b8f53050fbbe92079f4ed8ae9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 113/881] Revert "[nrf fromtree] scripts: ci: check_compliance: Add support for modules for Kconfig" This reverts commit 2f556e6769ccef2e66d1607ca0cf6e6dab63aa15. Signed-off-by: Jukka Rissanen --- scripts/ci/check_compliance.py | 59 +++------------------------------- 1 file changed, 5 insertions(+), 54 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 5a441c873f0..7ad88630e17 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -10,7 +10,7 @@ import json import logging import os -from pathlib import Path, PurePath +from pathlib import Path import platform import re import subprocess @@ -31,11 +31,6 @@ from west.manifest import Manifest from west.manifest import ManifestProject -try: - from yaml import CSafeLoader as SafeLoader -except ImportError: - from yaml import SafeLoader - sys.path.insert(0, str(Path(__file__).resolve().parents[1])) from get_maintainer import Maintainers, MaintainersError import list_boards @@ -786,23 +781,6 @@ def get_logging_syms(self, kconf): return set(kconf_syms) - def module_disallowed_check(self, module_path, type, folder, meta, regex): - # Returns a list with lines from git grep which includes Kconfigs from defconfig files - entry = type + '_root' - git_folder = ":" + folder - - if entry in meta['build']['settings']: - tmp_path = module_path.joinpath(meta['build']['settings'][entry]) - - if Path(tmp_path.joinpath(folder)).is_dir(): - tmp_output = git("grep", "--line-number", "-I", "--null", - "--perl-regexp", regex, "--", git_folder, - cwd=tmp_path, ignore_non_zero=True) - - if len(tmp_output) > 0: - return tmp_output.splitlines() - return [] - def check_disallowed_defconfigs(self, kconf): """ Checks that there are no disallowed Kconfigs used in board/SoC defconfig files @@ -845,41 +823,14 @@ def check_disallowed_defconfigs(self, kconf): grep_stdout_boards = git("grep", "--line-number", "-I", "--null", "--perl-regexp", regex_boards, "--", ":boards", - cwd=ZEPHYR_BASE).splitlines() + cwd=ZEPHYR_BASE) grep_stdout_socs = git("grep", "--line-number", "-I", "--null", "--perl-regexp", regex_socs, "--", ":soc", - cwd=ZEPHYR_BASE).splitlines() - - manifest = Manifest.from_file() - for project in manifest.get_projects([]): - if not manifest.is_active(project): - continue - - if not project.is_cloned(): - continue - - module_path = PurePath(project.abspath) - module_yml = module_path.joinpath('zephyr/module.yml') - - if not Path(module_yml).is_file(): - module_yml = module_path.joinpath('zephyr/module.yaml') - - if Path(module_yml).is_file(): - with Path(module_yml).open('r', encoding='utf-8') as f: - meta = yaml.load(f.read(), Loader=SafeLoader) - - if 'build' in meta and 'settings' in meta['build']: - grep_stdout_boards.extend(self.module_disallowed_check(module_path, - 'board', - 'boards', meta, - regex_boards)) - grep_stdout_socs.extend(self.module_disallowed_check(module_path, 'soc', - 'soc', meta, - regex_socs)) + cwd=ZEPHYR_BASE) # Board processing # splitlines() supports various line terminators - for grep_line in grep_stdout_boards: + for grep_line in grep_stdout_boards.splitlines(): path, lineno, line = grep_line.split("\0") # Extract symbol references (might be more than one) within the line @@ -896,7 +847,7 @@ def check_disallowed_defconfigs(self, kconf): # SoCs processing # splitlines() supports various line terminators - for grep_line in grep_stdout_socs: + for grep_line in grep_stdout_socs.splitlines(): path, lineno, line = grep_line.split("\0") # Extract symbol references (might be more than one) within the line From 77bf3e322698daf94908b49e0f1f0944cfd953fe Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 114/881] Revert "[nrf fromtree] scripts: ci: Add CI bindings style checker" This reverts commit 70e7ab3812919e7d9562ff4ee243be806d1982f3. Signed-off-by: Jukka Rissanen --- scripts/bindings_properties_allowlist.yaml | 11 -- scripts/ci/check_compliance.py | 117 ++++++--------------- 2 files changed, 30 insertions(+), 98 deletions(-) delete mode 100644 scripts/bindings_properties_allowlist.yaml diff --git a/scripts/bindings_properties_allowlist.yaml b/scripts/bindings_properties_allowlist.yaml deleted file mode 100644 index 100d4d380fb..00000000000 --- a/scripts/bindings_properties_allowlist.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# This file is a YAML allowlist of property names that are allowed to -# bypass the underscore check in bindings. These properties are exempt -# from the rule that requires using '-' instead of '_'. -# -# The file content can be as shown below: -# - propname1 -# - propname2 -# - ... - -- mmc-hs200-1_8v -- mmc-hs400-1_8v diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 7ad88630e17..3ee7b62c9b5 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -21,7 +21,6 @@ import shutil import textwrap import unidiff -import yaml from yamllint import config, linter @@ -36,30 +35,6 @@ import list_boards import list_hardware -sys.path.insert(0, str(Path(__file__).resolve().parents[2] - / "scripts" / "dts" / "python-devicetree" / "src")) -from devicetree import edtlib - - -# Let the user run this script as ./scripts/ci/check_compliance.py without -# making them set ZEPHYR_BASE. -ZEPHYR_BASE = os.environ.get('ZEPHYR_BASE') -if ZEPHYR_BASE: - ZEPHYR_BASE = Path(ZEPHYR_BASE) -else: - ZEPHYR_BASE = Path(__file__).resolve().parents[2] - # Propagate this decision to child processes. - os.environ['ZEPHYR_BASE'] = str(ZEPHYR_BASE) - -# Initialize the property names allowlist -BINDINGS_PROPERTIES_AL = None -with open(Path(__file__).parents[1] / 'bindings_properties_allowlist.yaml') as f: - allowlist = yaml.safe_load(f.read()) - if allowlist is not None: - BINDINGS_PROPERTIES_AL = set(allowlist) - else: - BINDINGS_PROPERTIES_AL = set() - logger = None def git(*args, cwd=None, ignore_non_zero=False): @@ -405,75 +380,32 @@ class DevicetreeBindingsCheck(ComplianceTest): doc = "See https://docs.zephyrproject.org/latest/build/dts/bindings.html for more details." def run(self, full=True): - bindings_diff, bindings = self.get_yaml_bindings() + dts_bindings = self.parse_dt_bindings() - # If no bindings are changed, skip this check. - try: - subprocess.check_call(['git', 'diff', '--quiet', COMMIT_RANGE] - + bindings_diff) - nodiff = True - except subprocess.CalledProcessError: - nodiff = False - if nodiff: - self.skip('no changes to bindings were made') - - for binding in bindings: - self.check(binding, self.check_yaml_property_name) - self.check(binding, self.required_false_check) - - @staticmethod - def check(binding, callback): - while binding is not None: - callback(binding) - binding = binding.child_binding - - def get_yaml_bindings(self): + for dts_binding in dts_bindings: + self.required_false_check(dts_binding) + + def parse_dt_bindings(self): """ - Returns a list of 'dts/bindings/**/*.yaml' + Returns a list of dts/bindings/**/*.yaml files """ - from glob import glob - BINDINGS_PATH = 'dts/bindings/' - bindings_diff_dir, bindings = set(), [] - - for file_name in get_files(filter='d'): - if BINDINGS_PATH in file_name: - p = file_name.partition(BINDINGS_PATH) - bindings_diff_dir.add(os.path.join(p[0], p[1])) - for path in bindings_diff_dir: - yamls = glob(f'{os.fspath(path)}/**/*.yaml', recursive=True) - bindings.extend(yamls) + dt_bindings = [] + for file_name in get_files(filter="d"): + if 'dts/bindings/' in file_name and file_name.endswith('.yaml'): + dt_bindings.append(file_name) - bindings = edtlib.bindings_from_paths(bindings, ignore_errors=True) - return list(bindings_diff_dir), bindings + return dt_bindings - def check_yaml_property_name(self, binding): - """ - Checks if the property names in the binding file contain underscores. - """ - for prop_name in binding.prop2specs: - if '_' in prop_name and prop_name not in BINDINGS_PROPERTIES_AL: - better_prop = prop_name.replace('_', '-') - print(f"Required: In '{binding.path}', " - f"the property '{prop_name}' " - f"should be renamed to '{better_prop}'.") - self.failure( - f"{binding.path}: property '{prop_name}' contains underscores.\n" - f"\tUse '{better_prop}' instead unless this property name is from Linux.\n" - "Or another authoritative upstream source of bindings for " - f"compatible '{binding.compatible}'.\n" - "\tHint: update 'bindings_properties_allowlist.yaml' if you need to " - "override this check for this property." - ) + def required_false_check(self, dts_binding): + with open(dts_binding) as file: + for line_number, line in enumerate(file, 1): + if 'required: false' in line: + self.fmtd_failure( + 'warning', 'Devicetree Bindings', dts_binding, + line_number, col=None, + desc="'required: false' is redundant, please remove") - def required_false_check(self, binding): - raw_props = binding.raw.get('properties', {}) - for prop_name, raw_prop in raw_props.items(): - if raw_prop.get('required') is False: - self.failure( - f'{binding.path}: property "{prop_name}": ' - "'required: false' is redundant, please remove" - ) class KconfigCheck(ComplianceTest): """ @@ -2052,6 +1984,17 @@ def _main(args): # The "real" main(), which is wrapped to catch exceptions and report them # to GitHub. Returns the number of test failures. + global ZEPHYR_BASE + ZEPHYR_BASE = os.environ.get('ZEPHYR_BASE') + if not ZEPHYR_BASE: + # Let the user run this script as ./scripts/ci/check_compliance.py without + # making them set ZEPHYR_BASE. + ZEPHYR_BASE = str(Path(__file__).resolve().parents[2]) + + # Propagate this decision to child processes. + os.environ['ZEPHYR_BASE'] = ZEPHYR_BASE + ZEPHYR_BASE = Path(ZEPHYR_BASE) + # The absolute path of the top-level git directory. Initialize it here so # that issues running Git can be reported to GitHub. global GIT_TOP From 14c56f681f459b7c1e46da2e44bf38ebcc96cbf5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 115/881] Revert "[nrf fromtree] soc: nordic: common: poweroff: Set VPR to remain in its reset state" This reverts commit 8f6f73e398f415c08bfa9ae7e3b02e03eb66c46e. Signed-off-by: Jukka Rissanen --- soc/nordic/common/poweroff.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/soc/nordic/common/poweroff.c b/soc/nordic/common/poweroff.c index ebce3aae77c..857b2f38078 100644 --- a/soc/nordic/common/poweroff.c +++ b/soc/nordic/common/poweroff.c @@ -16,18 +16,12 @@ #endif #if defined(CONFIG_SOC_SERIES_NRF54LX) #include -#include #endif #if defined(CONFIG_HAS_NORDIC_RAM_CTRL) #include #endif -#if defined(CONFIG_SOC_SERIES_NRF54LX) -#define VPR_POWER_IDX 1 -#define VPR_RET_BIT MEMCONF_POWER_RET_MEM0_Pos -#endif - void z_sys_poweroff(void) { #if defined(CONFIG_HAS_NORDIC_RAM_CTRL) @@ -65,9 +59,6 @@ void z_sys_poweroff(void) #endif #if defined(CONFIG_SOC_SERIES_NRF54LX) - /* Set VPR to remain in its reset state when waking from OFF */ - nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, VPR_POWER_IDX, VPR_RET_BIT, false); - nrfx_reset_reason_clear(UINT32_MAX); #endif #if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) From d03c27bb91706fdbbaffbc5315dd9ed41265e49a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 116/881] Revert "[nrf fromtree] modules: hal_nordic: remove deprecated error code" This reverts commit fa08cc6afe0e53ef1d6db5cc8d7e46f9a99365a4. Signed-off-by: Jukka Rissanen --- drivers/usb/device/usb_dc_nrfx.c | 2 +- modules/hal_nordic/nrfx/nrfx_glue.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/device/usb_dc_nrfx.c b/drivers/usb/device/usb_dc_nrfx.c index c8bbfd40ada..d7e56167120 100644 --- a/drivers/usb/device/usb_dc_nrfx.c +++ b/drivers/usb/device/usb_dc_nrfx.c @@ -1914,7 +1914,7 @@ static int usb_init(void) return -EIO; } - /* Ignore the return value, as NRFX_ERROR_ALREADY is not + /* Ignore the return value, as NRFX_ERROR_ALREADY_INITIALIZED is not * a problem here. */ (void)nrfx_power_init(&power_config); diff --git a/modules/hal_nordic/nrfx/nrfx_glue.c b/modules/hal_nordic/nrfx/nrfx_glue.c index 4e7fc94e11d..54696efd122 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.c +++ b/modules/hal_nordic/nrfx/nrfx_glue.c @@ -38,7 +38,7 @@ char const *nrfx_error_string_get(nrfx_err_t code) NRFX_ERROR_STRING_CASE(NRFX_ERROR_NULL); NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_ADDR); NRFX_ERROR_STRING_CASE(NRFX_ERROR_BUSY); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_ALREADY); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_ALREADY_INITIALIZED); NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_OVERRUN); NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_ANACK); NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_DNACK); From add16fb7265a57c3d5fef917993e4eaaf12c69f0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 117/881] Revert "[nrf fromtree] samples: subsys: ipc: Run multi-endpoint IPC sample on nrf54h20" This reverts commit 06b71687856dd61331c3eaaef08191938e2e9738. Signed-off-by: Jukka Rissanen --- .../ipc_service/multi_endpoint/CMakeLists.txt | 8 ++- .../multi_endpoint/Kconfig.sysbuild | 5 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 50 ------------------- .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 50 ------------------- .../ipc_service/multi_endpoint/sample.yaml | 2 - .../ipc/ipc_service/multi_endpoint/src/main.c | 1 - 7 files changed, 8 insertions(+), 109 deletions(-) delete mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/CMakeLists.txt b/samples/subsys/ipc/ipc_service/multi_endpoint/CMakeLists.txt index d8c7b1367e8..fca156d9fe2 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/CMakeLists.txt +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/CMakeLists.txt @@ -8,7 +8,11 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +if(NOT CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP AND + NOT CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUAPP ) + message(FATAL_ERROR "${BOARD} is not supported for this sample") +endif() + project(ipc_service) -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) +target_sources(app PRIVATE src/main.c) diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/Kconfig.sysbuild b/samples/subsys/ipc/ipc_service/multi_endpoint/Kconfig.sysbuild index abaec58fdf4..5e4c6d497cf 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/Kconfig.sysbuild +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/Kconfig.sysbuild @@ -6,6 +6,5 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string - default "$(BOARD)/nrf5340/cpunet" if $(BOARD) = "nrf5340dk" - default "$(BOARD)/nrf5340/cpunet" if $(BOARD) = "nrf5340bsim" - default "$(BOARD)/nrf54h20/cpurad" if $(BOARD) = "nrf54h20dk" + default "nrf5340dk/nrf5340/cpunet" if $(BOARD) = "nrf5340dk" + default "nrf5340bsim/nrf5340/cpunet" if $(BOARD) = "nrf5340bsim" diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index a6fa5758d9a..00000000000 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 1698d7a800d..00000000000 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,50 +0,0 @@ -/ { - reserved-memory { - /delete-node/ memory@2f0bf000; - /delete-node/ memory@2f0bf800; - - cpuapp_cpurad_ipc_shm_a: memory@2f0bf000 { - reg = <0x2f0bf000 DT_SIZE_K(1)>; - }; - - cpurad_cpuapp_ipc_shm_a: memory@2f0bf400 { - reg = <0x2f0bf400 DT_SIZE_K(1)>; - }; - - cpuapp_cpurad_ipc_shm_b: memory@2f0bf800 { - reg = <0x2f0bf800 DT_SIZE_K(1)>; - }; - - cpurad_cpuapp_ipc_shm_b: memory@2f0bfC00 { - reg = <0x2f0bfC00 DT_SIZE_K(1)>; - }; - }; - - ipc { - cpuapp_cpurad_ipc_b: ipc-2-3-b { - compatible = "zephyr,ipc-icbmsg"; - dcache-alignment = <32>; - status = "okay"; - mboxes = <&cpuapp_bellboard 20>, - <&cpurad_bellboard 14>; - }; - }; -}; - -&cpuapp_bellboard { - nordic,interrupt-mapping = <0x146041 0x0>; -}; - -&ipc0 { - tx-region = <&cpuapp_cpurad_ipc_shm_a>; - rx-region = <&cpurad_cpuapp_ipc_shm_a>; -}; - -ipc1: &cpuapp_cpurad_ipc_b { - status = "okay"; - mbox-names = "rx", "tx"; - tx-region = <&cpuapp_cpurad_ipc_shm_b>; - rx-region = <&cpurad_cpuapp_ipc_shm_b>; - tx-blocks = <32>; - rx-blocks = <32>; -}; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay deleted file mode 100644 index 26ef0518b8b..00000000000 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ /dev/null @@ -1,50 +0,0 @@ -/ { - reserved-memory { - /delete-node/ memory@2f0bf000; - /delete-node/ memory@2f0bf800; - - cpuapp_cpurad_ipc_shm_a: memory@2f0bf000 { - reg = <0x2f0bf000 DT_SIZE_K(1)>; - }; - - cpurad_cpuapp_ipc_shm_a: memory@2f0bf400 { - reg = <0x2f0bf400 DT_SIZE_K(1)>; - }; - - cpuapp_cpurad_ipc_shm_b: memory@2f0bf800 { - reg = <0x2f0bf800 DT_SIZE_K(1)>; - }; - - cpurad_cpuapp_ipc_shm_b: memory@2f0bfC00 { - reg = <0x2f0bfC00 DT_SIZE_K(1)>; - }; - }; - - ipc { - cpuapp_cpurad_ipc_b: ipc-2-3-b { - compatible = "zephyr,ipc-icbmsg"; - dcache-alignment = <32>; - status = "okay"; - mboxes = <&cpuapp_bellboard 20>, - <&cpurad_bellboard 14>; - }; - }; -}; - -&cpurad_bellboard { - nordic,interrupt-mapping = <0x5041 0>; -}; - -&ipc0 { - tx-region = <&cpurad_cpuapp_ipc_shm_a>; - rx-region = <&cpuapp_cpurad_ipc_shm_a>; -}; - -ipc1: &cpuapp_cpurad_ipc_b { - status = "okay"; - mbox-names = "tx", "rx"; - tx-region = <&cpurad_cpuapp_ipc_shm_b>; - rx-region = <&cpuapp_cpurad_ipc_shm_b>; - tx-blocks = <32>; - rx-blocks = <32>; -}; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/sample.yaml b/samples/subsys/ipc/ipc_service/multi_endpoint/sample.yaml index 1e08253ca2b..4505f76ac51 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/sample.yaml +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/sample.yaml @@ -17,11 +17,9 @@ tests: platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf5340bsim/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf5340dk/nrf5340/cpuapp - nrf5340bsim/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp tags: ipc sysbuild: true sample.ipc.multi_endpoint.icbmsg: diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/src/main.c b/samples/subsys/ipc/ipc_service/multi_endpoint/src/main.c index d7d74daaf10..4ad5659df38 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/src/main.c +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/src/main.c @@ -228,7 +228,6 @@ static void ipc1_entry(void *dummy0, void *dummy1, void *dummy2) return; } - printf("Waiting for bind\n"); k_sem_take(&ipc1_bound_sem, K_FOREVER); /* From 8b18417b8a2d772cd427eb3f2b4e5d8d444f9200 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 118/881] Revert "[nrf fromlist] tests: boards: nrf: qdec: Fix test for nRF54L15" This reverts commit d24c26f9852942beb447cd6a352aa95873fb6b7a. Signed-off-by: Jukka Rissanen --- tests/boards/nrf/qdec/src/main.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 6bc867f8aa9..9d138d325fb 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -60,11 +60,6 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t static void qenc_emulate_work_handler(struct k_work *work) { - /* Check if emulation has been stopped after submitting this work item. */ - if (loopback_currently_under_test == NULL) { - return; - } - if (toggle_a) { gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_a); } else { @@ -118,8 +113,6 @@ static void qenc_emulate_stop(void) k_timer_stop(&qenc_emulate_timer); qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_a); qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_b); - - loopback_currently_under_test = NULL; } } @@ -225,9 +218,6 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { pm_device_runtime_put(loopback->qdec); } - - qenc_emulate_stop(); - k_sem_reset(&sem); } /** @@ -280,7 +270,8 @@ static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) } qenc_emulate_stop(); - k_sem_reset(&sem); + /* emulation not working, but there may be old trigger which needs to be cleaned up */ + rc = k_sem_take(&sem, K_MSEC(200)); } /** @@ -580,7 +571,6 @@ static void after(void *fixture) ARG_UNUSED(fixture); qenc_emulate_stop(); - k_sem_reset(&sem); } ZTEST_SUITE(qdec_sensor, NULL, setup, before, after, NULL); From f5e0b2ad234b8554003ccc26f86437e341e82e16 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 119/881] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit 28dd6d642251104d3f1cf5b27d7641b36d070757. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index b5ace932db2..853d84113a6 100644 --- a/west.yml +++ b/west.yml @@ -325,7 +325,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 40403f5f2805cca210d2a47c8717d89c4e816cda + revision: 8b6001d6bdd9e2c8bb858fdb26f696f6d5f73db5 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: 787eea1a3c8dd13c86214e204a919e6f9bcebf91 From 0c20e011baf463b4d00e1b96399b7696b9387ead Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 120/881] Revert "[nrf fromlist] tests: kernel: interrupt: generic ISR offset definition for nrf54h20 VPRs" This reverts commit 04dbe2e567ecae84c575a335a22a8aa8895bfbf5. Signed-off-by: Jukka Rissanen --- tests/kernel/gen_isr_table/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/gen_isr_table/src/main.c b/tests/kernel/gen_isr_table/src/main.c index fdea6d3bd98..d3e3291573a 100644 --- a/tests/kernel/gen_isr_table/src/main.c +++ b/tests/kernel/gen_isr_table/src/main.c @@ -26,7 +26,7 @@ extern uintptr_t _irq_vector_table[]; #define ISR3_OFFSET 17 #define ISR5_OFFSET 18 #define TRIG_CHECK_SIZE 19 -#elif defined(CONFIG_SOC_SERIES_NRF54HX) && defined(CONFIG_RISCV_CORE_NORDIC_VPR) +#elif defined(CONFIG_SOC_NRF54H20_CPUPPR) || defined(CONFIG_SOC_NRF54H20_CPUFLPR) #define ISR1_OFFSET 14 #define ISR3_OFFSET 15 #define ISR5_OFFSET 16 From f06ee9bc2bf3a17035eb4878822d3b6f73897e88 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 121/881] Revert "[nrf fromtree] tests: kernel: interrupt: generic ISR offset definition for nrf54h20 VPRs" This reverts commit 809e846366f267496984d3a14fb40a347dc360a9. Signed-off-by: Jukka Rissanen --- tests/kernel/interrupt/src/nested_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/interrupt/src/nested_irq.c b/tests/kernel/interrupt/src/nested_irq.c index 99ebe7a35e9..6bfc81b8965 100644 --- a/tests/kernel/interrupt/src/nested_irq.c +++ b/tests/kernel/interrupt/src/nested_irq.c @@ -63,7 +63,7 @@ #define IRQ0_PRIO 1 #define IRQ1_PRIO 2 -#elif defined(CONFIG_SOC_SERIES_NRF54HX) && defined(CONFIG_RISCV_CORE_NORDIC_VPR) +#elif defined(CONFIG_SOC_NRF54H20_CPUPPR) #define IRQ0_LINE 14 #define IRQ1_LINE 15 From 957996ea90a026881ee4f1ffa3603b65c7d42728 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 122/881] Revert "[nrf fromtree] net: lib: tls_credentials: add invalid sec tag value" This reverts commit 82973b4f6d2a80e46775d336d20d3d57f09da409. Signed-off-by: Jukka Rissanen --- include/zephyr/net/tls_credentials.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/zephyr/net/tls_credentials.h b/include/zephyr/net/tls_credentials.h index d4bce6cd6fe..1002eee7e64 100644 --- a/include/zephyr/net/tls_credentials.h +++ b/include/zephyr/net/tls_credentials.h @@ -77,8 +77,6 @@ enum tls_credential_type { */ typedef int sec_tag_t; -#define SEC_TAG_TLS_INVALID (-1) /**< Invalid secure tag value. */ - /** * @brief Add a TLS credential. * From 6d93687581143bd64eb5ac10ca449c2cca3d14d6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 123/881] Revert "[nrf fromlist] drivers: timer: nrf_rtc: Fix custom wrapping" This reverts commit 139789b0b648c24b1a2dcbd5047725e213cf4f37. Signed-off-by: Jukka Rissanen --- drivers/timer/nrf_rtc_timer.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index d689365665e..a70cc19b7e9 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -21,12 +21,10 @@ #if (CONFIG_NRF_RTC_COUNTER_BIT_WIDTH < RTC_BIT_WIDTH) #define CUSTOM_COUNTER_BIT_WIDTH 1 -#define WRAP_CH 0 -#define SYS_CLOCK_CH 1 +#define WRAP_CH 1 #include "nrfx_ppi.h" #else #define CUSTOM_COUNTER_BIT_WIDTH 0 -#define SYS_CLOCK_CH 0 #endif #define RTC_PRETICK (IS_ENABLED(CONFIG_SOC_NRF53_RTC_PRETICK) && \ @@ -39,6 +37,7 @@ #define RTC_IRQn NRFX_IRQ_NUMBER_GET(RTC) #define RTC_LABEL rtc1 #define CHAN_COUNT_MAX (RTC1_CC_NUM - (RTC_PRETICK ? 1 : 0)) +#define SYS_CLOCK_CH 0 BUILD_ASSERT(CHAN_COUNT <= CHAN_COUNT_MAX, "Not enough compare channels"); /* Ensure that counter driver for RTC1 is not enabled. */ @@ -276,6 +275,15 @@ static int set_alarm(int32_t chan, uint32_t req_cc, bool exact) */ enum { MIN_CYCLES_FROM_NOW = 3 }; uint32_t cc_val = req_cc; + +#if CUSTOM_COUNTER_BIT_WIDTH + /* If a CC value is 0 when a CLEAR task is set, this will not + * trigger a COMAPRE event. Need to use 1 instead. + */ + if (cc_val % COUNTER_MAX == 0) { + cc_val = 1; + } +#endif uint32_t cc_inc = MIN_CYCLES_FROM_NOW; /* Disable event routing for the channel to avoid getting a COMPARE @@ -291,14 +299,6 @@ static int set_alarm(int32_t chan, uint32_t req_cc, bool exact) for (;;) { uint32_t now; -#if CUSTOM_COUNTER_BIT_WIDTH - /* If a CC value is 0 when a CLEAR task is set, this will not - * trigger a COMAPRE event. Need to use 1 instead. - */ - if ((cc_val & COUNTER_MAX) == 0) { - cc_val = 1; - } -#endif set_comparator(chan, cc_val); /* Enable event routing after the required CC value was set. * Even though the above operation may get repeated (see below), @@ -597,8 +597,8 @@ void rtc_nrf_isr(const void *arg) } #if CUSTOM_COUNTER_BIT_WIDTH - if (nrfy_rtc_int_enable_check(RTC, NRF_RTC_CHANNEL_INT_MASK(WRAP_CH)) && - nrfy_rtc_events_process(RTC, NRF_RTC_CHANNEL_INT_MASK(WRAP_CH))) { + if (nrfy_rtc_int_enable_check(RTC, NRF_RTC_INT_COMPARE1_MASK) && + nrfy_rtc_events_process(RTC, NRF_RTC_INT_COMPARE1_MASK)) { #else if (nrfy_rtc_int_enable_check(RTC, NRF_RTC_INT_OVERFLOW_MASK) && nrfy_rtc_events_process(RTC, NRF_RTC_INT_OVERFLOW_MASK)) { @@ -606,7 +606,7 @@ void rtc_nrf_isr(const void *arg) overflow_cnt++; } - for (int32_t chan = SYS_CLOCK_CH; chan < CHAN_COUNT; chan++) { + for (int32_t chan = 0; chan < CHAN_COUNT; chan++) { process_channel(chan); } } From 410385f7435cb699c93180bd7f57b1b3f42e39b3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 124/881] Revert "[nrf fromlist] drivers: adc: nrfx: Temporary fix for SAADC power consumption" This reverts commit 2158e6b9d71fe7582c0b3bd6fd8827352b26fc19. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 100c3fa66ef..7d442b482e6 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -639,7 +639,6 @@ static void event_handler(const nrfx_saadc_evt_t *event) if (has_single_ended(&m_data.ctx.sequence)) { correct_single_ended(&m_data.ctx.sequence, m_data.user_buffer); } - nrfy_saadc_disable(NRF_SAADC); adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); } else if (event->type == NRFX_SAADC_EVT_CALIBRATEDONE) { err = nrfx_saadc_mode_trigger(); From f07739181cfef743b9b00767e60382ac190bf9e0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:01 +0300 Subject: [PATCH 125/881] Revert "[nrf fromlist] doc: secure_storage: document the 30-bit UID" This reverts commit 804a1d59154a63351e29d6cf294e3b462220d5cd. Signed-off-by: Jukka Rissanen --- doc/services/storage/secure_storage/index.rst | 11 +---------- .../internal/zephyr/secure_storage/its/common.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/doc/services/storage/secure_storage/index.rst b/doc/services/storage/secure_storage/index.rst index 1829b435ea9..57f7dc03b27 100644 --- a/doc/services/storage/secure_storage/index.rst +++ b/doc/services/storage/secure_storage/index.rst @@ -43,18 +43,9 @@ The secure storage subsystem's implementation of the PSA Secure Storage API: Instead, the PS API directly calls into the Internal Trusted Storage (ITS) API (unless a `custom implementation <#whole-api>`_ of the PS API is provided). -Below are some ways the implementation purposefully deviates from the specification +Below are some ways the implementation deviates from the specification and an explanation why. This is not an exhaustive list. -* The UID type is only 30 bits by default. (Against `2.5 UIDs `_.) - - | This is an optimization done to make it more convenient to directly use the UIDs as - storage entry IDs (e.g., with :ref:`ZMS ` when - :kconfig:option:`CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS` is enabled). - | Zephyr defines numerical ranges to be used by different users of the API which guarantees that - there are no collisions and that they all fit within 30 bits. - See the header files in :zephyr_file:`include/zephyr/psa` for more information. - * The data stored in the ITS is by default encrypted and authenticated (Against ``1.`` in `3.2. Internal Trusted Storage requirements `_.) diff --git a/subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h b/subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h index 6ffc1bc78f5..f0576cba185 100644 --- a/subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h +++ b/subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h @@ -39,7 +39,6 @@ typedef struct { * smaller IDs compared to the 64-bit ones that PSA Secure Storage specifies. * Zephyr defines ranges of IDs to be used by different users of the API (subsystems, application) * which guarantees 1. no collisions and 2. that the IDs used fit within `uid`. - * @see @ref zephyr/psa/key_ids.h and the other header files under `zephyr/psa`. */ typedef struct { psa_storage_uid_t uid : SECURE_STORAGE_ITS_UID_BIT_SIZE; From 4d3f4324cec6e14f6b17f5a04dbc0c2209f85228 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 126/881] Revert "[nrf fromlist] secure_storage: use %# flag character for hex printing" This reverts commit fdb9ab5d52bacff73a0bc00f47cddfb61d282edd. Signed-off-by: Jukka Rissanen --- subsys/secure_storage/src/its/implementation.c | 2 +- subsys/secure_storage/src/its/store/zms.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/subsys/secure_storage/src/its/implementation.c b/subsys/secure_storage/src/its/implementation.c index 6f33195a062..a2b7f97c372 100644 --- a/subsys/secure_storage/src/its/implementation.c +++ b/subsys/secure_storage/src/its/implementation.c @@ -27,7 +27,7 @@ static psa_status_t make_its_uid(secure_storage_its_caller_id_t caller_id, psa_s #ifndef CONFIG_SECURE_STORAGE_64_BIT_UID /* Check that the UID is not bigger than the maximum defined size. */ if (uid & GENMASK64(63, SECURE_STORAGE_ITS_UID_BIT_SIZE)) { - LOG_DBG("UID %u/%#llx cannot be used as it has bits set past " + LOG_DBG("UID %u/0x%llx cannot be used as it has bits set past " "the first " STRINGIFY(SECURE_STORAGE_ITS_UID_BIT_SIZE) " ones.", caller_id, (unsigned long long)uid); return PSA_ERROR_INVALID_ARGUMENT; diff --git a/subsys/secure_storage/src/its/store/zms.c b/subsys/secure_storage/src/its/store/zms.c index 4778e0365e9..3a3bdd64c76 100644 --- a/subsys/secure_storage/src/its/store/zms.c +++ b/subsys/secure_storage/src/its/store/zms.c @@ -69,7 +69,7 @@ psa_status_t secure_storage_its_store_set(secure_storage_its_uid_t uid, } else { psa_ret = PSA_ERROR_STORAGE_FAILURE; } - LOG_DBG("%s %#x with %zu bytes. (%zd)", (psa_ret == PSA_SUCCESS) ? + LOG_DBG("%s 0x%x with %zu bytes. (%zd)", (psa_ret == PSA_SUCCESS) ? "Wrote" : "Failed to write", zms_id, data_length, zms_ret); return psa_ret; } @@ -90,7 +90,7 @@ psa_status_t secure_storage_its_store_get(secure_storage_its_uid_t uid, size_t d } else { psa_ret = PSA_ERROR_STORAGE_FAILURE; } - LOG_DBG("%s %#x for up to %zu bytes. (%zd)", (psa_ret != PSA_ERROR_STORAGE_FAILURE) ? + LOG_DBG("%s 0x%x for up to %zu bytes. (%zd)", (psa_ret != PSA_ERROR_STORAGE_FAILURE) ? "Read" : "Failed to read", zms_id, data_size, zms_ret); return psa_ret; } @@ -101,7 +101,7 @@ psa_status_t secure_storage_its_store_remove(secure_storage_its_uid_t uid) const uint32_t zms_id = zms_id_from(uid); ret = zms_delete(&s_zms, zms_id); - LOG_DBG("%s %#x. (%d)", ret ? "Failed to delete" : "Deleted", zms_id, ret); + LOG_DBG("%s 0x%x. (%d)", ret ? "Failed to delete" : "Deleted", zms_id, ret); return ret ? PSA_ERROR_STORAGE_FAILURE : PSA_SUCCESS; } From 58e69b4e15eb02960d3b14cc2dac81352f39a87d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 127/881] Revert "[nrf fromlist] samples: psa: specify integration_platforms" This reverts commit 5161a6a58af31aba9075eec78a7eb0134b6e5092. Signed-off-by: Jukka Rissanen --- samples/psa/its/sample.yaml | 2 -- samples/psa/persistent_key/sample.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/samples/psa/its/sample.yaml b/samples/psa/its/sample.yaml index d3e7b7e10c9..8d67cddd157 100644 --- a/samples/psa/its/sample.yaml +++ b/samples/psa/its/sample.yaml @@ -2,8 +2,6 @@ sample: name: PSA ITS API sample description: Demonstration of PSA Internal Trusted Storage (ITS) API usage. common: - integration_platforms: - - native_sim tags: - psa.secure_storage timeout: 10 diff --git a/samples/psa/persistent_key/sample.yaml b/samples/psa/persistent_key/sample.yaml index 7c5b9d80300..490f2ea8f15 100644 --- a/samples/psa/persistent_key/sample.yaml +++ b/samples/psa/persistent_key/sample.yaml @@ -2,8 +2,6 @@ sample: name: PSA Crypto persistent key sample description: Demonstration of persistent key usage in the PSA Crypto API. common: - integration_platforms: - - native_sim tags: - psa.secure_storage timeout: 10 From 56ace60bcaeed70473d24fa72a9d811c8fad69b0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 128/881] Revert "[nrf fromlist] tests: secure_storage: remove an integration platform" This reverts commit f9e3cfe8473ea45b23eebe781f0a6515139e7762. Signed-off-by: Jukka Rissanen --- tests/subsys/secure_storage/psa/crypto/testcase.yaml | 1 + tests/subsys/secure_storage/psa/its/testcase.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/subsys/secure_storage/psa/crypto/testcase.yaml b/tests/subsys/secure_storage/psa/crypto/testcase.yaml index 1482d23cb6c..8755a5a1935 100644 --- a/tests/subsys/secure_storage/psa/crypto/testcase.yaml +++ b/tests/subsys/secure_storage/psa/crypto/testcase.yaml @@ -8,6 +8,7 @@ tests: integration_platforms: - native_sim - nrf54l15dk/nrf54l15/cpuapp + - ophelia4ev/nrf54l15/cpuapp secure_storage.psa.crypto.tfm: filter: CONFIG_BUILD_WITH_TFM extra_args: EXTRA_CONF_FILE=overlay-tfm.conf diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index 0125b9d1e21..a871c015117 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -2,6 +2,7 @@ common: integration_platforms: - native_sim - nrf54l15dk/nrf54l15/cpuapp + - ophelia4ev/nrf54l15/cpuapp platform_exclude: - qemu_cortex_m0 # settings subsystem initialization fails timeout: 600 From 174df20676b2db977d988f724efd96e85e97ab20 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 129/881] Revert "[nrf fromlist] tests: secure_storage: psa: its: fix ZMS test" This reverts commit 2f40e49a5a6fdeeb23af70d80f00aabf15fca3a3. Signed-off-by: Jukka Rissanen --- tests/subsys/secure_storage/psa/its/overlay-store_zms.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/subsys/secure_storage/psa/its/overlay-store_zms.conf b/tests/subsys/secure_storage/psa/its/overlay-store_zms.conf index 6c36dd40297..7efe611bc0a 100644 --- a/tests/subsys/secure_storage/psa/its/overlay-store_zms.conf +++ b/tests/subsys/secure_storage/psa/its/overlay-store_zms.conf @@ -1,4 +1,3 @@ CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS=y CONFIG_ZMS=y CONFIG_FLASH=y -CONFIG_FLASH_MAP=y From 750d42bc262bb34bbff020b10c73bfe0f50ba3db Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 130/881] Revert "[nrf noup] tests: secure_storage: fix test w/ ZMS backend on 54L15" This reverts commit eb02a0210ff85ff00c9bacdf14c692f97d2e4d35. Signed-off-by: Jukka Rissanen --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index a871c015117..e0cf75c5895 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -28,7 +28,6 @@ tests: - EXTRA_DTC_OVERLAY_FILE=zms.overlay - EXTRA_CONF_FILE=\ overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf - - SB_CONFIG_PARTITION_MANAGER=n secure_storage.psa.its.secure_storage.store.zms.64-bit_uids: platform_allow: *zms_platform_allow From 980a30547734515241f243c9b0b9c81b99dbb4e0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 131/881] Revert "[nrf fromlist] tests: secure_storage: psa: its: add test scenarios for 64-bit UIDs" This reverts commit 5f0e7cdd3bd0d4096ac6f5368f03ab89f5ed5445. Signed-off-by: Jukka Rissanen --- .../secure_storage/psa/its/testcase.yaml | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index e0cf75c5895..05f1c1b9a6a 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -10,9 +10,10 @@ common: - psa.secure_storage tests: secure_storage.psa.its.secure_storage.store.zms: + filter: CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS # DT-based filtering is not possible for this test scenario. # Platforms with a storage_partition must be manually added here. - platform_allow: &zms_platform_allow + platform_allow: - native_sim - mps2/an385 - qemu_x86/atom @@ -24,29 +25,14 @@ tests: - nrf9160dk/nrf9160 - nrf9161dk/nrf9161 - ophelia4ev/nrf54l15/cpuapp - extra_args: &zms_extra_args + extra_args: - EXTRA_DTC_OVERLAY_FILE=zms.overlay - - EXTRA_CONF_FILE=\ - overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf - - secure_storage.psa.its.secure_storage.store.zms.64-bit_uids: - platform_allow: *zms_platform_allow - extra_args: *zms_extra_args - extra_configs: - - CONFIG_SECURE_STORAGE_64_BIT_UID=y + - EXTRA_CONF_FILE=overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf secure_storage.psa.its.secure_storage.store.settings: - filter: &settings_filter - CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS - extra_args: &settings_extra_args - "EXTRA_CONF_FILE=\ - overlay-secure_storage.conf;overlay-transform_default.conf;overlay-store_settings.conf" - - secure_storage.psa.its.secure_storage.store.settings.64-bit_uids: - filter: *settings_filter - extra_args: *settings_extra_args - extra_configs: - - CONFIG_SECURE_STORAGE_64_BIT_UID=y + filter: CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS + extra_args: "EXTRA_CONF_FILE=\ + overlay-secure_storage.conf;overlay-transform_default.conf;overlay-store_settings.conf" secure_storage.psa.its.secure_storage.custom.transform: filter: CONFIG_SECURE_STORAGE and not CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE From 011d2d651291129cf346481b7ab738ad8c277fd1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 132/881] Revert "[nrf fromlist] secure_storage: its: use %l printf length modifier" This reverts commit 2ce069884367ce0ea8a687ef0966dfaf8088a600. Signed-off-by: Jukka Rissanen --- subsys/secure_storage/src/its/implementation.c | 11 ++--------- subsys/secure_storage/src/its/store/settings.c | 6 ------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/subsys/secure_storage/src/its/implementation.c b/subsys/secure_storage/src/its/implementation.c index a2b7f97c372..b39fbf90b00 100644 --- a/subsys/secure_storage/src/its/implementation.c +++ b/subsys/secure_storage/src/its/implementation.c @@ -115,15 +115,8 @@ static bool keep_stored_entry(secure_storage_its_uid_t uid, size_t data_length, if (existing_data_len == data_length && existing_create_flags == create_flags && !memcmp(existing_data, p_data, data_length)) { -#ifdef CONFIG_SECURE_STORAGE_64_BIT_UID - LOG_DBG("Not writing entry %u/%#llx to storage because its stored data" - " (of length %zu) is identical.", uid.caller_id, - (unsigned long long)uid.uid, data_length); -#else - LOG_DBG("Not writing entry %u/%#lx to storage because its stored data" - " (of length %zu) is identical.", uid.caller_id, - (unsigned long)uid.uid, data_length); -#endif + LOG_DBG("Not writing entry %u/%llu to storage because its stored data" + " (of length %zu) is identical.", uid.caller_id, uid.uid, data_length); *ret = PSA_SUCCESS; return true; } diff --git a/subsys/secure_storage/src/its/store/settings.c b/subsys/secure_storage/src/its/store/settings.c index 37973ffb024..962fa516770 100644 --- a/subsys/secure_storage/src/its/store/settings.c +++ b/subsys/secure_storage/src/its/store/settings.c @@ -38,15 +38,9 @@ void secure_storage_its_store_settings_get_name( { int ret; -#ifdef CONFIG_SECURE_STORAGE_64_BIT_UID ret = snprintf(name, SECURE_STORAGE_ITS_STORE_SETTINGS_NAME_BUF_SIZE, CONFIG_SECURE_STORAGE_ITS_STORE_SETTINGS_PREFIX "%x/%llx", uid.caller_id, (unsigned long long)uid.uid); -#else - ret = snprintf(name, SECURE_STORAGE_ITS_STORE_SETTINGS_NAME_BUF_SIZE, - CONFIG_SECURE_STORAGE_ITS_STORE_SETTINGS_PREFIX "%x/%lx", - uid.caller_id, (unsigned long)uid.uid); -#endif __ASSERT_NO_MSG(ret > 0 && ret < SECURE_STORAGE_ITS_STORE_SETTINGS_NAME_BUF_SIZE); } From cb54fd4cf18a3a88954a2d1ef905126223946d24 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 133/881] Revert "[nrf fromlist] secure_storage: make UIDs 32-bit" This reverts commit c784ed16c10cbe33a4cde3488098cf347ef5cf04. Signed-off-by: Jukka Rissanen --- subsys/secure_storage/Kconfig | 11 --- subsys/secure_storage/Kconfig.its_store | 7 +- .../internal/zephyr/secure_storage/its.h | 17 ++-- .../zephyr/secure_storage/its/common.h | 23 +---- .../include/psa/internal_trusted_storage.h | 10 +- .../include/psa/protected_storage.h | 12 +-- .../include/psa/storage_common.h | 4 - .../secure_storage/src/its/implementation.c | 94 +++++-------------- subsys/secure_storage/src/its/store/zms.c | 30 ++++-- 9 files changed, 69 insertions(+), 139 deletions(-) diff --git a/subsys/secure_storage/Kconfig b/subsys/secure_storage/Kconfig index b0ac8c08a14..3fe8eb0f76a 100644 --- a/subsys/secure_storage/Kconfig +++ b/subsys/secure_storage/Kconfig @@ -25,17 +25,6 @@ module = SECURE_STORAGE module-str = secure_storage source "subsys/logging/Kconfig.template.log_config" -config SECURE_STORAGE_64_BIT_UID - bool "Make psa_storage_uid_t 64-bit" - help - Zephyr, by default, uses a 30-bit psa_storage_uid_t, which allows using only 32 bits to - identify entries. - UID ranges are defined for the different users of the API which guarantees that all the - UIDs fit within 30 bits. See for example the zephyr/psa/key_ids.h header file. - Enable this for backward compatibility if you are updating an existing installation with - stored entries that was using Zephyr prior to 4.3 or if for some reason you need the full - 64-bit UID range. - choice SECURE_STORAGE_ITS_IMPLEMENTATION prompt "Internal Trusted Storage (ITS) API implementation" diff --git a/subsys/secure_storage/Kconfig.its_store b/subsys/secure_storage/Kconfig.its_store index c924def563f..ccd15b968a7 100644 --- a/subsys/secure_storage/Kconfig.its_store +++ b/subsys/secure_storage/Kconfig.its_store @@ -17,7 +17,7 @@ config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS depends on ZMS help This implementation of the ITS store module makes direct use of ZMS for storage. - It needs a secure_storage_its_partition devicetree chosen property that points + It needs a `secure_storage_its_partition` devicetree chosen property that points to a fixed storage partition that will be dedicated to the ITS. It has lower overhead compared to the settings-based implementation, both in terms of runtime execution and storage space, and also ROM footprint if the settings subsystem is disabled. @@ -78,8 +78,7 @@ config SECURE_STORAGE_ITS_STORE_SETTINGS_PREFIX config SECURE_STORAGE_ITS_STORE_SETTINGS_NAME_MAX_LEN int "Maximum setting name length" range 2 64 - default 0 if SECURE_STORAGE_ITS_STORE_SETTINGS_NAME_CUSTOM - default 22 if SECURE_STORAGE_64_BIT_UID - default 14 + default 22 if !SECURE_STORAGE_ITS_STORE_SETTINGS_NAME_CUSTOM + default 0 endif # SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS diff --git a/subsys/secure_storage/include/internal/zephyr/secure_storage/its.h b/subsys/secure_storage/include/internal/zephyr/secure_storage/its.h index c19dd7be7b6..009bb5e061a 100644 --- a/subsys/secure_storage/include/internal/zephyr/secure_storage/its.h +++ b/subsys/secure_storage/include/internal/zephyr/secure_storage/its.h @@ -14,21 +14,18 @@ #include "its/common.h" /** @brief See `psa_its_set()`, to which this function is analogous. */ -psa_status_t secure_storage_its_set(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid, - size_t data_length, const void *p_data, - psa_storage_create_flags_t create_flags); +psa_status_t secure_storage_its_set(secure_storage_its_uid_t uid, size_t data_length, + const void *p_data, psa_storage_create_flags_t create_flags); /** @brief See `psa_its_get()`, to which this function is analogous. */ -psa_status_t secure_storage_its_get(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid, - size_t data_offset, size_t data_size, - void *p_data, size_t *p_data_length); +psa_status_t secure_storage_its_get(secure_storage_its_uid_t uid, size_t data_offset, + size_t data_size, void *p_data, size_t *p_data_length); /** @brief See `psa_its_get_info()`, to which this function is analogous. */ -psa_status_t secure_storage_its_get_info(secure_storage_its_caller_id_t caller_id, - psa_storage_uid_t uid, struct psa_storage_info_t *p_info); +psa_status_t secure_storage_its_get_info(secure_storage_its_uid_t uid, + struct psa_storage_info_t *p_info); /** @brief See `psa_its_remove()`, to which this function is analogous. */ -psa_status_t secure_storage_its_remove(secure_storage_its_caller_id_t caller_id, - psa_storage_uid_t uid); +psa_status_t secure_storage_its_remove(secure_storage_its_uid_t uid); #endif diff --git a/subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h b/subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h index f0576cba185..cd953086950 100644 --- a/subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h +++ b/subsys/secure_storage/include/internal/zephyr/secure_storage/its/common.h @@ -12,7 +12,8 @@ #include /** @brief The ID of the caller from which the ITS API call originates. - * This is used to namespace the different callers and possibly treat them differently. + * This is used to prevent ID collisions between different callers that are not aware + * of each other and so might use the same numerical IDs, e.g. PSA Crypto and PSA ITS. */ typedef enum { SECURE_STORAGE_ITS_CALLER_PSA_ITS, @@ -21,32 +22,12 @@ typedef enum { SECURE_STORAGE_ITS_CALLER_COUNT } secure_storage_its_caller_id_t; -#ifdef CONFIG_SECURE_STORAGE_64_BIT_UID - /** The UID (caller + entry IDs) of an ITS entry. */ typedef struct { psa_storage_uid_t uid; secure_storage_its_caller_id_t caller_id; } __packed secure_storage_its_uid_t; -#else - -#define SECURE_STORAGE_ITS_UID_BIT_SIZE 30 -#define SECURE_STORAGE_ITS_CALLER_ID_BIT_SIZE 2 - -/** @brief The UID (caller + entry IDs) of an ITS entry. - * This is a packed, 32-bit version of `psa_storage_uid_t` which allows storing - * smaller IDs compared to the 64-bit ones that PSA Secure Storage specifies. - * Zephyr defines ranges of IDs to be used by different users of the API (subsystems, application) - * which guarantees 1. no collisions and 2. that the IDs used fit within `uid`. - */ -typedef struct { - psa_storage_uid_t uid : SECURE_STORAGE_ITS_UID_BIT_SIZE; - secure_storage_its_caller_id_t caller_id : SECURE_STORAGE_ITS_CALLER_ID_BIT_SIZE; -} secure_storage_its_uid_t; - -#endif /* CONFIG_SECURE_STORAGE_64_BIT_UID */ - #ifdef CONFIG_SECURE_STORAGE_ITS_TRANSFORM_MODULE /** The maximum size, in bytes, of an entry's data after it has been transformed for storage. */ diff --git a/subsys/secure_storage/include/psa/internal_trusted_storage.h b/subsys/secure_storage/include/psa/internal_trusted_storage.h index 06a09e34988..a8c3b77c601 100644 --- a/subsys/secure_storage/include/psa/internal_trusted_storage.h +++ b/subsys/secure_storage/include/psa/internal_trusted_storage.h @@ -16,6 +16,7 @@ #else #define ITS_CALLER_ID SECURE_STORAGE_ITS_CALLER_PSA_ITS #endif +#define ITS_UID (secure_storage_its_uid_t){.uid = uid, .caller_id = ITS_CALLER_ID} /** @endcond */ #include @@ -49,7 +50,7 @@ static ALWAYS_INLINE psa_status_t psa_its_set(psa_storage_uid_t uid, size_t data_length, const void *p_data, psa_storage_create_flags_t create_flags) { - return secure_storage_its_set(ITS_CALLER_ID, uid, data_length, p_data, create_flags); + return secure_storage_its_set(ITS_UID, data_length, p_data, create_flags); } /** @@ -75,8 +76,7 @@ static ALWAYS_INLINE psa_status_t psa_its_get(psa_storage_uid_t uid, size_t data_offset, size_t data_size, void *p_data, size_t *p_data_length) { - return secure_storage_its_get(ITS_CALLER_ID, uid, data_offset, - data_size, p_data, p_data_length); + return secure_storage_its_get(ITS_UID, data_offset, data_size, p_data, p_data_length); } /** @@ -96,7 +96,7 @@ static ALWAYS_INLINE /** @endcond */ psa_status_t psa_its_get_info(psa_storage_uid_t uid, struct psa_storage_info_t *p_info) { - return secure_storage_its_get_info(ITS_CALLER_ID, uid, p_info); + return secure_storage_its_get_info(ITS_UID, p_info); } /** @@ -117,7 +117,7 @@ static ALWAYS_INLINE /** @endcond */ psa_status_t psa_its_remove(psa_storage_uid_t uid) { - return secure_storage_its_remove(ITS_CALLER_ID, uid); + return secure_storage_its_remove(ITS_UID); } #undef ITS_UID diff --git a/subsys/secure_storage/include/psa/protected_storage.h b/subsys/secure_storage/include/psa/protected_storage.h index 40d731b0425..7c20d3097a2 100644 --- a/subsys/secure_storage/include/psa/protected_storage.h +++ b/subsys/secure_storage/include/psa/protected_storage.h @@ -12,7 +12,8 @@ /** @cond INTERNAL_HIDDEN */ #ifdef CONFIG_SECURE_STORAGE_PS_IMPLEMENTATION_ITS #include "../internal/zephyr/secure_storage/its.h" -#define ITS_CALLER_ID SECURE_STORAGE_ITS_CALLER_PSA_PS +#define ITS_UID (secure_storage_its_uid_t){.uid = uid, \ + .caller_id = SECURE_STORAGE_ITS_CALLER_PSA_PS} #else #include "../internal/zephyr/secure_storage/ps.h" #endif @@ -49,7 +50,7 @@ psa_status_t psa_ps_set(psa_storage_uid_t uid, size_t data_length, const void *p_data, psa_storage_create_flags_t create_flags) { #ifdef CONFIG_SECURE_STORAGE_PS_IMPLEMENTATION_ITS - return secure_storage_its_set(ITS_CALLER_ID, uid, data_length, p_data, create_flags); + return secure_storage_its_set(ITS_UID, data_length, p_data, create_flags); #else return secure_storage_ps_set(uid, data_length, p_data, create_flags); #endif @@ -82,8 +83,7 @@ psa_status_t psa_ps_get(psa_storage_uid_t uid, size_t data_offset, size_t data_size, void *p_data, size_t *p_data_length) { #ifdef CONFIG_SECURE_STORAGE_PS_IMPLEMENTATION_ITS - return secure_storage_its_get(ITS_CALLER_ID, uid, data_offset, - data_size, p_data, p_data_length); + return secure_storage_its_get(ITS_UID, data_offset, data_size, p_data, p_data_length); #else return secure_storage_ps_get(uid, data_offset, data_size, p_data, p_data_length); #endif @@ -110,7 +110,7 @@ static ALWAYS_INLINE psa_status_t psa_ps_get_info(psa_storage_uid_t uid, struct psa_storage_info_t *p_info) { #ifdef CONFIG_SECURE_STORAGE_PS_IMPLEMENTATION_ITS - return secure_storage_its_get_info(ITS_CALLER_ID, uid, p_info); + return secure_storage_its_get_info(ITS_UID, p_info); #else return secure_storage_ps_get_info(uid, p_info); #endif @@ -138,7 +138,7 @@ static ALWAYS_INLINE psa_status_t psa_ps_remove(psa_storage_uid_t uid) { #ifdef CONFIG_SECURE_STORAGE_PS_IMPLEMENTATION_ITS - return secure_storage_its_remove(ITS_CALLER_ID, uid); + return secure_storage_its_remove(ITS_UID); #else return secure_storage_ps_remove(uid); #endif diff --git a/subsys/secure_storage/include/psa/storage_common.h b/subsys/secure_storage/include/psa/storage_common.h index 2bd0f7cce73..d5bed2a692e 100644 --- a/subsys/secure_storage/include/psa/storage_common.h +++ b/subsys/secure_storage/include/psa/storage_common.h @@ -20,11 +20,7 @@ #include /** UID type for identifying entries. */ -#ifdef CONFIG_SECURE_STORAGE_64_BIT_UID typedef uint64_t psa_storage_uid_t; -#else -typedef uint32_t psa_storage_uid_t; -#endif /** Flags used when creating an entry. */ typedef uint32_t psa_storage_create_flags_t; diff --git a/subsys/secure_storage/src/its/implementation.c b/subsys/secure_storage/src/its/implementation.c index b39fbf90b00..2ad937d45d2 100644 --- a/subsys/secure_storage/src/its/implementation.c +++ b/subsys/secure_storage/src/its/implementation.c @@ -11,33 +11,6 @@ LOG_MODULE_DECLARE(secure_storage, CONFIG_SECURE_STORAGE_LOG_LEVEL); -#ifndef CONFIG_SECURE_STORAGE_64_BIT_UID -BUILD_ASSERT(sizeof(secure_storage_its_uid_t) == 4); /* ITS UIDs are 32-bit */ -BUILD_ASSERT(1 << SECURE_STORAGE_ITS_CALLER_ID_BIT_SIZE >= SECURE_STORAGE_ITS_CALLER_COUNT); -BUILD_ASSERT(SECURE_STORAGE_ITS_CALLER_ID_BIT_SIZE + SECURE_STORAGE_ITS_UID_BIT_SIZE == 32); -#endif - -static psa_status_t make_its_uid(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid, - secure_storage_its_uid_t *its_uid) -{ - if (uid == 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - -#ifndef CONFIG_SECURE_STORAGE_64_BIT_UID - /* Check that the UID is not bigger than the maximum defined size. */ - if (uid & GENMASK64(63, SECURE_STORAGE_ITS_UID_BIT_SIZE)) { - LOG_DBG("UID %u/0x%llx cannot be used as it has bits set past " - "the first " STRINGIFY(SECURE_STORAGE_ITS_UID_BIT_SIZE) " ones.", - caller_id, (unsigned long long)uid); - return PSA_ERROR_INVALID_ARGUMENT; - } -#endif /* !CONFIG_SECURE_STORAGE_64_BIT_UID */ - - *its_uid = (secure_storage_its_uid_t){.caller_id = caller_id, .uid = uid}; - return PSA_SUCCESS; -} - static void log_failed_operation(const char *operation, const char *preposition, psa_status_t ret) { LOG_ERR("Failed to %s data %s storage. (%d)", operation, preposition, ret); @@ -144,17 +117,12 @@ static psa_status_t store_entry(secure_storage_its_uid_t uid, size_t data_length return ret; } -psa_status_t secure_storage_its_set(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid, - size_t data_length, const void *p_data, - psa_storage_create_flags_t create_flags) +psa_status_t secure_storage_its_set(secure_storage_its_uid_t uid, size_t data_length, + const void *p_data, psa_storage_create_flags_t create_flags) { psa_status_t ret; - secure_storage_its_uid_t its_uid; - if (make_its_uid(caller_id, uid, &its_uid) != PSA_SUCCESS) { - return PSA_ERROR_INVALID_ARGUMENT; - } - if (p_data == NULL && data_length != 0) { + if (uid.uid == 0 || (p_data == NULL && data_length != 0)) { return PSA_ERROR_INVALID_ARGUMENT; } if (create_flags & ~SECURE_STORAGE_ALL_CREATE_FLAGS) { @@ -166,49 +134,43 @@ psa_status_t secure_storage_its_set(secure_storage_its_caller_id_t caller_id, ps return PSA_ERROR_INSUFFICIENT_STORAGE; } - if (keep_stored_entry(its_uid, data_length, p_data, create_flags, &ret)) { + if (keep_stored_entry(uid, data_length, p_data, create_flags, &ret)) { return ret; } - ret = store_entry(its_uid, data_length, p_data, create_flags); + ret = store_entry(uid, data_length, p_data, create_flags); return ret; } -psa_status_t secure_storage_its_get(secure_storage_its_caller_id_t caller_id, psa_storage_uid_t uid, - size_t data_offset, size_t data_size, - void *p_data, size_t *p_data_length) -{ - psa_status_t ret; - secure_storage_its_uid_t its_uid; - uint8_t stored_data[SECURE_STORAGE_ITS_TRANSFORM_MAX_STORED_DATA_SIZE]; - size_t stored_data_len; - psa_storage_create_flags_t create_flags; - if (make_its_uid(caller_id, uid, &its_uid) != PSA_SUCCESS) { - return PSA_ERROR_INVALID_ARGUMENT; - } - if ((p_data == NULL && data_size != 0) || p_data_length == NULL) { +psa_status_t secure_storage_its_get(secure_storage_its_uid_t uid, size_t data_offset, + size_t data_size, void *p_data, size_t *p_data_length) +{ + if (uid.uid == 0 || (p_data == NULL && data_size != 0) || p_data_length == NULL) { return PSA_ERROR_INVALID_ARGUMENT; } if (data_size == 0) { *p_data_length = 0; return PSA_SUCCESS; } + psa_status_t ret; + uint8_t stored_data[SECURE_STORAGE_ITS_TRANSFORM_MAX_STORED_DATA_SIZE]; + size_t stored_data_len; + psa_storage_create_flags_t create_flags; - - ret = get_stored_data(its_uid, stored_data, &stored_data_len); + ret = get_stored_data(uid, stored_data, &stored_data_len); if (ret != PSA_SUCCESS) { return ret; } if (data_offset == 0 && data_size >= SECURE_STORAGE_ITS_TRANSFORM_DATA_SIZE(stored_data_len)) { /* All the data fits directly in the provided buffer. */ - return transform_stored_data(its_uid, stored_data_len, stored_data, data_size, - p_data, p_data_length, &create_flags); + return transform_stored_data(uid, stored_data_len, stored_data, data_size, p_data, + p_data_length, &create_flags); } uint8_t data[CONFIG_SECURE_STORAGE_ITS_MAX_DATA_SIZE]; size_t data_len; - ret = transform_stored_data(its_uid, stored_data_len, stored_data, sizeof(data), data, + ret = transform_stored_data(uid, stored_data_len, stored_data, sizeof(data), data, &data_len, &create_flags); if (ret == PSA_SUCCESS) { if (data_offset > data_len) { @@ -222,47 +184,41 @@ psa_status_t secure_storage_its_get(secure_storage_its_caller_id_t caller_id, ps return ret; } -psa_status_t secure_storage_its_get_info(secure_storage_its_caller_id_t caller_id, - psa_storage_uid_t uid, struct psa_storage_info_t *p_info) +psa_status_t secure_storage_its_get_info(secure_storage_its_uid_t uid, + struct psa_storage_info_t *p_info) { psa_status_t ret; - secure_storage_its_uid_t its_uid; uint8_t data[CONFIG_SECURE_STORAGE_ITS_MAX_DATA_SIZE]; - if (make_its_uid(caller_id, uid, &its_uid) != PSA_SUCCESS) { - return PSA_ERROR_INVALID_ARGUMENT; - } - if (p_info == NULL) { + if (uid.uid == 0 || p_info == NULL) { return PSA_ERROR_INVALID_ARGUMENT; } - ret = get_entry(its_uid, sizeof(data), data, &p_info->size, &p_info->flags); + ret = get_entry(uid, sizeof(data), data, &p_info->size, &p_info->flags); if (ret == PSA_SUCCESS) { p_info->capacity = p_info->size; } return ret; } -psa_status_t secure_storage_its_remove(secure_storage_its_caller_id_t caller_id, - psa_storage_uid_t uid) +psa_status_t secure_storage_its_remove(secure_storage_its_uid_t uid) { psa_status_t ret; - secure_storage_its_uid_t its_uid; psa_storage_create_flags_t create_flags; uint8_t data[CONFIG_SECURE_STORAGE_ITS_MAX_DATA_SIZE]; size_t data_len; - if (make_its_uid(caller_id, uid, &its_uid) != PSA_SUCCESS) { + if (uid.uid == 0) { return PSA_ERROR_INVALID_ARGUMENT; } - ret = get_entry(its_uid, sizeof(data), data, &data_len, &create_flags); + ret = get_entry(uid, sizeof(data), data, &data_len, &create_flags); if (ret == PSA_SUCCESS && (create_flags & PSA_STORAGE_FLAG_WRITE_ONCE)) { return PSA_ERROR_NOT_PERMITTED; } /* Allow overwriting corrupted entries as well to not be stuck with them forever. */ if (ret == PSA_SUCCESS || ret == PSA_ERROR_STORAGE_FAILURE) { - ret = secure_storage_its_store_remove(its_uid); + ret = secure_storage_its_store_remove(uid); if (ret != PSA_SUCCESS) { log_failed_operation("remove", "from", ret); return PSA_ERROR_STORAGE_FAILURE; diff --git a/subsys/secure_storage/src/its/store/zms.c b/subsys/secure_storage/src/its/store/zms.c index 3a3bdd64c76..ede296952ab 100644 --- a/subsys/secure_storage/src/its/store/zms.c +++ b/subsys/secure_storage/src/its/store/zms.c @@ -33,26 +33,26 @@ static int init_zms(void) } SYS_INIT(init_zms, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); -#ifdef CONFIG_SECURE_STORAGE_64_BIT_UID - /* Bit position of the ITS caller ID in the ZMS entry ID. */ #define ITS_CALLER_ID_POS 30 /* Make sure that every ITS caller ID fits in ZMS entry IDs at the defined position. */ BUILD_ASSERT(1 << (32 - ITS_CALLER_ID_POS) >= SECURE_STORAGE_ITS_CALLER_COUNT); -static uint32_t zms_id_from(secure_storage_its_uid_t uid) +static bool has_forbidden_bits_set(secure_storage_its_uid_t uid) { - __ASSERT_NO_MSG(!(uid.uid & GENMASK64(63, ITS_CALLER_ID_POS))); - return (uint32_t)uid.uid | (uid.caller_id << ITS_CALLER_ID_POS); + if (uid.uid & GENMASK64(63, ITS_CALLER_ID_POS)) { + LOG_DBG("UID %u/0x%llx cannot be used as it has bits set past " + "the first " STRINGIFY(ITS_CALLER_ID_POS) " ones.", + uid.caller_id, (unsigned long long)uid.uid); + return true; + } + return false; } -#else static uint32_t zms_id_from(secure_storage_its_uid_t uid) { - BUILD_ASSERT(sizeof(uid) == sizeof(uint32_t)); - return *(uint32_t *)&uid; + return (uint32_t)uid.uid | (uid.caller_id << ITS_CALLER_ID_POS); } -#endif /* CONFIG_SECURE_STORAGE_64_BIT_UID */ psa_status_t secure_storage_its_store_set(secure_storage_its_uid_t uid, size_t data_length, const void *data) @@ -61,6 +61,10 @@ psa_status_t secure_storage_its_store_set(secure_storage_its_uid_t uid, ssize_t zms_ret; const uint32_t zms_id = zms_id_from(uid); + if (has_forbidden_bits_set(uid)) { + return PSA_ERROR_INVALID_ARGUMENT; + } + zms_ret = zms_write(&s_zms, zms_id, data, data_length); if (zms_ret == data_length) { psa_ret = PSA_SUCCESS; @@ -81,6 +85,10 @@ psa_status_t secure_storage_its_store_get(secure_storage_its_uid_t uid, size_t d ssize_t zms_ret; const uint32_t zms_id = zms_id_from(uid); + if (has_forbidden_bits_set(uid)) { + return PSA_ERROR_INVALID_ARGUMENT; + } + zms_ret = zms_read(&s_zms, zms_id, data, data_size); if (zms_ret > 0) { *data_length = zms_ret; @@ -100,6 +108,10 @@ psa_status_t secure_storage_its_store_remove(secure_storage_its_uid_t uid) int ret; const uint32_t zms_id = zms_id_from(uid); + if (has_forbidden_bits_set(uid)) { + return PSA_ERROR_INVALID_ARGUMENT; + } + ret = zms_delete(&s_zms, zms_id); LOG_DBG("%s 0x%x. (%d)", ret ? "Failed to delete" : "Deleted", zms_id, ret); From 21410fab0c4f14b2098be64deea646511356f4c6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 134/881] Revert "[nrf fromlist] soc: nordic: ironside: dvfs: check abb analog status more than once" This reverts commit c867cec99e85127132360620f53c4c5f45a3f56d. Signed-off-by: Jukka Rissanen --- soc/nordic/ironside/Kconfig | 9 ++++----- soc/nordic/ironside/dvfs.c | 10 ---------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index 3136e3bd5f4..6eeacf06771 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -65,12 +65,11 @@ config NRF_IRONSIDE_DVFS_SERVICE if NRF_IRONSIDE_DVFS_SERVICE -config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS - int "IRONSside DVFS ABB analog status check maximum attempts" - range 0 255 - default 50 +config NRF_IRONSIDE_DVFS_OPPOINT_CHANGE_MUTEX_TIMEOUT_MS + int "IRONSside DVFS change oppoint mutex timeout" + default 100 help - Maximum attempts with 10us intervals before busy status will be reported. + Maximum timeout when waiting for DVFS oppoint change mutex lock. endif # NRF_IRONSIDE_DVFS_SERVICE diff --git a/soc/nordic/ironside/dvfs.c b/soc/nordic/ironside/dvfs.c index 6c7a86cd0ad..7793ff015b1 100644 --- a/soc/nordic/ironside/dvfs.c +++ b/soc/nordic/ironside/dvfs.c @@ -18,9 +18,6 @@ static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH; #error "Unsupported SoC series for IronSide DVFS" #endif -#define ABB_STATUSANA_CHECK_MAX_ATTEMPTS (CONFIG_NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS) -#define ABB_STATUSANA_CHECK_INTERVAL_US (10U) - struct dvfs_hsfll_data_t { uint32_t new_f_mult; uint32_t new_f_trim_entry; @@ -132,13 +129,6 @@ static inline bool ironside_dvfs_is_abb_locked(NRF_ABB_Type *abb) /* Temporary workaround until STATUSANA register is visible. */ volatile const uint32_t *statusana = (uint32_t *)abb + ABB_STATUSANA_REG_OFFSET; - uint8_t status_read_attempts = ABB_STATUSANA_CHECK_MAX_ATTEMPTS; - - while ((*statusana & ABB_STATUSANA_LOCKED_L_Msk) == 0 && status_read_attempts > 0) { - k_busy_wait(ABB_STATUSANA_CHECK_INTERVAL_US); - status_read_attempts--; - } - return ((*statusana & ABB_STATUSANA_LOCKED_L_Msk) != 0); } From c3e86eda069dfdeb8dd8f1d307c779cc06236197 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 135/881] Revert "[nrf noup] soc: nordic: ironside: fix typo in Kconfig" This reverts commit ec8bfd85d4ec9a7e883345312633c8dfae54e9d2. Signed-off-by: Jukka Rissanen --- soc/nordic/ironside/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index 6eeacf06771..2430090c943 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -69,7 +69,7 @@ config NRF_IRONSIDE_DVFS_OPPOINT_CHANGE_MUTEX_TIMEOUT_MS int "IRONSside DVFS change oppoint mutex timeout" default 100 help - Maximum timeout when waiting for DVFS oppoint change mutex lock. + Maximum tiemout when waiting for DVFS oppoint change mutex lock. endif # NRF_IRONSIDE_DVFS_SERVICE From 2d571c902549e5d2661cba52d3ed9af8b31830eb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 136/881] Revert "[nrf fromtree] boards/nordic/nrf54h20dk: added prototype s2ram_context section" This reverts commit 820b875fa19140ac5cb1f7f917edaba9890dc159. Signed-off-by: Jukka Rissanen --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 2c86129c0f3..0eb2fc235a5 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -333,20 +333,3 @@ zephyr_udc0: &usbhs { memory-regions = <&cpuapp_dma_region>; status = "okay"; }; - -/* Trim this RAM block for making room on all run-time common S2RAM cpu context. */ -&cpuapp_ram0 { - reg = <0x22000000 (DT_SIZE_K(32)-32)>; - ranges = <0x0 0x22000000 (0x8000-0x20)>; -}; - -/ { - soc { - /* run-time common S2RAM cpu context RAM */ - pm_s2ram: cpuapp_s2ram@22007fe0 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fe0 32>; - zephyr,memory-region = "pm_s2ram_context"; - }; - }; -}; From 02c2f6163afde949d98e97ca54fa740c16cf74b6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 137/881] Revert "[nrf fromtree] arch/arm/core/cortex_m: optional memory section for _cp_context" This reverts commit eb125ac902754194d2cfcc8a603f29262c18ceb9. Signed-off-by: Jukka Rissanen --- arch/arm/core/cortex_m/pm_s2ram.c | 14 +------------- subsys/pm/Kconfig | 3 --- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/arch/arm/core/cortex_m/pm_s2ram.c b/arch/arm/core/cortex_m/pm_s2ram.c index 81a4ae20a4f..2657d48dc32 100644 --- a/arch/arm/core/cortex_m/pm_s2ram.c +++ b/arch/arm/core/cortex_m/pm_s2ram.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2022, Carlo Caione - * Copyright (c) 2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -15,18 +14,7 @@ /** * CPU context for S2RAM */ - -#if DT_NODE_EXISTS(DT_NODELABEL(pm_s2ram)) &&\ - DT_NODE_HAS_COMPAT(DT_NODELABEL(pm_s2ram), zephyr_memory_region) - -/* Linker section name is given by `zephyr,memory-region` property of - * `zephyr,memory-region` compatible DT node with nodelabel `pm_s2ram`. - */ -__attribute__((section(DT_PROP(DT_NODELABEL(pm_s2ram), zephyr_memory_region)))) -#else -__noinit -#endif -_cpu_context_t _cpu_context; +__noinit _cpu_context_t _cpu_context; #ifndef CONFIG_PM_S2RAM_CUSTOM_MARKING /** diff --git a/subsys/pm/Kconfig b/subsys/pm/Kconfig index 7cc347369b9..c2bca1c5f04 100644 --- a/subsys/pm/Kconfig +++ b/subsys/pm/Kconfig @@ -38,9 +38,6 @@ config PM_S2RAM depends on ARCH_HAS_SUSPEND_TO_RAM help This option enables suspend-to-RAM (S2RAM). - When enabled on Cortex-M, and a 'zephyr,memory-region' compatible node with nodelabel - 'pm_s2ram' is defined in DT, _cpu_context symbol (located in arch/arm/core/cortex_m/pm_s2ram.c) - is placed in linker section given by 'zephyr,memory-region' property of aforementioned node. config PM_S2RAM_CUSTOM_MARKING bool "Use custom marking functions" From 1a05c1b4062e908f673fb32ea28c8ab0e24bdb8f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 138/881] Revert "[nrf fromlist] soc: nordic: Use default SYS_CLOCK_TICKS_PER_SEC for PPR core" This reverts commit e78ab1d9e5814a0043b5fbfa8359fd021ec1f8fe. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuppr | 2 ++ soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr | 3 +++ 2 files changed, 5 insertions(+) diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuppr b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuppr index e7f9a57a44c..bf7c12a3a69 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuppr +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuppr @@ -6,6 +6,8 @@ if SOC_NRF54H20_CPUPPR config NUM_IRQS default 496 +config SYS_CLOCK_TICKS_PER_SEC + default 1000 # # As PPR has limited memory most of tests does not fit with asserts enabled. config ASSERT diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr index 1280c0e63c0..8e52b3611aa 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr @@ -6,6 +6,9 @@ if SOC_NRF9280_CPUPPR config NUM_IRQS default 496 +config SYS_CLOCK_TICKS_PER_SEC + default 1000 + config RV_BOOT_HART default 13 if SOC_NRF9230_ENGB From c14e415b49a691a52435eac74dbe81527c07c67e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 139/881] Revert "[nrf fromlist] Bluetooth: Host: Add req/rsp l2cap validation" This reverts commit 7f148155976055f98e2549d6904d724a2fbb213c. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/l2cap.h | 2 - subsys/bluetooth/host/l2cap.c | 70 +++++++++----------------------- 2 files changed, 19 insertions(+), 53 deletions(-) diff --git a/include/zephyr/bluetooth/l2cap.h b/include/zephyr/bluetooth/l2cap.h index ee5203281d9..380b52ad508 100644 --- a/include/zephyr/bluetooth/l2cap.h +++ b/include/zephyr/bluetooth/l2cap.h @@ -264,8 +264,6 @@ struct bt_l2cap_le_chan { uint16_t psm; /** Helps match request context during CoC */ uint8_t ident; - /** Opcode of the pending request. Used to match responses with requests. */ - uint8_t pending_req; bt_security_t required_sec_level; /* Response Timeout eXpired (RTX) timer */ diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 466dd1e27c5..caf5424717b 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -80,11 +80,8 @@ NET_BUF_POOL_FIXED_DEFINE(disc_pool, 1, sizeof(struct bt_l2cap_disconn_req)), CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); -#define ANY_OPCODE 0x100 -#define l2cap_lookup_ident(conn, ident, req_opcode) \ - __l2cap_lookup_ident(conn, ident, req_opcode, false) -#define l2cap_remove_ident(conn, ident, req_opcode) \ - __l2cap_lookup_ident(conn, ident, req_opcode, true) +#define l2cap_lookup_ident(conn, ident) __l2cap_lookup_ident(conn, ident, false) +#define l2cap_remove_ident(conn, ident) __l2cap_lookup_ident(conn, ident, true) static sys_slist_t servers = SYS_SLIST_STATIC_INIT(&servers); #endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ @@ -142,15 +139,13 @@ static struct bt_l2cap_le_chan *l2cap_chan_alloc_cid(struct bt_conn *conn, } static struct bt_l2cap_le_chan * -__l2cap_lookup_ident(struct bt_conn *conn, uint16_t ident, uint16_t req_opcode, bool remove) +__l2cap_lookup_ident(struct bt_conn *conn, uint16_t ident, bool remove) { struct bt_l2cap_chan *chan; sys_snode_t *prev = NULL; SYS_SLIST_FOR_EACH_CONTAINER(&conn->channels, chan, node) { - if ((BT_L2CAP_LE_CHAN(chan)->ident == ident) && - ((BT_L2CAP_LE_CHAN(chan)->pending_req == req_opcode) || - (req_opcode == ANY_OPCODE))) { + if (BT_L2CAP_LE_CHAN(chan)->ident == ident) { if (remove) { sys_slist_remove(&conn->channels, prev, &chan->node); @@ -308,7 +303,7 @@ static void l2cap_rtx_timeout(struct k_work *work) bt_l2cap_chan_del(&chan->chan); /* Remove other channels if pending on the same ident */ - while ((chan = l2cap_remove_ident(conn, chan->ident, chan->pending_req))) { + while ((chan = l2cap_remove_ident(conn, chan->ident))) { bt_l2cap_chan_del(&chan->chan); } } @@ -528,23 +523,15 @@ static int l2cap_le_conn_req(struct bt_l2cap_le_chan *ch) { struct net_buf *buf; struct bt_l2cap_le_conn_req *req; - uint8_t ident; - ident = get_ident(); + ch->ident = get_ident(); - buf = l2cap_create_le_sig_pdu(BT_L2CAP_LE_CONN_REQ, ident, sizeof(*req)); + buf = l2cap_create_le_sig_pdu(BT_L2CAP_LE_CONN_REQ, + ch->ident, sizeof(*req)); if (!buf) { return -ENOMEM; } - /* TODO Ident handling/setting should ideally be done in l2cap_chan_send_req after the - * request is successfully sent on the channel but will require special considerations for - * functions such as l2cap_ecred_conn_req and bt_l2cap_ecred_chan_reconfigure where the - * ident is set for multiple channels, but the request is only sent on one. - */ - ch->ident = ident; - ch->pending_req = BT_L2CAP_LE_CONN_REQ; - req = net_buf_add(buf, sizeof(*req)); req->psm = sys_cpu_to_le16(ch->psm); req->scid = sys_cpu_to_le16(ch->rx.cid); @@ -603,7 +590,6 @@ static int l2cap_ecred_conn_req(struct bt_l2cap_chan **chan, int channels) "The MTU shall be the same for channels in the same request."); ch->ident = ident; - ch->pending_req = BT_L2CAP_ECRED_CONN_REQ; net_buf_add_le16(buf, ch->rx.cid); } @@ -1799,7 +1785,7 @@ static void le_ecred_reconf_rsp(struct bt_l2cap *l2cap, uint8_t ident, rsp = net_buf_pull_mem(buf, sizeof(*rsp)); result = sys_le16_to_cpu(rsp->result); - while ((ch = l2cap_lookup_ident(conn, ident, BT_L2CAP_ECRED_RECONF_REQ))) { + while ((ch = l2cap_lookup_ident(conn, ident))) { /* Stop timer started on REQ send. The timer is only set on one * of the channels, but we don't want to make assumptions on * which one it is. @@ -1812,7 +1798,6 @@ static void le_ecred_reconf_rsp(struct bt_l2cap *l2cap, uint8_t ident, ch->pending_rx_mtu = 0; ch->ident = 0U; - ch->pending_req = 0U; if (ch->chan.ops->reconfigured) { ch->chan.ops->reconfigured(&ch->chan); @@ -1958,7 +1943,7 @@ static void le_ecred_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, LOG_DBG("mtu 0x%04x mps 0x%04x credits 0x%04x result %u", mtu, mps, credits, result); - chan = l2cap_lookup_ident(conn, ident, BT_L2CAP_ECRED_CONN_REQ); + chan = l2cap_lookup_ident(conn, ident); if (chan) { psm = chan->psm; } else { @@ -1968,7 +1953,7 @@ static void le_ecred_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, switch (result) { case BT_L2CAP_LE_ERR_AUTHENTICATION: case BT_L2CAP_LE_ERR_ENCRYPTION: - while ((chan = l2cap_lookup_ident(conn, ident, BT_L2CAP_ECRED_CONN_REQ))) { + while ((chan = l2cap_lookup_ident(conn, ident))) { /* Cancel RTX work */ k_work_cancel_delayable(&chan->rtx_work); @@ -1988,7 +1973,7 @@ static void le_ecred_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, case BT_L2CAP_LE_ERR_SCID_IN_USE: /* Some connections refused – not enough resources available */ case BT_L2CAP_LE_ERR_NO_RESOURCES: - while ((chan = l2cap_lookup_ident(conn, ident, BT_L2CAP_ECRED_CONN_REQ))) { + while ((chan = l2cap_lookup_ident(conn, ident))) { struct bt_l2cap_chan *c; /* Cancel RTX work */ @@ -2044,7 +2029,6 @@ static void le_ecred_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, chan->tx.cid = dcid; chan->ident = 0U; - chan->pending_req = 0U; chan->tx.mtu = mtu; chan->tx.mps = mps; @@ -2065,7 +2049,7 @@ static void le_ecred_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, break; case BT_L2CAP_LE_ERR_PSM_NOT_SUPP: default: - while ((chan = l2cap_remove_ident(conn, ident, BT_L2CAP_ECRED_CONN_REQ))) { + while ((chan = l2cap_remove_ident(conn, ident))) { bt_l2cap_chan_del(&chan->chan); } break; @@ -2104,9 +2088,9 @@ static void le_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, if (result == BT_L2CAP_LE_SUCCESS || result == BT_L2CAP_LE_ERR_AUTHENTICATION || result == BT_L2CAP_LE_ERR_ENCRYPTION) { - chan = l2cap_lookup_ident(conn, ident, BT_L2CAP_LE_CONN_REQ); + chan = l2cap_lookup_ident(conn, ident); } else { - chan = l2cap_remove_ident(conn, ident, BT_L2CAP_LE_CONN_REQ); + chan = l2cap_remove_ident(conn, ident); } if (!chan) { @@ -2119,7 +2103,6 @@ static void le_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, /* Reset ident since it got a response */ chan->ident = 0U; - chan->pending_req = 0U; switch (result) { case BT_L2CAP_LE_SUCCESS: @@ -2179,17 +2162,7 @@ static void le_disconn_rsp(struct bt_l2cap *l2cap, uint8_t ident, return; } - chan = l2cap_lookup_ident(conn, ident, BT_L2CAP_DISCONN_REQ); - if (!chan) { - LOG_ERR("Cannot find channel for ident %u", ident); - return; - } - scid = sys_le16_to_cpu(rsp->scid); - if (scid != chan->rx.cid) { - LOG_ERR("Invalid scid 0x%04x", scid); - return; - } LOG_DBG("dcid 0x%04x scid 0x%04x", sys_le16_to_cpu(rsp->dcid), scid); @@ -2257,7 +2230,7 @@ static void reject_cmd(struct bt_l2cap *l2cap, uint8_t ident, struct bt_conn *conn = l2cap->chan.chan.conn; struct bt_l2cap_le_chan *chan; - while ((chan = l2cap_remove_ident(conn, ident, ANY_OPCODE))) { + while ((chan = l2cap_remove_ident(conn, ident))) { bt_l2cap_chan_del(&chan->chan); } } @@ -3124,7 +3097,6 @@ int bt_l2cap_ecred_chan_reconfigure(struct bt_l2cap_chan **chans, uint16_t mtu) ch = BT_L2CAP_LE_CHAN(chans[j]); ch->ident = ident; - ch->pending_req = BT_L2CAP_ECRED_RECONF_REQ; ch->pending_rx_mtu = mtu; net_buf_add_le16(buf, ch->rx.cid); @@ -3212,7 +3184,6 @@ int bt_l2cap_ecred_chan_reconfigure_explicit(struct bt_l2cap_chan **chans, size_ ch = BT_L2CAP_LE_CHAN(chans[i]); ch->ident = ident; - ch->pending_req = BT_L2CAP_ECRED_RECONF_REQ; ch->pending_rx_mtu = mtu; net_buf_add_le16(buf, ch->rx.cid); @@ -3265,7 +3236,6 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan) struct net_buf *buf; struct bt_l2cap_disconn_req *req; struct bt_l2cap_le_chan *le_chan; - uint8_t ident; if (!conn) { return -ENOTCONN; @@ -3280,16 +3250,14 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan) LOG_DBG("chan %p scid 0x%04x dcid 0x%04x", chan, le_chan->rx.cid, le_chan->tx.cid); - ident = get_ident(); + le_chan->ident = get_ident(); - buf = l2cap_create_le_sig_pdu(BT_L2CAP_DISCONN_REQ, ident, sizeof(*req)); + buf = l2cap_create_le_sig_pdu(BT_L2CAP_DISCONN_REQ, + le_chan->ident, sizeof(*req)); if (!buf) { return -ENOMEM; } - le_chan->ident = ident; - le_chan->pending_req = BT_L2CAP_DISCONN_REQ; - req = net_buf_add(buf, sizeof(*req)); req->dcid = sys_cpu_to_le16(le_chan->tx.cid); req->scid = sys_cpu_to_le16(le_chan->rx.cid); From 5a072ed87f0cabc14545e93e5ce508e96bfa80f8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 140/881] Revert "[nrf fromtree] bluetooth: host: add frame space update support" This reverts commit 8df4dd094d35868f76e51c002a3cd76312a6f38a. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/conn.h | 117 -------------------------- include/zephyr/bluetooth/hci_types.h | 39 --------- subsys/bluetooth/Kconfig | 18 +--- subsys/bluetooth/controller/Kconfig | 11 --- subsys/bluetooth/host/conn.c | 72 ---------------- subsys/bluetooth/host/conn_internal.h | 3 - subsys/bluetooth/host/hci_core.c | 37 -------- subsys/bluetooth/host/shell/bt.c | 90 -------------------- tests/bluetooth/shell/testcase.yaml | 6 -- 9 files changed, 2 insertions(+), 391 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index c6d8ce2015f..2da6b2c91d6 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -273,86 +273,6 @@ struct bt_conn_le_read_all_remote_feat_complete { const uint8_t *features; }; -#define BT_CONN_LE_FRAME_SPACE_TYPES_MASK_ACL_IFS \ - (BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_IFS_ACL_CP_MASK | \ - BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_IFS_ACL_PC_MASK) - -#define BT_CONN_LE_FRAME_SPACE_TYPES_MASK_ACL \ - (BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_IFS_ACL_CP_MASK | \ - BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_IFS_ACL_PC_MASK | \ - BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_MCES_MASK) - -#define BT_CONN_LE_FRAME_SPACE_TYPES_MASK_CIS \ - (BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_IFS_CIS_MASK | \ - BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_MSS_CIS_MASK) - -/** Maximum frame space in microseconds. - * As defined in Bluetooth Core Specification, Vol 4, Part E, Section 7.8.151. - */ -#define BT_CONN_LE_FRAME_SPACE_MAX (10000U) - -/** Frame space update initiator. */ -enum bt_conn_le_frame_space_update_initiator { - /** Initiated by local host */ - BT_CONN_LE_FRAME_SPACE_UPDATE_INITIATOR_LOCAL_HOST = - BT_HCI_LE_FRAME_SPACE_UPDATE_INITIATOR_LOCAL_HOST, - /** Initiated by local controller */ - BT_CONN_LE_FRAME_SPACE_UPDATE_INITIATOR_LOCAL_CONTROLLER = - BT_HCI_LE_FRAME_SPACE_UPDATE_INITIATOR_LOCAL_CONTROLLER, - /** Initiated by peer */ - BT_CONN_LE_FRAME_SPACE_UPDATE_INITIATOR_PEER = - BT_HCI_LE_FRAME_SPACE_UPDATE_INITIATOR_PEER -}; - -/** Frame space update params */ -struct bt_conn_le_frame_space_update_param { - /** Phy mask of the PHYs to be updated. - * Refer to BT_HCI_LE_FRAME_SPACE_UPDATE_PHY_* for values. - */ - uint8_t phys; - /** Spacing types mask of the spacing types to be updated. - * Refer to BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_* and - * BT_CONN_LE_FRAME_SPACE_TYPES_MASK_* for values. - */ - uint16_t spacing_types; - /** Minimum frame space in microseconds. - * Bluetooth Core Specification, Vol 4, Part E, Section 7.8.151 - * allows for a range of frame space from 0 to 10000 microseconds. - * The actual supported frame space values will be dependent on - * the controller's capabilities. - */ - uint16_t frame_space_min; - /** Maximum frame space in microseconds. - * Bluetooth Core Specification, Vol 4, Part E, Section 7.8.151 - * allows for a range of frame space from 0 to 10000 microseconds. - * The actual supported frame space values will be dependent on - * the controller's capabilities. - */ - uint16_t frame_space_max; -}; - -/** Frame space updated callback params */ -struct bt_conn_le_frame_space_updated { - /** HCI Status from LE Frame Space Update Complete event. - * The remaining parameters will be invalid if status is not - * @ref BT_HCI_ERR_SUCCESS. - */ - uint8_t status; - /** Initiator of the frame space update. */ - enum bt_conn_le_frame_space_update_initiator initiator; - /** Updated frame space in microseconds. */ - uint16_t frame_space; - /** Phy mask of the PHYs updated. - * Refer to BT_HCI_LE_FRAME_SPACE_UPDATE_PHY_* for values. - */ - uint8_t phys; - /** Spacing types mask of the spacing types updated. - * Refer to BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_* and - * BT_CONN_LE_FRAME_SPACE_TYPES_MASK_* for values. - */ - uint16_t spacing_types; -}; - /** Connection Type */ enum __packed bt_conn_type { /** LE Connection Type */ @@ -1305,23 +1225,6 @@ int bt_conn_le_subrate_request(struct bt_conn *conn, */ int bt_conn_le_read_all_remote_features(struct bt_conn *conn, uint8_t pages_requested); -/** @brief Update frame space. - * - * Request a change to the frame space parameters of a connection. - * This function will trigger the frame_space_updated callback when the - * procedure is completed. - * - * @kconfig_dep{CONFIG_BT_FRAME_SPACE_UPDATE}. - * - * @param conn @ref BT_CONN_TYPE_LE connection object. - * @param params Frame Space Update parameters. - * - * @return Zero on success or (negative) error code on failure. - * @return -EINVAL @p conn is not a valid @ref BT_CONN_TYPE_LE connection. - */ -int bt_conn_le_frame_space_update(struct bt_conn *conn, - const struct bt_conn_le_frame_space_update_param *params); - /** @brief Update the connection parameters. * * If the local device is in the peripheral role then updating the connection @@ -2032,26 +1935,6 @@ struct bt_conn_cb { const struct bt_conn_le_read_all_remote_feat_complete *params); #endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */ -#if defined(CONFIG_BT_FRAME_SPACE_UPDATE) - /** @brief Frame Space Update Complete event. - * - * This callback notifies the application that the frame space of - * the connection may have changed. - * The frame space update parameters will be invalid - * if status is not @ref BT_HCI_ERR_SUCCESS. - * - * This callback can be triggered by calling @ref - * bt_conn_le_frame_space_update, by the procedure running - * autonomously in the controller or by the peer. - * - * @param conn Connection object. - * @param params New frame space update parameters. - */ - void (*frame_space_updated)( - struct bt_conn *conn, - const struct bt_conn_le_frame_space_updated *params); -#endif /* CONFIG_BT_FRAME_SPACE_UPDATE */ - #if defined(CONFIG_BT_CHANNEL_SOUNDING) /** @brief LE CS Read Remote Supported Capabilities Complete event. * diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index cc4cdad9364..877617362c6 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -208,7 +208,6 @@ struct bt_hci_cmd_hdr { #define BT_LE_FEAT_BIT_CHANNEL_SOUNDING_HOST 47 #define BT_LE_FEAT_BIT_CHANNEL_SOUNDING_TONE_QUAL_IND 48 #define BT_LE_FEAT_BIT_EXTENDED_FEAT_SET 63 -#define BT_LE_FEAT_BIT_FRAME_SPACE_UPDATE 65 #define BT_LE_FEAT_TEST(feat, n) (feat[(n) >> 3] & \ BIT((n) & 7)) @@ -287,8 +286,6 @@ struct bt_hci_cmd_hdr { BT_LE_FEAT_BIT_CHANNEL_SOUNDING_HOST) #define BT_FEAT_LE_EXTENDED_FEAT_SET(feat) BT_LE_FEAT_TEST(feat, \ BT_LE_FEAT_BIT_EXTENDED_FEAT_SET) -#define BT_FEAT_LE_FRAME_SPACE_UPDATE_SET(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_FRAME_SPACE_UPDATE) #define BT_FEAT_LE_CIS(feat) (BT_FEAT_LE_CIS_CENTRAL(feat) | \ BT_FEAT_LE_CIS_PERIPHERAL(feat)) @@ -2818,30 +2815,6 @@ struct bt_hci_cp_le_cs_remove_config { #define BT_HCI_OP_LE_CS_TEST_END BT_OP(BT_OGF_LE, 0x0096) /* 0x2096 */ -#define BT_HCI_LE_FRAME_SPACE_UPDATE_PHY_1M_MASK BIT(0) -#define BT_HCI_LE_FRAME_SPACE_UPDATE_PHY_2M_MASK BIT(1) -#define BT_HCI_LE_FRAME_SPACE_UPDATE_PHY_CODED_MASK BIT(2) - -#define BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_IFS_ACL_CP_MASK BIT(0) -#define BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_IFS_ACL_PC_MASK BIT(1) -#define BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_MCES_MASK BIT(2) -#define BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_IFS_CIS_MASK BIT(3) -#define BT_HCI_LE_FRAME_SPACE_UPDATE_SPACING_TYPE_MSS_CIS_MASK BIT(4) - -#define BT_HCI_LE_FRAME_SPACE_UPDATE_INITIATOR_LOCAL_HOST (0) -#define BT_HCI_LE_FRAME_SPACE_UPDATE_INITIATOR_LOCAL_CONTROLLER (1) -#define BT_HCI_LE_FRAME_SPACE_UPDATE_INITIATOR_PEER (2) - -struct bt_hci_cp_le_frame_space_update { - uint16_t handle; - uint16_t frame_space_min; - uint16_t frame_space_max; - uint8_t phys; - uint16_t spacing_types; -} __packed; - -#define BT_HCI_OP_LE_FRAME_SPACE_UPDATE BT_OP(BT_OGF_LE, 0x009D) /* 0x209D */ - /* Event definitions */ #define BT_HCI_EVT_UNKNOWN 0x00 @@ -4031,16 +4004,6 @@ struct bt_hci_evt_le_cs_procedure_enable_complete { uint16_t max_procedure_len; } __packed; -#define BT_HCI_EVT_LE_FRAME_SPACE_UPDATE_COMPLETE 0x35 -struct bt_hci_evt_le_frame_space_update_complete { - uint8_t status; - uint16_t handle; - uint8_t initiator; - uint16_t frame_space; - uint8_t phys; - uint16_t spacing_types; -} __packed; - /* Event mask bits */ #define BT_EVT_BIT(n) (1ULL << (n)) @@ -4142,8 +4105,6 @@ struct bt_hci_evt_le_frame_space_update_complete { #define BT_EVT_MASK_LE_CS_SUBEVENT_RESULT_CONTINUE BT_EVT_BIT(49) #define BT_EVT_MASK_LE_CS_TEST_END_COMPLETE BT_EVT_BIT(50) -#define BT_EVT_MASK_LE_FRAME_SPACE_UPDATE_COMPLETE BT_EVT_BIT(52) - /** HCI Error Codes, BT Core Spec v5.4 [Vol 1, Part F]. */ #define BT_HCI_ERR_SUCCESS 0x00 #define BT_HCI_ERR_UNKNOWN_CMD 0x01 diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index 7e8fa5dca6e..3c297f370b0 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -115,18 +115,10 @@ config BT_CONN_TX help Hidden configuration that is true if ACL or broadcast ISO is enabled -config BT_LE_LOCAL_MINIMUM_REQUIRED_FEATURE_PAGE - int - default 1 if BT_FRAME_SPACE_UPDATE - default 0 - depends on BT_LE_EXTENDED_FEAT_SET - help - Minimum required feature page that must be supported. - config BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE int "Maximum supported feature page" - default BT_LE_LOCAL_MINIMUM_REQUIRED_FEATURE_PAGE - range BT_LE_LOCAL_MINIMUM_REQUIRED_FEATURE_PAGE 10 + default 0 + range 0 10 depends on BT_LE_EXTENDED_FEAT_SET help Maximum feature page that can be stored for local supported features. @@ -220,12 +212,6 @@ config BT_SUBRATING Enable support for LE Connection Subrating feature that is defined in the Bluetooth Core specification, Version 5.4 | Vol 6, Part B, Section 4.6.35. -config BT_FRAME_SPACE_UPDATE - bool "Frame Space Update" - depends on (!HAS_BT_CTLR || BT_CTLR_FRAME_SPACE_UPDATE_SUPPORT) && BT_CONN && BT_LE_EXTENDED_FEAT_SET - help - Enable support for Bluetooth 6.0 Frame Space Update feature. - config BT_CHANNEL_SOUNDING bool "Channel Sounding [EXPERIMENTAL]" select EXPERIMENTAL diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 3b2c5beae80..c7e7030ba28 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -125,9 +125,6 @@ config BT_CTLR_LE_PATH_LOSS_MONITORING_SUPPORT config BT_CTLR_SUBRATING_SUPPORT bool -config BT_CTLR_FRAME_SPACE_UPDATE_SUPPORT - bool - config BT_CTLR_CHANNEL_SOUNDING_SUPPORT bool @@ -1173,14 +1170,6 @@ config BT_CTLR_SUBRATING Enable support for Bluetooth v5.3 LE Connection Subrating in the Controller. -config BT_CTLR_FRAME_SPACE_UPDATE - bool "Frame Space Update" - depends on BT_CTLR_FRAME_SPACE_UPDATE_SUPPORT - default y if BT_FRAME_SPACE_UPDATE - help - Enable support for Bluetooth 6.0 Frame Space Update - in the Controller. - config BT_CTLR_CHANNEL_SOUNDING bool "Channel Sounding support" depends on BT_CTLR_CHANNEL_SOUNDING_SUPPORT diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 10c11250727..f930d85b334 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -3402,78 +3402,6 @@ int bt_conn_le_read_all_remote_features(struct bt_conn *conn, uint8_t pages_requ } #endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */ -#if defined(CONFIG_BT_FRAME_SPACE_UPDATE) -void notify_frame_space_update_complete(struct bt_conn *conn, - struct bt_conn_le_frame_space_updated *params) -{ - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; - - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->frame_space_updated != NULL) { - callback->frame_space_updated(conn, params); - } - } - } - - STRUCT_SECTION_FOREACH(bt_conn_cb, cb) - { - if (cb->frame_space_updated != NULL) { - cb->frame_space_updated(conn, params); - } - } -} - -static bool frame_space_update_param_valid(const struct bt_conn_le_frame_space_update_param *param) -{ - if (param->frame_space_min > BT_CONN_LE_FRAME_SPACE_MAX || - param->frame_space_max > BT_CONN_LE_FRAME_SPACE_MAX || - param->frame_space_min > param->frame_space_max) { - return false; - } - - if (param->spacing_types == 0) { - return false; - } - - if (param->phys == 0) { - return false; - } - - return true; -} - -int bt_conn_le_frame_space_update(struct bt_conn *conn, - const struct bt_conn_le_frame_space_update_param *param) -{ - struct bt_hci_cp_le_frame_space_update *cp; - struct net_buf *buf; - - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { - LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); - return -EINVAL; - } - - if (!frame_space_update_param_valid(param)) { - return -EINVAL; - } - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (buf == NULL) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->handle = sys_cpu_to_le16(conn->handle); - cp->frame_space_min = sys_cpu_to_le16(param->frame_space_min); - cp->frame_space_max = sys_cpu_to_le16(param->frame_space_max); - cp->spacing_types = sys_cpu_to_le16(param->spacing_types); - cp->phys = param->phys; - - return bt_hci_cmd_send_sync(BT_HCI_OP_LE_FRAME_SPACE_UPDATE, buf, NULL); -} -#endif /* CONFIG_BT_FRAME_SPACE_UPDATE */ - #if defined(CONFIG_BT_CHANNEL_SOUNDING) void notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status, struct bt_conn_le_cs_capabilities *params) diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index a31ca85c315..495de911446 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -517,9 +517,6 @@ void notify_subrate_change(struct bt_conn *conn, void notify_read_all_remote_feat_complete(struct bt_conn *conn, struct bt_conn_le_read_all_remote_feat_complete *params); -void notify_frame_space_update_complete(struct bt_conn *conn, - struct bt_conn_le_frame_space_updated *params); - void notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status, struct bt_conn_le_cs_capabilities *params); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 1f649689c7a..1fe19b5373b 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1831,33 +1831,6 @@ static void le_read_all_remote_feat_complete(struct net_buf *buf) } #endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */ -#if defined(CONFIG_BT_FRAME_SPACE_UPDATE) -static void le_frame_space_update_complete(struct net_buf *buf) -{ - struct bt_hci_evt_le_frame_space_update_complete *evt = (void *)buf->data; - struct bt_conn *conn; - struct bt_conn_le_frame_space_updated params; - uint16_t handle = sys_le16_to_cpu(evt->handle); - - conn = bt_conn_lookup_handle(handle, BT_CONN_TYPE_LE); - if (conn == NULL) { - LOG_ERR("Unknown conn handle 0x%04X", handle); - return; - } - - params.status = evt->status; - - if (params.status == BT_HCI_ERR_SUCCESS) { - params.phys = evt->phys; - params.spacing_types = evt->spacing_types; - params.frame_space = evt->frame_space; - params.initiator = evt->initiator; - } - - notify_frame_space_update_complete(conn, ¶ms); -} -#endif /* CONFIG_BT_FRAME_SPACE_UPDATE */ - #if defined(CONFIG_BT_DATA_LEN_UPDATE) static void le_data_len_change(struct net_buf *buf) { @@ -2985,11 +2958,6 @@ static const struct event_handler meta_events[] = { le_read_all_remote_feat_complete, sizeof(struct bt_hci_evt_le_read_all_remote_feat_complete)), #endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */ -#if defined(CONFIG_BT_FRAME_SPACE_UPDATE) - EVENT_HANDLER(BT_HCI_EVT_LE_FRAME_SPACE_UPDATE_COMPLETE, - le_frame_space_update_complete, - sizeof(struct bt_hci_evt_le_frame_space_update_complete)), -#endif /* CONFIG_BT_FRAME_SPACE_UPDATE */ #endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_CHANNEL_SOUNDING) EVENT_HANDLER(BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE, @@ -3556,11 +3524,6 @@ static int le_set_event_mask(void) BT_FEAT_LE_EXTENDED_FEAT_SET(bt_dev.le.features)) { mask |= BT_EVT_MASK_LE_READ_ALL_REMOTE_FEAT_COMPLETE; } - - if (IS_ENABLED(CONFIG_BT_FRAME_SPACE_UPDATE) && - BT_FEAT_LE_FRAME_SPACE_UPDATE_SET(bt_dev.le.features)) { - mask |= BT_EVT_MASK_LE_FRAME_SPACE_UPDATE_COMPLETE; - } } if (IS_ENABLED(CONFIG_BT_SMP) && diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index d9f7467104a..0946939f22c 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -1041,38 +1041,6 @@ void read_all_remote_feat_complete(struct bt_conn *conn, } #endif -#if defined(CONFIG_BT_FRAME_SPACE_UPDATE) -static const char *frame_space_initiator_to_str( - enum bt_conn_le_frame_space_update_initiator initiator) -{ - switch (initiator) { - case BT_CONN_LE_FRAME_SPACE_UPDATE_INITIATOR_LOCAL_HOST: - return "Local Host"; - case BT_CONN_LE_FRAME_SPACE_UPDATE_INITIATOR_LOCAL_CONTROLLER: - return "Local Controller"; - case BT_CONN_LE_FRAME_SPACE_UPDATE_INITIATOR_PEER: - return "Peer"; - default: - return "Unknown"; - } -} - -void frame_space_updated(struct bt_conn *conn, - const struct bt_conn_le_frame_space_updated *params) -{ - if (params->status != BT_HCI_ERR_SUCCESS) { - bt_shell_print("Frame space update failed (HCI status 0x%02x)", - params->status); - return; - } - - bt_shell_print( - "Frame space updated: frame space %d us, PHYs 0x%04x, spacing types 0x%04x, initiator %s", - params->frame_space, params->phys, params->spacing_types, - frame_space_initiator_to_str(params->initiator)); -} -#endif - #if defined(CONFIG_BT_CHANNEL_SOUNDING) void print_remote_cs_capabilities(struct bt_conn *conn, uint8_t status, @@ -1255,9 +1223,6 @@ BT_CONN_CB_DEFINE(conn_callbacks) = { #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) .read_all_remote_feat_complete = read_all_remote_feat_complete, #endif -#if defined(CONFIG_BT_FRAME_SPACE_UPDATE) - .frame_space_updated = frame_space_updated, -#endif #if defined(CONFIG_BT_CHANNEL_SOUNDING) .le_cs_read_remote_capabilities_complete = print_remote_cs_capabilities, .le_cs_read_remote_fae_table_complete = print_remote_cs_fae_table, @@ -3378,55 +3343,6 @@ static int cmd_read_all_remote_features(const struct shell *sh, size_t argc, cha } #endif -#if defined(CONFIG_BT_FRAME_SPACE_UPDATE) -static int cmd_frame_space_update(const struct shell *sh, size_t argc, char *argv[]) -{ - int err = 0; - struct bt_conn_le_frame_space_update_param params; - - if (default_conn == NULL) { - shell_error(sh, "Conn handle error, at least one connection is required."); - return -ENOEXEC; - } - - params.frame_space_min = shell_strtoul(argv[1], 10, &err); - if (err) { - shell_help(sh); - shell_error(sh, "Could not parse frame_space_min input"); - return SHELL_CMD_HELP_PRINTED; - } - - params.frame_space_max = shell_strtoul(argv[2], 10, &err); - if (err) { - shell_help(sh); - shell_error(sh, "Could not parse frame_space_max input"); - return SHELL_CMD_HELP_PRINTED; - } - - params.phys = shell_strtoul(argv[3], 16, &err); - if (err) { - shell_help(sh); - shell_error(sh, "Could not parse phys input"); - return SHELL_CMD_HELP_PRINTED; - } - - params.spacing_types = shell_strtoul(argv[4], 16, &err); - if (err) { - shell_help(sh); - shell_error(sh, "Could not parse spacing_types input"); - return SHELL_CMD_HELP_PRINTED; - } - - err = bt_conn_le_frame_space_update(default_conn, ¶ms); - if (err != 0) { - shell_error(sh, "bt_conn_le_frame_space_update returned error %d", err); - return -ENOEXEC; - } - - return 0; -} -#endif - #if defined(CONFIG_BT_CONN) #if defined(CONFIG_BT_CENTRAL) static int bt_do_connect_le(int *ercd, size_t argc, char *argv[]) @@ -5182,12 +5098,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds, SHELL_CMD_ARG(read-all-remote-features, NULL, "", cmd_read_all_remote_features, 2, 0), #endif -#if defined(CONFIG_BT_FRAME_SPACE_UPDATE) - SHELL_CMD_ARG(frame-space-update, NULL, - "[frame_space_min ] [frame_space_max ] [phys ] " - "[spacing_types ]", - cmd_frame_space_update, 5, 0), -#endif #if defined(CONFIG_BT_BROADCASTER) SHELL_CMD_ARG(advertise, NULL, " [mode: discov, non_discov] " diff --git a/tests/bluetooth/shell/testcase.yaml b/tests/bluetooth/shell/testcase.yaml index 45812ca5132..0517acd65ad 100644 --- a/tests/bluetooth/shell/testcase.yaml +++ b/tests/bluetooth/shell/testcase.yaml @@ -40,12 +40,6 @@ tests: - CONFIG_BT_LE_EXTENDED_FEAT_SET=y - CONFIG_BT_LL_SW_SPLIT=n build_only: true - bluetooth.shell.frame_space_update: - extra_configs: - - CONFIG_BT_FRAME_SPACE_UPDATE=y - - CONFIG_BT_LE_EXTENDED_FEAT_SET=y - - CONFIG_BT_LL_SW_SPLIT=n - build_only: true bluetooth.shell.channel_sounding: extra_configs: - CONFIG_BT_CHANNEL_SOUNDING=y From 5c9b5c7619dd391660d048589019c51e844ccd1c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 141/881] Revert "[nrf fromtree] bluetooth: host: Fix BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE define" This reverts commit 6c44930b7af9522a832e46b20d23012df1a8dab2. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/bluetooth.h | 9 ++++----- subsys/bluetooth/Kconfig | 3 ++- subsys/bluetooth/host/conn.c | 10 ++++------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 750155d211e..a061b0564bf 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -77,11 +77,10 @@ extern "C" { * The value of 8 correspond to page 0 in the LE Controller supported features. * 24 bytes are required for all subsequent supported feature pages. */ -#define BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE \ - (BT_HCI_LE_BYTES_PAGE_0_FEATURE_PAGE + \ - COND_CODE_1(CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE, \ - (CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE \ - * BT_HCI_LE_BYTES_PER_FEATURE_PAGE), \ +#define BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE \ + (BT_HCI_LE_BYTES_PAGE_0_FEATURE_PAGE + \ + COND_CODE_1(CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE, \ + CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE * BT_HCI_LE_BYTES_PER_FEATURE_PAGE, \ (0U))) /** Opaque type representing an advertiser. */ diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index 3c297f370b0..26efaf7832d 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -121,7 +121,8 @@ config BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE range 0 10 depends on BT_LE_EXTENDED_FEAT_SET help - Maximum feature page that can be stored for local supported features. + Maximum supported feature page that can be stored locally and fetched + from the remote connection with the LL Extended Feature Set feature. config BT_LE_EXTENDED_FEAT_SET bool "LL Extended Feature Set" diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index f930d85b334..3a2adf814b9 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -3357,13 +3357,11 @@ int bt_conn_le_subrate_request(struct bt_conn *conn, void notify_read_all_remote_feat_complete(struct bt_conn *conn, struct bt_conn_le_read_all_remote_feat_complete *params) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->read_all_remote_feat_complete != NULL) { - callback->read_all_remote_feat_complete(conn, params); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->read_all_remote_feat_complete != NULL) { + callback->read_all_remote_feat_complete(conn, params); } } From 52e41d69c542c2b171fc3c4050c9b2d2dc1fcaa0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:02 +0300 Subject: [PATCH 142/881] Revert "[nrf fromtree] Bluetooth: Add configuration to control the dynamic connection callbacks" This reverts commit 208b1b9dca7bb336cf5a20496477ac5cf3dd6e9f. Signed-off-by: Jukka Rissanen --- .../central_hr/overlay-static_callbacks.conf | 2 - samples/bluetooth/central_hr/prj_minimal.conf | 1 - .../overlay-static_callbacks.conf | 2 - .../bluetooth/peripheral_hr/prj_minimal.conf | 1 - subsys/bluetooth/Kconfig | 10 - subsys/bluetooth/host/conn.c | 258 +++++++----------- tests/bluetooth/gatt/testcase.yaml | 14 - tests/bluetooth/shell/testcase.yaml | 6 - ...ntral_hr_peripheral_hr_static_callbacks.sh | 24 -- tests/bsim/bluetooth/samples/compile.sh | 9 - 10 files changed, 104 insertions(+), 223 deletions(-) delete mode 100644 samples/bluetooth/central_hr/overlay-static_callbacks.conf delete mode 100644 samples/bluetooth/peripheral_hr/overlay-static_callbacks.conf delete mode 100755 tests/bsim/bluetooth/samples/central_hr_peripheral_hr/tests_scripts/central_hr_peripheral_hr_static_callbacks.sh diff --git a/samples/bluetooth/central_hr/overlay-static_callbacks.conf b/samples/bluetooth/central_hr/overlay-static_callbacks.conf deleted file mode 100644 index 528958ad3a9..00000000000 --- a/samples/bluetooth/central_hr/overlay-static_callbacks.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Disable connection dynamic callbacks -CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n diff --git a/samples/bluetooth/central_hr/prj_minimal.conf b/samples/bluetooth/central_hr/prj_minimal.conf index 983b5a934d7..3ea96d693c7 100644 --- a/samples/bluetooth/central_hr/prj_minimal.conf +++ b/samples/bluetooth/central_hr/prj_minimal.conf @@ -87,7 +87,6 @@ CONFIG_BT_GATT_SERVICE_CHANGED=n CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y CONFIG_BT_HCI_VS=n -CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n # Disable Bluetooth controller features not needed CONFIG_BT_CTLR_PRIVACY=n diff --git a/samples/bluetooth/peripheral_hr/overlay-static_callbacks.conf b/samples/bluetooth/peripheral_hr/overlay-static_callbacks.conf deleted file mode 100644 index 528958ad3a9..00000000000 --- a/samples/bluetooth/peripheral_hr/overlay-static_callbacks.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Disable connection dynamic callbacks -CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n diff --git a/samples/bluetooth/peripheral_hr/prj_minimal.conf b/samples/bluetooth/peripheral_hr/prj_minimal.conf index 76cac20ec5e..8f9c2b85cb1 100644 --- a/samples/bluetooth/peripheral_hr/prj_minimal.conf +++ b/samples/bluetooth/peripheral_hr/prj_minimal.conf @@ -93,7 +93,6 @@ CONFIG_BT_GATT_SERVICE_CHANGED=n CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=y CONFIG_BT_HCI_VS=n -CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n # Disable Bluetooth controller features not needed CONFIG_BT_CTLR_PRIVACY=n diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index 26efaf7832d..c98c7a5ff53 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -131,16 +131,6 @@ config BT_LE_EXTENDED_FEAT_SET Enable support for the LL Extended Feature Set feature. if BT_CONN -config BT_CONN_DYNAMIC_CALLBACKS - bool "Dynamic connection callbacks" - default y - help - Enable support for dynamic connection callbacks. This links in - bt_conn_cb_register(). Disabling this config is safe. It will make - uses of this and associated APIs fail to link. Note: Static registration - through BT_CONN_CB_DEFINE() is always available and does not depend on - this config. - config BT_HCI_ACL_FLOW_CONTROL bool "Controller to Host ACL flow control support" # Enable if building a Host-only build diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 3a2adf814b9..abcc3d861ff 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1650,13 +1650,11 @@ static void tx_complete_work(struct k_work *work) static void notify_recycled_conn_slot(void) { #if defined(CONFIG_BT_CONN) - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->recycled) { - callback->recycled(); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->recycled) { + callback->recycled(); } } @@ -1831,13 +1829,11 @@ void bt_conn_connected(struct bt_conn *conn) #if defined(CONFIG_BT_CLASSIC) void bt_conn_role_changed(struct bt_conn *conn, uint8_t status) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->role_changed) { - callback->role_changed(conn, status); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->role_changed) { + callback->role_changed(conn, status); } } @@ -1912,14 +1908,12 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason) static void notify_connected(struct bt_conn *conn) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->connected) { - callback->connected(conn, conn->err); - } + if (callback->connected) { + callback->connected(conn, conn->err); } } @@ -1932,13 +1926,11 @@ static void notify_connected(struct bt_conn *conn) static void notify_disconnected(struct bt_conn *conn) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->disconnected) { - callback->disconnected(conn, conn->err); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->disconnected) { + callback->disconnected(conn, conn->err); } } @@ -1961,13 +1953,11 @@ void notify_remote_info(struct bt_conn *conn) return; } - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->remote_info_available) { - callback->remote_info_available(conn, &remote_info); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->remote_info_available) { + callback->remote_info_available(conn, &remote_info); } } @@ -1992,14 +1982,13 @@ void notify_le_param_updated(struct bt_conn *conn) atomic_clear_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET); } - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_param_updated) { - callback->le_param_updated(conn, conn->le.interval, - conn->le.latency, conn->le.timeout); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_param_updated) { + callback->le_param_updated(conn, conn->le.interval, + conn->le.latency, + conn->le.timeout); } } @@ -2015,13 +2004,11 @@ void notify_le_param_updated(struct bt_conn *conn) #if defined(CONFIG_BT_USER_DATA_LEN_UPDATE) void notify_le_data_len_updated(struct bt_conn *conn) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_data_len_updated) { - callback->le_data_len_updated(conn, &conn->le.data_len); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_data_len_updated) { + callback->le_data_len_updated(conn, &conn->le.data_len); } } @@ -2036,13 +2023,11 @@ void notify_le_data_len_updated(struct bt_conn *conn) #if defined(CONFIG_BT_USER_PHY_UPDATE) void notify_le_phy_updated(struct bt_conn *conn) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_phy_updated) { - callback->le_phy_updated(conn, &conn->le.phy); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_phy_updated) { + callback->le_phy_updated(conn, &conn->le.phy); } } @@ -2060,24 +2045,22 @@ bool le_param_req(struct bt_conn *conn, struct bt_le_conn_param *param) return false; } - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (!callback->le_param_req) { - continue; - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (!callback->le_param_req) { + continue; + } - if (!callback->le_param_req(conn, param)) { - return false; - } + if (!callback->le_param_req(conn, param)) { + return false; + } - /* The callback may modify the parameters so we need to - * double-check that it returned valid parameters. - */ - if (!bt_le_conn_params_valid(param)) { - return false; - } + /* The callback may modify the parameters so we need to + * double-check that it returned valid parameters. + */ + if (!bt_le_conn_params_valid(param)) { + return false; } } @@ -2464,13 +2447,12 @@ void bt_conn_identity_resolved(struct bt_conn *conn) rpa = &conn->le.init_addr; } - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->identity_resolved) { - callback->identity_resolved(conn, rpa, &conn->le.dst); - } + struct bt_conn_cb *callback; + + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->identity_resolved) { + callback->identity_resolved(conn, rpa, &conn->le.dst); } } @@ -2584,13 +2566,11 @@ void bt_conn_security_changed(struct bt_conn *conn, uint8_t hci_err, bt_iso_security_changed(conn, hci_err); } - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->security_changed) { - callback->security_changed(conn, conn->sec_level, err); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->security_changed) { + callback->security_changed(conn, conn->sec_level, err); } } @@ -2688,8 +2668,6 @@ bt_security_t bt_conn_get_security(const struct bt_conn *conn) } #endif /* CONFIG_BT_SMP */ -#if defined(CONFIG_BT_CONN_DYNAMIC_CALLBACKS) - int bt_conn_cb_register(struct bt_conn_cb *cb) { if (sys_slist_find(&conn_cbs, &cb->_node, NULL)) { @@ -2714,8 +2692,6 @@ int bt_conn_cb_unregister(struct bt_conn_cb *cb) return 0; } -#endif /* CONFIG_BT_CONN_DYNAMIC_CALLBACKS */ - bool bt_conn_exists_le(uint8_t id, const bt_addr_le_t *peer) { struct bt_conn *conn = bt_conn_lookup_addr_le(id, peer); @@ -3027,13 +3003,11 @@ static int bt_conn_get_tx_power_level(struct bt_conn *conn, uint8_t type, void notify_tx_power_report(struct bt_conn *conn, struct bt_conn_le_tx_power_report report) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->tx_power_report) { - callback->tx_power_report(conn, &report); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->tx_power_report) { + callback->tx_power_report(conn, &report); } } @@ -3174,13 +3148,11 @@ int bt_conn_le_get_tx_power_level(struct bt_conn *conn, void notify_path_loss_threshold_report(struct bt_conn *conn, struct bt_conn_le_path_loss_threshold_report report) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->path_loss_threshold_report) { - callback->path_loss_threshold_report(conn, &report); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->path_loss_threshold_report) { + callback->path_loss_threshold_report(conn, &report); } } @@ -3247,13 +3219,11 @@ int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool reporting_ena void notify_subrate_change(struct bt_conn *conn, const struct bt_conn_le_subrate_changed params) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->subrate_changed) { - callback->subrate_changed(conn, ¶ms); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->subrate_changed) { + callback->subrate_changed(conn, ¶ms); } } @@ -3404,14 +3374,11 @@ int bt_conn_le_read_all_remote_features(struct bt_conn *conn, uint8_t pages_requ void notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status, struct bt_conn_le_cs_capabilities *params) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_cs_read_remote_capabilities_complete) { - callback->le_cs_read_remote_capabilities_complete(conn, status, - params); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_cs_read_remote_capabilities_complete) { + callback->le_cs_read_remote_capabilities_complete(conn, status, params); } } @@ -3425,14 +3392,11 @@ void notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status, void notify_remote_cs_fae_table(struct bt_conn *conn, uint8_t status, struct bt_conn_le_cs_fae_table *params) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_cs_read_remote_fae_table_complete) { - callback->le_cs_read_remote_fae_table_complete(conn, status, - params); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_cs_read_remote_fae_table_complete) { + callback->le_cs_read_remote_fae_table_complete(conn, status, params); } } @@ -3446,13 +3410,11 @@ void notify_remote_cs_fae_table(struct bt_conn *conn, uint8_t status, void notify_cs_config_created(struct bt_conn *conn, uint8_t status, struct bt_conn_le_cs_config *params) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_cs_config_complete) { - callback->le_cs_config_complete(conn, status, params); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_cs_config_complete) { + callback->le_cs_config_complete(conn, status, params); } } @@ -3465,13 +3427,11 @@ void notify_cs_config_created(struct bt_conn *conn, uint8_t status, void notify_cs_config_removed(struct bt_conn *conn, uint8_t config_id) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_cs_config_removed) { - callback->le_cs_config_removed(conn, config_id); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_cs_config_removed) { + callback->le_cs_config_removed(conn, config_id); } } @@ -3484,13 +3444,11 @@ void notify_cs_config_removed(struct bt_conn *conn, uint8_t config_id) void notify_cs_security_enable_available(struct bt_conn *conn, uint8_t status) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_cs_security_enable_complete) { - callback->le_cs_security_enable_complete(conn, status); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_cs_security_enable_complete) { + callback->le_cs_security_enable_complete(conn, status); } } @@ -3504,13 +3462,11 @@ void notify_cs_security_enable_available(struct bt_conn *conn, uint8_t status) void notify_cs_procedure_enable_available(struct bt_conn *conn, uint8_t status, struct bt_conn_le_cs_procedure_enable_complete *params) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_cs_procedure_enable_complete) { - callback->le_cs_procedure_enable_complete(conn, status, params); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_cs_procedure_enable_complete) { + callback->le_cs_procedure_enable_complete(conn, status, params); } } @@ -3523,13 +3479,11 @@ void notify_cs_procedure_enable_available(struct bt_conn *conn, uint8_t status, void notify_cs_subevent_result(struct bt_conn *conn, struct bt_conn_le_cs_subevent_result *result) { - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->le_cs_subevent_data_available) { - callback->le_cs_subevent_data_available(conn, result); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->le_cs_subevent_data_available) { + callback->le_cs_subevent_data_available(conn, result); } } @@ -4311,13 +4265,11 @@ void bt_hci_le_df_connection_iq_report_common(uint8_t event, struct net_buf *buf return; } - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->cte_report_cb) { - callback->cte_report_cb(conn, &iq_report); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->cte_report_cb) { + callback->cte_report_cb(conn, &iq_report); } } @@ -4357,13 +4309,11 @@ void bt_hci_le_df_cte_req_failed(struct net_buf *buf) return; } - if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) { - struct bt_conn_cb *callback; + struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->cte_report_cb) { - callback->cte_report_cb(conn, &iq_report); - } + SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + if (callback->cte_report_cb) { + callback->cte_report_cb(conn, &iq_report); } } diff --git a/tests/bluetooth/gatt/testcase.yaml b/tests/bluetooth/gatt/testcase.yaml index ff18a0c663f..37e14f0b968 100644 --- a/tests/bluetooth/gatt/testcase.yaml +++ b/tests/bluetooth/gatt/testcase.yaml @@ -28,17 +28,3 @@ tests: tags: - bluetooth - gatt - bluetooth.gatt.no_bt_conn_dynamic_callbacks: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" - - CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n - platform_allow: - - native_sim - - native_sim/native/64 - - qemu_x86 - - qemu_cortex_m3 - integration_platforms: - - native_sim - tags: - - bluetooth - - gatt diff --git a/tests/bluetooth/shell/testcase.yaml b/tests/bluetooth/shell/testcase.yaml index 0517acd65ad..673f13e481c 100644 --- a/tests/bluetooth/shell/testcase.yaml +++ b/tests/bluetooth/shell/testcase.yaml @@ -92,12 +92,6 @@ tests: extra_args: CONF_FILE="audio.conf" build_only: true tags: bluetooth - bluetooth.shell.audio.no_bt_conn_dynamic_callbacks: - extra_args: - - CONF_FILE="audio.conf" - - CONFIG_BT_CONN_DYNAMIC_CALLBACKS=n - build_only: true - tags: bluetooth bluetooth.shell.audio.no_testing: extra_args: CONF_FILE="audio.conf" build_only: true diff --git a/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/tests_scripts/central_hr_peripheral_hr_static_callbacks.sh b/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/tests_scripts/central_hr_peripheral_hr_static_callbacks.sh deleted file mode 100755 index f6567efdc2a..00000000000 --- a/tests/bsim/bluetooth/samples/central_hr_peripheral_hr/tests_scripts/central_hr_peripheral_hr_static_callbacks.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2025 Demant A/S -# SPDX-License-Identifier: Apache-2.0 - -source ${ZEPHYR_BASE}/tests/bsim/sh_common.source - -simulation_id="central_hr_peripheral_hr_static_callbacks_test" -test_long_name="$(guess_test_long_name)" -verbosity_level=2 -EXECUTE_TIMEOUT=60 - -cd ${BSIM_OUT_PATH}/bin - -Execute ./bs_${BOARD_TS}_samples_bluetooth_peripheral_hr_prj_conf_overlay-static_callbacks_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 - -Execute ./bs_${BOARD_TS}_${test_long_name}_prj_conf_overlay-static_callbacks_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=1 \ - -testid=central_hr_peripheral_hr - -Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ - -D=2 -sim_length=12e6 $@ - -wait_for_background_jobs #Wait for all programs in background and return != 0 if any fails diff --git a/tests/bsim/bluetooth/samples/compile.sh b/tests/bsim/bluetooth/samples/compile.sh index 33a9827a300..f189445c36b 100755 --- a/tests/bsim/bluetooth/samples/compile.sh +++ b/tests/bsim/bluetooth/samples/compile.sh @@ -37,15 +37,6 @@ app=tests/bsim/bluetooth/samples/central_hr_peripheral_hr \ extra_conf_file=${ZEPHYR_BASE}/samples/bluetooth/central_hr/prj.conf \ conf_overlay=${ZEPHYR_BASE}/samples/bluetooth/central_hr/overlay-phy_coded.conf \ compile -app=samples/bluetooth/peripheral_hr \ - sysbuild=1 \ - conf_overlay=overlay-static_callbacks.conf \ - compile -app=tests/bsim/bluetooth/samples/central_hr_peripheral_hr \ - sysbuild=1 \ - extra_conf_file=${ZEPHYR_BASE}/samples/bluetooth/central_hr/prj.conf \ - conf_overlay=${ZEPHYR_BASE}/samples/bluetooth/central_hr/overlay-static_callbacks.conf \ - compile if [ ${BOARD} == "nrf52_bsim/native" ]; then app=tests/bsim/bluetooth/samples/battery_service \ conf_file=prj.conf \ From 12d6dbb0c76be5e7d3733b8e5147a3991648e53f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 143/881] Revert "[nrf fromtree] Bluetooth: Host: Conn callbacks registration with BT_CONN_CB_DEFINE" This reverts commit 46f3f280968375c9e7340b4b28b80a10d98f1f3b. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/gatt.c | 22 +++++++++++----------- subsys/bluetooth/host/shell/bt.c | 6 +++++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 12ec91c78e4..be642fec9fe 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1511,17 +1511,6 @@ static void gatt_store_ccc_cf(uint8_t id, const bt_addr_le_t *peer_addr) } } -#if defined(CONFIG_BT_SETTINGS) && defined(CONFIG_BT_SMP) -BT_CONN_CB_DEFINE(gatt_conn_cb) = { - /* Also update the address of CCC or CF writes that happened before the - * identity resolution. Note that to increase security in the future, we - * might want to explicitly not do this and treat a bonded device as a - * brand-new peer. - */ - .identity_resolved = bt_gatt_identity_resolved, -}; -#endif /* CONFIG_BT_SETTINGS && CONFIG_BT_SMP */ - static void bt_gatt_service_init(void) { if (atomic_test_and_set_bit(gatt_flags, GATT_SERVICE_INITIALIZED)) { @@ -1578,6 +1567,17 @@ void bt_gatt_init(void) * and CF storage on pairing complete. */ bt_conn_auth_info_cb_register(&gatt_conn_auth_info_cb); + + static struct bt_conn_cb gatt_conn_cb = { + .identity_resolved = bt_gatt_identity_resolved, + }; + + /* Also update the address of CCC or CF writes that happened before the + * identity resolution. Note that to increase security in the future, we + * might want to explicitly not do this and treat a bonded device as a + * brand-new peer. + */ + bt_conn_cb_register(&gatt_conn_cb); #endif /* CONFIG_BT_SETTINGS && CONFIG_BT_SMP */ } diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 0946939f22c..611ce0afcec 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -1191,7 +1191,7 @@ static void le_cs_config_removed(struct bt_conn *conn, uint8_t config_id) } #endif -BT_CONN_CB_DEFINE(conn_callbacks) = { +static struct bt_conn_cb conn_callbacks = { .connected = connected, .disconnected = disconnected, .le_param_req = le_param_req, @@ -1374,6 +1374,10 @@ static void bt_ready(int err) #if defined(CONFIG_BT_CONN) default_conn = NULL; + + /* Unregister to avoid register repeatedly */ + bt_conn_cb_unregister(&conn_callbacks); + bt_conn_cb_register(&conn_callbacks); #endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_PER_ADV_SYNC) From d465bccce745ce08d0153e0ae3d1937176f34a30 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 144/881] Revert "[nrf fromtree] Bluetooth: Audio: Conn callbacks registration with BT_CONN_CB_DEFINE" This reverts commit 307315be45f6ccea17485944fb15c5319ba26445. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/audio/bap_unicast_client.c | 8 +++++++- subsys/bluetooth/audio/csip_set_member.c | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index 3db8e8a7b9c..1f081ee805b 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -4456,13 +4456,14 @@ static void unicast_client_disconnected(struct bt_conn *conn, uint8_t reason) unicast_client_ep_reset(conn, reason); } -BT_CONN_CB_DEFINE(conn_cbs) = { +static struct bt_conn_cb conn_cbs = { .disconnected = unicast_client_disconnected, }; int bt_bap_unicast_client_discover(struct bt_conn *conn, enum bt_audio_dir dir) { struct unicast_client *client; + static bool conn_cb_registered; uint8_t role; int err; @@ -4495,6 +4496,11 @@ int bt_bap_unicast_client_discover(struct bt_conn *conn, enum bt_audio_dir dir) client->disc_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE; client->disc_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE; + if (!conn_cb_registered) { + bt_conn_cb_register(&conn_cbs); + conn_cb_registered = true; + } + err = bt_gatt_discover(conn, &client->disc_params); if (err != 0) { atomic_clear_bit(client->flags, UNICAST_CLIENT_FLAG_BUSY); diff --git a/subsys/bluetooth/audio/csip_set_member.c b/subsys/bluetooth/audio/csip_set_member.c index c38929846b4..d41230a1668 100644 --- a/subsys/bluetooth/audio/csip_set_member.c +++ b/subsys/bluetooth/audio/csip_set_member.c @@ -647,7 +647,7 @@ static void csip_bond_deleted(uint8_t id, const bt_addr_le_t *peer) } } -BT_CONN_CB_DEFINE(conn_callbacks) = { +static struct bt_conn_cb conn_callbacks = { .disconnected = csip_disconnected, .security_changed = csip_security_changed, }; @@ -926,6 +926,7 @@ int bt_csip_set_member_register(const struct bt_csip_set_member_register_param * for (size_t i = 0U; i < ARRAY_SIZE(svc_insts); i++) { k_mutex_init(&svc_insts[i].mutex); } + bt_conn_cb_register(&conn_callbacks); bt_conn_auth_info_cb_register(&auth_callbacks); first_register = true; } From 98cc4651d3ba0e644f4163a15ac5fa214cb9b401 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 145/881] Revert "[nrf fromtree] bluetooth: classic: add role switch API" This reverts commit 0c9f335f663bab986df74ec88351c675e74d7aed. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/conn.h | 23 ----- include/zephyr/bluetooth/hci_types.h | 38 -------- subsys/bluetooth/host/classic/Kconfig | 6 -- subsys/bluetooth/host/classic/br.c | 35 ------- subsys/bluetooth/host/classic/conn_br.c | 101 -------------------- subsys/bluetooth/host/classic/shell/bredr.c | 77 --------------- subsys/bluetooth/host/classic/shell/bredr.h | 20 ---- subsys/bluetooth/host/shell/bt.c | 6 -- 8 files changed, 306 deletions(-) delete mode 100644 subsys/bluetooth/host/classic/shell/bredr.h diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 2da6b2c91d6..e74aeaa0fb5 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -2746,29 +2746,6 @@ struct bt_conn *bt_conn_lookup_addr_br(const bt_addr_t *peer); */ const bt_addr_t *bt_conn_get_dst_br(const struct bt_conn *conn); -/** @brief Change the role of the conn. - * - * @param conn Connection object. - * @param role The role that want to switch as, the value is @ref BT_HCI_ROLE_CENTRAL and - * @ref BT_HCI_ROLE_PERIPHERAL from hci_types.h. - * - * @return Zero on success or (negative) error code on failure. - * @return -ENOBUFS HCI command buffer is not available. - * @return -EINVAL @p conn is not a valid @ref BT_CONN_TYPE_BR connection - */ -int bt_conn_br_switch_role(const struct bt_conn *conn, uint8_t role); - -/** @brief Enable/disable role switch of the connection by setting the connection's link policy. - * - * @param conn Connection object. - * @param enable Value enable/disable role switch of controller. - * - * @return Zero on success or (negative) error code on failure. - * @return -ENOBUFS HCI command buffer is not available. - * @return -EINVAL @p conn is not a valid @ref BT_CONN_TYPE_BR connection. - */ -int bt_conn_br_set_role_switch_enable(const struct bt_conn *conn, bool enable); - #ifdef __cplusplus } #endif diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index 877617362c6..a2085271239 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -365,7 +365,6 @@ struct bt_hci_cmd_hdr { /* OpCode Group Fields */ #define BT_OGF_LINK_CTRL 0x01 -#define BT_OGF_LINK_POLICY 0x02 #define BT_OGF_BASEBAND 0x03 #define BT_OGF_INFO 0x04 #define BT_OGF_STATUS 0x05 @@ -561,43 +560,6 @@ struct bt_hci_cp_io_capability_neg_reply { uint8_t reason; } __packed; -#define BT_HCI_OP_SWITCH_ROLE BT_OP(BT_OGF_LINK_POLICY, 0x000b) -struct bt_hci_cp_switch_role { - bt_addr_t bdaddr; - uint8_t role; -} __packed; - -#define BT_HCI_LINK_POLICY_SETTINGS_ENABLE_ROLE_SWITCH BIT(0) -#define BT_HCI_LINK_POLICY_SETTINGS_ENABLE_HOLD_MODE BIT(1) -#define BT_HCI_LINK_POLICY_SETTINGS_ENABLE_SNIFF_SWITCH BIT(2) - -#define BT_HCI_OP_READ_LINK_POLICY_SETTINGS BT_OP(BT_OGF_LINK_POLICY, 0x000c) -struct bt_hci_cp_read_link_policy_settings { - uint16_t handle; -} __packed; -struct bt_hci_rp_read_link_policy_settings { - uint8_t status; - uint16_t handle; - uint16_t link_policy_settings; -} __packed; - -#define BT_HCI_OP_WRITE_LINK_POLICY_SETTINGS BT_OP(BT_OGF_LINK_POLICY, 0x000d) -struct bt_hci_cp_write_link_policy_settings { - uint16_t handle; - uint16_t link_policy_settings; -} __packed; - -#define BT_HCI_OP_READ_DEFAULT_LINK_POLICY_SETTINGS BT_OP(BT_OGF_LINK_POLICY, 0x000e) -struct bt_hci_rp_read_default_link_policy_settings { - uint8_t status; - uint16_t default_link_policy_settings; -} __packed; - -#define BT_HCI_OP_WRITE_DEFAULT_LINK_POLICY_SETTINGS BT_OP(BT_OGF_LINK_POLICY, 0x000f) -struct bt_hci_cp_write_default_link_policy_settings { - uint16_t default_link_policy_settings; -} __packed; - #define BT_HCI_OP_SET_EVENT_MASK BT_OP(BT_OGF_BASEBAND, 0x0001) /* 0x0c01 */ struct bt_hci_cp_set_event_mask { uint8_t events[8]; diff --git a/subsys/bluetooth/host/classic/Kconfig b/subsys/bluetooth/host/classic/Kconfig index beacfc31628..5d95a6375f5 100644 --- a/subsys/bluetooth/host/classic/Kconfig +++ b/subsys/bluetooth/host/classic/Kconfig @@ -508,12 +508,6 @@ config BT_COD consult the following link: https://www.bluetooth.com/specifications/assigned-numbers -config BT_DEFAULT_ROLE_SWITCH_ENABLE - bool "Default Bluetooth Role Switch Enable/Disable State" - help - This option sets the controller's default link policy to - enable/disable the role switch. - endif # BT_CLASSIC endmenu diff --git a/subsys/bluetooth/host/classic/br.c b/subsys/bluetooth/host/classic/br.c index f9265dc948b..f7cc28fb45f 100644 --- a/subsys/bluetooth/host/classic/br.c +++ b/subsys/bluetooth/host/classic/br.c @@ -800,10 +800,7 @@ int bt_br_init(void) struct bt_hci_cp_write_ssp_mode *ssp_cp; struct bt_hci_cp_write_inquiry_mode *inq_cp; struct bt_hci_write_local_name *name_cp; - struct bt_hci_rp_read_default_link_policy_settings *rp; - struct net_buf *rsp; int err; - uint16_t default_link_policy_settings; /* Read extended local features */ if (BT_FEAT_EXT_FEATURES(bt_dev.features)) { @@ -909,38 +906,6 @@ int bt_br_init(void) } } - err = bt_hci_cmd_send_sync(BT_HCI_OP_READ_DEFAULT_LINK_POLICY_SETTINGS, NULL, &rsp); - if (err) { - return err; - } - - rp = (void *)rsp->data; - default_link_policy_settings = rp->default_link_policy_settings; - - bool should_enable = IS_ENABLED(CONFIG_BT_DEFAULT_ROLE_SWITCH_ENABLE); - bool is_enabled = (default_link_policy_settings & - BT_HCI_LINK_POLICY_SETTINGS_ENABLE_ROLE_SWITCH); - - /* Enable/Disable the default role switch */ - if (should_enable != is_enabled) { - struct bt_hci_cp_write_default_link_policy_settings *policy_cp; - - default_link_policy_settings ^= BT_HCI_LINK_POLICY_SETTINGS_ENABLE_ROLE_SWITCH; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - return -ENOBUFS; - } - - policy_cp = net_buf_add(buf, sizeof(*policy_cp)); - policy_cp->default_link_policy_settings = default_link_policy_settings; - - err = bt_hci_cmd_send_sync(BT_HCI_OP_WRITE_DEFAULT_LINK_POLICY_SETTINGS, buf, NULL); - if (err) { - return err; - } - } - return 0; } diff --git a/subsys/bluetooth/host/classic/conn_br.c b/subsys/bluetooth/host/classic/conn_br.c index 29cb2e2dfd4..582d560c4df 100644 --- a/subsys/bluetooth/host/classic/conn_br.c +++ b/subsys/bluetooth/host/classic/conn_br.c @@ -170,104 +170,3 @@ void bt_br_acl_recv(struct bt_conn *conn, struct net_buf *buf, bool complete) net_buf_unref(buf); } - -int bt_conn_br_switch_role(const struct bt_conn *conn, uint8_t role) -{ - struct net_buf *buf; - struct bt_hci_cp_switch_role *cp; - - CHECKIF(conn == NULL) { - LOG_DBG("conn is NULL"); - return -EINVAL; - } - - if (!bt_conn_is_type(conn, BT_CONN_TYPE_BR)) { - LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); - return -EINVAL; - } - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - bt_addr_copy(&cp->bdaddr, &conn->br.dst); - cp->role = role; - - return bt_hci_cmd_send_sync(BT_HCI_OP_SWITCH_ROLE, buf, NULL); -} - -static int bt_conn_br_read_link_policy_settings(const struct bt_conn *conn, - uint16_t *link_policy_settings) -{ - int err; - struct net_buf *buf; - struct bt_hci_cp_read_link_policy_settings *cp; - struct bt_hci_rp_read_link_policy_settings *rp; - struct net_buf *rsp; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->handle = sys_cpu_to_le16(conn->handle); - - err = bt_hci_cmd_send_sync(BT_HCI_OP_READ_LINK_POLICY_SETTINGS, buf, &rsp); - if (!err) { - rp = (void *)rsp->data; - *link_policy_settings = rp->link_policy_settings; - } - - return err; -} - -static int bt_conn_br_write_link_policy_settings(const struct bt_conn *conn, - uint16_t link_policy_settings) -{ - struct net_buf *buf; - struct bt_hci_cp_write_link_policy_settings *cp; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->handle = sys_cpu_to_le16(conn->handle); - cp->link_policy_settings = link_policy_settings; - - return bt_hci_cmd_send_sync(BT_HCI_OP_WRITE_LINK_POLICY_SETTINGS, buf, NULL); -} - -int bt_conn_br_set_role_switch_enable(const struct bt_conn *conn, bool enable) -{ - int err; - uint16_t link_policy_settings; - bool is_enabled; - - CHECKIF(conn == NULL) { - LOG_DBG("conn is NULL"); - return -EINVAL; - } - - if (!bt_conn_is_type(conn, BT_CONN_TYPE_BR)) { - LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); - return -EINVAL; - } - - err = bt_conn_br_read_link_policy_settings(conn, &link_policy_settings); - if (err) { - return err; - } - - is_enabled = (link_policy_settings & BT_HCI_LINK_POLICY_SETTINGS_ENABLE_ROLE_SWITCH); - if (enable == is_enabled) { - return 0; - } - - link_policy_settings ^= BT_HCI_LINK_POLICY_SETTINGS_ENABLE_ROLE_SWITCH; - return bt_conn_br_write_link_policy_settings(conn, link_policy_settings); -} diff --git a/subsys/bluetooth/host/classic/shell/bredr.c b/subsys/bluetooth/host/classic/shell/bredr.c index d5c1d09a082..8770d3acbd2 100644 --- a/subsys/bluetooth/host/classic/shell/bredr.c +++ b/subsys/bluetooth/host/classic/shell/bredr.c @@ -1207,80 +1207,6 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) return err; } -void role_changed(struct bt_conn *conn, uint8_t status) -{ - struct bt_conn_info info; - int err; - - bt_shell_print("Role changed (HCI status 0x%02x)", status); - - err = bt_conn_get_info(conn, &info); - if (err) { - bt_shell_print("Failed to get info"); - return; - } - - bt_shell_print("Current role is: %s", get_conn_role_str(info.role)); -} - -static int cmd_switch_role(const struct shell *sh, size_t argc, char *argv[]) -{ - int err; - const char *action; - uint8_t role; - - if (!default_conn) { - shell_print(sh, "Not connected"); - return -ENOEXEC; - } - - action = argv[1]; - - if (!strcmp(action, "central")) { - role = BT_HCI_ROLE_CENTRAL; - } else if (!strcmp(action, "peripheral")) { - role = BT_HCI_ROLE_PERIPHERAL; - } else { - shell_help(sh); - return SHELL_CMD_HELP_PRINTED; - } - - err = bt_conn_br_switch_role(default_conn, role); - - if (err) { - shell_error(sh, "fail to change role (err %d)", err); - } - - return 0; -} - -static int cmd_set_role_switchable(const struct shell *sh, size_t argc, char *argv[]) -{ - int err = 0; - bool enable; - - if (!default_conn) { - shell_print(sh, "Not connected"); - return -ENOEXEC; - } - - enable = shell_strtobool(argv[1], 10, &err); - if (err) { - shell_help(sh); - return SHELL_CMD_HELP_PRINTED; - } - - err = bt_conn_br_set_role_switch_enable(default_conn, enable); - - if (err) { - shell_error(sh, "fail to set role switchable (err %d)", err); - } else { - shell_print(sh, "success"); - } - - return 0; -} - static int cmd_default_handler(const struct shell *sh, size_t argc, char **argv) { if (argc == 1) { @@ -1344,9 +1270,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE(br_cmds, SHELL_CMD_ARG(oob, NULL, NULL, cmd_oob, 1, 0), SHELL_CMD_ARG(pscan, NULL, "", cmd_connectable, 2, 0), SHELL_CMD_ARG(sdp-find, NULL, "", cmd_sdp_find_record, 2, 0), - SHELL_CMD_ARG(switch-role, NULL, "", cmd_switch_role, 2, 0), - SHELL_CMD_ARG(set-role-switchable, NULL, "", - cmd_set_role_switchable, 2, 0), SHELL_SUBCMD_SET_END ); diff --git a/subsys/bluetooth/host/classic/shell/bredr.h b/subsys/bluetooth/host/classic/shell/bredr.h deleted file mode 100644 index 1cc3396c63f..00000000000 --- a/subsys/bluetooth/host/classic/shell/bredr.h +++ /dev/null @@ -1,20 +0,0 @@ -/** @file - * @brief Bluetooth shell functions - * - * This is not to be included by the application. - */ - -/* - * Copyright 2025 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef __BREDR_H -#define __BREDR_H -#include -#include - -void role_changed(struct bt_conn *conn, uint8_t status); - -#endif /* __BREDR_H */ diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 611ce0afcec..05d841e3744 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -53,9 +53,6 @@ #include "controller/ll_sw/shell/ll.h" #endif /* CONFIG_BT_LL_SW_SPLIT */ #include "host/shell/bt.h" -#if defined(CONFIG_BT_CLASSIC) -#include "host/classic/shell/bredr.h" -#endif static bool no_settings_load; @@ -1229,9 +1226,6 @@ static struct bt_conn_cb conn_callbacks = { .le_cs_config_complete = le_cs_config_created, .le_cs_config_removed = le_cs_config_removed, #endif -#if defined(CONFIG_BT_CLASSIC) - .role_changed = role_changed, -#endif }; #endif /* CONFIG_BT_CONN */ From 5b4074647aca583543ac663c721472c1eb93e4d8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 146/881] Revert "[nrf fromtree] bluetooth: classic: add role changed callback" This reverts commit 009cc9b41f3790e4ae6d4bac05e6ccad95c19184. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/conn.h | 11 ----------- subsys/bluetooth/host/classic/br.c | 16 ++++++++-------- subsys/bluetooth/host/conn.c | 19 ------------------- subsys/bluetooth/host/conn_internal.h | 2 -- 4 files changed, 8 insertions(+), 40 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index e74aeaa0fb5..bf8a31603b8 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -2033,17 +2033,6 @@ struct bt_conn_cb { #endif -#if defined(CONFIG_BT_CLASSIC) - /** @brief The role of the connection has changed. - * - * This callback notifies the application that the role switch procedure has completed. - * - * @param conn Connection object. - * @param status HCI status of role change event. - */ - void (*role_changed)(struct bt_conn *conn, uint8_t status); -#endif - /** @internal Internally used field for list handling */ sys_snode_t _node; }; diff --git a/subsys/bluetooth/host/classic/br.c b/subsys/bluetooth/host/classic/br.c index f7cc28fb45f..994fcfbd22c 100644 --- a/subsys/bluetooth/host/classic/br.c +++ b/subsys/bluetooth/host/classic/br.c @@ -681,22 +681,22 @@ void bt_hci_role_change(struct net_buf *buf) LOG_DBG("status 0x%02x role %u addr %s", evt->status, evt->role, bt_addr_str(&evt->bdaddr)); + if (evt->status) { + return; + } + conn = bt_conn_lookup_addr_br(&evt->bdaddr); if (!conn) { LOG_ERR("Can't find conn for %s", bt_addr_str(&evt->bdaddr)); return; } - if (evt->status == 0) { - if (evt->role == BT_HCI_ROLE_PERIPHERAL) { - conn->role = BT_CONN_ROLE_PERIPHERAL; - } else { - conn->role = BT_CONN_ROLE_CENTRAL; - } + if (evt->role) { + conn->role = BT_CONN_ROLE_PERIPHERAL; + } else { + conn->role = BT_CONN_ROLE_CENTRAL; } - bt_conn_role_changed(conn, evt->status); - bt_conn_unref(conn); } diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index abcc3d861ff..b8f63abf801 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1826,25 +1826,6 @@ void bt_conn_connected(struct bt_conn *conn) notify_connected(conn); } -#if defined(CONFIG_BT_CLASSIC) -void bt_conn_role_changed(struct bt_conn *conn, uint8_t status) -{ - struct bt_conn_cb *callback; - - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->role_changed) { - callback->role_changed(conn, status); - } - } - - STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { - if (cb->role_changed) { - cb->role_changed(conn, status); - } - } -} -#endif - static int conn_disconnect(struct bt_conn *conn, uint8_t reason) { int err; diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 495de911446..7d3cc130394 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -490,8 +490,6 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state); void bt_conn_connected(struct bt_conn *conn); -void bt_conn_role_changed(struct bt_conn *conn, uint8_t status); - int bt_conn_le_conn_update(struct bt_conn *conn, const struct bt_le_conn_param *param); From 7aec6d0ea9f1e4592677e761a3b04a51d1a63616 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 147/881] Revert "[nrf fromtree] bluetooth: mesh: remove unused functionality" This reverts commit 534fd57c6f0ef128eb638366e9bc5d88c5c1e618. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/shell/bt.c | 4 ++ subsys/bluetooth/mesh/shell/CMakeLists.txt | 2 + subsys/bluetooth/mesh/shell/hci.c | 76 ++++++++++++++++++++++ subsys/bluetooth/mesh/shell/hci.h | 7 ++ 4 files changed, 89 insertions(+) create mode 100644 subsys/bluetooth/mesh/shell/hci.c create mode 100644 subsys/bluetooth/mesh/shell/hci.h diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 05d841e3744..cc30ad7fbb1 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -53,6 +53,7 @@ #include "controller/ll_sw/shell/ll.h" #endif /* CONFIG_BT_LL_SW_SPLIT */ #include "host/shell/bt.h" +#include "mesh/shell/hci.h" static bool no_settings_load; @@ -5241,6 +5242,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds, #endif #endif /* CONFIG_BT_SMP || CONFIG_BT_CLASSIC) */ #endif /* CONFIG_BT_CONN */ +#if defined(CONFIG_BT_HCI_MESH_EXT) + SHELL_CMD(mesh_adv, NULL, HELP_ONOFF, cmd_mesh_adv), +#endif /* CONFIG_BT_HCI_MESH_EXT */ #if defined(CONFIG_BT_LL_SW_SPLIT) SHELL_CMD(ll-addr, NULL, "", cmd_ll_addr_read), diff --git a/subsys/bluetooth/mesh/shell/CMakeLists.txt b/subsys/bluetooth/mesh/shell/CMakeLists.txt index e90e5542846..0a8e948fc43 100644 --- a/subsys/bluetooth/mesh/shell/CMakeLists.txt +++ b/subsys/bluetooth/mesh/shell/CMakeLists.txt @@ -36,3 +36,5 @@ zephyr_library_sources_ifdef(CONFIG_BT_MESH_OD_PRIV_PROXY_CLI od_priv_proxy.c) zephyr_library_sources_ifdef(CONFIG_BT_MESH_SOL_PDU_RPL_CLI sol_pdu_rpl.c) zephyr_library_sources_ifdef(CONFIG_BT_MESH_SHELL_BRG_CFG_CLI brg_cfg.c) + +zephyr_library_sources_ifdef(CONFIG_BT_HCI_MESH_EXT hci.c) diff --git a/subsys/bluetooth/mesh/shell/hci.c b/subsys/bluetooth/mesh/shell/hci.c new file mode 100644 index 00000000000..191a47c2411 --- /dev/null +++ b/subsys/bluetooth/mesh/shell/hci.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017-2018 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "../host/hci_core.h" + +#if defined(CONFIG_BT_HCI_MESH_EXT) +int cmd_mesh_adv(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_buf *buf; + int err; + + if (argc < 2) { + return -EINVAL; + } + + if (!strcmp(argv[1], "on")) { + struct bt_hci_cp_mesh_advertise *cp; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (!buf) { + return -ENOBUFS; + } + + net_buf_add_u8(buf, BT_HCI_OC_MESH_ADVERTISE); + + /* TODO: fetch and fill cmdline params */ + cp = net_buf_add(buf, sizeof(*cp)); + cp->adv_slot = 0U; + cp->own_addr_type = 0x01; + memset(&cp->random_addr, 0, sizeof(bt_addr_t)); + cp->ch_map = 0x07; + cp->tx_power = 0; + cp->min_tx_delay = 0U; + cp->max_tx_delay = 0x32; + cp->retx_count = 0x07; + cp->retx_interval = 0x00; + cp->scan_delay = 0x0a; + cp->scan_duration = sys_cpu_to_le16(0x0064); + cp->scan_filter = 0x00; + cp->data_len = 0U; + memset(cp->data, 0, sizeof(cp->data)); + } else if (!strcmp(argv[1], "off")) { + struct bt_hci_cp_mesh_advertise_cancel *cp; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (!buf) { + return -ENOBUFS; + } + + net_buf_add_u8(buf, BT_HCI_OC_MESH_ADVERTISE_CANCEL); + + cp = net_buf_add(buf, sizeof(*cp)); + cp->adv_slot = 0U; + } else { + return -EINVAL; + } + + err = bt_hci_cmd_send_sync(BT_HCI_OP_VS_MESH, buf, NULL); + + return err; +} +#endif /* CONFIG_BT_HCI_MESH_EXT */ diff --git a/subsys/bluetooth/mesh/shell/hci.h b/subsys/bluetooth/mesh/shell/hci.h new file mode 100644 index 00000000000..81dcb0d892e --- /dev/null +++ b/subsys/bluetooth/mesh/shell/hci.h @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2017 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +int cmd_mesh_adv(const struct shell *sh, size_t argc, char *argv[]); From d1be9b9d58dd5cadef5ada3f275031d73fc40f71 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 148/881] Revert "[nrf fromtree] bluetooth: host: Add support for extended feature set feature" This reverts commit 579aa3120082320a027414816202b9e4f88edc41. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/bluetooth.h | 12 +--- include/zephyr/bluetooth/conn.h | 58 ------------------ include/zephyr/bluetooth/hci_types.h | 36 +---------- subsys/bluetooth/Kconfig | 15 ----- subsys/bluetooth/common/Kconfig | 2 +- subsys/bluetooth/controller/Kconfig | 11 ---- subsys/bluetooth/host/conn.c | 47 --------------- subsys/bluetooth/host/conn_internal.h | 3 - subsys/bluetooth/host/hci_core.c | 86 ++------------------------- subsys/bluetooth/host/shell/bt.c | 66 -------------------- tests/bluetooth/shell/testcase.yaml | 6 -- 11 files changed, 11 insertions(+), 331 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index a061b0564bf..7f287f1c344 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -72,16 +71,11 @@ extern "C" { #define BT_ID_DEFAULT 0 /** - * @brief Number of octets for local supported features + * @brief Number of octets for local supported * - * The value of 8 correspond to page 0 in the LE Controller supported features. - * 24 bytes are required for all subsequent supported feature pages. + * The value of 8 correspond to page 0 in the LE Controller supported features */ -#define BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE \ - (BT_HCI_LE_BYTES_PAGE_0_FEATURE_PAGE + \ - COND_CODE_1(CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE, \ - CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE * BT_HCI_LE_BYTES_PER_FEATURE_PAGE, \ - (0U))) +#define BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE 8 /** Opaque type representing an advertiser. */ struct bt_le_ext_adv; diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index bf8a31603b8..8bc060bb05b 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -252,27 +252,6 @@ struct bt_conn_le_subrate_changed { uint16_t supervision_timeout; }; -/** Read all remote features complete callback params */ -struct bt_conn_le_read_all_remote_feat_complete { - /** @brief HCI Status from LE Read All Remote Features Complete event. - * - * The remaining parameters will be unchanged if status is not @ref BT_HCI_ERR_SUCCESS. - */ - uint8_t status; - /** Number of pages supported by remote device. */ - uint8_t max_remote_page; - /** Number of pages fetched from remote device. */ - uint8_t max_valid_page; - /** @brief Pointer to array of size 248, with feature bits of remote supported features. - * - * Page 0 being 8 bytes, with the following 10 pages of 24 bytes. - * Refer to BT_LE_FEAT_BIT_* for values. - * Refer to the BT_FEAT_LE_* macros for value comparison. - * See Bluetooth Core Specification, Vol 6, Part B, Section 4.6. - */ - const uint8_t *features; -}; - /** Connection Type */ enum __packed bt_conn_type { /** LE Connection Type */ @@ -1207,24 +1186,6 @@ int bt_conn_le_subrate_set_defaults(const struct bt_conn_le_subrate_param *param int bt_conn_le_subrate_request(struct bt_conn *conn, const struct bt_conn_le_subrate_param *params); -/** @brief Read remote feature pages. - * - * Request remote feature pages, from 0 up to pages_requested or the number - * of pages supported by the peer. There is a maximum of 10 pages. - * This function will trigger the read_all_remote_feat_complete callback - * when the procedure is completed. - * - * @kconfig_dep{CONFIG_BT_LE_EXTENDED_FEAT_SET} - * - * @param conn @ref BT_CONN_TYPE_LE connection object. - * @param pages_requested Number of feature pages to be requested from peer. - * There is a maximum of 10 pages. - * - * @return Zero on success or (negative) error code on failure. - * @return -EINVAL @p conn is not a valid @ref BT_CONN_TYPE_LE connection. - */ -int bt_conn_le_read_all_remote_features(struct bt_conn *conn, uint8_t pages_requested); - /** @brief Update the connection parameters. * * If the local device is in the peripheral role then updating the connection @@ -1916,25 +1877,6 @@ struct bt_conn_cb { const struct bt_conn_le_subrate_changed *params); #endif /* CONFIG_BT_SUBRATING */ -#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) - /** @brief Read all remote features complete event. - * - * This callback notifies the application that a 'read all remote - * features' procedure of the connection is completed. The other params - * will not be populated if status is not @ref BT_HCI_ERR_SUCCESS. - * - * This callback can be triggered by calling @ref - * bt_conn_le_read_all_remote_features or by the procedure running - * autonomously in the controller. - * - * @param conn Connection object. - * @param params Remote features. - */ - void (*read_all_remote_feat_complete)( - struct bt_conn *conn, - const struct bt_conn_le_read_all_remote_feat_complete *params); -#endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */ - #if defined(CONFIG_BT_CHANNEL_SOUNDING) /** @brief LE CS Read Remote Supported Capabilities Complete event. * diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index a2085271239..0b2c1b1a397 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -207,7 +207,7 @@ struct bt_hci_cmd_hdr { #define BT_LE_FEAT_BIT_CHANNEL_SOUNDING 46 #define BT_LE_FEAT_BIT_CHANNEL_SOUNDING_HOST 47 #define BT_LE_FEAT_BIT_CHANNEL_SOUNDING_TONE_QUAL_IND 48 -#define BT_LE_FEAT_BIT_EXTENDED_FEAT_SET 63 +#define BT_LE_FEAT_BIT_LL_EXTENDED_FEAT_SET 63 #define BT_LE_FEAT_TEST(feat, n) (feat[(n) >> 3] & \ BIT((n) & 7)) @@ -284,8 +284,6 @@ struct bt_hci_cmd_hdr { BT_LE_FEAT_BIT_CHANNEL_SOUNDING) #define BT_FEAT_LE_CHANNEL_SOUNDING_HOST(feat) BT_LE_FEAT_TEST(feat, \ BT_LE_FEAT_BIT_CHANNEL_SOUNDING_HOST) -#define BT_FEAT_LE_EXTENDED_FEAT_SET(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_EXTENDED_FEAT_SET) #define BT_FEAT_LE_CIS(feat) (BT_FEAT_LE_CIS_CENTRAL(feat) | \ BT_FEAT_LE_CIS_PERIPHERAL(feat)) @@ -2440,22 +2438,6 @@ struct bt_hci_cp_le_tx_test_v4 { uint8_t ant_ids[0]; } __packed; -#define BT_HCI_OP_LE_READ_ALL_LOCAL_SUPPORTED_FEATURES BT_OP(BT_OGF_LE, 0x0087) /* 0x2087 */ -struct bt_hci_rp_le_read_all_local_supported_features { - uint8_t status; - uint8_t max_page; - uint8_t features[248]; -} __packed; - -#define BT_READ_ALL_LOCAL_FEATURES_SUPPORTED(supported_commands) \ - BT_CMD_TEST(supported_commands, 47, 2) - -#define BT_HCI_OP_LE_READ_ALL_REMOTE_FEATURES BT_OP(BT_OGF_LE, 0x0088) /* 0x2088 */ -struct bt_hci_cp_le_read_all_remote_features { - uint16_t handle; - uint8_t pages_requested; -} __packed; - #define BT_HCI_TX_TEST_POWER_MIN -0x7F #define BT_HCI_TX_TEST_POWER_MAX 0x14 @@ -3570,20 +3552,6 @@ struct bt_hci_evt_le_cis_established_v2 { uint8_t framing; } __packed; -#define BT_HCI_EVT_LE_READ_ALL_REMOTE_FEAT_COMPLETE 0x2b - -#define BT_HCI_LE_FEATURE_PAGE_MAX 10 -#define BT_HCI_LE_BYTES_PER_FEATURE_PAGE 24 -#define BT_HCI_LE_BYTES_PAGE_0_FEATURE_PAGE 8 - -struct bt_hci_evt_le_read_all_remote_feat_complete { - uint8_t status; - uint16_t handle; - uint8_t max_remote_page; - uint8_t max_valid_page; - uint8_t features[248]; -} __packed; - #define BT_HCI_LE_CS_INITIATOR_ROLE_MASK BIT(0) #define BT_HCI_LE_CS_REFLECTOR_ROLE_MASK BIT(1) @@ -4056,8 +4024,6 @@ struct bt_hci_evt_le_cs_procedure_enable_complete { #define BT_EVT_MASK_LE_ENH_CONN_COMPLETE_V2 BT_EVT_BIT(40) #define BT_EVT_MASK_LE_CIS_ESTABLISHED_V2 BT_EVT_BIT(41) -#define BT_EVT_MASK_LE_READ_ALL_REMOTE_FEAT_COMPLETE BT_EVT_BIT(42) - #define BT_EVT_MASK_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE BT_EVT_BIT(43) #define BT_EVT_MASK_LE_CS_READ_REMOTE_FAE_TABLE_COMPLETE BT_EVT_BIT(44) #define BT_EVT_MASK_LE_CS_SECURITY_ENABLE_COMPLETE BT_EVT_BIT(45) diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index c98c7a5ff53..68d08819e1c 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -115,21 +115,6 @@ config BT_CONN_TX help Hidden configuration that is true if ACL or broadcast ISO is enabled -config BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE - int "Maximum supported feature page" - default 0 - range 0 10 - depends on BT_LE_EXTENDED_FEAT_SET - help - Maximum supported feature page that can be stored locally and fetched - from the remote connection with the LL Extended Feature Set feature. - -config BT_LE_EXTENDED_FEAT_SET - bool "LL Extended Feature Set" - depends on !HAS_BT_CTLR || BT_CTLR_EXTENDED_FEAT_SET_SUPPORT - help - Enable support for the LL Extended Feature Set feature. - if BT_CONN config BT_HCI_ACL_FLOW_CONTROL bool "Controller to Host ACL flow control support" diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 60328a1dd35..2b7b698d8f8 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -119,7 +119,7 @@ config BT_BUF_ACL_RX_COUNT config BT_BUF_EVT_RX_SIZE int "Maximum supported HCI Event buffer length" - default $(UINT8_MAX) if (BT_EXT_ADV && BT_OBSERVER) || BT_PER_ADV_SYNC || BT_DF_CONNECTION_CTE_RX || BT_CLASSIC || BT_CHANNEL_SOUNDING || BT_LE_EXTENDED_FEAT_SET + default $(UINT8_MAX) if (BT_EXT_ADV && BT_OBSERVER) || BT_PER_ADV_SYNC || BT_DF_CONNECTION_CTE_RX || BT_CLASSIC || BT_CHANNEL_SOUNDING # LE Read Supported Commands command complete event. default 68 range 68 $(UINT8_MAX) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index c7e7030ba28..16a40b7f437 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -128,9 +128,6 @@ config BT_CTLR_SUBRATING_SUPPORT config BT_CTLR_CHANNEL_SOUNDING_SUPPORT bool -config BT_CTLR_EXTENDED_FEAT_SET_SUPPORT - bool - # Virtual option that all local LL implementations should select config HAS_BT_CTLR bool @@ -1179,14 +1176,6 @@ config BT_CTLR_CHANNEL_SOUNDING Enable support for Bluetooth 6.0 Channel Sounding in the Controller. -config BT_CTLR_EXTENDED_FEAT_SET - bool "LL Extended Feature Set support" - depends on BT_CTLR_EXTENDED_FEAT_SET_SUPPORT - default y if BT_LE_EXTENDED_FEAT_SET - help - Enable support for Bluetooth 6.0 LL Extended Feature Set - in the Controller. - rsource "Kconfig.df" rsource "Kconfig.ll_sw_split" rsource "Kconfig.dtm" diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index b8f63abf801..a74a0429527 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -3304,53 +3304,6 @@ int bt_conn_le_subrate_request(struct bt_conn *conn, } #endif /* CONFIG_BT_SUBRATING */ -#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) -void notify_read_all_remote_feat_complete(struct bt_conn *conn, - struct bt_conn_le_read_all_remote_feat_complete *params) -{ - struct bt_conn_cb *callback; - - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->read_all_remote_feat_complete != NULL) { - callback->read_all_remote_feat_complete(conn, params); - } - } - - STRUCT_SECTION_FOREACH(bt_conn_cb, cb) - { - if (cb->read_all_remote_feat_complete != NULL) { - cb->read_all_remote_feat_complete(conn, params); - } - } -} - -int bt_conn_le_read_all_remote_features(struct bt_conn *conn, uint8_t pages_requested) -{ - struct bt_hci_cp_le_read_all_remote_features *cp; - struct net_buf *buf; - - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { - LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); - return -EINVAL; - } - - if (pages_requested > BT_HCI_LE_FEATURE_PAGE_MAX) { - return -EINVAL; - } - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (buf == NULL) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->handle = sys_cpu_to_le16(conn->handle); - cp->pages_requested = pages_requested; - - return bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_ALL_REMOTE_FEATURES, buf, NULL); -} -#endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */ - #if defined(CONFIG_BT_CHANNEL_SOUNDING) void notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status, struct bt_conn_le_cs_capabilities *params) diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 7d3cc130394..909c0ebd22e 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -512,9 +512,6 @@ void notify_path_loss_threshold_report(struct bt_conn *conn, void notify_subrate_change(struct bt_conn *conn, struct bt_conn_le_subrate_changed params); -void notify_read_all_remote_feat_complete(struct bt_conn *conn, - struct bt_conn_le_read_all_remote_feat_complete *params); - void notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status, struct bt_conn_le_cs_capabilities *params); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 1fe19b5373b..9de787388b1 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1800,37 +1800,6 @@ static void le_remote_feat_complete(struct net_buf *buf) bt_conn_unref(conn); } -#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) -static void le_read_all_remote_feat_complete(struct net_buf *buf) -{ - struct bt_hci_evt_le_read_all_remote_feat_complete *evt = (void *)buf->data; - struct bt_conn *conn; - struct bt_conn_le_read_all_remote_feat_complete params; - uint16_t handle = sys_le16_to_cpu(evt->handle); - - LOG_DBG("Read all remote feature complete: 0x%02x %s handle %u", evt->status, - bt_hci_err_to_str(evt->status), handle); - - conn = bt_conn_lookup_handle(handle, BT_CONN_TYPE_LE); - if (conn == NULL) { - LOG_ERR("Unknown conn handle 0x%04X", handle); - return; - } - - params.status = evt->status; - - if (params.status == BT_HCI_ERR_SUCCESS) { - params.max_remote_page = evt->max_remote_page; - params.max_valid_page = evt->max_valid_page; - params.features = evt->features; - } - - notify_read_all_remote_feat_complete(conn, ¶ms); - - bt_conn_unref(conn); -} -#endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */ - #if defined(CONFIG_BT_DATA_LEN_UPDATE) static void le_data_len_change(struct net_buf *buf) { @@ -2953,11 +2922,6 @@ static const struct event_handler meta_events[] = { EVENT_HANDLER(BT_HCI_EVT_LE_ENH_CONN_COMPLETE_V2, le_enh_conn_complete_v2, sizeof(struct bt_hci_evt_le_enh_conn_complete_v2)), #endif /* CONFIG_BT_PER_ADV_RSP || CONFIG_BT_PER_ADV_SYNC_RSP */ -#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) - EVENT_HANDLER(BT_HCI_EVT_LE_READ_ALL_REMOTE_FEAT_COMPLETE, - le_read_all_remote_feat_complete, - sizeof(struct bt_hci_evt_le_read_all_remote_feat_complete)), -#endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */ #endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_CHANNEL_SOUNDING) EVENT_HANDLER(BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE, @@ -3194,47 +3158,9 @@ static void read_le_features_complete(struct net_buf *buf) LOG_DBG("status 0x%02x %s", rp->status, bt_hci_err_to_str(rp->status)); - memcpy(bt_dev.le.features, rp->features, sizeof(rp->features)); -} - -static void read_le_all_supported_features_complete(struct net_buf *buf) -{ - struct bt_hci_rp_le_read_all_local_supported_features *rp = (void *)buf->data; - - LOG_DBG("status 0x%02x %s", rp->status, bt_hci_err_to_str(rp->status)); - memcpy(bt_dev.le.features, rp->features, sizeof(bt_dev.le.features)); } -static int read_le_local_supported_features(void) -{ - struct net_buf *rsp; - int err; - - /* Read Low Energy Supported Features */ - if (IS_ENABLED(CONFIG_BT_LE_EXTENDED_FEAT_SET) && - BT_READ_ALL_LOCAL_FEATURES_SUPPORTED(bt_dev.supported_commands)) { - err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_ALL_LOCAL_SUPPORTED_FEATURES, NULL, - &rsp); - if (err != 0) { - return err; - } - - read_le_all_supported_features_complete(rsp); - } else { - err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_LOCAL_FEATURES, NULL, - &rsp); - if (err != 0) { - return err; - } - - read_le_features_complete(rsp); - } - - net_buf_unref(rsp); - return 0; -} - #if defined(CONFIG_BT_CONN) #if !defined(CONFIG_BT_CLASSIC) static void read_buffer_size_complete(struct net_buf *buf) @@ -3519,11 +3445,6 @@ static int le_set_event_mask(void) BT_FEAT_LE_CONN_SUBRATING(bt_dev.le.features)) { mask |= BT_EVT_MASK_LE_SUBRATE_CHANGE; } - - if (IS_ENABLED(CONFIG_BT_LE_EXTENDED_FEAT_SET) && - BT_FEAT_LE_EXTENDED_FEAT_SET(bt_dev.le.features)) { - mask |= BT_EVT_MASK_LE_READ_ALL_REMOTE_FEAT_COMPLETE; - } } if (IS_ENABLED(CONFIG_BT_SMP) && @@ -3662,11 +3583,16 @@ static int le_init(void) return -ENODEV; } - err = read_le_local_supported_features(); + /* Read Low Energy Supported Features */ + err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_LOCAL_FEATURES, NULL, + &rsp); if (err) { return err; } + read_le_features_complete(rsp); + net_buf_unref(rsp); + if (IS_ENABLED(CONFIG_BT_ISO) && BT_FEAT_LE_ISO(bt_dev.le.features)) { err = le_init_iso(); diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index cc30ad7fbb1..1550644018e 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -1008,37 +1008,6 @@ void subrate_changed(struct bt_conn *conn, } #endif -#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) -void read_all_remote_feat_complete(struct bt_conn *conn, - const struct bt_conn_le_read_all_remote_feat_complete *params) -{ - if (params->status == BT_HCI_ERR_SUCCESS) { - uint8_t number_of_bytes = BT_HCI_LE_BYTES_PAGE_0_FEATURE_PAGE; - - if (params->max_valid_page > 0) { - number_of_bytes += - (params->max_valid_page * BT_HCI_LE_BYTES_PER_FEATURE_PAGE); - } - - bt_shell_fprintf_print( - "Read all remote features complete, Max Remote Page %d, LE Features: 0x", - params->max_remote_page); - - for (int i = number_of_bytes - 1; i >= 0; i--) { - uint8_t features = params->features[i]; - char features_str[(2 * sizeof(uint8_t)) + 1]; - - bin2hex(&features, sizeof(features), features_str, sizeof(features_str)); - bt_shell_fprintf_print("%s", features_str); - } - bt_shell_fprintf_print("\n"); - } else { - bt_shell_print("Read all remote features failed (HCI status 0x%02x)", - params->status); - } -} -#endif - #if defined(CONFIG_BT_CHANNEL_SOUNDING) void print_remote_cs_capabilities(struct bt_conn *conn, uint8_t status, @@ -1218,9 +1187,6 @@ static struct bt_conn_cb conn_callbacks = { #if defined(CONFIG_BT_SUBRATING) .subrate_changed = subrate_changed, #endif -#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) - .read_all_remote_feat_complete = read_all_remote_feat_complete, -#endif #if defined(CONFIG_BT_CHANNEL_SOUNDING) .le_cs_read_remote_capabilities_complete = print_remote_cs_capabilities, .le_cs_read_remote_fae_table_complete = print_remote_cs_fae_table, @@ -3314,34 +3280,6 @@ static int cmd_subrate_request(const struct shell *sh, size_t argc, char *argv[] } #endif -#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) -static int cmd_read_all_remote_features(const struct shell *sh, size_t argc, char *argv[]) -{ - int err = 0; - - if (default_conn == NULL) { - shell_error(sh, "Conn handle error, at least one connection is required."); - return -ENOEXEC; - } - - uint8_t pages_requested = shell_strtoul(argv[1], 10, &err); - - if (err != 0) { - shell_help(sh); - shell_error(sh, "Could not parse input for pages_requested"); - return SHELL_CMD_HELP_PRINTED; - } - - err = bt_conn_le_read_all_remote_features(default_conn, pages_requested); - if (err != 0) { - shell_error(sh, "bt_conn_le_read_all_remote_features returned error %d", err); - return -ENOEXEC; - } - - return 0; -} -#endif - #if defined(CONFIG_BT_CONN) #if defined(CONFIG_BT_CENTRAL) static int bt_do_connect_le(int *ercd, size_t argc, char *argv[]) @@ -5093,10 +5031,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds, " ", cmd_subrate_request, 6, 0), #endif -#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) - SHELL_CMD_ARG(read-all-remote-features, NULL, "", - cmd_read_all_remote_features, 2, 0), -#endif #if defined(CONFIG_BT_BROADCASTER) SHELL_CMD_ARG(advertise, NULL, " [mode: discov, non_discov] " diff --git a/tests/bluetooth/shell/testcase.yaml b/tests/bluetooth/shell/testcase.yaml index 673f13e481c..812aee24eeb 100644 --- a/tests/bluetooth/shell/testcase.yaml +++ b/tests/bluetooth/shell/testcase.yaml @@ -34,12 +34,6 @@ tests: - CONFIG_BT_SUBRATING=y - CONFIG_BT_LL_SW_SPLIT=n build_only: true - bluetooth.shell.extended_feature_set: - extra_configs: - - CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE=10 - - CONFIG_BT_LE_EXTENDED_FEAT_SET=y - - CONFIG_BT_LL_SW_SPLIT=n - build_only: true bluetooth.shell.channel_sounding: extra_configs: - CONFIG_BT_CHANNEL_SOUNDING=y From 9f65afc366188dd153dafe2cf97dfdbb28e17c3f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 149/881] Revert "[nrf fromtree] bluetooth: host: hci_core: allow both orders of version and feature events" This reverts commit 5684f5eeed7d513efcc806aaa69bb8f274776515. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/hci_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 9de787388b1..7263bc39ed4 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1792,8 +1792,7 @@ static void le_remote_feat_complete(struct net_buf *buf) atomic_set_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED); if (IS_ENABLED(CONFIG_BT_REMOTE_INFO) && - (!IS_ENABLED(CONFIG_BT_REMOTE_VERSION) || - atomic_test_bit(conn->flags, BT_CONN_AUTO_VERSION_INFO))) { + !IS_ENABLED(CONFIG_BT_REMOTE_VERSION)) { notify_remote_info(conn); } @@ -2373,8 +2372,7 @@ static void bt_hci_evt_read_remote_version_complete(struct net_buf *buf) atomic_set_bit(conn->flags, BT_CONN_AUTO_VERSION_INFO); - if (IS_ENABLED(CONFIG_BT_REMOTE_INFO) && - atomic_test_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED)) { + if (IS_ENABLED(CONFIG_BT_REMOTE_INFO)) { /* Remote features is already present */ notify_remote_info(conn); } From 359e53cda2509dc674bd57bd946572cca38223fb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 150/881] Revert "[nrf fromtree] kconfig: fix typo in (soc, subsys)" This reverts commit 149b89ae09b5658fdd4ede74ee5275e8a7ac3cd9. Signed-off-by: Jukka Rissanen --- soc/atmel/sam0/common/Kconfig.samd2x | 2 +- soc/espressif/esp32s3/Kconfig | 3 +-- soc/intel/intel_adsp/Kconfig | 4 ++-- soc/intel/intel_adsp/Kconfig.defconfig | 2 +- soc/nxp/imxrt/imxrt118x/Kconfig | 4 ++-- soc/nxp/rw/Kconfig | 2 +- soc/renesas/rx/Kconfig | 2 +- soc/silabs/Kconfig | 2 +- soc/st/stm32/Kconfig | 2 +- soc/st/stm32/Kconfig.defconfig | 2 +- subsys/bluetooth/controller/Kconfig | 2 +- subsys/canbus/isotp/Kconfig | 2 +- subsys/debug/coredump/Kconfig | 2 +- subsys/ipc/ipc_service/backends/Kconfig | 10 +++++----- subsys/logging/Kconfig.processing | 2 +- subsys/mgmt/ec_host_cmd/Kconfig.logging | 2 +- subsys/mgmt/mcumgr/smp/Kconfig | 4 ++-- 17 files changed, 24 insertions(+), 25 deletions(-) diff --git a/soc/atmel/sam0/common/Kconfig.samd2x b/soc/atmel/sam0/common/Kconfig.samd2x index c9de00e3249..11f76f608a1 100644 --- a/soc/atmel/sam0/common/Kconfig.samd2x +++ b/soc/atmel/sam0/common/Kconfig.samd2x @@ -8,7 +8,7 @@ config SOC_ATMEL_SAMD_NVM_WAIT_STATES default 1 help Wait states to set for NVM. Consult the datasheet as these are highly - dependent on the device operating conditions. + dependent on the device operationg conditions. config SOC_ATMEL_SAMD_OSC32K bool "Internal 32.768 kHz RC oscillator" diff --git a/soc/espressif/esp32s3/Kconfig b/soc/espressif/esp32s3/Kconfig index 5fa2d4607e8..99ebadeb440 100644 --- a/soc/espressif/esp32s3/Kconfig +++ b/soc/espressif/esp32s3/Kconfig @@ -152,8 +152,7 @@ config MAC_BB_PD help If enabled, the MAC and baseband of Wi-Fi and Bluetooth will be powered down when PHY is disabled. Enabling this setting reduces power consumption - by a small amount but increases RAM use by approximately 4KB (Wi-Fi only), - 2KB (Bluetooth only) or 5.3KB (Wi-Fi + Bluetooth). + by a small amount but increases RAM use by approximat endmenu # Cache config diff --git a/soc/intel/intel_adsp/Kconfig b/soc/intel/intel_adsp/Kconfig index 2d87adb0306..096c4336876 100644 --- a/soc/intel/intel_adsp/Kconfig +++ b/soc/intel/intel_adsp/Kconfig @@ -141,8 +141,8 @@ config XTENSA_WAITI_BUG config ADSP_IDLE_CLOCK_GATING bool "DSP clock gating in Idle" help - When true, FW will run with enabled clock gating. This option changes - HW configuration of a DSP. Every time core goes to the WAITI state + When true, FW will run with enabled clock gating. This options change + HW configuration of a DSP. Evry time core goes to the WAITI state (wait for interrupt) during idle, the clock can be gated (however, this does not mean that this will happen). diff --git a/soc/intel/intel_adsp/Kconfig.defconfig b/soc/intel/intel_adsp/Kconfig.defconfig index 1d8312e7fb6..5a2ff345e25 100644 --- a/soc/intel/intel_adsp/Kconfig.defconfig +++ b/soc/intel/intel_adsp/Kconfig.defconfig @@ -18,7 +18,7 @@ config XTENSA_RPO_CACHE def_bool y # console can't handle the amount of data coming from many tests, so introduce -# a delay between testcases. +# a delay beween testcases. if ZTEST config ZTEST_TEST_DELAY_MS default 100 diff --git a/soc/nxp/imxrt/imxrt118x/Kconfig b/soc/nxp/imxrt/imxrt118x/Kconfig index 1ec08a04311..d62af3d1b51 100644 --- a/soc/nxp/imxrt/imxrt118x/Kconfig +++ b/soc/nxp/imxrt/imxrt118x/Kconfig @@ -40,11 +40,11 @@ config IMAGE_CONTAINER_OFFSET default 0x1000 help Image container is a boot image format that is used by ROM. Container - format consists of container header, image array entry, signature block + format consists container header, image arrary entry, signature block and user program images and data. The boot ROM expects container data to be saved in external memory. -# Note- This config presents the offset between container header and user +# Note- This config present the offest between container header and user # image. If ROM_START_OFFSET changed, you also need to change CONTAINER_USER_IMAGE_OFFSET # value. CONTAINER_USER_IMAGE_OFFSET = ROM_START_OFFSET - IMAGE_CONTAINER_OFFSET. config CONTAINER_USER_IMAGE_OFFSET diff --git a/soc/nxp/rw/Kconfig b/soc/nxp/rw/Kconfig index 63a2e28b732..a32483ad0c1 100644 --- a/soc/nxp/rw/Kconfig +++ b/soc/nxp/rw/Kconfig @@ -39,7 +39,7 @@ config FLASH_CONFIG_OFFSET default 0x400 help The flash config offset provides the boot ROM with the on-board - flash type and parameters. The boot ROM requires a fixed flash config + flash type and parameters. The boot ROM requires a fixed flash conifg offset for FlexSPI device. config IMAGE_VECTOR_TABLE_OFFSET diff --git a/soc/renesas/rx/Kconfig b/soc/renesas/rx/Kconfig index 2f5253bf541..f0670b850e3 100644 --- a/soc/renesas/rx/Kconfig +++ b/soc/renesas/rx/Kconfig @@ -10,7 +10,7 @@ config RENESAS_NONE_USED_PORT_INIT bool "Initialize unused ports" default y help - Initialize the unused pins of RX MCU followed by in the "Handling of + Initialize the unsed pins of RX MCU followed by in the "Handling of Unused Pins" section of PORT chapter of RX MCU of User's manual. Note: please MUST set "BSP_PACKAGE_PINS" definition to your device of pin type in r_bsp_config.h. diff --git a/soc/silabs/Kconfig b/soc/silabs/Kconfig index 1fb5535ac67..dcf8de541c6 100644 --- a/soc/silabs/Kconfig +++ b/soc/silabs/Kconfig @@ -9,7 +9,7 @@ if SOC_FAMILY_SILABS_S0 || SOC_FAMILY_SILABS_S1 || SOC_FAMILY_SILABS_S2 config SOC_GECKO_SDID int help - Sometimes, Gecko SDK refers to the chipset using the internal ID. This + Gecko SDK sometime refere to the chipset using the internal ID. This entry reflects this ID. config SOC_GECKO_BURTC diff --git a/soc/st/stm32/Kconfig b/soc/st/stm32/Kconfig index a14d9ea8182..59a245fb17a 100644 --- a/soc/st/stm32/Kconfig +++ b/soc/st/stm32/Kconfig @@ -36,7 +36,7 @@ config STM32_ENABLE_DEBUG_SLEEP_STOP Some STM32 parts disable the DBGMCU in sleep/stop modes because of power consumption. As a side-effects this prevents debuggers from attaching w/o resetting the target. This - effectively destroys the use-case of `west attach`. Also + effectivly destroys the use-case of `west attach`. Also SEGGER RTT and similar technologies need this. config SWJ_ANALOG_PRIORITY diff --git a/soc/st/stm32/Kconfig.defconfig b/soc/st/stm32/Kconfig.defconfig index 26055f9eb60..18f343b9324 100644 --- a/soc/st/stm32/Kconfig.defconfig +++ b/soc/st/stm32/Kconfig.defconfig @@ -3,7 +3,7 @@ # Copyright (c) 2017, I-SENSE group of ICCS # SPDX-License-Identifier: Apache-2.0 -# Default configurations applied to the whole STM32 family +# Default configurations appplied tp the whole STM32 family if SOC_FAMILY_STM32 diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 16a40b7f437..60726163581 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -128,7 +128,7 @@ config BT_CTLR_SUBRATING_SUPPORT config BT_CTLR_CHANNEL_SOUNDING_SUPPORT bool -# Virtual option that all local LL implementations should select +# Virtual option that all local LL implemenations should select config HAS_BT_CTLR bool diff --git a/subsys/canbus/isotp/Kconfig b/subsys/canbus/isotp/Kconfig index c643f22ca18..281692cf95e 100644 --- a/subsys/canbus/isotp/Kconfig +++ b/subsys/canbus/isotp/Kconfig @@ -87,7 +87,7 @@ config ISOTP_RX_SF_FF_BUF_COUNT default 4 help This buffer is used for first and single frames. It is extra because the - buffer has to be ready for the first reception in isr context and therefore + buffer has to be ready for the first reception in isr context and therefor is allocated when binding. Each buffer will occupy CAN_MAX_DLEN - 1 byte + header (sizeof(struct net_buf)) amount of data. diff --git a/subsys/debug/coredump/Kconfig b/subsys/debug/coredump/Kconfig index c4e93605988..1e763e522e1 100644 --- a/subsys/debug/coredump/Kconfig +++ b/subsys/debug/coredump/Kconfig @@ -45,7 +45,7 @@ config DEBUG_COREDUMP_BACKEND_INTEL_ADSP_MEM_WINDOW help Core dump is done via memory window slot[1]. It is Intel ADSP memory region shared with xtensa DSP. - Window 2 slot [1] is reserved for debugging information. + Window 2 slot [1] is reserved for debuging information. config DEBUG_COREDUMP_BACKEND_OTHER bool "Backend subsystem for coredump defined out of tree" diff --git a/subsys/ipc/ipc_service/backends/Kconfig b/subsys/ipc/ipc_service/backends/Kconfig index bb8b444898f..8230465e246 100644 --- a/subsys/ipc/ipc_service/backends/Kconfig +++ b/subsys/ipc/ipc_service/backends/Kconfig @@ -23,7 +23,7 @@ config IPC_SERVICE_BACKEND_ICMSG depends on DT_HAS_ZEPHYR_IPC_ICMSG_ENABLED select IPC_SERVICE_ICMSG help - Choosing this backend results in single endpoint implementation based + Chosing this backend results in single endpoint implementation based on circular packet buffer. config IPC_SERVICE_BACKEND_ICMSG_ME_INITIATOR @@ -33,8 +33,8 @@ config IPC_SERVICE_BACKEND_ICMSG_ME_INITIATOR depends on DT_HAS_ZEPHYR_IPC_ICMSG_ME_INITIATOR_ENABLED select IPC_SERVICE_ICMSG_ME help - Choosing this backend results in multi endpoint implementation based - on circular packet buffer. This enables endpoint discovery initiator + Chosing this backend results in multi endpoint implementation based + on circular packet buffer. This enables enpoint discovery initiator role. config IPC_SERVICE_BACKEND_ICMSG_ME_FOLLOWER @@ -44,8 +44,8 @@ config IPC_SERVICE_BACKEND_ICMSG_ME_FOLLOWER depends on DT_HAS_ZEPHYR_IPC_ICMSG_ME_FOLLOWER_ENABLED select IPC_SERVICE_ICMSG_ME help - Choosing this backend results in multi endpoint implementation based - on circular packet buffer. This enables endpoint discovery follower + Chosing this backend results in multi endpoint implementation based + on circular packet buffer. This enables enpoint discovery follower role. rsource "Kconfig.icmsg_me" diff --git a/subsys/logging/Kconfig.processing b/subsys/logging/Kconfig.processing index c13c8a76a91..f354e8b5df6 100644 --- a/subsys/logging/Kconfig.processing +++ b/subsys/logging/Kconfig.processing @@ -114,7 +114,7 @@ config LOG_PROCESS_THREAD_PRIORITY depends on LOG_PROCESS_THREAD_CUSTOM_PRIORITY help The priority of the log processing thread. - When not set the priority is set to K_LOWEST_APPLICATION_THREAD_PRIO. + When not set the prority is set to K_LOWEST_APPLICATION_THREAD_PRIO. endif # LOG_PROCESS_THREAD diff --git a/subsys/mgmt/ec_host_cmd/Kconfig.logging b/subsys/mgmt/ec_host_cmd/Kconfig.logging index ca225309929..96de59e39cd 100644 --- a/subsys/mgmt/ec_host_cmd/Kconfig.logging +++ b/subsys/mgmt/ec_host_cmd/Kconfig.logging @@ -8,7 +8,7 @@ config EC_HOST_CMD_LOG_DBG_BUFFERS depends on EC_HC_LOG_LEVEL_DBG help Every command is logged with the debug logging level. Use this config - to decide if full request and response buffers are logged alongside + to decide, if full reqest and response buffers are logged alongside other command parameters. config EC_HOST_CMD_LOG_SUPPRESSED_NUMBER diff --git a/subsys/mgmt/mcumgr/smp/Kconfig b/subsys/mgmt/mcumgr/smp/Kconfig index aab861fa9cf..b460067dd84 100644 --- a/subsys/mgmt/mcumgr/smp/Kconfig +++ b/subsys/mgmt/mcumgr/smp/Kconfig @@ -31,7 +31,7 @@ config MCUMGR_SMP_CBOR_MIN_DECODING_LEVELS help Minimal decoding levels, map/list encapsulation, required to be supported by zcbor decoding of SMP responses - is auto generated from MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_? options. + is auto genereated from MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_? options. A group or command that adds additional maps/lists above the base map, which is already taken into account, should select one of the MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_?. @@ -87,7 +87,7 @@ config MCUMGR_SMP_CBOR_MIN_ENCODING_LEVELS help Minimal encoding levels, map/list encapsulation, required to be supported by zcbor encoding of SMP responses - is auto generated from MCUMGR_SMP_CBOR_MIN_ENCODING_LEVEL_? options. + is auto genereated from MCUMGR_SMP_CBOR_MIN_ENCODING_LEVEL_? options. A group or command that adds additional maps/lists above the base map, which is already taken into account, should select one of the MCUMGR_SMP_CBOR_MIN_ENCODING_LEVEL_?. From 2d75c6e82299fb7ce886154a25e155ee183a5e26 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 151/881] Revert "[nrf fromtree] drivers: flash: nordic: nrf_mramc update" This reverts commit 142b7e6a6ba865e99abca1f326a302df7e5647c1. Signed-off-by: Jukka Rissanen --- drivers/flash/soc_flash_nrf_mramc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/flash/soc_flash_nrf_mramc.c b/drivers/flash/soc_flash_nrf_mramc.c index 7e3a88af2b2..716e7c0f250 100644 --- a/drivers/flash/soc_flash_nrf_mramc.c +++ b/drivers/flash/soc_flash_nrf_mramc.c @@ -10,7 +10,7 @@ #include #include #if defined(CONFIG_SOC_FLASH_NRF_MRAMC_FLUSH_CACHE) -#include +#include #endif LOG_MODULE_REGISTER(flash_nrf_mramc, CONFIG_FLASH_LOG_LEVEL); @@ -112,7 +112,13 @@ static int nrf_mramc_write(const struct device *dev, off_t offset, * and not number of bytes */ nrfx_mramc_words_write(addr, data, len / WRITE_BLOCK_SIZE); - +#if defined(CONFIG_SOC_FLASH_NRF_MRAMC_FLUSH_CACHE) + if (nrf_cache_enable_check(NRF_ICACHE)) { + while (nrf_cache_busy_check(NRF_ICACHE)) { + } + nrf_cache_invalidate(NRF_ICACHE); + } +#endif return 0; } @@ -138,7 +144,11 @@ static int nrf_mramc_erase(const struct device *dev, off_t offset, size_t size) */ nrfx_mramc_area_erase(addr, size / WRITE_BLOCK_SIZE); #if defined(CONFIG_SOC_FLASH_NRF_MRAMC_FLUSH_CACHE) - sys_cache_instr_invd_all(); + if (nrf_cache_enable_check(NRF_ICACHE)) { + while (nrf_cache_busy_check(NRF_ICACHE)) { + } + nrf_cache_invalidate(NRF_ICACHE); + } #endif return 0; } From de4faa6f97597805bcc4fbf023f0bbc7e40a8cf3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 152/881] Revert "[nrf fromtree] drivers: flash: nordic: fix nrf-mramc indentation" This reverts commit d1bf6d42716c9e662dd55393c842e83eb5d41f9f. Signed-off-by: Jukka Rissanen --- drivers/flash/soc_flash_nrf_mramc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/flash/soc_flash_nrf_mramc.c b/drivers/flash/soc_flash_nrf_mramc.c index 716e7c0f250..c08f8f32851 100644 --- a/drivers/flash/soc_flash_nrf_mramc.c +++ b/drivers/flash/soc_flash_nrf_mramc.c @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - -#include -#include -#include -#if defined(CONFIG_SOC_FLASH_NRF_MRAMC_FLUSH_CACHE) -#include -#endif + #include + + #include + #include + #include + #if defined(CONFIG_SOC_FLASH_NRF_MRAMC_FLUSH_CACHE) + #include + #endif LOG_MODULE_REGISTER(flash_nrf_mramc, CONFIG_FLASH_LOG_LEVEL); From 91a89294e28d3076f33d6806a57c2522a15937df Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 153/881] Revert "[nrf fromlist] boards: nordic: nrf54h20dk: Disable EXMIF and GPIO6 by default" This reverts commit 63febf7715f82807e3b70eb33b3365a7372412a8. Signed-off-by: Jukka Rissanen --- .../nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 4 ++-- .../jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 10 ---------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 10 ---------- .../common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 10 ---------- 4 files changed, 2 insertions(+), 32 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 0eb2fc235a5..85a2539c3ff 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -264,14 +264,14 @@ slot3_partition: &cpurad_slot1_partition { }; &gpio6 { - status = "disabled"; + status = "okay"; }; &exmif { pinctrl-0 = <&exmif_default>; pinctrl-1 = <&exmif_sleep>; pinctrl-names = "default", "sleep"; - status = "disabled"; + status = "okay"; mx25uw63: mx25uw6345g@0 { compatible = "mxicy,mx25u", "jedec,mspi-nor"; diff --git a/samples/drivers/jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 22c24c32f6d..b8f138ad2b2 100644 --- a/samples/drivers/jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/drivers/jesd216/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,16 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -&gpio6 { - status = "okay"; - zephyr,pm-device-runtime-auto; -}; - -&exmif { - status = "okay"; - zephyr,pm-device-runtime-auto; -}; - &mx25uw63 { status = "okay"; }; diff --git a/samples/drivers/spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 22c24c32f6d..b8f138ad2b2 100644 --- a/samples/drivers/spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/drivers/spi_flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,16 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -&gpio6 { - status = "okay"; - zephyr,pm-device-runtime-auto; -}; - -&exmif { - status = "okay"; - zephyr,pm-device-runtime-auto; -}; - &mx25uw63 { status = "okay"; }; diff --git a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 22c24c32f6d..b8f138ad2b2 100644 --- a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,16 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -&gpio6 { - status = "okay"; - zephyr,pm-device-runtime-auto; -}; - -&exmif { - status = "okay"; - zephyr,pm-device-runtime-auto; -}; - &mx25uw63 { status = "okay"; }; From 229f9be3392bea3ad2b232b1d22dff6f13da45da Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 154/881] Revert "[nrf fromlist] openthread: Use OPENTHREAD instead of L2_OPENTHREAD in dependencies" This reverts commit f39f7647e2526ffc081096e8b764693d620a93c9. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig.mbedtls | 2 +- subsys/logging/backends/Kconfig.spinel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 87ab5ed44e4..2d8f260b5d1 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -485,7 +485,7 @@ config MBEDTLS_ENTROPY_POLL_ZEPHYR config MBEDTLS_OPENTHREAD_OPTIMIZATIONS_ENABLED bool "MbedTLS optimizations for OpenThread" - depends on OPENTHREAD + depends on NET_L2_OPENTHREAD default y if !NET_SOCKETS_SOCKOPT_TLS help Enable some OpenThread specific mbedTLS optimizations that allows to diff --git a/subsys/logging/backends/Kconfig.spinel b/subsys/logging/backends/Kconfig.spinel index 94ed1f040a9..d2d29370aa3 100644 --- a/subsys/logging/backends/Kconfig.spinel +++ b/subsys/logging/backends/Kconfig.spinel @@ -4,7 +4,7 @@ config LOG_BACKEND_SPINEL bool "OpenThread dedicated Spinel protocol backend" depends on !LOG_BACKEND_UART - depends on OPENTHREAD + depends on NET_L2_OPENTHREAD help When enabled, backend will use OpenThread dedicated SPINEL protocol for logging. This protocol is byte oriented and wraps given messages into serial frames. From e03f0ef9179c476f9d83237912cf71c2ce0efe27 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 155/881] Revert "[nrf fromlist] drivers: spi: nrfx: release constlat mode on suspend" This reverts commit f1b32dd21614cb36651a29e6b37c795581839489. Signed-off-by: Jukka Rissanen --- drivers/spi/spi_nrfx_spim.c | 2 +- drivers/spi/spi_nrfx_spis.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index ef832713936..c8a0566b68a 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -806,7 +806,7 @@ static void spim_suspend(const struct device *dev) #if SPIM_CROSS_DOMAIN_PINS_HANDLE int err; - err = nrf_sys_event_release_global_constlat(); + err = nrf_sys_event_request_global_constlat(); (void)err; __ASSERT_NO_MSG(err >= 0); #else diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index 71256b84fc3..c6e551eafc3 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -451,7 +451,7 @@ static void spi_nrfx_suspend(const struct device *dev) #if SPIS_CROSS_DOMAIN_PINS_HANDLE int err; - err = nrf_sys_event_release_global_constlat(); + err = nrf_sys_event_request_global_constlat(); (void)err; __ASSERT_NO_MSG(err >= 0); #else From 4a8a3e655d1a58f59811f6f7d9f05c89cf603ce0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 156/881] Revert "[nrf fromlist] tests: drivers: counter_nrf_rtc: test fixed top on nRF52832" This reverts commit dcf7fbdde4ca060152ca71b820b9be3a02707ce2. Signed-off-by: Jukka Rissanen --- .../fixed_top/boards/nrf52dk_nrf52832.overlay | 8 -------- .../counter/counter_nrf_rtc/fixed_top/testcase.yaml | 1 - 2 files changed, 9 deletions(-) delete mode 100644 tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf52dk_nrf52832.overlay diff --git a/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf52dk_nrf52832.overlay b/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf52dk_nrf52832.overlay deleted file mode 100644 index ebfed9cf903..00000000000 --- a/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf52dk_nrf52832.overlay +++ /dev/null @@ -1,8 +0,0 @@ -&rtc0 { - status = "okay"; - fixed-top; -}; -&rtc2 { - status = "okay"; - fixed-top; -}; diff --git a/tests/drivers/counter/counter_nrf_rtc/fixed_top/testcase.yaml b/tests/drivers/counter/counter_nrf_rtc/fixed_top/testcase.yaml index 763c6896d07..38dda6dc88c 100644 --- a/tests/drivers/counter/counter_nrf_rtc/fixed_top/testcase.yaml +++ b/tests/drivers/counter/counter_nrf_rtc/fixed_top/testcase.yaml @@ -5,7 +5,6 @@ tests: - counter depends_on: counter platform_allow: - - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf52_bsim - nrf54h20dk/nrf54h20/cpuapp From 279c620a00efef63205055b91bffac0bbeea3678 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:03 +0300 Subject: [PATCH 157/881] Revert "[nrf fromlist] drivers: timer: nrf_rtc_timer: Allow use of custom bit width" This reverts commit a0459930f3cd7393326f35475a93aad9121d074d. Signed-off-by: Jukka Rissanen --- drivers/timer/Kconfig.nrf_rtc | 7 -- drivers/timer/nrf_rtc_timer.c | 77 ++------------------ include/zephyr/drivers/timer/nrf_rtc_timer.h | 2 +- tests/drivers/timer/nrf_rtc_timer/src/main.c | 11 +-- 4 files changed, 9 insertions(+), 88 deletions(-) diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index 82228d453ca..729dc8d362a 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -9,7 +9,6 @@ config NRF_RTC_TIMER depends on SOC_COMPATIBLE_NRF select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT - select NRFX_PPI if SOC_NRF52832 depends on !$(dt_nodelabel_enabled,rtc1) help This module implements a kernel device driver for the nRF Real Time @@ -43,10 +42,4 @@ config NRF_RTC_TIMER_TRIGGER_OVERFLOW When enabled, a function can be used to trigger RTC overflow and effectively shift time into the future. -config NRF_RTC_COUNTER_BIT_WIDTH - int - default 15 if SOC_NRF52832 - default 24 - range 15 24 - endif # NRF_RTC_TIMER diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index a70cc19b7e9..0fdf951f925 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -17,34 +17,23 @@ #include #include -#define RTC_BIT_WIDTH 24 - -#if (CONFIG_NRF_RTC_COUNTER_BIT_WIDTH < RTC_BIT_WIDTH) -#define CUSTOM_COUNTER_BIT_WIDTH 1 -#define WRAP_CH 1 -#include "nrfx_ppi.h" -#else -#define CUSTOM_COUNTER_BIT_WIDTH 0 -#endif - #define RTC_PRETICK (IS_ENABLED(CONFIG_SOC_NRF53_RTC_PRETICK) && \ IS_ENABLED(CONFIG_SOC_NRF5340_CPUNET)) #define EXT_CHAN_COUNT CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT -#define CHAN_COUNT (EXT_CHAN_COUNT + 1 + CUSTOM_COUNTER_BIT_WIDTH) +#define CHAN_COUNT (EXT_CHAN_COUNT + 1) #define RTC NRF_RTC1 #define RTC_IRQn NRFX_IRQ_NUMBER_GET(RTC) #define RTC_LABEL rtc1 #define CHAN_COUNT_MAX (RTC1_CC_NUM - (RTC_PRETICK ? 1 : 0)) -#define SYS_CLOCK_CH 0 BUILD_ASSERT(CHAN_COUNT <= CHAN_COUNT_MAX, "Not enough compare channels"); /* Ensure that counter driver for RTC1 is not enabled. */ BUILD_ASSERT(DT_NODE_HAS_STATUS(DT_NODELABEL(RTC_LABEL), disabled), "Counter for RTC1 must be disabled"); -#define COUNTER_BIT_WIDTH CONFIG_NRF_RTC_COUNTER_BIT_WIDTH +#define COUNTER_BIT_WIDTH 24U #define COUNTER_SPAN BIT(COUNTER_BIT_WIDTH) #define COUNTER_MAX (COUNTER_SPAN - 1U) #define COUNTER_HALF_SPAN (COUNTER_SPAN / 2U) @@ -150,7 +139,7 @@ uint32_t z_nrf_rtc_timer_capture_task_address_get(int32_t chan) { #if defined(RTC_TASKS_CAPTURE_TASKS_CAPTURE_Msk) __ASSERT_NO_MSG(chan >= 0 && chan < CHAN_COUNT); - if (chan == SYS_CLOCK_CH) { + if (chan == 0) { return 0; } @@ -275,15 +264,6 @@ static int set_alarm(int32_t chan, uint32_t req_cc, bool exact) */ enum { MIN_CYCLES_FROM_NOW = 3 }; uint32_t cc_val = req_cc; - -#if CUSTOM_COUNTER_BIT_WIDTH - /* If a CC value is 0 when a CLEAR task is set, this will not - * trigger a COMAPRE event. Need to use 1 instead. - */ - if (cc_val % COUNTER_MAX == 0) { - cc_val = 1; - } -#endif uint32_t cc_inc = MIN_CYCLES_FROM_NOW; /* Disable event routing for the channel to avoid getting a COMPARE @@ -447,17 +427,6 @@ uint64_t z_nrf_rtc_timer_read(void) uint32_t cntr = counter(); -#if CUSTOM_COUNTER_BIT_WIDTH - /* If counter is equal to it maximum value while val is greater - * than anchor, then we can assume that overflow has been recorded - * in the overflow_cnt, but clear task has not been triggered yet. - * Treat counter as if it has been cleared. - */ - if ((cntr == COUNTER_MAX) && (val > anchor)) { - cntr = 0; - } -#endif - val += cntr; if (cntr < OVERFLOW_RISK_RANGE_END) { @@ -596,13 +565,8 @@ void rtc_nrf_isr(const void *arg) rtc_pretick_rtc1_isr_hook(); } -#if CUSTOM_COUNTER_BIT_WIDTH - if (nrfy_rtc_int_enable_check(RTC, NRF_RTC_INT_COMPARE1_MASK) && - nrfy_rtc_events_process(RTC, NRF_RTC_INT_COMPARE1_MASK)) { -#else if (nrfy_rtc_int_enable_check(RTC, NRF_RTC_INT_OVERFLOW_MASK) && nrfy_rtc_events_process(RTC, NRF_RTC_INT_OVERFLOW_MASK)) { -#endif overflow_cnt++; } @@ -661,7 +625,7 @@ int z_nrf_rtc_timer_trigger_overflow(void) uint64_t now = z_nrf_rtc_timer_read(); if (err == 0) { - sys_clock_timeout_handler(SYS_CLOCK_CH, now, NULL); + sys_clock_timeout_handler(0, now, NULL); } bail: full_int_unlock(mcu_critical_state); @@ -718,7 +682,7 @@ void sys_clock_set_timeout(int32_t ticks, bool idle) uint64_t target_time = cyc + last_count; - compare_set(SYS_CLOCK_CH, target_time, sys_clock_timeout_handler, NULL, false); + compare_set(0, target_time, sys_clock_timeout_handler, NULL, false); } uint32_t sys_clock_elapsed(void) @@ -738,9 +702,7 @@ uint32_t sys_clock_cycle_get_32(void) static void int_event_disable_rtc(void) { uint32_t mask = NRF_RTC_INT_TICK_MASK | -#if !CUSTOM_COUNTER_BIT_WIDTH NRF_RTC_INT_OVERFLOW_MASK | -#endif NRF_RTC_INT_COMPARE0_MASK | NRF_RTC_INT_COMPARE1_MASK | NRF_RTC_INT_COMPARE2_MASK | @@ -772,9 +734,7 @@ static int sys_clock_driver_init(void) nrfy_rtc_int_enable(RTC, NRF_RTC_CHANNEL_INT_MASK(chan)); } -#if !CUSTOM_COUNTER_BIT_WIDTH nrfy_rtc_int_enable(RTC, NRF_RTC_INT_OVERFLOW_MASK); -#endif NVIC_ClearPendingIRQ(RTC_IRQn); @@ -787,13 +747,13 @@ static int sys_clock_driver_init(void) int_mask = BIT_MASK(CHAN_COUNT); if (CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT) { - alloc_mask = BIT_MASK(CHAN_COUNT) & ~BIT(SYS_CLOCK_CH); + alloc_mask = BIT_MASK(EXT_CHAN_COUNT) << 1; } uint32_t initial_timeout = IS_ENABLED(CONFIG_TICKLESS_KERNEL) ? MAX_CYCLES : CYC_PER_TICK; - compare_set(SYS_CLOCK_CH, initial_timeout, sys_clock_timeout_handler, NULL, false); + compare_set(0, initial_timeout, sys_clock_timeout_handler, NULL, false); #if defined(CONFIG_CLOCK_CONTROL_NRF) static const enum nrf_lfclk_start_mode mode = @@ -806,29 +766,6 @@ static int sys_clock_driver_init(void) z_nrf_clock_control_lf_on(mode); #endif -#if CUSTOM_COUNTER_BIT_WIDTH - /* WRAP_CH reserved for wrapping. */ - alloc_mask &= ~BIT(WRAP_CH); - - nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(WRAP_CH); - nrfx_err_t result; - nrf_ppi_channel_t ch; - - nrfy_rtc_event_enable(RTC, NRF_RTC_CHANNEL_INT_MASK(WRAP_CH)); - nrfy_rtc_cc_set(RTC, WRAP_CH, COUNTER_MAX); - uint32_t evt_addr; - uint32_t task_addr; - - evt_addr = nrfy_rtc_event_address_get(RTC, evt); - task_addr = nrfy_rtc_task_address_get(RTC, NRF_RTC_TASK_CLEAR); - - result = nrfx_ppi_channel_alloc(&ch); - if (result != NRFX_SUCCESS) { - return -ENODEV; - } - (void)nrfx_ppi_channel_assign(ch, evt_addr, task_addr); - (void)nrfx_ppi_channel_enable(ch); -#endif return 0; } diff --git a/include/zephyr/drivers/timer/nrf_rtc_timer.h b/include/zephyr/drivers/timer/nrf_rtc_timer.h index de1ad940cf5..57340098c23 100644 --- a/include/zephyr/drivers/timer/nrf_rtc_timer.h +++ b/include/zephyr/drivers/timer/nrf_rtc_timer.h @@ -15,7 +15,7 @@ extern "C" { /** @brief Maximum allowed time span that is considered to be in the future. */ -#define NRF_RTC_TIMER_MAX_SCHEDULE_SPAN BIT(CONFIG_NRF_RTC_COUNTER_BIT_WIDTH - 1) +#define NRF_RTC_TIMER_MAX_SCHEDULE_SPAN BIT(23) /** @brief RTC timer compare event handler. * diff --git a/tests/drivers/timer/nrf_rtc_timer/src/main.c b/tests/drivers/timer/nrf_rtc_timer/src/main.c index 00393c8587d..ebdb1c18a3f 100644 --- a/tests/drivers/timer/nrf_rtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_rtc_timer/src/main.c @@ -321,11 +321,7 @@ ZTEST(nrf_rtc_timer, test_resetting_cc) struct test_data test_data = { .target_time = now + 5, .window = 0, - /* For lower bit width, target_time may be equal to maximum counter value. - * In such case, due to PPI connection clearing the timer, counter value - * read in the handler may be slightly off the set counter value. - */ - .delay = (CONFIG_NRF_RTC_COUNTER_BIT_WIDTH < 24) ? 2 : 0, + .delay = 0, .err = -EINVAL }; @@ -365,11 +361,6 @@ static void overflow_sched_handler(int32_t id, uint64_t expire_time, */ ZTEST(nrf_rtc_timer, test_overflow) { - /* For bit width lower than default 24, overflow injection is not possible. */ - if (CONFIG_NRF_RTC_COUNTER_BIT_WIDTH < 24) { - ztest_test_skip(); - } - PRINT("RTC ticks before overflow injection: %u\r\n", (uint32_t)z_nrf_rtc_timer_read()); From 09643d75c8ec141d675bb6165d6b3b8f04db1525 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 158/881] Revert "[nrf fromlist] soc: nordic: uicr: Populate UICR.VERSION field in gen_uicr.py" This reverts commit 7d913ca2a706b2f2a49e8c9e8c80178cf2ef0539. Signed-off-by: Jukka Rissanen --- soc/nordic/common/uicr/gen_uicr.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 5888786e928..50f96eab566 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -17,10 +17,6 @@ from elftools.elf.elffile import ELFFile from intelhex import IntelHex -# The UICR format version produced by this script -UICR_FORMAT_VERSION_MAJOR = 2 -UICR_FORMAT_VERSION_MINOR = 0 - # Name of the ELF section containing PERIPHCONF entries. # Must match the name used in the linker script. PERIPHCONF_SECTION = "uicr_periphconf_entry" @@ -49,14 +45,6 @@ class PeriphconfEntry(c.LittleEndianStructure): PERIPHCONF_ENTRY_SIZE = c.sizeof(PeriphconfEntry) -class Version(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("MINOR", c.c_uint16), - ("MAJOR", c.c_uint16), - ] - - class Approtect(c.LittleEndianStructure): _pack_ = 1 _fields_ = [ @@ -116,7 +104,7 @@ class Mpcconf(c.LittleEndianStructure): class Uicr(c.LittleEndianStructure): _pack_ = 1 _fields_ = [ - ("VERSION", Version), + ("VERSION", c.c_uint32), ("RESERVED", c.c_uint32), ("LOCK", c.c_uint32), ("RESERVED1", c.c_uint32), @@ -183,9 +171,6 @@ def main() -> None: init_values = DISABLED_VALUE.to_bytes(4, "little") * (c.sizeof(Uicr) // 4) uicr = Uicr.from_buffer_copy(init_values) - uicr.VERSION.MAJOR = UICR_FORMAT_VERSION_MAJOR - uicr.VERSION.MINOR = UICR_FORMAT_VERSION_MINOR - kconfig_str = args.in_config.read() kconfig = parse_kconfig(kconfig_str) From 424aa28c458034db85422601cc403503e3992f02 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 159/881] Revert "[nrf fromtree] Bluetooth: Host: Use MTU min for l2cap test" This reverts commit 7de47337d2a38ff9e5221986072ce1e8c9f6aaaa. Signed-off-by: Jukka Rissanen --- tests/bsim/bluetooth/host/l2cap/many_conns/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bsim/bluetooth/host/l2cap/many_conns/src/main.c b/tests/bsim/bluetooth/host/l2cap/many_conns/src/main.c index a4f45bc1890..ff9f3030d1e 100644 --- a/tests/bsim/bluetooth/host/l2cap/many_conns/src/main.c +++ b/tests/bsim/bluetooth/host/l2cap/many_conns/src/main.c @@ -29,7 +29,7 @@ DEFINE_FLAG_STATIC(flag_l2cap_connected); #define NUM_PERIPHERALS CONFIG_BT_MAX_CONN #define L2CAP_CHANS NUM_PERIPHERALS #define SDU_NUM 1 -#define SDU_LEN 23 +#define SDU_LEN 10 /* Only one SDU per link will be transmitted */ NET_BUF_POOL_DEFINE(sdu_tx_pool, From e706bdfaf797aeb93a38c0af06218653f230b19a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 160/881] Revert "[nrf fromtree] Bluetooth: Host: Add conn rsp param check" This reverts commit 4c976e3ff28fceec1203f5a86cd5399675795f0a. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/l2cap.h | 14 ------- subsys/bluetooth/host/l2cap.c | 52 +++++--------------------- subsys/bluetooth/host/l2cap_internal.h | 3 -- 3 files changed, 9 insertions(+), 60 deletions(-) diff --git a/include/zephyr/bluetooth/l2cap.h b/include/zephyr/bluetooth/l2cap.h index 380b52ad508..f8781d791f0 100644 --- a/include/zephyr/bluetooth/l2cap.h +++ b/include/zephyr/bluetooth/l2cap.h @@ -111,20 +111,6 @@ extern "C" { */ #define BT_L2CAP_ECRED_MIN_MPS 64 -/** @brief L2CAP maximum MTU - * - * The maximum MTU for an L2CAP Based Connection. This is the same with or without ECRED. This - * requirement is taken from text in Core 3.A.4.22 and 3.A.4.26 v6.0. - */ -#define BT_L2CAP_MAX_MTU UINT16_MAX - -/** @brief L2CAP maximum MPS - * - * The maximum MPS for an L2CAP Based Connection. This is the same with or without ECRED. This - * requirement is taken from text in Core 3.A.4.22 and 3.A.4.26 v6.0. - */ -#define BT_L2CAP_MAX_MPS 65533 - /** @brief The maximum number of channels in ECRED L2CAP signaling PDUs * * Currently, this is the maximum number of channels referred to in the diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index caf5424717b..9ecdc72c0aa 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -1479,6 +1479,11 @@ static void le_conn_req(struct bt_l2cap *l2cap, uint8_t ident, LOG_DBG("psm 0x%02x scid 0x%04x mtu %u mps %u credits %u", psm, scid, mtu, mps, credits); + if (mtu < L2CAP_LE_MIN_MTU || mps < L2CAP_LE_MIN_MPS) { + LOG_ERR("Invalid LE-Conn Req params: mtu %u mps %u", mtu, mps); + return; + } + buf = l2cap_create_le_sig_pdu(BT_L2CAP_LE_CONN_RSP, ident, sizeof(*rsp)); if (!buf) { @@ -1488,16 +1493,6 @@ static void le_conn_req(struct bt_l2cap *l2cap, uint8_t ident, rsp = net_buf_add(buf, sizeof(*rsp)); (void)memset(rsp, 0, sizeof(*rsp)); - /* Validate parameters. Requirements are from Core Spec v6.0, Vol 3.A.4.22. Valid credit - * range is from 0 to UINT16_MAX, thus no credit validation is needed. - */ - if (!IN_RANGE(mtu, L2CAP_LE_MIN_MTU, BT_L2CAP_MAX_MTU) || - !IN_RANGE(mps, L2CAP_LE_MIN_MPS, BT_L2CAP_MAX_MPS)) { - LOG_ERR("Invalid le conn req params: mtu %u mps %u", mtu, mps); - result = BT_L2CAP_LE_ERR_UNACCEPT_PARAMS; - goto rsp; - } - /* Check if there is a server registered */ server = bt_l2cap_server_lookup_psm(psm); if (!server) { @@ -1583,12 +1578,8 @@ static void le_ecred_conn_req(struct bt_l2cap *l2cap, uint8_t ident, LOG_DBG("psm 0x%02x mtu %u mps %u credits %u", psm, mtu, mps, credits); - /* Validate parameters. Requirements are from Core Spec v6.0, Vol 3.A.4.25. */ - if (!IN_RANGE(mtu, BT_L2CAP_ECRED_MIN_MTU, BT_L2CAP_MAX_MTU) || - !IN_RANGE(mps, BT_L2CAP_ECRED_MIN_MPS, BT_L2CAP_MAX_MPS) || - !IN_RANGE(credits, BT_L2CAP_ECRED_CREDITS_MIN, BT_L2CAP_ECRED_CREDITS_MAX)) { - LOG_ERR("Invalid le ecred conn req params: mtu %u mps %u credits %u", mtu, mps, - credits); + if (mtu < BT_L2CAP_ECRED_MIN_MTU || mps < BT_L2CAP_ECRED_MIN_MPS) { + LOG_ERR("Invalid ecred conn req params. mtu %u mps %u", mtu, mps); result = BT_L2CAP_LE_ERR_INVALID_PARAMS; goto response; } @@ -1991,24 +1982,13 @@ static void le_ecred_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, LOG_DBG("dcid 0x%04x", dcid); - /* Validate parameters before assignment. Requirements are from Core Spec - * v6.0, Vol 3.A.4.26. If a Destination CID is 0x0000, the channel was not + /* If a Destination CID is 0x0000, the channel was not * established. */ - if (dcid == 0U) { + if (!dcid) { bt_l2cap_chan_remove(conn, &chan->chan); bt_l2cap_chan_del(&chan->chan); continue; - } else if (!L2CAP_LE_CID_IS_DYN(dcid) || - !IN_RANGE(mtu, BT_L2CAP_ECRED_MIN_MTU, BT_L2CAP_MAX_MTU) || - !IN_RANGE(mps, BT_L2CAP_ECRED_MIN_MPS, BT_L2CAP_MAX_MPS) || - !IN_RANGE(credits, BT_L2CAP_ECRED_CREDITS_MIN, - BT_L2CAP_ECRED_CREDITS_MAX)) { - LOG_WRN("Invalid ecred conn rsp params: dcid 0x%04x mtu %u mps %u " - "credits %u. Disconnecting.", - dcid, mtu, mps, credits); - bt_conn_disconnect(conn, BT_HCI_ERR_UNACCEPT_CONN_PARAM); - return; } c = bt_l2cap_le_lookup_tx_cid(conn, dcid); @@ -2106,20 +2086,6 @@ static void le_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident, switch (result) { case BT_L2CAP_LE_SUCCESS: - /* Validate parameters on successful connection. Requirements are from Core Spec - * v6.0, Vol 3.A.4.23. Valid credit range is from 0 to UINT16_MAX, thus no credit - * validation is needed. - */ - if ((!L2CAP_LE_CID_IS_DYN(dcid) || - !IN_RANGE(mtu, L2CAP_LE_MIN_MTU, BT_L2CAP_MAX_MTU) || - !IN_RANGE(mps, L2CAP_LE_MIN_MPS, BT_L2CAP_MAX_MPS))) { - LOG_WRN("Invalid conn rsp params: dcid 0x%04x mtu %u mps %u. " - "Disconnecting.", - dcid, mtu, mps); - bt_conn_disconnect(conn, BT_HCI_ERR_UNACCEPT_CONN_PARAM); - return; - } - chan->tx.cid = dcid; chan->tx.mtu = mtu; chan->tx.mps = mps; diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index 61fa7416dd5..07bd428334a 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -125,9 +125,6 @@ struct bt_l2cap_le_credits { uint16_t credits; } __packed; -#define BT_L2CAP_ECRED_CREDITS_MIN 1 -#define BT_L2CAP_ECRED_CREDITS_MAX UINT16_MAX - #define BT_L2CAP_ECRED_CONN_REQ 0x17 struct bt_l2cap_ecred_conn_req { uint16_t psm; From 1808570c297d7cc622aad8d59f85507f4bccf395 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 161/881] Revert "[nrf fromtree] Bluetooth: Host: Add l2cap credit param checks" This reverts commit b07b1bba4aec25dc602f00301a2a8ed72bc4b0de. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/l2cap.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 9ecdc72c0aa..ac3bd8eeb2b 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -2158,17 +2158,6 @@ static void le_credits(struct bt_l2cap *l2cap, uint8_t ident, cid = sys_le16_to_cpu(ev->cid); credits = sys_le16_to_cpu(ev->credits); - if (!L2CAP_LE_CID_IS_DYN(cid)) { - LOG_WRN("Can't add credits to non-dynamic channel %p (cid 0x%04x)", &l2cap->chan, - cid); - return; - } - - if (credits == 0U) { - LOG_WRN("Ignoring zero credit packet"); - return; - } - LOG_DBG("cid 0x%04x credits %u", cid, credits); chan = bt_l2cap_le_lookup_tx_cid(conn, cid); From cf4660817f2a1bb43ee8cc1ebb64f30dc060a4bd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 162/881] Revert "[nrf fromtree] Bluetooth: Host: l2cap: Fix MPS/MTU confusion" This reverts commit 01ec0ff5bd167631bc8078b88ac1767f9ac6d866. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/l2cap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index ac3bd8eeb2b..9fa5638d961 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -46,7 +46,6 @@ LOG_MODULE_REGISTER(bt_l2cap, CONFIG_BT_L2CAP_LOG_LEVEL); #define CHAN_RX(_w) CONTAINER_OF(_w, struct bt_l2cap_le_chan, rx_work) #define L2CAP_LE_MIN_MTU 23 -#define L2CAP_LE_MIN_MPS 23 #define L2CAP_LE_MAX_CREDITS (BT_BUF_ACL_RX_COUNT - 1) @@ -1479,7 +1478,7 @@ static void le_conn_req(struct bt_l2cap *l2cap, uint8_t ident, LOG_DBG("psm 0x%02x scid 0x%04x mtu %u mps %u credits %u", psm, scid, mtu, mps, credits); - if (mtu < L2CAP_LE_MIN_MTU || mps < L2CAP_LE_MIN_MPS) { + if (mtu < L2CAP_LE_MIN_MTU || mps < L2CAP_LE_MIN_MTU) { LOG_ERR("Invalid LE-Conn Req params: mtu %u mps %u", mtu, mps); return; } @@ -1578,7 +1577,7 @@ static void le_ecred_conn_req(struct bt_l2cap *l2cap, uint8_t ident, LOG_DBG("psm 0x%02x mtu %u mps %u credits %u", psm, mtu, mps, credits); - if (mtu < BT_L2CAP_ECRED_MIN_MTU || mps < BT_L2CAP_ECRED_MIN_MPS) { + if (mtu < BT_L2CAP_ECRED_MIN_MTU || mps < BT_L2CAP_ECRED_MIN_MTU) { LOG_ERR("Invalid ecred conn req params. mtu %u mps %u", mtu, mps); result = BT_L2CAP_LE_ERR_INVALID_PARAMS; goto response; @@ -1686,7 +1685,7 @@ static void le_ecred_reconf_req(struct bt_l2cap *l2cap, uint8_t ident, mtu = sys_le16_to_cpu(req->mtu); mps = sys_le16_to_cpu(req->mps); - if (mps < BT_L2CAP_ECRED_MIN_MPS) { + if (mps < BT_L2CAP_ECRED_MIN_MTU) { result = BT_L2CAP_RECONF_OTHER_UNACCEPT; goto response; } From 855ec14b331ad6aac066df78d5d77b3712edfbdd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 163/881] Revert "[nrf fromtree] bluetooth: host: gatt: fix null-ptr access if no include-svc userdata" This reverts commit 57d8acee344a9fcc77116a02cee99624a548bf9a. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/gatt.h | 1 - subsys/bluetooth/host/gatt.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 2c7d36a6758..3597c7c5fdb 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -918,7 +918,6 @@ ssize_t bt_gatt_attr_read_service(struct bt_conn *conn, * Read include service attribute value from local database storing the result * into buffer after encoding it. * @note Only use this with attributes which user_data is a ``bt_gatt_include``. - * The function returns EINVAL if @p attr or @p attr->user_data is NULL. * * @param conn Connection object. * @param attr Attribute to read. diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index be642fec9fe..3092801554a 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1917,10 +1917,6 @@ ssize_t bt_gatt_attr_read_included(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset) { - if ((attr == NULL) || (attr->user_data == NULL)) { - return -EINVAL; - } - struct bt_gatt_attr *incl = attr->user_data; uint16_t handle = bt_gatt_attr_get_handle(incl); struct bt_uuid *uuid = incl->user_data; From 280efecec79568f020c203aab4ec3562dbb5bce1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 164/881] Revert "[nrf fromtree] Bluetooth: Host: Fix SMP Pairing failed code on invalid Public Key" This reverts commit 8720fcc41232657f771b09ec1627b1bbc279d471. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index ff920fb0f3a..805b18f33c4 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -4499,7 +4499,7 @@ static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) } } else if (!bt_pub_key_is_valid(smp->pkey)) { LOG_WRN("Received invalid public key"); - return BT_SMP_ERR_DHKEY_CHECK_FAILED; + return BT_SMP_ERR_INVALID_PARAMS; } if (IS_ENABLED(CONFIG_BT_CENTRAL) && From 151635838998b733da06949a6f5fee3ab70752bc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 165/881] Revert "[nrf fromtree] Bluetooth: Host: Update LE legacy pairing check" This reverts commit 2c900ff71beb178c58b4d0f295e003bfbce94da8. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/smp.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 805b18f33c4..916bb661bb9 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -2555,35 +2555,22 @@ static uint8_t legacy_pairing_req(struct bt_smp *smp) static uint8_t legacy_pairing_random(struct bt_smp *smp) { struct bt_conn *conn = smp->chan.chan.conn; - uint8_t tmp[16], cfm_i[16]; + uint8_t tmp[16]; int err; LOG_DBG(""); - /* calculate LP_CONFIRM_R */ + /* calculate confirmation */ err = smp_c1(smp->tk, smp->rrnd, smp->preq, smp->prsp, &conn->le.init_addr, &conn->le.resp_addr, tmp); if (err) { return BT_SMP_ERR_UNSPECIFIED; } - /* calculate LP_CONFIRM_I */ - err = smp_c1(smp->tk, smp->prnd, smp->preq, smp->prsp, - &conn->le.init_addr, &conn->le.resp_addr, cfm_i); - if (err) { - return BT_SMP_ERR_UNSPECIFIED; - } - LOG_DBG("pcnf %s", bt_hex(smp->pcnf, 16)); - LOG_DBG("cfm (remote) %s", bt_hex(tmp, 16)); - LOG_DBG("cfm (local) %s", bt_hex(cfm_i, 16)); + LOG_DBG("cfm %s", bt_hex(tmp, 16)); - /* Core Specification, Vol 3, Part H, section 2.3.5.5 (Errata ES-24491): If the computed - * LP_CONFIRM_R value is not equal to the received LP_CONFIRM_R value, or the received - * LP_CONFIRM_R value is equal to the LP_CONFIRM_I value, fail pairing. - */ - if (memcmp(smp->pcnf, tmp, sizeof(smp->pcnf)) || - !memcmp(smp->pcnf, cfm_i, sizeof(smp->pcnf))) { + if (memcmp(smp->pcnf, tmp, sizeof(smp->pcnf))) { return BT_SMP_ERR_CONFIRM_FAILED; } From bbd98867a3e042bc5f5664e16332de650d7a1752 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 166/881] Revert "[nrf fromlist] drivers: nrf_wifi: Add check for minimum RX buffer size" This reverts commit 39a962774d40381bdd99f94f7efa14c102035434. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/fmac_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 125ffd7a9a1..f2d9aa55af9 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -79,8 +79,6 @@ BUILD_ASSERT(CONFIG_NRF70_TX_MAX_DATA_SIZE % 4 == 0, "TX buffer size must be a multiple of 4"); BUILD_ASSERT(CONFIG_NRF70_RX_MAX_DATA_SIZE % 4 == 0, "RX buffer size must be a multiple of 4"); -BUILD_ASSERT(CONFIG_NRF70_RX_MAX_DATA_SIZE >= 400, - "RX buffer size must be at least 400 bytes"); static const unsigned char aggregation = 1; static const unsigned char max_num_tx_agg_sessions = 4; From 14f4366725990d6cc0fb44db7e47a9e5a4c01f41 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 167/881] Revert "[nrf fromtree] net: l2: wifi: Fix the default keepalive value" This reverts commit 8277731e86e2d7bab82d1ac72c8419c583a7bf3b. Signed-off-by: Jukka Rissanen --- subsys/net/l2/wifi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/l2/wifi/Kconfig b/subsys/net/l2/wifi/Kconfig index 49d061c7439..7728678cc97 100644 --- a/subsys/net/l2/wifi/Kconfig +++ b/subsys/net/l2/wifi/Kconfig @@ -158,7 +158,7 @@ endif # WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE config WIFI_MGMT_BSS_MAX_IDLE_TIME int "BSS max idle timeout in seconds" range 0 64000 - default 300 + default 30 help As per 802.11-2020: 11.21.13 BSS max idle period management If dot11WirelessManagementImplemented is true, dot11BSSMaxIdlePeriod is From 8e1199c4dbfe5fa77640c7e929b6368d0cf1185f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 168/881] Revert "[nrf fromtree] net: l2: wifi: Configure BSS max idle period" This reverts commit 9c45c9847cf12b71026a1241dfc06bf52da3f1a9. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 1 - drivers/wifi/nrf_wifi/inc/wifi_mgmt.h | 3 -- drivers/wifi/nrf_wifi/src/fmac_main.c | 4 -- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 53 ------------------------- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 6 +-- include/zephyr/net/wifi_mgmt.h | 16 -------- modules/hostap/src/supp_api.c | 13 ------ modules/hostap/src/supp_api.h | 8 ---- modules/hostap/src/supp_main.c | 1 - subsys/net/l2/wifi/Kconfig | 16 -------- subsys/net/l2/wifi/wifi_mgmt.c | 25 ------------ subsys/net/l2/wifi/wifi_shell.c | 32 --------------- 12 files changed, 2 insertions(+), 176 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 7a863d8b614..c193515ae2d 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -91,7 +91,6 @@ struct nrf_wifi_vif_ctx_zep { struct k_work_delayable nrf_wifi_rpu_recovery_bringup_work; #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ int rts_threshold_value; - unsigned short bss_max_idle_period; }; struct nrf_wifi_vif_ctx_map { diff --git a/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h b/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h index 9b84427cdca..a4ae2030210 100644 --- a/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h +++ b/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h @@ -77,7 +77,4 @@ int nrf_wifi_set_rts_threshold(const struct device *dev, int nrf_wifi_get_rts_threshold(const struct device *dev, unsigned int *rts_threshold); - -int nrf_wifi_set_bss_max_idle_period(const struct device *dev, - unsigned short bss_max_idle_period); #endif /* __ZEPHYR_WIFI_MGMT_H__ */ diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index f2d9aa55af9..379c3242b18 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -858,9 +858,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) #endif /* CONFIG_NRF70_RADIO_TEST */ k_mutex_init(&rpu_drv_priv_zep.rpu_ctx_zep.rpu_lock); -#ifndef CONFIG_NRF70_RADIO_TEST - vif_ctx_zep->bss_max_idle_period = USHRT_MAX; -#endif /* !CONFIG_NRF70_RADIO_TEST */ return 0; #ifdef CONFIG_NRF70_RADIO_TEST fmac_deinit: @@ -888,7 +885,6 @@ static const struct wifi_mgmt_ops nrf_wifi_mgmt_ops = { .get_power_save_config = nrf_wifi_get_power_save_config, .set_rts_threshold = nrf_wifi_set_rts_threshold, .get_rts_threshold = nrf_wifi_get_rts_threshold, - .set_bss_max_idle_period = nrf_wifi_set_bss_max_idle_period, #endif #ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES .mode = nrf_wifi_mode, diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index e9755e80013..a323faf21dd 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -1077,56 +1077,3 @@ int nrf_wifi_get_rts_threshold(const struct device *dev, return ret; } - -int nrf_wifi_set_bss_max_idle_period(const struct device *dev, - unsigned short bss_max_idle_period) -{ - struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - int ret = -1; - - if (!dev) { - LOG_ERR("%s: dev is NULL", __func__); - return ret; - } - - vif_ctx_zep = dev->data; - - if (!vif_ctx_zep) { - LOG_ERR("%s: vif_ctx_zep is NULL", __func__); - return ret; - } - - rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - - if (!rpu_ctx_zep) { - LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); - return ret; - } - - - if (!rpu_ctx_zep->rpu_ctx) { - LOG_ERR("%s: RPU context not initialized", __func__); - return ret; - } - - if (((int)bss_max_idle_period < 0) || - (bss_max_idle_period > 64000)) { - /* 0 or value less than 64000 is passed to f/w. - * All other values considered as invalid. - */ - LOG_ERR("%s: Invalid max_idle_period value : %d", - __func__, (int)bss_max_idle_period); - return ret; - } - - k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); - - vif_ctx_zep->bss_max_idle_period = bss_max_idle_period; - - ret = 0; - - k_mutex_unlock(&vif_ctx_zep->vif_lock); - - return ret; -} diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 21f7600ca80..34af00e6d38 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -931,10 +931,8 @@ int nrf_wifi_wpa_supp_associate(void *if_priv, struct wpa_driver_associate_param assoc_info.use_mfp = NRF_WIFI_MFP_REQUIRED; } - if (vif_ctx_zep->bss_max_idle_period == USHRT_MAX) { - assoc_info.bss_max_idle_time = CONFIG_WIFI_MGMT_BSS_MAX_IDLE_TIME; - } else { - assoc_info.bss_max_idle_time = vif_ctx_zep->bss_max_idle_period; + if (params->bss_max_idle_period) { + assoc_info.bss_max_idle_time = params->bss_max_idle_period; } assoc_info.conn_type = NRF_WIFI_CONN_TYPE_OPEN; diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 4232a88d955..2c895afb36d 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -133,8 +133,6 @@ enum net_request_wifi_cmd { NET_REQUEST_WIFI_CMD_CANDIDATE_SCAN, /** AP WPS config */ NET_REQUEST_WIFI_CMD_AP_WPS_CONFIG, - /** Configure BSS maximum idle period */ - NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD, /** @cond INTERNAL_HIDDEN */ NET_REQUEST_WIFI_CMD_MAX /** @endcond */ @@ -319,11 +317,6 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_START_ROAMING); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_NEIGHBOR_REP_COMPLETE); -#define NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD \ - (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD) - -NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD); - /** @cond INTERNAL_HIDDEN */ enum { @@ -1595,15 +1588,6 @@ struct wifi_mgmt_ops { * @return 0 if ok, < 0 if error */ int (*start_11r_roaming)(const struct device *dev); - /** Set BSS max idle period - * - * @param dev Pointer to the device structure for the driver instance. - * @param BSS max idle period value - * - * @return 0 if ok, < 0 if error - */ - int (*set_bss_max_idle_period)(const struct device *dev, - unsigned short bss_max_idle_period); }; /** Wi-Fi management offload API */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 3679808b3d4..cde1ef95f47 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -1811,19 +1811,6 @@ int supplicant_legacy_roam(const struct device *dev) return ret; } -int supplicant_set_bss_max_idle_period(const struct device *dev, - unsigned short bss_max_idle_period) -{ - const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_mgmt_api(dev); - - if (!wifi_mgmt_api || !wifi_mgmt_api->set_bss_max_idle_period) { - wpa_printf(MSG_ERROR, "set_bss_max_idle_period is not supported"); - return -ENOTSUP; - } - - return wifi_mgmt_api->set_bss_max_idle_period(dev, bss_max_idle_period); -} - #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM int supplicant_btm_query(const struct device *dev, uint8_t reason) { diff --git a/modules/hostap/src/supp_api.h b/modules/hostap/src/supp_api.h index 9d2b90b50fe..ddd3c3d6698 100644 --- a/modules/hostap/src/supp_api.h +++ b/modules/hostap/src/supp_api.h @@ -305,14 +305,6 @@ int supplicant_get_wifi_conn_params(const struct device *dev, */ int supplicant_wps_config(const struct device *dev, struct wifi_wps_config_params *params); -/** @ Set Wi-Fi max idle period - * - * @param dev Wi-Fi interface handle to use - * @param bss_max_idle_period Maximum idle period to set - * @return 0 for OK; -1 for ERROR - */ -int supplicant_set_bss_max_idle_period(const struct device *dev, - unsigned short bss_max_idle_period); #ifdef CONFIG_AP int set_ap_bandwidth(const struct device *dev, enum wifi_frequency_bandwidths bandwidth); diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index 9336cb2bf74..4549ab3160d 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -83,7 +83,6 @@ static const struct wifi_mgmt_ops mgmt_ops = { #endif .get_conn_params = supplicant_get_wifi_conn_params, .wps_config = supplicant_wps_config, - .set_bss_max_idle_period = supplicant_set_bss_max_idle_period, #ifdef CONFIG_AP .ap_enable = supplicant_ap_enable, .ap_disable = supplicant_ap_disable, diff --git a/subsys/net/l2/wifi/Kconfig b/subsys/net/l2/wifi/Kconfig index 7728678cc97..4b1d309066c 100644 --- a/subsys/net/l2/wifi/Kconfig +++ b/subsys/net/l2/wifi/Kconfig @@ -154,19 +154,3 @@ config HEAP_MEM_POOL_ADD_SIZE_WIFI_CERT endif # WIFI_SHELL_RUNTIME_CERTIFICATES endif # WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - -config WIFI_MGMT_BSS_MAX_IDLE_TIME - int "BSS max idle timeout in seconds" - range 0 64000 - default 30 - help - As per 802.11-2020: 11.21.13 BSS max idle period management - If dot11WirelessManagementImplemented is true, dot11BSSMaxIdlePeriod is - nonzero and dot11BSSMaxIdlePeriodIndicationByNonAPSTA is true, then a - non-S1G non-AP STA shall include a BSS Max Idle Period element - in the (Re)Association Request frame. If the BSS Max Idle Period - element is present in the (Re)Association Request frame received - by a non-S1G AP that has dot11BSSMaxIdlePeriodIndicationByNonAPSTA - equal to true, then the non-S1G AP may choose the non-AP STA’s - preferred maximum idle period. The non-S1G AP indicates its chosen - value to the non-S1G STA in the (Re)Association Response frame. diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index f16f2581374..0183faab1d5 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -1403,31 +1403,6 @@ static int wifi_set_enterprise_creds(uint64_t mgmt_request, struct net_if *iface NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_ENTERPRISE_CREDS, wifi_set_enterprise_creds); #endif -static int wifi_set_bss_max_idle_period(uint64_t mgmt_request, struct net_if *iface, - void *data, size_t len) -{ - const struct device *dev = net_if_get_device(iface); - const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_api(iface); - unsigned short *bss_max_idle_period = data; - - if (wifi_mgmt_api == NULL || wifi_mgmt_api->set_bss_max_idle_period == NULL) { - return -ENOTSUP; - } - - if (!net_if_is_admin_up(iface)) { - return -ENETDOWN; - } - - if (!data || len != sizeof(*bss_max_idle_period)) { - return -EINVAL; - } - - return wifi_mgmt_api->set_bss_max_idle_period(dev, *bss_max_idle_period); -} - -NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD, - wifi_set_bss_max_idle_period); - #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS void wifi_mgmt_raise_raw_scan_result_event(struct net_if *iface, struct wifi_raw_scan_result *raw_scan_result) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index b23d407da64..8a5468ba81b 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3455,32 +3455,6 @@ static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[ return 0; } - -static int cmd_wifi_set_bss_max_idle_period(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - unsigned short bss_max_idle_period = 0; - int idx = 1; - unsigned long val = 0; - - if (!parse_number(sh, &val, argv[idx++], "bss_max_idle_period", 0, USHRT_MAX)) { - return -EINVAL; - } - - bss_max_idle_period = (unsigned short)val; - - if (net_mgmt(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD, iface, - &bss_max_idle_period, sizeof(bss_max_idle_period))) { - shell_fprintf(sh, SHELL_WARNING, - "Setting BSS maximum idle period failed.\n"); - return -ENOEXEC; - } - - shell_fprintf(sh, SHELL_NORMAL, "BSS max idle period: %hu\n", bss_max_idle_period); - - return 0; -} - SHELL_STATIC_SUBCMD_SET_CREATE( wifi_cmd_ap, SHELL_CMD_ARG(disable, NULL, "Disable Access Point mode.\n" @@ -3956,12 +3930,6 @@ SHELL_SUBCMD_ADD((wifi), ps_exit_strategy, NULL, cmd_wifi_ps_exit_strategy, 2, 2); -SHELL_SUBCMD_ADD((wifi), bss_max_idle_period, NULL, - ".\n" - "[-i, --iface=] : Interface index.\n", - cmd_wifi_set_bss_max_idle_period, - 2, 2); - SHELL_CMD_REGISTER(wifi, &wifi_commands, "Wi-Fi commands", NULL); static int wifi_shell_init(void) From f5ffe74b29a90c3597b2f9aa1246b33636d952ef Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 169/881] Revert "[nrf fromtree] net: events: Add missing net_mgmt.h include" This reverts commit 2cf4a21ae0008f40c499943e9ba7ec794ab0385b. Signed-off-by: Jukka Rissanen --- include/zephyr/net/net_event.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/zephyr/net/net_event.h b/include/zephyr/net/net_event.h index 556a78ae99e..3a948ca5ef9 100644 --- a/include/zephyr/net/net_event.h +++ b/include/zephyr/net/net_event.h @@ -13,7 +13,6 @@ #define ZEPHYR_INCLUDE_NET_NET_EVENT_H_ #include -#include #include #ifdef __cplusplus From 9bc8fb31415f7b3a841ebe0a222c91060334de86 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 170/881] Revert "[nrf fromtree] net: ppp: stats: Fix net_mgmt request handler format" This reverts commit 22479b9c1f1d4915b4adc2bec36021f2e86f7c9b. Signed-off-by: Jukka Rissanen --- subsys/net/l2/ppp/ppp_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/l2/ppp/ppp_stats.c b/subsys/net/l2/ppp/ppp_stats.c index ee831b3953d..9dafef154b3 100644 --- a/subsys/net/l2/ppp/ppp_stats.c +++ b/subsys/net/l2/ppp/ppp_stats.c @@ -17,7 +17,7 @@ LOG_MODULE_REGISTER(net_ppp_stats, CONFIG_NET_L2_PPP_LOG_LEVEL); #if defined(CONFIG_NET_STATISTICS_USER_API) -static int ppp_stats_get(uint64_t mgmt_request, struct net_if *iface, +static int ppp_stats_get(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { size_t len_chk = 0; From 2aad548ddd473d304bd7bcaaa98c7f46166b963a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 171/881] Revert "[nrf fromtree] net: mgmt: Increment API major version number" This reverts commit f5093d3789c7b9fd38ab1c17d62a74854c5d70c6. Signed-off-by: Jukka Rissanen --- include/zephyr/net/net_mgmt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/net/net_mgmt.h b/include/zephyr/net/net_mgmt.h index 1c5f0aebeaa..9c559b7fd8b 100644 --- a/include/zephyr/net/net_mgmt.h +++ b/include/zephyr/net/net_mgmt.h @@ -24,7 +24,7 @@ extern "C" { * @brief Network Management * @defgroup net_mgmt Network Management * @since 1.7 - * @version 2.0.0 + * @version 1.0.0 * @ingroup networking * @{ */ From 213e60376afd300737e1f394e6310f376fcb16b7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 172/881] Revert "[nrf fromtree] doc: migration: 4.2: Add information about net_mgmt API changes" This reverts commit 2b89705e9b89a5779bcdccfe853d2c0d08074a16. Signed-off-by: Jukka Rissanen --- doc/releases/migration-guide-4.2.rst | 15 --------------- doc/releases/release-notes-4.2.rst | 7 ------- 2 files changed, 22 deletions(-) diff --git a/doc/releases/migration-guide-4.2.rst b/doc/releases/migration-guide-4.2.rst index 9b31f4a1634..08a2a3d0e33 100644 --- a/doc/releases/migration-guide-4.2.rst +++ b/doc/releases/migration-guide-4.2.rst @@ -509,21 +509,6 @@ Networking need to update their response callback implementations. To retain current behavior, simply return 0 from the callback. -* The API signature of ``net_mgmt`` event handler :c:type:`net_mgmt_event_handler_t` and - request handler :c:type:`net_mgmt_request_handler_t` has changed. The management event - type is changed from ``uint32_t`` to ``uint64_t``. The change allows event number values - to be bit masks instead of enum values. The layer code still stays as a enum value. - The :c:macro:`NET_MGMT_LAYER_CODE` and :c:macro:`NET_MGMT_GET_COMMAND` can be used to get - the layer code and management event command from the actual event value in the request or - event handlers if needed. - -* The socket options for ``net_mgmt`` type sockets cannot directly be network management - event types as those are now ``uint64_t`` and the socket option expects a normal 32 bit - integer value. Because of this, a new ``SO_NET_MGMT_ETHERNET_SET_QAV_PARAM`` - and ``SO_NET_MGMT_ETHERNET_GET_QAV_PARAM`` socket options are created that will replace - the previously used ``NET_REQUEST_ETHERNET_GET_QAV_PARAM`` and - ``NET_REQUEST_ETHERNET_GET_QAV_PARAM`` options. - OpenThread ========== diff --git a/doc/releases/release-notes-4.2.rst b/doc/releases/release-notes-4.2.rst index 80e0f5868de..00c65556880 100644 --- a/doc/releases/release-notes-4.2.rst +++ b/doc/releases/release-notes-4.2.rst @@ -111,13 +111,6 @@ Deprecated APIs and options was deprecated since Zephyr 4.0, and users were advised to migrate to alternative crypto backends. -Stable API changes in this release -================================== - -* The API signature of ``net_mgmt`` event handler :c:type:`net_mgmt_event_handler_t` - and request handler :c:type:`net_mgmt_request_handler_t` has changed. The event value - type is changed from ``uint32_t`` to ``uint64_t``. - New APIs and options ==================== From 352e7988e804aa763938e4a3297006b975f91d87 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:04 +0300 Subject: [PATCH 173/881] Revert "[nrf fromtree] net: socket: mgmt: Create proper socket options for net_mgmt sockets" This reverts commit 664e66c32f9ff1dc86a0fed3fea82b55cce36bfa. Signed-off-by: Jukka Rissanen --- include/zephyr/net/socket_net_mgmt.h | 13 ------------- subsys/net/lib/sockets/sockets_net_mgmt.c | 4 ++-- tests/net/socket/net_mgmt/src/main.c | 21 ++++----------------- 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/include/zephyr/net/socket_net_mgmt.h b/include/zephyr/net/socket_net_mgmt.h index 595a92bbad9..337648d5d18 100644 --- a/include/zephyr/net/socket_net_mgmt.h +++ b/include/zephyr/net/socket_net_mgmt.h @@ -42,19 +42,6 @@ extern "C" { /** @endcond */ -/** - * @name Socket options for NET_MGMT sockets - * @{ - */ - -/** Set Ethernet Qav parameters */ -#define SO_NET_MGMT_ETHERNET_SET_QAV_PARAM 1 - -/** Get Ethernet Qav parameters */ -#define SO_NET_MGMT_ETHERNET_GET_QAV_PARAM 2 - -/** @} */ /* for @name */ - /** * struct sockaddr_nm - The sockaddr structure for NET_MGMT sockets * diff --git a/subsys/net/lib/sockets/sockets_net_mgmt.c b/subsys/net/lib/sockets/sockets_net_mgmt.c index dcb4194ec85..0b45416c1f2 100644 --- a/subsys/net/lib/sockets/sockets_net_mgmt.c +++ b/subsys/net/lib/sockets/sockets_net_mgmt.c @@ -237,7 +237,7 @@ static int znet_mgmt_getsockopt(struct net_mgmt_socket *mgmt, int level, } if (IS_ENABLED(CONFIG_NET_L2_ETHERNET_MGMT)) { - if (optname == SO_NET_MGMT_ETHERNET_GET_QAV_PARAM) { + if (optname == NET_REQUEST_ETHERNET_GET_QAV_PARAM) { int ret; ret = net_mgmt(NET_REQUEST_ETHERNET_GET_QAV_PARAM, @@ -274,7 +274,7 @@ static int znet_mgmt_setsockopt(struct net_mgmt_socket *mgmt, int level, } if (IS_ENABLED(CONFIG_NET_L2_ETHERNET_MGMT)) { - if (optname == SO_NET_MGMT_ETHERNET_SET_QAV_PARAM) { + if (optname == NET_REQUEST_ETHERNET_SET_QAV_PARAM) { int ret; ret = net_mgmt(NET_REQUEST_ETHERNET_SET_QAV_PARAM, diff --git a/tests/net/socket/net_mgmt/src/main.c b/tests/net/socket/net_mgmt/src/main.c index 89901beda7b..a5d6ead4679 100644 --- a/tests/net/socket/net_mgmt/src/main.c +++ b/tests/net/socket/net_mgmt/src/main.c @@ -20,19 +20,6 @@ LOG_MODULE_REGISTER(net_test, CONFIG_NET_SOCKETS_LOG_LEVEL); #define STACK_SIZE 1024 #define THREAD_PRIORITY K_PRIO_COOP(8) -/* Use a base value for socket options that are not implemented. - * This is used to check if the socket option is implemented or not. - */ -#define NOT_IMPLEMENTED_SOCKET_OPTION_BASE (INT32_MAX - 1000) - -#if !defined(SO_NET_MGMT_ETHERNET_GET_PRIORITY_QUEUES_NUM) -#define SO_NET_MGMT_ETHERNET_GET_PRIORITY_QUEUES_NUM (NOT_IMPLEMENTED_SOCKET_OPTION_BASE + 1) -#endif /* !defined(SO_NET_MGMT_ETHERNET_GET_PRIORITY_QUEUES_NUM) */ - -#if !defined(SO_NET_MGMT_ETHERNET_SET_MAC_ADDRESS) -#define SO_NET_MGMT_ETHERNET_SET_MAC_ADDRESS (NOT_IMPLEMENTED_SOCKET_OPTION_BASE + 2) -#endif /* !defined(SO_NET_MGMT_ETHERNET_SET_MAC_ADDRESS) */ - static struct net_if *default_iface; static ZTEST_BMEM int fd; @@ -515,7 +502,7 @@ static void test_ethernet_set_qav(void) params.qav_param.enabled = true; ret = zsock_setsockopt(fd, SOL_NET_MGMT_RAW, - SO_NET_MGMT_ETHERNET_SET_QAV_PARAM, + NET_REQUEST_ETHERNET_SET_QAV_PARAM, ¶ms, sizeof(params)); zassert_equal(ret, 0, "Cannot set Qav parameters"); } @@ -542,7 +529,7 @@ static void test_ethernet_get_qav(void) params.qav_param.type = ETHERNET_QAV_PARAM_TYPE_STATUS; ret = zsock_getsockopt(fd, SOL_NET_MGMT_RAW, - SO_NET_MGMT_ETHERNET_GET_QAV_PARAM, + NET_REQUEST_ETHERNET_GET_QAV_PARAM, ¶ms, &optlen); zassert_equal(ret, 0, "Cannot get Qav parameters (%d)", ret); zassert_equal(optlen, sizeof(params), "Invalid optlen (%d)", optlen); @@ -569,7 +556,7 @@ static void test_ethernet_get_unknown_option(void) memset(¶ms, 0, sizeof(params)); ret = zsock_getsockopt(fd, SOL_NET_MGMT_RAW, - SO_NET_MGMT_ETHERNET_GET_PRIORITY_QUEUES_NUM, + NET_REQUEST_ETHERNET_GET_PRIORITY_QUEUES_NUM, ¶ms, &optlen); zassert_equal(ret, -1, "Could get prio queue parameters (%d)", errno); zassert_equal(errno, EINVAL, "prio queue get parameters"); @@ -594,7 +581,7 @@ static void test_ethernet_set_unknown_option(void) memset(¶ms, 0, sizeof(params)); ret = zsock_setsockopt(fd, SOL_NET_MGMT_RAW, - SO_NET_MGMT_ETHERNET_SET_MAC_ADDRESS, + NET_REQUEST_ETHERNET_SET_MAC_ADDRESS, ¶ms, optlen); zassert_equal(ret, -1, "Could set promisc_mode parameters (%d)", errno); zassert_equal(errno, EINVAL, "promisc_mode set parameters"); From e80acad37a7639d3cfbeef6155475e35657310bd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 174/881] Revert "[nrf fromtree] net: mgmt: Convert the mgmt API to use 64-bit masks" This reverts commit 8b3dda735e1b57360d80423698f4897c7a790c8b. Signed-off-by: Jukka Rissanen --- .../networking/api/coap_server.rst | 2 +- doc/connectivity/networking/api/net_mgmt.rst | 6 +- drivers/modem/modem_cellular.c | 2 +- drivers/wifi/esp32/src/esp_wifi_drv.c | 2 +- include/zephyr/net/coap_mgmt.h | 20 +- include/zephyr/net/conn_mgr_connectivity.h | 14 +- include/zephyr/net/ethernet_mgmt.h | 20 +- include/zephyr/net/ieee802154_mgmt.h | 11 +- include/zephyr/net/net_event.h | 245 ++++++------------ include/zephyr/net/net_mgmt.h | 85 +++--- include/zephyr/net/ppp.h | 20 +- include/zephyr/net/socket_net_mgmt.h | 2 +- include/zephyr/net/wifi_mgmt.h | 63 ++--- modules/hostap/src/supp_events.h | 27 +- modules/hostap/src/supp_main.c | 4 +- samples/boards/nxp/s32/netc/src/main.c | 2 +- samples/net/capture/src/main.c | 4 +- samples/net/cloud/mqtt_azure/src/main.c | 2 +- samples/net/cloud/tagoio_http_post/src/wifi.c | 2 +- samples/net/common/net_sample_common.c | 2 +- samples/net/dhcpv4_client/src/main.c | 2 +- samples/net/dns_resolve/src/main.c | 2 +- samples/net/dsa/src/main.c | 2 +- samples/net/ipv4_autoconf/src/main.c | 2 +- samples/net/lwm2m_client/src/lwm2m-client.c | 4 +- samples/net/mqtt_sn_publisher/src/main.c | 2 +- .../secure_mqtt_sensor_actuator/src/main.c | 2 +- samples/net/sockets/coap_download/src/main.c | 2 +- samples/net/sockets/coap_server/src/events.c | 2 +- .../sockets/dumb_http_server_mt/src/main.c | 2 +- .../net/sockets/echo_client/src/echo-client.c | 4 +- .../net/sockets/echo_server/src/echo-server.c | 2 +- samples/net/sockets/packet/src/packet.c | 2 +- samples/net/sockets/txtime/src/main.c | 2 +- samples/net/wifi/apsta_mode/src/main.c | 2 +- samples/subsys/mgmt/updatehub/src/main.c | 2 +- subsys/logging/backends/log_backend_net.c | 2 +- subsys/mgmt/mcumgr/transport/src/smp_udp.c | 2 +- subsys/net/conn_mgr/conn_mgr_connectivity.c | 4 +- subsys/net/conn_mgr/events_handler.c | 16 +- subsys/net/ip/ipv4_autoconf.c | 2 +- subsys/net/ip/ipv6_pe.c | 2 +- subsys/net/ip/net_mgmt.c | 36 +-- subsys/net/ip/net_stats.c | 2 +- subsys/net/ip/pmtu.c | 1 + subsys/net/l2/ethernet/arp.c | 4 +- subsys/net/l2/ethernet/ethernet_mgmt.c | 4 +- subsys/net/l2/ethernet/ethernet_stats.c | 2 +- subsys/net/l2/ethernet/lldp/lldp.c | 4 +- subsys/net/l2/ieee802154/ieee802154_mgmt.c | 18 +- subsys/net/l2/ieee802154/ieee802154_shell.c | 4 +- subsys/net/l2/openthread/openthread.c | 2 +- subsys/net/l2/ppp/ppp_l2.c | 2 +- subsys/net/l2/virtual/virtual_mgmt.c | 4 +- subsys/net/l2/wifi/wifi_mgmt.c | 66 ++--- subsys/net/l2/wifi/wifi_shell.c | 4 +- subsys/net/lib/coap/coap.c | 2 +- subsys/net/lib/coap/coap_server.c | 2 +- subsys/net/lib/config/init.c | 26 +- subsys/net/lib/config/init_clock_sntp.c | 2 +- subsys/net/lib/dhcpv4/dhcpv4.c | 4 +- subsys/net/lib/dhcpv6/dhcpv6.c | 2 +- subsys/net/lib/dns/llmnr_responder.c | 2 +- subsys/net/lib/dns/mdns_responder.c | 8 +- subsys/net/lib/ptp/port.c | 2 +- subsys/net/lib/shell/events.c | 6 +- subsys/net/lib/sockets/sockets_net_mgmt.c | 4 +- subsys/shell/backends/shell_mqtt.c | 2 +- tests/boards/espressif/ethernet/src/main.c | 2 +- tests/boards/espressif/wifi/src/main.c | 2 +- tests/net/conn_mgr_conn/src/main.c | 2 +- tests/net/conn_mgr_monitor/src/main.c | 18 +- tests/net/conn_mgr_nsos/src/main.c | 2 +- tests/net/dhcpv4/client/prj.conf | 3 - tests/net/dhcpv4/client/src/main.c | 4 +- tests/net/dhcpv6/src/main.c | 2 +- tests/net/hostname/src/main.c | 2 +- .../ieee802154/l2/src/ieee802154_shell_test.c | 2 +- tests/net/igmp/src/main.c | 6 +- tests/net/lib/dns_addremove/src/main.c | 2 +- tests/net/mgmt/src/mgmt.c | 43 ++- tests/net/mld/src/main.c | 6 +- tests/net/pmtu/src/main.c | 6 +- 83 files changed, 370 insertions(+), 546 deletions(-) diff --git a/doc/connectivity/networking/api/coap_server.rst b/doc/connectivity/networking/api/coap_server.rst index 91ae5ecde47..a2d0d1b77c1 100644 --- a/doc/connectivity/networking/api/coap_server.rst +++ b/doc/connectivity/networking/api/coap_server.rst @@ -243,7 +243,7 @@ following example simply prints when an event occurs. #define COAP_EVENTS_SET (NET_EVENT_COAP_OBSERVER_ADDED | NET_EVENT_COAP_OBSERVER_REMOVED | \ NET_EVENT_COAP_SERVICE_STARTED | NET_EVENT_COAP_SERVICE_STOPPED) - void coap_event_handler(uint64_t mgmt_event, struct net_if *iface, + void coap_event_handler(uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data) { switch (mgmt_event) { diff --git a/doc/connectivity/networking/api/net_mgmt.rst b/doc/connectivity/networking/api/net_mgmt.rst index 7c47a63eee2..2973ee82b04 100644 --- a/doc/connectivity/networking/api/net_mgmt.rst +++ b/doc/connectivity/networking/api/net_mgmt.rst @@ -97,7 +97,7 @@ An example follows. struct net_mgmt_event_callback ipv4_callback; void callback_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_IF_xxx) { @@ -139,7 +139,7 @@ Or similarly using :c:macro:`NET_MGMT_REGISTER_EVENT_HANDLER`. #define EVENT_IFACE_SET (NET_EVENT_IF_xxx | NET_EVENT_IF_yyy) #define EVENT_IPV4_SET (NET_EVENT_IPV4_xxx | NET_EVENT_IPV4_yyy) - static void event_handler(uint64_t mgmt_event, struct net_if *iface, + static void event_handler(uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data) { @@ -183,7 +183,7 @@ You define your handler modeled with this signature: .. code-block:: c - static int your_handler(uint64_t mgmt_event, struct net_if *iface, + static int your_handler(uint32_t mgmt_event, struct net_if *iface, void *data, size_t len); and then register it with an associated mgmt_request code: diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 8eb87fd3608..1c00525b7d8 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -1774,7 +1774,7 @@ static int modem_cellular_pm_action(const struct device *dev, enum pm_device_act } #endif /* CONFIG_PM_DEVICE */ -static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { struct modem_cellular_data *data = diff --git a/drivers/wifi/esp32/src/esp_wifi_drv.c b/drivers/wifi/esp32/src/esp_wifi_drv.c index 72c4c512717..305994d6a32 100644 --- a/drivers/wifi/esp32/src/esp_wifi_drv.c +++ b/drivers/wifi/esp32/src/esp_wifi_drv.c @@ -77,7 +77,7 @@ struct esp32_wifi_runtime { static struct net_mgmt_event_callback esp32_dhcp_cb; -static void wifi_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void wifi_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { switch (mgmt_event) { diff --git a/include/zephyr/net/coap_mgmt.h b/include/zephyr/net/coap_mgmt.h index 0cc25a9cb18..961ca18d1ab 100644 --- a/include/zephyr/net/coap_mgmt.h +++ b/include/zephyr/net/coap_mgmt.h @@ -40,25 +40,13 @@ struct coap_service; struct coap_resource; struct coap_observer; -enum { - NET_EVENT_COAP_CMD_SERVICE_STARTED_VAL, - NET_EVENT_COAP_CMD_SERVICE_STOPPED_VAL, - NET_EVENT_COAP_CMD_OBSERVER_ADDED_VAL, - NET_EVENT_COAP_CMD_OBSERVER_REMOVED_VAL, - - NET_EVENT_COAP_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_COAP_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_coap_cmd exceeds the limit"); - enum net_event_coap_cmd { /* Service events */ - NET_MGMT_CMD(NET_EVENT_COAP_CMD_SERVICE_STARTED), - NET_MGMT_CMD(NET_EVENT_COAP_CMD_SERVICE_STOPPED), + NET_EVENT_COAP_CMD_SERVICE_STARTED = 1, + NET_EVENT_COAP_CMD_SERVICE_STOPPED, /* Observer events */ - NET_MGMT_CMD(NET_EVENT_COAP_CMD_OBSERVER_ADDED), - NET_MGMT_CMD(NET_EVENT_COAP_CMD_OBSERVER_REMOVED), + NET_EVENT_COAP_CMD_OBSERVER_ADDED, + NET_EVENT_COAP_CMD_OBSERVER_REMOVED, }; /** @endcond */ diff --git a/include/zephyr/net/conn_mgr_connectivity.h b/include/zephyr/net/conn_mgr_connectivity.h index cb0f63fcfac..d1b0ea8106a 100644 --- a/include/zephyr/net/conn_mgr_connectivity.h +++ b/include/zephyr/net/conn_mgr_connectivity.h @@ -41,19 +41,9 @@ extern "C" { NET_MGMT_EVENT_BIT) #define NET_MGMT_CONN_IF_EVENT (NET_MGMT_IFACE_BIT | NET_MGMT_CONN_BASE) -enum { - NET_EVENT_CONN_CMD_IF_TIMEOUT_VAL, - NET_EVENT_CONN_CMD_IF_FATAL_ERROR_VAL, - - NET_EVENT_CONN_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_CONN_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_conn_cmd exceeds the limit"); - enum net_event_conn_cmd { - NET_MGMT_CMD(NET_EVENT_CONN_CMD_IF_TIMEOUT), - NET_MGMT_CMD(NET_EVENT_CONN_CMD_IF_FATAL_ERROR), + NET_EVENT_CONN_CMD_IF_TIMEOUT = 1, + NET_EVENT_CONN_CMD_IF_FATAL_ERROR, }; /** @endcond */ diff --git a/include/zephyr/net/ethernet_mgmt.h b/include/zephyr/net/ethernet_mgmt.h index 79306e9195a..750e899da20 100644 --- a/include/zephyr/net/ethernet_mgmt.h +++ b/include/zephyr/net/ethernet_mgmt.h @@ -188,23 +188,11 @@ struct ethernet_req_params { }; }; -enum { - NET_EVENT_ETHERNET_CMD_CARRIER_ON_VAL, - NET_EVENT_ETHERNET_CMD_CARRIER_OFF_VAL, - NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED_VAL, - NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED_VAL, - - NET_EVENT_ETHERNET_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_ETHERNET_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_ethernet_cmd exceeds the limit"); - enum net_event_ethernet_cmd { - NET_MGMT_CMD(NET_EVENT_ETHERNET_CMD_CARRIER_ON), - NET_MGMT_CMD(NET_EVENT_ETHERNET_CMD_CARRIER_OFF), - NET_MGMT_CMD(NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED), - NET_MGMT_CMD(NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED), + NET_EVENT_ETHERNET_CMD_CARRIER_ON = 1, + NET_EVENT_ETHERNET_CMD_CARRIER_OFF, + NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED, + NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED, }; #define NET_EVENT_ETHERNET_CARRIER_ON \ diff --git a/include/zephyr/net/ieee802154_mgmt.h b/include/zephyr/net/ieee802154_mgmt.h index 970f8a89a9c..bf20b49b720 100644 --- a/include/zephyr/net/ieee802154_mgmt.h +++ b/include/zephyr/net/ieee802154_mgmt.h @@ -255,17 +255,8 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_IEEE802154_GET_SECURITY_SETTINGS); * @cond INTERNAL_HIDDEN */ -enum { - NET_EVENT_IEEE802154_CMD_SCAN_RESULT_VAL, - - NET_EVENT_IEEE802154_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_IEEE802154_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_ieee802154_cmd exceeds the limit"); - enum net_event_ieee802154_cmd { - NET_MGMT_CMD(NET_EVENT_IEEE802154_CMD_SCAN_RESULT), + NET_EVENT_IEEE802154_CMD_SCAN_RESULT = 1, }; /** diff --git a/include/zephyr/net/net_event.h b/include/zephyr/net/net_event.h index 3a948ca5ef9..0b8c995cd3e 100644 --- a/include/zephyr/net/net_event.h +++ b/include/zephyr/net/net_event.h @@ -34,23 +34,11 @@ extern "C" { NET_MGMT_LAYER(NET_IF_LAYER) | \ NET_MGMT_LAYER_CODE(NET_IF_CORE_CODE)) -enum { - NET_EVENT_IF_CMD_DOWN_VAL, - NET_EVENT_IF_CMD_UP_VAL, - NET_EVENT_IF_CMD_ADMIN_DOWN_VAL, - NET_EVENT_IF_CMD_ADMIN_UP_VAL, - - NET_EVENT_IF_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_IF_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_if_cmd exceeds the limit"); - enum net_event_if_cmd { - NET_MGMT_CMD(NET_EVENT_IF_CMD_DOWN), - NET_MGMT_CMD(NET_EVENT_IF_CMD_UP), - NET_MGMT_CMD(NET_EVENT_IF_CMD_ADMIN_DOWN), - NET_MGMT_CMD(NET_EVENT_IF_CMD_ADMIN_UP), + NET_EVENT_IF_CMD_DOWN = 1, + NET_EVENT_IF_CMD_UP, + NET_EVENT_IF_CMD_ADMIN_DOWN, + NET_EVENT_IF_CMD_ADMIN_UP, }; /* IPv6 Events */ @@ -61,65 +49,32 @@ enum net_event_if_cmd { NET_MGMT_LAYER(NET_IPV6_LAYER) | \ NET_MGMT_LAYER_CODE(NET_IPV6_CORE_CODE)) -enum { - NET_EVENT_IPV6_CMD_ADDR_ADD_VAL, - NET_EVENT_IPV6_CMD_ADDR_DEL_VAL, - NET_EVENT_IPV6_CMD_MADDR_ADD_VAL, - NET_EVENT_IPV6_CMD_MADDR_DEL_VAL, - NET_EVENT_IPV6_CMD_PREFIX_ADD_VAL, - NET_EVENT_IPV6_CMD_PREFIX_DEL_VAL, - NET_EVENT_IPV6_CMD_MCAST_JOIN_VAL, - NET_EVENT_IPV6_CMD_MCAST_LEAVE_VAL, - NET_EVENT_IPV6_CMD_ROUTER_ADD_VAL, - NET_EVENT_IPV6_CMD_ROUTER_DEL_VAL, - NET_EVENT_IPV6_CMD_ROUTE_ADD_VAL, - NET_EVENT_IPV6_CMD_ROUTE_DEL_VAL, - NET_EVENT_IPV6_CMD_DAD_SUCCEED_VAL, - NET_EVENT_IPV6_CMD_DAD_FAILED_VAL, - NET_EVENT_IPV6_CMD_NBR_ADD_VAL, - NET_EVENT_IPV6_CMD_NBR_DEL_VAL, - NET_EVENT_IPV6_CMD_DHCP_START_VAL, - NET_EVENT_IPV6_CMD_DHCP_BOUND_VAL, - NET_EVENT_IPV6_CMD_DHCP_STOP_VAL, - NET_EVENT_IPV6_CMD_ADDR_DEPRECATED_VAL, - NET_EVENT_IPV6_CMD_PE_ENABLED_VAL, - NET_EVENT_IPV6_CMD_PE_DISABLED_VAL, - NET_EVENT_IPV6_CMD_PE_FILTER_ADD_VAL, - NET_EVENT_IPV6_CMD_PE_FILTER_DEL_VAL, - NET_EVENT_IPV6_CMD_PMTU_CHANGED_VAL, - - NET_EVENT_IPV6_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_IPV6_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_ipv6_cmd exceeds the limit"); - enum net_event_ipv6_cmd { - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_ADDR_ADD), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_ADDR_DEL), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_MADDR_ADD), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_MADDR_DEL), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_PREFIX_ADD), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_PREFIX_DEL), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_MCAST_JOIN), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_MCAST_LEAVE), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_ROUTER_ADD), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_ROUTER_DEL), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_ROUTE_ADD), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_ROUTE_DEL), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_DAD_SUCCEED), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_DAD_FAILED), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_NBR_ADD), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_NBR_DEL), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_DHCP_START), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_DHCP_BOUND), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_DHCP_STOP), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_ADDR_DEPRECATED), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_PE_ENABLED), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_PE_DISABLED), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_PE_FILTER_ADD), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_PE_FILTER_DEL), - NET_MGMT_CMD(NET_EVENT_IPV6_CMD_PMTU_CHANGED), + NET_EVENT_IPV6_CMD_ADDR_ADD = 1, + NET_EVENT_IPV6_CMD_ADDR_DEL, + NET_EVENT_IPV6_CMD_MADDR_ADD, + NET_EVENT_IPV6_CMD_MADDR_DEL, + NET_EVENT_IPV6_CMD_PREFIX_ADD, + NET_EVENT_IPV6_CMD_PREFIX_DEL, + NET_EVENT_IPV6_CMD_MCAST_JOIN, + NET_EVENT_IPV6_CMD_MCAST_LEAVE, + NET_EVENT_IPV6_CMD_ROUTER_ADD, + NET_EVENT_IPV6_CMD_ROUTER_DEL, + NET_EVENT_IPV6_CMD_ROUTE_ADD, + NET_EVENT_IPV6_CMD_ROUTE_DEL, + NET_EVENT_IPV6_CMD_DAD_SUCCEED, + NET_EVENT_IPV6_CMD_DAD_FAILED, + NET_EVENT_IPV6_CMD_NBR_ADD, + NET_EVENT_IPV6_CMD_NBR_DEL, + NET_EVENT_IPV6_CMD_DHCP_START, + NET_EVENT_IPV6_CMD_DHCP_BOUND, + NET_EVENT_IPV6_CMD_DHCP_STOP, + NET_EVENT_IPV6_CMD_ADDR_DEPRECATED, + NET_EVENT_IPV6_CMD_PE_ENABLED, + NET_EVENT_IPV6_CMD_PE_DISABLED, + NET_EVENT_IPV6_CMD_PE_FILTER_ADD, + NET_EVENT_IPV6_CMD_PE_FILTER_DEL, + NET_EVENT_IPV6_CMD_PMTU_CHANGED, }; /* IPv4 Events*/ @@ -130,45 +85,22 @@ enum net_event_ipv6_cmd { NET_MGMT_LAYER(NET_IPV4_LAYER) | \ NET_MGMT_LAYER_CODE(NET_IPV4_CORE_CODE)) -enum { - NET_EVENT_IPV4_CMD_ADDR_ADD_VAL, - NET_EVENT_IPV4_CMD_ADDR_DEL_VAL, - NET_EVENT_IPV4_CMD_MADDR_ADD_VAL, - NET_EVENT_IPV4_CMD_MADDR_DEL_VAL, - NET_EVENT_IPV4_CMD_ROUTER_ADD_VAL, - NET_EVENT_IPV4_CMD_ROUTER_DEL_VAL, - NET_EVENT_IPV4_CMD_DHCP_START_VAL, - NET_EVENT_IPV4_CMD_DHCP_BOUND_VAL, - NET_EVENT_IPV4_CMD_DHCP_STOP_VAL, - NET_EVENT_IPV4_CMD_MCAST_JOIN_VAL, - NET_EVENT_IPV4_CMD_MCAST_LEAVE_VAL, - NET_EVENT_IPV4_CMD_ACD_SUCCEED_VAL, - NET_EVENT_IPV4_CMD_ACD_FAILED_VAL, - NET_EVENT_IPV4_CMD_ACD_CONFLICT_VAL, - NET_EVENT_IPV4_CMD_PMTU_CHANGED_VAL, - - NET_EVENT_IPV4_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_IPV4_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_ipv4_cmd exceeds the limit"); - enum net_event_ipv4_cmd { - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_ADDR_ADD), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_ADDR_DEL), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_MADDR_ADD), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_MADDR_DEL), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_ROUTER_ADD), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_ROUTER_DEL), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_DHCP_START), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_DHCP_BOUND), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_DHCP_STOP), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_MCAST_JOIN), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_MCAST_LEAVE), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_ACD_SUCCEED), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_ACD_FAILED), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_ACD_CONFLICT), - NET_MGMT_CMD(NET_EVENT_IPV4_CMD_PMTU_CHANGED), + NET_EVENT_IPV4_CMD_ADDR_ADD = 1, + NET_EVENT_IPV4_CMD_ADDR_DEL, + NET_EVENT_IPV4_CMD_MADDR_ADD, + NET_EVENT_IPV4_CMD_MADDR_DEL, + NET_EVENT_IPV4_CMD_ROUTER_ADD, + NET_EVENT_IPV4_CMD_ROUTER_DEL, + NET_EVENT_IPV4_CMD_DHCP_START, + NET_EVENT_IPV4_CMD_DHCP_BOUND, + NET_EVENT_IPV4_CMD_DHCP_STOP, + NET_EVENT_IPV4_CMD_MCAST_JOIN, + NET_EVENT_IPV4_CMD_MCAST_LEAVE, + NET_EVENT_IPV4_CMD_ACD_SUCCEED, + NET_EVENT_IPV4_CMD_ACD_FAILED, + NET_EVENT_IPV4_CMD_ACD_CONFLICT, + NET_EVENT_IPV4_CMD_PMTU_CHANGED, }; /* L4 network events */ @@ -179,45 +111,22 @@ enum net_event_ipv4_cmd { NET_MGMT_LAYER(NET_L4_LAYER) | \ NET_MGMT_LAYER_CODE(NET_L4_CORE_CODE)) -enum { - NET_EVENT_L4_CMD_CONNECTED_VAL, - NET_EVENT_L4_CMD_DISCONNECTED_VAL, - NET_EVENT_L4_CMD_IPV4_CONNECTED_VAL, - NET_EVENT_L4_CMD_IPV4_DISCONNECTED_VAL, - NET_EVENT_L4_CMD_IPV6_CONNECTED_VAL, - NET_EVENT_L4_CMD_IPV6_DISCONNECTED_VAL, - NET_EVENT_L4_CMD_DNS_SERVER_ADD_VAL, - NET_EVENT_L4_CMD_DNS_SERVER_DEL_VAL, - NET_EVENT_L4_CMD_HOSTNAME_CHANGED_VAL, - NET_EVENT_L4_CMD_CAPTURE_STARTED_VAL, - NET_EVENT_L4_CMD_CAPTURE_STOPPED_VAL, - NET_EVENT_L4_CMD_VPN_CONNECTED_VAL, - NET_EVENT_L4_CMD_VPN_DISCONNECTED_VAL, - NET_EVENT_L4_CMD_VPN_PEER_ADD_VAL, - NET_EVENT_L4_CMD_VPN_PEER_DEL_VAL, - - NET_EVENT_L4_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_L4_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_l4_cmd exceeds the limit"); - enum net_event_l4_cmd { - NET_MGMT_CMD(NET_EVENT_L4_CMD_CONNECTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_DISCONNECTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_IPV4_CONNECTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_IPV4_DISCONNECTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_IPV6_CONNECTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_IPV6_DISCONNECTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_DNS_SERVER_ADD), - NET_MGMT_CMD(NET_EVENT_L4_CMD_DNS_SERVER_DEL), - NET_MGMT_CMD(NET_EVENT_L4_CMD_HOSTNAME_CHANGED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_CAPTURE_STARTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_CAPTURE_STOPPED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_VPN_CONNECTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_VPN_DISCONNECTED), - NET_MGMT_CMD(NET_EVENT_L4_CMD_VPN_PEER_ADD), - NET_MGMT_CMD(NET_EVENT_L4_CMD_VPN_PEER_DEL), + NET_EVENT_L4_CMD_CONNECTED = 1, + NET_EVENT_L4_CMD_DISCONNECTED, + NET_EVENT_L4_CMD_IPV4_CONNECTED, + NET_EVENT_L4_CMD_IPV4_DISCONNECTED, + NET_EVENT_L4_CMD_IPV6_CONNECTED, + NET_EVENT_L4_CMD_IPV6_DISCONNECTED, + NET_EVENT_L4_CMD_DNS_SERVER_ADD, + NET_EVENT_L4_CMD_DNS_SERVER_DEL, + NET_EVENT_L4_CMD_HOSTNAME_CHANGED, + NET_EVENT_L4_CMD_CAPTURE_STARTED, + NET_EVENT_L4_CMD_CAPTURE_STOPPED, + NET_EVENT_L4_CMD_VPN_CONNECTED, + NET_EVENT_L4_CMD_VPN_DISCONNECTED, + NET_EVENT_L4_CMD_VPN_PEER_ADD, + NET_EVENT_L4_CMD_VPN_PEER_DEL, }; /** @endcond */ @@ -244,11 +153,11 @@ enum net_event_l4_cmd { /** Event emitted when an IPv6 address is removed from the system. */ #define NET_EVENT_IPV6_ADDR_DEL \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL) /** Event emitted when an IPv6 multicast address is added to the system. */ #define NET_EVENT_IPV6_MADDR_ADD \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD) /** Event emitted when an IPv6 multicast address is removed from the system. */ #define NET_EVENT_IPV6_MADDR_DEL \ @@ -256,19 +165,19 @@ enum net_event_l4_cmd { /** Event emitted when an IPv6 prefix is added to the system. */ #define NET_EVENT_IPV6_PREFIX_ADD \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD) /** Event emitted when an IPv6 prefix is removed from the system. */ #define NET_EVENT_IPV6_PREFIX_DEL \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL) /** Event emitted when an IPv6 multicast group is joined. */ #define NET_EVENT_IPV6_MCAST_JOIN \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_JOIN) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_JOIN) /** Event emitted when an IPv6 multicast group is left. */ #define NET_EVENT_IPV6_MCAST_LEAVE \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_LEAVE) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_LEAVE) /** Event emitted when an IPv6 router is added to the system. */ #define NET_EVENT_IPV6_ROUTER_ADD \ @@ -304,15 +213,15 @@ enum net_event_l4_cmd { /** Event emitted when an IPv6 DHCP client starts. */ #define NET_EVENT_IPV6_DHCP_START \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_START) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_START) /** Event emitted when an IPv6 DHCP client address is bound. */ #define NET_EVENT_IPV6_DHCP_BOUND \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_BOUND) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_BOUND) /** Event emitted when an IPv6 DHCP client is stopped. */ #define NET_EVENT_IPV6_DHCP_STOP \ - (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_STOP) + (NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_STOP) /** IPv6 address is deprecated. */ #define NET_EVENT_IPV6_ADDR_DEPRECATED \ @@ -344,11 +253,11 @@ enum net_event_l4_cmd { /** Event emitted when an IPv4 address is removed from the system. */ #define NET_EVENT_IPV4_ADDR_DEL \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL) /** Event emitted when an IPv4 multicast address is added to the system. */ #define NET_EVENT_IPV4_MADDR_ADD \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_ADD) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_ADD) /** Event emitted when an IPv4 multicast address is removed from the system. */ #define NET_EVENT_IPV4_MADDR_DEL \ @@ -356,31 +265,31 @@ enum net_event_l4_cmd { /** Event emitted when an IPv4 router is added to the system. */ #define NET_EVENT_IPV4_ROUTER_ADD \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD) /** Event emitted when an IPv4 router is removed from the system. */ #define NET_EVENT_IPV4_ROUTER_DEL \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL) /** Event emitted when an IPv4 DHCP client is started. */ #define NET_EVENT_IPV4_DHCP_START \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_START) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_START) /** Event emitted when an IPv4 DHCP client address is bound. */ #define NET_EVENT_IPV4_DHCP_BOUND \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_BOUND) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_BOUND) /** Event emitted when an IPv4 DHCP client is stopped. */ #define NET_EVENT_IPV4_DHCP_STOP \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_STOP) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_STOP) /** Event emitted when an IPv4 multicast group is joined. */ #define NET_EVENT_IPV4_MCAST_JOIN \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_JOIN) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_JOIN) /** Event emitted when an IPv4 multicast group is left. */ #define NET_EVENT_IPV4_MCAST_LEAVE \ - (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_LEAVE) + (NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_LEAVE) /** Event emitted when an IPv4 address conflict detection succeeds. */ #define NET_EVENT_IPV4_ACD_SUCCEED \ diff --git a/include/zephyr/net/net_mgmt.h b/include/zephyr/net/net_mgmt.h index 9c559b7fd8b..04e95cbb5ec 100644 --- a/include/zephyr/net/net_mgmt.h +++ b/include/zephyr/net/net_mgmt.h @@ -14,6 +14,7 @@ #include #include +#include #include #ifdef __cplusplus @@ -35,30 +36,38 @@ struct net_if; /** * @brief NET MGMT event mask basics, normalizing parts of bit fields */ -#define NET_MGMT_EVENT_MASK GENMASK64(63, 63) /* 0x8000000000000000 */ -#define NET_MGMT_ON_IFACE_MASK GENMASK64(62, 62) /* 0x4000000000000000 */ -#define NET_MGMT_LAYER_MASK GENMASK64(61, 60) /* 0x3000000000000000 */ -#define NET_MGMT_SYNC_EVENT_MASK GENMASK64(59, 59) /* 0x0800000000000000 */ -#define NET_MGMT_LAYER_CODE_MASK GENMASK64(58, 52) /* 0x07F0000000000000 */ -#define NET_MGMT_COMMAND_MASK GENMASK64(51, 0) /* 0x000FFFFFFFFFFFFF */ +#define NET_MGMT_EVENT_MASK 0x80000000 +#define NET_MGMT_ON_IFACE_MASK 0x40000000 +#define NET_MGMT_LAYER_MASK 0x30000000 +#define NET_MGMT_SYNC_EVENT_MASK 0x08000000 +#define NET_MGMT_LAYER_CODE_MASK 0x07FF0000 +#define NET_MGMT_COMMAND_MASK 0x0000FFFF + +#define NET_MGMT_EVENT_BIT BIT(31) +#define NET_MGMT_IFACE_BIT BIT(30) +#define NET_MGMT_SYNC_EVENT_BIT BIT(27) + +#define NET_MGMT_LAYER(_layer) (_layer << 28) +#define NET_MGMT_LAYER_CODE(_code) (_code << 16) + +#define NET_MGMT_EVENT(mgmt_request) \ + (mgmt_request & NET_MGMT_EVENT_MASK) -#define NET_MGMT_MAX_COMMANDS 52 /* TODO: figure out the value from mask */ +#define NET_MGMT_ON_IFACE(mgmt_request) \ + (mgmt_request & NET_MGMT_ON_IFACE_MASK) -#define NET_MGMT_EVENT_BIT BIT64(63) -#define NET_MGMT_IFACE_BIT BIT64(62) -#define NET_MGMT_SYNC_EVENT_BIT BIT64(59) +#define NET_MGMT_EVENT_SYNCHRONOUS(mgmt_request) \ + (mgmt_request & NET_MGMT_SYNC_EVENT_MASK) -#define NET_MGMT_LAYER(_layer) FIELD_PREP(NET_MGMT_LAYER_MASK, (_layer)) -#define NET_MGMT_LAYER_CODE(_code) FIELD_PREP(NET_MGMT_LAYER_CODE_MASK, (_code)) +#define NET_MGMT_GET_LAYER(mgmt_request) \ + ((mgmt_request & NET_MGMT_LAYER_MASK) >> 28) -#define NET_MGMT_EVENT(mgmt_request) FIELD_GET(NET_MGMT_EVENT_MASK, mgmt_request) -#define NET_MGMT_ON_IFACE(mgmt_request) FIELD_GET(NET_MGMT_ON_IFACE_MASK, mgmt_request) -#define NET_MGMT_EVENT_SYNCHRONOUS(mgmt_request) FIELD_GET(NET_MGMT_SYNC_EVENT_MASK, mgmt_request) -#define NET_MGMT_GET_LAYER(mgmt_request) FIELD_GET(NET_MGMT_LAYER_MASK, mgmt_request) -#define NET_MGMT_GET_LAYER_CODE(mgmt_request) FIELD_GET(NET_MGMT_LAYER_CODE_MASK, mgmt_request) -#define NET_MGMT_GET_COMMAND(mgmt_request) FIELD_GET(NET_MGMT_COMMAND_MASK, mgmt_request) +#define NET_MGMT_GET_LAYER_CODE(mgmt_request) \ + ((mgmt_request & NET_MGMT_LAYER_CODE_MASK) >> 16) + +#define NET_MGMT_GET_COMMAND(mgmt_request) \ + (mgmt_request & NET_MGMT_COMMAND_MASK) -#define NET_MGMT_CMD(cmd) cmd = BIT64(cmd ##_VAL) /* Useful generic definitions */ #define NET_MGMT_LAYER_L2 1 @@ -93,8 +102,6 @@ enum net_mgmt_layer_code { NET_MGMT_LAYER_CODE_RESERVED = 0x7F /**< Reserved layer code for future use */ }; -#include - /** * @typedef net_mgmt_request_handler_t * @brief Signature which all Net MGMT request handler need to follow @@ -106,7 +113,7 @@ enum net_mgmt_layer_code { * NULL otherwise. * @param len Length in byte of the memory pointed by data. */ -typedef int (*net_mgmt_request_handler_t)(uint64_t mgmt_request, +typedef int (*net_mgmt_request_handler_t)(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len); @@ -127,7 +134,7 @@ typedef int (*net_mgmt_request_handler_t)(uint64_t mgmt_request, * @param _mgmt_request Management event identifier */ #define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request) \ - extern int net_mgmt_##_mgmt_request(uint64_t mgmt_request, \ + extern int net_mgmt_##_mgmt_request(uint32_t mgmt_request, \ struct net_if *iface, \ void *data, size_t len) @@ -151,7 +158,7 @@ struct net_mgmt_event_callback; * if it's an event on an iface. NULL otherwise. */ typedef void (*net_mgmt_event_handler_t)(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface); /** @@ -195,11 +202,11 @@ struct net_mgmt_event_callback { * receive events from multiple layers, one must have multiple * listeners registered, one for each layer being listened. */ - uint64_t event_mask; + uint32_t event_mask; /** Internal place holder when a synchronous event wait is * successfully unlocked on a event. */ - uint64_t raised_event; + uint32_t raised_event; }; }; @@ -214,7 +221,7 @@ struct net_mgmt_event_callback { * @param info_length Length in bytes of the memory pointed by @p info. * @param user_data Data provided by the user to the handler. */ -typedef void (*net_mgmt_event_static_handler_t)(uint64_t mgmt_event, +typedef void (*net_mgmt_event_static_handler_t)(uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data); @@ -223,7 +230,7 @@ typedef void (*net_mgmt_event_static_handler_t)(uint64_t mgmt_event, /* Structure for event handler registered at compile time */ struct net_mgmt_event_static_handler { - uint64_t event_mask; + uint32_t event_mask; net_mgmt_event_static_handler_t handler; void *user_data; }; @@ -260,7 +267,7 @@ struct net_mgmt_event_static_handler { static inline void net_mgmt_init_event_callback(struct net_mgmt_event_callback *cb, net_mgmt_event_handler_t handler, - uint64_t mgmt_event_mask) + uint32_t mgmt_event_mask) { __ASSERT(cb, "Callback pointer should not be NULL"); __ASSERT(handler, "Handler pointer should not be NULL"); @@ -306,7 +313,7 @@ void net_mgmt_del_event_callback(struct net_mgmt_event_callback *cb); * is not defined. */ #if defined(CONFIG_NET_MGMT_EVENT) -void net_mgmt_event_notify_with_info(uint64_t mgmt_event, struct net_if *iface, +void net_mgmt_event_notify_with_info(uint32_t mgmt_event, struct net_if *iface, const void *info, size_t length); #else #define net_mgmt_event_notify_with_info(...) @@ -319,7 +326,7 @@ void net_mgmt_event_notify_with_info(uint64_t mgmt_event, struct net_if *iface, * based on an iface. NULL otherwise. */ #if defined(CONFIG_NET_MGMT_EVENT) -static inline void net_mgmt_event_notify(uint64_t mgmt_event, +static inline void net_mgmt_event_notify(uint32_t mgmt_event, struct net_if *iface) { net_mgmt_event_notify_with_info(mgmt_event, iface, NULL, 0); @@ -349,15 +356,15 @@ static inline void net_mgmt_event_notify(uint64_t mgmt_event, * actual event. */ #ifdef CONFIG_NET_MGMT_EVENT -int net_mgmt_event_wait(uint64_t mgmt_event_mask, - uint64_t *raised_event, +int net_mgmt_event_wait(uint32_t mgmt_event_mask, + uint32_t *raised_event, struct net_if **iface, const void **info, size_t *info_length, k_timeout_t timeout); #else -static inline int net_mgmt_event_wait(uint64_t mgmt_event_mask, - uint64_t *raised_event, +static inline int net_mgmt_event_wait(uint32_t mgmt_event_mask, + uint32_t *raised_event, struct net_if **iface, const void **info, size_t *info_length, @@ -394,15 +401,15 @@ static inline int net_mgmt_event_wait(uint64_t mgmt_event_mask, */ #ifdef CONFIG_NET_MGMT_EVENT int net_mgmt_event_wait_on_iface(struct net_if *iface, - uint64_t mgmt_event_mask, - uint64_t *raised_event, + uint32_t mgmt_event_mask, + uint32_t *raised_event, const void **info, size_t *info_length, k_timeout_t timeout); #else static inline int net_mgmt_event_wait_on_iface(struct net_if *iface, - uint64_t mgmt_event_mask, - uint64_t *raised_event, + uint32_t mgmt_event_mask, + uint32_t *raised_event, const void **info, size_t *info_length, k_timeout_t timeout) diff --git a/include/zephyr/net/ppp.h b/include/zephyr/net/ppp.h index 82e02648380..7028e4f2d0f 100644 --- a/include/zephyr/net/ppp.h +++ b/include/zephyr/net/ppp.h @@ -574,23 +574,11 @@ void net_ppp_init(struct net_if *iface); NET_MGMT_LAYER_CODE(NET_PPP_CODE)) #define NET_PPP_EVENT (NET_PPP_BASE | NET_MGMT_EVENT_BIT) -enum { - NET_EVENT_PPP_CMD_CARRIER_ON_VAL, - NET_EVENT_PPP_CMD_CARRIER_OFF_VAL, - NET_EVENT_PPP_CMD_PHASE_RUNNING_VAL, - NET_EVENT_PPP_CMD_PHASE_DEAD_VAL, - - NET_EVENT_PPP_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_PPP_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_ppp_cmd exceeds the limit"); - enum net_event_ppp_cmd { - NET_MGMT_CMD(NET_EVENT_PPP_CMD_CARRIER_ON), - NET_MGMT_CMD(NET_EVENT_PPP_CMD_CARRIER_OFF), - NET_MGMT_CMD(NET_EVENT_PPP_CMD_PHASE_RUNNING), - NET_MGMT_CMD(NET_EVENT_PPP_CMD_PHASE_DEAD), + NET_EVENT_PPP_CMD_CARRIER_ON = 1, + NET_EVENT_PPP_CMD_CARRIER_OFF, + NET_EVENT_PPP_CMD_PHASE_RUNNING, + NET_EVENT_PPP_CMD_PHASE_DEAD, }; struct net_if; diff --git a/include/zephyr/net/socket_net_mgmt.h b/include/zephyr/net/socket_net_mgmt.h index 337648d5d18..8f3c5829ad3 100644 --- a/include/zephyr/net/socket_net_mgmt.h +++ b/include/zephyr/net/socket_net_mgmt.h @@ -73,7 +73,7 @@ struct sockaddr_nm { uintptr_t nm_pid; /** net_mgmt mask */ - uint64_t nm_mask; + uint32_t nm_mask; }; diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 2c895afb36d..5477b6a3c0e 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -317,73 +317,44 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_START_ROAMING); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_NEIGHBOR_REP_COMPLETE); -/** @cond INTERNAL_HIDDEN */ - -enum { - NET_EVENT_WIFI_CMD_SCAN_RESULT_VAL, - NET_EVENT_WIFI_CMD_SCAN_DONE_VAL, - NET_EVENT_WIFI_CMD_CONNECT_RESULT_VAL, - NET_EVENT_WIFI_CMD_DISCONNECT_RESULT_VAL, - NET_EVENT_WIFI_CMD_IFACE_STATUS_VAL, - NET_EVENT_WIFI_CMD_TWT_VAL, - NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE_VAL, - NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT_VAL, - NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE_VAL, - NET_EVENT_WIFI_CMD_SIGNAL_CHANGE_VAL, - NET_EVENT_WIFI_CMD_NEIGHBOR_REP_RECEIVED_VAL, - NET_EVENT_WIFI_CMD_NEIGHBOR_REP_COMPLETE_VAL, - NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT_VAL, - NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT_VAL, - NET_EVENT_WIFI_CMD_AP_STA_CONNECTED_VAL, - NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED_VAL, - NET_EVENT_WIFI_CMD_SUPPLICANT_VAL, - - NET_EVENT_WIFI_CMD_MAX, -}; - -BUILD_ASSERT(NET_EVENT_WIFI_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_wifi_cmd exceeds the limit"); - -/** @endcond */ - /** @brief Wi-Fi management events */ enum net_event_wifi_cmd { /** Scan results available */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SCAN_RESULT), + NET_EVENT_WIFI_CMD_SCAN_RESULT = 1, /** Scan done */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SCAN_DONE), + NET_EVENT_WIFI_CMD_SCAN_DONE, /** Connect result */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_CONNECT_RESULT), + NET_EVENT_WIFI_CMD_CONNECT_RESULT, /** Disconnect result */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_DISCONNECT_RESULT), + NET_EVENT_WIFI_CMD_DISCONNECT_RESULT, /** Interface status */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_IFACE_STATUS), + NET_EVENT_WIFI_CMD_IFACE_STATUS, /** TWT events */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_TWT), + NET_EVENT_WIFI_CMD_TWT, /** TWT sleep status: awake or sleeping, can be used by application * to determine if it can send data or not. */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE), + NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE, /** Raw scan results available */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT), + NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT, /** Disconnect complete */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE), + NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE, /** Signal change event */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SIGNAL_CHANGE), + NET_EVENT_WIFI_CMD_SIGNAL_CHANGE, /** Neighbor Report */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NEIGHBOR_REP_RECEIVED), + NET_EVENT_WIFI_CMD_NEIGHBOR_REP_RECEIVED, /** Neighbor Report complete */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NEIGHBOR_REP_COMPLETE), + NET_EVENT_WIFI_CMD_NEIGHBOR_REP_COMPLETE, /** AP mode enable result */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT), + NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT, /** AP mode disable result */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT), + NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT, /** STA connected to AP */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_STA_CONNECTED), + NET_EVENT_WIFI_CMD_AP_STA_CONNECTED, /** STA disconnected from AP */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED), + NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED, /** Supplicant specific event */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SUPPLICANT), + NET_EVENT_WIFI_CMD_SUPPLICANT, }; /** Event emitted for Wi-Fi scan result */ diff --git a/modules/hostap/src/supp_events.h b/modules/hostap/src/supp_events.h index 1c74af52849..09c30e7a37f 100644 --- a/modules/hostap/src/supp_events.h +++ b/modules/hostap/src/supp_events.h @@ -17,27 +17,14 @@ NET_MGMT_IFACE_BIT) #define NET_MGMT_SUPPLICANT_EVENT (NET_MGMT_EVENT_BIT | NET_MGMT_SUPPLICANT_BASE) -enum { - NET_EVENT_SUPPLICANT_CMD_READY_VAL, - NET_EVENT_SUPPLICANT_CMD_NOT_READY_VAL, - NET_EVENT_SUPPLICANT_CMD_IFACE_ADDED_VAL, - NET_EVENT_SUPPLICANT_CMD_IFACE_REMOVING_VAL, - NET_EVENT_SUPPLICANT_CMD_IFACE_REMOVED_VAL, - NET_EVENT_SUPPLICANT_CMD_INT_EVENT_VAL, - - NET_EVENT_SUPPLICANT_CMD_MAX -}; - -BUILD_ASSERT(NET_EVENT_SUPPLICANT_CMD_MAX <= NET_MGMT_MAX_COMMANDS, - "Number of events in net_event_supplicant_cmd exceeds the limit"); - enum net_event_supplicant_cmd { - NET_MGMT_CMD(NET_EVENT_SUPPLICANT_CMD_READY), - NET_MGMT_CMD(NET_EVENT_SUPPLICANT_CMD_NOT_READY), - NET_MGMT_CMD(NET_EVENT_SUPPLICANT_CMD_IFACE_ADDED), - NET_MGMT_CMD(NET_EVENT_SUPPLICANT_CMD_IFACE_REMOVING), - NET_MGMT_CMD(NET_EVENT_SUPPLICANT_CMD_IFACE_REMOVED), - NET_MGMT_CMD(NET_EVENT_SUPPLICANT_CMD_INT_EVENT), + NET_EVENT_SUPPLICANT_CMD_READY = 1, + NET_EVENT_SUPPLICANT_CMD_NOT_READY, + NET_EVENT_SUPPLICANT_CMD_IFACE_ADDED, + NET_EVENT_SUPPLICANT_CMD_IFACE_REMOVING, + NET_EVENT_SUPPLICANT_CMD_IFACE_REMOVED, + NET_EVENT_SUPPLICANT_CMD_INT_EVENT, + NET_EVENT_WIFI_CMD_MAX }; #define NET_EVENT_SUPPLICANT_READY \ diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index 4549ab3160d..c2a4866b921 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -484,14 +484,14 @@ static void submit_iface_work(struct supplicant_context *ctx, } #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_INF_MON static void interface_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event & INTERFACE_EVENT_MASK) != mgmt_event) { return; } if (!is_wanted_interface(iface)) { - LOG_DBG("Ignoring event (0x%" PRIx64 ") from interface %d (%p)", + LOG_DBG("Ignoring event (0x%02x) from interface %d (%p)", mgmt_event, net_if_get_by_iface(iface), iface); return; } diff --git a/samples/boards/nxp/s32/netc/src/main.c b/samples/boards/nxp/s32/netc/src/main.c index 09e6cea9883..8399a7dd9b5 100644 --- a/samples/boards/nxp/s32/netc/src/main.c +++ b/samples/boards/nxp/s32/netc/src/main.c @@ -69,7 +69,7 @@ static int setup_iface(struct net_if *iface, const char *ipv6_addr, } static void iface_up_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_IF_UP) { k_sem_give(&iface_up); diff --git a/samples/net/capture/src/main.c b/samples/net/capture/src/main.c index 1b68ee30afa..3feafc4eb25 100644 --- a/samples/net/capture/src/main.c +++ b/samples/net/capture/src/main.c @@ -285,7 +285,7 @@ static int init_app(void) #define EVENT_MASK (NET_EVENT_CAPTURE_STARTED | NET_EVENT_CAPTURE_STOPPED) static void event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(iface); ARG_UNUSED(cb); @@ -307,7 +307,7 @@ int main(void) { static struct net_mgmt_event_callback mgmt_cb; struct net_if *iface; - uint64_t event; + uint32_t event; int ret; LOG_INF("Starting network capture sample"); diff --git a/samples/net/cloud/mqtt_azure/src/main.c b/samples/net/cloud/mqtt_azure/src/main.c index 538461af2d1..841c1fb7ebe 100644 --- a/samples/net/cloud/mqtt_azure/src/main.c +++ b/samples/net/cloud/mqtt_azure/src/main.c @@ -487,7 +487,7 @@ static void abort_mqtt_connection(void) } static void l4_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event & L4_EVENT_MASK) != mgmt_event) { return; diff --git a/samples/net/cloud/tagoio_http_post/src/wifi.c b/samples/net/cloud/tagoio_http_post/src/wifi.c index a0cd121d62b..f9eb52b7a59 100644 --- a/samples/net/cloud/tagoio_http_post/src/wifi.c +++ b/samples/net/cloud/tagoio_http_post/src/wifi.c @@ -26,7 +26,7 @@ static void handle_wifi_connect_result(struct net_mgmt_event_callback *cb) } static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { switch (mgmt_event) { case NET_EVENT_WIFI_CONNECT_RESULT: diff --git a/samples/net/common/net_sample_common.c b/samples/net/common/net_sample_common.c index 0b570a64feb..e1b91c91122 100644 --- a/samples/net/common/net_sample_common.c +++ b/samples/net/common/net_sample_common.c @@ -20,7 +20,7 @@ LOG_MODULE_REGISTER(net_samples_common, LOG_LEVEL_DBG); static struct net_mgmt_event_callback l4_cb; static K_SEM_DEFINE(network_connected, 0, 1); -static void l4_event_handler(struct net_mgmt_event_callback *cb, uint64_t event, +static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event, struct net_if *iface) { switch (event) { diff --git a/samples/net/dhcpv4_client/src/main.c b/samples/net/dhcpv4_client/src/main.c index 72f7a17f273..00d48949d73 100644 --- a/samples/net/dhcpv4_client/src/main.c +++ b/samples/net/dhcpv4_client/src/main.c @@ -38,7 +38,7 @@ static void start_dhcpv4_client(struct net_if *iface, void *user_data) } static void handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { int i = 0; diff --git a/samples/net/dns_resolve/src/main.c b/samples/net/dns_resolve/src/main.c index 5302f569874..23e5645d0b4 100644 --- a/samples/net/dns_resolve/src/main.c +++ b/samples/net/dns_resolve/src/main.c @@ -198,7 +198,7 @@ static void print_dhcpv4_addr(struct net_if *iface, struct net_if_addr *if_addr, } static void ipv4_addr_add_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { diff --git a/samples/net/dsa/src/main.c b/samples/net/dsa/src/main.c index a84b2cef7a9..16d41af5999 100644 --- a/samples/net/dsa/src/main.c +++ b/samples/net/dsa/src/main.c @@ -54,7 +54,7 @@ static void dsa_iface_find_cb(struct net_if *iface, void *user_data) static struct net_mgmt_event_callback mgmt_cb; static void event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(iface); ARG_UNUSED(cb); diff --git a/samples/net/ipv4_autoconf/src/main.c b/samples/net/ipv4_autoconf/src/main.c index 9dd9fa53bb7..c4e93105cf7 100644 --- a/samples/net/ipv4_autoconf/src/main.c +++ b/samples/net/ipv4_autoconf/src/main.c @@ -25,7 +25,7 @@ LOG_MODULE_REGISTER(net_ipv4_autoconf_sample, LOG_LEVEL_DBG); static struct net_mgmt_event_callback mgmt_cb; static void handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { int i = 0; diff --git a/samples/net/lwm2m_client/src/lwm2m-client.c b/samples/net/lwm2m_client/src/lwm2m-client.c index 7c15f84502c..9127769ff6b 100644 --- a/samples/net/lwm2m_client/src/lwm2m-client.c +++ b/samples/net/lwm2m_client/src/lwm2m-client.c @@ -334,7 +334,7 @@ static void on_net_event_l4_connected(void) } static void l4_event_handler(struct net_mgmt_event_callback *cb, - uint64_t event, + uint32_t event, struct net_if *iface) { switch (event) { @@ -356,7 +356,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb, } static void connectivity_event_handler(struct net_mgmt_event_callback *cb, - uint64_t event, + uint32_t event, struct net_if *iface) { if (event == NET_EVENT_CONN_IF_FATAL_ERROR) { diff --git a/samples/net/mqtt_sn_publisher/src/main.c b/samples/net/mqtt_sn_publisher/src/main.c index fddeb4c976f..65436daea4d 100644 --- a/samples/net/mqtt_sn_publisher/src/main.c +++ b/samples/net/mqtt_sn_publisher/src/main.c @@ -30,7 +30,7 @@ K_SEM_DEFINE(run_app, 0, 1); #define EVENT_MASK (NET_EVENT_L4_CONNECTED | NET_EVENT_L4_DISCONNECTED) -static void net_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void net_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event & EVENT_MASK) != mgmt_event) { diff --git a/samples/net/secure_mqtt_sensor_actuator/src/main.c b/samples/net/secure_mqtt_sensor_actuator/src/main.c index 9b6872a69cf..64993139e90 100644 --- a/samples/net/secure_mqtt_sensor_actuator/src/main.c +++ b/samples/net/secure_mqtt_sensor_actuator/src/main.c @@ -30,7 +30,7 @@ static struct net_mgmt_event_callback net_l4_mgmt_cb; K_SEM_DEFINE(net_conn_sem, 0, 1); static void net_l4_evt_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { switch (mgmt_event) { case NET_EVENT_L4_CONNECTED: diff --git a/samples/net/sockets/coap_download/src/main.c b/samples/net/sockets/coap_download/src/main.c index 2e1ee6c59d3..bb15551cfba 100644 --- a/samples/net/sockets/coap_download/src/main.c +++ b/samples/net/sockets/coap_download/src/main.c @@ -21,7 +21,7 @@ static int64_t start_time; /* This struct contains (potentially large) TX and RX buffers, so allocate statically */ static struct coap_client client = {0}; -static void net_event_handler(uint64_t mgmt_event, struct net_if *iface, void *info, +static void net_event_handler(uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data) { if (NET_EVENT_L4_CONNECTED == mgmt_event) { diff --git a/samples/net/sockets/coap_server/src/events.c b/samples/net/sockets/coap_server/src/events.c index 8c621214a7d..3f843fba017 100644 --- a/samples/net/sockets/coap_server/src/events.c +++ b/samples/net/sockets/coap_server/src/events.c @@ -13,7 +13,7 @@ LOG_MODULE_DECLARE(net_coap_service_sample); #define COAP_EVENTS_SET (NET_EVENT_COAP_OBSERVER_ADDED | NET_EVENT_COAP_OBSERVER_REMOVED | \ NET_EVENT_COAP_SERVICE_STARTED | NET_EVENT_COAP_SERVICE_STOPPED) -void coap_event_handler(uint64_t mgmt_event, struct net_if *iface, +void coap_event_handler(uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data) { ARG_UNUSED(iface); diff --git a/samples/net/sockets/dumb_http_server_mt/src/main.c b/samples/net/sockets/dumb_http_server_mt/src/main.c index 4c8a1021923..ed19fa96833 100644 --- a/samples/net/sockets/dumb_http_server_mt/src/main.c +++ b/samples/net/sockets/dumb_http_server_mt/src/main.c @@ -98,7 +98,7 @@ K_THREAD_DEFINE(tcp6_thread_id, STACK_SIZE, NET_EVENT_L4_DISCONNECTED) static void event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event & EVENT_MASK) != mgmt_event) { return; diff --git a/samples/net/sockets/echo_client/src/echo-client.c b/samples/net/sockets/echo_client/src/echo-client.c index 9c451b9c3cc..3ca9ddc8aa0 100644 --- a/samples/net/sockets/echo_client/src/echo-client.c +++ b/samples/net/sockets/echo_client/src/echo-client.c @@ -229,7 +229,7 @@ static int check_our_ipv6_sockets(int sock, } static void ipv6_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { static char addr_str[INET6_ADDRSTRLEN]; @@ -297,7 +297,7 @@ static void ipv6_event_handler(struct net_mgmt_event_callback *cb, } static void event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event & EVENT_MASK) != mgmt_event) { return; diff --git a/samples/net/sockets/echo_server/src/echo-server.c b/samples/net/sockets/echo_server/src/echo-server.c index c4dc98b4004..fd6bd4f6acf 100644 --- a/samples/net/sockets/echo_server/src/echo-server.c +++ b/samples/net/sockets/echo_server/src/echo-server.c @@ -82,7 +82,7 @@ static void stop_udp_and_tcp(void) } static void event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(iface); ARG_UNUSED(cb); diff --git a/samples/net/sockets/packet/src/packet.c b/samples/net/sockets/packet/src/packet.c index e4354254b3e..3b3af25c7ab 100644 --- a/samples/net/sockets/packet/src/packet.c +++ b/samples/net/sockets/packet/src/packet.c @@ -229,7 +229,7 @@ static void send_packet(void) } static void iface_up_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_IF_UP) { k_sem_give(&iface_up); diff --git a/samples/net/sockets/txtime/src/main.c b/samples/net/sockets/txtime/src/main.c index 870e10f8ff7..d4bc85a3f2a 100644 --- a/samples/net/sockets/txtime/src/main.c +++ b/samples/net/sockets/txtime/src/main.c @@ -71,7 +71,7 @@ static void quit(void) } static void event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { static bool dhcpv4_done; diff --git a/samples/net/wifi/apsta_mode/src/main.c b/samples/net/wifi/apsta_mode/src/main.c index aa0d0cb28cb..eb90b1c2104 100644 --- a/samples/net/wifi/apsta_mode/src/main.c +++ b/samples/net/wifi/apsta_mode/src/main.c @@ -36,7 +36,7 @@ static struct wifi_connect_req_params sta_config; static struct net_mgmt_event_callback cb; -static void wifi_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void wifi_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { switch (mgmt_event) { diff --git a/samples/subsys/mgmt/updatehub/src/main.c b/samples/subsys/mgmt/updatehub/src/main.c index 9f9af6ae003..73d64a1a694 100644 --- a/samples/subsys/mgmt/updatehub/src/main.c +++ b/samples/subsys/mgmt/updatehub/src/main.c @@ -63,7 +63,7 @@ void start_updatehub(void) } static void event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event & EVENT_MASK) != mgmt_event) { return; diff --git a/subsys/logging/backends/log_backend_net.c b/subsys/logging/backends/log_backend_net.c index b0e3ca5c425..11f0612724f 100644 --- a/subsys/logging/backends/log_backend_net.c +++ b/subsys/logging/backends/log_backend_net.c @@ -367,7 +367,7 @@ const struct log_backend *log_backend_net_get(void) } #if defined(CONFIG_LOG_BACKEND_NET_USE_CONNECTION_MANAGER) -static void l4_event_handler(uint64_t mgmt_event, struct net_if *iface, void *info, +static void l4_event_handler(uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data) { ARG_UNUSED(iface); diff --git a/subsys/mgmt/mcumgr/transport/src/smp_udp.c b/subsys/mgmt/mcumgr/transport/src/smp_udp.c index e3da22e6731..8067b36d6e6 100644 --- a/subsys/mgmt/mcumgr/transport/src/smp_udp.c +++ b/subsys/mgmt/mcumgr/transport/src/smp_udp.c @@ -280,7 +280,7 @@ static void smp_udp_open_iface(struct net_if *iface, void *user_data) } } -static void smp_udp_net_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void smp_udp_net_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(cb); diff --git a/subsys/net/conn_mgr/conn_mgr_connectivity.c b/subsys/net/conn_mgr/conn_mgr_connectivity.c index 905b5b07d1c..5bf8e3f58be 100644 --- a/subsys/net/conn_mgr/conn_mgr_connectivity.c +++ b/subsys/net/conn_mgr/conn_mgr_connectivity.c @@ -315,7 +315,7 @@ static void conn_mgr_conn_handle_iface_down(struct net_if *iface) } static struct net_mgmt_event_callback conn_mgr_conn_iface_cb; -static void conn_mgr_conn_iface_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void conn_mgr_conn_iface_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event & CONN_MGR_CONN_IFACE_EVENTS_MASK) != mgmt_event) { @@ -333,7 +333,7 @@ static void conn_mgr_conn_iface_handler(struct net_mgmt_event_callback *cb, uint } static struct net_mgmt_event_callback conn_mgr_conn_self_cb; -static void conn_mgr_conn_self_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void conn_mgr_conn_self_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event & CONN_MGR_CONN_SELF_EVENTS_MASK) != mgmt_event) { diff --git a/subsys/net/conn_mgr/events_handler.c b/subsys/net/conn_mgr/events_handler.c index 2a0c6fefc28..8f15a8b6c62 100644 --- a/subsys/net/conn_mgr/events_handler.c +++ b/subsys/net/conn_mgr/events_handler.c @@ -19,12 +19,12 @@ static struct net_mgmt_event_callback ipv6_events_cb; static struct net_mgmt_event_callback ipv4_events_cb; static void conn_mgr_iface_events_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { int idx; - NET_DBG("%s event 0x%" PRIx64 " received on iface %d (%p)", "Iface", mgmt_event, + NET_DBG("%s event 0x%x received on iface %d (%p)", "Iface", mgmt_event, net_if_get_by_iface(iface), iface); if ((mgmt_event & CONN_MGR_IFACE_EVENTS_MASK) != mgmt_event) { @@ -55,12 +55,12 @@ static void conn_mgr_iface_events_handler(struct net_mgmt_event_callback *cb, #if defined(CONFIG_NET_IPV6) static void conn_mgr_ipv6_events_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { int idx; - NET_DBG("%s event 0x%" PRIx64 " received on iface %d (%p)", "IPv6", mgmt_event, + NET_DBG("%s event 0x%x received on iface %d (%p)", "IPv6", mgmt_event, net_if_get_by_iface(iface), iface); if ((mgmt_event & CONN_MGR_IPV6_EVENTS_MASK) != mgmt_event) { @@ -101,7 +101,7 @@ static void conn_mgr_ipv6_events_handler(struct net_mgmt_event_callback *cb, #else static inline void conn_mgr_ipv6_events_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(cb); @@ -112,12 +112,12 @@ void conn_mgr_ipv6_events_handler(struct net_mgmt_event_callback *cb, #if defined(CONFIG_NET_IPV4) static void conn_mgr_ipv4_events_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { int idx; - NET_DBG("%s event 0x%" PRIx64 " received on iface %d (%p)", "IPv4", mgmt_event, + NET_DBG("%s event 0x%x received on iface %d (%p)", "IPv4", mgmt_event, net_if_get_by_iface(iface), iface); if ((mgmt_event & CONN_MGR_IPV4_EVENTS_MASK) != mgmt_event) { @@ -159,7 +159,7 @@ static void conn_mgr_ipv4_events_handler(struct net_mgmt_event_callback *cb, #else static inline void conn_mgr_ipv4_events_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(cb); diff --git a/subsys/net/ip/ipv4_autoconf.c b/subsys/net/ip/ipv4_autoconf.c index ad399622a99..f08608f3b7e 100644 --- a/subsys/net/ip/ipv4_autoconf.c +++ b/subsys/net/ip/ipv4_autoconf.c @@ -55,7 +55,7 @@ static inline void ipv4_autoconf_addr_set(struct net_if_ipv4_autoconf *ipv4auto) } static void acd_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { struct net_if_config *cfg; struct in_addr *addr; diff --git a/subsys/net/ip/ipv6_pe.c b/subsys/net/ip/ipv6_pe.c index bb03683db39..4379dc47e7e 100644 --- a/subsys/net/ip/ipv6_pe.c +++ b/subsys/net/ip/ipv6_pe.c @@ -501,7 +501,7 @@ static void ipv6_pe_recheck_filters(bool is_denylist) #if CONFIG_NET_IPV6_PE_FILTER_PREFIX_COUNT > 0 static void send_filter_event(struct in6_addr *addr, bool is_denylist, - uint64_t event_type) + int event_type) { if (IS_ENABLED(CONFIG_NET_MGMT_EVENT_INFO)) { struct net_event_ipv6_pe_filter info; diff --git a/subsys/net/ip/net_mgmt.c b/subsys/net/ip/net_mgmt.c index d48a54e5611..4fbc1a1b599 100644 --- a/subsys/net/ip/net_mgmt.c +++ b/subsys/net/ip/net_mgmt.c @@ -27,7 +27,7 @@ struct mgmt_event_entry { #endif /* CONFIG_NET_MGMT_EVENT_QUEUE */ size_t info_length; #endif /* CONFIG_NET_MGMT_EVENT_INFO */ - uint64_t event; + uint32_t event; struct net_if *iface; }; @@ -47,7 +47,7 @@ K_KERNEL_STACK_DEFINE(mgmt_stack, CONFIG_NET_MGMT_EVENT_STACK_SIZE); static struct k_work_q mgmt_work_q_obj; #endif -static uint64_t global_event_mask; +static uint32_t global_event_mask; static sys_slist_t event_callbacks = SYS_SLIST_STATIC_INIT(&event_callbacks); /* Forward declaration for the actual caller */ @@ -67,7 +67,7 @@ static struct k_work_q *mgmt_work_q = COND_CODE_1(CONFIG_NET_MGMT_EVENT_SYSTEM_W static void mgmt_event_work_handler(struct k_work *work); static K_WORK_DEFINE(mgmt_work, mgmt_event_work_handler); -static inline void mgmt_push_event(uint64_t mgmt_event, struct net_if *iface, +static inline void mgmt_push_event(uint32_t mgmt_event, struct net_if *iface, const void *info, size_t length) { #ifndef CONFIG_NET_MGMT_EVENT_INFO @@ -85,7 +85,7 @@ static inline void mgmt_push_event(uint64_t mgmt_event, struct net_if *iface, memcpy(new_event.info, info, length); new_event.info_length = length; } else { - NET_ERR("Event 0x%" PRIx64 " info length %zu > max size %zu", + NET_ERR("Event %u info length %zu > max size %zu", mgmt_event, length, NET_EVENT_INFO_MAX_SIZE); (void)k_mutex_unlock(&net_mgmt_event_lock); @@ -99,7 +99,7 @@ static inline void mgmt_push_event(uint64_t mgmt_event, struct net_if *iface, if (k_msgq_put(&event_msgq, &new_event, K_MSEC(CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT)) != 0) { - NET_WARN("Failure to push event (0x%" PRIx64 "), " + NET_WARN("Failure to push event (%u), " "try increasing the 'CONFIG_NET_MGMT_EVENT_QUEUE_SIZE' " "or 'CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT' options.", mgmt_event); @@ -128,7 +128,7 @@ static void mgmt_event_work_handler(struct k_work *work) #else -static inline void mgmt_push_event(uint64_t event, struct net_if *iface, +static inline void mgmt_push_event(uint32_t event, struct net_if *iface, const void *info, size_t length) { #ifndef CONFIG_NET_MGMT_EVENT_INFO @@ -149,7 +149,7 @@ static inline void mgmt_push_event(uint64_t event, struct net_if *iface, #endif /* CONFIG_NET_MGMT_EVENT_QUEUE */ -static inline void mgmt_add_event_mask(uint64_t event_mask) +static inline void mgmt_add_event_mask(uint32_t event_mask) { global_event_mask |= event_mask; } @@ -169,7 +169,7 @@ static inline void mgmt_rebuild_global_event_mask(void) } } -static inline bool mgmt_is_event_handled(uint64_t mgmt_event) +static inline bool mgmt_is_event_handled(uint32_t mgmt_event) { return (((NET_MGMT_GET_LAYER(mgmt_event) & NET_MGMT_GET_LAYER(global_event_mask)) == @@ -188,7 +188,7 @@ static inline void mgmt_run_slist_callbacks(const struct mgmt_event_entry * cons struct net_mgmt_event_callback *cb, *tmp; /* Readable layer code is starting from 1, thus the increment */ - NET_DBG("Event layer 0x%" PRIx64 " code 0x%" PRIx64 " cmd 0x%" PRIx64, + NET_DBG("Event layer %u code %u cmd %u", NET_MGMT_GET_LAYER(mgmt_event->event) + 1, NET_MGMT_GET_LAYER_CODE(mgmt_event->event), NET_MGMT_GET_COMMAND(mgmt_event->event)); @@ -283,8 +283,8 @@ static void mgmt_run_callbacks(const struct mgmt_event_entry * const mgmt_event) } static int mgmt_event_wait_call(struct net_if *iface, - uint64_t mgmt_event_mask, - uint64_t *raised_event, + uint32_t mgmt_event_mask, + uint32_t *raised_event, struct net_if **event_iface, const void **info, size_t *info_length, @@ -303,7 +303,7 @@ static int mgmt_event_wait_call(struct net_if *iface, sync_data.iface = iface; } - NET_DBG("Synchronous event 0x%" PRIx64 " wait %p", sync.event_mask, &sync); + NET_DBG("Synchronous event 0x%08x wait %p", sync.event_mask, &sync); net_mgmt_add_event_callback(&sync); @@ -367,12 +367,12 @@ void net_mgmt_del_event_callback(struct net_mgmt_event_callback *cb) (void)k_mutex_unlock(&net_mgmt_callback_lock); } -void net_mgmt_event_notify_with_info(uint64_t mgmt_event, struct net_if *iface, +void net_mgmt_event_notify_with_info(uint32_t mgmt_event, struct net_if *iface, const void *info, size_t length) { if (mgmt_is_event_handled(mgmt_event)) { /* Readable layer code is starting from 1, thus the increment */ - NET_DBG("Notifying Event layer 0x%" PRIx64 " code 0x%" PRIx64 " type 0x%" PRIx64, + NET_DBG("Notifying Event layer %u code %u type %u", NET_MGMT_GET_LAYER(mgmt_event) + 1, NET_MGMT_GET_LAYER_CODE(mgmt_event), NET_MGMT_GET_COMMAND(mgmt_event)); @@ -381,8 +381,8 @@ void net_mgmt_event_notify_with_info(uint64_t mgmt_event, struct net_if *iface, } } -int net_mgmt_event_wait(uint64_t mgmt_event_mask, - uint64_t *raised_event, +int net_mgmt_event_wait(uint32_t mgmt_event_mask, + uint32_t *raised_event, struct net_if **iface, const void **info, size_t *info_length, @@ -394,8 +394,8 @@ int net_mgmt_event_wait(uint64_t mgmt_event_mask, } int net_mgmt_event_wait_on_iface(struct net_if *iface, - uint64_t mgmt_event_mask, - uint64_t *raised_event, + uint32_t mgmt_event_mask, + uint32_t *raised_event, const void **info, size_t *info_length, k_timeout_t timeout) diff --git a/subsys/net/ip/net_stats.c b/subsys/net/ip/net_stats.c index 9e7d0bb6fc7..5da625faeb6 100644 --- a/subsys/net/ip/net_stats.c +++ b/subsys/net/ip/net_stats.c @@ -252,7 +252,7 @@ void net_print_statistics(void) #if defined(CONFIG_NET_STATISTICS_USER_API) -static int net_stats_get(uint64_t mgmt_request, struct net_if *iface, +static int net_stats_get(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { size_t len_chk = 0; diff --git a/subsys/net/ip/pmtu.c b/subsys/net/ip/pmtu.c index cdd09ed0ca8..be2c3355a6b 100644 --- a/subsys/net/ip/pmtu.c +++ b/subsys/net/ip/pmtu.c @@ -12,6 +12,7 @@ LOG_MODULE_REGISTER(net_pmtu, CONFIG_NET_PMTU_LOG_LEVEL); #include +#include #include #include #include "pmtu.h" diff --git a/subsys/net/l2/ethernet/arp.c b/subsys/net/l2/ethernet/arp.c index d49ab054eaa..af816185fe1 100644 --- a/subsys/net/l2/ethernet/arp.c +++ b/subsys/net/l2/ethernet/arp.c @@ -569,7 +569,7 @@ static void notify_all_ipv4_addr(struct net_if *iface) } static void iface_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(cb); @@ -586,7 +586,7 @@ static void iface_event_handler(struct net_mgmt_event_callback *cb, } static void ipv4_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { struct in_addr *ipaddr; diff --git a/subsys/net/l2/ethernet/ethernet_mgmt.c b/subsys/net/l2/ethernet/ethernet_mgmt.c index 15efbc4f37c..3f1b6735318 100644 --- a/subsys/net/l2/ethernet/ethernet_mgmt.c +++ b/subsys/net/l2/ethernet/ethernet_mgmt.c @@ -25,7 +25,7 @@ static inline bool is_hw_caps_supported(const struct device *dev, return ((api->get_capabilities(dev) & caps) != 0); } -static int ethernet_set_config(uint64_t mgmt_request, +static int ethernet_set_config(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { @@ -255,7 +255,7 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_ETHERNET_SET_TXINJECTION_MODE, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_ETHERNET_SET_MAC_FILTER, ethernet_set_config); -static int ethernet_get_config(uint64_t mgmt_request, +static int ethernet_get_config(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { diff --git a/subsys/net/l2/ethernet/ethernet_stats.c b/subsys/net/l2/ethernet/ethernet_stats.c index 57d354623f6..ccbbd53e2f2 100644 --- a/subsys/net/l2/ethernet/ethernet_stats.c +++ b/subsys/net/l2/ethernet/ethernet_stats.c @@ -17,7 +17,7 @@ LOG_MODULE_REGISTER(net_ethernet_stats, CONFIG_NET_L2_ETHERNET_LOG_LEVEL); #if defined(CONFIG_NET_STATISTICS_USER_API) -static int eth_stats_get(uint64_t mgmt_request, struct net_if *iface, +static int eth_stats_get(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { size_t len_chk = 0; diff --git a/subsys/net/l2/ethernet/lldp/lldp.c b/subsys/net/l2/ethernet/lldp/lldp.c index 230e69eb6b8..2895691d6f0 100644 --- a/subsys/net/l2/ethernet/lldp/lldp.c +++ b/subsys/net/l2/ethernet/lldp/lldp.c @@ -234,7 +234,7 @@ static int lldp_check_iface(struct net_if *iface) return 0; } -static int lldp_start(struct net_if *iface, uint64_t mgmt_event) +static int lldp_start(struct net_if *iface, uint32_t mgmt_event) { struct ethernet_context *ctx; int ret, slot; @@ -328,7 +328,7 @@ int net_lldp_register_callback(struct net_if *iface, net_lldp_recv_cb_t recv_cb) } static void iface_event_handler(struct net_mgmt_event_callback *evt_cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { lldp_start(iface, mgmt_event); } diff --git a/subsys/net/l2/ieee802154/ieee802154_mgmt.c b/subsys/net/l2/ieee802154/ieee802154_mgmt.c index 3c654c375b6..993bcc12ae9 100644 --- a/subsys/net/l2/ieee802154/ieee802154_mgmt.c +++ b/subsys/net/l2/ieee802154/ieee802154_mgmt.c @@ -74,7 +74,7 @@ enum net_verdict ieee802154_handle_beacon(struct net_if *iface, return NET_CONTINUE; } -static int ieee802154_cancel_scan(uint64_t mgmt_request, struct net_if *iface, +static int ieee802154_cancel_scan(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { struct ieee802154_context *ctx = net_if_l2_data(iface); @@ -94,7 +94,7 @@ static int ieee802154_cancel_scan(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_CANCEL_SCAN, ieee802154_cancel_scan); -static int ieee802154_scan(uint64_t mgmt_request, struct net_if *iface, +static int ieee802154_scan(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct ieee802154_phy_supported_channels *supported_channels; @@ -437,7 +437,7 @@ enum net_verdict ieee802154_handle_mac_command(struct net_if *iface, return NET_DROP; } -static int ieee802154_associate(uint64_t mgmt_request, struct net_if *iface, +static int ieee802154_associate(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { struct ieee802154_context *ctx = net_if_l2_data(iface); @@ -631,7 +631,7 @@ static int ieee802154_associate(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_ASSOCIATE, ieee802154_associate); -static int ieee802154_disassociate(uint64_t mgmt_request, struct net_if *iface, +static int ieee802154_disassociate(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { struct ieee802154_context *ctx = net_if_l2_data(iface); @@ -706,7 +706,7 @@ static int ieee802154_disassociate(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_DISASSOCIATE, ieee802154_disassociate); -static int ieee802154_set_ack(uint64_t mgmt_request, struct net_if *iface, +static int ieee802154_set_ack(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { struct ieee802154_context *ctx = net_if_l2_data(iface); @@ -733,7 +733,7 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_SET_ACK, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_UNSET_ACK, ieee802154_set_ack); -static int ieee802154_set_parameters(uint64_t mgmt_request, +static int ieee802154_set_parameters(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { @@ -851,7 +851,7 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_SET_SHORT_ADDR, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_SET_TX_POWER, ieee802154_set_parameters); -static int ieee802154_get_parameters(uint64_t mgmt_request, +static int ieee802154_get_parameters(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { @@ -914,7 +914,7 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_GET_TX_POWER, #ifdef CONFIG_NET_L2_IEEE802154_SECURITY -static int ieee802154_set_security_settings(uint64_t mgmt_request, +static int ieee802154_set_security_settings(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { @@ -953,7 +953,7 @@ static int ieee802154_set_security_settings(uint64_t mgmt_request, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_IEEE802154_SET_SECURITY_SETTINGS, ieee802154_set_security_settings); -static int ieee802154_get_security_settings(uint64_t mgmt_request, +static int ieee802154_get_security_settings(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { diff --git a/subsys/net/l2/ieee802154/ieee802154_shell.c b/subsys/net/l2/ieee802154/ieee802154_shell.c index 777e7c6e46f..8a4e6ab0b6c 100644 --- a/subsys/net/l2/ieee802154/ieee802154_shell.c +++ b/subsys/net/l2/ieee802154/ieee802154_shell.c @@ -209,7 +209,7 @@ static inline char *print_coordinator_address(char *buf, int buf_len) } static void scan_result_cb(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { char buf[64]; @@ -224,7 +224,7 @@ static int cmd_ieee802154_scan(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_ieee802154(); - uint64_t scan_type; + uint32_t scan_type; int ret = 0; if (argc < 3) { diff --git a/subsys/net/l2/openthread/openthread.c b/subsys/net/l2/openthread/openthread.c index 4ed6a34162f..6ddeadf8dfc 100644 --- a/subsys/net/l2/openthread/openthread.c +++ b/subsys/net/l2/openthread/openthread.c @@ -34,7 +34,7 @@ static struct openthread_state_changed_callback ot_l2_state_changed_cb; #ifdef CONFIG_NET_MGMT_EVENT static struct net_mgmt_event_callback ip6_addr_cb; -static void ipv6_addr_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void ipv6_addr_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { if (net_if_l2(iface) != &NET_L2_GET_NAME(OPENTHREAD)) { diff --git a/subsys/net/l2/ppp/ppp_l2.c b/subsys/net/l2/ppp/ppp_l2.c index ae573a6e7ce..5521d76470e 100644 --- a/subsys/net/l2/ppp/ppp_l2.c +++ b/subsys/net/l2/ppp/ppp_l2.c @@ -474,7 +474,7 @@ static void tx_handler(void *p1, void *p2, void *p3) } } -static void net_ppp_mgmt_evt_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void net_ppp_mgmt_evt_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { struct ppp_context *ctx; diff --git a/subsys/net/l2/virtual/virtual_mgmt.c b/subsys/net/l2/virtual/virtual_mgmt.c index c6187e0dd9f..1210fc59083 100644 --- a/subsys/net/l2/virtual/virtual_mgmt.c +++ b/subsys/net/l2/virtual/virtual_mgmt.c @@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(net_virtual_mgmt, CONFIG_NET_L2_VIRTUAL_LOG_LEVEL); #include #include -static int virtual_interface_set_config(uint64_t mgmt_request, +static int virtual_interface_set_config(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { @@ -89,7 +89,7 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_VIRTUAL_INTERFACE_SET_LINK_TYPE, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_VIRTUAL_INTERFACE_SET_PRIVATE_KEY, virtual_interface_set_config); -static int virtual_interface_get_config(uint64_t mgmt_request, +static int virtual_interface_get_config(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 0183faab1d5..dc52c42a5c2 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -371,7 +371,7 @@ static const struct wifi_mgmt_ops *const get_wifi_api(struct net_if *iface) return off_api ? off_api->wifi_mgmt_api : NULL; } -static int wifi_connect(uint64_t mgmt_request, struct net_if *iface, +static int wifi_connect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { struct wifi_connect_req_params *params = @@ -475,7 +475,7 @@ static void scan_result_cb(struct net_if *iface, int status, #endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS_ONLY */ } -static int wifi_scan(uint64_t mgmt_request, struct net_if *iface, +static int wifi_scan(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -504,7 +504,7 @@ static int wifi_scan(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_SCAN, wifi_scan); -static int wifi_disconnect(uint64_t mgmt_request, struct net_if *iface, +static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -546,7 +546,7 @@ void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status) } #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_ROAMING -static int wifi_start_roaming(uint64_t mgmt_request, struct net_if *iface, +static int wifi_start_roaming(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -589,7 +589,7 @@ static int wifi_start_roaming(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_START_ROAMING, wifi_start_roaming); -static int wifi_neighbor_rep_complete(uint64_t mgmt_request, struct net_if *iface, +static int wifi_neighbor_rep_complete(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -684,7 +684,7 @@ void wifi_mgmt_raise_neighbor_rep_recv_event(struct net_if *iface, char *inbuf, } #endif -static int wifi_ap_enable(uint64_t mgmt_request, struct net_if *iface, +static int wifi_ap_enable(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { struct wifi_connect_req_params *params = @@ -705,7 +705,7 @@ static int wifi_ap_enable(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_ENABLE, wifi_ap_enable); -static int wifi_ap_disable(uint64_t mgmt_request, struct net_if *iface, +static int wifi_ap_disable(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -724,7 +724,7 @@ static int wifi_ap_disable(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable); -static int wifi_ap_sta_disconnect(uint64_t mgmt_request, struct net_if *iface, +static int wifi_ap_sta_disconnect(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -752,7 +752,7 @@ static int wifi_ap_sta_disconnect(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_STA_DISCONNECT, wifi_ap_sta_disconnect); -static int wifi_ap_config_params(uint64_t mgmt_request, struct net_if *iface, +static int wifi_ap_config_params(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -790,7 +790,7 @@ static int wifi_ap_config_params(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_CONFIG_PARAM, wifi_ap_config_params); -static int wifi_ap_set_rts_threshold(uint64_t mgmt_request, struct net_if *iface, +static int wifi_ap_set_rts_threshold(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -814,7 +814,7 @@ static int wifi_ap_set_rts_threshold(uint64_t mgmt_request, struct net_if *iface NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_RTS_THRESHOLD, wifi_ap_set_rts_threshold); -static int wifi_iface_status(uint64_t mgmt_request, struct net_if *iface, +static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -842,7 +842,7 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface, } #ifdef CONFIG_NET_STATISTICS_WIFI -static int wifi_iface_stats(uint64_t mgmt_request, struct net_if *iface, +static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -861,7 +861,7 @@ static int wifi_iface_stats(uint64_t mgmt_request, struct net_if *iface, } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); -static int wifi_iface_stats_reset(uint64_t mgmt_request, struct net_if *iface, +static int wifi_iface_stats_reset(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -876,7 +876,7 @@ static int wifi_iface_stats_reset(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_RESET_WIFI, wifi_iface_stats_reset); #endif /* CONFIG_NET_STATISTICS_WIFI */ -static int wifi_11k_cfg(uint64_t mgmt_request, struct net_if *iface, +static int wifi_11k_cfg(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -902,7 +902,7 @@ static int wifi_11k_cfg(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_11K_CONFIG, wifi_11k_cfg); -static int wifi_11k_neighbor_request(uint64_t mgmt_request, struct net_if *iface, +static int wifi_11k_neighbor_request(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -923,7 +923,7 @@ static int wifi_11k_neighbor_request(uint64_t mgmt_request, struct net_if *iface NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_11K_NEIGHBOR_REQUEST, wifi_11k_neighbor_request); -static int wifi_set_power_save(uint64_t mgmt_request, struct net_if *iface, +static int wifi_set_power_save(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -977,7 +977,7 @@ static int wifi_set_power_save(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_PS, wifi_set_power_save); -static int wifi_get_power_save_config(uint64_t mgmt_request, struct net_if *iface, +static int wifi_get_power_save_config(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1001,7 +1001,7 @@ static int wifi_get_power_save_config(uint64_t mgmt_request, struct net_if *ifac NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_PS_CONFIG, wifi_get_power_save_config); -static int wifi_set_twt(uint64_t mgmt_request, struct net_if *iface, +static int wifi_set_twt(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1068,7 +1068,7 @@ static int wifi_set_twt(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_TWT, wifi_set_twt); -static int wifi_set_btwt(uint64_t mgmt_request, struct net_if *iface, +static int wifi_set_btwt(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1108,7 +1108,7 @@ void wifi_mgmt_raise_twt_event(struct net_if *iface, struct wifi_twt_params *twt sizeof(struct wifi_twt_params)); } -static int wifi_reg_domain(uint64_t mgmt_request, struct net_if *iface, +static int wifi_reg_domain(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1140,7 +1140,7 @@ void wifi_mgmt_raise_twt_sleep_state(struct net_if *iface, sizeof(twt_sleep_state)); } -static int wifi_mode(uint64_t mgmt_request, struct net_if *iface, +static int wifi_mode(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1164,7 +1164,7 @@ static int wifi_mode(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_MODE, wifi_mode); -static int wifi_packet_filter(uint64_t mgmt_request, struct net_if *iface, +static int wifi_packet_filter(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1188,7 +1188,7 @@ static int wifi_packet_filter(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_PACKET_FILTER, wifi_packet_filter); -static int wifi_channel(uint64_t mgmt_request, struct net_if *iface, +static int wifi_channel(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1212,7 +1212,7 @@ static int wifi_channel(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_CHANNEL, wifi_channel); -static int wifi_get_version(uint64_t mgmt_request, struct net_if *iface, +static int wifi_get_version(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1228,7 +1228,7 @@ static int wifi_get_version(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_VERSION, wifi_get_version); -static int wifi_btm_query(uint64_t mgmt_request, struct net_if *iface, void *data, size_t len) +static int wifi_btm_query(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_api(iface); @@ -1252,7 +1252,7 @@ static int wifi_btm_query(uint64_t mgmt_request, struct net_if *iface, void *dat NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_BTM_QUERY, wifi_btm_query); -static int wifi_get_connection_params(uint64_t mgmt_request, struct net_if *iface, +static int wifi_get_connection_params(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1272,7 +1272,7 @@ static int wifi_get_connection_params(uint64_t mgmt_request, struct net_if *ifac NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_CONN_PARAMS, wifi_get_connection_params); -static int wifi_wps_config(uint64_t mgmt_request, struct net_if *iface, void *data, size_t len) +static int wifi_wps_config(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_api(iface); @@ -1291,7 +1291,7 @@ static int wifi_wps_config(uint64_t mgmt_request, struct net_if *iface, void *da NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_WPS_CONFIG, wifi_wps_config); -static int wifi_set_rts_threshold(uint64_t mgmt_request, struct net_if *iface, +static int wifi_set_rts_threshold(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1316,7 +1316,7 @@ static int wifi_set_rts_threshold(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_RTS_THRESHOLD, wifi_set_rts_threshold); #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP -static int wifi_dpp(uint64_t mgmt_request, struct net_if *iface, +static int wifi_dpp(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1338,7 +1338,7 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DPP, wifi_dpp); #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */ -static int wifi_pmksa_flush(uint64_t mgmt_request, struct net_if *iface, +static int wifi_pmksa_flush(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1357,7 +1357,7 @@ static int wifi_pmksa_flush(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_PMKSA_FLUSH, wifi_pmksa_flush); -static int wifi_get_rts_threshold(uint64_t mgmt_request, struct net_if *iface, +static int wifi_get_rts_threshold(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1382,7 +1382,7 @@ static int wifi_get_rts_threshold(uint64_t mgmt_request, struct net_if *iface, NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_RTS_THRESHOLD_CONFIG, wifi_get_rts_threshold); #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE -static int wifi_set_enterprise_creds(uint64_t mgmt_request, struct net_if *iface, +static int wifi_set_enterprise_creds(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { const struct device *dev = net_if_get_device(iface); @@ -1721,7 +1721,7 @@ static int add_static_network_config(struct net_if *iface) #endif /* defined(CONFIG_WIFI_CREDENTIALS_STATIC) */ } -static int connect_stored_command(uint64_t mgmt_request, struct net_if *iface, void *data, +static int connect_stored_command(uint32_t mgmt_request, struct net_if *iface, void *data, size_t len) { int ret = 0; diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 8a5468ba81b..07514b53a33 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -518,7 +518,7 @@ static void handle_wifi_neighbor_rep_complete(struct net_mgmt_event_callback *cb #endif static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { switch (mgmt_event) { case NET_EVENT_WIFI_CONNECT_RESULT: @@ -556,7 +556,7 @@ static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, } static void wifi_mgmt_scan_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { switch (mgmt_event) { case NET_EVENT_WIFI_SCAN_RESULT: diff --git a/subsys/net/lib/coap/coap.c b/subsys/net/lib/coap/coap.c index 4ba5f4d309e..b1d00a46f1d 100644 --- a/subsys/net/lib/coap/coap.c +++ b/subsys/net/lib/coap/coap.c @@ -1956,7 +1956,7 @@ void coap_observer_init(struct coap_observer *observer, static inline void coap_observer_raise_event(struct coap_resource *resource, struct coap_observer *observer, - uint64_t mgmt_event) + uint32_t mgmt_event) { #ifdef CONFIG_NET_MGMT_EVENT_INFO const struct net_event_coap_observer net_event = { diff --git a/subsys/net/lib/coap/coap_server.c b/subsys/net/lib/coap/coap_server.c index 27e4267167f..6ab85ede3f1 100644 --- a/subsys/net/lib/coap/coap_server.c +++ b/subsys/net/lib/coap/coap_server.c @@ -385,7 +385,7 @@ static inline bool coap_service_in_section(const struct coap_service *service) STRUCT_SECTION_END(coap_service) > service; } -static inline void coap_service_raise_event(const struct coap_service *service, uint64_t mgmt_event) +static inline void coap_service_raise_event(const struct coap_service *service, uint32_t mgmt_event) { #if defined(CONFIG_NET_MGMT_EVENT_INFO) const struct net_event_coap_service net_event = { diff --git a/subsys/net/lib/config/init.c b/subsys/net/lib/config/init.c index 22500fd8f84..56b6bc03b6c 100644 --- a/subsys/net/lib/config/init.c +++ b/subsys/net/lib/config/init.c @@ -102,7 +102,7 @@ static void print_dhcpv4_info(struct net_if *iface) static struct net_mgmt_event_callback mgmt4_cb; static void ipv4_addr_add_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_IPV4_ADDR_ADD) { @@ -244,7 +244,7 @@ static struct net_mgmt_event_callback mgmt6_cb; static struct in6_addr laddr; static void ipv6_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { struct net_if_ipv6 *ipv6 = iface->config.ip.ipv6; int i; @@ -310,7 +310,7 @@ static void ipv6_event_handler(struct net_mgmt_event_callback *cb, static void setup_ipv6(struct net_if *iface, uint32_t flags) { struct net_if_addr *ifaddr; - uint64_t mask = NET_EVENT_IPV6_DAD_SUCCEED; + uint32_t mask = NET_EVENT_IPV6_DAD_SUCCEED; if (sizeof(CONFIG_NET_CONFIG_MY_IPV6_ADDR) == 1) { /* Empty address, skip setting ANY address in this case */ @@ -330,10 +330,20 @@ static void setup_ipv6(struct net_if *iface, uint32_t flags) net_mgmt_init_event_callback(&mgmt6_cb, ipv6_event_handler, mask); net_mgmt_add_event_callback(&mgmt6_cb); - ifaddr = net_if_ipv6_addr_add(iface, &laddr, NET_ADDR_MANUAL, 0); - if (!ifaddr) { - NET_ERR("Cannot add %s to interface", - CONFIG_NET_CONFIG_MY_IPV6_ADDR); + /* + * check for CMD_ADDR_ADD bit here, NET_EVENT_IPV6_ADDR_ADD is + * a combination of _NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_ADD + * so it will always return != NET_EVENT_IPV6_CMD_ADDR_ADD if any other + * event is set (for instance NET_EVENT_IPV6_ROUTER_ADD) + */ + if ((mask & NET_EVENT_IPV6_CMD_ADDR_ADD) == + NET_EVENT_IPV6_CMD_ADDR_ADD) { + ifaddr = net_if_ipv6_addr_add(iface, &laddr, + NET_ADDR_MANUAL, 0); + if (!ifaddr) { + NET_ERR("Cannot add %s to interface", + CONFIG_NET_CONFIG_MY_IPV6_ADDR); + } } exit: @@ -353,7 +363,7 @@ static void setup_ipv6(struct net_if *iface, uint32_t flags) #if defined(CONFIG_NET_NATIVE) static void iface_up_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_IF_UP) { NET_INFO("Interface %d (%p) coming up", diff --git a/subsys/net/lib/config/init_clock_sntp.c b/subsys/net/lib/config/init_clock_sntp.c index 0e2b9aa1362..dd63564f9c0 100644 --- a/subsys/net/lib/config/init_clock_sntp.c +++ b/subsys/net/lib/config/init_clock_sntp.c @@ -89,7 +89,7 @@ static void sntp_resync_handler(struct k_work *work) #endif /* CONFIG_NET_CONFIG_SNTP_INIT_RESYNC */ #ifdef CONFIG_NET_CONFIG_SNTP_INIT_USE_CONNECTION_MANAGER -static void l4_event_handler(uint64_t mgmt_event, struct net_if *iface, void *info, +static void l4_event_handler(uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data) { ARG_UNUSED(iface); diff --git a/subsys/net/lib/dhcpv4/dhcpv4.c b/subsys/net/lib/dhcpv4/dhcpv4.c index f9a20bb7dfe..2096bf330d9 100644 --- a/subsys/net/lib/dhcpv4/dhcpv4.c +++ b/subsys/net/lib/dhcpv4/dhcpv4.c @@ -1637,7 +1637,7 @@ static enum net_verdict net_dhcpv4_input(struct net_conn *conn, } static void dhcpv4_iface_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { sys_snode_t *node = NULL; @@ -1699,7 +1699,7 @@ static void dhcpv4_iface_event_handler(struct net_mgmt_event_callback *cb, #if defined(CONFIG_NET_IPV4_ACD) static void dhcpv4_acd_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { sys_snode_t *node = NULL; struct in_addr *addr; diff --git a/subsys/net/lib/dhcpv6/dhcpv6.c b/subsys/net/lib/dhcpv6/dhcpv6.c index 88770bac66d..c1282c2a6f1 100644 --- a/subsys/net/lib/dhcpv6/dhcpv6.c +++ b/subsys/net/lib/dhcpv6/dhcpv6.c @@ -2200,7 +2200,7 @@ static void dhcpv6_timeout(struct k_work *work) } static void dhcpv6_iface_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { sys_snode_t *node = NULL; diff --git a/subsys/net/lib/dns/llmnr_responder.c b/subsys/net/lib/dns/llmnr_responder.c index f0f1f57ff28..bf330e24374 100644 --- a/subsys/net/lib/dns/llmnr_responder.c +++ b/subsys/net/lib/dns/llmnr_responder.c @@ -117,7 +117,7 @@ static void create_ipv4_dst_addr(struct sockaddr_in *src_addr, #endif static void llmnr_iface_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_IF_UP) { #if defined(CONFIG_NET_IPV4) diff --git a/subsys/net/lib/dns/mdns_responder.c b/subsys/net/lib/dns/mdns_responder.c index 8642364bc2b..29f1c657ae1 100644 --- a/subsys/net/lib/dns/mdns_responder.c +++ b/subsys/net/lib/dns/mdns_responder.c @@ -157,7 +157,7 @@ static void mark_needs_announce(struct net_if *iface, bool needs_announce) #endif /* CONFIG_MDNS_RESPONDER_PROBE */ static void mdns_iface_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_IF_UP) { @@ -958,7 +958,7 @@ static void probing(struct k_work *work) } static void mdns_addr_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { uint32_t probe_delay = sys_rand32_get() % 250; bool probe_started = false; @@ -1110,7 +1110,7 @@ static void mdns_addr_event_handler(struct net_mgmt_event_callback *cb, } static void mdns_conn_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_L4_DISCONNECTED) { /* Clear the failed probes counter so that we can start @@ -1823,7 +1823,7 @@ static void do_init_listener(struct k_work *work) static int mdns_responder_init(void) { - uint64_t flags = NET_EVENT_IF_UP; + uint32_t flags = NET_EVENT_IF_UP; external_records = NULL; external_records_count = 0; diff --git a/subsys/net/lib/ptp/port.c b/subsys/net/lib/ptp/port.c index d3f803cb391..24abec002c8 100644 --- a/subsys/net/lib/ptp/port.c +++ b/subsys/net/lib/ptp/port.c @@ -964,7 +964,7 @@ int port_state_update(struct ptp_port *port, enum ptp_port_event event, bool tt_ } static void port_link_monitor(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(cb); diff --git a/subsys/net/lib/shell/events.c b/subsys/net/lib/shell/events.c index 51afbc85fc9..6b27dc2e4b0 100644 --- a/subsys/net/lib/shell/events.c +++ b/subsys/net/lib/shell/events.c @@ -44,7 +44,7 @@ static const char unknown_event_str[] = ""; struct event_msg { struct net_if *iface; size_t len; - uint64_t event; + uint32_t event; uint8_t data[MAX_EVENT_INFO_SIZE]; }; @@ -52,7 +52,7 @@ K_MSGQ_DEFINE(event_mon_msgq, sizeof(struct event_msg), CONFIG_NET_MGMT_EVENT_QUEUE_SIZE, sizeof(intptr_t)); static void event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { struct event_msg msg; int ret; @@ -563,7 +563,7 @@ static void event_mon_handler(const struct shell *sh, void *p2, void *p3) } if (desc == unknown_event_str) { - PR_INFO("EVENT: %s [%d] %s%s%s%s%s (0x%" PRIx64 ")\n", layer_str, + PR_INFO("EVENT: %s [%d] %s%s%s%s%s (0x%08x)\n", layer_str, net_if_get_by_iface(msg.iface), desc, desc2 ? " " : "", desc2 ? desc2 : "", info ? " " : "", info ? info : "", msg.event); diff --git a/subsys/net/lib/sockets/sockets_net_mgmt.c b/subsys/net/lib/sockets/sockets_net_mgmt.c index 0b45416c1f2..909893e0444 100644 --- a/subsys/net/lib/sockets/sockets_net_mgmt.c +++ b/subsys/net/lib/sockets/sockets_net_mgmt.c @@ -31,7 +31,7 @@ __net_socket struct net_mgmt_socket { uintptr_t pid; /* net_mgmt mask */ - uint64_t mask; + uint32_t mask; /* Message allocation timeout */ k_timeout_t alloc_timeout; @@ -145,7 +145,7 @@ static ssize_t znet_mgmt_recvfrom(struct net_mgmt_socket *mgmt, void *buf, { struct sockaddr_nm *nm_addr = (struct sockaddr_nm *)src_addr; k_timeout_t timeout = mgmt->wait_timeout; - uint64_t raised_event = 0; + uint32_t raised_event = 0; uint8_t *copy_to = buf; struct net_mgmt_msghdr hdr; struct net_if *iface; diff --git a/subsys/shell/backends/shell_mqtt.c b/subsys/shell/backends/shell_mqtt.c index d77cbac6742..28bd39f4b0d 100644 --- a/subsys/shell/backends/shell_mqtt.c +++ b/subsys/shell/backends/shell_mqtt.c @@ -508,7 +508,7 @@ static void net_disconnect_handler(struct k_work *work) } /* Network connection event handler */ -static void network_evt_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void network_evt_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { struct shell_mqtt *sh = sh_mqtt; diff --git a/tests/boards/espressif/ethernet/src/main.c b/tests/boards/espressif/ethernet/src/main.c index e9c397d795f..b64bc946366 100644 --- a/tests/boards/espressif/ethernet/src/main.c +++ b/tests/boards/espressif/ethernet/src/main.c @@ -30,7 +30,7 @@ static uint8_t ntp_server[4]; static struct net_mgmt_event_callback mgmt_cb; static struct net_dhcpv4_option_callback dhcp_cb; -static void ipv4_event(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void ipv4_event(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { if ((mgmt_event != NET_EVENT_IPV4_ADDR_ADD) || diff --git a/tests/boards/espressif/wifi/src/main.c b/tests/boards/espressif/wifi/src/main.c index 931927ef25d..bbccdb9b2a9 100644 --- a/tests/boards/espressif/wifi/src/main.c +++ b/tests/boards/espressif/wifi/src/main.c @@ -93,7 +93,7 @@ static void wifi_disconnect_result(struct net_mgmt_event_callback *cb) } } -static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { switch (mgmt_event) { diff --git a/tests/net/conn_mgr_conn/src/main.c b/tests/net/conn_mgr_conn/src/main.c index 940d142b8db..b66e246b12d 100644 --- a/tests/net/conn_mgr_conn/src/main.c +++ b/tests/net/conn_mgr_conn/src/main.c @@ -95,7 +95,7 @@ static struct event_stats { struct net_mgmt_event_callback conn_mgr_conn_callback; static void conn_mgr_conn_handler(struct net_mgmt_event_callback *cb, - uint64_t event, struct net_if *iface) + uint32_t event, struct net_if *iface) { k_mutex_lock(&event_mutex, K_FOREVER); diff --git a/tests/net/conn_mgr_monitor/src/main.c b/tests/net/conn_mgr_monitor/src/main.c index e1e1cd67081..cd8242c10d1 100644 --- a/tests/net/conn_mgr_monitor/src/main.c +++ b/tests/net/conn_mgr_monitor/src/main.c @@ -38,12 +38,12 @@ #define DAD_WAIT_TIME EVENT_WAIT_TIME #endif -#define TEST_EXPECT_L4_CONNECTED NET_EVENT_L4_CMD_CONNECTED -#define TEST_EXPECT_L4_DISCONNECTED NET_EVENT_L4_CMD_DISCONNECTED -#define TEST_EXPECT_L4_IPV6_CONNECTED NET_EVENT_L4_CMD_IPV6_CONNECTED -#define TEST_EXPECT_L4_IPV6_DISCONNECTED NET_EVENT_L4_CMD_IPV6_DISCONNECTED -#define TEST_EXPECT_L4_IPV4_CONNECTED NET_EVENT_L4_CMD_IPV4_CONNECTED -#define TEST_EXPECT_L4_IPV4_DISCONNECTED NET_EVENT_L4_CMD_IPV4_DISCONNECTED +#define TEST_EXPECT_L4_CONNECTED BIT(NET_EVENT_L4_CMD_CONNECTED) +#define TEST_EXPECT_L4_DISCONNECTED BIT(NET_EVENT_L4_CMD_DISCONNECTED) +#define TEST_EXPECT_L4_IPV6_CONNECTED BIT(NET_EVENT_L4_CMD_IPV6_CONNECTED) +#define TEST_EXPECT_L4_IPV6_DISCONNECTED BIT(NET_EVENT_L4_CMD_IPV6_DISCONNECTED) +#define TEST_EXPECT_L4_IPV4_CONNECTED BIT(NET_EVENT_L4_CMD_IPV4_CONNECTED) +#define TEST_EXPECT_L4_IPV4_DISCONNECTED BIT(NET_EVENT_L4_CMD_IPV4_DISCONNECTED) #define TEST_EXPECT_CLEAR(event) (global_stats.expected_events &= ~event) @@ -162,7 +162,7 @@ static struct test_stats get_reset_stats(void) /* Callback hooks */ struct net_mgmt_event_callback l4_callback; -void l4_handler(struct net_mgmt_event_callback *cb, uint64_t event, struct net_if *iface) +void l4_handler(struct net_mgmt_event_callback *cb, uint32_t event, struct net_if *iface) { if (event == NET_EVENT_L4_CONNECTED) { k_mutex_lock(&stats_mutex, K_FOREVER); @@ -187,7 +187,7 @@ void l4_handler(struct net_mgmt_event_callback *cb, uint64_t event, struct net_i struct net_mgmt_event_callback conn_callback; -void conn_handler(struct net_mgmt_event_callback *cb, uint64_t event, struct net_if *iface) +void conn_handler(struct net_mgmt_event_callback *cb, uint32_t event, struct net_if *iface) { if (event == NET_EVENT_L4_IPV6_CONNECTED) { k_mutex_lock(&stats_mutex, K_FOREVER); @@ -224,7 +224,7 @@ void conn_handler(struct net_mgmt_event_callback *cb, uint64_t event, struct net } } -static void wait_for_events(uint64_t event_mask, k_timeout_t timeout) +static void wait_for_events(uint32_t event_mask, k_timeout_t timeout) { k_mutex_lock(&stats_mutex, K_FOREVER); k_sem_reset(&event_sem); diff --git a/tests/net/conn_mgr_nsos/src/main.c b/tests/net/conn_mgr_nsos/src/main.c index d4e014accff..41c4273f262 100644 --- a/tests/net/conn_mgr_nsos/src/main.c +++ b/tests/net/conn_mgr_nsos/src/main.c @@ -15,7 +15,7 @@ K_SEM_DEFINE(l4_connected, 0, 1); K_SEM_DEFINE(l4_disconnected, 0, 1); -static void l4_event_handler(struct net_mgmt_event_callback *cb, uint64_t event, +static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event, struct net_if *iface) { switch (event) { diff --git a/tests/net/dhcpv4/client/prj.conf b/tests/net/dhcpv4/client/prj.conf index 5ac77585482..5b126f90a14 100644 --- a/tests/net/dhcpv4/client/prj.conf +++ b/tests/net/dhcpv4/client/prj.conf @@ -20,7 +20,6 @@ CONFIG_NET_MGMT_EVENT=y CONFIG_NET_MGMT_EVENT_INFO=y CONFIG_DNS_RESOLVER=y -CONFIG_DNS_RESOLVER_MAX_SERVERS=3 # Turn off UDP checksum checking as the test fails otherwise. CONFIG_NET_UDP_CHECKSUM=n @@ -32,5 +31,3 @@ CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX=2 CONFIG_NET_DHCPV4_LOG_LEVEL_DBG=y CONFIG_LOG_BUFFER_SIZE=8192 - -CONFIG_ZVFS_POLL_MAX=5 diff --git a/tests/net/dhcpv4/client/src/main.c b/tests/net/dhcpv4/client/src/main.c index 7c87ab4d478..654a98d2cbe 100644 --- a/tests/net/dhcpv4/client/src/main.c +++ b/tests/net/dhcpv4/client/src/main.c @@ -493,7 +493,7 @@ static struct net_dhcpv4_option_callback opt_vs_invalid_cb; static int event_count; static void receiver_cb(struct net_mgmt_event_callback *cb, - uint64_t nm_event, struct net_if *iface) + uint32_t nm_event, struct net_if *iface) { if (nm_event != NET_EVENT_IPV4_ADDR_ADD && nm_event != NET_EVENT_DNS_SERVER_ADD && @@ -694,7 +694,7 @@ ZTEST(dhcpv4_tests, test_dhcp) #elif defined(CONFIG_NET_DHCPV4_OPTION_CALLBACKS) while (event_count < 10) { #elif defined(CONFIG_NET_DHCPV4_OPTION_PRINT_IGNORED) - while (event_count < 1) { + while (event_count < 2) { #else while (event_count < 5) { #endif diff --git a/tests/net/dhcpv6/src/main.c b/tests/net/dhcpv6/src/main.c index b1375383c67..c5046a2746a 100644 --- a/tests/net/dhcpv6/src/main.c +++ b/tests/net/dhcpv6/src/main.c @@ -178,7 +178,7 @@ static struct net_pkt *test_dhcpv6_create_message( return NULL; } -static void evt_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void evt_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(cb); diff --git a/tests/net/hostname/src/main.c b/tests/net/hostname/src/main.c index b5c0664d2ef..bfc2fd926f8 100644 --- a/tests/net/hostname/src/main.c +++ b/tests/net/hostname/src/main.c @@ -101,7 +101,7 @@ static void net_iface_init(struct net_if *iface) #ifdef CONFIG_NET_MGMT_EVENT static void hostname_changed(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_HOSTNAME_CHANGED) { #ifdef CONFIG_NET_MGMT_EVENT_INFO diff --git a/tests/net/ieee802154/l2/src/ieee802154_shell_test.c b/tests/net/ieee802154/l2/src/ieee802154_shell_test.c index 5964025e023..0281b699edb 100644 --- a/tests/net/ieee802154/l2/src/ieee802154_shell_test.c +++ b/tests/net/ieee802154/l2/src/ieee802154_shell_test.c @@ -50,7 +50,7 @@ static bool expected_association_permitted_bit; #define EXPECTED_PAYLOAD_DATA EXPECTED_ENDDEVICE_EXT_ADDR_LE #define EXPECTED_PAYLOAD_LEN 8 -static void scan_result_cb(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, +static void scan_result_cb(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { struct ieee802154_context *ctx = net_if_l2_data(iface); diff --git a/tests/net/igmp/src/main.c b/tests/net/igmp/src/main.c index e2f201dd4ee..7878c5953eb 100644 --- a/tests/net/igmp/src/main.c +++ b/tests/net/igmp/src/main.c @@ -227,7 +227,7 @@ NET_DEVICE_INIT(net_test_igmp, "net_test_igmp", 127); static void group_joined(struct net_mgmt_event_callback *cb, - uint64_t nm_event, struct net_if *iface) + uint32_t nm_event, struct net_if *iface) { if (nm_event != NET_EVENT_IPV4_MCAST_JOIN) { /* Spurious callback. */ @@ -240,7 +240,7 @@ static void group_joined(struct net_mgmt_event_callback *cb, } static void group_left(struct net_mgmt_event_callback *cb, - uint64_t nm_event, struct net_if *iface) + uint32_t nm_event, struct net_if *iface) { if (nm_event != NET_EVENT_IPV4_MCAST_LEAVE) { /* Spurious callback. */ @@ -253,7 +253,7 @@ static void group_left(struct net_mgmt_event_callback *cb, } static struct mgmt_events { - uint64_t event; + uint32_t event; net_mgmt_event_handler_t handler; struct net_mgmt_event_callback cb; } mgmt_events[] = { diff --git a/tests/net/lib/dns_addremove/src/main.c b/tests/net/lib/dns_addremove/src/main.c index f8f9fdc1c80..1b6f55efd73 100644 --- a/tests/net/lib/dns_addremove/src/main.c +++ b/tests/net/lib/dns_addremove/src/main.c @@ -139,7 +139,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface1_test, 127); static void dns_evt_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { if (mgmt_event == NET_EVENT_DNS_SERVER_ADD) { k_sem_give(&dns_added); diff --git a/tests/net/mgmt/src/mgmt.c b/tests/net/mgmt/src/mgmt.c index 288dcc353b2..004b60adb97 100644 --- a/tests/net/mgmt/src/mgmt.c +++ b/tests/net/mgmt/src/mgmt.c @@ -28,7 +28,7 @@ LOG_MODULE_REGISTER(net_test, CONFIG_NET_MGMT_EVENT_LOG_LEVEL); MAX(sizeof(TEST_INFO_STRING), sizeof(struct in6_addr)) /* Notifier infra */ -static uint64_t event2throw; +static uint32_t event2throw; static uint32_t throw_times; static uint32_t throw_sleep; static bool with_info; @@ -38,7 +38,7 @@ static struct k_thread thrower_thread_data; static struct k_sem thrower_lock; /* Receiver infra */ -static uint64_t rx_event; +static uint32_t rx_event; static uint32_t rx_calls; static size_t info_length_in_test; static struct net_mgmt_event_callback rx_cb; @@ -49,7 +49,7 @@ static struct in6_addr addr6 = { { { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, static char info_data[TEST_MGMT_EVENT_INFO_SIZE]; -static int test_mgmt_request(uint64_t mgmt_request, +static int test_mgmt_request(uint32_t mgmt_request, struct net_if *iface, void *data, uint32_t len) { uint32_t *test_data = data; @@ -67,14 +67,14 @@ static int test_mgmt_request(uint64_t mgmt_request, NET_MGMT_REGISTER_REQUEST_HANDLER(TEST_MGMT_REQUEST, test_mgmt_request); -static void test_mgmt_event_handler(uint64_t mgmt_event, struct net_if *iface, void *info, +static void test_mgmt_event_handler(uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data) { if (!with_static) { return; } - TC_PRINT("\t\tReceived static event 0x%" PRIx64 "\n", mgmt_event); + TC_PRINT("\t\tReceived static event 0x%08X\n", mgmt_event); ARG_UNUSED(user_data); @@ -144,7 +144,7 @@ static void thrower_thread(void *p1, void *p2, void *p3) while (1) { k_sem_take(&thrower_lock, K_FOREVER); - TC_PRINT("\tThrowing event 0x%" PRIx64 " %u times\n", + TC_PRINT("\tThrowing event 0x%08X %u times\n", event2throw, throw_times); for (; throw_times; throw_times--) { @@ -168,9 +168,9 @@ static void thrower_thread(void *p1, void *p2, void *p3) } static void receiver_cb(struct net_mgmt_event_callback *cb, - uint64_t nm_event, struct net_if *iface) + uint32_t nm_event, struct net_if *iface) { - TC_PRINT("\t\tReceived event 0x%" PRIx64 "\n", nm_event); + TC_PRINT("\t\tReceived event 0x%08X\n", nm_event); if (with_info && cb->info) { if (cb->info_length != info_length_in_test) { @@ -208,15 +208,14 @@ static int sending_event(uint32_t times, bool receiver, bool info) k_msleep(THREAD_SLEEP); if (receiver) { - TC_PRINT("\tReceived 0x%" PRIx64 " %u times\n", + TC_PRINT("\tReceived 0x%08X %u times\n", rx_event, rx_calls); zassert_equal(rx_event, event2throw, "rx_event check failed"); zassert_equal(rx_calls, times, "rx_calls check failed"); net_mgmt_del_event_callback(&rx_cb); - rx_event = 0ULL; - rx_calls = 0U; + rx_event = rx_calls = 0U; } return TC_PASS; @@ -234,7 +233,7 @@ static int test_sending_event_info(uint32_t times, bool receiver) static int test_synchronous_event_listener(uint32_t times, bool on_iface) { - uint64_t event_mask; + uint32_t event_mask; int ret; TC_PRINT("- Synchronous event listener %s\n", @@ -284,14 +283,13 @@ static int test_static_event_listener(uint32_t times, bool info) /* Let the network stack to proceed */ k_msleep(THREAD_SLEEP); - TC_PRINT("\tReceived 0x%" PRIx64 " %u times\n", + TC_PRINT("\tReceived 0x%08X %u times\n", rx_event, rx_calls); zassert_equal(rx_event, event2throw, "rx_event check failed"); zassert_equal(rx_calls, times, "rx_calls check failed"); - rx_event = 0ULL; - rx_calls = 0U; + rx_event = rx_calls = 0U; with_static = false; return TC_PASS; @@ -299,12 +297,12 @@ static int test_static_event_listener(uint32_t times, bool info) static void initialize_event_tests(void) { - event2throw = 0ULL; + event2throw = 0U; throw_times = 0U; throw_sleep = 0; with_info = false; - rx_event = 0ULL; + rx_event = 0U; rx_calls = 0U; k_sem_init(&thrower_lock, 0, UINT_MAX); @@ -320,9 +318,9 @@ static void initialize_event_tests(void) NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT); } -static int test_core_event(uint64_t event, bool (*func)(void)) +static int test_core_event(uint32_t event, bool (*func)(void)) { - TC_PRINT("- Triggering core event: 0x%" PRIx64 "\n", event); + TC_PRINT("- Triggering core event: 0x%08X\n", event); info_length_in_test = sizeof(struct in6_addr); memcpy(info_data, &addr6, sizeof(addr6)); @@ -338,11 +336,10 @@ static int test_core_event(uint64_t event, bool (*func)(void)) zassert_true(rx_calls > 0 && rx_calls != -1, "rx_calls empty"); zassert_equal(rx_event, event, "rx_event check failed, " - "0x%" PRIx64 " vs 0x%" PRIx64, rx_event, event); + "0x%08x vs 0x%08x", rx_event, event); net_mgmt_del_event_callback(&rx_cb); - rx_event = 0ULL; - rx_calls = 0U; + rx_event = rx_calls = 0U; return TC_PASS; } @@ -429,7 +426,7 @@ ZTEST(mgmt_fn_test_suite, test_mgmt) static K_SEM_DEFINE(wait_for_event_processing, 0, 1); static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, struct net_if *iface) + uint32_t mgmt_event, struct net_if *iface) { static int cb_call_count; diff --git a/tests/net/mld/src/main.c b/tests/net/mld/src/main.c index 0036b5853af..1c95fe5409d 100644 --- a/tests/net/mld/src/main.c +++ b/tests/net/mld/src/main.c @@ -238,7 +238,7 @@ static void test_iface_carrier_off_on(void) } static void group_joined(struct net_mgmt_event_callback *cb, - uint64_t nm_event, struct net_if *iface) + uint32_t nm_event, struct net_if *iface) { if (nm_event != NET_EVENT_IPV6_MCAST_JOIN) { /* Spurious callback. */ @@ -254,7 +254,7 @@ static void group_joined(struct net_mgmt_event_callback *cb, } static void group_left(struct net_mgmt_event_callback *cb, - uint64_t nm_event, struct net_if *iface) + uint32_t nm_event, struct net_if *iface) { if (nm_event != NET_EVENT_IPV6_MCAST_LEAVE) { /* Spurious callback. */ @@ -270,7 +270,7 @@ static void group_left(struct net_mgmt_event_callback *cb, } static struct mgmt_events { - uint64_t event; + uint32_t event; net_mgmt_event_handler_t handler; struct net_mgmt_event_callback cb; } mgmt_events[] = { diff --git a/tests/net/pmtu/src/main.c b/tests/net/pmtu/src/main.c index d744a4415f4..54d225a259e 100644 --- a/tests/net/pmtu/src/main.c +++ b/tests/net/pmtu/src/main.c @@ -103,7 +103,7 @@ static K_SEM_DEFINE(wait_pmtu_changed, 0, UINT_MAX); static bool is_pmtu_changed; static void ipv6_pmtu_changed(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(cb); @@ -123,7 +123,7 @@ static void ipv6_pmtu_changed(struct net_mgmt_event_callback *cb, } static void ipv4_pmtu_changed(struct net_mgmt_event_callback *cb, - uint64_t mgmt_event, + uint32_t mgmt_event, struct net_if *iface) { ARG_UNUSED(cb); @@ -143,7 +143,7 @@ static void ipv4_pmtu_changed(struct net_mgmt_event_callback *cb, } static struct mgmt_events { - uint64_t event; + uint32_t event; net_mgmt_event_handler_t handler; struct net_mgmt_event_callback cb; } mgmt_events[] = { From 2cd55494e3622c26c46aa6c35b6ce7475e01c258 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 175/881] Revert "[nrf fromlist] drivers: adc: nrfx_saadc: Add support for DMM" This reverts commit 05746fdc63754ddf8eee3ce25485760dbcb86df4. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 72 +++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 7d442b482e6..2ba7b6efd00 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -13,7 +13,6 @@ #include #include #include -#include LOG_MODULE_REGISTER(adc_nrfx_saadc, CONFIG_ADC_LOG_LEVEL); @@ -98,19 +97,34 @@ BUILD_ASSERT((NRF_SAADC_AIN0 == NRF_SAADC_INPUT_AIN0) && "Definitions from nrf-adc.h do not match those from nrf_saadc.h"); #endif +#if defined(CONFIG_NRF_PLATFORM_HALTIUM) +#include +/* Haltium devices always use bounce buffers in RAM */ +static uint16_t adc_samples_buffer[SAADC_CH_NUM] DMM_MEMORY_SECTION(DT_NODELABEL(adc)); + +#define ADC_BUFFER_IN_RAM + +#endif /* defined(CONFIG_NRF_PLATFORM_HALTIUM) */ + struct driver_data { struct adc_context ctx; uint8_t single_ended_channels; + nrf_saadc_value_t *buffer; /* Pointer to the buffer with converted samples. */ uint8_t active_channel_cnt; - void *mem_reg; + +#if defined(ADC_BUFFER_IN_RAM) + void *samples_buffer; void *user_buffer; +#endif }; static struct driver_data m_data = { ADC_CONTEXT_INIT_TIMER(m_data, ctx), ADC_CONTEXT_INIT_LOCK(m_data, ctx), ADC_CONTEXT_INIT_SYNC(m_data, ctx), - .mem_reg = DMM_DEV_TO_REG(DT_NODELABEL(adc)), +#if defined(ADC_BUFFER_IN_RAM) + .samples_buffer = adc_samples_buffer, +#endif }; /* Forward declaration */ @@ -378,29 +392,22 @@ static void adc_context_start_sampling(struct adc_context *ctx) if (ret != NRFX_SUCCESS) { LOG_ERR("Cannot start sampling: 0x%08x", ret); - adc_context_complete(ctx, -EIO); + adc_context_complete(&m_data.ctx, -EIO); } } } static void adc_context_update_buffer_pointer(struct adc_context *ctx, bool repeat) { - void *samples_buffer; - if (!repeat) { +#if defined(ADC_BUFFER_IN_RAM) m_data.user_buffer = (uint16_t *)m_data.user_buffer + m_data.active_channel_cnt; - } +#else + nrf_saadc_value_t *buffer = (uint16_t *)m_data.buffer + m_data.active_channel_cnt; - int error = dmm_buffer_in_prepare( - m_data.mem_reg, m_data.user_buffer, - NRFX_SAADC_SAMPLES_TO_BYTES(m_data.active_channel_cnt), - &samples_buffer); - if (error != 0) { - LOG_ERR("DMM buffer allocation failed err=%d", error); - adc_context_complete(ctx, -EIO); + nrfx_saadc_buffer_set(buffer, m_data.active_channel_cnt); +#endif } - - nrfx_saadc_buffer_set(samples_buffer, m_data.active_channel_cnt); } static int get_resolution(const struct adc_sequence *sequence, nrf_saadc_resolution_t *resolution) @@ -495,12 +502,12 @@ static bool has_single_ended(const struct adc_sequence *sequence) return sequence->channels & m_data.single_ended_channels; } -static void correct_single_ended(const struct adc_sequence *sequence, nrf_saadc_value_t *buffer) +static void correct_single_ended(const struct adc_sequence *sequence) { uint16_t channel_bit = BIT(0); uint8_t selected_channels = sequence->channels; uint8_t single_ended_channels = m_data.single_ended_channels; - int16_t *sample = (int16_t *)buffer; + int16_t *sample = (int16_t *)m_data.buffer; while (channel_bit <= single_ended_channels) { if (channel_bit & selected_channels) { @@ -525,7 +532,6 @@ static int start_read(const struct device *dev, nrf_saadc_oversample_t oversampling; uint8_t active_channel_cnt = 0U; uint8_t channel_id = 0U; - void *samples_buffer; /* Signal an error if channel selection is invalid (no channels or * a non-existing one is selected). @@ -576,21 +582,16 @@ static int start_read(const struct device *dev, } m_data.active_channel_cnt = active_channel_cnt; +#if defined(ADC_BUFFER_IN_RAM) m_data.user_buffer = sequence->buffer; - error = dmm_buffer_in_prepare(m_data.mem_reg, - m_data.user_buffer, - NRFX_SAADC_SAMPLES_TO_BYTES(active_channel_cnt), - &samples_buffer); - if (error != 0) { - LOG_ERR("DMM buffer allocation failed err=%d", error); - return error; - } - + nrfx_saadc_buffer_set(m_data.samples_buffer, active_channel_cnt); +#else /* Buffer is filled in chunks, each chunk composed of number of samples equal to number * of active channels. Buffer pointer is advanced and reloaded after each chunk. */ - nrfx_saadc_buffer_set(samples_buffer, active_channel_cnt); + nrfx_saadc_buffer_set(sequence->buffer, active_channel_cnt); +#endif adc_context_start_read(&m_data.ctx, sequence); @@ -631,14 +632,17 @@ static void event_handler(const nrfx_saadc_evt_t *event) nrfx_err_t err; if (event->type == NRFX_SAADC_EVT_DONE) { - dmm_buffer_in_release( - m_data.mem_reg, m_data.user_buffer, - NRFX_SAADC_SAMPLES_TO_BYTES(m_data.active_channel_cnt), - event->data.done.p_buffer); + m_data.buffer = event->data.done.p_buffer; if (has_single_ended(&m_data.ctx.sequence)) { - correct_single_ended(&m_data.ctx.sequence, m_data.user_buffer); + correct_single_ended(&m_data.ctx.sequence); } + +#if defined(ADC_BUFFER_IN_RAM) + memcpy(m_data.user_buffer, m_data.samples_buffer, + NRFX_SAADC_SAMPLES_TO_BYTES(m_data.active_channel_cnt)); +#endif + adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); } else if (event->type == NRFX_SAADC_EVT_CALIBRATEDONE) { err = nrfx_saadc_mode_trigger(); From 2cd76e548c8be6dc04240e8817e6d519a484359f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 176/881] Revert "[nrf fromtree] soc: nordic: 54h20: fix typo ETX -> EXT" This reverts commit 64848a42d2b6c12fc6f3ed89fad4272195ceadd8. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/bicr/bicr-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/bicr/bicr-schema.json b/soc/nordic/nrf54h/bicr/bicr-schema.json index a43107a12b6..70e133f6ae0 100644 --- a/soc/nordic/nrf54h/bicr/bicr-schema.json +++ b/soc/nordic/nrf54h/bicr/bicr-schema.json @@ -193,7 +193,7 @@ ], "enum": [ "CRYSTAL", - "EXT_SINE", + "ETX_SINE", "EXT_SQUARE" ], "default": "CRYSTAL" From 36e37b05ee36e3dca19381da7e5d6c6b2d9c8c05 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 177/881] Revert "[nrf fromtree] soc: nordic: 54h20: bicr: Fix order of enum" This reverts commit f10e671ae2b0ecfadb48592d51fae88800ce836b. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/bicr/bicr-schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soc/nordic/nrf54h/bicr/bicr-schema.json b/soc/nordic/nrf54h/bicr/bicr-schema.json index 70e133f6ae0..b43b7236a6b 100644 --- a/soc/nordic/nrf54h/bicr/bicr-schema.json +++ b/soc/nordic/nrf54h/bicr/bicr-schema.json @@ -11,8 +11,8 @@ "title": "Power supply scheme", "enumNames": [ "Unconfigured (system will not boot)", - "Both VDD and VDDH supplied with 1.8 V (inductor present)", - "VDDH supplied with 2.1-5.5 V and VDD regulated by the chip (inductor present)" + "VDDH supplied with 2.1-5.5 V and VDD regulated by the chip (inductor present)", + "Both VDD and VDDH supplied with 1.8 V (inductor present)" ], "enum": [ "UNCONFIGURED", From b7bb6829d86d7d45eb741000d15b20a6542ae442 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 178/881] Revert "[nrf noup] samples: bluetooth: mesh: update stack sizes" This reverts commit 8876f35b0208e315d554ca1fec6f66643340fd0d. Signed-off-by: Jukka Rissanen --- samples/bluetooth/mesh_provisioner/prj.conf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 0e5f6490ede..24176780516 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -1,10 +1,6 @@ #CONFIG_INIT_STACKS=y -# Stack sizes from thread analysis + 50% margin, rounded to nearest 100 -CONFIG_MAIN_STACK_SIZE=4400 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4800 -CONFIG_BT_MESH_SETTINGS_WORKQ_STACK_SIZE=1700 -CONFIG_BT_MESH_ADV_STACK_SIZE=4000 -CONFIG_BT_RX_STACK_SIZE=3300 +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 # The Bluetooth API should not be used from a preemptive thread: CONFIG_MAIN_THREAD_PRIORITY=-2 From b6765701e0970001597b687a09aecf20a5e3bef6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 179/881] Revert "[nrf fromlist] tests: boards: nrf: qdec: Fix test for multiple instances" This reverts commit e6948df926e1027caeb3914a2dc37430aca3d09c. Signed-off-by: Jukka Rissanen --- .../boards/bl54l15_dvk_nrf54l15_common.dtsi | 14 +- .../boards/bl54l15u_dvk_nrf54l15_common.dtsi | 14 +- .../qdec/boards/nrf52840dk_nrf52840.overlay | 7 - .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 14 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 25 +- .../boards/nrf54l15dk_nrf54l15_common.dtsi | 45 ++- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 14 +- .../qdec/dts/bindings/test-qdec-loopback.yaml | 20 -- tests/boards/nrf/qdec/src/main.c | 313 ++++++++++-------- 9 files changed, 229 insertions(+), 237 deletions(-) delete mode 100644 tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml diff --git a/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi index 19ca5e83647..4db67a49a5e 100644 --- a/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi @@ -5,6 +5,12 @@ */ / { + aliases { + qdec0 = &qdec20; + qenca = &phase_a; + qencb = &phase_b; + }; + encoder-emulate { compatible = "gpio-leds"; @@ -16,14 +22,6 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi index 19ca5e83647..4db67a49a5e 100644 --- a/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi @@ -5,6 +5,12 @@ */ / { + aliases { + qdec0 = &qdec20; + qenca = &phase_a; + qencb = &phase_b; + }; + encoder-emulate { compatible = "gpio-leds"; @@ -16,14 +22,6 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay index a495df07f7c..f227fb95c38 100644 --- a/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay @@ -22,13 +22,6 @@ }; }; - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec0>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay index d1f008c8193..ed6a5587f5b 100644 --- a/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,6 +4,12 @@ */ / { + aliases { + qdec0 = &qdec1; + qenca = &phase_a; + qencb = &phase_b; + }; + encoder-emulate { compatible = "gpio-leds"; phase_a: phase_a { @@ -15,14 +21,6 @@ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec1>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 7e43c70dac0..78f3aa09ace 100644 --- a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -11,12 +11,21 @@ */ / { + aliases { + qdec0 = &qdec130; + qdec1 = &qdec131; + qenca = &phase_a; + qencb = &phase_b; + qenca1 = &phase_a1; + qencb1 = &phase_b1; + }; + encoder-emulate { compatible = "gpio-leds"; - phase_a0: phase_a0 { + phase_a: phase_a { gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; }; - phase_b0: phase_b0 { + phase_b: phase_b { gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; }; phase_a1: phase_a1 { @@ -26,18 +35,6 @@ gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec130>; - qenc-emul-gpios = <&phase_a0 &phase_b0>; - }; - loopback1 { - qdec = <&qdec131>; - qenc-emul-gpios = <&phase_a1 &phase_b1>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi index f2729414652..06a490d1da0 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi @@ -4,38 +4,35 @@ */ /* Required loopbacks - * P1.8 <-> P1.9 - * P1.10 <-> P1.11 - * P1.12 <-> P1.13 - * P1.14 <-> P2.10 + * P1.8 <-> P1.9 + * P1.10 >-> P1.11 + * P2.8 <-> P2.9 + * P2.10 <-> P1.14 */ / { + aliases { + qdec0 = &qdec20; + qdec1 = &qdec21; + qenca = &phase_a; + qencb = &phase_b; + qenca1 = &phase_a1; + qencb1 = &phase_b1; + }; + encoder-emulate { compatible = "gpio-leds"; - phase_a0: phase_a0 { + phase_a: phase_a { gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; - phase_b0: phase_b0 { + phase_b: phase_b { gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; phase_a1: phase_a1 { - gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; }; phase_b1: phase_b1 { - gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; - }; - }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a0 &phase_b0>; - }; - loopback1 { - qdec = <&qdec21>; - qenc-emul-gpios = <&phase_a1 &phase_b1>; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; }; }; }; @@ -58,15 +55,15 @@ qdec_21_pinctrl: qdec_21_pinctrl { group1 { - psels = , - ; + psels = , + ; }; }; qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; diff --git a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi index 6f8f3a18431..84e7b1dbc30 100644 --- a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -11,6 +11,12 @@ */ / { + aliases { + qdec0 = &qdec20; + qenca = &phase_a; + qencb = &phase_b; + }; + encoder-emulate { compatible = "gpio-leds"; phase_a: phase_a { @@ -20,14 +26,6 @@ gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml b/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml deleted file mode 100644 index e03b2ff3bc3..00000000000 --- a/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml +++ /dev/null @@ -1,20 +0,0 @@ -description: | - Binding describing loopbacks required to run tests/boards/nrf/qdec test in Zephyr. - -compatible: "test-qdec-loopbacks" - -child-binding: - description: | - Binding describing a single loopback pair consisting of a QDEC device and two "gpio-leds" pins - working as a quadrature encoder for the test. - properties: - qdec: - type: phandle - required: true - description: Node of the QDEC device used to capture quadrature signal in the loopback. - qenc-emul-gpios: - type: phandles - required: true - description: | - Children nodes of "gpio-leds" compatible used to generate quadrature signal. The first - phandles outputs phase A signal, the second one outputs phase B signal. diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 9d138d325fb..7df97be2a43 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -11,40 +11,27 @@ #include #include -/** - * Structure grouping gpio pins used for QENC emulation connected with a QDEC device - * with a loopback. - */ -struct qdec_qenc_loopback { - struct gpio_dt_spec qenc_phase_a; - struct gpio_dt_spec qenc_phase_b; - - const struct device *qdec; - uint32_t qdec_config_step; -}; - static K_SEM_DEFINE(sem, 0, 1); - -#define GET_QDEC_QENC_LOOPBACK(x) \ - { \ - .qenc_phase_a = GPIO_DT_SPEC_GET(DT_PHANDLE_BY_IDX(x, qenc_emul_gpios, 0), gpios), \ - .qenc_phase_b = GPIO_DT_SPEC_GET(DT_PHANDLE_BY_IDX(x, qenc_emul_gpios, 1), gpios), \ - .qdec = DEVICE_DT_GET(DT_PHANDLE(x, qdec)), \ - .qdec_config_step = DT_PROP_BY_PHANDLE(x, qdec, steps) \ - } - - -struct qdec_qenc_loopback loopbacks[] = { - DT_FOREACH_CHILD_SEP(DT_NODELABEL(qdec_loopbacks), GET_QDEC_QENC_LOOPBACK, (,)) -}; - -#define TESTED_QDEC_COUNT ARRAY_SIZE(loopbacks) - +static const struct gpio_dt_spec phase_a = GPIO_DT_SPEC_GET(DT_ALIAS(qenca), gpios); +static const struct gpio_dt_spec phase_b = GPIO_DT_SPEC_GET(DT_ALIAS(qencb), gpios); +static const struct device *const qdec_dev = DEVICE_DT_GET(DT_ALIAS(qdec0)); +static const uint32_t qdec_config_step = DT_PROP(DT_ALIAS(qdec0), steps); + +/* Disable testing second QDEC instance + * until the issue with multiple + * QDEC instances support is resolved + */ +#if DT_NODE_EXISTS(DT_ALIAS(qdecX)) +#define SECOND_QDEC_INSTANCE + +static const struct gpio_dt_spec phase_a1 = GPIO_DT_SPEC_GET(DT_ALIAS(qenca1), gpios); +static const struct gpio_dt_spec phase_b1 = GPIO_DT_SPEC_GET(DT_ALIAS(qencb1), gpios); +static const struct device *const qdec_1_dev = DEVICE_DT_GET(DT_ALIAS(qdec1)); +static const uint32_t qdec_1_config_step = DT_PROP(DT_ALIAS(qdec1), steps); +#endif static struct sensor_trigger qdec_trigger = {.type = SENSOR_TRIG_DATA_READY, .chan = SENSOR_CHAN_ROTATION}; - static bool toggle_a = true; -static struct qdec_qenc_loopback *loopback_currently_under_test; static void qdec_trigger_handler(const struct device *dev, const struct sensor_trigger *trigger) { @@ -61,9 +48,15 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t static void qenc_emulate_work_handler(struct k_work *work) { if (toggle_a) { - gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_a); + gpio_pin_toggle_dt(&phase_a); +#if defined(SECOND_QDEC_INSTANCE) + gpio_pin_toggle_dt(&phase_a1); +#endif } else { - gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_b); + gpio_pin_toggle_dt(&phase_b); +#if defined(SECOND_QDEC_INSTANCE) + gpio_pin_toggle_dt(&phase_b1); +#endif } toggle_a = !toggle_a; } @@ -96,46 +89,52 @@ static void qenc_emulate_setup_pin(const struct gpio_dt_spec *gpio_dt) zassert_true(rc == 0, "%s: pin configure failed: %d", gpio_dt->port->name, rc); } -static void qenc_emulate_start(struct qdec_qenc_loopback *loopback, k_timeout_t period, - bool forward) +static void qenc_emulate_start(k_timeout_t period, bool forward) { - qenc_emulate_reset_pin(&loopback->qenc_phase_a); - qenc_emulate_reset_pin(&loopback->qenc_phase_b); + qenc_emulate_reset_pin(&phase_a); + qenc_emulate_reset_pin(&phase_b); +#if defined(SECOND_QDEC_INSTANCE) + qenc_emulate_reset_pin(&phase_a1); + qenc_emulate_reset_pin(&phase_b1); +#endif toggle_a = !forward; - loopback_currently_under_test = loopback; + k_timer_start(&qenc_emulate_timer, period, period); } static void qenc_emulate_stop(void) { - if (loopback_currently_under_test) { - k_timer_stop(&qenc_emulate_timer); - qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_a); - qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_b); - } + k_timer_stop(&qenc_emulate_timer); + + qenc_emulate_reset_pin(&phase_a); + qenc_emulate_reset_pin(&phase_b); +#if defined(SECOND_QDEC_INSTANCE) + qenc_emulate_reset_pin(&phase_a1); + qenc_emulate_reset_pin(&phase_b1); +#endif } -static void qenc_emulate_verify_reading(struct qdec_qenc_loopback *loopback, - int emulator_period_ms, int emulation_duration_ms, bool forward, - bool overflow_expected) +static void qenc_emulate_verify_reading(const struct device *const dev, int emulator_period_ms, + int emulation_duration_ms, bool forward, bool overflow_expected, + const uint32_t config_step) { int rc; struct sensor_value val = {0}; int32_t expected_steps = emulation_duration_ms / emulator_period_ms; - int32_t expected_reading = 360 * expected_steps / loopback->qdec_config_step; - int32_t delta = expected_reading / 4; + int32_t expected_reading = 360 * expected_steps / config_step; + int32_t delta = expected_reading / 5; if (!forward) { expected_reading *= -1; } - qenc_emulate_start(loopback, K_MSEC(emulator_period_ms), forward); + qenc_emulate_start(K_MSEC(emulator_period_ms), forward); /* wait for some readings */ k_msleep(emulation_duration_ms); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(dev); if (!overflow_expected) { zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); @@ -143,7 +142,7 @@ static void qenc_emulate_verify_reading(struct qdec_qenc_loopback *loopback, zassert_true(rc == -EOVERFLOW, "Failed to detect overflow"); } - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); TC_PRINT("Expected reading: %d, actual value: %d, delta: %d\n", @@ -158,31 +157,31 @@ static void qenc_emulate_verify_reading(struct qdec_qenc_loopback *loopback, /* wait and get readings to clear state */ k_msleep(100); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); } -static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) +static void sensor_trigger_set_and_disable(const struct device *const dev) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } k_sem_give(&sem); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ALL; - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* emulation working, handler should be called */ rc = k_sem_take(&sem, K_MSEC(200)); @@ -194,7 +193,7 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) rc = k_sem_take(&sem, K_MSEC(200)); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } /* there should be no triggers now*/ @@ -202,21 +201,21 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } /* register empty trigger - disable trigger */ - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, NULL); + rc = sensor_trigger_set(dev, &qdec_trigger, NULL); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* emulation working, but handler not set, thus should not be called */ rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } } @@ -228,50 +227,49 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_trigger_set_and_disable) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_trigger_set_and_disable(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_trigger_set_and_disable(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_trigger_set_and_disable(qdec_1_dev); +#endif + } -static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) +static void sensor_trigger_set_test(const struct device *const dev) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* emulation working now */ rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == 0, "qdec handler should be triggered (%d)", rc); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); TC_PRINT("QDEC reading: %d\n", val.val1); zassert_true(val.val1 != 0, "No readings from QDEC"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } - - qenc_emulate_stop(); - /* emulation not working, but there may be old trigger which needs to be cleaned up */ - rc = k_sem_take(&sem, K_MSEC(200)); } /** @@ -282,37 +280,39 @@ static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_trigger_set) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_trigger_set_test(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_trigger_set_test(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_trigger_set_test(qdec_1_dev); +#endif } -static void sensor_trigger_set_negative(struct qdec_qenc_loopback *loopback) +static void sensor_trigger_set_negative(const struct device *const dev) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); qdec_trigger.type = SENSOR_TRIG_MAX; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid trigger type"); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_MAX; - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid channel"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } } @@ -324,10 +324,12 @@ static void sensor_trigger_set_negative(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_trigger_set_negative) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_trigger_set_negative(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_trigger_set_negative(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_trigger_set_negative(qdec_1_dev); +#endif } /** @@ -338,22 +340,37 @@ ZTEST(qdec_sensor, test_sensor_trigger_set_negative) */ ZTEST(qdec_sensor, test_qdec_readings) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopbacks[i].qdec); - } - - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - qenc_emulate_verify_reading(&loopbacks[i], 10, 100, true, false); - qenc_emulate_verify_reading(&loopbacks[i], 2, 500, true, false); - qenc_emulate_verify_reading(&loopbacks[i], 10, 200, false, false); - qenc_emulate_verify_reading(&loopbacks[i], 1, 1000, false, true); - qenc_emulate_verify_reading(&loopbacks[i], 1, 1000, true, true); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopbacks[i].qdec); - } + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_get(qdec_dev); } + + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + qenc_emulate_verify_reading(qdec_dev, 10, 100, true, false, qdec_config_step); + qenc_emulate_verify_reading(qdec_dev, 2, 500, true, false, qdec_config_step); + qenc_emulate_verify_reading(qdec_dev, 10, 200, false, false, qdec_config_step); + qenc_emulate_verify_reading(qdec_dev, 1, 1000, false, true, qdec_config_step); + qenc_emulate_verify_reading(qdec_dev, 1, 1000, true, true, qdec_config_step); + + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put(qdec_dev); + } + +#if defined(SECOND_QDEC_INSTANCE) + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_get(qdec_1_dev); + } + + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + qenc_emulate_verify_reading(qdec_1_dev, 10, 100, true, false, qdec_1_config_step); + qenc_emulate_verify_reading(qdec_1_dev, 2, 500, true, false, qdec_1_config_step); + qenc_emulate_verify_reading(qdec_1_dev, 10, 200, false, false, qdec_1_config_step); + qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, false, true, qdec_1_config_step); + qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, true, true, qdec_1_config_step); + + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put(qdec_1_dev); + } +#endif } static void sensor_channel_get_empty(const struct device *const dev) @@ -402,38 +419,40 @@ static void sensor_channel_get_empty(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_channel_get_empty) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_channel_get_empty(loopbacks[i].qdec); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_channel_get_empty(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_channel_get_empty(qdec_1_dev); +#endif } -static void sensor_channel_get_test(struct qdec_qenc_loopback *loopback) +static void sensor_channel_get_test(const struct device *const dev) { int rc; struct sensor_value val_first = {0}; struct sensor_value val_second = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(qdec_dev); } - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(qdec_dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val_first); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val_first); zassert_true(rc == 0, "Failed to get sample (%d)", rc); zassert_true(val_first.val1 != 0, "No readings from QDEC"); /* wait for more readings*/ k_msleep(200); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val_second); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val_second); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); zassert_true(val_second.val1 != 0, "No readings from QDEC"); @@ -451,7 +470,7 @@ static void sensor_channel_get_test(struct qdec_qenc_loopback *loopback) val_second.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(qdec_dev); } } @@ -463,36 +482,38 @@ static void sensor_channel_get_test(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_channel_get) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_channel_get_test(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_channel_get_test(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_channel_get_test(qdec_1_dev); +#endif } -static void sensor_channel_get_negative(struct qdec_qenc_loopback *loopback) +static void sensor_channel_get_negative(const struct device *const dev) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_MAX, &val); + rc = sensor_channel_get(dev, SENSOR_CHAN_MAX, &val); zassert_true(rc < 0, "Should failed to get sample (%d)", rc); zassert_true(val.val1 == 0, "Some readings from QDEC: %d", val.val1); zassert_true(val.val2 == 0, "Some readings from QDEC: %d", val.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } } @@ -504,10 +525,12 @@ static void sensor_channel_get_negative(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_channel_get_negative) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_channel_get_negative(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_channel_get_negative(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_channel_get_negative(qdec_1_dev); +#endif } static void sensor_sample_fetch_test(const struct device *const dev) @@ -540,22 +563,32 @@ static void sensor_sample_fetch_test(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_sample_fetch) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_sample_fetch_test(loopbacks[i].qdec); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_sample_fetch_test(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_sample_fetch_test(qdec_1_dev); +#endif } static void *setup(void) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - int rc = device_is_ready(loopbacks[i].qdec); + int rc; - zassert_true(rc, "QDEC index %d not ready: %d", i, rc); + rc = device_is_ready(qdec_dev); + zassert_true(rc, "QDEC device not ready: %d", rc); + + qenc_emulate_setup_pin(&phase_a); + qenc_emulate_setup_pin(&phase_b); + +#if defined(SECOND_QDEC_INSTANCE) + rc = device_is_ready(qdec_1_dev); + zassert_true(rc, "QDEC 1 device not ready: %d", rc); + + qenc_emulate_setup_pin(&phase_a1); + qenc_emulate_setup_pin(&phase_b1); +#endif - qenc_emulate_setup_pin(&loopbacks[i].qenc_phase_a); - qenc_emulate_setup_pin(&loopbacks[i].qenc_phase_b); - } return NULL; } From 4ec68abba7d359daf60fd3b55b396259d1ce072e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 180/881] Revert "[nrf fromtree] tests: boards: nrf: qdec: Disable testing of 2nd instance until fixed" This reverts commit 64d730258d9ebfdb61cd2098ebbf3e1c1bf7dd51. Signed-off-by: Jukka Rissanen --- tests/boards/nrf/qdec/src/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 7df97be2a43..0df3ee2ab95 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -17,11 +17,7 @@ static const struct gpio_dt_spec phase_b = GPIO_DT_SPEC_GET(DT_ALIAS(qencb), gpi static const struct device *const qdec_dev = DEVICE_DT_GET(DT_ALIAS(qdec0)); static const uint32_t qdec_config_step = DT_PROP(DT_ALIAS(qdec0), steps); -/* Disable testing second QDEC instance - * until the issue with multiple - * QDEC instances support is resolved - */ -#if DT_NODE_EXISTS(DT_ALIAS(qdecX)) +#if DT_NODE_EXISTS(DT_ALIAS(qdec1)) #define SECOND_QDEC_INSTANCE static const struct gpio_dt_spec phase_a1 = GPIO_DT_SPEC_GET(DT_ALIAS(qenca1), gpios); From 58816c68ed3a9736d55f1ab48eae9fc0f31faf41 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 181/881] Revert "[nrf fromtree] tests: boards: nrf: qdec: Add testing with multiple QDEC instances" This reverts commit bb1a8e3fa07b0841fdacf487e1cebdf660915eef. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 57 +--- .../boards/nrf54l15dk_nrf54l15_common.dtsi | 53 +--- tests/boards/nrf/qdec/src/main.c | 272 +++++------------- 3 files changed, 82 insertions(+), 300 deletions(-) diff --git a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 78f3aa09ace..7e6da5a3458 100644 --- a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -3,21 +3,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* Required loopbacks - * P2.08 <-> P2.09 - * P2.10 <-> P2.11 - * P1.02 <-> P1.03 - * P7.01 <-> P1.05 - */ - / { aliases { qdec0 = &qdec130; - qdec1 = &qdec131; qenca = &phase_a; qencb = &phase_b; - qenca1 = &phase_a1; - qencb1 = &phase_b1; }; encoder-emulate { @@ -28,73 +18,34 @@ phase_b: phase_b { gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; }; - phase_a1: phase_a1 { - gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; - }; - phase_b1: phase_b1 { - gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; - }; }; }; &pinctrl { - qdec_130_pinctrl: qdec_130_pinctrl { + qdec_pinctrl: qdec_pinctrl { group1 { psels = , ; }; }; - qdec_130_sleep_pinctrl: qdec_130_sleep_pinctrl { + qdec_sleep_pinctrl: qdec_sleep_pinctrl { group1 { psels = , ; low-power-enable; }; }; - - qdec_131_pinctrl: qdec_131_pinctrl { - group1 { - psels = , - ; - }; - }; - - qdec_131_sleep_pinctrl: qdec_131_sleep_pinctrl { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&gpio1 { - status = "okay"; }; &gpio2 { status = "okay"; }; -&gpio7 { - status = "okay"; -}; - &qdec130 { status = "okay"; - pinctrl-0 = <&qdec_130_pinctrl>; - pinctrl-1 = <&qdec_130_sleep_pinctrl>; - pinctrl-names = "default", "sleep"; - steps = <127>; - led-pre = <500>; - zephyr,pm-device-runtime-auto; -}; - -&qdec131 { - status = "okay"; - pinctrl-0 = <&qdec_131_pinctrl>; - pinctrl-1 = <&qdec_131_sleep_pinctrl>; + pinctrl-0 = <&qdec_pinctrl>; + pinctrl-1 = <&qdec_sleep_pinctrl>; pinctrl-names = "default", "sleep"; steps = <127>; led-pre = <500>; diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi index 06a490d1da0..3fa426569b8 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi @@ -3,21 +3,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* Required loopbacks - * P1.8 <-> P1.9 - * P1.10 >-> P1.11 - * P2.8 <-> P2.9 - * P2.10 <-> P1.14 - */ - / { aliases { qdec0 = &qdec20; - qdec1 = &qdec21; qenca = &phase_a; qencb = &phase_b; - qenca1 = &phase_a1; - qencb1 = &phase_b1; }; encoder-emulate { @@ -28,69 +18,34 @@ phase_b: phase_b { gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; - phase_a1: phase_a1 { - gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; - }; - phase_b1: phase_b1 { - gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; - }; }; }; &pinctrl { - qdec_20_pinctrl: qdec_20_pinctrl { + qdec_pinctrl: qdec_pinctrl { group1 { psels = , ; }; }; - qdec_20_sleep_pinctrl: qdec_20_sleep_pinctrl { + qdec_sleep_pinctrl: qdec_sleep_pinctrl { group1 { psels = , ; low-power-enable; }; }; - - qdec_21_pinctrl: qdec_21_pinctrl { - group1 { - psels = , - ; - }; - }; - - qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl { - group1 { - psels = , - ; - low-power-enable; - }; - }; }; &gpio1 { status = "okay"; }; -&gpio2 { - status = "okay"; -}; - &qdec20 { status = "okay"; - pinctrl-0 = <&qdec_20_pinctrl>; - pinctrl-1 = <&qdec_20_sleep_pinctrl>; - pinctrl-names = "default", "sleep"; - steps = <127>; - led-pre = <500>; - zephyr,pm-device-runtime-auto; -}; - -&qdec21 { - status = "okay"; - pinctrl-0 = <&qdec_21_pinctrl>; - pinctrl-1 = <&qdec_21_sleep_pinctrl>; + pinctrl-0 = <&qdec_pinctrl>; + pinctrl-1 = <&qdec_sleep_pinctrl>; pinctrl-names = "default", "sleep"; steps = <127>; led-pre = <500>; diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 0df3ee2ab95..d87feb22f42 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -16,15 +16,6 @@ static const struct gpio_dt_spec phase_a = GPIO_DT_SPEC_GET(DT_ALIAS(qenca), gpi static const struct gpio_dt_spec phase_b = GPIO_DT_SPEC_GET(DT_ALIAS(qencb), gpios); static const struct device *const qdec_dev = DEVICE_DT_GET(DT_ALIAS(qdec0)); static const uint32_t qdec_config_step = DT_PROP(DT_ALIAS(qdec0), steps); - -#if DT_NODE_EXISTS(DT_ALIAS(qdec1)) -#define SECOND_QDEC_INSTANCE - -static const struct gpio_dt_spec phase_a1 = GPIO_DT_SPEC_GET(DT_ALIAS(qenca1), gpios); -static const struct gpio_dt_spec phase_b1 = GPIO_DT_SPEC_GET(DT_ALIAS(qencb1), gpios); -static const struct device *const qdec_1_dev = DEVICE_DT_GET(DT_ALIAS(qdec1)); -static const uint32_t qdec_1_config_step = DT_PROP(DT_ALIAS(qdec1), steps); -#endif static struct sensor_trigger qdec_trigger = {.type = SENSOR_TRIG_DATA_READY, .chan = SENSOR_CHAN_ROTATION}; static bool toggle_a = true; @@ -33,6 +24,7 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t { zassert_not_null(dev); zassert_not_null(trigger); + zassert_equal_ptr(dev, qdec_dev); /* trigger should be stored as a pointer in a driver * thus this address should match */ @@ -45,14 +37,8 @@ static void qenc_emulate_work_handler(struct k_work *work) { if (toggle_a) { gpio_pin_toggle_dt(&phase_a); -#if defined(SECOND_QDEC_INSTANCE) - gpio_pin_toggle_dt(&phase_a1); -#endif } else { gpio_pin_toggle_dt(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - gpio_pin_toggle_dt(&phase_b1); -#endif } toggle_a = !toggle_a; } @@ -89,10 +75,6 @@ static void qenc_emulate_start(k_timeout_t period, bool forward) { qenc_emulate_reset_pin(&phase_a); qenc_emulate_reset_pin(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - qenc_emulate_reset_pin(&phase_a1); - qenc_emulate_reset_pin(&phase_b1); -#endif toggle_a = !forward; @@ -105,20 +87,15 @@ static void qenc_emulate_stop(void) qenc_emulate_reset_pin(&phase_a); qenc_emulate_reset_pin(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - qenc_emulate_reset_pin(&phase_a1); - qenc_emulate_reset_pin(&phase_b1); -#endif } -static void qenc_emulate_verify_reading(const struct device *const dev, int emulator_period_ms, - int emulation_duration_ms, bool forward, bool overflow_expected, - const uint32_t config_step) +static void qenc_emulate_verify_reading(int emulator_period_ms, int emulation_duration_ms, + bool forward, bool overflow_expected) { int rc; struct sensor_value val = {0}; int32_t expected_steps = emulation_duration_ms / emulator_period_ms; - int32_t expected_reading = 360 * expected_steps / config_step; + int32_t expected_reading = 360 * expected_steps / qdec_config_step; int32_t delta = expected_reading / 5; if (!forward) { @@ -127,10 +104,10 @@ static void qenc_emulate_verify_reading(const struct device *const dev, int emul qenc_emulate_start(K_MSEC(emulator_period_ms), forward); - /* wait for some readings */ + /* wait for some readings*/ k_msleep(emulation_duration_ms); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(qdec_dev); if (!overflow_expected) { zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); @@ -138,11 +115,9 @@ static void qenc_emulate_verify_reading(const struct device *const dev, int emul zassert_true(rc == -EOVERFLOW, "Failed to detect overflow"); } - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); - TC_PRINT("Expected reading: %d, actual value: %d, delta: %d\n", - expected_reading, val.val1, delta); if (!overflow_expected) { zassert_within(val.val1, expected_reading, delta, "Expected reading: %d, but got: %d", expected_reading, val.val1); @@ -153,26 +128,30 @@ static void qenc_emulate_verify_reading(const struct device *const dev, int emul /* wait and get readings to clear state */ k_msleep(100); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(qdec_dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); } -static void sensor_trigger_set_and_disable(const struct device *const dev) +/** + * @brief sensor_trigger_set test disable trigger + * + * Confirm trigger happens after set and stops after being disabled + * + */ +ZTEST(qdec_sensor, test_sensor_trigger_set_and_disable) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(qdec_dev); } - k_sem_give(&sem); - qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ALL; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(qdec_dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); @@ -189,7 +168,7 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) rc = k_sem_take(&sem, K_MSEC(200)); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(qdec_dev); } /* there should be no triggers now*/ @@ -197,11 +176,11 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(qdec_dev); } /* register empty trigger - disable trigger */ - rc = sensor_trigger_set(dev, &qdec_trigger, NULL); + rc = sensor_trigger_set(qdec_dev, &qdec_trigger, NULL); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); qenc_emulate_start(K_MSEC(10), true); @@ -211,39 +190,28 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(qdec_dev); } } /** - * @brief sensor_trigger_set test disable trigger + * @brief sensor_trigger_set test * - * Confirm trigger happens after set and stops after being disabled + * Confirm trigger happens after set * */ -ZTEST(qdec_sensor, test_sensor_trigger_set_and_disable) -{ - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_and_disable(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_and_disable(qdec_1_dev); -#endif - -} - -static void sensor_trigger_set_test(const struct device *const dev) +ZTEST(qdec_sensor, test_sensor_trigger_set) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(qdec_dev); } qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(qdec_dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); @@ -254,80 +222,54 @@ static void sensor_trigger_set_test(const struct device *const dev) rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == 0, "qdec handler should be triggered (%d)", rc); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(qdec_dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); TC_PRINT("QDEC reading: %d\n", val.val1); zassert_true(val.val1 != 0, "No readings from QDEC"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(qdec_dev); } } /** - * @brief sensor_trigger_set test + * @brief sensor_trigger_set test negative * - * Confirm trigger happens after set + * Confirm setting trigger with invalid data does not work * */ -ZTEST(qdec_sensor, test_sensor_trigger_set) -{ - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_test(qdec_1_dev); -#endif -} - -static void sensor_trigger_set_negative(const struct device *const dev) +ZTEST(qdec_sensor, test_sensor_trigger_set_negative) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(qdec_dev); } - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(qdec_dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); qdec_trigger.type = SENSOR_TRIG_MAX; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(qdec_dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid trigger type"); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_MAX; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(qdec_dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid channel"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(qdec_dev); } } -/** - * @brief sensor_trigger_set test negative - * - * Confirm setting trigger with invalid data does not work - * - */ -ZTEST(qdec_sensor, test_sensor_trigger_set_negative) -{ - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_negative(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_negative(qdec_1_dev); -#endif -} - /** * @brief QDEC readings tests * @@ -340,90 +282,68 @@ ZTEST(qdec_sensor, test_qdec_readings) pm_device_runtime_get(qdec_dev); } - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - qenc_emulate_verify_reading(qdec_dev, 10, 100, true, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 2, 500, true, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 10, 200, false, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 1, 1000, false, true, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 1, 1000, true, true, qdec_config_step); + qenc_emulate_verify_reading(10, 100, true, false); + qenc_emulate_verify_reading(2, 500, true, false); + qenc_emulate_verify_reading(10, 200, false, false); + qenc_emulate_verify_reading(1, 1000, false, true); + qenc_emulate_verify_reading(1, 1000, true, true); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { pm_device_runtime_put(qdec_dev); } - -#if defined(SECOND_QDEC_INSTANCE) - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(qdec_1_dev); - } - - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - qenc_emulate_verify_reading(qdec_1_dev, 10, 100, true, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 2, 500, true, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 10, 200, false, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, false, true, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, true, true, qdec_1_config_step); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(qdec_1_dev); - } -#endif } -static void sensor_channel_get_empty(const struct device *const dev) +/** + * @brief sensor_channel_get test with no emulation + * + * Confirm getting empty reading from QDEC + * + */ +ZTEST(qdec_sensor, test_sensor_channel_get_empty) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(qdec_dev); } /* wait for potential new readings */ k_msleep(100); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(qdec_dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); /* get readings but ignore them, as they may include reading from time * when emulation was still working (i.e. during previous test) */ - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); /* wait for potential new readings */ k_msleep(100); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(qdec_dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); /* emulation was not working, expect no readings */ - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); zassert_true(val.val1 == 0, "Expected no readings but got: %d", val.val1); zassert_true(val.val2 == 0, "Expected no readings but got: %d", val.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(qdec_dev); } } /** - * @brief sensor_channel_get test with no emulation + * @brief sensor_channel_get test with emulation * - * Confirm getting empty reading from QDEC + * Confirm getting readings from QDEC * */ -ZTEST(qdec_sensor, test_sensor_channel_get_empty) -{ - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_empty(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_empty(qdec_1_dev); -#endif -} - -static void sensor_channel_get_test(const struct device *const dev) +ZTEST(qdec_sensor, test_sensor_channel_get) { int rc; struct sensor_value val_first = {0}; @@ -471,28 +391,18 @@ static void sensor_channel_get_test(const struct device *const dev) } /** - * @brief sensor_channel_get test with emulation + * @brief sensor_channel_get test negative * - * Confirm getting readings from QDEC + * Confirm getting readings from QDEC with invalid channel * */ -ZTEST(qdec_sensor, test_sensor_channel_get) -{ - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_test(qdec_1_dev); -#endif -} - -static void sensor_channel_get_negative(const struct device *const dev) +ZTEST(qdec_sensor, test_sensor_channel_get_negative) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(qdec_dev); } qenc_emulate_start(K_MSEC(10), true); @@ -500,73 +410,47 @@ static void sensor_channel_get_negative(const struct device *const dev) /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(qdec_dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_MAX, &val); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_MAX, &val); zassert_true(rc < 0, "Should failed to get sample (%d)", rc); zassert_true(val.val1 == 0, "Some readings from QDEC: %d", val.val1); zassert_true(val.val2 == 0, "Some readings from QDEC: %d", val.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(qdec_dev); } } /** - * @brief sensor_channel_get test negative + * @brief sensor_sample_fetch(_chan) test * - * Confirm getting readings from QDEC with invalid channel + * Confirm fetching work with QDEC specific channel - rotation * */ -ZTEST(qdec_sensor, test_sensor_channel_get_negative) -{ - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_negative(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_negative(qdec_1_dev); -#endif -} - -static void sensor_sample_fetch_test(const struct device *const dev) +ZTEST(qdec_sensor, test_sensor_sample_fetch) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(qdec_dev); } - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(qdec_dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_sample_fetch_chan(dev, SENSOR_CHAN_ROTATION); + rc = sensor_sample_fetch_chan(qdec_dev, SENSOR_CHAN_ROTATION); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_sample_fetch_chan(dev, SENSOR_CHAN_MAX); + rc = sensor_sample_fetch_chan(qdec_dev, SENSOR_CHAN_MAX); zassert_true(rc < 0, "Should fail to fetch sample from invalid channel (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(qdec_dev); } } -/** - * @brief sensor_sample_fetch(_chan) test - * - * Confirm fetching work with QDEC specific channel - rotation - * - */ -ZTEST(qdec_sensor, test_sensor_sample_fetch) -{ - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_sample_fetch_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_sample_fetch_test(qdec_1_dev); -#endif -} - static void *setup(void) { int rc; @@ -577,14 +461,6 @@ static void *setup(void) qenc_emulate_setup_pin(&phase_a); qenc_emulate_setup_pin(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - rc = device_is_ready(qdec_1_dev); - zassert_true(rc, "QDEC 1 device not ready: %d", rc); - - qenc_emulate_setup_pin(&phase_a1); - qenc_emulate_setup_pin(&phase_b1); -#endif - return NULL; } From 2200418b90cc16c249f07d813df15111431ee8a6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 182/881] Revert "[nrf fromtree] Bluetooth: Mesh: Blob Server considers friendship" This reverts commit 1ed3c0dd5c9ddbccd5a1c19a5720d27880c7dd69. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/mesh/blob_srv.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/subsys/bluetooth/mesh/blob_srv.c b/subsys/bluetooth/mesh/blob_srv.c index c022352b040..2d4ec561f83 100644 --- a/subsys/bluetooth/mesh/blob_srv.c +++ b/subsys/bluetooth/mesh/blob_srv.c @@ -151,12 +151,8 @@ static int pull_req_max(const struct bt_mesh_blob_srv *srv) BLOB_CHUNK_SDU_LEN(srv->state.xfer.chunk_size), BT_MESH_APP_SEG_SDU_MAX); - /* It is possible that the friend node cannot hold all segments per chunk. In this - * case, we should request at least 1 chunk. As requesting `0` would be invalid. - */ - count = MAX(1, MIN(CONFIG_BT_MESH_BLOB_SRV_PULL_REQ_COUNT, - bt_mesh.lpn.queue_size / segments_per_chunk)); - + count = MIN(CONFIG_BT_MESH_BLOB_SRV_PULL_REQ_COUNT, + bt_mesh.lpn.queue_size / segments_per_chunk); } #endif @@ -825,27 +821,7 @@ static int handle_info_get(const struct bt_mesh_model *mod, struct bt_mesh_msg_c net_buf_simple_add_u8(&rsp, BLOB_BLOCK_SIZE_LOG_MIN); net_buf_simple_add_u8(&rsp, BLOB_BLOCK_SIZE_LOG_MAX); net_buf_simple_add_le16(&rsp, CONFIG_BT_MESH_BLOB_CHUNK_COUNT_MAX); - -#if defined(CONFIG_BT_MESH_LOW_POWER) - /* If friendship is established, then chunk size is according to friend's queue size. - * Chunk size = (Queue size * Segment size) - (Opcode (1) - Chunk Number (2) - * - 8 byte MIC (max)) - */ - if (bt_mesh_lpn_established() && bt_mesh.lpn.queue_size > 0) { - uint16_t chunk_size = (bt_mesh.lpn.queue_size * 12) - 11; - - chunk_size = MIN(chunk_size, BLOB_RX_CHUNK_SIZE); - net_buf_simple_add_le16(&rsp, chunk_size); - if (bt_mesh.lpn.queue_size <= 2) { - LOG_WRN("FndQ too small %u", bt_mesh.lpn.queue_size); - } - } else { - net_buf_simple_add_le16(&rsp, BLOB_RX_CHUNK_SIZE); - } -#else net_buf_simple_add_le16(&rsp, BLOB_RX_CHUNK_SIZE); -#endif - net_buf_simple_add_le32(&rsp, CONFIG_BT_MESH_BLOB_SIZE_MAX); net_buf_simple_add_le16(&rsp, MTU_SIZE_MAX); net_buf_simple_add_u8(&rsp, BT_MESH_BLOB_XFER_MODE_ALL); From 0da065ff35dc27d56d3988f0ca8049477908e59e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 183/881] Revert "[nrf fromtree] dts: nordic: Fix GPREGRET addresses for nRF54LM20A" This reverts commit b57c64b8fcf5a7e5e3b7a501074d364d36471f18. Signed-off-by: Jukka Rissanen --- dts/vendor/nordic/nrf54lm20a.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index d1e6d1b0d28..d673ae94e50 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -800,19 +800,19 @@ #address-cells = <1>; #size-cells = <1>; - gpregret1: gpregret1@500 { + gpregret1: gpregret1@51c { #address-cells = <1>; #size-cells = <1>; compatible = "nordic,nrf-gpregret"; - reg = <0x500 0x1>; + reg = <0x51c 0x1>; status = "disabled"; }; - gpregret2: gpregret2@504 { + gpregret2: gpregret2@520 { #address-cells = <1>; #size-cells = <1>; compatible = "nordic,nrf-gpregret"; - reg = <0x504 0x1>; + reg = <0x520 0x1>; status = "disabled"; }; }; From d6fe967e2139377d843a6507d3de647ecf306f1d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 184/881] Revert "[nrf fromtree] soc: nordic: Extend address validation to cover GPREGRET" This reverts commit d45132712f2f0a846c04f0c171ec9fcbd43d8d1a. Signed-off-by: Jukka Rissanen --- soc/nordic/validate_base_addresses.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 7426364417f..f3c9c8bf214 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -73,19 +73,13 @@ #define NRF_WDT0 NRF_WDT #endif -#if !defined(NRF_POWER_GPREGRET1) && defined(NRF_POWER) #if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) -#define NRF_POWER_GPREGRET1 (&NRF_POWER->GPREGRET) -#else -#define NRF_POWER_GPREGRET1 (&NRF_POWER->GPREGRET[0]) -#endif +#if !defined(NRF_POWER_GPREGRET1) && defined(NRF_POWER_BASE) +#define NRF_POWER_GPREGRET1 (0x51c + NRF_POWER_BASE) #endif -#if !defined(NRF_POWER_GPREGRET2) && defined(NRF_POWER) -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) -#define NRF_POWER_GPREGRET2 (&NRF_POWER->GPREGRET2) -#else -#define NRF_POWER_GPREGRET2 (&NRF_POWER->GPREGRET[1]) +#if !defined(NRF_POWER_GPREGRET2) && defined(NRF_POWER_BASE) +#define NRF_POWER_GPREGRET2 (0x520 + NRF_POWER_BASE) #endif #endif @@ -373,5 +367,9 @@ CHECK_DT_REG(cpurad_wdt010, NRF_RADIOCORE_WDT010); CHECK_DT_REG(cpurad_wdt011, NRF_RADIOCORE_WDT011); CHECK_DT_REG(wdt131, NRF_WDT131); CHECK_DT_REG(wdt132, NRF_WDT132); + +/* nRF51/nRF52-specific addresses */ +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) CHECK_DT_REG(gpregret1, NRF_POWER_GPREGRET1); CHECK_DT_REG(gpregret2, NRF_POWER_GPREGRET2); +#endif From 3b3b7a5169f3d6e762bde983ac0988cc8a921030 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 185/881] Revert "[nrf fromlist] samples: nordic: system_off: check for supported reset causes" This reverts commit 49957e518f5cd614529c2bc69e606e870629c1af. Signed-off-by: Jukka Rissanen --- samples/boards/nordic/system_off/src/main.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/samples/boards/nordic/system_off/src/main.c b/samples/boards/nordic/system_off/src/main.c index b4c2eeb2b1b..d119eff87da 100644 --- a/samples/boards/nordic/system_off/src/main.c +++ b/samples/boards/nordic/system_off/src/main.c @@ -31,17 +31,8 @@ static const struct gpio_dt_spec sw0 = GPIO_DT_SPEC_GET(DT_ALIAS(sw0), gpios); static const struct device *comp_dev = DEVICE_DT_GET(DT_NODELABEL(comp)); #endif -int print_reset_cause(uint32_t reset_cause) +void print_reset_cause(uint32_t reset_cause) { - int32_t ret; - uint32_t supported; - - ret = hwinfo_get_supported_reset_cause((uint32_t *) &supported); - - if (ret || !(reset_cause & supported)) { - return -ENOTSUP; - } - if (reset_cause & RESET_DEBUG) { printf("Reset by debugger.\n"); } else if (reset_cause & RESET_CLOCK) { @@ -51,8 +42,6 @@ int print_reset_cause(uint32_t reset_cause) } else { printf("Other wake up cause 0x%08X.\n", reset_cause); } - - return 0; } int main(void) @@ -68,12 +57,7 @@ int main(void) printf("\n%s system off demo\n", CONFIG_BOARD); hwinfo_get_reset_cause(&reset_cause); - rc = print_reset_cause(reset_cause); - - if (rc < 0) { - printf("Reset cause not supported.\n"); - return 0; - } + print_reset_cause(reset_cause); if (IS_ENABLED(CONFIG_APP_USE_RETAINED_MEM)) { bool retained_ok = retained_validate(); From 8ac877ccc41ccee96f4f0baebaa330cfdb13e8ad Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 186/881] Revert "[nrf fromlist] drivers: hwinfo: nrf: extend supported reset reasons" This reverts commit d6ac46be53344353db054fd4a6068868d1b99457. Signed-off-by: Jukka Rissanen --- drivers/hwinfo/hwinfo_nrf.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index 3d3314ddf58..f5a6ed38a20 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -207,15 +207,6 @@ int z_impl_hwinfo_get_supported_reset_cause(uint32_t *supported) | RESET_SOFTWARE | RESET_CPU_LOCKUP | RESET_LOW_POWER_WAKE -#if NRFX_RESET_REASON_HAS_VBUS - | RESET_POR -#endif -#if NRFX_RESET_REASON_HAS_GRTC - | RESET_CLOCK -#endif -#if defined(NRFX_RESET_REASON_TAMPC_MASK) || defined(NRFX_RESET_REASON_SECTAMPER_MASK) - | RESET_SECURITY -#endif | RESET_DEBUG); return 0; From 4789b36e45e8e49986f3916bc5c9d5ad3d891ccb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 187/881] Revert "[nrf fromlist] drivers: firmware: remove duplicate function definitions" This reverts commit 10fd4547f9aba742598e82a3975222fe7b07e267. Signed-off-by: Jukka Rissanen --- include/zephyr/drivers/firmware/tisci/tisci.h | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/include/zephyr/drivers/firmware/tisci/tisci.h b/include/zephyr/drivers/firmware/tisci/tisci.h index 38fc58b9121..8097d6d4405 100644 --- a/include/zephyr/drivers/firmware/tisci/tisci.h +++ b/include/zephyr/drivers/firmware/tisci/tisci.h @@ -891,6 +891,44 @@ int tisci_cmd_set_fwl_region(const struct device *dev, const struct tisci_msg_fw */ int tisci_cmd_get_fwl_region(const struct device *dev, struct tisci_msg_fwl_region *region); +/* INCLUDE_ZEPHYR_DRIVERS_TISCI_H_ */ + +/* Firewall Management Functions */ +/* ... previous firewall functions ... */ + +/** + * @brief Get firewall region configuration + * + * Retrieves the configuration of a firewall region including permissions, + * addresses, and control settings. + * + * @param dev Pointer to the TI SCI device + * @param region Pointer to store the firewall region configuration. + * The fwl_id, region, and n_permission_regs fields must be + * set before calling this function. + * + * @return 0 if successful, or an error code + */ +int tisci_cmd_get_fwl_region(const struct device *dev, struct tisci_msg_fwl_region *region); + +/* Firewall Management Functions */ +/* ... previous firewall functions ... */ + +/** + * @brief Get firewall region configuration + * + * Retrieves the configuration of a firewall region including permissions, + * addresses, and control settings. + * + * @param dev Pointer to the TI SCI device + * @param region Pointer to store the firewall region configuration. + * The fwl_id, region, and n_permission_regs fields must be + * set before calling this function. + * + * @return 0 if successful, or an error code + */ +int tisci_cmd_get_fwl_region(const struct device *dev, struct tisci_msg_fwl_region *region); + /* Firewall Management Functions */ /* ... previous firewall functions ... */ From 170f34a881ace5abb266bc4507591449953eba8a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:05 +0300 Subject: [PATCH 188/881] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit 2c70598db1380173cedfaf193c93d9c540fdd72e. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 853d84113a6..6ec17c12dce 100644 --- a/west.yml +++ b/west.yml @@ -325,7 +325,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 8b6001d6bdd9e2c8bb858fdb26f696f6d5f73db5 + revision: 6e5961223f81aa2707c555db138819a5c1b7942c path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: 787eea1a3c8dd13c86214e204a919e6f9bcebf91 From 4be466f51c6c1f2a9d050956920fbc6d0c1bd809 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 189/881] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit c09cc2f94af10b1996f9e0c726d25f252c434af0. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 6ec17c12dce..41fa45c8693 100644 --- a/west.yml +++ b/west.yml @@ -325,7 +325,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 6e5961223f81aa2707c555db138819a5c1b7942c + revision: 968d55ff22579080466bf2f482596dd6e35361c6 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: 787eea1a3c8dd13c86214e204a919e6f9bcebf91 From 455fe3e2762eb56181593109e491074e5bcaf287 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 190/881] Revert "[nrf fromlist] doc: extensions: kconfig: Add support for sysbuild" This reverts commit 6fb16ab25d1adff73dbde6b89defcc6ce8a20734. Signed-off-by: Jukka Rissanen --- doc/_extensions/zephyr/kconfig/__init__.py | 276 ++++++++++----------- 1 file changed, 130 insertions(+), 146 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index eb1903b1898..6bf828a9088 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -70,24 +70,19 @@ ZEPHYR_BASE = Path(__file__).parents[4] -def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, dict[str, str]]: +def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, dict[str, str]]: """Load Kconfig""" with TemporaryDirectory() as td: modules = zephyr_module.parse_modules(ZEPHYR_BASE) # generate Kconfig.modules file kconfig = "" - sysbuild_kconfig = "" for module in modules: kconfig += zephyr_module.process_kconfig(module.project, module.meta) - sysbuild_kconfig += zephyr_module.process_sysbuildkconfig(module.project, module.meta) with open(Path(td) / "Kconfig.modules", "w") as f: f.write(kconfig) - with open(Path(td) / "Kconfig.sysbuild.modules", "w") as f: - f.write(sysbuild_kconfig) - # generate dummy Kconfig.dts file kconfig = "" @@ -150,13 +145,6 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d os.environ["BOARD"] = "boards" os.environ["KCONFIG_BOARD_DIR"] = str(Path(td) / "boards") - # Sysbuild runs first - os.environ["CONFIG_"] = "SB_CONFIG_" - sysbuild_output = kconfiglib.Kconfig(ZEPHYR_BASE / "share" / "sysbuild" / "Kconfig") - - # Normal Kconfig runs second - os.environ["CONFIG_"] = "CONFIG_" - # insert external Kconfigs to the environment module_paths = dict() for module in modules: @@ -184,7 +172,7 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d if kconfig.exists(): os.environ[f"ZEPHYR_{name_var}_KCONFIG"] = str(kconfig) - return kconfiglib.Kconfig(ZEPHYR_BASE / "Kconfig"), sysbuild_output, module_paths + return kconfiglib.Kconfig(ZEPHYR_BASE / "Kconfig"), module_paths class KconfigSearchNode(nodes.Element): @@ -344,15 +332,13 @@ def add_option(self, option): def sc_fmt(sc): - prefix = os.environ["CONFIG_"] - if isinstance(sc, kconfiglib.Symbol): if sc.nodes: - return f'{prefix}{sc.name}' + return f'CONFIG_{sc.name}' elif isinstance(sc, kconfiglib.Choice): if not sc.name: return "<choice>" - return f'<choice {prefix}{sc.name}>' + return f'<choice CONFIG_{sc.name}>' return kconfiglib.standard_sc_expr_str(sc) @@ -364,139 +350,137 @@ def kconfig_build_resources(app: Sphinx) -> None: return with progress_message("Building Kconfig database..."): - kconfig, sysbuild_kconfig, module_paths = kconfig_load(app) + kconfig, module_paths = kconfig_load(app) db = list() - for kconfig_obj in [kconfig, sysbuild_kconfig]: - os.environ["CONFIG_"] = kconfig_obj.config_prefix - for sc in sorted( - chain(kconfig_obj.unique_defined_syms, kconfig_obj.unique_choices), - key=lambda sc: sc.name if sc.name else "", - ): - # skip nameless symbols - if not sc.name: + for sc in sorted( + chain(kconfig.unique_defined_syms, kconfig.unique_choices), + key=lambda sc: sc.name if sc.name else "", + ): + # skip nameless symbols + if not sc.name: + continue + + # store alternative defaults (from defconfig files) + alt_defaults = list() + for node in sc.nodes: + if "defconfig" not in node.filename: continue - # store alternative defaults (from defconfig files) - alt_defaults = list() - for node in sc.nodes: - if "defconfig" not in str(node.filename): - continue - - for value, cond in node.orig_defaults: - fmt = kconfiglib.expr_str(value, sc_fmt) - if cond is not sc.kconfig.y: - fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" - alt_defaults.append([fmt, node.filename]) - - # build list of symbols that select/imply the current one - # note: all reverse dependencies are ORed together, and conditionals - # (e.g. select/imply A if B) turns into A && B. So we first split - # by OR to include all entries, and we split each one by AND to just - # take the first entry. - selected_by = list() - if isinstance(sc, kconfiglib.Symbol) and sc.rev_dep != sc.kconfig.n: - for select in kconfiglib.split_expr(sc.rev_dep, kconfiglib.OR): - sym = kconfiglib.split_expr(select, kconfiglib.AND)[0] - selected_by.append(f"{kconfig_obj.config_prefix}{sym.name}") - - implied_by = list() - if isinstance(sc, kconfiglib.Symbol) and sc.weak_rev_dep != sc.kconfig.n: - for select in kconfiglib.split_expr(sc.weak_rev_dep, kconfiglib.OR): - sym = kconfiglib.split_expr(select, kconfiglib.AND)[0] - implied_by.append(f"{kconfig_obj.config_prefix}{sym.name}") - - # only process nodes with prompt or help - nodes = [node for node in sc.nodes if node.prompt or node.help] - - inserted_paths = list() - for node in nodes: - # avoid duplicate symbols by forcing unique paths. this can - # happen due to dependencies on 0, a trick used by some modules - path = f"{node.filename}:{node.linenr}" - if path in inserted_paths: - continue - inserted_paths.append(path) - - dependencies = None - if node.dep is not sc.kconfig.y: - dependencies = kconfiglib.expr_str(node.dep, sc_fmt) - - defaults = list() - for value, cond in node.orig_defaults: - fmt = kconfiglib.expr_str(value, sc_fmt) - if cond is not sc.kconfig.y: - fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" - defaults.append(fmt) - - selects = list() - for value, cond in node.orig_selects: - fmt = kconfiglib.expr_str(value, sc_fmt) - if cond is not sc.kconfig.y: - fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" - selects.append(fmt) - - implies = list() - for value, cond in node.orig_implies: - fmt = kconfiglib.expr_str(value, sc_fmt) - if cond is not sc.kconfig.y: - fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" - implies.append(fmt) - - ranges = list() - for min, max, cond in node.orig_ranges: - fmt = ( - f"[{kconfiglib.expr_str(min, sc_fmt)}, " - f"{kconfiglib.expr_str(max, sc_fmt)}]" - ) - if cond is not sc.kconfig.y: - fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" - ranges.append(fmt) - - choices = list() - if isinstance(sc, kconfiglib.Choice): - for sym in sc.syms: - choices.append(kconfiglib.expr_str(sym, sc_fmt)) - - menupath = "" - iternode = node - while iternode.parent is not iternode.kconfig.top_node: - iternode = iternode.parent - if iternode.prompt: - title = iternode.prompt[0] - else: - title = kconfiglib.standard_sc_expr_str(iternode.item) - menupath = f" > {title}" + menupath - - menupath = "(Top)" + menupath - - filename = str(node.filename) - for name, path in module_paths.items(): - path += "/" - if str(node.filename).startswith(path): - filename = str(node.filename).replace(path, f"/") - break - - db.append( - { - "name": f"{kconfig_obj.config_prefix}{sc.name}", - "prompt": node.prompt[0] if node.prompt else None, - "type": kconfiglib.TYPE_TO_STR[sc.type], - "help": node.help, - "dependencies": dependencies, - "defaults": defaults, - "alt_defaults": alt_defaults, - "selects": selects, - "selected_by": selected_by, - "implies": implies, - "implied_by": implied_by, - "ranges": ranges, - "choices": choices, - "filename": filename, - "linenr": node.linenr, - "menupath": menupath, - } + for value, cond in node.orig_defaults: + fmt = kconfiglib.expr_str(value, sc_fmt) + if cond is not sc.kconfig.y: + fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" + alt_defaults.append([fmt, node.filename]) + + # build list of symbols that select/imply the current one + # note: all reverse dependencies are ORed together, and conditionals + # (e.g. select/imply A if B) turns into A && B. So we first split + # by OR to include all entries, and we split each one by AND to just + # take the first entry. + selected_by = list() + if isinstance(sc, kconfiglib.Symbol) and sc.rev_dep != sc.kconfig.n: + for select in kconfiglib.split_expr(sc.rev_dep, kconfiglib.OR): + sym = kconfiglib.split_expr(select, kconfiglib.AND)[0] + selected_by.append(f"CONFIG_{sym.name}") + + implied_by = list() + if isinstance(sc, kconfiglib.Symbol) and sc.weak_rev_dep != sc.kconfig.n: + for select in kconfiglib.split_expr(sc.weak_rev_dep, kconfiglib.OR): + sym = kconfiglib.split_expr(select, kconfiglib.AND)[0] + implied_by.append(f"CONFIG_{sym.name}") + + # only process nodes with prompt or help + nodes = [node for node in sc.nodes if node.prompt or node.help] + + inserted_paths = list() + for node in nodes: + # avoid duplicate symbols by forcing unique paths. this can + # happen due to dependencies on 0, a trick used by some modules + path = f"{node.filename}:{node.linenr}" + if path in inserted_paths: + continue + inserted_paths.append(path) + + dependencies = None + if node.dep is not sc.kconfig.y: + dependencies = kconfiglib.expr_str(node.dep, sc_fmt) + + defaults = list() + for value, cond in node.orig_defaults: + fmt = kconfiglib.expr_str(value, sc_fmt) + if cond is not sc.kconfig.y: + fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" + defaults.append(fmt) + + selects = list() + for value, cond in node.orig_selects: + fmt = kconfiglib.expr_str(value, sc_fmt) + if cond is not sc.kconfig.y: + fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" + selects.append(fmt) + + implies = list() + for value, cond in node.orig_implies: + fmt = kconfiglib.expr_str(value, sc_fmt) + if cond is not sc.kconfig.y: + fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" + implies.append(fmt) + + ranges = list() + for min, max, cond in node.orig_ranges: + fmt = ( + f"[{kconfiglib.expr_str(min, sc_fmt)}, " + f"{kconfiglib.expr_str(max, sc_fmt)}]" ) + if cond is not sc.kconfig.y: + fmt += f" if {kconfiglib.expr_str(cond, sc_fmt)}" + ranges.append(fmt) + + choices = list() + if isinstance(sc, kconfiglib.Choice): + for sym in sc.syms: + choices.append(kconfiglib.expr_str(sym, sc_fmt)) + + menupath = "" + iternode = node + while iternode.parent is not iternode.kconfig.top_node: + iternode = iternode.parent + if iternode.prompt: + title = iternode.prompt[0] + else: + title = kconfiglib.standard_sc_expr_str(iternode.item) + menupath = f" > {title}" + menupath + + menupath = "(Top)" + menupath + + filename = node.filename + for name, path in module_paths.items(): + path += "/" + if node.filename.startswith(path): + filename = node.filename.replace(path, f"/") + break + + db.append( + { + "name": f"CONFIG_{sc.name}", + "prompt": node.prompt[0] if node.prompt else None, + "type": kconfiglib.TYPE_TO_STR[sc.type], + "help": node.help, + "dependencies": dependencies, + "defaults": defaults, + "alt_defaults": alt_defaults, + "selects": selects, + "selected_by": selected_by, + "implies": implies, + "implied_by": implied_by, + "ranges": ranges, + "choices": choices, + "filename": filename, + "linenr": node.linenr, + "menupath": menupath, + } + ) app.env.kconfig_db = db # type: ignore From e64cc7ab6f1cbd0643f679c2285799c151d07430 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 191/881] Revert "[nrf noup] bluetooth: host: Allow auto swap feature without privacy" This reverts commit c1ddd14ed35f577e22cdd0021781a70bda2a0926. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index da1928758fd..3830745417a 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -633,7 +633,7 @@ config BT_ID_UNPAIR_MATCHING_BONDS config BT_ID_AUTO_SWAP_MATCHING_BONDS bool "Automatically swap conflicting entries in the Resolving List" depends on !BT_ID_UNPAIR_MATCHING_BONDS - depends on BT_SMP && BT_PERIPHERAL && !BT_CENTRAL + depends on BT_PRIVACY && BT_PERIPHERAL && !BT_CENTRAL help If this option is enabled, the Host will not add a new bond with the same peer address (or IRK) to the Resolving List if there is From 260b49f1deb69b69a6d3c265d9e00c6d68071a94 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 192/881] Revert "[nrf fromtree] cmake: mcuboot: SHA512/pure image signing" This reverts commit c136755381da8ba816a7be35bc0ff8050fc559df. Signed-off-by: Jukka Rissanen --- cmake/mcuboot.cmake | 7 ------- modules/Kconfig.mcuboot | 12 ------------ 2 files changed, 19 deletions(-) diff --git a/cmake/mcuboot.cmake b/cmake/mcuboot.cmake index ac37b175a31..d2fcf68e889 100644 --- a/cmake/mcuboot.cmake +++ b/cmake/mcuboot.cmake @@ -152,13 +152,6 @@ function(zephyr_mcuboot_tasks) set(imgtool_args --align ${write_block_size} ${imgtool_args}) endif() - # Set proper hash calculation algorithm for signing - if(CONFIG_MCUBOOT_BOOTLOADER_SIGNATURE_TYPE_PURE) - set(imgtool_args --pure ${imgtool_args}) - elseif(CONFIG_MCUBOOT_BOOTLOADER_USES_SHA512) - set(imgtool_args --sha 512 ${imgtool_args}) - endif() - # Extensionless prefix of any output file. set(output ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}) diff --git a/modules/Kconfig.mcuboot b/modules/Kconfig.mcuboot index a95dc34b72f..c02ee43f5eb 100644 --- a/modules/Kconfig.mcuboot +++ b/modules/Kconfig.mcuboot @@ -288,18 +288,6 @@ config MCUBOOT_BOOTLOADER_NO_DOWNGRADE MCUBOOT_DOWNGRADE_PREVENTION option enabled. endif -config MCUBOOT_BOOTLOADER_USES_SHA512 - bool "MCUboot uses SHA512 for image hash" - help - MCUboot has been compiled to verify images using SHA512. - -config MCUBOOT_BOOTLOADER_SIGNATURE_TYPE_PURE - bool "Signature is verified over an image rather than sha of an image" - help - MCUboot has been compiled to verify images using pure signature - verification, i.e., the signature is verified over the image rather - than the SHA of the image. - config MCUBOOT_APPLICATION_FIRMWARE_UPDATER bool "Application is firmware updater image" depends on MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER From 1490c0af4e5ea9fc147ad9ecf12702212b9ed555 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 193/881] Revert "[nrf fromlist] samples: bluetooth: Add support for nRF54lm20a to two samples" This reverts commit 8d7b9c9d00552a89eb04755435e24d555894d819. Signed-off-by: Jukka Rissanen --- samples/bluetooth/beacon/sample.yaml | 2 -- samples/bluetooth/peripheral_hr/sample.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index 00215341924..819ac3d3002 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -10,7 +10,6 @@ tests: - nrf52dk/nrf52832 - nrf54l15dk/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp tags: bluetooth integration_platforms: - qemu_cortex_m3 @@ -18,7 +17,6 @@ tests: - nrf52dk/nrf52832 - nrf54l15dk/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp sample.bluetooth.beacon-coex: extra_args: - CONF_FILE="prj-coex.conf" diff --git a/samples/bluetooth/peripheral_hr/sample.yaml b/samples/bluetooth/peripheral_hr/sample.yaml index 22bc7667461..8b0722d169f 100644 --- a/samples/bluetooth/peripheral_hr/sample.yaml +++ b/samples/bluetooth/peripheral_hr/sample.yaml @@ -15,7 +15,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - qemu_cortex_m3 - nrf52_bsim @@ -26,7 +25,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp tags: bluetooth sample.bluetooth.peripheral_hr.minimal: harness: bluetooth From 3e4fcd4e576e3721f7377b6ace20ddd6c627fd9a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 194/881] Revert "[nrf noup] samples: bluetooth: Add support for nRF54lm20a to hci_uart" This reverts commit 1512388b59efaa75c4f87e7139b878d0a58d8101. Signed-off-by: Jukka Rissanen --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 12 ------------ samples/bluetooth/hci_uart/sample.yaml | 4 ---- 2 files changed, 16 deletions(-) delete mode 100644 samples/bluetooth/hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/bluetooth/hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/bluetooth/hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 0388a57baec..00000000000 --- a/samples/bluetooth/hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&uart20 { - compatible = "nordic,nrf-uarte"; - current-speed = <1000000>; - status = "okay"; - hw-flow-control; -}; diff --git a/samples/bluetooth/hci_uart/sample.yaml b/samples/bluetooth/hci_uart/sample.yaml index 4dc5c6e9036..97ad6c561b2 100644 --- a/samples/bluetooth/hci_uart/sample.yaml +++ b/samples/bluetooth/hci_uart/sample.yaml @@ -8,14 +8,10 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf21540dk/nrf52840 - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf21540dk/nrf52840 - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp tags: - uart - bluetooth From b85aa1247dd9f075dc20ae833de394439b1cda19 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 195/881] Revert "[nrf noup] boards: arm: nrf9131ek: enable tfm" This reverts commit 797a60e8542a450d615b7fd1007f3c407fae87b8. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf9131ek/Kconfig.defconfig | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index 1a30d006b4c..e1d8de241c0 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -8,22 +8,3 @@ config HW_STACK_PROTECTION config BOARD_NRF9131EK select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS - -if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_NRF9131EK_NRF9131_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS From b8b3ee0efb155b0ce8fcf4dba3556fd2d153efad Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 196/881] Revert "[nrf noup] boards: nordic: nrf7002dk: Bring back NS variants" This reverts commit c1643faea535faad9caf5852960c2d9cb09db101. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 --- boards/nordic/nrf7002dk/Kconfig | 4 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 72 ------------------- boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 18 +---- boards/nordic/nrf7002dk/board.yml | 4 -- .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ---------- .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 ----- ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 24 ------- .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 ----------- .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 ----- .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 23 ------ 12 files changed, 4 insertions(+), 273 deletions(-) delete mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt deleted file mode 100644 index db20255712b..00000000000 --- a/boards/nordic/nrf7002dk/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND - CONFIG_BOARD_ENABLE_CPUNET) - zephyr_library() - zephyr_library_sources(nrf5340_cpunet_reset.c) -endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index d4b7030a65a..fa6c8097ae3 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,9 +10,7 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 config BT_HCI_IPC default y if BT diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig index 0d89a008996..48510d6e24f 100644 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -9,75 +9,3 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION endif # BOARD_NRF7002DK - -if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -# By default, if we build for a Non-Secure version of the board, -# force building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -# Code Partition: -# -# For the secure version of the board the firmware is linked at the beginning -# of the flash, or into the code-partition defined in DT if it is intended to -# be loaded by MCUboot. If the secure firmware is to be combined with a non- -# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always -# be restricted to the size of its code partition. -# -# For the non-secure version of the board, the firmware -# must be linked into the code-partition (non-secure) defined in DT, regardless. -# Apply this configuration below by setting the Kconfig symbols used by -# the linker according to the information extracted from DT partitions. - -# SRAM Partition: -# -# If the secure firmware is to be combined with a non-secure image -# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always -# be restricted to the secure image SRAM partition (sram-secure-partition). -# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram -# may be used by the image. -# -# For the non-secure version of the board, the firmware image SRAM is -# always restricted to the allocated non-secure SRAM partition. -# -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - -if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ - TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif - -if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif - -endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 91f52ee6f08..61b9e818f36 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,6 +4,4 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index 11a27910eeb..f85bbc86f48 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,24 +1,10 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) - set(TFM_PUBLIC_KEY_FORMAT "full") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -endif() - -if(CONFIG_TFM_FLASH_MERGED_BINARY) - set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 39db5dcfa3a..4f41341e442 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,9 +5,5 @@ board: socs: - name: nrf5340 variants: - - name: ns - cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp - variants: - - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts deleted file mode 100644 index 5ff28accf3f..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dtsi" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - zephyr,wifi = &wlan0; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; -}; - -&qspi { - nrf70: nrf7001@1 { - compatible = "nordic,nrf7001-qspi"; - status = "okay"; - reg = <1>; - qspi-frequency = <24000000>; - qspi-quad-mode; - - #include "nrf70_common.dtsi" - }; -}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml deleted file mode 100644 index 16575969126..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns -name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usbd - - usb_device - - netif:openthread -vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig deleted file mode 100644 index 2c435653140..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts deleted file mode 100644 index 0deb8ccc1bf..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dtsi" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns_app; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - zephyr,wifi = &wlan0; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; -}; - -&qspi { - nrf70: nrf7002@1 { - compatible = "nordic,nrf7002-qspi"; - status = "okay"; - reg = <1>; - qspi-frequency = <24000000>; - qspi-quad-mode; - - #include "nrf70_common.dtsi" - #include "nrf70_common_5g.dtsi" - }; -}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml deleted file mode 100644 index ea43785b455..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk/nrf5340/cpuapp/ns -name: NRF7002-DK-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usbd - - usb_device - - netif:openthread -vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig deleted file mode 100644 index 1886b926bfd..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig +++ /dev/null @@ -1,23 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y From 9e0d3158b392f41c10219ba03583c73110e52085 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 197/881] Revert "[nrf noup] modules: hal_nordic: require nrf-regtool" This reverts commit e606b2aaf5ebd69b03c5fd92c99d9ef1d9c7e96a. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index e5b1ab60dfc..b6f35286412 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -13,7 +13,6 @@ if(CONFIG_NRF_REGTOOL_GENERATE_UICR) endif() if(DEFINED nrf_regtool_components) find_package(nrf-regtool 9.2.0 - REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From 3a60a6acc3c8200eadbee6c5c300cebc019475ea Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 198/881] Revert "[nrf noup] samples: lwm2m_client: Add support for nRF91x" This reverts commit 1b4e2efade1fa707bf264d4da17fa6b78e9d67fa. Signed-off-by: Jukka Rissanen --- samples/net/lwm2m_client/overlay-nrf91x.conf | 53 -------------------- 1 file changed, 53 deletions(-) delete mode 100644 samples/net/lwm2m_client/overlay-nrf91x.conf diff --git a/samples/net/lwm2m_client/overlay-nrf91x.conf b/samples/net/lwm2m_client/overlay-nrf91x.conf deleted file mode 100644 index 7b902178e07..00000000000 --- a/samples/net/lwm2m_client/overlay-nrf91x.conf +++ /dev/null @@ -1,53 +0,0 @@ -# Configuration file for nRF91x -# This file is merged with prj.conf in the application folder, and options -# set here will take precedence if they are present in both files. - -# General -CONFIG_MAIN_STACK_SIZE=4096 - -CONFIG_NET_SOCKETS=y -CONFIG_NET_NATIVE=y -CONFIG_NET_SOCKETS_OFFLOAD=y - -CONFIG_NET_CONFIG_MY_IPV6_ADDR="" -CONFIG_NET_CONFIG_PEER_IPV6_ADDR="" -CONFIG_NET_CONFIG_MY_IPV4_ADDR="" -CONFIG_NET_CONFIG_MY_IPV4_GW="" - -CONFIG_NET_CONFIG_NEED_IPV6=n -CONFIG_NET_CONFIG_NEED_IPV4=n -CONFIG_NET_CONFIG_AUTO_INIT=n - -# Modem related configurations -CONFIG_NRF_MODEM_LIB_NET_IF=y -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_DOWN=n -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=n -CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y - -CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=n -CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=n - -# Disable Duplicate Address Detection (DAD) -# due to not being properly implemented for offloaded interfaces. -CONFIG_NET_IPV6_NBR_CACHE=n -CONFIG_NET_IPV6_MLD=n - -# Zephyr NET Connection Manager and Connectivity layer. -CONFIG_NET_CONNECTION_MANAGER=y -CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024 - -CONFIG_NET_SAMPLE_LWM2M_ID="nrf91x" -CONFIG_NET_SAMPLE_LWM2M_SERVER="coaps://leshan.eclipseprojects.io:5684" -CONFIG_LWM2M_DNS_SUPPORT=y - -## Enable DTLS support -CONFIG_LWM2M_DTLS_SUPPORT=y -CONFIG_LWM2M_TLS_SESSION_CACHING=y -CONFIG_LWM2M_DTLS_CID=y -CONFIG_TLS_CREDENTIALS=y - -## Crypto -CONFIG_OBERON_BACKEND=y -CONFIG_NORDIC_SECURITY_BACKEND=y -CONFIG_MBEDTLS_SHA256_C=y From 7b76e94ee4507cd26a24a235604ba0da27611ef2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 199/881] Revert "[nrf noup] bluetooth: conn: Skip buffer ref count check in send_buf" This reverts commit cc098c6faa2fbcac2be22af3586102d17e81e5ea. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/conn.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index a74a0429527..489792d3098 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -702,27 +702,19 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - /* If ATT sent callback is delayed until data transmission - * is done by BLE controller, the transmitted buffer may - * have an additional reference. The reference is used to - * extend lifetime of the net buffer until the data - * transmission is confirmed by ACK of the remote. + /* Check that buf->ref is 1 or 2. It would be 1 if this was + * the only reference (e.g. buf was removed from the conn + * tx_queue). It would be 2 if the tx_data_pull kept it on + * the tx_queue for segmentation. * - * send_buf function can be called multiple times, if buffer - * has to be fragmented over HCI. In that case, the callback - * is provided as an argument only for the last transmitted - * fragment. The `buf->ref == 1` (or 2) check is skipped - * because it's impossible to properly validate number of - * references for the sent fragments if buffers may have the - * additional reference. - * - * Otherwise, check that buf->ref is 1 or 2. It would be 1 - * if this was the only reference (e.g. buf was removed from - * the conn tx_queue). It would be 2 if the tx_data_pull - * kept it on the tx_queue for segmentation. + * Allow for an additional buffer reference if callback is + * provided. This can be used to extend lifetime of the net + * buffer until the data transmission is confirmed by ACK of + * the remote. */ - __ASSERT_NO_MSG(IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX) || (buf->ref == 1) || - (buf->ref == 2)); + if (buf->ref > 2 + (cb ? 1 : 0)) { + __ASSERT_NO_MSG(false); + } /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. From 1202675732be6ff16a1fa1977603a5c46a01e2ae Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 200/881] Revert "[nrf noup] bluetooth: conn: Allow for an extra ref in bt_l2cap_send_pdu" This reverts commit 90daf74e59ef2ef4d6d385d39632fa9cd736c80a. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/conn.c | 17 +++++------------ subsys/bluetooth/host/l2cap.c | 8 ++------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 489792d3098..9e9f18c040a 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -702,19 +702,12 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - /* Check that buf->ref is 1 or 2. It would be 1 if this was - * the only reference (e.g. buf was removed from the conn - * tx_queue). It would be 2 if the tx_data_pull kept it on - * the tx_queue for segmentation. - * - * Allow for an additional buffer reference if callback is - * provided. This can be used to extend lifetime of the net - * buffer until the data transmission is confirmed by ACK of - * the remote. + /* Check that buf->ref is 1 or 2. It would be 1 if this + * was the only reference (e.g. buf was removed + * from the conn tx_queue). It would be 2 if the + * tx_data_pull kept it on the tx_queue for segmentation. */ - if (buf->ref > 2 + (cb ? 1 : 0)) { - __ASSERT_NO_MSG(false); - } + __ASSERT_NO_MSG((buf->ref == 1) || (buf->ref == 2)); /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 9fa5638d961..ac6fc60dbad 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -729,17 +729,13 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, return -ENOTCONN; } - /* Allow for an additional buffer reference if callback is provided. This can be used to - * extend lifetime of the net buffer until the data transmission is confirmed by ACK of the - * remote. - */ - if (pdu->ref > 1 + (cb ? 1 : 0)) { + if (pdu->ref != 1) { /* The host may alter the buf contents when fragmenting. Higher * layers cannot expect the buf contents to stay intact. Extra * refs suggests a silent data corruption would occur if not for * this error. */ - LOG_ERR("Expecting up to %d refs, got %d", cb ? 2 : 1, pdu->ref); + LOG_ERR("Expecting 1 ref, got %d", pdu->ref); return -EINVAL; } From 31d690e74bf13decb1087940a4bfd47fc233c237 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 201/881] Revert "[nrf noup] ci: update test_spec label for E2E DFU tests" This reverts commit 1b7ccc6e935529a3a464097925b31d69a3a9f9f2. Signed-off-by: Jukka Rissanen --- .github/test-spec.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 76def875e0b..5337249f7da 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -49,33 +49,6 @@ - "tests/subsys/dfu/**/*" - "tests/subsys/mgmt/mcumgr/**/*" -"CI-dfu-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/**/*" - - "drivers/console/**/*" - - "drivers/flash/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/spi/**/*" - - "dts/arm/nordic/nrf54h*" - - "dts/common/nordic/*" - - "dts/riscv/nordic/nrf54h*" - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "include/zephyr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" - - "scripts/west_commands/runners/nrfutil.py" - - "soc/nordic/nrf54h/**/*" - - "subsys/bluetooth/**/*" - - "subsys/dfu/**/*" - - "subsys/logging/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "subsys/tracing/**/*" - "CI-tfm-test": - "boards/nordic/nrf5340dk/**/*" - "boards/nordic/nrf9160dk/**/*" From 227c0351a36644647a2a640c7bdb7206193ffc81 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 202/881] Revert "[nrf noup] boards: nordic: nrf54lm20 adjust ROM_START_OFFSET" This reverts commit cd135b25e4e48e649c8fdfa97abee3989c5300f6. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54lm20dk/Kconfig.defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig index 2efb752c97b..266f0f7c13d 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54lm20dk/Kconfig.defconfig @@ -4,7 +4,6 @@ if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP config ROM_START_OFFSET - default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP From 5535f15173dd3bcc117797ecacc4a323db37489d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 203/881] Revert "[nrf noup] modem: backend: uart: SLM optimized modem UART backend" This reverts commit 3290b8b98587cafc91c483cdd217a40f9c51bad0. Signed-off-by: Jukka Rissanen --- include/zephyr/modem/backend/uart_slm.h | 61 --- subsys/modem/backends/CMakeLists.txt | 1 - subsys/modem/backends/Kconfig | 23 - .../modem/backends/modem_backend_uart_slm.c | 514 ------------------ 4 files changed, 599 deletions(-) delete mode 100644 include/zephyr/modem/backend/uart_slm.h delete mode 100644 subsys/modem/backends/modem_backend_uart_slm.c diff --git a/include/zephyr/modem/backend/uart_slm.h b/include/zephyr/modem/backend/uart_slm.h deleted file mode 100644 index e522c6cf791..00000000000 --- a/include/zephyr/modem/backend/uart_slm.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -#ifndef ZEPHYR_MODEM_BACKEND_UART_SLM_ -#define ZEPHYR_MODEM_BACKEND_UART_SLM_ - -#ifdef __cplusplus -extern "C" { -#endif - -struct slm_rx_queue_event { - uint8_t *buf; - size_t len; -}; - -struct modem_backend_uart_slm { - const struct device *uart; - struct modem_pipe pipe; - struct k_work_delayable receive_ready_work; - struct k_work transmit_idle_work; - -#ifdef CONFIG_MODEM_STATS - struct modem_stats_buffer receive_buf_stats; - struct modem_stats_buffer transmit_buf_stats; -#endif - struct ring_buf transmit_rb; - struct k_work rx_disabled_work; - atomic_t state; - - struct k_mem_slab rx_slab; - struct k_msgq rx_queue; - struct slm_rx_queue_event rx_event; - struct slm_rx_queue_event rx_queue_buf[CONFIG_MODEM_BACKEND_UART_SLM_BUFFER_COUNT]; - uint32_t rx_buf_size; - uint8_t rx_buf_count; -}; - -struct modem_backend_uart_slm_config { - const struct device *uart; - uint8_t *receive_buf; /* Address must be word-aligned. */ - uint32_t receive_buf_size; - uint8_t *transmit_buf; - uint32_t transmit_buf_size; -}; - -struct modem_pipe *modem_backend_uart_slm_init(struct modem_backend_uart_slm *backend, - const struct modem_backend_uart_slm_config *config); - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_MODEM_BACKEND_UART_SLM_ */ diff --git a/subsys/modem/backends/CMakeLists.txt b/subsys/modem/backends/CMakeLists.txt index 787697a84e1..e2247a8a09d 100644 --- a/subsys/modem/backends/CMakeLists.txt +++ b/subsys/modem/backends/CMakeLists.txt @@ -10,4 +10,3 @@ if(CONFIG_MODEM_BACKEND_UART_ASYNC) zephyr_library_sources_ifdef(CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC modem_backend_uart_async_hwfc.c) zephyr_library_sources_ifndef(CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC modem_backend_uart_async.c) endif() -zephyr_library_sources_ifdef(CONFIG_MODEM_BACKEND_UART_SLM modem_backend_uart_slm.c) diff --git a/subsys/modem/backends/Kconfig b/subsys/modem/backends/Kconfig index 5f8d804ed35..2ce81c6dce1 100644 --- a/subsys/modem/backends/Kconfig +++ b/subsys/modem/backends/Kconfig @@ -64,26 +64,3 @@ endif # MODEM_BACKEND_UART_ASYNC_HWFC endif # MODEM_BACKEND_UART_ASYNC endif # MODEM_BACKEND_UART - -config MODEM_BACKEND_UART_SLM - bool "SLM-optimized modem UART backend" - select MODEM_PIPE - select RING_BUFFER - depends on UART_ASYNC_API - -if MODEM_BACKEND_UART_SLM - -config MODEM_BACKEND_UART_SLM_BUFFER_COUNT - int "SLM modem UART backend buffer count" - range 2 4 - default 3 - -config MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS - int "SLM modem UART transmit timeout in milliseconds" - default 1000 - -config MODEM_BACKEND_UART_SLM_RECEIVE_IDLE_TIMEOUT_MS - int "SLM modem UART receive idle timeout in milliseconds" - default 30 - -endif # MODEM_BACKEND_UART_SLM diff --git a/subsys/modem/backends/modem_backend_uart_slm.c b/subsys/modem/backends/modem_backend_uart_slm.c deleted file mode 100644 index f1aa1b0bb40..00000000000 --- a/subsys/modem/backends/modem_backend_uart_slm.c +++ /dev/null @@ -1,514 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include -LOG_MODULE_REGISTER(modem_backend_uart_slm, CONFIG_MODEM_MODULES_LOG_LEVEL); - -#include -#include -#include - -struct rx_buf_t { - atomic_t ref_counter; - uint8_t buf[]; -}; - -static inline struct rx_buf_t *block_start_get(struct modem_backend_uart_slm *backend, uint8_t *buf) -{ - size_t block_num; - - /* Find the correct block. */ - block_num = (((size_t)buf - sizeof(struct rx_buf_t) - (size_t)backend->rx_slab.buffer) / - backend->rx_buf_size); - - return (struct rx_buf_t *)&backend->rx_slab.buffer[block_num * backend->rx_buf_size]; -} - -static struct rx_buf_t *rx_buf_alloc(struct modem_backend_uart_slm *backend) -{ - struct rx_buf_t *buf; - - if (k_mem_slab_alloc(&backend->rx_slab, (void **)&buf, K_NO_WAIT)) { - return NULL; - } - atomic_set(&buf->ref_counter, 1); - - return buf; -} - -static void rx_buf_ref(struct modem_backend_uart_slm *backend, void *buf) -{ - atomic_inc(&(block_start_get(backend, buf)->ref_counter)); -} - -static void rx_buf_unref(struct modem_backend_uart_slm *backend, void *buf) -{ - struct rx_buf_t *uart_buf = block_start_get(backend, buf); - atomic_t ref_counter = atomic_dec(&uart_buf->ref_counter); - - if (ref_counter == 1) { - k_mem_slab_free(&backend->rx_slab, (void *)uart_buf); - } -} - -enum { - MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT, - MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT, - MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT, -}; - -static int modem_backend_uart_slm_rx_enable(struct modem_backend_uart_slm *backend) -{ - int ret; - struct rx_buf_t *buf = rx_buf_alloc(backend); - - if (!buf) { - return -ENOMEM; - } - - ret = uart_rx_enable(backend->uart, buf->buf, - backend->rx_buf_size - sizeof(struct rx_buf_t), - CONFIG_MODEM_BACKEND_UART_SLM_RECEIVE_IDLE_TIMEOUT_MS * 1000); - if (ret) { - rx_buf_unref(backend, buf->buf); - return ret; - } - - return 0; -} - -static void modem_backend_uart_slm_rx_recovery(struct modem_backend_uart_slm *backend) -{ - int err; - - if (!atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT)) { - return; - } - - err = modem_backend_uart_slm_rx_enable(backend); - if (err) { - LOG_DBG("RX recovery failed: %d", err); - return; - } - - if (!atomic_test_and_clear_bit(&backend->state, - MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT)) { - /* Closed during recovery. */ - uart_rx_disable(backend->uart); - } else { - LOG_DBG("RX recovery success"); - } -} - -static bool modem_backend_uart_slm_is_uart_stopped(const struct modem_backend_uart_slm *backend) -{ - if (!atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT) && - !atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT) && - !atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT)) { - return true; - } - - return false; -} - -static bool modem_backend_uart_slm_is_open(const struct modem_backend_uart_slm *backend) -{ - return atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT); -} - -static void modem_backend_uart_slm_event_handler(const struct device *dev, struct uart_event *evt, - void *user_data) -{ - struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)user_data; - struct slm_rx_queue_event rx_event; - int err; - - switch (evt->type) { - case UART_TX_DONE: - ring_buf_get_finish(&backend->transmit_rb, evt->data.tx.len); - atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - k_work_submit(&backend->transmit_idle_work); - break; - - case UART_TX_ABORTED: - ring_buf_get_finish(&backend->transmit_rb, evt->data.tx.len); - if (!modem_backend_uart_slm_is_open(backend)) { - /* When we are closing, send the remaining data after re-open. */ - atomic_clear_bit(&backend->state, - MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - break; - } - if (evt->data.tx.len != 0) { - /* If we were able to send some data, attempt to send the remaining - * data before releasing the transmit bit. - */ - uint8_t *buf; - size_t bytes_to_transmit = - ring_buf_get_claim(&backend->transmit_rb, &buf, - ring_buf_capacity_get(&backend->transmit_rb)); - - err = uart_tx(backend->uart, buf, bytes_to_transmit, - CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS * 1000L); - if (err) { - LOG_ERR("Failed to %s %u bytes. (%d)", "start async transmit for", - bytes_to_transmit, err); - atomic_clear_bit(&backend->state, - MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - } - break; - } - - /* We were not able to send anything. Start dropping data. */ - LOG_ERR("Transmit aborted (%u bytes dropped)", - ring_buf_size_get(&backend->transmit_rb)); - atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - k_work_submit(&backend->transmit_idle_work); - break; - - case UART_RX_BUF_REQUEST: - struct rx_buf_t *buf = rx_buf_alloc(backend); - - if (!buf) { - LOG_DBG("No receive buffer, disabling RX"); - break; - } - err = uart_rx_buf_rsp(backend->uart, buf->buf, - backend->rx_buf_size - sizeof(struct rx_buf_t)); - if (err) { - LOG_ERR("uart_rx_buf_rsp: %d", err); - rx_buf_unref(backend, buf->buf); - } - break; - - case UART_RX_BUF_RELEASED: - if (evt->data.rx_buf.buf) { - rx_buf_unref(backend, evt->data.rx_buf.buf); - } - break; - - case UART_RX_RDY: - if (evt->data.rx.buf) { - rx_buf_ref(backend, evt->data.rx.buf); - rx_event.buf = &evt->data.rx.buf[evt->data.rx.offset]; - rx_event.len = evt->data.rx.len; - err = k_msgq_put(&backend->rx_queue, &rx_event, K_NO_WAIT); - if (err) { - LOG_WRN("RX queue overflow: %d (dropped %u)", err, - evt->data.rx.len); - rx_buf_unref(backend, evt->data.rx.buf); - break; - } - k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); - } - break; - - case UART_RX_DISABLED: - if (atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT)) { - if (!atomic_test_and_set_bit(&backend->state, - MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT)) { - k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); - LOG_DBG("RX recovery started"); - } - } - break; - - case UART_RX_STOPPED: - LOG_WRN("Receive stopped for reasons: %u", (uint8_t)evt->data.rx_stop.reason); - break; - - default: - break; - } - - if (modem_backend_uart_slm_is_uart_stopped(backend)) { - k_work_submit(&backend->rx_disabled_work); - } -} - -static int modem_backend_uart_slm_open(void *data) -{ - struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)data; - struct rx_buf_t *rx_buf = rx_buf_alloc(backend); - int ret; - - if (!rx_buf) { - return -ENOMEM; - } - - atomic_clear(&backend->state); - atomic_set_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - atomic_set_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT); - - if (!ring_buf_is_empty(&backend->transmit_rb)) { - /* Transmit was aborted due to modem_backend_uart_slm_close. - * Send the remaining data before allowing further transmits. - */ - uint8_t *tx_buf; - const uint32_t tx_buf_size = ring_buf_get_claim( - &backend->transmit_rb, &tx_buf, ring_buf_size_get(&backend->transmit_rb)); - - ret = uart_tx(backend->uart, tx_buf, tx_buf_size, - CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS * 1000L); - if (ret) { - LOG_ERR("Failed to %s %u bytes. (%d)", "start async transmit for", - tx_buf_size, ret); - atomic_clear_bit(&backend->state, - MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - } - } else { - /* Previous transmit was not aborted. */ - atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - } - - ret = uart_rx_enable(backend->uart, rx_buf->buf, - backend->rx_buf_size - sizeof(struct rx_buf_t), - CONFIG_MODEM_BACKEND_UART_SLM_RECEIVE_IDLE_TIMEOUT_MS * 1000L); - if (ret < 0) { - rx_buf_unref(backend, rx_buf->buf); - atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT); - return ret; - } - - modem_pipe_notify_opened(&backend->pipe); - return 0; -} - -#ifdef CONFIG_MODEM_STATS -static uint32_t get_transmit_buf_size(const struct modem_backend_uart_slm *backend) -{ - return ring_buf_capacity_get(&backend->transmit_rb); -} - -static uint32_t get_receive_buf_size(struct modem_backend_uart_slm *backend) -{ - return (backend->rx_buf_size - sizeof(struct rx_buf_t)) * backend->rx_buf_count; -} - -static void advertise_transmit_buf_stats(struct modem_backend_uart_slm *backend, uint32_t length) -{ - modem_stats_buffer_advertise_length(&backend->transmit_buf_stats, length); -} - -static void advertise_receive_buf_stats(struct modem_backend_uart_slm *backend, uint32_t reserved) -{ - modem_stats_buffer_advertise_length(&backend->receive_buf_stats, reserved); -} -#endif - -static int modem_backend_uart_slm_transmit(void *data, const uint8_t *buf, size_t size) -{ - struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)data; - bool transmitting; - uint32_t bytes_to_transmit; - int ret; - uint8_t *tx_buf; - - if (!modem_backend_uart_slm_is_open(backend)) { - return -EPERM; - } - - transmitting = - atomic_test_and_set_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - if (transmitting) { - return 0; - } - - /* Copy buf to transmit ring buffer which is passed to UART. */ - ring_buf_reset(&backend->transmit_rb); - ring_buf_put(&backend->transmit_rb, buf, size); - bytes_to_transmit = ring_buf_get_claim(&backend->transmit_rb, &tx_buf, size); - - ret = uart_tx(backend->uart, tx_buf, bytes_to_transmit, - CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS * 1000L); - -#ifdef CONFIG_MODEM_STATS - advertise_transmit_buf_stats(backend, bytes_to_transmit); -#endif - - if (ret != 0) { - LOG_ERR("Failed to %s %u bytes. (%d)", "start async transmit for", - bytes_to_transmit, ret); - atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); - - return ret; - } - - return (int)bytes_to_transmit; -} - -static int modem_backend_uart_slm_receive(void *data, uint8_t *buf, size_t size) -{ - struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)data; - size_t received = 0; - size_t copy_size = 0; - -#ifdef CONFIG_MODEM_STATS - struct slm_rx_queue_event rx_event; - size_t reserved = backend->rx_event.len; - - for (int i = 0; i < k_msgq_num_used_get(&backend->rx_queue); i++) { - if (k_msgq_peek_at(&backend->rx_queue, &rx_event, i)) { - break; - } - reserved += rx_event.len; - } - advertise_receive_buf_stats(backend, reserved); -#endif - while (size > received) { - /* Keeping track of the rx_event allows us to receive less than what the event - * indicates. - */ - if (backend->rx_event.len == 0) { - if (k_msgq_get(&backend->rx_queue, &backend->rx_event, K_NO_WAIT)) { - break; - } - } - copy_size = MIN(size - received, backend->rx_event.len); - memcpy(buf, backend->rx_event.buf, copy_size); - buf += copy_size; - received += copy_size; - backend->rx_event.buf += copy_size; - backend->rx_event.len -= copy_size; - - if (backend->rx_event.len == 0) { - rx_buf_unref(backend, backend->rx_event.buf); - } - } - - if (backend->rx_event.len != 0 || k_msgq_num_used_get(&backend->rx_queue) != 0) { - k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); - } - - modem_backend_uart_slm_rx_recovery(backend); - - return (int)received; -} - -static int modem_backend_uart_slm_close(void *data) -{ - struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)data; - - atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT); - uart_tx_abort(backend->uart); - - if (!atomic_test_and_clear_bit(&backend->state, - MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT)) { - /* Disable the RX, if recovery is not ongoing. */ - uart_rx_disable(backend->uart); - } - - return 0; -} - -static void modem_backend_uart_slm_receive_ready_handler(struct k_work *item) -{ - struct modem_backend_uart_slm *backend = - CONTAINER_OF(k_work_delayable_from_work(item), struct modem_backend_uart_slm, - receive_ready_work); - - modem_pipe_notify_receive_ready(&backend->pipe); -} - -static void modem_backend_uart_slm_transmit_idle_handler(struct k_work *item) -{ - struct modem_backend_uart_slm *backend = - CONTAINER_OF(item, struct modem_backend_uart_slm, transmit_idle_work); - - modem_pipe_notify_transmit_idle(&backend->pipe); -} - -static void modem_backend_uart_slm_notify_closed(struct k_work *item) -{ - - struct modem_backend_uart_slm *backend = - CONTAINER_OF(item, struct modem_backend_uart_slm, rx_disabled_work); - - modem_pipe_notify_closed(&backend->pipe); -} - -#ifdef CONFIG_MODEM_STATS -static void init_stats(struct modem_backend_uart_slm *backend) -{ - char name[CONFIG_MODEM_STATS_BUFFER_NAME_SIZE]; - uint32_t receive_buf_size; - uint32_t transmit_buf_size; - - receive_buf_size = get_receive_buf_size(backend); - transmit_buf_size = get_transmit_buf_size(backend); - - snprintk(name, sizeof(name), "%s_%s", backend->uart->name, "rx"); - modem_stats_buffer_init(&backend->receive_buf_stats, name, receive_buf_size); - snprintk(name, sizeof(name), "%s_%s", backend->uart->name, "tx"); - modem_stats_buffer_init(&backend->transmit_buf_stats, name, transmit_buf_size); -} -#endif - -static const struct modem_pipe_api modem_backend_uart_slm_api = { - .open = modem_backend_uart_slm_open, - .transmit = modem_backend_uart_slm_transmit, - .receive = modem_backend_uart_slm_receive, - .close = modem_backend_uart_slm_close, -}; - -struct modem_pipe *modem_backend_uart_slm_init(struct modem_backend_uart_slm *backend, - const struct modem_backend_uart_slm_config *config) -{ - int err; - - __ASSERT_NO_MSG(config->uart != NULL); - __ASSERT_NO_MSG(config->receive_buf != NULL); - __ASSERT_NO_MSG(config->receive_buf_size > 1); - __ASSERT_NO_MSG((config->receive_buf_size % 2) == 0); - __ASSERT_NO_MSG(config->transmit_buf != NULL); - __ASSERT_NO_MSG(config->transmit_buf_size > 0); - - memset(backend, 0x00, sizeof(*backend)); - backend->uart = config->uart; - k_work_init_delayable(&backend->receive_ready_work, - modem_backend_uart_slm_receive_ready_handler); - k_work_init(&backend->transmit_idle_work, modem_backend_uart_slm_transmit_idle_handler); - k_work_init(&backend->rx_disabled_work, modem_backend_uart_slm_notify_closed); - - err = uart_callback_set(backend->uart, modem_backend_uart_slm_event_handler, backend); - if (err) { - LOG_ERR("uart_callback_set failed. (%d)", err); - return NULL; - } - - int32_t buf_size = (int32_t)config->receive_buf_size; - - backend->rx_buf_count = CONFIG_MODEM_BACKEND_UART_SLM_BUFFER_COUNT; - - /* k_mem_slab_init requires a word-aligned buffer. */ - __ASSERT((uintptr_t)config->receive_buf % sizeof(void *) == 0, - "Receive buffer is not word-aligned"); - - /* Make sure all the buffers will be aligned. */ - buf_size -= (config->receive_buf_size % (sizeof(uint32_t) * backend->rx_buf_count)); - backend->rx_buf_size = buf_size / backend->rx_buf_count; - __ASSERT_NO_MSG(backend->rx_buf_size > sizeof(struct rx_buf_t)); - - /* Initialize the RX buffers and event queue. */ - err = k_mem_slab_init(&backend->rx_slab, config->receive_buf, backend->rx_buf_size, - backend->rx_buf_count); - if (err) { - LOG_ERR("k_mem_slab_init failed. (%d)", err); - return NULL; - } - k_msgq_init(&backend->rx_queue, (char *)backend->rx_queue_buf, - sizeof(struct slm_rx_queue_event), CONFIG_MODEM_BACKEND_UART_SLM_BUFFER_COUNT); - - ring_buf_init(&backend->transmit_rb, config->transmit_buf_size, config->transmit_buf); - - modem_pipe_init(&backend->pipe, backend, &modem_backend_uart_slm_api); - -#ifdef CONFIG_MODEM_STATS - init_stats(backend); -#endif - return &backend->pipe; -} From 9e3d7a44c1c09dabb714668d89f5522345b55aa3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 204/881] Revert "[nrf noup] boards: xiao_ble: Add static partition manager configuration" This reverts commit f8d62960ff1247572cc783278a6fd42900e8621a. Signed-off-by: Jukka Rissanen --- boards/seeed/xiao_ble/pm_static.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 boards/seeed/xiao_ble/pm_static.yml diff --git a/boards/seeed/xiao_ble/pm_static.yml b/boards/seeed/xiao_ble/pm_static.yml deleted file mode 100644 index 02915293177..00000000000 --- a/boards/seeed/xiao_ble/pm_static.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Mirror of partitions defined in nrf52840_partition_uf2_sdv7.dtsi -# Default flash layout for nrf52840 using UF2 and SoftDevice s140 v7 - -softdevice_reserved: - address: 0x00 - size: 0x27000 - -app: - address: 0x27000 - size: 0xC5000 - -settings_storage: - address: 0xEC000 - size: 0x8000 - -uf2_partition: - address: 0xF4000 - size: 0xC000 From 175918220df3b12a2133c59ae04e6fed5bdae128 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:06 +0300 Subject: [PATCH 205/881] Revert "[nrf noup] boards: nrf54h20dk: Enable default images for sysbuild" This reverts commit 91e50002e9f067dff6727639670c1719308e9a6a. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54h20dk/Kconfig.sysbuild | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 boards/nordic/nrf54h20dk/Kconfig.sysbuild diff --git a/boards/nordic/nrf54h20dk/Kconfig.sysbuild b/boards/nordic/nrf54h20dk/Kconfig.sysbuild deleted file mode 100644 index 29bd62b4992..00000000000 --- a/boards/nordic/nrf54h20dk/Kconfig.sysbuild +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF54H20DK_NRF54H20_CPURAD - -config NRF_DEFAULT_EMPTY - default y - -endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From ee07e1432f59f593b6dad4130e413dbaa698a753 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 206/881] Revert "[nrf noup] bluetooth: host: Add support for bonding with same peer" This reverts commit 1890dbafd139c48deecd082099fb036fb4ca1649. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/bluetooth.h | 10 -- subsys/bluetooth/host/Kconfig | 18 --- subsys/bluetooth/host/adv.c | 52 ------- subsys/bluetooth/host/adv.h | 1 - subsys/bluetooth/host/hci_core.h | 23 +-- subsys/bluetooth/host/id.c | 217 ++------------------------- subsys/bluetooth/host/id.h | 23 --- subsys/bluetooth/host/keys.c | 79 +--------- subsys/bluetooth/host/keys.h | 6 - subsys/bluetooth/host/smp.c | 18 +-- tests/bluetooth/host/id/mocks/adv.c | 1 - tests/bluetooth/host/id/mocks/adv.h | 4 +- tests/bluetooth/host/id/mocks/keys.c | 1 - tests/bluetooth/host/id/mocks/keys.h | 4 +- 14 files changed, 30 insertions(+), 427 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 7f287f1c344..c6832764759 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1489,10 +1489,6 @@ struct bt_le_per_adv_param { * This error code is only guaranteed when using Zephyr * controller, for other controllers code returned in * this case may be -EIO. - * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and - * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable - * advertising is requested, and the given local identity has a conflicting - * key with another local identity for which advertising is already started. */ int bt_le_adv_start(const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, @@ -1620,12 +1616,6 @@ struct bt_le_ext_adv_start_param { * * @param adv Advertising set object. * @param param Advertise start parameters. - * - * @return Zero on success or (negative) error code otherwise. - * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and - * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable - * advertising is requested, and the given local identity has a conflicting - * key with another local identity for which advertising is already started. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, const struct bt_le_ext_adv_start_param *param); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 3830745417a..7611761bb45 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -630,24 +630,6 @@ config BT_ID_UNPAIR_MATCHING_BONDS link-layer. The Host does not have control over this acknowledgment, and the order of distribution is fixed by the specification. -config BT_ID_AUTO_SWAP_MATCHING_BONDS - bool "Automatically swap conflicting entries in the Resolving List" - depends on !BT_ID_UNPAIR_MATCHING_BONDS - depends on BT_PRIVACY && BT_PERIPHERAL && !BT_CENTRAL - help - If this option is enabled, the Host will not add a new bond with - the same peer address (or IRK) to the Resolving List if there is - already a bond with the same peer address (or IRK) on another local - identity. - - In case of Peripheral, the Host will swap the existing entry in the - Resolving List with the new one, so that the new bond will be used for - address resolution for the new local identity if the device starts - advertising with the new local identity. - - Important: this option is supported exclusively in the Peripheral - role. Excluding the Central role. - config BT_ID_ALLOW_UNAUTH_OVERWRITE bool "Allow unauthenticated pairing with same peer with other local identity" depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 2d7d65aaaeb..25a538614e3 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -272,25 +272,6 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) #endif /* CONFIG_BT_BROADCASTER */ #endif /* defined(CONFIG_BT_EXT_ADV) */ -struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id) -{ -#if defined(CONFIG_BT_EXT_ADV) - for (size_t i = 0; i < ARRAY_SIZE(adv_pool); i++) { - if (atomic_test_bit(adv_pool[i].flags, BT_ADV_CREATED) && - adv_pool[i].id == id) { - return &adv_pool[i]; - } - } -#else - if (atomic_test_bit(bt_dev.adv.flags, BT_ADV_CREATED) && bt_dev.adv.id == id) { - return &bt_dev.adv; - } -#endif - - return NULL; -} - - void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), void *data) { @@ -1040,14 +1021,6 @@ int bt_le_adv_start_legacy(struct bt_le_ext_adv *adv, adv->id = param->id; bt_dev.adv_conn_id = adv->id; - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - err = bt_id_resolving_list_check_and_update(adv->id, param->peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - err = bt_id_set_adv_own_addr(adv, param->options, dir_adv, &set_param.own_addr_type); if (err) { @@ -1363,15 +1336,6 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } adv->id = param->id; - - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - err = bt_id_resolving_list_check_and_update(adv->id, param->peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - err = le_ext_adv_param_set(adv, param, sd != NULL); if (err) { return err; @@ -1727,22 +1691,6 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, return -EALREADY; } - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - const bt_addr_le_t *peer; - - if (bt_addr_le_eq(&adv->target_addr, BT_ADDR_LE_ANY)) { - peer = NULL; - } else { - peer = &adv->target_addr; - } - - err = bt_id_resolving_list_check_and_update(adv->id, peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index 1bd15854db2..65ad51135ce 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -25,4 +25,3 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable); int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv); void bt_adv_reset_adv_pool(void); -struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 74c2711b3e4..b6ebdba31a7 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -500,28 +500,7 @@ struct bt_keys; void bt_id_add(struct bt_keys *keys); void bt_id_del(struct bt_keys *keys); -/** @brief Find a conflict in the resolving list for a candidate IRK. - * - * @param candidate The candidate keys to check for conflicts. - * @param all If true, check all IRKs, otherwise check only added keys. - * - * @return The conflicting key if there is one, or NULL if no conflict was found. - */ -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool all); - -/** * @brief Find multiple conflicts in the resolving list for a candidate IRK. - * - * This function iterates over all keys (added and not added to the Resolving List). If there are - * multiple conflicts, this function will return true. Otherwise, it will return false. - * - * If @c firt_conflict is not NULL, it will be set to the first found conflict. - * - * @param candidate The candidate key to check for conflicts. - * @param first_conflict Pointer to store the first found conflict, if any. Can be NULL. - * - * @return True if there are multiple conflicts, otherwise it returns false. - */ -bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict); +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate); int bt_setup_random_id_addr(void); int bt_setup_public_id_addr(void); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 436feb32c1b..e52294cf538 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -942,33 +942,9 @@ void bt_id_pending_keys_update(void) } } -static bool keys_conflict_check(const struct bt_keys *candidate, const struct bt_keys *resident) -{ - bool addr_conflict; - bool irk_conflict; - - addr_conflict = bt_addr_le_eq(&candidate->addr, &resident->addr); - - /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ - irk_conflict = (!bt_irk_eq(&candidate->irk, &(struct bt_irk){}) && - bt_irk_eq(&candidate->irk, &resident->irk)); - - if (addr_conflict || irk_conflict) { - LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val))); - LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&candidate->addr), - bt_hex(candidate->irk.val, sizeof(candidate->irk.val))); - - return true; - } - - return false; -} - struct bt_id_conflict { struct bt_keys *candidate; struct bt_keys *found; - bool check_all_irk; }; /* The Controller Resolve List is constrained by 7.8.38 "LE Add Device To @@ -980,6 +956,8 @@ struct bt_id_conflict { void find_rl_conflict(struct bt_keys *resident, void *user_data) { struct bt_id_conflict *conflict = user_data; + bool addr_conflict; + bool irk_conflict; __ASSERT_NO_MSG(conflict != NULL); __ASSERT_NO_MSG(conflict->candidate != NULL); @@ -992,26 +970,30 @@ void find_rl_conflict(struct bt_keys *resident, void *user_data) } /* Test against committed bonds only. */ - if (!conflict->check_all_irk && (resident->state & BT_KEYS_ID_ADDED) == 0) { - /* If the resident bond is not committed, we cannot have a conflict. */ + if ((resident->state & BT_KEYS_ID_ADDED) == 0) { return; } - if (resident->id == conflict->candidate->id) { - /* If the IDs are the same, we cannot have a conflict. */ - return; - } + addr_conflict = bt_addr_le_eq(&conflict->candidate->addr, &resident->addr); + + /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ + irk_conflict = (!bt_irk_eq(&conflict->candidate->irk, &(struct bt_irk){}) && + bt_irk_eq(&conflict->candidate->irk, &resident->irk)); + + if (addr_conflict || irk_conflict) { + LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&conflict->candidate->addr), + bt_hex(conflict->candidate->irk.val, sizeof(conflict->candidate->irk.val))); - if (keys_conflict_check(conflict->candidate, resident)) { conflict->found = resident; } } -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_irk) +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) { struct bt_id_conflict conflict = { .candidate = candidate, - .check_all_irk = check_all_irk, }; bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict, &conflict); @@ -1019,59 +1001,6 @@ struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_ir return conflict.found; } -struct bt_id_conflict_multiple { - struct bt_keys *candidate; - struct bt_keys *found; - bool found_multiple; -}; - -void find_rl_conflict_multiple(struct bt_keys *resident, void *user_data) -{ - struct bt_id_conflict_multiple *conflict = user_data; - - __ASSERT_NO_MSG(conflict != NULL); - __ASSERT_NO_MSG(conflict->candidate != NULL); - __ASSERT_NO_MSG(resident != NULL); - - if (conflict->found_multiple) { - /* If we already found enough conflicts, we can stop searching. */ - return; - } - - if (resident->id == conflict->candidate->id) { - /* If the IDs are the same, we cannot have a conflict. */ - return; - } - - if (keys_conflict_check(conflict->candidate, resident)) { - if (conflict->found) { - conflict->found_multiple = true; - - LOG_WRN("Found multiple conflicts for %s: addr %s and IRK %s", - bt_addr_le_str(&conflict->candidate->addr), - bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val))); - } else { - conflict->found = resident; - } - } -} - -bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict) -{ - struct bt_id_conflict_multiple conflict = { - .candidate = candidate, - }; - - bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict_multiple, &conflict); - - if (first_conflict != NULL) { - *first_conflict = conflict.found; - } - - return conflict.found_multiple; -} - void bt_id_add(struct bt_keys *keys) { CHECKIF(keys == NULL) { @@ -1323,122 +1252,6 @@ void bt_id_del(struct bt_keys *keys) bt_le_ext_adv_foreach(adv_unpause_enabled, NULL); } } - -static int conflict_check_and_replace(uint8_t id, struct bt_keys *keys) -{ - /* For the given key check if it has conflicts with other keys in the Resolving List - * (such keys have BT_KEYS_ID_ADDED state and BT_KEYS_ID_CONFLICT flag set). If it does, we - * need to remove the conflicting key from the Resolving List and add the new key. - * - * If the key is not in the Resolving List, we can add the new key right away. - * - * If advertiser for the conflicting key is enabled, we cannot remove the key from the - * Resolving List, so we return an error. - */ - - struct bt_keys *conflict; - const struct bt_le_ext_adv *adv; - - if (!(keys->flags & BT_KEYS_ID_CONFLICT)) { - LOG_DBG("Key has no conflicts for id %u addr %s", id, bt_addr_le_str(&keys->addr)); - return 0; - } - - if (keys->state & BT_KEYS_ID_ADDED) { - LOG_DBG("Key is already added to resolving list for id %u addr %s", id, - bt_addr_le_str(&keys->addr)); - return 0; - } - - /* bt_id_find_conflict returns only keys added to the Resolving List (state is - * BT_KEYS_ID_ADDED). If the key has conflict, but no keys were added (for example, if the - * last added key was removed after bt_unpair()), then this function will return NULL. Then, - * we don't need to remove a conflicting key from the Resolving List. Otherwise, we need to - * remove the conflicting key from the Resolving List before adding the new key. - */ - conflict = bt_id_find_conflict(keys, false); - if (conflict != NULL) { - __ASSERT_NO_MSG((conflict->flags & BT_KEYS_ID_CONFLICT) != 0); - - LOG_DBG("Found conflicting key with id %u addr %s", conflict->id, - bt_addr_le_str(&conflict->addr)); - - adv = bt_adv_lookup_by_id(conflict->id); - if (adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { - LOG_WRN("Cannot remove the conflicting key from the Resolving List while" - " advertising"); - return -EPERM; - } - - /* Drop BT_KEYS_ID_PENDING_DEL flag if we were about to delete the keys since we - * delete it here. - */ - conflict->state &= ~BT_KEYS_ID_PENDING_DEL; - bt_id_del(conflict); - } - - bt_id_add(keys); - - return 0; -} - -struct bt_id_resolve { - uint8_t id; - int err; -}; - -static void check_and_add_keys_for_id(struct bt_keys *keys, void *data) -{ - struct bt_id_resolve *resolve = data; - - if (resolve->err) { - /* Skipping other keys because we got error. */ - return; - } - - if (resolve->id != keys->id) { - /* We are only interested in keys for the given id */ - return; - } - - resolve->err = conflict_check_and_replace(resolve->id, keys); -} - -int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer) -{ - int err; - - if (peer == NULL) { - struct bt_id_resolve resolve = { - .id = id, - }; - - LOG_DBG("Updating resolving list for id %u without peer address", id); - - bt_keys_foreach_type(BT_KEYS_IRK, check_and_add_keys_for_id, &resolve); - err = resolve.err; - } else { - struct bt_keys *keys; - - LOG_DBG("Updating resolving list for id %u addr %s", id, bt_addr_le_str(peer)); - - keys = bt_keys_get_addr(id, peer); - if (!keys) { - LOG_DBG("No keys found for id %u addr %s", id, bt_addr_le_str(peer)); - return -ENOENT; - } - - err = conflict_check_and_replace(id, keys); - } - - if (err) { - LOG_ERR("Failed to update resolving list for id %u addr %s (err %d)", id, - peer ? bt_addr_le_str(peer) : "NULL", err); - return err; - } - - return err; -} #endif /* defined(CONFIG_BT_SMP) */ void bt_id_get(bt_addr_le_t *addrs, size_t *count) diff --git a/subsys/bluetooth/host/id.h b/subsys/bluetooth/host/id.h index cd66784a503..8824d3bb496 100644 --- a/subsys/bluetooth/host/id.h +++ b/subsys/bluetooth/host/id.h @@ -60,26 +60,3 @@ void bt_id_pending_keys_update(void); void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag); void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv); - -/** - * @brief Check and update the resolving list for a given identity. - * - * This function checks if the resolving list contains the keys for the given - * identity and peer address. If the keys are not present, it adds them to the - * resolving list. If the keys are present, it checks for conflicts with - * existing keys in the resolving list. If a conflict is found, it replaces - * the conflicting key with the new key. - * - * If the peer address is NULL, it updates the resolving list for all keys that belong to the given - * identity. - * - * If for any of the keys belonging to the given identity a conflict is found and the advertiser for - * that key is enabled, the function returns an error. - * - * @param id The identity ID to check and update. - * @param peer The peer address to check against the resolving list. - * - * @return 0 on success, or a negative error code on failure. - * @return -EPERM if a conflict is found and the advertiser for the conflicting key is enabled. - */ -int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer); diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 4ae1d5b7a96..6341fc1e58e 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -310,57 +310,16 @@ void bt_keys_add_type(struct bt_keys *keys, enum bt_keys_type type) keys->keys |= type; } -static void add_id_cb(struct k_work *work) -{ - bt_id_pending_keys_update(); -} - -static K_WORK_DEFINE(add_id_work, add_id_cb); - void bt_keys_clear(struct bt_keys *keys) { - struct bt_keys *conflict = NULL; - __ASSERT_NO_MSG(keys != NULL); LOG_DBG("%s (keys 0x%04x)", bt_addr_le_str(&keys->addr), keys->keys); - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && - (keys->flags & BT_KEYS_ID_CONFLICT) != 0) { - /* We need to check how many conflicting keys left. If there is only one conflicting - * key left, we can remove the BT_KEYS_ID_CONFLICT flag from it so that Host don't - * need to check and update the Resolving List whenever this is needed. The key - * should be re-added to the Resolving List. - */ - bool found_multiple; - - found_multiple = bt_id_find_conflict_multiple(keys, &conflict); - if (conflict) { - if (found_multiple || (conflict->state & BT_KEYS_ID_ADDED) != 0) { - /* If we found multiple conflicting keys or the conflicting key - * is already added to the ID list, we don't need to clear the - * conflict flag for it and re-add it to the Resolving List. - */ - conflict = NULL; - } else { - /* Clear the conflict flag for the conflicting key */ - conflict->flags &= ~BT_KEYS_ID_CONFLICT; - } - } - } - if (keys->state & BT_KEYS_ID_ADDED) { bt_id_del(keys); } - if (conflict) { - /* Re-add the conflicting key to the Resolving List if it was the last conflicting - * key. - */ - bt_id_pending_keys_update_set(conflict, BT_KEYS_ID_PENDING_ADD); - k_work_submit(&add_id_work); - } - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { /* Delete stored keys from flash */ bt_settings_delete_keys(keys->id, &keys->addr); @@ -388,28 +347,6 @@ int bt_keys_store(struct bt_keys *keys) return 0; } -static void check_and_set_id_conflict_flag(struct bt_keys *keys) -{ - struct bt_keys *conflict; - - if (!IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - /* If auto-swap is not enabled, we don't need to check for conflicts */ - return; - } - - /* Use bt_id_find_conflict() to check if there are any conflicting keys for the given keys. - * If there is at least one, set the BT_KEYS_ID_CONFLICT flag for both the keys and the - * conflicting key. - */ - conflict = bt_id_find_conflict(keys, true); - if (conflict != NULL) { - LOG_DBG("Found conflicting key %p.", conflict); - - keys->flags |= BT_KEYS_ID_CONFLICT; - conflict->flags |= BT_KEYS_ID_CONFLICT; - } -} - static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { @@ -490,8 +427,6 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, memcpy(keys->storage_start, val, len); } - check_and_set_id_conflict_flag(keys); - LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { @@ -501,17 +436,17 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return 0; } +static void add_id_cb(struct k_work *work) +{ + bt_id_pending_keys_update(); +} + +static K_WORK_DEFINE(add_id_work, add_id_cb); + static void id_add(struct bt_keys *keys, void *user_data) { __ASSERT_NO_MSG(keys != NULL); - if (keys->flags & BT_KEYS_ID_CONFLICT) { - /* If the keys have the conflict flag set, we don't want to add them to the ID list, - * as this will cause issues with resolving list. - */ - return; - } - bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD); k_work_submit(&add_id_work); } diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index 185fd610e77..b53635ce2c5 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -45,12 +45,6 @@ enum { /* Bit 2 and 3 might accidentally exist in old stored keys */ BT_KEYS_SC = BIT(4), BT_KEYS_OOB = BIT(5), - /** Indicates that the keys are in conflict with existing keys. - * - * This is used to indicate that the keys being added conflict with - * existing keys from different identity. - */ - BT_KEYS_ID_CONFLICT = BIT(6), }; struct bt_ltk { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 916bb661bb9..3c4fc29fe24 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -909,7 +909,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) bt_id_del(keys); } - conflict = bt_id_find_conflict(keys, false); + conflict = bt_id_find_conflict(keys); if (conflict != NULL) { int err; @@ -919,7 +919,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) __ASSERT_NO_MSG(!err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(keys, false)); + __ASSERT_NO_MSG(!bt_id_find_conflict(keys)); bt_id_add(keys); } @@ -4048,24 +4048,16 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) */ __ASSERT_NO_MSG(!(smp->remote_dist & BT_SMP_DIST_ID_KEY)); - conflict = bt_id_find_conflict(new_bond, IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)); + conflict = bt_id_find_conflict(new_bond); if (conflict) { LOG_DBG("New bond conflicts with a bond on id %d.", conflict->id); } - if (conflict && !IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && - !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { + if (conflict && !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { LOG_WRN("Refusing new pairing. The old bond must be unpaired first."); return BT_SMP_ERR_AUTH_REQUIREMENTS; } - if (conflict && IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - LOG_WRN("Conflict detected with %p. Don't add key to Resolve List.", conflict); - new_bond->flags |= BT_KEYS_ID_CONFLICT; - conflict->flags |= BT_KEYS_ID_CONFLICT; - return 0; - } - if (conflict && IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { bool trust_ok; int unpair_err; @@ -4082,7 +4074,7 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) __ASSERT_NO_MSG(!unpair_err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond, false)); + __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond)); bt_id_add(new_bond); return 0; } diff --git a/tests/bluetooth/host/id/mocks/adv.c b/tests/bluetooth/host/id/mocks/adv.c index a22123dea3d..2c2d4f3f3c7 100644 --- a/tests/bluetooth/host/id/mocks/adv.c +++ b/tests/bluetooth/host/id/mocks/adv.c @@ -15,4 +15,3 @@ DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv *, DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DEFINE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); -DEFINE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/adv.h b/tests/bluetooth/host/id/mocks/adv.h index 1602ddf4718..bfb74400159 100644 --- a/tests/bluetooth/host/id/mocks/adv.h +++ b/tests/bluetooth/host/id/mocks/adv.h @@ -18,8 +18,7 @@ typedef void (*bt_le_ext_adv_foreach_cb)(struct bt_le_ext_adv *adv, void *data); FAKE(bt_le_adv_lookup_legacy) \ FAKE(bt_le_ext_adv_get_index) \ FAKE(bt_le_adv_set_enable_ext) \ - FAKE(bt_le_ext_adv_foreach) \ - FAKE(bt_adv_lookup_by_id) + FAKE(bt_le_ext_adv_foreach) DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable, struct bt_le_ext_adv *, bool); DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_le_adv_lookup_legacy); @@ -28,4 +27,3 @@ DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv * DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DECLARE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); -DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/keys.c b/tests/bluetooth/host/id/mocks/keys.c index 61f73569c46..f885ab875c0 100644 --- a/tests/bluetooth/host/id/mocks/keys.c +++ b/tests/bluetooth/host/id/mocks/keys.c @@ -10,4 +10,3 @@ DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DEFINE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); -DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); diff --git a/tests/bluetooth/host/id/mocks/keys.h b/tests/bluetooth/host/id/mocks/keys.h index 1912472b78d..b6901e315ab 100644 --- a/tests/bluetooth/host/id/mocks/keys.h +++ b/tests/bluetooth/host/id/mocks/keys.h @@ -15,9 +15,7 @@ typedef void (*bt_keys_foreach_type_cb)(struct bt_keys *keys, void *data); /* List of fakes used by this unit tester */ #define KEYS_FFF_FAKES_LIST(FAKE) \ FAKE(bt_keys_find_irk) \ - FAKE(bt_keys_foreach_type) \ - FAKE(bt_keys_get_addr) + FAKE(bt_keys_foreach_type) DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DECLARE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); -DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); From d40278ad3528353a61a5d402550858eb08413447 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 207/881] Revert "[nrf noup] zephyr: doc: fix board page" This reverts commit 45023b2d4f10fbbcb6f0be9da7d666a1cc5dee46. Signed-off-by: Jukka Rissanen --- boards/index.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/boards/index.rst b/boards/index.rst index 2ffe426fc24..3cc92770cfe 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -12,8 +12,33 @@ template available under :zephyr_file:`doc/templates/board.tmpl`. Shields are hardware add-ons that can be stacked on top of a board to add extra functionality. Refer to the :ref:`shield_porting_guide` for more information on how to port a shield. +.. admonition:: Search Tips + :class: dropdown + + * Use the form below to filter the list of supported boards and shields. If a field is left + empty, it will not be used in the filtering process. + + * Filtering by name and vendor is available for both boards and shields. The rest of the fields + apply only to boards. + + * A board/shield must meet **all** criteria selected across different fields. For example, if you + select both a vendor and an architecture, only boards that match both will be displayed. Within + a single field, selecting multiple options (such as two architectures) will show boards + matching **either** option. + + * The list of supported hardware features for each board is automatically generated using + information from the Devicetree. It may not be reflecting the full list of supported features + since some of them may not be enabled by default. + + * Can't find your exact board? Don't worry! If a similar board with the same or a closely related + MCU exists, you can use it as a :ref:`starting point ` for adding + support for your own board. + .. toctree:: :maxdepth: 2 :glob: + :hidden: */index + +.. zephyr:board-catalog:: From 2fa0f95729ecf75205295cf182399d2cd6a4c03e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 208/881] Revert "[nrf noup] ci: Update CI-boot-test patterns and remove SUIT labels" This reverts commit b68aa7bd7be4df7d7d6cb924c1f963cb590b9ce9. Signed-off-by: Jukka Rissanen --- .github/test-spec.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5337249f7da..6da6bdbaa87 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,7 +39,6 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": - - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" @@ -365,3 +364,29 @@ - "tests/boards/nordic/**/*" - "tests/drivers/**/*" - "tests/kernel/**/*" + +"CI-suit-dfu-test": + - "subsys/mgmt/mcumgr/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "subsys/bluetooth/**/*" + - "drivers/bluetooth/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/console/**/*" + - "drivers/gpio/**/*" + - "dts/common/nordic/*" + - "dts/arm/nordic/nrf54h*/**/*" + - "dts/riscv/nordic/nrf54h*/**/*" + - "boards/nordic/nrf54h*/**/*" + - "soc/nordic/nrf54h/**/*" + - "include/zephyr/**/*" + - "subsys/logging/**/*" + - "subsys/tracing/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/nrfutil.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" From c2fb2036b1c91f043b4fc231003bda6d9e1aecbc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 209/881] Revert "[nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs" This reverts commit 77ba279d1f02d409714133c72ca70852193d5e3c. Signed-off-by: Jukka Rissanen --- scripts/ci/check_compliance.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 3ee7b62c9b5..31bb02c22f8 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1241,30 +1241,6 @@ class SysbuildKconfigCheck(KconfigCheck): "SUIT_MPI_GENERATE", # Used by nRF runners to program provisioning data "SUIT_MPI_RAD_AREA_PATH", # Used by nRF runners to program provisioning data # zephyr-keep-sorted-stop - - # NCS-specific allowlist - # zephyr-keep-sorted-start re(^\s+") - "APP_CPUNET_RUN", # Used by sample - "APP_DFU", # Used by sample - "BT_FAST_PAIR", # Legacy/removed, used in migration documentation - "COMP_DATA_LAYOUT_ARRAY", # Used by test - "COMP_DATA_LAYOUT_MULTIPLE", # Used by test - "COMP_DATA_LAYOUT_SINGLE", # Used by test - "DTM_NO_DFE", # Used by DTM application - "DTM_TRANSPORT_HCI", # Used by DTM application - "INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation - "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "ML_APP_REMOTE_BOARD", # Used by machine learning application - "MY_APP_IMAGE_ABC", # Used in documentation - "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests - "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation - "SUIT_ENVELOPE_", # Used by jinja - "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation - "SUIT_MPI_", # Used by jinja - "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation - "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample - # zephyr-keep-sorted-stop } From dafba34634610e82a9b6dd640d60f06fbc716022 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 210/881] Revert "[nrf noup] ci: NCS-specific CI tweaks" This reverts commit ad003a38b2a4230828df44ea025f179a64256947. Signed-off-by: Jukka Rissanen --- .github/workflows/commit-tags.yml | 28 -------------------------- .github/workflows/compliance.yml | 13 +++++++----- Jenkinsfile | 5 ----- scripts/gitlint/zephyr_commit_rules.py | 4 ++-- 4 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/commit-tags.yml delete mode 100644 Jenkinsfile diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml deleted file mode 100644 index 828f0297167..00000000000 --- a/.github/workflows/commit-tags.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Commit tags - -on: - pull_request: - types: [synchronize, opened, reopened, edited, labeled, unlabeled, - milestoned, demilestoned, assigned, unassigned, ready_for_review, - review_requested] - -jobs: - commit_tags: - runs-on: ubuntu-22.04 - name: Run commit tags checks on patch series (PR) - steps: - - name: Update PATH for west - run: | - echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Checkout the code - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - - name: Run the commit tags - uses: nrfconnect/action-commit-tags@main - with: - target: . - upstream: zephyrproject-rtos/zephyr/main diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 22744e8a6ac..9d1621cc4d3 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -34,8 +34,8 @@ jobs: git config --global user.name "Your Name" git remote -v # Ensure there's no merge commits in the PR - #[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ - #(echo "::error ::Merge commits not allowed, rebase instead";false) + [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ + (echo "::error ::Merge commits not allowed, rebase instead";false) rm -fr ".git/rebase-apply" rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} @@ -72,9 +72,12 @@ jobs: git log --pretty=oneline | head -n 10 # Increase rename limit to allow for large PRs git config diff.renameLimit 10000 - ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic \ - -e Kconfig -e SysbuildKconfig -e KconfigBasicNoModules -e SysbuildKconfigBasicNoModules \ - -e ModulesMaintainers -c origin/${BASE_REF}.. + excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat" + # The signed-off-by check for dependabot should be skipped + if [ "${{ github.actor }}" == "dependabot[bot]" ]; then + excludes="$excludes -e Identity" + fi + ./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3b9cf002239..00000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,5 +0,0 @@ -@Library("CI_LIB") _ - -def pipeline = new ncs.sdk_zephyr.Main() - -pipeline.run(JOB_NAME) diff --git a/scripts/gitlint/zephyr_commit_rules.py b/scripts/gitlint/zephyr_commit_rules.py index ef317e22684..a2c9cd3cb7f 100644 --- a/scripts/gitlint/zephyr_commit_rules.py +++ b/scripts/gitlint/zephyr_commit_rules.py @@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule): name = "title-max-length-no-revert" id = "UC5" target = CommitMessageTitle - options_spec = [IntOption('line-length', 120, "Max line length")] + options_spec = [IntOption('line-length', 75, "Max line length")] violation_message = "Commit title exceeds max length ({0}>{1})" def validate(self, line, _commit): @@ -103,7 +103,7 @@ class MaxLineLengthExceptions(LineRule): name = "max-line-length-with-exceptions" id = "UC4" target = CommitMessageBody - options_spec = [IntOption('line-length', 120, "Max line length")] + options_spec = [IntOption('line-length', 75, "Max line length")] violation_message = "Commit message body line exceeds max length ({0}>{1})" def validate(self, line, _commit): From 1d6027827fb8a852cc261013ab1ca4685ccd27a3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 211/881] Revert "[nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20" This reverts commit 892f60bbd28790a22fbaa5631fd32aaa6a6f755f. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 ---- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 ------- tests/bluetooth/tester/sysbuild.cmake | 7 ++++ .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 40 ------------------- .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 13 ------ .../tester/sysbuild/hci_ipc/prj.conf | 23 ----------- 6 files changed, 7 insertions(+), 97 deletions(-) delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 51b0ef5fa8d..5bb1c4d8284 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -22,10 +22,3 @@ CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_BTTESTER_LOG_LEVEL_DBG=y CONFIG_UART_INTERRUPT_DRIVEN=y - -# Enable PSA RNG -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n -CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 4f9de686b7e..e6d4f675f57 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,17 +12,3 @@ status = "okay"; hw-flow-control; }; - -// Enable PSA RNG -/ { - chosen { - zephyr,entropy = &psa_rng; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; - - /delete-node/ prng; -}; diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index b640a7d0493..bcd564733c5 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -18,6 +18,13 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) ) endif() + if(SB_CONFIG_SOC_NRF54H20_CPUAPP) + set(${NET_APP}_CONF_FILE + ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf + CACHE INTERNAL "" + ) + endif() + set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index b7d64a9e6a0..00000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,40 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_ISR_STACK_SIZE=1024 -CONFIG_IDLE_STACK_SIZE=256 -CONFIG_MAIN_STACK_SIZE=1024 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=8192 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y - -CONFIG_BT_BUF_EVT_RX_COUNT=16 -CONFIG_BT_BUF_EVT_RX_SIZE=255 -CONFIG_BT_BUF_ACL_RX_SIZE=255 -CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_BUF_CMD_TX_SIZE=255 - -# Host -CONFIG_BT_BROADCASTER=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_OBSERVER=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_EXT_ADV=y -CONFIG_BT_PER_ADV=y -CONFIG_BT_PER_ADV_SYNC=y - -# Controller -CONFIG_BT_LL_SW_SPLIT=n -CONFIG_BT_LL_SOFTDEVICE=y -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 -CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 - -# Enable PSA RNG -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n -CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay deleted file mode 100644 index e34567fe834..00000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ /dev/null @@ -1,13 +0,0 @@ -// Enable PSA RNG -/ { - chosen { - zephyr,entropy = &psa_rng; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; - - /delete-node/ prng; -}; diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf deleted file mode 100644 index 08b1aed9e7f..00000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf +++ /dev/null @@ -1,23 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_HEAP_MEM_POOL_SIZE=4096 - -CONFIG_MAIN_STACK_SIZE=512 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y -CONFIG_BT_MAX_CONN=16 - - -# Workaround: Unable to allocate command buffer when using K_NO_WAIT since -# Host number of completed commands does not follow normal flow control. -CONFIG_BT_BUF_CMD_TX_COUNT=10 - -# Enable and adjust the below value as necessary -# CONFIG_BT_BUF_EVT_RX_COUNT=16 -# CONFIG_BT_BUF_EVT_RX_SIZE=255 -# CONFIG_BT_BUF_ACL_RX_SIZE=255 -# CONFIG_BT_BUF_ACL_TX_SIZE=251 -# CONFIG_BT_BUF_CMD_TX_SIZE=255 From 6affa0a605c5ae162f9ae07b5441cf50f30c0ddb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 212/881] Revert "[nrf noup] mgmt: mcumgr: Fix nRF5340 network core hook" This reverts commit 730c36b0bbb62f31816baeb0f3efaa84dc522c90. Signed-off-by: Jukka Rissanen --- subsys/mgmt/mcumgr/CMakeLists.txt | 13 ++++++------- subsys/mgmt/mcumgr/Kconfig | 2 +- subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 15 ++++++++++++--- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 -------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 3bb21e16f79..ad088eca067 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -17,11 +17,10 @@ add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) -if(CONFIG_MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index c45cb7f81d6..1c6a3a2a516 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,7 @@ menuconfig MCUMGR bool "mcumgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP && MCUMGR_GRP_IMG && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 + imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c index b372ce4e494..f1ac8a168e6 100644 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -8,10 +8,19 @@ #include #include "bootutil/bootutil_public.h" -int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state) +#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 +/* Sysbuild */ +#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER +#else +/* Legacy child/parent */ +#define NET_CORE_IMAGE 1 +#endif + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) { - if (image_index == CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER) { - /* Pretend that primary slot of the network core update image is unpopulated */ + if (image_index == NET_CORE_IMAGE) { + /* Pretend that primary slot of image 1 unpopulated */ state->magic = BOOT_MAGIC_UNSET; state->swap_type = BOOT_SWAP_TYPE_NONE; state->image_num = image_index; diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index d95f9b5849a..5f122fcf71f 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -227,14 +227,6 @@ config MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE sysbuild if needed. This enables selecting the correct slot when running a QSPI XIP split image application in DirectXIP mode. -config MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK - bool "nRF5340 network core bootutil hook" - depends on SOC_NRF5340_CPUAPP && BOOT_IMAGE_ACCESS_HOOKS && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 - default y - help - This option will enable a bootutil hook that populates the network core update image - slot with dummy data to allow for uploading a firmware update to the network core. - module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" From 5c33bd60222544f94ef196836c3a236003f33fcd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 213/881] Revert "[nrf noup] tests: crypto: Set size for PSA slot" This reverts commit 39b7cf4e0af13a0a08afd68b0b94976dc0ce8bac. Signed-off-by: Jukka Rissanen --- tests/crypto/secp256r1/mbedtls.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/crypto/secp256r1/mbedtls.conf b/tests/crypto/secp256r1/mbedtls.conf index c4ea620de55..bbc2eb0e656 100644 --- a/tests/crypto/secp256r1/mbedtls.conf +++ b/tests/crypto/secp256r1/mbedtls.conf @@ -1,7 +1,6 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED=y -CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE=65 CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=2 From 6d3990a8fc9b200cedefc533dfceb37ffaeb675b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 214/881] Revert "[nrf noup] Bluetooth: update experimental for qualification" This reverts commit a29db90830b199845cccdcf81544fc0129a228f9. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/controller/Kconfig | 4 +--- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 60726163581..2cc9600d27f 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -143,12 +143,10 @@ config BT_CTLR the HAS_BT_CTLR option. config BT_LL_SW_SPLIT - bool "Software-based Bluetooth LE Link Layer [EXPERIMENTAL]" + bool "Software-based Bluetooth LE Link Layer" default y depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED select HAS_BT_CTLR - select EXPERIMENTAL - select ENTROPY_GENERATOR help Use Zephyr software Bluetooth LE Link Layer ULL LLL split implementation. diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index 34e862378c5..2841e7d8a12 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -52,7 +52,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" + bool "L2CAP Enhanced Credit Based Flow Control support" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From dcfd98a887ec14d08e310fd9a576a557c4f717c8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 215/881] Revert "[nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration" This reverts commit 2e74ea72fa61061c4caf1beb6dda304473838774. Signed-off-by: Jukka Rissanen --- drivers/pinctrl/pinctrl_nrf.c | 32 ----------- .../zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 56 ------------------- 2 files changed, 88 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 34c0107b591..65a07310260 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -112,18 +112,6 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = { #define NRF_PSEL_TDM(reg, line) ((NRF_TDM_Type *)reg)->PSEL.line #endif -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || \ - defined(CONFIG_MSPI_HPF) || \ - DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(nordic_nrf_vpr_coprocessor, pinctrl_0) -#if defined(CONFIG_SOC_SERIES_NRF54LX) -#define NRF_PSEL_SDP_MSPI(psel) \ - nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_VPR); -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -/* On nRF54H, pin routing is controlled by secure domain, via UICR. */ -#define NRF_PSEL_SDP_MSPI(psel) -#endif -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || ... */ - int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg) { @@ -477,26 +465,6 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* defined(NRF_PSEL_TWIS) */ -#if defined(NRF_PSEL_SDP_MSPI) - case NRF_FUN_SDP_MSPI_CS0: - case NRF_FUN_SDP_MSPI_CS1: - case NRF_FUN_SDP_MSPI_CS2: - case NRF_FUN_SDP_MSPI_CS3: - case NRF_FUN_SDP_MSPI_CS4: - case NRF_FUN_SDP_MSPI_SCK: - case NRF_FUN_SDP_MSPI_DQ0: - case NRF_FUN_SDP_MSPI_DQ1: - case NRF_FUN_SDP_MSPI_DQ2: - case NRF_FUN_SDP_MSPI_DQ3: - case NRF_FUN_SDP_MSPI_DQ4: - case NRF_FUN_SDP_MSPI_DQ5: - case NRF_FUN_SDP_MSPI_DQ6: - case NRF_FUN_SDP_MSPI_DQ7: - NRF_PSEL_SDP_MSPI(psel); - dir = NRF_GPIO_PIN_DIR_OUTPUT; - input = NRF_GPIO_PIN_INPUT_CONNECT; - break; -#endif /* defined(NRF_PSEL_SDP_MSPI) */ default: return -ENOTSUP; } diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 088cfce648b..9de74061e8d 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -172,62 +172,6 @@ #define NRF_FUN_GRTC_CLKOUT_FAST 55U /** GRTC slow clock output */ #define NRF_FUN_GRTC_CLKOUT_32K 56U -/** SDP_MSPI clock pin */ -#define NRF_FUN_SDP_MSPI_SCK 57U -/** SDP_MSPI data pin 0 */ -#define NRF_FUN_SDP_MSPI_DQ0 58U -/** SDP_MSPI data pin 1 */ -#define NRF_FUN_SDP_MSPI_DQ1 59U -/** SDP_MSPI data pin 2 */ -#define NRF_FUN_SDP_MSPI_DQ2 60U -/** SDP_MSPI data pin 3 */ -#define NRF_FUN_SDP_MSPI_DQ3 61U -/** SDP_MSPI data pin 4 */ -#define NRF_FUN_SDP_MSPI_DQ4 62U -/** SDP_MSPI data pin 5 */ -#define NRF_FUN_SDP_MSPI_DQ5 63U -/** SDP_MSPI data pin 6 */ -#define NRF_FUN_SDP_MSPI_DQ6 64U -/** SDP_MSPI data pin 7 */ -#define NRF_FUN_SDP_MSPI_DQ7 65U -/** SDP_MSPI chip select 0 */ -#define NRF_FUN_SDP_MSPI_CS0 66U -/** SDP_MSPI chip select 1 */ -#define NRF_FUN_SDP_MSPI_CS1 67U -/** SDP_MSPI chip select 2 */ -#define NRF_FUN_SDP_MSPI_CS2 68U -/** SDP_MSPI chip select 3 */ -#define NRF_FUN_SDP_MSPI_CS3 69U -/** SDP_MSPI chip select 4 */ -#define NRF_FUN_SDP_MSPI_CS4 70U -/** High-Performance Framework MSPI clock pin */ -#define NRF_FUN_HPF_MSPI_SCK NRF_FUN_SDP_MSPI_SCK -/** High-Performance Framework MSPI data pin 0 */ -#define NRF_FUN_HPF_MSPI_DQ0 NRF_FUN_SDP_MSPI_DQ0 -/** High-Performance Framework MSPI data pin 1 */ -#define NRF_FUN_HPF_MSPI_DQ1 NRF_FUN_SDP_MSPI_DQ1 -/** High-Performance Framework MSPI data pin 2 */ -#define NRF_FUN_HPF_MSPI_DQ2 NRF_FUN_SDP_MSPI_DQ2 -/** High-Performance Framework MSPI data pin 3 */ -#define NRF_FUN_HPF_MSPI_DQ3 NRF_FUN_SDP_MSPI_DQ3 -/** High-Performance Framework MSPI data pin 4 */ -#define NRF_FUN_HPF_MSPI_DQ4 NRF_FUN_SDP_MSPI_DQ4 -/** High-Performance Framework MSPI data pin 5 */ -#define NRF_FUN_HPF_MSPI_DQ5 NRF_FUN_SDP_MSPI_DQ5 -/** High-Performance Framework MSPI data pin 6 */ -#define NRF_FUN_HPF_MSPI_DQ6 NRF_FUN_SDP_MSPI_DQ6 -/** High-Performance Framework MSPI data pin 7 */ -#define NRF_FUN_HPF_MSPI_DQ7 NRF_FUN_SDP_MSPI_DQ7 -/** High-Performance Framework MSPI chip select pin 0 */ -#define NRF_FUN_HPF_MSPI_CS0 NRF_FUN_SDP_MSPI_CS0 -/** High-Performance Framework MSPI chip select pin 1 */ -#define NRF_FUN_HPF_MSPI_CS1 NRF_FUN_SDP_MSPI_CS1 -/** High-Performance Framework MSPI chip select pin 2 */ -#define NRF_FUN_HPF_MSPI_CS2 NRF_FUN_SDP_MSPI_CS2 -/** High-Performance Framework MSPI chip select pin 3 */ -#define NRF_FUN_HPF_MSPI_CS3 NRF_FUN_SDP_MSPI_CS3 -/** High-Performance Framework MSPI chip select pin 4 */ -#define NRF_FUN_HPF_MSPI_CS4 NRF_FUN_SDP_MSPI_CS4 /** TDM SCK in master mode */ #define NRF_FUN_TDM_SCK_M 71U /** TDM SCK in slave mode */ From f1ba5f30983ded00240617e7faefa87497e711d3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 216/881] Revert "[nrf noup] drivers: spi_dw: Bring back custom EXMIF peripheral handling" This reverts commit e2ee4c0ffea72be2e9385b81594cbad94ac00ae9. Signed-off-by: Jukka Rissanen --- drivers/pinctrl/pinctrl_nrf.c | 3 +- drivers/spi/spi_dw.c | 32 +--------------------- dts/bindings/spi/nordic,nrf-exmif-spi.yaml | 8 ------ 3 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 dts/bindings/spi/nordic,nrf-exmif-spi.yaml diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 65a07310260..07941fcb5ad 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -428,8 +428,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) || \ - DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif_spi) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) /* Pin routing is controlled by secure domain, via UICR */ case NRF_FUN_EXMIF_CK: case NRF_FUN_EXMIF_DQ0: diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index 6941bfdaaa7..bd10447e442 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -41,14 +41,6 @@ LOG_MODULE_REGISTER(spi_dw); #include #endif -#ifdef CONFIG_HAS_NRFX -#include -#endif - -#ifdef CONFIG_SOC_NRF54H20_GPD -#include -#endif - static inline bool spi_dw_is_slave(struct spi_dw_data *spi) { return (IS_ENABLED(CONFIG_SPI_SLAVE) && @@ -266,7 +258,6 @@ static int spi_dw_configure(const struct device *dev, /* Baud rate and Slave select, for master only */ write_baudr(dev, SPI_DW_CLK_DIVIDER(info->clock_frequency, config->frequency)); - write_ser(dev, BIT(config->slave)); } if (spi_dw_is_slave(spi)) { @@ -521,10 +512,6 @@ void spi_dw_isr(const struct device *dev) uint32_t int_status; int error; -#ifdef CONFIG_HAS_NRFX - NRF_EXMIF->EVENTS_CORE = 0; -#endif - int_status = read_isr(dev); LOG_DBG("SPI %p int_status 0x%x - (tx: %d, rx: %d)", dev, int_status, @@ -573,18 +560,6 @@ int spi_dw_init(const struct device *dev) DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); -#ifdef CONFIG_HAS_NRFX - NRF_EXMIF->INTENSET = BIT(0); - NRF_EXMIF->TASKS_START = 1; - -#ifdef CONFIG_SOC_NRF54H20_GPD - err = nrf_gpd_request(NRF_GPD_FAST_ACTIVE1); - if (err < 0) { - return err; - } -#endif -#endif - info->config_func(); /* Masking interrupt and making sure controller is disabled */ @@ -609,11 +584,6 @@ int spi_dw_init(const struct device *dev) return 0; } -#define REG_ADDR(inst) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), nordic_nrf_exmif_spi), \ - (Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(core, DT_DRV_INST(inst))), \ - (DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)))) - #define SPI_CFG_IRQS_SINGLE_ERR_LINE(inst) \ IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, rx_avail, irq), \ DT_INST_IRQ_BY_NAME(inst, rx_avail, priority), \ @@ -686,7 +656,7 @@ COND_CODE_1(IS_EQ(DT_NUM_IRQS(DT_DRV_INST(inst)), 1), \ SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ }; \ static const struct spi_dw_config spi_dw_config_##inst = { \ - REG_ADDR(inst), \ + DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ .clock_frequency = COND_CODE_1( \ DT_NODE_HAS_PROP(DT_INST_PHANDLE(inst, clocks), clock_frequency), \ (DT_INST_PROP_BY_PHANDLE(inst, clocks, clock_frequency)), \ diff --git a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml deleted file mode 100644 index d988b414687..00000000000 --- a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic External Memory Interface (EXMIF) used in SPI mode only - -compatible: "nordic,nrf-exmif-spi" - -include: snps,designware-spi.yaml From 98d7da57e2730e79dd261fe5ca6a3a6b11a9bee2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 217/881] Revert "[nrf noup] entropy: Add fake entropy nRF PRNG driver" This reverts commit e2aa08c6d7cbba17349065d497885731a21715df. Signed-off-by: Jukka Rissanen --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 6 -- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 5 - .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 6 -- .../nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 5 - drivers/entropy/CMakeLists.txt | 7 -- drivers/entropy/Kconfig | 1 - drivers/entropy/Kconfig.nrf_prng | 19 ---- drivers/entropy/fake_entropy_nrf_prng.c | 101 ------------------ dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi | 9 -- dts/bindings/rng/nordic,nrf-prng.yaml | 8 -- 10 files changed, 167 deletions(-) delete mode 100644 drivers/entropy/Kconfig.nrf_prng delete mode 100644 drivers/entropy/fake_entropy_nrf_prng.c delete mode 100644 dts/bindings/rng/nordic,nrf-prng.yaml diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 85a2539c3ff..47255b0c994 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -27,7 +27,6 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; - zephyr,entropy = &prng; }; aliases { @@ -108,11 +107,6 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; - - prng: prng { - compatible = "nordic,entropy-prng"; - status = "okay"; - }; }; &cpuapp_bellboard { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 7e1a1c8e9e0..5473d9a7405 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -28,11 +28,6 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &prng; - }; - prng: prng { - compatible = "nordic,entropy-prng"; - status = "okay"; }; aliases { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 4a99911fa21..f4cce12f4b1 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -27,7 +27,6 @@ zephyr,ieee802154 = &cpuapp_ieee802154; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &prng; }; aliases { @@ -109,11 +108,6 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; - - prng: prng { - compatible = "nordic,entropy-prng"; - status = "okay"; - }; }; &cpuapp_ram0x_region { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index d6c03bc4a51..5efa7dbd471 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -28,11 +28,6 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &prng; - }; - prng: prng { - compatible = "nordic,entropy-prng"; - status = "okay"; }; aliases { diff --git a/drivers/entropy/CMakeLists.txt b/drivers/entropy/CMakeLists.txt index e038bbfe1b6..eaf858add89 100644 --- a/drivers/entropy/CMakeLists.txt +++ b/drivers/entropy/CMakeLists.txt @@ -45,11 +45,4 @@ zephyr_library_sources_ifdef(CONFIG_ENTROPY_SY1XX_TRNG entropy_sy1xx_tr zephyr_library_sources_ifdef(CONFIG_ENTROPY_TELINK_B91_TRNG entropy_b91_trng.c) # zephyr-keep-sorted-stop -if (CONFIG_FAKE_ENTROPY_NRF_PRNG) - zephyr_library_sources(fake_entropy_nrf_prng.c) - - message(WARNING "\nA nRF PRNG is used, which does not produce real random bits." - "This is not secure and should therefore never be used in a product.") -endif() - zephyr_library_link_libraries_ifdef(CONFIG_BUILD_WITH_TFM tfm_api) diff --git a/drivers/entropy/Kconfig b/drivers/entropy/Kconfig index c52ac96e6bf..e0a2080b343 100644 --- a/drivers/entropy/Kconfig +++ b/drivers/entropy/Kconfig @@ -36,7 +36,6 @@ source "drivers/entropy/Kconfig.neorv32" source "drivers/entropy/Kconfig.npcx" source "drivers/entropy/Kconfig.nrf5" source "drivers/entropy/Kconfig.nrf_cracen" -source "drivers/entropy/Kconfig.nrf_prng" source "drivers/entropy/Kconfig.nxp" source "drivers/entropy/Kconfig.psa_crypto" source "drivers/entropy/Kconfig.renesas_ra" diff --git a/drivers/entropy/Kconfig.nrf_prng b/drivers/entropy/Kconfig.nrf_prng deleted file mode 100644 index e81db4de4b1..00000000000 --- a/drivers/entropy/Kconfig.nrf_prng +++ /dev/null @@ -1,19 +0,0 @@ -# nRF fake entropy prng generator driver configuration - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if ENTROPY_GENERATOR - -config FAKE_ENTROPY_NRF_PRNG - bool "A fake nRF entropy driver" - default y - depends on DT_HAS_NORDIC_ENTROPY_PRNG_ENABLED - depends on (SOC_SERIES_NRF54HX || SOC_SERIES_NRF92X || SOC_SERIES_NRF54LX) - select ENTROPY_HAS_DRIVER - help - This is a super simple PRNG driver that can be used on nRF platforms that - do not have an entropy source. - This is NOT SAFE to use for cryptographic operations! - -endif diff --git a/drivers/entropy/fake_entropy_nrf_prng.c b/drivers/entropy/fake_entropy_nrf_prng.c deleted file mode 100644 index 8624c844405..00000000000 --- a/drivers/entropy/fake_entropy_nrf_prng.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include - -#define DT_DRV_COMPAT nordic_entropy_prng - -/* This file implements a pseudo-RNG - * https://vigna.di.unimi.it/xorshift/xoshiro128plus.c - */ - -static uint32_t s[4]; - -static inline uint32_t rotl(const uint32_t x, int k) -{ - return (x << k) | (x >> (32 - k)); -} - -static uint32_t rng_next(void) -{ - const uint32_t result = rotl(s[0] + s[3], 7) + s[0]; - - const uint32_t t = s[1] << 9; - - s[2] ^= s[0]; - s[3] ^= s[1]; - s[1] ^= s[2]; - s[0] ^= s[3]; - - s[2] ^= t; - - s[3] = rotl(s[3], 11); - - return result; -} - -static int entropy_prng_get_entropy(const struct device *dev, uint8_t *buffer, uint16_t length) -{ - ARG_UNUSED(dev); - - while (length) { - /* - * Note that only 1 thread (Zephyr thread or HW models), runs at - * a time, therefore there is no need to use random_r() - */ - uint32_t value = rng_next(); - - size_t to_copy = MIN(length, sizeof(long)); - - memcpy(buffer, &value, to_copy); - buffer += to_copy; - length -= to_copy; - } - - return 0; -} - -static int entropy_prng_get_entropy_isr(const struct device *dev, uint8_t *buf, uint16_t len, - uint32_t flags) -{ - ARG_UNUSED(flags); - - int err; - - /* - * entropy_prng_get_entropy() is also safe for ISRs - * and always produces data. - */ - err = entropy_prng_get_entropy(dev, buf, len); - if (err < 0) { - return err; - } else { - return len; - } -} - -static int entropy_prng_init(const struct device *dev) -{ - ARG_UNUSED(dev); - - /* Picked some arbitrary initial seed. */ - s[0] = 0xAF568BC0; - s[1] = 0xAC34307E; - s[2] = 0x9B7F6DD1; - s[3] = 0xD84319FC; - return 0; -} - -static const struct entropy_driver_api entropy_prng_api_funcs = { - .get_entropy = entropy_prng_get_entropy, .get_entropy_isr = entropy_prng_get_entropy_isr}; - -DEVICE_DT_INST_DEFINE(0, entropy_prng_init, NULL, NULL, NULL, PRE_KERNEL_1, - CONFIG_ENTROPY_INIT_PRIORITY, &entropy_prng_api_funcs); diff --git a/dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi index 5c7e5db3001..2df3fc59676 100644 --- a/dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi @@ -16,10 +16,6 @@ nvic: &cpuapp_nvic {}; /delete-node/ &cpuflpr_clic; / { - chosen { - zephyr,entropy = &prng; - }; - soc { compatible = "simple-bus"; interrupt-parent = <&cpuapp_nvic>; @@ -30,11 +26,6 @@ nvic: &cpuapp_nvic {}; compatible = "zephyr,psa-crypto-rng"; status = "disabled"; }; - - prng: prng { - compatible = "nordic,entropy-prng"; - status = "okay"; - }; }; &cpuflpr_vpr { diff --git a/dts/bindings/rng/nordic,nrf-prng.yaml b/dts/bindings/rng/nordic,nrf-prng.yaml deleted file mode 100644 index 8936393a0b6..00000000000 --- a/dts/bindings/rng/nordic,nrf-prng.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -description: This is a super simple PRNG - -compatible: "nordic,entropy-prng" - -include: base.yaml From c42a089d18249c0cf0690bc6e950872067302d02 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 218/881] Revert "[nrf noup] samples: bluetooth: hci_ipc: increase main stack size for Cracen driver on nRF54H20" This reverts commit 316cce07af745093d8056a50ff27c88e15f7d9b6. Signed-off-by: Jukka Rissanen --- .../bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index 296e6836638..00000000000 --- a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Increase stack size for Cracen driver. -CONFIG_MAIN_STACK_SIZE=1024 From 265ac977173eb2fa8ef449410fdefae4d3a56422 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 219/881] Revert "[nrf noup] samples: bluetooth: mesh: Disable secure storage for real targets." This reverts commit f331133c270974e2a33087c12dab21419fc0b0ba. Signed-off-by: Jukka Rissanen --- samples/bluetooth/mesh/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh/prj.conf | 2 +- samples/bluetooth/mesh_demo/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh_demo/prj.conf | 2 +- samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh_provisioner/prj.conf | 2 +- samples/boards/nordic/mesh/onoff-app/prj.conf | 2 +- .../nordic/mesh/onoff_level_lighting_vnd_app/prj.conf | 2 +- tests/bluetooth/mesh_shell/boards/qemu_x86.conf | 6 ------ tests/bluetooth/mesh_shell/prj.conf | 2 +- 10 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 samples/bluetooth/mesh/boards/qemu_x86.conf delete mode 100644 samples/bluetooth/mesh_demo/boards/qemu_x86.conf delete mode 100644 samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf delete mode 100644 tests/bluetooth/mesh_shell/boards/qemu_x86.conf diff --git a/samples/bluetooth/mesh/boards/qemu_x86.conf b/samples/bluetooth/mesh/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b78..00000000000 --- a/samples/bluetooth/mesh/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh/prj.conf b/samples/bluetooth/mesh/prj.conf index cd7d6532b61..14b19316a86 100644 --- a/samples/bluetooth/mesh/prj.conf +++ b/samples/bluetooth/mesh/prj.conf @@ -5,7 +5,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_HWINFO=y CONFIG_BT=y diff --git a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b78..00000000000 --- a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_demo/prj.conf b/samples/bluetooth/mesh_demo/prj.conf index b7016b02c65..bcb738ae5bd 100644 --- a/samples/bluetooth/mesh_demo/prj.conf +++ b/samples/bluetooth/mesh_demo/prj.conf @@ -31,7 +31,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y # Limit the number of key slots in PSA Crypto core to reduce # RAM footprint diff --git a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b78..00000000000 --- a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 24176780516..10949c5480d 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -45,7 +45,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y #CONFIG_BT_MESH_LOG_LEVEL_DBG=y #CONFIG_BT_MESH_SETTINGS_LOG_LEVEL_DBG=y diff --git a/samples/boards/nordic/mesh/onoff-app/prj.conf b/samples/boards/nordic/mesh/onoff-app/prj.conf index 0783579e795..0e67042b265 100644 --- a/samples/boards/nordic/mesh/onoff-app/prj.conf +++ b/samples/boards/nordic/mesh/onoff-app/prj.conf @@ -9,7 +9,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf index 96b5466b4a1..3bb984208c7 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf @@ -7,7 +7,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT_OBSERVER=y CONFIG_BT_BROADCASTER=y diff --git a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b78..00000000000 --- a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index aab2745d359..2af60029568 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT=y CONFIG_BT_OBSERVER=y From 3f98257d4a4c2aea71f7a6f5b546f8063925119c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:07 +0300 Subject: [PATCH 220/881] Revert "[nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS" This reverts commit 609c11851694ecaee87cda239066273e2410b8e3. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ------------------ 2 files changed, 1 insertion(+), 949 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 5fe8f70377e..b7f459ea177 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -1294,6 +1294,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_config_reserved_resources_ncs.h" + default "nrfx_reserved_resources.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h deleted file mode 100644 index ec8a9acaf7b..00000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h +++ /dev/null @@ -1,948 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ -#define NRFX_CONFIG_RESERVED_RESOURCES_H__ - -/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE130_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) - -/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE131_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) - -/** @brief Bitmask that defines EGU instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_EGUS_USED 0 - -/** @brief Bitmask that defines TIMER instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_TIMERS_USED 0 - -/* If the GRTC system timer driver is to be used, prepare definitions required - * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and - * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. - */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ - (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ - ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ - (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ - DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ - -/* - * The enabled Bluetooth controller subsystem is responsible for providing - * definitions of the BT_CTLR_USED_* symbols used below in a file named - * bt_ctlr_used_resources.h and for adding its location to global include - * paths so that the file can be included here for all Zephyr libraries that - * are to be built. - */ -#if defined(CONFIG_BT_LL_SW_SPLIT) -#include -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#endif -#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ - -#if defined(CONFIG_BT_LL_SOFTDEVICE) -/* Define auxiliary symbols needed for SDC device dispatch. */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRF52_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRF53_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRF54L_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF71X) -#define NRF71_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRF54H_SERIES -#endif -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) -#else -#error Unsupported chip family -#endif -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ - -#if defined(CONFIG_NRF_802154_RADIO_DRIVER) -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#include <../src/nrf_802154_peripherals_nrf52.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#include <../src/nrf_802154_peripherals_nrf53.h> -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#include <../src/nrf_802154_peripherals_nrf54l.h> -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#include <../src/nrf_802154_peripherals_nrf54h.h> -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ - -#if defined(CONFIG_MPSL) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ - (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif - -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL -#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL -#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL -#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL -#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL -#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL -#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL -#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL -#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL -#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL -#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL -#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL -#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL -#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL -#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL -#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL -#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL -#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 -#endif - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) - -BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_CHANNELS_USED \ - (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI0_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_GROUPS_USED \ - (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI0_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_CHANNELS_USED \ - (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI00_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_GROUPS_USED \ - (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI00_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_CHANNELS_USED \ - (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI10_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_GROUPS_USED \ - (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI10_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_CHANNELS_USED \ - (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI20_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_GROUPS_USED \ - (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI20_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_CHANNELS_USED \ - (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI30_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_GROUPS_USED \ - (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI30_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_CHANNELS_USED \ - (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI020_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_GROUPS_USED \ - (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI020_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_CHANNELS_USED \ - (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI030_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_GROUPS_USED \ - (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI030_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_CHANNELS_USED \ - (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI120_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_GROUPS_USED \ - (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI120_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_CHANNELS_USED \ - (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI130_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_GROUPS_USED \ - (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI130_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_CHANNELS_USED \ - (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI131_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_GROUPS_USED \ - (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI131_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_CHANNELS_USED \ - (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI132_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_GROUPS_USED \ - (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI132_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_CHANNELS_USED \ - (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI133_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_GROUPS_USED \ - (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI133_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_CHANNELS_USED \ - (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI134_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_GROUPS_USED \ - (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI134_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_CHANNELS_USED \ - (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI135_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_GROUPS_USED \ - (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI135_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_CHANNELS_USED \ - (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI136_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_GROUPS_USED \ - (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI136_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines PPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_CHANNELS_USED \ - (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) - -#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED -#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED - -/** @brief Bitmask that defines PPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_GROUPS_USED \ - (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) - -#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ - (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ - (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ - (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ - (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ - (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ - (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ - (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ - NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) - -#if defined(CONFIG_SOFTDEVICE) -#include -#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED -#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED -#else -#define NRFX_PPI_CHANNELS_USED_BY_SD 0 -#define NRFX_PPI_GROUPS_USED_BY_SD 0 -#endif - -#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ From 1fa07322559ade6a742aaa8a95a4e8f45cb4d048 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 221/881] Revert "[nrf noup] dts: Select SoftDevice Controller on nRF54L09" This reverts commit e40f5313c37dc245a8812643924cdba02afe1252. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi | 4 ++-- dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi | 4 ++-- dts/vendor/nordic/nrf54l09.dtsi | 8 +++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi b/boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi index e1347c35948..7d0c880c2de 100644 --- a/boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi @@ -18,7 +18,7 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; }; @@ -119,7 +119,7 @@ status = "okay"; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi index 6c7f34d3b21..1dfc5ce133c 100644 --- a/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &prng; }; @@ -38,7 +38,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54l09.dtsi b/dts/vendor/nordic/nrf54l09.dtsi index 90ecc49b877..3dc17dabd9b 100644 --- a/dts/vendor/nordic/nrf54l09.dtsi +++ b/dts/vendor/nordic/nrf54l09.dtsi @@ -221,11 +221,9 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From 78412907b519b1ea94f092406d3c760278be4eb0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 222/881] Revert "[nrf noup] entropy: Add fake entropy nRF PRNG driver" This reverts commit a0d10324b63734e313e07415908fcca08936e5fb. Signed-off-by: Jukka Rissanen --- dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi index 1dfc5ce133c..fc359cdb0ac 100644 --- a/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi @@ -18,7 +18,6 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &prng; }; soc { @@ -31,11 +30,6 @@ nvic: &cpuapp_nvic {}; compatible = "zephyr,psa-crypto-rng"; status = "disabled"; }; - - prng: prng { - compatible = "nordic,entropy-prng"; - status = "okay"; - }; }; &bt_hci_controller { From ceb28e448ee1dba7023576c79f72498342f272e9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 223/881] Revert "[nrf noup] ble: Adding missing AES config for BT_CRYPTO" This reverts commit b3b520b40258b238a58133f568353a852ca8eb87. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/crypto/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/crypto/Kconfig b/subsys/bluetooth/crypto/Kconfig index 0f46a0f59a0..0856daf9d9a 100644 --- a/subsys/bluetooth/crypto/Kconfig +++ b/subsys/bluetooth/crypto/Kconfig @@ -8,7 +8,6 @@ config BT_CRYPTO select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_CMAC select PSA_WANT_ALG_ECB_NO_PADDING - imply MBEDTLS_CIPHER_AES_ENABLED if !BUILD_WITH_TFM imply MBEDTLS_AES_ROM_TABLES if MBEDTLS_PSA_CRYPTO_C help This option enables the Bluetooth Cryptographic Toolbox. From 3f76c2a091681717dbdb155fdade9979ddfec74e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 224/881] Revert "[nrf noup] bluetooth: Temporary Kconfig fix for BT RPC configuration" This reverts commit 8797d168475faaa8c96cab970881b8ee35dfa2c1. Signed-off-by: Jukka Rissanen --- drivers/bluetooth/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index e64a33f663c..a1680af6583 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -12,7 +12,7 @@ menuconfig BT_DRIVERS bool "Bluetooth drivers" default y - depends on BT && BT_HCI + depends on BT if BT_DRIVERS From 9ee3cd195e77c29195669247a967e80d0fc53062 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 225/881] Revert "[nrf noup] tests: arm_irq_vector_table: Disable starting of SSF client" This reverts commit 1449016262127173218fd276fab23c4b97800c7d. Signed-off-by: Jukka Rissanen --- .../arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 025c842f70b..0bcc82e646b 100644 --- a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,2 +1 @@ CONFIG_SOC_NRF54H20_GPD=n -CONFIG_SSF_CLIENT_SYS_INIT=n diff --git a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf index 025c842f70b..0bcc82e646b 100644 --- a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -1,2 +1 @@ CONFIG_SOC_NRF54H20_GPD=n -CONFIG_SSF_CLIENT_SYS_INIT=n From f4285e5dbf999ebbd9ac3f97dafe799a21577f60 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 226/881] Revert "[nrf noup] Revert "mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA"" This reverts commit a83567fd12f3f2f0e5dc1a4c6ed6d667e7154bb0. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig.mbedtls | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 2d8f260b5d1..7b5122670e5 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -283,6 +283,7 @@ config MBEDTLS_SOME_CIPHER_ENABLED config MBEDTLS_CIPHER_AES_ENABLED bool "AES block cipher" + default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C if MBEDTLS_CIPHER_AES_ENABLED From acaaf16fac22cae37c9a70f92396e78406fb7af9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 227/881] Revert "[nrf noup] samples/tests: Add TF-M sysbuild config files" This reverts commit 0d882bd5dfc71bf18fd548404dc30d6674308f09. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/dfu/sysbuild.conf | 1 - tests/drivers/flash/common/sysbuild.conf | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 samples/subsys/usb/dfu/sysbuild.conf create mode 100644 tests/drivers/flash/common/sysbuild.conf diff --git a/samples/subsys/usb/dfu/sysbuild.conf b/samples/subsys/usb/dfu/sysbuild.conf deleted file mode 100644 index 47f00ff3cff..00000000000 --- a/samples/subsys/usb/dfu/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/tests/drivers/flash/common/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n From ed63a530807dede69be383b429615d997781f62a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 228/881] Revert "[nrf noup] soc: nrf54l: Add custom section for KMU" This reverts commit e9da911d1d201b953c920a536f1c1c6b0cda5327. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54l/CMakeLists.txt | 9 --------- soc/nordic/nrf54l/kmu_push_area_section.ld | 19 ------------------- 2 files changed, 28 deletions(-) delete mode 100644 soc/nordic/nrf54l/kmu_push_area_section.ld diff --git a/soc/nordic/nrf54l/CMakeLists.txt b/soc/nordic/nrf54l/CMakeLists.txt index d986fe9c20d..cebbda571b6 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -6,12 +6,3 @@ zephyr_library_sources( ../validate_rram_partitions.c ) zephyr_include_directories(.) - -# We need a buffer in memory in a static location which can be used by -# the KMU peripheral. The KMU has a static destination address, we chose -# this address to be 0x20000000, which is the first address in the SRAM. -if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND CONFIG_XIP) -# Exclamation mark is printable character with the lowest number in ASCII table. -# We are sure that this file will be included first. -zephyr_linker_sources(RAM_SECTIONS SORT_KEY ! kmu_push_area_section.ld) -endif() diff --git a/soc/nordic/nrf54l/kmu_push_area_section.ld b/soc/nordic/nrf54l/kmu_push_area_section.ld deleted file mode 100644 index e8c8cd9f09a..00000000000 --- a/soc/nordic/nrf54l/kmu_push_area_section.ld +++ /dev/null @@ -1,19 +0,0 @@ -# This section must be loaded first of all the -# custom sections because we want it to be placed -# at the top address of RAM. -SECTION_PROLOGUE(NRF_KMU_RESERVED_PUSH_SECTION,(NOLOAD) ,) -{ - __nrf_kmu_reserved_push_area = .; - *(.nrf_kmu_reserved_push_area) - __nrf_kmu_reserved_push_area_end = .; -} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) - -# It doesn't seem to be possible to enforce placing a section -# at a specific address in memory using the Zephyr SECTION macros. -# So this assert is necessary to avoid accidentatly moving this -# section to a different address. -ASSERT(__nrf_kmu_reserved_push_area == RAM_ADDR, "Error: \ - The section NRF_KMU_RESERVED_PUSH_SECTION needs to be \ - placed on the top RAM address but it is not, please edit \ - your linker scripts to make sure that it is placed on \ - the to RAM address.") From a4fcbbf52055415f5b8b50a4c75aa75562dc432d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 229/881] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding as default" This reverts commit 6d216e1a427579ef6fba03c6cb0fa90d4d9e1504. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk/nrf54l20_cpuapp_common.dtsi | 4 +- dts/arm/nordic/nrf52805.dtsi | 11 +- dts/arm/nordic/nrf52810.dtsi | 11 +- dts/arm/nordic/nrf52811.dtsi | 11 +- dts/arm/nordic/nrf52820.dtsi | 11 +- dts/arm/nordic/nrf52832.dtsi | 11 +- dts/arm/nordic/nrf52833.dtsi | 11 +- dts/arm/nordic/nrf52840.dtsi | 11 +- dts/arm/nordic/nrf5340_cpunet.dtsi | 11 +- dts/arm/nordic/nrf54h20_cpurad.dtsi | 4 +- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +- dts/vendor/nordic/nrf54h20.dtsi | 7 +- dts/vendor/nordic/nrf54l20.dtsi | 7 +- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 +- .../bluetooth/bap_broadcast_sink/sample.yaml | 4 +- .../bap_broadcast_sink/sysbuild.cmake | 4 - .../bap_broadcast_source/sample.yaml | 4 +- .../bap_broadcast_source/sysbuild.cmake | 4 - .../bluetooth/bap_unicast_client/sample.yaml | 4 +- .../bap_unicast_client/sysbuild.cmake | 4 - .../bluetooth/bap_unicast_server/sample.yaml | 4 +- .../bap_unicast_server/sysbuild.cmake | 4 - samples/bluetooth/beacon/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sysbuild.cmake | 4 - samples/bluetooth/cap_initiator/sample.yaml | 4 +- .../bluetooth/cap_initiator/sysbuild.cmake | 4 - .../direction_finding_central/sample.yaml | 15 +-- .../sample.yaml | 14 +-- .../sample.yaml | 14 +-- .../direction_finding_peripheral/sample.yaml | 15 +-- samples/bluetooth/hci_ipc/sample.yaml | 34 ++---- samples/bluetooth/hci_uart/sample.yaml | 18 +--- samples/bluetooth/hci_vs_scan_req/sample.yaml | 2 - samples/bluetooth/iso_central/sample.yaml | 6 +- .../pbp_public_broadcast_sink/sample.yaml | 4 +- .../pbp_public_broadcast_sink/sysbuild.cmake | 4 - .../pbp_public_broadcast_source/sample.yaml | 4 +- .../sysbuild.cmake | 4 - .../bt-ll-sw-split/bt-ll-sw-split.overlay | 4 - .../controller/ll_sw/nordic/lll/lll.c | 2 +- .../controller/ctrl_api/testcase.yaml | 2 - .../controller/ctrl_chmu/testcase.yaml | 2 - .../controller/ctrl_cis_create/testcase.yaml | 2 - .../ctrl_cis_terminate/testcase.yaml | 2 - .../controller/ctrl_collision/testcase.yaml | 2 - .../controller/ctrl_conn_update/testcase.yaml | 11 +- .../controller/ctrl_cte_req/testcase.yaml | 2 - .../ctrl_data_length_update/testcase.yaml | 10 +- .../controller/ctrl_encrypt/testcase.yaml | 2 - .../ctrl_feature_exchange/testcase.yaml | 2 - .../controller/ctrl_hci/testcase.yaml | 2 - .../controller/ctrl_invalid/testcase.yaml | 2 - .../controller/ctrl_le_ping/testcase.yaml | 2 - .../ctrl_min_used_chans/testcase.yaml | 2 - .../controller/ctrl_phy_update/testcase.yaml | 6 +- .../controller/ctrl_sca_update/testcase.yaml | 2 - .../controller/ctrl_sw_privacy/testcase.yaml | 2 - .../controller/ctrl_terminate/testcase.yaml | 2 - .../ctrl_tx_buffer_alloc/testcase.yaml | 22 +--- .../controller/ctrl_tx_queue/testcase.yaml | 2 - .../controller/ctrl_unsupported/testcase.yaml | 6 +- .../controller/ctrl_user_ext/testcase.yaml | 2 - .../controller/ctrl_version/testcase.yaml | 2 - .../df/connection_cte_req/testcase.yaml | 2 - .../df/connection_cte_tx_params/testcase.yaml | 2 - .../connectionless_cte_chains/testcase.yaml | 2 - .../df/connectionless_cte_rx/testcase.yaml | 2 - .../df/connectionless_cte_tx/testcase.yaml | 2 - tests/bluetooth/init/testcase.yaml | 101 +++++------------- 70 files changed, 127 insertions(+), 389 deletions(-) diff --git a/boards/nordic/nrf54l20pdk/nrf54l20_cpuapp_common.dtsi b/boards/nordic/nrf54l20pdk/nrf54l20_cpuapp_common.dtsi index f719b2d9392..614ffbca4de 100644 --- a/boards/nordic/nrf54l20pdk/nrf54l20_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l20pdk/nrf54l20_cpuapp_common.dtsi @@ -18,7 +18,7 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; }; @@ -122,7 +122,7 @@ status = "okay"; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 2134605c9f8..45a54f97b06 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -106,13 +106,12 @@ status = "okay"; ble-2mbps-supported; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 6e09220e78b..217758dd161 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -110,13 +110,12 @@ status = "okay"; ble-2mbps-supported; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 12d0a0ea4d6..670f569c0ac 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -122,13 +122,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index d15fbb2ae4e..50c8d2ba07f 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -124,13 +124,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK another Bluetooth controller + * is added and set as the default. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index eef2297c43b..7bd62c70754 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -110,13 +110,12 @@ status = "okay"; ble-2mbps-supported; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 1b3620aa01c..8202ddc4543 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -124,13 +124,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index f19383ba7e7..bcbfd926c9b 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -112,13 +112,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index be0fad16d66..4f9164767f1 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -9,7 +9,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -102,13 +102,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index e8ff2dac3a4..2cfda47afc5 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -24,7 +24,7 @@ wdt011: &cpurad_wdt011 {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; }; soc { @@ -104,6 +104,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 80875058f5f..8b0339eda39 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -15,7 +15,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &psa_rng; }; @@ -36,7 +36,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 68884b8a567..8dcd8700b27 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -450,10 +450,9 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi index bee70effa0e..de63a005c1d 100644 --- a/dts/vendor/nordic/nrf54l20.dtsi +++ b/dts/vendor/nordic/nrf54l20.dtsi @@ -261,10 +261,9 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 95c27375038..aa259713d2f 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -250,11 +250,9 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/samples/bluetooth/bap_broadcast_sink/sample.yaml b/samples/bluetooth/bap_broadcast_sink/sample.yaml index 148b8b64169..5d06dee0bf8 100644 --- a/samples/bluetooth/bap_broadcast_sink/sample.yaml +++ b/samples/bluetooth/bap_broadcast_sink/sample.yaml @@ -24,7 +24,5 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_broadcast_source/sample.yaml b/samples/bluetooth/bap_broadcast_source/sample.yaml index 5f745cd0895..5e5b01d942d 100644 --- a/samples/bluetooth/bap_broadcast_source/sample.yaml +++ b/samples/bluetooth/bap_broadcast_source/sample.yaml @@ -36,7 +36,5 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_client/sample.yaml b/samples/bluetooth/bap_unicast_client/sample.yaml index 44f32934ce9..7283090b878 100644 --- a/samples/bluetooth/bap_unicast_client/sample.yaml +++ b/samples/bluetooth/bap_unicast_client/sample.yaml @@ -22,7 +22,5 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_client/sysbuild.cmake b/samples/bluetooth/bap_unicast_client/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/bap_unicast_client/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_client/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_server/sample.yaml b/samples/bluetooth/bap_unicast_server/sample.yaml index 266ced73f66..068f752b626 100644 --- a/samples/bluetooth/bap_unicast_server/sample.yaml +++ b/samples/bluetooth/bap_unicast_server/sample.yaml @@ -22,7 +22,5 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_server/sysbuild.cmake b/samples/bluetooth/bap_unicast_server/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/bap_unicast_server/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_server/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index 819ac3d3002..f6f08790092 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -18,9 +18,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuapp sample.bluetooth.beacon-coex: - extra_args: - - CONF_FILE="prj-coex.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="prj-coex.conf" harness: bluetooth platform_allow: - nrf52840dk/nrf52840 diff --git a/samples/bluetooth/cap_acceptor/sample.yaml b/samples/bluetooth/cap_acceptor/sample.yaml index 9061f44679f..824e744eeca 100644 --- a/samples/bluetooth/cap_acceptor/sample.yaml +++ b/samples/bluetooth/cap_acceptor/sample.yaml @@ -26,7 +26,5 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/cap_acceptor/sysbuild.cmake b/samples/bluetooth/cap_acceptor/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/cap_acceptor/sysbuild.cmake +++ b/samples/bluetooth/cap_acceptor/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/cap_initiator/sample.yaml b/samples/bluetooth/cap_initiator/sample.yaml index e3e557f4830..b4f593c9912 100644 --- a/samples/bluetooth/cap_initiator/sample.yaml +++ b/samples/bluetooth/cap_initiator/sample.yaml @@ -26,7 +26,5 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/cap_initiator/sysbuild.cmake b/samples/bluetooth/cap_initiator/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/cap_initiator/sysbuild.cmake +++ b/samples/bluetooth/cap_initiator/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index ffdf634c6e3..b7a118e6cdc 100644 --- a/samples/bluetooth/direction_finding_central/sample.yaml +++ b/samples/bluetooth/direction_finding_central/sample.yaml @@ -14,24 +14,15 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.central.aod_with_controller: + sample.bluetooth.direction_finding.central.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aod.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aod.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding.central.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aod.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - tags: bluetooth - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml index c500cc80dce..8e6097de58a 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml @@ -12,22 +12,14 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless_rx.aod_with_controller: + sample.bluetooth.direction_finding_connectionless_rx.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aod.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aod.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding_connectionless_rx.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aod.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 2a4fa93d19d..78d21b2c95f 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -12,22 +12,14 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless.aoa_with_controller: + sample.bluetooth.direction_finding_connectionless.aoa: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aoa.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding_connectionless.aoa_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aoa.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_peripheral/sample.yaml b/samples/bluetooth/direction_finding_peripheral/sample.yaml index 01f612ad08a..f300cb415cc 100644 --- a/samples/bluetooth/direction_finding_peripheral/sample.yaml +++ b/samples/bluetooth/direction_finding_peripheral/sample.yaml @@ -14,24 +14,15 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.peripheral.aod_with_controller: + sample.bluetooth.direction_finding.peripheral.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aoa.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding.peripheral.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aoa.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - tags: bluetooth - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/hci_ipc/sample.yaml b/samples/bluetooth/hci_ipc/sample.yaml index 3763478b6b3..b758b254768 100644 --- a/samples/bluetooth/hci_ipc/sample.yaml +++ b/samples/bluetooth/hci_ipc/sample.yaml @@ -15,9 +15,7 @@ tests: sample.bluetooth.hci_ipc.iso_broadcast.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -27,9 +25,7 @@ tests: sample.bluetooth.hci_ipc.iso_receive.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -39,9 +35,7 @@ tests: sample.bluetooth.hci_ipc.bis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -51,9 +45,7 @@ tests: sample.bluetooth.hci_ipc.iso_central.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -63,9 +55,7 @@ tests: sample.bluetooth.hci_ipc.iso_peripheral.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -75,9 +65,7 @@ tests: sample.bluetooth.hci_ipc.cis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -87,9 +75,7 @@ tests: sample.bluetooth.hci_ipc.iso.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -113,7 +99,6 @@ tests: extra_args: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet @@ -124,16 +109,13 @@ tests: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - CONFIG_BT_CTLR_PHY_CODED=n - - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet sample.bluetooth.hci_ipc.mesh.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet diff --git a/samples/bluetooth/hci_uart/sample.yaml b/samples/bluetooth/hci_uart/sample.yaml index 97ad6c561b2..b555a74ac5b 100644 --- a/samples/bluetooth/hci_uart/sample.yaml +++ b/samples/bluetooth/hci_uart/sample.yaml @@ -20,9 +20,7 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -31,9 +29,7 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -44,9 +40,7 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -56,9 +50,7 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df.iq_report: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -92,7 +84,6 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth @@ -104,7 +95,6 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf54l15dk_nrf54l15_cpuapp_df.overlay - - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth diff --git a/samples/bluetooth/hci_vs_scan_req/sample.yaml b/samples/bluetooth/hci_vs_scan_req/sample.yaml index 49526522d16..245a83aa0d9 100644 --- a/samples/bluetooth/hci_vs_scan_req/sample.yaml +++ b/samples/bluetooth/hci_vs_scan_req/sample.yaml @@ -9,6 +9,4 @@ tests: - nrf52dk/nrf52832 extra_configs: - CONFIG_BT_LL_SW_SPLIT=y - extra_args: - - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/iso_central/sample.yaml b/samples/bluetooth/iso_central/sample.yaml index 57254ee809a..3a7dedd404a 100644 --- a/samples/bluetooth/iso_central/sample.yaml +++ b/samples/bluetooth/iso_central/sample.yaml @@ -11,11 +11,11 @@ tests: sample.bluetooth.iso_central.bt_ll_sw_split: harness: bluetooth platform_allow: + - qemu_cortex_m3 + - qemu_x86 - nrf52_bsim - nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml index 901d40b00d4..d7c816ee5b7 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml @@ -23,7 +23,5 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml index 1d2e31306e2..80c90704211 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml @@ -23,7 +23,5 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake index e0a7fd9d175..d3bf7be5b6c 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake @@ -18,10 +18,6 @@ if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay index a57a0e82ba6..04bf83ef44d 100644 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay +++ b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay @@ -2,10 +2,6 @@ status = "okay"; }; -&bt_hci_sdc { - status = "disabled"; -}; - / { chosen { zephyr,bt-hci = &bt_hci_controller; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index f93ea59f38e..d3e1f77b355 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -62,7 +62,7 @@ static struct { /* FIXME: This could probably use a chosen entropy device instead on relying on * the nodelabel being the same as for the old nrf rng. */ -static const struct device *const dev_entropy = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy)); +static const struct device *const dev_entropy = DEVICE_DT_GET(DT_NODELABEL(rng)); #endif /* CONFIG_ENTROPY_HAS_DRIVER */ static int init_reset(void); diff --git a/tests/bluetooth/controller/ctrl_api/testcase.yaml b/tests/bluetooth/controller/ctrl_api/testcase.yaml index 21f178bf9b2..19bf6c9ab49 100644 --- a/tests/bluetooth/controller/ctrl_api/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_api/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_api.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml index 9c3ee626433..f7e8068d60e 100644 --- a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_chmu.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml index 2371d7063eb..99612a89bc3 100644 --- a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_cis_create.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml index a98229ba45f..956172a89b2 100644 --- a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_cis_terminate.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_collision/testcase.yaml b/tests/bluetooth/controller/ctrl_collision/testcase.yaml index daa8f3bc6c3..6086a9a4ebc 100644 --- a/tests/bluetooth/controller/ctrl_collision/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_collision/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_collision.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml index fc4ecb0b647..5b0bda4b908 100644 --- a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml @@ -7,18 +7,11 @@ common: tests: bluetooth.controller.ctrl_conn_update.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_conn_update.apm_test: type: unit - extra_args: - - CONF_FILE=prj_apm.conf - - SNIPPET="bt-ll-sw-split" - + extra_args: CONF_FILE=prj_apm.conf bluetooth.controller.ctrl_conn_update.no_param_req_test: type: unit - extra_args: - - CONF_FILE=prj_no_param_req.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_no_param_req.conf diff --git a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml index c6288aecc43..fd6ff51118d 100644 --- a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_cte_req.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml index c7d1174e12b..9778af435b4 100644 --- a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml @@ -6,17 +6,11 @@ common: tests: bluetooth.controller.ctrl_data_length_update.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nocodedphy: type: unit - extra_args: - - CONF_FILE=prj_nocoded.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_nocoded.conf bluetooth.controller.ctrl_data_length_update.test_nophy: type: unit - extra_args: - - CONF_FILE=prj_nophy.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_nophy.conf diff --git a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml index 86dd5bfe4d3..d5bb2cb8b11 100644 --- a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_encrypt.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml index 087e49575ff..257542f3612 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_feature_exchange.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_hci/testcase.yaml b/tests/bluetooth/controller/ctrl_hci/testcase.yaml index 5e00c85f6f4..c750ebc8dd8 100644 --- a/tests/bluetooth/controller/ctrl_hci/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_hci/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_hci.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml index cee54e6b09e..2d1741931e3 100644 --- a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_invalid.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml index 54178905da1..b6a77528f32 100644 --- a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_le_ping.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml index a9445cbf8c4..0991b0cdd43 100644 --- a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_min_used_chans.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml index d5c49d587a8..1d7da169f1d 100644 --- a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml @@ -6,10 +6,6 @@ common: tests: bluetooth.controller.ctrl_phy_update.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_phy_update.test_reduced_buf: type: unit - extra_args: - - CONF_FILE=prj_rx_cnt.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_rx_cnt.conf diff --git a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml index cbc3c3faf72..cbf63aa1b57 100644 --- a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_sca_update.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml index ac5dd6e957e..778606d6954 100644 --- a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml @@ -4,5 +4,3 @@ common: tests: bluetooth.ctrl_sw_privacy.test: platform_allow: nrf52_bsim - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml index 6b1409e9653..cbe639401ea 100644 --- a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_terminate.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml index 363986bd3d3..614eb7fe94c 100644 --- a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml @@ -6,35 +6,23 @@ common: tests: bluetooth.controller.ctrl_tx_buffer_alloc.test_0_per_conn: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_1_per_conn: type: unit - extra_args: - - CONF_FILE=prj_1.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_1.conf bluetooth.controller.ctrl_tx_buffer_alloc.test_2_per_conn: type: unit - extra_args: - - CONF_FILE=prj_2.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_2.conf bluetooth.controller.ctrl_tx_buffer_alloc.test_3_per_conn: type: unit - extra_args: - - CONF_FILE=prj_3.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_3.conf bluetooth.controller.ctrl_tx_buffer_alloc.test_max_per_conn_alloc: type: unit - extra_args: - - CONF_FILE=prj_max.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_max.conf bluetooth.controller.ctrl_tx_buffer_alloc.test_max_common_alloc: type: unit - extra_args: - - CONF_FILE=prj_max_common.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_max_common.conf diff --git a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml index 282b620b317..295ad891a63 100644 --- a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml @@ -5,5 +5,3 @@ common: tests: bluetooth.ctrl_tx_queue.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml index 48b18af9353..28aba1a752a 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml @@ -6,11 +6,7 @@ common: tests: bluetooth.controller.ctrl_unsupported.default.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_unsupported.test: type: unit - extra_args: - - CONF_FILE=prj_unsupported.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_unsupported.conf diff --git a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml index be963df24a8..af319a7a719 100644 --- a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml @@ -4,5 +4,3 @@ common: tests: bluetooth.ctrl_user_ext.test: platform_allow: nrf52_bsim - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_version/testcase.yaml b/tests/bluetooth/controller/ctrl_version/testcase.yaml index 5df86b9bca9..6badcbc7254 100644 --- a/tests/bluetooth/controller/ctrl_version/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_version/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_version.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_req/testcase.yaml b/tests/bluetooth/df/connection_cte_req/testcase.yaml index fbfe4b0d9a1..768aba4a51f 100644 --- a/tests/bluetooth/df/connection_cte_req/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_req/testcase.yaml @@ -2,5 +2,3 @@ tests: bluetooth.df.conection_cte_req: platform_allow: nrf52_bsim tags: bluetooth - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml index a9986c5b0e5..38a23b0950e 100644 --- a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml @@ -2,5 +2,3 @@ tests: bluetooth.df.conection_cte_tx_params: platform_allow: nrf52_bsim tags: bluetooth - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml index 844a7bbb524..6aa5bb0f0c1 100644 --- a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml @@ -2,5 +2,3 @@ tests: bluetooth.df.connectionless_cte_chains: platform_allow: nrf52_bsim tags: bluetooth - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml index c8f08a90843..f839b1910eb 100644 --- a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml @@ -2,5 +2,3 @@ tests: bluetooth.df.connectionless_cte_rx: platform_allow: nrf52_bsim tags: bluetooth - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml index 491cc0e7e59..77d651d0cbc 100644 --- a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml @@ -2,5 +2,3 @@ tests: bluetooth.df.connectionless_cte_tx: platform_allow: nrf52_bsim tags: bluetooth - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/init/testcase.yaml b/tests/bluetooth/init/testcase.yaml index a5cc40cd39e..dd44257e012 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -74,9 +74,7 @@ tests: extra_args: CONF_FILE=prj_9.conf platform_allow: qemu_cortex_m3 bluetooth.init.test_ctlr: - extra_args: - - CONF_FILE=prj_ctlr.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -88,9 +86,7 @@ tests: - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_4_0: - extra_args: - - CONF_FILE=prj_ctlr_4_0.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_4_0.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -99,9 +95,7 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_4_0_dbg: - extra_args: - - CONF_FILE=prj_ctlr_4_0_dbg.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_4_0_dbg.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -110,9 +104,7 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_tiny: - extra_args: - - CONF_FILE=prj_ctlr_tiny.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_tiny.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -124,7 +116,6 @@ tests: extra_args: - CONF_FILE=prj_ctlr_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -135,7 +126,6 @@ tests: extra_args: - CONF_FILE=prj_ctlr_5_x_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -147,7 +137,6 @@ tests: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_CTLR_ADVANCED_FEATURES=y - CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf52840dk/nrf52840 @@ -157,16 +146,13 @@ tests: bluetooth.init.test_ctlr_ticker: extra_args: - CONF_FILE=prj_ctlr_ticker.conf - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_broadcaster: - extra_args: - - CONF_FILE=prj_ctlr_broadcaster.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_broadcaster.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -175,9 +161,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral: - extra_args: - - CONF_FILE=prj_ctlr_peripheral.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -186,9 +170,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral_priv: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -197,9 +179,7 @@ tests: integration_platforms: - nrf52840dk/nrf52840 bluetooth.init.test_ctlr_observer: - extra_args: - - CONF_FILE=prj_ctlr_observer.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_observer.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -208,9 +188,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_central: - extra_args: - - CONF_FILE=prj_ctlr_central.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -220,9 +198,7 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_central_priv: - extra_args: - - CONF_FILE=prj_ctlr_central_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -232,9 +208,7 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_broadcaster_ext: - extra_args: - - CONF_FILE=prj_ctlr_broadcaster_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_broadcaster_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -243,9 +217,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -254,9 +226,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext_priv: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_ext_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_ext_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -265,9 +235,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_oberver_ext: - extra_args: - - CONF_FILE=prj_ctlr_observer_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_observer_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -276,9 +244,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext: - extra_args: - - CONF_FILE=prj_ctlr_central_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -287,9 +253,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext_priv: - extra_args: - - CONF_FILE=prj_ctlr_central_ext_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_ext_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -298,9 +262,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv: - extra_args: - - CONF_FILE=prj_ctlr_per_adv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_adv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -309,9 +271,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv_no_adi: - extra_args: - - CONF_FILE=prj_ctlr_per_adv_no_adi.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_adv_no_adi.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -320,9 +280,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync: - extra_args: - - CONF_FILE=prj_ctlr_per_sync.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_sync.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -331,9 +289,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_adi: - extra_args: - - CONF_FILE=prj_ctlr_per_sync_no_adi.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_sync_no_adi.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -342,9 +298,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_filter: - extra_args: - - CONF_FILE=prj_ctlr_per_sync_no_filter.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_sync_no_filter.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -353,9 +307,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_iso: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_iso.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_iso.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -364,9 +316,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_iso: - extra_args: - - CONF_FILE=prj_ctlr_central_iso.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_iso.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -385,9 +335,7 @@ tests: - DTC_OVERLAY_FILE=h5.overlay platform_allow: qemu_cortex_m3 bluetooth.init.test_llcp: - extra_args: - - CONF_FILE=prj_llcp.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_llcp.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -399,7 +347,6 @@ tests: extra_args: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_RECV_WORKQ_BT=y - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 bluetooth.init.test_host_6_x: From 5fbb64b3fca5cf2744ad76c14138887d9955a4a1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 230/881] Revert "[nrf noup] dts: choose a crypto accelerator for entropy" This reverts commit 53fae56efca3c201e8faa1433b7c3ee98b4e6dd6. Signed-off-by: Jukka Rissanen --- dts/arm/nordic/nrf52840.dtsi | 4 ++-- dts/arm/nordic/nrf5340_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf91.dtsi | 3 +-- soc/nordic/common/Kconfig.peripherals | 6 ++---- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index bcbfd926c9b..dab5f762058 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -8,7 +8,7 @@ / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -572,7 +572,7 @@ reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>; reg-names = "wrapper", "core"; interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - status = "okay"; + status = "disabled"; }; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index d3df6da3199..30aaf9c9947 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -34,7 +34,7 @@ }; chosen { - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng_hci; zephyr,flash-controller = &flash_controller; }; @@ -104,7 +104,7 @@ reg = <0x50844000 0x1000>, <0x50845000 0x1000>; reg-names = "wrapper", "core"; interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 8b0339eda39..3f1fe655b6e 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -16,7 +16,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &psa_rng; + zephyr,entropy = &rng; }; soc { @@ -32,7 +32,7 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 7b7d4891651..1747dcea74a 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -28,7 +28,6 @@ }; chosen { - zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -52,7 +51,7 @@ reg = <0x50840000 0x1000>, <0x50841000 0x1000>; reg-names = "wrapper", "core"; interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; - status = "okay"; + status = "disabled"; }; ctrlap: ctrlap@50006000 { diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 90bd21f8466..083fcc4e089 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -13,12 +13,10 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) || \ - ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91X) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \ - ($(dt_nodelabel_enabled,psa_rng) && SOC_NRF5340_CPUAPP) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM)) From 0c8bd7836db2c7a987d5d2d21e7037b22fc396cb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 231/881] Revert "[nrf noup] Bluetooth: Mesh: Disable processing of ext ADV packets" This reverts commit bc11d5db02692ffaa2a6e75ec939f2b9fa404d03. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/mesh/Kconfig | 11 ----------- subsys/bluetooth/mesh/adv_ext.c | 12 ------------ 2 files changed, 23 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 7e4adf4c78a..bd0350307ba 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -214,17 +214,6 @@ config BT_MESH_ADV_EXT_FRIEND_SEPARATE messages as close to the start of the ReceiveWindow as possible, thus reducing the scanning time on the Low Power node. -config BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS - bool "Reject or accept extended advertising packets" - depends on BT_LL_SOFTDEVICE - help - Configure the scanner and initiator to either reject or accept extended - advertising packets by the SoftDevice Controller. This is set to false - by default, to prevent loss of scan time when receiving a pointer packet - while scanning for Bluetooth Mesh packets. Set to true if extended - advertising packets are to be received by the SoftDevice Controller for - purposes other than Bluetooth Mesh. - endif # BT_MESH_ADV_EXT endchoice diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index c74f0a40d99..0e6f6120f73 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -519,18 +519,6 @@ void bt_mesh_adv_init(void) K_PRIO_COOP(MESH_WORKQ_PRIORITY), NULL); k_thread_name_set(&bt_mesh_workq.thread, "BT MESH WQ"); } - -#if defined(CONFIG_BT_LL_SOFTDEVICE) - const sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t cmd_params = { - .accept_ext_adv_packets = IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS), - }; - - int err = sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set(&cmd_params); - - if (err) { - LOG_ERR("Failed to set accept_ext_adv_packets: %d", err); - } -#endif } static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance) From 3ecb08775daf96382680fab3d892fc66490177eb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 232/881] Revert "[nrf noup] tests: bluetooth: tester: sysbuild configurable 53/54H" This reverts commit 63f0faef7bd0ccffd1970b1677efa04b696b8d70. Signed-off-by: Jukka Rissanen --- .../nrf54h20_cpurad-bt_ll_softdevice.conf | 33 ------------------- tests/bluetooth/tester/Kconfig.sysbuild | 1 - tests/bluetooth/tester/sysbuild.cmake | 16 ++------- 3 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf diff --git a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf deleted file mode 100644 index 1f7748e5cd7..00000000000 --- a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf +++ /dev/null @@ -1,33 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_ISR_STACK_SIZE=1024 -CONFIG_IDLE_STACK_SIZE=256 -CONFIG_MAIN_STACK_SIZE=512 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=8192 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y - -CONFIG_BT_BUF_EVT_RX_COUNT=16 -CONFIG_BT_BUF_EVT_RX_SIZE=255 -CONFIG_BT_BUF_ACL_RX_SIZE=255 -CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_BUF_CMD_TX_SIZE=255 - -# Host -CONFIG_BT_BROADCASTER=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_OBSERVER=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_EXT_ADV=y -CONFIG_BT_PER_ADV=y -CONFIG_BT_PER_ADV_SYNC=y - -# Controller -CONFIG_BT_LL_SW_SPLIT=n -CONFIG_BT_LL_SOFTDEVICE=y -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 -CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/tests/bluetooth/tester/Kconfig.sysbuild b/tests/bluetooth/tester/Kconfig.sysbuild index e14a6e1aa8e..69e4d5a97fb 100644 --- a/tests/bluetooth/tester/Kconfig.sysbuild +++ b/tests/bluetooth/tester/Kconfig.sysbuild @@ -5,7 +5,6 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string - default "nrf54h20dk/nrf54h20/cpurad" if "$(BOARD)" = "nrf54h20dk" default "nrf5340dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340dk" default "nrf5340_audio_dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340_audio_dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP" diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index bcd564733c5..a9ddf127947 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -2,6 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) + # For builds in the nrf5340, we build the netcore image with the controller + set(NET_APP hci_ipc) set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP}) @@ -11,20 +13,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) BOARD ${SB_CONFIG_NET_CORE_BOARD} ) - if(SB_CONFIG_SOC_NRF5340_CPUAPP) - set(${NET_APP}_SNIPPET - "bt-ll-sw-split" - CACHE INTERNAL "" - ) - endif() - - if(SB_CONFIG_SOC_NRF54H20_CPUAPP) - set(${NET_APP}_CONF_FILE - ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf - CACHE INTERNAL "" - ) - endif() - set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" From eb97e981fcda7bd28b69eb6612575a0816d45e8a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 233/881] Revert "[nrf noup] net: tests: crypto: Adding legacy Crypto support ipv6 tests" This reverts commit 462b528e3f91ce8139309d0d07c8bc64edc65042. Signed-off-by: Jukka Rissanen --- tests/net/ipv6/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index c8dda772895..51cfa883727 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -33,7 +33,6 @@ CONFIG_NET_IF_MAX_IPV6_COUNT=2 CONFIG_NET_IPV6_PE=y CONFIG_NET_IPV6_PE_FILTER_PREFIX_COUNT=2 CONFIG_NET_IPV6_PE_PREFER_PUBLIC_ADDRESSES=n -CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y # Increase the stack a bit for mps2/an385 CONFIG_NET_RX_STACK_SIZE=1700 From d62c5db0e4308901138759904ba4eeec80911408 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 234/881] Revert "[nrf noup] net: tests: Add legacy crypto API support for big_http_download" This reverts commit d9e0b36c715d2afa68d885ae3a0435efd4cac4a9. Signed-off-by: Jukka Rissanen --- samples/net/sockets/big_http_download/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/net/sockets/big_http_download/prj.conf b/samples/net/sockets/big_http_download/prj.conf index 8677e7113e4..a406f314dfb 100644 --- a/samples/net/sockets/big_http_download/prj.conf +++ b/samples/net/sockets/big_http_download/prj.conf @@ -3,7 +3,6 @@ CONFIG_REQUIRES_FULL_LIBC=y CONFIG_MBEDTLS=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_MD=y -CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y CONFIG_MAIN_STACK_SIZE=2536 # Networking config From b24ad68349facca1e09442ae82cc36041698dbd4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 235/881] Revert "[nrf noup] mbedtls: Don't enable auto-generation of Mbed TLS files" This reverts commit d268008fb254d5fcb01e92931864fca8165a1246. Signed-off-by: Jukka Rissanen --- tests/crypto/mbedtls/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/crypto/mbedtls/CMakeLists.txt b/tests/crypto/mbedtls/CMakeLists.txt index 47670bead01..7ebdc9d76a9 100644 --- a/tests/crypto/mbedtls/CMakeLists.txt +++ b/tests/crypto/mbedtls/CMakeLists.txt @@ -6,5 +6,15 @@ project(mbedtls) set(output_file ${PROJECT_BINARY_DIR}/mbedtls-check.timestamp) +add_custom_command( + COMMENT "Check Mbed TLS auto-generated files" + COMMAND + ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/modules/mbedtls/create_psa_files.py --check + OUTPUT + ${output_file} +) + +add_custom_target(check_mbedtls_auto_generated_files ALL DEPENDS ${output_file}) + FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) From d9c785eef14d08bb2896bf74b93d74b99f6c0d07 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 236/881] Revert "[nrf noup] samples: net: Enable Wi-Fi driver in sysbuild builds" This reverts commit ccf6152219b7547248f52b752f19f770ad444c66. Signed-off-by: Jukka Rissanen --- samples/net/dns_resolve/Kconfig.sysbuild | 13 ------------- samples/net/ipv4_autoconf/Kconfig.sysbuild | 13 ------------- samples/net/lwm2m_client/Kconfig.sysbuild | 13 ------------- samples/net/mdns_responder/Kconfig.sysbuild | 13 ------------- samples/net/mqtt_publisher/Kconfig.sysbuild | 13 ------------- samples/net/mqtt_sn_publisher/Kconfig.sysbuild | 13 ------------- samples/net/sockets/coap_server/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_async/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_client/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_server/Kconfig.sysbuild | 13 ------------- samples/net/sockets/http_get/Kconfig.sysbuild | 13 ------------- samples/net/sockets/sntp_client/Kconfig.sysbuild | 13 ------------- samples/net/syslog_net/Kconfig.sysbuild | 13 ------------- samples/net/telnet/Kconfig.sysbuild | 13 ------------- samples/net/wifi/Kconfig.sysbuild | 13 ------------- samples/net/wifi/shell/sample.yaml | 2 -- 16 files changed, 197 deletions(-) delete mode 100644 samples/net/dns_resolve/Kconfig.sysbuild delete mode 100644 samples/net/ipv4_autoconf/Kconfig.sysbuild delete mode 100644 samples/net/lwm2m_client/Kconfig.sysbuild delete mode 100644 samples/net/mdns_responder/Kconfig.sysbuild delete mode 100644 samples/net/mqtt_publisher/Kconfig.sysbuild delete mode 100644 samples/net/mqtt_sn_publisher/Kconfig.sysbuild delete mode 100644 samples/net/sockets/coap_server/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_async/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_client/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_server/Kconfig.sysbuild delete mode 100644 samples/net/sockets/http_get/Kconfig.sysbuild delete mode 100644 samples/net/sockets/sntp_client/Kconfig.sysbuild delete mode 100644 samples/net/syslog_net/Kconfig.sysbuild delete mode 100644 samples/net/telnet/Kconfig.sysbuild delete mode 100644 samples/net/wifi/Kconfig.sysbuild diff --git a/samples/net/dns_resolve/Kconfig.sysbuild b/samples/net/dns_resolve/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/dns_resolve/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/ipv4_autoconf/Kconfig.sysbuild b/samples/net/ipv4_autoconf/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/ipv4_autoconf/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/lwm2m_client/Kconfig.sysbuild b/samples/net/lwm2m_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/lwm2m_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mdns_responder/Kconfig.sysbuild b/samples/net/mdns_responder/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/mdns_responder/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_publisher/Kconfig.sysbuild b/samples/net/mqtt_publisher/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/mqtt_publisher/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/coap_server/Kconfig.sysbuild b/samples/net/sockets/coap_server/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/sockets/coap_server/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_async/Kconfig.sysbuild b/samples/net/sockets/echo_async/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/sockets/echo_async/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_client/Kconfig.sysbuild b/samples/net/sockets/echo_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/sockets/echo_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_server/Kconfig.sysbuild b/samples/net/sockets/echo_server/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/sockets/echo_server/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/http_get/Kconfig.sysbuild b/samples/net/sockets/http_get/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/sockets/http_get/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/sntp_client/Kconfig.sysbuild b/samples/net/sockets/sntp_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/sockets/sntp_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/syslog_net/Kconfig.sysbuild b/samples/net/syslog_net/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/syslog_net/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/telnet/Kconfig.sysbuild b/samples/net/telnet/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/telnet/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/Kconfig.sysbuild b/samples/net/wifi/Kconfig.sysbuild deleted file mode 100644 index 158551060c5..00000000000 --- a/samples/net/wifi/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index 8543e6bfb38..5f72e068611 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -58,7 +58,6 @@ tests: - nrf7002dk/nrf5340/cpuapp/nrf7001 sample.net.wifi.nrf7002ek: extra_args: - - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002ek platform_allow: @@ -70,7 +69,6 @@ tests: sample.net.wifi.nrf7002eb: extra_args: - CONFIG_NRF70_UTIL=y - - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002eb platform_allow: From e5c3f6bd662fd20e75741dd3795fbd2da31b5556 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:08 +0300 Subject: [PATCH 237/881] Revert "[nrf noup] lib: os: zvfs: Remove EXPERIMENTAL from ZVFS" This reverts commit f52f65458f060758f18daf2b572383b6938eceae. Signed-off-by: Jukka Rissanen --- lib/os/zvfs/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index 495d5c84968..a9c9518a1d5 100644 --- a/lib/os/zvfs/Kconfig +++ b/lib/os/zvfs/Kconfig @@ -6,6 +6,7 @@ menuconfig ZVFS bool "Zephyr virtual filesystem (ZVFS) support [EXPERIMENTAL]" select FDTABLE + select EXPERIMENTAL help ZVFS is a central, Zephyr-native library that provides a common interoperable API for all types of file descriptors such as those from the non-virtual FS, sockets, eventfds, FILE *'s From cb6ac889b7805f42dc4c758400fa8f57facce644 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 238/881] Revert "[nrf noup] kernel: banner: Make function weak" This reverts commit 717e659b48410693135e5e630579ab4671633cb7. Signed-off-by: Jukka Rissanen --- kernel/banner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/banner.c b/kernel/banner.c index a16784cb975..5cadda0a5e9 100644 --- a/kernel/banner.c +++ b/kernel/banner.c @@ -24,7 +24,7 @@ #endif /* BUILD_VERSION */ #endif /* !BANNER_VERSION */ -__weak void boot_banner(void) +void boot_banner(void) { #if defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0) #ifdef CONFIG_BOOT_BANNER From 8f9fa6adef8dbe6de3cafec93a840a66f86e4745 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 239/881] Revert "[nrf noup] mbedtls: Don't select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC" This reverts commit 34341c43b31bb2c60c84b98e4322b465edd0e433. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig.mbedtls | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 7b5122670e5..b4c5f48a428 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -117,7 +117,6 @@ config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE if PSA_CRYPTO_CLIENT - select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE if PSA_CRYPTO_CLIENT config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED bool "DHE-RSA based ciphersuite modes" From fbeb1e453b7f5b8f1148dce4454d5cfd48b8f0e2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 240/881] Revert "[nrf noup] mbedtls: Adding missing configuration for RSA key type derive" This reverts commit 414a6c3008ad17b54a22682962c6eddfa47d6368. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig.psa.auto | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index b235c30380f..834252432b5 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -298,9 +298,4 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE - bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY - default y if PSA_CRYPTO_ENABLE_ALL - endif # PSA_CRYPTO_CLIENT From 96a7a34147d0cf0b28c001936ecac37f6c0048d5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 241/881] Revert "[nrf noup] mbedtls: Adding helptext warnings for weak crypto" This reverts commit 76dee8cd798e036c3d034df18006e06c1b9431f6. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig.psa.auto | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 834252432b5..fa8cdbc7b53 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -88,9 +88,7 @@ config PSA_WANT_ALG_HMAC config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - help - Warning: The MD5 hash is weak and deprecated and is only recommended - for use in legacy protocols. + config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -121,9 +119,6 @@ config PSA_WANT_ALG_RSA_PSS config PSA_WANT_ALG_SHA_1 bool "PSA_WANT_ALG_SHA_1" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - help - Warning: The SHA-1 hash is weak and deprecated and is only recommended - for use in legacy protocols. config PSA_WANT_ALG_SHA_224 bool "PSA_WANT_ALG_SHA_224" if !MBEDTLS_PROMPTLESS From 7c0ab2970302baa872e24fde35a757f9d206c144 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 242/881] Revert "[nrf noup] mbedtls: Add dependency logic for PSA crypto configurations" This reverts commit 2abfddff4d8f12849a31dd0842e0a7a07825847e. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig.psa.auto | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index fa8cdbc7b53..56a81dd6efd 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -71,7 +71,6 @@ config PSA_WANT_ALG_GCM config PSA_WANT_ALG_HKDF bool "PSA_WANT_ALG_HKDF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_HKDF_EXTRACT bool "PSA_WANT_ALG_HKDF_EXTRACT" if !MBEDTLS_PROMPTLESS @@ -93,12 +92,11 @@ config PSA_WANT_ALG_MD5 config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_CMAC + config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -155,22 +153,18 @@ config PSA_WANT_ALG_SHA3_512 config PSA_WANT_ALG_STREAM_CIPHER bool "PSA_WANT_ALG_STREAM_CIPHER" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - select PSA_WANT_KEY_TYPE_CHACHA20 config PSA_WANT_ALG_TLS12_PRF bool "PSA_WANT_ALG_TLS12_PRF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_PSK_TO_MS bool "PSA_WANT_ALG_TLS12_PSK_TO_MS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS bool "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_SHA_256 config PSA_WANT_ECC_BRAINPOOL_P_R1_256 bool "PSA_WANT_ECC_BRAINPOOL_P_R1_256" if !MBEDTLS_PROMPTLESS @@ -243,8 +237,7 @@ config PSA_WANT_KEY_TYPE_AES config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_CHACHA20_POLY1305 || \ - PSA_WANT_ALG_STREAM_CIPHER + config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS @@ -260,37 +253,30 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL endif # PSA_CRYPTO_CLIENT From 43d0b8cf61bd6aa3a30ac85deebba81bf402b25e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 243/881] Revert "[nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto" This reverts commit 32fa048131dc1eb8dd223c99c3e40649efb720bf. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig.psa.auto | 61 +++++++++++++++++++++++++++++++ modules/mbedtls/Kconfig.psa.logic | 7 ++++ 2 files changed, 68 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 56a81dd6efd..08b1bbc0241 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -36,6 +36,10 @@ config PSA_WANT_ALG_CMAC bool "PSA_WANT_ALG_CMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_CFB + bool "PSA_WANT_ALG_CFB" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_ALG_CHACHA20_POLY1305 bool "PSA_WANT_ALG_CHACHA20_POLY1305" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -56,6 +60,10 @@ config PSA_WANT_ALG_ECDH bool "PSA_WANT_ALG_ECDH" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_FFDH + bool "PSA_WANT_ALG_FFDH" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_ALG_ECDSA bool "PSA_WANT_ALG_ECDSA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -88,6 +96,9 @@ config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_OFB + bool "PSA_WANT_ALG_OFB" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -97,6 +108,9 @@ config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_RIPEMD160 + bool "PSA_WANT_ALG_RIPEMD160" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -214,6 +228,26 @@ config PSA_WANT_ECC_SECP_R1_521 bool "PSA_WANT_ECC_SECP_R1_521" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_DH_RFC7919_2048 + bool "PSA_WANT_DH_RFC7919_2048" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_3072 + bool "PSA_WANT_DH_RFC7919_3072" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_4096 + bool "PSA_WANT_DH_RFC7919_4096" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_6144 + bool "PSA_WANT_DH_RFC7919_6144" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_8192 + bool "PSA_WANT_DH_RFC7919_8192" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_DERIVE bool "PSA_WANT_KEY_TYPE_DERIVE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -234,15 +268,30 @@ config PSA_WANT_KEY_TYPE_AES bool "PSA_WANT_KEY_TYPE_AES" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_ARIA + bool "PSA_WANT_KEY_TYPE_ARIA" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_CAMELLIA + bool "PSA_WANT_KEY_TYPE_CAMELLIA" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DES + bool "PSA_WANT_KEY_TYPE_DES" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY + bool "PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_RAW_DATA bool "PSA_WANT_KEY_TYPE_RAW_DATA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -279,4 +328,16 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + endif # PSA_CRYPTO_CLIENT diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index 2de81163dc1..dcea9e35405 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -18,3 +18,10 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC + bool + default y + depends on PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT || \ + PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT || \ + PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE From 7f578a63909d9a76ece65b12ad88201bb2ca48b6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 244/881] Revert "[nrf noup] mbedtls: Enable PSA_WANT_GENERATE_RANDOM for PSA RNG" This reverts commit 3c07722fbc78e7432f561696e82bf77982f4550a. Signed-off-by: Jukka Rissanen --- drivers/entropy/Kconfig.psa_crypto | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/entropy/Kconfig.psa_crypto b/drivers/entropy/Kconfig.psa_crypto index 18514a071d1..d06001225b0 100644 --- a/drivers/entropy/Kconfig.psa_crypto +++ b/drivers/entropy/Kconfig.psa_crypto @@ -7,7 +7,6 @@ config ENTROPY_PSA_CRYPTO_RNG bool "PSA Crypto Random source Entropy driver" depends on DT_HAS_ZEPHYR_PSA_CRYPTO_RNG_ENABLED select ENTROPY_HAS_DRIVER - select PSA_WANT_GENERATE_RANDOM default y help Enable the PSA Crypto source Entropy driver. From 3d76117051749c715ccc59c91e12cb25598b0838 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 245/881] Revert "[nrf noup] modules: mbedtls: Disable configurations in Kconfig.tls-generic" This reverts commit c62b6ebb411e687814e89652273b333a4b47bbae. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig.mbedtls | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index b4c5f48a428..e534ba0c10a 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -7,8 +7,6 @@ menu "Mbed TLS configuration" depends on MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-mbedtls.h" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - menu "TLS" config MBEDTLS_TLS_VERSION_1_2 @@ -42,8 +40,6 @@ endif # MBEDTLS_TLS_VERSION_1_2 || MBEDTLS_TLS_VERSION_1_3 endmenu # TLS -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - menu "Ciphersuite configuration" comment "Supported key exchange modes" @@ -64,8 +60,6 @@ config MBEDTLS_GENPRIME_ENABLED endif # MBEDTLS_RSA_C -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_MD @@ -98,8 +92,6 @@ config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED bool "RSA-PSK based ciphersuite modes" depends on MBEDTLS_PKCS1_V15 || MBEDTLS_PKCS1_V21 -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -107,8 +99,6 @@ config MBEDTLS_PSK_MAX_LEN Max size of TLS pre-shared keys, in bytes. It has no effect if no PSK key exchange is used. -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "RSA-only based ciphersuite modes" depends on MBEDTLS_MD @@ -246,12 +236,8 @@ config MBEDTLS_ECP_NIST_OPTIM endif -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - comment "Supported ciphers and cipher modes" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers and modes" select MBEDTLS_CIPHER_AES_ENABLED @@ -342,12 +328,8 @@ config MBEDTLS_CMAC bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers." depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - comment "Supported hash algorithms" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_HASH_ALL_ENABLED bool "All available MAC methods" select MBEDTLS_MD5 @@ -388,14 +370,10 @@ config MBEDTLS_SHA512 config MBEDTLS_POLY1305 bool "Poly1305 hash family" -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - endmenu comment "Random number generators" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_CTR_DRBG_ENABLED bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED @@ -405,21 +383,15 @@ config MBEDTLS_HMAC_DRBG_ENABLED bool "HMAC_DRBG random generator" select MBEDTLS_MD -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - comment "Other configurations" config MBEDTLS_CIPHER bool "generic cipher layer." default y if PSA_WANT_ALG_CMAC -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_MD bool "generic message digest layer." -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_ASN1_PARSE_C bool "Support for ASN1 parser functions" @@ -459,8 +431,6 @@ config MBEDTLS_HAVE_ASM of asymmetric cryptography, however this might have an impact on the code size. -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_ENTROPY_C bool "Mbed TLS entropy accumulator" depends on MBEDTLS_SHA256 || MBEDTLS_SHA384 || MBEDTLS_SHA512 @@ -469,8 +439,6 @@ config MBEDTLS_ENTROPY_C mostly used in conjunction with CTR_DRBG or HMAC_DRBG to create a deterministic random number generator. -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_ENTROPY_POLL_ZEPHYR bool "Provide entropy data to Mbed TLS through entropy driver or random generator" default y From 3f9430b9655ff08604ff1cefd600209c6b1fff9d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 246/881] Revert "[nrf noup] samples: basic: blinky: add eGPIO tests configuration" This reverts commit 40b222de413d542f187f039da8eb1e9e3d9a359d. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay diff --git a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay deleted file mode 100644 index bd1ceb2f894..00000000000 --- a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -&led0 { - gpios = <&hpf_gpio 9 GPIO_ACTIVE_HIGH>; -}; From 27202aa500d8b0c9bc21fc9848e91682197c0716 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 247/881] Revert "[nrf noup] boards/nordic/nrf54l15dk: Set ROM offset by PM" This reverts commit cea66ec75f604cbdc74f67165cb50ea478c716cd. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54l15dk/Kconfig.defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/nordic/nrf54l15dk/Kconfig.defconfig b/boards/nordic/nrf54l15dk/Kconfig.defconfig index fb63aaecb44..0661366e911 100644 --- a/boards/nordic/nrf54l15dk/Kconfig.defconfig +++ b/boards/nordic/nrf54l15dk/Kconfig.defconfig @@ -8,7 +8,6 @@ if BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ BOARD_NRF54L15DK_NRF54L15_CPUAPP config ROM_START_OFFSET - default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ From 6424c521b502c962a692e3bbee5ceafd8da023aa Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 248/881] Revert "[nrf noup] mgmt: mcumgr: grp: img_mgmt: Add handling for QSPI XIP" This reverts commit a5b67c16269292d3f1f921238591cb8cb848c004. Signed-off-by: Jukka Rissanen --- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 -------- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 8 -------- 2 files changed, 16 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index 5f122fcf71f..0915d70e870 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -219,14 +219,6 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS This will enable the slot info function hooks which can be used to add additional information to responses. -config MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE - bool "QSPI XIP Split image mode" - depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP - help - This option should not be selected by users and should automatically be selected by - sysbuild if needed. This enables selecting the correct slot when running a QSPI XIP - split image application in DirectXIP mode. - module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c index b53f1b21465..d0303360f69 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -235,14 +235,6 @@ int img_mgmt_active_slot(int image) /* Multi image does not support DirectXIP or RAM load currently */ #if CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER > 1 slot = (image << 1); - -#if defined(CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE) || \ - defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) || \ - defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) - if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) { - slot += 1; - } -#endif #elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) /* RAM load requires querying bootloader */ int rc; From 698ae77e81a7b6d694aac9b6619b3f0b839caa29 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 249/881] Revert "[nrf noup] board: nordic_ thingy53: Enable QSPI by default" This reverts commit 20671bcf45981a4491aea49326e530978e79d792. Signed-off-by: Jukka Rissanen --- boards/nordic/thingy53/Kconfig.defconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index b7f33e89bf1..badcb5c20e5 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -97,9 +97,6 @@ config MCUBOOT_USB_SUPPORT bool default n -config NORDIC_QSPI_NOR - default y - endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From e5abc0bc949d2bb10b0ec3d977c2f29dc1437bb8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 250/881] Revert "[nrf noup] bluetooth: att: Allow ATT sent callback after data TX is done" This reverts commit 5b9ea8c24b78a4be7e83f5cdbe1fead42b659f44. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/Kconfig.gatt | 17 ----------------- subsys/bluetooth/host/att.c | 17 +---------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index 221bc413c4b..a04241a3e94 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -38,23 +38,6 @@ config BT_ATT_RETRY_ON_SEC_ERR If an ATT request fails due to insufficient security, the host will try to elevate the security level and retry the ATT request. -config BT_ATT_SENT_CB_AFTER_TX - bool "Delay ATT sent callback until data transmission is done by controller [EXPERIMENTAL]" - select EXPERIMENTAL - help - By default, the BLE stack calls sent callback for ATT data when the - data is passed to BLE controller for transmission. Enabling this - Kconfig option delays calling the sent callback until data - transmission is finished by BLE controller (the callback is called - upon receiving the Number of Completed Packets HCI Event). - - The feature is not available in Zephyr RTOS (it's specific to NCS - Zephyr fork). It is a temporary solution allowing to control flow of - GATT notifications with HID reports for HID use-case. - - Enabling this option may require increasing CONFIG_BT_CONN_TX_MAX in - configuration, because ATT would use additional TX contexts. - config BT_EATT bool "Enhanced ATT Bearers support [EXPERIMENTAL]" depends on BT_L2CAP_ECRED diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 7fac12a6fb9..98b310f4b4b 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -328,13 +328,6 @@ static void att_disconnect(struct bt_att_chan *chan) } } -static void chan_sent_cb(struct bt_conn *conn, void *user_data, int err) -{ - struct net_buf *nb = user_data; - - net_buf_unref(nb); -} - /* In case of success the ownership of the buffer is transferred to the stack * which takes care of releasing it when it completes transmitting to the * controller. @@ -428,15 +421,7 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf) data->att_chan = chan; - if (IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX)) { - err = bt_l2cap_send_pdu(&chan->chan, buf, chan_sent_cb, net_buf_ref(buf)); - if (err) { - net_buf_unref(buf); - } - } else { - err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); - } - + err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); if (err) { if (err == -ENOBUFS) { LOG_ERR("Ran out of TX buffers or contexts."); From 1a83c3410da9c187f77f7110bc68a97d45bb3bca Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 251/881] Revert "[nrf noup] dts: Add Bluetooth Controller to nRF54H20" This reverts commit 6f17dc3e1d057a260efb291a63f4d2d94cb94d6d. Signed-off-by: Jukka Rissanen --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 8 -------- dts/vendor/nordic/nrf54h20.dtsi | 8 -------- 2 files changed, 16 deletions(-) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 2cfda47afc5..2d2fdee8d27 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -23,10 +23,6 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &cpuflpr; / { - chosen { - zephyr,bt-hci = &bt_hci_controller; - }; - soc { compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; @@ -103,7 +99,3 @@ wdt011: &cpurad_wdt011 {}; &dppic020 { status = "okay"; }; - -&bt_hci_controller { - status = "okay"; -}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 8dcd8700b27..05ae6df5d0f 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -449,14 +449,6 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; - - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; }; ccm030: ccm@3a000 { From 246073a2b8f26161288a551ba6444e2412b187ed Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 252/881] Revert "[nrf noup] drivers: flash: kconfig: nrf_rram region resolution" This reverts commit 73823d3b105fd8547e1363ec07d91d0da1665ba1. Signed-off-by: Jukka Rissanen --- drivers/flash/Kconfig.nrf_rram | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/flash/Kconfig.nrf_rram b/drivers/flash/Kconfig.nrf_rram index a59560e86a4..3dea687a0f8 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -70,14 +70,14 @@ config SOC_FLASH_NRF_TIMEOUT_MULTIPLIER config NRF_RRAM_REGION_ADDRESS_RESOLUTION hex - default 0x1000 + default 0x400 help RRAMC's region protection address resolution. Applies to region with configurable start address. config NRF_RRAM_REGION_SIZE_UNIT hex - default 0x1000 + default 0x400 help Base unit for the size of RRAMC's region protection. From eefce00ef3d1fb48db85824188938dbbace6b1cf Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 253/881] Revert "[nrf noup] ci: Enable action-manifest-pr" This reverts commit 7cf6f4fa8083e27ae79ba2c3160a870a1054380e. Signed-off-by: Jukka Rissanen --- .github/workflows/manifest-PR.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/manifest-PR.yml diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml deleted file mode 100644 index a871aa381de..00000000000 --- a/.github/workflows/manifest-PR.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: handle manifest PR -on: - pull_request_target: - types: [opened, synchronize, closed] - branches: - - main - - -jobs: - call-manifest-pr-action: - runs-on: ubuntu-latest - steps: - - name: handle manifest PR - uses: nrfconnect/action-manifest-pr@main - with: - token: ${{ secrets.NCS_GITHUB_TOKEN }} - manifest-pr-title-details: ${{ github.event.pull_request.title }} From 181e8e1f6af872500e6b388737da96ccae3a7bbd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:09 +0300 Subject: [PATCH 254/881] Revert "[nrf noup] soc: nordic: nrf54l: Skip clock configuration from ns" This reverts commit 4a163d030c88bc9d9a8c3f2069d4140d1f990d1c. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54l/Kconfig | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index bc88a62efb7..2d968a57bbe 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -62,18 +62,10 @@ config SOC_NRF54LM20A_ENGA_CPUFLPR if SOC_SERIES_NRF54LX config SOC_NRF54LX_SKIP_CLOCK_CONFIG - bool - prompt "Skip clock frequency configuration in system initialization" if TRUSTED_EXECUTION_SECURE - default y if TRUSTED_EXECUTION_NONSECURE + bool "Skip clock frequency configuration in system initialization" help - With this option, the CPU clock frequency is not set during this - Zephyr image's system initialization. The CPU runs with either - the HW reset values, or with the configuration set by an image - earlier in the boot chain. - - Note that for security reasons it is not supported to configure - the clock peripheral (NRF_OSCILLATORS) from the non-secure - domain. + With this option, the CPU clock frequency is not set during system initialization. + The CPU runs with the default, hardware-selected frequency. config SOC_NRF54LX_DISABLE_FICR_TRIMCNF bool "Disable trimming of the device" From b3986c8220086b95919ed26e9b4c6f25161686d1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 255/881] Revert "[nrf noup] settings: nvs: use dedicated lookup cache hash function" This reverts commit 1deb982783fff1ca9368fbe649123fbdeedfd304. Signed-off-by: Jukka Rissanen --- subsys/fs/nvs/Kconfig | 9 --------- subsys/fs/nvs/nvs.c | 46 ------------------------------------------- 2 files changed, 55 deletions(-) diff --git a/subsys/fs/nvs/Kconfig b/subsys/fs/nvs/Kconfig index 21798932f52..48915c2f048 100644 --- a/subsys/fs/nvs/Kconfig +++ b/subsys/fs/nvs/Kconfig @@ -29,15 +29,6 @@ config NVS_LOOKUP_CACHE_SIZE Number of entries in Non-volatile Storage lookup cache. It is recommended that it be a power of 2. -config NVS_LOOKUP_CACHE_FOR_SETTINGS - bool "Non-volatile Storage lookup cache optimized for settings" - depends on NVS_LOOKUP_CACHE - help - Use the lookup cache hash function that results in the least number of - collissions and, in turn, the best NVS performance provided that the NVS - is used as the settings backend only. This option should NOT be enabled - if the NVS is also written to directly, outside the settings layer. - config NVS_DATA_CRC bool "Non-volatile Storage CRC protection on the data" help diff --git a/subsys/fs/nvs/nvs.c b/subsys/fs/nvs/nvs.c index 103b605d5fc..2e553fdbf55 100644 --- a/subsys/fs/nvs/nvs.c +++ b/subsys/fs/nvs/nvs.c @@ -13,11 +13,6 @@ #include #include "nvs_priv.h" -#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS -#include -#include -#endif - #include LOG_MODULE_REGISTER(fs_nvs, CONFIG_NVS_LOG_LEVEL); @@ -26,45 +21,6 @@ static int nvs_ate_valid(struct nvs_fs *fs, const struct nvs_ate *entry); #ifdef CONFIG_NVS_LOOKUP_CACHE -#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS - -static inline size_t nvs_lookup_cache_pos(uint16_t id) -{ - /* - * 1. The NVS settings backend uses up to (NVS_NAME_ID_OFFSET - 1) NVS IDs to - store keys and equal number of NVS IDs to store values. - * 2. For each key-value pair, the value is stored at NVS ID greater by exactly - * NVS_NAME_ID_OFFSET than NVS ID that holds the key. - * 3. The backend tries to minimize the range of NVS IDs used to store keys. - * That is, NVS IDs are allocated sequentially, and freed NVS IDs are reused - * before allocating new ones. - * - * Therefore, to assure the least number of collisions in the lookup cache, - * the least significant bit of the hash indicates whether the given NVS ID - * represents a key or a value, and remaining bits of the hash are set to - * the ordinal number of the key-value pair. Consequently, the hash function - * provides the following mapping: - * - * 1st settings key => hash 0 - * 1st settings value => hash 1 - * 2nd settings key => hash 2 - * 2nd settings value => hash 3 - * ... - */ - BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAMECNT_ID), "NVS_NAMECNT_ID is not power of 2"); - BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAME_ID_OFFSET), "NVS_NAME_ID_OFFSET is not power of 2"); - - uint16_t key_value_bit; - uint16_t key_value_ord; - - key_value_bit = (id >> LOG2(NVS_NAME_ID_OFFSET)) & 1; - key_value_ord = id & (NVS_NAME_ID_OFFSET - 1); - - return ((key_value_ord << 1) | key_value_bit) % CONFIG_NVS_LOOKUP_CACHE_SIZE; -} - -#else /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ - static inline size_t nvs_lookup_cache_pos(uint16_t id) { uint16_t hash; @@ -80,8 +36,6 @@ static inline size_t nvs_lookup_cache_pos(uint16_t id) return hash % CONFIG_NVS_LOOKUP_CACHE_SIZE; } -#endif /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ - static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) { int rc; From 1020a3cc9e7b4113348e2a15dd5a5e7bc17f85e0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 256/881] Revert "[nrf noup] samples: sysbuild: hello_world: support PM on nRF53" This reverts commit 470fcc9ac884ec9698e1d838160c7c3aadf706e0. Signed-off-by: Jukka Rissanen --- samples/sysbuild/hello_world/sysbuild.cmake | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index 8f8fc49dbff..c7c2615c665 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -11,17 +11,5 @@ ExternalZephyrProject_Add( BOARD ${SB_CONFIG_REMOTE_BOARD} ) -if(SB_CONFIG_SOC_SERIES_NRF53X) - set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) - set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) - set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) - set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") -else(SB_CONFIG_SOC_SERIES_NRF54LX) - set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) - set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) - set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) - set(CPUFLPR_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") -endif() - add_dependencies(${DEFAULT_IMAGE} remote) sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote) From aa75c28defc214c42500d7bbf9a47758742b333b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 257/881] Revert "[nrf noup] board: nordic: thingy53: Default to update only MCUboot type" This reverts commit a06f9582999650d0f950952b4799510871e23948. Signed-off-by: Jukka Rissanen --- boards/nordic/thingy53/Kconfig.sysbuild | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index df489c1dd54..c03d191b370 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -7,10 +7,6 @@ choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -choice MCUBOOT_MODE - default MCUBOOT_MODE_OVERWRITE_ONLY -endchoice - config SECURE_BOOT_NETCORE default y @@ -20,9 +16,6 @@ config NETCORE_APP_UPDATE config NRF_DEFAULT_EMPTY default y if SECURE_BOOT_NETCORE -config MCUBOOT_USE_ALL_AVAILABLE_RAM - default y if BOARD_THINGY53_NRF5340_CPUAPP_NS && BOOTLOADER_MCUBOOT - endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY From 2d140dc461c1b44bd6a66931ab7f544949843db1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 258/881] =?UTF-8?q?Revert=20"[nrf=20noup]=C2=A0Bluetooth:?= =?UTF-8?q?=20Mesh:=20remove=20legacy=20adv=20support"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 10b13619fcdedaa5ae25f62eb7acd86f5f768635. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/mesh/Kconfig | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index bd0350307ba..cd3d4619097 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -59,16 +59,12 @@ choice BT_MESH_ADV menuconfig BT_MESH_ADV_LEGACY bool "Legacy advertising" - depends on BT_LL_SW_SPLIT help Use legacy advertising commands for mesh sending. Legacy - advertising is significantly slower than the extended advertising. + advertising is significantly slower than the extended advertising, but + is supported by all controllers. - WARNING: This feature is not supported in NCS. The legacy advertiser will not work - with SDC, as attempting to start an advertisement during the scanner duty cycle - will result in an error. The Zephyr Link Layer can be used experimentally as an - alternative. - The legacy advertiser can occasionally do more message + WARNING: The legacy advertiser can occasionally do more message retransmissions than requested because of limitations of HCI interface API. From 42ddfadc229914781eb2e495a60c43df9188afb5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 259/881] Revert "[nrf noup] kernel: Disable boot banner if NCS_BOOT_BANNER is enabled" This reverts commit 4b7a867eabe9e6e3724e8b3c210b9506c9c2cfef. Signed-off-by: Jukka Rissanen --- kernel/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/Kconfig b/kernel/Kconfig index c2976b9f281..838d44afbf9 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -457,7 +457,6 @@ config SKIP_BSS_CLEAR config BOOT_BANNER bool "Boot banner" default y - depends on !NCS_BOOT_BANNER select PRINTK select EARLY_CONSOLE help From c4ff8c2acd13006e487be2e84341cc412d0f0462 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 260/881] Revert "[nrf noup] tree-wide: support NCS Partition Manager (PM) definitions" This reverts commit 5c2eecf1ef8bc3bc714dff8adf8f023bd921227a. Signed-off-by: Jukka Rissanen --- arch/arm/core/mpu/arm_mpu_regions.c | 13 ----- cmake/linker/ld/target.cmake | 1 - cmake/linker/lld/target.cmake | 1 - cmake/modules/kernel.cmake | 4 -- drivers/flash/soc_flash_nrf.c | 11 ---- drivers/flash/soc_flash_nrf_rram.c | 11 ---- .../arch/arm/cortex_m/scripts/linker.ld | 50 ------------------- include/zephyr/storage/flash_map.h | 6 --- lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 18 +------ subsys/dfu/boot/mcuboot_shell.c | 40 --------------- subsys/fs/littlefs_fs.c | 7 +-- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ---------- 13 files changed, 4 insertions(+), 187 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 383fd573513..0bf7a219c27 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,9 +8,6 @@ #include #include -#if USE_PARTITION_MANAGER -#include -#endif static const struct arm_mpu_region mpu_regions[] = { #ifdef CONFIG_XIP @@ -27,14 +24,6 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", -#if USE_PARTITION_MANAGER - PM_SRAM_ADDRESS, -#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) - REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), -#else - REGION_RAM_ATTR(REGION_SRAM_SIZE)), -#endif -#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -42,8 +31,6 @@ static const struct arm_mpu_region mpu_regions[] = { #else REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif - -#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index cee3dd011bc..733accda782 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,7 +80,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} - -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index bdea4f1ec92..b6b96525e70 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,7 +52,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} - -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 5c8fa184b20..c6319611c8c 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -256,7 +256,3 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() - -if(ZEPHYR_NRF_MODULE_DIR) - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) -endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 574739082dc..9e1ba68319f 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,11 +37,6 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -171,12 +166,6 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index d46e3524ea8..d26a15cf723 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,11 +54,6 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -284,12 +279,6 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index ae4fbcaedda..278620dfaf0 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,39 +34,6 @@ #define ROMSTART_REGION ROMABLE_REGION #endif -#if USE_PARTITION_MANAGER - -#include - -#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) -/* We are linking against S1, create symbol containing the flash ID of S0. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S0_ID; - -#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ - -#ifdef PM_S1_ID -/* We are linking against S0, create symbol containing the flash ID of S1. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S1_ID; -#endif /* PM_S1_ID */ - -#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ - -#define ROM_ADDR PM_ADDRESS -#define ROM_SIZE PM_SIZE - -#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) -#define RAM_SIZE CONFIG_PM_SRAM_SIZE -#else -#define RAM_SIZE PM_SRAM_SIZE -#endif -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -88,23 +55,6 @@ _image_1_primary_slot_id = PM_S1_ID; #define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS -#endif /* USE_PARTITION_MANAGER */ - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) -#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) -#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) -#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) -#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) -#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) -#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) -#endif - #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index f62f1c21718..d8ba414abd3 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -348,10 +348,6 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); -#if USE_PARTITION_MANAGER -#include -#else - /** * Returns non-0 value if fixed-partition of given DTS node label exists. * @@ -473,8 +469,6 @@ DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) #undef FOR_EACH_PARTITION_TABLE /** @endcond */ -#endif /* USE_PARTITION_MANAGER */ - #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index 9a39ab8ad73..0d97da3e340 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -81,7 +81,7 @@ config HEAP_LISTENER choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) && !PARTITION_MANAGER_ENABLED + default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 2821ae8173a..2b01e152f00 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,20 +25,6 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); -#if USE_PARTITION_MANAGER - -#include - -#define RAM_SIZE PM_SRAM_SIZE -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - -#define RAM_SIZE (KB((size_t) CONFIG_SRAM_SIZE)) -#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS - -#endif /* USE_PARTITION_MANAGER */ - #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -120,8 +106,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((RAM_SIZE - \ - ((size_t) HEAP_BASE - (size_t) RAM_ADDR)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ + ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index e167bc1e39b..be4e558713f 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,16 +20,6 @@ #endif #endif -#if USE_PARTITION_MANAGER -#include - -#ifdef CONFIG_NCS_IS_VARIANT_IMAGE -#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID -#else -#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID -#endif -#endif - struct area_desc { const char *name; unsigned int id; @@ -103,35 +93,6 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ -#if USE_PARTITION_MANAGER -#ifdef PM_MCUBOOT_ID - if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { - shell_error(sh, "Cannot erase boot partition"); - return -EACCES; - } -#endif - -#ifdef PM_APP_ID - if (id == PM_APP_ID) { - shell_error(sh, "Cannot erase this area"); - return -EACCES; - } -#endif - -#ifdef PM_MCUBOOT_PRIMARY_APP_ID - if (id == PM_MCUBOOT_PRIMARY_APP_ID) { - shell_error(sh, "Cannot erase this area"); - return -EACCES; - } -#endif - -#ifdef ACTIVE_IMAGE_ID - if (id == ACTIVE_IMAGE_ID) { - shell_error(sh, "Cannot erase active partitions"); - return -EACCES; - } -#endif -#else #if FIXED_PARTITION_EXISTS(boot_partition) if (id == FIXED_PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -144,7 +105,6 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } -#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index 5abbf95f949..7cf8aaa44c7 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1103,12 +1103,7 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *) \ - COND_CODE_1(USE_PARTITION_MANAGER, \ - (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ - (FIXED_PARTITION_ID(littlefs_storage)), \ - (FIXED_PARTITION_ID(storage)))), \ - (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ + .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index 9996e1d74d9..a74e46b8520 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,35 +13,8 @@ extern "C" { #endif -#if CONFIG_PARTITION_MANAGER_ENABLED - -#include "pm_config.h" - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) -#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE -#else -/* The current image is a child image in a different domain than the image - * which defined the required values. To reach the values of the parent domain - * we use the 'PM__' variant of the define. - */ -#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ - -#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ - -#else - -#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) -#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) - -#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From a7d1daf25d72782c415ee89f12c773994610ebd1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 261/881] Revert "[nrf noup] include: net: add NCS extensions" This reverts commit d7a627775d65077527e6272d627e2b88bfecc9cd. Signed-off-by: Jukka Rissanen --- include/zephyr/net/socket.h | 1 - include/zephyr/net/socket_ncs.h | 170 -------------------------------- 2 files changed, 171 deletions(-) delete mode 100644 include/zephyr/net/socket_ncs.h diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index 4a0823bc069..ae398bb6117 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -35,7 +35,6 @@ #include #include #include -#include #include #ifdef __cplusplus diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h deleted file mode 100644 index 92a8447c47f..00000000000 --- a/include/zephyr/net/socket_ncs.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ -#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ - -/** - * @file - * @brief NCS specific additions to the BSD sockets API definitions - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence - * when creating a new socket. Combine this flag with a socket type when - * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). - * If it's desired to create a native TLS socket, but still offload the - * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. - */ -#define SOCK_NATIVE 0x80000000 -#define SOCK_NATIVE_TLS 0x40000000 - -/** Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options. - */ -#define NET_SOCKET_NCS_BASE 1000 - -/* NCS specific TLS level socket options */ - -/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. - * The option accepts an integer, indicating the total handshake timeout, - * including retransmissions, in seconds. - * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. - */ -#define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) - -/** Socket option to save DTLS connection, specifically for nRF sockets. - */ -#define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) - -/** Socket option to load DTLS connection, specifically for nRF sockets. - */ -#define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) - -/** Socket option to get result of latest TLS/DTLS completed handshakes end status, - * specifically for nRF sockets. - * The option accepts an integer, indicating the setting. - * Accepted vaules for the option are: 0 and 1. - */ -#define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) - -/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ -#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */ -#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ -#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ - -/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */ -#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 -#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 - -/* NCS specific socket options */ - -/** sockopt: enable sending data as part of exceptional events */ -#define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) -/** sockopt: Keep socket open when its PDN connection is lost - * or the device is put into flight mode. - */ -#define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) -/** sockopt: bind to PDN */ -#define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) - -/** sockopt: Release assistance indication (RAI). - * The option accepts an integer, indicating the type of RAI. - * Accepted values for the option are: @ref RAI_NO_DATA, @ref RAI_LAST, @ref RAI_ONE_RESP, - * @ref RAI_ONGOING, @ref RAI_WAIT_MORE. - */ -#define SO_RAI (NET_SOCKET_NCS_BASE + 61) - -/** Release assistance indication (RAI). - * Indicate that the application does not intend to send more data. - * This applies immediately and lets the modem exit connected mode more - * quickly. - * - * @note This requires the socket to be connected. - */ -#define RAI_NO_DATA 1 -/** Release assistance indication (RAI). - * Indicate that the application does not intend to send more data - * after the next call to send() or sendto(). - * This lets the modem exit connected mode more quickly after sending the data. - */ -#define RAI_LAST 2 -/** Release assistance indication (RAI). - * Indicate that the application is expecting to receive just one data packet - * after the next call to send() or sendto(). - * This lets the modem exit connected mode more quickly after having received the data. - */ -#define RAI_ONE_RESP 3 -/** Release assistance indication (RAI). - * Indicate that the socket is in active use by a client application. - * This lets the modem stay in connected mode longer. - */ -#define RAI_ONGOING 4 -/** Release assistance indication (RAI). - * Indicate that the socket is in active use by a server application. - * This lets the modem stay in connected mode longer. - */ -#define RAI_WAIT_MORE 5 - -/* NCS specific IPPROTO_ALL level socket options */ - -/** IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. */ -#define IPPROTO_ALL 512 -/** sockopt: disable all replies to unexpected traffics */ -#define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) - -/* NCS specific IPPROTO_IP level socket options */ - -/** sockopt: enable IPv4 ICMP replies */ -#define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) - -/* NCS specific IPPROTO_IPV6 level socket options */ - -/** sockopt: enable IPv6 ICMP replies */ -#define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) - -/** sockopt: Delay IPv6 address refresh during power saving mode */ -#define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) - -/* NCS specific TCP level socket options */ - -/** sockopt: Configurable TCP server session timeout in minutes. - * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). - */ -#define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) - -/* NCS specific gettaddrinfo() flags */ - -/** Assume `service` contains a Packet Data Network (PDN) ID. - * When specified together with the AI_NUMERICSERV flag, - * `service` shall be formatted as follows: "port:pdn_id" - * where "port" is the port number and "pdn_id" is the PDN ID. - * Example: "8080:1", port 8080 PDN ID 1. - * Example: "42:0", port 42 PDN ID 0. - */ -#define AI_PDNSERV 0x1000 - -/* NCS specific send() and sendto() flags */ - -/** Request a blocking send operation until the request is acknowledged. - * When used in send() or sendto(), the request will not return until the - * send operation is completed by lower layers, or until the timeout, given by the SO_SNDTIMEO - * socket option, is reached. Valid timeout values are 1 to 600 seconds. - */ -#define MSG_WAITACK 0x200 - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ From fb5934111e4bce650e25894eae500c00a830434a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 262/881] Revert "[nrf noup] board: nordic: thingy53: Enable default images for sysbuild" This reverts commit f730f82960010af1f6fd988d15842de0920dc9af. Signed-off-by: Jukka Rissanen --- boards/nordic/thingy53/Kconfig.sysbuild | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index c03d191b370..2110f226e6b 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -1,22 +1,5 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS - -choice BOOTLOADER - default BOOTLOADER_MCUBOOT -endchoice - -config SECURE_BOOT_NETCORE - default y - -config NETCORE_APP_UPDATE - default y if SECURE_BOOT_NETCORE - -config NRF_DEFAULT_EMPTY - default y if SECURE_BOOT_NETCORE - -endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS - config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY default y if BOOTLOADER_MCUBOOT From a5b49072230028dcce261de16e912e54e90b6613 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 263/881] Revert "[nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir" This reverts commit 5bbb2c8dd32e564667eb7b6bc3bd27f9f58e1bfb. Signed-off-by: Jukka Rissanen --- scripts/west_commands/build.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index 1b7bf3b80a1..90d1a037e4f 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -624,12 +624,7 @@ def _run_cmake(self, board, origin, cmake_opts): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', None) - - if config_sysbuild is None: - # If no option is set, then enable sysbuild globally - config_sysbuild = True - + config_sysbuild = config_getboolean('sysbuild', False) if self.args.sysbuild or (config_sysbuild and not self.args.no_sysbuild): cmake_opts.extend([f'-S{SYSBUILD_PROJ_DIR}', f'-DAPP_DIR:PATH={self.source_dir}']) From 1f69238f26329478631ee464a1cea461db62e9cc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 264/881] Revert "[nrf noup] boards: nordic: thingy53: Add sysbuild Kconfig file" This reverts commit fa07e94d6a760f8a4e025b408f3ddd5db47acaf5. Signed-off-by: Jukka Rissanen --- boards/nordic/thingy53/Kconfig.sysbuild | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 boards/nordic/thingy53/Kconfig.sysbuild diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild deleted file mode 100644 index 2110f226e6b..00000000000 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOOTLOADER_MCUBOOT From 68a6f6203d6903964b6c2a5fd0404c6645e17a08 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 265/881] Revert "[nrf noup] samples: psa_crypto: Remove support for Nordic boards" This reverts commit 27f225d5ae6e3f73b609970b81881d504f1b956d. Signed-off-by: Jukka Rissanen --- samples/tfm_integration/psa_crypto/sample.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/tfm_integration/psa_crypto/sample.yaml b/samples/tfm_integration/psa_crypto/sample.yaml index 7d287985bf3..ea9844730fc 100644 --- a/samples/tfm_integration/psa_crypto/sample.yaml +++ b/samples/tfm_integration/psa_crypto/sample.yaml @@ -16,6 +16,8 @@ tests: platform_allow: - mps2/an521/cpu0/ns - v2m_musca_s1/musca_s1/ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns - stm32l562e_dk/stm32l562xx/ns - bl5340_dvk/nrf5340/cpuapp/ns - max32657evkit/max32657/ns From 9728a4a1de4578b769d4541d6e075bb898055d81 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 266/881] Revert "[nrf noup] boards: thingy53_nrf5340: Enable MCUboot by default" This reverts commit ce70796db5dd9a8d99c55732c0292bbeffc38f77. Signed-off-by: Jukka Rissanen --- boards/nordic/thingy53/Kconfig.defconfig | 6 ------ boards/nordic/thingy53/thingy53_nrf5340_common.dtsi | 1 - 2 files changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index badcb5c20e5..1aa0d7d082e 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -8,12 +8,6 @@ config HW_STACK_PROTECTION if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS -config BOOTLOADER_MCUBOOT - default y if !MCUBOOT - -config BOARD_ENABLE_CPUNET - default y if !MCUBOOT - # Code Partition: # # For the secure version of the board the firmware is linked at the beginning diff --git a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi index 900b9d06e65..3f2f2d5f060 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi +++ b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi @@ -13,7 +13,6 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; - nordic,pm-ext-flash = &mx25r64; }; buttons { From 865250d9ff366c7f2d53c30abcd391f8a8097157 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 267/881] Revert "[nrf noup] boards: arm: thingy53: Disable USB CDC added by MCUBoot" This reverts commit 6d1e3772d63562e2e30fa3176805538d2f0c4117. Signed-off-by: Jukka Rissanen --- boards/nordic/thingy53/Kconfig.defconfig | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 1aa0d7d082e..c1139f0dca1 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -84,13 +84,6 @@ endif # !TRUSTED_EXECUTION_SECURE source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" -# By default, a USB CDC ACM instance is already enabled in the board's DTS. -# It is not necessary for nRF Connect SDK to add another instance if MCUBoot -# bootloader is built as a child image. -config MCUBOOT_USB_SUPPORT - bool - default n - endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From fa734090076e8d3e0ccc798267f0e43bb5c19a89 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 268/881] Revert "[nrf noup] boards: thingy53_nrf5340: Add common partition map" This reverts commit afef9ef461a574f57a785bf220060468ad3ebbde. Signed-off-by: Jukka Rissanen --- .../pm_static_thingy53_nrf5340_cpuapp.yml | 55 -------------- .../pm_static_thingy53_nrf5340_cpuapp_ns.yml | 73 ------------------- 2 files changed, 128 deletions(-) delete mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml delete mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml deleted file mode 100644 index 7a48d51ec33..00000000000 --- a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml +++ /dev/null @@ -1,55 +0,0 @@ -app: - address: 0x10200 - region: flash_primary - size: 0xdfe00 -mcuboot: - address: 0x0 - region: flash_primary - size: 0x10000 -mcuboot_pad: - address: 0x10000 - region: flash_primary - size: 0x200 -mcuboot_primary: - address: 0x10000 - orig_span: &id001 - - mcuboot_pad - - app - region: flash_primary - size: 0xe0000 - span: *id001 -mcuboot_primary_app: - address: 0x10200 - orig_span: &id002 - - app - region: flash_primary - size: 0xdfe00 - span: *id002 -settings_storage: - address: 0xf0000 - region: flash_primary - size: 0x10000 -mcuboot_primary_1: - address: 0x0 - size: 0x40000 - device: flash_ctrl - region: ram_flash -mcuboot_secondary: - address: 0x00000 - size: 0xe0000 - device: MX25R64 - region: external_flash -mcuboot_secondary_1: - address: 0xe0000 - size: 0x40000 - device: MX25R64 - region: external_flash -external_flash: - address: 0x120000 - size: 0x6e0000 - device: MX25R64 - region: external_flash -pcd_sram: - address: 0x20000000 - size: 0x2000 - region: sram_primary diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml deleted file mode 100644 index 70ffe6d9c12..00000000000 --- a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml +++ /dev/null @@ -1,73 +0,0 @@ -mcuboot: - address: 0x0 - region: flash_primary - size: 0x10000 -mcuboot_pad: - address: 0x10000 - region: flash_primary - size: 0x200 -tfm_secure: - address: 0x10000 - size: 0xc000 - span: [mcuboot_pad, tfm] -tfm_nonsecure: - address: 0x1c000 - size: 0xd4000 - span: [app] -tfm: - address: 0x10200 - region: flash_primary - size: 0xbe00 -app: - address: 0x1c000 - region: flash_primary - size: 0xd4000 -mcuboot_primary: - address: 0x10000 - orig_span: &id001 - - mcuboot_pad - - tfm - - app - region: flash_primary - size: 0xe0000 - span: *id001 -mcuboot_primary_app: - address: 0x10200 - orig_span: &id002 - - tfm - - app - region: flash_primary - size: 0xdfe00 - span: *id002 -nonsecure_storage: - address: 0xf0000 - size: 0x10000 - span: [settings_storage] -settings_storage: - address: 0xf0000 - region: flash_primary - size: 0x10000 -mcuboot_primary_1: - address: 0x0 - size: 0x40000 - device: flash_ctrl - region: ram_flash -mcuboot_secondary: - address: 0x00000 - size: 0xe0000 - device: MX25R64 - region: external_flash -mcuboot_secondary_1: - address: 0xe0000 - size: 0x40000 - device: MX25R64 - region: external_flash -external_flash: - address: 0x120000 - size: 0x6e0000 - device: MX25R64 - region: external_flash -pcd_sram: - address: 0x20000000 - size: 0x2000 - region: sram_primary From e10c878f4a89f83302cf0ad91036111a16fe7aa7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 269/881] Revert "[nrf noup] soc: arm: nRF91: Add SPU Flash/RAM alignment" This reverts commit a562d9663033995572b1e3269c687cbb343773e0. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf53/Kconfig | 22 ++++++++-------------- soc/nordic/nrf91/Kconfig | 20 -------------------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 1a747bec9ea..d90bf28846a 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -167,15 +167,12 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_TRUSTZONE_FLASH_REGION_SIZE +config NRF_SPU_FLASH_REGION_ALIGNMENT hex - default NRF_SPU_FLASH_REGION_SIZE + default 0x4000 help - Define the flash region size from a TrustZone perspective. - This is used when we set the security attributes(S/NSC/NS) of a region - in TrustZone enabled devices. - In practice this option defines the granularity of the security attributes, - i.e. the smallest region that can be set to secure or non-secure. + FLASH regions must be aligned to this value due to SPU HW + limitations. config NRF_SPU_RAM_REGION_SIZE hex @@ -183,15 +180,12 @@ config NRF_SPU_RAM_REGION_SIZE help RAM region size for the NRF_SPU peripheral -config NRF_TRUSTZONE_RAM_REGION_SIZE +config NRF_SPU_RAM_REGION_ALIGNMENT hex - default NRF_SPU_RAM_REGION_SIZE + default 0x2000 help - Define the RAM region size from a TrustZone perspective. - This is used when we set the security attributes(S/NSC/NS) of a region - in TrustZone enabled devices. - In practice this option defines the granularity of the security attributes, - i.e. the smallest region that can be set to secure or non-secure. + RAM regions must be aligned to this value due to SPU HW + limitations. config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" diff --git a/soc/nordic/nrf91/Kconfig b/soc/nordic/nrf91/Kconfig index 9f55cdd77ed..ed38eff73a2 100644 --- a/soc/nordic/nrf91/Kconfig +++ b/soc/nordic/nrf91/Kconfig @@ -24,16 +24,6 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default NRF_SPU_FLASH_REGION_SIZE - help - Define the flash region size from a TrustZone perspective. - This is used when we set the security attributes(S/NSC/NS) of a region - in TrustZone enabled devices. - In practice this option defines the granularity of the security attributes, - i.e. the smallest region that can be set to secure or non-secure. - config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 @@ -44,14 +34,4 @@ config NRF_ENABLE_ICACHE bool "Instruction cache (I-Cache)" default y -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default NRF_SPU_RAM_REGION_SIZE - help - Define the RAM region size from a TrustZone perspective. - This is used when we set the security attributes(S/NSC/NS) of a region - in TrustZone enabled devices. - In practice this option defines the granularity of the security attributes, - i.e. the smallest region that can be set to secure or non-secure. - endif # SOC_SERIES_NRF91X From 7a5d3fc6ccfc31f65febec51a1d787015733eaa8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 270/881] Revert "[nrf noup] soc: arm: nRF53: Add SPU Flash/RAM alignment" This reverts commit bc60d5ca3563061a00c35873e3e5c225e6de3750. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf53/Kconfig | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index d90bf28846a..8aade63f54a 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -167,26 +167,12 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_SPU_FLASH_REGION_ALIGNMENT - hex - default 0x4000 - help - FLASH regions must be aligned to this value due to SPU HW - limitations. - config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 help RAM region size for the NRF_SPU peripheral -config NRF_SPU_RAM_REGION_ALIGNMENT - hex - default 0x2000 - help - RAM regions must be aligned to this value due to SPU HW - limitations. - config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" depends on NRF_SOC_SECURE_SUPPORTED From 1d9b6a4b39199b941cc9120b78df7ffcc46895a2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:10 +0300 Subject: [PATCH 271/881] Revert "[nrf noup] net: mqtt: add native TLS support" This reverts commit 3fbd1c5c3c5217423087ea1075acc4b5b79ac330. Signed-off-by: Jukka Rissanen --- doc/connectivity/networking/api/mqtt.rst | 3 --- include/zephyr/net/mqtt.h | 3 --- subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 7 +------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/doc/connectivity/networking/api/mqtt.rst b/doc/connectivity/networking/api/mqtt.rst index 3d222d53816..9a167ffe665 100644 --- a/doc/connectivity/networking/api/mqtt.rst +++ b/doc/connectivity/networking/api/mqtt.rst @@ -150,7 +150,6 @@ additional configuration information: tls_config->sec_tag_list = m_sec_tags; tls_config->sec_tag_count = ARRAY_SIZE(m_sec_tags); tls_config->hostname = MQTT_BROKER_HOSTNAME; - tls_config->set_native_tls = true; In this sample code, the ``m_sec_tags`` array holds a list of tags, referencing TLS credentials that the MQTT library should use for authentication. We do not specify @@ -163,8 +162,6 @@ Note, that TLS credentials referenced by the ``m_sec_tags`` array must be registered in the system first. For more information on how to do that, refer to :ref:`secure sockets documentation `. -Finally, ``set_native_tls`` can be optionally set to enable native TLS support instead of offloading TLS operations to the modem. - An example of how to use TLS with MQTT is also present in :zephyr:code-sample:`mqtt-publisher` sample application. diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index 797f8f339d7..d63cc131624 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -773,9 +773,6 @@ struct mqtt_sec_config { /** Indicates the preference for copying certificates to the heap. */ int cert_nocopy; - - /** Set socket to native TLS */ - bool set_native_tls; }; /** @brief MQTT transport type. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 617dec4b4d2..68a101e6c84 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -22,15 +22,10 @@ int mqtt_client_tls_connect(struct mqtt_client *client) { const struct sockaddr *broker = client->broker; struct mqtt_sec_config *tls_config = &client->transport.tls.config; - int type = SOCK_STREAM; int ret; - if (tls_config->set_native_tls) { - type |= SOCK_NATIVE_TLS; - } - client->transport.tls.sock = zsock_socket(broker->sa_family, - type, IPPROTO_TLS_1_2); + SOCK_STREAM, IPPROTO_TLS_1_2); if (client->transport.tls.sock < 0) { return -errno; } From 0d78df4977eed1369214855432bada0d03e5c750 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 272/881] Revert "[nrf noup] net: mqtt: Provide option to enable TLS session caching" This reverts commit e15a1164f1ce13a1b67291fdc880e31d8cf63abd. Signed-off-by: Jukka Rissanen --- include/zephyr/net/mqtt.h | 3 --- subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index d63cc131624..b992714afd3 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -763,9 +763,6 @@ struct mqtt_sec_config { uint32_t alpn_protocol_name_count; #endif - /** Indicates the preference for enabling TLS session caching. */ - int session_cache; - /** Peer hostname for ceritificate verification. * May be NULL to skip hostname verification. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 68a101e6c84..2ff337eef34 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -109,16 +109,6 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } - if (tls_config->session_cache == TLS_SESSION_CACHE_ENABLED) { - ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, - TLS_SESSION_CACHE, - &tls_config->session_cache, - sizeof(tls_config->session_cache)); - if (ret < 0) { - goto error; - } - } - if (tls_config->cert_nocopy != TLS_CERT_NOCOPY_NONE) { ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, TLS_CERT_NOCOPY, &tls_config->cert_nocopy, From 242d7aedfa85da3c5f8cfc12587ec75a5ffe57fd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 273/881] Revert "[nrf noup] test: schedule_api: Use Minimal C library" This reverts commit 8cb54eb26cbce8c31af83154d863dd72bca036a4. Signed-off-by: Jukka Rissanen --- tests/kernel/pipe/deprecated/pipe_api/prj.conf | 1 - tests/kernel/sched/schedule_api/prj.conf | 1 - tests/kernel/sched/schedule_api/prj_multiq.conf | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/kernel/pipe/deprecated/pipe_api/prj.conf b/tests/kernel/pipe/deprecated/pipe_api/prj.conf index df3270adfdf..02d8fd3dd56 100644 --- a/tests/kernel/pipe/deprecated/pipe_api/prj.conf +++ b/tests/kernel/pipe/deprecated/pipe_api/prj.conf @@ -6,4 +6,3 @@ CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y CONFIG_PIPES=y CONFIG_DEPRECATION_TEST=y -CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj.conf b/tests/kernel/sched/schedule_api/prj.conf index 8b649a3b7fc..a5ceef69433 100644 --- a/tests/kernel/sched/schedule_api/prj.conf +++ b/tests/kernel/sched/schedule_api/prj.conf @@ -7,4 +7,3 @@ CONFIG_MAX_THREAD_BYTES=6 CONFIG_TEST_USERSPACE=y CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y -CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index 84c9d80ac61..c8dd4bf786b 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -7,4 +7,3 @@ CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y CONFIG_NUM_COOP_PRIORITIES=30 CONFIG_NUM_PREEMPT_PRIORITIES=40 -CONFIG_MINIMAL_LIBC=y From dfb9fd69718d61ffa0519de7008f4c4001266957 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 274/881] Revert "[nrf noup] modules: mbedtls: Use help for DISABLE_MBEDTLS_BUILTIN info" This reverts commit c289b579cd65da72777519d2305d1c7cf46ad609. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index aa8c479e89f..f7bc6a609f1 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -43,11 +43,10 @@ config MBEDTLS_LIBRARY endchoice +# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select +# DISABLE_MBEDTLS_BUILTIN. config DISABLE_MBEDTLS_BUILTIN bool - help - Subsystems cannot deselect MBEDTLS_BUILTIN, but they can select - DISABLE_MBEDTLS_BUILTIN. config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" From 1d30826608f32da03f9ab03e89046bfc75832b9b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 275/881] Revert "[nrf noup] dfu/boot/mcuboot: fix confirmation in case of USE_PARTITION_MANAGER" This reverts commit b24d5100b9a635d4bb2bc2e041b5fdbc0ad452a0. Signed-off-by: Jukka Rissanen --- subsys/dfu/boot/mcuboot.c | 44 --------------------------------------- 1 file changed, 44 deletions(-) diff --git a/subsys/dfu/boot/mcuboot.c b/subsys/dfu/boot/mcuboot.c index 2984efe0906..5683d23a87a 100644 --- a/subsys/dfu/boot/mcuboot.c +++ b/subsys/dfu/boot/mcuboot.c @@ -49,48 +49,6 @@ enum IMAGE_INDEXES { IMAGE_INDEX_2 }; -#if USE_PARTITION_MANAGER -#include - -#if CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 -/* Sysbuild */ -#ifdef CONFIG_MCUBOOT -/* lib is part of MCUboot -> operate on the primary application slot */ -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#else -/* TODO: Add firmware loader support */ -/* lib is part of the app -> operate on active slot */ -#if defined(CONFIG_NCS_IS_VARIANT_IMAGE) -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID -#else -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#endif -#endif /* CONFIG_MCUBOOT */ -#else -/* Legacy child/parent */ -#if CONFIG_BUILD_WITH_TFM - #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) -#else - #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) -#endif - -#ifdef CONFIG_MCUBOOT - /* lib is part of MCUboot -> operate on the primary application slot */ - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#else - /* lib is part of the App -> operate on active slot */ -#if (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_PRIMARY_ADDRESS - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#elif (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_SECONDARY_ADDRESS - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID -#else - #error Missing partition definitions. -#endif -#endif /* CONFIG_MCUBOOT */ -#endif /* CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 */ - -#else - #if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) /* For RAM LOAD mode, the active image must be fetched from the bootloader */ #define ACTIVE_SLOT_FLASH_AREA_ID boot_fetch_active_slot() @@ -100,8 +58,6 @@ enum IMAGE_INDEXES { #define ACTIVE_SLOT_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_code_partition)) #endif -#endif /* USE_PARTITION_MANAGER */ - /* * Raw (on-flash) representation of the v1 image header. */ From 518648e09e7746ccbe6f8acd071b1c262a432de8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 276/881] Revert "[nrf noup] Bluetooth: Mesh: Fix adv randomness bug" This reverts commit 43189afa7eec1ea93bd83e7c7fb2284779723402. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/mesh/adv_ext.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 0e6f6120f73..7caff2f91d2 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -568,10 +568,8 @@ int bt_mesh_adv_enable(void) return err; } - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && - IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_FRIEND_SEPARATE) && - advs[i].tags == BT_MESH_ADV_TAG_BIT_FRIEND) { - err = set_adv_randomness(advs[i].instance->handle, 0); + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { + err = set_adv_randomness(adv->instance->handle, 0); if (err) { LOG_ERR("Failed to set zero randomness: %d", err); } From a940a60e3691a2ac8e8c1815b98ca8b787c8b077 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 277/881] Revert "[nrf noup] Bluetooth: Mesh: zero randomization for friend's adv" This reverts commit 71c24b8a084e7ae6290b678ce2e4418d75720a39. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/mesh/Kconfig | 2 +- subsys/bluetooth/mesh/adv_ext.c | 32 -------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index cd3d4619097..e51ad2ccac0 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1705,7 +1705,7 @@ config BT_MESH_LPN_INIT_POLL_TIMEOUT config BT_MESH_LPN_SCAN_LATENCY int "Latency for enabling scanning" range 0 50 - default 2 + default 15 help Latency in milliseconds that it takes to enable scanning. This is in practice how much time in advance before the Receive Window diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 7caff2f91d2..b056f74a587 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -13,9 +13,6 @@ #include #include #include -#if defined(CONFIG_BT_LL_SOFTDEVICE) -#include -#endif #include "common/bt_str.h" @@ -152,28 +149,6 @@ static inline struct bt_mesh_ext_adv *gatt_adv_get(void) } } -static int set_adv_randomness(uint8_t handle, int rand_us) -{ -#if defined(CONFIG_BT_LL_SOFTDEVICE) - struct net_buf *buf; - sdc_hci_cmd_vs_set_adv_randomness_t *cmd_params; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - LOG_ERR("Could not allocate command buffer"); - return -ENOMEM; - } - - cmd_params = net_buf_add(buf, sizeof(*cmd_params)); - cmd_params->adv_handle = handle; - cmd_params->rand_us = rand_us; - - return bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_SET_ADV_RANDOMNESS, buf, NULL); -#else - return 0; -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ -} - static int adv_start(struct bt_mesh_ext_adv *ext_adv, const struct bt_le_adv_param *param, struct bt_le_ext_adv_start_param *start, @@ -567,13 +542,6 @@ int bt_mesh_adv_enable(void) if (err) { return err; } - - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { - err = set_adv_randomness(adv->instance->handle, 0); - if (err) { - LOG_ERR("Failed to set zero randomness: %d", err); - } - } } return 0; From 1abb36561dd25d173a92c90fe0303675c55f5647 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 278/881] Revert "[nrf noup] modules: tfm: Add Kconfig for CRYPTO_PAKE_MODULE_ENABLED" This reverts commit 821fa521c423a67c7ac013a36345241f7841e4a8. Signed-off-by: Jukka Rissanen --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 9604319ca01..02d3580c22f 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -88,17 +88,6 @@ config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED is not used. Note that key agreement is under key derivation in the current implementation. -config TFM_CRYPTO_PAKE_MODULE_ENABLED - bool "PAKE crypto module" - default y - depends on PSA_HAS_PAKE_SUPPORT - depends on NRF_SECURITY - depends on PSA_CRYPTO_DRIVER_OBERON || PSA_CRYPTO_DRIVER_CRACEN - help - Enables the PAKE crypto module within the crypto partition. - Unset this option if the functionality provided by 'crypto_pake.c' - is not used. - endif # TFM_PARTITION_CRYPTO endif # BUILD_WITH_TFM From 3acb861586b16f76e038927363e2a5efac3fd0da Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 279/881] Revert "[nrf noup] samples/tests: Disable PM for some sysbuild builds" This reverts commit d1cb7a90e291f4b336ff4729bc5fa7923f228df5. Signed-off-by: Jukka Rissanen --- samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf | 1 - samples/drivers/mbox/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf | 1 - samples/subsys/logging/multidomain/sysbuild.conf | 1 - tests/boot/mcuboot_recovery_retention/sysbuild.conf | 1 - tests/boot/test_mcuboot/sysbuild.conf | 1 - tests/drivers/flash/common/sysbuild.conf | 1 - tests/drivers/flash/negative_tests/sysbuild.conf | 1 - tests/subsys/fs/fcb/sysbuild.conf | 1 - tests/subsys/fs/littlefs/sysbuild.conf | 1 - 12 files changed, 12 deletions(-) delete mode 100644 samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf delete mode 100644 samples/drivers/mbox/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf delete mode 100644 samples/subsys/logging/multidomain/sysbuild.conf delete mode 100644 tests/drivers/flash/common/sysbuild.conf delete mode 100644 tests/drivers/flash/negative_tests/sysbuild.conf delete mode 100644 tests/subsys/fs/fcb/sysbuild.conf delete mode 100644 tests/subsys/fs/littlefs/sysbuild.conf diff --git a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/drivers/mbox/sysbuild.conf b/samples/drivers/mbox/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/samples/drivers/mbox/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/logging/multidomain/sysbuild.conf b/samples/subsys/logging/multidomain/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/samples/subsys/logging/multidomain/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/mcuboot_recovery_retention/sysbuild.conf b/tests/boot/mcuboot_recovery_retention/sysbuild.conf index 3b5b3c96380..47f00ff3cff 100644 --- a/tests/boot/mcuboot_recovery_retention/sysbuild.conf +++ b/tests/boot/mcuboot_recovery_retention/sysbuild.conf @@ -1,2 +1 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/test_mcuboot/sysbuild.conf b/tests/boot/test_mcuboot/sysbuild.conf index 3b5b3c96380..47f00ff3cff 100644 --- a/tests/boot/test_mcuboot/sysbuild.conf +++ b/tests/boot/test_mcuboot/sysbuild.conf @@ -1,2 +1 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/tests/drivers/flash/common/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/negative_tests/sysbuild.conf b/tests/drivers/flash/negative_tests/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/tests/drivers/flash/negative_tests/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/fcb/sysbuild.conf b/tests/subsys/fs/fcb/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/tests/subsys/fs/fcb/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/littlefs/sysbuild.conf b/tests/subsys/fs/littlefs/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/tests/subsys/fs/littlefs/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n From af9ef4b65bc4bb36cfd00262012cb94f1b2f7159 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 280/881] Revert "[nrf noup] samples&tests: Restore a few CONFIG_NEWLIB_LIBC_NANO=n" This reverts commit a6e6112a4c064a3d280153bc8644236153105c0e. Signed-off-by: Jukka Rissanen --- tests/lib/newlib/heap_listener/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/lib/newlib/heap_listener/prj.conf b/tests/lib/newlib/heap_listener/prj.conf index 7282777ff1c..e5a5dc6df4c 100644 --- a/tests/lib/newlib/heap_listener/prj.conf +++ b/tests/lib/newlib/heap_listener/prj.conf @@ -1,4 +1,3 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y From a19710c0a6032030f6218dbd67b4e770be57082e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 281/881] Revert "[nrf noup] samples: mgmt: mcumgr smp_svr: Migrate child image config" This reverts commit cda7620299116bde3df5639d50b9c1b9169ee1e3. Signed-off-by: Jukka Rissanen --- .../subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf deleted file mode 100644 index 98260877332..00000000000 --- a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor -# -# SPDX-License-Identifier: Apache-2.0 -# - -CONFIG_BT_MAX_CONN=2 -CONFIG_BT_BUF_ACL_RX_SIZE=502 -CONFIG_BT_BUF_ACL_TX_SIZE=502 -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 From 458a3a18d19888d2144a7f89f1e1279ef29b927a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 282/881] Revert "[nrf noup] samples: bluetooth: hci_pow_ctrl: Migrate child image config" This reverts commit 757558096a07cc71ee4afc0f6aebe766bbb61d01. Signed-off-by: Jukka Rissanen --- samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf | 1 - 1 file changed, 1 deletion(-) delete mode 100644 samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf deleted file mode 100644 index e6749ae6399..00000000000 --- a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From 97a11f9de2fc4a30e1e6e0d54aa5f1caa20a91a3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 283/881] Revert "[nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1" This reverts commit c82b5f3d3859c3aa32c1157bd4225a2186a47856. Signed-off-by: Jukka Rissanen --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 ----- subsys/mgmt/mcumgr/Kconfig | 1 - .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 35 ------------------- 3 files changed, 44 deletions(-) delete mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index ad088eca067..39d4a4ca8ce 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -16,11 +16,3 @@ add_subdirectory(transport) add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) - -if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) -endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 1c6a3a2a516..49bd17f4669 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,6 @@ menuconfig MCUMGR bool "mcumgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c deleted file mode 100644 index f1ac8a168e6..00000000000 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include "bootutil/bootutil_public.h" - -#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 -/* Sysbuild */ -#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER -#else -/* Legacy child/parent */ -#define NET_CORE_IMAGE 1 -#endif - -int boot_read_swap_state_primary_slot_hook(int image_index, - struct boot_swap_state *state) -{ - if (image_index == NET_CORE_IMAGE) { - /* Pretend that primary slot of image 1 unpopulated */ - state->magic = BOOT_MAGIC_UNSET; - state->swap_type = BOOT_SWAP_TYPE_NONE; - state->image_num = image_index; - state->copy_done = BOOT_FLAG_UNSET; - state->image_ok = BOOT_FLAG_UNSET; - - /* Prevent bootutil from trying to obtain true info */ - return 0; - } - - return BOOT_HOOK_REGULAR; -} From 729706d91ef653e281b0799bf47bbf89c59e2155 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 284/881] Revert "[nrf noup] mcumgr: img_mgmt: Fix check for chosen code partition" This reverts commit 6b04ceee078c40901b3ddd15e821fde8333d5f5c. Signed-off-by: Jukka Rissanen --- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c index d0303360f69..035a765798e 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -43,23 +43,6 @@ #if !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) -#if USE_PARTITION_MANAGER -#include - -#ifdef PM_MCUBOOT_SECONDARY_PAD_SIZE -BUILD_ASSERT(PM_MCUBOOT_PAD_SIZE == PM_MCUBOOT_SECONDARY_PAD_SIZE); -#endif - -#if CONFIG_BUILD_WITH_TFM - #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) -#else - #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) -#endif - -#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (FIXED_PARTITION_OFFSET(label) == (PM_ADDRESS - PM_ADDRESS_OFFSET)) - -#else /* ! USE_PARTITION_MANAGER */ #ifndef CONFIG_FLASH_LOAD_OFFSET #error MCUmgr requires application to be built with CONFIG_FLASH_LOAD_OFFSET set \ to be able to figure out application running slot. @@ -67,7 +50,6 @@ BUILD_ASSERT(PM_MCUBOOT_PAD_SIZE == PM_MCUBOOT_SECONDARY_PAD_SIZE); #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ (FIXED_PARTITION_OFFSET(label) == CONFIG_FLASH_LOAD_OFFSET) -#endif /* USE_PARTITION_MANAGER */ BUILD_ASSERT(sizeof(struct image_header) == IMAGE_HEADER_SIZE, "struct image_header not required size"); From 9849c16a486059a5a3ec22c5500646825ba133c9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 285/881] Revert "[nrf noup] drivers/flashdisk: Add support for Partition Manager" This reverts commit a01de066f17e286537b4979a04ca69c286806bc9. Signed-off-by: Jukka Rissanen --- drivers/disk/flashdisk.c | 78 ---------------------------------------- 1 file changed, 78 deletions(-) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index 4d8e3f1eee0..1ac3d15ba62 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -469,8 +469,6 @@ static const struct disk_operations flash_disk_ops = { .ioctl = disk_flash_access_ioctl, }; -#ifndef USE_PARTITION_MANAGER -/* The non-Partition manager, DTS based generators below */ #define DT_DRV_COMPAT zephyr_flash_disk #define PARTITION_PHANDLE(n) DT_PHANDLE_BY_IDX(DT_DRV_INST(n), partition, 0) @@ -512,82 +510,6 @@ DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) "Devicetree node " DT_NODE_PATH(DT_DRV_INST(n)) \ " has cache size which is not a multiple of its sector size"); DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) -#else /* ifndef USE_PARTITION_MANAGER */ -/* Partition Manager based generators below */ - -/* Gets the PM_..._EXTRA_PARAM_##param value */ -#define PM_FLASH_DISK_ENTRY_EXTRA_PARAM(name, param) PM_##name##_EXTRA_PARAM_disk_##param - -/* Gets the PM_..._NAME value which is originally cased, as in yaml, partition name */ -#define PM_FLASH_DISK_ENTRY_PARTITION_NAME(name) PM_##name##_NAME - -/* Generates flashdiskN_cache variable name, where N is partition ID */ -#define PM_FLASH_DISK_CACHE_VARIABLE(n) UTIL_CAT(flashdisk, UTIL_CAT(FIXED_PARTITION_ID(n), _cache)) - -/* Generate cache buffers */ -#define CACHE_SIZE(n) (COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), (0), (1)) * \ - PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size)) -#define DEFINE_FLASHDISKS_CACHE(n) \ - static uint8_t __aligned(4) PM_FLASH_DISK_CACHE_VARIABLE(n)[CACHE_SIZE(n)]; - -PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) - -/* Generated single Flash Disk device data from Partition Manager partition. - * Partition is required to have type set to disk in partition definitions: - * type: disk - * and following extra params can be provided: - * extra_params: { - * name = "", - * cache_size = , - * sector_size = , - * read_only = - * } - * where: - * is mandatory device name that will be used by Disk Access and FAT FS to mount device; - * is cache r/w cache size, which is mandatory if read_only = 0 or not present, - * and should be multiple of ; - * is mandatory device sector size information, usually should be erase page size, - * for flash devices, for example 4096 bytes; - * read_only is optional, if not present then assumed false; can be 0(false) or 1(true). - */ -#define DEFINE_FLASHDISKS_DEVICE(n) \ -{ \ - .info = { \ - .ops = &flash_disk_ops, \ - .name = STRINGIFY(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, name)), \ - }, \ - .area_id = FIXED_PARTITION_ID(n), \ - .offset = FIXED_PARTITION_OFFSET(n), \ - .cache = PM_FLASH_DISK_CACHE_VARIABLE(n), \ - .cache_size = sizeof(PM_FLASH_DISK_CACHE_VARIABLE(n)), \ - .size = FIXED_PARTITION_SIZE(n), \ - .sector_size = PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size), \ -}, - -/* The bellow used PM_FOREACH_TYPE_disk is generated by Partition Manager foreach - * loop macro. The lower case _disk is type name for which the macro has been generated; - * partition entry can have multiple types set and foreach macro will be generated - * for every type found across partition definitions. - */ -static struct flashdisk_data flash_disks[] = { - PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE) -}; - -#define VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY(n) \ - COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), \ - (/* cache-size is not used for read-only disks */), \ - (BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) != 0, \ - "Flash disk partition " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n))\ - " must have non-zero cache-size");)) -PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) - -#define VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE(n) \ - BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) % \ - PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size) == 0, \ - "Devicetree node " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n)) \ - " has cache size which is not a multiple of its sector size"); -PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) -#endif /* USE_PARTITION_MANAGER */ static int disk_flash_init(void) { From d5bd5942a82e9db506f8fba6753b403a7a0dc613 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 286/881] Revert "[nrf noup] modules: mbedtls: Add include folders" This reverts commit a3505ca86f9f4bb9a1d33116259bb2d7e08196db. Signed-off-by: Jukka Rissanen --- modules/mbedtls/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index 8801e1ecdf1..61c7400017d 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -40,8 +40,6 @@ zephyr_interface_library_named(mbedTLS) # Add regular includes target_include_directories(mbedTLS INTERFACE ${ZEPHYR_CURRENT_MODULE_DIR}/include - ${ZEPHYR_CURRENT_MODULE_DIR}/include/library - ${ZEPHYR_CURRENT_MODULE_DIR}/library configs include ) From fad280192ea172d19bb1c0c4699794a4ea63e317 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 287/881] Revert "[nrf noup] modules: mbedtls: Allow MBEDTLS_BUILTIN to be deselected" This reverts commit 0556e7f7d3e2e046bb334ef2133c071179caf189. Signed-off-by: Jukka Rissanen --- modules/mbedtls/Kconfig | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index f7bc6a609f1..bf165473f17 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -29,7 +29,6 @@ choice MBEDTLS_IMPLEMENTATION config MBEDTLS_BUILTIN bool "Use Zephyr in-tree mbedTLS version" - depends on ! DISABLE_MBEDTLS_BUILTIN help Link with mbedTLS sources included with Zephyr distribution. Included mbedTLS version is well integrated with and supported @@ -43,11 +42,6 @@ config MBEDTLS_LIBRARY endchoice -# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select -# DISABLE_MBEDTLS_BUILTIN. -config DISABLE_MBEDTLS_BUILTIN - bool - config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" help From 611d8160c7976e1c3474fd7081fb6c7834e560c2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:11 +0300 Subject: [PATCH 288/881] Revert "[nrf noup] modules: tf-m: use of PSA_HAS_XXXX_SUPPORT" This reverts commit 5620a796e91d9e65c6a02d7585ca8909eb674c77. Signed-off-by: Jukka Rissanen --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 02d3580c22f..1d70a2c44d2 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -10,7 +10,6 @@ if TFM_PARTITION_CRYPTO config TFM_CRYPTO_RNG_MODULE_ENABLED bool "Random number generator crypto module" default y - depends on PSA_WANT_GENERATE_RANDOM && NRF_SECURITY help Enables the random number generator module within the crypto partition. Unset this option if 'psa_generate_random' is not used. @@ -18,7 +17,6 @@ config TFM_CRYPTO_RNG_MODULE_ENABLED config TFM_CRYPTO_KEY_MODULE_ENABLED bool "KEY crypto module" default y - depends on PSA_HAS_KEY_SUPPORT && NRF_SECURITY help Enables the KEY crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_management.c' @@ -27,7 +25,6 @@ config TFM_CRYPTO_KEY_MODULE_ENABLED config TFM_CRYPTO_AEAD_MODULE_ENABLED bool "AEAD crypto module" default y - depends on PSA_HAS_AEAD_SUPPORT && NRF_SECURITY help Enables the AEAD crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_aead.c' @@ -36,7 +33,6 @@ config TFM_CRYPTO_AEAD_MODULE_ENABLED config TFM_CRYPTO_MAC_MODULE_ENABLED bool "MAC crypto module" default y - depends on PSA_HAS_MAC_SUPPORT && NRF_SECURITY help Enables the MAC crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_mac.c' @@ -45,7 +41,6 @@ config TFM_CRYPTO_MAC_MODULE_ENABLED config TFM_CRYPTO_HASH_MODULE_ENABLED bool "HASH crypto module" default y - depends on PSA_HAS_HASH_SUPPORT && NRF_SECURITY help Enables the HASH crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_hash.c' @@ -54,7 +49,6 @@ config TFM_CRYPTO_HASH_MODULE_ENABLED config TFM_CRYPTO_CIPHER_MODULE_ENABLED bool "CIPHER crypto module" default y - depends on PSA_HAS_CIPHER_SUPPORT && NRF_SECURITY help Enables the CIPHER crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_cipher.c' @@ -63,7 +57,6 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED bool "ASYM ENCRYPT crypto module" default y - depends on PSA_HAS_ASYM_ENCRYPT_SUPPORT && NRF_SECURITY help Enables the ASYM ENCRYPT crypto module within the crypto partition. Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' @@ -72,7 +65,6 @@ config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED bool "ASYM SIGN crypto module" default y - depends on PSA_HAS_ASYM_SIGN_SUPPORT && NRF_SECURITY help Enables the ASYM SIGN crypto module within the crypto partition. Unset this option if the sign functionality provided by 'crypto_asymmetric.c' @@ -81,12 +73,10 @@ config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED bool "KEY DERIVATION crypto module" default y - depends on (PSA_HAS_KEY_DERIVATION || PSA_HAS_KEY_AGREEMENT) && NRF_SECURITY help Enables the KEY_DERIVATION crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_derivation.c' is not used. - Note that key agreement is under key derivation in the current implementation. endif # TFM_PARTITION_CRYPTO From 7454fcf915a8c3a8b8f2547d9ff023b223ea1da5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 289/881] Revert "[nrf noup] doc: remove Kconfig search" This reverts commit 68cba0c8e64da160f49c2296ef956fe1512369d9. Signed-off-by: Jukka Rissanen --- MAINTAINERS.yml | 1 + doc/build/kconfig/setting.rst | 6 ++++-- doc/develop/application/index.rst | 5 +++-- doc/kconfig.rst | 8 ++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 doc/kconfig.rst diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 77296a734a6..3e7c3048b53 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1041,6 +1041,7 @@ Documentation: - doc/images/Zephyr-Kite-in-tree.png - doc/index-tex.rst - doc/index.rst + - doc/kconfig.rst - doc/templates/sample.tmpl - doc/templates/board.tmpl - boards/index.rst diff --git a/doc/build/kconfig/setting.rst b/doc/build/kconfig/setting.rst index 6fe1feaed7d..ad62d86eb3d 100644 --- a/doc/build/kconfig/setting.rst +++ b/doc/build/kconfig/setting.rst @@ -7,7 +7,8 @@ The :ref:`menuconfig and guiconfig interfaces ` can be used to test out configurations during application development. This page explains how to make settings permanent. -All Kconfig options can be searched in the Kconfig search page. +All Kconfig options can be searched in the :ref:`Kconfig search page +`. .. note:: @@ -114,7 +115,8 @@ Assignments in configuration files are only respected if the dependencies for the symbol are satisfied. A warning is printed otherwise. To figure out what the dependencies of a symbol are, use one of the :ref:`interactive configuration interfaces ` (you can jump directly to a symbol with -:kbd:`/`), or look up the symbol in the Kconfig search page. +:kbd:`/`), or look up the symbol in the :ref:`Kconfig search page +`. .. _initial-conf: diff --git a/doc/develop/application/index.rst b/doc/develop/application/index.rst index 42d53040bd2..7dc4539677e 100644 --- a/doc/develop/application/index.rst +++ b/doc/develop/application/index.rst @@ -648,8 +648,9 @@ started. See :ref:`setting_configuration_values` for detailed documentation on setting Kconfig configuration values. The :ref:`initial-conf` section on the same page -explains how the initial configuration is derived. See :ref:`hardening` for -security information related with Kconfig options. +explains how the initial configuration is derived. See :ref:`kconfig-search` +for a complete list of configuration options. +See :ref:`hardening` for security information related with Kconfig options. The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration diff --git a/doc/kconfig.rst b/doc/kconfig.rst new file mode 100644 index 00000000000..1123de2adbd --- /dev/null +++ b/doc/kconfig.rst @@ -0,0 +1,8 @@ +:orphan: + +.. _kconfig-search: + +Kconfig Search +============== + +.. kconfig:search:: From 6628874cb2917321a4158ba850c9dcbfebaa6283 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 290/881] Revert "[nrf noup] Revert "twister: Use natural sort when generating hardware map"" This reverts commit 0250cd1c9fb33c0d9b5da883b24bdfdb7df522c2. Signed-off-by: Jukka Rissanen --- scripts/pylib/twister/twisterlib/hardwaremap.py | 2 +- scripts/requirements-run-test.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 5c0c5eb1238..d3308b8cbe3 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -386,7 +386,7 @@ def save(self, hwm_file): boot_ids = [] # use existing map - self.detected.sort(key=lambda x: x.serial or '') + self.detected = natsorted(self.detected, key=lambda x: x.serial or '') if os.path.exists(hwm_file): with open(hwm_file) as yaml_file: hwm = yaml.load(yaml_file, Loader=SafeLoader) diff --git a/scripts/requirements-run-test.txt b/scripts/requirements-run-test.txt index 08ff89b0c54..d3a4be91673 100644 --- a/scripts/requirements-run-test.txt +++ b/scripts/requirements-run-test.txt @@ -7,6 +7,7 @@ pyocd>=0.35.0 # used by twister for board/hardware map tabulate +natsort # used by mcuboot cbor>=1.0.0 From ba16befd81a19c31e0f98ce2dac20a94e4a3a9c7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 291/881] Revert "[nrf noup] tests: drivers: build_all: regulator: use old schema" This reverts commit e6f28400604c1307aa5768438749b9686e891947. Signed-off-by: Jukka Rissanen --- tests/drivers/build_all/regulator/testcase.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/drivers/build_all/regulator/testcase.yaml b/tests/drivers/build_all/regulator/testcase.yaml index b662f0ac205..30d494aca23 100644 --- a/tests/drivers/build_all/regulator/testcase.yaml +++ b/tests/drivers/build_all/regulator/testcase.yaml @@ -3,7 +3,9 @@ tests: drivers.regulator.build: - tags: drivers regulator + tags: + - drivers + - regulator build_only: true platform_allow: - native_sim From 159280affb65a24e43248dc9f2c07c1b2441da36 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 292/881] Revert "[nrf noup] ci: add .github/test-spec.yml" This reverts commit fc65d19b1f987439ab158c74e32f2085060baf09. Signed-off-by: Jukka Rissanen --- .github/test-spec.yml | 392 ------------------------------------------ 1 file changed, 392 deletions(-) delete mode 100644 .github/test-spec.yml diff --git a/.github/test-spec.yml b/.github/test-spec.yml deleted file mode 100644 index 6da6bdbaa87..00000000000 --- a/.github/test-spec.yml +++ /dev/null @@ -1,392 +0,0 @@ -# This is the Jenkins ci variant of the .github/labler.yaml - -"CI-run-zephyr-twister": - - any: - - "!.github/**/*" - - "!doc/**/*" - - "!CODEOWNERS" - - "!LICENSE" - - "!**/*.rst" - - "!VERSION" - - "!submanifests/**/*" - - "!MAINTAINERS.yml" - - "!version.h.in" - - "!Jenkinsfile" - - "!**/*.md" - -"CI-iot-zephyr-lwm2m-test": - - "drivers/console/**/*" - - "drivers/flash/**/*" - - "subsys/dfu/boot/**/*" - - "subsys/net/ip/**/*" - - "subsys/net/lib/http/**/*" - - "subsys/net/lib/lwm2m//**/*" - - "subsys/net/**/*" - -"CI-iot-samples-test": - - "boards/nordic/nrf9160dk/**/*" - - "dts/arm/nordic/nrf9160*" - - "include/net/**/*" - - "subsys/net/lib/**/*" - -"CI-iot-libraries-test": - - "boards/nordic/nrf9160dk/**/*" - - "dts/arm/nordic/nrf9160*" - - "include/net/socket_ncs.h" - - "subsys/testsuite/ztest/**/*" - -"CI-lwm2m-test": null -# Not necessary to run tests on changes to this repo. - -"CI-boot-test": - - "subsys/mgmt/mcumgr/**/*" - - "subsys/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "include/dfu/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "tests/boot/**/*" - - "tests/subsys/dfu/**/*" - - "tests/subsys/mgmt/mcumgr/**/*" - -"CI-tfm-test": - - "boards/nordic/nrf5340dk/**/*" - - "boards/nordic/nrf9160dk/**/*" - - "drivers/entropy/*" - - "dts/arm/nordic/nrf5340*" - - "dts/arm/nordic/nrf9160*" - - "modules/trusted-firmware-m/**/*" - - "samples/tfm_integration/**/*" - -"CI-ble-test": - - any: - - "drivers/bluetooth/**/*" - - any: - - "dts/arm/nordic/nrf5*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - - any: - - "include/zephyr/bluetooth/**/*" - - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/hci_ipc/**/*" - -"CI-ble-samples-test": - - any: - - "drivers/bluetooth/**/*" - - any: - - "dts/arm/nordic/nrf5*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - - any: - - "include/zephyr/bluetooth/**/*" - - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/**/*" - -"CI-mesh-test": - - "subsys/bluetooth/mesh/**/*" - - "include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/mesh/**/*" - - "samples/bluetooth/mesh_demo/**/*" - - "samples/bluetooth/mesh_provisioner/**/*" - - "tests/bluetooth/mesh/**/*" - - "tests/bluetooth/mesh_shell/**/*" - -"CI-thingy91-test": - - "boards/nordic/nrf9160dk/**/*" - - "arch/x86/core/**/*" - - "arch/x86/include/**/*" - - "drivers/console/**/*" - - "drivers/ethernet/**/*" - - "drivers/flash/**/*" - - "drivers/hwinfo/**/*" - - "drivers/interrupt_controller/**/*" - - "drivers/net/**/*" - - "drivers/serial/**/*" - - "drivers/timer/**/*" - - "include/**/*" - - "kernel/**/*" - - "lib/libc/common/source/stdlib/**/*" - - "lib/libc/newlib/**/*" - - "lib/libc/picolibc/**/*" - - "lib/os/**/*" - - "lib/posix/**/*" - - "misc/**/*" - - "modules/mbedtls/**/*" - - "soc/x86/ia32/**/*" - - "subsys/fs/fcb/**/*" - - "subsys/logging/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/include/**/*" - - "subsys/settings/src/**/*" - - "subsys/stats/**/*" - - "subsys/storage/flash_map/**/*" - - "subsys/storage/stream/**/*" - - "subsys/tracing/**/*" - -"CI-desktop-test": - - "drivers/bluetooth/*" - - "subsys/bluetooth/*" - - "include/zephyr/bluetooth/*" - -"CI-crypto-test": - - "boards/nordic/nrf52840dk/**/*" - - "boards/nordic/nrf5340dk/**/*" - - "boards/nordic/nrf9160dk/**/*" - - "drivers/entropy/*" - - "drivers/serial/**/*" - - "dts/arm/nordic/nrf52840*" - - "dts/arm/nordic/nrf5340*" - - "dts/arm/nordic/nrf9160*" - - "include/drivers/serial/**/*" - - "modules/mbedtls/**/*" - -"CI-fem-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "dts/bindings/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/arch/**/*" - - "lib/libc/**/*" - - "lib/open-amp/**/*" - - "modules/hal_nordic/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "modules/trusted-firmware-m/**/*" - - "samples/net/sockets/echo_*/**/*" - - "share/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - - "subsys/bluetooth/shell/**/*" - - "subsys/ipc/**/*" - - "Kconfig" - - "CMakeLists.txt" - -"CI-rs-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "dts/bindings/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/arch/**/*" - - "lib/libc/**/*" - - "lib/open-amp/**/*" - - "modules/hal_nordic/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "modules/trusted-firmware-m/**/*" - - "samples/net/sockets/echo_*/**/*" - - "share/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - - "subsys/bluetooth/shell/**/*" - - "subsys/ipc/**/*" - - "Kconfig" - - "CMakeLists.txt" - -"CI-thread-test": - - "include/zephyr/net/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "samples/net/openthread/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-nfc-test": - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "drivers/flash/**/*" - - "drivers/mbox/**/*" - - "drivers/spi/**/*" - - "lib/crc/**/*" - - "modules/hal_nordic/**/*" - - "soc/nordic/**/*" - - "subsys/ipc/ipc_service/**/*" - - "subsys/fs/**/*" - - "subsys/mem_mgmt/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/**/*" - - "subsys/shell/**/*" - - "subsys/storage/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - -"CI-matter-test": - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/settings/**/*" - - "subsys/net/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "drivers/net/**/*" - - "samples/bluetooth/hci_ipc/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - -"CI-find-my-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/**/*" - - "drivers/entropy/**/*" - - "drivers/flash/**/*" - - "drivers/usb/**/*" - - "drivers/regulator/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/fs/**/*" - - "subsys/ipc/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/**/*" - - "subsys/storage/**/*" - - "subsys/tracing/**/*" - - "subsys/usb/device/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - -"CI-rpc-test": - - "subsys/ipc/ipc_service/**/*" - - "subsys/random/**/*" - - "soc/nordic/nrf53/**/*" - -"CI-modemshell-test": - - "include/net/**/*" - - "include/posix/**/*" - - "include/shell/**/*" - - "drivers/net/**/*" - - "drivers/serial/**/*" - - "drivers/wifi/**/*" - - "subsys/shell/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-positioning-test": - - "include/net/**/*" - - "include/posix/**/*" - - "drivers/net/**/*" - - "drivers/wifi/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-cloud-test": - - "include/zephyr/dfu/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/posix/**/*" - - "include/zephyr/settings/**/*" - - "drivers/led/**/*" - - "drivers/net/**/*" - - "drivers/sensor/**/*" - - "drivers/serial/**/*" - - "drivers/wifi/**/*" - - "lib/posix/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-wifi": - - "subsys/net/l2/wifi/**/*" - - "subsys/net/l2/ethernet/**/*" - -"CI-audio-test": - - "boards/nordic/nrf5340_audio_dk/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/gpio/**/*" - - "drivers/i2c/**/*" - - "drivers/watchdog/**/*" - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/bluetooth/hci_ipc/**/*" - - "soc/nordic/**/*" - - "subsys/bluetooth/audio/**/*" - - "subsys/bluetooth/host/**/*" - - "subsys/dfu/**/*" - - "subsys/fs/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "subsys/sd/**/*" - - "subsys/storage/**/*" - - "subsys/task_wdt/**/*" - - "subsys/usb/**/*" - - "subsys/zbus/**/*" - -"CI-pmic-samples-test": - - "samples/shields/npm1300_ek/**/*" - - "boards/shields/npm1300_ek/**/*" - - "**/**npm1300**/**" - - "drivers/regulator/regulator_common.c" - - "drivers/regulator/regulator_shell.c" - - "drivers/gpio/gpio_shell.c" - - "drivers/sensor/sensor_shell.c" - -"CI-test-low-level": - - "arch/**/*" - - "boards/nordic/nrf54*/**/*" - - "drivers/**/*" - - "dts/**/*" - - "include/zephyr/**/*" - - "kernel/**/*" - - "modules/hal_nordic/**/*" - - "samples/basic/blinky_pwm/**/*" - - "samples/basic/fade_led/**/*" - - "samples/boards/nrf/**/*" - - "samples/boards/nordic/**/*" - - "samples/drivers/adc/**/*" - - "samples/drivers/jesd216/**/*" - - "samples/drivers/mbox/**/*" - - "samples/drivers/soc_flash_nrf/**/*" - - "samples/drivers/spi_flash/**/*" - - "samples/drivers/watchdog/**/*" - - "samples/hello_world/**/*" - - "samples/sensor/**/*" - - "samples/subsys/ipc/**/*" - - "samples/subsys/logging/**/*" - - "samples/subsys/settings/**/*" - - "samples/subsys/usb/cdc_acm/**/*" - - "samples/subsys/usb/mass/**/*" - - "samples/synchronization/**/*" - - "subsys/logging/**/*" - - "subsys/settings/**/*" - - "tests/arch/**/*" - - "tests/boards/nrf/**/*" - - "tests/boards/nordic/**/*" - - "tests/drivers/**/*" - - "tests/kernel/**/*" - -"CI-suit-dfu-test": - - "subsys/mgmt/mcumgr/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "subsys/bluetooth/**/*" - - "drivers/bluetooth/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/console/**/*" - - "drivers/gpio/**/*" - - "dts/common/nordic/*" - - "dts/arm/nordic/nrf54h*/**/*" - - "dts/riscv/nordic/nrf54h*/**/*" - - "boards/nordic/nrf54h*/**/*" - - "soc/nordic/nrf54h/**/*" - - "include/zephyr/**/*" - - "subsys/logging/**/*" - - "subsys/tracing/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/nrfutil.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" From 96ff83cc51eb3f51f0dfe4476446afb4272a7eb7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 293/881] Revert "[nrf noup] ci: scripts: add quarantine file" This reverts commit 88c7330e9305bcb19c46cb7f4d03db556753bab1. Signed-off-by: Jukka Rissanen --- scripts/quarantine.yaml | 88 ----------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 scripts/quarantine.yaml diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml deleted file mode 100644 index 20c4f9248ea..00000000000 --- a/scripts/quarantine.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# The configurations resulting as a product of scenarios and platforms -# will be skipped if quarantine is used. More details here: -# https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine - -- scenarios: - - testing.ztest.busy_sim - - testing.ztest.busy_sim_nrf52840dk_pin - platforms: - - nrf52840dk_nrf52840 - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.unary_f64 - platforms: - - nrf5340dk_nrf5340_cpunet - - qemu_cortex_m3 - comment: "Flash overflows" - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.binary_f16 - - libraries.cmsis_dsp.matrix.binary_f16.fpu - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Flash overflows" - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.binary_q15 - - libraries.cmsis_dsp.matrix.binary_q15.fpu - - libraries.cmsis_dsp.matrix.unary_f32 - - libraries.cmsis_dsp.matrix.unary_f32.fpu - - libraries.cmsis_dsp.matrix.unary_f64 - - libraries.cmsis_dsp.matrix.unary_f64.fpu - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Flash overflows" - -# libsdl2-dev package should be added into docker image -- scenarios: - - sample.boards.nrf.nrf_led_matrix - - sample.display.lvgl.gui - platforms: - - native_posix - comment: "libsdl2-dev package not available" - -- scenarios: - - sample.net.sockets.echo_server.usbnet - - sample.net.sockets.echo_server.usbnet_composite - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - sample.net.zperf.netusb_ecm - - sample.net.zperf.netusb_eem - - sample.net.zperf.netusb_rndis - platforms: - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - net.mqtt.tls - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - kernel.common.picolibc - - libraries.picolibc - - libraries.libc.picolibc.mem_alloc - - libraries.picolibc.sprintf_new - platforms: - - nrf52dk_nrf52832 - comment: "Ram overflows, also in the upstream" - -- scenarios: - - sample.psa_crypto - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Due to using sdk-zephyr manifest instead of nrf. Should be fixed after the change" From e6d2fd40325d31e6a9a6780ceaa7a336117e34bd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 294/881] Revert "[nrf noup] ci: set `ZEPHYR__KCONFIG` for NCS modules" This reverts commit 26572f95c09d9c063ad9dda85b6e6368f015ce94. Signed-off-by: Jukka Rissanen --- scripts/ci/check_compliance.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 31bb02c22f8..cd97ea96717 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -458,13 +458,6 @@ def get_modules(self, modules_file, sysbuild_modules_file, settings_file): modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] - nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') - nrf_modules = [] - if os.path.exists(nrf_modules_dir): - nrf_modules = [name for name in os.listdir(nrf_modules_dir) if - os.path.exists(os.path.join(nrf_modules_dir, name, - 'Kconfig'))] - with open(modules_file, 'r') as fp_module_file: content = fp_module_file.read() @@ -474,31 +467,8 @@ def get_modules(self, modules_file, sysbuild_modules_file, settings_file): re.sub('[^a-zA-Z0-9]', '_', module).upper(), modules_dir / module / 'Kconfig' )) - for module in nrf_modules: - fp_module_file.write("ZEPHYR_{}_KCONFIG = {}\n".format( - re.sub('[^a-zA-Z0-9]', '_', module).upper(), - nrf_modules_dir / module / 'Kconfig' - )) - fp_module_file.write("NCS_{}_KCONFIG = {}\n".format( - re.sub('[^a-zA-Z0-9]', '_', module).upper(), - modules_dir / module / 'Kconfig' - )) - # Add NRF as static entry as workaround for ext Kconfig root support - fp_module_file.write("ZEPHYR_NRF_KCONFIG = {}\n".format( - nrf_modules_dir / '..' / 'Kconfig.nrf' - )) fp_module_file.write(content) - with open(sysbuild_modules_file, 'r') as fp_sysbuild_module_file: - content = fp_sysbuild_module_file.read() - - with open(sysbuild_modules_file, 'w') as fp_sysbuild_module_file: - # Add NRF as static entry as workaround for ext Kconfig root support - fp_sysbuild_module_file.write("SYSBUILD_NRF_KCONFIG = {}\n".format( - nrf_modules_dir / '..' / 'sysbuild' / 'Kconfig.sysbuild' - )) - fp_sysbuild_module_file.write(content) - def get_kconfig_dts(self, kconfig_dts_file, settings_file): """ Generate the Kconfig.dts using dts/bindings as the source. From fc6de74e0f27a73fbcf85e0a95caf997c33a9fd4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 295/881] Revert "[nrf fromlist] samples: boards: nordic: spis_wakeup: fix boot for h20" This reverts commit 98158522b81f9b0f7926731714063c80dec0eaa5. Signed-off-by: Jukka Rissanen --- .../nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.conf diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index 61643e48fbf..00000000000 --- a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y From 4d842f696250ccbbefc78e82c1a0716fae48dbfd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 296/881] Revert "[nrf fromlist] drivers: nrf_wifi: Fix the interoperability issues" This reverts commit 91510521ffd06a8fadad9c73db8cf13e555f3cff. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 4b3bb0d41ca..af3e7827dcb 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -840,7 +840,7 @@ if NRF_WIFI_FEAT_KEEPALIVE config NRF_WIFI_KEEPALIVE_PERIOD_S int "Keepalive period in seconds" range 30 3600 - default 30 + default 60 help Keepalive period in seconds to send keepalive packets to the AP. endif From 18cd4b13233ba744e316d63eebb7a7e93462039c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 297/881] Revert "[nrf fromtree] manifest: hostap: Pull feature to add driver processing delay to capa" This reverts commit 47f186c0e50d052ccafb9b9b70caba717b5280c2. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 41fa45c8693..c4c3f8ceda5 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: c55683ce514953277be5566fceb38c4c2485f1e1 + revision: 7fda615fcccd577af7339b4198400c39ac14f8f8 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From ae547b0d2b090c138faac9566d4f5ad6327eee2d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 298/881] Revert "[nrf fromtree] manifest: hostap: Pull support to dump keys" This reverts commit 9d2a54e5529f39fb05228bbeaa6e937d30eddc3c. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index c4c3f8ceda5..94e1638cb45 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 7fda615fcccd577af7339b4198400c39ac14f8f8 + revision: e942f86e865d5b24bbbe8b0c333f030cbbe62bfb - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 74424a921e5361f26b4688bb85b6eb72904a1af6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 299/881] Revert "[nrf fromtree] drivers: nrf_wifi: Fix the issue of delayed keepalive" This reverts commit 8d67a0f289f02ed16ef4644fb6f7df4562ce8aa5. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 34af00e6d38..22aa0416550 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1805,11 +1805,6 @@ int nrf_wifi_supp_get_capa(void *if_priv, struct wpa_driver_capa *capa) capa->extended_capa_mask = rpu_ctx_zep->extended_capa_mask; capa->extended_capa_len = rpu_ctx_zep->extended_capa_len; } - /* Based on testing, this works to fix the disconnection due to delayed - * keepalive to the AP - */ - capa->driver_tx_processing_delay_ms = 1000; - out: k_mutex_unlock(&vif_ctx_zep->vif_lock); return status; From 957ab7b2096a7d49a4cfd58083ed5848fb427fa0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 300/881] Revert "[nrf fromlist] mgmt: mcumgr: grp: img_mgmt: Show firmware loader slot info" This reverts commit b924e1adc5fa06b1e53e0f1088795a1a4529a271. Signed-off-by: Jukka Rissanen --- .../mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 50 +------------------ .../mcumgr/grp/img_mgmt/src/zephyr_img_mgmt.c | 2 +- 2 files changed, 3 insertions(+), 49 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index 384d0613739..5333d651c9f 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -58,11 +58,6 @@ LOG_MODULE_DECLARE(mcumgr_img_grp, CONFIG_MCUMGR_GRP_IMG_LOG_LEVEL); #define DIRECT_XIP_BOOT_FOREVER 3 #endif -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) && \ - CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER > 1 -#warning "MCUmgr img mgmt only supports 1 image" -#endif - /** * Collects information about the specified image slot. */ @@ -201,6 +196,7 @@ int img_mgmt_get_next_boot_slot(int image, enum img_mgmt_next_boot_type *type) #else #if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) + static int read_directxip_state(int slot) { struct boot_swap_state bss; @@ -233,8 +229,6 @@ static int read_directxip_state(int slot) } #endif /* defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) */ -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) || \ - defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) int img_mgmt_get_next_boot_slot(int image, enum img_mgmt_next_boot_type *type) { struct image_version aver; @@ -307,14 +301,12 @@ int img_mgmt_get_next_boot_slot(int image, enum img_mgmt_next_boot_type *type) return return_slot; } -#endif /* defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) || \ - * defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) - */ #endif /* !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) && \ * !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) && \ * !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) */ + /** * Indicates whether any image slot is pending (i.e., whether a test swap will * happen on the next reboot. @@ -502,7 +494,6 @@ static bool img_mgmt_state_encode_slot(struct smp_streamer *ctxt, uint32_t slot, /** * Command handler: image state read */ -#if !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) int img_mgmt_state_read(struct smp_streamer *ctxt) { @@ -560,43 +551,6 @@ img_mgmt_state_read(struct smp_streamer *ctxt) return ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE; } -#else -int -img_mgmt_state_read(struct smp_streamer *ctxt) -{ - zcbor_state_t *zse = ctxt->writer->zs; - uint32_t i; - bool ok; - - ok = zcbor_tstr_put_lit(zse, "images") && - zcbor_list_start_encode(zse, 2); - - img_mgmt_take_lock(); - - for (i = 0; ok && i < CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER; i++) { - /* _a is active slot, _o is opposite slot */ - int slot_a = img_mgmt_active_slot(i); - int slot_o = img_mgmt_get_opposite_slot(slot_a); - int flags_a = REPORT_SLOT_ACTIVE; - int flags_o = REPORT_SLOT_CONFIRMED; - - ok = img_mgmt_state_encode_slot(ctxt, slot_o, flags_o) && - img_mgmt_state_encode_slot(ctxt, slot_a, flags_a); - } - - /* Ending list encoding for two slots per image */ - ok = ok && zcbor_list_end_encode(zse, 2); - /* splitStatus is always 0 so in frugal list it is not present at all */ - if (!IS_ENABLED(CONFIG_MCUMGR_GRP_IMG_FRUGAL_LIST) && ok) { - ok = zcbor_tstr_put_lit(zse, "splitStatus") && - zcbor_int32_put(zse, 0); - } - - img_mgmt_release_lock(); - - return ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE; -} -#endif /* !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) */ static int img_mgmt_set_next_boot_slot_common(int slot, int active_slot, bool confirm) { diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/zephyr_img_mgmt.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/zephyr_img_mgmt.c index d4972b573cc..b43b250ad16 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/zephyr_img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/zephyr_img_mgmt.c @@ -140,11 +140,11 @@ img_mgmt_flash_area_id(int slot) fa_id = FIXED_PARTITION_ID(SLOT0_PARTITION); break; +#if !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) case 1: fa_id = FIXED_PARTITION_ID(SLOT1_PARTITION); break; -#if !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) #if FIXED_PARTITION_EXISTS(SLOT2_PARTITION) case 2: fa_id = FIXED_PARTITION_ID(SLOT2_PARTITION); From e807141271def0a03be7c17db6a9f1cab75c45f1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 301/881] Revert "[nrf fromtree] tests: fs: littlefs: Fix nRF54L15-based dtc overlay files" This reverts commit a1604e234eceb23779c387d5907294e4457b76e0. Signed-off-by: Jukka Rissanen --- .../fs/littlefs/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay | 6 ++++-- .../fs/littlefs/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay | 6 ++++-- .../fs/littlefs/boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 6 ++++-- .../fs/littlefs/boards/ophelia4ev_nrf54l15_cpuapp.overlay | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/subsys/fs/littlefs/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/subsys/fs/littlefs/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay index f0cf923b4e7..31e324265bc 100644 --- a/tests/subsys/fs/littlefs/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ b/tests/subsys/fs/littlefs/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -5,7 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +/delete-node/ &slot0_ns_partition; /delete-node/ &slot1_partition; +/delete-node/ &slot1_ns_partition; &cpuapp_rram { partitions { @@ -13,9 +15,9 @@ #address-cells = <1>; #size-cells = <1>; - small_partition: partition@b6000 { + small_partition: partition@67000 { label = "small"; - reg = <0x000b6000 0x00010000>; + reg = <0x00067000 0x00010000>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/subsys/fs/littlefs/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay index f0cf923b4e7..31e324265bc 100644 --- a/tests/subsys/fs/littlefs/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ b/tests/subsys/fs/littlefs/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -5,7 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +/delete-node/ &slot0_ns_partition; /delete-node/ &slot1_partition; +/delete-node/ &slot1_ns_partition; &cpuapp_rram { partitions { @@ -13,9 +15,9 @@ #address-cells = <1>; #size-cells = <1>; - small_partition: partition@b6000 { + small_partition: partition@67000 { label = "small"; - reg = <0x000b6000 0x00010000>; + reg = <0x00067000 0x00010000>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/subsys/fs/littlefs/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index d7b166fa1e0..292e98c96a0 100644 --- a/tests/subsys/fs/littlefs/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/subsys/fs/littlefs/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,7 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +/delete-node/ &slot0_ns_partition; /delete-node/ &slot1_partition; +/delete-node/ &slot1_ns_partition; &cpuapp_rram { partitions { @@ -12,9 +14,9 @@ #address-cells = <1>; #size-cells = <1>; - small_partition: partition@b6000 { + small_partition: partition@67000 { label = "small"; - reg = <0x000b6000 0x00010000>; + reg = <0x00067000 0x00010000>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/ophelia4ev_nrf54l15_cpuapp.overlay b/tests/subsys/fs/littlefs/boards/ophelia4ev_nrf54l15_cpuapp.overlay index 807d42c43da..64bfe273c9d 100644 --- a/tests/subsys/fs/littlefs/boards/ophelia4ev_nrf54l15_cpuapp.overlay +++ b/tests/subsys/fs/littlefs/boards/ophelia4ev_nrf54l15_cpuapp.overlay @@ -4,7 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +/delete-node/ &slot0_ns_partition; /delete-node/ &slot1_partition; +/delete-node/ &slot1_ns_partition; &cpuapp_rram { partitions { @@ -12,9 +14,9 @@ #address-cells = <1>; #size-cells = <1>; - small_partition: partition@b6000 { + small_partition: partition@67000 { label = "small"; - reg = <0x000b6000 0x00010000>; + reg = <0x00067000 0x00010000>; }; }; }; From 1d285490af6cbc497d3a7a6679f27f158f745acd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 302/881] Revert "[nrf fromlist] soc: nordic: nrf54h: Add DT_NODE_EXISTS check" This reverts commit 1b785f57b67170f8c163fa617783a91013ce9b1f. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index a3f67711e45..a20815b2227 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -216,7 +216,7 @@ void soc_late_init_hook(void) DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + CONFIG_ROM_START_OFFSET); } -#elif DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot0_partition)) +#else radiocore_address = (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) + DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + From 7d35192375922099049d59acdbccf780081acba4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 303/881] Revert "[nrf fromtree] Bluetooth: Decode Bluetooth 6.1 version number" This reverts commit c61e3f3ce2b475d212dfe16f88fa5f1eea11a460. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/hci_types.h | 1 - subsys/bluetooth/host/hci_core.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index 0b2c1b1a397..2123556b455 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -858,7 +858,6 @@ struct bt_hci_rp_configure_data_path { #define BT_HCI_VERSION_5_3 12 #define BT_HCI_VERSION_5_4 13 #define BT_HCI_VERSION_6_0 14 -#define BT_HCI_VERSION_6_1 15 #define BT_HCI_OP_READ_LOCAL_VERSION_INFO BT_OP(BT_OGF_INFO, 0x0001) /* 0x1001 */ struct bt_hci_rp_read_local_version_info { diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 7263bc39ed4..3a866c6346d 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3843,7 +3843,7 @@ const char *bt_hci_get_ver_str(uint8_t core_version) { const char * const str[] = { "1.0b", "1.1", "1.2", "2.0", "2.1", "3.0", "4.0", "4.1", "4.2", - "5.0", "5.1", "5.2", "5.3", "5.4", "6.0", "6.1" + "5.0", "5.1", "5.2", "5.3", "5.4", "6.0" }; if (core_version < ARRAY_SIZE(str)) { From 78ec40df16e0f5ac78c7208d80347e5c24f4e651 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:12 +0300 Subject: [PATCH 304/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Make transfer timeout configurable" This reverts commit 7f2380fed7aafab23b4c64e20aa96dfeb77d77ba. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor.c | 3 +-- drivers/flash/flash_mspi_nor.h | 1 - dts/bindings/mtd/jedec,mspi-nor.yaml | 8 -------- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index ae22202e075..b7ca6341d3a 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -27,7 +27,7 @@ void flash_mspi_command_set(const struct device *dev, const struct flash_mspi_no dev_data->xfer.xfer_mode = MSPI_PIO; dev_data->xfer.packets = &dev_data->packet; dev_data->xfer.num_packet = 1; - dev_data->xfer.timeout = dev_config->transfer_timeout; + dev_data->xfer.timeout = 10; dev_data->xfer.cmd_length = cmd->cmd_length; dev_data->xfer.addr_length = cmd->addr_length; @@ -887,7 +887,6 @@ BUILD_ASSERT((FLASH_SIZE_INST(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == / 1000, \ .reset_recovery_us = DT_INST_PROP_OR(inst, t_reset_recovery, 0) \ / 1000,)) \ - .transfer_timeout = DT_INST_PROP(inst, transfer_timeout), \ FLASH_PAGE_LAYOUT_DEFINE(inst) \ .jedec_id = DT_INST_PROP(inst, jedec_id), \ .jedec_cmds = FLASH_CMDS(inst), \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index ad957f24bc7..35a0bff4c21 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -35,7 +35,6 @@ struct flash_mspi_nor_config { uint32_t reset_pulse_us; uint32_t reset_recovery_us; #endif - uint32_t transfer_timeout; #if defined(CONFIG_FLASH_PAGE_LAYOUT) struct flash_pages_layout layout; #endif diff --git a/dts/bindings/mtd/jedec,mspi-nor.yaml b/dts/bindings/mtd/jedec,mspi-nor.yaml index 09660b84159..5bad8f54b5d 100644 --- a/dts/bindings/mtd/jedec,mspi-nor.yaml +++ b/dts/bindings/mtd/jedec,mspi-nor.yaml @@ -22,11 +22,3 @@ properties: type: int description: | Minimum time, in nanoseconds, the flash chip needs to recover after reset. - - transfer-timeout: - type: int - default: 10 - description: | - Maximum time, in milliseconds, allowed for a single transfer on the MSPI - bus in communication with the flash chip. The default value is the one - that was previously hard-coded in the flash_mspi_nor driver. From 76f877ff05c60362ac9996276b10801b7d63542b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 305/881] Revert "[nrf fromlist] soc: nordic: ironside: run clang-format on some files" This reverts commit e125145b9ea8e0945d52b170e3a34f7d87aae0bb. Signed-off-by: Jukka Rissanen --- soc/nordic/ironside/include/nrf_ironside/dvfs.h | 15 ++++++++------- soc/nordic/ironside/include/nrf_ironside/update.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/soc/nordic/ironside/include/nrf_ironside/dvfs.h b/soc/nordic/ironside/include/nrf_ironside/dvfs.h index f48c8a6344a..e2cb03c249e 100644 --- a/soc/nordic/ironside/include/nrf_ironside/dvfs.h +++ b/soc/nordic/ironside/include/nrf_ironside/dvfs.h @@ -31,19 +31,19 @@ enum ironside_dvfs_oppoint { */ /** The requested DVFS oppoint is not allowed. */ -#define IRONSIDE_DVFS_ERROR_WRONG_OPPOINT (1) +#define IRONSIDE_DVFS_ERROR_WRONG_OPPOINT (1) /** Waiting for mutex lock timed out, or hardware is busy. */ -#define IRONSIDE_DVFS_ERROR_BUSY (2) +#define IRONSIDE_DVFS_ERROR_BUSY (2) /** There is configuration error in the DVFS service. */ -#define IRONSIDE_DVFS_ERROR_OPPOINT_DATA (3) +#define IRONSIDE_DVFS_ERROR_OPPOINT_DATA (3) /** The caller does not have permission to change the DVFS oppoint. */ -#define IRONSIDE_DVFS_ERROR_PERMISSION (4) +#define IRONSIDE_DVFS_ERROR_PERMISSION (4) /** The requested DVFS oppoint is already set, no change needed. */ #define IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED (5) /** The operation timed out, possibly due to a hardware issue. */ -#define IRONSIDE_DVFS_ERROR_TIMEOUT (6) +#define IRONSIDE_DVFS_ERROR_TIMEOUT (6) /** The DVFS oppoint change operation is not allowed in the ISR context. */ -#define IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED (7) +#define IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED (7) /** * @} @@ -80,7 +80,8 @@ int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint); */ static inline bool ironside_dvfs_is_oppoint_valid(enum ironside_dvfs_oppoint dvfs_oppoint) { - if (dvfs_oppoint != IRONSIDE_DVFS_OPP_HIGH && dvfs_oppoint != IRONSIDE_DVFS_OPP_MEDLOW && + if (dvfs_oppoint != IRONSIDE_DVFS_OPP_HIGH && + dvfs_oppoint != IRONSIDE_DVFS_OPP_MEDLOW && dvfs_oppoint != IRONSIDE_DVFS_OPP_LOW) { return false; } diff --git a/soc/nordic/ironside/include/nrf_ironside/update.h b/soc/nordic/ironside/include/nrf_ironside/update.h index c0f021a91ed..8152a77f5f7 100644 --- a/soc/nordic/ironside/include/nrf_ironside/update.h +++ b/soc/nordic/ironside/include/nrf_ironside/update.h @@ -40,7 +40,7 @@ /* Index of the update blob pointer within the service buffer. */ #define IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX (0) /* Index of the return code within the service buffer. */ -#define IRONSIDE_UPDATE_SERVICE_RETCODE_IDX (0) +#define IRONSIDE_UPDATE_SERVICE_RETCODE_IDX (0) /** * @brief IronSide update blob. From 2a0d5f608888aca1802545c645a2bf94d938ce51 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 306/881] Revert "[nrf fromlist] boards: nordic: nrf54h20dk: Add ETM to JLinkScript" This reverts commit d45353ccd301fea2fb90e10102b05b4d44167fa6. Signed-off-by: Jukka Rissanen --- .../support/nrf54h20_cpuapp.JLinkScript | 169 ------------------ 1 file changed, 169 deletions(-) diff --git a/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript index 9738ec77f43..b1b96857399 100644 --- a/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript +++ b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript @@ -1,175 +1,6 @@ __constant U32 _CPUCONF_ADDR = 0x52011000; __constant U32 _CPUCONF_CPUWAIT_OFFSET = 0x50C; -// ATBFUNNEL -__constant U32 _ATBFUNNEL211_ADDR = 0xBF04D000; -__constant U32 _ATBFUNNEL212_ADDR = 0xBF04E000; -__constant U32 _ATBFUNNEL_CTRLREG_OFFSET = 0x0; -__constant U32 _HOLDTIME_4 = 0x300; -__constant U32 _ENS0 = 0x1; -__constant U32 _ENS1 = 0x2; -__constant U32 _ENS2 = 0x4; - -// ATBREPLICATOR -__constant U32 _ATBREPLICATOR212_ADDR = 0xBF04A000; -__constant U32 _ATBREPLICATOR213_ADDR = 0xBF04B000; -__constant U32 _ATBREPLICATOR_IDFILTER0_OFFSET = 0x0; -__constant U32 _ATBREPLICATOR_IDFILTER1_OFFSET = 0x4; -__constant U32 _ID_NONE = 0xFFFFFFFF; -__constant U32 _ID1x = 0xFFFFFFFD; - -// TSGEN -__constant U32 _TSGEN_ADDR = 0xBF041000; -__constant U32 _TSGEN_CNTCR_OFFSET = 0x0; -__constant U32 _TSGEN_CNTFID0_OFFSET = 0x20; -// Clock rate = TDD Freq. / 8 -__constant U32 _TS_CLOCKRATE = 40000000; - -// CTI -__constant U32 _CTI210_ADDR = 0xBF046000; -__constant U32 _CTICONTROL_OFFSET = 0x0; -__constant U32 _CTIOUTEN_OFFSET = 0xA0; -__constant U32 _CTIGATE_OFFSET = 0x140; -__constant U32 _TPIU_FLUSH_TRIG = 0x2; - -// TPIU -__constant U32 _TPIU_ADDR = 0xBF043000; -__constant U32 _CURRENTPORTSIZE_OFFSET = 0x4; -__constant U32 _FFCR_OFFSET = 0x304; -__constant U32 _FSCR_OFFSET = 0x308; -__constant U32 _ENFCONT = 0x02; -__constant U32 _FONFLIN = 0x10; -__constant U32 _ENFTC = 0x1; -__constant U32 _TPIU_SYNC_FRAME_COUNT = 0x8; -__constant U32 _CURRENTPORTSIZE_4 = 0x8; - -// TDDCONF -__constant U32 _TDDCONF_ADDR = 0xBF001000; -__constant U32 _TRACEPORTSPEED_OFFSET = 0x408; -__constant U32 _SPEED80MHZ = 0x0; - -// CoreSight general -__constant U32 _CORESIGHT_CLAIMSET_OFFSET = 0xFA0; -__constant U32 _CORESIGHT_CLAIMCLR_OFFSET = 0xFA4; -__constant U32 _CORESIGHT_LAR_OFFSET = 0xFB0; -__constant U32 _CORESIGHT_UNLOCK_KEY = 0xC5ACCE55; - -// GPIO P7 -__constant U32 _P7_ADDR = 0x5F938E00; -__constant U32 _PIN_CNF3_OFFSET = 0x8C; -__constant U32 _PIN_CNF4_OFFSET = 0x90; -__constant U32 _PIN_CNF5_OFFSET = 0x94; -__constant U32 _PIN_CNF6_OFFSET = 0x98; -__constant U32 _PIN_CNF7_OFFSET = 0x9C; -__constant U32 _PIN_CNF_TPIU_CLOCK_VALUE = 0x80000503; -__constant U32 _PIN_CNF_TPIU_DATA_VALUE = 0x00000503; - -// Settings -__constant U32 _DEBUGGER_CLAIM_MASK = 0x2; - -// Used to check if we have already set up tracing -int _needCoresightSetup = 1; - -// Unlock a CoreSight peripheral -void _CSUnlock(U32 addr) -{ - JLINK_MEM_WriteU32(addr + _CORESIGHT_LAR_OFFSET, _CORESIGHT_UNLOCK_KEY); -} - -// Lock a CoreSight peripheral -void _CSLock(U32 addr) -{ - JLINK_MEM_WriteU32(addr + _CORESIGHT_LAR_OFFSET, 0); -} - -// Set claim bits in the CoreSight peripheral to indicate to the firmware that it -// has been configured by the host debugger -void _CSClaim(U32 addr) -{ - JLINK_MEM_WriteU32(addr + _CORESIGHT_CLAIMSET_OFFSET, _DEBUGGER_CLAIM_MASK); -} - -// Set up CoreSight and other necessary configuration so to enable ETM -> TPIU tracing. -int _SetupETMTPIUTrace(void) -{ - // Set up ATB funnels/replicators to route ApplicationDomain ETM to TPIU - _CSUnlock(_ATBFUNNEL212_ADDR); - JLINK_MEM_WriteU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, _HOLDTIME_4 | _ENS0); - _CSClaim(_ATBFUNNEL212_ADDR); - _CSLock(_ATBFUNNEL212_ADDR); - - _CSUnlock(_ATBREPLICATOR212_ADDR); - JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, _ID_NONE); - JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, _ID1x); - _CSLock(_ATBREPLICATOR212_ADDR); - _CSClaim(_ATBREPLICATOR212_ADDR); - _CSLock(_ATBREPLICATOR212_ADDR); - - _CSUnlock(_ATBFUNNEL211_ADDR); - JLINK_MEM_WriteU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, _HOLDTIME_4 | _ENS0); - _CSClaim(_ATBFUNNEL211_ADDR); - _CSLock(_ATBFUNNEL211_ADDR); - - _CSUnlock(_ATBREPLICATOR213_ADDR); - JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, _ID1x); - JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, _ID_NONE); - _CSClaim(_ATBREPLICATOR213_ADDR); - _CSLock(_ATBREPLICATOR213_ADDR); - - // Configure timestamp generator for the correct clock rate - JLINK_MEM_WriteU32(_TSGEN_ADDR + _TSGEN_CNTFID0_OFFSET, _TS_CLOCKRATE); - JLINK_MEM_WriteU32(_TSGEN_ADDR + _TSGEN_CNTCR_OFFSET, 1); - _CSClaim(_TSGEN_ADDR); - - // Configure CTI1 for TPIU formatter flushing - _CSUnlock(_CTI210_ADDR); - JLINK_MEM_WriteU32(_CTI210_ADDR + _CTIOUTEN_OFFSET, _TPIU_FLUSH_TRIG); - JLINK_MEM_WriteU32(_CTI210_ADDR + _CTIGATE_OFFSET, _TPIU_FLUSH_TRIG); - JLINK_MEM_WriteU32(_CTI210_ADDR + _CTICONTROL_OFFSET, 1); - _CSClaim(_CTI210_ADDR); - _CSLock(_CTI210_ADDR); - - // Configure TPIU for port size 4, continuous formatting - _CSUnlock(_TPIU_ADDR); - JLINK_MEM_WriteU32(_TPIU_ADDR + _CURRENTPORTSIZE_OFFSET, _CURRENTPORTSIZE_4); - JLINK_MEM_WriteU32(_TPIU_ADDR + _FFCR_OFFSET, _ENFCONT | _FONFLIN | _ENFTC); - JLINK_MEM_WriteU32(_TPIU_ADDR + _FSCR_OFFSET, _TPIU_SYNC_FRAME_COUNT); - _CSClaim(_TPIU_ADDR); - _CSLock(_TPIU_ADDR); - - // Configure the trace pins - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF3_OFFSET, _PIN_CNF_TPIU_CLOCK_VALUE); - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF4_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF5_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF6_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF7_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); - - return 0; -} - -int ConfigTargetSettings(void) -{ - JLINK_ExecCommand("CORESIGHT_AddAP = Index=0 Type=AHB-AP"); - CORESIGHT_IndexAHBAPToUse = 0; - - // Adjust trace sample delay to compensate for timing when using 320MHz - JLINK_ExecCommand("TraceSampleAdjust TD = 1000"); - - return 0; -} - -int OnTraceStart(void) -{ - // Set up CoreSight if not already configured - if (_needCoresightSetup) { - _SetupETMTPIUTrace(); - _needCoresightSetup = 0; - } - - return 0; -} - - int SetupTarget(void) { JLINK_TARGET_Halt(); From 57cb2615796463c934abc6d0160d6af75f26c00d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 307/881] Revert "[nrf fromlist] soc: nrf54h: Configure CTRLSEL and pin for TRACE" This reverts commit bdd753cd1311d72ab043800c4913d417d3e71020. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/soc.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index a20815b2227..d51ade98911 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,7 +22,6 @@ #include #include #include -#include #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) #include @@ -184,13 +183,6 @@ void soc_late_init_hook(void) err_tdd = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT); __ASSERT(err_tdd == 0, "err_tdd was %d", err_tdd); - - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 3, GPIO_PIN_CNF_CTRLSEL_TND); - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 4, GPIO_PIN_CNF_CTRLSEL_TND); - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 5, GPIO_PIN_CNF_CTRLSEL_TND); - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 6, GPIO_PIN_CNF_CTRLSEL_TND); - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 7, GPIO_PIN_CNF_CTRLSEL_TND); - #endif #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) From 100ef27d9c40513aa048895d30dd14c84d701931 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 308/881] Revert "[nrf fromlist] soc: nordic: ironside: Add TDD" This reverts commit bd9a022166c48254d021f64c5b61d7f47bbf6215. Signed-off-by: Jukka Rissanen --- soc/nordic/ironside/CMakeLists.txt | 1 - soc/nordic/ironside/Kconfig | 6 --- .../ironside/include/nrf_ironside/tdd.h | 38 ------------------- soc/nordic/ironside/tdd.c | 28 -------------- soc/nordic/nrf54h/Kconfig | 13 +------ soc/nordic/nrf54h/soc.c | 22 ++--------- 6 files changed, 5 insertions(+), 103 deletions(-) delete mode 100644 soc/nordic/ironside/include/nrf_ironside/tdd.h delete mode 100644 soc/nordic/ironside/tdd.c diff --git a/soc/nordic/ironside/CMakeLists.txt b/soc/nordic/ironside/CMakeLists.txt index 98e721541d7..cf68e8a1352 100644 --- a/soc/nordic/ironside/CMakeLists.txt +++ b/soc/nordic/ironside/CMakeLists.txt @@ -6,6 +6,5 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_TDD_SERVICE tdd.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_DVFS_SERVICE dvfs.c) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index 2430090c943..a9e68bba0b2 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -37,12 +37,6 @@ config NRF_IRONSIDE_CPUCONF_SERVICE help Service used to boot local domain cores. -config NRF_IRONSIDE_TDD_SERVICE - bool "IronSide TDD service" - select NRF_IRONSIDE_CALL - help - Service used to control the trace and debug domain. - config NRF_IRONSIDE_UPDATE_SERVICE bool "IronSide update service" select NRF_IRONSIDE_CALL diff --git a/soc/nordic/ironside/include/nrf_ironside/tdd.h b/soc/nordic/ironside/include/nrf_ironside/tdd.h deleted file mode 100644 index d065b1619a6..00000000000 --- a/soc/nordic/ironside/include/nrf_ironside/tdd.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ - -#include - -#include - -#define IRONSIDE_SE_TDD_SERVICE_ERROR_INVALID_CONFIG (1) - -#define IRONSIDE_SE_CALL_ID_TDD_V0 4 - -#define IRONSIDE_SE_TDD_SERVICE_REQ_CONFIG_IDX 0 -#define IRONSIDE_SE_TDD_SERVICE_RSP_RETCODE_IDX 0 - -enum ironside_se_tdd_config { - RESERVED0 = 0, /* Reserved */ - /** Turn off the TDD */ - IRONSIDE_SE_TDD_CONFIG_OFF = 1, - /** Turn on the TDD with default configuration */ - IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT = 2, -}; - -/** - * @brief Control the Trace and Debug Domain (TDD). - * - * @param config The configuration to be applied. - * - * @retval 0 on success. - * @retval -IRONSIDE_SE_TDD_ERROR_EINVAL on invalid argument. - */ -int ironside_se_tdd_configure(const enum ironside_se_tdd_config config); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ */ diff --git a/soc/nordic/ironside/tdd.c b/soc/nordic/ironside/tdd.c deleted file mode 100644 index eee5691cf36..00000000000 --- a/soc/nordic/ironside/tdd.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -int ironside_se_tdd_configure(const enum ironside_se_tdd_config config) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_SE_CALL_ID_TDD_V0; - buf->args[IRONSIDE_SE_TDD_SERVICE_REQ_CONFIG_IDX] = (uint32_t)config; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_SE_TDD_SERVICE_RSP_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 56b64f293ba..7889287b4a4 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -8,6 +8,7 @@ config SOC_SERIES_NRF54HX select HAS_NRFX select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM + select SOC_LATE_INIT_HOOK if SOC_NRF54H20_CPURAD_ENABLE select NRF_PLATFORM_HALTIUM select EXPERIMENTAL if MCUBOOT @@ -67,23 +68,11 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_PM select HAS_POWEROFF -config SOC_NRF54H20_TDD_ENABLE - bool "Power and configure the trace and debug domain (TDD)" - depends on SOC_NRF54H20_CPUAPP - select NRF_IRONSIDE_TDD_SERVICE - select SOC_LATE_INIT_HOOK - help - This will at application boot time request that the trace and - debug domain (TDD) is powered up and configured. - This allows configuring the coresight peripherals from - the application domain. - config SOC_NRF54H20_CPURAD_ENABLE bool "Boot the nRF54H20 Radio core" default y if NRF_802154_SER_HOST || BT_HCI_HOST depends on SOC_NRF54H20_CPUAPP select NRF_IRONSIDE_CPUCONF_SERVICE - select SOC_LATE_INIT_HOOK help This will at application boot time enable clock to the Radiocore, and also power will be requested to the Radiocore diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index d51ade98911..5f52a091fa8 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -26,9 +26,6 @@ #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) #include #endif -#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE) -#include -#endif LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -174,19 +171,10 @@ void soc_early_init_hook(void) } } -#if defined(CONFIG_SOC_LATE_INIT_HOOK) - +#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) void soc_late_init_hook(void) { -#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE) - int err_tdd; - - err_tdd = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT); - __ASSERT(err_tdd == 0, "err_tdd was %d", err_tdd); -#endif - -#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) - int err_cpuconf; + int err; /* The msg will be used for communication prior to IPC * communication being set up. But at this moment no such @@ -225,10 +213,8 @@ void soc_late_init_hook(void) /* Don't wait as this is not yet supported. */ bool cpu_wait = false; - err_cpuconf = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, - msg_size); - __ASSERT(err_cpuconf == 0, "err_cpuconf was %d", err_cpuconf); -#endif + err = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, msg_size); + __ASSERT(err == 0, "err was %d", err); } #endif From 333b22ab5f862a32d471982caed58b03f1ca9761 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 309/881] Revert "[nrf fromtree] soc: nordic: ironside: Fix bleeding config" This reverts commit 8c49e07c567e284bbbed4aa675c5d0a74eadaaa0. Signed-off-by: Jukka Rissanen --- soc/nordic/CMakeLists.txt | 2 +- soc/nordic/ironside/CMakeLists.txt | 3 +++ soc/nordic/nrf54h/soc.c | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/soc/nordic/CMakeLists.txt b/soc/nordic/CMakeLists.txt index 0c9e9184d6d..cba58ae5187 100644 --- a/soc/nordic/CMakeLists.txt +++ b/soc/nordic/CMakeLists.txt @@ -47,4 +47,4 @@ endif() add_subdirectory(${SOC_SERIES}) add_subdirectory(common) -add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE ironside) +add_subdirectory(ironside) diff --git a/soc/nordic/ironside/CMakeLists.txt b/soc/nordic/ironside/CMakeLists.txt index cf68e8a1352..a0a18fc94a8 100644 --- a/soc/nordic/ironside/CMakeLists.txt +++ b/soc/nordic/ironside/CMakeLists.txt @@ -2,8 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 zephyr_include_directories(include) + zephyr_library() + zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) + zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 5f52a091fa8..79708129804 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,10 +22,7 @@ #include #include #include - -#if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) #include -#endif LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); From 90be40a25246241e9573acbc0493a82aa89af057 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 310/881] Revert "[nrf fromtree] soc: nrf54h: don't boot radio core if VTOR is not programmed" This reverts commit d8199513c3c9151c4fb067632c23e4450fb9e78f. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/Kconfig | 7 ------- soc/nordic/nrf54h/soc.c | 7 ------- 2 files changed, 14 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 7889287b4a4..97423a04e9b 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -78,13 +78,6 @@ config SOC_NRF54H20_CPURAD_ENABLE Radiocore, and also power will be requested to the Radiocore subsystem. The Radiocore will then start executing instructions. -config SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR - bool "Check VTOR before booting Radio core" - default y - depends on SOC_NRF54H20_CPURAD_ENABLE - help - Verify that VTOR is not 0xFFFFFFFF before booting the Radiocore. - config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 79708129804..cdff2310355 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -200,13 +200,6 @@ void soc_late_init_hook(void) CONFIG_ROM_START_OFFSET); #endif - if (IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR) && - sys_read32((mem_addr_t)radiocore_address) == 0xFFFFFFFFUL) { - LOG_ERR("Radiocore is not programmed, it will not be started"); - - return; - } - /* Don't wait as this is not yet supported. */ bool cpu_wait = false; From fdf622979e749afa91546523265f7ae26eb3ac2d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 311/881] Revert "[nrf fromtree] west: runners: nrf: don't recover twice on nrf54h" This reverts commit 1871cdbd417ea23ebe66ff2a7c1669c0c32337a9. Signed-off-by: Jukka Rissanen --- scripts/west_commands/runners/nrf_common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index a7401084ef3..ba1d0dfdc32 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -320,7 +320,8 @@ def recover_target(self): # recover operation unlocks the core and then flashes a small image that # keeps the debug access port open, recovering the network core last # would result in that small image being deleted from the app core. - if self.family in ('nrf53', 'nrf92'): + # In the case of the 54H, the order is indifferent. + if self.family in ('nrf53', 'nrf54h', 'nrf92'): self.exec_op('recover', core='Network') self.exec_op('recover') From 303b6ab72b21d91e0f07a3711279c0142cd97468 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 312/881] Revert "[nrf fromtree] west: runners: nrf: Program UICR/PERIPHCONF artifacts if present" This reverts commit 39b677e13129bf1e7d77af0819eb9292b642b27e. Signed-off-by: Jukka Rissanen --- scripts/west_commands/runners/nrf_common.py | 26 +++------------------ 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index ba1d0dfdc32..e0818653772 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -369,9 +369,9 @@ def program_hex(self): if self.family in ('nrf54h', 'nrf92'): erase_arg = 'ERASE_NONE' - regtool_generated_uicr = self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR') + generated_uicr = self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR') - if regtool_generated_uicr and not self.hex_get_uicrs().get(core): + if generated_uicr and not self.hex_get_uicrs().get(core): raise RuntimeError( f"Expected a UICR to be contained in: {self.hex_}\n" "Please ensure that the correct version of nrf-regtool is " @@ -434,27 +434,7 @@ def program_hex(self): core='Application', ) - if self.build_conf.getboolean("CONFIG_NRF_HALTIUM_GENERATE_UICR"): - zephyr_build_dir = Path(self.cfg.build_dir) / 'zephyr' - - self.op_program( - str(zephyr_build_dir / 'uicr.hex'), - 'ERASE_NONE', - None, - defer=True, - core='Application', - ) - - if self.build_conf.getboolean("CONFIG_NRF_HALTIUM_UICR_PERIPHCONF"): - self.op_program( - str(zephyr_build_dir / 'periphconf.hex'), - 'ERASE_NONE', - None, - defer=True, - core='Application', - ) - - if not self.erase and regtool_generated_uicr: + if not self.erase and generated_uicr: self.exec_op('erase', core=core, kind='uicr') else: if self.erase: From c207578f992b27fc6c0f161629de899ca4dc24ce Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 313/881] Revert "[nrf fromtree] soc: nordic: add IronSide SE compatible UICR support" This reverts commit ed57bd891abe731ba2cbafeb0f4e1329ed51572d. Signed-off-by: Jukka Rissanen --- .../nrf54h20dk_nrf54h20-memory_map.dtsi | 4 - soc/nordic/common/CMakeLists.txt | 4 - soc/nordic/common/Kconfig | 1 - soc/nordic/common/uicr/CMakeLists.txt | 36 -- soc/nordic/common/uicr/Kconfig | 31 -- soc/nordic/common/uicr/gen_uicr.py | 270 --------------- soc/nordic/common/uicr/uicr.h | 308 ------------------ soc/nordic/common/uicr/uicr.ld | 11 - 8 files changed, 665 deletions(-) delete mode 100644 soc/nordic/common/uicr/CMakeLists.txt delete mode 100644 soc/nordic/common/uicr/Kconfig delete mode 100644 soc/nordic/common/uicr/gen_uicr.py delete mode 100644 soc/nordic/common/uicr/uicr.h delete mode 100644 soc/nordic/common/uicr/uicr.ld diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index b6a53955c60..aa6ebc629cc 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -162,9 +162,5 @@ storage_partition: partition@1a4000 { reg = <0x1a4000 DT_SIZE_K(40)>; }; - - periphconf_partition: partition@1ae000 { - reg = <0x1ae000 DT_SIZE_K(8)>; - }; }; }; diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index 825be4842fb..ac75d083869 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -3,10 +3,6 @@ add_subdirectory_ifdef(CONFIG_RISCV_CORE_NORDIC_VPR vpr) -if(CONFIG_NRF_PERIPHCONF_SECTION OR CONFIG_NRF_HALTIUM_GENERATE_UICR) - add_subdirectory(uicr) -endif() - # Let SystemInit() be called in place of soc_reset_hook() by default. zephyr_linker_symbol(SYMBOL soc_reset_hook EXPR "@SystemInit@") diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index 782d9452b67..059274fd299 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -49,4 +49,3 @@ source "subsys/logging/Kconfig.template.log_config" endif # MRAM_LATENCY rsource "vpr/Kconfig" -rsource "uicr/Kconfig" diff --git a/soc/nordic/common/uicr/CMakeLists.txt b/soc/nordic/common/uicr/CMakeLists.txt deleted file mode 100644 index 0bde6b47f57..00000000000 --- a/soc/nordic/common/uicr/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if(CONFIG_NRF_PERIPHCONF_SECTION) - zephyr_linker_sources(SECTIONS uicr.ld) -endif() - -if(CONFIG_NRF_HALTIUM_GENERATE_UICR) - if(CONFIG_NRF_PERIPHCONF_SECTION) - set(in_periphconf_elf_arg - --in-periphconf-elf $ - ) - endif() - - if(CONFIG_NRF_HALTIUM_UICR_PERIPHCONF) - set(periphconf_hex_file ${PROJECT_BINARY_DIR}/periphconf.hex) - set(out_periphconf_hex_arg - --out-periphconf-hex ${periphconf_hex_file} - ) - list(APPEND optional_byproducts ${periphconf_hex_file}) - endif() - - set(uicr_hex_file ${PROJECT_BINARY_DIR}/uicr.hex) - set_property(GLOBAL APPEND PROPERTY extra_post_build_commands - COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${ZEPHYR_BASE}/scripts/dts/python-devicetree/src - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/gen_uicr.py - --in-config ${DOTCONFIG} - --in-edt-pickle ${EDT_PICKLE} - ${in_periphconf_elf_arg} - ${out_periphconf_hex_arg} - --out-uicr-hex ${uicr_hex_file} - ) - set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${uicr_hex_file} ${optional_byproducts} - ) -endif() diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig deleted file mode 100644 index f132510a7a5..00000000000 --- a/soc/nordic/common/uicr/Kconfig +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config NRF_HALTIUM_GENERATE_UICR - bool "Generate UICR file" - depends on SOC_NRF54H20_CPUAPP - default y - help - Generate UICR HEX file. - -if NRF_HALTIUM_GENERATE_UICR - -config NRF_HALTIUM_UICR_PERIPHCONF - bool "Initialize global domain peripherals" - default y - help - Generates a blob containing static global domain peripheral initialization - values extracted from the build artifacts, and configures UICR.PERIPHCONF - to point at the blob. The initialization values are then loaded ahead of - ahead of the application boot. - -endif - -config NRF_PERIPHCONF_SECTION - bool "Populate global peripheral initialization section" - default y if SOC_NRF54H20_CPUAPP - depends on LINKER_DEVNULL_SUPPORT - imply LINKER_DEVNULL_MEMORY - help - Include static global domain peripheral initialization values from the - build in a dedicated section in the devnull region. diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py deleted file mode 100644 index 50f96eab566..00000000000 --- a/soc/nordic/common/uicr/gen_uicr.py +++ /dev/null @@ -1,270 +0,0 @@ -""" -Copyright (c) 2025 Nordic Semiconductor ASA -SPDX-License-Identifier: Apache-2.0 -""" - -from __future__ import annotations - -import argparse -import ctypes as c -import math -import pickle -import re -import sys -from collections import defaultdict -from itertools import groupby - -from elftools.elf.elffile import ELFFile -from intelhex import IntelHex - -# Name of the ELF section containing PERIPHCONF entries. -# Must match the name used in the linker script. -PERIPHCONF_SECTION = "uicr_periphconf_entry" - -# Expected nodelabel of the UICR devicetree node, used to extract its location from the devicetree. -UICR_NODELABEL = "uicr" -# Nodelabel of the PERIPHCONF devicetree node, used to extract its location from the devicetree. -PERIPHCONF_NODELABEL = "periphconf_partition" - -# Common values for representing enabled/disabled in the UICR format. -ENABLED_VALUE = 0xFFFF_FFFF -DISABLED_VALUE = 0xBD23_28A8 - - -class ScriptError(RuntimeError): ... - - -class PeriphconfEntry(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("regptr", c.c_uint32), - ("value", c.c_uint32), - ] - - -PERIPHCONF_ENTRY_SIZE = c.sizeof(PeriphconfEntry) - - -class Approtect(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("APPLICATION", c.c_uint32), - ("RADIOCORE", c.c_uint32), - ("RESERVED", c.c_uint32), - ("CORESIGHT", c.c_uint32), - ] - - -class Protectedmem(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("SIZE4KB", c.c_uint32), - ] - - -class Recovery(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("PROCESSOR", c.c_uint32), - ("INITSVTOR", c.c_uint32), - ("SIZE4KB", c.c_uint32), - ] - - -class Its(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("ADDRESS", c.c_uint32), - ("APPLICATIONSIZE", c.c_uint32), - ("RADIOCORESIZE", c.c_uint32), - ] - - -class Periphconf(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("ADDRESS", c.c_uint32), - ("MAXCOUNT", c.c_uint32), - ] - - -class Mpcconf(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("ADDRESS", c.c_uint32), - ("MAXCOUNT", c.c_uint32), - ] - - -class Uicr(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("VERSION", c.c_uint32), - ("RESERVED", c.c_uint32), - ("LOCK", c.c_uint32), - ("RESERVED1", c.c_uint32), - ("APPROTECT", Approtect), - ("ERASEPROTECT", c.c_uint32), - ("PROTECTEDMEM", Protectedmem), - ("RECOVERY", Recovery), - ("ITS", Its), - ("RESERVED2", c.c_uint32 * 7), - ("PERIPHCONF", Periphconf), - ("MPCCONF", Mpcconf), - ] - - -def main() -> None: - parser = argparse.ArgumentParser( - allow_abbrev=False, - description=( - "Generate artifacts for the UICR and associated configuration blobs from application " - "build outputs. User Information Configuration Registers (UICR), in the context of " - "certain Nordic SoCs, are used to configure system resources, like memory and " - "peripherals, and to protect the device in various ways." - ), - ) - parser.add_argument( - "--in-config", - required=True, - type=argparse.FileType("r"), - help="Path to the .config file from the application build", - ) - parser.add_argument( - "--in-edt-pickle", - required=True, - type=argparse.FileType("rb"), - help="Path to the edt.pickle file from the application build", - ) - parser.add_argument( - "--in-periphconf-elf", - dest="in_periphconf_elfs", - default=[], - action="append", - type=argparse.FileType("rb"), - help=( - "Path to an ELF file to extract PERIPHCONF data from. Can be provided multiple times. " - "The PERIPHCONF data from each ELF file is combined in a single list which is sorted " - "by ascending address and cleared of duplicate entries." - ), - ) - parser.add_argument( - "--out-uicr-hex", - required=True, - type=argparse.FileType("w", encoding="utf-8"), - help="Path to write the generated UICR HEX file to", - ) - parser.add_argument( - "--out-periphconf-hex", - default=None, - type=argparse.FileType("w", encoding="utf-8"), - help="Path to write the generated PERIPHCONF HEX file to", - ) - args = parser.parse_args() - - try: - init_values = DISABLED_VALUE.to_bytes(4, "little") * (c.sizeof(Uicr) // 4) - uicr = Uicr.from_buffer_copy(init_values) - - kconfig_str = args.in_config.read() - kconfig = parse_kconfig(kconfig_str) - - edt = pickle.load(args.in_edt_pickle) - - try: - periphconf_partition = edt.label2node[PERIPHCONF_NODELABEL] - except LookupError as e: - raise ScriptError( - "Failed to find a PERIPHCONF partition in the devicetree. " - f"Expected a DT node with label '{PERIPHCONF_NODELABEL}'." - ) from e - - flash_base_address = periphconf_partition.flash_controller.regs[0].addr - periphconf_address = flash_base_address + periphconf_partition.regs[0].addr - periphconf_size = periphconf_partition.regs[0].size - - periphconf_combined = extract_and_combine_periphconfs(args.in_periphconf_elfs) - padding_len = periphconf_size - len(periphconf_combined) - periphconf_final = periphconf_combined + bytes([0xFF for _ in range(padding_len)]) - - if kconfig.get("CONFIG_NRF_HALTIUM_UICR_PERIPHCONF") == "y": - uicr.PERIPHCONF.ENABLE = ENABLED_VALUE - uicr.PERIPHCONF.ADDRESS = periphconf_address - uicr.PERIPHCONF.MAXCOUNT = math.floor(periphconf_size / 8) - - try: - uicr_node = edt.label2node[UICR_NODELABEL] - except LookupError as e: - raise ScriptError( - "Failed to find UICR node in the devicetree. " - f"Expected a DT node with label '{UICR_NODELABEL}'." - ) from e - - uicr_hex = IntelHex() - uicr_hex.frombytes(bytes(uicr), offset=uicr_node.regs[0].addr) - - uicr_hex.write_hex_file(args.out_uicr_hex) - - if args.out_periphconf_hex is not None: - periphconf_hex = IntelHex() - periphconf_hex.frombytes(periphconf_final, offset=periphconf_address) - periphconf_hex.write_hex_file(args.out_periphconf_hex) - - except ScriptError as e: - print(f"Error: {e!s}") - sys.exit(1) - - -def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes: - combined_periphconf = [] - - for in_file in elf_files: - elf = ELFFile(in_file) - conf_section = elf.get_section_by_name(PERIPHCONF_SECTION) - if conf_section is None: - continue - - conf_section_data = conf_section.data() - num_entries = len(conf_section_data) // PERIPHCONF_ENTRY_SIZE - periphconf = (PeriphconfEntry * num_entries).from_buffer_copy(conf_section_data) - combined_periphconf.extend(periphconf) - - combined_periphconf.sort(key=lambda e: e.regptr) - deduplicated_periphconf = [] - - for regptr, regptr_entries in groupby(combined_periphconf, key=lambda e: e.regptr): - entries = list(regptr_entries) - if len(entries) > 1: - unique_values = {e.value for e in entries} - if len(unique_values) > 1: - raise ScriptError( - f"PERIPHCONF has conflicting values for register 0x{regptr:09_x}: " - + ", ".join([f"0x{val:09_x}" for val in unique_values]) - ) - deduplicated_periphconf.append(entries[0]) - - final_periphconf = (PeriphconfEntry * len(deduplicated_periphconf))() - for i, entry in enumerate(deduplicated_periphconf): - final_periphconf[i] = entry - - return bytes(final_periphconf) - - -def parse_kconfig(content: str) -> dict[str, str | None]: - result = defaultdict(None) - match_iter = re.finditer( - r"^(?P(SB_)?CONFIG_[^=\s]+)=(?P[^\s#])+$", content, re.MULTILINE - ) - for match in match_iter: - result[match["config"]] = match["value"] - - return result - - -if __name__ == "__main__": - main() diff --git a/soc/nordic/common/uicr/uicr.h b/soc/nordic/common/uicr/uicr.h deleted file mode 100644 index 7ceb12429e2..00000000000 --- a/soc/nordic/common/uicr/uicr.h +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SOC_NORDIC_COMMON_UICR_UICR_H_ -#define SOC_NORDIC_COMMON_UICR_UICR_H_ - -#include -#include -#include -#include -#include - -/** Entry in the PERIPHCONF table. */ -struct uicr_periphconf_entry { - /** Register pointer. */ - uint32_t regptr; - /** Register value. */ - uint32_t value; -} __packed; - -/** @brief Add an entry to the PERIPHCONF table section. - * - * This should typically not be used directly. - * Prefer to use one of the higher level macros. - */ -#define UICR_PERIPHCONF_ADD(_regptr, _value) \ - static STRUCT_SECTION_ITERABLE(uicr_periphconf_entry, \ - _UICR_PERIPHCONF_ENTRY_NAME(__COUNTER__)) = { \ - .regptr = (_regptr), \ - .value = (_value), \ - } - -#define _UICR_PERIPHCONF_ENTRY_NAME(_id) __UICR_PERIPHCONF_ENTRY_NAME(_id) -#define __UICR_PERIPHCONF_ENTRY_NAME(_id) _uicr_periphconf_entry_##_id - -/** @brief Add a PERIPHCONF entry for a SPU PERIPH[n].PERM register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Peripheral slave index on the bus (PERIPH[n] register index). - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _dmasec If true, set DMASEC to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_PERIPH_PERM_SET(_spu, _index, _secattr, _dmasec, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->PERIPH[(_index)].PERM, \ - (uint32_t)((((_ownerid) << SPU_PERIPH_PERM_OWNERID_Pos) & \ - SPU_PERIPH_PERM_OWNERID_Msk) | \ - (((_secattr) ? SPU_PERIPH_PERM_SECATTR_Secure \ - : SPU_PERIPH_PERM_SECATTR_NonSecure) \ - << SPU_PERIPH_PERM_SECATTR_Pos) | \ - (((_dmasec) ? SPU_PERIPH_PERM_DMASEC_Secure \ - : SPU_PERIPH_PERM_DMASEC_NonSecure) \ - << SPU_PERIPH_PERM_DMASEC_Pos) | \ - (SPU_PERIPH_PERM_LOCK_Locked << SPU_PERIPH_PERM_LOCK_Pos))) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.IPCT.CH[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_IPCT_CH_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.IPCT.CH[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.IPCT.INTERRUPT[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_IPCT_INTERRUPT_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.IPCT.INTERRUPT[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.DPPIC.CH[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_DPPIC_CH_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.DPPIC.CH[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.DPPIC.CHG[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Register index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_DPPIC_CHG_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.DPPIC.CHG[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIOTE[n].CH[m] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index (GPIOTE[n] register index). - * @param _subindex Feature subindex (CH[m] register index). - * @param _secattr If true, set the SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_GPIOTE_CH_SET(_spu, _index, _subindex, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD( \ - (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIOTE[_index].CH[_subindex], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIOTE.INTERRUPT[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _subindex Feature subindex. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_GPIOTE_INTERRUPT_SET(_spu, _index, _subindex, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD( \ - (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIOTE[_index].INTERRUPT[_subindex], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIO[n].PIN[m] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _subindex Feature subindex. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_GPIO_PIN_SET(_spu, _index, _subindex, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD( \ - (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIO[_index].PIN[_subindex], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GRTC.CC[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_GRTC_CC_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GRTC.CC[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/* Common macro for encoding a SPU FEATURE.* register value. - * Note that the MDK SPU_FEATURE_IPCT_CH_ macros are used for all since all the FEATURE registers - * have the same layout with different naming. - */ -#define _UICR_SPU_FEATURE_VAL(_secattr, _ownerid) \ - (uint32_t)((((_ownerid) << SPU_FEATURE_IPCT_CH_OWNERID_Pos) & \ - SPU_FEATURE_IPCT_CH_OWNERID_Msk) | \ - (((_secattr) ? SPU_FEATURE_IPCT_CH_SECATTR_Secure \ - : SPU_FEATURE_IPCT_CH_SECATTR_NonSecure) \ - << SPU_FEATURE_IPCT_CH_SECATTR_Pos) | \ - (SPU_FEATURE_IPCT_CH_LOCK_Locked << SPU_FEATURE_IPCT_CH_LOCK_Pos)) - -/** @brief Add PERIPHCONF entries for configuring IPCMAP CHANNEL.SOURCE[n] and CHANNEL.SINK[n]. - * - * @param _index CHANNEL.SOURCE[n]/CHANNEL.SINK[n] register index. - * @param _source_domain DOMAIN field value in CHANNEL[n].SOURCE. - * @param _source_ch SOURCE field value in CHANNEL[n].SOURCE. - * @param _sink_domain DOMAIN field value in CHANNEL[n].SINK. - * @param _sink_ch SINK field value in CHANNEL[n].SINK. - */ -#define UICR_IPCMAP_CHANNEL_CFG(_index, _source_domain, _source_ch, _sink_domain, _sink_ch) \ - UICR_IPCMAP_CHANNEL_SOURCE_SET(_index, _source_domain, _source_ch, 1); \ - UICR_IPCMAP_CHANNEL_SINK_SET(_index, _sink_domain, _sink_ch) - -#define UICR_IPCMAP_CHANNEL_SOURCE_SET(_index, _domain, _ch, _enable) \ - UICR_PERIPHCONF_ADD((uint32_t)&NRF_IPCMAP->CHANNEL[(_index)].SOURCE, \ - (uint32_t)((((_domain) << IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos) & \ - IPCMAP_CHANNEL_SOURCE_DOMAIN_Msk) | \ - (((_ch) << IPCMAP_CHANNEL_SOURCE_SOURCE_Pos) & \ - IPCMAP_CHANNEL_SOURCE_SOURCE_Msk) | \ - (((_enable) ? IPCMAP_CHANNEL_SOURCE_ENABLE_Enabled \ - : IPCMAP_CHANNEL_SOURCE_ENABLE_Disabled) \ - << IPCMAP_CHANNEL_SOURCE_ENABLE_Pos))) - -#define UICR_IPCMAP_CHANNEL_SINK_SET(_index, _domain, _ch) \ - UICR_PERIPHCONF_ADD((uint32_t)&NRF_IPCMAP->CHANNEL[(_index)].SINK, \ - (uint32_t)((((_domain) << IPCMAP_CHANNEL_SINK_DOMAIN_Pos) & \ - IPCMAP_CHANNEL_SINK_DOMAIN_Msk) | \ - (((_ch) << IPCMAP_CHANNEL_SINK_SINK_Pos) & \ - IPCMAP_CHANNEL_SINK_SINK_Msk))) - -/** @brief Add a PERIPHCONF entry for an IRQMAP IRQ[n].SINK register value. - * - * @param _irqnum IRQ number (IRQ[n] register index). - * @param _processor Processor to route the interrupt to (PROCESSORID field value). - */ -#define UICR_IRQMAP_IRQ_SINK_SET(_irqnum, _processor) \ - UICR_PERIPHCONF_ADD((uint32_t)&NRF_IRQMAP->IRQ[(_irqnum)].SINK, \ - (uint32_t)(((_processor) << IRQMAP_IRQ_SINK_PROCESSORID_Pos) & \ - IRQMAP_IRQ_SINK_PROCESSORID_Msk)) - -/** @brief Add a PERIPHCONF entry for configuring a GPIO PIN_CNF[n] CTRLSEL field value. - * - * @param _gpio GPIO instance address. - * @param _pin Pin number (PIN_CNF[n] register index). - * @param _ctrlsel CTRLSEL field value. - */ -#define UICR_GPIO_PIN_CNF_CTRLSEL_SET(_gpio, _pin, _ctrlsel) \ - UICR_PERIPHCONF_ADD( \ - (uint32_t)&((NRF_GPIO_Type *)(_gpio))->PIN_CNF[(_pin)], \ - ((GPIO_PIN_CNF_ResetValue) | \ - (uint32_t)(((_ctrlsel) << GPIO_PIN_CNF_CTRLSEL_Pos) & GPIO_PIN_CNF_CTRLSEL_Msk))) - -/** @brief Add a PERIPHCONF entry for a PPIB SUBSCRIBE_SEND[n] register. - * - * @param _ppib Global domain PPIB instance address. - * @param _ppib_ch PPIB channel number. - */ -#define UICR_PPIB_SUBSCRIBE_SEND_ENABLE(_ppib, _ppib_ch) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_PPIB_Type *)(_ppib))->SUBSCRIBE_SEND[(_ppib_ch)], \ - (uint32_t)PPIB_SUBSCRIBE_SEND_EN_Msk) - -/** @brief Add a PERIPHCONF entry for a PPIB PUBLISH_RECEIVE[n] register. - * - * @param _ppib Global domain PPIB instance address. - * @param _ppib_ch PPIB channel number. - */ -#define UICR_PPIB_PUBLISH_RECEIVE_ENABLE(_ppib, _ppib_ch) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_PPIB_Type *)(_ppib))->PUBLISH_RECEIVE[(_ppib_ch)], \ - (uint32_t)PPIB_PUBLISH_RECEIVE_EN_Msk) - -/* The definitions below are not currently available in the MDK but are needed for the macros - * above. When they are, this can be deleted. - */ -#ifndef IPCMAP_CHANNEL_SOURCE_SOURCE_Msk - -typedef struct { - __IOM uint32_t SOURCE; - __IOM uint32_t SINK; -} NRF_IPCMAP_CHANNEL_Type; - -#define IPCMAP_CHANNEL_SOURCE_SOURCE_Pos (0UL) -#define IPCMAP_CHANNEL_SOURCE_SOURCE_Msk (0xFUL << IPCMAP_CHANNEL_SOURCE_SOURCE_Pos) -#define IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos (8UL) -#define IPCMAP_CHANNEL_SOURCE_DOMAIN_Msk (0xFUL << IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos) -#define IPCMAP_CHANNEL_SOURCE_ENABLE_Pos (31UL) -#define IPCMAP_CHANNEL_SOURCE_ENABLE_Disabled (0x0UL) -#define IPCMAP_CHANNEL_SOURCE_ENABLE_Enabled (0x1UL) -#define IPCMAP_CHANNEL_SINK_SINK_Pos (0UL) -#define IPCMAP_CHANNEL_SINK_SINK_Msk (0xFUL << IPCMAP_CHANNEL_SINK_SINK_Pos) -#define IPCMAP_CHANNEL_SINK_DOMAIN_Pos (8UL) -#define IPCMAP_CHANNEL_SINK_DOMAIN_Msk (0xFUL << IPCMAP_CHANNEL_SINK_DOMAIN_Pos) - -typedef struct { - __IM uint32_t RESERVED[256]; - __IOM NRF_IPCMAP_CHANNEL_Type CHANNEL[16]; -} NRF_IPCMAP_Type; - -#endif /* IPCMAP_CHANNEL_SOURCE_SOURCE_Msk */ - -#ifndef NRF_IPCMAP -#define NRF_IPCMAP ((NRF_IPCMAP_Type *)0x5F923000UL) -#endif - -#ifndef IRQMAP_IRQ_SINK_PROCESSORID_Msk - -typedef struct { - __IOM uint32_t SINK; -} NRF_IRQMAP_IRQ_Type; - -#define IRQMAP_IRQ_SINK_PROCESSORID_Pos (8UL) -#define IRQMAP_IRQ_SINK_PROCESSORID_Msk (0xFUL << IRQMAP_IRQ_SINK_PROCESSORID_Pos) - -typedef struct { - __IM uint32_t RESERVED[256]; - __IOM NRF_IRQMAP_IRQ_Type IRQ[480]; -} NRF_IRQMAP_Type; - -#endif /* IRQMAP_IRQ_SINK_PROCESSORID_Msk */ - -#ifndef NRF_IRQMAP -#define NRF_IRQMAP ((NRF_IRQMAP_Type *)0x5F924000UL) -#endif /* NRF_IRQMAP */ - -#ifndef GPIO_PIN_CNF_CTRLSEL_Pos - -#define GPIO_PIN_CNF_CTRLSEL_Pos (28UL) -#define GPIO_PIN_CNF_CTRLSEL_Msk (0x7UL << GPIO_PIN_CNF_CTRLSEL_Pos) -#define GPIO_PIN_CNF_CTRLSEL_Min (0x0UL) -#define GPIO_PIN_CNF_CTRLSEL_Max (0x7UL) -#define GPIO_PIN_CNF_CTRLSEL_GPIO (0x0UL) -#define GPIO_PIN_CNF_CTRLSEL_VPR (0x1UL) -#define GPIO_PIN_CNF_CTRLSEL_GRC (0x1UL) -#define GPIO_PIN_CNF_CTRLSEL_SecureDomain (0x2UL) -#define GPIO_PIN_CNF_CTRLSEL_PWM (0x2UL) -#define GPIO_PIN_CNF_CTRLSEL_I3C (0x2UL) -#define GPIO_PIN_CNF_CTRLSEL_Serial (0x3UL) -#define GPIO_PIN_CNF_CTRLSEL_HSSPI (0x3UL) -#define GPIO_PIN_CNF_CTRLSEL_RadioCore (0x4UL) -#define GPIO_PIN_CNF_CTRLSEL_EXMIF (0x4UL) -#define GPIO_PIN_CNF_CTRLSEL_CELL (0x4UL) -#define GPIO_PIN_CNF_CTRLSEL_DTB (0x6UL) -#define GPIO_PIN_CNF_CTRLSEL_TND (0x7UL) - -#endif /* GPIO_PIN_CNF_CTRLSEL_Pos */ - -#endif /* SOC_NORDIC_COMMON_UICR_UICR_H_ */ diff --git a/soc/nordic/common/uicr/uicr.ld b/soc/nordic/common/uicr/uicr.ld deleted file mode 100644 index 210495b1c66..00000000000 --- a/soc/nordic/common/uicr/uicr.ld +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -SECTION_PROLOGUE(uicr_periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) -{ - Z_LINK_ITERABLE(uicr_periphconf_entry); -} GROUP_ROM_LINK_IN(DEVNULL_REGION, DEVNULL_REGION) From b4708cfa407883ec4b09d68f06c6d2365126892a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 314/881] Revert "[nrf fromtree] dts: nordic: update UICR definition on nrf54h20" This reverts commit 3ad7a6d1a6bfb5b71213a96732ed58ed66086cf2. Signed-off-by: Jukka Rissanen --- dts/vendor/nordic/nrf54h20.dtsi | 11 +++++++++-- soc/nordic/validate_base_addresses.c | 4 ---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 05ae6df5d0f..241a8206f9a 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -226,12 +226,13 @@ write-block-size = <16>; }; - uicr: uicr@fff8000 { - compatible = "nordic,nrf-uicr"; + cpuapp_uicr: uicr@fff8000 { + compatible = "nordic,nrf-uicr-v2"; reg = <0xfff8000 DT_SIZE_K(2)>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0xfff8000 DT_SIZE_K(2)>; + domain = <2>; bicr: bicr@7b0 { compatible = "nordic,nrf-bicr"; @@ -239,6 +240,12 @@ }; }; + cpurad_uicr: uicr@fffa000 { + compatible = "nordic,nrf-uicr-v2"; + reg = <0xfffa000 DT_SIZE_K(2)>; + domain = <3>; + }; + ficr: ficr@fffe000 { compatible = "nordic,nrf-ficr"; reg = <0xfffe000 DT_SIZE_K(2)>; diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index f3c9c8bf214..1c5c39f74ec 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -335,11 +335,7 @@ CHECK_DT_REG(uart134, NRF_UARTE134); CHECK_DT_REG(uart135, NRF_UARTE135); CHECK_DT_REG(uart136, NRF_UARTE136); CHECK_DT_REG(uart137, NRF_UARTE137); -#if !defined(CONFIG_SOC_SERIES_NRF54HX) CHECK_DT_REG(uicr, NRF_UICR); -#else -CHECK_DT_REG(uicr, NRF_APPLICATION_UICR); -#endif CHECK_DT_REG(cpuapp_uicr, NRF_APPLICATION_UICR); CHECK_DT_REG(bicr, NRF_APPLICATION_BICR); CHECK_DT_REG(cpurad_uicr, NRF_RADIOCORE_UICR); From 538c52c175cc0d4f1d89cbdc903574801638d7b7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 315/881] Revert "[nrf fromtree] boards: nordic: nrf54h20dk: refactor RAM memory map" This reverts commit 75718fa236c519a4ae9e28a06671182983d2adc2. Signed-off-by: Jukka Rissanen --- .../nrf54h20dk_nrf54h20-memory_map.dtsi | 135 +++++++++++++----- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 12 ++ .../nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml | 2 +- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 8 ++ dts/vendor/nordic/nrf54h20.dtsi | 1 + .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 5 + .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 + .../soc/nrf54h20_cpuapp.overlay | 4 + .../nordic-ppr/soc/nrf54h20_cpuapp.overlay | 4 + .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 8 ++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 + 11 files changed, 153 insertions(+), 34 deletions(-) create mode 100644 tests/arch/common/ramfunc/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index aa6ebc629cc..7f568005a22 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -7,20 +7,62 @@ / { reserved-memory { - cpuapp_data: memory@2f000000 { - reg = <0x2f000000 DT_SIZE_K(760)>; + cpuapp_ram0x_region: memory@2f010000 { + compatible = "nordic,owned-memory"; + reg = <0x2f010000 DT_SIZE_K(260)>; + status = "disabled"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2f010000 0x41000>; + + cpuapp_data: memory@1000 { + reg = <0x1000 DT_SIZE_K(256)>; + }; }; - etr_buffer: memory@2f0be000 { - reg = <0x2f0be000 DT_SIZE_K(4)>; + cpurad_ram0x_region: memory@2f051000 { + compatible = "nordic,owned-memory"; + reg = <0x2f051000 DT_SIZE_K(4)>; + status = "disabled"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2f051000 0x1000>; }; - cpuapp_cpurad_ipc_shm: memory@2f0bf000 { - reg = <0x2f0bf000 DT_SIZE_K(2)>; + etr_buf_ram0x_region: memory@2f0be000 { + compatible = "nordic,owned-memory"; + reg = <0x2f0be000 DT_SIZE_K(4)>; + status = "disabled"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2f0be000 0x1000>; + + /* TODO In future move this region to cpuapp_ram0x_region. */ + etr_buffer: memory@0 { + reg = <0x0 DT_SIZE_K(4)>; + }; }; - cpurad_cpuapp_ipc_shm: memory@2f0bf800 { - reg = <0x2f0bf800 DT_SIZE_K(2)>; + cpuapp_cpurad_ram0x_region: memory@2f0bf000 { + compatible = "nordic,owned-memory"; + reg = <0x2f0bf000 DT_SIZE_K(4)>; + status = "disabled"; + nordic,access = , + ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2f0bf000 0x1000>; + + cpuapp_cpurad_ipc_shm: memory@0 { + reg = <0x0 DT_SIZE_K(2)>; + }; + + cpurad_cpuapp_ipc_shm: memory@800 { + reg = <0x800 DT_SIZE_K(2)>; + }; }; cpuapp_cpusys_ipc_shm: memory@2f88f600 { @@ -63,53 +105,80 @@ reg = <0x2f88fd00 0x200>; }; - cpuflpr_code_data: memory@2f890000 { - reg = <0x2f890000 DT_SIZE_K(46)>; - }; + /* + * NOTE: FLPR has a direct bridge with RAM21 that bypasses MPC. + * This means that when this region is marked as non-executable, + * only FLPR can execute code from it. + */ + ram21_region: memory@2f890000 { + compatible = "nordic,owned-memory"; + status = "disabled"; + reg = <0x2f890000 DT_SIZE_K(64)>; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2f890000 0x10000>; - cpuapp_cpuflpr_ipc_shm: memory@2f89b800 { - reg = <0x2f89b800 DT_SIZE_K(1)>; - }; + cpuflpr_code_data: memory@0 { + reg = <0x0 DT_SIZE_K(46)>; + }; - cpuflpr_cpuapp_ipc_shm: memory@2f89bc00 { - reg = <0x2f89bc00 DT_SIZE_K(1)>; + cpuapp_cpuflpr_ipc_shm: memory@b800 { + reg = <0xb800 DT_SIZE_K(1)>; + }; + + cpuflpr_cpuapp_ipc_shm: memory@bc00 { + reg = <0xbc00 DT_SIZE_K(1)>; + }; + + dma_fast_region: memory@c000 { + compatible = "zephyr,memory-region"; + reg = <0xc000 DT_SIZE_K(16)>; + status = "disabled"; + #memory-region-cells = <0>; + zephyr,memory-region = "DMA_RAM21"; + zephyr,memory-attr = <( DT_MEM_DMA | DT_MEM_CACHEABLE )>; + }; }; - dma_fast_region: memory@2f89c000 { - compatible = "zephyr,memory-region"; - reg = <0x2f89c000 DT_SIZE_K(16)>; + cpuppr_ram3x_region: memory@2fc00000 { + compatible = "nordic,owned-memory"; + reg = <0x2fc00000 DT_SIZE_K(64)>; status = "disabled"; - #memory-region-cells = <0>; - zephyr,memory-region = "DMA_RAM21"; - zephyr,memory-attr = <( DT_MEM_DMA | DT_MEM_CACHEABLE )>; - }; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2fc00000 0x10000>; - cpuppr_code_data: memory@2fc00000 { - reg = <0x2fc00000 DT_SIZE_K(62)>; - }; + cpuppr_code_data: memory@0 { + reg = <0x0 DT_SIZE_K(62)>; + }; - cpuapp_cpuppr_ipc_shm: memory@2fc0f800 { - reg = <0x2fc0f800 DT_SIZE_K(1)>; - }; + cpuapp_cpuppr_ipc_shm: memory@f800 { + reg = <0xf800 DT_SIZE_K(1)>; + }; - cpuppr_cpuapp_ipc_shm: memory@2fc0fc00 { - reg = <0x2fc0fc00 DT_SIZE_K(1)>; + cpuppr_cpuapp_ipc_shm: memory@fc00 { + reg = <0xfc00 DT_SIZE_K(1)>; + }; }; cpuapp_dma_region: memory@2fc12000 { - compatible = "zephyr,memory-region"; + compatible = "nordic,owned-memory", "zephyr,memory-region"; reg = <0x2fc12000 DT_SIZE_K(4)>; status = "disabled"; #memory-region-cells = <0>; + nordic,access = ; zephyr,memory-region = "DMA_RAM3x_APP"; zephyr,memory-attr = <( DT_MEM_DMA )>; }; cpurad_dma_region: memory@2fc13000 { - compatible = "zephyr,memory-region"; + compatible = "nordic,owned-memory", "zephyr,memory-region"; reg = <0x2fc13000 DT_SIZE_K(1)>; status = "disabled"; #memory-region-cells = <0>; + nordic,access = ; zephyr,memory-region = "DMA_RAM3x_RAD"; zephyr,memory-attr = <( DT_MEM_DMA )>; }; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 47255b0c994..16c573d127e 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -109,6 +109,18 @@ }; }; +&cpuapp_ram0x_region { + status = "okay"; +}; + +&etr_buf_ram0x_region { + status = "okay"; +}; + +&ram21_region { + status = "okay"; +}; + &cpuapp_bellboard { status = "okay"; interrupts = <96 NRF_DEFAULT_IRQ_PRIORITY>; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml index 4e82987d28e..832689be8e1 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml @@ -9,7 +9,7 @@ toolchain: - gnuarmemb - zephyr sysbuild: true -ram: 760 +ram: 256 flash: 392 supported: - adc diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 5473d9a7405..2813d5b1174 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -36,6 +36,14 @@ }; }; +&cpuapp_cpurad_ram0x_region { + status = "okay"; +}; + +&cpurad_ram0x_region { + status = "okay"; +}; + &cpurad_bellboard { status = "okay"; interrupts = <96 NRF_DEFAULT_IRQ_PRIORITY>; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 241a8206f9a..b57c718a9e2 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -14,6 +14,7 @@ #include #include #include +#include #include /delete-node/ &sw_pwm; diff --git a/samples/application_development/code_relocation_nocopy/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/application_development/code_relocation_nocopy/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 98d67e2ad08..ab53f12725d 100644 --- a/samples/application_development/code_relocation_nocopy/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/application_development/code_relocation_nocopy/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,5 +1,10 @@ +&cpuapp_ram0x_region { + nordic,access = ; +}; + &xip_region { status = "okay"; + nordic,access = ; }; &mx25uw63 { diff --git a/samples/boards/nordic/coresight_stm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/boards/nordic/coresight_stm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 970377c4d89..bf5ba18d204 100644 --- a/samples/boards/nordic/coresight_stm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/boards/nordic/coresight_stm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -7,6 +7,10 @@ status = "okay"; }; +&cpuppr_ram3x_region { + status = "okay"; +}; + &cpuflpr_vpr { status = "okay"; }; diff --git a/snippets/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay b/snippets/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay index 2d884a3455a..4d02921660b 100644 --- a/snippets/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay +++ b/snippets/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay @@ -3,6 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +&cpuppr_ram3x_region { + status = "okay"; +}; + &cpuppr_vpr { execution-memory = <&cpuppr_code_partition>; /delete-property/ source-memory; diff --git a/snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay b/snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay index ae635c9ca9b..75128f42a13 100644 --- a/snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay +++ b/snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay @@ -3,6 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +&cpuppr_ram3x_region { + status = "okay"; +}; + &uart135 { status = "reserved"; }; diff --git a/tests/arch/common/ramfunc/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/arch/common/ramfunc/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 00000000000..ad84324a3e9 --- /dev/null +++ b/tests/arch/common/ramfunc/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +&cpuapp_ram0x_region { + nordic,access = ; +}; diff --git a/tests/boards/nrf/coresight_stm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/coresight_stm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 970377c4d89..bf5ba18d204 100644 --- a/tests/boards/nrf/coresight_stm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/coresight_stm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -7,6 +7,10 @@ status = "okay"; }; +&cpuppr_ram3x_region { + status = "okay"; +}; + &cpuflpr_vpr { status = "okay"; }; From 991df0bd28fab943897345adc7f14ac7a412915d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 316/881] Revert "[nrf fromtree] boards: nordic: update nrf54h20dk memory map" This reverts commit 9f67617e6ecb8990d82b4836c68d70af6e729caa. Signed-off-by: Jukka Rissanen --- .../nrf54h20dk_nrf54h20-memory_map.dtsi | 22 +++++++++---------- .../nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml | 2 +- .../nrf54h20dk_nrf54h20_cpurad_0_9_0.yaml | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index 7f568005a22..cd595d6cd5d 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -200,16 +200,16 @@ #address-cells = <1>; #size-cells = <1>; - cpuapp_boot_partition: partition@30000 { - reg = <0x30000 DT_SIZE_K(64)>; + cpuapp_boot_partition: partition@2c000 { + reg = <0x2c000 DT_SIZE_K(64)>; }; - cpuapp_slot0_partition: partition@40000 { - reg = <0x40000 DT_SIZE_K(328)>; + cpuapp_slot0_partition: partition@3c000 { + reg = <0x3c000 DT_SIZE_K(336)>; }; - cpurad_slot0_partition: partition@92000 { - reg = <0x92000 DT_SIZE_K(328)>; + cpurad_slot0_partition: partition@90000 { + reg = <0x90000 DT_SIZE_K(336)>; }; cpuppr_code_partition: partition@e4000 { @@ -221,15 +221,15 @@ }; cpuapp_slot1_partition: partition@100000 { - reg = <0x100000 DT_SIZE_K(328)>; + reg = <0x100000 DT_SIZE_K(336)>; }; - cpurad_slot1_partition: partition@152000 { - reg = <0x152000 DT_SIZE_K(328)>; + cpurad_slot1_partition: partition@154000 { + reg = <0x154000 DT_SIZE_K(336)>; }; - storage_partition: partition@1a4000 { - reg = <0x1a4000 DT_SIZE_K(40)>; + storage_partition: partition@1a8000 { + reg = <0x1a8000 DT_SIZE_K(40)>; }; }; }; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml index 832689be8e1..1884ce0a4d0 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_0_9_0.yaml @@ -10,7 +10,7 @@ toolchain: - zephyr sysbuild: true ram: 256 -flash: 392 +flash: 296 supported: - adc - can diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_0_9_0.yaml index 8567494d1e3..de557fcc2cd 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_0_9_0.yaml @@ -10,7 +10,7 @@ toolchain: - zephyr sysbuild: true ram: 192 -flash: 328 +flash: 256 supported: - counter - gpio From 4d51c9dc46a2befe6b133b70ddb94c4ca09e9e0f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 317/881] Revert "[nrf fromtree] modules: hal_nordic: Remove nrf-regtool support for nRF54H" This reverts commit eda8866442f8461d437d881115863965d281e035. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/Kconfig.nrf_regtool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/Kconfig.nrf_regtool b/modules/hal_nordic/Kconfig.nrf_regtool index 12f7a53f471..396ec2050a0 100644 --- a/modules/hal_nordic/Kconfig.nrf_regtool +++ b/modules/hal_nordic/Kconfig.nrf_regtool @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 menu "nrf-regtool options" - depends on SOC_SERIES_NRF92X + depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF92X config NRF_REGTOOL_GENERATE_UICR bool "Generate UICR" From 32c95f431fc66e7f91d04fd6eac02918d19d2976 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 318/881] Revert "[nrf fromtree] boards: nrf54h20dk: Limit app core FLASH_LOAD_SIZE" This reverts commit b1e4c7852981379374f30da895e3d72380706c48. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54h20dk/Kconfig.defconfig | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 069ed7b6eba..1800fb1775f 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -22,13 +22,6 @@ if !USE_DT_CODE_PARTITION config FLASH_LOAD_OFFSET default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) -# This is meant to span 'cpuapp_boot_partition' and 'cpuapp_slot0_partition' -# in the default memory map. -config FLASH_LOAD_SIZE - default $(add_hex, $(dt_nodelabel_reg_addr_hex,cpuapp_slot0_partition), \ - $(dt_nodelabel_reg_size_hex,cpuapp_slot0_partition), \ - -$(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition)) - endif # !USE_DT_CODE_PARTITION endif # BOARD_NRF54H20DK_NRF54H20_CPUAPP From 175185dd857ddff213d4ab9bf343e0c846093dbf Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 319/881] Revert "[nrf fromtree] boards: nrf54h20dk: Merge iron variants into the base variants" This reverts commit 738229c484b65c98a33b991daa0436bc7469b443. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54h20dk/Kconfig.defconfig | 28 ++--- boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk | 8 +- boards/nordic/nrf54h20dk/board.cmake | 7 +- boards/nordic/nrf54h20dk/board.yml | 4 + .../nrf54h20dk_nrf54h20-ipc_conf.dtsi | 8 +- .../nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi | 30 +++++ .../nrf54h20dk_nrf54h20-memory_map.dtsi | 98 +++++++++-------- .../nrf54h20dk_nrf54h20-memory_map_iron.dtsi | 104 ++++++++++++++++++ .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 27 ++--- .../nrf54h20dk_nrf54h20_cpuapp_defconfig | 2 + .../nrf54h20dk_nrf54h20_cpuapp_iron.dts | 45 ++++++++ ...nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml | 25 +++++ .../nrf54h20dk_nrf54h20_cpuapp_iron_defconfig | 26 +++++ .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 11 +- .../nrf54h20dk_nrf54h20_cpurad_iron.dts | 29 +++++ ...nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml | 20 ++++ .../nrf54h20dk_nrf54h20_cpurad_iron_defconfig | 25 +++++ dts/vendor/nordic/nrf54h20.dtsi | 4 + .../nordic/nrf_ironside/update/README.rst | 6 +- .../nordic/nrf_ironside/update/sample.yaml | 4 +- .../nrf54h20dk_nrf54h20_cpuapp_iron.overlay | 3 + samples/drivers/mbox/sample.yaml | 1 - .../nrf54h20dk_nrf54h20_cpuapp_iron.overlay | 8 ++ .../subsys/mgmt/mcumgr/smp_svr/sample.yaml | 2 +- .../nrf54h20dk_nrf54h20_cpuapp_iron.conf | 4 + samples/sysbuild/hello_world/sample.yaml | 10 +- .../nrf54h20dk_nrf54h20_cpurad_iron.conf | 1 + scripts/west_commands/runners/nrf_common.py | 6 +- soc/nordic/ironside/Kconfig | 4 +- soc/nordic/nrf54h/Kconfig | 4 +- .../nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 3 + .../nrf54h/Kconfig.defconfig.nrf54h20_cpurad | 3 + soc/nordic/nrf54h/Kconfig.soc | 5 + tests/boards/nrf/nrfs/prj.conf | 2 - .../nrf54h20dk_nrf54h20_cpuapp_iron.overlay | 6 + .../nrf54h20dk_nrf54h20_cpuapp_iron.conf | 2 + .../nrf54h20dk_nrf54h20_cpuapp_iron.overlay | 8 ++ tests/subsys/ipc/ipc_sessions/testcase.yaml | 1 - 38 files changed, 469 insertions(+), 115 deletions(-) create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_defconfig create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml create mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig create mode 100644 samples/drivers/counter/alarm/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay create mode 100644 samples/drivers/watchdog/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay create mode 100644 samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf create mode 100644 samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf create mode 100644 tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay create mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf create mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 1800fb1775f..3a6ba6b6d26 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -12,18 +12,6 @@ config BT_HCI_IPC config MAX_THREAD_BYTES default 3 if USERSPACE -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -if !USE_DT_CODE_PARTITION - -# Application core firmware must start at this offset when not using MCUboot. -# However, the default 'zephyr,code-partition' in DT is set for MCUboot. -config FLASH_LOAD_OFFSET - default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) - -endif # !USE_DT_CODE_PARTITION - endif # BOARD_NRF54H20DK_NRF54H20_CPUAPP if BOARD_NRF54H20DK_NRF54H20_CPURAD @@ -31,7 +19,21 @@ if BOARD_NRF54H20DK_NRF54H20_CPURAD config MAX_THREAD_BYTES default 3 if USERSPACE +endif # BOARD_NRF54H20DK_NRF54H20_CPURAD + +if BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON + config ROM_START_OFFSET default 0x800 if BOOTLOADER_MCUBOOT -endif # BOARD_NRF54H20DK_NRF54H20_CPURAD +config FLASH_LOAD_OFFSET + default 0x2c000 if !USE_DT_CODE_PARTITION + +endif # BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON + +if BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON diff --git a/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk b/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk index 62ad7a0d21c..c509f968db6 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk +++ b/boards/nordic/nrf54h20dk/Kconfig.nrf54h20dk @@ -2,9 +2,13 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF54H20DK - select SOC_NRF54H20_CPUAPP if BOARD_NRF54H20DK_NRF54H20_CPUAPP - select SOC_NRF54H20_CPURAD if BOARD_NRF54H20DK_NRF54H20_CPURAD + select SOC_NRF54H20_CPUAPP if (BOARD_NRF54H20DK_NRF54H20_CPUAPP || \ + BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON) + select SOC_NRF54H20_CPURAD if (BOARD_NRF54H20DK_NRF54H20_CPURAD || \ + BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) select SOC_NRF54H20_CPUPPR if (BOARD_NRF54H20DK_NRF54H20_CPUPPR || \ BOARD_NRF54H20DK_NRF54H20_CPUPPR_XIP) select SOC_NRF54H20_CPUFLPR if (BOARD_NRF54H20DK_NRF54H20_CPUFLPR || \ BOARD_NRF54H20DK_NRF54H20_CPUFLPR_XIP) + select SOC_NRF54H20_IRON if (BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON || \ + BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) diff --git a/boards/nordic/nrf54h20dk/board.cmake b/boards/nordic/nrf54h20dk/board.cmake index b9383042b0c..093155e9322 100644 --- a/boards/nordic/nrf54h20dk/board.cmake +++ b/boards/nordic/nrf54h20dk/board.cmake @@ -2,7 +2,10 @@ include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) -if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD) +if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON) if(CONFIG_SOC_NRF54H20_CPUAPP) set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuapp.JLinkScript) else() @@ -14,7 +17,7 @@ if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54H20DK_NRF54H20_C endif() if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUFLPR) - if(CONFIG_SOC_NRF54H20_CPUPPR) + if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR) set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuppr.JLinkScript) else() set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuflpr.JLinkScript) diff --git a/boards/nordic/nrf54h20dk/board.yml b/boards/nordic/nrf54h20dk/board.yml index 2d3d40c20e0..a54cf1ae549 100644 --- a/boards/nordic/nrf54h20dk/board.yml +++ b/boards/nordic/nrf54h20dk/board.yml @@ -9,6 +9,10 @@ board: cpucluster: cpuppr - name: xip cpucluster: cpuflpr + - name: iron + cpucluster: cpuapp + - name: iron + cpucluster: cpurad revision: format: major.minor.patch default: "0.9.0" diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi index f31d909b6f9..94cda5e8ee2 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi @@ -7,17 +7,17 @@ / { ipc { cpusec_cpuapp_ipc: ipc-1-2 { - compatible = "nordic,ironside-call"; + compatible = "zephyr,ipc-icmsg"; status = "disabled"; - memory-region = <&cpusec_cpuapp_ipc_shm>; + dcache-alignment = <32>; mboxes = <&cpusec_bellboard 12>, <&cpuapp_bellboard 0>; }; cpusec_cpurad_ipc: ipc-1-3 { - compatible = "nordic,ironside-call"; + compatible = "zephyr,ipc-icmsg"; status = "disabled"; - memory-region = <&cpusec_cpurad_ipc_shm>; + dcache-alignment = <32>; mboxes = <&cpusec_bellboard 18>, <&cpurad_bellboard 0>; }; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi new file mode 100644 index 00000000000..a44db40538d --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is to be merged with the original ipc_conf.dtsi in the future. */ + +/ { + ipc { + /delete-node/ ipc-1-2; + /delete-node/ ipc-1-3; + + cpusec_cpuapp_ipc: ipc-1-2 { + compatible = "nordic,ironside-call"; + memory-region = <&cpusec_cpuapp_ipc_shm>; + mboxes = <&cpusec_bellboard 12>, + <&cpuapp_bellboard 0>; + status = "disabled"; + }; + + cpusec_cpurad_ipc: ipc-1-3 { + compatible = "nordic,ironside-call"; + memory-region = <&cpusec_cpurad_ipc_shm>; + mboxes = <&cpusec_bellboard 18>, + <&cpurad_bellboard 0>; + status = "disabled"; + }; + }; +}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index cd595d6cd5d..f2937402554 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -16,6 +16,14 @@ #size-cells = <1>; ranges = <0x0 0x2f010000 0x41000>; + cpusec_cpuapp_ipc_shm: memory@0 { + reg = <0x0 DT_SIZE_K(2)>; + }; + + cpuapp_cpusec_ipc_shm: memory@800 { + reg = <0x800 DT_SIZE_K(2)>; + }; + cpuapp_data: memory@1000 { reg = <0x1000 DT_SIZE_K(256)>; }; @@ -29,6 +37,14 @@ #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x2f051000 0x1000>; + + cpusec_cpurad_ipc_shm: memory@0 { + reg = <0x0 DT_SIZE_K(2)>; + }; + + cpurad_cpusec_ipc_shm: memory@800 { + reg = <0x800 DT_SIZE_K(2)>; + }; }; etr_buf_ram0x_region: memory@2f0be000 { @@ -65,44 +81,20 @@ }; }; - cpuapp_cpusys_ipc_shm: memory@2f88f600 { - reg = <0x2f88f600 0x80>; - }; - - cpusys_cpuapp_ipc_shm: memory@2f88f680 { - reg = <0x2f88f680 0x80>; - }; - - cpurad_cpusys_ipc_shm: memory@2f88f700 { - reg = <0x2f88f700 0x80>; + cpuapp_cpusys_ipc_shm: memory@2f88fce0 { + reg = <0x2f88fce0 0x80>; }; - cpusys_cpurad_ipc_shm: memory@2f88f780 { - reg = <0x2f88f780 0x80>; + cpusys_cpuapp_ipc_shm: memory@2f88fd60 { + reg = <0x2f88fd60 0x80>; }; - cpusec_cpurad_ipc_shm: memory@2f88f800 { - reg = <0x2f88f800 0x80>; + cpurad_cpusys_ipc_shm: memory@2f88fe00 { + reg = <0x2f88fe00 0x80>; }; - cpurad_ironside_se_event_report: memory@2f88f880 { - reg = <0x2f88f880 0x100>; - }; - - cpurad_ironside_se_boot_report: memory@2f88f980 { - reg = <0x2f88f980 0x200>; - }; - - cpusec_cpuapp_ipc_shm: memory@2f88fb80 { - reg = <0x2f88fb80 0x80>; - }; - - cpuapp_ironside_se_event_report: memory@2f88fc00 { - reg = <0x2f88fc00 0x100>; - }; - - cpuapp_ironside_se_boot_report: memory@2f88fd00 { - reg = <0x2f88fd00 0x200>; + cpusys_cpurad_ipc_shm: memory@2f88fe80 { + reg = <0x2f88fe80 0x80>; }; /* @@ -195,21 +187,27 @@ }; &mram1x { - partitions { - compatible = "fixed-partitions"; + cpurad_rx_partitions: cpurad-rx-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "disabled"; + nordic,access = ; #address-cells = <1>; #size-cells = <1>; - cpuapp_boot_partition: partition@2c000 { - reg = <0x2c000 DT_SIZE_K(64)>; + cpurad_slot0_partition: partition@54000 { + reg = <0x54000 DT_SIZE_K(256)>; }; + }; - cpuapp_slot0_partition: partition@3c000 { - reg = <0x3c000 DT_SIZE_K(336)>; - }; + cpuapp_rx_partitions: cpuapp-rx-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "disabled"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; - cpurad_slot0_partition: partition@90000 { - reg = <0x90000 DT_SIZE_K(336)>; + cpuapp_slot0_partition: partition@94000 { + reg = <0x94000 DT_SIZE_K(320)>; }; cpuppr_code_partition: partition@e4000 { @@ -219,17 +217,21 @@ cpuflpr_code_partition: partition@f4000 { reg = <0xf4000 DT_SIZE_K(48)>; }; + }; - cpuapp_slot1_partition: partition@100000 { - reg = <0x100000 DT_SIZE_K(336)>; - }; + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "disabled"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; - cpurad_slot1_partition: partition@154000 { - reg = <0x154000 DT_SIZE_K(336)>; + dfu_partition: partition@100000 { + reg = < 0x100000 DT_SIZE_K(908) >; }; - storage_partition: partition@1a8000 { - reg = <0x1a8000 DT_SIZE_K(40)>; + storage_partition: partition@1e3000 { + reg = < 0x1e3000 DT_SIZE_K(40) >; }; }; }; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi new file mode 100644 index 00000000000..2977e83758b --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map_iron.dtsi @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is to be merged with the original memory_map.dtsi in the future. + * The following nodes will be replaced: + */ +/delete-node/ &cpuapp_cpusec_ipc_shm; +/delete-node/ &cpuapp_cpusys_ipc_shm; +/delete-node/ &cpurad_cpusec_ipc_shm; +/delete-node/ &cpurad_cpusys_ipc_shm; +/delete-node/ &cpusec_cpuapp_ipc_shm; +/delete-node/ &cpusec_cpurad_ipc_shm; +/delete-node/ &cpusys_cpuapp_ipc_shm; +/delete-node/ &cpusys_cpurad_ipc_shm; +/delete-node/ &cpuapp_rw_partitions; +/delete-node/ &cpuapp_rx_partitions; +/delete-node/ &cpurad_rx_partitions; + +/ { + reserved-memory { + cpuapp_cpusys_ipc_shm: memory@2f88f600 { + reg = <0x2f88f600 0x80>; + }; + + cpusys_cpuapp_ipc_shm: memory@2f88f680 { + reg = <0x2f88f680 0x80>; + }; + + cpurad_cpusys_ipc_shm: memory@2f88f700 { + reg = <0x2f88f700 0x80>; + }; + + cpusys_cpurad_ipc_shm: memory@2f88f780 { + reg = <0x2f88f780 0x80>; + }; + + cpusec_cpurad_ipc_shm: memory@2f88f800 { + reg = <0x2f88f800 0x80>; + }; + + cpurad_ironside_se_event_report: memory@2f88f880 { + reg = <0x2f88f880 0x100>; + }; + + cpurad_ironside_se_boot_report: memory@2f88f980 { + reg = <0x2f88f980 0x200>; + }; + + cpusec_cpuapp_ipc_shm: memory@2f88fb80 { + reg = <0x2f88fb80 0x80>; + }; + + cpuapp_ironside_se_event_report: memory@2f88fc00 { + reg = <0x2f88fc00 0x100>; + }; + + cpuapp_ironside_se_boot_report: memory@2f88fd00 { + reg = <0x2f88fd00 0x200>; + }; + }; +}; + +&mram1x { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_boot_partition: partition@2c000 { + reg = <0x2c000 DT_SIZE_K(64)>; + }; + + cpuapp_slot0_partition: partition@3c000 { + reg = <0x3c000 DT_SIZE_K(336)>; + }; + + cpurad_slot0_partition: partition@90000 { + reg = <0x90000 DT_SIZE_K(336)>; + }; + + cpuppr_code_partition: partition@e4000 { + reg = <0xe4000 DT_SIZE_K(64)>; + }; + + cpuflpr_code_partition: partition@f4000 { + reg = <0xf4000 DT_SIZE_K(48)>; + }; + + cpuapp_slot1_partition: partition@100000 { + reg = <0x100000 DT_SIZE_K(336)>; + }; + + cpurad_slot1_partition: partition@154000 { + reg = <0x154000 DT_SIZE_K(336)>; + }; + + storage_partition: partition@1a8000 { + reg = <0x1a8000 DT_SIZE_K(40)>; + }; + }; +}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 16c573d127e..9cbc9035d4f 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -18,11 +18,10 @@ chosen { zephyr,console = &uart136; - zephyr,code-partition = &slot0_partition; + zephyr,code-partition = &cpuapp_slot0_partition; zephyr,flash = &mram1x; zephyr,sram = &cpuapp_data; zephyr,shell-uart = &uart136; - zephyr,uart-mcumgr = &uart136; zephyr,ieee802154 = &cpuapp_ieee802154; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; @@ -146,6 +145,8 @@ &cpusec_cpuapp_ipc { status = "okay"; mbox-names = "tx", "rx"; + tx-region = <&cpuapp_cpusec_ipc_shm>; + rx-region = <&cpusec_cpuapp_ipc_shm>; }; &cpusec_bellboard { @@ -189,26 +190,12 @@ ipc0: &cpuapp_cpurad_ipc { status = "okay"; }; -ironside_se_boot_report: &cpuapp_ironside_se_boot_report {}; - -boot_partition: &cpuapp_boot_partition { - label = "mcuboot"; -}; - -slot0_partition: &cpuapp_slot0_partition { - label = "image-0"; -}; - -slot1_partition: &cpuapp_slot1_partition { - label = "image-1"; -}; - -slot2_partition: &cpurad_slot0_partition { - label = "image-2"; +&cpuapp_rx_partitions { + status = "okay"; }; -slot3_partition: &cpurad_slot1_partition { - label = "image-3"; +&cpuapp_rw_partitions { + status = "okay"; }; &cpuppr_vpr { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig index 5b27932f785..d3ce90b8a38 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig @@ -8,6 +8,8 @@ CONFIG_SERIAL=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y +CONFIG_USE_DT_CODE_PARTITION=y + # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts new file mode 100644 index 00000000000..e822cf2c911 --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54h20dk_nrf54h20_cpuapp.dts" +#include "nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi" +#include "nrf54h20dk_nrf54h20-memory_map_iron.dtsi" + +/delete-node/ &cpusec_cpurad_ipc; + +/ { + chosen { + zephyr,code-partition = &slot0_partition; + zephyr,uart-mcumgr = &uart136; + }; +}; + +&cpusec_cpuapp_ipc { + mbox-names = "tx", "rx"; + status = "okay"; +}; + +ironside_se_boot_report: &cpuapp_ironside_se_boot_report {}; + +boot_partition: &cpuapp_boot_partition { + label = "mcuboot"; +}; + +slot0_partition: &cpuapp_slot0_partition { + label = "image-0"; +}; + +slot1_partition: &cpuapp_slot1_partition { + label = "image-1"; +}; + +slot2_partition: &cpurad_slot0_partition { + label = "image-2"; +}; + +slot3_partition: &cpurad_slot1_partition { + label = "image-3"; +}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml new file mode 100644 index 00000000000..563a8b4ac1b --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml @@ -0,0 +1,25 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54h20dk/nrf54h20/cpuapp/iron +name: nRF54H20-DK-nRF54H20-Application (IronSide compatible) (revision 0.9.0) +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +sysbuild: true +ram: 256 +flash: 480 +supported: + - adc + - can + - counter + - gpio + - i2c + - pwm + - retained_mem + - spi + - watchdog + - usbd diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_defconfig new file mode 100644 index 00000000000..bf3b6ac01e4 --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_defconfig @@ -0,0 +1,26 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# MPU-based null-pointer dereferencing detection cannot be applied +# as the (0x0 - 0x400) region is unmapped for this target. +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y + +# Enable cache +CONFIG_CACHE_MANAGEMENT=y +CONFIG_EXTERNAL_CACHE=y + +# Enable GPIO +CONFIG_GPIO=y + +# UICR generation is not supported, and when reintroduced will not use nrf-regtool. +CONFIG_NRF_REGTOOL_GENERATE_UICR=n diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 2813d5b1174..ebeb2aeeaff 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -24,7 +24,6 @@ zephyr,flash = &mram1x; zephyr,sram = &cpurad_ram0; zephyr,shell-uart = &uart135; - zephyr,uart-mcumgr = &uart135; zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; @@ -63,6 +62,8 @@ &cpusec_cpurad_ipc { status = "okay"; mbox-names = "tx", "rx"; + tx-region = <&cpurad_cpusec_ipc_shm>; + rx-region = <&cpusec_cpurad_ipc_shm>; }; &cpusec_bellboard { @@ -89,12 +90,8 @@ ipc0: &cpuapp_cpurad_ipc { status = "okay"; }; -slot0_partition: &cpurad_slot0_partition { - label = "image-0"; -}; - -slot1_partition: &cpurad_slot1_partition { - label = "image-1"; +&cpurad_rx_partitions { + status = "okay"; }; &grtc { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts new file mode 100644 index 00000000000..16b599f554e --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54h20dk_nrf54h20_cpurad.dts" +#include "nrf54h20dk_nrf54h20-ipc_conf_iron.dtsi" +#include "nrf54h20dk_nrf54h20-memory_map_iron.dtsi" + +/ { + chosen { + zephyr,code-partition = &cpurad_slot0_partition; + zephyr,uart-mcumgr = &uart135; + }; +}; + +&cpusec_cpurad_ipc { + mbox-names = "tx", "rx"; + status = "okay"; +}; + +slot0_partition: &cpurad_slot0_partition { + label = "image-0"; +}; + +slot1_partition: &cpurad_slot1_partition { + label = "image-1"; +}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml new file mode 100644 index 00000000000..034b9f7e27d --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml @@ -0,0 +1,20 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54h20dk/nrf54h20/cpurad/iron +name: nRF54H20-DK-nRF54H20-Radio (IronSide SE compatible) (revision 0.9.0) +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +sysbuild: true +ram: 192 +flash: 336 +supported: + - counter + - gpio + - pwm + - retained_mem + - spi diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig new file mode 100644 index 00000000000..4d247d80526 --- /dev/null +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig @@ -0,0 +1,25 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_USE_DT_CODE_PARTITION=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# MPU-based null-pointer dereferencing detection cannot be applied +# as the (0x0 - 0x400) region is unmapped for this target. +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y + +# Enable cache +CONFIG_CACHE_MANAGEMENT=y +CONFIG_EXTERNAL_CACHE=y + +# UICR generation is not supported, and when reintroduced will not use nrf-regtool. +CONFIG_NRF_REGTOOL_GENERATE_UICR=n diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index b57c718a9e2..c72fedef84a 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -152,6 +152,10 @@ reserved-memory { #address-cells = <1>; #size-cells = <1>; + + suit_storage_partition: memory@e1ed000 { + reg = <0xe1ed000 DT_SIZE_K(20)>; + }; }; clocks { diff --git a/samples/boards/nordic/nrf_ironside/update/README.rst b/samples/boards/nordic/nrf_ironside/update/README.rst index 484d97d0add..af72d23f391 100644 --- a/samples/boards/nordic/nrf_ironside/update/README.rst +++ b/samples/boards/nordic/nrf_ironside/update/README.rst @@ -25,8 +25,8 @@ The update procedure works as follows: Once the operation has completed, you can read the boot report to verify that the update has taken place. -Building and running the application for nrf54h20dk/nrf54h20/cpuapp -******************************************************************* +Building and running the application for nrf54h20dk/nrf54h20/cpuapp/iron +************************************************************************ .. note:: You can use this application only when there is already a version of IronSide SE installed on the device. @@ -55,7 +55,7 @@ Building and running the application for nrf54h20dk/nrf54h20/cpuapp .. zephyr-app-commands:: :zephyr-app: samples/boards/nordic/nrf_ironside/update - :board: nrf54h20dk/nrf54h20/cpuapp + :board: nrf54h20dk/nrf54h20/cpuapp/iron :goals: flash #. Trigger a reset: diff --git a/samples/boards/nordic/nrf_ironside/update/sample.yaml b/samples/boards/nordic/nrf_ironside/update/sample.yaml index 3a5d9477da2..cc127d9eb6d 100644 --- a/samples/boards/nordic/nrf_ironside/update/sample.yaml +++ b/samples/boards/nordic/nrf_ironside/update/sample.yaml @@ -5,8 +5,8 @@ common: build_only: true tags: nrf_ironside integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuapp/iron tests: sample.boards.nordic.nrf_ironside.update: - platform_allow: nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf54h20dk/nrf54h20/cpuapp/iron diff --git a/samples/drivers/counter/alarm/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay b/samples/drivers/counter/alarm/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay new file mode 100644 index 00000000000..f65b4dd3b0b --- /dev/null +++ b/samples/drivers/counter/alarm/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +#include "nrf54h20dk_nrf54h20_common.dtsi" diff --git a/samples/drivers/mbox/sample.yaml b/samples/drivers/mbox/sample.yaml index c18533c2c18..8a25dc0b3bf 100644 --- a/samples/drivers/mbox/sample.yaml +++ b/samples/drivers/mbox/sample.yaml @@ -65,7 +65,6 @@ tests: integration_platforms: - nrf54h20dk/nrf54h20/cpuapp extra_args: - - mbox_CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf sysbuild: true harness: console diff --git a/samples/drivers/watchdog/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay b/samples/drivers/watchdog/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay new file mode 100644 index 00000000000..102abfc8ef2 --- /dev/null +++ b/samples/drivers/watchdog/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay @@ -0,0 +1,8 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt010 { + status = "okay"; +}; diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml b/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml index fd6194cdc4f..8ede9b77d07 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml +++ b/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml @@ -88,7 +88,7 @@ tests: - mimxrt685_evk/mimxrt685s/cm33 - rd_rw612_bga - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuapp/iron - pinnacle_100_dvk - mg100 integration_platforms: diff --git a/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf b/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf new file mode 100644 index 00000000000..ca2bc07e4f2 --- /dev/null +++ b/samples/sysbuild/hello_world/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y diff --git a/samples/sysbuild/hello_world/sample.yaml b/samples/sysbuild/hello_world/sample.yaml index e638594c634..c8ca9cbe4c0 100644 --- a/samples/sysbuild/hello_world/sample.yaml +++ b/samples/sysbuild/hello_world/sample.yaml @@ -25,9 +25,13 @@ tests: - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp - extra_args: - - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf - - hello_world_CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y + extra_args: SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + + sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpurad.iron: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp/iron + extra_args: SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf + sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpuppr: platform_allow: - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf b/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf new file mode 100644 index 00000000000..8d4a230adbe --- /dev/null +++ b/samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad_iron.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad/iron" diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index e0818653772..a6af477c61a 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -379,7 +379,7 @@ def program_hex(self): ) if self.erase: - if self.family == 'nrf54h': + if self.build_conf.get('CONFIG_SOC_NRF54H20_IRON'): self.exec_op('erase', kind='all') else: self.exec_op('erase', core='Application', kind='all') @@ -464,8 +464,8 @@ def program_hex(self): self.logger.debug(f'Erase modes: chip:{erase_arg} ext_mem:' f'{ext_mem_erase_opt}') - # Temp hack while waiting for nrfutil Network support for NRF54H20 with IronSide - if self.family == 'nrf54h' and core == 'Network': + # Temp hack while waiting for NRF54H20_IRON support for Network in nrfutil + if self.build_conf.get('CONFIG_SOC_NRF54H20_IRON') and core == "Network": core = "Application" self.op_program(self.hex_, erase_arg, ext_mem_erase_opt, defer=True, core=core) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index a9e68bba0b2..8a91adf8ed0 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -3,7 +3,7 @@ config NRF_IRONSIDE bool - depends on SOC_NRF54H20 || SOC_NRF9280_IRON + depends on SOC_NRF54H20_IRON || SOC_NRF9280_IRON help This is selected by drivers interacting with Nordic IronSide firmware. @@ -28,7 +28,7 @@ config NRF_IRONSIDE_CALL_INIT_PRIORITY endif # NRF_IRONSIDE_CALL menu "Nordic IronSide services" - depends on SOC_NRF54H20 || SOC_NRF9280_IRON + depends on SOC_NRF54H20_IRON || SOC_NRF9280_IRON config NRF_IRONSIDE_CPUCONF_SERVICE bool "IronSide CPUCONF service" diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 97423a04e9b..ed9fc86f2fc 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -10,7 +10,6 @@ config SOC_SERIES_NRF54HX select SOC_EARLY_INIT_HOOK if ARM select SOC_LATE_INIT_HOOK if SOC_NRF54H20_CPURAD_ENABLE select NRF_PLATFORM_HALTIUM - select EXPERIMENTAL if MCUBOOT config SOC_NRF54H20_CPUAPP_COMMON bool @@ -89,3 +88,6 @@ config SOC_NRF54H20_CPUFLPR rsource "bicr/Kconfig" rsource "gpd/Kconfig" + +config SOC_NRF54H20_IRON + select EXPERIMENTAL if MCUBOOT diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index 69bde826ba4..595cc2d3886 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -8,6 +8,9 @@ if SOC_NRF54H20_CPUAPP config NUM_IRQS default 471 +config NRF_REGTOOL_GENERATE_UICR + default y + config SHELL_BACKEND_SERIAL default n if NRF_ETR_SHELL diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad index 8f86835b92c..1fffdeae6d2 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad @@ -8,6 +8,9 @@ if SOC_NRF54H20_CPURAD config NUM_IRQS default 471 +config NRF_REGTOOL_GENERATE_UICR + default y + config PM default y diff --git a/soc/nordic/nrf54h/Kconfig.soc b/soc/nordic/nrf54h/Kconfig.soc index 459854e13b2..62d5293bfe3 100644 --- a/soc/nordic/nrf54h/Kconfig.soc +++ b/soc/nordic/nrf54h/Kconfig.soc @@ -33,5 +33,10 @@ config SOC_NRF54H20_CPUFLPR help nRF54H20 CPUFLPR +config SOC_NRF54H20_IRON + bool + help + Indicates that local domain firmware is compatible with Nordic IronSide SE. + config SOC default "nrf54h20" if SOC_NRF54H20 diff --git a/tests/boards/nrf/nrfs/prj.conf b/tests/boards/nrf/nrfs/prj.conf index ee3da6976c4..c1a01949d60 100644 --- a/tests/boards/nrf/nrfs/prj.conf +++ b/tests/boards/nrf/nrfs/prj.conf @@ -19,5 +19,3 @@ CONFIG_LOG=y CONFIG_LOG_MODE_IMMEDIATE=n CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y - -CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y diff --git a/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay b/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay new file mode 100644 index 00000000000..0e01ff40bb9 --- /dev/null +++ b/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54h20dk_nrf54h20_common.dtsi" diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf new file mode 100644 index 00000000000..45e31e2fae4 --- /dev/null +++ b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.conf @@ -0,0 +1,2 @@ +# Disable dcache +CONFIG_DCACHE=n diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay new file mode 100644 index 00000000000..102abfc8ef2 --- /dev/null +++ b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54h20dk_nrf54h20_cpuapp_iron.overlay @@ -0,0 +1,8 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt010 { + status = "okay"; +}; diff --git a/tests/subsys/ipc/ipc_sessions/testcase.yaml b/tests/subsys/ipc/ipc_sessions/testcase.yaml index a4d34a394dd..f76a61b8d68 100644 --- a/tests/subsys/ipc/ipc_sessions/testcase.yaml +++ b/tests/subsys/ipc/ipc_sessions/testcase.yaml @@ -20,7 +20,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - CONFIG_IPC_TEST_SKIP_CORE_RESET=y - - CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y sample.ipc.ipc_sessions.nrf54h20dk_cpuapp_cpuppr: platform_allow: - nrf54h20dk/nrf54h20/cpuapp From 898a991b224b1b186dd22db88d033a7e70a6c8ae Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 320/881] Revert "[nrf fromtree] tests: boards: nrf: nrfs: Build main image for app core only" This reverts commit dd86ab537cee1ac7917810a8c48a51aaf29a69f0. Signed-off-by: Jukka Rissanen --- tests/boards/nrf/nrfs/Kconfig.sysbuild | 1 + tests/boards/nrf/nrfs/testcase.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/boards/nrf/nrfs/Kconfig.sysbuild b/tests/boards/nrf/nrfs/Kconfig.sysbuild index 6cc7dc9575a..f281257725f 100644 --- a/tests/boards/nrf/nrfs/Kconfig.sysbuild +++ b/tests/boards/nrf/nrfs/Kconfig.sysbuild @@ -6,3 +6,4 @@ source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" config REMOTE_BOARD string default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP + default "$(BOARD)/nrf54h20/cpuapp" if SOC_NRF54H20_CPURAD diff --git a/tests/boards/nrf/nrfs/testcase.yaml b/tests/boards/nrf/nrfs/testcase.yaml index d1974f00d7c..315c3cf7f37 100644 --- a/tests/boards/nrf/nrfs/testcase.yaml +++ b/tests/boards/nrf/nrfs/testcase.yaml @@ -1,8 +1,10 @@ common: platform_allow: - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad integration_platforms: - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad tags: - nrfs harness: ztest From 527e6b43b3ed73c48f0d7412ddd0b06df5c810ce Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:13 +0300 Subject: [PATCH 321/881] Revert "[nrf fromtree] samples: drivers: mbox: switch nrf54h20 cpuapp and cpurad remotes" This reverts commit bff309cc23e793fdb8efc94eceedf1983c29a7e2. Signed-off-by: Jukka Rissanen --- samples/drivers/mbox/CMakeLists.txt | 1 + samples/drivers/mbox/Kconfig.sysbuild | 1 + .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 0 samples/drivers/mbox/remote/CMakeLists.txt | 2 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 0 samples/drivers/mbox/sample.yaml | 12 +++++------- .../mbox/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf | 1 - 7 files changed, 8 insertions(+), 9 deletions(-) rename samples/drivers/mbox/{remote => }/boards/nrf54h20dk_nrf54h20_cpurad.overlay (100%) rename samples/drivers/mbox/{ => remote}/boards/nrf54h20dk_nrf54h20_cpuapp.overlay (100%) delete mode 100644 samples/drivers/mbox/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/drivers/mbox/CMakeLists.txt b/samples/drivers/mbox/CMakeLists.txt index e5d5e612c79..d6bada1a50e 100644 --- a/samples/drivers/mbox/CMakeLists.txt +++ b/samples/drivers/mbox/CMakeLists.txt @@ -24,6 +24,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_ESP32_DEVKITC_ESP32_PROCPU OR CONFIG_BOARD_ESP32S3_DEVKITM_ESP32S3_PROCPU OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUAPP OR CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUAPP OR CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP OR diff --git a/samples/drivers/mbox/Kconfig.sysbuild b/samples/drivers/mbox/Kconfig.sysbuild index 2a79840f389..76d3d240abc 100644 --- a/samples/drivers/mbox/Kconfig.sysbuild +++ b/samples/drivers/mbox/Kconfig.sysbuild @@ -18,6 +18,7 @@ config REMOTE_BOARD default "lpcxpresso55s69/lpc55s69/cpu1" if $(BOARD) = "lpcxpresso55s69" default "frdm_mcxn947/mcxn947/cpu1" if $(BOARD) = "frdm_mcxn947" default "mcx_n9xx_evk/mcxn947/cpu1" if $(BOARD) = "mcx_n9xx_evk" + default "nrf54h20dk/nrf54h20/cpuapp" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpurad" default "nrf54l09pdk/nrf54l09/cpuflpr" if $(BOARD) = "nrf54l09pdk" default "nrf54l15dk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15dk" default "nrf54lm20dk/nrf54lm20a/cpuflpr" if $(BOARD) = "nrf54lm20dk" diff --git a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpurad.overlay similarity index 100% rename from samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay rename to samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpurad.overlay diff --git a/samples/drivers/mbox/remote/CMakeLists.txt b/samples/drivers/mbox/remote/CMakeLists.txt index bd4c9e2e20e..c84efec1197 100644 --- a/samples/drivers/mbox/remote/CMakeLists.txt +++ b/samples/drivers/mbox/remote/CMakeLists.txt @@ -23,7 +23,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET OR CONFIG_BOARD_ESP32S3_DEVKITM_ESP32S3_APPCPU OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUFLPR OR - CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUFLPR OR CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUFLPR OR CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR OR diff --git a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuapp.overlay similarity index 100% rename from samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp.overlay rename to samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/samples/drivers/mbox/sample.yaml b/samples/drivers/mbox/sample.yaml index 8a25dc0b3bf..809d5e091dc 100644 --- a/samples/drivers/mbox/sample.yaml +++ b/samples/drivers/mbox/sample.yaml @@ -59,21 +59,19 @@ tests: - "Ping \\(on channel 16\\)" - "Pong \\(on channel 14\\)" - sample.drivers.mbox.nrf54h20_app_rad: + sample.drivers.mbox.nrf54h20_rad_app: platform_allow: - - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - extra_args: - - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + - nrf54h20dk/nrf54h20/cpurad sysbuild: true harness: console harness_config: type: multi_line ordered: false regex: - - "Ping \\(on channel 12\\)" - - "Pong \\(on channel 18\\)" + - "Ping \\(on channel 18\\)" + - "Pong \\(on channel 12\\)" sample.drivers.mbox.nrf54l: platform_allow: diff --git a/samples/drivers/mbox/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/samples/drivers/mbox/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index dd863e78d99..00000000000 --- a/samples/drivers/mbox/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" From 9eaf2d5ce2881f16d5fde93d260aebdf3a483c8e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 322/881] Revert "[nrf fromtree] soc: Boot matching radio slot" This reverts commit 66adbc0343e431f68c12690588692bb3016238f8. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/soc.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index cdff2310355..0c43c617572 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -32,15 +32,6 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #define HSFLL_NODE DT_NODELABEL(cpurad_hsfll) #endif -#ifdef CONFIG_USE_DT_CODE_PARTITION -#define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) -#elif defined(CONFIG_FLASH_LOAD_OFFSET) -#define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET -#endif - -#define PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (DT_REG_ADDR(DT_NODELABEL(label)) == FLASH_LOAD_OFFSET) - sys_snode_t soc_node; #define FICR_ADDR_GET(node_id, name) \ @@ -53,6 +44,8 @@ sys_snode_t soc_node; ADDRESS_DOMAIN_Msk | \ ADDRESS_BUS_Msk))) +#define DT_NODELABEL_CPURAD_SLOT0_PARTITION DT_NODELABEL(cpurad_slot0_partition) + static void power_domain_init(void) { /* @@ -179,26 +172,11 @@ void soc_late_init_hook(void) */ uint8_t *msg = NULL; size_t msg_size = 0; - void *radiocore_address = NULL; - -#if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) - if (PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) { - radiocore_address = - (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot1_partition))) + - DT_REG_ADDR(DT_NODELABEL(cpurad_slot1_partition)) + - CONFIG_ROM_START_OFFSET); - } else { - radiocore_address = - (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) + - DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + - CONFIG_ROM_START_OFFSET); - } -#else - radiocore_address = - (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) + - DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + + + void *radiocore_address = + (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL_CPURAD_SLOT0_PARTITION)) + + DT_REG_ADDR(DT_NODELABEL_CPURAD_SLOT0_PARTITION) + CONFIG_ROM_START_OFFSET); -#endif /* Don't wait as this is not yet supported. */ bool cpu_wait = false; From 912e0c598dd794cf923d101ff1122974798f4df1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 323/881] Revert "[nrf fromtree] boards: nordic: Enable CONFIG_HW_STACK_PROTECTION conditionally" This reverts commit 401d0637330a495b11e8587a83fd7c8ddea1872e. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf21540dk/Kconfig.defconfig | 3 --- .../nordic/nrf21540dk/nrf21540dk_nrf52840_defconfig | 3 +++ boards/nordic/nrf52833dk/Kconfig.defconfig | 3 --- .../nordic/nrf52833dk/nrf52833dk_nrf52820_defconfig | 3 +++ .../nordic/nrf52833dk/nrf52833dk_nrf52833_defconfig | 3 +++ boards/nordic/nrf52840dk/Kconfig.defconfig | 3 --- .../nordic/nrf52840dk/nrf52840dk_nrf52811_defconfig | 3 +++ .../nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig | 3 +++ boards/nordic/nrf52840dongle/Kconfig.defconfig | 3 --- .../nrf52840dongle/nrf52840dongle_nrf52840_defconfig | 3 +++ boards/nordic/nrf52dk/Kconfig.defconfig | 11 ----------- boards/nordic/nrf52dk/nrf52dk_nrf52805_defconfig | 3 +++ boards/nordic/nrf52dk/nrf52dk_nrf52810_defconfig | 3 +++ boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig | 3 +++ boards/nordic/nrf5340_audio_dk/Kconfig.defconfig | 3 --- .../nrf5340_audio_dk_nrf5340_cpuapp_defconfig | 2 ++ .../nrf5340_audio_dk_nrf5340_cpuapp_ns_defconfig | 2 ++ .../nrf5340_audio_dk_nrf5340_cpunet_defconfig | 3 +++ boards/nordic/nrf5340dk/Kconfig.defconfig | 3 --- .../nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig | 3 +++ .../nrf5340dk/nrf5340dk_nrf5340_cpuapp_ns_defconfig | 3 +++ .../nrf5340dk/nrf5340dk_nrf5340_cpunet_defconfig | 3 +++ boards/nordic/nrf54h20dk/Kconfig.defconfig | 3 --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig | 3 +++ .../nrf54h20dk_nrf54h20_cpuapp_iron_defconfig | 3 +++ .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_defconfig | 3 +++ .../nrf54h20dk_nrf54h20_cpurad_iron_defconfig | 3 +++ boards/nordic/nrf54l09pdk/Kconfig.defconfig | 3 --- .../nrf54l09pdk/nrf54l09pdk_nrf54l09_cpuapp_defconfig | 3 +++ boards/nordic/nrf54l15dk/Kconfig.defconfig | 3 --- .../nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp_defconfig | 3 +++ .../nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_defconfig | 3 +++ .../nrf54l15dk_nrf54l10_cpuapp_ns_defconfig | 1 + .../nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig | 3 +++ .../nrf54l15dk_nrf54l15_cpuapp_ns_defconfig | 1 + boards/nordic/nrf54l20pdk/Kconfig.defconfig | 3 --- .../nrf54l20pdk/nrf54l20pdk_nrf54l20_cpuapp_defconfig | 3 +++ boards/nordic/nrf7002dk/Kconfig.defconfig | 11 ----------- .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig | 3 +++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_defconfig | 3 +++ .../nrf7002dk/nrf7002dk_nrf5340_cpunet_defconfig | 3 +++ boards/nordic/nrf9131ek/Kconfig.defconfig | 3 --- boards/nordic/nrf9131ek/nrf9131ek_nrf9131_defconfig | 3 +++ .../nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig | 3 +++ boards/nordic/nrf9151dk/Kconfig.defconfig | 3 --- boards/nordic/nrf9151dk/nrf9151dk_nrf9151_defconfig | 3 +++ .../nordic/nrf9151dk/nrf9151dk_nrf9151_ns_defconfig | 3 +++ boards/nordic/nrf9160dk/Kconfig.defconfig | 3 --- boards/nordic/nrf9160dk/nrf9160dk_nrf52840_defconfig | 3 +++ boards/nordic/nrf9160dk/nrf9160dk_nrf9160_defconfig | 3 +++ .../nordic/nrf9160dk/nrf9160dk_nrf9160_ns_defconfig | 3 +++ boards/nordic/nrf9161dk/Kconfig.defconfig | 3 --- boards/nordic/nrf9161dk/nrf9161dk_nrf9161_defconfig | 3 +++ .../nordic/nrf9161dk/nrf9161dk_nrf9161_ns_defconfig | 3 +++ boards/nordic/nrf9280pdk/Kconfig.defconfig | 3 --- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig | 3 +++ .../nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig | 3 +++ boards/nordic/thingy52/Kconfig.defconfig | 3 --- boards/nordic/thingy52/thingy52_nrf52832_defconfig | 3 +++ boards/nordic/thingy53/Kconfig.defconfig | 3 --- .../nordic/thingy53/thingy53_nrf5340_cpuapp_defconfig | 3 +++ .../thingy53/thingy53_nrf5340_cpuapp_ns_defconfig | 3 +++ .../nordic/thingy53/thingy53_nrf5340_cpunet_defconfig | 3 +++ 63 files changed, 126 insertions(+), 73 deletions(-) delete mode 100644 boards/nordic/nrf52dk/Kconfig.defconfig delete mode 100644 boards/nordic/nrf7002dk/Kconfig.defconfig diff --git a/boards/nordic/nrf21540dk/Kconfig.defconfig b/boards/nordic/nrf21540dk/Kconfig.defconfig index 6f2eea3c998..31642d14409 100644 --- a/boards/nordic/nrf21540dk/Kconfig.defconfig +++ b/boards/nordic/nrf21540dk/Kconfig.defconfig @@ -5,7 +5,4 @@ if BOARD_NRF21540DK -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - endif # BOARD_NRF21540DK diff --git a/boards/nordic/nrf21540dk/nrf21540dk_nrf52840_defconfig b/boards/nordic/nrf21540dk/nrf21540dk_nrf52840_defconfig index 7167aca850a..14367293292 100644 --- a/boards/nordic/nrf21540dk/nrf21540dk_nrf52840_defconfig +++ b/boards/nordic/nrf21540dk/nrf21540dk_nrf52840_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf52833dk/Kconfig.defconfig b/boards/nordic/nrf52833dk/Kconfig.defconfig index d016c17667e..dc6fbbdcf3d 100644 --- a/boards/nordic/nrf52833dk/Kconfig.defconfig +++ b/boards/nordic/nrf52833dk/Kconfig.defconfig @@ -5,7 +5,4 @@ if BOARD_NRF52833DK -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - endif # BOARD_NRF52833DK diff --git a/boards/nordic/nrf52833dk/nrf52833dk_nrf52820_defconfig b/boards/nordic/nrf52833dk/nrf52833dk_nrf52820_defconfig index 7167aca850a..14367293292 100644 --- a/boards/nordic/nrf52833dk/nrf52833dk_nrf52820_defconfig +++ b/boards/nordic/nrf52833dk/nrf52833dk_nrf52820_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf52833dk/nrf52833dk_nrf52833_defconfig b/boards/nordic/nrf52833dk/nrf52833dk_nrf52833_defconfig index 7167aca850a..14367293292 100644 --- a/boards/nordic/nrf52833dk/nrf52833dk_nrf52833_defconfig +++ b/boards/nordic/nrf52833dk/nrf52833dk_nrf52833_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf52840dk/Kconfig.defconfig b/boards/nordic/nrf52840dk/Kconfig.defconfig index 96aa4159c27..478445b229b 100644 --- a/boards/nordic/nrf52840dk/Kconfig.defconfig +++ b/boards/nordic/nrf52840dk/Kconfig.defconfig @@ -5,7 +5,4 @@ if BOARD_NRF52840DK -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - endif # BOARD_NRF52840DK diff --git a/boards/nordic/nrf52840dk/nrf52840dk_nrf52811_defconfig b/boards/nordic/nrf52840dk/nrf52840dk_nrf52811_defconfig index d94d5ee46d1..c076e7d8897 100644 --- a/boards/nordic/nrf52840dk/nrf52840dk_nrf52811_defconfig +++ b/boards/nordic/nrf52840dk/nrf52840dk_nrf52811_defconfig @@ -5,6 +5,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable UART CONFIG_SERIAL=y diff --git a/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig b/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig index 7167aca850a..14367293292 100644 --- a/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig +++ b/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf52840dongle/Kconfig.defconfig b/boards/nordic/nrf52840dongle/Kconfig.defconfig index 931786859b2..5bdbb6ce63b 100644 --- a/boards/nordic/nrf52840dongle/Kconfig.defconfig +++ b/boards/nordic/nrf52840dongle/Kconfig.defconfig @@ -6,9 +6,6 @@ if BOARD_NRF52840DONGLE -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - # To let the nRF5 bootloader load an application, the application # must be linked after Nordic MBR, that is factory-programmed on the board. diff --git a/boards/nordic/nrf52840dongle/nrf52840dongle_nrf52840_defconfig b/boards/nordic/nrf52840dongle/nrf52840dongle_nrf52840_defconfig index bb029eee81e..ffaccd75ea8 100644 --- a/boards/nordic/nrf52840dongle/nrf52840dongle_nrf52840_defconfig +++ b/boards/nordic/nrf52840dongle/nrf52840dongle_nrf52840_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf52dk/Kconfig.defconfig b/boards/nordic/nrf52dk/Kconfig.defconfig deleted file mode 100644 index fbe5fabf759..00000000000 --- a/boards/nordic/nrf52dk/Kconfig.defconfig +++ /dev/null @@ -1,11 +0,0 @@ -# nRF52 DK board configuration - -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF52DK - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_NRF52DK diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52805_defconfig b/boards/nordic/nrf52dk/nrf52dk_nrf52805_defconfig index 4e65cf49c0c..a4b09719b93 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52805_defconfig +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52805_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52810_defconfig b/boards/nordic/nrf52dk/nrf52dk_nrf52810_defconfig index e721f2360a1..a6749163af4 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52810_defconfig +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52810_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig b/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig index 7167aca850a..14367293292 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig b/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig index 0ba5af14907..7084af10d6b 100644 --- a/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig @@ -3,9 +3,6 @@ # Copyright (c) 2019 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS # Code Partition: diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_defconfig b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_defconfig index 13a1136435c..516f0cf7407 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_defconfig +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_defconfig @@ -3,6 +3,8 @@ CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y + CONFIG_ARM_TRUSTZONE_M=y CONFIG_GPIO=y diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_ns_defconfig index 604e4311a6d..5883909a4f0 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_ns_defconfig +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_ns_defconfig @@ -3,6 +3,8 @@ CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y + CONFIG_ARM_TRUSTZONE_M=y CONFIG_TRUSTED_EXECUTION_NONSECURE=y diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet_defconfig b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet_defconfig index 2225f146d9b..56940c43a09 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet_defconfig +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf5340dk/Kconfig.defconfig b/boards/nordic/nrf5340dk/Kconfig.defconfig index 497113310bf..6ba50229174 100644 --- a/boards/nordic/nrf5340dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340dk/Kconfig.defconfig @@ -3,9 +3,6 @@ # Copyright (c) 2019-2020 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS # Code Partition: diff --git a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig index 5b38cedf4b5..db40370dad0 100644 --- a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig +++ b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_ns_defconfig index 1da4e29c891..1886b926bfd 100644 --- a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_ns_defconfig +++ b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_ns_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet_defconfig b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet_defconfig index fd8622d4e36..39428726753 100644 --- a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet_defconfig +++ b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 3a6ba6b6d26..4023f3b0232 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -1,9 +1,6 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_NRF54H20DK_NRF54H20_CPUAPP config BT_HCI_IPC diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig index d3ce90b8a38..e1ba596d135 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig @@ -13,6 +13,9 @@ CONFIG_USE_DT_CODE_PARTITION=y # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # MPU-based null-pointer dereferencing detection cannot be applied # as the (0x0 - 0x400) region is unmapped for this target. CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_defconfig index bf3b6ac01e4..01f3bec3932 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_defconfig +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_defconfig @@ -11,6 +11,9 @@ CONFIG_UART_CONSOLE=y # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # MPU-based null-pointer dereferencing detection cannot be applied # as the (0x0 - 0x400) region is unmapped for this target. CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_defconfig index 87bdd63ea7d..27df01dee12 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_defconfig +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_defconfig @@ -13,6 +13,9 @@ CONFIG_USE_DT_CODE_PARTITION=y # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # MPU-based null-pointer dereferencing detection cannot be applied # as the (0x0 - 0x400) region is unmapped for this target. CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig index 4d247d80526..0ee0a96f99d 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_defconfig @@ -13,6 +13,9 @@ CONFIG_USE_DT_CODE_PARTITION=y # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # MPU-based null-pointer dereferencing detection cannot be applied # as the (0x0 - 0x400) region is unmapped for this target. CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y diff --git a/boards/nordic/nrf54l09pdk/Kconfig.defconfig b/boards/nordic/nrf54l09pdk/Kconfig.defconfig index 22c20a6a52e..f6c1efe188b 100644 --- a/boards/nordic/nrf54l09pdk/Kconfig.defconfig +++ b/boards/nordic/nrf54l09pdk/Kconfig.defconfig @@ -3,9 +3,6 @@ if BOARD_NRF54L09PDK_NRF54L09_CPUAPP -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - config ROM_START_OFFSET default 0x800 if BOOTLOADER_MCUBOOT diff --git a/boards/nordic/nrf54l09pdk/nrf54l09pdk_nrf54l09_cpuapp_defconfig b/boards/nordic/nrf54l09pdk/nrf54l09pdk_nrf54l09_cpuapp_defconfig index 33481a8f230..80996ce11ad 100644 --- a/boards/nordic/nrf54l09pdk/nrf54l09pdk_nrf54l09_cpuapp_defconfig +++ b/boards/nordic/nrf54l09pdk/nrf54l09pdk_nrf54l09_cpuapp_defconfig @@ -13,3 +13,6 @@ CONFIG_GPIO=y # Enable MPU CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/nordic/nrf54l15dk/Kconfig.defconfig b/boards/nordic/nrf54l15dk/Kconfig.defconfig index 0661366e911..04c1d9ddc23 100644 --- a/boards/nordic/nrf54l15dk/Kconfig.defconfig +++ b/boards/nordic/nrf54l15dk/Kconfig.defconfig @@ -1,9 +1,6 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ BOARD_NRF54L15DK_NRF54L15_CPUAPP diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp_defconfig index 33481a8f230..80996ce11ad 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp_defconfig @@ -13,3 +13,6 @@ CONFIG_GPIO=y # Enable MPU CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_defconfig index 33481a8f230..80996ce11ad 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_defconfig @@ -13,3 +13,6 @@ CONFIG_GPIO=y # Enable MPU CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig index d9f869918bf..1d759be671c 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig index 33481a8f230..80996ce11ad 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig @@ -13,3 +13,6 @@ CONFIG_GPIO=y # Enable MPU CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig index d9f869918bf..1d759be671c 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf54l20pdk/Kconfig.defconfig b/boards/nordic/nrf54l20pdk/Kconfig.defconfig index 4eac6259089..406a65c8826 100644 --- a/boards/nordic/nrf54l20pdk/Kconfig.defconfig +++ b/boards/nordic/nrf54l20pdk/Kconfig.defconfig @@ -3,9 +3,6 @@ if BOARD_NRF54L20PDK_NRF54L20_CPUAPP -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - config ROM_START_OFFSET default 0x800 if BOOTLOADER_MCUBOOT diff --git a/boards/nordic/nrf54l20pdk/nrf54l20pdk_nrf54l20_cpuapp_defconfig b/boards/nordic/nrf54l20pdk/nrf54l20pdk_nrf54l20_cpuapp_defconfig index 33481a8f230..80996ce11ad 100644 --- a/boards/nordic/nrf54l20pdk/nrf54l20pdk_nrf54l20_cpuapp_defconfig +++ b/boards/nordic/nrf54l20pdk/nrf54l20pdk_nrf54l20_cpuapp_defconfig @@ -13,3 +13,6 @@ CONFIG_GPIO=y # Enable MPU CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig deleted file mode 100644 index 48510d6e24f..00000000000 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ /dev/null @@ -1,11 +0,0 @@ -# nRF7002 DK board configuration - -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF7002DK - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_NRF7002DK diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig index a3e0cd63251..49f3e03e263 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_defconfig index e9003b07891..33a414dc380 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_defconfig +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_defconfig @@ -4,6 +4,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_defconfig index 2225f146d9b..56940c43a09 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_defconfig +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable GPIO CONFIG_GPIO=y diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index e1d8de241c0..3e422198078 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -3,8 +3,5 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - config BOARD_NRF9131EK select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS diff --git a/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_defconfig b/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_defconfig index dc9001bd610..c486d832382 100644 --- a/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_defconfig +++ b/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig b/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig index 0699ae4a785..d15d371416b 100644 --- a/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig +++ b/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf9151dk/Kconfig.defconfig b/boards/nordic/nrf9151dk/Kconfig.defconfig index 308f6f7441e..cfdc9c5f87e 100644 --- a/boards/nordic/nrf9151dk/Kconfig.defconfig +++ b/boards/nordic/nrf9151dk/Kconfig.defconfig @@ -2,9 +2,6 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -# -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION if BOARD_NRF9151DK_NRF9151 || BOARD_NRF9151DK_NRF9151_NS diff --git a/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_defconfig b/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_defconfig index dc9001bd610..c486d832382 100644 --- a/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_defconfig +++ b/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns_defconfig b/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns_defconfig index 244b153235f..2a74dd56f41 100644 --- a/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns_defconfig +++ b/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf9160dk/Kconfig.defconfig b/boards/nordic/nrf9160dk/Kconfig.defconfig index f27b36a40d1..b92acdd3f10 100644 --- a/boards/nordic/nrf9160dk/Kconfig.defconfig +++ b/boards/nordic/nrf9160dk/Kconfig.defconfig @@ -3,9 +3,6 @@ # Copyright (c) 2018-2020 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_NRF9160DK_NRF9160 || BOARD_NRF9160DK_NRF9160_NS config BOARD_NRF9160DK diff --git a/boards/nordic/nrf9160dk/nrf9160dk_nrf52840_defconfig b/boards/nordic/nrf9160dk/nrf9160dk_nrf52840_defconfig index 1863ff54588..cfe82dd2678 100644 --- a/boards/nordic/nrf9160dk/nrf9160dk_nrf52840_defconfig +++ b/boards/nordic/nrf9160dk/nrf9160dk_nrf52840_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable UART driver CONFIG_SERIAL=y diff --git a/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_defconfig b/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_defconfig index dc9001bd610..c486d832382 100644 --- a/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_defconfig +++ b/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_ns_defconfig b/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_ns_defconfig index 786906c85fc..624f98b1da3 100644 --- a/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_ns_defconfig +++ b/boards/nordic/nrf9160dk/nrf9160dk_nrf9160_ns_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf9161dk/Kconfig.defconfig b/boards/nordic/nrf9161dk/Kconfig.defconfig index 52e4067ecfa..28490a3c65d 100644 --- a/boards/nordic/nrf9161dk/Kconfig.defconfig +++ b/boards/nordic/nrf9161dk/Kconfig.defconfig @@ -3,9 +3,6 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_NRF9161DK_NRF9161 || BOARD_NRF9161DK_NRF9161_NS config BOARD_NRF9161DK diff --git a/boards/nordic/nrf9161dk/nrf9161dk_nrf9161_defconfig b/boards/nordic/nrf9161dk/nrf9161dk_nrf9161_defconfig index dc9001bd610..c486d832382 100644 --- a/boards/nordic/nrf9161dk/nrf9161dk_nrf9161_defconfig +++ b/boards/nordic/nrf9161dk/nrf9161dk_nrf9161_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf9161dk/nrf9161dk_nrf9161_ns_defconfig b/boards/nordic/nrf9161dk/nrf9161dk_nrf9161_ns_defconfig index 244b153235f..2a74dd56f41 100644 --- a/boards/nordic/nrf9161dk/nrf9161dk_nrf9161_ns_defconfig +++ b/boards/nordic/nrf9161dk/nrf9161dk_nrf9161_ns_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/nrf9280pdk/Kconfig.defconfig b/boards/nordic/nrf9280pdk/Kconfig.defconfig index 24669fc7f1e..ae7cb48cbc3 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.defconfig +++ b/boards/nordic/nrf9280pdk/Kconfig.defconfig @@ -1,9 +1,6 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_NRF9280PDK_NRF9280_CPUAPP config BT_HCI_IPC diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig index d3ce90b8a38..e1ba596d135 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig @@ -13,6 +13,9 @@ CONFIG_USE_DT_CODE_PARTITION=y # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # MPU-based null-pointer dereferencing detection cannot be applied # as the (0x0 - 0x400) region is unmapped for this target. CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig index 87bdd63ea7d..27df01dee12 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig @@ -13,6 +13,9 @@ CONFIG_USE_DT_CODE_PARTITION=y # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # MPU-based null-pointer dereferencing detection cannot be applied # as the (0x0 - 0x400) region is unmapped for this target. CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y diff --git a/boards/nordic/thingy52/Kconfig.defconfig b/boards/nordic/thingy52/Kconfig.defconfig index f9902cf481d..9e50838b5c2 100644 --- a/boards/nordic/thingy52/Kconfig.defconfig +++ b/boards/nordic/thingy52/Kconfig.defconfig @@ -5,7 +5,4 @@ if BOARD_THINGY52 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - endif # BOARD_THINGY52 diff --git a/boards/nordic/thingy52/thingy52_nrf52832_defconfig b/boards/nordic/thingy52/thingy52_nrf52832_defconfig index d142c1ed38e..401a71ab47a 100644 --- a/boards/nordic/thingy52/thingy52_nrf52832_defconfig +++ b/boards/nordic/thingy52/thingy52_nrf52832_defconfig @@ -7,6 +7,9 @@ CONFIG_REGULATOR=y # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable RTT CONFIG_USE_SEGGER_RTT=y diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index c1139f0dca1..d149d360f85 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -3,9 +3,6 @@ # Copyright (c) 2021 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS # Code Partition: diff --git a/boards/nordic/thingy53/thingy53_nrf5340_cpuapp_defconfig b/boards/nordic/thingy53/thingy53_nrf5340_cpuapp_defconfig index 7aac6819966..de1c1fd5964 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_cpuapp_defconfig +++ b/boards/nordic/thingy53/thingy53_nrf5340_cpuapp_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/thingy53/thingy53_nrf5340_cpuapp_ns_defconfig b/boards/nordic/thingy53/thingy53_nrf5340_cpuapp_ns_defconfig index f831ec5148e..39dc91517e0 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_cpuapp_ns_defconfig +++ b/boards/nordic/thingy53/thingy53_nrf5340_cpuapp_ns_defconfig @@ -3,6 +3,9 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y diff --git a/boards/nordic/thingy53/thingy53_nrf5340_cpunet_defconfig b/boards/nordic/thingy53/thingy53_nrf5340_cpunet_defconfig index 341b4431728..c115d16a9d0 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_cpunet_defconfig +++ b/boards/nordic/thingy53/thingy53_nrf5340_cpunet_defconfig @@ -3,5 +3,8 @@ # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Enable GPIO CONFIG_GPIO=y From bb1add9c3403c00b8cdae06852bfc53ecb6d2c26 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 324/881] Revert "[nrf fromtree] boards: nordic: Use dts for non-secure partitions" This reverts commit c57026d76594a40abc9e3851c7f924e3b73f3757. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf5340dk/Kconfig.defconfig | 26 ++++++++++++++---- boards/nordic/nrf54l15dk/Kconfig.defconfig | 14 +++++++--- boards/nordic/nrf9131ek/Kconfig.defconfig | 32 ++++++++++++++++++++-- boards/nordic/nrf9151dk/Kconfig.defconfig | 28 +++++++++++++++++-- boards/nordic/nrf9160dk/Kconfig.defconfig | 28 +++++++++++++++++-- boards/nordic/nrf9161dk/Kconfig.defconfig | 28 +++++++++++++++++-- 6 files changed, 138 insertions(+), 18 deletions(-) diff --git a/boards/nordic/nrf5340dk/Kconfig.defconfig b/boards/nordic/nrf5340dk/Kconfig.defconfig index 6ba50229174..b6186d4e074 100644 --- a/boards/nordic/nrf5340dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340dk/Kconfig.defconfig @@ -3,7 +3,7 @@ # Copyright (c) 2019-2020 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS +if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS # Code Partition: # @@ -29,19 +29,29 @@ if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS # For the non-secure version of the board, the firmware image SRAM is # always restricted to the allocated non-secure SRAM partition. # +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition if BOARD_NRF5340DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) config SRAM_SIZE default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) endif # BOARD_NRF5340DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE -config BOARD_NRF5340DK - select USE_DT_CODE_PARTITION if BOARD_NRF5340DK_NRF5340_CPUAPP_NS +if BOARD_NRF5340DK_NRF5340_CPUAPP_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif # BOARD_NRF5340DK_NRF5340_CPUAPP_NS config BT_HCI_IPC default y if BT @@ -50,4 +60,8 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD int default 4096 if BT_HCI_IPC -endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS +endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS + +if BOARD_NRF5340DK_NRF5340_CPUNET + +endif # BOARD_NRF5340DK_NRF5340_CPUNET diff --git a/boards/nordic/nrf54l15dk/Kconfig.defconfig b/boards/nordic/nrf54l15dk/Kconfig.defconfig index 04c1d9ddc23..9628b1fdf96 100644 --- a/boards/nordic/nrf54l15dk/Kconfig.defconfig +++ b/boards/nordic/nrf54l15dk/Kconfig.defconfig @@ -1,6 +1,10 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + if BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ BOARD_NRF54L15DK_NRF54L15_CPUAPP @@ -12,13 +16,15 @@ endif # BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS -config BOARD_NRF54L15DK - select USE_DT_CODE_PARTITION if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || \ - BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS - config BT_CTLR default BT +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + # By default, if we build for a Non-Secure version of the board, # enable building with TF-M as the Secure Execution Environment. config BUILD_WITH_TFM diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index 3e422198078..b63e7ef8d34 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -3,5 +3,33 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config BOARD_NRF9131EK - select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS +if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS + +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + depends on BOARD_NRF9131EK_NRF9131 && TRUSTED_EXECUTION_SECURE + +if BOARD_NRF9131EK_NRF9131_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif # BOARD_NRF9131EK_NRF9131_NS + +endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS diff --git a/boards/nordic/nrf9151dk/Kconfig.defconfig b/boards/nordic/nrf9151dk/Kconfig.defconfig index cfdc9c5f87e..21f036f7607 100644 --- a/boards/nordic/nrf9151dk/Kconfig.defconfig +++ b/boards/nordic/nrf9151dk/Kconfig.defconfig @@ -5,8 +5,32 @@ if BOARD_NRF9151DK_NRF9151 || BOARD_NRF9151DK_NRF9151_NS -config BOARD_NRF9151DK - select USE_DT_CODE_PARTITION if BOARD_NRF9151DK_NRF9151_NS +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + depends on BOARD_NRF9151DK_NRF9151 && TRUSTED_EXECUTION_SECURE + +if BOARD_NRF9151DK_NRF9151_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif # BOARD_NRF9151DK_NRF9151_NS config BT_HCI_VS default y if BT diff --git a/boards/nordic/nrf9160dk/Kconfig.defconfig b/boards/nordic/nrf9160dk/Kconfig.defconfig index b92acdd3f10..b26c68ef531 100644 --- a/boards/nordic/nrf9160dk/Kconfig.defconfig +++ b/boards/nordic/nrf9160dk/Kconfig.defconfig @@ -5,8 +5,32 @@ if BOARD_NRF9160DK_NRF9160 || BOARD_NRF9160DK_NRF9160_NS -config BOARD_NRF9160DK - select USE_DT_CODE_PARTITION if BOARD_NRF9160DK_NRF9160_NS +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + depends on BOARD_NRF9160DK_NRF9160 && TRUSTED_EXECUTION_SECURE + +if BOARD_NRF9160DK_NRF9160_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif # BOARD_NRF9160DK_NRF9160_NS config BT_HCI_VS default y if BT diff --git a/boards/nordic/nrf9161dk/Kconfig.defconfig b/boards/nordic/nrf9161dk/Kconfig.defconfig index 28490a3c65d..3790d580a29 100644 --- a/boards/nordic/nrf9161dk/Kconfig.defconfig +++ b/boards/nordic/nrf9161dk/Kconfig.defconfig @@ -5,8 +5,32 @@ if BOARD_NRF9161DK_NRF9161 || BOARD_NRF9161DK_NRF9161_NS -config BOARD_NRF9161DK - select USE_DT_CODE_PARTITION if BOARD_NRF9161DK_NRF9161_NS +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + depends on BOARD_NRF9161DK_NRF9161 && TRUSTED_EXECUTION_SECURE + +if BOARD_NRF9161DK_NRF9161_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif # BOARD_NRF9161DK_NRF9161_NS config BT_HCI_VS default y if BT From 5b89d6728b9a840a121df16a2689e6e05f25fa68 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 325/881] Revert "[nrf fromtree] soc: nordic: move nrf_ironside from drivers/firmware to soc/nordic" This reverts commit 8da799d316d7d18984b2d24229f614659ed9328b. Signed-off-by: Jukka Rissanen --- drivers/firmware/CMakeLists.txt | 1 + drivers/firmware/Kconfig | 1 + .../firmware/nrf_ironside}/CMakeLists.txt | 2 -- .../ironside => drivers/firmware/nrf_ironside}/Kconfig | 0 .../firmware/nrf_ironside}/boot_report.c | 2 +- .../ironside => drivers/firmware/nrf_ironside}/call.c | 2 +- .../ironside => drivers/firmware/nrf_ironside}/cpuconf.c | 4 ++-- .../ironside => drivers/firmware/nrf_ironside}/dvfs.c | 4 ++-- .../ironside => drivers/firmware/nrf_ironside}/update.c | 4 ++-- dts/bindings/{misc => firmware}/nordic,ironside-call.yaml | 0 .../zephyr/drivers/firmware}/nrf_ironside/boot_report.h | 6 +++--- .../zephyr/drivers/firmware}/nrf_ironside/call.h | 6 +++--- .../zephyr/drivers/firmware}/nrf_ironside/cpuconf.h | 8 ++++---- .../zephyr/drivers/firmware}/nrf_ironside/dvfs.h | 6 +++--- .../zephyr/drivers/firmware}/nrf_ironside/update.h | 6 +++--- samples/boards/nordic/nrf_ironside/update/src/main.c | 4 ++-- soc/nordic/CMakeLists.txt | 1 - soc/nordic/nrf54h/soc.c | 2 +- 18 files changed, 29 insertions(+), 30 deletions(-) rename {soc/nordic/ironside => drivers/firmware/nrf_ironside}/CMakeLists.txt (92%) rename {soc/nordic/ironside => drivers/firmware/nrf_ironside}/Kconfig (100%) rename {soc/nordic/ironside => drivers/firmware/nrf_ironside}/boot_report.c (89%) rename {soc/nordic/ironside => drivers/firmware/nrf_ironside}/call.c (98%) rename {soc/nordic/ironside => drivers/firmware/nrf_ironside}/cpuconf.c (92%) rename {soc/nordic/ironside => drivers/firmware/nrf_ironside}/dvfs.c (97%) rename {soc/nordic/ironside => drivers/firmware/nrf_ironside}/update.c (83%) rename dts/bindings/{misc => firmware}/nordic,ironside-call.yaml (100%) rename {soc/nordic/ironside/include => include/zephyr/drivers/firmware}/nrf_ironside/boot_report.h (91%) rename {soc/nordic/ironside/include => include/zephyr/drivers/firmware}/nrf_ironside/call.h (91%) rename {soc/nordic/ironside/include => include/zephyr/drivers/firmware}/nrf_ironside/cpuconf.h (89%) rename {soc/nordic/ironside/include => include/zephyr/drivers/firmware}/nrf_ironside/dvfs.h (92%) rename {soc/nordic/ironside/include => include/zephyr/drivers/firmware}/nrf_ironside/update.h (90%) diff --git a/drivers/firmware/CMakeLists.txt b/drivers/firmware/CMakeLists.txt index cb6cec89963..caed354c397 100644 --- a/drivers/firmware/CMakeLists.txt +++ b/drivers/firmware/CMakeLists.txt @@ -2,5 +2,6 @@ # zephyr-keep-sorted-start add_subdirectory_ifdef(CONFIG_ARM_SCMI scmi) +add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE nrf_ironside) add_subdirectory_ifdef(CONFIG_TISCI tisci) # zephyr-keep-sorted-stop diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 8cca2f588ed..3c92ec3bb6e 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -11,6 +11,7 @@ config ARM_SCMI Interface (SCMI). # zephyr-keep-sorted-start +source "drivers/firmware/nrf_ironside/Kconfig" source "drivers/firmware/scmi/Kconfig" source "drivers/firmware/tisci/Kconfig" # zephyr-keep-sorted-stop diff --git a/soc/nordic/ironside/CMakeLists.txt b/drivers/firmware/nrf_ironside/CMakeLists.txt similarity index 92% rename from soc/nordic/ironside/CMakeLists.txt rename to drivers/firmware/nrf_ironside/CMakeLists.txt index a0a18fc94a8..ddc46bd69b1 100644 --- a/soc/nordic/ironside/CMakeLists.txt +++ b/drivers/firmware/nrf_ironside/CMakeLists.txt @@ -1,8 +1,6 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -zephyr_include_directories(include) - zephyr_library() zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) diff --git a/soc/nordic/ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig similarity index 100% rename from soc/nordic/ironside/Kconfig rename to drivers/firmware/nrf_ironside/Kconfig diff --git a/soc/nordic/ironside/boot_report.c b/drivers/firmware/nrf_ironside/boot_report.c similarity index 89% rename from soc/nordic/ironside/boot_report.c rename to drivers/firmware/nrf_ironside/boot_report.c index ead0afca947..ee3e5ff3042 100644 --- a/soc/nordic/ironside/boot_report.c +++ b/drivers/firmware/nrf_ironside/boot_report.c @@ -5,7 +5,7 @@ #include #include -#include +#include #define IRONSIDE_SE_BOOT_REPORT_ADDR DT_REG_ADDR(DT_NODELABEL(ironside_se_boot_report)) diff --git a/soc/nordic/ironside/call.c b/drivers/firmware/nrf_ironside/call.c similarity index 98% rename from soc/nordic/ironside/call.c rename to drivers/firmware/nrf_ironside/call.c index de4f59943f6..f120c017549 100644 --- a/soc/nordic/ironside/call.c +++ b/drivers/firmware/nrf_ironside/call.c @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include #include #include +#include #include #include #include diff --git a/soc/nordic/ironside/cpuconf.c b/drivers/firmware/nrf_ironside/cpuconf.c similarity index 92% rename from soc/nordic/ironside/cpuconf.c rename to drivers/firmware/nrf_ironside/cpuconf.c index 264772a09e2..a8377ae0f93 100644 --- a/soc/nordic/ironside/cpuconf.c +++ b/drivers/firmware/nrf_ironside/cpuconf.c @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #define CPU_PARAMS_CPU_OFFSET (0) #define CPU_PARAMS_CPU_MASK (0xF) diff --git a/soc/nordic/ironside/dvfs.c b/drivers/firmware/nrf_ironside/dvfs.c similarity index 97% rename from soc/nordic/ironside/dvfs.c rename to drivers/firmware/nrf_ironside/dvfs.c index 7793ff015b1..dd1e64f6d34 100644 --- a/soc/nordic/ironside/dvfs.c +++ b/drivers/firmware/nrf_ironside/dvfs.c @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH; diff --git a/soc/nordic/ironside/update.c b/drivers/firmware/nrf_ironside/update.c similarity index 83% rename from soc/nordic/ironside/update.c rename to drivers/firmware/nrf_ironside/update.c index a56407a3fa1..8de21303b05 100644 --- a/soc/nordic/ironside/update.c +++ b/drivers/firmware/nrf_ironside/update.c @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include +#include +#include int ironside_update(const struct ironside_update_blob *update) { diff --git a/dts/bindings/misc/nordic,ironside-call.yaml b/dts/bindings/firmware/nordic,ironside-call.yaml similarity index 100% rename from dts/bindings/misc/nordic,ironside-call.yaml rename to dts/bindings/firmware/nordic,ironside-call.yaml diff --git a/soc/nordic/ironside/include/nrf_ironside/boot_report.h b/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h similarity index 91% rename from soc/nordic/ironside/include/nrf_ironside/boot_report.h rename to include/zephyr/drivers/firmware/nrf_ironside/boot_report.h index 7cd51267533..509c05babcb 100644 --- a/soc/nordic/ironside/include/nrf_ironside/boot_report.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ +#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_BOOT_REPORT_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_BOOT_REPORT_H_ #include #include @@ -74,4 +74,4 @@ struct ironside_boot_report { */ int ironside_boot_report_get(const struct ironside_boot_report **report); -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ */ +#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_BOOT_REPORT_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/call.h b/include/zephyr/drivers/firmware/nrf_ironside/call.h similarity index 91% rename from soc/nordic/ironside/include/nrf_ironside/call.h rename to include/zephyr/drivers/firmware/nrf_ironside/call.h index 9a2431c7d58..d67e9762202 100644 --- a/soc/nordic/ironside/include/nrf_ironside/call.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/call.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ +#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CALL_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CALL_H_ #include @@ -79,4 +79,4 @@ void ironside_call_dispatch(struct ironside_call_buf *buf); */ void ironside_call_release(struct ironside_call_buf *buf); -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ */ +#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CALL_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h similarity index 89% rename from soc/nordic/ironside/include/nrf_ironside/cpuconf.h rename to include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h index 49e562b1369..bed8932868f 100644 --- a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ +#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ #include #include +#include #include #include -#include /** * @name CPUCONF service error codes. @@ -71,4 +71,4 @@ BUILD_ASSERT(IRONSIDE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); int ironside_cpuconf(NRF_PROCESSORID_Type cpu, const void *vector_table, bool cpu_wait, const uint8_t *msg, size_t msg_size); -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ */ +#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_CPUCONF_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/dvfs.h b/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h similarity index 92% rename from soc/nordic/ironside/include/nrf_ironside/dvfs.h rename to include/zephyr/drivers/firmware/nrf_ironside/dvfs.h index e2cb03c249e..5a80f062bd7 100644 --- a/soc/nordic/ironside/include/nrf_ironside/dvfs.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ +#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_ #include #include @@ -89,4 +89,4 @@ static inline bool ironside_dvfs_is_oppoint_valid(enum ironside_dvfs_oppoint dvf return true; } -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ */ +#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/update.h b/include/zephyr/drivers/firmware/nrf_ironside/update.h similarity index 90% rename from soc/nordic/ironside/include/nrf_ironside/update.h rename to include/zephyr/drivers/firmware/nrf_ironside/update.h index 8152a77f5f7..5da02c97e6d 100644 --- a/soc/nordic/ironside/include/nrf_ironside/update.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/update.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ +#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ #include #include @@ -69,4 +69,4 @@ struct ironside_update_blob { */ int ironside_update(const struct ironside_update_blob *update); -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ */ +#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_UPDATE_H_ */ diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c index 11fb8824519..17098d93d3b 100644 --- a/samples/boards/nordic/nrf_ironside/update/src/main.c +++ b/samples/boards/nordic/nrf_ironside/update/src/main.c @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include +#include +#include #include LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); diff --git a/soc/nordic/CMakeLists.txt b/soc/nordic/CMakeLists.txt index cba58ae5187..5aec1af8820 100644 --- a/soc/nordic/CMakeLists.txt +++ b/soc/nordic/CMakeLists.txt @@ -47,4 +47,3 @@ endif() add_subdirectory(${SOC_SERIES}) add_subdirectory(common) -add_subdirectory(ironside) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 0c43c617572..e55f56242b9 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); From ea904f089ba76e370dcd5e73c65e25e48f736beb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 326/881] Revert "[nrf fromtree] drivers: firmware: nrf_ironside: Update the spelling" This reverts commit 049e7818669cd74d7ef545145376d4ed15c3161f. Signed-off-by: Jukka Rissanen --- ...nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml | 2 +- ...nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml | 2 +- drivers/firmware/nrf_ironside/Kconfig | 22 +++++++++---------- drivers/firmware/nrf_ironside/dvfs.c | 6 ++--- .../firmware/nordic,ironside-call.yaml | 2 +- .../firmware/nrf_ironside/boot_report.h | 14 ++++++------ .../drivers/firmware/nrf_ironside/call.h | 8 +++---- .../drivers/firmware/nrf_ironside/cpuconf.h | 2 +- .../drivers/firmware/nrf_ironside/dvfs.h | 10 ++++----- .../drivers/firmware/nrf_ironside/update.h | 12 +++++----- .../boards/nordic/nrf_ironside/update/Kconfig | 2 +- .../nordic/nrf_ironside/update/README.rst | 20 ++++++++--------- .../nordic/nrf_ironside/update/sample.yaml | 4 ++-- .../nordic/nrf_ironside/update/src/main.c | 2 +- soc/nordic/nrf54h/Kconfig.soc | 2 +- soc/nordic/nrf92/Kconfig.soc | 2 +- 16 files changed, 56 insertions(+), 56 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml index 563a8b4ac1b..eefca56fe0c 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron_0_9_0.yaml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 identifier: nrf54h20dk/nrf54h20/cpuapp/iron -name: nRF54H20-DK-nRF54H20-Application (IronSide compatible) (revision 0.9.0) +name: nRF54H20-DK-nRF54H20-Application (IRONside compatible) (revision 0.9.0) type: mcu arch: arm toolchain: diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml index 034b9f7e27d..ef71cfa924c 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron_0_9_0.yaml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 identifier: nrf54h20dk/nrf54h20/cpurad/iron -name: nRF54H20-DK-nRF54H20-Radio (IronSide SE compatible) (revision 0.9.0) +name: nRF54H20-DK-nRF54H20-Radio (IRONside SE compatible) (revision 0.9.0) type: mcu arch: arm toolchain: diff --git a/drivers/firmware/nrf_ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig index 8a91adf8ed0..4c313618638 100644 --- a/drivers/firmware/nrf_ironside/Kconfig +++ b/drivers/firmware/nrf_ironside/Kconfig @@ -5,7 +5,7 @@ config NRF_IRONSIDE bool depends on SOC_NRF54H20_IRON || SOC_NRF9280_IRON help - This is selected by drivers interacting with Nordic IronSide firmware. + This is selected by drivers interacting with Nordic IRONside firmware. config NRF_IRONSIDE_CALL bool @@ -14,44 +14,44 @@ config NRF_IRONSIDE_CALL select EVENTS select MBOX help - This is selected by features that require support for IronSide calls. + This is selected by features that require support for IRONside calls. if NRF_IRONSIDE_CALL config NRF_IRONSIDE_CALL_INIT_PRIORITY - int "IronSide calls' initialization priority" + int "IRONside calls' initialization priority" default 41 help - Initialization priority of IronSide calls. It must be below MBOX_INIT_PRIORITY, + Initialization priority of IRONside calls. It must be below MBOX_INIT_PRIORITY, but higher than the priority of any feature that selects NRF_IRONSIDE_CALL. endif # NRF_IRONSIDE_CALL -menu "Nordic IronSide services" +menu "Nordic IRONside services" depends on SOC_NRF54H20_IRON || SOC_NRF9280_IRON config NRF_IRONSIDE_CPUCONF_SERVICE - bool "IronSide CPUCONF service" + bool "IRONside CPUCONF service" depends on SOC_NRF54H20_CPUAPP || SOC_NRF9280_CPUAPP select NRF_IRONSIDE_CALL help Service used to boot local domain cores. config NRF_IRONSIDE_UPDATE_SERVICE - bool "IronSide update service" + bool "IRONside update service" select NRF_IRONSIDE_CALL help - Service used to update the IronSide SE firmware. + Service used to update the IRONside SE firmware. config NRF_IRONSIDE_BOOT_REPORT - bool "IronSide boot report" + bool "IRONside boot report" depends on $(dt_nodelabel_exists,ironside_se_boot_report) select NRF_IRONSIDE help - Support for parsing the Boot Report populated by Nordic IronSide firmware. + Support for parsing the Boot Report populated by Nordic IRONside firmware. config NRF_IRONSIDE_DVFS_SERVICE - bool "IronSide DVFS service" + bool "IRONside DVFS service" depends on SOC_NRF54H20_CPUAPP select NRF_IRONSIDE_CALL help diff --git a/drivers/firmware/nrf_ironside/dvfs.c b/drivers/firmware/nrf_ironside/dvfs.c index dd1e64f6d34..c814024b3ed 100644 --- a/drivers/firmware/nrf_ironside/dvfs.c +++ b/drivers/firmware/nrf_ironside/dvfs.c @@ -15,7 +15,7 @@ static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH; #define ABB_STATUSANA_LOCKED_L_Msk (0x1UL << ABB_STATUSANA_LOCKED_L_Pos) #define ABB_STATUSANA_REG_OFFSET (0x102UL) #else -#error "Unsupported SoC series for IronSide DVFS" +#error "Unsupported SoC series for IRONside DVFS" #endif struct dvfs_hsfll_data_t { @@ -133,8 +133,8 @@ static inline bool ironside_dvfs_is_abb_locked(NRF_ABB_Type *abb) } /** - * @brief Request DVFS oppoint change from IronSide secure domain. - * This function will send a request over IPC to the IronSide secure domain + * @brief Request DVFS oppoint change from IRONside secure domain. + * This function will send a request over IPC to the IRONside secure domain * This function is synchronous and will return when the request is completed. * * @param oppoint @ref enum ironside_dvfs_oppoint diff --git a/dts/bindings/firmware/nordic,ironside-call.yaml b/dts/bindings/firmware/nordic,ironside-call.yaml index a2605ff2294..14f39cb0b74 100644 --- a/dts/bindings/firmware/nordic,ironside-call.yaml +++ b/dts/bindings/firmware/nordic,ironside-call.yaml @@ -1,7 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -description: IPC configuration for Nordic IronSide calls +description: IPC configuration for Nordic IRONside calls compatible: "nordic,ironside-call" diff --git a/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h b/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h index 509c05babcb..8a209b8788d 100644 --- a/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/boot_report.h @@ -9,14 +9,14 @@ #include #include -/** Constant used to check if an Nordic IronSide SE boot report has been written. */ +/** Constant used to check if an Nordic IRONside SE boot report has been written. */ #define IRONSIDE_BOOT_REPORT_MAGIC (0x4d69546fUL) /** Length of the local domain context buffer in bytes. */ #define IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) /** Length of the random data buffer in bytes. */ #define IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) -/** @brief IronSide version structure. */ +/** @brief IRONside version structure. */ struct ironside_version { /** Wrapping sequence number ranging from 1-126, incremented for each release. */ uint8_t seqnum; @@ -43,13 +43,13 @@ struct ironside_boot_report_uicr_error { } description; }; -/** @brief IronSide boot report. */ +/** @brief IRONside boot report. */ struct ironside_boot_report { /** Magic value used to identify valid boot report */ uint32_t magic; - /** Firmware version of IronSide SE. */ + /** Firmware version of IRONside SE. */ struct ironside_version ironside_se_version; - /** Firmware version of IronSide SE recovery firmware. */ + /** Firmware version of IRONside SE recovery firmware. */ struct ironside_version ironside_se_recovery_version; /** Copy of SICR.UROT.UPDATE.STATUS.*/ uint32_t ironside_update_status; @@ -64,9 +64,9 @@ struct ironside_boot_report { }; /** - * @brief Get a pointer to the IronSide boot report. + * @brief Get a pointer to the IRONside boot report. * - * @param[out] report Will be set to point to the IronSide boot report. + * @param[out] report Will be set to point to the IRONside boot report. * * @retval 0 if successful. * @retval -EFAULT if the magic field in the report is incorrect. diff --git a/include/zephyr/drivers/firmware/nrf_ironside/call.h b/include/zephyr/drivers/firmware/nrf_ironside/call.h index d67e9762202..178b9371cdb 100644 --- a/include/zephyr/drivers/firmware/nrf_ironside/call.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/call.h @@ -8,7 +8,7 @@ #include -/** @brief Maximum number of arguments to an IronSide call. +/** @brief Maximum number of arguments to an IRONside call. * * This is chosen so that the containing message buffer size is minimal but * cache line aligned. @@ -50,7 +50,7 @@ struct ironside_call_buf { */ /** - * @brief Allocate memory for an IronSide call. + * @brief Allocate memory for an IRONside call. * * This function will block when no buffers are available, until one is * released by another thread on the client side. @@ -60,7 +60,7 @@ struct ironside_call_buf { struct ironside_call_buf *ironside_call_alloc(void); /** - * @brief Dispatch an IronSide call. + * @brief Dispatch an IRONside call. * * This function will block until a response is received from the server. * @@ -71,7 +71,7 @@ struct ironside_call_buf *ironside_call_alloc(void); void ironside_call_dispatch(struct ironside_call_buf *buf); /** - * @brief Release an IronSide call buffer. + * @brief Release an IRONside call buffer. * * This function must be called after processing the response. * diff --git a/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h index bed8932868f..d769a319def 100644 --- a/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h @@ -63,7 +63,7 @@ BUILD_ASSERT(IRONSIDE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); * If the given msg_size is less than that, the remaining bytes are set to zero. * * @retval 0 on success or if the CPU has already booted. - * @retval Positive non-0 error status if reported by IronSide call. + * @retval Positive non-0 error status if reported by IRONside call. * @retval -IRONSIDE_CPUCONF_ERROR_WRONG_CPU if cpu is unrecognized * @retval -IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE if msg_size is greater than * IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE. diff --git a/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h b/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h index 5a80f062bd7..7d6587bb3c0 100644 --- a/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h @@ -18,15 +18,15 @@ enum ironside_dvfs_oppoint { }; /** - * @brief Number of DVFS oppoints supported by IronSide. + * @brief Number of DVFS oppoints supported by IRONside. * - * This is the number of different DVFS oppoints that can be set on IronSide. + * This is the number of different DVFS oppoints that can be set on IRONside. * The oppoints are defined in the `ironside_dvfs_oppoint` enum. */ #define IRONSIDE_DVFS_OPPOINT_COUNT (3) /** - * @name IronSide DVFS service error codes. + * @name IRONside DVFS service error codes. * @{ */ @@ -49,10 +49,10 @@ enum ironside_dvfs_oppoint { * @} */ -/* IronSide call identifiers with implicit versions. +/* IRONside call identifiers with implicit versions. * * With the initial "version 0", the service ABI is allowed to break until the - * first production release of IronSide SE. + * first production release of IRONside SE. */ #define IRONSIDE_CALL_ID_DVFS_SERVICE_V0 3 diff --git a/include/zephyr/drivers/firmware/nrf_ironside/update.h b/include/zephyr/drivers/firmware/nrf_ironside/update.h index 5da02c97e6d..62191b3285b 100644 --- a/include/zephyr/drivers/firmware/nrf_ironside/update.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/update.h @@ -30,10 +30,10 @@ /** Length of the update signature in bytes. */ #define IRONSIDE_UPDATE_SIGNATURE_LENGTH (64) -/* IronSide call identifiers with implicit versions. +/* IRONside call identifiers with implicit versions. * * With the initial "version 0", the service ABI is allowed to break until the - * first production release of IronSide SE. + * first production release of IRONside SE. */ #define IRONSIDE_CALL_ID_UPDATE_SERVICE_V0 1 @@ -43,7 +43,7 @@ #define IRONSIDE_UPDATE_SERVICE_RETCODE_IDX (0) /** - * @brief IronSide update blob. + * @brief IRONside update blob. */ struct ironside_update_blob { uint8_t manifest[IRONSIDE_UPDATE_MANIFEST_LENGTH]; @@ -53,9 +53,9 @@ struct ironside_update_blob { }; /** - * @brief Request a firmware upgrade of the IronSide SE. + * @brief Request a firmware upgrade of the IRONside SE. * - * This invokes the IronSide SE update service. The device must be restarted for the update + * This invokes the IRONside SE update service. The device must be restarted for the update * to be installed. Check the update status in the application boot report to see if the update * was successfully installed. * @@ -63,7 +63,7 @@ struct ironside_update_blob { * * @retval -IRONSIDE_UPDATE_ERROR_NOT_PERMITTED if missing access to the update candidate. * @retval -IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED if writing update parameters to SICR failed. - * @returns Positive non-0 error status if reported by IronSide call. + * @returns Positive non-0 error status if reported by IRONside call. * @returns 0 on a successful request (although the update itself may still fail). * */ diff --git a/samples/boards/nordic/nrf_ironside/update/Kconfig b/samples/boards/nordic/nrf_ironside/update/Kconfig index 12d3350ef79..702b943ff60 100644 --- a/samples/boards/nordic/nrf_ironside/update/Kconfig +++ b/samples/boards/nordic/nrf_ironside/update/Kconfig @@ -6,6 +6,6 @@ config UPDATE_BLOB_ADDRESS default 0xe100000 help Address of the update blob. The default value matches the placement of the - update blobs delivered with the IronSide SE firmware. + update blobs delivered with the IRONside SE firmware. source "Kconfig.zephyr" diff --git a/samples/boards/nordic/nrf_ironside/update/README.rst b/samples/boards/nordic/nrf_ironside/update/README.rst index af72d23f391..2f44feedf06 100644 --- a/samples/boards/nordic/nrf_ironside/update/README.rst +++ b/samples/boards/nordic/nrf_ironside/update/README.rst @@ -1,24 +1,24 @@ .. zephyr:code-sample:: nrf_ironside_update - :name: Nordic IronSide SE firmware update + :name: Nordic IRONside SE firmware update - Update the Nordic IronSide SE firmware. + Update the Nordic IRONside SE firmware. Overview ******** -The Nordic IronSide SE Update sample updates the IronSide SE firmware on a SoC that already has IronSide SE installed. -It can update both the main image and the recovery image of IronSide SE using the IronSide SE firmware release ZIP file. +The Nordic IRONside SE Update sample updates the IRONside SE firmware on a SoC that already has IRONside SE installed. +It can update both the main image and the recovery image of IRONside SE using the IRONside SE firmware release ZIP file. Update procedure **************** The update procedure works as follows: -1. The application invokes the IronSide SE update service and passes the parameters that correspond to the location of the HEX file of the IronSide SE firmware update. +1. The application invokes the IRONside SE update service and passes the parameters that correspond to the location of the HEX file of the IRONside SE firmware update. #. The application prints the return value of the service call and outputs information from the update HEX file. -#. After the service call completes, the IronSide SE firmware updates the internal state of the device. +#. After the service call completes, the IRONside SE firmware updates the internal state of the device. #. The firmware installs the update during the next device boot. This operation can take several seconds. @@ -29,9 +29,9 @@ Building and running the application for nrf54h20dk/nrf54h20/cpuapp/iron ************************************************************************ .. note:: - You can use this application only when there is already a version of IronSide SE installed on the device. + You can use this application only when there is already a version of IRONside SE installed on the device. -1. Unzip the IronSide SE release ZIP to get the update hex file: +1. Unzip the IRONside SE release ZIP to get the update hex file: .. code-block:: console @@ -39,13 +39,13 @@ Building and running the application for nrf54h20dk/nrf54h20/cpuapp/iron #. Program the appropriate update hex file from the release ZIP using one (not both) of the following commands: - a) To update IronSide SE firmware: + a) To update IRONside SE firmware: .. code-block:: console nrfutil device program --traits jlink --firmware update/ironside_se_update.hex - b) To update IronSide SE recovery firmware: + b) To update IRONside SE recovery firmware: .. code-block:: console diff --git a/samples/boards/nordic/nrf_ironside/update/sample.yaml b/samples/boards/nordic/nrf_ironside/update/sample.yaml index cc127d9eb6d..af3c24624b8 100644 --- a/samples/boards/nordic/nrf_ironside/update/sample.yaml +++ b/samples/boards/nordic/nrf_ironside/update/sample.yaml @@ -1,6 +1,6 @@ sample: - name: Nordic IronSide SE update service - description: Demonstrates how to update the Nordic IronSide SE firmware + name: Nordic IRONside SE update service + description: Demonstrates how to update the Nordic IRONside SE firmware common: build_only: true tags: nrf_ironside diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c index 17098d93d3b..a06603ca9b2 100644 --- a/samples/boards/nordic/nrf_ironside/update/src/main.c +++ b/samples/boards/nordic/nrf_ironside/update/src/main.c @@ -28,7 +28,7 @@ int main(void) LOG_HEXDUMP_INF((void *)report->random_data, sizeof(report->random_data), "random data"); err = ironside_update(update); - LOG_INF("IronSide update retval: 0x%x", err); + LOG_INF("IRONside update retval: 0x%x", err); if (err == 0) { LOG_HEXDUMP_INF(update->manifest, sizeof(update->manifest), "Update manifest:"); diff --git a/soc/nordic/nrf54h/Kconfig.soc b/soc/nordic/nrf54h/Kconfig.soc index 62d5293bfe3..ac9101c177c 100644 --- a/soc/nordic/nrf54h/Kconfig.soc +++ b/soc/nordic/nrf54h/Kconfig.soc @@ -36,7 +36,7 @@ config SOC_NRF54H20_CPUFLPR config SOC_NRF54H20_IRON bool help - Indicates that local domain firmware is compatible with Nordic IronSide SE. + Indicates that local domain firmware is compatible with Nordic IRONside SE. config SOC default "nrf54h20" if SOC_NRF54H20 diff --git a/soc/nordic/nrf92/Kconfig.soc b/soc/nordic/nrf92/Kconfig.soc index 6ad2fb8a014..49891687a29 100644 --- a/soc/nordic/nrf92/Kconfig.soc +++ b/soc/nordic/nrf92/Kconfig.soc @@ -65,7 +65,7 @@ config SOC_NRF9280_CPUPPR config SOC_NRF9280_IRON bool help - Indicates that local domain firmware is compatible with Nordic IronSide SE. + Indicates that local domain firmware is compatible with Nordic IRONside SE. config SOC default "nrf9280" if SOC_NRF9280 From 978877a68566b4dbff824df1da09027ea80c92ec Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 327/881] Revert "[nrf fromtree] drivers: nrf_ironside: dvfs abb analog status workaround" This reverts commit f2a9184cfbe788df5ee926fcbdc20d6d1d975d78. Signed-off-by: Jukka Rissanen --- drivers/firmware/nrf_ironside/dvfs.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/firmware/nrf_ironside/dvfs.c b/drivers/firmware/nrf_ironside/dvfs.c index c814024b3ed..89208f71fb7 100644 --- a/drivers/firmware/nrf_ironside/dvfs.c +++ b/drivers/firmware/nrf_ironside/dvfs.c @@ -10,14 +10,6 @@ static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH; -#if defined(CONFIG_SOC_SERIES_NRF54HX) -#define ABB_STATUSANA_LOCKED_L_Pos (0UL) -#define ABB_STATUSANA_LOCKED_L_Msk (0x1UL << ABB_STATUSANA_LOCKED_L_Pos) -#define ABB_STATUSANA_REG_OFFSET (0x102UL) -#else -#error "Unsupported SoC series for IRONside DVFS" -#endif - struct dvfs_hsfll_data_t { uint32_t new_f_mult; uint32_t new_f_trim_entry; @@ -126,10 +118,7 @@ static void ironside_dvfs_change_oppoint_complete(enum ironside_dvfs_oppoint dvf static inline bool ironside_dvfs_is_abb_locked(NRF_ABB_Type *abb) { /* Check if ABB analog part is locked. */ - /* Temporary workaround until STATUSANA register is visible. */ - volatile const uint32_t *statusana = (uint32_t *)abb + ABB_STATUSANA_REG_OFFSET; - - return ((*statusana & ABB_STATUSANA_LOCKED_L_Msk) != 0); + return ((abb->STATUSANA & ABB_STATUSANA_LOCKED_Msk) != 0); } /** From b63d180c5bff3e8f2c7c783f467fa3c58b293926 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 328/881] Revert "[nrf fromtree] drivers: firmware: TISCI driver support" This reverts commit 4d841693325072528d19cbf11d5d2820701250b1. Signed-off-by: Jukka Rissanen --- drivers/firmware/CMakeLists.txt | 1 - drivers/firmware/Kconfig | 1 - drivers/firmware/tisci/CMakeLists.txt | 6 - drivers/firmware/tisci/Kconfig | 22 - drivers/firmware/tisci/tisci.c | 1602 --------------- drivers/firmware/tisci/tisci.h | 1820 ----------------- dts/bindings/firmware/ti,k2g-sci.yaml | 25 - include/zephyr/drivers/firmware/tisci/tisci.h | 1037 ---------- 8 files changed, 4514 deletions(-) delete mode 100644 drivers/firmware/tisci/CMakeLists.txt delete mode 100644 drivers/firmware/tisci/Kconfig delete mode 100644 drivers/firmware/tisci/tisci.c delete mode 100644 drivers/firmware/tisci/tisci.h delete mode 100644 dts/bindings/firmware/ti,k2g-sci.yaml delete mode 100644 include/zephyr/drivers/firmware/tisci/tisci.h diff --git a/drivers/firmware/CMakeLists.txt b/drivers/firmware/CMakeLists.txt index caed354c397..062106cf92b 100644 --- a/drivers/firmware/CMakeLists.txt +++ b/drivers/firmware/CMakeLists.txt @@ -3,5 +3,4 @@ # zephyr-keep-sorted-start add_subdirectory_ifdef(CONFIG_ARM_SCMI scmi) add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE nrf_ironside) -add_subdirectory_ifdef(CONFIG_TISCI tisci) # zephyr-keep-sorted-stop diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 3c92ec3bb6e..3e3afe9ffdd 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -13,7 +13,6 @@ config ARM_SCMI # zephyr-keep-sorted-start source "drivers/firmware/nrf_ironside/Kconfig" source "drivers/firmware/scmi/Kconfig" -source "drivers/firmware/tisci/Kconfig" # zephyr-keep-sorted-stop endmenu diff --git a/drivers/firmware/tisci/CMakeLists.txt b/drivers/firmware/tisci/CMakeLists.txt deleted file mode 100644 index 29d27c0f3f5..00000000000 --- a/drivers/firmware/tisci/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025, Texas Instruments -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library() - -zephyr_library_sources_ifdef(CONFIG_TISCI tisci.c) diff --git a/drivers/firmware/tisci/Kconfig b/drivers/firmware/tisci/Kconfig deleted file mode 100644 index 2cce1059341..00000000000 --- a/drivers/firmware/tisci/Kconfig +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2025, Texas Instruments -# SPDX-License-Identifier: Apache-2.0 - -config TISCI - bool "TISCI Firmware driver" - default y - depends on DT_HAS_TI_K2G_SCI_ENABLED - select MBOX - help - TISCI firmware driver is a frontend interface - to TI System Controller interface firmware through - secureproxy mailbox. - -if TISCI - -config TISCI_INIT_PRIORITY - int "TISCI init priority" - default KERNEL_INIT_PRIORITY_OBJECTS - help - Init priority for the TISCI driver. - -endif diff --git a/drivers/firmware/tisci/tisci.c b/drivers/firmware/tisci/tisci.c deleted file mode 100644 index 0206289bcbe..00000000000 --- a/drivers/firmware/tisci/tisci.c +++ /dev/null @@ -1,1602 +0,0 @@ -/* - * Copyright (c) 2025, Texas Instruments - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#define DT_DRV_COMPAT ti_k2g_sci -#include -#include -#include "tisci.h" -#include -#include -#include -#define LOG_LEVEL CONFIG_MBOX_LOG_LEVEL -#include -LOG_MODULE_REGISTER(ti_k2g_sci); - -/** - * @struct tisci_config - TISCI device configuration structure - * @mbox_tx: Mailbox transmit channel specification. - * @mbox_rx: Mailbox receive channel specification. - * @host_id: Host ID for the device. - * @max_msg_size: Maximum supported message size in bytes. - * @max_rx_timeout_ms: Maximum receive timeout in milliseconds. - */ -struct tisci_config { - struct mbox_dt_spec mbox_tx; - struct mbox_dt_spec mbox_rx; - uint32_t host_id; - int max_msg_size; - int max_rx_timeout_ms; -}; - -/** - * @struct tisci_xfer - TISCI transfer details - * @param tx_message: Transmit message - * @param rx_message: Received message - */ -struct tisci_xfer { - struct mbox_msg tx_message; - struct rx_msg rx_message; -}; - -/** - * @struct tisci_data - Runtime data for TISCI device communication - * @xfer: Structure holding the current transfer details, including buffers and status. - * @seq: Current transfer sequence number, used to track message order. - * @rx_message: Structure for storing the most recently received message. - * @data_sem: Semaphore used to synchronize access to the data structure. - */ -struct tisci_data { - struct tisci_xfer xfer; - uint8_t seq; - struct rx_msg rx_message; - struct k_sem data_sem; -}; - -/* Core/Setup Functions */ -static struct tisci_xfer *tisci_setup_one_xfer(const struct device *dev, uint16_t msg_type, - uint32_t msg_flags, void *req_buf, - size_t tx_message_size, void *resp_buf, - size_t rx_message_size) -{ - struct tisci_data *data = dev->data; - - k_sem_take(&data->data_sem, K_FOREVER); - - const struct tisci_config *config = dev->config; - struct tisci_xfer *xfer = &data->xfer; - struct tisci_msg_hdr *hdr; - - if (rx_message_size > config->max_msg_size || tx_message_size > config->max_msg_size || - (rx_message_size > 0 && rx_message_size < sizeof(*hdr)) || - tx_message_size < sizeof(*hdr)) { - return NULL; - } - - data->seq++; - - xfer->tx_message.data = req_buf; - xfer->tx_message.size = tx_message_size; - xfer->rx_message.buf = resp_buf; - xfer->rx_message.size = (uint8_t)rx_message_size; - - hdr = (struct tisci_msg_hdr *)req_buf; - hdr->seq = data->seq; - hdr->type = msg_type; - hdr->host = config->host_id; - hdr->flags = msg_flags; - - if (rx_message_size) { - hdr->flags = hdr->flags | TISCI_FLAG_REQ_ACK_ON_PROCESSED; - } - - return xfer; -} - -static void callback(const struct device *dev, mbox_channel_id_t channel_id, void *user_data, - struct mbox_msg *mbox_data) -{ - struct rx_msg *msg = user_data; - - k_sem_give(msg->response_ready_sem); -} - -static bool tisci_is_response_ack(void *r) -{ - struct tisci_msg_hdr *hdr = (struct tisci_msg_hdr *)r; - - return hdr->flags & TISCI_FLAG_RESP_GENERIC_ACK ? true : false; -} - -static int tisci_get_response(const struct device *dev, struct tisci_xfer *xfer) -{ - if (!dev) { - return -EINVAL; - } - - struct tisci_data *data = dev->data; - const struct tisci_config *config = dev->config; - struct tisci_msg_hdr *hdr; - - if (!xfer->rx_message.buf) { - LOG_ERR("No response buffer provided"); - return -EINVAL; - } - - if (k_sem_take(data->rx_message.response_ready_sem, K_MSEC(config->max_rx_timeout_ms)) != - 0) { - LOG_ERR("Timeout waiting for response"); - return -ETIMEDOUT; - } - - if (xfer->rx_message.size > config->max_msg_size) { - LOG_ERR("rx_message.size [ %d ] > max_msg_size\n", xfer->rx_message.size); - return -EINVAL; - } - - if (data->rx_message.size < xfer->rx_message.size) { - LOG_ERR("rx_message.size [ %d ] < xfer->rx_message.size\n", data->rx_message.size); - return -EINVAL; - } - - memcpy(xfer->rx_message.buf, data->rx_message.buf, xfer->rx_message.size); - hdr = (struct tisci_msg_hdr *)xfer->rx_message.buf; - - /* Sanity check for message response */ - if (hdr->seq != data->seq) { - LOG_ERR("HDR seq != data seq [%d != %d]\n", hdr->seq, data->seq); - return -EINVAL; - } - - k_sem_give(&data->data_sem); - return 0; -} - -static int tisci_do_xfer(const struct device *dev, struct tisci_xfer *xfer) -{ - if (!dev) { - return -EINVAL; - } - - const struct tisci_config *config = dev->config; - struct mbox_msg *msg = &xfer->tx_message; - int ret; - - ret = mbox_send_dt(&config->mbox_tx, msg); - if (ret < 0) { - LOG_ERR("Could not send (%d)\n", ret); - return ret; - } - - /* Get response if requested */ - if (xfer->rx_message.size) { - ret = tisci_get_response(dev, xfer); - if (ret) { - return ret; - } - if (!tisci_is_response_ack(xfer->rx_message.buf)) { - LOG_ERR("TISCI Response in NACK\n"); - return -ENODEV; - } - } - - return 0; -} - -/* Clock Management Functions */ -int tisci_cmd_get_clock_state(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint8_t *programmed_state, uint8_t *current_state) -{ - struct tisci_msg_resp_get_clock_state resp; - struct tisci_msg_req_get_clock_state req; - struct tisci_xfer *xfer; - int ret; - - if (!programmed_state && !current_state) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_GET_CLOCK_STATE, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.dev_id = dev_id; - req.clk_id = clk_id; - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get clock state (ret=%d)", ret); - return ret; - } - - if (programmed_state) { - *programmed_state = resp.programmed_state; - } - if (current_state) { - *current_state = resp.current_state; - } - return 0; -} - -int tisci_cmd_clk_is_auto(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - bool *req_state) -{ - uint8_t state = 0; - int ret; - - if (!req_state) { - return -EINVAL; - } - - ret = tisci_cmd_get_clock_state(dev, dev_id, clk_id, &state, NULL); - if (ret) { - return ret; - } - - *req_state = (state == MSG_CLOCK_SW_STATE_AUTO); - return 0; -} - -int tisci_cmd_clk_is_on(const struct device *dev, uint32_t dev_id, uint8_t clk_id, bool *req_state, - bool *curr_state) -{ - uint8_t c_state = 0, r_state = 0; - int ret; - - if (!req_state && !curr_state) { - return -EINVAL; - } - - ret = tisci_cmd_get_clock_state(dev, dev_id, clk_id, &r_state, &c_state); - if (ret) { - return ret; - } - - if (req_state) { - *req_state = (r_state == MSG_CLOCK_SW_STATE_REQ); - } - if (curr_state) { - *curr_state = (c_state == MSG_CLOCK_HW_STATE_READY); - } - return 0; -} - -int tisci_cmd_clk_is_off(const struct device *dev, uint32_t dev_id, uint8_t clk_id, bool *req_state, - bool *curr_state) -{ - uint8_t c_state = 0, r_state = 0; - int ret; - - if (!req_state && !curr_state) { - return -EINVAL; - } - - ret = tisci_cmd_get_clock_state(dev, dev_id, clk_id, &r_state, &c_state); - if (ret) { - return ret; - } - - if (req_state) { - *req_state = (r_state == MSG_CLOCK_SW_STATE_UNREQ); - } - if (curr_state) { - *curr_state = (c_state == MSG_CLOCK_HW_STATE_NOT_READY); - } - return 0; -} - -int tisci_cmd_clk_get_match_freq(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint64_t min_freq, uint64_t target_freq, uint64_t max_freq, - uint64_t *match_freq) -{ - struct tisci_msg_resp_query_clock_freq resp; - struct tisci_msg_req_query_clock_freq req; - struct tisci_xfer *xfer; - int ret; - - if (!match_freq) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_QUERY_CLOCK_FREQ, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.dev_id = dev_id; - req.clk_id = clk_id; - req.min_freq_hz = min_freq; - req.target_freq_hz = target_freq; - req.max_freq_hz = max_freq; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get matching clock frequency (ret=%d)", ret); - return ret; - } - - *match_freq = resp.freq_hz; - - return 0; -} - -int tisci_cmd_clk_set_freq(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint64_t min_freq, uint64_t target_freq, uint64_t max_freq) -{ - struct tisci_msg_req_set_clock_freq req; - struct tisci_msg_resp_set_clock_freq resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SET_CLOCK_FREQ, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.dev_id = dev_id; - req.clk_id = clk_id; - req.min_freq_hz = min_freq; - req.target_freq_hz = target_freq; - req.max_freq_hz = max_freq; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set clock frequency (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_clk_get_freq(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint64_t *freq) -{ - struct tisci_msg_resp_get_clock_freq resp; - struct tisci_msg_req_get_clock_freq req; - struct tisci_xfer *xfer; - int ret; - - if (!freq) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_GET_CLOCK_FREQ, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.dev_id = dev_id; - req.clk_id = clk_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get clock frequency (ret=%d)", ret); - return ret; - } - - *freq = resp.freq_hz; - - return 0; -} - -int tisci_set_clock_state(const struct device *dev, uint32_t dev_id, uint8_t clk_id, uint32_t flags, - uint8_t state) -{ - struct tisci_msg_req_set_clock_state req; - struct tisci_msg_resp_set_clock_state resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SET_CLOCK_STATE, flags, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.dev_id = dev_id; - req.clk_id = clk_id; - req.request_state = state; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set clock state (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_clk_set_parent(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint8_t parent_id) -{ - struct tisci_msg_req_set_clock_parent req; - struct tisci_msg_resp_set_clock_parent resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SET_CLOCK_PARENT, 0, &req, sizeof(req), &resp, - sizeof(resp)); - - req.dev_id = dev_id; - req.clk_id = clk_id; - req.parent_id = parent_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set clock parent (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_clk_get_parent(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint8_t *parent_id) -{ - struct tisci_msg_resp_get_clock_parent resp; - struct tisci_msg_req_get_clock_parent req; - struct tisci_xfer *xfer; - int ret; - - if (!parent_id) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_GET_CLOCK_PARENT, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.dev_id = dev_id; - req.clk_id = clk_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get clock parent (ret=%d)", ret); - return ret; - } - - *parent_id = resp.parent_id; - - return 0; -} - -int tisci_cmd_clk_get_num_parents(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint8_t *num_parents) -{ - struct tisci_msg_resp_get_clock_num_parents resp; - struct tisci_msg_req_get_clock_num_parents req; - struct tisci_xfer *xfer; - int ret; - - if (!num_parents) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_GET_NUM_CLOCK_PARENTS, 0, &req, sizeof(req), - &resp, sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.dev_id = dev_id; - req.clk_id = clk_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get number of clock parents (ret=%d)", ret); - return ret; - } - - *num_parents = resp.num_parents; - - return 0; -} - -int tisci_cmd_get_clock(const struct device *dev, uint32_t dev_id, uint8_t clk_id, bool needs_ssc, - bool can_change_freq, bool enable_input_term) -{ - uint32_t flags = 0; - - flags |= needs_ssc ? MSG_FLAG_CLOCK_ALLOW_SSC : 0; - flags |= can_change_freq ? MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE : 0; - flags |= enable_input_term ? MSG_FLAG_CLOCK_INPUT_TERM : 0; - - return tisci_set_clock_state(dev, dev_id, clk_id, flags, MSG_CLOCK_SW_STATE_REQ); -} - -int tisci_cmd_idle_clock(const struct device *dev, uint32_t dev_id, uint8_t clk_id) -{ - - return tisci_set_clock_state(dev, dev_id, clk_id, 0, MSG_CLOCK_SW_STATE_UNREQ); -} - -int tisci_cmd_put_clock(const struct device *dev, uint32_t dev_id, uint8_t clk_id) -{ - - return tisci_set_clock_state(dev, dev_id, clk_id, 0, MSG_CLOCK_SW_STATE_UNREQ); -} - -/* Device Management Functions */ -int tisci_set_device_state(const struct device *dev, uint32_t dev_id, uint32_t flags, uint8_t state) -{ - struct tisci_msg_req_set_device_state req; - struct tisci_msg_resp_set_device_state resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SET_DEVICE_STATE, flags, &req, sizeof(req), - &resp, sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.id = dev_id; - req.state = state; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set device state (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_set_device_state_no_wait(const struct device *dev, uint32_t dev_id, uint32_t flags, - uint8_t state) -{ - struct tisci_msg_req_set_device_state req; - struct tisci_msg_resp_set_device_state resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SET_DEVICE_STATE, - flags | TISCI_FLAG_REQ_GENERIC_NORESPONSE, &req, sizeof(req), - &resp, sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.id = dev_id; - req.state = state; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set device state without wait (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_get_device_state(const struct device *dev, uint32_t dev_id, uint32_t *clcnt, - uint32_t *resets, uint8_t *p_state, uint8_t *c_state) -{ - struct tisci_msg_resp_get_device_state resp; - struct tisci_msg_req_get_device_state req; - struct tisci_xfer *xfer; - int ret; - - if (!clcnt && !resets && !p_state && !c_state) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_GET_DEVICE_STATE, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.id = dev_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get device state (ret=%d)", ret); - return ret; - } - - if (clcnt) { - *clcnt = resp.context_loss_count; - } - if (resets) { - *resets = resp.resets; - } - if (p_state) { - *p_state = resp.programmed_state; - } - if (c_state) { - *c_state = resp.current_state; - } - - return 0; -} - -int tisci_cmd_get_device(const struct device *dev, uint32_t dev_id) -{ - - return tisci_set_device_state(dev, dev_id, 0, MSG_DEVICE_SW_STATE_ON); -} - -int tisci_cmd_get_device_exclusive(const struct device *dev, uint32_t dev_id) -{ - - return tisci_set_device_state(dev, dev_id, MSG_FLAG_DEVICE_EXCLUSIVE, - MSG_DEVICE_SW_STATE_ON); -} - -int tisci_cmd_idle_device(const struct device *dev, uint32_t dev_id) -{ - - return tisci_set_device_state(dev, dev_id, 0, MSG_DEVICE_SW_STATE_RETENTION); -} - -int tisci_cmd_idle_device_exclusive(const struct device *dev, uint32_t dev_id) -{ - - return tisci_set_device_state(dev, dev_id, MSG_FLAG_DEVICE_EXCLUSIVE, - MSG_DEVICE_SW_STATE_RETENTION); -} - -int tisci_cmd_put_device(const struct device *dev, uint32_t dev_id) -{ - - return tisci_set_device_state(dev, dev_id, 0, MSG_DEVICE_SW_STATE_AUTO_OFF); -} - -int tisci_cmd_dev_is_valid(const struct device *dev, uint32_t dev_id) -{ - uint8_t unused; - - return tisci_get_device_state(dev, dev_id, NULL, NULL, NULL, &unused); -} - -int tisci_cmd_dev_get_clcnt(const struct device *dev, uint32_t dev_id, uint32_t *count) -{ - - return tisci_get_device_state(dev, dev_id, count, NULL, NULL, NULL); -} - -int tisci_cmd_dev_is_idle(const struct device *dev, uint32_t dev_id, bool *r_state) -{ - int ret; - uint8_t state; - - if (!r_state) { - return -EINVAL; - } - - ret = tisci_get_device_state(dev, dev_id, NULL, NULL, &state, NULL); - if (ret) { - return ret; - } - - *r_state = (state == MSG_DEVICE_SW_STATE_RETENTION); - - return 0; -} - -int tisci_cmd_dev_is_stop(const struct device *dev, uint32_t dev_id, bool *r_state, - bool *curr_state) -{ - int ret; - uint8_t p_state, c_state; - - if (!r_state && !curr_state) { - return -EINVAL; - } - - ret = tisci_get_device_state(dev, dev_id, NULL, NULL, &p_state, &c_state); - if (ret) { - return ret; - } - - if (r_state) { - *r_state = (p_state == MSG_DEVICE_SW_STATE_AUTO_OFF); - } - if (curr_state) { - *curr_state = (c_state == MSG_DEVICE_HW_STATE_OFF); - } - - return 0; -} - -int tisci_cmd_dev_is_on(const struct device *dev, uint32_t dev_id, bool *r_state, bool *curr_state) -{ - int ret; - uint8_t p_state, c_state; - - if (!r_state && !curr_state) { - return -EINVAL; - } - - ret = tisci_get_device_state(dev, dev_id, NULL, NULL, &p_state, &c_state); - if (ret) { - return ret; - } - - if (r_state) { - *r_state = (p_state == MSG_DEVICE_SW_STATE_ON); - } - if (curr_state) { - *curr_state = (c_state == MSG_DEVICE_HW_STATE_ON); - } - - return 0; -} - -int tisci_cmd_dev_is_trans(const struct device *dev, uint32_t dev_id, bool *curr_state) -{ - int ret; - uint8_t state; - - if (!curr_state) { - return -EINVAL; - } - - ret = tisci_get_device_state(dev, dev_id, NULL, NULL, NULL, &state); - if (ret) { - return ret; - } - - *curr_state = (state == MSG_DEVICE_HW_STATE_TRANS); - - return 0; -} - -int tisci_cmd_set_device_resets(const struct device *dev, uint32_t dev_id, uint32_t reset_state) -{ - struct tisci_msg_req_set_device_resets req; - struct tisci_msg_resp_set_device_resets resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SET_DEVICE_RESETS, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.id = dev_id; - req.resets = reset_state; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set device resets (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_get_device_resets(const struct device *dev, uint32_t dev_id, uint32_t *reset_state) -{ - - return tisci_get_device_state(dev, dev_id, NULL, reset_state, NULL, NULL); -} - -/* Processor Management Functions */ -int tisci_cmd_proc_request(const struct device *dev, uint8_t proc_id) -{ - struct tisci_msg_req_proc_request req; - struct tisci_msg_resp_proc_request resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_PROC_REQUEST, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.processor_id = proc_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to request processor control (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_proc_release(const struct device *dev, uint8_t proc_id) -{ - struct tisci_msg_req_proc_release req; - struct tisci_msg_resp_proc_release resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_PROC_RELEASE, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.processor_id = proc_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to release processor control (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_proc_handover(const struct device *dev, uint8_t proc_id, uint8_t host_id) -{ - struct tisci_msg_req_proc_handover req; - struct tisci_msg_resp_proc_handover resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_PROC_HANDOVER, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.processor_id = proc_id; - req.host_id = host_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to handover processor control (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_set_proc_boot_cfg(const struct device *dev, uint8_t proc_id, uint64_t bootvector, - uint32_t config_flags_set, uint32_t config_flags_clear) -{ - struct tisci_msg_req_set_proc_boot_config req; - struct tisci_msg_resp_set_proc_boot_config resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SET_PROC_BOOT_CONFIG, 0, &req, sizeof(req), - &resp, sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.processor_id = proc_id; - req.bootvector_low = bootvector & TISCI_ADDR_LOW_MASK; - req.bootvector_high = (bootvector & TISCI_ADDR_HIGH_MASK) >> TISCI_ADDR_HIGH_SHIFT; - req.config_flags_set = config_flags_set; - req.config_flags_clear = config_flags_clear; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set processor boot configuration (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_set_proc_boot_ctrl(const struct device *dev, uint8_t proc_id, - uint32_t control_flags_set, uint32_t control_flags_clear) -{ - struct tisci_msg_req_set_proc_boot_ctrl req; - struct tisci_msg_resp_set_proc_boot_ctrl resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SET_PROC_BOOT_CTRL, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.processor_id = proc_id; - req.control_flags_set = control_flags_set; - req.control_flags_clear = control_flags_clear; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set processor boot control (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_proc_auth_boot_image(const struct device *dev, uint64_t *image_addr, - uint32_t *image_size) -{ - struct tisci_msg_req_proc_auth_boot_image req; - struct tisci_msg_resp_proc_auth_boot_image resp; - struct tisci_xfer *xfer; - int ret; - - if (!image_addr) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_PROC_AUTH_BOOT_IMAGE, 0, &req, sizeof(req), - &resp, sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.cert_addr_low = *image_addr & TISCI_ADDR_LOW_MASK; - req.cert_addr_high = (*image_addr & TISCI_ADDR_HIGH_MASK) >> TISCI_ADDR_HIGH_SHIFT; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to authenticate boot image (ret=%d)", ret); - return ret; - } - - *image_addr = - (resp.image_addr_low & TISCI_ADDR_LOW_MASK) | - (((uint64_t)resp.image_addr_high << TISCI_ADDR_HIGH_SHIFT) & TISCI_ADDR_HIGH_MASK); - - if (image_size) { - *image_size = resp.image_size; - } - - return 0; -} - -int tisci_cmd_get_proc_boot_status(const struct device *dev, uint8_t proc_id, uint64_t *bv, - uint32_t *cfg_flags, uint32_t *ctrl_flags, uint32_t *sts_flags) -{ - struct tisci_msg_resp_get_proc_boot_status resp; - struct tisci_msg_req_get_proc_boot_status req; - struct tisci_xfer *xfer; - int ret; - - if (!bv && !cfg_flags && !ctrl_flags && !sts_flags) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_GET_PROC_BOOT_STATUS, 0, &req, sizeof(req), - &resp, sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.processor_id = proc_id; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get processor boot status (ret=%d)", ret); - return ret; - } - - if (bv) { - *bv = (resp.bootvector_low & TISCI_ADDR_LOW_MASK) | - (((uint64_t)resp.bootvector_high << TISCI_ADDR_HIGH_SHIFT) & - TISCI_ADDR_HIGH_MASK); - } - if (cfg_flags) { - *cfg_flags = resp.config_flags; - } - if (ctrl_flags) { - *ctrl_flags = resp.control_flags; - } - if (sts_flags) { - *sts_flags = resp.status_flags; - } - - return 0; -} - -/* Resource Management Functions */ -int tisci_get_resource_range(const struct device *dev, uint32_t dev_id, uint8_t subtype, - uint8_t s_host, uint16_t *range_start, uint16_t *range_num) -{ - struct tisci_msg_resp_get_resource_range resp; - struct tisci_msg_req_get_resource_range req; - struct tisci_xfer *xfer; - int ret; - - if (!s_host) { - return -EINVAL; - } - if (!range_start && !range_num) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_GET_RESOURCE_RANGE, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - req.secondary_host = s_host; - req.type = dev_id & MSG_RM_RESOURCE_TYPE_MASK; - req.subtype = subtype & MSG_RM_RESOURCE_SUBTYPE_MASK; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get resource range (ret=%d)", ret); - return ret; - } - - if (!resp.range_start && !resp.range_num) { - return -ENODEV; - } - - if (range_start) { - *range_start = resp.range_start; - } - if (range_num) { - *range_num = resp.range_num; - } - - return 0; -} - -int tisci_cmd_get_resource_range(const struct device *dev, uint32_t dev_id, uint8_t subtype, - uint16_t *range_start, uint16_t *range_num) -{ - return tisci_get_resource_range(dev, dev_id, subtype, TISCI_IRQ_SECONDARY_HOST_INVALID, - range_start, range_num); -} - -int tisci_cmd_get_resource_range_from_shost(const struct device *dev, uint32_t dev_id, - uint8_t subtype, uint8_t s_host, uint16_t *range_start, - uint16_t *range_num) -{ - return tisci_get_resource_range(dev, dev_id, subtype, s_host, range_start, range_num); -} - -/* Board Configuration Functions */ - -int cmd_set_board_config_using_msg(const struct device *dev, uint16_t msg_type, uint64_t addr, - uint32_t size) -{ - struct tisci_msg_board_config_req req; - struct tisci_msg_board_config_resp resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, msg_type, 0, &req, sizeof(req), &resp, sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup board config transfer"); - return -EINVAL; - } - - req.boardcfgp_high = (addr >> 32) & 0xFFFFFFFFU; - req.boardcfgp_low = addr & 0xFFFFFFFFU; - req.boardcfg_size = size; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Board config transfer failed (ret=%d)", ret); - return ret; - } - - return 0; -} - -/* Version/Revision Function */ -int tisci_cmd_get_revision(const struct device *dev, struct tisci_version_info *ver) -{ - struct tisci_msg_hdr hdr; - struct tisci_msg_resp_version rev_info; - struct tisci_xfer *xfer; - int ret; - - if (!ver) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_VERSION, 0, &hdr, sizeof(hdr), &rev_info, - sizeof(rev_info)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to get version (ret=%d)", ret); - return ret; - } - - ver->abi_major = rev_info.abi_major; - ver->abi_minor = rev_info.abi_minor; - ver->firmware_revision = rev_info.firmware_revision; - strncpy(ver->firmware_description, rev_info.firmware_description, - sizeof(ver->firmware_description)); - return 0; -} - -/* System Control Functions */ - -int tisci_cmd_sys_reset(const struct device *dev) -{ - struct tisci_msg_req_reboot req; - struct tisci_msg_resp_reboot resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_SYS_RESET, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup system reset transfer"); - return -EINVAL; - } - - req.domain = 0; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("System reset request failed (ret=%d)", ret); - return ret; - } - - return 0; -} - -/* Memory Management Functions */ - -int tisci_cmd_query_msmc(const struct device *dev, uint64_t *msmc_start, uint64_t *msmc_end) -{ - struct tisci_msg_resp_query_msmc resp; - struct tisci_msg_hdr req; - struct tisci_xfer *xfer; - int ret; - - if (!msmc_start || !msmc_end) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_QUERY_MSMC, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup MSMC query transfer"); - return -EINVAL; - } - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("MSMC query failed (ret=%d)", ret); - return ret; - } - - *msmc_start = - ((uint64_t)resp.msmc_start_high << TISCI_ADDR_HIGH_SHIFT) | resp.msmc_start_low; - *msmc_end = ((uint64_t)resp.msmc_end_high << TISCI_ADDR_HIGH_SHIFT) | resp.msmc_end_low; - - return 0; -} - -/* Firewall Management Functions */ - -int tisci_cmd_set_fwl_region(const struct device *dev, const struct tisci_msg_fwl_region *region) -{ - struct tisci_msg_fwl_set_firewall_region_req req; - struct tisci_msg_fwl_set_firewall_region_resp resp; - struct tisci_xfer *xfer; - int ret; - - if (!region) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_FWL_SET, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup firewall config transfer"); - return -EINVAL; - } - - req.fwl_id = region->fwl_id; - req.region = region->region; - req.n_permission_regs = region->n_permission_regs; - req.control = region->control; - memcpy(req.permissions, region->permissions, sizeof(uint32_t) * FWL_MAX_PRIVID_SLOTS); - req.start_address = region->start_address; - req.end_address = region->end_address; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Firewall config transfer failed (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_get_fwl_region(const struct device *dev, struct tisci_msg_fwl_region *region) -{ - struct tisci_msg_fwl_get_firewall_region_req req; - struct tisci_msg_fwl_get_firewall_region_resp resp; - struct tisci_xfer *xfer; - int ret; - - if (!region) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_FWL_GET, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup firewall query transfer"); - return -EINVAL; - } - - req.fwl_id = region->fwl_id; - req.region = region->region; - req.n_permission_regs = region->n_permission_regs; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Firewall query transfer failed (ret=%d)", ret); - return ret; - } - - region->fwl_id = resp.fwl_id; - region->region = resp.region; - region->n_permission_regs = resp.n_permission_regs; - region->control = resp.control; - memcpy(region->permissions, resp.permissions, sizeof(uint32_t) * FWL_MAX_PRIVID_SLOTS); - region->start_address = resp.start_address; - region->end_address = resp.end_address; - - return 0; -} - -int tisci_cmd_change_fwl_owner(const struct device *dev, struct tisci_msg_fwl_owner *owner) -{ - struct tisci_msg_fwl_change_owner_info_req req; - struct tisci_msg_fwl_change_owner_info_resp resp; - struct tisci_xfer *xfer; - int ret; - - if (!owner) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_FWL_CHANGE_OWNER, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup firewall owner change transfer"); - return -EINVAL; - } - - req.fwl_id = owner->fwl_id; - req.region = owner->region; - req.owner_index = owner->owner_index; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Firewall owner change failed (ret=%d)", ret); - return ret; - } - - owner->fwl_id = resp.fwl_id; - owner->region = resp.region; - owner->owner_index = resp.owner_index; - owner->owner_privid = resp.owner_privid; - owner->owner_permission_bits = resp.owner_permission_bits; - - return 0; -} - -/* UDMAP Management Functions */ - -int tisci_cmd_rm_udmap_tx_ch_cfg(const struct device *dev, - const struct tisci_msg_rm_udmap_tx_ch_cfg *params) -{ - struct tisci_msg_rm_udmap_tx_ch_cfg_req req; - struct tisci_msg_rm_udmap_tx_ch_cfg_resp resp; - struct tisci_xfer *xfer; - int ret; - - if (!params) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_RM_UDMAP_TX_CH_CFG, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup UDMAP TX channel config transfer"); - return -EINVAL; - } - - /* Copy all configuration parameters */ - req.valid_params = params->valid_params; - req.nav_id = params->nav_id; - req.index = params->index; - req.tx_pause_on_err = params->tx_pause_on_err; - req.tx_filt_einfo = params->tx_filt_einfo; - req.tx_filt_pswords = params->tx_filt_pswords; - req.tx_atype = params->tx_atype; - req.tx_chan_type = params->tx_chan_type; - req.tx_supr_tdpkt = params->tx_supr_tdpkt; - req.tx_fetch_size = params->tx_fetch_size; - req.tx_credit_count = params->tx_credit_count; - req.txcq_qnum = params->txcq_qnum; - req.tx_priority = params->tx_priority; - req.tx_qos = params->tx_qos; - req.tx_orderid = params->tx_orderid; - req.fdepth = params->fdepth; - req.tx_sched_priority = params->tx_sched_priority; - req.tx_burst_size = params->tx_burst_size; - req.tx_tdtype = params->tx_tdtype; - req.extended_ch_type = params->extended_ch_type; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("UDMAP TX channel %u config failed (ret=%d)", params->index, ret); - return ret; - } - - LOG_DBG("UDMAP TX channel %u configured successfully", params->index); - return 0; -} - -int tisci_cmd_rm_udmap_rx_ch_cfg(const struct device *dev, - const struct tisci_msg_rm_udmap_rx_ch_cfg *params) -{ - struct tisci_msg_rm_udmap_rx_ch_cfg_req req; - struct tisci_msg_rm_udmap_rx_ch_cfg_resp resp; - struct tisci_xfer *xfer; - int ret; - - if (!params) { - return -EINVAL; - } - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_RM_UDMAP_RX_CH_CFG, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup UDMAP RX channel config transfer"); - return -EINVAL; - } - - /* Copy all configuration parameters */ - req.valid_params = params->valid_params; - req.nav_id = params->nav_id; - req.index = params->index; - req.rx_fetch_size = params->rx_fetch_size; - req.rxcq_qnum = params->rxcq_qnum; - req.rx_priority = params->rx_priority; - req.rx_qos = params->rx_qos; - req.rx_orderid = params->rx_orderid; - req.rx_sched_priority = params->rx_sched_priority; - req.flowid_start = params->flowid_start; - req.flowid_cnt = params->flowid_cnt; - req.rx_pause_on_err = params->rx_pause_on_err; - req.rx_atype = params->rx_atype; - req.rx_chan_type = params->rx_chan_type; - req.rx_ignore_short = params->rx_ignore_short; - req.rx_ignore_long = params->rx_ignore_long; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("UDMAP RX channel %u config failed (ret=%d)", params->index, ret); - return ret; - } - - LOG_DBG("UDMAP RX channel %u configured successfully", params->index); - return 0; -} - -/* PSI-L Management Functions */ - -int tisci_cmd_rm_psil_pair(const struct device *dev, uint32_t nav_id, uint32_t src_thread, - uint32_t dst_thread) -{ - struct tisci_msg_psil_pair_req req; - struct tisci_msg_psil_pair_resp resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_RM_PSIL_PAIR, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup PSI-L pair transfer"); - return -EINVAL; - } - - req.nav_id = nav_id; - req.src_thread = src_thread; - req.dst_thread = dst_thread; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("PSI-L pair failed nav:%u %u->%u (ret=%d)", nav_id, src_thread, dst_thread, - ret); - return ret; - } - - LOG_DBG("PSI-L pair successful nav:%u %u->%u", nav_id, src_thread, dst_thread); - return 0; -} - -int tisci_cmd_rm_psil_unpair(const struct device *dev, uint32_t nav_id, uint32_t src_thread, - uint32_t dst_thread) -{ - struct tisci_msg_psil_unpair_req req; - struct tisci_msg_psil_unpair_resp resp; - struct tisci_xfer *xfer; - int ret; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_RM_PSIL_UNPAIR, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR(" Failed to setup PSI-L unpair transfer"); - return -EINVAL; - } - - req.nav_id = nav_id; - req.src_thread = src_thread; - req.dst_thread = dst_thread; - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("PSI-L unpair failed %u->%u (ret=%d)", src_thread, dst_thread, ret); - return ret; - } - - LOG_DBG("PSI-L unpair successful %u->%u", src_thread, dst_thread); - return 0; -} - -/* Interrupt Management Functions */ -int tisci_cmd_rm_irq_set(const struct device *dev, struct tisci_irq_set_req *client_req) -{ - struct tisci_xfer *xfer; - struct tisci_msg_rm_irq_set_resp resp = {0}; - int ret; - - if (!client_req) { - return -EINVAL; - } - - struct tisci_msg_rm_irq_set_req req = { - .hdr = {0}, - .valid_params = client_req->valid_params, - .src_id = client_req->src_id, - .src_index = client_req->src_index, - .dst_id = client_req->dst_id, - .dst_host_irq = client_req->dst_host_irq, - .ia_id = client_req->ia_id, - .vint = client_req->vint, - .global_event = client_req->global_event, - .vint_status_bit_index = client_req->vint_status_bit_index, - .secondary_host = client_req->secondary_host, - }; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_RM_IRQ_SET, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to set IRQ (ret=%d)", ret); - return ret; - } - - return 0; -} - -int tisci_cmd_rm_irq_release(const struct device *dev, struct tisci_irq_release_req *client_req) -{ - struct tisci_xfer *xfer; - struct tisci_msg_rm_irq_release_resp resp = {0}; - int ret; - - if (!client_req) { - return -EINVAL; - } - - struct tisci_msg_rm_irq_release_req req = { - .hdr = {0}, - .valid_params = client_req->valid_params, - .src_id = client_req->src_id, - .src_index = client_req->src_index, - .dst_id = client_req->dst_id, - .dst_host_irq = client_req->dst_host_irq, - .ia_id = client_req->ia_id, - .vint = client_req->vint, - .global_event = client_req->global_event, - .vint_status_bit_index = client_req->vint_status_bit_index, - .secondary_host = client_req->secondary_host, - }; - - xfer = tisci_setup_one_xfer(dev, TISCI_MSG_RM_IRQ_RELEASE, 0, &req, sizeof(req), &resp, - sizeof(resp)); - if (!xfer) { - LOG_ERR("Failed to setup transfer"); - return -EINVAL; - } - - ret = tisci_do_xfer(dev, xfer); - if (ret) { - LOG_ERR("Failed to release IRQ (ret=%d)", ret); - return ret; - } - - return 0; -} - -/* Init function */ -static int tisci_init(const struct device *dev) -{ - const struct tisci_config *config = dev->config; - struct tisci_data *data = dev->data; - int ret; - - k_sem_init(data->rx_message.response_ready_sem, 0, 1); - - ret = mbox_register_callback_dt(&config->mbox_rx, callback, &data->rx_message); - if (ret < 0) { - LOG_ERR("Could not register callback (%d)\n", ret); - return ret; - } - - ret = mbox_set_enabled_dt(&config->mbox_rx, true); - if (ret < 0) { - LOG_ERR("Could not enable RX channel (%d)\n", ret); - return ret; - } - return 0; -} - -/* Device Tree Instantiation */ -#define TISCI_DEFINE(_n) \ - static uint8_t rx_message_buf_##_n[MAILBOX_MBOX_SIZE] = {0}; \ - static struct k_sem response_ready_sem_##_n; \ - static struct tisci_data tisci_data_##_n = { \ - .seq = 0, \ - .rx_message = \ - { \ - .buf = rx_message_buf_##_n, \ - .size = sizeof(rx_message_buf_##_n), \ - .response_ready_sem = &response_ready_sem_##_n, \ - }, \ - .data_sem = Z_SEM_INITIALIZER(tisci_data_##_n.data_sem, 1, 1), \ - }; \ - static const struct tisci_config tisci_config_##_n = { \ - .mbox_tx = MBOX_DT_SPEC_INST_GET(_n, tx), \ - .mbox_rx = MBOX_DT_SPEC_INST_GET(_n, rx), \ - .host_id = DT_INST_PROP(_n, ti_host_id), \ - .max_msg_size = MAILBOX_MBOX_SIZE, \ - .max_rx_timeout_ms = 10000, \ - }; \ - DEVICE_DT_INST_DEFINE(_n, tisci_init, NULL, &tisci_data_##_n, &tisci_config_##_n, \ - PRE_KERNEL_1, CONFIG_TISCI_INIT_PRIORITY, NULL); - -DT_INST_FOREACH_STATUS_OKAY(TISCI_DEFINE) diff --git a/drivers/firmware/tisci/tisci.h b/drivers/firmware/tisci/tisci.h deleted file mode 100644 index 59d3898c7c4..00000000000 --- a/drivers/firmware/tisci/tisci.h +++ /dev/null @@ -1,1820 +0,0 @@ -/* - * Copyright (c) 2025, Texas Instruments - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief Texas Instruments System Control Interface (TISCI) Protocol - * - */ - -#ifndef INCLUDE_ZEPHYR_DRIVERS_TISCI_PROTOCOL_H_ -#define INCLUDE_ZEPHYR_DRIVERS_TISCI_PROTOCOL_H_ - -#include "zephyr/kernel.h" -#include -#include - -#ifndef __packed -#define __packed __attribute__((__packed__)) -#endif - -#define TISCI_MSG_ENABLE_WDT 0x0000 -#define TISCI_MSG_WAKE_RESET 0x0001 -#define TISCI_MSG_VERSION 0x0002 -#define TISCI_MSG_WAKE_REASON 0x0003 -#define TISCI_MSG_GOODBYE 0x0004 -#define TISCI_MSG_SYS_RESET 0x0005 -#define TISCI_MSG_BOARD_CONFIG 0x000b -#define TISCI_MSG_BOARD_CONFIG_RM 0x000c -#define TISCI_MSG_BOARD_CONFIG_SECURITY 0x000d -#define TISCI_MSG_BOARD_CONFIG_PM 0x000e -#define TISCI_MSG_QUERY_MSMC 0x0020 - -/* Device requests */ -#define TISCI_MSG_SET_DEVICE_STATE 0x0200 -#define TISCI_MSG_GET_DEVICE_STATE 0x0201 -#define TISCI_MSG_SET_DEVICE_RESETS 0x0202 - -/* Clock requests */ -#define TISCI_MSG_SET_CLOCK_STATE 0x0100 -#define TISCI_MSG_GET_CLOCK_STATE 0x0101 -#define TISCI_MSG_SET_CLOCK_PARENT 0x0102 -#define TISCI_MSG_GET_CLOCK_PARENT 0x0103 -#define TISCI_MSG_GET_NUM_CLOCK_PARENTS 0x0104 -#define TISCI_MSG_SET_CLOCK_FREQ 0x010c -#define TISCI_MSG_QUERY_CLOCK_FREQ 0x010d -#define TISCI_MSG_GET_CLOCK_FREQ 0x010e - -/* Processor Control Messages */ -#define TISCI_MSG_PROC_REQUEST 0xc000 -#define TISCI_MSG_PROC_RELEASE 0xc001 -#define TISCI_MSG_PROC_HANDOVER 0xc005 -#define TISCI_MSG_SET_PROC_BOOT_CONFIG 0xc100 -#define TISCI_MSG_SET_PROC_BOOT_CTRL 0xc101 -#define TISCI_MSG_PROC_AUTH_BOOT_IMAGE 0xc120 -#define TISCI_MSG_GET_PROC_BOOT_STATUS 0xc400 -#define TISCI_MSG_WAIT_PROC_BOOT_STATUS 0xc401 - -/* Resource Management Requests */ -/* RM TISCI message to request a resource range assignment for a host */ -#define TISCI_MSG_GET_RESOURCE_RANGE 0x1500 -/* RM TISCI message to set an IRQ between a peripheral and host processor */ -#define TISCI_MSG_RM_IRQ_SET (0x1000U) -/* RM TISCI message to release a configured IRQ */ -#define TISCI_MSG_RM_IRQ_RELEASE (0x1001U) - -/* NAVSS resource management */ -/* Ringacc requests */ -#define TISCI_MSG_RM_RING_CFG 0x1110 - -/* PSI-L requests */ -#define TISCI_MSG_RM_PSIL_PAIR 0x1280 -#define TISCI_MSG_RM_PSIL_UNPAIR 0x1281 - -#define TISCI_MSG_RM_UDMAP_TX_ALLOC 0x1200 -#define TISCI_MSG_RM_UDMAP_TX_FREE 0x1201 -#define TISCI_MSG_RM_UDMAP_RX_ALLOC 0x1210 -#define TISCI_MSG_RM_UDMAP_RX_FREE 0x1211 -#define TISCI_MSG_RM_UDMAP_FLOW_CFG 0x1220 -#define TISCI_MSG_RM_UDMAP_OPT_FLOW_CFG 0x1221 - -#define TISCI_MSG_RM_UDMAP_TX_CH_CFG 0x1205 -#define TISCI_MSG_RM_UDMAP_RX_CH_CFG 0x1215 -#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG 0x1231 - -#define TISCI_MSG_FWL_SET 0x9000 -#define TISCI_MSG_FWL_GET 0x9001 -#define TISCI_MSG_FWL_CHANGE_OWNER 0x9002 - -/** - * @struct rx_msg - * @brief Received message details - * @param seq: Message sequence number - * @param size: Message size in bytes - * @param buf: Buffer for message data - * @param response_ready_sem: Semaphore to signal when a response is ready - */ -struct rx_msg { - uint8_t seq; - size_t size; - void *buf; - struct k_sem *response_ready_sem; -}; - -/** - * @struct tisci_msg_hdr - * @brief Generic Message Header for All messages and responses - * @param type: Type of messages: One of TISCI_MSG* values - * @param host: Host of the message - * @param seq: Message identifier indicating a transfer sequence - * @param flags: Flag for the message - */ -struct tisci_msg_hdr { - uint16_t type; - uint8_t host; - uint8_t seq; -#define TISCI_MSG_FLAG(val) (1 << (val)) -#define TISCI_FLAG_REQ_GENERIC_NORESPONSE 0x0 -#define TISCI_FLAG_REQ_ACK_ON_RECEIVED TISCI_MSG_FLAG(0) -#define TISCI_FLAG_REQ_ACK_ON_PROCESSED TISCI_MSG_FLAG(1) -#define TISCI_FLAG_RESP_GENERIC_NACK 0x0 -#define TISCI_FLAG_RESP_GENERIC_ACK TISCI_MSG_FLAG(1) - /* Additional Flags */ - uint32_t flags; -} __packed; - -/** - * @struct tisci_secure_msg_hdr - * @brief Header that prefixes all TISCI messages sent - * via secure transport. - * @param checksum: crc16 checksum for the entire message - * @param reserved: Reserved for future use. - */ -struct tisci_secure_msg_hdr { - uint16_t checksum; - uint16_t reserved; -} __packed; - -/** - * @struct tisci_msg_resp_version - * @brief Response for a message - * - * In general, ABI version changes follow the rule that minor version increments - * are backward compatible. Major revision changes in ABI may not be - * backward compatible. - * - * Response to a generic message with message type TISCI_MSG_VERSION - * @param hdr: Generic header - * @param firmware_description: String describing the firmware - * @param firmware_revision: Firmware revision - * @param abi_major: Major version of the ABI that firmware supports - * @param abi_minor: Minor version of the ABI that firmware supports - */ -struct tisci_msg_resp_version { - struct tisci_msg_hdr hdr; - char firmware_description[32]; - uint16_t firmware_revision; - uint8_t abi_major; - uint8_t abi_minor; -} __packed; - -/** - * @struct tisci_msg_req_reboot - * @brief Reboot the SoC - * @param hdr: Generic Header - * @param domain: Domain to be reset, 0 for full SoC reboot. - * - * Request type is TISCI_MSG_SYS_RESET, responded with a generic - * ACK/NACK message. - */ -struct tisci_msg_req_reboot { - struct tisci_msg_hdr hdr; - uint8_t domain; -} __packed; - -/** - * @struct tisci_msg_resp_reboot - * @brief Response to system reset (generic ACK/NACK) - */ -struct tisci_msg_resp_reboot { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_board_config_req - * @brief Board configuration message - * @param hdr: Generic Header - * @param boardcfgp_low: Lower 32 bit of the pointer pointing to the board - * configuration data - * @param boardcfgp_high: Upper 32 bit of the pointer pointing to the board - * configuration data - * @param boardcfg_size: Size of board configuration data object - * Request type is TISCI_MSG_BOARD_CONFIG, responded with a generic - * ACK/NACK message. - */ -struct tisci_msg_board_config_req { - struct tisci_msg_hdr hdr; - uint32_t boardcfgp_low; - uint32_t boardcfgp_high; - uint16_t boardcfg_size; -} __packed; - -/** - * @struct tisci_msg_board_config_resp - * @brief Response to board config request (generic ACK/NACK) - * @param hdr: Generic Header - */ -struct tisci_msg_board_config_resp { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_resp_query_msmc - * @brief Query msmc message response structure - * @param hdr: Generic Header - * @param msmc_start_low: Lower 32 bit of msmc start - * @param msmc_start_high: Upper 32 bit of msmc start - * @param msmc_end_low: Lower 32 bit of msmc end - * @param msmc_end_high: Upper 32 bit of msmc end - * - * @brief Response to a generic message with message type TISCI_MSG_QUERY_MSMC - */ -struct tisci_msg_resp_query_msmc { - struct tisci_msg_hdr hdr; - uint32_t msmc_start_low; - uint32_t msmc_start_high; - uint32_t msmc_end_low; - uint32_t msmc_end_high; -} __packed; - -/** - * @struct tisci_msg_req_set_device_state - * @brief Set the desired state of the device - * @param hdr: Generic header - * @param id: Indicates which device to modify - * @param reserved: Reserved space in message, must be 0 for backward compatibility - * @param state: The desired state of the device. - * - * Certain flags can also be set to alter the device state: - * MSG_FLAG_DEVICE_WAKE_ENABLED - Configure the device to be a wake source. - * The meaning of this flag will vary slightly from device to device and from - * SoC to SoC but it generally allows the device to wake the SoC out of deep - * suspend states. - * MSG_FLAG_DEVICE_RESET_ISO - Enable reset isolation for this device. - * MSG_FLAG_DEVICE_EXCLUSIVE - Claim this device exclusively. When passed - * with STATE_RETENTION or STATE_ON, it will claim the device exclusively. - * If another host already has this device set to STATE_RETENTION or STATE_ON, - * the message will fail. Once successful, other hosts attempting to set - * STATE_RETENTION or STATE_ON will fail. - * - * Request type is TISCI_MSG_SET_DEVICE_STATE, responded with a generic - * ACK/NACK message. - */ -struct tisci_msg_req_set_device_state { - /* Additional hdr->flags options */ -#define MSG_FLAG_DEVICE_WAKE_ENABLED TISCI_MSG_FLAG(8) -#define MSG_FLAG_DEVICE_RESET_ISO TISCI_MSG_FLAG(9) -#define MSG_FLAG_DEVICE_EXCLUSIVE TISCI_MSG_FLAG(10) - struct tisci_msg_hdr hdr; - uint32_t id; - uint32_t reserved; - -#define MSG_DEVICE_SW_STATE_AUTO_OFF 0 -#define MSG_DEVICE_SW_STATE_RETENTION 1 -#define MSG_DEVICE_SW_STATE_ON 2 - uint8_t state; -} __packed; - -/** - * @struct tisci_msg_resp_set_device_state - * @brief Response to set device state (generic ACK/NACK) - */ -struct tisci_msg_resp_set_device_state { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_req_get_device_state - * @brief Request to get device. - * @param hdr: Generic header - * @param id: Device Identifier - * - * Request type is TISCI_MSG_GET_DEVICE_STATE, responded device state - * information - */ -struct tisci_msg_req_get_device_state { - struct tisci_msg_hdr hdr; - uint32_t id; -} __packed; - -/** - * @struct tisci_msg_resp_get_device_state - * @brief Response to get device request. - * @param hdr: Generic header - * @param context_loss_count: Indicates how many times the device has lost context. A - * driver can use this monotonic counter to determine if the device has - * lost context since the last time this message was exchanged. - * @param resets: Programmed state of the reset lines. - * @param programmed_state: The state as programmed by set_device. - * - Uses the MSG_DEVICE_SW_* macros - * @param current_state: The actual state of the hardware. - * - * Response to request TISCI_MSG_GET_DEVICE_STATE. - */ -struct tisci_msg_resp_get_device_state { - struct tisci_msg_hdr hdr; - uint32_t context_loss_count; - uint32_t resets; - uint8_t programmed_state; -#define MSG_DEVICE_HW_STATE_OFF 0 -#define MSG_DEVICE_HW_STATE_ON 1 -#define MSG_DEVICE_HW_STATE_TRANS 2 - uint8_t current_state; -} __packed; - -/** - * @struct tisci_msg_req_set_device_reset - * @brief Set the desired resets configuration of the device - * @param hdr: Generic header - * @param id: Indicates which device to modify - * @param resets: A bit field of resets for the device. The meaning, behavior, - * and usage of the reset flags are device specific. 0 for a bit - * indicates releasing the reset represented by that bit while 1 - * indicates keeping it held. - * - * Request type is TISCI_MSG_SET_DEVICE_RESETS, responded with a generic - * ACK/NACK message. - */ -struct tisci_msg_req_set_device_resets { - struct tisci_msg_hdr hdr; - uint32_t id; - uint32_t resets; -} __packed; - -/** - * @struct tisci_msg_resp_set_device_resets - * @brief Response to set device resets request (generic ACK/NACK) - */ -struct tisci_msg_resp_set_device_resets { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_req_set_clock_state - * @brief Request to setup a Clock state - * @param hdr: Generic Header, Certain flags can be set specific to the clocks: - * MSG_FLAG_CLOCK_ALLOW_SSC: Allow this clock to be modified - * via spread spectrum clocking. - * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE: Allow this clock's - * frequency to be changed while it is running so long as it - * is within the min/max limits. - * MSG_FLAG_CLOCK_INPUT_TERM: Enable input termination, this - * is only applicable to clock inputs on the SoC pseudo-device. - * @param dev_id: Device identifier this request is for - * @param clk_id: Clock identifier for the device for this request. - * Each device has it's own set of clock inputs. This indexes - * which clock input to modify. - * @param request_state: Request the state for the clock to be set to. - * MSG_CLOCK_SW_STATE_UNREQ: The IP does not require this clock, - * it can be disabled, regardless of the state of the device - * MSG_CLOCK_SW_STATE_AUTO: Allow the System Controller to - * automatically manage the state of this clock. If the device - * is enabled, then the clock is enabled. If the device is set - * to off or retention, then the clock is internally set as not - * being required by the device.(default) - * MSG_CLOCK_SW_STATE_REQ: Configure the clock to be enabled, - * regardless of the state of the device. - * - * Normally, all required clocks are managed by TISCI entity, this is used - * only for specific control *IF* required. Auto managed state is - * MSG_CLOCK_SW_STATE_AUTO, in other states, TISCI entity assume remote - * will explicitly control. - * - * Request type is TISCI_MSG_SET_CLOCK_STATE, response is a generic - * ACK or NACK message. - */ -struct tisci_msg_req_set_clock_state { - /* Additional hdr->flags options */ -#define MSG_FLAG_CLOCK_ALLOW_SSC TISCI_MSG_FLAG(8) -#define MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE TISCI_MSG_FLAG(9) -#define MSG_FLAG_CLOCK_INPUT_TERM TISCI_MSG_FLAG(10) - struct tisci_msg_hdr hdr; - uint32_t dev_id; - uint8_t clk_id; -#define MSG_CLOCK_SW_STATE_UNREQ 0 -#define MSG_CLOCK_SW_STATE_AUTO 1 -#define MSG_CLOCK_SW_STATE_REQ 2 - uint8_t request_state; -} __packed; - -/** - * @struct tisci_msg_resp_set_clock_state - * @brief Response to set clock state (generic ACK/NACK) - */ -struct tisci_msg_resp_set_clock_state { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_req_get_clock_state - * @brief Request for clock state - * @param hdr: Generic Header - * @param dev_id: Device identifier this request is for - * @param clk_id: Clock identifier for the device for this request. - * Each device has it's own set of clock inputs. This indexes - * which clock input to get state of. - * - * Request type is TISCI_MSG_GET_CLOCK_STATE, response is state - * of the clock - */ -struct tisci_msg_req_get_clock_state { - struct tisci_msg_hdr hdr; - uint32_t dev_id; - uint8_t clk_id; -} __packed; - -/** - * @struct tisci_msg_resp_get_clock_state - * @brief Response to get clock state - * @param hdr: Generic Header - * @param programmed_state: Any programmed state of the clock. This is one of - * MSG_CLOCK_SW_STATE* values. - * @param current_state: Current state of the clock. This is one of: - * MSG_CLOCK_HW_STATE_NOT_READY: Clock is not ready - * MSG_CLOCK_HW_STATE_READY: Clock is ready - * - * Response to TISCI_MSG_GET_CLOCK_STATE. - */ -struct tisci_msg_resp_get_clock_state { - struct tisci_msg_hdr hdr; - uint8_t programmed_state; -#define MSG_CLOCK_HW_STATE_NOT_READY 0 -#define MSG_CLOCK_HW_STATE_READY 1 - uint8_t current_state; -} __packed; - -/** - * @struct tisci_msg_req_set_clock_parent - * @brief Set the clock parent - * @param hdr: Generic Header - * @param dev_id: Device identifier this request is for - * @param clk_id: Clock identifier for the device for this request. - * Each device has it's own set of clock inputs. This indexes - * which clock input to modify. - * @param parent_id: The new clock parent is selectable by an index via this - * parameter. - * - * Request type is TISCI_MSG_SET_CLOCK_PARENT, response is generic - * ACK / NACK message. - */ -struct tisci_msg_req_set_clock_parent { - struct tisci_msg_hdr hdr; - uint32_t dev_id; - uint8_t clk_id; - uint8_t parent_id; -} __packed; - -/** - * @struct tisci_msg_resp_set_clock_parent - * @brief Response to set clock parent (generic ACK/NACK) - */ -struct tisci_msg_resp_set_clock_parent { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_req_get_clock_parent - * @brief Get the clock parent - * @param hdr: Generic Header - * @param dev_id: Device identifier this request is for - * @param clk_id: Clock identifier for the device for this request. - * Each device has it's own set of clock inputs. This indexes - * which clock input to get the parent for. - * - * Request type is TISCI_MSG_GET_CLOCK_PARENT, response is parent information - */ -struct tisci_msg_req_get_clock_parent { - struct tisci_msg_hdr hdr; - uint32_t dev_id; - uint8_t clk_id; -} __packed; - -/** - * @struct tisci_msg_resp_get_clock_parent - * @brief Response with clock parent - * @param hdr: Generic Header - * @param parent_id: The current clock parent - * - * Response to TISCI_MSG_GET_CLOCK_PARENT. - */ -struct tisci_msg_resp_get_clock_parent { - struct tisci_msg_hdr hdr; - uint8_t parent_id; -} __packed; - -/** - * @struct tisci_msg_req_get_clock_num_parents - * @brief Request to get clock parents - * @param hdr: Generic header - * @param dev_id: Device identifier this request is for - * @param clk_id: Clock identifier for the device for this request. - * - * This request provides information about how many clock parent options - * are available for a given clock to a device. This is typically used - * for input clocks. - * - * Request type is TISCI_MSG_GET_NUM_CLOCK_PARENTS, response is appropriate - * message, or NACK in case of inability to satisfy request. - */ -struct tisci_msg_req_get_clock_num_parents { - struct tisci_msg_hdr hdr; - uint32_t dev_id; - uint8_t clk_id; -} __packed; - -/** - * @struct tisci_msg_resp_get_clock_num_parents - * @brief Response for get clk parents - * @param hdr: Generic header - * @param num_parents: Number of clock parents - * - * Response to TISCI_MSG_GET_NUM_CLOCK_PARENTS - */ -struct tisci_msg_resp_get_clock_num_parents { - struct tisci_msg_hdr hdr; - uint8_t num_parents; -} __packed; - -/** - * @struct tisci_msg_req_query_clock_freq - * @brief Request to query a frequency - * @param hdr: Generic Header - * @param dev_id: Device identifier this request is for - * @param min_freq_hz: The minimum allowable frequency in Hz. This is the minimum - * allowable programmed frequency and does not account for clock - * tolerances and jitter. - * @param target_freq_hz: The target clock frequency. A frequency will be found - * as close to this target frequency as possible. - * @param max_freq_hz: The maximum allowable frequency in Hz. This is the maximum - * allowable programmed frequency and does not account for clock - * tolerances and jitter. - * @param clk_id: Clock identifier for the device for this request. - * - * NOTE: Normally clock frequency management is automatically done by TISCI - * entity. In case of specific requests, TISCI evaluates capability to achieve - * requested frequency within provided range and responds with - * result message. - * - * Request type is TISCI_MSG_QUERY_CLOCK_FREQ, response is appropriate message, - * or NACK in case of inability to satisfy request. - */ -struct tisci_msg_req_query_clock_freq { - struct tisci_msg_hdr hdr; - uint32_t dev_id; - uint64_t min_freq_hz; - uint64_t target_freq_hz; - uint64_t max_freq_hz; - uint8_t clk_id; -} __packed; - -/** - * @struct tisci_msg_resp_query_clock_freq - * @brief Response to a clock frequency query - * @param hdr: Generic Header - * @param freq_hz: Frequency that is the best match in Hz. - * - * Response to request type TISCI_MSG_QUERY_CLOCK_FREQ. NOTE: if the request - * cannot be satisfied, the message will be of type NACK. - */ -struct tisci_msg_resp_query_clock_freq { - struct tisci_msg_hdr hdr; - uint64_t freq_hz; -} __packed; - -/** - * @struct tisci_msg_req_set_clock_freq - * @brief Request to setup a clock frequency - * @param hdr: Generic Header - * @param dev_id: Device identifier this request is for - * @param min_freq_hz: The minimum allowable frequency in Hz. This is the minimum - * allowable programmed frequency and does not account for clock - * tolerances and jitter. - * @param target_freq_hz: The target clock frequency. The clock will be programmed - * at a rate as close to this target frequency as possible. - * @param max_freq_hz: The maximum allowable frequency in Hz. This is the maximum - * allowable programmed frequency and does not account for clock - * tolerances and jitter. - * @param clk_id: Clock identifier for the device for this request. - * - * NOTE: Normally clock frequency management is automatically done by TISCI - * entity. In case of specific requests, TISCI evaluates capability to achieve - * requested range and responds with success/failure message. - * - * This sets the desired frequency for a clock within an allowable - * range. This message will fail on an enabled clock unless - * MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE is set for the clock. Additionally, - * if other clocks have their frequency modified due to this message, - * they also must have the MSG_FLAG_CLOCK_ALLOW_FREQ_CHANGE or be disabled. - * - * Calling set frequency on a clock input to the SoC pseudo-device will - * inform the PMMC of that clock's frequency. Setting a frequency of - * zero will indicate the clock is disabled. - * - * Calling set frequency on clock outputs from the SoC pseudo-device will - * function similarly to setting the clock frequency on a device. - * - * Request type is TISCI_MSG_SET_CLOCK_FREQ, response is a generic ACK/NACK - * message. - */ -struct tisci_msg_req_set_clock_freq { - struct tisci_msg_hdr hdr; - uint32_t dev_id; - uint64_t min_freq_hz; - uint64_t target_freq_hz; - uint64_t max_freq_hz; - uint8_t clk_id; -} __packed; - -/** - * @struct tisci_msg_resp_set_clock_freq - * @brief Response to set clock frequency (generic ACK/NACK) - */ -struct tisci_msg_resp_set_clock_freq { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_req_get_clock_freq - * @brief Request to get the clock frequency - * @param hdr: Generic Header - * @param dev_id: Device identifier this request is for - * @param clk_id: Clock identifier for the device for this request. - * - * NOTE: Normally clock frequency management is automatically done by TISCI - * entity. In some cases, clock frequencies are configured by host. - * - * Request type is TISCI_MSG_GET_CLOCK_FREQ, responded with clock frequency - * that the clock is currently at. - */ -struct tisci_msg_req_get_clock_freq { - struct tisci_msg_hdr hdr; - uint32_t dev_id; - uint8_t clk_id; -} __packed; - -/** - * @struct tisci_msg_resp_get_clock_freq - * @brief Response of clock frequency request - * @param hdr: Generic Header - * @param freq_hz: Frequency that the clock is currently on, in Hz. - * - * Response to request type TISCI_MSG_GET_CLOCK_FREQ. - */ -struct tisci_msg_resp_get_clock_freq { - struct tisci_msg_hdr hdr; - uint64_t freq_hz; -} __packed; - -#define TISCI_IRQ_SECONDARY_HOST_INVALID 0xff - -/** - * @struct tisci_msg_req_get_resource_range - * @brief Request to get a host's assigned - * range of resources. - * @param hdr: Generic Header - * @param type: Unique resource assignment type - * @param subtype: Resource assignment subtype within the resource type. - * @param secondary_host: Host processing entity to which the resources are - * allocated. This is required only when the destination - * host id id different from ti sci interface host id, - * else TISCI_IRQ_SECONDARY_HOST_INVALID can be passed. - * - * Request type is TISCI_MSG_GET_RESOURCE_RANGE. Responded with requested - * resource range which is of type TISCI_MSG_GET_RESOURCE_RANGE. - */ -struct tisci_msg_req_get_resource_range { - struct tisci_msg_hdr hdr; -#define MSG_RM_RESOURCE_TYPE_MASK GENMASK(9, 0) -#define MSG_RM_RESOURCE_SUBTYPE_MASK GENMASK(5, 0) - uint16_t type; - uint8_t subtype; - uint8_t secondary_host; -} __packed; - -/** - * @struct tisci_msg_resp_get_resource_range - * @brief Response to resource get range. - * @param hdr: Generic Header - * @param range_start: Start index of the resource range. - * @param range_num: Number of resources in the range. - * - * Response to request TISCI_MSG_GET_RESOURCE_RANGE. - */ -struct tisci_msg_resp_get_resource_range { - struct tisci_msg_hdr hdr; - uint16_t range_start; - uint16_t range_num; -} __packed; -#define TISCI_ADDR_LOW_MASK GENMASK64(31, 0) -#define TISCI_ADDR_HIGH_MASK GENMASK64(63, 32) -#define TISCI_ADDR_HIGH_SHIFT 32 - -/** - * @struct tisci_msg_req_proc_request - * @brief Request a processor - * - * @param hdr: Generic Header - * @param processor_id: ID of processor - * - * Request type is TISCI_MSG_PROC_REQUEST, response is a generic ACK/NACK - * message. - */ -struct tisci_msg_req_proc_request { - struct tisci_msg_hdr hdr; - uint8_t processor_id; -} __packed; - -/** - * @struct tisci_msg_resp_proc_request - * @brief Response to processor request (generic ACK/NACK) - */ -struct tisci_msg_resp_proc_request { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_req_proc_release - * @brief Release a processor - * - * @param hdr: Generic Header - * @param processor_id: ID of processor - * - * Request type is TISCI_MSG_PROC_RELEASE, response is a generic ACK/NACK - * message. - */ -struct tisci_msg_req_proc_release { - struct tisci_msg_hdr hdr; - uint8_t processor_id; -} __packed; - -/** - * @struct tisci_msg_resp_proc_release - * @brief Response to processor release (generic ACK/NACK) - */ -struct tisci_msg_resp_proc_release { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_req_proc_handover - * @brief Handover a processor to a host - * - * @param hdr: Generic Header - * @param processor_id: ID of processor - * @param host_id: New Host we want to give control to - * - * Request type is TISCI_MSG_PROC_HANDOVER, response is a generic ACK/NACK - * message. - */ -struct tisci_msg_req_proc_handover { - struct tisci_msg_hdr hdr; - uint8_t processor_id; - uint8_t host_id; -} __packed; - -/** - * @struct tisci_msg_resp_proc_handover - * @brief Response to processor handover (generic ACK/NACK) - */ -struct tisci_msg_resp_proc_handover { - struct tisci_msg_hdr hdr; -} __packed; - -/* A53 Config Flags */ -#define PROC_BOOT_CFG_FLAG_ARMV8_DBG_EN 0x00000001 -#define PROC_BOOT_CFG_FLAG_ARMV8_DBG_NIDEN 0x00000002 -#define PROC_BOOT_CFG_FLAG_ARMV8_DBG_SPIDEN 0x00000004 -#define PROC_BOOT_CFG_FLAG_ARMV8_DBG_SPNIDEN 0x00000008 -#define PROC_BOOT_CFG_FLAG_ARMV8_AARCH32 0x00000100 - -/* R5 Config Flags */ -#define PROC_BOOT_CFG_FLAG_R5_DBG_EN 0x00000001 -#define PROC_BOOT_CFG_FLAG_R5_DBG_NIDEN 0x00000002 -#define PROC_BOOT_CFG_FLAG_R5_LOCKSTEP 0x00000100 -#define PROC_BOOT_CFG_FLAG_R5_TEINIT 0x00000200 -#define PROC_BOOT_CFG_FLAG_R5_NMFI_EN 0x00000400 -#define PROC_BOOT_CFG_FLAG_R5_TCM_RSTBASE 0x00000800 -#define PROC_BOOT_CFG_FLAG_R5_BTCM_EN 0x00001000 -#define PROC_BOOT_CFG_FLAG_R5_ATCM_EN 0x00002000 - -/** - * @struct tisci_msg_req_set_proc_boot_config - * @brief Set Processor boot configuration - * @param hdr: Generic Header - * @param processor_id: ID of processor - * @param bootvector_low: Lower 32bit (Little Endian) of boot vector - * @param bootvector_high: Higher 32bit (Little Endian) of boot vector - * @param config_flags_set: Optional Processor specific Config Flags to set. - * Setting a bit here implies required bit sets to 1. - * @param config_flags_clear: Optional Processor specific Config Flags to clear. - * Setting a bit here implies required bit gets cleared. - * - * Request type is TISCI_MSG_SET_PROC_BOOT_CONFIG, response is a generic - * ACK/NACK message. - */ -struct tisci_msg_req_set_proc_boot_config { - struct tisci_msg_hdr hdr; - uint8_t processor_id; - uint32_t bootvector_low; - uint32_t bootvector_high; - uint32_t config_flags_set; - uint32_t config_flags_clear; -} __packed; - -/** - * @struct tisci_msg_resp_set_proc_boot_config - * @brief Response to set processor boot config (generic ACK/NACK) - */ -struct tisci_msg_resp_set_proc_boot_config { - struct tisci_msg_hdr hdr; -} __packed; - -/* R5 Control Flags */ -#define PROC_BOOT_CTRL_FLAG_R5_CORE_HALT 0x00000001 - -/** - * @struct tisci_msg_req_set_proc_boot_ctrl - * @brief Set Processor boot control flags - * @param hdr: Generic Header - * @param processor_id: ID of processor - * @param control_flags_set: Optional Processor specific Control Flags to set. - * Setting a bit here implies required bit sets to 1. - * @param control_flags_clear:Optional Processor specific Control Flags to clear. - * Setting a bit here implies required bit gets cleared. - * - * Request type is TISCI_MSG_SET_PROC_BOOT_CTRL, response is a generic ACK/NACK - * message. - */ -struct tisci_msg_req_set_proc_boot_ctrl { - struct tisci_msg_hdr hdr; - uint8_t processor_id; - uint32_t control_flags_set; - uint32_t control_flags_clear; -} __packed; - -/** - * @struct tisci_msg_resp_set_proc_boot_ctrl - * @brief Response to set processor boot control (generic ACK/NACK) - */ -struct tisci_msg_resp_set_proc_boot_ctrl { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_req_proc_auth_start_image - * @brief Authenticate and start image - * @param hdr: Generic Header - * @param cert_addr_low: Lower 32bit (Little Endian) of certificate - * @param cert_addr_high: Higher 32bit (Little Endian) of certificate - * - * Request type is TISCI_MSG_PROC_AUTH_BOOT_IMAGE, response is a generic - * ACK/NACK message. - */ -struct tisci_msg_req_proc_auth_boot_image { - struct tisci_msg_hdr hdr; - uint32_t cert_addr_low; - uint32_t cert_addr_high; -} __packed; - -struct tisci_msg_resp_proc_auth_boot_image { - struct tisci_msg_hdr hdr; - uint32_t image_addr_low; - uint32_t image_addr_high; - uint32_t image_size; -} __packed; - -/** - * @struct tisci_msg_req_get_proc_boot_status - * @brief Get processor boot status - * @param hdr: Generic Header - * @param processor_id: ID of processor - * - * Request type is TISCI_MSG_GET_PROC_BOOT_STATUS, response is appropriate - * message, or NACK in case of inability to satisfy request. - */ -struct tisci_msg_req_get_proc_boot_status { - struct tisci_msg_hdr hdr; - uint8_t processor_id; -} __packed; - -/* ARMv8 Status Flags */ -#define PROC_BOOT_STATUS_FLAG_ARMV8_WFE 0x00000001 -#define PROC_BOOT_STATUS_FLAG_ARMV8_WFI 0x00000002 - -/* R5 Status Flags */ -#define PROC_BOOT_STATUS_FLAG_R5_WFE 0x00000001 -#define PROC_BOOT_STATUS_FLAG_R5_WFI 0x00000002 -#define PROC_BOOT_STATUS_FLAG_R5_CLK_GATED 0x00000004 -#define PROC_BOOT_STATUS_FLAG_R5_LOCKSTEP_PERMITTED 0x00000100 - -/** - * @struct tisci_msg_resp_get_proc_boot_status - * @brief Processor boot status response - * @param hdr: Generic Header - * @param processor_id: ID of processor - * @param bootvector_low: Lower 32bit (Little Endian) of boot vector - * @param bootvector_high: Higher 32bit (Little Endian) of boot vector - * @param config_flags: Optional Processor specific Config Flags set. - * @param control_flags: Optional Processor specific Control Flags. - * @param status_flags: Optional Processor specific Status Flags set. - * - * Response to TISCI_MSG_GET_PROC_BOOT_STATUS. - */ -struct tisci_msg_resp_get_proc_boot_status { - struct tisci_msg_hdr hdr; - uint8_t processor_id; - uint32_t bootvector_low; - uint32_t bootvector_high; - uint32_t config_flags; - uint32_t control_flags; - uint32_t status_flags; -} __packed; - -/** - * @struct tisci_msg_req_wait_proc_boot_status - * @brief Wait for a processor boot status - * @param hdr: Generic Header - * @param processor_id: ID of processor - * @param num_wait_iterations: Total number of iterations we will check before - * we will timeout and give up - * @param num_match_iterations: How many iterations should we have continued - * status to account for status bits glitching. - * This is to make sure that match occurs for - * consecutive checks. This implies that the - * worst case should consider that the stable - * time should at the worst be num_wait_iterations - * num_match_iterations to prevent timeout. - * @param delay_per_iteration_us: Specifies how long to wait (in micro seconds) - * between each status checks. This is the minimum - * duration, and overhead of register reads and - * checks are on top of this and can vary based on - * varied conditions. - * @param delay_before_iterations_us: Specifies how long to wait (in micro seconds) - * before the very first check in the first - * iteration of status check loop. This is the - * minimum duration, and overhead of register - * reads and checks are. - * @param status_flags_1_set_all_wait:If non-zero, Specifies that all bits of the - * status matching this field requested MUST be 1. - * @param status_flags_1_set_any_wait:If non-zero, Specifies that at least one of the - * bits matching this field requested MUST be 1. - * @param status_flags_1_clr_all_wait:If non-zero, Specifies that all bits of the - * status matching this field requested MUST be 0. - * @param status_flags_1_clr_any_wait:If non-zero, Specifies that at least one of the - * bits matching this field requested MUST be 0. - * - * Request type is TISCI_MSG_WAIT_PROC_BOOT_STATUS, response is appropriate - * message, or NACK in case of inability to satisfy request. - */ -struct tisci_msg_req_wait_proc_boot_status { - struct tisci_msg_hdr hdr; - uint8_t processor_id; - uint8_t num_wait_iterations; - uint8_t num_match_iterations; - uint8_t delay_per_iteration_us; - uint8_t delay_before_iterations_us; - uint32_t status_flags_1_set_all_wait; - uint32_t status_flags_1_set_any_wait; - uint32_t status_flags_1_clr_all_wait; - uint32_t status_flags_1_clr_any_wait; -} __packed; - -/** - * @struct tisci_msg_rm_ring_cfg_req - * @brief Configure a Navigator Subsystem ring - * - * Configures the non-real-time registers of a Navigator Subsystem ring. - * @param hdr: Generic Header - * @param valid_params: Bitfield defining validity of ring configuration parameters. - * The ring configuration fields are not valid, and will not be used for - * ring configuration, if their corresponding valid bit is zero. - * Valid bit usage: - * 0 - Valid bit for tisci_msg_rm_ring_cfg_req addr_lo - * 1 - Valid bit for tisci_msg_rm_ring_cfg_req addr_hi - * 2 - Valid bit for tisci_msg_rm_ring_cfg_req count - * 3 - Valid bit for tisci_msg_rm_ring_cfg_req mode - * 4 - Valid bit for tisci_msg_rm_ring_cfg_req size - * 5 - Valid bit for tisci_msg_rm_ring_cfg_req order_id - * @param nav_id: Device ID of Navigator Subsystem from which the ring is allocated - * @param index: ring index to be configured. - * @param addr_lo: 32 LSBs of ring base address to be programmed into the ring's - * RING_BA_LO register - * @param addr_hi: 16 MSBs of ring base address to be programmed into the ring's - * RING_BA_HI register. - * @param count: Number of ring elements. Must be even if mode is CREDENTIALS or QM - * modes. - * @param mode: Specifies the mode the ring is to be configured. - * @param size: Specifies encoded ring element size. To calculate the encoded size use - * the formula (log2(size_bytes) - 2), where size_bytes cannot be - * greater than 256. - * @param order_id: Specifies the ring's bus order ID. - */ -struct tisci_msg_rm_ring_cfg_req { - struct tisci_msg_hdr hdr; - uint32_t valid_params; - uint16_t nav_id; - uint16_t index; - uint32_t addr_lo; - uint32_t addr_hi; - uint32_t count; - uint8_t mode; - uint8_t size; - uint8_t order_id; -} __packed; - -/** - * @struct tisci_msg_rm_ring_cfg_resp - * @brief Response to configuring a ring. - * - * @param hdr: Generic Header - */ -struct tisci_msg_rm_ring_cfg_resp { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_rm_ring_get_cfg_req - * @brief Get RA ring's configuration - * - * Gets the configuration of the non-real-time register fields of a ring. The - * host, or a supervisor of the host, who owns the ring must be the requesting - * host. The values of the non-real-time registers are returned in - * tisci_msg_rm_ring_get_cfg_resp. - * - * @param hdr: Generic Header - * @param nav_id: Device ID of Navigator Subsystem from which the ring is allocated - * @param index: ring index. - */ -struct tisci_msg_rm_ring_get_cfg_req { - struct tisci_msg_hdr hdr; - uint16_t nav_id; - uint16_t index; -} __packed; - -/** - * @struct tisci_msg_rm_ring_get_cfg_resp - * @brief Ring get configuration response - * - * Response received by host processor after RM has handled - * @ref tisci_msg_rm_ring_get_cfg_req. The response contains the ring's - * non-real-time register values. - * - * @param hdr: Generic Header - * @param addr_lo: Ring 32 LSBs of base address - * @param addr_hi: Ring 16 MSBs of base address. - * @param count: Ring number of elements. - * @param mode: Ring mode. - * @param size: encoded Ring element size - * @param order_id: ing order ID. - */ -struct tisci_msg_rm_ring_get_cfg_resp { - struct tisci_msg_hdr hdr; - uint32_t addr_lo; - uint32_t addr_hi; - uint32_t count; - uint8_t mode; - uint8_t size; - uint8_t order_id; -} __packed; - -/** - * @struct tisci_msg_psil_pair_req - * @brief Pairs a PSI-L source thread to a destination - * thread - * @param hdr: Generic Header - * @param nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is - * used to pair the source and destination threads. - * @param src_thread: PSI-L source thread ID within the PSI-L System thread map. - * - * UDMAP transmit channels mapped to source threads will have their - * TCHAN_THRD_ID register programmed with the destination thread if the pairing - * is successful. - - * @param dst_thread: PSI-L destination thread ID within the PSI-L System thread map. - * PSI-L destination threads start at index 0x8000. The request is NACK'd if - * the destination thread is not greater than or equal to 0x8000. - * - * UDMAP receive channels mapped to destination threads will have their - * RCHAN_THRD_ID register programmed with the source thread if the pairing - * is successful. - * - * Request type is TISCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK - * message. - */ -struct tisci_msg_psil_pair_req { - struct tisci_msg_hdr hdr; - uint32_t nav_id; - uint32_t src_thread; - uint32_t dst_thread; -} __packed; - -/** - * @struct tisci_msg_psil_pair_resp - * @brief Response to PSI-L thread pair request (generic ACK/NACK) - * @param hdr: Generic Header - */ -struct tisci_msg_psil_pair_resp { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_psil_unpair_req - * @brief Unpairs a PSI-L source thread from a destination thread - * @param hdr: Generic Header - * @param nav_id: SoC Navigator Subsystem device ID whose PSI-L config proxy is - * used to unpair the source and destination threads. - * @param src_thread: PSI-L source thread ID within the PSI-L System thread map. - * - * UDMAP transmit channels mapped to source threads will have their - * TCHAN_THRD_ID register cleared if the unpairing is successful. - * - * @param dst_thread: PSI-L destination thread ID within the PSI-L System thread map. - * PSI-L destination threads start at index 0x8000. The request is NACK'd if - * the destination thread is not greater than or equal to 0x8000. - * - * UDMAP receive channels mapped to destination threads will have their - * RCHAN_THRD_ID register cleared if the unpairing is successful. - * - * Request type is TISCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK - * message. - */ -struct tisci_msg_psil_unpair_req { - struct tisci_msg_hdr hdr; - uint32_t nav_id; - uint32_t src_thread; - uint32_t dst_thread; -} __packed; - -/** - * @struct tisci_msg_psil_unpair_resp - * @brief Response to PSI-L thread unpair request (generic ACK/NACK) - * @param hdr: Generic Header - */ -struct tisci_msg_psil_unpair_resp { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * Configures a Navigator Subsystem UDMAP transmit channel - * - * Configures the non-real-time registers of a Navigator Subsystem UDMAP - * transmit channel. The channel index must be assigned to the host defined - * in the TISCI header via the RM board configuration resource assignment - * range list. - * - * @param hdr: Generic Header - * - * @param valid_params: Bitfield defining validity of tx channel configuration - * parameters. The tx channel configuration fields are not valid, and will not - * be used for ch configuration, if their corresponding valid bit is zero. - * Valid bit usage: - * 0 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err - * 1 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_atype - * 2 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_chan_type - * 3 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size - * 4 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::txcq_qnum - * 5 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_priority - * 6 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_qos - * 7 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_orderid - * 8 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority - * 9 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo - * 10 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords - * 11 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt - * 12 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_credit_count - * 13 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::fdepth - * 14 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_burst_size - * 15 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::tx_tdtype - * 16 - Valid bit for tisci_msg_rm_udmap_tx_ch_cfg::extended_ch_type - * - * @param nav_id: SoC device ID of Navigator Subsystem where tx channel is located - * - * @param index: UDMAP transmit channel index. - * - * @param tx_pause_on_err: UDMAP transmit channel pause on error configuration to - * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG - * register. - * - * @param tx_filt_einfo: UDMAP transmit channel extended packet information passing - * configuration to be programmed into the tx_filt_einfo field of the - * channel's TCHAN_TCFG register. - * - * @param tx_filt_pswords: UDMAP transmit channel protocol specific word passing - * configuration to be programmed into the tx_filt_pswords field of the - * channel's TCHAN_TCFG register. - * - * @param tx_atype: UDMAP transmit channel non Ring Accelerator access pointer - * interpretation configuration to be programmed into the tx_atype field of - * the channel's TCHAN_TCFG register. - * - * @param tx_chan_type: UDMAP transmit channel functional channel type and work - * passing mechanism configuration to be programmed into the tx_chan_type - * field of the channel's TCHAN_TCFG register. - * - * @param tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression - * configuration to be programmed into the tx_supr_tdpkt field of the channel's - * TCHAN_TCFG register. - * - * @param tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to - * fetch configuration to be programmed into the tx_fetch_size field of the - * channel's TCHAN_TCFG register. The user must make sure to set the maximum - * word count that can pass through the channel for any allowed descriptor type. - * - * @param tx_credit_count: UDMAP transmit channel transfer request credit count - * configuration to be programmed into the count field of the TCHAN_TCREDIT - * register. Specifies how many credits for complete TRs are available. - * - * @param txcq_qnum: UDMAP transmit channel completion queue configuration to be - * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified - * completion queue must be assigned to the host, or a subordinate of the host, - * requesting configuration of the transmit channel. - * - * @param tx_priority: UDMAP transmit channel transmit priority value to be programmed - * into the priority field of the channel's TCHAN_TPRI_CTRL register. - * - * @param tx_qos: UDMAP transmit channel transmit qos value to be programmed into the - * qos field of the channel's TCHAN_TPRI_CTRL register. - * - * @param tx_orderid: UDMAP transmit channel bus order id value to be programmed into - * the orderid field of the channel's TCHAN_TPRI_CTRL register. - * - * @param fdepth: UDMAP transmit channel FIFO depth configuration to be programmed - * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of - * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP - * section of the TRM for restrictions regarding this parameter. - * - * @param tx_sched_priority: UDMAP transmit channel tx scheduling priority - * configuration to be programmed into the priority field of the channel's - * TCHAN_TST_SCHED register. - * - * @param tx_burst_size: UDMAP transmit channel burst size configuration to be - * programmed into the tx_burst_size field of the TCHAN_TCFG register. - * - * @param tx_tdtype: UDMAP transmit channel teardown type configuration to be - * programmed into the tdtype field of the TCHAN_TCFG register: - * 0 - Return immediately - * 1 - Wait for completion message from remote peer - * - * @param extended_ch_type: Valid for BCDMA. - * 0 - the channel is split tx channel (tchan) - * 1 - the channel is block copy channel (bchan) - */ -struct tisci_msg_rm_udmap_tx_ch_cfg_req { - struct tisci_msg_hdr hdr; - uint32_t valid_params; - uint16_t nav_id; - uint16_t index; - uint8_t tx_pause_on_err; - uint8_t tx_filt_einfo; - uint8_t tx_filt_pswords; - uint8_t tx_atype; - uint8_t tx_chan_type; - uint8_t tx_supr_tdpkt; - uint16_t tx_fetch_size; - uint8_t tx_credit_count; - uint16_t txcq_qnum; - uint8_t tx_priority; - uint8_t tx_qos; - uint8_t tx_orderid; - uint16_t fdepth; - uint8_t tx_sched_priority; - uint8_t tx_burst_size; - uint8_t tx_tdtype; - uint8_t extended_ch_type; -} __packed; - -/** - * @struct tisci_msg_rm_udmap_tx_ch_cfg_resp - * @brief Response to UDMAP transmit channel configuration request (generic ACK/NACK) - * @param hdr: Generic Header - */ -struct tisci_msg_rm_udmap_tx_ch_cfg_resp { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * Configures a Navigator Subsystem UDMAP receive channel - * - * Configures the non-real-time registers of a Navigator Subsystem UDMAP - * receive channel. The channel index must be assigned to the host defined - * in the TISCI header via the RM board configuration resource assignment - * range list. - * - * @param hdr: Generic Header - * - * @param valid_params: Bitfield defining validity of rx channel configuration - * parameters. - * The rx channel configuration fields are not valid, and will not be used for - * ch configuration, if their corresponding valid bit is zero. - * Valid bit usage: - * 0 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err - * 1 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_atype - * 2 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type - * 3 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size - * 4 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum - * 5 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_priority - * 6 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_qos - * 7 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid - * 8 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority - * 9 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::flowid_start - * 10 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt - * 11 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short - * 12 - Valid bit for @ref tisci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long - * - * @param nav_id: SoC device ID of Navigator Subsystem where rx channel is located - * - * @param index: UDMAP receive channel index. - * - * @param rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to - * fetch configuration to be programmed into the rx_fetch_size field of the - * channel's RCHAN_RCFG register. - * - * @param rxcq_qnum: UDMAP receive channel completion queue configuration to be - * programmed into the rxcq_qnum field of the RCHAN_RCQ register. - * The specified completion queue must be assigned to the host, or a subordinate - * of the host, requesting configuration of the receive channel. - * - * @param rx_priority: UDMAP receive channel receive priority value to be programmed - * into the priority field of the channel's RCHAN_RPRI_CTRL register. - * - * @param rx_qos: UDMAP receive channel receive qos value to be programmed into the - * qos field of the channel's RCHAN_RPRI_CTRL register. - * - * @param rx_orderid: UDMAP receive channel bus order id value to be programmed into - * the orderid field of the channel's RCHAN_RPRI_CTRL register. - * - * @param rx_sched_priority: UDMAP receive channel rx scheduling priority - * configuration to be programmed into the priority field of the channel's - * RCHAN_RST_SCHED register. - * - * @param flowid_start: UDMAP receive channel additional flows starting index - * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG - * register. Specifies the starting index for flow IDs the receive channel is to - * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be - * set as valid and configured together. The starting flow ID set by - * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset - * of flows beyond the default flows statically mapped to receive channels. - * The additional flows must be assigned to the host, or a subordinate of the - * host, requesting configuration of the receive channel. - * - * @param flowid_cnt: UDMAP receive channel additional flows count configuration to - * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register. - * This field specifies how many flow IDs are in the additional contiguous range - * of legal flow IDs for the channel. @ref flowid_start and flowid_cnt must be - * set as valid and configured together. Disabling the valid_params field bit - * for flowid_cnt indicates no flow IDs other than the default are to be - * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt - * cannot be greater than the number of receive flows in the receive channel's - * Navigator Subsystem. The additional flows must be assigned to the host, or a - * subordinate of the host, requesting configuration of the receive channel. - * - * @param rx_pause_on_err: UDMAP receive channel pause on error configuration to be - * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG - * register. - * - * @param rx_atype: UDMAP receive channel non Ring Accelerator access pointer - * interpretation configuration to be programmed into the rx_atype field of the - * channel's RCHAN_RCFG register. - * - * @param rx_chan_type: UDMAP receive channel functional channel type and work passing - * mechanism configuration to be programmed into the rx_chan_type field of the - * channel's RCHAN_RCFG register. - * - * @param rx_ignore_short: UDMAP receive channel short packet treatment configuration - * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register. - * - * @param rx_ignore_long: UDMAP receive channel long packet treatment configuration to - * be programmed into the rx_ignore_long field of the RCHAN_RCFG register. - */ -struct tisci_msg_rm_udmap_rx_ch_cfg_req { - struct tisci_msg_hdr hdr; - uint32_t valid_params; - uint16_t nav_id; - uint16_t index; - uint16_t rx_fetch_size; - uint16_t rxcq_qnum; - uint8_t rx_priority; - uint8_t rx_qos; - uint8_t rx_orderid; - uint8_t rx_sched_priority; - uint16_t flowid_start; - uint16_t flowid_cnt; - uint8_t rx_pause_on_err; - uint8_t rx_atype; - uint8_t rx_chan_type; - uint8_t rx_ignore_short; - uint8_t rx_ignore_long; -} __packed; - -/** - * @struct tisci_msg_rm_udmap_rx_ch_cfg_resp - * @brief Response to UDMAP receive channel configuration request (generic ACK/NACK) - * @param hdr: Generic Header - */ -struct tisci_msg_rm_udmap_rx_ch_cfg_resp { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * Configures a Navigator Subsystem UDMAP receive flow - * - * Configures a Navigator Subsystem UDMAP receive flow's registers. - * Configuration does not include the flow registers which handle size-based - * free descriptor queue routing. - * - * The flow index must be assigned to the host defined in the TISCI header via - * the RM board configuration resource assignment range list. - * - * @param hdr: Standard TISCI header - * - * Valid params - * Bitfield defining validity of rx flow configuration parameters. The - * rx flow configuration fields are not valid, and will not be used for flow - * configuration, if their corresponding valid bit is zero. Valid bit usage: - * 0 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present - * 1 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present - * 2 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_error_handling - * 3 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_desc_type - * 4 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset - * 5 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum - * 6 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi - * 7 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo - * 8 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi - * 9 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo - * 10 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel - * 11 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel - * 12 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel - * 13 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel - * 14 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum - * 15 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum - * 16 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum - * 17 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum - * 18 - Valid bit for reftisci_msg_rm_udmap_flow_cfg_req::rx_ps_location - * - * @param nav_id: SoC device ID of Navigator Subsystem from which the receive flow is - * allocated - * - * @param flow_index: UDMAP receive flow index for non-optional configuration. - * - * @param rx_einfo_present: - * UDMAP receive flow extended packet info present configuration to be - * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register. - * - * @param rx_psinfo_present: - * UDMAP receive flow PS words present configuration to be programmed into the - * rx_psinfo_present field of the flow's RFLOW_RFA register. - * - * @param rx_error_handling: - * UDMAP receive flow error handling configuration to be programmed into the - * rx_error_handling field of the flow's RFLOW_RFA register. - * - * @param rx_desc_type: - * UDMAP receive flow descriptor type configuration to be programmed into the - * rx_desc_type field field of the flow's RFLOW_RFA register. - * - * @param rx_sop_offset: - * UDMAP receive flow start of packet offset configuration to be programmed - * into the rx_sop_offset field of the RFLOW_RFA register. See the UDMAP - * section of the TRM for more information on this setting. Valid values for - * this field are 0-255 bytes. - * - * @param rx_dest_qnum: - * UDMAP receive flow destination queue configuration to be programmed into the - * rx_dest_qnum field of the flow's RFLOW_RFA register. The specified - * destination queue must be valid within the Navigator Subsystem and must be - * owned by the host, or a subordinate of the host, requesting allocation and - * configuration of the receive flow. - * - * @param rx_src_tag_hi: - * UDMAP receive flow source tag high byte constant configuration to be - * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register. - * See the UDMAP section of the TRM for more information on this setting. - * - * @param rx_src_tag_lo: - * UDMAP receive flow source tag low byte constant configuration to be - * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register. - * See the UDMAP section of the TRM for more information on this setting. - * - * @param rx_dest_tag_hi: - * UDMAP receive flow destination tag high byte constant configuration to be - * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register. - * See the UDMAP section of the TRM for more information on this setting. - * - * @param rx_dest_tag_lo: - * UDMAP receive flow destination tag low byte constant configuration to be - * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register. - * See the UDMAP section of the TRM for more information on this setting. - * - * @param rx_src_tag_hi_sel: - * UDMAP receive flow source tag high byte selector configuration to be - * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register. See - * the UDMAP section of the TRM for more information on this setting. - * - * @param rx_src_tag_lo_sel: - * UDMAP receive flow source tag low byte selector configuration to be - * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register. See - * the UDMAP section of the TRM for more information on this setting. - * - * @param rx_dest_tag_hi_sel: - * UDMAP receive flow destination tag high byte selector configuration to be - * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. See - * the UDMAP section of the TRM for more information on this setting. - * - * @param rx_dest_tag_lo_sel: - * UDMAP receive flow destination tag low byte selector configuration to be - * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register. See - * the UDMAP section of the TRM for more information on this setting. - * - * @param rx_fdq0_sz0_qnum: - * UDMAP receive flow free descriptor queue 0 configuration to be programmed - * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the - * UDMAP section of the TRM for more information on this setting. The specified - * free queue must be valid within the Navigator Subsystem and must be owned - * by the host, or a subordinate of the host, requesting allocation and - * configuration of the receive flow. - * - * @param rx_fdq1_qnum: - * UDMAP receive flow free descriptor queue 1 configuration to be programmed - * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the - * UDMAP section of the TRM for more information on this setting. The specified - * free queue must be valid within the Navigator Subsystem and must be owned - * by the host, or a subordinate of the host, requesting allocation and - * configuration of the receive flow. - * - * @param rx_fdq2_qnum: - * UDMAP receive flow free descriptor queue 2 configuration to be programmed - * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the - * UDMAP section of the TRM for more information on this setting. The specified - * free queue must be valid within the Navigator Subsystem and must be owned - * by the host, or a subordinate of the host, requesting allocation and - * configuration of the receive flow. - * - * @param rx_fdq3_qnum: - * UDMAP receive flow free descriptor queue 3 configuration to be programmed - * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the - * UDMAP section of the TRM for more information on this setting. The specified - * free queue must be valid within the Navigator Subsystem and must be owned - * by the host, or a subordinate of the host, requesting allocation and - * configuration of the receive flow. - * - * @param rx_ps_location: - * UDMAP receive flow PS words location configuration to be programmed into the - * rx_ps_location field of the flow's RFLOW_RFA register. - */ -struct tisci_msg_rm_udmap_flow_cfg_req { - struct tisci_msg_hdr hdr; - uint32_t valid_params; - uint16_t nav_id; - uint16_t flow_index; - uint8_t rx_einfo_present; - uint8_t rx_psinfo_present; - uint8_t rx_error_handling; - uint8_t rx_desc_type; - uint16_t rx_sop_offset; - uint16_t rx_dest_qnum; - uint8_t rx_src_tag_hi; - uint8_t rx_src_tag_lo; - uint8_t rx_dest_tag_hi; - uint8_t rx_dest_tag_lo; - uint8_t rx_src_tag_hi_sel; - uint8_t rx_src_tag_lo_sel; - uint8_t rx_dest_tag_hi_sel; - uint8_t rx_dest_tag_lo_sel; - uint16_t rx_fdq0_sz0_qnum; - uint16_t rx_fdq1_qnum; - uint16_t rx_fdq2_qnum; - uint16_t rx_fdq3_qnum; - uint8_t rx_ps_location; -} __packed; - -/** - * Response to configuring a Navigator Subsystem UDMAP receive flow - * - * @param hdr: Standard TISCI header - */ -struct tisci_msg_rm_udmap_flow_cfg_resp { - struct tisci_msg_hdr hdr; -} __packed; - -#define FWL_MAX_PRIVID_SLOTS 3U - -/** - * @struct tisci_msg_fwl_set_firewall_region_req - * @brief Request for configuring the firewall permissions. - * - * @param hdr: Generic Header - * - * @param fwl_id: Firewall ID in question - * @param region: Region or channel number to set config info - * This field is unused in case of a simple firewall and must be initialized - * to zero. In case of a region based firewall, this field indicates the - * region in question. (index starting from 0) In case of a channel based - * firewall, this field indicates the channel in question (index starting - * from 0) - * @param n_permission_regs: Number of permission registers to set - * @param control: Contents of the firewall CONTROL register to set - * @param permissions: Contents of the firewall PERMISSION register to set - * @param start_address: Contents of the firewall START_ADDRESS register to set - * @param end_address: Contents of the firewall END_ADDRESS register to set - */ - -struct tisci_msg_fwl_set_firewall_region_req { - struct tisci_msg_hdr hdr; - uint16_t fwl_id; - uint16_t region; - uint32_t n_permission_regs; - uint32_t control; - uint32_t permissions[FWL_MAX_PRIVID_SLOTS]; - uint64_t start_address; - uint64_t end_address; -} __packed; - -/** - * @struct tisci_msg_fwl_set_firewall_region_resp - * @brief Response to set firewall region (generic ACK/NACK) - */ -struct tisci_msg_fwl_set_firewall_region_resp { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @struct tisci_msg_fwl_get_firewall_region_req - * @brief Request for retrieving the firewall permissions - * - * @param hdr: Generic Header - * - * @param fwl_id: Firewall ID in question - * @param region: Region or channel number to get config info - * This field is unused in case of a simple firewall and must be initialized - * to zero. In case of a region based firewall, this field indicates the - * region in question (index starting from 0). In case of a channel based - * firewall, this field indicates the channel in question (index starting - * from 0). - * @param n_permission_regs: Number of permission registers to retrieve - */ -struct tisci_msg_fwl_get_firewall_region_req { - struct tisci_msg_hdr hdr; - uint16_t fwl_id; - uint16_t region; - uint32_t n_permission_regs; -} __packed; - -/** - * @struct tisci_msg_fwl_get_firewall_region_resp - * @brief Response for retrieving the firewall permissions - * - * @param hdr: Generic Header - * - * @param fwl_id: Firewall ID in question - * @param region: Region or channel number to set config info This field is - * unused in case of a simple firewall and must be initialized to zero. In - * case of a region based firewall, this field indicates the region in - * question. (index starting from 0) In case of a channel based firewall, this - * field indicates the channel in question (index starting from 0) - * @param n_permission_regs: Number of permission registers retrieved - * @param control: Contents of the firewall CONTROL register - * @param permissions: Contents of the firewall PERMISSION registers - * @param start_address: Contents of the firewall START_ADDRESS - * register This is not applicable for - * channelized firewalls. - * @param end_address: Contents of the firewall END_ADDRESS register This is not applicable for - * channelized firewalls. - */ -struct tisci_msg_fwl_get_firewall_region_resp { - struct tisci_msg_hdr hdr; - uint16_t fwl_id; - uint16_t region; - uint32_t n_permission_regs; - uint32_t control; - uint32_t permissions[FWL_MAX_PRIVID_SLOTS]; - uint64_t start_address; - uint64_t end_address; -} __packed; - -/** - * @struct tisci_msg_fwl_change_owner_info_req - * @brief Request for a firewall owner change - * - * @param hdr: Generic Header - * - * @param fwl_id: Firewall ID in question - * @param region: Region or channel number if applicable - * @param owner_index: New owner index to transfer ownership to - */ -struct tisci_msg_fwl_change_owner_info_req { - struct tisci_msg_hdr hdr; - uint16_t fwl_id; - uint16_t region; - uint8_t owner_index; -} __packed; - -/** - * @struct tisci_msg_fwl_change_owner_info_resp - * @brief Response for a firewall owner change - * - * @param hdr: Generic Header - * - * @param fwl_id: Firewall ID specified in request - * @param region: Region or channel number specified in request - * @param owner_index: Owner index specified in request - * @param owner_privid: New owner priv-ID returned by DMSC. - * @param owner_permission_bits: New owner permission bits returned by DMSC. - */ - -struct tisci_msg_fwl_change_owner_info_resp { - struct tisci_msg_hdr hdr; - uint16_t fwl_id; - uint16_t region; - uint8_t owner_index; - uint8_t owner_privid; - uint16_t owner_permission_bits; -} __packed; - -/** - * @brief Request to set up an interrupt route. - * - * Configures peripherals within the interrupt subsystem according to the - * valid configuration provided. - * - * @param hdr Standard TISCI header. - * @param valid_params Bitfield defining validity of interrupt route set parameters. - * Each bit corresponds to a field's validity. - * @param src_id ID of interrupt source peripheral. - * @param src_index Interrupt source index within source peripheral. - * @param dst_id SoC IR device ID (valid if TISCI_MSG_VALUE_RM_DST_ID_VALID is set). - * @param dst_host_irq SoC IR output index (valid if TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID - * is set). - * @param ia_id Device ID of interrupt aggregator (valid if - * TISCI_MSG_VALUE_RM_IA_ID_VALID is set). - * @param vint Virtual interrupt number (valid if TISCI_MSG_VALUE_RM_VINT_VALID is - * set). - * @param global_event Global event mapped to interrupt aggregator (valid if - * TISCI_MSG_VALUE_RM_GLOBAL_EVENT_VALID is set). - * @param vint_status_bit_index Virtual interrupt status bit (valid if - * TISCI_MSG_VALUE_RM_VINT_STATUS_BIT_INDEX_VALID is set). - * @param secondary_host Secondary host value (valid if - * TISCI_MSG_VALUE_RM_SECONDARY_HOST_VALID is set). - */ -struct tisci_msg_rm_irq_set_req { - struct tisci_msg_hdr hdr; - uint32_t valid_params; - uint16_t src_id; - uint16_t src_index; - uint16_t dst_id; - uint16_t dst_host_irq; - uint16_t ia_id; - uint16_t vint; - uint16_t global_event; - uint8_t vint_status_bit_index; - uint8_t secondary_host; -} __packed; - -/** - * @brief Response to setting a peripheral to processor interrupt. - * - * @param hdr Standard TISCI header. - */ -struct tisci_msg_rm_irq_set_resp { - struct tisci_msg_hdr hdr; -} __packed; - -/** - * @brief Request to release interrupt peripheral resources. - * - * Releases interrupt peripheral resources according to the valid configuration provided. - * - * @param hdr Standard TISCI header. - * @param valid_params Bitfield defining validity of interrupt route release parameters. - * Each bit corresponds to a field's validity. - * @param src_id ID of interrupt source peripheral. - * @param src_index Interrupt source index within source peripheral. - * @param dst_id SoC IR device ID (valid if TISCI_MSG_VALUE_RM_DST_ID_VALID is set). - * @param dst_host_irq SoC IR output index (valid if TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID - * is set). - * @param ia_id Device ID of interrupt aggregator (valid if - * TISCI_MSG_VALUE_RM_IA_ID_VALID is set). - * @param vint Virtual interrupt number (valid if TISCI_MSG_VALUE_RM_VINT_VALID is - * set). - * @param global_event Global event mapped to interrupt aggregator (valid if - * TISCI_MSG_VALUE_RM_GLOBAL_EVENT_VALID is set). - * @param vint_status_bit_index Virtual interrupt status bit (valid if - * TISCI_MSG_VALUE_RM_VINT_STATUS_BIT_INDEX_VALID is set). - * @param secondary_host Secondary host value (valid if - * TISCI_MSG_VALUE_RM_SECONDARY_HOST_VALID is set). - */ -struct tisci_msg_rm_irq_release_req { - struct tisci_msg_hdr hdr; - uint32_t valid_params; - uint16_t src_id; - uint16_t src_index; - uint16_t dst_id; - uint16_t dst_host_irq; - uint16_t ia_id; - uint16_t vint; - uint16_t global_event; - uint8_t vint_status_bit_index; - uint8_t secondary_host; -} __packed; - -/** - * @brief Response to releasing a peripheral to processor interrupt. - * - * @param hdr Standard TISCI header. - */ -struct tisci_msg_rm_irq_release_resp { - struct tisci_msg_hdr hdr; -} __packed; - -#endif /* INCLUDE_ZEPHYR_DRIVERS_MISC_TISCI_H_ */ diff --git a/dts/bindings/firmware/ti,k2g-sci.yaml b/dts/bindings/firmware/ti,k2g-sci.yaml deleted file mode 100644 index ebdbcb97dd5..00000000000 --- a/dts/bindings/firmware/ti,k2g-sci.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2025 Texas Instruments Incorporated. -# SPDX-License-Identifier: Apache-2.0 - -description: TISCI Client Driver - -compatible: "ti,k2g-sci" - -include: [base.yaml] - -properties: - reg: - required: true - - ti,host-id: - type: int - required: true - description: Host ID for processor - - mboxes: - description: phandle to the MBOX controller (TX and RX are required) - required: true - - mbox-names: - description: MBOX channel names (must be called "tx" and "rx") - required: true diff --git a/include/zephyr/drivers/firmware/tisci/tisci.h b/include/zephyr/drivers/firmware/tisci/tisci.h deleted file mode 100644 index 8097d6d4405..00000000000 --- a/include/zephyr/drivers/firmware/tisci/tisci.h +++ /dev/null @@ -1,1037 +0,0 @@ -/* - * Copyright (c) 2025, Texas Instruments - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief Public APIs for the TISCI driver - * - */ - -#ifndef INCLUDE_ZEPHYR_DRIVERS_TISCI_H_ -#define INCLUDE_ZEPHYR_DRIVERS_TISCI_H_ - -#include - -#define MAILBOX_MBOX_SIZE 60 - -/** - * @struct tisci_version_info - * @brief version information structure - * @param abi_major: Major ABI version. Change here implies risk of backward - * compatibility break. - * @param abi_minor: Minor ABI version. Change here implies new feature addition, - * or compatible change in ABI. - * @param firmware_revision: Firmware revision (not usually used). - * @param firmware_description: Firmware description (not usually used). - */ -struct tisci_version_info { - uint8_t abi_major; - uint8_t abi_minor; - uint16_t firmware_revision; - char firmware_description[32]; -}; - -/** - * @struct tisci_msg_fwl_region_cfg - * @brief Request and Response for firewalls settings - * - * @param fwl_id: Firewall ID in question - * @param region: Region or channel number to set config info - * This field is unused in case of a simple firewall and must be initialized - * to zero. In case of a region based firewall, this field indicates the - * region in question. (index starting from 0) In case of a channel based - * firewall, this field indicates the channel in question (index starting - * from 0) - * @param n_permission_regs: Number of permission registers to set - * @param control: Contents of the firewall CONTROL register to set - * @param permissions: Contents of the firewall PERMISSION register to set - * @param start_address: Contents of the firewall START_ADDRESS register to set - * @param end_address: Contents of the firewall END_ADDRESS register to set - */ -struct tisci_msg_fwl_region { - uint16_t fwl_id; - uint16_t region; - uint32_t n_permission_regs; - uint32_t control; - uint32_t permissions[3]; - uint64_t start_address; - uint64_t end_address; -}; - -/** - * @brief Request and Response for firewall owner change - * @struct tisci_msg_fwl_owner - * @param fwl_id: Firewall ID in question - * @param region: Region or channel number to set config info - * This field is unused in case of a simple firewall and must be initialized - * to zero. In case of a region based firewall, this field indicates the - * region in question. (index starting from 0) In case of a channel based - * firewall, this field indicates the channel in question (index starting - * from 0) - * @param n_permission_regs: Number of permission registers <= 3 - * @param control: Control register value for this region - * @param owner_index: New owner index to change to. Owner indexes are setup in DMSC firmware boot - *configuration data - * @param owner_privid: New owner priv-id, used to lookup owner_index is not known, must be set to - *zero otherwise - * @param owner_permission_bits: New owner permission bits - */ -struct tisci_msg_fwl_owner { - uint16_t fwl_id; - uint16_t region; - uint8_t owner_index; - uint8_t owner_privid; - uint16_t owner_permission_bits; -}; - -/** - * Configures a Navigator Subsystem UDMAP transmit channel - * - * Configures a Navigator Subsystem UDMAP transmit channel registers. - * See tisci_msg_rm_udmap_tx_ch_cfg_req - */ -struct tisci_msg_rm_udmap_tx_ch_cfg { - uint32_t valid_params; -#define TISCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_EINFO_VALID BIT(9) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_PSWORDS_VALID BIT(10) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_TX_SUPR_TDPKT_VALID BIT(11) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_TX_CREDIT_COUNT_VALID BIT(12) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_TX_FDEPTH_VALID BIT(13) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_TX_TDTYPE_VALID BIT(15) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_EXTENDED_CH_TYPE_VALID BIT(16) - uint16_t nav_id; - uint16_t index; - uint8_t tx_pause_on_err; - uint8_t tx_filt_einfo; - uint8_t tx_filt_pswords; - uint8_t tx_atype; - uint8_t tx_chan_type; - uint8_t tx_supr_tdpkt; - uint16_t tx_fetch_size; - uint8_t tx_credit_count; - uint16_t txcq_qnum; - uint8_t tx_priority; - uint8_t tx_qos; - uint8_t tx_orderid; - uint16_t fdepth; - uint8_t tx_sched_priority; - uint8_t tx_burst_size; - uint8_t tx_tdtype; - uint8_t extended_ch_type; -}; - -/** - * Configures a Navigator Subsystem UDMAP receive channel - * - * Configures a Navigator Subsystem UDMAP receive channel registers. - * See tisci_msg_rm_udmap_rx_ch_cfg_req - */ -struct tisci_msg_rm_udmap_rx_ch_cfg { - uint32_t valid_params; -#define TISCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_START_VALID BIT(9) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_CNT_VALID BIT(10) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_SHORT_VALID BIT(11) -#define TISCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_LONG_VALID BIT(12) - uint16_t nav_id; - uint16_t index; - uint16_t rx_fetch_size; - uint16_t rxcq_qnum; - uint8_t rx_priority; - uint8_t rx_qos; - uint8_t rx_orderid; - uint8_t rx_sched_priority; - uint16_t flowid_start; - uint16_t flowid_cnt; - uint8_t rx_pause_on_err; - uint8_t rx_atype; - uint8_t rx_chan_type; - uint8_t rx_ignore_short; - uint8_t rx_ignore_long; - uint8_t rx_burst_size; -}; - -#define TISCI_MSG_VALUE_RM_DST_ID_VALID (1u << 0u) -#define TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID (1u << 1u) -#define TISCI_MSG_VALUE_RM_IA_ID_VALID (1u << 2u) -#define TISCI_MSG_VALUE_RM_VINT_VALID (1u << 3u) -#define TISCI_MSG_VALUE_RM_GLOBAL_EVENT_VALID (1u << 4u) -#define TISCI_MSG_VALUE_RM_VINT_STATUS_BIT_INDEX_VALID (1u << 5u) - -/** - * @brief Request to set up an interrupt route. - * - * Configures peripherals within the interrupt subsystem according to the - * valid configuration provided. - * - * @param valid_params Bitfield defining validity of interrupt route set parameters. - * Each bit corresponds to a field's validity. - * @param src_id ID of interrupt source peripheral. - * @param src_index Interrupt source index within source peripheral. - * @param dst_id SoC IR device ID (valid if TISCI_MSG_VALUE_RM_DST_ID_VALID is set). - * @param dst_host_irq SoC IR output index (valid if TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID - * is set). - * @param ia_id Device ID of interrupt aggregator (valid if - * TISCI_MSG_VALUE_RM_IA_ID_VALID is set). - * @param vint Virtual interrupt number (valid if TISCI_MSG_VALUE_RM_VINT_VALID is - * set). - * @param global_event Global event mapped to interrupt aggregator (valid if - * TISCI_MSG_VALUE_RM_GLOBAL_EVENT_VALID is set). - * @param vint_status_bit_index Virtual interrupt status bit (valid if - * TISCI_MSG_VALUE_RM_VINT_STATUS_BIT_INDEX_VALID is set). - * @param secondary_host Secondary host value (valid if - * TISCI_MSG_VALUE_RM_SECONDARY_HOST_VALID is set). - */ -struct tisci_irq_set_req { - uint32_t valid_params; - uint16_t src_id; - uint16_t src_index; - uint16_t dst_id; - uint16_t dst_host_irq; - uint16_t ia_id; - uint16_t vint; - uint16_t global_event; - uint8_t vint_status_bit_index; - uint8_t secondary_host; -}; - -/** - * @brief Request to release interrupt peripheral resources. - * - * Releases interrupt peripheral resources according to the valid configuration provided. - * - * @param valid_params Bitfield defining validity of interrupt route release parameters. - * Each bit corresponds to a field's validity. - * @param src_id ID of interrupt source peripheral. - * @param src_index Interrupt source index within source peripheral. - * @param dst_id SoC IR device ID (valid if TISCI_MSG_VALUE_RM_DST_ID_VALID is set). - * @param dst_host_irq SoC IR output index (valid if TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID - * is set). - * @param ia_id Device ID of interrupt aggregator (valid if - * TISCI_MSG_VALUE_RM_IA_ID_VALID is set). - * @param vint Virtual interrupt number (valid if TISCI_MSG_VALUE_RM_VINT_VALID is - * set). - * @param global_event Global event mapped to interrupt aggregator (valid if - * TISCI_MSG_VALUE_RM_GLOBAL_EVENT_VALID is set). - * @param vint_status_bit_index Virtual interrupt status bit (valid if - * TISCI_MSG_VALUE_RM_VINT_STATUS_BIT_INDEX_VALID is set). - * @param secondary_host Secondary host value (valid if - * TISCI_MSG_VALUE_RM_SECONDARY_HOST_VALID is set). - */ - -struct tisci_irq_release_req { - uint32_t valid_params; - uint16_t src_id; - uint16_t src_index; - uint16_t dst_id; - uint16_t dst_host_irq; - uint16_t ia_id; - uint16_t vint; - uint16_t global_event; - uint8_t vint_status_bit_index; - uint8_t secondary_host; -}; - -/* Version/Revision Functions */ - -/** - * @brief Get the revision information of the TI SCI firmware - * - * Queries the TI SCI firmware for its version and revision information. - * The retrieved information is stored in the provided @p ver structure. - * - * @param dev Pointer to the TI SCI device - * @param ver Pointer to a structure where the firmware version information will be stored - * - * @return 0 if successful, or a negative error code on failure - */ -int tisci_cmd_get_revision(const struct device *dev, struct tisci_version_info *ver); - -/* Clock Management Functions */ - -/** - * @brief Get the state of a clock - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param programmed_state Pointer to store the requested state of the clock - * @param current_state Pointer to store the current state of the clock - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_clock_state(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint8_t *programmed_state, uint8_t *current_state); - -/** - * @brief Set the state of a clock - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param flags Header flags as needed - * @param state State to request for the clock - * - * @return 0 if successful, or an error code - */ -int tisci_set_clock_state(const struct device *dev, uint32_t dev_id, uint8_t clk_id, uint32_t flags, - uint8_t state); - -/** - * @brief Check if the clock is ON - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param req_state Pointer to store whether the clock is managed and enabled - * @param curr_state Pointer to store whether the clock is ready for operation - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_is_on(const struct device *dev, uint32_t dev_id, uint8_t clk_id, bool *req_state, - bool *curr_state); - -/** - * @brief Check if the clock is OFF - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param req_state Pointer to store whether the clock is managed and disabled - * @param curr_state Pointer to store whether the clock is NOT ready for operation - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_is_off(const struct device *dev, uint32_t dev_id, uint8_t clk_id, bool *req_state, - bool *curr_state); - -/** - * @brief Check if the clock is being auto-managed - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param req_state Pointer to store whether the clock is auto-managed - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_is_auto(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - bool *req_state); - -/** - * @brief Get the current frequency of a clock - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param freq Pointer to store the current frequency in Hz - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_get_freq(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint64_t *freq); - -/** - * @brief Set a frequency for a clock - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param min_freq Minimum allowable frequency in Hz - * @param target_freq Target clock frequency in Hz - * @param max_freq Maximum allowable frequency in Hz - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_set_freq(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint64_t min_freq, uint64_t target_freq, uint64_t max_freq); - -/** - * @brief Get a matching frequency for a clock - * - * Finds a frequency that matches the requested range for a clock. - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param min_freq Minimum allowable frequency in Hz - * @param target_freq Target clock frequency in Hz - * @param max_freq Maximum allowable frequency in Hz - * @param match_freq Pointer to store the matched frequency in Hz - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_get_match_freq(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint64_t min_freq, uint64_t target_freq, uint64_t max_freq, - uint64_t *match_freq); - -/** - * @brief Set the parent clock for a clock - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param parent_id Identifier of the parent clock to set - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_set_parent(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint8_t parent_id); - -/** - * @brief Get the parent clock for a clock - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param parent_id Pointer to store the identifier of the parent clock - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_get_parent(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint8_t *parent_id); - -/** - * @brief Get the number of parent clocks for a clock - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param num_parents Pointer to store the number of parent clocks - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_clk_get_num_parents(const struct device *dev, uint32_t dev_id, uint8_t clk_id, - uint8_t *num_parents); - -/** - * @brief Get control of a clock from TI SCI - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * @param needs_ssc 'true' if Spread Spectrum clock is desired, else 'false' - * @param can_change_freq 'true' if frequency change is desired, else 'false' - * @param enable_input_term 'true' if input termination is desired, else 'false' - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_clock(const struct device *dev, uint32_t dev_id, uint8_t clk_id, bool needs_ssc, - bool can_change_freq, bool enable_input_term); - -/** - * @brief Idle a clock that is under control of TI SCI - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_idle_clock(const struct device *dev, uint32_t dev_id, uint8_t clk_id); - -/** - * @brief Release a clock from control back to TI SCI - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clk_id Clock identifier for the device for this request - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_put_clock(const struct device *dev, uint32_t dev_id, uint8_t clk_id); - -/* Device Management Functions */ - -/** - * @brief Set the state of a device - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param flags Flags to set for the device - * @param state State to move the device to: - * - 0: Device is off - * - 1: Device is on - * - 2: Device is in retention - * - 3: Device is in reset - * - * @return 0 if successful, or an error code - */ -int tisci_set_device_state(const struct device *dev, uint32_t dev_id, uint32_t flags, - uint8_t state); - -/** - * @brief Set the state of a device without waiting for a response - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param flags Flags to set for the device - * @param state State to move the device to: - * - 0: Device is off - * - 1: Device is on - * - 2: Device is in retention - * - 3: Device is in reset - * - * @return 0 if successful, or an error code - */ -int tisci_set_device_state_no_wait(const struct device *dev, uint32_t dev_id, uint32_t flags, - uint8_t state); - -/** - * @brief Get the state of a device - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param clcnt Pointer to store the Context Loss Count - * @param resets Pointer to store the reset count - * @param p_state Pointer to store the programmed state - * @param c_state Pointer to store the current state - * - * @return 0 if successful, or an error code - */ -int tisci_get_device_state(const struct device *dev, uint32_t dev_id, uint32_t *clcnt, - uint32_t *resets, uint8_t *p_state, uint8_t *c_state); - -/** - * @brief Request exclusive access to a device managed by TISCI - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_device(const struct device *dev, uint32_t dev_id); -int tisci_cmd_get_device_exclusive(const struct device *dev, uint32_t dev_id); - -/** - * @brief Command to idle a device managed by TISCI - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_idle_device(const struct device *dev, uint32_t dev_id); -int tisci_cmd_idle_device_exclusive(const struct device *dev, uint32_t dev_id); - -/** - * @brief Command to release a device managed by TISCI - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_put_device(const struct device *dev, uint32_t dev_id); - -/** - * @brief Check if a device ID is valid - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * - * @return 0 if the device ID is valid, or an error code - */ -int tisci_cmd_dev_is_valid(const struct device *dev, uint32_t dev_id); - -/** - * @brief Get the context loss counter for a device - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param count Pointer to store the context loss counter - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_dev_get_clcnt(const struct device *dev, uint32_t dev_id, uint32_t *count); - -/** - * @brief Check if the device is requested to be idle - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param r_state Pointer to store the result (true if requested to be idle) - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_dev_is_idle(const struct device *dev, uint32_t dev_id, bool *r_state); - -/** - * @brief Check if the device is requested to be stopped - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param r_state Pointer to store the result (true if requested to be stopped) - * @param curr_state Pointer to store the result (true if currently stopped) - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_dev_is_stop(const struct device *dev, uint32_t dev_id, bool *r_state, - bool *curr_state); - -/** - * @brief Check if the device is requested to be ON - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param r_state Pointer to store the result (true if requested to be ON) - * @param curr_state Pointer to store the result (true if currently ON and active) - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_dev_is_on(const struct device *dev, uint32_t dev_id, bool *r_state, bool *curr_state); - -/** - * @brief Check if the device is currently transitioning - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param curr_state Pointer to store the result (true if currently transitioning) - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_dev_is_trans(const struct device *dev, uint32_t dev_id, bool *curr_state); - -/** - * @brief Set resets for a device managed by TISCI - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param reset_state Device-specific reset bit field - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_set_device_resets(const struct device *dev, uint32_t dev_id, uint32_t reset_state); - -/** - * @brief Get reset state for a device managed by TISCI - * - * @param dev Pointer to the TI SCI device - * @param dev_id Device identifier for this request - * @param reset_state Pointer to store the reset state - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_device_resets(const struct device *dev, uint32_t dev_id, uint32_t *reset_state); - -/* Resource Management Functions */ - -/** - * @brief Get a range of resources assigned to a host - * - * @param dev Pointer to the TI SCI device - * @param dev_id TISCI device ID - * @param subtype Resource assignment subtype being requested - * @param s_host Host processor ID to which the resources are allocated - * @param range_start Pointer to store the start index of the resource range - * @param range_num Pointer to store the number of resources in the range - * - * @return 0 if successful, or an error code - */ -int tisci_get_resource_range(const struct device *dev, uint32_t dev_id, uint8_t subtype, - uint8_t s_host, uint16_t *range_start, uint16_t *range_num); - -/** - * @brief Get a range of resources assigned to the host - * - * @param dev Pointer to the TI SCI device - * @param dev_id TISCI device ID - * @param subtype Resource assignment subtype being requested - * @param range_start Pointer to store the start index of the resource range - * @param range_num Pointer to store the number of resources in the range - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_resource_range(const struct device *dev, uint32_t dev_id, uint8_t subtype, - uint16_t *range_start, uint16_t *range_num); - -/** - * @brief Get a range of resources assigned to a specified host - * - * @param dev Pointer to the TI SCI device - * @param dev_id TISCI device ID - * @param subtype Resource assignment subtype being requested - * @param s_host Host processor ID to which the resources are allocated - * @param range_start Pointer to store the start index of the resource range - * @param range_num Pointer to store the number of resources in the range - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_resource_range_from_shost(const struct device *dev, uint32_t dev_id, - uint8_t subtype, uint8_t s_host, uint16_t *range_start, - uint16_t *range_num); - -/* Processor Management Functions */ - -/** - * @brief Command to request a physical processor control - * - * @param dev Pointer to the TI SCI device - * @param proc_id Processor ID this request is for - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_proc_request(const struct device *dev, uint8_t proc_id); - -/** - * @brief Command to release a physical processor control - * - * @param dev Pointer to the TI SCI device - * @param proc_id Processor ID this request is for - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_proc_release(const struct device *dev, uint8_t proc_id); - -/** - * @brief Command to handover a physical processor control to a host - * in the processor's access control list - * - * @param dev Pointer to the TI SCI device - * @param proc_id Processor ID this request is for - * @param host_id Host ID to get the control of the processor - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_proc_handover(const struct device *dev, uint8_t proc_id, uint8_t host_id); - -/** - * @brief Command to set the processor boot configuration flags - * - * @param dev Pointer to the TI SCI device - * @param proc_id Processor ID this request is for - * @param bootvector Boot vector address - * @param config_flags_set Configuration flags to be set - * @param config_flags_clear Configuration flags to be cleared - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_set_proc_boot_cfg(const struct device *dev, uint8_t proc_id, uint64_t bootvector, - uint32_t config_flags_set, uint32_t config_flags_clear); - -/** - * @brief Command to set the processor boot control flags - * - * @param dev Pointer to the TI SCI device - * @param proc_id Processor ID this request is for - * @param control_flags_set Control flags to be set - * @param control_flags_clear Control flags to be cleared - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_set_proc_boot_ctrl(const struct device *dev, uint8_t proc_id, - uint32_t control_flags_set, uint32_t control_flags_clear); - -/** - * @brief Command to authenticate and load the image, then set the processor configuration flags - * - * @param dev Pointer to the TI SCI device - * @param image_addr Pointer to the memory address of the payload image and certificate - * @param image_size Pointer to the size of the image after authentication - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_proc_auth_boot_image(const struct device *dev, uint64_t *image_addr, - uint32_t *image_size); - -/** - * @brief Command to get the processor boot status - * - * @param dev Pointer to the TI SCI device - * @param proc_id Processor ID this request is for - * @param bv Pointer to store the boot vector - * @param cfg_flags Pointer to store the configuration flags - * @param ctrl_flags Pointer to store the control flags - * @param sts_flags Pointer to store the status flags - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_proc_boot_status(const struct device *dev, uint8_t proc_id, uint64_t *bv, - uint32_t *cfg_flags, uint32_t *ctrl_flags, uint32_t *sts_flags); - -/** - * @brief Helper function to wait for a processor boot status without requesting or waiting for a - * response - * - * @param dev Pointer to the TI SCI device - * @param proc_id Processor ID this request is for - * @param num_wait_iterations Total number of iterations to check before timeout - * @param num_match_iterations Number of consecutive matches required to confirm status - * @param delay_per_iteration_us Delay in microseconds between each status check - * @param delay_before_iterations_us Delay in microseconds before the first status check - * @param status_flags_1_set_all_wait Flags that must all be set to 1 - * @param status_flags_1_set_any_wait Flags where at least one must be set to 1 - * @param status_flags_1_clr_all_wait Flags that must all be cleared to 0 - * @param status_flags_1_clr_any_wait Flags where at least one must be cleared to 0 - * - * @return 0 if successful, or an error code - */ -int tisci_proc_wait_boot_status_no_wait(const struct device *dev, uint8_t proc_id, - uint8_t num_wait_iterations, uint8_t num_match_iterations, - uint8_t delay_per_iteration_us, - uint8_t delay_before_iterations_us, - uint32_t status_flags_1_set_all_wait, - uint32_t status_flags_1_set_any_wait, - uint32_t status_flags_1_clr_all_wait, - uint32_t status_flags_1_clr_any_wait); - -/** - * @brief Command to shutdown a core without requesting or waiting for a response - * - * @param dev Pointer to the TI SCI device - * @param proc_id Processor ID this request is for - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_proc_shutdown_no_wait(const struct device *dev, uint8_t proc_id); - -/* Board Configuration Functions */ - -/** - * @brief Set board configuration using a specified message type - * - * Sends a board configuration message to the TI SCI firmware with configuration - * data from a specified memory location. - * - * @param dev Pointer to the TI SCI device - * @param msg_type TISCI message type for board configuration - * @param addr Physical address of board configuration data - * @param size Size of board configuration data in bytes - * - * @return 0 if successful, or an error code - */ -int cmd_set_board_config_using_msg(const struct device *dev, uint16_t msg_type, uint64_t addr, - uint32_t size); - -/* Ring Configuration Function */ - -/** - * @brief Configure a RA ring - * - * @param dev Pointer to the TI SCI device - * @param valid_params Bitfield defining validity of ring configuration parameters - * @param nav_id Device ID of Navigator Subsystem from which the ring is allocated - * @param index Ring index - * @param addr_lo The ring base address low 32 bits - * @param addr_hi The ring base address high 32 bits - * @param count Number of ring elements - * @param mode The mode of the ring - * @param size The ring element size - * @param order_id Specifies the ring's bus order ID - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_ring_config(const struct device *dev, uint32_t valid_params, uint16_t nav_id, - uint16_t index, uint32_t addr_lo, uint32_t addr_hi, uint32_t count, - uint8_t mode, uint8_t size, uint8_t order_id); - -/* System Control Functions */ - -/** - * @brief Request a system reset - * - * Commands the TI SCI firmware to perform a system reset. - * - * @param dev Pointer to the TI SCI device - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_sys_reset(const struct device *dev); - -/* Memory Management Functions */ - -/** - * @brief Query the available MSMC memory range - * - * Queries the TI SCI firmware for the currently available MSMC (Multi-Standard - * Shared Memory Controller) memory range. - * - * @param dev Pointer to the TI SCI device - * @param msmc_start Pointer to store the MSMC start address - * @param msmc_end Pointer to store the MSMC end address - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_query_msmc(const struct device *dev, uint64_t *msmc_start, uint64_t *msmc_end); - -/* Firewall Management Functions */ - -/** - * @brief Configure a firewall region - * - * Sets up a firewall region with the specified configuration parameters - * including permissions, addresses, and control settings. - * - * @param dev Pointer to the TI SCI device - * @param region Pointer to the firewall region configuration parameters - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_set_fwl_region(const struct device *dev, const struct tisci_msg_fwl_region *region); - -/* INCLUDE_ZEPHYR_DRIVERS_TISCI_H_ */ - -/* Firewall Management Functions */ -/* ... previous firewall functions ... */ - -/** - * @brief Get firewall region configuration - * - * Retrieves the configuration of a firewall region including permissions, - * addresses, and control settings. - * - * @param dev Pointer to the TI SCI device - * @param region Pointer to store the firewall region configuration. - * The fwl_id, region, and n_permission_regs fields must be - * set before calling this function. - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_fwl_region(const struct device *dev, struct tisci_msg_fwl_region *region); - -/* INCLUDE_ZEPHYR_DRIVERS_TISCI_H_ */ - -/* Firewall Management Functions */ -/* ... previous firewall functions ... */ - -/** - * @brief Get firewall region configuration - * - * Retrieves the configuration of a firewall region including permissions, - * addresses, and control settings. - * - * @param dev Pointer to the TI SCI device - * @param region Pointer to store the firewall region configuration. - * The fwl_id, region, and n_permission_regs fields must be - * set before calling this function. - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_fwl_region(const struct device *dev, struct tisci_msg_fwl_region *region); - -/* Firewall Management Functions */ -/* ... previous firewall functions ... */ - -/** - * @brief Get firewall region configuration - * - * Retrieves the configuration of a firewall region including permissions, - * addresses, and control settings. - * - * @param dev Pointer to the TI SCI device - * @param region Pointer to store the firewall region configuration. - * The fwl_id, region, and n_permission_regs fields must be - * set before calling this function. - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_get_fwl_region(const struct device *dev, struct tisci_msg_fwl_region *region); - -/* Firewall Management Functions */ -/* ... previous firewall functions ... */ - -/** - * @brief Change firewall region owner - * - * Changes the ownership of a firewall region and retrieves updated - * ownership information. - * - * @param dev Pointer to the TI SCI device - * @param owner Pointer to firewall owner configuration. - * On input: contains fwl_id, region, and owner_index - * On output: contains updated ownership information - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_change_fwl_owner(const struct device *dev, struct tisci_msg_fwl_owner *owner); - -/* UDMAP Management Functions */ - -/** - * @brief Configure a UDMAP transmit channel - * - * Configures the non-real-time registers of a Navigator Subsystem UDMAP - * transmit channel. - * - * @param dev Pointer to the TI SCI device - * @param params Pointer to the transmit channel configuration parameters - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_rm_udmap_tx_ch_cfg(const struct device *dev, - const struct tisci_msg_rm_udmap_tx_ch_cfg *params); - -/** - * @brief Configure a UDMAP receive channel - * - * Configures the non-real-time registers of a Navigator Subsystem UDMAP - * receive channel. - * - * @param dev Pointer to the TI SCI device - * @param params Pointer to the receive channel configuration parameters - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_rm_udmap_rx_ch_cfg(const struct device *dev, - const struct tisci_msg_rm_udmap_rx_ch_cfg *params); - -/* PSI-L Management Functions */ - -/** - * @brief Pair PSI-L source thread to destination thread - * - * Pairs a PSI-L source thread to a destination thread in the - * Navigator Subsystem. - * - * @param dev Pointer to the TI SCI device - * @param nav_id Navigator Subsystem device ID - * @param src_thread Source thread ID - * @param dst_thread Destination thread ID - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_rm_psil_pair(const struct device *dev, uint32_t nav_id, uint32_t src_thread, - uint32_t dst_thread); - -/** - * @brief Unpair PSI-L source thread from destination thread - * - * Unpairs a PSI-L source thread from a destination thread in the - * Navigator Subsystem. - * - * @param dev Pointer to the TI SCI device - * @param nav_id Navigator Subsystem device ID - * @param src_thread Source thread ID - * @param dst_thread Destination thread ID - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_rm_psil_unpair(const struct device *dev, uint32_t nav_id, uint32_t src_thread, - uint32_t dst_thread); - -/** - * @brief Set a Navigator Subsystem IRQ - * - * Sets up an interrupt route in the Navigator Subsystem using the provided request structure. - * - * @param dev Pointer to the TI SCI device - * @param req Pointer to the IRQ set request structure - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_rm_irq_set(const struct device *dev, struct tisci_irq_set_req *req); - -/** - * @brief Release a Navigator Subsystem IRQ - * - * Releases an interrupt route in the Navigator Subsystem using the provided request structure. - * - * @param dev Pointer to the TI SCI device - * @param req Pointer to the IRQ release request structure - * - * @return 0 if successful, or an error code - */ -int tisci_cmd_rm_irq_release(const struct device *dev, struct tisci_irq_release_req *req); -#endif From 23fcd076101b2e87a4b0a6cd46b8bb2379ddadfe Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 329/881] Revert "[nrf fromtree] drivers: firmware: nrf_ironside: add nrf9280 to CPUCONF service" This reverts commit ef6adf71bfd81180aa64d785732d9abc26012c7b. Signed-off-by: Jukka Rissanen --- drivers/firmware/nrf_ironside/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/nrf_ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig index 4c313618638..13866aba52d 100644 --- a/drivers/firmware/nrf_ironside/Kconfig +++ b/drivers/firmware/nrf_ironside/Kconfig @@ -3,7 +3,7 @@ config NRF_IRONSIDE bool - depends on SOC_NRF54H20_IRON || SOC_NRF9280_IRON + depends on SOC_NRF54H20_IRON help This is selected by drivers interacting with Nordic IRONside firmware. @@ -28,11 +28,11 @@ config NRF_IRONSIDE_CALL_INIT_PRIORITY endif # NRF_IRONSIDE_CALL menu "Nordic IRONside services" - depends on SOC_NRF54H20_IRON || SOC_NRF9280_IRON + depends on SOC_NRF54H20_IRON config NRF_IRONSIDE_CPUCONF_SERVICE bool "IRONside CPUCONF service" - depends on SOC_NRF54H20_CPUAPP || SOC_NRF9280_CPUAPP + depends on SOC_NRF54H20_CPUAPP select NRF_IRONSIDE_CALL help Service used to boot local domain cores. From 96c8cd6c590b08fd864eff284a1a3bb7c32fa49d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 330/881] Revert "[nrf fromtree] drivers: nrf_ironside dvfs service" This reverts commit f3fd75707ce42d24b2349dcd82b92040a2503c4f. Signed-off-by: Jukka Rissanen --- drivers/firmware/nrf_ironside/CMakeLists.txt | 1 - drivers/firmware/nrf_ironside/Kconfig | 17 -- drivers/firmware/nrf_ironside/dvfs.c | 184 ------------------ .../drivers/firmware/nrf_ironside/dvfs.h | 92 --------- modules/hal_nordic/nrfs/CMakeLists.txt | 4 +- 5 files changed, 2 insertions(+), 296 deletions(-) delete mode 100644 drivers/firmware/nrf_ironside/dvfs.c delete mode 100644 include/zephyr/drivers/firmware/nrf_ironside/dvfs.h diff --git a/drivers/firmware/nrf_ironside/CMakeLists.txt b/drivers/firmware/nrf_ironside/CMakeLists.txt index ddc46bd69b1..bc2adf842ed 100644 --- a/drivers/firmware/nrf_ironside/CMakeLists.txt +++ b/drivers/firmware/nrf_ironside/CMakeLists.txt @@ -8,4 +8,3 @@ zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_DVFS_SERVICE dvfs.c) diff --git a/drivers/firmware/nrf_ironside/Kconfig b/drivers/firmware/nrf_ironside/Kconfig index 13866aba52d..e009df4df05 100644 --- a/drivers/firmware/nrf_ironside/Kconfig +++ b/drivers/firmware/nrf_ironside/Kconfig @@ -50,21 +50,4 @@ config NRF_IRONSIDE_BOOT_REPORT help Support for parsing the Boot Report populated by Nordic IRONside firmware. -config NRF_IRONSIDE_DVFS_SERVICE - bool "IRONside DVFS service" - depends on SOC_NRF54H20_CPUAPP - select NRF_IRONSIDE_CALL - help - Service used to handle DVFS operating point requests. - -if NRF_IRONSIDE_DVFS_SERVICE - -config NRF_IRONSIDE_DVFS_OPPOINT_CHANGE_MUTEX_TIMEOUT_MS - int "IRONSside DVFS change oppoint mutex timeout" - default 100 - help - Maximum tiemout when waiting for DVFS oppoint change mutex lock. - -endif # NRF_IRONSIDE_DVFS_SERVICE - endmenu diff --git a/drivers/firmware/nrf_ironside/dvfs.c b/drivers/firmware/nrf_ironside/dvfs.c deleted file mode 100644 index 89208f71fb7..00000000000 --- a/drivers/firmware/nrf_ironside/dvfs.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include - -#include -#include - -static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH; - -struct dvfs_hsfll_data_t { - uint32_t new_f_mult; - uint32_t new_f_trim_entry; - uint32_t max_hsfll_freq; -}; - -static const struct dvfs_hsfll_data_t dvfs_hsfll_data[] = { - /* ABB oppoint 0.8V */ - { - .new_f_mult = 20, - .new_f_trim_entry = 0, - .max_hsfll_freq = 320000000, - }, - /* ABB oppoint 0.6V */ - { - .new_f_mult = 8, - .new_f_trim_entry = 2, - .max_hsfll_freq = 128000000, - }, - /* ABB oppoint 0.5V */ - { - .new_f_mult = 4, - .new_f_trim_entry = 3, - .max_hsfll_freq = 64000000, - }, -}; - -BUILD_ASSERT(ARRAY_SIZE(dvfs_hsfll_data) == (IRONSIDE_DVFS_OPPOINT_COUNT), - "dvfs_hsfll_data size must match number of DVFS oppoints"); - -/** - * @brief Check if the requested oppoint change operation is downscaling. - * - * @param target_freq_setting The target oppoint to check. - * @return true if the current oppoint is higher than the target, false otherwise. - */ -static bool ironside_dvfs_is_downscaling(enum ironside_dvfs_oppoint target_freq_setting) -{ - return current_dvfs_oppoint < target_freq_setting; -} - -/** - * @brief Configure hsfll depending on selected oppoint - * - * @param enum oppoint target operation point - */ -static void ironside_dvfs_configure_hsfll(enum ironside_dvfs_oppoint oppoint) -{ - nrf_hsfll_trim_t hsfll_trim = {}; - uint8_t freq_trim_idx = dvfs_hsfll_data[oppoint].new_f_trim_entry; - -#if defined(NRF_APPLICATION) - hsfll_trim.vsup = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.VSUP; - hsfll_trim.coarse = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.COARSE[freq_trim_idx]; - hsfll_trim.fine = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.FINE[freq_trim_idx]; -#if NRF_HSFLL_HAS_TCOEF_TRIM - hsfll_trim.tcoef = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.TCOEF; -#endif -#else -#error "Only application core is supported for DVFS" -#endif - - nrf_hsfll_clkctrl_mult_set(NRF_HSFLL, dvfs_hsfll_data[oppoint].new_f_mult); - nrf_hsfll_trim_set(NRF_HSFLL, &hsfll_trim); - nrf_barrier_w(); - - nrf_hsfll_task_trigger(NRF_HSFLL, NRF_HSFLL_TASK_FREQ_CHANGE); - /* Trigger hsfll task one more time, SEE PAC-4078 */ - nrf_hsfll_task_trigger(NRF_HSFLL, NRF_HSFLL_TASK_FREQ_CHANGE); -} - -/* Function handling steps for DVFS oppoint change. */ -static void ironside_dvfs_prepare_to_scale(enum ironside_dvfs_oppoint dvfs_oppoint) -{ - if (ironside_dvfs_is_downscaling(dvfs_oppoint)) { - ironside_dvfs_configure_hsfll(dvfs_oppoint); - } -} - -/* Update MDK variable which is used by nrfx_coredep_delay_us (k_busy_wait). */ -static void ironside_dvfs_update_core_clock(enum ironside_dvfs_oppoint dvfs_oppoint) -{ - extern uint32_t SystemCoreClock; - - SystemCoreClock = dvfs_hsfll_data[dvfs_oppoint].max_hsfll_freq; -} - -/* Perform scaling finnish procedure. */ -static void ironside_dvfs_change_oppoint_complete(enum ironside_dvfs_oppoint dvfs_oppoint) -{ - if (!ironside_dvfs_is_downscaling(dvfs_oppoint)) { - ironside_dvfs_configure_hsfll(dvfs_oppoint); - } - - current_dvfs_oppoint = dvfs_oppoint; - ironside_dvfs_update_core_clock(dvfs_oppoint); -} - -/** - * @brief Check if ABB analog part is locked. - * - * @param abb Pointer to ABB peripheral. - * - * @return true if ABB is locked, false otherwise. - */ -static inline bool ironside_dvfs_is_abb_locked(NRF_ABB_Type *abb) -{ - /* Check if ABB analog part is locked. */ - return ((abb->STATUSANA & ABB_STATUSANA_LOCKED_Msk) != 0); -} - -/** - * @brief Request DVFS oppoint change from IRONside secure domain. - * This function will send a request over IPC to the IRONside secure domain - * This function is synchronous and will return when the request is completed. - * - * @param oppoint @ref enum ironside_dvfs_oppoint - * @return int - */ -static int ironside_dvfs_req_oppoint(enum ironside_dvfs_oppoint oppoint) -{ - int err; - - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_DVFS_SERVICE_V0; - buf->args[IRONSIDE_DVFS_SERVICE_OPPOINT_IDX] = oppoint; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_DVFS_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} - -int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint) -{ - int status = 0; - - if (!ironside_dvfs_is_oppoint_valid(dvfs_oppoint)) { - return -IRONSIDE_DVFS_ERROR_WRONG_OPPOINT; - } - - if (!ironside_dvfs_is_abb_locked(NRF_ABB)) { - return -IRONSIDE_DVFS_ERROR_BUSY; - } - - if (dvfs_oppoint == current_dvfs_oppoint) { - return status; - } - - if (k_is_in_isr()) { - return -IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED; - } - - ironside_dvfs_prepare_to_scale(dvfs_oppoint); - - status = ironside_dvfs_req_oppoint(dvfs_oppoint); - - if (status != 0) { - return status; - } - ironside_dvfs_change_oppoint_complete(dvfs_oppoint); - - return status; -} diff --git a/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h b/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h deleted file mode 100644 index 7d6587bb3c0..00000000000 --- a/include/zephyr/drivers/firmware/nrf_ironside/dvfs.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_ -#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_ - -#include -#include -#include -#include - -enum ironside_dvfs_oppoint { - IRONSIDE_DVFS_OPP_HIGH = 0, - IRONSIDE_DVFS_OPP_MEDLOW = 1, - IRONSIDE_DVFS_OPP_LOW = 2 -}; - -/** - * @brief Number of DVFS oppoints supported by IRONside. - * - * This is the number of different DVFS oppoints that can be set on IRONside. - * The oppoints are defined in the `ironside_dvfs_oppoint` enum. - */ -#define IRONSIDE_DVFS_OPPOINT_COUNT (3) - -/** - * @name IRONside DVFS service error codes. - * @{ - */ - -/** The requested DVFS oppoint is not allowed. */ -#define IRONSIDE_DVFS_ERROR_WRONG_OPPOINT (1) -/** Waiting for mutex lock timed out, or hardware is busy. */ -#define IRONSIDE_DVFS_ERROR_BUSY (2) -/** There is configuration error in the DVFS service. */ -#define IRONSIDE_DVFS_ERROR_OPPOINT_DATA (3) -/** The caller does not have permission to change the DVFS oppoint. */ -#define IRONSIDE_DVFS_ERROR_PERMISSION (4) -/** The requested DVFS oppoint is already set, no change needed. */ -#define IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED (5) -/** The operation timed out, possibly due to a hardware issue. */ -#define IRONSIDE_DVFS_ERROR_TIMEOUT (6) -/** The DVFS oppoint change operation is not allowed in the ISR context. */ -#define IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED (7) - -/** - * @} - */ - -/* IRONside call identifiers with implicit versions. - * - * With the initial "version 0", the service ABI is allowed to break until the - * first production release of IRONside SE. - */ -#define IRONSIDE_CALL_ID_DVFS_SERVICE_V0 3 - -/* Index of the DVFS oppoint within the service buffer. */ -#define IRONSIDE_DVFS_SERVICE_OPPOINT_IDX (0) -/* Index of the return code within the service buffer. */ -#define IRONSIDE_DVFS_SERVICE_RETCODE_IDX (0) - -/** - * @brief Change the current DVFS oppoint. - * - * This function will request a change of the current DVFS oppoint to the - * specified value. It will block until the change is applied. - * - * @param dvfs_oppoint The new DVFS oppoint to set. - * @return int 0 on success, negative error code on failure. - */ -int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint); - -/** - * @brief Check if the given oppoint is valid. - * - * @param dvfs_oppoint The oppoint to check. - * @return true if the oppoint is valid, false otherwise. - */ -static inline bool ironside_dvfs_is_oppoint_valid(enum ironside_dvfs_oppoint dvfs_oppoint) -{ - if (dvfs_oppoint != IRONSIDE_DVFS_OPP_HIGH && - dvfs_oppoint != IRONSIDE_DVFS_OPP_MEDLOW && - dvfs_oppoint != IRONSIDE_DVFS_OPP_LOW) { - return false; - } - - return true; -} - -#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_ */ diff --git a/modules/hal_nordic/nrfs/CMakeLists.txt b/modules/hal_nordic/nrfs/CMakeLists.txt index dcc7c340ed3..d94c2da32a8 100644 --- a/modules/hal_nordic/nrfs/CMakeLists.txt +++ b/modules/hal_nordic/nrfs/CMakeLists.txt @@ -14,12 +14,12 @@ if(CONFIG_NRFS) zephyr_include_directories(${INC_DIR}) zephyr_include_directories(${INC_DIR}/services) - zephyr_include_directories_ifdef(CONFIG_NRFS_HAS_DVFS_SERVICE ${HELPERS_DIR}) + zephyr_include_directories(${HELPERS_DIR}) zephyr_include_directories(.) zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/backends) zephyr_include_directories_ifdef(CONFIG_NRFS_DVFS_LOCAL_DOMAIN ${CMAKE_CURRENT_SOURCE_DIR}/dvfs) - zephyr_library_sources_ifdef(CONFIG_NRFS_HAS_DVFS_SERVICE ${HELPERS_DIR}/dvfs_oppoint.c) + zephyr_library_sources(${HELPERS_DIR}/dvfs_oppoint.c) if(CONFIG_NRFS_LOCAL_DOMAIN) zephyr_library_sources_ifdef(CONFIG_NRFS_AUDIOPLL_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_audiopll.c) From 2b44b11f8036b70bf8f5c5fbb7be71fc68a26664 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 331/881] Revert "[nrf fromtree] drivers: mspi_dw: Prevent RX FIFO overflows in Single IO mode" This reverts commit d02d1b4e91f6318201e909db240659347a6da515. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 47 +++++++----------------------------------- 1 file changed, 7 insertions(+), 40 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index e57511b409a..adc59e765b1 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -78,13 +78,6 @@ struct mspi_dw_config { const struct gpio_dt_spec *ce_gpios; uint8_t ce_gpios_len; uint8_t tx_fifo_depth_minus_1; - /* Maximum number of items allowed in the TX FIFO when transmitting - * dummy bytes; it must be at least one less than the RX FIFO depth - * to account for a byte that can be partially received (i.e. in - * the shifting register) when tx_dummy_bytes() calculates how many - * bytes can be written to the TX FIFO to not overflow the RX FIFO. - */ - uint8_t max_queued_dummy_bytes; uint8_t tx_fifo_threshold; uint8_t rx_fifo_threshold; DECLARE_REG_ACCESS(); @@ -158,11 +151,7 @@ static void tx_data(const struct device *dev, if (buf_pos >= buf_end) { /* Set the threshold to 0 to get the next interrupt - * when the FIFO is completely emptied. This also sets - * the TX start level to 0, so if the transmission was - * not started so far because the FIFO was not filled - * up completely (the start level was set to maximum - * in start_next_packet()), it will be started now. + * when the FIFO is completely emptied. */ write_txftlr(dev, 0); break; @@ -181,22 +170,11 @@ static bool tx_dummy_bytes(const struct device *dev) { struct mspi_dw_data *dev_data = dev->data; const struct mspi_dw_config *dev_config = dev->config; - uint8_t fifo_room = dev_config->max_queued_dummy_bytes + uint8_t fifo_room = dev_config->tx_fifo_depth_minus_1 + 1 - FIELD_GET(TXFLR_TXTFL_MASK, read_txflr(dev)); - uint8_t rx_fifo_items = FIELD_GET(RXFLR_RXTFL_MASK, read_rxflr(dev)); uint16_t dummy_bytes = dev_data->dummy_bytes; const uint8_t dummy_val = 0; - /* Subtract the number of items that are already stored in the RX - * FIFO to avoid overflowing it; `max_queued_dummy_bytes` accounts - * that one byte that can be partially received, thus not included - * in the value from the RXFLR register. - */ - if (fifo_room <= rx_fifo_items) { - return false; - } - fifo_room -= rx_fifo_items; - if (dummy_bytes > fifo_room) { dev_data->dummy_bytes = dummy_bytes - fifo_room; @@ -211,10 +189,8 @@ static bool tx_dummy_bytes(const struct device *dev) write_dr(dev, dummy_val); } while (--dummy_bytes); - /* Set the TX start level to 0, so that the transmission will be - * started now if it hasn't been yet. The threshold value is also - * set to 0 here, but it doesn't really matter, as the interrupt - * will be anyway disabled. + /* Set the threshold to 0 to get the next interrupt when the FIFO is + * completely emptied. */ write_txftlr(dev, 0); @@ -314,16 +290,12 @@ static void mspi_dw_isr(const struct device *dev) if (int_status & ISR_TXEIS_BIT) { if (tx_dummy_bytes(dev)) { - /* All the required dummy bytes were - * written to the FIFO; disable the TXE - * interrupt, as it's no longer needed. - */ write_imr(dev, IMR_RXFIM_BIT); } int_status = read_isr(dev); } - } while (int_status != 0); + } while (int_status); } if (finished) { @@ -951,11 +923,8 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) * clock stretching feature does not work yet, or in Standard * SPI mode, where the clock stretching is not available at all. */ - uint8_t start_level = dev_data->dummy_bytes != 0 - ? dev_config->max_queued_dummy_bytes - 1 - : dev_config->tx_fifo_depth_minus_1; - - write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, start_level) | + write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, + dev_config->tx_fifo_depth_minus_1) | FIELD_PREP(TXFTLR_TFT_MASK, dev_config->tx_fifo_threshold)); } else { @@ -1437,8 +1406,6 @@ static DEVICE_API(mspi, drv_api) = { TX_FIFO_DEPTH(inst)) #define MSPI_DW_FIFO_PROPS(inst) \ .tx_fifo_depth_minus_1 = TX_FIFO_DEPTH(inst) - 1, \ - .max_queued_dummy_bytes = MIN(RX_FIFO_DEPTH(inst) - 1, \ - TX_FIFO_DEPTH(inst)), \ .tx_fifo_threshold = \ DT_INST_PROP_OR(inst, tx_fifo_threshold, \ 7 * TX_FIFO_DEPTH(inst) / 8 - 1), \ From d8dc3a3f8f2ef5cb274bb66983ec158aec34361b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 332/881] Revert "[nrf fromlist] drivers: spi: nrfx_spim: use dmm" This reverts commit 9f730b0351edec58ebd933480fd9907fe14638d2. Signed-off-by: Jukka Rissanen --- drivers/spi/spi_nrfx_spim.c | 75 +++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index c8a0566b68a..438a1b22999 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -16,7 +16,6 @@ #ifdef CONFIG_SOC_NRF54H20_GPD #include #endif -#include #ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 #include #endif @@ -124,6 +123,9 @@ struct spi_nrfx_config { #endif uint32_t wake_pin; nrfx_gpiote_t wake_gpiote; +#ifdef CONFIG_DCACHE + uint32_t mem_attr; +#endif #ifdef USE_CLOCK_REQUESTS const struct device *clk_dev; struct nrf_clock_spec clk_spec; @@ -132,7 +134,6 @@ struct spi_nrfx_config { bool cross_domain; int8_t default_port; #endif - void *mem_reg; }; static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context); @@ -503,6 +504,11 @@ static void transfer_next_chunk(const struct device *dev) } memcpy(dev_data->tx_buffer, tx_buf, chunk_len); +#ifdef CONFIG_DCACHE + if (dev_config->mem_attr & DT_MEM_CACHEABLE) { + sys_cache_data_flush_range(dev_data->tx_buffer, chunk_len); + } +#endif tx_buf = dev_data->tx_buffer; } @@ -519,20 +525,10 @@ static void transfer_next_chunk(const struct device *dev) dev_data->chunk_len = chunk_len; - xfer.tx_length = spi_context_tx_buf_on(ctx) ? chunk_len : 0; - xfer.rx_length = spi_context_rx_buf_on(ctx) ? chunk_len : 0; - - error = dmm_buffer_out_prepare(dev_config->mem_reg, tx_buf, xfer.tx_length, - (void **)&xfer.p_tx_buffer); - if (error != 0) { - goto out_alloc_failed; - } - - error = dmm_buffer_in_prepare(dev_config->mem_reg, rx_buf, xfer.rx_length, - (void **)&xfer.p_rx_buffer); - if (error != 0) { - goto in_alloc_failed; - } + xfer.p_tx_buffer = tx_buf; + xfer.tx_length = spi_context_tx_buf_on(ctx) ? chunk_len : 0; + xfer.p_rx_buffer = rx_buf; + xfer.rx_length = spi_context_rx_buf_on(ctx) ? chunk_len : 0; #ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 if (xfer.rx_length == 1 && xfer.tx_length <= 1) { @@ -555,15 +551,8 @@ static void transfer_next_chunk(const struct device *dev) anomaly_58_workaround_clear(dev_data); #endif } - - /* On nrfx_spim_xfer() error */ - dmm_buffer_in_release(dev_config->mem_reg, rx_buf, xfer.rx_length, - (void **)&xfer.p_rx_buffer); -in_alloc_failed: - dmm_buffer_out_release(dev_config->mem_reg, (void **)&xfer.p_tx_buffer); } -out_alloc_failed: finish_transaction(dev, error); } @@ -571,7 +560,9 @@ static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context) { const struct device *dev = p_context; struct spi_nrfx_data *dev_data = dev->data; +#ifdef CONFIG_DCACHE const struct spi_nrfx_config *dev_config = dev->config; +#endif if (p_event->type == NRFX_SPIM_EVENT_DONE) { /* Chunk length is set to 0 when a transaction is aborted @@ -585,21 +576,15 @@ static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context) #ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 anomaly_58_workaround_clear(dev_data); #endif - - if (spi_context_tx_buf_on(&dev_data->ctx)) { - dmm_buffer_out_release(dev_config->mem_reg, - (void **)p_event->xfer_desc.p_tx_buffer); - } - - if (spi_context_rx_buf_on(&dev_data->ctx)) { - dmm_buffer_in_release(dev_config->mem_reg, dev_data->ctx.rx_buf, - dev_data->chunk_len, p_event->xfer_desc.p_rx_buffer); - } - #ifdef SPI_BUFFER_IN_RAM if (spi_context_rx_buf_on(&dev_data->ctx) && p_event->xfer_desc.p_rx_buffer != NULL && p_event->xfer_desc.p_rx_buffer != dev_data->ctx.rx_buf) { +#ifdef CONFIG_DCACHE + if (dev_config->mem_attr & DT_MEM_CACHEABLE) { + sys_cache_data_invd_range(dev_data->rx_buffer, dev_data->chunk_len); + } +#endif (void)memcpy(dev_data->ctx.rx_buf, dev_data->rx_buffer, dev_data->chunk_len); @@ -893,6 +878,8 @@ static int spi_nrfx_deinit(const struct device *dev) return 0; } +#define SPIM_MEM_REGION(idx) DT_PHANDLE(SPIM(idx), memory_regions) + #define SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \ IF_ENABLED(NRFX_SPIM_EXTENDED_ENABLED, \ (.dcx_pin = NRF_SPIM_PIN_NOT_CONNECTED, \ @@ -901,6 +888,13 @@ static int spi_nrfx_deinit(const struct device *dev) ()) \ )) +#define SPIM_GET_MEM_ATTR(idx) \ + COND_CODE_1(SPIM_HAS_PROP(idx, memory_regions), \ + (COND_CODE_1(DT_NODE_HAS_PROP(SPIM_MEM_REGION(idx), zephyr_memory_attr), \ + (DT_PROP(SPIM_MEM_REGION(idx), zephyr_memory_attr)), \ + (0))), \ + (0)) + /* Fast instances depend on the global HSFLL clock controller (as they need * to request the highest frequency from it to operate correctly), so they * must be initialized after that controller driver, hence the default SPI @@ -927,10 +921,10 @@ static int spi_nrfx_deinit(const struct device *dev) IF_ENABLED(SPI_BUFFER_IN_RAM, \ (static uint8_t spim_##idx##_tx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ - DMM_MEMORY_SECTION(SPIM(idx)); \ + SPIM_MEMORY_SECTION(idx); \ static uint8_t spim_##idx##_rx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ - DMM_MEMORY_SECTION(SPIM(idx));)) \ + SPIM_MEMORY_SECTION(idx);)) \ static struct spi_nrfx_data spi_##idx##_data = { \ IF_ENABLED(CONFIG_MULTITHREADING, \ (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ @@ -967,6 +961,8 @@ static int spi_nrfx_deinit(const struct device *dev) .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPIM(idx), wake_gpios, \ WAKE_PIN_NOT_USED), \ .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPIM(idx)), \ + IF_ENABLED(CONFIG_DCACHE, \ + (.mem_attr = SPIM_GET_MEM_ATTR(idx),)) \ IF_ENABLED(USE_CLOCK_REQUESTS, \ (.clk_dev = SPIM_REQUESTS_CLOCK(SPIM(idx)) \ ? DEVICE_DT_GET(DT_CLOCKS_CTLR(SPIM(idx))) \ @@ -979,7 +975,6 @@ static int spi_nrfx_deinit(const struct device *dev) .default_port = \ DT_PROP_OR(DT_PHANDLE(SPIM(idx), \ default_gpio_port), port, -1),)) \ - .mem_reg = DMM_DEV_TO_REG(SPIM(idx)), \ }; \ BUILD_ASSERT(!SPIM_HAS_PROP(idx, wake_gpios) || \ !(DT_GPIO_FLAGS(SPIM(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ @@ -994,6 +989,12 @@ static int spi_nrfx_deinit(const struct device *dev) POST_KERNEL, SPIM_INIT_PRIORITY(idx), \ &spi_nrfx_driver_api) +#define SPIM_MEMORY_SECTION(idx) \ + COND_CODE_1(SPIM_HAS_PROP(idx, memory_regions), \ + (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ + SPIM_MEM_REGION(idx)))))), \ + ()) + #define COND_NRF_SPIM_DEVICE(unused, prefix, i, _) \ IF_ENABLED(CONFIG_HAS_HW_NRF_SPIM##prefix##i, (SPI_NRFX_SPIM_DEFINE(prefix##i);)) From e252313aff4bdc0fe74c9bf72a3eae55a0085696 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 333/881] Revert "[nrf fromtree] net: shell: dns: Print info about DHCP added servers" This reverts commit 340fef3ef4029059bc999aee4212bb7b879beb1d. Signed-off-by: Jukka Rissanen --- subsys/net/lib/shell/dns.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/subsys/net/lib/shell/dns.c b/subsys/net/lib/shell/dns.c index e01b58096c3..6c6285990d8 100644 --- a/subsys/net/lib/shell/dns.c +++ b/subsys/net/lib/shell/dns.c @@ -93,30 +93,22 @@ static void print_dns_info(const struct shell *sh, } if (ctx->servers[i].dns_server.sa_family == AF_INET) { - PR("\t%s:%u%s%s%s%s%s\n", + PR("\t%s:%u%s%s\n", net_sprint_ipv4_addr( &net_sin(&ctx->servers[i].dns_server)-> sin_addr), ntohs(net_sin(&ctx->servers[i].dns_server)->sin_port), printable_iface(iface_name, " via ", ""), - printable_iface(iface_name, iface_name, ""), - ctx->servers[i].source != DNS_SOURCE_UNKNOWN ? " (" : "", - ctx->servers[i].source != DNS_SOURCE_UNKNOWN ? - dns_get_source_str(ctx->servers[i].source) : "", - ctx->servers[i].source != DNS_SOURCE_UNKNOWN ? ")" : ""); + printable_iface(iface_name, iface_name, "")); } else if (ctx->servers[i].dns_server.sa_family == AF_INET6) { - PR("\t[%s]:%u%s%s%s%s%s\n", + PR("\t[%s]:%u%s%s\n", net_sprint_ipv6_addr( &net_sin6(&ctx->servers[i].dns_server)-> sin6_addr), ntohs(net_sin6(&ctx->servers[i].dns_server)->sin6_port), printable_iface(iface_name, " via ", ""), - printable_iface(iface_name, iface_name, ""), - ctx->servers[i].source != DNS_SOURCE_UNKNOWN ? " (" : "", - ctx->servers[i].source != DNS_SOURCE_UNKNOWN ? - dns_get_source_str(ctx->servers[i].source) : "", - ctx->servers[i].source != DNS_SOURCE_UNKNOWN ? ")" : ""); + printable_iface(iface_name, iface_name, "")); } } From c429ec965dead73194c351a8c388e2af3aa2bda8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 334/881] Revert "[nrf fromtree] net: dhcp: Remove only added DNS servers when stopping" This reverts commit 0fff66f43b44a46715b1a9516b98fb8e05747775. Signed-off-by: Jukka Rissanen --- include/zephyr/net/dns_resolve.h | 13 ------------- subsys/net/lib/dhcpv4/dhcpv4.c | 11 ++--------- subsys/net/lib/dhcpv6/dhcpv6.c | 11 ++--------- subsys/net/lib/dns/resolve.c | 20 +------------------- 4 files changed, 5 insertions(+), 50 deletions(-) diff --git a/include/zephyr/net/dns_resolve.h b/include/zephyr/net/dns_resolve.h index 400af6b77e6..e8789e8621d 100644 --- a/include/zephyr/net/dns_resolve.h +++ b/include/zephyr/net/dns_resolve.h @@ -586,19 +586,6 @@ int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, */ int dns_resolve_remove(struct dns_resolve_context *ctx, int if_index); -/** - * @brief Remove servers from the DNS resolving context that were added by - * a specific source. - * - * @param ctx DNS context - * @param if_index Network interface from which the DNS servers are removed. - * @param source Source of the DNS servers, e.g., manual, DHCPv4/6, etc. - * - * @return 0 if ok, <0 if error. - */ -int dns_resolve_remove_source(struct dns_resolve_context *ctx, int if_index, - enum dns_server_source source); - /** * @brief Cancel a pending DNS query. * diff --git a/subsys/net/lib/dhcpv4/dhcpv4.c b/subsys/net/lib/dhcpv4/dhcpv4.c index 2096bf330d9..5dce854aa90 100644 --- a/subsys/net/lib/dhcpv4/dhcpv4.c +++ b/subsys/net/lib/dhcpv4/dhcpv4.c @@ -1677,9 +1677,8 @@ static void dhcpv4_iface_event_handler(struct net_mgmt_event_callback *cb, * comes back up. */ if (IS_ENABLED(CONFIG_NET_DHCPV4_DNS_SERVER_VIA_INTERFACE)) { - dns_resolve_remove_source(dns_resolve_get_default(), - net_if_get_by_iface(iface), - DNS_SOURCE_DHCPV4); + dns_resolve_remove(dns_resolve_get_default(), + net_if_get_by_iface(iface)); } } } else if (mgmt_event == NET_EVENT_IF_UP) { @@ -1945,12 +1944,6 @@ void net_dhcpv4_stop(struct net_if *iface) NET_DBG("state=%s", net_dhcpv4_state_name(iface->config.dhcpv4.state)); - if (IS_ENABLED(CONFIG_NET_DHCPV4_DNS_SERVER_VIA_INTERFACE)) { - dns_resolve_remove_source(dns_resolve_get_default(), - net_if_get_by_iface(iface), - DNS_SOURCE_DHCPV4); - } - sys_slist_find_and_remove(&dhcpv4_ifaces, &iface->config.dhcpv4.node); diff --git a/subsys/net/lib/dhcpv6/dhcpv6.c b/subsys/net/lib/dhcpv6/dhcpv6.c index c1282c2a6f1..d8b1e3d7a6d 100644 --- a/subsys/net/lib/dhcpv6/dhcpv6.c +++ b/subsys/net/lib/dhcpv6/dhcpv6.c @@ -2226,9 +2226,8 @@ static void dhcpv6_iface_event_handler(struct net_mgmt_event_callback *cb, * comes back up. */ if (IS_ENABLED(CONFIG_NET_DHCPV6_DNS_SERVER_VIA_INTERFACE)) { - dns_resolve_remove_source(dns_resolve_get_default(), - net_if_get_by_iface(iface), - DNS_SOURCE_DHCPV6); + dns_resolve_remove(dns_resolve_get_default(), + net_if_get_by_iface(iface)); } } else if (mgmt_event == NET_EVENT_IF_UP) { NET_DBG("Interface %p coming up", iface); @@ -2324,12 +2323,6 @@ void net_dhcpv6_stop(struct net_if *iface) (void)dhcpv6_enter_state(iface, NET_DHCPV6_DISABLED); - if (IS_ENABLED(CONFIG_NET_DHCPV6_DNS_SERVER_VIA_INTERFACE)) { - dns_resolve_remove_source(dns_resolve_get_default(), - net_if_get_by_iface(iface), - DNS_SOURCE_DHCPV6); - } - sys_slist_find_and_remove(&dhcpv6_ifaces, &iface->config.dhcpv6.node); diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index 9025501971e..2b8d6f975fb 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -2163,9 +2163,7 @@ int dns_resolve_reconfigure(struct dns_resolve_context *ctx, source); } -static int dns_resolve_remove_and_check_source(struct dns_resolve_context *ctx, int if_index, - bool check_source, - enum dns_server_source source) +int dns_resolve_remove(struct dns_resolve_context *ctx, int if_index) { int i; int ret = -ENOENT; @@ -2190,10 +2188,6 @@ static int dns_resolve_remove_and_check_source(struct dns_resolve_context *ctx, continue; } - if (check_source && ctx->servers[i].source != source) { - continue; - } - ctx->servers[i].if_index = 0; /* See comment in dns_resolve_close_locked() about @@ -2215,18 +2209,6 @@ static int dns_resolve_remove_and_check_source(struct dns_resolve_context *ctx, return st; } -int dns_resolve_remove(struct dns_resolve_context *ctx, int if_index) -{ - return dns_resolve_remove_and_check_source(ctx, if_index, false, - DNS_SOURCE_UNKNOWN); -} - -int dns_resolve_remove_source(struct dns_resolve_context *ctx, int if_index, - enum dns_server_source source) -{ - return dns_resolve_remove_and_check_source(ctx, if_index, true, source); -} - struct dns_resolve_context *dns_resolve_get_default(void) { return &dns_default_ctx; From 44766879fea11bd7b73ff420549734dccf27ee30 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 335/881] Revert "[nrf fromtree] net: dns: Save info about source when configuring DNS servers" This reverts commit e4b17cd2922ce9e9f3fb1c708faa780c7ac1150b. Signed-off-by: Jukka Rissanen --- drivers/modem/hl7800.c | 3 +- drivers/wifi/esp_at/esp.c | 3 +- include/zephyr/net/dns_resolve.h | 38 +--------------- subsys/net/ip/ipv6_nbr.c | 3 +- subsys/net/l2/ppp/ipcp.c | 3 +- subsys/net/lib/dhcpv4/dhcpv4.c | 6 +-- subsys/net/lib/dhcpv6/dhcpv6.c | 6 +-- subsys/net/lib/dns/resolve.c | 61 +++++--------------------- tests/net/lib/dns_addremove/src/main.c | 3 +- 9 files changed, 23 insertions(+), 103 deletions(-) diff --git a/drivers/modem/hl7800.c b/drivers/modem/hl7800.c index 33064290639..58e4f663838 100644 --- a/drivers/modem/hl7800.c +++ b/drivers/modem/hl7800.c @@ -1966,8 +1966,7 @@ static void dns_work_cb(struct k_work *work) } } else { LOG_DBG("Reconfiguring DNS resolver"); - ret = dns_resolve_reconfigure(dnsCtx, (const char **)dns_servers_str, NULL, - DNS_SOURCE_MANUAL); + ret = dns_resolve_reconfigure(dnsCtx, (const char **)dns_servers_str, NULL); if (ret < 0) { LOG_ERR("dns_resolve_reconfigure fail (%d)", ret); retry = true; diff --git a/drivers/wifi/esp_at/esp.c b/drivers/wifi/esp_at/esp.c index 427d548350b..25c47412c4c 100644 --- a/drivers/wifi/esp_at/esp.c +++ b/drivers/wifi/esp_at/esp.c @@ -506,8 +506,7 @@ static void esp_dns_work(struct k_work *work) dnsctx = dns_resolve_get_default(); err = dns_resolve_reconfigure_with_interfaces(dnsctx, NULL, dns_servers, - interfaces, - DNS_SOURCE_MANUAL); + interfaces); if (err) { LOG_ERR("Could not set DNS servers: %d", err); } diff --git a/include/zephyr/net/dns_resolve.h b/include/zephyr/net/dns_resolve.h index e8789e8621d..62781b51892 100644 --- a/include/zephyr/net/dns_resolve.h +++ b/include/zephyr/net/dns_resolve.h @@ -42,24 +42,6 @@ enum dns_query_type { DNS_QUERY_TYPE_AAAA = 28 }; -/** - * Entity that added the DNS server. - */ -enum dns_server_source { - /** Source is unknown */ - DNS_SOURCE_UNKNOWN = 0, - /** Server information is added manually, for example by an application */ - DNS_SOURCE_MANUAL, - /** Server information is from DHCPv4 server */ - DNS_SOURCE_DHCPV4, - /** Server information is from DHCPv6 server */ - DNS_SOURCE_DHCPV6, - /** Server information is from IPv6 SLAAC (router advertisement) */ - DNS_SOURCE_IPV6_RA, - /** Server information is from PPP */ - DNS_SOURCE_PPP, -}; - /** Max size of the resolved name. */ #ifndef DNS_MAX_NAME_SIZE #define DNS_MAX_NAME_SIZE 20 @@ -363,9 +345,6 @@ struct dns_resolve_context { */ int if_index; - /** Source of the DNS server, e.g., manual, DHCPv4/6, etc. */ - enum dns_server_source source; - /** Is this server mDNS one */ uint8_t is_mdns : 1; @@ -539,14 +518,12 @@ int dns_resolve_close(struct dns_resolve_context *ctx); * @param servers_sa DNS server addresses as struct sockaddr. The array * is NULL terminated. Port numbers are optional in struct sockaddr, the * default will be used if set to 0. - * @param source Source of the DNS servers, e.g., manual, DHCPv4/6, etc. * * @return 0 if ok, <0 if error. */ int dns_resolve_reconfigure(struct dns_resolve_context *ctx, const char *servers_str[], - const struct sockaddr *servers_sa[], - enum dns_server_source source); + const struct sockaddr *servers_sa[]); /** * @brief Reconfigure DNS resolving context with new server list and @@ -566,15 +543,13 @@ int dns_resolve_reconfigure(struct dns_resolve_context *ctx, * @param interfaces Network interfaces to which the DNS servers are bound. * This is an array of network interface indices. The array must be * the same length as the servers_str and servers_sa arrays. - * @param source Source of the DNS servers, e.g., manual, DHCPv4/6, etc. * * @return 0 if ok, <0 if error. */ int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, const char *servers_str[], const struct sockaddr *servers_sa[], - int interfaces[], - enum dns_server_source source); + int interfaces[]); /** * @brief Remove servers from the DNS resolving context. @@ -726,15 +701,6 @@ static inline int dns_cancel_addr_info(uint16_t dns_id) /** @cond INTERNAL_HIDDEN */ -/** - * @brief Get string representation of the DNS server source. - * - * @param source Source of the DNS server. - * - * @return String representation of the DNS server source. - */ -const char *dns_get_source_str(enum dns_server_source source); - /** * @brief Initialize DNS subsystem. */ diff --git a/subsys/net/ip/ipv6_nbr.c b/subsys/net/ip/ipv6_nbr.c index 1cf7e53ad48..19a0405f6ea 100644 --- a/subsys/net/ip/ipv6_nbr.c +++ b/subsys/net/ip/ipv6_nbr.c @@ -2509,8 +2509,7 @@ static inline bool handle_ra_rdnss(struct net_pkt *pkt, uint8_t len) /* TODO: Handle lifetime. */ ctx = dns_resolve_get_default(); ret = dns_resolve_reconfigure_with_interfaces(ctx, NULL, dns_servers, - interfaces, - DNS_SOURCE_IPV6_RA); + interfaces); if (ret < 0) { NET_DBG("Failed to set RDNSS resolve address: %d", ret); } diff --git a/subsys/net/l2/ppp/ipcp.c b/subsys/net/l2/ppp/ipcp.c index 320b78a0c0c..f376a3997a3 100644 --- a/subsys/net/l2/ppp/ipcp.c +++ b/subsys/net/l2/ppp/ipcp.c @@ -376,8 +376,7 @@ static void ipcp_set_dns_servers(struct ppp_fsm *fsm) dnsctx = dns_resolve_get_default(); ret = dns_resolve_reconfigure_with_interfaces(dnsctx, NULL, dns_servers, - interfaces, - DNS_SOURCE_PPP); + interfaces); if (ret < 0) { NET_ERR("Could not set DNS servers"); return; diff --git a/subsys/net/lib/dhcpv4/dhcpv4.c b/subsys/net/lib/dhcpv4/dhcpv4.c index 5dce854aa90..c475b1fb4d2 100644 --- a/subsys/net/lib/dhcpv4/dhcpv4.c +++ b/subsys/net/lib/dhcpv4/dhcpv4.c @@ -1185,11 +1185,9 @@ static bool dhcpv4_parse_options(struct net_pkt *pkt, status = dns_resolve_reconfigure_with_interfaces(ctx, NULL, dns_servers, - interfaces, - DNS_SOURCE_DHCPV4); + interfaces); } else { - status = dns_resolve_reconfigure(ctx, NULL, dns_servers, - DNS_SOURCE_DHCPV4); + status = dns_resolve_reconfigure(ctx, NULL, dns_servers); } if (status < 0) { diff --git a/subsys/net/lib/dhcpv6/dhcpv6.c b/subsys/net/lib/dhcpv6/dhcpv6.c index d8b1e3d7a6d..2e1441b0331 100644 --- a/subsys/net/lib/dhcpv6/dhcpv6.c +++ b/subsys/net/lib/dhcpv6/dhcpv6.c @@ -1426,11 +1426,9 @@ static int dhcpv6_handle_dns_server_option(struct net_pkt *pkt) status = dns_resolve_reconfigure_with_interfaces(ctx, NULL, dns_servers, - interfaces, - DNS_SOURCE_DHCPV6); + interfaces); } else { - status = dns_resolve_reconfigure(ctx, NULL, dns_servers, - DNS_SOURCE_DHCPV6); + status = dns_resolve_reconfigure(ctx, NULL, dns_servers); } if (status < 0) { diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index 2b8d6f975fb..234d48ba843 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -488,34 +488,13 @@ static int get_free_slot(struct dns_resolve_context *ctx) return -ENOENT; } -const char *dns_get_source_str(enum dns_server_source source) -{ - switch (source) { - case DNS_SOURCE_UNKNOWN: - return "unknown"; - case DNS_SOURCE_MANUAL: - return "manual"; - case DNS_SOURCE_DHCPV4: - __fallthrough; - case DNS_SOURCE_DHCPV6: - return "DHCP"; - case DNS_SOURCE_IPV6_RA: - return "IPv6 RA"; - case DNS_SOURCE_PPP: - return "PPP"; - } - - return ""; -} - /* Must be invoked with context lock held */ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, const char *servers[], const struct sockaddr *servers_sa[], const struct net_socket_service_desc *svc, uint16_t port, int interfaces[], - bool do_cleanup, - enum dns_server_source source) + bool do_cleanup) { #if defined(CONFIG_NET_IPV6) struct sockaddr_in6 local_addr6 = { @@ -629,8 +608,6 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, } } - ctx->servers[idx].source = source; - addr = &ctx->servers[idx].dns_server; (void)memset(addr, 0, sizeof(*addr)); @@ -647,16 +624,13 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, dns_postprocess_server(ctx, idx); - NET_DBG("[%d] %.*s%s%s%s%s%s%s%s", i, (int)server_len, servers[i], + NET_DBG("[%d] %.*s%s%s%s%s", i, (int)server_len, servers[i], IS_ENABLED(CONFIG_MDNS_RESOLVER) ? (ctx->servers[i].is_mdns ? " mDNS" : "") : "", IS_ENABLED(CONFIG_LLMNR_RESOLVER) ? (ctx->servers[i].is_llmnr ? " LLMNR" : "") : "", iface_str != NULL ? " via " : "", - iface_str != NULL ? iface_str : "", - source != DNS_SOURCE_UNKNOWN ? " (" : "", - source != DNS_SOURCE_UNKNOWN ? dns_get_source_str(source) : "", - source != DNS_SOURCE_UNKNOWN ? ")" : ""); + iface_str != NULL ? iface_str : ""); idx++; } @@ -682,8 +656,6 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, break; } - ctx->servers[idx].source = source; - memcpy(&ctx->servers[idx].dns_server, servers_sa[i], sizeof(ctx->servers[idx].dns_server)); @@ -696,7 +668,7 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, dns_postprocess_server(ctx, idx); - NET_DBG("[%d] %s%s%s%s%s%s%s%s", i, + NET_DBG("[%d] %s%s%s%s%s", i, net_sprint_addr(servers_sa[i]->sa_family, &net_sin(servers_sa[i])->sin_addr), IS_ENABLED(CONFIG_MDNS_RESOLVER) ? @@ -704,10 +676,7 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, IS_ENABLED(CONFIG_LLMNR_RESOLVER) ? (ctx->servers[i].is_llmnr ? " LLMNR" : "") : "", interfaces != NULL ? " via " : "", - interfaces != NULL ? iface_str : "", - source != DNS_SOURCE_UNKNOWN ? " (" : "", - source != DNS_SOURCE_UNKNOWN ? dns_get_source_str(source) : "", - source != DNS_SOURCE_UNKNOWN ? ")" : ""); + interfaces != NULL ? iface_str : ""); idx++; } @@ -902,7 +871,7 @@ int dns_resolve_init_with_svc(struct dns_resolve_context *ctx, const char *serve } ret = dns_resolve_init_locked(ctx, servers, servers_sa, svc, port, - interfaces, true, DNS_SOURCE_UNKNOWN); + interfaces, true); k_mutex_unlock(&lock); @@ -2086,8 +2055,7 @@ static int do_dns_resolve_reconfigure(struct dns_resolve_context *ctx, const char *servers[], const struct sockaddr *servers_sa[], int interfaces[], - bool do_close, - enum dns_server_source source) + bool do_close) { int err; @@ -2124,8 +2092,7 @@ static int do_dns_resolve_reconfigure(struct dns_resolve_context *ctx, err = dns_resolve_init_locked(ctx, servers, servers_sa, &resolve_svc, 0, interfaces, - do_close, - source); + do_close); unlock: k_mutex_unlock(&ctx->lock); @@ -2137,30 +2104,26 @@ static int do_dns_resolve_reconfigure(struct dns_resolve_context *ctx, int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, const char *servers[], const struct sockaddr *servers_sa[], - int interfaces[], - enum dns_server_source source) + int interfaces[]) { return do_dns_resolve_reconfigure(ctx, servers, servers_sa, interfaces, IS_ENABLED(CONFIG_DNS_RECONFIGURE_CLEANUP) ? - true : false, - source); + true : false); } int dns_resolve_reconfigure(struct dns_resolve_context *ctx, const char *servers[], - const struct sockaddr *servers_sa[], - enum dns_server_source source) + const struct sockaddr *servers_sa[]) { return do_dns_resolve_reconfigure(ctx, servers, servers_sa, NULL, IS_ENABLED(CONFIG_DNS_RECONFIGURE_CLEANUP) ? - true : false, - source); + true : false); } int dns_resolve_remove(struct dns_resolve_context *ctx, int if_index) diff --git a/tests/net/lib/dns_addremove/src/main.c b/tests/net/lib/dns_addremove/src/main.c index 1b6f55efd73..3ff9bb2aabe 100644 --- a/tests/net/lib/dns_addremove/src/main.c +++ b/tests/net/lib/dns_addremove/src/main.c @@ -466,8 +466,7 @@ ZTEST(dns_addremove, test_dns_reconfigure_callback) "Timeout while waiting for DNS added callback"); } - ret = dns_resolve_reconfigure(&resv_ipv4, dns2_servers_str, NULL, - DNS_SOURCE_MANUAL); + ret = dns_resolve_reconfigure(&resv_ipv4, dns2_servers_str, NULL); zassert_equal(ret, 0, "Cannot reconfigure DNS server"); /* Wait for DNS removed callback after reconfiguring DNS */ From a3acf915bf97c7842a914ae43a161055f831119f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 336/881] Revert "[nrf fromtree] net: ppp: Bind DNS to device ppp network interface" This reverts commit 1da2e9f7b65d9e013745bd2b17b22a5234396df0. Signed-off-by: Jukka Rissanen --- subsys/net/l2/ppp/ipcp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/subsys/net/l2/ppp/ipcp.c b/subsys/net/l2/ppp/ipcp.c index f376a3997a3..1cea54de2f3 100644 --- a/subsys/net/l2/ppp/ipcp.c +++ b/subsys/net/l2/ppp/ipcp.c @@ -362,8 +362,6 @@ static void ipcp_set_dns_servers(struct ppp_fsm *fsm) (struct sockaddr *) &dns2, NULL }; - int ifindex = net_if_get_by_iface(ctx->iface); - int interfaces[2] = { ifindex, ifindex }; int ret; if (!dns1.sin_addr.s_addr) { @@ -375,8 +373,7 @@ static void ipcp_set_dns_servers(struct ppp_fsm *fsm) } dnsctx = dns_resolve_get_default(); - ret = dns_resolve_reconfigure_with_interfaces(dnsctx, NULL, dns_servers, - interfaces); + ret = dns_resolve_reconfigure(dnsctx, NULL, dns_servers); if (ret < 0) { NET_ERR("Could not set DNS servers"); return; From e03e14e0ed8a41d4133fabbceb90d647eb9fad3d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:14 +0300 Subject: [PATCH 337/881] Revert "[nrf fromtree] drivers: wifi: esp_at: Bind DNS to device net interface" This reverts commit 939bc466cf7bf16a5339dab7f4ae19b3992a41a4. Signed-off-by: Jukka Rissanen --- drivers/wifi/esp_at/esp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/wifi/esp_at/esp.c b/drivers/wifi/esp_at/esp.c index 25c47412c4c..c68ea98ee0f 100644 --- a/drivers/wifi/esp_at/esp.c +++ b/drivers/wifi/esp_at/esp.c @@ -490,23 +490,18 @@ static void esp_dns_work(struct k_work *work) struct dns_resolve_context *dnsctx; struct sockaddr_in *addrs = data->dns_addresses; const struct sockaddr *dns_servers[ESP_MAX_DNS + 1] = {}; - int interfaces[ESP_MAX_DNS]; size_t i; - int err, ifindex; - - ifindex = net_if_get_by_ifindex(data->net_iface); + int err; for (i = 0; i < ESP_MAX_DNS; i++) { if (!addrs[i].sin_addr.s_addr) { break; } dns_servers[i] = (struct sockaddr *) &addrs[i]; - interfaces[i] = ifindex; } dnsctx = dns_resolve_get_default(); - err = dns_resolve_reconfigure_with_interfaces(dnsctx, NULL, dns_servers, - interfaces); + err = dns_resolve_reconfigure(dnsctx, NULL, dns_servers); if (err) { LOG_ERR("Could not set DNS servers: %d", err); } From 39dfd79d292d9c9ed27fe3ed4f4a91eb37d060a5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 338/881] Revert "[nrf fromtree] net: shell: conn: Print packet socket information correctly" This reverts commit a7bc8d7f849701b991df0252373873bb85af6bfe. Signed-off-by: Jukka Rissanen --- subsys/net/lib/shell/conn.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/net/lib/shell/conn.c b/subsys/net/lib/shell/conn.c index ca852f1d15d..32dc32fcf44 100644 --- a/subsys/net/lib/shell/conn.c +++ b/subsys/net/lib/shell/conn.c @@ -89,8 +89,6 @@ static void conn_handler_cb(struct net_conn *conn, void *user_data) } else if (conn->local_addr.sa_family == AF_UNSPEC) { snprintk(addr_local, sizeof(addr_local), "AF_UNSPEC"); - } else if (conn->local_addr.sa_family == AF_PACKET) { - snprintk(addr_local, sizeof(addr_local), "AF_PACKET"); } else { snprintk(addr_local, sizeof(addr_local), "AF_UNK(%d)", conn->local_addr.sa_family); From 5f3900ae46e6174c589189a2569c02a5c4262cc3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 339/881] Revert "[nrf fromtree] net: dns: Add uninitialized state to resolver context" This reverts commit cfc8a779844ac270c8c99be6c288f2dd2a3174a5. Signed-off-by: Jukka Rissanen --- include/zephyr/net/dns_resolve.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/zephyr/net/dns_resolve.h b/include/zephyr/net/dns_resolve.h index 62781b51892..05ee7154d1c 100644 --- a/include/zephyr/net/dns_resolve.h +++ b/include/zephyr/net/dns_resolve.h @@ -320,7 +320,6 @@ typedef void (*dns_resolve_cb_t)(enum dns_resolve_status status, /** @cond INTERNAL_HIDDEN */ enum dns_resolve_context_state { - DNS_RESOLVE_CONTEXT_UNINITIALIZED = 0, DNS_RESOLVE_CONTEXT_ACTIVE, DNS_RESOLVE_CONTEXT_DEACTIVATING, DNS_RESOLVE_CONTEXT_INACTIVE, From c5905a949f24cd26d02646154b9b70da506388da Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 340/881] Revert "[nrf fromtree] net: dns: Properly cleanup DNS servers per network interface" This reverts commit 4ca5fae37bd240dd1175e8e57b5cef86cdd0c0a7. Signed-off-by: Jukka Rissanen --- include/zephyr/net/dns_resolve.h | 10 - subsys/net/ip/Kconfig.stack | 1 - subsys/net/ip/ipv6_nbr.c | 6 +- subsys/net/lib/dhcpv4/dhcpv4.c | 10 - subsys/net/lib/dhcpv6/dhcpv6.c | 10 - subsys/net/lib/dns/Kconfig | 13 - subsys/net/lib/dns/resolve.c | 479 +++++---------------- tests/net/lib/dns_addremove/src/main.c | 20 +- tests/net/lib/dns_addremove/testcase.yaml | 3 - tests/net/lib/dns_dispatcher/src/main.c | 7 +- tests/net/lib/dns_dispatcher/testcase.yaml | 6 - 11 files changed, 130 insertions(+), 435 deletions(-) diff --git a/include/zephyr/net/dns_resolve.h b/include/zephyr/net/dns_resolve.h index 05ee7154d1c..49043bd1733 100644 --- a/include/zephyr/net/dns_resolve.h +++ b/include/zephyr/net/dns_resolve.h @@ -550,16 +550,6 @@ int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, const struct sockaddr *servers_sa[], int interfaces[]); -/** - * @brief Remove servers from the DNS resolving context. - * - * @param ctx DNS context - * @param if_index Network interface from which the DNS servers are removed. - * - * @return 0 if ok, <0 if error. - */ -int dns_resolve_remove(struct dns_resolve_context *ctx, int if_index); - /** * @brief Cancel a pending DNS query. * diff --git a/subsys/net/ip/Kconfig.stack b/subsys/net/ip/Kconfig.stack index ed8853d1394..c02fe47bafc 100644 --- a/subsys/net/ip/Kconfig.stack +++ b/subsys/net/ip/Kconfig.stack @@ -17,7 +17,6 @@ config NET_TX_STACK_SIZE config NET_RX_STACK_SIZE int "RX thread stack size" - default 1792 if DNS_RESOLVER default 1500 help Set the RX thread stack size in bytes. The RX thread is waiting diff --git a/subsys/net/ip/ipv6_nbr.c b/subsys/net/ip/ipv6_nbr.c index 19a0405f6ea..b64a73ed537 100644 --- a/subsys/net/ip/ipv6_nbr.c +++ b/subsys/net/ip/ipv6_nbr.c @@ -2469,9 +2469,6 @@ static inline bool handle_ra_rdnss(struct net_pkt *pkt, uint8_t len) const struct sockaddr *dns_servers[] = { (struct sockaddr *)&dns, NULL }; - int interfaces[] = { - net_if_get_by_iface(net_pkt_iface(pkt)) - }; size_t rdnss_size; int ret; @@ -2508,8 +2505,7 @@ static inline bool handle_ra_rdnss(struct net_pkt *pkt, uint8_t len) /* TODO: Handle lifetime. */ ctx = dns_resolve_get_default(); - ret = dns_resolve_reconfigure_with_interfaces(ctx, NULL, dns_servers, - interfaces); + ret = dns_resolve_reconfigure(ctx, NULL, dns_servers); if (ret < 0) { NET_DBG("Failed to set RDNSS resolve address: %d", ret); } diff --git a/subsys/net/lib/dhcpv4/dhcpv4.c b/subsys/net/lib/dhcpv4/dhcpv4.c index c475b1fb4d2..6dedcab3cd9 100644 --- a/subsys/net/lib/dhcpv4/dhcpv4.c +++ b/subsys/net/lib/dhcpv4/dhcpv4.c @@ -1668,16 +1668,6 @@ static void dhcpv4_iface_event_handler(struct net_mgmt_event_callback *cb, if (!net_if_ipv4_addr_rm(iface, &iface->config.dhcpv4.requested_ip)) { NET_DBG("Failed to remove addr from iface"); } - - /* Remove DNS servers as interface is gone. We only need to - * do this for this interface. If using global setting, the - * DNS servers are removed automatically when the interface - * comes back up. - */ - if (IS_ENABLED(CONFIG_NET_DHCPV4_DNS_SERVER_VIA_INTERFACE)) { - dns_resolve_remove(dns_resolve_get_default(), - net_if_get_by_iface(iface)); - } } } else if (mgmt_event == NET_EVENT_IF_UP) { NET_DBG("Interface %p coming up", iface); diff --git a/subsys/net/lib/dhcpv6/dhcpv6.c b/subsys/net/lib/dhcpv6/dhcpv6.c index 2e1441b0331..f5984273cc3 100644 --- a/subsys/net/lib/dhcpv6/dhcpv6.c +++ b/subsys/net/lib/dhcpv6/dhcpv6.c @@ -2217,16 +2217,6 @@ static void dhcpv6_iface_event_handler(struct net_mgmt_event_callback *cb, if (mgmt_event == NET_EVENT_IF_DOWN) { NET_DBG("Interface %p going down", iface); dhcpv6_set_timeout(iface, UINT64_MAX); - - /* Remove DNS servers as interface is gone. We only need to - * do this for this interface. If using global setting, the - * DNS servers are removed automatically when the interface - * comes back up. - */ - if (IS_ENABLED(CONFIG_NET_DHCPV6_DNS_SERVER_VIA_INTERFACE)) { - dns_resolve_remove(dns_resolve_get_default(), - net_if_get_by_iface(iface)); - } } else if (mgmt_event == NET_EVENT_IF_UP) { NET_DBG("Interface %p coming up", iface); dhcpv6_enter_state(iface, NET_DHCPV6_INIT); diff --git a/subsys/net/lib/dns/Kconfig b/subsys/net/lib/dns/Kconfig index a413f04f656..c3f3ba6bc99 100644 --- a/subsys/net/lib/dns/Kconfig +++ b/subsys/net/lib/dns/Kconfig @@ -121,19 +121,6 @@ config DNS_SERVER5 endif # DNS_SERVER_IP_ADDRESSES -config DNS_RECONFIGURE_CLEANUP - bool "Cleanup old DNS server entries when reconfiguring" - help - If calling dns_resolve_reconfigure() when new DNS servers - are being set, for example if receiving new ones from DHCP server, - remove the old entries before setting up the new ones. - If you have only one network interface, then this can be enabled. - If you have multiple network interfaces, then this should be disabled - because the later configuration update would remove the entries - set by the other network interface configuration. - The previous default in Zephyr 4.1 or earlier was to have this enabled. - The current default in Zephyr 4.2 is to disable this option. - config DNS_NUM_CONCUR_QUERIES int "Number of simultaneous DNS queries per one DNS context" default 1 diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index 234d48ba843..447d0a78322 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -81,7 +81,6 @@ NET_BUF_POOL_DEFINE(dns_qname_pool, DNS_RESOLVER_BUF_CTR, DNS_CACHE_DEFINE(dns_cache, CONFIG_DNS_RESOLVER_CACHE_MAX_ENTRIES); #endif /* CONFIG_DNS_RESOLVER_CACHE */ -static K_MUTEX_DEFINE(lock); static int init_called; static struct dns_resolve_context dns_default_ctx; @@ -415,86 +414,12 @@ static int bind_to_iface(int sock, const struct sockaddr *addr, int if_index) return ret; } -static bool is_server_name_found(struct dns_resolve_context *ctx, - const char *server, size_t server_len, - const char *iface_str) -{ - ARRAY_FOR_EACH(ctx->servers, i) { - if (ctx->servers[i].dns_server.sa_family == AF_INET || - ctx->servers[i].dns_server.sa_family == AF_INET6) { - char addr_str[INET6_ADDRSTRLEN]; - size_t addr_len; - - if (net_addr_ntop(ctx->servers[i].dns_server.sa_family, - &net_sin(&ctx->servers[i].dns_server)->sin_addr, - addr_str, sizeof(addr_str)) < 0) { - continue; - } - - addr_len = strlen(addr_str); - if (addr_len != server_len || - strncmp(addr_str, server, server_len) != 0) { - continue; - } - - if (iface_str != NULL && ctx->servers[i].if_index > 0) { - char iface_name[IFNAMSIZ]; - - net_if_get_name(net_if_get_by_index( - ctx->servers[i].if_index), - iface_name, sizeof(iface_name)); - - if (strcmp(iface_name, iface_str) != 0) { - continue; - } - } - - return true; - } - } - - return false; -} - -static bool is_server_addr_found(struct dns_resolve_context *ctx, - const struct sockaddr *addr, - int if_index) -{ - ARRAY_FOR_EACH(ctx->servers, i) { - if (ctx->servers[i].dns_server.sa_family == addr->sa_family && - memcmp(&ctx->servers[i].dns_server, addr, - sizeof(ctx->servers[i].dns_server)) == 0) { - if (if_index == 0 || - (if_index > 0 && - ctx->servers[i].if_index != if_index)) { - continue; - } - - return true; - } - } - - return false; -} - -static int get_free_slot(struct dns_resolve_context *ctx) -{ - ARRAY_FOR_EACH(ctx->servers, i) { - if (ctx->servers[i].dns_server.sa_family == 0) { - return i; - } - } - - return -ENOENT; -} - /* Must be invoked with context lock held */ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, const char *servers[], const struct sockaddr *servers_sa[], const struct net_socket_service_desc *svc, - uint16_t port, int interfaces[], - bool do_cleanup) + uint16_t port, int interfaces[]) { #if defined(CONFIG_NET_IPV6) struct sockaddr_in6 local_addr6 = { @@ -520,20 +445,17 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, return -ENOENT; } - if (do_cleanup) { - if (ctx->state != DNS_RESOLVE_CONTEXT_INACTIVE) { - ret = -ENOTEMPTY; - NET_DBG("DNS resolver context is not inactive (%d)", ctx->state); - goto fail; - } + if (ctx->state != DNS_RESOLVE_CONTEXT_INACTIVE) { + ret = -ENOTEMPTY; + goto fail; + } - ARRAY_FOR_EACH(ctx->servers, j) { - ctx->servers[j].sock = -1; - } + ARRAY_FOR_EACH(ctx->servers, j) { + ctx->servers[j].sock = -1; + } - ARRAY_FOR_EACH(ctx->fds, j) { - ctx->fds[j].fd = -1; - } + ARRAY_FOR_EACH(ctx->fds, j) { + ctx->fds[j].fd = -1; } /* If user has provided a list of servers in string format, then @@ -542,146 +464,78 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, * The interfaces parameter should point to an array that is the * the same length as the servers_sa parameter array. */ - for (i = 0; servers != NULL && idx < SERVER_COUNT && servers[i] != NULL; i++) { - const char *iface_str; - size_t server_len; - struct sockaddr *addr; - bool found; - - iface_str = strstr(servers[i], "%"); - if (iface_str != NULL) { - server_len = iface_str - servers[i]; - iface_str++; - - if (server_len == 0) { - NET_DBG("Empty server name"); - continue; - } - - found = is_server_name_found(ctx, servers[i], - server_len, iface_str); - if (found) { - NET_DBG("Server %.*s already exists", - (int)server_len, servers[i]); - continue; - } + if (servers) { + for (i = 0; idx < SERVER_COUNT && servers[i]; i++) { + const char *iface_str; + size_t server_len; - /* Figure out if there are free slots where to add - * the server. - */ - idx = get_free_slot(ctx); - if (idx < 0) { - NET_DBG("No free slots for server %.*s", - (int)server_len, servers[i]); - break; - } + struct sockaddr *addr = &ctx->servers[idx].dns_server; - /* Skip empty interface name */ - if (iface_str[0] == '\0') { - ctx->servers[idx].if_index = 0; - iface_str = NULL; - } else { - ctx->servers[idx].if_index = - net_if_get_by_name(iface_str); - } + iface_str = strstr(servers[i], "%"); + if (iface_str) { + server_len = iface_str - servers[i]; + iface_str++; - } else { - server_len = strlen(servers[i]); - if (server_len == 0) { - NET_DBG("Empty server name"); - continue; - } + if (server_len == 0) { + NET_DBG("Empty server name"); + continue; + } - found = is_server_name_found(ctx, servers[i], - server_len, NULL); - if (found) { - NET_DBG("Server %.*s already exists", - (int)server_len, servers[i]); - continue; - } + /* Skip empty interface name */ + if (iface_str[0] == '\0') { + ctx->servers[idx].if_index = 0; + iface_str = NULL; + } else { + ctx->servers[idx].if_index = + net_if_get_by_name(iface_str); + } - idx = get_free_slot(ctx); - if (idx < 0) { - NET_DBG("No free slots for server %.*s", - (int)server_len, servers[i]); - break; + } else { + server_len = strlen(servers[i]); + ctx->servers[idx].if_index = 0; } - } - addr = &ctx->servers[idx].dns_server; + (void)memset(addr, 0, sizeof(*addr)); - (void)memset(addr, 0, sizeof(*addr)); + ret = net_ipaddr_parse(servers[i], server_len, addr); + if (!ret) { + if (servers[i] != NULL && servers[i][0] != '\0') { + NET_DBG("Invalid server address %.*s", + (int)server_len, servers[i]); + } - ret = net_ipaddr_parse(servers[i], server_len, addr); - if (!ret) { - if (servers[i][0] != '\0') { - NET_DBG("Invalid server address %.*s", - (int)server_len, servers[i]); + continue; } - continue; - } - - dns_postprocess_server(ctx, idx); - - NET_DBG("[%d] %.*s%s%s%s%s", i, (int)server_len, servers[i], - IS_ENABLED(CONFIG_MDNS_RESOLVER) ? - (ctx->servers[i].is_mdns ? " mDNS" : "") : "", - IS_ENABLED(CONFIG_LLMNR_RESOLVER) ? - (ctx->servers[i].is_llmnr ? " LLMNR" : "") : "", - iface_str != NULL ? " via " : "", - iface_str != NULL ? iface_str : ""); - idx++; - } - - for (i = 0; servers_sa != NULL && idx < SERVER_COUNT && servers_sa[i] != NULL; i++) { - char iface_str[IFNAMSIZ] = { 0 }; - bool found; - - found = is_server_addr_found(ctx, servers_sa[i], interfaces[i]); - if (found) { - NET_DBG("Server %s already exists", - net_sprint_addr(ctx->servers[i].dns_server.sa_family, - &net_sin(&ctx->servers[i].dns_server)->sin_addr)); - continue; - } + dns_postprocess_server(ctx, idx); - /* Figure out if there are free slots where to add the server. - */ - idx = get_free_slot(ctx); - if (idx < 0) { - NET_DBG("No free slots for server %s", - net_sprint_addr(ctx->servers[i].dns_server.sa_family, - &net_sin(&ctx->servers[i].dns_server)->sin_addr)); - break; + NET_DBG("[%d] %.*s%s%s%s%s", i, (int)server_len, servers[i], + IS_ENABLED(CONFIG_MDNS_RESOLVER) ? + (ctx->servers[i].is_mdns ? " mDNS" : "") : "", + IS_ENABLED(CONFIG_LLMNR_RESOLVER) ? + (ctx->servers[i].is_llmnr ? " LLMNR" : "") : "", + iface_str != NULL ? " via " : "", + iface_str != NULL ? iface_str : ""); + idx++; } + } - memcpy(&ctx->servers[idx].dns_server, servers_sa[i], - sizeof(ctx->servers[idx].dns_server)); + if (servers_sa) { + for (i = 0; idx < SERVER_COUNT && servers_sa[i]; i++) { + memcpy(&ctx->servers[idx].dns_server, servers_sa[i], + sizeof(ctx->servers[idx].dns_server)); - if (interfaces != NULL) { - ctx->servers[idx].if_index = interfaces[i]; + if (interfaces != NULL) { + ctx->servers[idx].if_index = interfaces[idx]; + } - net_if_get_name(net_if_get_by_index(ctx->servers[idx].if_index), - iface_str, sizeof(iface_str)); + dns_postprocess_server(ctx, idx); + idx++; } - - dns_postprocess_server(ctx, idx); - - NET_DBG("[%d] %s%s%s%s%s", i, - net_sprint_addr(servers_sa[i]->sa_family, - &net_sin(servers_sa[i])->sin_addr), - IS_ENABLED(CONFIG_MDNS_RESOLVER) ? - (ctx->servers[i].is_mdns ? " mDNS" : "") : "", - IS_ENABLED(CONFIG_LLMNR_RESOLVER) ? - (ctx->servers[i].is_llmnr ? " LLMNR" : "") : "", - interfaces != NULL ? " via " : "", - interfaces != NULL ? iface_str : ""); - idx++; } for (i = 0, count = 0; - i < SERVER_COUNT && ctx->servers[i].dns_server.sa_family != 0; i++) { + i < SERVER_COUNT && ctx->servers[i].dns_server.sa_family; i++) { if (ctx->servers[i].dns_server.sa_family == AF_INET6) { #if defined(CONFIG_NET_IPV6) @@ -717,16 +571,6 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, goto fail; } - if (ctx->servers[i].sock >= 0) { - /* Socket already exists, so skip it */ - NET_DBG("Socket %d already exists for %s", - ctx->servers[i].sock, - net_sprint_addr(ctx->servers[i].dns_server.sa_family, - &net_sin(&ctx->servers[i].dns_server)->sin_addr)); - count++; - continue; - } - ret = zsock_socket(ctx->servers[i].dns_server.sa_family, SOCK_DGRAM, IPPROTO_UDP); if (ret < 0) { @@ -745,7 +589,6 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, if (ret < 0) { zsock_close(ctx->servers[i].sock); ctx->servers[i].sock = -1; - ctx->servers[i].dns_server.sa_family = 0; continue; } @@ -794,8 +637,6 @@ static int dns_resolve_init_locked(struct dns_resolve_context *ctx, if (ret < 0) { NET_DBG("Cannot set %s to socket (%d)", "polling", ret); zsock_close(ctx->servers[i].sock); - ctx->servers[i].sock = -1; - ctx->servers[i].dns_server.sa_family = 0; continue; } @@ -854,28 +695,20 @@ int dns_resolve_init_with_svc(struct dns_resolve_context *ctx, const char *serve const struct net_socket_service_desc *svc, uint16_t port, int interfaces[]) { - int ret; - if (!ctx) { return -ENOENT; } - k_mutex_lock(&lock, K_FOREVER); - - /* Do cleanup only if we are starting the context for the first time */ - if (init_called == 0) { - (void)memset(ctx, 0, sizeof(*ctx)); - - (void)k_mutex_init(&ctx->lock); - ctx->state = DNS_RESOLVE_CONTEXT_INACTIVE; - } - - ret = dns_resolve_init_locked(ctx, servers, servers_sa, svc, port, - interfaces, true); + (void)memset(ctx, 0, sizeof(*ctx)); - k_mutex_unlock(&lock); + (void)k_mutex_init(&ctx->lock); + ctx->state = DNS_RESOLVE_CONTEXT_INACTIVE; - return ret; + /* As this function is called only once during system init, there is no + * reason to acquire lock. + */ + return dns_resolve_init_locked(ctx, servers, servers_sa, svc, port, + interfaces); } int dns_resolve_init(struct dns_resolve_context *ctx, const char *servers[], @@ -1906,51 +1739,10 @@ int dns_resolve_name(struct dns_resolve_context *ctx, user_data, timeout, true); } -static int dns_server_close(struct dns_resolve_context *ctx, - int server_idx) -{ - struct net_if *iface; - - if (ctx->servers[server_idx].sock < 0) { - return -ENOENT; - } - - (void)dns_dispatcher_unregister(&ctx->servers[server_idx].dispatcher); - - if (ctx->servers[server_idx].dns_server.sa_family == AF_INET6) { - iface = net_if_ipv6_select_src_iface( - &net_sin6(&ctx->servers[server_idx].dns_server)->sin6_addr); - } else { - iface = net_if_ipv4_select_src_iface( - &net_sin(&ctx->servers[server_idx].dns_server)->sin_addr); - } - - if (IS_ENABLED(CONFIG_NET_MGMT_EVENT_INFO)) { - net_mgmt_event_notify_with_info( - NET_EVENT_DNS_SERVER_DEL, - iface, - (void *)&ctx->servers[server_idx].dns_server, - sizeof(struct sockaddr)); - } else { - net_mgmt_event_notify(NET_EVENT_DNS_SERVER_DEL, iface); - } - - zsock_close(ctx->servers[server_idx].sock); - - ctx->servers[server_idx].sock = -1; - ctx->servers[server_idx].dns_server.sa_family = 0; - - ARRAY_FOR_EACH(ctx->fds, j) { - ctx->fds[j].fd = -1; - } - - return 0; -} - /* Must be invoked with context lock held */ static int dns_resolve_close_locked(struct dns_resolve_context *ctx) { - int i, ret; + int i; if (ctx->state != DNS_RESOLVE_CONTEXT_ACTIVE) { return -ENOENT; @@ -1970,10 +1762,44 @@ static int dns_resolve_close_locked(struct dns_resolve_context *ctx) k_mutex_unlock(&ctx->lock); for (i = 0; i < SERVER_COUNT; i++) { - ret = dns_server_close(ctx, i); - if (ret < 0) { - NET_DBG("Cannot close DNS server %d (%d)", i, ret); + struct net_if *iface; + + if (ctx->servers[i].sock < 0) { + continue; + } + + (void)dns_dispatcher_unregister(&ctx->servers[i].dispatcher); + + if (ctx->servers[i].dns_server.sa_family == AF_INET6) { + iface = net_if_ipv6_select_src_iface( + &net_sin6(&ctx->servers[i].dns_server)->sin6_addr); + } else { + iface = net_if_ipv4_select_src_iface( + &net_sin(&ctx->servers[i].dns_server)->sin_addr); + } + + if (IS_ENABLED(CONFIG_NET_MGMT_EVENT_INFO)) { + net_mgmt_event_notify_with_info( + NET_EVENT_DNS_SERVER_DEL, + iface, + (void *)&ctx->servers[i].dns_server, + sizeof(struct sockaddr)); + } else { + net_mgmt_event_notify(NET_EVENT_DNS_SERVER_DEL, + iface); } + + zsock_close(ctx->servers[i].sock); + + ARRAY_FOR_EACH(ctx->fds, j) { + if (ctx->fds[j].fd == ctx->servers[i].sock) { + ctx->fds[j].fd = -1; + } + } + + (void)dns_dispatcher_unregister(&ctx->servers[i].dispatcher); + + ctx->servers[i].sock = -1; } if (--init_called <= 0) { @@ -2051,11 +1877,10 @@ static bool dns_servers_exists(struct dns_resolve_context *ctx, return true; } -static int do_dns_resolve_reconfigure(struct dns_resolve_context *ctx, - const char *servers[], - const struct sockaddr *servers_sa[], - int interfaces[], - bool do_close) +int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, + const char *servers[], + const struct sockaddr *servers_sa[], + int interfaces[]) { int err; @@ -2063,7 +1888,6 @@ static int do_dns_resolve_reconfigure(struct dns_resolve_context *ctx, return -ENOENT; } - k_mutex_lock(&lock, K_FOREVER); k_mutex_lock(&ctx->lock, K_FOREVER); if (dns_servers_exists(ctx, servers, servers_sa)) { @@ -2077,99 +1901,32 @@ static int do_dns_resolve_reconfigure(struct dns_resolve_context *ctx, goto unlock; } - if (ctx->state == DNS_RESOLVE_CONTEXT_ACTIVE && - (do_close || init_called == 0)) { + if (ctx->state == DNS_RESOLVE_CONTEXT_ACTIVE) { dns_resolve_cancel_all(ctx); err = dns_resolve_close_locked(ctx); if (err) { goto unlock; } - - /* Make sure we do fresh start once */ - do_close = true; } err = dns_resolve_init_locked(ctx, servers, servers_sa, - &resolve_svc, 0, interfaces, - do_close); + &resolve_svc, 0, interfaces); unlock: k_mutex_unlock(&ctx->lock); - k_mutex_unlock(&lock); return err; } -int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, - const char *servers[], - const struct sockaddr *servers_sa[], - int interfaces[]) -{ - return do_dns_resolve_reconfigure(ctx, - servers, - servers_sa, - interfaces, - IS_ENABLED(CONFIG_DNS_RECONFIGURE_CLEANUP) ? - true : false); -} - int dns_resolve_reconfigure(struct dns_resolve_context *ctx, const char *servers[], const struct sockaddr *servers_sa[]) { - return do_dns_resolve_reconfigure(ctx, - servers, - servers_sa, - NULL, - IS_ENABLED(CONFIG_DNS_RECONFIGURE_CLEANUP) ? - true : false); -} - -int dns_resolve_remove(struct dns_resolve_context *ctx, int if_index) -{ - int i; - int ret = -ENOENT; - int st = 0; - - if (!ctx) { - return -ENOENT; - } - - if (if_index <= 0) { - /* If network interface index is 0, then do nothing. - * If your want to remove all the servers, then just call - * dns_resolve_close() directly. - */ - return -EINVAL; - } - - k_mutex_lock(&ctx->lock, K_FOREVER); - - for (i = 0; i < SERVER_COUNT; i++) { - if (ctx->servers[i].if_index != if_index) { - continue; - } - - ctx->servers[i].if_index = 0; - - /* See comment in dns_resolve_close_locked() about - * releasing the lock before closing the server socket. - */ - k_mutex_unlock(&ctx->lock); - - ret = dns_server_close(ctx, i); - - k_mutex_lock(&ctx->lock, K_FOREVER); - - if (ret < 0) { - st = ret; - } - } - - k_mutex_unlock(&ctx->lock); - - return st; + return dns_resolve_reconfigure_with_interfaces(ctx, + servers, + servers_sa, + NULL); } struct dns_resolve_context *dns_resolve_get_default(void) diff --git a/tests/net/lib/dns_addremove/src/main.c b/tests/net/lib/dns_addremove/src/main.c index 3ff9bb2aabe..eb8d25a5fa5 100644 --- a/tests/net/lib/dns_addremove/src/main.c +++ b/tests/net/lib/dns_addremove/src/main.c @@ -470,17 +470,15 @@ ZTEST(dns_addremove, test_dns_reconfigure_callback) zassert_equal(ret, 0, "Cannot reconfigure DNS server"); /* Wait for DNS removed callback after reconfiguring DNS */ - if (IS_ENABLED(CONFIG_DNS_RECONFIGURE_CLEANUP)) { - if (k_sem_take(&dns_removed, WAIT_TIME)) { - zassert_true(false, - "Timeout while waiting for DNS removed callback"); - } - - /* Wait for DNS added callback after reconfiguring DNS */ - if (k_sem_take(&dns_added, WAIT_TIME)) { - zassert_true(false, - "Timeout while waiting for DNS added callback"); - } + if (k_sem_take(&dns_removed, WAIT_TIME)) { + zassert_true(false, + "Timeout while waiting for DNS removed callback"); + } + + /* Wait for DNS added callback after reconfiguring DNS */ + if (k_sem_take(&dns_added, WAIT_TIME)) { + zassert_true(false, + "Timeout while waiting for DNS added callback"); } ret = dns_resolve_close(&resv_ipv4); diff --git a/tests/net/lib/dns_addremove/testcase.yaml b/tests/net/lib/dns_addremove/testcase.yaml index a6f56003f46..5551a41cfba 100644 --- a/tests/net/lib/dns_addremove/testcase.yaml +++ b/tests/net/lib/dns_addremove/testcase.yaml @@ -14,6 +14,3 @@ tests: net.dns.no_ipv4: extra_configs: - CONFIG_NET_IPV4=n - net.dns.addremove.reconfigure_cleanup: - extra_configs: - - CONFIG_DNS_RECONFIGURE_CLEANUP=y diff --git a/tests/net/lib/dns_dispatcher/src/main.c b/tests/net/lib/dns_dispatcher/src/main.c index e0353e8ac1f..21e60466066 100644 --- a/tests/net/lib/dns_dispatcher/src/main.c +++ b/tests/net/lib/dns_dispatcher/src/main.c @@ -175,14 +175,11 @@ static void *test_init(void) ZTEST(dns_dispatcher, test_dns_dispatcher) { struct dns_resolve_context *ctx; - int ret, sock1, sock2 = -1; + int sock1, sock2 = -1; ctx = dns_resolve_get_default(); - dns_resolve_close(ctx); - - ret = dns_resolve_init_default(ctx); - zassert_equal(ret, 0, "Cannot initialize DNS resolver (%d)", ret); + dns_resolve_init_default(ctx); sock1 = ctx->servers[0].sock; diff --git a/tests/net/lib/dns_dispatcher/testcase.yaml b/tests/net/lib/dns_dispatcher/testcase.yaml index b3ffd7c6479..314097ece66 100644 --- a/tests/net/lib/dns_dispatcher/testcase.yaml +++ b/tests/net/lib/dns_dispatcher/testcase.yaml @@ -8,9 +8,3 @@ common: tests: net.dns.dispatch: min_ram: 21 - net.dns.dispatch.ctx_cleanup: - extra_configs: - - CONFIG_DNS_RECONFIGURE_CLEANUP=y - net.dns.dispatch.ctx_no_cleanup: - extra_configs: - - CONFIG_DNS_RECONFIGURE_CLEANUP=n From e9594f3b915f0815b237c3dab68a5caac37eb600 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 341/881] Revert "[nrf fromtree] net: dhcpv6: Honor network interface for DNS servers" This reverts commit 564862d8c0479b1bb95aecd4e9864286ac83b239. Signed-off-by: Jukka Rissanen --- subsys/net/lib/dhcpv6/Kconfig | 17 ----------------- subsys/net/lib/dhcpv6/dhcpv6.c | 20 +------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/subsys/net/lib/dhcpv6/Kconfig b/subsys/net/lib/dhcpv6/Kconfig index 7fda850ec5e..dad049dac77 100644 --- a/subsys/net/lib/dhcpv6/Kconfig +++ b/subsys/net/lib/dhcpv6/Kconfig @@ -31,23 +31,6 @@ config NET_DHCPV6_OPTION_DNS_ADDRESS option from the server, and if available, use obtained information to configure DNS resolver. -config NET_DHCPV6_DNS_SERVER_VIA_INTERFACE - bool "Make DNS servers specific to the network interface" - depends on NET_DHCPV6_OPTION_DNS_ADDRESS - default y - help - If this is set, then if the system has multiple network interfaces - and each has DHCP enabled, then assign DNS servers received from that - network interface, to that specific interface. - If this option is not set, then any interface can be used for all - the configured DNS server addresses when doing DNS queries. - Example: We receive DNS server 2001:db8::1:53 DHCPv6 option from Wi-Fi - interface and DNS server 2001:db8::2:53 from Ethernet interface. - When this option is set, the DNS resolver will use DNS server - 2001:db8::1:53 when sending DNS query to the Wi-Fi interface and DNS - server 2001:db8::2:53 when sending DNS query to the Ethernet - interface. - if NET_DHCPV6 module = NET_DHCPV6 module-dep = NET_LOG diff --git a/subsys/net/lib/dhcpv6/dhcpv6.c b/subsys/net/lib/dhcpv6/dhcpv6.c index f5984273cc3..29dd652d428 100644 --- a/subsys/net/lib/dhcpv6/dhcpv6.c +++ b/subsys/net/lib/dhcpv6/dhcpv6.c @@ -1412,25 +1412,7 @@ static int dhcpv6_handle_dns_server_option(struct net_pkt *pkt) } ctx = dns_resolve_get_default(); - - if (IS_ENABLED(CONFIG_NET_DHCPV6_DNS_SERVER_VIA_INTERFACE)) { - /* If we are using the interface to resolve DNS servers, - * we need to save the interface index. - */ - int ifindex = net_if_get_by_iface(net_pkt_iface(pkt)); - int interfaces[MAX_DNS_SERVERS]; - - for (uint8_t i = 0; i < server_count; i++) { - interfaces[i] = ifindex; - } - - status = dns_resolve_reconfigure_with_interfaces(ctx, NULL, - dns_servers, - interfaces); - } else { - status = dns_resolve_reconfigure(ctx, NULL, dns_servers); - } - + status = dns_resolve_reconfigure(ctx, NULL, dns_servers); if (status < 0) { NET_DBG("Failed to reconfigure DNS resolver from DHCPv6 " "option: %d", status); From 5bc05c935508a076ff8a9d674447d95a1a3bfff8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 342/881] Revert "[nrf fromtree] net: dhcpv4: Honor network interface for DNS servers" This reverts commit feb37b6e1b4e4a8111b4d1a5689b587cc6240846. Signed-off-by: Jukka Rissanen --- subsys/net/lib/dhcpv4/Kconfig | 17 ----------------- subsys/net/lib/dhcpv4/dhcpv4.c | 20 +------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/subsys/net/lib/dhcpv4/Kconfig b/subsys/net/lib/dhcpv4/Kconfig index cf7603ae65a..52dcfc099b5 100644 --- a/subsys/net/lib/dhcpv4/Kconfig +++ b/subsys/net/lib/dhcpv4/Kconfig @@ -96,23 +96,6 @@ config NET_DHCPV4_OPTION_PRINT_IGNORED received and ignored. If this is not set, then we print these as unknown options. -config NET_DHCPV4_DNS_SERVER_VIA_INTERFACE - bool "Make DNS servers specific to the network interface" - depends on NET_DHCPV4_OPTION_DNS_ADDRESS - default y - help - If this is set, then if the system has multiple network interfaces - and each has DHCP enabled, then assign DNS servers received from that - network interface, to that specific interface. - If this option is not set, then any interface can be used for all - the configured DNS server addresses when doing DNS queries. - Example: We receive DNS server 192.0.2.53 DHCPv4 option from Wi-Fi - interface and DNS server 198.51.100.53 from Ethernet interface. - When this option is set, the DNS resolver will use DNS server - 192.0.2.53 when sending DNS query to the Wi-Fi interface and DNS - server 198.51.100.53 when sending DNS query to the Ethernet - interface. - endif # NET_DHCPV4 config NET_DHCPV4_SERVER diff --git a/subsys/net/lib/dhcpv4/dhcpv4.c b/subsys/net/lib/dhcpv4/dhcpv4.c index 6dedcab3cd9..f7d7447b27d 100644 --- a/subsys/net/lib/dhcpv4/dhcpv4.c +++ b/subsys/net/lib/dhcpv4/dhcpv4.c @@ -1171,25 +1171,7 @@ static bool dhcpv4_parse_options(struct net_pkt *pkt, for (uint8_t i = 0; i < dns_servers_cnt; i++) { dnses[i].sin_family = AF_INET; } - - if (IS_ENABLED(CONFIG_NET_DHCPV4_DNS_SERVER_VIA_INTERFACE)) { - /* If we are using the interface to resolve DNS servers, - * we need to save the interface index. - */ - int ifindex = net_if_get_by_iface(iface); - int interfaces[MAX_DNS_SERVERS]; - - for (uint8_t i = 0; i < dns_servers_cnt; i++) { - interfaces[i] = ifindex; - } - - status = dns_resolve_reconfigure_with_interfaces(ctx, NULL, - dns_servers, - interfaces); - } else { - status = dns_resolve_reconfigure(ctx, NULL, dns_servers); - } - + status = dns_resolve_reconfigure(ctx, NULL, dns_servers); if (status < 0) { NET_DBG("options_dns, failed to set " "resolve address: %d", status); From d5b4e4bae1f2a39f9141eebad43d3a8eb29cef24 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 343/881] Revert "[nrf fromtree] net: dns: Allow reconfiguration with network interfaces" This reverts commit 2dd096115023603c781939e2a4dfb2ea4be3fdc0. Signed-off-by: Jukka Rissanen --- include/zephyr/net/dns_resolve.h | 26 -------------------------- subsys/net/lib/dns/resolve.c | 20 ++++---------------- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/include/zephyr/net/dns_resolve.h b/include/zephyr/net/dns_resolve.h index 49043bd1733..3413a008395 100644 --- a/include/zephyr/net/dns_resolve.h +++ b/include/zephyr/net/dns_resolve.h @@ -524,32 +524,6 @@ int dns_resolve_reconfigure(struct dns_resolve_context *ctx, const char *servers_str[], const struct sockaddr *servers_sa[]); -/** - * @brief Reconfigure DNS resolving context with new server list and - * allowing servers to be specified to a specific network interface. - * - * @param ctx DNS context - * @param servers_str DNS server addresses using textual strings. The - * array is NULL terminated. The port number can be given in the string. - * Syntax for the server addresses with or without port numbers: - * IPv4 : 10.0.9.1 - * IPv4 + port : 10.0.9.1:5353 - * IPv6 : 2001:db8::22:42 - * IPv6 + port : [2001:db8::22:42]:5353 - * @param servers_sa DNS server addresses as struct sockaddr. The array - * is NULL terminated. Port numbers are optional in struct sockaddr, the - * default will be used if set to 0. - * @param interfaces Network interfaces to which the DNS servers are bound. - * This is an array of network interface indices. The array must be - * the same length as the servers_str and servers_sa arrays. - * - * @return 0 if ok, <0 if error. - */ -int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, - const char *servers_str[], - const struct sockaddr *servers_sa[], - int interfaces[]); - /** * @brief Cancel a pending DNS query. * diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index 447d0a78322..813b7cd8f6c 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -1877,10 +1877,9 @@ static bool dns_servers_exists(struct dns_resolve_context *ctx, return true; } -int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, - const char *servers[], - const struct sockaddr *servers_sa[], - int interfaces[]) +int dns_resolve_reconfigure(struct dns_resolve_context *ctx, + const char *servers[], + const struct sockaddr *servers_sa[]) { int err; @@ -1910,8 +1909,7 @@ int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, } } - err = dns_resolve_init_locked(ctx, servers, servers_sa, - &resolve_svc, 0, interfaces); + err = dns_resolve_init_locked(ctx, servers, servers_sa, &resolve_svc, 0, NULL); unlock: k_mutex_unlock(&ctx->lock); @@ -1919,16 +1917,6 @@ int dns_resolve_reconfigure_with_interfaces(struct dns_resolve_context *ctx, return err; } -int dns_resolve_reconfigure(struct dns_resolve_context *ctx, - const char *servers[], - const struct sockaddr *servers_sa[]) -{ - return dns_resolve_reconfigure_with_interfaces(ctx, - servers, - servers_sa, - NULL); -} - struct dns_resolve_context *dns_resolve_get_default(void) { return &dns_default_ctx; From 397979a82c14ffb16586ba40a91b63755ac2138d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 344/881] Revert "[nrf fromtree] drivers: udc_dwc2: Fix incomplete iso handling race" This reverts commit 424f0f92b93334678d77e3ccb22d307c3cd2e6c5. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 98 ++++++++++---------------------------- 1 file changed, 24 insertions(+), 74 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 4ef5dc1825c..599dfcd8b5d 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -141,7 +141,6 @@ struct udc_dwc2_data { unsigned int enumdone : 1; unsigned int enumspd : 2; unsigned int pending_dout_feed : 1; - unsigned int ignore_ep0_nakeff : 1; enum dwc2_suspend_type suspend_type; /* Number of endpoints including control endpoint */ uint8_t numdeveps; @@ -486,6 +485,7 @@ static int dwc2_tx_fifo_write(const struct device *dev, mem_addr_t dieptsiz_reg = (mem_addr_t)&base->in_ep[ep_idx].dieptsiz; /* TODO: use dwc2_get_dxepctl_reg() */ mem_addr_t diepctl_reg = (mem_addr_t)&base->in_ep[ep_idx].diepctl; + mem_addr_t diepint_reg = (mem_addr_t)&base->in_ep[ep_idx].diepint; uint32_t diepctl; uint32_t max_xfersize, max_pktcnt, pktcnt; @@ -617,6 +617,9 @@ static int dwc2_tx_fifo_write(const struct device *dev, } sys_write32(diepctl, diepctl_reg); + /* Clear IN Endpoint NAK Effective interrupt in case it was set */ + sys_write32(USB_DWC2_DIEPINT_INEPNAKEFF, diepint_reg); + if (dwc2_in_completer_mode(dev)) { const uint8_t *src = buf->data; @@ -808,20 +811,7 @@ static void dwc2_handle_xfer_next(const struct device *dev, if (USB_EP_DIR_IS_OUT(cfg->addr)) { dwc2_prep_rx(dev, buf, cfg); } else { - int err; - - if (cfg->addr == USB_CONTROL_EP_IN && - udc_ctrl_stage_is_status_in(dev)) { - /* It was observed that EPENA results in INEPNAKEFF - * interrupt which leads to endpoint disable. It is not - * clear how to prevent this without violating sequence - * described in Programming Guide, so just set a flag - * for interrupt handler to ignore it. - */ - priv->ignore_ep0_nakeff = 1; - } - - err = dwc2_tx_fifo_write(dev, cfg, buf); + int err = dwc2_tx_fifo_write(dev, cfg, buf); if (cfg->addr == USB_CONTROL_EP_IN) { /* Feed a buffer for the next setup packet after arming @@ -872,7 +862,6 @@ static int dwc2_handle_evt_setup(const struct device *dev) * transfer beforehand. In Buffer DMA the SETUP can be copied to any EP0 * OUT buffer. If there is any buffer queued, it is obsolete now. */ - priv->ignore_ep0_nakeff = 0; udc_dwc2_ep_disable(dev, cfg_in, false, true); atomic_and(&priv->xfer_finished, ~(BIT(0) | BIT(16))); @@ -2669,21 +2658,7 @@ static inline void dwc2_handle_iepint(const struct device *dev) } if (status & USB_DWC2_DIEPINT_INEPNAKEFF) { - uint32_t diepctl = sys_read32(diepctl_reg); - - if (!(diepctl & USB_DWC2_DEPCTL_NAKSTS)) { - /* Ignore stale NAK effective interrupt */ - } else if (n == 0 && priv->ignore_ep0_nakeff) { - /* Status stage enabled endpoint. NAK will be - * cleared in STSPHSERCVD interrupt. - */ - } else if (diepctl & USB_DWC2_DEPCTL_EPENA) { - diepctl &= ~USB_DWC2_DEPCTL_EPENA; - diepctl |= USB_DWC2_DEPCTL_EPDIS; - sys_write32(diepctl, diepctl_reg); - } else if (priv->iso_in_rearm & (BIT(n))) { - priv->iso_in_rearm &= ~BIT(n); - } + sys_set_bits(diepctl_reg, USB_DWC2_DEPCTL_EPDIS); } if (status & USB_DWC2_DIEPINT_EPDISBLD) { @@ -2701,13 +2676,6 @@ static inline void dwc2_handle_iepint(const struct device *dev) if ((usb_dwc2_get_depctl_eptype(diepctl) == USB_DWC2_DEPCTL_EPTYPE_ISO) && (priv->iso_in_rearm & BIT(n))) { struct udc_ep_config *cfg = udc_get_ep_cfg(dev, n | USB_EP_DIR_IN); - struct net_buf *buf; - - /* Data is no longer relevant, discard it */ - buf = udc_buf_get(cfg); - if (buf) { - udc_submit_ep_event(dev, buf, 0); - } /* Try to queue next packet before SOF */ dwc2_handle_xfer_next(dev, cfg); @@ -2869,17 +2837,9 @@ static inline void dwc2_handle_oepint(const struct device *dev) if ((usb_dwc2_get_depctl_eptype(doepctl) == USB_DWC2_DEPCTL_EPTYPE_ISO) && (priv->iso_out_rearm & BIT(n))) { struct udc_ep_config *cfg; - struct net_buf *buf; - - cfg = udc_get_ep_cfg(dev, n | USB_EP_DIR_OUT); - - /* Discard disabled transfer buffer */ - buf = udc_buf_get(cfg); - if (buf) { - udc_submit_ep_event(dev, buf, 0); - } /* Try to queue next packet before SOF */ + cfg = udc_get_ep_cfg(dev, n | USB_EP_DIR_OUT); dwc2_handle_xfer_next(dev, cfg); priv->iso_out_rearm &= ~BIT(n); @@ -2923,6 +2883,7 @@ static void dwc2_handle_incompisoin(const struct device *dev) /* Check if endpoint didn't receive ISO IN data */ if ((diepctl & mask) == val) { struct udc_ep_config *cfg; + struct net_buf *buf; cfg = udc_get_ep_cfg(dev, i | USB_EP_DIR_IN); __ASSERT_NO_MSG(cfg && cfg->stat.enabled && @@ -2930,7 +2891,13 @@ static void dwc2_handle_incompisoin(const struct device *dev) udc_dwc2_ep_disable(dev, cfg, false, false); - rearm |= BIT(i); + buf = udc_buf_get(cfg); + if (buf) { + /* Data is no longer relevant */ + udc_submit_ep_event(dev, buf, 0); + + rearm |= BIT(i); + } } eps &= ~BIT(i); @@ -2973,6 +2940,7 @@ static void dwc2_handle_incompisoout(const struct device *dev) /* Check if endpoint didn't receive ISO OUT data */ if ((doepctl & mask) == val) { struct udc_ep_config *cfg; + struct net_buf *buf; cfg = udc_get_ep_cfg(dev, i); __ASSERT_NO_MSG(cfg && cfg->stat.enabled && @@ -2980,7 +2948,12 @@ static void dwc2_handle_incompisoout(const struct device *dev) udc_dwc2_ep_disable(dev, cfg, false, false); - rearm |= BIT(i); + buf = udc_buf_get(cfg); + if (buf) { + udc_submit_ep_event(dev, buf, 0); + + rearm |= BIT(i); + } } eps &= ~BIT(i); @@ -3011,31 +2984,8 @@ static void dwc2_handle_goutnakeff(const struct device *dev) doepctl_reg = (mem_addr_t)&base->out_ep[ep_idx].doepctl; doepctl = sys_read32(doepctl_reg); - if (!(doepctl & USB_DWC2_DEPCTL_EPENA)) { - /* While endpoint was enabled when application requested - * to disable it, there is a race window between setting - * DCTL SGOUTNAK bit and it becoming effective. During - * the window, it is possible for host to actually send - * OUT DATA packet ending the transfer which disables - * the endpoint. - * - * If we arrived here due to INCOMPISOOUT, clearing - * the rearm flag is enough. - */ - if (priv->iso_out_rearm & BIT(ep_idx)) { - priv->iso_out_rearm &= ~BIT(ep_idx); - } - - /* If application requested STALL then set it here, but - * otherwise there's nothing to do. - */ - if (!(priv->ep_out_stall & BIT(ep_idx))) { - continue; - } - } else if (ep_idx != 0) { - /* Only set EPDIS if EPENA is set, but do not set it for - * endpoint 0 which cannot be disabled by application. - */ + /* The application cannot disable control OUT endpoint 0. */ + if (ep_idx != 0) { doepctl |= USB_DWC2_DEPCTL_EPDIS; } From dc0157e4f164ec275a84ae5b6993c9d53f4e4088 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 345/881] Revert "[nrf fromtree] drivers: udc_dwc2: Rearm isochronous OUT endpoints during incompisoout" This reverts commit b04c3d73d9b44d3db3f82102a4a36753a942bca9. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 599dfcd8b5d..fca8f607ec7 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -121,7 +121,6 @@ struct udc_dwc2_data { /* Isochronous endpoint enabled (IN on bits 0-15, OUT on bits 16-31) */ uint32_t iso_enabled; uint16_t iso_in_rearm; - uint16_t iso_out_rearm; uint16_t ep_out_disable; uint16_t ep_out_stall; uint16_t txf_set; @@ -2777,7 +2776,6 @@ static inline void dwc2_handle_oepint(const struct device *dev) while (epint) { uint8_t n = find_lsb_set(epint) - 1; mem_addr_t doepint_reg = (mem_addr_t)&base->out_ep[n].doepint; - mem_addr_t doepctl_reg = (mem_addr_t)&base->out_ep[n].doepctl; uint32_t doepint; uint32_t status; @@ -2830,20 +2828,7 @@ static inline void dwc2_handle_oepint(const struct device *dev) } if (status & USB_DWC2_DOEPINT_EPDISBLD) { - uint32_t doepctl = sys_read32(doepctl_reg); - k_event_post(&priv->ep_disabled, BIT(16 + n)); - - if ((usb_dwc2_get_depctl_eptype(doepctl) == USB_DWC2_DEPCTL_EPTYPE_ISO) && - (priv->iso_out_rearm & BIT(n))) { - struct udc_ep_config *cfg; - - /* Try to queue next packet before SOF */ - cfg = udc_get_ep_cfg(dev, n | USB_EP_DIR_OUT); - dwc2_handle_xfer_next(dev, cfg); - - priv->iso_out_rearm &= ~BIT(n); - } } epint &= ~BIT(n); @@ -2928,7 +2913,6 @@ static void dwc2_handle_incompisoout(const struct device *dev) ((priv->sof_num & 1) ? USB_DWC2_DEPCTL_DPID : 0) | USB_DWC2_DEPCTL_USBACTEP; uint32_t eps = (priv->iso_enabled & 0xFFFF0000UL) >> 16; - uint16_t rearm = 0; while (eps) { uint8_t i = find_lsb_set(eps) - 1; @@ -2951,17 +2935,12 @@ static void dwc2_handle_incompisoout(const struct device *dev) buf = udc_buf_get(cfg); if (buf) { udc_submit_ep_event(dev, buf, 0); - - rearm |= BIT(i); } } eps &= ~BIT(i); } - /* Mark endpoints to re-arm in EPDISBLD handler */ - priv->iso_out_rearm = rearm; - sys_write32(USB_DWC2_GINTSTS_INCOMPISOOUT, gintsts_reg); } From b24d2b5ca5fc1d6044dbfad97c132942a0f0da40 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 346/881] Revert "[nrf fromtree] usb: device_next: uac2: Double buffering on feedback endpoint" This reverts commit 594ae1ce8da1737d8e5f3e4c95cbf65f4918cf46. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/class/usbd_uac2.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_uac2.c b/subsys/usb/device_next/class/usbd_uac2.c index 3a53b5c5d21..945970c18c5 100644 --- a/subsys/usb/device_next/class/usbd_uac2.c +++ b/subsys/usb/device_next/class/usbd_uac2.c @@ -29,7 +29,7 @@ LOG_MODULE_REGISTER(usbd_uac2, CONFIG_USBD_UAC2_LOG_LEVEL); + AS_HAS_ISOCHRONOUS_DATA_ENDPOINT(node) \ + AS_IS_USB_ISO_IN(node) /* ISO IN double buffering */ \ + AS_IS_USB_ISO_OUT(node) /* ISO OUT double buffering */ \ - + 2 * AS_HAS_EXPLICIT_FEEDBACK_ENDPOINT(node))) + + AS_HAS_EXPLICIT_FEEDBACK_ENDPOINT(node))) #define COUNT_UAC2_EP_BUFFERS(i) \ + DT_PROP(DT_DRV_INST(i), interrupt_endpoint) \ DT_INST_FOREACH_CHILD(i, COUNT_UAC2_AS_ENDPOINT_BUFFERS) @@ -88,7 +88,6 @@ struct uac2_ctx { atomic_t as_queued; atomic_t as_double; uint32_t fb_queued; - uint32_t fb_double; }; /* UAC2 device constant data */ @@ -442,11 +441,7 @@ static void write_explicit_feedback(struct usbd_class_data *const c_data, LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); } else { - if (ctx->fb_queued & BIT(as_idx)) { - ctx->fb_double |= BIT(as_idx); - } else { - ctx->fb_queued |= BIT(as_idx); - } + ctx->fb_queued |= BIT(as_idx); } } @@ -818,17 +813,7 @@ static int uac2_request(struct usbd_class_data *const c_data, struct net_buf *bu terminal = cfg->as_terminals[as_idx]; if (is_feedback) { - bool clear_double = buf->frags; - - if (ctx->fb_queued & BIT(as_idx)) { - ctx->fb_queued &= ~BIT(as_idx); - } else { - clear_double = true; - } - - if (clear_double) { - ctx->fb_double &= ~BIT(as_idx); - } + ctx->fb_queued &= ~BIT(as_idx); } else if (!atomic_test_and_clear_bit(&ctx->as_queued, as_idx) || buf->frags) { atomic_clear_bit(&ctx->as_double, as_idx); } @@ -895,7 +880,7 @@ static void uac2_sof(struct usbd_class_data *const c_data) * for now to allow faster recovery (i.e. reduce workload to be * done during this frame). */ - if (ctx->fb_queued & ctx->fb_double & BIT(as_idx)) { + if (ctx->fb_queued & BIT(as_idx)) { continue; } From 0a7a05467eb3d01786abcb3e2de904e4dce06a2b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 347/881] Revert "[nrf fromtree] usb: device_next: uac2: Do not leak buffer on failed enqueue" This reverts commit d7181027a06dc72738383cb1ff38ace206d06db3. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/class/usbd_uac2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_uac2.c b/subsys/usb/device_next/class/usbd_uac2.c index 945970c18c5..00a8fa5b826 100644 --- a/subsys/usb/device_next/class/usbd_uac2.c +++ b/subsys/usb/device_next/class/usbd_uac2.c @@ -399,8 +399,6 @@ static void schedule_iso_out_read(struct usbd_class_data *const c_data, if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); - ctx->ops->data_recv_cb(dev, terminal, - data_buf, 0, ctx->user_data); atomic_clear_bit(queued_bits, as_idx); } } From e936177acd42122fa1d345a03c190a5ea54c2de7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 348/881] Revert "[nrf fromtree] usb: device_next: uac2: Double buffering on data OUT endpoints" This reverts commit bd9592bb773cc04dfc7e1b848ff95c152363fa34. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/class/usbd_uac2.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_uac2.c b/subsys/usb/device_next/class/usbd_uac2.c index 00a8fa5b826..0b08673abd2 100644 --- a/subsys/usb/device_next/class/usbd_uac2.c +++ b/subsys/usb/device_next/class/usbd_uac2.c @@ -28,7 +28,6 @@ LOG_MODULE_REGISTER(usbd_uac2, CONFIG_USBD_UAC2_LOG_LEVEL); IF_ENABLED(DT_NODE_HAS_COMPAT(node, zephyr_uac2_audio_streaming), ( \ + AS_HAS_ISOCHRONOUS_DATA_ENDPOINT(node) \ + AS_IS_USB_ISO_IN(node) /* ISO IN double buffering */ \ - + AS_IS_USB_ISO_OUT(node) /* ISO OUT double buffering */ \ + AS_HAS_EXPLICIT_FEEDBACK_ENDPOINT(node))) #define COUNT_UAC2_EP_BUFFERS(i) \ + DT_PROP(DT_DRV_INST(i), interrupt_endpoint) \ @@ -349,7 +348,6 @@ static void schedule_iso_out_read(struct usbd_class_data *const c_data, const struct uac2_cfg *cfg = dev->config; struct uac2_ctx *ctx = dev->data; struct net_buf *buf; - atomic_t *queued_bits = &ctx->as_queued; void *data_buf; int as_idx = terminal_to_as_interface(dev, terminal); int ret; @@ -366,19 +364,16 @@ static void schedule_iso_out_read(struct usbd_class_data *const c_data, return; } - if (atomic_test_and_set_bit(queued_bits, as_idx)) { - queued_bits = &ctx->as_double; - if (atomic_test_and_set_bit(queued_bits, as_idx)) { - /* Transfer already double queued - nothing to do */ - return; - } + if (atomic_test_and_set_bit(&ctx->as_queued, as_idx)) { + /* Transfer already queued - do not requeue */ + return; } /* Prepare transfer to read audio OUT data from host */ data_buf = ctx->ops->get_recv_buf(dev, terminal, mps, ctx->user_data); if (!data_buf) { LOG_ERR("No data buffer for terminal %d", terminal); - atomic_clear_bit(queued_bits, as_idx); + atomic_clear_bit(&ctx->as_queued, as_idx); return; } @@ -391,7 +386,7 @@ static void schedule_iso_out_read(struct usbd_class_data *const c_data, */ ctx->ops->data_recv_cb(dev, terminal, data_buf, 0, ctx->user_data); - atomic_clear_bit(queued_bits, as_idx); + atomic_clear_bit(&ctx->as_queued, as_idx); return; } @@ -399,7 +394,7 @@ static void schedule_iso_out_read(struct usbd_class_data *const c_data, if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); - atomic_clear_bit(queued_bits, as_idx); + atomic_clear_bit(&ctx->as_queued, as_idx); } } @@ -819,10 +814,6 @@ static int uac2_request(struct usbd_class_data *const c_data, struct net_buf *bu if (USB_EP_DIR_IS_OUT(ep)) { ctx->ops->data_recv_cb(dev, terminal, buf->__buf, buf->len, ctx->user_data); - if (buf->frags) { - ctx->ops->data_recv_cb(dev, terminal, buf->frags->__buf, - buf->frags->len, ctx->user_data); - } } else if (!is_feedback) { ctx->ops->buf_release_cb(dev, terminal, buf->__buf, ctx->user_data); if (buf->frags) { From ef1c3d99820bb50e3415fa977949e25532139012 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 349/881] Revert "[nrf fromtree] usb: device_next: uac2: Remove unnecessary plus signs" This reverts commit 102db0ae7a983108ce5cb012560dfd3fc4788986. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/class/usbd_uac2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_uac2.c b/subsys/usb/device_next/class/usbd_uac2.c index 0b08673abd2..efa3fd6cdf3 100644 --- a/subsys/usb/device_next/class/usbd_uac2.c +++ b/subsys/usb/device_next/class/usbd_uac2.c @@ -26,9 +26,9 @@ LOG_MODULE_REGISTER(usbd_uac2, CONFIG_USBD_UAC2_LOG_LEVEL); #define COUNT_UAC2_AS_ENDPOINT_BUFFERS(node) \ IF_ENABLED(DT_NODE_HAS_COMPAT(node, zephyr_uac2_audio_streaming), ( \ - + AS_HAS_ISOCHRONOUS_DATA_ENDPOINT(node) \ - + AS_IS_USB_ISO_IN(node) /* ISO IN double buffering */ \ - + AS_HAS_EXPLICIT_FEEDBACK_ENDPOINT(node))) + + AS_HAS_ISOCHRONOUS_DATA_ENDPOINT(node) + \ + + AS_IS_USB_ISO_IN(node) /* ISO IN double buffering */ + \ + AS_HAS_EXPLICIT_FEEDBACK_ENDPOINT(node))) #define COUNT_UAC2_EP_BUFFERS(i) \ + DT_PROP(DT_DRV_INST(i), interrupt_endpoint) \ DT_INST_FOREACH_CHILD(i, COUNT_UAC2_AS_ENDPOINT_BUFFERS) From 8bd2f15b760d220d2558878b2513935ae1b8c8ee Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 350/881] Revert "[nrf fromtree] usb: device_next: hid: Fix endpoint address getters" This reverts commit b000e11ccf58bacf48f189177d79ffc2297f66de. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/class/usbd_hid.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_hid.c b/subsys/usb/device_next/class/usbd_hid.c index d978aea0d27..d5476a88ed6 100644 --- a/subsys/usb/device_next/class/usbd_hid.c +++ b/subsys/usb/device_next/class/usbd_hid.c @@ -84,29 +84,19 @@ struct hid_device_data { static inline uint8_t hid_get_in_ep(struct usbd_class_data *const c_data) { - struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); const struct device *dev = usbd_class_get_private(c_data); const struct hid_device_config *dcfg = dev->config; struct usbd_hid_descriptor *desc = dcfg->desc; - if (USBD_SUPPORTS_HIGH_SPEED && usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { - return desc->hs_in_ep.bEndpointAddress; - } - return desc->in_ep.bEndpointAddress; } static inline uint8_t hid_get_out_ep(struct usbd_class_data *const c_data) { - struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); const struct device *dev = usbd_class_get_private(c_data); const struct hid_device_config *dcfg = dev->config; struct usbd_hid_descriptor *desc = dcfg->desc; - if (USBD_SUPPORTS_HIGH_SPEED && usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { - return desc->hs_out_ep.bEndpointAddress; - } - return desc->out_ep.bEndpointAddress; } From 1ef9f6d1a08dc3678f1905de1b4ebc6ee99d5ce3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 351/881] Revert "[nrf fromtree] samples: usb: uac2: implicit: Stop processing micophone data" This reverts commit cd96efdf9c5ce474cbb592c17aa39c6cc47a83e2. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/uac2_implicit_feedback/src/main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/main.c b/samples/subsys/usb/uac2_implicit_feedback/src/main.c index 12abdf4fe68..b7720fe0331 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/main.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/main.c @@ -93,7 +93,6 @@ static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, !ctx->microphone_enabled) { i2s_trigger(ctx->i2s_dev, I2S_DIR_BOTH, I2S_TRIGGER_DROP); ctx->i2s_started = false; - ctx->rx_started = false; ctx->i2s_counter = 0; ctx->plus_ones = ctx->minus_ones = 0; if (ctx->pending_mic_samples) { @@ -173,7 +172,6 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, ret = i2s_write(ctx->i2s_dev, buf, size); if (ret < 0) { ctx->i2s_started = false; - ctx->rx_started = false; ctx->i2s_counter = 0; ctx->plus_ones = ctx->minus_ones = 0; if (ctx->pending_mic_samples) { From eeaab5104f9e0a7ac1d00b2b323229723bc46784 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 352/881] Revert "[nrf fromlist] tests: drivers: pwm_gpio_loopback: Add more channels" This reverts commit 9fd04855d0ec375e7608cb4fc76351505be06640. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 32 +++++++------------ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 30 ++--------------- 2 files changed, 14 insertions(+), 48 deletions(-) diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 7eb6ff84af3..8b5846df92d 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,55 +4,45 @@ * * Test requires wire connection between: * - PWM130 OUT[0] at P0.00 <-> GPIO input at P0.01 - * - PWM130 OUT[1] at P0.02 <-> GPIO input at P0.04 - * - PWM130 OUT[2] at P0.03 <-> GPIO input at P0.05 - * - PWM130 OUT[3] at P0.06 <-> GPIO input at P0.07 * - PWM120 OUT[0] at P7.00 <-> GPIO input at P1.09 + * - PWM120 OUT[1] at P7.01 <-> GPIO input at P1.05 */ / { zephyr,user { pwms = <&pwm130 0 160000 PWM_POLARITY_NORMAL>, - <&pwm130 1 160000 PWM_POLARITY_NORMAL>, - <&pwm130 2 160000 PWM_POLARITY_NORMAL>, - <&pwm130 3 160000 PWM_POLARITY_NORMAL>, - <&pwm120 0 80000 PWM_POLARITY_NORMAL>; + <&pwm120 0 80000 PWM_POLARITY_NORMAL>, + <&pwm120 1 80000 PWM_POLARITY_NORMAL>; gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>, - <&gpio0 4 GPIO_ACTIVE_HIGH>, - <&gpio0 5 GPIO_ACTIVE_HIGH>, - <&gpio0 7 GPIO_ACTIVE_HIGH>, - <&gpio1 9 GPIO_ACTIVE_HIGH>; + <&gpio1 9 GPIO_ACTIVE_HIGH>, + <&gpio1 5 GPIO_ACTIVE_HIGH>; }; }; &pinctrl { pwm130_default: pwm130_default { group1 { - psels = , - , - , - ; + psels = ; }; }; pwm130_sleep: pwm130_sleep { group1 { - psels = , - , - , - ; + psels = ; low-power-enable; }; }; pwm120_default: pwm120_default { group1 { - psels = ; + psels = , + ; }; }; pwm120_sleep: pwm120_sleep { group1 { - psels = ; + psels = , + ; low-power-enable; }; }; diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 69b0c8c5bed..4ecece17892 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -3,36 +3,12 @@ * SPDX-License-Identifier: Apache-2.0 * * Test requires jumper between: - * - PWM20 OUT[0] at P1.08 <-> GPIO input at P1.09 - * - PWM20 OUT[1] at P1.10 <-> GPIO input at P1.11 - * - PWM20 OUT[2] at P1.12 <-> GPIO input at P1.13 + * - PWM20 OUT[0] at P1.10 <-> GPIO input at P1.11 */ / { zephyr,user { - pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>, - <&pwm20 1 160000 PWM_POLARITY_NORMAL>, - <&pwm20 2 160000 PWM_POLARITY_NORMAL>; - gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>, - <&gpio1 11 GPIO_ACTIVE_HIGH>, - <&gpio1 13 GPIO_ACTIVE_HIGH>; - }; -}; - -&pinctrl { - pwm20_default: pwm20_default { - group1 { - psels = , - , - ; - }; - }; - - pwm20_sleep: pwm20_sleep { - group1 { - psels = , - , - ; - }; + pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>; + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; From 5df615eb7e2d3a2a579105542125da109e86393a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 353/881] Revert "[nrf fromlist] tests: drivers: pwm_gpio_loopback: Test improvement" This reverts commit 87b4e2ceea2b1195582054a2c3d00a7db6480def. Signed-off-by: Jukka Rissanen --- .../drivers/pwm/pwm_gpio_loopback/src/main.c | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/tests/drivers/pwm/pwm_gpio_loopback/src/main.c b/tests/drivers/pwm/pwm_gpio_loopback/src/main.c index d1552712caf..12218990634 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/src/main.c +++ b/tests/drivers/pwm/pwm_gpio_loopback/src/main.c @@ -234,25 +234,16 @@ ZTEST(pwm_gpio_loopback, test_pwm) ZTEST(pwm_gpio_loopback, test_pwm_cross) { - uint8_t duty[TEST_PWM_COUNT]; - const int duty_step = 25; - const int duty_variations = 5; - - /* Initial sweep with increasing duty cycles */ for (int i = 0; i < TEST_PWM_COUNT; i++) { - duty[i] = (i % duty_variations) * duty_step; - test_run(&pwms_dt[i], &gpios_dt[i], duty[i], true); + /* Test case: [Duty: 40%] */ + test_run(&pwms_dt[i], &gpios_dt[i], 40, true); } - /* Repeat test with persistent config checks and rotated duty cycles */ - for (int j = 1; j < duty_variations; j++) { - for (int i = 0; i < TEST_PWM_COUNT; i++) { - test_run(&pwms_dt[i], &gpios_dt[i], duty[i], false); - } - for (int i = 0; i < TEST_PWM_COUNT; i++) { - duty[i] = ((j + i) % duty_variations) * duty_step; - test_run(&pwms_dt[i], &gpios_dt[i], duty[i], true); - } + /* Set all channels and check if they retain the original + * configuration without calling pwm_set again + */ + for (int i = 0; i < TEST_PWM_COUNT; i++) { + test_run(&pwms_dt[i], &gpios_dt[i], 40, false); } } From ffa410ad13bbf56c673293e27d59cf7aac331c65 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:15 +0300 Subject: [PATCH 354/881] Revert "[nrf fromlist] drivers: spi: nrfx_spis: fix buffer freeing on error" This reverts commit 4ce95e842d6c97dd3ae374f2e93769c45f37314b. Signed-off-by: Jukka Rissanen --- drivers/spi/spi_nrfx_spis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index c6e551eafc3..daa75d7e7ff 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -243,9 +243,9 @@ static int prepare_for_transfer(const struct device *dev, return 0; buffers_set_failed: - dmm_buffer_in_release(dev_config->mem_reg, rx_buf, rx_buf_len, dmm_rx_buf); + dmm_buffer_in_release(dev_config->mem_reg, rx_buf, rx_buf_len, rx_buf); in_alloc_failed: - dmm_buffer_out_release(dev_config->mem_reg, (void *)dmm_tx_buf); + dmm_buffer_out_release(dev_config->mem_reg, (void *)tx_buf); out_alloc_failed: return err; } From 39ae7c7f9793bb7b05f70384a313d8c9710f550e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 355/881] Revert "[nrf fromlist] tests: drivers: spi: controller_peripheral: add direct variant" This reverts commit c8aad717b270ffbf924dad0e5d358a8fbdd0d1f0. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_controller_peripheral/Kconfig | 7 ------- .../drivers/spi/spi_controller_peripheral/src/main.c | 9 +++------ .../spi/spi_controller_peripheral/testcase.yaml | 11 ----------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/tests/drivers/spi/spi_controller_peripheral/Kconfig b/tests/drivers/spi/spi_controller_peripheral/Kconfig index c98c3a27ff2..f6472dae4ab 100644 --- a/tests/drivers/spi/spi_controller_peripheral/Kconfig +++ b/tests/drivers/spi/spi_controller_peripheral/Kconfig @@ -11,11 +11,4 @@ config TESTED_SPI_MODE 2: CPOL 1 (Active low), CPHA 0 (leading) 3: CPOL 1 (Active low), CPHA 1 (trailing) -config PREALLOC_BUFFERS - bool "Preallocate buffers" - default y - help - Preallocate buffers used for transaction - using `memory-region` property. - source "Kconfig.zephyr" diff --git a/tests/drivers/spi/spi_controller_peripheral/src/main.c b/tests/drivers/spi/spi_controller_peripheral/src/main.c index 7e15bb32536..04c6c27d11a 100644 --- a/tests/drivers/spi/spi_controller_peripheral/src/main.c +++ b/tests/drivers/spi/spi_controller_peripheral/src/main.c @@ -41,12 +41,9 @@ static struct k_poll_event async_evt_spim = K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_SIGNAL, K_POLL_MODE_NOTIFY_ONLY, &async_sig_spim); #define MEMORY_SECTION(node) \ - COND_CODE_1(IS_ENABLED(CONFIG_PREALLOC_BUFFERS), \ - (COND_CODE_1(DT_NODE_HAS_PROP(node, memory_regions), \ - (__attribute__((__section__( \ - LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(node, \ - memory_regions)))))), \ - ())), \ + COND_CODE_1(DT_NODE_HAS_PROP(node, memory_regions), \ + (__attribute__((__section__( \ + LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(node, memory_regions)))))), \ ()) static uint8_t spim_buffer[32] MEMORY_SECTION(DT_BUS(DT_NODELABEL(dut_spi_dt))); diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 5f243dd6cf6..f385c3073e9 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -117,14 +117,3 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l20pdk/nrf54l20/cpuapp - ophelia4ev/nrf54l15/cpuapp - - drivers.spi.direct_xfer: - extra_configs: - - CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=0 - filter: CONFIG_SOC_FAMILY_NORDIC_NRF - - drivers.spi.direct_xfer.no_prealloc: - extra_configs: - - CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=0 - - CONFIG_PREALLOC_BUFFERS=n - filter: CONFIG_SOC_FAMILY_NORDIC_NRF From 9cf38bb981ae987cd3f04c8de92fd439492c2509 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 356/881] Revert "[nrf fromtree] boards: shields: add npm1304_ek shield" This reverts commit ba1a3a62b9f2f57334bf9e2691779f6d3f1f187e. Signed-off-by: Jukka Rissanen --- boards/shields/npm1300_ek/doc/index.rst | 7 +- boards/shields/npm1304_ek/Kconfig.shield | 5 - boards/shields/npm1304_ek/doc/index.rst | 30 ----- boards/shields/npm1304_ek/npm1304_ek.overlay | 86 -------------- boards/shields/npm1304_ek/shield.yml | 11 -- doc/_scripts/redirects.py | 1 - samples/shields/npm1300_ek/CMakeLists.txt | 11 ++ samples/shields/npm1300_ek/doc/index.rst | 71 +++++++++++ .../nrf52dk_nrf52832.overlay} | 7 +- .../{npm13xx_ek => npm1300_ek}/prj.conf | 0 samples/shields/npm1300_ek/sample.yaml | 12 ++ .../{npm13xx_ek => npm1300_ek}/src/main.c | 30 ++--- samples/shields/npm13xx_ek/CMakeLists.txt | 17 --- .../boards/nrf52dk_nrf52832.overlay | 10 -- samples/shields/npm13xx_ek/doc/index.rst | 110 ------------------ samples/shields/npm13xx_ek/npm1304.overlay | 36 ------ samples/shields/npm13xx_ek/sample.yaml | 17 --- 17 files changed, 113 insertions(+), 348 deletions(-) delete mode 100644 boards/shields/npm1304_ek/Kconfig.shield delete mode 100644 boards/shields/npm1304_ek/doc/index.rst delete mode 100644 boards/shields/npm1304_ek/npm1304_ek.overlay delete mode 100644 boards/shields/npm1304_ek/shield.yml create mode 100644 samples/shields/npm1300_ek/CMakeLists.txt create mode 100644 samples/shields/npm1300_ek/doc/index.rst rename samples/shields/{npm13xx_ek/npm1300.overlay => npm1300_ek/nrf52dk_nrf52832.overlay} (88%) rename samples/shields/{npm13xx_ek => npm1300_ek}/prj.conf (100%) create mode 100644 samples/shields/npm1300_ek/sample.yaml rename samples/shields/{npm13xx_ek => npm1300_ek}/src/main.c (81%) delete mode 100644 samples/shields/npm13xx_ek/CMakeLists.txt delete mode 100644 samples/shields/npm13xx_ek/boards/nrf52dk_nrf52832.overlay delete mode 100644 samples/shields/npm13xx_ek/doc/index.rst delete mode 100644 samples/shields/npm13xx_ek/npm1304.overlay delete mode 100644 samples/shields/npm13xx_ek/sample.yaml diff --git a/boards/shields/npm1300_ek/doc/index.rst b/boards/shields/npm1300_ek/doc/index.rst index 5193523dde8..816c31a5fff 100644 --- a/boards/shields/npm1300_ek/doc/index.rst +++ b/boards/shields/npm1300_ek/doc/index.rst @@ -22,5 +22,10 @@ Usage ***** The shield can be used in any application by setting ``--shield npm1300_ek`` -when invoking ``west build``. You can check :zephyr:code-sample:`npm13xx_ek` for a +when invoking ``west build``. You can check :zephyr:code-sample:`npm1300_ek` for a comprehensive sample. + +References +********** + +TBC diff --git a/boards/shields/npm1304_ek/Kconfig.shield b/boards/shields/npm1304_ek/Kconfig.shield deleted file mode 100644 index d86b2525d1c..00000000000 --- a/boards/shields/npm1304_ek/Kconfig.shield +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config SHIELD_NPM1304_EK - def_bool $(shields_list_contains,npm1304_ek) diff --git a/boards/shields/npm1304_ek/doc/index.rst b/boards/shields/npm1304_ek/doc/index.rst deleted file mode 100644 index 2c47ed1ffd6..00000000000 --- a/boards/shields/npm1304_ek/doc/index.rst +++ /dev/null @@ -1,30 +0,0 @@ -.. _npm1304_ek: - -nPM1304 EK -########## - -Overview -******** - -The nPM1304 EK lets you test different functions and features of the nPM1304 -Power Management Integrated Circuit (PMIC). - -Requirements -************ - -The nPM1304 EK board is not a direct fit into an Arduino connector. However, -the Zephyr shield is expected to be connected to the Arduino shield connectors. -That is, you need to connect the I2C lines to the ``arduino_i2c`` bus. This allows to -use the shield with any host board that supports the Arduino connector. - -Usage -***** - -To use the shield in any application, build it with the following command: - -.. zephyr-app-commands:: - :board: your_board - :shield: npm1304_ek - :goals: build - -For a comprehensive sample, refer to :zephyr:code-sample:`npm13xx_ek`. diff --git a/boards/shields/npm1304_ek/npm1304_ek.overlay b/boards/shields/npm1304_ek/npm1304_ek.overlay deleted file mode 100644 index 37e6961c5fd..00000000000 --- a/boards/shields/npm1304_ek/npm1304_ek.overlay +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -&arduino_i2c { - npm1304_ek_pmic: pmic@6b { - compatible = "nordic,npm1304"; - reg = <0x6b>; - - npm1304_ek_gpio: gpio-controller { - compatible = "nordic,npm1304-gpio"; - gpio-controller; - #gpio-cells = <2>; - ngpios = <5>; - }; - - npm1304_ek_regulators: regulators { - compatible = "nordic,npm1304-regulator"; - - /* limits are set to min/max allowed values */ - npm1304_ek_buck1: BUCK1 { - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <3300000>; - }; - - npm1304_ek_buck2: BUCK2 { - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <3300000>; - }; - - npm1304_ek_ldo1: LDO1 { - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <3300000>; - }; - - npm1304_ek_ldo2: LDO2 { - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <3300000>; - }; - }; - - npm1304_ek_charger: charger { - compatible = "nordic,npm1304-charger"; - term-microvolt = <4150000>; - term-warm-microvolt = <4000000>; - current-microamp = <4000>; - vbus-limit-microamp = <500000>; - thermistor-ohms = <10000>; - thermistor-beta = <3380>; - charging-enable; - }; - - npm1304_ek_buttons: buttons { - compatible = "gpio-keys"; - - pmic_button0: pmic_button_0 { - gpios = <&npm1304_ek_gpio 0 GPIO_ACTIVE_LOW>; - label = "Pmic button switch 0"; - zephyr,code = ; - }; - - pmic_button1: pmic_button_1 { - gpios = <&npm1304_ek_gpio 1 GPIO_ACTIVE_LOW>; - label = "Pmic button switch 1"; - zephyr,code = ; - }; - - pmic_button2: pmic_button_2 { - gpios = <&npm1304_ek_gpio 2 GPIO_ACTIVE_LOW>; - label = "Pmic button switch 2"; - zephyr,code = ; - }; - }; - - npm1304_ek_leds: leds { - compatible = "nordic,npm1304-led"; - nordic,led0-mode = "error"; - nordic,led1-mode = "charging"; - nordic,led2-mode = "host"; - }; - }; -}; diff --git a/boards/shields/npm1304_ek/shield.yml b/boards/shields/npm1304_ek/shield.yml deleted file mode 100644 index 88e19fb84be..00000000000 --- a/boards/shields/npm1304_ek/shield.yml +++ /dev/null @@ -1,11 +0,0 @@ -shield: - name: npm1304_ek - full_name: nPM1304 EK - vendor: nordic - supported_features: - - mfd - - input - - gpio - - led - - regulator - - sensor diff --git a/doc/_scripts/redirects.py b/doc/_scripts/redirects.py index ba7525fbdb0..1c1e9e29942 100644 --- a/doc/_scripts/redirects.py +++ b/doc/_scripts/redirects.py @@ -302,7 +302,6 @@ ('samples/sensor/max44009/README', 'samples/sensor/light_polling/README'), ('samples/sensor/wsen_hids/README', 'samples/sensor/sensor'), ('samples/sensor/wsen_itds/README', 'samples/sensor/sensor'), - ('samples/shields/npm1300_ek/doc/index', 'samples/shields/npm13xx_ek/doc/index'), ('samples/subsys/video/capture/README', 'samples/drivers/video/capture/README'), ('samples/subsys/video/tcpserversink/README', 'samples/drivers/video/tcpserversink/README'), ('samples/subsys/video/video', 'samples/drivers/video/video'), diff --git a/samples/shields/npm1300_ek/CMakeLists.txt b/samples/shields/npm1300_ek/CMakeLists.txt new file mode 100644 index 00000000000..09e4de1cc52 --- /dev/null +++ b/samples/shields/npm1300_ek/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2023 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +set(SHIELD npm1300_ek) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(npm1300_ek) +target_sources(app PRIVATE src/main.c) diff --git a/samples/shields/npm1300_ek/doc/index.rst b/samples/shields/npm1300_ek/doc/index.rst new file mode 100644 index 00000000000..be2e8db34cf --- /dev/null +++ b/samples/shields/npm1300_ek/doc/index.rst @@ -0,0 +1,71 @@ +.. zephyr:code-sample:: npm1300_ek + :name: nPM1300 EK + + Interact with the nPM1300 PMIC using the shell interface. + +Overview +******** + +This sample is provided for evaluation of the :ref:`npm1300_ek`. +The sample provides a shell interface to support the features of the +nPM1300 PMIC, including: + +- Regulators (BUCK1/2, LDO1/2) +- GPIO + +Requirements +************ + +The shield needs to be wired to a host board supporting the Arduino connector. + +Examples and images to follow + +Building and Running +******************** + +The sample is designed so that it can run on any platform. For example, when +building for the nRF52 DK, the following command can be used: + +.. zephyr-app-commands:: + :zephyr-app: samples/shields/npm1300_ek + :board: nrf52dk/nrf52832 + :goals: build + :compact: + +Note that this sample automatically sets ``SHIELD`` to ``npm1300_ek``. Once +flashed, you should boot into the shell interface. The ``regulator`` command is +provided to test the PMIC. Below you can find details for each subcommand. + +Regulators +========== + +The ``regulator`` shell interface provides several subcommand to test +the regulators embedded in the PMIC. Below you can find some command examples. + +.. code-block:: bash + + # list all the supported voltages by BUCK1 + regulator vlist BUCK1 + 1.000 V + 1.100 V + ... + +.. code-block:: bash + + # enable BUCK2 + regulator enable BUCK2 + # disable BUCK2 + regulator disable BUCK2 + +.. code-block:: bash + + # set BUCK2 voltage to exactly 2V + regulator vset BUCK2 2V + # obtain the actual BUCK1 configured voltage + regulator vget BUCK1 + 1.800 V + # set BUCK1 voltage to a value between 2.35V and 2.45V + regulator set BUCK1 2.35V 2.45V + # obtain the actual BUCK1 configured voltage + regulator get BUCK1 + 2.400 V diff --git a/samples/shields/npm13xx_ek/npm1300.overlay b/samples/shields/npm1300_ek/nrf52dk_nrf52832.overlay similarity index 88% rename from samples/shields/npm13xx_ek/npm1300.overlay rename to samples/shields/npm1300_ek/nrf52dk_nrf52832.overlay index 408c1b8715d..e4f2cca20ce 100644 --- a/samples/shields/npm13xx_ek/npm1300.overlay +++ b/samples/shields/npm1300_ek/nrf52dk_nrf52832.overlay @@ -1,7 +1,12 @@ /* - * Copyright (C) 2025 Nordic Semiconductor ASA + * Copyright (C) 2023 Nordic Semiconductor ASA * SPDX-License-Identifier: Apache-2.0 */ + &i2c0_default { + group1 { + bias-pull-up; + }; +}; &npm1300_ek_regulators { dvs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>, diff --git a/samples/shields/npm13xx_ek/prj.conf b/samples/shields/npm1300_ek/prj.conf similarity index 100% rename from samples/shields/npm13xx_ek/prj.conf rename to samples/shields/npm1300_ek/prj.conf diff --git a/samples/shields/npm1300_ek/sample.yaml b/samples/shields/npm1300_ek/sample.yaml new file mode 100644 index 00000000000..de89e80d79e --- /dev/null +++ b/samples/shields/npm1300_ek/sample.yaml @@ -0,0 +1,12 @@ +# Copyright (c) 2023 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +sample: + name: nPM1300 EK +tests: + sample.shields.npm1300_ek: + platform_allow: nrf52dk/nrf52832 + harness: shield + tags: shield + extra_args: SHIELD=npm1300_ek + depends_on: arduino_i2c diff --git a/samples/shields/npm13xx_ek/src/main.c b/samples/shields/npm1300_ek/src/main.c similarity index 81% rename from samples/shields/npm13xx_ek/src/main.c rename to samples/shields/npm1300_ek/src/main.c index 0473c566235..9ecffb69e21 100644 --- a/samples/shields/npm13xx_ek/src/main.c +++ b/samples/shields/npm1300_ek/src/main.c @@ -19,25 +19,15 @@ #define SLEEP_TIME_MS 100 #define UPDATE_TIME_MS 2000 -#if CONFIG_SHIELD_NPM1300_EK -#define SHIELD_LABEL(component) DT_NODELABEL(npm1300_ek_ ## component) -#elif CONFIG_SHIELD_NPM1304_EK -#define SHIELD_LABEL(component) DT_NODELABEL(npm1304_ek_ ## component) -#else -#error "either npm1300_ek or npm1304_ek shield should be selected" -#endif - -#define NPM13XX_DEVICE(dev) DEVICE_DT_GET(SHIELD_LABEL(dev)) - static const struct gpio_dt_spec button1 = GPIO_DT_SPEC_GET(DT_ALIAS(sw0), gpios); -static const struct device *regulators = NPM13XX_DEVICE(regulators); +static const struct device *regulators = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_regulators)); -static const struct device *charger = NPM13XX_DEVICE(charger); +static const struct device *charger = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_charger)); -static const struct device *leds = NPM13XX_DEVICE(leds); +static const struct device *leds = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_leds)); -static const struct device *pmic = NPM13XX_DEVICE(pmic); +static const struct device *pmic = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_pmic)); void configure_ui(void) { @@ -63,14 +53,9 @@ void configure_ui(void) } } -static void event_callback(const struct device *dev, struct gpio_callback *cb, uint32_t events) +static void event_callback(const struct device *dev, struct gpio_callback *cb, uint32_t pins) { - if (events & BIT(NPM13XX_EVENT_SHIPHOLD_PRESS)) { - printk("SHPHLD pressed\n"); - } - if (events & BIT(NPM13XX_EVENT_SHIPHOLD_RELEASE)) { - printk("SHPHLD released\n"); - } + printk("Event detected\n"); } void configure_events(void) @@ -83,8 +68,7 @@ void configure_events(void) /* Setup callback for shiphold button press */ static struct gpio_callback event_cb; - gpio_init_callback(&event_cb, event_callback, BIT(NPM13XX_EVENT_SHIPHOLD_PRESS) | - BIT(NPM13XX_EVENT_SHIPHOLD_RELEASE)); + gpio_init_callback(&event_cb, event_callback, BIT(NPM13XX_EVENT_SHIPHOLD_PRESS)); mfd_npm13xx_add_callback(pmic, &event_cb); } diff --git a/samples/shields/npm13xx_ek/CMakeLists.txt b/samples/shields/npm13xx_ek/CMakeLists.txt deleted file mode 100644 index f3432a12e0b..00000000000 --- a/samples/shields/npm13xx_ek/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) - -if(SHIELD STREQUAL "npm1300_ek") - set(EXTRA_DTC_OVERLAY_FILE npm1300.overlay) -elseif(SHIELD STREQUAL "npm1304_ek") - set(EXTRA_DTC_OVERLAY_FILE npm1304.overlay) -else() - message(FATAL_ERROR "either npm1300_ek or npm1304_ek must be selected with --shield") -endif() - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) - -project(npm13xx_ek) -target_sources(app PRIVATE src/main.c) diff --git a/samples/shields/npm13xx_ek/boards/nrf52dk_nrf52832.overlay b/samples/shields/npm13xx_ek/boards/nrf52dk_nrf52832.overlay deleted file mode 100644 index 14a68cf7912..00000000000 --- a/samples/shields/npm13xx_ek/boards/nrf52dk_nrf52832.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (C) 2023 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&i2c0_default { - group1 { - bias-pull-up; - }; -}; diff --git a/samples/shields/npm13xx_ek/doc/index.rst b/samples/shields/npm13xx_ek/doc/index.rst deleted file mode 100644 index 892e5f45a65..00000000000 --- a/samples/shields/npm13xx_ek/doc/index.rst +++ /dev/null @@ -1,110 +0,0 @@ -.. zephyr:code-sample:: npm13xx_ek - :name: nPM13xx EK - - Interact with an nPM1300 or nPM1304 PMIC using the shell interface and buttons. - -Overview -******** - -This sample is provided for evaluation of :ref:`npm1300_ek` and :ref:`npm1304_ek`. The sample -demonstrates use of Dynamic Voltage Scaling (DVS) regulator API feature which allows to switch -between chosen voltage levels or regulator modes by toggling configured GPIOs with a single -regulator API call. - -It also provides a shell interface to support the features of the nPM1300 and nPM1304 PMICs, -including: - -- Regulators (BUCK1/2, LDO1/2) -- GPIO - -Requirements -************ - -The shield needs to be wired to a host board featuring the Arduino I2C connector. PMIC's GPIO3 acts -as an interrupt output, pins GPIO1 and GPIO2 are configured to control regulator modes (controlled -by the MCU software through DVS). - -In addition, PMIC's VDDIO pin should be connected to an appropriate voltage reference. - -E.g. for an nRF52 Series DK the wiring is as follows: - - +------------------+-------+-------+-------+-------+-------+-------+-----+ - | nPM13xx EK pins | SDA | SCL | GPIO1 | GPIO2 | GPIO3 | VDDIO | GND | - +------------------+-------+-------+-------+-------+-------+-------+-----+ - | nRF52 DK pins | P0.26 | P0.27 | P0.17 | P0.18 | P0.22 | VDD | GND | - +------------------+-------+-------+-------+-------+-------+-------+-----+ - -Building and Running -******************** - -The sample is designed so that it can run on any platform (references to host GPIOs connected to -the nPM13xx EK need to be updated in the ``npm13xx.overlay`` files to reflect chosen HW). - -For example, when building for the nRF52 DK and the nPM1300 EK, the following command can be used: - -.. zephyr-app-commands:: - :zephyr-app: samples/shields/npm13xx_ek - :board: nrf52dk/nrf52832 - :shield: npm1300_ek - :goals: build - :compact: - -Testing -******* - -After flashing the sample FW, you need to connect to the shell interface, where in case of -successful initialization you will see the nPM13xx PMIC status messages containing charger status -and battery voltage, current and temperature. Pressing and releasing the SHPHLD button on the EK -will generate interrupts and these events will also be printed in the shell. - -Pressing a dedicated button on the host DK (Button 1 on an nRF52 Series DK) will cycle DVS states. - - +-------------------------------------+----------------+---------------+---------------+ - | **DVS state** (GPIO1 | GPIO2 level) | **BUCK2 mode** | **LDO1 mode** | **LDO2 mode** | - +-------------------------------------+----------------+---------------+---------------+ - | **0** (HIGH | HIGH) | OFF | OFF | OFF | - +-------------------------------------+----------------+---------------+---------------+ - | **1** (LOW | HIGH) | ON retention | OFF | OFF | - +-------------------------------------+----------------+---------------+---------------+ - | **2** (HIGH | LOW) | OFF | ON | ON | - +-------------------------------------+----------------+---------------+---------------+ - | **3** (LOW | LOW) | ON PWM | ON | ON | - +-------------------------------------+----------------+---------------+---------------+ - -.. note:: - On an nRF52 Series DK, DVS pins are also used for the onboard LED1 and LED2, so you can observe - the DVS state pins visually: an LED lights up when the respective pin is LOW - -Regulators -********** - -The ``regulator`` shell interface provides several subcommand to test -the regulators embedded in the PMIC. Below you can find some command examples. - -.. code-block:: console - - # list all the supported voltages by BUCK1 - uart:~$ regulator vlist BUCK1 - 1.000 V - 1.100 V - ... - -.. code-block:: console - - # enable BUCK2 - uart:~$ regulator enable BUCK2 - # disable BUCK2 - uart:~$ regulator disable BUCK2 - -.. code-block:: console - - # set BUCK2 voltage to exactly 2V - uart:~$ regulator vset BUCK2 2V - # obtain the actual BUCK1 configured voltage - uart:~$ regulator vget BUCK1 - 1.800 V - # set BUCK1 voltage to a value between 2.35V and 2.45V - uart:~$ regulator set BUCK1 2.35V 2.45V - # obtain the actual BUCK1 configured voltage - uart:~$ regulator get BUCK1 - 2.400 V diff --git a/samples/shields/npm13xx_ek/npm1304.overlay b/samples/shields/npm13xx_ek/npm1304.overlay deleted file mode 100644 index 010c7d4897a..00000000000 --- a/samples/shields/npm13xx_ek/npm1304.overlay +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&npm1304_ek_regulators { - dvs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>, - <&gpio0 18 GPIO_ACTIVE_LOW>; -}; - -&npm1304_ek_buck1 { - regulator-init-microvolt = <2000000>; -}; - -&npm1304_ek_buck2 { - regulator-init-microvolt = <3300000>; - retention-microvolt = <2500000>; - enable-gpio-config = <1 GPIO_ACTIVE_LOW>; - retention-gpio-config = <2 GPIO_ACTIVE_HIGH>; - pwm-gpio-config = <2 GPIO_ACTIVE_LOW>; -}; - -&npm1304_ek_ldo1 { - regulator-initial-mode = ; - enable-gpio-config = <2 GPIO_ACTIVE_LOW>; -}; - -&npm1304_ek_ldo2 { - regulator-initial-mode = ; - enable-gpio-config = <2 GPIO_ACTIVE_LOW>; -}; - -&npm1304_ek_pmic { - host-int-gpios = <&gpio0 22 0>; - pmic-int-pin = <3>; -}; diff --git a/samples/shields/npm13xx_ek/sample.yaml b/samples/shields/npm13xx_ek/sample.yaml deleted file mode 100644 index 98c68d54e32..00000000000 --- a/samples/shields/npm13xx_ek/sample.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -sample: - name: nPM13xx EK -common: - platform_allow: nrf52dk/nrf52832 - depends_on: arduino_i2c - tags: - - shield - - regulator - - sensor -tests: - sample.shields.npm1300_ek: - extra_args: SHIELD=npm1300_ek - sample.shields.npm1304_ek: - extra_args: SHIELD=npm1304_ek From cbf417726ac69de08f0ca2a6cfac7e35e7fc1159 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 357/881] Revert "[nrf fromtree] samples: fs: fs_sample: Fix nrf54l15 dts overlay files" This reverts commit 1e7c322c576ac40b778665b12e7560eaebecd125. Signed-off-by: Jukka Rissanen --- .../fs/fs_sample/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay | 2 ++ .../fs/fs_sample/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay | 2 ++ .../fs/fs_sample/boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 3 ++- .../fs/fs_sample/boards/ophelia4ev_nrf54l15_cpuapp.overlay | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/samples/subsys/fs/fs_sample/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/samples/subsys/fs/fs_sample/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay index 5a063e3b862..2311a039702 100644 --- a/samples/subsys/fs/fs_sample/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ b/samples/subsys/fs/fs_sample/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -11,6 +11,8 @@ */ /delete-node/ &slot0_partition; /delete-node/ &slot1_partition; +/delete-node/ &slot0_ns_partition; +/delete-node/ &slot1_ns_partition; /delete-node/ &storage_partition; &cpuapp_rram { diff --git a/samples/subsys/fs/fs_sample/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/samples/subsys/fs/fs_sample/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay index 5a063e3b862..2311a039702 100644 --- a/samples/subsys/fs/fs_sample/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ b/samples/subsys/fs/fs_sample/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -11,6 +11,8 @@ */ /delete-node/ &slot0_partition; /delete-node/ &slot1_partition; +/delete-node/ &slot0_ns_partition; +/delete-node/ &slot1_ns_partition; /delete-node/ &storage_partition; &cpuapp_rram { diff --git a/samples/subsys/fs/fs_sample/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/subsys/fs/fs_sample/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index b7544821893..391afea75a4 100644 --- a/samples/subsys/fs/fs_sample/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/samples/subsys/fs/fs_sample/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -10,6 +10,8 @@ */ /delete-node/ &slot0_partition; /delete-node/ &slot1_partition; +/delete-node/ &slot0_ns_partition; +/delete-node/ &slot1_ns_partition; /delete-node/ &storage_partition; &cpuapp_rram { @@ -21,7 +23,6 @@ slot0_partition: parition@10000 { reg = <0x00010000 DT_SIZE_K(300)>; }; - slot1_partition: partition@5b000 { reg = <0x0005b000 DT_SIZE_K(300)>; }; diff --git a/samples/subsys/fs/fs_sample/boards/ophelia4ev_nrf54l15_cpuapp.overlay b/samples/subsys/fs/fs_sample/boards/ophelia4ev_nrf54l15_cpuapp.overlay index 339c971683a..da13128938a 100644 --- a/samples/subsys/fs/fs_sample/boards/ophelia4ev_nrf54l15_cpuapp.overlay +++ b/samples/subsys/fs/fs_sample/boards/ophelia4ev_nrf54l15_cpuapp.overlay @@ -10,6 +10,8 @@ */ /delete-node/ &slot0_partition; /delete-node/ &slot1_partition; +/delete-node/ &slot0_ns_partition; +/delete-node/ &slot1_ns_partition; /delete-node/ &storage_partition; &cpuapp_rram { From 8de2bb576842708cad289b8d79df3fd508c468ac Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 358/881] Revert "[nrf fromtree] boards: nordic: nrf54l05: Change to use common dts partitioning file" This reverts commit c49eabe0283c50d6f00e952ec298d3e2d3ac4435. Signed-off-by: Jukka Rissanen --- .../nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.dts | 44 ++++++++++++++++++- .../nrf54l15dk_nrf54l05_cpuapp.yaml | 2 +- dts/vendor/nordic/nrf54l05_partition.dtsi | 38 ---------------- 3 files changed, 43 insertions(+), 41 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l05_partition.dtsi diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.dts index 2c30c727005..23ae87ccb11 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.dts @@ -25,5 +25,45 @@ ranges = <0x0 0x20000000 DT_SIZE_K(96)>; }; -/* Include default memory partition configuration file */ -#include +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(500)>; +}; + +/* These partition sizes assume no FLPR area in RRAM */ +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(100)>; + }; + + slot0_ns_partition: partition@29000 { + label = "image-0-nonsecure"; + reg = <0x29000 DT_SIZE_K(100)>; + }; + + slot1_partition: partition@42000 { + label = "image-1"; + reg = <0x42000 DT_SIZE_K(100)>; + }; + + slot1_ns_partition: partition@5b000 { + label = "image-1-nonsecure"; + reg = <0x5b000 DT_SIZE_K(100)>; + }; + + storage_partition: partition@74000 { + label = "storage"; + reg = <0x74000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.yaml index cda8efcd610..2a41fbf2ca1 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l05_cpuapp.yaml @@ -10,7 +10,7 @@ toolchain: - zephyr sysbuild: true ram: 96 -flash: 500 +flash: 100 supported: - adc - counter diff --git a/dts/vendor/nordic/nrf54l05_partition.dtsi b/dts/vendor/nordic/nrf54l05_partition.dtsi deleted file mode 100644 index aa2ea04bce0..00000000000 --- a/dts/vendor/nordic/nrf54l05_partition.dtsi +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(500)>; -}; - -/* These partition sizes assume no FLPR area in RRAM */ -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(200)>; - }; - - slot1_partition: partition@42000 { - label = "image-1"; - reg = <0x42000 DT_SIZE_K(200)>; - }; - - storage_partition: partition@74000 { - label = "storage"; - reg = <0x74000 DT_SIZE_K(36)>; - }; - }; -}; From b8937310ef78214e3c363fd915255f2793d69e92 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 359/881] Revert "[nrf fromtree] boards: nordic: nrf54l15_ns: Change to use common dts partitioning file" This reverts commit 02d21dd590dbb7439d999f0bdb05ec76a9df6927. Signed-off-by: Jukka Rissanen --- .../bl54l15_dvk_nrf54l15_cpuapp_ns.dts | 48 +++++++++++++- .../bl54l15u_dvk_nrf54l15_cpuapp_ns.dts | 48 +++++++++++++- .../nrf54l15dk_nrf54l15_cpuapp_ns.dts | 48 +++++++++++++- .../panb511evb_nrf54l15_cpuapp_ns.dts | 48 +++++++++++++- .../raytac_an54l15q_db_nrf54l15_cpuapp_ns.dts | 48 +++++++++++++- dts/vendor/nordic/nrf54l15_ns_partition.dtsi | 62 ------------------- 6 files changed, 225 insertions(+), 77 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l15_ns_partition.dtsi diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.dts index bca01b2b062..38712ba7074 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.dts +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.dts @@ -58,6 +58,51 @@ }; }; +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54L15 has 1524 kB of non volatile memory (RRAM) but the + * last 96kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8A000 { + label = "image-0-nonsecure"; + reg = <0x0008A000 DT_SIZE_K(844)>; + }; + + storage_partition: partition@15D000 { + label = "storage"; + reg = <0x00015D000 DT_SIZE_K(32)>; + }; + }; +}; + &uart30 { /* Disable so that TF-M can use this UART */ status = "disabled"; @@ -67,6 +112,3 @@ pinctrl-1 = <&uart30_sleep>; pinctrl-names = "default", "sleep"; }; - -/* Include default memory partition configuration file */ -#include diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.dts b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.dts index 6530b554d34..f03eb6a5e81 100644 --- a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.dts +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.dts @@ -58,6 +58,51 @@ }; }; +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54L15 has 1524 kB of non volatile memory (RRAM) but the + * last 96kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8A000 { + label = "image-0-nonsecure"; + reg = <0x0008A000 DT_SIZE_K(844)>; + }; + + storage_partition: partition@15D000 { + label = "storage"; + reg = <0x00015D000 DT_SIZE_K(32)>; + }; + }; +}; + &uart30 { /* Disable so that TF-M can use this UART */ status = "disabled"; @@ -67,6 +112,3 @@ pinctrl-1 = <&uart30_sleep>; pinctrl-names = "default", "sleep"; }; - -/* Include default memory partition configuration file */ -#include diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.dts index f78a1f864e2..3a7ca70eaed 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.dts @@ -57,6 +57,51 @@ }; }; +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54L15 has 1524 kB of non volatile memory (RRAM) but the + * last 96kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8A000 { + label = "image-0-nonsecure"; + reg = <0x0008A000 DT_SIZE_K(844)>; + }; + + storage_partition: partition@15D000 { + label = "storage"; + reg = <0x00015D000 DT_SIZE_K(32)>; + }; + }; +}; + &uart30 { /* Disable so that TF-M can use this UART */ status = "disabled"; @@ -66,6 +111,3 @@ pinctrl-1 = <&uart30_sleep>; pinctrl-names = "default", "sleep"; }; - -/* Include default memory partition configuration file */ -#include diff --git a/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp_ns.dts b/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp_ns.dts index 4f5ea303316..f4aeab933f8 100644 --- a/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp_ns.dts +++ b/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp_ns.dts @@ -57,6 +57,51 @@ }; }; +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54L15 has 1524 kB of non volatile memory (RRAM) but the + * last 96kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8A000 { + label = "image-0-nonsecure"; + reg = <0x0008A000 DT_SIZE_K(844)>; + }; + + storage_partition: partition@15D000 { + label = "storage"; + reg = <0x00015D000 DT_SIZE_K(32)>; + }; + }; +}; + &uart20 { /* Disable so that TF-M can use this UART */ status = "disabled"; @@ -66,6 +111,3 @@ pinctrl-1 = <&uart20_sleep>; pinctrl-names = "default", "sleep"; }; - -/* Include default memory partition configuration file */ -#include diff --git a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns.dts b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns.dts index d6395d7fd71..db7a01aead8 100644 --- a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns.dts +++ b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns.dts @@ -58,6 +58,51 @@ }; }; +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54L15 has 1524 kB of non volatile memory (RRAM) but the + * last 96kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8A000 { + label = "image-0-nonsecure"; + reg = <0x0008A000 DT_SIZE_K(844)>; + }; + + storage_partition: partition@15D000 { + label = "storage"; + reg = <0x00015D000 DT_SIZE_K(32)>; + }; + }; +}; + &uart30 { /* Disable so that TF-M can use this UART */ status = "disabled"; @@ -66,6 +111,3 @@ pinctrl-1 = <&uart30_sleep>; pinctrl-names = "default", "sleep"; }; - -/* Include default memory partition configuration file */ -#include diff --git a/dts/vendor/nordic/nrf54l15_ns_partition.dtsi b/dts/vendor/nordic/nrf54l15_ns_partition.dtsi deleted file mode 100644 index ac15dc79f33..00000000000 --- a/dts/vendor/nordic/nrf54l15_ns_partition.dtsi +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuapp_rram { - /* - * Default NVM layout on NRF54L15 Application MCU without BL2: - * This layout matches (by necessity) that in the TF-M repository: - * - * 0x0000_0000 Secure image primary (512 KB) - * 0x0008_0000 Protected Storage Area (16 KB) - * 0x0008_4000 Internal Trusted Storage Area (16 KB) - * 0x0008_8000 OTP / NV counters area (8 KB) - * 0x0008_A000 Non-secure image primary (844 KB) - * 0x0015_D000 Non-secure storage, used when built with NRF_NS_STORAGE=ON, - * otherwise unused (32 KB) - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - /* nRF54L15 has 1524 kB of non volatile memory (RRAM) but the - * last 96kB are reserved for the FLPR MCU. - * - * This static layout needs to be the same with the upstream TF-M layout in the - * header flash_layout.h of the relevant platform. Any updates in the layout - * needs to happen both in the flash_layout.h and in this file at the same time. - */ - slot0_partition: partition@0 { - label = "image-0"; - reg = <0x0000000 DT_SIZE_K(512)>; - }; - - tfm_ps_partition: partition@80000 { - label = "tfm-ps"; - reg = <0x00080000 DT_SIZE_K(16)>; - }; - - tfm_its_partition: partition@84000 { - label = "tfm-its"; - reg = <0x00084000 DT_SIZE_K(16)>; - }; - - tfm_otp_partition: partition@88000 { - label = "tfm-otp"; - reg = <0x00088000 DT_SIZE_K(8)>; - }; - - slot0_ns_partition: partition@8A000 { - label = "image-0-nonsecure"; - reg = <0x0008A000 DT_SIZE_K(844)>; - }; - - storage_partition: partition@15D000 { - label = "storage"; - reg = <0x00015D000 DT_SIZE_K(32)>; - }; - }; -}; From 09f5ce96e9fd4c0a8c66323a594beed029899591 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 360/881] Revert "[nrf fromtree] boards: nordic: nrf54l15: Change to use common dts partitioning file" This reverts commit a72fadce3c365308402894aea22c83bf96226157. Signed-off-by: Jukka Rissanen --- .../bl54l15_dvk_nrf54l15_cpuapp.dts | 40 ++++++++++++++++- .../bl54l15_dvk_nrf54l15_cpuapp.yaml | 2 +- .../bl54l15u_dvk_nrf54l15_cpuapp.dts | 40 ++++++++++++++++- .../bl54l15u_dvk_nrf54l15_cpuapp.yaml | 2 +- .../nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts | 41 +++++++++++++++++- .../nrf54l15dk_nrf54l15_cpuapp.yaml | 2 +- .../panb511evb/panb511evb_nrf54l15_cpuapp.dts | 40 ++++++++++++++++- .../panb511evb_nrf54l15_cpuapp.yaml | 2 +- .../raytac_an54l15q_db_nrf54l15_cpuapp.dts | 40 ++++++++++++++++- .../raytac_an54l15q_db_nrf54l15_cpuapp.yaml | 2 +- .../ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts | 43 +++++++++++++++++-- .../ophelia4ev_nrf54l15_cpuapp.yaml | 2 +- dts/vendor/nordic/nrf54l15_partition.dtsi | 33 -------------- 13 files changed, 237 insertions(+), 52 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l15_partition.dtsi diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.dts index 50a03e2d48f..ef92bda9930 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.dts +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.dts @@ -20,5 +20,41 @@ }; }; -/* Include default memory partition configuration file */ -#include +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.yaml b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.yaml index 066929a10a6..abcf0f54482 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.yaml +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.yaml @@ -11,7 +11,7 @@ toolchain: - zephyr sysbuild: true ram: 188 -flash: 1428 +flash: 324 supported: - adc - counter diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.dts b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.dts index 00ffc3f5449..7ea5099aa3f 100644 --- a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.dts +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.dts @@ -20,5 +20,41 @@ }; }; -/* Include default memory partition configuration file */ -#include +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.yaml b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.yaml index d210534c8b5..264368c2baf 100644 --- a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.yaml +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.yaml @@ -11,7 +11,7 @@ toolchain: - zephyr sysbuild: true ram: 188 -flash: 1428 +flash: 324 supported: - adc - counter diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts index 6e662902561..b2d96daa192 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts @@ -19,5 +19,42 @@ }; }; -/* Include default memory partition configuration file */ -#include +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml index e23a2a0073a..3fbfefe01a3 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml @@ -10,7 +10,7 @@ toolchain: - zephyr sysbuild: true ram: 188 -flash: 1428 +flash: 324 supported: - adc - counter diff --git a/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp.dts b/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp.dts index 04616affd14..c79847a3b57 100644 --- a/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp.dts +++ b/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp.dts @@ -19,5 +19,41 @@ }; }; -/* Include default memory partition configuration file */ -#include +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp.yaml b/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp.yaml index db252d56047..e911ee9e54c 100644 --- a/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp.yaml +++ b/boards/panasonic/panb511evb/panb511evb_nrf54l15_cpuapp.yaml @@ -10,7 +10,7 @@ toolchain: - zephyr sysbuild: true ram: 188 -flash: 1428 +flash: 324 supported: - adc - counter diff --git a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp.dts b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp.dts index d347ef16ac1..d9362a6ddb0 100644 --- a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp.dts +++ b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp.dts @@ -21,5 +21,41 @@ }; }; -/* Include default memory partition configuration file */ -#include +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp.yaml b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp.yaml index 7a5e9a84f96..4e3b9067475 100644 --- a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp.yaml +++ b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp.yaml @@ -12,7 +12,7 @@ toolchain: - zephyr sysbuild: true ram: 188 -flash: 1428 +flash: 324 supported: - adc - counter diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts index 2380fcd5b8d..73b135891a8 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts @@ -26,6 +26,46 @@ }; }; +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; + &cpuapp_sram { status = "okay"; }; @@ -132,6 +172,3 @@ &adc { status = "okay"; }; - -/* Include default memory partition configuration file */ -#include diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.yaml b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.yaml index 6e8bd507277..87fee9c3d62 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.yaml +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.yaml @@ -10,7 +10,7 @@ toolchain: - zephyr sysbuild: true ram: 188 -flash: 1428 +flash: 324 supported: - adc - counter diff --git a/dts/vendor/nordic/nrf54l15_partition.dtsi b/dts/vendor/nordic/nrf54l15_partition.dtsi deleted file mode 100644 index 4988de3ed54..00000000000 --- a/dts/vendor/nordic/nrf54l15_partition.dtsi +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(664)>; - }; - - slot1_partition: partition@b6000 { - label = "image-1"; - reg = <0xb6000 DT_SIZE_K(664)>; - }; - - storage_partition: partition@15c000 { - label = "storage"; - reg = <0x15c000 DT_SIZE_K(36)>; - }; - }; -}; From ec38b5cda07c46369223d0809653448fbb510884 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 361/881] Revert "[nrf fromtree] boards: nordic: nrf54l10_cpuapp_ns: Add workaround for partitions" This reverts commit db3708451536f016792c7e6bd7ec2002b956a068. Signed-off-by: Jukka Rissanen --- boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.dts | 3 --- boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns.dts | 3 --- 2 files changed, 6 deletions(-) diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.dts index 39a986ae2b6..02d900390cc 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.dts +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.dts @@ -59,9 +59,6 @@ }; &cpuapp_rram { - /* TODO: revert this hack when TF-M update is available that fixes partition sizes */ - reg = <0x0 DT_SIZE_K(1022)>; - partitions { compatible = "fixed-partitions"; #address-cells = <1>; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns.dts index cd644d845d5..f1aa851ed2d 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns.dts @@ -58,9 +58,6 @@ }; &cpuapp_rram { - /* TODO: revert this hack when TF-M update is available that fixes partition sizes */ - reg = <0x0 DT_SIZE_K(1022)>; - partitions { compatible = "fixed-partitions"; #address-cells = <1>; From 1fc03de75ab058baacbb214478c09eeadec8e733 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 362/881] Revert "[nrf fromtree] boards: nordic: nrf54l10: Change to use common dts partitioning file" This reverts commit 9e518534b01e8d2829a3db4baed5fad0a862a479. Signed-off-by: Jukka Rissanen --- .../bl54l15_dvk_nrf54l10_cpuapp.dts | 48 ++++++++++++++++++- .../bl54l15_dvk_nrf54l10_cpuapp.yaml | 2 +- .../nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.dts | 48 ++++++++++++++++++- .../nrf54l15dk_nrf54l10_cpuapp.yaml | 2 +- dts/vendor/nordic/nrf54l10_partition.dtsi | 38 --------------- 5 files changed, 94 insertions(+), 44 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l10_partition.dtsi diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.dts index 0654c4139c5..3d9336bbeab 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.dts +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.dts @@ -26,5 +26,49 @@ ranges = <0x0 0x20000000 DT_SIZE_K(192)>; }; -/* Include default memory partition configuration file */ -#include +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1022)>; +}; + +/* These partition sizes assume no FLPR area in RRAM */ +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(224)>; + }; + + slot0_ns_partition: partition@48000 { + label = "image-0-nonsecure"; + reg = <0x48000 DT_SIZE_K(224)>; + }; + + slot1_partition: partition@80000 { + label = "image-1"; + reg = <0x80000 DT_SIZE_K(224)>; + }; + + slot1_ns_partition: partition@b8000 { + label = "image-1-nonsecure"; + reg = <0xb8000 DT_SIZE_K(224)>; + }; + + /* 32K from 0xf0000 to 0xf7fff reserved for TF-M partitions */ + + storage_partition: partition@f8000 { + label = "storage"; + reg = <0xf8000 DT_SIZE_K(28)>; + }; + + /* 2K from 0xff000 to 0xff7ff unused */ + }; +}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.yaml b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.yaml index 13bdefd1b7e..0a53875b749 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.yaml +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.yaml @@ -11,7 +11,7 @@ toolchain: - zephyr sysbuild: true ram: 192 -flash: 1012 +flash: 230 supported: - adc - counter diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.dts index e3ee6b5434f..020fdd16af2 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.dts @@ -25,5 +25,49 @@ ranges = <0x0 0x20000000 DT_SIZE_K(192)>; }; -/* Include default memory partition configuration file */ -#include +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1022)>; +}; + +/* These partition sizes assume no FLPR area in RRAM */ +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(224)>; + }; + + slot0_ns_partition: partition@48000 { + label = "image-0-nonsecure"; + reg = <0x48000 DT_SIZE_K(224)>; + }; + + slot1_partition: partition@80000 { + label = "image-1"; + reg = <0x80000 DT_SIZE_K(224)>; + }; + + slot1_ns_partition: partition@b8000 { + label = "image-1-nonsecure"; + reg = <0xb8000 DT_SIZE_K(224)>; + }; + + /* 32K from 0xf0000 to 0xf7fff reserved for TF-M partitions */ + + storage_partition: partition@f8000 { + label = "storage"; + reg = <0xf8000 DT_SIZE_K(28)>; + }; + + /* 2K from 0xff000 to 0xff7ff unused */ + }; +}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.yaml index 0be5ece7d0e..d56468281ac 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp.yaml @@ -10,7 +10,7 @@ toolchain: - zephyr sysbuild: true ram: 192 -flash: 1012 +flash: 230 supported: - adc - counter diff --git a/dts/vendor/nordic/nrf54l10_partition.dtsi b/dts/vendor/nordic/nrf54l10_partition.dtsi deleted file mode 100644 index e73b1c5f0e3..00000000000 --- a/dts/vendor/nordic/nrf54l10_partition.dtsi +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1012)>; -}; - -/* These partition sizes assume no FLPR area in RRAM */ -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(456)>; - }; - - slot1_partition: partition@82000 { - label = "image-1"; - reg = <0x82000 DT_SIZE_K(456)>; - }; - - storage_partition: partition@f4000 { - label = "storage"; - reg = <0xf4000 DT_SIZE_K(36)>; - }; - }; -}; From 586155cffe829eb7b767d4aea03771eaaa0c9d16 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 363/881] Revert "[nrf fromtree] dts: vendor: nordic: nrf54l10: Fix wrong size of NVM" This reverts commit 8620d6150ce43432ac3d140f8abc8c489ff0efcc. Signed-off-by: Jukka Rissanen --- dts/vendor/nordic/nrf54l10.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/vendor/nordic/nrf54l10.dtsi b/dts/vendor/nordic/nrf54l10.dtsi index 800c4081f28..a515fbb42f5 100644 --- a/dts/vendor/nordic/nrf54l10.dtsi +++ b/dts/vendor/nordic/nrf54l10.dtsi @@ -25,14 +25,14 @@ }; &cpuapp_rram { - reg = <0x0 DT_SIZE_K(950)>; + reg = <0x0 DT_SIZE_K(960)>; }; -/* 950 + 62 = 1012KB */ +/* 960 + 62 = 1022KB */ &rram_controller { - cpuflpr_rram: rram@ed800 { + cpuflpr_rram: rram@f0000 { compatible = "soc-nv-flash"; - reg = <0xed800 DT_SIZE_K(62)>; + reg = <0xf0000 DT_SIZE_K(62)>; erase-block-size = <4096>; write-block-size = <16>; }; From e6cbb00f483a494effcee715f774f1594711100a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 364/881] Revert "[nrf fromlist] tests: drivers: gpio_basic_api: Add nrf_sense_edge test for nrf54l15dk" This reverts commit 5a47376a429951a35db9fc5d4624bd2af8c63a01. Signed-off-by: Jukka Rissanen --- .../gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay | 9 --------- tests/drivers/gpio/gpio_basic_api/testcase.yaml | 5 ----- 2 files changed, 14 deletions(-) delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay deleted file mode 100644 index 59839fa9265..00000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&gpio1 { - sense-edge-mask = <0xC00>; -}; diff --git a/tests/drivers/gpio/gpio_basic_api/testcase.yaml b/tests/drivers/gpio/gpio_basic_api/testcase.yaml index 80557929687..325b22efa1c 100644 --- a/tests/drivers/gpio/gpio_basic_api/testcase.yaml +++ b/tests/drivers/gpio/gpio_basic_api/testcase.yaml @@ -24,11 +24,6 @@ tests: extra_args: "DTC_OVERLAY_FILE=boards/nrf52840dk_nrf52840.overlay;\ boards/nrf52840dk_nrf52840_sense_edge.overlay" - drivers.gpio.nrf_sense_edge.nrf54l: - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - extra_args: "EXTRA_DTC_OVERLAY_FILE=boards/nrf54l_sense_edge.overlay" - drivers.gpio.mr_canhubk3_wkpu: platform_allow: mr_canhubk3 extra_args: "DTC_OVERLAY_FILE=boards/mr_canhubk3_wkpu.overlay" From bd7689d04191231b01feaf3d73c4943ae5f03430 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 365/881] Revert "[nrf fromtree] tests: drivers: flash: Add MSPI flash test in single I/O mode" This reverts commit 8ec7d71d0755163e82eec1b8e88ecd7b2f8fdfc7. Signed-off-by: Jukka Rissanen --- .../common/boards/mx25uw63_single_io.overlay | 62 ------------------- tests/drivers/flash/common/testcase.yaml | 5 -- 2 files changed, 67 deletions(-) delete mode 100644 tests/drivers/flash/common/boards/mx25uw63_single_io.overlay diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay deleted file mode 100644 index a24ba4e5489..00000000000 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - - /delete-node/ exmif_default; - /delete-node/ exmif_sleep; - - exmif_default: exmif_default { - group1 { - psels = , - , - , - , - , - , - , - , - , - ; - nordic,drive-mode = ; - }; - }; - - exmif_sleep: exmif_sleep { - group1 { - low-power-enable; - psels = , - , - , - , - , - , - , - , - , - ; - }; - }; - -}; - -&gpio6 { - status = "okay"; -}; - -&exmif { - status = "okay"; - pinctrl-0 = <&exmif_default>; - pinctrl-1 = <&exmif_sleep>; - pinctrl-names = "default", "sleep"; - ce-gpios = <&gpio6 3 GPIO_ACTIVE_LOW>; -}; - -&mx25uw63 { - status = "okay"; - mspi-max-frequency = ; - mspi-io-mode = "MSPI_IO_MODE_SINGLE"; -}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 0a35ec04cd9..0433d024ff1 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -151,8 +151,3 @@ tests: extra_args: - DTC_OVERLAY_FILE="./boards/${BOARD}_ospi_b_nor.overlay" - CONF_FILE="./prj.conf ./boards/${BOARD}_ospi_b_nor.conf" - drivers.flash.common.mspi_single_io: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - extra_args: - - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_single_io.overlay From 7caadc4882849544be765cafd996d95216b9125e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 366/881] Revert "[nrf fromlist] drivers: serial: nrfx_uarte: Add mode with TIMER byte counting" This reverts commit 2b7fae8f92faf11993a2fbaee758c56f48bbd060. Signed-off-by: Jukka Rissanen --- drivers/serial/Kconfig.nrfx | 26 - drivers/serial/Kconfig.nrfx_uart_instance | 7 - drivers/serial/uart_nrfx_uarte.c | 1028 ++------------------- 3 files changed, 88 insertions(+), 973 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 7baa53b9c42..8bcb9e49b66 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -78,32 +78,6 @@ config UART_ASYNC_TX_CACHE_SIZE in RAM, because EasyDMA in UARTE peripherals can only transfer data from RAM. -config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - bool "Use TIMER to count RX bytes" - depends on UART_ASYNC_API - depends on UART_NRFX_UARTE_LEGACY_SHIM - depends on !ARCH_POSIX # Mode not supported on BSIM target - select NRFX_GPPI - -config UART_NRFX_UARTE_BOUNCE_BUF_LEN - int "RX bounce buffer size" - depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - default 256 - range 64 1024 - help - Buffer is used when workaround with bounce buffers is applied - -config UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY - int "RX bounce buffer swap latency (in microseconds)" - depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - default 300 - help - Option decides how long before current bounce buffer is filled driver - attempts to swap the buffer. It must be long enough to ensure that - space following the buffer is not overwritten. Too high value results - in more frequent buffer swaps so it impacts performance. Setting should - take into account potential interrupt handling latency. - config UART_NRFX_UARTE_DIRECT_ISR bool "Use direct ISR" diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index 82ffaa10fcb..b1a68d691c4 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -18,13 +18,6 @@ config UART_$(nrfx_uart_num)_ASYNC help This option enables UART Asynchronous API support on port $(nrfx_uart_num). -config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER - bool - depends on $(dt_nodelabel_has_prop,uart$(nrfx_uart_num),timer) - depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) - default y - imply UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - config UART_$(nrfx_uart_num)_ENHANCED_POLL_OUT bool "Efficient poll out on port $(nrfx_uart_num)" depends on !$(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),endtx-stoptx-supported) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 149a48d88b2..995d1113473 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -188,16 +188,6 @@ BUILD_ASSERT(IS_ENABLED(CONFIG_CLOCK_CONTROL)); /* Size of hardware fifo in RX path. */ #define UARTE_HW_RX_FIFO_SIZE 5 -/* TIMER CC channels for counting bytes with TIMER. */ -/* Channel used for capturing current counter value. */ -#define UARTE_TIMER_CAPTURE_CH 0 -/* Channel used to get compare event when number of received bytes reaches user buffer size. */ -#define UARTE_TIMER_USR_CNT_CH 1 -/* Channel used to get compare event when bounce buffer need to be switched. */ -#define UARTE_TIMER_BUF_SWITCH_CH 2 -/* Magic byte that is used to fill the buffer. */ -#define UARTE_MAGIC_BYTE 0xAA - #ifdef UARTE_ANY_ASYNC struct uarte_async_tx { @@ -211,30 +201,6 @@ struct uarte_async_tx { bool pending; }; -/* Structure with data for Count Bytes With Timer receiver mode (cbwt). */ -struct uarte_async_rx_cbwt { - uint8_t *curr_bounce_buf; - uint8_t *anomaly_byte_addr; - uint32_t usr_rd_off; - uint32_t usr_wr_off; - uint32_t bounce_off; - uint32_t bounce_limit; - uint32_t last_cnt; - uint32_t cc_usr; - uint32_t cc_swap; -#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE - size_t bounce_buf_swap_len; -#endif -#ifdef UARTE_ANY_CACHE - uint8_t *anomaly_byte_dst; - uint8_t anomaly_byte; -#endif - uint8_t bounce_idx; - uint8_t ppi_ch; - bool in_irq; - bool discard_fifo; -}; - struct uarte_async_rx { struct k_timer timer; #ifdef CONFIG_HAS_NORDIC_DMM @@ -246,9 +212,8 @@ struct uarte_async_rx { size_t offset; uint8_t *next_buf; size_t next_buf_len; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) +#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX +#if !defined(UARTE_HAS_FRAME_TIMEOUT) uint32_t idle_cnt; #endif k_timeout_t timeout; @@ -321,10 +286,6 @@ struct uarte_nrfx_data { #define UARTE_FLAG_POLL_OUT BIT(3) /* Flag indicating that a workaround for not working frame timeout is active. */ #define UARTE_FLAG_FTIMEOUT_WATCH BIT(4) -/* Flag indicating that UART_RX_BUF_REQUEST event need to be called from the interrupt context. */ -#define UARTE_FLAG_RX_BUF_REQ BIT(5) -/* Flag indicating that CC value in TIMER was set too late. */ -#define UARTE_FLAG_LATE_CC BIT(6) /* If enabled then ENDTX is PPI'ed to TXSTOP */ #define UARTE_CFG_FLAG_PPI_ENDTX BIT(0) @@ -343,12 +304,6 @@ struct uarte_nrfx_data { /* Indicates that workaround for spurious RXTO during restart shall be applied. */ #define UARTE_CFG_FLAG_SPURIOUS_RXTO BIT(3) -/* Indicates that UARTE/TIMER interrupt priority differs from system clock (GRTC/RTC). */ -#define UARTE_CFG_FLAG_VAR_IRQ BIT(4) - -/* Indicates that instance needs special handling of BAUDRATE register. */ -#define UARTE_CFG_FLAG_VOLATILE_BAUDRATE BIT(5) - /* Formula for getting the baudrate settings is following: * 2^12 * (2^20 / (f_PCLK / desired_baudrate)) where f_PCLK is a frequency that * drives the UARTE. @@ -385,14 +340,6 @@ struct uarte_nrfx_data { (baudrate) == 921600 ? NRF_UARTE_BAUDRATE_921600 : \ (baudrate) == 1000000 ? NRF_UARTE_BAUDRATE_1000000 : 0) -#define UARTE_MIN_BUF_SWAP_LEN 10 - -#define UARTE_US_TO_BYTES(baudrate) \ - DIV_ROUND_UP((CONFIG_UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY * baudrate), 10000000) - -#define UARTE_BUF_SWAP_LEN(bounce_buf_len, baudrate) \ - ((bounce_buf_len) - MAX(UARTE_MIN_BUF_SWAP_LEN, UARTE_US_TO_BYTES(baudrate))) - #define LOW_POWER_ENABLED(_config) \ (IS_ENABLED(UARTE_ANY_LOW_POWER) && \ !IS_ENABLED(CONFIG_PM_DEVICE) && \ @@ -439,15 +386,6 @@ struct uarte_nrfx_config { #endif /* CONFIG_UART_USE_RUNTIME_CONFIGURE */ #ifdef UARTE_ANY_ASYNC -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - NRF_TIMER_Type * timer_regs; - IRQn_Type timer_irqn; - IRQn_Type uarte_irqn; - uint8_t *bounce_buf[2]; - size_t bounce_buf_len; - size_t bounce_buf_swap_len; - struct uarte_async_rx_cbwt *cbwt_data; -#endif nrfx_timer_t timer; uint8_t *tx_cache; uint8_t *rx_flush_buf; @@ -467,12 +405,6 @@ struct uarte_nrfx_config { (IS_ENABLED(UARTE_ANY_HW_ASYNC) ? \ (config->flags & UARTE_CFG_FLAG_HW_BYTE_COUNTING) : false) -/* Determine if instance is using an approach with counting bytes with TIMER (cbwt). */ -#define IS_CBWT(dev) \ - COND_CODE_1(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ - ((((const struct uarte_nrfx_config *)dev->config)->cbwt_data != NULL)), \ - (false)) - static inline NRF_UARTE_Type *get_uarte_instance(const struct device *dev) { const struct uarte_nrfx_config *config = dev->config; @@ -669,23 +601,10 @@ static int baudrate_set(const struct device *dev, uint32_t baudrate) return -EINVAL; } -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - struct uarte_async_rx_cbwt *cbwt_data = config->cbwt_data; - - cbwt_data->bounce_buf_swap_len = UARTE_BUF_SWAP_LEN(config->bounce_buf_len, - baudrate); - } -#endif - #ifdef UARTE_BAUDRATE_RETENTION_WORKAROUND - if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { - struct uarte_nrfx_data *data = dev->data; + struct uarte_nrfx_data *data = dev->data; - data->nrf_baudrate = nrf_baudrate; - } else { - nrf_uarte_baudrate_set(get_uarte_instance(dev), nrf_baudrate); - } + data->nrf_baudrate = nrf_baudrate; #else nrf_uarte_baudrate_set(get_uarte_instance(dev), nrf_baudrate); #endif @@ -873,11 +792,9 @@ static void uarte_periph_enable(const struct device *dev) } #endif #if UARTE_BAUDRATE_RETENTION_WORKAROUND - if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { - nrf_uarte_baudrate_set(uarte, - COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, - (data->nrf_baudrate), (config->nrf_baudrate))); - } + nrf_uarte_baudrate_set(uarte, + COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, + (data->nrf_baudrate), (config->nrf_baudrate))); #endif #ifdef UARTE_ANY_ASYNC @@ -977,17 +894,13 @@ static void rx_buf_release(const struct device *dev, uint8_t *buf) user_callback(dev, &evt); } -static void rx_disable_finalize(const struct device *dev) +static void notify_rx_disable(const struct device *dev) { const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; struct uart_event evt = { .type = UART_RX_DISABLED, }; - async_rx->enabled = false; - if (LOW_POWER_ENABLED(cfg)) { uint32_t key = irq_lock(); @@ -1005,42 +918,28 @@ static void rx_disable_finalize(const struct device *dev) } } -static int rx_disable(const struct device *dev, bool api) +static int uarte_nrfx_rx_disable(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); int key; + if (async_rx->buf == NULL) { + return -EFAULT; + } + k_timer_stop(&async_rx->timer); key = irq_lock(); -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - if (cbwt_data) { - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_BUF_SWITCH_CH)); - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); - nrf_timer_int_disable(cfg->timer_regs, - nrf_timer_compare_int_get(UARTE_TIMER_BUF_SWITCH_CH) | - nrf_timer_compare_int_get(UARTE_TIMER_USR_CNT_CH)); - nrf_uarte_shorts_disable(cfg->uarte_regs, NRF_UARTE_SHORT_ENDRX_STARTRX); - } -#endif - if (async_rx->next_buf != NULL) { nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); } async_rx->enabled = false; - if (api) { - async_rx->discard_fifo = true; - } + async_rx->discard_fifo = true; nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); irq_unlock(key); @@ -1048,18 +947,6 @@ static int rx_disable(const struct device *dev, bool api) return 0; } -static int uarte_nrfx_rx_disable(const struct device *dev) -{ - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - - if (async_rx->buf == NULL) { - return -EFAULT; - } - - return rx_disable(dev, true); -} - #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -1084,10 +971,10 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) if (ret != NRFX_SUCCESS) { LOG_ERR("Timer already initialized"); return -EINVAL; + } else { + nrfx_timer_clear(&cfg->timer); } - nrfx_timer_clear(&cfg->timer); - ret = nrfx_gppi_channel_alloc(&data->async->rx.cnt.ppi); if (ret != NRFX_SUCCESS) { LOG_ERR("Failed to allocate PPI Channel"); @@ -1105,653 +992,6 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) } #endif /* !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) */ -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - -static uint32_t get_byte_cnt(NRF_TIMER_Type *timer) -{ - nrf_timer_task_trigger(timer, nrf_timer_capture_task_get(UARTE_TIMER_CAPTURE_CH)); - - nrf_barrier_w(); - - return nrf_timer_cc_get(timer, UARTE_TIMER_CAPTURE_CH); -} - -static void rx_buf_req(const struct device *dev) -{ - struct uart_event evt = { - .type = UART_RX_BUF_REQUEST, - }; - - user_callback(dev, &evt); -} - -static bool notify_rx_rdy(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - size_t len = cbwt_data->usr_wr_off - cbwt_data->usr_rd_off; - - if (len == 0) { - return async_rx->buf != NULL; - } - - struct uart_event evt = { - .type = UART_RX_RDY, - .data.rx.buf = async_rx->buf, - .data.rx.len = len, - .data.rx.offset = cbwt_data->usr_rd_off - }; - user_callback(dev, &evt); - cbwt_data->usr_rd_off += len; - - if (cbwt_data->usr_rd_off == async_rx->buf_len) { - rx_buf_release(dev, async_rx->buf); - async_rx->buf = async_rx->next_buf; - async_rx->buf_len = async_rx->next_buf_len; - async_rx->next_buf_len = 0; - async_rx->next_buf = 0; - cbwt_data->usr_rd_off = 0; - cbwt_data->usr_wr_off = 0; - - if (async_rx->buf_len == 0) { - return false; - } - - /* Set past value to ensure that event will not expire after clearing but - * before setting the new value. - */ - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, cbwt_data->cc_usr - 1); - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); - cbwt_data->cc_usr += async_rx->buf_len; - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, cbwt_data->cc_usr); - - /* Check if CC is already in the past. In that case trigger CC handling.*/ - if (cbwt_data->cc_usr <= get_byte_cnt(cfg->timer_regs)) { - atomic_or(&data->flags, UARTE_FLAG_LATE_CC); - NRFX_IRQ_PENDING_SET(cfg->timer_irqn); - } else { - atomic_and(&data->flags, ~UARTE_FLAG_LATE_CC); - } - } - - return true; -} - -static void anomaly_byte_handle(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint8_t curr_byte, anomaly_byte; - uint32_t diff; - - if (cbwt_data->anomaly_byte_addr == NULL) { - return; - } - - diff = cfg->uarte_regs->DMA.RX.PTR - (uint32_t)cbwt_data->curr_bounce_buf; - /* Anomaly can be checked only if more than 1 byte is received to the current buffer. */ - if (diff < 2) { - return; - } - - if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { - sys_cache_data_invd_range(cbwt_data->curr_bounce_buf, 1); - sys_cache_data_invd_range(cbwt_data->anomaly_byte_addr, 1); - } - - curr_byte = cbwt_data->curr_bounce_buf[0]; - anomaly_byte = *cbwt_data->anomaly_byte_addr; - if ((curr_byte == UARTE_MAGIC_BYTE) && (anomaly_byte != UARTE_MAGIC_BYTE)) { -#ifdef UARTE_ANY_CACHE - if (cfg->flags & UARTE_CFG_FLAG_CACHEABLE) { - /* We cannot write directly to curr_bounce_buf as it is written by - * DMA and with cache operations data may be overwritten. Copying - * need to be postponed to the moment when user buffer is filled. - */ - cbwt_data->anomaly_byte = anomaly_byte; - cbwt_data->anomaly_byte_dst = &cbwt_data->curr_bounce_buf[0]; - } else { - cbwt_data->curr_bounce_buf[0] = anomaly_byte; - } -#else - cbwt_data->curr_bounce_buf[0] = anomaly_byte; -#endif - } - - cbwt_data->anomaly_byte_addr = NULL; -} - -static uint32_t fill_usr_buf(const struct device *dev, uint32_t len) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - uint8_t *buf = cfg->bounce_buf[cbwt_data->bounce_idx]; - uint32_t usr_rem = async_rx->buf_len - cbwt_data->usr_wr_off; - uint32_t bounce_rem = cbwt_data->bounce_limit - cbwt_data->bounce_off; - uint32_t cpy_len = MIN(bounce_rem, MIN(usr_rem, len)); - - __ASSERT(cpy_len + cbwt_data->bounce_off <= cfg->bounce_buf_len, - "Exceeding the buffer cpy_len:%d off:%d limit:%d", - cpy_len, cbwt_data->bounce_off, cbwt_data->bounce_limit); - - if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { - sys_cache_data_invd_range(&buf[cbwt_data->bounce_off], cpy_len); - } - - memcpy(&async_rx->buf[cbwt_data->usr_wr_off], &buf[cbwt_data->bounce_off], cpy_len); -#ifdef UARTE_ANY_CACHE - if ((buf == cbwt_data->anomaly_byte_dst) && (cbwt_data->bounce_off == 0)) { - async_rx->buf[cbwt_data->usr_wr_off] = cbwt_data->anomaly_byte; - cbwt_data->anomaly_byte_dst = NULL; - } -#endif - cbwt_data->bounce_off += cpy_len; - cbwt_data->usr_wr_off += cpy_len; - cbwt_data->last_cnt += cpy_len; - if (cbwt_data->bounce_off == cbwt_data->bounce_limit) { - /* Bounce buffer drained */ - cbwt_data->bounce_idx = cbwt_data->bounce_idx == 0 ? 1 : 0; - cbwt_data->bounce_off = 0; - cbwt_data->bounce_limit = cfg->bounce_buf_len; - } - - return cpy_len; -} - -static bool update_usr_buf(const struct device *dev, uint32_t len, bool notify_any, bool buf_req) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - anomaly_byte_handle(dev); - - do { - uint32_t cpy_len = len ? fill_usr_buf(dev, len) : 0; - bool usr_buf_full = cbwt_data->usr_wr_off == async_rx->buf_len; - - len -= cpy_len; - if (((len == 0) && notify_any) || usr_buf_full) { - if (!notify_rx_rdy(dev)) { - return false; - } - - if (usr_buf_full && buf_req) { - rx_buf_req(dev); - } - } - } while (len > 0); - - return true; -} - -static void prepare_bounce_buf(const struct device *dev, uint8_t *buf, - size_t swap_len, size_t len) -{ - const struct uarte_nrfx_config *cfg = dev->config; - - buf[0] = UARTE_MAGIC_BYTE; - for (size_t i = swap_len; i < len; i++) { - buf[i] = UARTE_MAGIC_BYTE; - } - - if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { - sys_cache_data_flush_range(buf, 1); - sys_cache_data_flush_range(&buf[swap_len], len); - } -} - -/* This function is responsible for swapping the bounce buffer and it is the most - * tricky part of the solution. Receiver is continuously working and we want to - * change DMA pointer on the fly. DMA is also incrementing that pointer so there are - * moments in the reception when updating the pointer will result in different behavior. - * - * There are two main cases that need to be handled: - * 1. PTR is updated and there was no byte boundary (in the middle of a byte or there is - * no byte on the line). It is a safe spot. - * - * The most common and simplest case. PTR is update but since - * DMA already started the reception of the previous byte it means that next byte will - * be stored in the previous PTR and bytes following that byte will be stored to the - * new bounce buffer - * - * 2. Updating the pointer collided with byte boundary. - * - * RXDRDY and RXSTARTED events are used to detect if collision occurred. - * There are few scenarios that may happen and the driver must detect which one occurred. - * Detection is done by reading back the PTR register. Following cases are considered: - * - * - PTR did not change. It means that it was written after byte boundary. It is the same - * case as if PTR was updated in the safe spot. - * - * - PTR is updated by 1. There is an anomaly and it is unclear where next byte will be - * copied. PTR state indicates that it should be copied to the beginning of the new - * bounce buffer but it might be copied to the previous bounce buffer. Both locations - * are written with a magic byte (0xAA) and later on it is checked which location has - * changed and if byte was written to the previous bounce buffer it is copied to the - * start of the new bounce buffer. - * - * - PTR is not updated with the new bounce buffer location. DMA is incrementing PTR content - * and it is possible that SW writes new value between read and modify and DMA may - * overwrite value written by the driver. In that case reception continuous to the - * previous bounce buffer and swap procedure need to be repeated. - */ -static int bounce_buf_swap(const struct device *dev, uint8_t *prev_bounce_buf) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t prev_buf_cnt, new_cnt, cnt, ptr; - uint32_t prev_buf_inc = 1; - int key; - - key = irq_lock(); - /* Clear events that indicates byte boundary and set PTR. If events are set - * after PTR is set then we know that setting PTR collided with byte boundary. - */ - nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED); - nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); - cfg->uarte_regs->DMA.RX.PTR = (uint32_t)cbwt_data->curr_bounce_buf; - cnt = get_byte_cnt(cfg->timer_regs); - - if (!nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY) && - !nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED)) { - /* RXDRDY did not happen when PTR was set. Safest case. PTR was updated - * correctly. Last byte will be received to the previous buffer. - */ - new_cnt = 0; - prev_buf_cnt = cnt - cbwt_data->last_cnt; - goto no_collision; - } - - /* Setting PTR collided with byte boundary we need to detect what happened. */ - while (!nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED)) { - } - - /* Read pointer when there is no new byte coming. */ - do { - cnt = get_byte_cnt(cfg->timer_regs); - ptr = cfg->uarte_regs->DMA.RX.PTR; - } while (cnt != get_byte_cnt(cfg->timer_regs)); - - new_cnt = ptr - (uint32_t)cbwt_data->curr_bounce_buf; - prev_buf_cnt = cnt - cbwt_data->last_cnt; - - if (new_cnt == 0) { - /* New PTR is not incremented. It was written after LIST post ENDRX - * incrementation. - */ - } else if (new_cnt == 1) { - /* new_cnt == 1. New PTR incremented. It's possible that data is already - * copied to that new location or it is written to the tail of the previous - * bounce buffer. We try to detect what happens. - */ - prev_buf_inc = 0; - cbwt_data->anomaly_byte_addr = - &prev_bounce_buf[cbwt_data->bounce_off + prev_buf_cnt]; - } else if (new_cnt <= cfg->bounce_buf_len) { - prev_buf_inc = 0; - prev_buf_cnt = cnt - cbwt_data->last_cnt - (new_cnt - 1); - } else { - /* New PTR value is not set. Re-set PTR is needed. Transfer continues to - * previous buffer whole buffer swapping need to be repeat. - */ - irq_unlock(key); - return -EAGAIN; - } - -no_collision: - cbwt_data->bounce_limit = cbwt_data->bounce_off + prev_buf_cnt + prev_buf_inc; - __ASSERT(cbwt_data->bounce_limit < cfg->bounce_buf_len, - "Too high limit (%d, max:%d), increase latency", - cbwt_data->bounce_limit, cfg->bounce_buf_len); - irq_unlock(key); - - return prev_buf_cnt; -} - -static size_t get_swap_len(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; -#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - return cbwt_data->bounce_buf_swap_len; -#else - return cfg->bounce_buf_swap_len; -#endif -} - -static void bounce_buf_switch(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - int new_data = cbwt_data->cc_swap - cbwt_data->last_cnt; - uint8_t *prev_bounce_buf = cbwt_data->curr_bounce_buf; - int prev_cnt; - - /* Fill user buffer with all pending data. */ - if (!update_usr_buf(dev, new_data < 0 ? 0 : new_data, false, true)) { - rx_disable(dev, false); - return; - } - - cbwt_data->curr_bounce_buf = (cbwt_data->curr_bounce_buf == cfg->bounce_buf[0]) ? - cfg->bounce_buf[1] : cfg->bounce_buf[0]; - prepare_bounce_buf(dev, cbwt_data->curr_bounce_buf, get_swap_len(dev), - cfg->bounce_buf_len); - - /* Swapping may need retry. */ - while ((prev_cnt = bounce_buf_swap(dev, prev_bounce_buf)) < 0) { - } - - /* Update user buffer with data that was received during swapping. */ - if (update_usr_buf(dev, prev_cnt, false, true)) { - /* Set compare event for next moment when bounce buffers need to be swapped. */ - cbwt_data->cc_swap += get_swap_len(dev); - __ASSERT(cbwt_data->cc_swap > get_byte_cnt(cfg->timer_regs), - "Setting CC too late next:%d cnt:%d", - cbwt_data->cc_swap, get_byte_cnt(cfg->timer_regs)); - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH, cbwt_data->cc_swap); - } else { - /* Stop RX. */ - rx_disable(dev, false); - } -} - -static void usr_buf_complete(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t rem = async_rx->buf_len - cbwt_data->usr_wr_off; - - __ASSERT_NO_MSG(rem <= (get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt)); - - if (!update_usr_buf(dev, rem, true, true)) { - /* Stop RX if there is no next buffer. */ - rx_disable(dev, false); - } -} - -static void notify_new_data(const struct device *dev, bool buf_req) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t cnt = get_byte_cnt(cfg->timer_regs); - uint32_t new_data = cnt - cbwt_data->last_cnt; - - (void)update_usr_buf(dev, new_data, true, buf_req); -} - -static void cbwt_rx_timeout(struct k_timer *timer) -{ - const struct device *dev = k_timer_user_data_get(timer); - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - struct uarte_async_rx *async_rx = &data->async->rx; - - if (nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY)) { - nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); - async_rx->idle_cnt = 0; - } else { - async_rx->idle_cnt++; - if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { - if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { - if (cbwt_data->in_irq) { - /* TIMER or UARTE interrupt preempted. Lets try again - * later. - */ - k_timer_start(timer, async_rx->timeout, K_NO_WAIT); - return; - } - irq_disable(cfg->uarte_irqn); - irq_disable(cfg->timer_irqn); - } - - nrf_uarte_int_enable(cfg->uarte_regs, NRF_UARTE_INT_RXDRDY_MASK); - notify_new_data(dev, true); - - if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { - irq_enable(cfg->uarte_irqn); - irq_enable(cfg->timer_irqn); - } - return; - } - } - - k_timer_start(timer, async_rx->timeout, K_NO_WAIT); -} - -static void cbwt_rx_flush_handle(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t rem_data = get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt; - uint32_t bbuf_rem_data = cbwt_data->bounce_limit - cbwt_data->bounce_off; - uint32_t amount; - uint8_t *dst; - - nrf_uarte_rx_buffer_set(uarte, cfg->rx_flush_buf, UARTE_HW_RX_FIFO_SIZE); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_FLUSHRX); - while (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) { - /* empty */ - } - - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); - if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED)) { - /* FIFO is empty. */ - return; - } - - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - amount = nrf_uarte_rx_amount_get(uarte); - - if (rem_data <= bbuf_rem_data) { - /* instead of -1 it should be -amount but RXDRDY event is not generated - * for bytes following first that goes to FIFO they are generated during flushing. - */ - dst = &cfg->bounce_buf[cbwt_data->bounce_idx][cbwt_data->bounce_off + rem_data - 1]; - } else { - /* See comment in if clause. */ - dst = &cbwt_data->curr_bounce_buf[rem_data - bbuf_rem_data - 1]; - } - - if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { - sys_cache_data_invd_range(cfg->rx_flush_buf, amount); - sys_cache_data_invd_range(dst, amount); - } - - memcpy(dst, cfg->rx_flush_buf, amount); -} - -static void cbwt_rxto_isr(const struct device *dev, bool do_flush) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - if (async_rx->buf) { - notify_new_data(dev, false); - } - - if (async_rx->buf) { - rx_buf_release(dev, async_rx->buf); - async_rx->buf = NULL; - } - - if (async_rx->next_buf) { - rx_buf_release(dev, async_rx->next_buf); - async_rx->next_buf = NULL; - } - - if (do_flush) { - cbwt_rx_flush_handle(dev); - } - - if (async_rx->discard_fifo) { - cbwt_data->discard_fifo = async_rx->discard_fifo; - async_rx->discard_fifo = false; - } - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_STOP); - rx_disable_finalize(dev); -} - -static bool timer_ch_evt_check_clear(NRF_TIMER_Type *timer, uint32_t ch) -{ - nrf_timer_event_t evt = nrf_timer_compare_event_get(ch); - - if (nrf_timer_event_check(timer, evt)) { - nrf_timer_event_clear(timer, evt); - return true; - } - - return false; -} - -static void timer_isr(const void *arg) -{ - const struct device *dev = arg; - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - static const uint32_t flags_to_check = UARTE_FLAG_RX_BUF_REQ | - UARTE_FLAG_TRIG_RXTO | - UARTE_FLAG_LATE_CC; - uint32_t flags = atomic_and(&data->flags, ~flags_to_check); - - cbwt_data->in_irq = true; - - if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH) || - (flags & UARTE_FLAG_LATE_CC)) { - usr_buf_complete(dev); - } - - /* Must be after user buf complet CC handling. */ - if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH)) { - bounce_buf_switch(dev); - } - - if (flags & UARTE_FLAG_RX_BUF_REQ) { - rx_buf_req(dev); - } - - if (flags & UARTE_FLAG_TRIG_RXTO) { - cbwt_rxto_isr(dev, false); - } - - cbwt_data->in_irq = false; -} - -static void cbwt_rx_enable(const struct device *dev, bool with_timeout) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t rem_data; - uint32_t len = async_rx->buf_len; - uint32_t rx_int_mask = NRF_UARTE_INT_RXTO_MASK | - (with_timeout ? NRF_UARTE_INT_RXDRDY_MASK : 0); - - if (cbwt_data->discard_fifo) { - rem_data = 0; - cbwt_data->discard_fifo = false; - } else { - rem_data = get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt; - } - - cbwt_data->usr_rd_off = 0; - cbwt_data->usr_wr_off = 0; - - if (rem_data >= len) { - atomic_or(&data->flags, UARTE_FLAG_TRIG_RXTO); - NRFX_IRQ_PENDING_SET(cfg->timer_irqn); - return; - } else if (rem_data) { - (void)update_usr_buf(dev, rem_data, false, true); - len -= rem_data; - } - - prepare_bounce_buf(dev, cfg->bounce_buf[0], get_swap_len(dev), cfg->bounce_buf_len); - - cbwt_data->last_cnt = 0; - cbwt_data->bounce_off = 0; - cbwt_data->bounce_idx = 0; - cbwt_data->curr_bounce_buf = cfg->bounce_buf[0]; - cbwt_data->bounce_limit = cfg->bounce_buf_len; - /* Enable ArrayList. */ - nrf_uarte_shorts_enable(cfg->uarte_regs, NRF_UARTE_SHORT_ENDRX_STARTRX); - nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); - nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); - nrf_uarte_rx_buffer_set(cfg->uarte_regs, cbwt_data->curr_bounce_buf, 1); - - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_BUF_SWITCH_CH)); - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); - nrf_timer_int_enable(cfg->timer_regs, - nrf_timer_compare_int_get(UARTE_TIMER_BUF_SWITCH_CH) | - nrf_timer_compare_int_get(UARTE_TIMER_USR_CNT_CH)); - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_CLEAR); - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_START); - cbwt_data->cc_usr = len; - cbwt_data->cc_swap = get_swap_len(dev); - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH, get_swap_len(dev)); - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, len); - - atomic_or(&data->flags, UARTE_FLAG_RX_BUF_REQ); - nrf_uarte_task_trigger(cfg->uarte_regs, NRF_UARTE_TASK_STARTRX); - NRFX_IRQ_PENDING_SET(cfg->timer_irqn); -} - -static int cbwt_uarte_async_init(const struct device *dev) -{ - /* As this approach does not use nrfx_timer driver but only HAL special setup - * function is used. - */ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - static const uint32_t rx_int_mask = NRF_UARTE_INT_ERROR_MASK | - NRF_UARTE_INT_RXTO_MASK; - uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); - uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT); - nrfx_err_t ret; - - nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER); - nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32); - - ret = nrfx_gppi_channel_alloc(&cbwt_data->ppi_ch); - if (ret != NRFX_SUCCESS) { - return -ENOMEM; - } - - nrfx_gppi_channel_endpoints_setup(cbwt_data->ppi_ch, evt, tsk); - nrfx_gppi_channels_enable(BIT(cbwt_data->ppi_ch)); - -#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE - cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; -#endif - - /* Enable EasyDMA LIST feature (it is exposed in SPIM but not in UARTE). */ - *(volatile uint32_t *)((uint32_t)cfg->uarte_regs + 0x714) = 1; - nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); - - return 0; -} -#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER */ - static int uarte_async_init(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; @@ -1764,17 +1004,6 @@ static int uarte_async_init(const struct device *dev) ((IS_ENABLED(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && !IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) ? NRF_UARTE_INT_RXDRDY_MASK : 0); - k_timer_init(&data->async->rx.timer, rx_timeout, NULL); - k_timer_user_data_set(&data->async->rx.timer, (void *)dev); - k_timer_init(&data->async->tx.timer, tx_timeout, NULL); - k_timer_user_data_set(&data->async->tx.timer, (void *)dev); - -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - return cbwt_uarte_async_init(dev); - } -#endif - #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) int ret = uarte_nrfx_rx_counting_init(dev); @@ -1785,6 +1014,11 @@ static int uarte_async_init(const struct device *dev) nrf_uarte_int_enable(uarte, rx_int_mask); + k_timer_init(&data->async->rx.timer, rx_timeout, NULL); + k_timer_user_data_set(&data->async->rx.timer, (void *)dev); + k_timer_init(&data->async->tx.timer, tx_timeout, NULL); + k_timer_user_data_set(&data->async->tx.timer, (void *)dev); + return 0; } @@ -1933,7 +1167,6 @@ static uint32_t us_to_bauds(uint32_t baudrate, int32_t timeout) } #endif - static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, size_t len, int32_t timeout) @@ -1943,11 +1176,6 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, const struct uarte_nrfx_config *cfg = dev->config; NRF_UARTE_Type *uarte = get_uarte_instance(dev); -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - bool with_timeout = timeout != SYS_FOREVER_US; -#endif - if (cfg->disable_rx) { __ASSERT(false, "TX only UARTE instance"); return -ENOTSUP; @@ -1962,45 +1190,35 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } #ifdef CONFIG_HAS_NORDIC_DMM - if (!IS_CBWT(dev)) { - void *dma_buf; - int ret = 0; + uint8_t *dma_buf; + int ret = 0; - ret = dmm_buffer_in_prepare(cfg->mem_reg, buf, len, &dma_buf); - if (ret < 0) { - return ret; - } - - async_rx->usr_buf = buf; - buf = dma_buf; + ret = dmm_buffer_in_prepare(cfg->mem_reg, buf, len, (void **)&dma_buf); + if (ret < 0) { + return ret; } -#endif -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + async_rx->usr_buf = buf; + buf = dma_buf; +#endif +#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX #ifdef UARTE_HAS_FRAME_TIMEOUT - if (!IS_CBWT(dev) && with_timeout) { + if (timeout != SYS_FOREVER_US) { uint32_t baudrate = COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, - (data->uart_config.baudrate), (cfg->baudrate)); + (data->uart_config.baudrate), (cfg->baudrate)); + + async_rx->timeout = K_USEC(timeout); nrf_uarte_frame_timeout_set(uarte, us_to_bauds(baudrate, timeout)); nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_FRAME_TIMEOUT_STOPRX); - } -#endif -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - async_rx->idle_cnt = 0; -#endif - - if (with_timeout) { - if (!IS_CBWT(dev) && IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) { - async_rx->timeout = K_USEC(timeout); - } else { - async_rx->timeout = with_timeout ? - K_USEC(timeout / RX_TIMEOUT_DIV) : K_NO_WAIT; - } } else { async_rx->timeout = K_NO_WAIT; } +#else + async_rx->timeout = (timeout == SYS_FOREVER_US) ? + K_NO_WAIT : K_USEC(timeout / RX_TIMEOUT_DIV); + async_rx->idle_cnt = 0; +#endif /* UARTE_HAS_FRAME_TIMEOUT */ #else async_rx->timeout_us = timeout; async_rx->timeout_slab = timeout / RX_TIMEOUT_DIV; @@ -2028,20 +1246,8 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } } pm_device_runtime_get(dev); - } else if (LOW_POWER_ENABLED(cfg)) { - unsigned int key = irq_lock(); - - uarte_enable_locked(dev, UARTE_FLAG_LOW_POWER_RX); - irq_unlock(key); } -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - cbwt_rx_enable(dev, with_timeout); - return 0; - } -#endif - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) || LOW_POWER_ENABLED(cfg)) { if (async_rx->flush_cnt) { int cpy_len = MIN(len, async_rx->flush_cnt); @@ -2078,7 +1284,7 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, return 0; } else { #ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX - if (with_timeout) { + if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); @@ -2103,6 +1309,13 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, async_rx->enabled = true; + if (LOW_POWER_ENABLED(cfg)) { + unsigned int key = irq_lock(); + + uarte_enable_locked(dev, UARTE_FLAG_LOW_POWER_RX); + irq_unlock(key); + } + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); return 0; @@ -2121,33 +1334,29 @@ static int uarte_nrfx_rx_buf_rsp(const struct device *dev, uint8_t *buf, err = -EACCES; } else if (async_rx->next_buf == NULL) { #ifdef CONFIG_HAS_NORDIC_DMM - if (!IS_CBWT(dev)) { - uint8_t *dma_buf; - const struct uarte_nrfx_config *config = dev->config; + uint8_t *dma_buf; + const struct uarte_nrfx_config *config = dev->config; - err = dmm_buffer_in_prepare(config->mem_reg, buf, len, (void **)&dma_buf); - if (err < 0) { - return err; - } - async_rx->next_usr_buf = buf; - buf = dma_buf; + err = dmm_buffer_in_prepare(config->mem_reg, buf, len, (void **)&dma_buf); + if (err < 0) { + return err; } + async_rx->next_usr_buf = buf; + buf = dma_buf; #endif async_rx->next_buf = buf; async_rx->next_buf_len = len; - if (!IS_CBWT(dev)) { - nrf_uarte_rx_buffer_set(uarte, buf, len); - /* If buffer is shorter than RX FIFO then there is a risk that due - * to interrupt handling latency ENDRX event is not handled on time - * and due to ENDRX_STARTRX short data will start to be overwritten. - * In that case short is not enabled and ENDRX event handler will - * manually start RX for that buffer. Thanks to RX FIFO there is - * 5 byte time for doing that. If interrupt latency is higher and - * there is no HWFC in both cases data will be lost or corrupted. - */ - if (len >= UARTE_HW_RX_FIFO_SIZE) { - nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); - } + nrf_uarte_rx_buffer_set(uarte, buf, len); + /* If buffer is shorter than RX FIFO then there is a risk that due + * to interrupt handling latency ENDRX event is not handled on time + * and due to ENDRX_STARTRX short data will start to be overwritten. + * In that case short is not enabled and ENDRX event handler will + * manually start RX for that buffer. Thanks to RX FIFO there is + * 5 byte time for doing that. If interrupt latency is higher and + * there is no HWFC in both cases data will be lost or corrupted. + */ + if (len >= UARTE_HW_RX_FIFO_SIZE) { + nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); } err = 0; } else { @@ -2197,13 +1406,6 @@ static void rx_timeout(struct k_timer *timer) NRF_UARTE_Type *uarte = get_uarte_instance(dev); #ifdef UARTE_HAS_FRAME_TIMEOUT -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - cbwt_rx_timeout(timer); - return; - } -#endif - struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; bool rxdrdy = nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY); @@ -2350,7 +1552,7 @@ static void error_isr(const struct device *dev) nrf_uarte_errorsrc_clear(uarte, err); user_callback(dev, &evt); - (void)rx_disable(dev, false); + (void) uarte_nrfx_rx_disable(dev); } static void rxstarted_isr(const struct device *dev) @@ -2569,6 +1771,7 @@ static void rxto_isr(const struct device *dev) * In the second case, additionally, data from the UARTE internal RX * FIFO need to be discarded. */ + async_rx->enabled = false; if (async_rx->discard_fifo) { async_rx->discard_fifo = false; #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) @@ -2596,7 +1799,15 @@ static void rxto_isr(const struct device *dev) #endif nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); #endif - rx_disable_finalize(dev); + + if (LOW_POWER_ENABLED(config)) { + uint32_t key = irq_lock(); + + uarte_disable_locked(dev, UARTE_FLAG_LOW_POWER_RX); + irq_unlock(key); + } + + notify_rx_disable(dev); } static void txstopped_isr(const struct device *dev) @@ -2686,12 +1897,10 @@ static void txstopped_isr(const struct device *dev) static void rxdrdy_isr(const struct device *dev) { -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) struct uarte_nrfx_data *data = dev->data; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) NRF_UARTE_Type *uarte = get_uarte_instance(dev); data->async->rx.idle_cnt = 0; @@ -2723,9 +1932,8 @@ static void uarte_nrfx_isr_async(const void *arg) struct uarte_async_rx *async_rx = &data->async->rx; uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); - if ((IS_CBWT(dev) || - !(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT))) && - event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { + if (!(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) + && event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { rxdrdy_isr(dev); } @@ -2753,12 +1961,6 @@ static void uarte_nrfx_isr_async(const void *arg) rxstarted_isr(dev); } -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev) && - event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask)) { - cbwt_rxto_isr(dev, true); - } else -#endif /* RXTO must be handled after ENDRX which should notify the buffer. * Skip if ENDRX is set when RXTO is set. It means that * ENDRX occurred after check for ENDRX in isr which may happen when @@ -2783,8 +1985,7 @@ static void uarte_nrfx_isr_async(const void *arg) txstopped_isr(dev); } - if (!IS_CBWT(dev) && - (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO)) { + if (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO) { #ifdef CONFIG_HAS_NORDIC_DMM int ret; @@ -2799,7 +2000,7 @@ static void uarte_nrfx_isr_async(const void *arg) rx_buf_release(dev, async_rx->buf); async_rx->buf_len = 0; async_rx->buf = NULL; - rx_disable_finalize(dev); + notify_rx_disable(dev); } } @@ -3413,46 +2614,6 @@ static int uarte_instance_init(const struct device *dev, return pm_device_driver_init(dev, uarte_nrfx_pm_action); } - -#define UARTE_TIMER_REG(idx) (NRF_TIMER_Type *)DT_REG_ADDR(DT_PHANDLE(UARTE(idx), timer)) - -#define UARTE_TIMER_IRQN(idx) DT_IRQN(DT_PHANDLE(UARTE(idx), timer)) - -#define UARTE_TIMER_IRQ_PRIO(idx) DT_IRQ(DT_PHANDLE(UARTE(idx), timer), priority) - -#define UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx) \ - IF_ENABLED(UARTE_HAS_PROP(idx, timer), \ - (.timer_regs = UARTE_TIMER_REG(idx), \ - .timer_irqn = UARTE_TIMER_IRQN(idx), \ - .uarte_irqn = DT_IRQN(UARTE(idx)), \ - .bounce_buf = { \ - uart##idx##_bounce_buf, \ - &uart##idx##_bounce_buf[sizeof(uart##idx##_bounce_buf) / 2] \ - }, \ - .bounce_buf_len = sizeof(uart##idx##_bounce_buf) / 2, \ - .bounce_buf_swap_len = UARTE_BUF_SWAP_LEN(sizeof(uart##idx##_bounce_buf) / 2,\ - UARTE_US_TO_BYTES(UARTE_PROP(idx, current_speed))), \ - .cbwt_data = &uart##idx##_bounce_data,)) - -#define UARTE_COUNT_BYTES_WITH_TIMER_VALIDATE_CONFIG(idx) \ - __ASSERT_NO_MSG(UARTE_TIMER_IRQ_PRIO(idx) == DT_IRQ(UARTE(idx), priority)) - -#define UARTE_TIMER_IRQ_CONNECT(idx, func) \ - IF_ENABLED(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ - UARTE_HAS_PROP(idx, timer)), \ - (UARTE_COUNT_BYTES_WITH_TIMER_VALIDATE_CONFIG(idx); \ - IRQ_CONNECT(UARTE_TIMER_IRQN(idx), UARTE_TIMER_IRQ_PRIO(idx), func, \ - DEVICE_DT_GET(UARTE(idx)), 0); \ - irq_enable(UARTE_TIMER_IRQN(idx));)) - -/* Macro sets flag to indicate that uart use different interrupt priority than the system clock. */ -#define UARTE_HAS_VAR_PRIO(idx) \ - COND_CODE_1(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ - UARTE_HAS_PROP(idx, timer)), \ - ((DT_IRQ(UARTE(idx), priority) != DT_IRQ(DT_NODELABEL(grtc), priority)) ? \ - UARTE_CFG_FLAG_VAR_IRQ : 0), (0)) - - #define UARTE_GET_ISR(idx) \ COND_CODE_1(CONFIG_UART_##idx##_ASYNC, (uarte_nrfx_isr_async), (uarte_nrfx_isr_int)) @@ -3468,18 +2629,16 @@ static int uarte_instance_init(const struct device *dev, )) /* Depending on configuration standard or direct IRQ is connected. */ -#define UARTE_IRQ_CONNECT(idx, irqn, prio) \ - COND_CODE_1(CONFIG_UART_NRFX_UARTE_NO_IRQ, (), \ - (COND_CODE_1(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, \ - (IRQ_DIRECT_CONNECT(irqn, prio, uarte_##idx##_direct_isr, 0)), \ - (IRQ_CONNECT(irqn, prio, UARTE_GET_ISR(idx), \ - DEVICE_DT_GET(UARTE(idx)), 0))))) +#define UARTE_IRQ_CONNECT(idx, irqn, prio) \ + COND_CODE_1(CONFIG_UART_NRFX_UARTE_NO_IRQ, (), \ + (COND_CODE_1(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, \ + (IRQ_DIRECT_CONNECT(irqn, prio, uarte_##idx##_direct_isr, 0)), \ + (IRQ_CONNECT(irqn, prio, UARTE_GET_ISR(idx), DEVICE_DT_GET(UARTE(idx)), 0))))) #define UARTE_IRQ_CONFIGURE(idx) \ do { \ UARTE_IRQ_CONNECT(idx, DT_IRQN(UARTE(idx)), DT_IRQ(UARTE(idx), priority)); \ irq_enable(DT_IRQN(UARTE(idx))); \ - UARTE_TIMER_IRQ_CONNECT(idx, timer_isr) \ } while (false) /* Low power mode is used when disable_rx is not defined or in async mode if @@ -3570,12 +2729,6 @@ static int uarte_instance_init(const struct device *dev, UARTE_INT_DRIVEN(idx); \ PINCTRL_DT_DEFINE(UARTE(idx)); \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, ( \ - IF_ENABLED(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ - UARTE_HAS_PROP(idx, timer)), \ - (static uint8_t uart##idx##_bounce_buf[CONFIG_UART_NRFX_UARTE_BOUNCE_BUF_LEN] \ - DMM_MEMORY_SECTION(UARTE(idx)); \ - static struct uarte_async_rx_cbwt uart##idx##_bounce_data; \ - )) \ static uint8_t \ uarte##idx##_tx_cache[CONFIG_UART_ASYNC_TX_CACHE_SIZE] \ DMM_MEMORY_SECTION(UARTE(idx)); \ @@ -3617,10 +2770,6 @@ static int uarte_instance_init(const struct device *dev, (IS_ENABLED(CONFIG_UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND) && \ INSTANCE_IS_HIGH_SPEED(_, /*empty*/, idx, _) ? \ UARTE_CFG_FLAG_SPURIOUS_RXTO : 0) | \ - ((IS_ENABLED(UARTE_BAUDRATE_RETENTION_WORKAROUND) && \ - UARTE_IS_CACHEABLE(idx)) ? \ - UARTE_CFG_FLAG_VOLATILE_BAUDRATE : 0) | \ - UARTE_HAS_VAR_PRIO(idx) | \ USE_LOW_POWER(idx), \ UARTE_DISABLE_RX_INIT(UARTE(idx)), \ .poll_out_byte = &uarte##idx##_poll_out_byte, \ @@ -3628,8 +2777,6 @@ static int uarte_instance_init(const struct device *dev, IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ (.tx_cache = uarte##idx##_tx_cache, \ .rx_flush_buf = uarte##idx##_flush_buf,)) \ - IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ - (UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx))) \ IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ (.timer = NRFX_TIMER_INSTANCE( \ CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ @@ -3681,4 +2828,5 @@ static int uarte_instance_init(const struct device *dev, #define COND_UART_NRF_UARTE_DEVICE(unused, prefix, i, _) \ IF_ENABLED(CONFIG_HAS_HW_NRF_UARTE##prefix##i, (UART_NRF_UARTE_DEVICE(prefix##i);)) + UARTE_FOR_EACH_INSTANCE(COND_UART_NRF_UARTE_DEVICE, (), ()) From 70d95c6ca732356218cd8f49d6bf148d00c214a1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 367/881] Revert "[nrf fromlist] drivers: serial: nrfx_uarte: Prepare code for extension" This reverts commit d3fb28f406efd0b218b85a5e749be9a95992260b. Signed-off-by: Jukka Rissanen --- drivers/serial/uart_nrfx_uarte.c | 133 ++++++++++++++----------------- 1 file changed, 61 insertions(+), 72 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 995d1113473..cf864a59429 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -875,78 +875,6 @@ static void tx_start(const struct device *dev, const uint8_t *buf, size_t len) static void rx_timeout(struct k_timer *timer); static void tx_timeout(struct k_timer *timer); -static void user_callback(const struct device *dev, struct uart_event *evt) -{ - struct uarte_nrfx_data *data = dev->data; - - if (data->async->user_callback) { - data->async->user_callback(dev, evt, data->async->user_data); - } -} - -static void rx_buf_release(const struct device *dev, uint8_t *buf) -{ - struct uart_event evt = { - .type = UART_RX_BUF_RELEASED, - .data.rx_buf.buf = buf, - }; - - user_callback(dev, &evt); -} - -static void notify_rx_disable(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uart_event evt = { - .type = UART_RX_DISABLED, - }; - - if (LOW_POWER_ENABLED(cfg)) { - uint32_t key = irq_lock(); - - uarte_disable_locked(dev, UARTE_FLAG_LOW_POWER_RX); - irq_unlock(key); - } - - user_callback(dev, (struct uart_event *)&evt); - - /* runtime PM is put after the callback. In case uart is re-enabled from that - * callback we avoid suspending/resuming the device. - */ - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put_async(dev, K_NO_WAIT); - } -} - -static int uarte_nrfx_rx_disable(const struct device *dev) -{ - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - int key; - - if (async_rx->buf == NULL) { - return -EFAULT; - } - - k_timer_stop(&async_rx->timer); - - key = irq_lock(); - - if (async_rx->next_buf != NULL) { - nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - } - - async_rx->enabled = false; - async_rx->discard_fifo = true; - - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - irq_unlock(key); - - return 0; -} - #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -1145,6 +1073,15 @@ static int uarte_nrfx_tx_abort(const struct device *dev) return 0; } +static void user_callback(const struct device *dev, struct uart_event *evt) +{ + struct uarte_nrfx_data *data = dev->data; + + if (data->async->user_callback) { + data->async->user_callback(dev, evt, data->async->user_data); + } +} + static void notify_uart_rx_rdy(const struct device *dev, size_t len) { struct uarte_nrfx_data *data = dev->data; @@ -1158,6 +1095,29 @@ static void notify_uart_rx_rdy(const struct device *dev, size_t len) user_callback(dev, &evt); } +static void rx_buf_release(const struct device *dev, uint8_t *buf) +{ + struct uart_event evt = { + .type = UART_RX_BUF_RELEASED, + .data.rx_buf.buf = buf, + }; + + user_callback(dev, &evt); +} + +static void notify_rx_disable(const struct device *dev) +{ + struct uart_event evt = { + .type = UART_RX_DISABLED, + }; + + user_callback(dev, (struct uart_event *)&evt); + + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put_async(dev, K_NO_WAIT); + } +} + #ifdef UARTE_HAS_FRAME_TIMEOUT static uint32_t us_to_bauds(uint32_t baudrate, int32_t timeout) { @@ -1384,6 +1344,35 @@ static int uarte_nrfx_callback_set(const struct device *dev, return 0; } +static int uarte_nrfx_rx_disable(const struct device *dev) +{ + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + int key; + + if (async_rx->buf == NULL) { + return -EFAULT; + } + + k_timer_stop(&async_rx->timer); + + key = irq_lock(); + + if (async_rx->next_buf != NULL) { + nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + } + + async_rx->enabled = false; + async_rx->discard_fifo = true; + + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + irq_unlock(key); + + return 0; +} + static void tx_timeout(struct k_timer *timer) { const struct device *dev = k_timer_user_data_get(timer); From f39148322a65ba15f962c6caf4da1786e3453582 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 368/881] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Optimize test data handling" This reverts commit 29526b1e69a2ac46c13da6ca44251bdaa73f14e1. Signed-off-by: Jukka Rissanen --- tests/drivers/uart/uart_async_dual/src/main.c | 152 +++++++----------- 1 file changed, 58 insertions(+), 94 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index 160d8c76104..c2ad5d8a0a0 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -61,25 +61,6 @@ ZTEST_DMEM struct dut_data duts[] = { #endif }; -/* Array that contains potential payload. It is used to memcmp against incoming packets. */ -static const uint8_t test_buf[256] = { - 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, - 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, - 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, - 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, - 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, - 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, - 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, - 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, - 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, - 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, - 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, - 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, - 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, - 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, - 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, - 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; - static void pm_check(const struct device *dev, const struct device *second_dev, bool exp_on, int line) { @@ -147,8 +128,6 @@ enum test_rx_mode { RX_ALL, }; -typedef bool (*test_on_rx_rdy_t)(const struct device *dev, uint8_t *buf, size_t len); - struct test_rx_data { uint8_t hdr[1]; uint8_t buf[256]; @@ -161,7 +140,6 @@ struct test_rx_data { struct k_sem sem; uint32_t timeout; uint32_t buf_idx; - test_on_rx_rdy_t on_rx_rdy; }; static struct test_tx_data tx_data; @@ -299,86 +277,75 @@ static void on_tx_done(const struct device *dev, struct uart_event *evt) try_tx(dev, true); } -static bool on_rx_rdy_rx_all(const struct device *dev, uint8_t *buf, size_t len) +static void on_rx_rdy(const struct device *dev, struct uart_event *evt) { - bool ok; - - if (rx_data.payload_idx == 0) { - rx_data.payload_idx = buf[0] - 1; - buf++; - len--; - } - - ok = memcmp(buf, &test_buf[256 - rx_data.payload_idx], len) == 0; - rx_data.payload_idx -= len; - - return ok; -} - -static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len); - -static bool on_rx_rdy_payload(const struct device *dev, uint8_t *buf, size_t len) -{ - bool ok; + uint32_t len = evt->data.rx.len; + uint32_t off = evt->data.rx.offset; int err; - ok = memcmp(buf, &test_buf[255 - rx_data.payload_idx], len) == 0; - if (!ok) { - for (int i = 0; i < len; i++) { - if (buf[i] != test_buf[255 - rx_data.payload_idx + i]) { - zassert_true(false, "Byte %d expected: %02x got: %02x", - i, buf[i], test_buf[255 - rx_data.payload_idx + i]); - } - } - rx_data.cont = false; - tx_data.cont = false; - zassert_true(ok); - return false; + if (!rx_data.cont) { + return; } - rx_data.payload_idx -= len; - - if (rx_data.payload_idx == 0) { - rx_data.state = RX_HDR; - rx_data.on_rx_rdy = on_rx_rdy_hdr; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - rx_data.buf_req = false; + rx_data.rx_cnt += evt->data.rx.len; + if (evt->data.rx.buf == rx_data.hdr) { + if (rx_data.hdr[0] == 1) { + /* single byte packet. */ err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); zassert_equal(err, 0); + return; } - } - - return true; -} - -static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) -{ - int err; - zassert_equal(buf, rx_data.hdr); - zassert_equal(len, 1); - if (rx_data.hdr[0] == 1) { - /* single byte packet. */ + zassert_equal(rx_data.payload_idx, 0); + rx_data.state = RX_PAYLOAD; + rx_data.payload_idx = rx_data.hdr[0] - 1; if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); + size_t l = rx_data.hdr[0] - 1; + + zassert_true(l > 0); + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.buf, rx_data.hdr[0] - 1); } - return true; - } + } else { + for (int i = 0; i < len; i++) { + bool ok; - zassert_equal(rx_data.payload_idx, 0); - rx_data.on_rx_rdy = on_rx_rdy_payload; - rx_data.payload_idx = rx_data.hdr[0] - 1; - rx_data.state = RX_PAYLOAD; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - size_t l = rx_data.hdr[0] - 1; + if ((rx_data.mode == RX_ALL) && (rx_data.payload_idx == 0)) { + rx_data.payload_idx = evt->data.rx.buf[off + i]; + ok = true; + } else { + ok = evt->data.rx.buf[off + i] == (uint8_t)rx_data.payload_idx; + } - zassert_true(l > 0); - rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.buf, buf[0] - 1); - } + if (!ok) { + LOG_ERR("Unexpected data at %d, exp:%02x got:%02x", + i, rx_data.payload_idx, evt->data.rx.buf[off + i]); + } - return true; + zassert_true(ok, "Unexpected data at %d, exp:%02x got:%02x", + i, len - i, evt->data.rx.buf[off + i]); + if (!ok) { + rx_data.cont = false; + tx_data.cont = false; + /* Avoid flood of errors as we are in the interrupt and ztest + * cannot abort from here. + */ + return; + } + rx_data.payload_idx--; + if (rx_data.payload_idx == 0) { + if (rx_data.mode != RX_ALL) { + zassert_equal(i + 1, len, "len:%d i:%d", len, i); + } + rx_data.state = RX_HDR; + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); + } + } + } + } } static void on_rx_buf_req(const struct device *dev) @@ -418,6 +385,7 @@ static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *us return; } + zassert_true(len > 0); err = uart_rx_enable(dev, buf, len, data->timeout); zassert_equal(err, 0, "Unexpected err:%d", err); @@ -449,11 +417,7 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void break; case UART_RX_RDY: zassert_true(dev == rx_dev); - if (rx_data.cont) { - rx_data.on_rx_rdy(dev, &evt->data.rx.buf[evt->data.rx.offset], - evt->data.rx.len); - rx_data.rx_cnt += evt->data.rx.len; - } + on_rx_rdy(dev, evt); break; case UART_RX_BUF_RELEASED: zassert_true(dev == rx_dev); @@ -552,7 +516,7 @@ static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, tx_data.rx_timeout = rx_data.timeout; rx_data.cont = true; rx_data.rx_cnt = 0; - rx_data.on_rx_rdy = rx_mode == RX_ALL ? on_rx_rdy_rx_all : on_rx_rdy_hdr; + rx_data.state = RX_HDR; rx_data.mode = rx_mode; ring_buf_init(&tx_data.rbuf, sizeof(tx_data.buf), tx_data.buf); From 30f4a18f2a44c135342dfebe7d2f72fadc66073e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 369/881] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Extend nrf54h20dk configuration" This reverts commit 95ceeea1d07954d763c357cbe667def4ea1fd17f. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 22 ------------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 12 ---------- 2 files changed, 34 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi index 84ad9194e62..79dac0ca960 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -60,16 +60,6 @@ }; }; -&timer134 { - status = "reserved"; -}; - -&dppic135 { - owned-channels = <0>; - source-channels = <0>; - status = "okay"; -}; - dut: &uart134 { status = "okay"; current-speed = <115200>; @@ -77,7 +67,6 @@ dut: &uart134 { pinctrl-1 = <&uart134_alt_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; - timer = <&timer134>; zephyr,pm-device-runtime-auto; }; @@ -91,23 +80,12 @@ dut_aux: &uart137 { zephyr,pm-device-runtime-auto; }; -&dppic120 { - owned-channels = <0>; - source-channels = <0>; - status = "okay"; -}; - -&timer120 { - status = "reserved"; -}; - dut2: &uart120 { pinctrl-0 = <&uart120_default_alt>; pinctrl-1 = <&uart120_sleep_alt>; pinctrl-names = "default", "sleep"; current-speed = <115200>; hw-flow-control; - timer = <&timer120>; zephyr,pm-device-runtime-auto; }; diff --git a/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 65a2c52016e..fcdc838a54e 100644 --- a/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -9,15 +9,3 @@ status = "reserved"; interrupt-parent = <&cpuppr_clic>; }; - -&timer134 { - interrupt-parent = <&cpuppr_clic>; -}; - -&dppic135 { - child-owned-channels = <0>; -}; - -&uart136 { - current-speed = <1000000>; -}; From 653374828879fd15b1179e892a27bf3d97dedeb0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 370/881] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Update configuration for nrf54l" This reverts commit 9880309e77a33c49f91906f9355d845f11984432. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 7 ------- 2 files changed, 8 deletions(-) diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index d8995e36971..a1e29cbf0ff 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -42,7 +42,6 @@ dut: &uart21 { pinctrl-1 = <&uart21_sleep_alt>; pinctrl-names = "default", "sleep"; current-speed = <115200>; - timer = <&timer21>; }; dut2: &uart00 { diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 69c5c183096..cd064941153 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -38,10 +38,6 @@ }; }; -&timer21 { - status = "reserved"; -}; - dut: &uart21 { status = "okay"; current-speed = <115200>; @@ -49,8 +45,6 @@ dut: &uart21 { pinctrl-1 = <&uart21_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; - timer = <&timer21>; - zephyr,pm-device-runtime-auto; }; dut_aux: &uart22 { @@ -60,7 +54,6 @@ dut_aux: &uart22 { pinctrl-1 = <&uart22_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; - zephyr,pm-device-runtime-auto; }; &timer20 { From 57e962224a78e56ed1ff77fadc32e920031796fd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:16 +0300 Subject: [PATCH 371/881] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Extend testing" This reverts commit bac4ea5d135b521c269cbceb231467468e0b49a6. Signed-off-by: Jukka Rissanen --- tests/drivers/uart/uart_async_dual/Kconfig | 8 - tests/drivers/uart/uart_async_dual/src/main.c | 218 ++++-------------- .../uart/uart_async_dual/testcase.yaml | 15 -- 3 files changed, 50 insertions(+), 191 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/Kconfig b/tests/drivers/uart/uart_async_dual/Kconfig index f0087aa48e3..6e80ec3a795 100644 --- a/tests/drivers/uart/uart_async_dual/Kconfig +++ b/tests/drivers/uart/uart_async_dual/Kconfig @@ -16,13 +16,5 @@ config PM_RUNTIME_IN_TEST select PM_DEVICE select PM_DEVICE_RUNTIME -config TEST_CHOPPED_TX - bool "Test chopped TX data" - default y - help - When enabled then test cases that transmits TX packets in random chunks are - performed. Some driver implementation do not support case when new TX data - collides with handling of the RX timeout. - # Include Zephyr's Kconfig source "Kconfig" diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index c2ad5d8a0a0..d14e0f88a11 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -28,10 +28,9 @@ LOG_MODULE_REGISTER(test); #endif #define TX_TIMEOUT 100000 -#define RX_TIMEOUT_BYTES 50 +#define RX_TIMEOUT 2000 #define MAX_PACKET_LEN 128 -#define MIN_PACKET_LEN 10 struct dut_data { const struct device *dev; @@ -101,7 +100,6 @@ static const struct device *tx_dev; enum test_tx_mode { TX_BULK, TX_PACKETS, - TX_CHOPPED, }; struct test_tx_data { @@ -113,8 +111,6 @@ struct test_tx_data { volatile bool cont; volatile enum test_tx_mode mode; struct k_sem sem; - uint32_t idx; - uint32_t rx_timeout; }; enum test_rx_state { @@ -125,21 +121,17 @@ enum test_rx_state { enum test_rx_mode { RX_CONT, RX_DIS, - RX_ALL, }; struct test_rx_data { uint8_t hdr[1]; uint8_t buf[256]; uint32_t rx_cnt; - uint32_t payload_idx; enum test_rx_state state; enum test_rx_mode mode; volatile bool cont; bool buf_req; struct k_sem sem; - uint32_t timeout; - uint32_t buf_idx; }; static struct test_tx_data tx_data; @@ -151,8 +143,8 @@ static void fill_tx(struct test_tx_data *data) uint32_t len; int err; - if (data->mode != TX_BULK) { - err = k_sem_take(&data->sem, K_MSEC(200)); + if (data->mode == TX_PACKETS) { + err = k_sem_take(&data->sem, K_MSEC(100)); if (err < 0 && !data->cont) { return; } @@ -161,10 +153,9 @@ static void fill_tx(struct test_tx_data *data) uint8_t len = sys_rand8_get(); len = len % MAX_PACKET_LEN; - len = MAX(MIN_PACKET_LEN, len); + len = MAX(2, len); data->packet_len = len; - data->idx = 0; for (int i = 0; i < len; i++) { data->buf[i] = len - i; } @@ -172,11 +163,12 @@ static void fill_tx(struct test_tx_data *data) return; } - while ((len = ring_buf_put_claim(&data->rbuf, &buf, 255)) > 0) { + while ((len = ring_buf_put_claim(&data->rbuf, &buf, 255)) > 1) { uint8_t r = (sys_rand8_get() % MAX_PACKET_LEN) % len; - uint8_t packet_len = MAX(r, MIN_PACKET_LEN); + uint8_t packet_len = MAX(r, 2); + uint8_t rem = len - packet_len; - packet_len = (len <= MIN_PACKET_LEN) ? len : packet_len; + packet_len = (rem < 3) ? len : packet_len; buf[0] = packet_len; for (int i = 1; i < packet_len; i++) { buf[i] = packet_len - i; @@ -197,7 +189,7 @@ static void try_tx(const struct device *dev, bool irq) return; } - if (tx_data.mode == TX_PACKETS) { + if ((tx_data.mode == TX_PACKETS) && (tx_data.packet_len > 0)) { uint8_t len = tx_data.packet_len; tx_data.packet_len = 0; @@ -207,50 +199,19 @@ static void try_tx(const struct device *dev, bool irq) err, irq, tx_data.cont); return; } + zassert_true(tx_data.mode == TX_BULK); - if (tx_data.mode == TX_BULK) { - if (!atomic_cas(&tx_data.busy, 0, 1)) { - return; - } - - len = ring_buf_get_claim(&tx_data.rbuf, &buf, 255); - if (len > 0) { - err = uart_tx(dev, buf, len, TX_TIMEOUT); - zassert_equal(err, 0, - "Unexpected err:%d irq:%d cont:%d\n", - err, irq, tx_data.cont); - } else { - tx_data.busy = 0; - } + if (!atomic_cas(&tx_data.busy, 0, 1)) { return; } - zassert_true(tx_data.mode == TX_CHOPPED); - - uint32_t rem = tx_data.packet_len - tx_data.idx; - - if (tx_data.packet_len > 12) { - len = sys_rand8_get() % (tx_data.packet_len / 4); - } else { - len = 0; + len = ring_buf_get_claim(&tx_data.rbuf, &buf, 255); + if (len > 0) { + err = uart_tx(dev, buf, len, TX_TIMEOUT); + zassert_equal(err, 0, + "Unexpected err:%d irq:%d cont:%d\n", + err, irq, tx_data.cont); } - len = MAX(3, len); - len = MIN(rem, len); - - buf = &tx_data.buf[tx_data.idx]; - tx_data.idx += len; - - err = uart_tx(dev, buf, len, TX_TIMEOUT); - zassert_equal(err, 0, - "Unexpected err:%d irq:%d cont:%d\n", - err, irq, tx_data.cont); -} - -static void tx_backoff(uint32_t rx_timeout) -{ - uint32_t delay = (rx_timeout / 2) + (sys_rand32_get() % rx_timeout); - - k_busy_wait(delay); } static void on_tx_done(const struct device *dev, struct uart_event *evt) @@ -260,17 +221,6 @@ static void on_tx_done(const struct device *dev, struct uart_event *evt) return; } - if (tx_data.mode == TX_CHOPPED) { - if (tx_data.idx == tx_data.packet_len) { - k_sem_give(&tx_data.sem); - } else { - - tx_backoff(tx_data.rx_timeout); - try_tx(dev, true); - } - return; - } - /* Finish previous data chunk and start new if any pending. */ ring_buf_get_finish(&tx_data.rbuf, evt->data.tx.len); atomic_set(&tx_data.busy, 0); @@ -289,16 +239,7 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) rx_data.rx_cnt += evt->data.rx.len; if (evt->data.rx.buf == rx_data.hdr) { - if (rx_data.hdr[0] == 1) { - /* single byte packet. */ - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); - return; - } - - zassert_equal(rx_data.payload_idx, 0); rx_data.state = RX_PAYLOAD; - rx_data.payload_idx = rx_data.hdr[0] - 1; if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { size_t l = rx_data.hdr[0] - 1; @@ -307,19 +248,16 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) err = uart_rx_buf_rsp(dev, rx_data.buf, rx_data.hdr[0] - 1); } } else { - for (int i = 0; i < len; i++) { - bool ok; + /* Payload received */ + rx_data.state = RX_HDR; + zassert_equal(len, rx_data.hdr[0] - 1); - if ((rx_data.mode == RX_ALL) && (rx_data.payload_idx == 0)) { - rx_data.payload_idx = evt->data.rx.buf[off + i]; - ok = true; - } else { - ok = evt->data.rx.buf[off + i] == (uint8_t)rx_data.payload_idx; - } + for (int i = 0; i < len; i++) { + bool ok = evt->data.rx.buf[off + i] == (uint8_t)(len - i); if (!ok) { LOG_ERR("Unexpected data at %d, exp:%02x got:%02x", - i, rx_data.payload_idx, evt->data.rx.buf[off + i]); + i, len - i, evt->data.rx.buf[off + i]); } zassert_true(ok, "Unexpected data at %d, exp:%02x got:%02x", @@ -332,52 +270,21 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) */ return; } - rx_data.payload_idx--; - if (rx_data.payload_idx == 0) { - if (rx_data.mode != RX_ALL) { - zassert_equal(i + 1, len, "len:%d i:%d", len, i); - } - rx_data.state = RX_HDR; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); - } - } + } + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); } } } -static void on_rx_buf_req(const struct device *dev) -{ - if (rx_data.mode != RX_ALL) { - rx_data.buf_req = true; - return; - } - - size_t len = sizeof(rx_data.buf) / 2; - uint8_t *buf = &rx_data.buf[len * rx_data.buf_idx]; - - rx_data.buf_idx = (rx_data.buf_idx + 1) & 0x1; - uart_rx_buf_rsp(dev, buf, len); -} - static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *user_data) { ARG_UNUSED(evt); struct test_rx_data *data = user_data; int err; - uint8_t *buf; - uint32_t len; - - if (data->mode == RX_ALL) { - buf = data->buf; - len = sizeof(data->buf) / 2; - } else { - buf = (data->state == RX_HDR) ? data->hdr : data->buf; - len = (data->state == RX_HDR) ? 1 : (data->hdr[0] - 1); - data->buf_idx = 1; - } + uint8_t *buf = (data->state == RX_HDR) ? data->hdr : data->buf; + uint32_t len = (data->state == RX_HDR) ? 1 : (data->hdr[0] - 1); data->buf_req = false; @@ -387,7 +294,7 @@ static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *us zassert_true(len > 0); - err = uart_rx_enable(dev, buf, len, data->timeout); + err = uart_rx_enable(dev, buf, len, RX_TIMEOUT); zassert_equal(err, 0, "Unexpected err:%d", err); } @@ -423,8 +330,8 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void zassert_true(dev == rx_dev); break; case UART_RX_BUF_REQUEST: + rx_data.buf_req = true; zassert_true(dev == rx_dev); - on_rx_buf_req(dev); break; case UART_RX_DISABLED: zassert_true(dev == rx_dev); @@ -439,7 +346,7 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void } } -static void config_baudrate(uint32_t rate, bool hwfc) +static void config_baudrate(uint32_t rate) { struct uart_config config; int err; @@ -447,7 +354,6 @@ static void config_baudrate(uint32_t rate, bool hwfc) err = uart_config_get(rx_dev, &config); zassert_equal(err, 0, "Unexpected err:%d", err); - config.flow_ctrl = hwfc ? UART_CFG_FLOW_CTRL_RTS_CTS : UART_CFG_FLOW_CTRL_NONE; config.baudrate = rate; err = uart_configure(rx_dev, &config); @@ -490,14 +396,13 @@ static void report_progress(uint32_t start) * * Test has busy simulator running if it is enabled in the configuration. */ -static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, - enum test_rx_mode rx_mode, bool hwfc) +static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) { int err; uint32_t load = 0; uint32_t start = k_uptime_get_32(); - config_baudrate(baudrate, hwfc); + config_baudrate(baudrate); if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { uint32_t active_avg = (baudrate == 1000000) ? 5 : 30; @@ -509,15 +414,13 @@ static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, memset(&tx_data, 0, sizeof(tx_data)); memset(&rx_data, 0, sizeof(rx_data)); tx_data.cont = true; - tx_data.mode = tx_mode; - k_sem_init(&tx_data.sem, (tx_mode != TX_BULK) ? 1 : 0, 1); + tx_data.mode = tx_packets ? TX_PACKETS : TX_BULK; + k_sem_init(&tx_data.sem, tx_packets ? 1 : 0, 1); - rx_data.timeout = (RX_TIMEOUT_BYTES * 1000000 * 10) / baudrate; - tx_data.rx_timeout = rx_data.timeout; rx_data.cont = true; rx_data.rx_cnt = 0; rx_data.state = RX_HDR; - rx_data.mode = rx_mode; + rx_data.mode = cont ? RX_CONT : RX_DIS; ring_buf_init(&tx_data.rbuf, sizeof(tx_data.buf), tx_data.buf); @@ -556,82 +459,62 @@ static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, /* Flush all TX data that may be already started. */ k_msleep(10); - (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); + (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), RX_TIMEOUT); k_msleep(10); (void)uart_rx_disable(rx_dev); k_msleep(10); TC_PRINT("Received %d bytes for %d ms, CPU load:%d.%d\n", rx_data.rx_cnt, CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT, load / 10, load % 10); - zassert_true(rx_data.rx_cnt > 1000, "Unexpected RX cnt: %d", rx_data.rx_cnt); + zassert_true(rx_data.rx_cnt > 1000, "Unexected RX cnt: %d", rx_data.rx_cnt); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_dis_hwfc) { /* TX in bulk mode, RX in DIS mode, 115k2 */ - var_packet(115200, TX_BULK, RX_DIS, true); + var_packet_hwfc(115200, false, false); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_cont_hwfc) { /* TX in bulk mode, RX in CONT mode, 115k2 */ - var_packet(115200, TX_BULK, RX_CONT, true); + var_packet_hwfc(115200, false, true); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_dis_hwfc_1m) { /* TX in bulk mode, RX in DIS mode, 1M */ - var_packet(1000000, TX_BULK, RX_DIS, true); + var_packet_hwfc(1000000, false, false); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_cont_hwfc_1m) { /* TX in bulk mode, RX in CONT mode, 1M */ - var_packet(1000000, TX_BULK, RX_CONT, true); + var_packet_hwfc(1000000, false, true); } ZTEST(uart_async_dual, test_var_packets_dis_hwfc) { /* TX in packet mode, RX in DIS mode, 115k2 */ - var_packet(115200, TX_PACKETS, RX_DIS, true); + var_packet_hwfc(115200, true, false); } ZTEST(uart_async_dual, test_var_packets_cont_hwfc) { /* TX in packet mode, RX in CONT mode, 115k2 */ - var_packet(115200, TX_PACKETS, RX_CONT, true); + var_packet_hwfc(115200, true, true); } ZTEST(uart_async_dual, test_var_packets_dis_hwfc_1m) { /* TX in packet mode, RX in DIS mode, 1M */ - var_packet(1000000, TX_PACKETS, RX_DIS, true); + var_packet_hwfc(1000000, true, false); } ZTEST(uart_async_dual, test_var_packets_cont_hwfc_1m) { /* TX in packet mode, RX in CONT mode, 1M */ - var_packet(1000000, TX_PACKETS, RX_CONT, true); -} - -ZTEST(uart_async_dual, test_var_packets_chopped_all) -{ - if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { - ztest_test_skip(); - } - - /* TX in chopped mode, RX in receive ALL mode, 115k2 */ - var_packet(115200, TX_CHOPPED, RX_ALL, false); -} - -ZTEST(uart_async_dual, test_var_packets_chopped_all_1m) -{ - if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { - ztest_test_skip(); - } - - /* TX in chopped mode, RX in receive ALL mode, 1M */ - var_packet(1000000, TX_CHOPPED, RX_ALL, false); + var_packet_hwfc(1000000, true, true); } static void hci_like_callback(const struct device *dev, struct uart_event *evt, void *user_data) @@ -680,7 +563,7 @@ static bool rx(uint8_t *buf, size_t len) { int err; - err = uart_rx_enable(rx_dev, buf, len, rx_data.timeout); + err = uart_rx_enable(rx_dev, buf, len, RX_TIMEOUT); zassert_equal(err, 0, "Unexpected err:%d", err); err = k_sem_take(&rx_data.sem, K_MSEC(100)); @@ -868,7 +751,7 @@ static void hci_like_test(uint32_t baudrate) int err; uint32_t load = 0; - config_baudrate(baudrate, true); + config_baudrate(baudrate); if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { uint32_t active_avg = (baudrate == 1000000) ? 10 : 50; @@ -882,7 +765,6 @@ static void hci_like_test(uint32_t baudrate) tx_data.cnt = 0; tx_data.cont = true; rx_data.cont = true; - rx_data.timeout = (RX_TIMEOUT_BYTES * 1000000 * 10) / baudrate; k_sem_init(&tx_data.sem, 1, 1); k_sem_init(&rx_data.sem, 0, 1); @@ -920,7 +802,7 @@ static void hci_like_test(uint32_t baudrate) k_msleep(10); PM_CHECK(tx_dev, rx_dev, false); - (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); + (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), RX_TIMEOUT); k_msleep(1); (void)uart_rx_disable(rx_dev); diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index 1722d5e5e7d..1a2d811bbfe 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -73,18 +73,3 @@ tests: - nrf52_bsim extra_configs: - CONFIG_PM_RUNTIME_IN_TEST=y - drivers.uart.async_dual.no_tx_chopped: - harness: ztest - harness_config: - fixture: uart_loopback - depends_on: gpio - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr - - nrf9160dk/nrf9160 - - nrf52_bsim - extra_configs: - - CONFIG_TEST_CHOPPED_TX=n - - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER=n From 996b1725a2fc141aa01c31af82be964b71a62023 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 372/881] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Add progress report" This reverts commit 249e3bf5abbe03e3a493915ca89b3ad585207022. Signed-off-by: Jukka Rissanen --- tests/drivers/uart/uart_async_dual/src/main.c | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index d14e0f88a11..37ce73120ac 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -365,26 +365,6 @@ static void config_baudrate(uint32_t rate) } } -static void report_progress(uint32_t start) -{ - static const uint32_t inc = CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT / 20; - static uint32_t next; - static uint32_t progress; - - if ((k_uptime_get_32() - start < inc) && progress) { - /* Reset state. */ - next = inc; - progress = 0; - } - - if (k_uptime_get_32() > (start + next)) { - progress += 5; - TC_PRINT("\r%d%%", progress); - next += inc; - } -} - - /* Test is running following scenario. Transmitter is sending packets which * has 1 byte header with length followed by the payload. Transmitter can send * packets in two modes: bulk where data is send in chunks without gaps between @@ -400,7 +380,6 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) { int err; uint32_t load = 0; - uint32_t start = k_uptime_get_32(); config_baudrate(baudrate); @@ -441,10 +420,8 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) while (tx_data.cont || rx_data.cont) { fill_tx(&tx_data); k_msleep(1); - report_progress(start); try_tx(tx_dev, false); } - TC_PRINT("\n"); if (IS_ENABLED(CONFIG_CPU_LOAD)) { load = cpu_load_get(true); @@ -676,7 +653,6 @@ static void hci_like_rx(void) uint8_t len; bool cont; bool explicit_pm = IS_ENABLED(CONFIG_PM_RUNTIME_IN_TEST); - uint32_t start = k_uptime_get_32(); while (1) { if (explicit_pm) { @@ -728,9 +704,7 @@ static void hci_like_rx(void) PM_CHECK(rx_dev, tx_dev, false); check_payload(rx_data.buf, len); - report_progress(start); } - TC_PRINT("\n"); } #define HCI_LIKE_TX_STACK_SIZE 2048 From e285590d675c955ec71fdfa37e9ef02a8c686e2f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 373/881] Revert "[nrf fromlist] dts: bindings: serial: nrf-uarte: Add timer property" This reverts commit b83628773c322abb2347726371b6a63441188e33. Signed-off-by: Jukka Rissanen --- dts/bindings/serial/nordic,nrf-uarte.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dts/bindings/serial/nordic,nrf-uarte.yaml b/dts/bindings/serial/nordic,nrf-uarte.yaml index c8eb2bbc758..4e9ccb0dd40 100644 --- a/dts/bindings/serial/nordic,nrf-uarte.yaml +++ b/dts/bindings/serial/nordic,nrf-uarte.yaml @@ -24,11 +24,3 @@ properties: type: boolean description: | UARTE allows usage of cross domain pins with constant latency mode required. - - timer: - type: phandle - description: | - Timer instance used to count received bytes. Due to issues with frame timeout - feature it is required to reliably receive data in cases where flow control - is not used and new byte can appear on the line when frame timeout expires - but before it is handled. From 0fc71a2f7c23c2e58119191334c176dae0f642f4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 374/881] Revert "[nrf fromtree] samples: boards: nrf: clock_control: Add memory-regions prop to uart sample" This reverts commit 446f35c7cd3690c685b006d8e6172897293091fd. Signed-off-by: Jukka Rissanen --- samples/boards/nordic/clock_control/configs/uart135.overlay | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/boards/nordic/clock_control/configs/uart135.overlay b/samples/boards/nordic/clock_control/configs/uart135.overlay index 51f8f5102c0..0e81f4cd2aa 100644 --- a/samples/boards/nordic/clock_control/configs/uart135.overlay +++ b/samples/boards/nordic/clock_control/configs/uart135.overlay @@ -12,5 +12,4 @@ &uart135 { status = "okay"; - memory-regions = <&cpuapp_dma_region>; }; From 22a79d6414dc72d6592df667f4cd51c2ca2aac1a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 375/881] Revert "[nrf fromtree] drivers: nrf: add build asserts for memory-regions property" This reverts commit 15ec1e7e05122e68d24b6150f12db18b1b3d3a56. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 2 -- drivers/audio/dmic_nrfx_pdm.c | 1 - drivers/i2c/i2c_nrfx_twim.c | 1 - drivers/i2c/i2c_nrfx_twim_rtio.c | 1 - drivers/i2c/i2c_nrfx_twis.c | 1 - drivers/i2s/i2s_nrf_tdm.c | 1 - drivers/pwm/pwm_nrfx.c | 1 - drivers/serial/uart_nrfx_uarte.c | 1 - drivers/spi/spi_nrfx_spim.c | 1 - drivers/spi/spi_nrfx_spis.c | 1 - soc/nordic/common/soc_nrf_common.h | 13 ------------- 11 files changed, 24 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 2ba7b6efd00..274a43157e0 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -709,7 +709,5 @@ static DEVICE_API(adc, adc_nrfx_driver_api) = { /* Validate configuration of all channels. */ DT_FOREACH_CHILD(DT_DRV_INST(0), VALIDATE_CHANNEL_CONFIG) -NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(0)); - DEVICE_DT_INST_DEFINE(0, init_saadc, NULL, NULL, NULL, POST_KERNEL, CONFIG_ADC_INIT_PRIORITY, &adc_nrfx_driver_api); diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index 433aea66bbc..b2fcb7abb86 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -728,7 +728,6 @@ static const struct _dmic_ops dmic_ops = { .clk_src = PDM_CLK_SRC(idx), \ .mem_reg = DMM_DEV_TO_REG(PDM(idx)), \ }; \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PDM(idx)); \ BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ NRF_PDM_HAS_SELECTABLE_CLOCK, \ "Clock source ACLK is not available."); \ diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index e3c307231ab..b6c37f455dc 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -253,7 +253,6 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { #define I2C_NRFX_TWIM_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ BUILD_ASSERT(I2C_FREQUENCY(idx) != \ I2C_NRFX_TWIM_INVALID_FREQUENCY, \ "Wrong I2C " #idx " frequency setting in dts"); \ diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 0ddf5ffdd77..5eef549ba2e 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -254,7 +254,6 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) #define I2C_NRFX_TWIM_RTIO_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ BUILD_ASSERT(I2C_FREQUENCY(idx) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ "Wrong I2C " #idx " frequency setting in dts"); \ static void irq_connect##idx(void) \ diff --git a/drivers/i2c/i2c_nrfx_twis.c b/drivers/i2c/i2c_nrfx_twis.c index be55c851f3a..dca3a457cf2 100644 --- a/drivers/i2c/i2c_nrfx_twis.c +++ b/drivers/i2c/i2c_nrfx_twis.c @@ -325,7 +325,6 @@ static int shim_nrf_twis_deinit(const struct device *dev) _CONCAT_4(shim_nrf_twis_, name, _, id) #define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SHIM_NRF_TWIS_NODE(id)); \ static void SHIM_NRF_TWIS_NAME(id, irq_connect)(void) \ { \ IRQ_CONNECT( \ diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index c65edb2717b..f8fa4773d37 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -1192,7 +1192,6 @@ static DEVICE_API(i2s, tdm_nrf_drv_api) = { BUILD_ASSERT((TDM_SCK_CLK_SRC(idx) != ACLK && TDM_MCK_CLK_SRC(idx) != ACLK) || \ DT_NODE_HAS_STATUS_OKAY(NODE_ACLK), \ "Clock source ACLK requires the audiopll node."); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(TDM(idx)); \ DEVICE_DT_DEFINE(TDM(idx), tdm_nrf_init##idx, NULL, &tdm_nrf_data##idx, &tdm_nrf_cfg##idx, \ POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, &tdm_nrf_drv_api); diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index e5a046fd975..6a106c12841 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -496,7 +496,6 @@ static int pwm_nrfx_init(const struct device *dev) #define PWM_NRFX_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \ static uint16_t pwm_##idx##_seq_values[NRF_PWM_CHANNEL_COUNT] \ PWM_MEMORY_SECTION(idx); \ diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index cf864a59429..20b6cad541d 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2714,7 +2714,6 @@ static int uarte_instance_init(const struct device *dev, #define UART_NRF_UARTE_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(UARTE(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(UARTE(idx)); \ UARTE_INT_DRIVEN(idx); \ PINCTRL_DT_DEFINE(UARTE(idx)); \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, ( \ diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 438a1b22999..f1d6f8125d6 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -912,7 +912,6 @@ static int spi_nrfx_deinit(const struct device *dev) #define SPI_NRFX_SPIM_DEFINE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ static void irq_connect##idx(void) \ { \ IRQ_CONNECT(DT_IRQN(SPIM(idx)), DT_IRQ(SPIM(idx), priority), \ diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index daa75d7e7ff..8ab8de97955 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -571,7 +571,6 @@ static int spi_nrfx_init(const struct device *dev) } #define SPI_NRFX_SPIS_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ static void irq_connect##idx(void) \ { \ IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), \ diff --git a/soc/nordic/common/soc_nrf_common.h b/soc/nordic/common/soc_nrf_common.h index e2ff929a503..dd6fb8866bf 100644 --- a/soc/nordic/common/soc_nrf_common.h +++ b/soc/nordic/common/soc_nrf_common.h @@ -236,19 +236,6 @@ DT_PINCTRL_HAS_NAME(node_id, sleep), \ DT_NODE_PATH(node_id) " defined without sleep state") -/** - * Error out the build if CONFIG_HAS_NORDIC_DMM=y and memory-regions property is not defined - * or the status of the selected memory region is not "okay" - * - * @param node Devicetree node. - */ -#define NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(node_id) \ - IF_ENABLED(CONFIG_HAS_NORDIC_DMM, \ - (BUILD_ASSERT(( \ - DT_NODE_HAS_PROP(node_id, memory_regions) && \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE_BY_IDX(node_id, memory_regions, 0))), \ - DT_NODE_PATH(node_id) " defined without memory regions"))) - /** @brief Get clock frequency that is used for the given node. * * Macro checks if node has clock property and if yes then if clock has clock_frequency property From af1575706bdf3a5a8007026d34637291f7523085 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 376/881] Revert "[nrf fromlist] tests: drivers: gpio: basic_api: Add nrf54h20/cpurad GPIOTE0 config" This reverts commit eb31114fcac56d0ab45f245ab8063a6d3abb200d. Signed-off-by: Jukka Rissanen --- ...nrf54h20dk_nrf54h20_cpurad_gpiote0.overlay | 28 ------------------- .../drivers/gpio/gpio_basic_api/testcase.yaml | 7 ----- 2 files changed, 35 deletions(-) delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54h20dk_nrf54h20_cpurad_gpiote0.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54h20dk_nrf54h20_cpurad_gpiote0.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54h20dk_nrf54h20_cpurad_gpiote0.overlay deleted file mode 100644 index 0c8f7dbe06c..00000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54h20dk_nrf54h20_cpurad_gpiote0.overlay +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&pinctrl { - gpiote0_default_alt: gpiote0_default_alt { - group1 { - psels = ; - }; - }; -}; - -/ { - resources { - compatible = "test-gpio-basic-api"; - out-gpios = <&gpio1 5 0>; - in-gpios = <&gpio1 4 0>; - }; -}; - -&gpio1 { - status = "okay"; - gpiote-instance = <&gpiote0>; -}; - -&gpiote0 { - status = "okay"; - pinctrl-0 = <&gpiote0_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/gpio/gpio_basic_api/testcase.yaml b/tests/drivers/gpio/gpio_basic_api/testcase.yaml index 325b22efa1c..71f55e493cc 100644 --- a/tests/drivers/gpio/gpio_basic_api/testcase.yaml +++ b/tests/drivers/gpio/gpio_basic_api/testcase.yaml @@ -111,10 +111,3 @@ tests: platform_allow: - siwx917_rb4338a extra_args: "DTC_OVERLAY_FILE=boards/siwx917_rb4338a-uulp.overlay" - drivers.gpio.2pin.nrf54h20_cpurad_gpiote0: - harness_config: - fixture: i2s_loopback # Loopback includes the pin pair needed for that test - platform_allow: - - nrf54h20dk/nrf54h20/cpurad - extra_args: - - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpurad_gpiote0.overlay" From 96e84773f6537bd8569307d706669fea574cb75c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 377/881] Revert "[nrf fromlist] tests: drivers: gpio: basic_api: Improve test" This reverts commit 444ba1c7294dc85618cc5c260c1498116591cd68. Signed-off-by: Jukka Rissanen --- .../drivers/gpio/gpio_basic_api/src/test_callback_manage.c | 7 ++----- .../drivers/gpio/gpio_basic_api/src/test_config_trigger.c | 6 ------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c b/tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c index d302e993032..4c521c8e2a0 100644 --- a/tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c +++ b/tests/drivers/gpio/gpio_basic_api/src/test_callback_manage.c @@ -66,19 +66,16 @@ static int init_callback(const struct device *dev_in, const struct device *dev_o static void trigger_callback(const struct device *dev_in, const struct device *dev_out, int enable_cb) { - int rc; - gpio_pin_set(dev_out, PIN_OUT, 0); k_sleep(K_MSEC(100)); cb_cnt[0] = 0; cb_cnt[1] = 0; if (enable_cb == 1) { - rc = gpio_pin_interrupt_configure(dev_in, PIN_IN, GPIO_INT_EDGE_RISING); + gpio_pin_interrupt_configure(dev_in, PIN_IN, GPIO_INT_EDGE_RISING); } else { - rc = gpio_pin_interrupt_configure(dev_in, PIN_IN, GPIO_INT_DISABLE); + gpio_pin_interrupt_configure(dev_in, PIN_IN, GPIO_INT_DISABLE); } - zassert_equal(rc, 0); k_sleep(K_MSEC(100)); gpio_pin_set(dev_out, PIN_OUT, 1); k_sleep(K_MSEC(1000)); diff --git a/tests/drivers/gpio/gpio_basic_api/src/test_config_trigger.c b/tests/drivers/gpio/gpio_basic_api/src/test_config_trigger.c index 38c5401bcd6..881020a7281 100644 --- a/tests/drivers/gpio/gpio_basic_api/src/test_config_trigger.c +++ b/tests/drivers/gpio/gpio_basic_api/src/test_config_trigger.c @@ -68,9 +68,6 @@ ZTEST(after_flash_gpio_config_trigger, test_gpio_config_twice_trigger) k_sleep(K_MSEC(10)); zassert_between_inclusive(cb_cnt, 0, 1, "Got %d interrupts", cb_cnt); - ret = gpio_pin_interrupt_configure(dev_in, PIN_IN, GPIO_INT_DISABLE); - zassert_ok(ret, "interrupt disabling failed"); - gpio_remove_callback(dev_in, &drv_data->gpio_cb); } @@ -118,8 +115,5 @@ ZTEST(after_flash_gpio_config_trigger, test_gpio_config_trigger) k_sleep(K_MSEC(10)); zassert_between_inclusive(cb_cnt, 0, 1, "Got %d interrupts", cb_cnt); - ret = gpio_pin_interrupt_configure(dev_in, PIN_IN, GPIO_INT_DISABLE); - zassert_ok(ret, "interrupt disabling failed"); - gpio_remove_callback(dev_in, &drv_data->gpio_cb); } From f92f9cefee97c852fdddfdc79c109c3501123959 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 378/881] Revert "[nrf fromlist] drivers: gpio: nrfx: Add support for GPIOTE0 on cpurad" This reverts commit 579af8877d140192461f14fbd7faf96344b1a358. Signed-off-by: Jukka Rissanen --- drivers/gpio/gpio_nrfx.c | 128 +++++++++------------------------------ 1 file changed, 27 insertions(+), 101 deletions(-) diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index f7c57156361..0a94b84c67f 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -20,26 +20,6 @@ #include #endif -#define GPIOTE_PHANDLE(id) DT_INST_PHANDLE(id, gpiote_instance) -#define GPIOTE_PROP(idx, prop) DT_PROP(GPIOTE(idx), prop) - -#define IS_NO_PORT_INSTANCE(id) DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) || -#define IS_FIXED_CH_INSTANCE(id) DT_PROP_OR(GPIOTE_PHANDLE(id), fixed_channels_supported, 0) || - -#if DT_INST_FOREACH_STATUS_OKAY(IS_NO_PORT_INSTANCE) 0 -#define GPIOTE_NO_PORT_EVT_SUPPORT 1 -#endif - -#if DT_INST_FOREACH_STATUS_OKAY(IS_FIXED_CH_INSTANCE) 0 -#define GPIOTE_FIXED_CH_SUPPORT 1 -#endif - -#if defined(GPIOTE_NO_PORT_EVT_SUPPORT) || defined(GPIOTE_FIXED_CH_SUPPORT) -#define GPIOTE_FEATURE_FLAG 1 -#define GPIOTE_FLAG_NO_PORT_EVT BIT(0) -#define GPIOTE_FLAG_FIXED_CHAN BIT(1) -#endif - struct gpio_nrfx_data { /* gpio_driver_data needs to be first */ struct gpio_driver_data common; @@ -53,9 +33,6 @@ struct gpio_nrfx_cfg { uint32_t edge_sense; uint8_t port_num; nrfx_gpiote_t gpiote; -#if defined(GPIOTE_FEATURE_FLAG) - uint32_t flags; -#endif #ifdef CONFIG_SOC_NRF54H20_GPD uint8_t pad_pd; #endif @@ -203,7 +180,6 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, abs_pin, &input_pin_config); if (err != NRFX_SUCCESS) { ret = -EINVAL; - goto end; } } @@ -235,21 +211,13 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, } if (IS_ENABLED(CONFIG_GPIO_NRFX_INTERRUPT) && free_ch) { -#ifdef GPIOTE_FEATURE_FLAG - /* Fixed channel was used, no need to free. */ - if (cfg->flags & GPIOTE_FLAG_FIXED_CHAN) { - goto end; - } -#endif err = nrfx_gpiote_channel_free(&cfg->gpiote, ch); __ASSERT_NO_MSG(err == NRFX_SUCCESS); } end: gpio_nrfx_gpd_retain_set(port, BIT(pin)); - int pm_ret = pm_device_runtime_put(port); - - return (ret != 0) ? ret : pm_ret; + return pm_device_runtime_put(port); } #ifdef CONFIG_GPIO_GET_CONFIG @@ -425,37 +393,6 @@ static nrfx_gpiote_trigger_t get_trigger(enum gpio_int_mode mode, NRFX_GPIOTE_TRIGGER_LOTOHI; } -static nrfx_err_t chan_alloc(const struct gpio_nrfx_cfg *cfg, gpio_pin_t pin, uint8_t *ch) -{ -#ifdef GPIOTE_FEATURE_FLAG - if (cfg->flags & GPIOTE_FLAG_FIXED_CHAN) { - /* Currently fixed channel relation is only present in one instance (GPIOTE0 on - * cpurad). The rules are following: - * - GPIOTE0 can only be used with P1 (pins 4-11) and P2 (pins (0-11)) - * - P1: channel => pin - 4, e.g. P1.4 => channel 0, P1.5 => channel 1 - * - P2: channel => pin % 8, e.g. P2.0 => channel 0, P2.8 => channel 0 - */ - nrfx_err_t err = NRFX_SUCCESS; - - if (cfg->port_num == 1) { - if (pin < 4) { - err = NRFX_ERROR_INVALID_PARAM; - } else { - *ch = pin - 4; - } - } else if (cfg->port_num == 2) { - *ch = pin & 0x7; - } else { - err = NRFX_ERROR_INVALID_PARAM; - } - - return err; - } -#endif - - return nrfx_gpiote_channel_alloc(&cfg->gpiote, ch); -} - static int gpio_nrfx_pin_interrupt_configure(const struct device *port, gpio_pin_t pin, enum gpio_int_mode mode, @@ -491,7 +428,7 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, (nrf_gpio_pin_dir_get(abs_pin) == NRF_GPIO_PIN_DIR_INPUT)) { err = nrfx_gpiote_channel_get(&cfg->gpiote, abs_pin, &ch); if (err == NRFX_ERROR_INVALID_PARAM) { - err = chan_alloc(cfg, pin, &ch); + err = nrfx_gpiote_channel_alloc(&cfg->gpiote, &ch); if (err != NRFX_SUCCESS) { return -ENOMEM; } @@ -499,11 +436,6 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, trigger_config.p_in_channel = &ch; } else { -#ifdef GPIOTE_FEATURE_FLAG - if (cfg->flags & GPIOTE_FLAG_NO_PORT_EVT) { - return -ENOTSUP; - } -#endif /* If edge mode with channel was previously used and we are changing to sense or * level triggered, we must free the channel. */ @@ -709,6 +641,7 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { #endif }; +#define GPIOTE_PHANDLE(id) DT_INST_PHANDLE(id, gpiote_instance) #define GPIOTE_INST(id) DT_PROP(GPIOTE_PHANDLE(id), instance) #define GPIOTE_INSTANCE(id) \ @@ -735,37 +668,30 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { #define PAD_PD(inst) #endif -#define GPIO_NRF_DEVICE(id) \ - GPIOTE_CHECK(id); \ - static const struct gpio_nrfx_cfg gpio_nrfx_p##id##_cfg = { \ - .common = { \ - .port_pin_mask = \ - GPIO_PORT_PIN_MASK_FROM_DT_INST(id), \ - }, \ - .port = _CONCAT(NRF_P, DT_INST_PROP(id, port)), \ - .port_num = DT_INST_PROP(id, port), \ - .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ - .gpiote = GPIOTE_INSTANCE(id), \ - IF_ENABLED(GPIOTE_FEATURE_FLAG, \ - (.flags = \ - (DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) ? \ - GPIOTE_FLAG_NO_PORT_EVT : 0) | \ - (DT_PROP_OR(GPIOTE_PHANDLE(id), fixed_channels_supported, 0) ? \ - GPIOTE_FLAG_FIXED_CHAN : 0),) \ - ) \ - PAD_PD(id) \ - }; \ - \ - static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \ - \ - PM_DEVICE_DT_INST_DEFINE(id, gpio_nrfx_pm_hook); \ - \ - DEVICE_DT_INST_DEFINE(id, gpio_nrfx_init, \ - PM_DEVICE_DT_INST_GET(id), \ - &gpio_nrfx_p##id##_data, \ - &gpio_nrfx_p##id##_cfg, \ - PRE_KERNEL_1, \ - CONFIG_GPIO_INIT_PRIORITY, \ +#define GPIO_NRF_DEVICE(id) \ + GPIOTE_CHECK(id); \ + static const struct gpio_nrfx_cfg gpio_nrfx_p##id##_cfg = { \ + .common = { \ + .port_pin_mask = \ + GPIO_PORT_PIN_MASK_FROM_DT_INST(id), \ + }, \ + .port = _CONCAT(NRF_P, DT_INST_PROP(id, port)), \ + .port_num = DT_INST_PROP(id, port), \ + .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ + .gpiote = GPIOTE_INSTANCE(id), \ + PAD_PD(id) \ + }; \ + \ + static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \ + \ + PM_DEVICE_DT_INST_DEFINE(id, gpio_nrfx_pm_hook); \ + \ + DEVICE_DT_INST_DEFINE(id, gpio_nrfx_init, \ + PM_DEVICE_DT_INST_GET(id), \ + &gpio_nrfx_p##id##_data, \ + &gpio_nrfx_p##id##_cfg, \ + PRE_KERNEL_1, \ + CONFIG_GPIO_INIT_PRIORITY, \ &gpio_nrfx_drv_api_funcs); DT_INST_FOREACH_STATUS_OKAY(GPIO_NRF_DEVICE) From 7bddc89686ce6f2ba0f3eba231af3b67269e04d2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 379/881] Revert "[nrf fromlist] modules: hal_nordic: nrfx: Add GPIOTE config flag" This reverts commit 033ae0fc80adb92e4a86cc97c9c58863c09e88f4. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/nrfx/Kconfig | 4 ---- modules/hal_nordic/nrfx/nrfx_kconfig.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index b7f459ea177..b918a2023c3 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -226,10 +226,6 @@ config NRFX_GPIOTE131 depends on $(dt_nodelabel_exists,gpiote131) select NRFX_GPIOTE -config NRFX_GPIOTE_NONUNIFORM_INSTANCES - def_bool $(dt_nodelabel_enabled,gpiote0) - depends on $(dt_nodelabel_bool_prop,gpiote0,fixed-channels-supported) - config NRFX_GPIOTE_NUM_OF_EVT_HANDLERS int "Number of event handlers" depends on NRFX_GPIOTE diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 6e3583743bc..5aa856f2299 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -207,9 +207,6 @@ #ifdef CONFIG_NRFX_GPIOTE131 #define NRFX_GPIOTE131_ENABLED 1 #endif -#ifdef CONFIG_NRFX_GPIOTE_NONUNIFORM_INSTANCES -#define NRFX_GPIOTE_CONFIG_NONUNIFORM_INSTANCES 1 -#endif #ifdef CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS #define NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS From 10b40399399d1cc00a26c48b15f3c1dcaa2be2a5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 380/881] Revert "[nrf fromlist] dts: bindings: gpio: nrf-gpiote: Extend description" This reverts commit f54a8aa973f3225c6fe3a92fa648d3c08292d270. Signed-off-by: Jukka Rissanen --- dts/bindings/gpio/nordic,nrf-gpiote.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/dts/bindings/gpio/nordic,nrf-gpiote.yaml b/dts/bindings/gpio/nordic,nrf-gpiote.yaml index 90914c712d2..b9180857e44 100644 --- a/dts/bindings/gpio/nordic,nrf-gpiote.yaml +++ b/dts/bindings/gpio/nordic,nrf-gpiote.yaml @@ -8,7 +8,6 @@ compatible: "nordic,nrf-gpiote" include: - base.yaml - nordic,split-channels.yaml - - pinctrl-device.yaml properties: reg: @@ -17,17 +16,6 @@ properties: interrupts: required: true - no-port-event: - type: boolean - description: | - Indicates that the GPIOTE instance does not support PORT event. - - fixed-channels-supported: - type: boolean - description: | - Indicates that the GPIOTE instance has fixed connection between pins and TE channels. - It means that a specific TE channel must be used for a given pin. - instance: type: int required: true From 95075e6498247328e1c4ffe4e1c2f27fca544325 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 381/881] Revert "[nrf fromlist] dts: vendor: nordic: nrf54h20: Add gpiote0 node" This reverts commit 6eba812c4b9374ba0741a8fe43610f8838735728. Signed-off-by: Jukka Rissanen --- dts/vendor/nordic/nrf54h20.dtsi | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index c72fedef84a..042725a1617 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -391,16 +391,6 @@ interrupts = <37 NRF_DEFAULT_IRQ_PRIORITY>; }; - gpiote0: gpiote@27000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x27000 0x1000>; - status = "disabled"; - interrupts = <39 NRF_DEFAULT_IRQ_PRIORITY>; - instance = <0>; - no-port-event; - fixed-channels-supported; - }; - timer020: timer@28000 { compatible = "nordic,nrf-timer"; reg = <0x28000 0x1000>; From 46aa985b39c24d299b7cdec349cfcb78b53ea856 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 382/881] Revert "[nrf fromlist] modules: hal_nordic: Bump nrf-regtool to 9.2.0" This reverts commit b71414bca9ca54ce33c349b88487564fab5eedc3. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index b6f35286412..11c28246828 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -12,7 +12,7 @@ if(CONFIG_NRF_REGTOOL_GENERATE_UICR) list(APPEND nrf_regtool_components GENERATE:UICR) endif() if(DEFINED nrf_regtool_components) - find_package(nrf-regtool 9.2.0 + find_package(nrf-regtool 9.1.0 COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From ae5a3f08039f09b5cc277f97e86db021eebeb138 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 383/881] Revert "[nrf fromlist] modules: hal_nordic: nrfx: Add support for custom NRFX_DIR on Sysbuild" This reverts commit 46684e34c2443deedc147edb47a9718ef9f66627. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/nrfx/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index dc31c3a13ca..d063046cfa8 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -5,8 +5,6 @@ zephyr_library() # The nrfx source directory can be override through the definition of the NRFX_DIR symbol # during the invocation of the build system -zephyr_get(NRFX_DIR SYSBUILD GLOBAL) - if(NOT DEFINED NRFX_DIR) set(NRFX_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/nrfx CACHE PATH "nrfx Directory") endif() From 80f22e6e7412583523920ff663bef15a0c2da416 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 384/881] Revert "[nrf fromtree] net: ppp: Allow peer-options to be rejected" This reverts commit 09a153cef1d3a36e6ca5b423c97f82c1d197b059. Signed-off-by: Jukka Rissanen --- subsys/net/l2/ppp/ipcp.c | 35 ++--------------------------------- subsys/net/l2/ppp/options.c | 30 +----------------------------- 2 files changed, 3 insertions(+), 62 deletions(-) diff --git a/subsys/net/l2/ppp/ipcp.c b/subsys/net/l2/ppp/ipcp.c index 1cea54de2f3..afa92b29364 100644 --- a/subsys/net/l2/ppp/ipcp.c +++ b/subsys/net/l2/ppp/ipcp.c @@ -228,37 +228,6 @@ static int ipcp_server_nak_ip_address(struct ppp_fsm *fsm, #endif #if defined(CONFIG_NET_L2_PPP_OPTION_SERVE_DNS) - -static int ipcp_dns1_address_parse(struct ppp_fsm *fsm, struct net_pkt *pkt, - void *user_data) -{ - struct ppp_context *ctx = - CONTAINER_OF(fsm, struct ppp_context, ipcp.fsm); - int ret; - - ret = ipcp_dns_address_parse(fsm, pkt, user_data); - - if (ret == -EINVAL && ctx->ipcp.peer_options.dns1_address.s_addr == INADDR_ANY) { - return -ENOTSUP; - } - return ret; -} - -static int ipcp_dns2_address_parse(struct ppp_fsm *fsm, struct net_pkt *pkt, - void *user_data) -{ - struct ppp_context *ctx = - CONTAINER_OF(fsm, struct ppp_context, ipcp.fsm); - int ret; - - ret = ipcp_dns_address_parse(fsm, pkt, user_data); - - if (ret == -EINVAL && ctx->ipcp.peer_options.dns2_address.s_addr == INADDR_ANY) { - return -ENOTSUP; - } - return ret; -} - static int ipcp_server_nak_dns1_address(struct ppp_fsm *fsm, struct net_pkt *ret_pkt, void *user_data) @@ -294,9 +263,9 @@ static const struct ppp_peer_option_info ipcp_peer_options[] = { PPP_PEER_OPTION(IPCP_OPTION_IP_ADDRESS, ipcp_ip_address_parse, NULL), #endif #if defined(CONFIG_NET_L2_PPP_OPTION_SERVE_DNS) - PPP_PEER_OPTION(IPCP_OPTION_DNS1, ipcp_dns1_address_parse, + PPP_PEER_OPTION(IPCP_OPTION_DNS1, ipcp_dns_address_parse, ipcp_server_nak_dns1_address), - PPP_PEER_OPTION(IPCP_OPTION_DNS2, ipcp_dns2_address_parse, + PPP_PEER_OPTION(IPCP_OPTION_DNS2, ipcp_dns_address_parse, ipcp_server_nak_dns2_address), #endif }; diff --git a/subsys/net/l2/ppp/options.c b/subsys/net/l2/ppp/options.c index 694d338c9b7..6fd8c15de6e 100644 --- a/subsys/net/l2/ppp/options.c +++ b/subsys/net/l2/ppp/options.c @@ -144,38 +144,14 @@ static int ppp_parse_option_conf_req_supported(struct net_pkt *pkt, { struct ppp_parse_option_conf_req_data *parse_data = user_data; struct ppp_fsm *fsm = parse_data->fsm; - struct net_pkt *ret_pkt = parse_data->ret_pkt; - struct net_pkt_cursor cursor; const struct ppp_peer_option_info *option_info = ppp_peer_option_info_get(parse_data->options_info, parse_data->num_options_info, code); int ret; - net_pkt_cursor_backup(pkt, &cursor); ret = option_info->parse(fsm, pkt, parse_data->user_data); - if (ret == -ENOTSUP) { - net_pkt_cursor_restore(pkt, &cursor); - parse_data->rej_count++; - if (parse_data->nack_count != 0) { - /* Remove any NACKed data, if we need to reject something first */ - net_pkt_update_length(ret_pkt, 0); - net_pkt_cursor_init(ret_pkt); - parse_data->nack_count = 0; - } - net_pkt_write_u8(ret_pkt, code); - net_pkt_write_u8(ret_pkt, len + sizeof(code) + sizeof(len)); - if (len > 0) { - net_pkt_copy(ret_pkt, pkt, len); - } - return 0; - } else if (ret == -EINVAL) { - if (parse_data->rej_count != 0) { - /* If we have already rejected some options, we - * cannot NACK anything in the same packet. - */ - return 0; - } + if (ret == -EINVAL) { parse_data->nack_count++; ret = option_info->nack(fsm, parse_data->ret_pkt, parse_data->user_data); @@ -226,10 +202,6 @@ int ppp_config_info_req(struct ppp_fsm *fsm, return -EINVAL; } - if (parse_data.rej_count) { - return PPP_CONFIGURE_REJ; - } - if (parse_data.nack_count) { return PPP_CONFIGURE_NACK; } From 481d43fcef362b0584d626838159c7bf96a193c3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 385/881] Revert "[nrf fromtree] net: ppp: ipcp: Don't request DNS if not needed" This reverts commit c1cace5e91f5221960b61cae57188d7483759be2. Signed-off-by: Jukka Rissanen --- include/zephyr/net/ppp.h | 4 --- subsys/net/l2/ppp/ipcp.c | 58 +++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/include/zephyr/net/ppp.h b/include/zephyr/net/ppp.h index 7028e4f2d0f..a2b63b7dd1e 100644 --- a/include/zephyr/net/ppp.h +++ b/include/zephyr/net/ppp.h @@ -353,11 +353,7 @@ struct ppp_my_option_data { uint32_t flags; }; -#if defined(CONFIG_NET_L2_PPP_OPTION_DNS_USE) #define IPCP_NUM_MY_OPTIONS 3 -#else -#define IPCP_NUM_MY_OPTIONS 1 -#endif #define IPV6CP_NUM_MY_OPTIONS 1 enum ppp_flags { diff --git a/subsys/net/l2/ppp/ipcp.c b/subsys/net/l2/ppp/ipcp.c index afa92b29364..b345802e68e 100644 --- a/subsys/net/l2/ppp/ipcp.c +++ b/subsys/net/l2/ppp/ipcp.c @@ -42,6 +42,16 @@ static int ipcp_add_ip_address(struct ppp_context *ctx, struct net_pkt *pkt) return ipcp_add_address(ctx, pkt, &ctx->ipcp.my_options.address); } +static int ipcp_add_dns1(struct ppp_context *ctx, struct net_pkt *pkt) +{ + return ipcp_add_address(ctx, pkt, &ctx->ipcp.my_options.dns1_address); +} + +static int ipcp_add_dns2(struct ppp_context *ctx, struct net_pkt *pkt) +{ + return ipcp_add_address(ctx, pkt, &ctx->ipcp.my_options.dns2_address); +} + static int ipcp_ack_check_address(struct net_pkt *pkt, size_t oplen, struct in_addr *addr) { @@ -71,6 +81,20 @@ static int ipcp_ack_ip_address(struct ppp_context *ctx, struct net_pkt *pkt, &ctx->ipcp.my_options.address); } +static int ipcp_ack_dns1(struct ppp_context *ctx, struct net_pkt *pkt, + uint8_t oplen) +{ + return ipcp_ack_check_address(pkt, oplen, + &ctx->ipcp.my_options.dns1_address); +} + +static int ipcp_ack_dns2(struct ppp_context *ctx, struct net_pkt *pkt, + uint8_t oplen) +{ + return ipcp_ack_check_address(pkt, oplen, + &ctx->ipcp.my_options.dns2_address); +} + static int ipcp_nak_override_address(struct net_pkt *pkt, size_t oplen, struct in_addr *addr) { @@ -88,31 +112,6 @@ static int ipcp_nak_ip_address(struct ppp_context *ctx, struct net_pkt *pkt, &ctx->ipcp.my_options.address); } -#if defined(CONFIG_NET_L2_PPP_OPTION_DNS_USE) -static int ipcp_add_dns1(struct ppp_context *ctx, struct net_pkt *pkt) -{ - return ipcp_add_address(ctx, pkt, &ctx->ipcp.my_options.dns1_address); -} - -static int ipcp_add_dns2(struct ppp_context *ctx, struct net_pkt *pkt) -{ - return ipcp_add_address(ctx, pkt, &ctx->ipcp.my_options.dns2_address); -} - -static int ipcp_ack_dns1(struct ppp_context *ctx, struct net_pkt *pkt, - uint8_t oplen) -{ - return ipcp_ack_check_address(pkt, oplen, - &ctx->ipcp.my_options.dns1_address); -} - -static int ipcp_ack_dns2(struct ppp_context *ctx, struct net_pkt *pkt, - uint8_t oplen) -{ - return ipcp_ack_check_address(pkt, oplen, - &ctx->ipcp.my_options.dns2_address); -} - static int ipcp_nak_dns1(struct ppp_context *ctx, struct net_pkt *pkt, uint8_t oplen) { @@ -126,24 +125,21 @@ static int ipcp_nak_dns2(struct ppp_context *ctx, struct net_pkt *pkt, return ipcp_nak_override_address(pkt, oplen, &ctx->ipcp.my_options.dns2_address); } -#endif /* CONFIG_NET_L2_PPP_OPTION_DNS_USE */ static const struct ppp_my_option_info ipcp_my_options[] = { PPP_MY_OPTION(IPCP_OPTION_IP_ADDRESS, ipcp_add_ip_address, ipcp_ack_ip_address, ipcp_nak_ip_address), -#if defined(CONFIG_NET_L2_PPP_OPTION_DNS_USE) PPP_MY_OPTION(IPCP_OPTION_DNS1, ipcp_add_dns1, ipcp_ack_dns1, ipcp_nak_dns1), PPP_MY_OPTION(IPCP_OPTION_DNS2, ipcp_add_dns2, ipcp_ack_dns2, ipcp_nak_dns2), -#endif }; BUILD_ASSERT(ARRAY_SIZE(ipcp_my_options) == IPCP_NUM_MY_OPTIONS); static struct net_pkt *ipcp_config_info_add(struct ppp_fsm *fsm) { - return ppp_my_options_add(fsm, IPCP_NUM_MY_OPTIONS * IP_ADDRESS_OPTION_LEN); + return ppp_my_options_add(fsm, 3 * IP_ADDRESS_OPTION_LEN); } struct ipcp_peer_option_data { @@ -236,7 +232,7 @@ static int ipcp_server_nak_dns1_address(struct ppp_fsm *fsm, CONTAINER_OF(fsm, struct ppp_context, ipcp.fsm); (void)net_pkt_write_u8(ret_pkt, IPCP_OPTION_DNS1); - (void)ipcp_add_address(ctx, ret_pkt, &ctx->ipcp.peer_options.dns1_address); + ipcp_add_dns1(ctx, ret_pkt); return 0; } @@ -249,7 +245,7 @@ static int ipcp_server_nak_dns2_address(struct ppp_fsm *fsm, CONTAINER_OF(fsm, struct ppp_context, ipcp.fsm); (void)net_pkt_write_u8(ret_pkt, IPCP_OPTION_DNS2); - (void)ipcp_add_address(ctx, ret_pkt, &ctx->ipcp.peer_options.dns2_address); + ipcp_add_dns2(ctx, ret_pkt); return 0; } From b20e1db3257ee2f2b645e8bada1e58b43eb67ca1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 386/881] Revert "[nrf fromtree] boards: nordic: nrf7002dk: Fix the newline between the groups" This reverts commit b2334710d73e234fc16c3dfd95120d66e5d3ce93. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi b/boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi index e6bda0940db..08fcadc2244 100644 --- a/boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi +++ b/boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi @@ -59,7 +59,6 @@ ; bias-pull-down; }; - group2 { psels = ; bias-pull-up; @@ -76,7 +75,6 @@ bias-pull-down; low-power-enable; }; - group2 { psels = ; bias-pull-up; From 8757001cc6185bc315ce819bc564b4e6822f399e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 387/881] Revert "[nrf fromtree] boards: nordic: nrf7002dk: Fix DTS warning" This reverts commit e09502fc2e6dbb07bc146f064e92fd396fd3288f. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi b/boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi index 08fcadc2244..d8f78cfd40c 100644 --- a/boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi +++ b/boards/nordic/nrf7002dk/nrf5340_cpuapp_common_pinctrl.dtsi @@ -73,13 +73,12 @@ , ; bias-pull-down; - low-power-enable; }; group2 { psels = ; bias-pull-up; - low-power-enable; }; + low-power-enable; }; uart1_default: uart1_default { From 64ace5fb153d9e2395e84e9e9eb8cb4d5008350f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:17 +0300 Subject: [PATCH 388/881] Revert "[nrf fromtree] dts: bindings: Add missing nRF Wi-Fi interface" This reverts commit 89622e20bf7f8fe4abbcca6c3e1509f07c3f39e1. Signed-off-by: Jukka Rissanen --- dts/bindings/wifi/nordic,wlan.yaml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 dts/bindings/wifi/nordic,wlan.yaml diff --git a/dts/bindings/wifi/nordic,wlan.yaml b/dts/bindings/wifi/nordic,wlan.yaml deleted file mode 100644 index 9c704bc9586..00000000000 --- a/dts/bindings/wifi/nordic,wlan.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic Wi-Fi network interface. - - This binding defines a Wi-Fi network interface for Nordic nRF70 series - Wi-Fi chips. The interface is used to identify and name Wi-Fi network - interfaces like wlan0. - -compatible: "nordic,wlan" From 8db1267ec283e0615454649cac25ac3a01d3e983 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 389/881] Revert "[nrf fromlist] manifest: nrf_wifi: Pull fix for raw TX" This reverts commit 290cf97630249480d287a76fbae8f9b1f77071a6. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 94e1638cb45..67424489a9a 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: 968d55ff22579080466bf2f482596dd6e35361c6 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 787eea1a3c8dd13c86214e204a919e6f9bcebf91 + revision: 00801cbaf83600ba9e39b010928401e817a93fdc path: modules/lib/nrf_wifi - name: open-amp revision: f7f4d083c7909a39d86e217376c69b416ec4faf3 From ac2d0b56da76d7241487d3fe939edecd380f2468 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 390/881] Revert "[nrf fromtree] manifest: nrf_wifi: Pull fix for processing patch feature flags" This reverts commit d64be7ff9e9ceed45720ce09544d15a3c0f7400d. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 67424489a9a..acf99c65b10 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: 968d55ff22579080466bf2f482596dd6e35361c6 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 00801cbaf83600ba9e39b010928401e817a93fdc + revision: 5f59c2336c69f28ae83f93812a1d726f9fceabfe path: modules/lib/nrf_wifi - name: open-amp revision: f7f4d083c7909a39d86e217376c69b416ec4faf3 From 03f5881d08cfdfc2a55464a0f6e415cf97d99e84 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 391/881] Revert "[nrf fromlist] drivers: nrf_wifi: Fix defaults to avoid false recovery" This reverts commit 593cc07e7c9eba3954346539608deaf4073411c2. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index af3e7827dcb..414900f581b 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -748,12 +748,11 @@ config NRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS config NRF_WIFI_RPU_MIN_TIME_TO_ENTER_SLEEP_MS int "Minimum idle time to enter sleep in milliseconds" - range 100 40000 - default 5000 + range 100 5000 + default 1000 help Minimum time the host should de-assert WAKEUP_NOW and let RPU enter - sleep mode, assuming there is no activity. Please note that higher values - of this value may increase the power consumption. + sleep mode, assuming there is no activity. config NRF_WIFI_RPU_RECOVERY_DEBUG bool "RPU recovery debug logs" From fa037b7c6f40e21b1ba3b72870b498545a873296 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 392/881] Revert "[nrf fromlist] net: ip: Use rate limited version" This reverts commit 65087d8f5442a22df1e710eb633ce5edd590dc5a. Signed-off-by: Jukka Rissanen --- subsys/net/ip/net_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/net/ip/net_if.c b/subsys/net/ip/net_if.c index 8c5e7b81548..b541787a0d9 100644 --- a/subsys/net/ip/net_if.c +++ b/subsys/net/ip/net_if.c @@ -262,8 +262,8 @@ static bool net_if_tx(struct net_if *iface, struct net_pkt *pkt) status = net_if_l2(iface)->send(iface, pkt); net_if_tx_unlock(iface); if (status < 0) { - NET_WARN_RATELIMIT("iface %d pkt %p send failure status %d", - net_if_get_by_iface(iface), pkt, status); + NET_WARN("iface %d pkt %p send failure status %d", + net_if_get_by_iface(iface), pkt, status); } if (IS_ENABLED(CONFIG_NET_PKT_TXTIME_STATS) || From daac46414d5804973bdec304457cf8a9747bd831 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 393/881] Revert "[nrf fromlist] net: Add ratelimited variants" This reverts commit f6f6fd04956190ae9e94ea20f790430cd5aac7cf. Signed-off-by: Jukka Rissanen --- include/zephyr/net/net_core.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/include/zephyr/net/net_core.h b/include/zephyr/net/net_core.h index 505683eb139..e4b18418b3a 100644 --- a/include/zephyr/net/net_core.h +++ b/include/zephyr/net/net_core.h @@ -61,14 +61,8 @@ extern "C" { #define NET_WARN(fmt, ...) LOG_WRN(fmt, ##__VA_ARGS__) #define NET_INFO(fmt, ...) LOG_INF(fmt, ##__VA_ARGS__) -/* Rate-limited network logging macros */ -#define NET_ERR_RATELIMIT(fmt, ...) LOG_ERR_RATELIMIT(fmt, ##__VA_ARGS__) -#define NET_WARN_RATELIMIT(fmt, ...) LOG_WRN_RATELIMIT(fmt, ##__VA_ARGS__) -#define NET_INFO_RATELIMIT(fmt, ...) LOG_INF_RATELIMIT(fmt, ##__VA_ARGS__) -#define NET_DBG_RATELIMIT(fmt, ...) LOG_DBG_RATELIMIT(fmt, ##__VA_ARGS__) - -#define NET_HEXDUMP_DBG(_data, _length, _str) LOG_HEXDUMP_DBG(_data, _length, _str) -#define NET_HEXDUMP_ERR(_data, _length, _str) LOG_HEXDUMP_ERR(_data, _length, _str) +#define NET_HEXDUMP_DBG(_data, _length, _str) LOG_HEXDUMP_DBG(_data, _length, _str) +#define NET_HEXDUMP_ERR(_data, _length, _str) LOG_HEXDUMP_ERR(_data, _length, _str) #define NET_HEXDUMP_WARN(_data, _length, _str) LOG_HEXDUMP_WRN(_data, _length, _str) #define NET_HEXDUMP_INFO(_data, _length, _str) LOG_HEXDUMP_INF(_data, _length, _str) From 7352d9a0721fdd88c317726d040bfb4db500b6be Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 394/881] Revert "[nrf noup] logging: Add ratelimited variants" This reverts commit 4ba4327b0faa1db6243f111d83e4a8eb66b2754f. Signed-off-by: Jukka Rissanen --- doc/services/logging/index.rst | 99 ----- include/zephyr/logging/log.h | 375 ------------------ subsys/logging/Kconfig | 50 --- .../logging/log_ratelimited/CMakeLists.txt | 9 - tests/subsys/logging/log_ratelimited/prj.conf | 18 - .../log_ratelimited/test_log_ratelimited.c | 62 --- .../logging/log_ratelimited/testcase.yaml | 23 -- 7 files changed, 636 deletions(-) delete mode 100644 tests/subsys/logging/log_ratelimited/CMakeLists.txt delete mode 100644 tests/subsys/logging/log_ratelimited/prj.conf delete mode 100644 tests/subsys/logging/log_ratelimited/test_log_ratelimited.c delete mode 100644 tests/subsys/logging/log_ratelimited/testcase.yaml diff --git a/doc/services/logging/index.rst b/doc/services/logging/index.rst index be683161655..86f5e97d8c9 100644 --- a/doc/services/logging/index.rst +++ b/doc/services/logging/index.rst @@ -32,7 +32,6 @@ Summary of the logging features: - Support for logging floating point variables and long long arguments. - Built-in copying of transient strings used as arguments. - Support for multi-domain logging. -- Rate-limited logging macros to prevent log flooding when messages are generated frequently. Logging API is highly configurable at compile time as well as at run time. Using Kconfig options (see :ref:`logging_kconfig`) logs can be gradually removed from @@ -60,16 +59,6 @@ The warning level also exposes the following additional macro: - :c:macro:`LOG_WRN_ONCE` for warnings where only the first occurrence is of interest. -Rate-limited logging macros are also available for all severity levels to prevent log flooding: - -- ``LOG_X_RATELIMIT`` for rate-limited standard printf-like messages using default rate, e.g. :c:macro:`LOG_ERR_RATELIMIT`. -- ``LOG_X_RATELIMIT_RATE`` for rate-limited standard printf-like messages with custom rate, e.g. :c:macro:`LOG_ERR_RATELIMIT_RATE`. -- ``LOG_HEXDUMP_X_RATELIMIT`` for rate-limited data dumping using default rate, e.g. :c:macro:`LOG_HEXDUMP_WRN_RATELIMIT`. -- ``LOG_HEXDUMP_X_RATELIMIT_RATE`` for rate-limited data dumping with custom rate, e.g. :c:macro:`LOG_HEXDUMP_WRN_RATELIMIT_RATE`. - -The convenience macros use the default rate specified by ``CONFIG_LOG_RATELIMIT_INTERVAL_MS``, -while the explicit rate macros take a rate parameter (in milliseconds) that specifies the minimum interval between log messages. - There are two configuration categories: configurations per module and global configuration. When logging is enabled globally, it works for modules. However, modules can disable logging locally. Every module can specify its own logging @@ -352,94 +341,6 @@ If logs are processed from a thread (user or internal) then it is possible to en a feature which will wake up processing thread when certain amount of log messages are buffered (see :kconfig:option:`CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD`). -.. _logging_ratelimited: - -Rate-limited logging -******************** - -Rate-limited logging macros provide a way to prevent log flooding when messages are -generated frequently. These macros ensure that log messages are not output more -frequently than a specified interval, similar to Linux's ``printk_ratelimited`` -functionality. - -The rate-limited logging system provides two types of macros: - -**Convenience macros (using default rate):** -- :c:macro:`LOG_ERR_RATELIMIT` - Rate-limited error messages -- :c:macro:`LOG_WRN_RATELIMIT` - Rate-limited warning messages -- :c:macro:`LOG_INF_RATELIMIT` - Rate-limited info messages -- :c:macro:`LOG_DBG_RATELIMIT` - Rate-limited debug messages -- :c:macro:`LOG_HEXDUMP_ERR_RATELIMIT` - Rate-limited error hexdump -- :c:macro:`LOG_HEXDUMP_WRN_RATELIMIT` - Rate-limited warning hexdump -- :c:macro:`LOG_HEXDUMP_INF_RATELIMIT` - Rate-limited info hexdump -- :c:macro:`LOG_HEXDUMP_DBG_RATELIMIT` - Rate-limited debug hexdump - -**Explicit rate macros (with custom rate):** -- :c:macro:`LOG_ERR_RATELIMIT_RATE` - Rate-limited error messages with custom rate -- :c:macro:`LOG_WRN_RATELIMIT_RATE` - Rate-limited warning messages with custom rate -- :c:macro:`LOG_INF_RATELIMIT_RATE` - Rate-limited info messages with custom rate -- :c:macro:`LOG_DBG_RATELIMIT_RATE` - Rate-limited debug messages with custom rate -- :c:macro:`LOG_HEXDUMP_ERR_RATELIMIT_RATE` - Rate-limited error hexdump with custom rate -- :c:macro:`LOG_HEXDUMP_WRN_RATELIMIT_RATE` - Rate-limited warning hexdump with custom rate -- :c:macro:`LOG_HEXDUMP_INF_RATELIMIT_RATE` - Rate-limited info hexdump with custom rate -- :c:macro:`LOG_HEXDUMP_DBG_RATELIMIT_RATE` - Rate-limited debug hexdump with custom rate - -The convenience macros use the default rate specified by :kconfig:option:`CONFIG_LOG_RATELIMIT_INTERVAL_MS` -(5000ms by default). The explicit rate macros take a rate parameter (in milliseconds) that specifies -the minimum interval between log messages. The rate limiting is per-macro-call-site, meaning -that each unique call to a rate-limited macro has its own independent rate limit. - -Example usage: - -.. code-block:: c - - #include - #include - - LOG_MODULE_REGISTER(my_module, CONFIG_LOG_DEFAULT_LEVEL); - - void process_data(void) - { - /* Convenience macros using default rate (CONFIG_LOG_RATELIMIT_INTERVAL_MS) */ - LOG_WRN_RATELIMIT("Data processing warning: %d", error_code); - LOG_ERR_RATELIMIT("Critical error occurred: %s", error_msg); - LOG_INF_RATELIMIT("Processing status: %d items", item_count); - LOG_HEXDUMP_WRN_RATELIMIT(data_buffer, data_len, "Data buffer:"); - - /* Explicit rate macros with custom intervals */ - LOG_WRN_RATELIMIT_RATE(1000, "Fast rate warning: %d", error_code); - LOG_ERR_RATELIMIT_RATE(30000, "Slow rate error: %s", error_msg); - LOG_INF_RATELIMIT_RATE(2000, "Custom rate status: %d items", item_count); - LOG_HEXDUMP_ERR_RATELIMIT_RATE(5000, data_buffer, data_len, "Error data:"); - } - -Rate-limited logging is particularly useful for: - -- Error conditions that might occur frequently but don't need to flood the logs -- Status updates in tight loops or high-frequency callbacks -- Debug information that could overwhelm the logging system -- Network or I/O operations that might fail repeatedly - -Configuration -============== - -Rate-limited logging can be configured using the following Kconfig options: - -- :kconfig:option:`CONFIG_LOG_RATELIMIT` - Master switch to enable/disable rate-limited logging -- :kconfig:option:`CONFIG_LOG_RATELIMIT_INTERVAL_MS` - Default interval for convenience macros (5000ms) - -When :kconfig:option:`CONFIG_LOG_RATELIMIT` is disabled, the behavior of rate-limited macros is controlled -by the :kconfig:option:`CONFIG_LOG_RATELIMIT_FALLBACK` choice: - -- :kconfig:option:`CONFIG_LOG_RATELIMIT_FALLBACK_LOG` - All rate-limited macros behave as regular logging macros -- :kconfig:option:`CONFIG_LOG_RATELIMIT_FALLBACK_DROP` - All rate-limited macros expand to no-ops (default) - -This allows you to control whether rate-limited log macros should always print or be completely -suppressed when rate limiting is not available. - -The rate limiting is implemented using static variables and :c:func:`k_uptime_get_32` -to track the last log time for each call site. - .. _logging_panic: Logging panic diff --git a/include/zephyr/logging/log.h b/include/zephyr/logging/log.h index 84601af4393..2358b332ef4 100644 --- a/include/zephyr/logging/log.h +++ b/include/zephyr/logging/log.h @@ -10,7 +10,6 @@ #include #include #include -#include #if CONFIG_USERSPACE && CONFIG_LOG_ALWAYS_RUNTIME #include @@ -97,340 +96,6 @@ extern "C" { } \ } while (0) -#if defined(CONFIG_LOG_RATELIMIT) || defined(__DOXYGEN__) -/** - * @brief Core rate-limited logging macro - * - * @details Internal macro that provides rate-limited logging functionality. - * Uses atomic operations to ensure thread safety in multi-threaded environments. - * Only one thread can successfully log a message within the specified rate limit period. - * - * @param _level Log level (LOG_LEVEL_ERR, LOG_LEVEL_WRN, etc.) - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param _skipped_msg Message to show when messages are skipped. - * @param _log_func Logging function to call (Z_LOG or Z_LOG_HEXDUMP) - * @param ... Arguments to pass to the logging function. - */ -#define _LOG_RATELIMIT_CORE(_level, _rate_ms, _skipped_msg, _log_func, ...) \ - do { \ - static atomic_t __last_log_time ; \ - static atomic_t __skipped_count ; \ - uint32_t __now = k_uptime_get_32(); \ - uint32_t __last = atomic_get(&__last_log_time); \ - uint32_t __diff = __now - __last; \ - if (unlikely(__diff >= (_rate_ms))) { \ - if (atomic_cas(&__last_log_time, __last, __now)) { \ - uint32_t __skipped = atomic_clear(&__skipped_count); \ - if (__skipped > 0) { \ - Z_LOG(_level, _skipped_msg, __skipped); \ - } \ - _log_func(_level, __VA_ARGS__); \ - } else { \ - atomic_inc(&__skipped_count); \ - } \ - } else { \ - atomic_inc(&__skipped_count); \ - } \ - } while (0) - -/** - * @brief Rate-limited logging macros - * - * @details These macros provide rate-limited logging functionality to prevent - * log flooding when messages are generated frequently. Each macro ensures that - * log messages are not output more frequently than a specified interval. - * Rate limiting is per-macro-call-site, meaning each unique call has its own - * independent rate limit. - * - * The macros use atomic operations to ensure thread safety in multi-threaded - * environments. Only one thread can successfully log a message within the - * specified rate limit period. - * - * @see CONFIG_LOG_RATELIMIT_INTERVAL_MS - */ - -/** - * @brief Writes a WARNING level message to the log with rate limiting. - * - * @details It's meant for situations that warrant investigation but could clutter - * the logs if output too frequently. The message will be logged at most once - * per specified interval in milliseconds. - * - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param ... A string optionally containing printk valid conversion specifier, - * followed by as many values as specifiers. - */ -#define LOG_WRN_RATELIMIT_RATE(_rate_ms, ...) \ - _LOG_RATELIMIT_CORE(LOG_LEVEL_WRN, _rate_ms, "Skipped %d messages", Z_LOG, __VA_ARGS__) - -/** - * @brief Writes a WARNING level message to the log with rate limiting. - * - * @details It's meant for situations that warrant investigation but could clutter - * the logs if output too frequently. The message will be logged at most once - * per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS). - * - * @param ... A string optionally containing printk valid conversion specifier, - * followed by as many values as specifiers. - */ -#define LOG_WRN_RATELIMIT(...) \ - LOG_WRN_RATELIMIT_RATE(CONFIG_LOG_RATELIMIT_INTERVAL_MS, __VA_ARGS__) - -/** - * @brief Writes an ERROR level message to the log with rate limiting. - * - * @details It's meant to report severe errors, such as those from which it's - * not possible to recover, but with rate limiting to prevent log flooding. - * The message will be logged at most once per specified interval in milliseconds. - * - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param ... A string optionally containing printk valid conversion specifier, - * followed by as many values as specifiers. - */ -#define LOG_ERR_RATELIMIT_RATE(_rate_ms, ...) \ - _LOG_RATELIMIT_CORE(LOG_LEVEL_ERR, _rate_ms, "Skipped %d messages", Z_LOG, __VA_ARGS__) - -/** - * @brief Writes an ERROR level message to the log with rate limiting. - * - * @details It's meant to report severe errors, such as those from which it's - * not possible to recover, but with rate limiting to prevent log flooding. - * The message will be logged at most once per default interval (see - * CONFIG_LOG_RATELIMIT_INTERVAL_MS). - * - * @param ... A string optionally containing printk valid conversion specifier, - * followed by as many values as specifiers. - */ -#define LOG_ERR_RATELIMIT(...) \ - LOG_ERR_RATELIMIT_RATE(CONFIG_LOG_RATELIMIT_INTERVAL_MS, __VA_ARGS__) - -/** - * @brief Writes an INFO level message to the log with rate limiting. - * - * @details It's meant to write generic user oriented messages with rate limiting - * to prevent log flooding. The message will be logged at most once per specified - * interval in milliseconds. - * - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param ... A string optionally containing printk valid conversion specifier, - * followed by as many values as specifiers. - */ -#define LOG_INF_RATELIMIT_RATE(_rate_ms, ...) \ - _LOG_RATELIMIT_CORE(LOG_LEVEL_INF, _rate_ms, "Skipped %d messages", Z_LOG, __VA_ARGS__) - -/** - * @brief Writes an INFO level message to the log with rate limiting. - * - * @details It's meant to write generic user oriented messages with rate limiting - * to prevent log flooding. The message will be logged at most once per default - * interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS). - * - * @param ... A string optionally containing printk valid conversion specifier, - * followed by as many values as specifiers. - */ -#define LOG_INF_RATELIMIT(...) \ - LOG_INF_RATELIMIT_RATE(CONFIG_LOG_RATELIMIT_INTERVAL_MS, __VA_ARGS__) - -/** - * @brief Writes a DEBUG level message to the log with rate limiting. - * - * @details It's meant to write developer oriented information with rate limiting - * to prevent log flooding. The message will be logged at most once per specified - * interval in milliseconds. - * - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param ... A string optionally containing printk valid conversion specifier, - * followed by as many values as specifiers. - */ -#define LOG_DBG_RATELIMIT_RATE(_rate_ms, ...) \ - _LOG_RATELIMIT_CORE(LOG_LEVEL_DBG, _rate_ms, "Skipped %d messages", Z_LOG, __VA_ARGS__) - -/** - * @brief Writes a DEBUG level message to the log with rate limiting. - * - * @details It's meant to write developer oriented information with rate limiting - * to prevent log flooding. The message will be logged at most once per default - * interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS). - * - * @param ... A string optionally containing printk valid conversion specifier, - * followed by as many values as specifiers. - */ -#define LOG_DBG_RATELIMIT(...) \ - LOG_DBG_RATELIMIT_RATE(CONFIG_LOG_RATELIMIT_INTERVAL_MS, __VA_ARGS__) - -/** - * @brief Writes an ERROR level hexdump message to the log with rate limiting. - * - * @details It's meant to report severe errors, such as those from which it's - * not possible to recover, but with rate limiting to prevent log flooding. - * The message will be logged at most once per specified interval in milliseconds. - * - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param _data Pointer to the data to be logged. - * @param _length Length of data (in bytes). - * @param _str Persistent, raw string. - */ -#define LOG_HEXDUMP_ERR_RATELIMIT_RATE(_rate_ms, _data, _length, _str) \ - _LOG_RATELIMIT_CORE(LOG_LEVEL_ERR, _rate_ms, "Skipped %d hexdump messages", \ - Z_LOG_HEXDUMP, _data, _length, _str) - -/** - * @brief Writes an ERROR level hexdump message to the log with rate limiting. - * - * @details It's meant to report severe errors, such as those from which it's - * not possible to recover, but with rate limiting to prevent log flooding. - * The message will be logged at most once per default interval (see - * CONFIG_LOG_RATELIMIT_INTERVAL_MS). - * - * @param _data Pointer to the data to be logged. - * @param _length Length of data (in bytes). - * @param _str Persistent, raw string. - */ -#define LOG_HEXDUMP_ERR_RATELIMIT(_data, _length, _str) \ - LOG_HEXDUMP_ERR_RATELIMIT_RATE(CONFIG_LOG_RATELIMIT_INTERVAL_MS, _data, _length, _str) - -/** - * @brief Writes a WARNING level hexdump message to the log with rate limiting. - * - * @details It's meant to register messages related to unusual situations that - * are not necessarily errors, but with rate limiting to prevent log flooding. - * The message will be logged at most once per specified interval in milliseconds. - * - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param _data Pointer to the data to be logged. - * @param _length Length of data (in bytes). - * @param _str Persistent, raw string. - */ -#define LOG_HEXDUMP_WRN_RATELIMIT_RATE(_rate_ms, _data, _length, _str) \ - _LOG_RATELIMIT_CORE(LOG_LEVEL_WRN, _rate_ms, "Skipped %d hexdump messages", \ - Z_LOG_HEXDUMP, _data, _length, _str) - -/** - * @brief Writes a WARNING level hexdump message to the log with rate limiting. - * - * @details It's meant to register messages related to unusual situations that - * are not necessarily errors, but with rate limiting to prevent log flooding. - * The message will be logged at most once per default interval (see - * CONFIG_LOG_RATELIMIT_INTERVAL_MS). - * - * @param _data Pointer to the data to be logged. - * @param _length Length of data (in bytes). - * @param _str Persistent, raw string. - */ -#define LOG_HEXDUMP_WRN_RATELIMIT(_data, _length, _str) \ - LOG_HEXDUMP_WRN_RATELIMIT_RATE(CONFIG_LOG_RATELIMIT_INTERVAL_MS, _data, _length, _str) - -/** - * @brief Writes an INFO level hexdump message to the log with rate limiting. - * - * @details It's meant to write generic user oriented messages with rate limiting - * to prevent log flooding. The message will be logged at most once per specified - * interval in milliseconds. - * - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param _data Pointer to the data to be logged. - * @param _length Length of data (in bytes). - * @param _str Persistent, raw string. - */ -#define LOG_HEXDUMP_INF_RATELIMIT_RATE(_rate_ms, _data, _length, _str) \ - _LOG_RATELIMIT_CORE(LOG_LEVEL_INF, _rate_ms, "Skipped %d hexdump messages", \ - Z_LOG_HEXDUMP, _data, _length, _str) - -/** - * @brief Writes an INFO level hexdump message to the log with rate limiting. - * - * @details It's meant to write generic user oriented messages with rate limiting - * to prevent log flooding. The message will be logged at most once per default - * interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS). - * - * @param _data Pointer to the data to be logged. - * @param _length Length of data (in bytes). - * @param _str Persistent, raw string. - */ -#define LOG_HEXDUMP_INF_RATELIMIT(_data, _length, _str) \ - LOG_HEXDUMP_INF_RATELIMIT_RATE(CONFIG_LOG_RATELIMIT_INTERVAL_MS, _data, _length, _str) - -/** - * @brief Writes a DEBUG level hexdump message to the log with rate limiting. - * - * @details It's meant to write developer oriented information with rate limiting - * to prevent log flooding. The message will be logged at most once per specified - * interval in milliseconds. - * - * @param _rate_ms Minimum interval in milliseconds between log messages. - * @param _data Pointer to the data to be logged. - * @param _length Length of data (in bytes). - * @param _str Persistent, raw string. - */ -#define LOG_HEXDUMP_DBG_RATELIMIT_RATE(_rate_ms, _data, _length, _str) \ - _LOG_RATELIMIT_CORE(LOG_LEVEL_DBG, _rate_ms, "Skipped %d hexdump messages", \ - Z_LOG_HEXDUMP, _data, _length, _str) - -/** - * @brief Writes a DEBUG level hexdump message to the log with rate limiting. - * - * @details It's meant to write developer oriented information with rate limiting - * to prevent log flooding. The message will be logged at most once per default - * interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS). - * - * @param _data Pointer to the data to be logged. - * @param _length Length of data (in bytes). - * @param _str Persistent, raw string. - */ -#define LOG_HEXDUMP_DBG_RATELIMIT(_data, _length, _str) \ - LOG_HEXDUMP_DBG_RATELIMIT_RATE(CONFIG_LOG_RATELIMIT_INTERVAL_MS, _data, _length, _str) - -#else /* CONFIG_LOG_RATELIMIT */ - -/* Rate-limited logging macros when CONFIG_LOG_RATELIMIT is disabled */ -#if defined(CONFIG_LOG_RATELIMIT_FALLBACK_DROP) -/* Fallback: Drop all prints (no output) */ -#define LOG_WRN_RATELIMIT_RATE(_rate_ms, ...) (void)0 -#define LOG_WRN_RATELIMIT(...) (void)0 -#define LOG_ERR_RATELIMIT_RATE(_rate_ms, ...) (void)0 -#define LOG_ERR_RATELIMIT(...) (void)0 -#define LOG_INF_RATELIMIT_RATE(_rate_ms, ...) (void)0 -#define LOG_INF_RATELIMIT(...) (void)0 -#define LOG_DBG_RATELIMIT_RATE(_rate_ms, ...) (void)0 -#define LOG_DBG_RATELIMIT(...) (void)0 -#define LOG_HEXDUMP_ERR_RATELIMIT_RATE(_rate_ms, _data, _length, _str) (void)0 -#define LOG_HEXDUMP_ERR_RATELIMIT(_data, _length, _str) (void)0 -#define LOG_HEXDUMP_WRN_RATELIMIT_RATE(_rate_ms, _data, _length, _str) (void)0 -#define LOG_HEXDUMP_WRN_RATELIMIT(_data, _length, _str) (void)0 -#define LOG_HEXDUMP_INF_RATELIMIT_RATE(_rate_ms, _data, _length, _str) (void)0 -#define LOG_HEXDUMP_INF_RATELIMIT(_data, _length, _str) (void)0 -#define LOG_HEXDUMP_DBG_RATELIMIT_RATE(_rate_ms, _data, _length, _str) (void)0 -#define LOG_HEXDUMP_DBG_RATELIMIT(_data, _length, _str) (void)0 -#else /* Catch all, not just CONFIG_LOG_RATELIMIT_FALLBACK_LOG */ -/* Fallback: Log all prints (ignore rate limiting) */ -#define LOG_WRN_RATELIMIT_RATE(_rate_ms, ...) LOG_WRN(__VA_ARGS__) -#define LOG_WRN_RATELIMIT(...) LOG_WRN(__VA_ARGS__) -#define LOG_ERR_RATELIMIT_RATE(_rate_ms, ...) LOG_ERR(__VA_ARGS__) -#define LOG_ERR_RATELIMIT(...) LOG_ERR(__VA_ARGS__) -#define LOG_INF_RATELIMIT_RATE(_rate_ms, ...) LOG_INF(__VA_ARGS__) -#define LOG_INF_RATELIMIT(...) LOG_INF(__VA_ARGS__) -#define LOG_DBG_RATELIMIT_RATE(_rate_ms, ...) LOG_DBG(__VA_ARGS__) -#define LOG_DBG_RATELIMIT(...) LOG_DBG(__VA_ARGS__) -#define LOG_HEXDUMP_ERR_RATELIMIT_RATE(_rate_ms, _data, _length, _str) \ - LOG_HEXDUMP_ERR(_data, _length, _str) -#define LOG_HEXDUMP_ERR_RATELIMIT(_data, _length, _str) \ - LOG_HEXDUMP_ERR(_data, _length, _str) -#define LOG_HEXDUMP_WRN_RATELIMIT_RATE(_rate_ms, _data, _length, _str) \ - LOG_HEXDUMP_WRN(_data, _length, _str) -#define LOG_HEXDUMP_WRN_RATELIMIT(_data, _length, _str) \ - LOG_HEXDUMP_WRN(_data, _length, _str) -#define LOG_HEXDUMP_INF_RATELIMIT_RATE(_rate_ms, _data, _length, _str) \ - LOG_HEXDUMP_INF(_data, _length, _str) -#define LOG_HEXDUMP_INF_RATELIMIT(_data, _length, _str) \ - LOG_HEXDUMP_INF(_data, _length, _str) -#define LOG_HEXDUMP_DBG_RATELIMIT_RATE(_rate_ms, _data, _length, _str) \ - LOG_HEXDUMP_DBG(_data, _length, _str) -#define LOG_HEXDUMP_DBG_RATELIMIT(_data, _length, _str) \ - LOG_HEXDUMP_DBG(_data, _length, _str) -#endif - -#endif /* CONFIG_LOG_RATELIMIT */ - /** * @brief Unconditionally print raw log message. * @@ -834,46 +499,6 @@ extern struct k_mem_partition k_log_partition; #define LOG_HEXDUMP_WRN(...) (void) 0 #define LOG_HEXDUMP_DBG(...) (void) 0 #define LOG_HEXDUMP_INF(...) (void) 0 - -#undef LOG_ERR_RATELIMIT -#undef LOG_WRN_RATELIMIT -#undef LOG_INF_RATELIMIT -#undef LOG_DBG_RATELIMIT - -#undef LOG_ERR_RATELIMIT_RATE -#undef LOG_WRN_RATELIMIT_RATE -#undef LOG_INF_RATELIMIT_RATE -#undef LOG_DBG_RATELIMIT_RATE - -#undef LOG_HEXDUMP_ERR_RATELIMIT -#undef LOG_HEXDUMP_WRN_RATELIMIT -#undef LOG_HEXDUMP_INF_RATELIMIT -#undef LOG_HEXDUMP_DBG_RATELIMIT - -#undef LOG_HEXDUMP_ERR_RATELIMIT_RATE -#undef LOG_HEXDUMP_WRN_RATELIMIT_RATE -#undef LOG_HEXDUMP_INF_RATELIMIT_RATE -#undef LOG_HEXDUMP_DBG_RATELIMIT_RATE - -#define LOG_ERR_RATELIMIT(...) (void) 0 -#define LOG_WRN_RATELIMIT(...) (void) 0 -#define LOG_INF_RATELIMIT(...) (void) 0 -#define LOG_DBG_RATELIMIT(...) (void) 0 - -#define LOG_HEXDUMP_ERR_RATELIMIT(...) (void) 0 -#define LOG_HEXDUMP_WRN_RATELIMIT(...) (void) 0 -#define LOG_HEXDUMP_INF_RATELIMIT(...) (void) 0 -#define LOG_HEXDUMP_DBG_RATELIMIT(...) (void) 0 - -#define LOG_ERR_RATELIMIT_RATE(...) (void) 0 -#define LOG_WRN_RATELIMIT_RATE(...) (void) 0 -#define LOG_INF_RATELIMIT_RATE(...) (void) 0 -#define LOG_DBG_RATELIMIT_RATE(...) (void) 0 - -#define LOG_HEXDUMP_ERR_RATELIMIT_RATE(...) (void) 0 -#define LOG_HEXDUMP_WRN_RATELIMIT_RATE(...) (void) 0 -#define LOG_HEXDUMP_INF_RATELIMIT_RATE(...) (void) 0 -#define LOG_HEXDUMP_DBG_RATELIMIT_RATE(...) (void) 0 #endif /** diff --git a/subsys/logging/Kconfig b/subsys/logging/Kconfig index 00a91f43c14..f7a7b32b804 100644 --- a/subsys/logging/Kconfig +++ b/subsys/logging/Kconfig @@ -49,56 +49,6 @@ endif rsource "Kconfig.misc" -config LOG_RATELIMIT - bool "Rate-limited logging macros" - default y - help - When enabled, provides rate-limited logging macros that prevent - log flooding when messages are generated frequently. Rate limiting - is per-macro-call-site, meaning each unique call has its own - independent rate limit. - -if LOG_RATELIMIT - -config LOG_RATELIMIT_INTERVAL_MS - int "Default rate limit interval (milliseconds)" - default 5000 - range 100 60000 - help - Default interval between rate-limited log messages. - This is used by the convenience macros LOG_*_RATELIMIT - when no explicit rate is provided. Can be overridden per call - using LOG_*_RATELIMIT_RATE macros. -endif # LOG_RATELIMIT - -if !LOG_RATELIMIT -choice LOG_RATELIMIT_FALLBACK - prompt "Fallback behavior for rate-limited logging macros" - default LOG_RATELIMIT_FALLBACK_DROP - help - Select fallback behavior for rate-limited logging macros when - LOG_RATELIMIT is disabled. - - - "Log all prints": All log prints are output, i.e., rate limiting is ignored. - - "Drop all prints": All log prints using rate-limited macros are dropped. - - This option allows you to control whether rate-limited log macros - should always print or be completely suppressed when rate limiting - is not available. - -config LOG_RATELIMIT_FALLBACK_LOG - bool "Log all prints (ignore rate limiting)" - help - All log prints using rate-limited macros are output as normal logs. - -config LOG_RATELIMIT_FALLBACK_DROP - bool "Drop all prints" - help - All log prints using rate-limited macros are dropped (no output). - -endchoice -endif # !LOG_RATELIMIT - endif # LOG config LOG_OUTPUT diff --git a/tests/subsys/logging/log_ratelimited/CMakeLists.txt b/tests/subsys/logging/log_ratelimited/CMakeLists.txt deleted file mode 100644 index 29df5637b03..00000000000 --- a/tests/subsys/logging/log_ratelimited/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2025 -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(log_ratelimited_test) - -FILE(GLOB app_sources *.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/subsys/logging/log_ratelimited/prj.conf b/tests/subsys/logging/log_ratelimited/prj.conf deleted file mode 100644 index e3621aa1a7e..00000000000 --- a/tests/subsys/logging/log_ratelimited/prj.conf +++ /dev/null @@ -1,18 +0,0 @@ -CONFIG_MAIN_THREAD_PRIORITY=5 -CONFIG_ZTEST=y -CONFIG_TEST_USERSPACE=y -CONFIG_TEST_LOGGING_DEFAULTS=n -CONFIG_LOG=y -CONFIG_LOG_OUTPUT=y -CONFIG_LOG_PRINTK=n -CONFIG_LOG_BACKEND_UART=y -CONFIG_LOG_BUFFER_SIZE=768 -CONFIG_KERNEL_LOG_LEVEL_OFF=y -CONFIG_SOC_LOG_LEVEL_OFF=y -CONFIG_ARCH_LOG_LEVEL_OFF=y -CONFIG_LOG_FUNC_NAME_PREFIX_DBG=n -CONFIG_LOG_PROCESS_THREAD=n -CONFIG_ASSERT=y -CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_LOG_DEFAULT_LEVEL=4 -CONFIG_LOG_RATELIMIT=y diff --git a/tests/subsys/logging/log_ratelimited/test_log_ratelimited.c b/tests/subsys/logging/log_ratelimited/test_log_ratelimited.c deleted file mode 100644 index ea22fe57964..00000000000 --- a/tests/subsys/logging/log_ratelimited/test_log_ratelimited.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -LOG_MODULE_REGISTER(test_log_ratelimited, CONFIG_LOG_DEFAULT_LEVEL); - -#ifndef CONFIG_LOG_RATELIMIT_FALLBACK_DROP -/* Test data for hexdump */ -static uint8_t test_data[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}; -#endif /* CONFIG_LOG_RATELIMIT_FALLBACK_DROP */ - -/** - * @brief Test compilation of all rate-limited macros. - * This test primarily checks for compilation errors and does not assert log - * counts, as log levels might filter some messages depending on Kconfig. - */ -ZTEST(log_ratelimited, test_compilation) -{ - /* This test only checks if the macros compile without errors. */ - /* Call each macro once to ensure compilation. */ - LOG_ERR_RATELIMIT("Compilation test: Error message"); - LOG_WRN_RATELIMIT("Compilation test: Warning message"); - LOG_INF_RATELIMIT("Compilation test: Info message"); - LOG_DBG_RATELIMIT("Compilation test: Debug message"); - - LOG_ERR_RATELIMIT_RATE(100, "Compilation test: Error message with rate"); - LOG_WRN_RATELIMIT_RATE(100, "Compilation test: Warning message with rate"); - LOG_INF_RATELIMIT_RATE(100, "Compilation test: Info message with rate"); - LOG_DBG_RATELIMIT_RATE(100, "Compilation test: Debug message with rate"); - - LOG_HEXDUMP_ERR_RATELIMIT(test_data, sizeof(test_data), - "Compilation test: Error hexdump"); - LOG_HEXDUMP_WRN_RATELIMIT(test_data, sizeof(test_data), - "Compilation test: Warning hexdump"); - LOG_HEXDUMP_INF_RATELIMIT(test_data, sizeof(test_data), - "Compilation test: Info hexdump"); - LOG_HEXDUMP_DBG_RATELIMIT(test_data, sizeof(test_data), - "Compilation test: Debug hexdump"); - - LOG_HEXDUMP_ERR_RATELIMIT_RATE(100, test_data, sizeof(test_data), - "Compilation test: Error hexdump with rate"); - LOG_HEXDUMP_WRN_RATELIMIT_RATE(100, test_data, sizeof(test_data), - "Compilation test: Warning hexdump with rate"); - LOG_HEXDUMP_INF_RATELIMIT_RATE(100, test_data, sizeof(test_data), - "Compilation test: Info hexdump with rate"); - LOG_HEXDUMP_DBG_RATELIMIT_RATE(100, test_data, sizeof(test_data), - "Compilation test: Debug hexdump with rate"); - - zassert_true(true, "All rate-limited macros compile successfully"); -} - - -/* Define the test suite and specify the setup function to be called before each - * test case. - */ -ZTEST_SUITE(log_ratelimited, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/subsys/logging/log_ratelimited/testcase.yaml b/tests/subsys/logging/log_ratelimited/testcase.yaml deleted file mode 100644 index 5fa2d18a562..00000000000 --- a/tests/subsys/logging/log_ratelimited/testcase.yaml +++ /dev/null @@ -1,23 +0,0 @@ -common: - integration_platforms: - - native_sim - tags: - - logging - platform_allow: - - native_sim - -tests: - logging.log_ratelimited: - build_only: true - extra_configs: - - CONFIG_LOG_RATELIMIT_INTERVAL_MS=1000 - logging.log_ratelimited.fallback_drop: - build_only: true - extra_configs: - - CONFIG_LOG_RATELIMIT=n - - CONFIG_LOG_RATELIMIT_FALLBACK_DROP=y - logging.log_ratelimited.fallback_log: - build_only: true - extra_configs: - - CONFIG_LOG_RATELIMIT=n - - CONFIG_LOG_RATELIMIT_FALLBACK_LOG=y From 6e05a326ba8c8ee115e196a1ca2d7f780e8cc7eb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 395/881] Revert "[nrf fromtree] modules: nrf_wifi: Fix build error" This reverts commit 446998834133fc1ef18874055f99531700a34f6e. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/os/shim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index 79137e46e13..6fb329cfd06 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -199,11 +199,11 @@ static void *zep_shim_spinlock_alloc(void) { struct k_mutex *lock = NULL; - lock = k_heap_aligned_alloc(wifi_ctrl_pool, WORD_SIZE, sizeof(*lock), K_FOREVER); - if (!lock) { + slock = k_heap_aligned_alloc(wifi_ctrl_pool, WORD_SIZE, sizeof(*slock), K_FOREVER); + if (!slock) { LOG_ERR("%s: Unable to allocate memory for spinlock", __func__); } else { - memset(lock, 0, sizeof(*lock)); + memset(slock, 0, sizeof(*slock)); } return lock; From ef901c09d04c91f9f07506014679554fd019be10 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 396/881] Revert "[nrf fromtree] Revert "modules: nrf_wifi: Use spinlocks"" This reverts commit 34e6741ed4104a5eb1dd68061f4848f6ca569d3c. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/os/shim.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index 6fb329cfd06..fba771284c6 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -195,9 +195,14 @@ static void zep_shim_qspi_cpy_to(void *priv, unsigned long addr, const void *src } #endif /* !CONFIG_NRF71_ON_IPC */ +struct zep_shim_spinlock { + struct k_spinlock lock; + k_spinlock_key_t key; +}; + static void *zep_shim_spinlock_alloc(void) { - struct k_mutex *lock = NULL; + struct zep_shim_spinlock *slock = NULL; slock = k_heap_aligned_alloc(wifi_ctrl_pool, WORD_SIZE, sizeof(*slock), K_FOREVER); if (!slock) { @@ -206,7 +211,7 @@ static void *zep_shim_spinlock_alloc(void) memset(slock, 0, sizeof(*slock)); } - return lock; + return slock; } static void zep_shim_spinlock_free(void *lock) @@ -218,29 +223,38 @@ static void zep_shim_spinlock_free(void *lock) static void zep_shim_spinlock_init(void *lock) { - k_mutex_init(lock); + /* No explicit initialization needed for k_spinlock_t */ + ARG_UNUSED(lock); } static void zep_shim_spinlock_take(void *lock) { - k_mutex_lock(lock, K_FOREVER); + struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock; + + slock->key = k_spin_lock(&slock->lock); } static void zep_shim_spinlock_rel(void *lock) { - k_mutex_unlock(lock); + struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock; + + k_spin_unlock(&slock->lock, slock->key); } static void zep_shim_spinlock_irq_take(void *lock, unsigned long *flags) { + struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock; + ARG_UNUSED(flags); - k_mutex_lock(lock, K_FOREVER); + slock->key = k_spin_lock(&slock->lock); } static void zep_shim_spinlock_irq_rel(void *lock, unsigned long *flags) { + struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock; + ARG_UNUSED(flags); - k_mutex_unlock(lock); + k_spin_unlock(&slock->lock, slock->key); } static int zep_shim_pr_dbg(const char *fmt, va_list args) From 945195359479dcddf189753d74afaee477c00fb8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 397/881] Revert "[nrf fromtree] modified: nrf_wifi: Refactor heap calls" This reverts commit 4142fcf4c635d8db389b4551e0a45700be0ae596. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/os/shim.c | 47 ++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index fba771284c6..a92720b6dce 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -34,14 +34,7 @@ LOG_MODULE_REGISTER(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); -/* Memory pool management - unified pool-based API */ -#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) -/* Use global system heap */ -extern struct sys_heap _system_heap; -static struct k_heap * const wifi_ctrl_pool = &_system_heap; -static struct k_heap * const wifi_data_pool = &_system_heap; -#else -/* Use dedicated heaps */ +#if !defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) #if defined(CONFIG_NOCACHE_MEMORY) K_HEAP_DEFINE_NOCACHE(wifi_drv_ctrl_mem_pool, CONFIG_NRF_WIFI_CTRL_HEAP_SIZE); K_HEAP_DEFINE_NOCACHE(wifi_drv_data_mem_pool, CONFIG_NRF_WIFI_DATA_HEAP_SIZE); @@ -49,8 +42,6 @@ K_HEAP_DEFINE_NOCACHE(wifi_drv_data_mem_pool, CONFIG_NRF_WIFI_DATA_HEAP_SIZE); K_HEAP_DEFINE(wifi_drv_ctrl_mem_pool, CONFIG_NRF_WIFI_CTRL_HEAP_SIZE); K_HEAP_DEFINE(wifi_drv_data_mem_pool, CONFIG_NRF_WIFI_DATA_HEAP_SIZE); #endif /* CONFIG_NOCACHE_MEMORY */ -static struct k_heap * const wifi_ctrl_pool = &wifi_drv_ctrl_mem_pool; -static struct k_heap * const wifi_data_pool = &wifi_drv_data_mem_pool; #endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ #define WORD_SIZE 4 @@ -61,14 +52,22 @@ static void *zep_shim_mem_alloc(size_t size) { size_t size_aligned = ROUND_UP(size, 4); - return k_heap_aligned_alloc(wifi_ctrl_pool, WORD_SIZE, size_aligned, K_FOREVER); +#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) + return k_malloc(size_aligned); +#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ + return k_heap_aligned_alloc(&wifi_drv_ctrl_mem_pool, WORD_SIZE, size_aligned, K_FOREVER); +#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } static void *zep_shim_data_mem_alloc(size_t size) { size_t size_aligned = ROUND_UP(size, 4); - return k_heap_aligned_alloc(wifi_data_pool, WORD_SIZE, size_aligned, K_FOREVER); +#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) + return k_malloc(size_aligned); +#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ + return k_heap_aligned_alloc(&wifi_drv_data_mem_pool, WORD_SIZE, size_aligned, K_FOREVER); +#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } static void *zep_shim_mem_zalloc(size_t size) @@ -112,14 +111,22 @@ static void *zep_shim_data_mem_zalloc(size_t size) static void zep_shim_mem_free(void *buf) { if (buf) { - k_heap_free(wifi_ctrl_pool, buf); +#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) + k_free(buf); +#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ + k_heap_free(&wifi_drv_ctrl_mem_pool, buf); +#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } } static void zep_shim_data_mem_free(void *buf) { if (buf) { - k_heap_free(wifi_data_pool, buf); +#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) + k_free(buf); +#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ + k_heap_free(&wifi_drv_data_mem_pool, buf); +#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } } @@ -204,11 +211,9 @@ static void *zep_shim_spinlock_alloc(void) { struct zep_shim_spinlock *slock = NULL; - slock = k_heap_aligned_alloc(wifi_ctrl_pool, WORD_SIZE, sizeof(*slock), K_FOREVER); + slock = k_calloc(sizeof(*slock), sizeof(char)); if (!slock) { LOG_ERR("%s: Unable to allocate memory for spinlock", __func__); - } else { - memset(slock, 0, sizeof(*slock)); } return slock; @@ -216,9 +221,11 @@ static void *zep_shim_spinlock_alloc(void) static void zep_shim_spinlock_free(void *lock) { - if (lock) { - k_heap_free(wifi_ctrl_pool, lock); - } +#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) + k_free(lock); +#else + k_heap_free(&wifi_drv_ctrl_mem_pool, lock); +#endif } static void zep_shim_spinlock_init(void *lock) From 1df01d7d2e33aa963f20394bd3bfcac1bc087107 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 398/881] Revert "[nrf fromtree] modules: nrf_wifi: Use spinlocks" This reverts commit 4e7cb9a82e8dcbd607868c597f07da8c0ec6d94f. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/os/shim.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index a92720b6dce..df460d5ab53 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -202,66 +202,53 @@ static void zep_shim_qspi_cpy_to(void *priv, unsigned long addr, const void *src } #endif /* !CONFIG_NRF71_ON_IPC */ -struct zep_shim_spinlock { - struct k_spinlock lock; - k_spinlock_key_t key; -}; - static void *zep_shim_spinlock_alloc(void) { - struct zep_shim_spinlock *slock = NULL; + struct k_mutex *lock = NULL; + + lock = zep_shim_mem_zalloc(sizeof(*lock)); - slock = k_calloc(sizeof(*slock), sizeof(char)); - if (!slock) { + if (!lock) { LOG_ERR("%s: Unable to allocate memory for spinlock", __func__); } - return slock; + return lock; } static void zep_shim_spinlock_free(void *lock) { #if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) k_free(lock); -#else +#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ k_heap_free(&wifi_drv_ctrl_mem_pool, lock); -#endif +#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } static void zep_shim_spinlock_init(void *lock) { - /* No explicit initialization needed for k_spinlock_t */ - ARG_UNUSED(lock); + k_mutex_init(lock); } static void zep_shim_spinlock_take(void *lock) { - struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock; - - slock->key = k_spin_lock(&slock->lock); + k_mutex_lock(lock, K_FOREVER); } static void zep_shim_spinlock_rel(void *lock) { - struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock; - - k_spin_unlock(&slock->lock, slock->key); + k_mutex_unlock(lock); } static void zep_shim_spinlock_irq_take(void *lock, unsigned long *flags) { - struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock; - ARG_UNUSED(flags); - slock->key = k_spin_lock(&slock->lock); + k_mutex_lock(lock, K_FOREVER); } static void zep_shim_spinlock_irq_rel(void *lock, unsigned long *flags) { - struct zep_shim_spinlock *slock = (struct zep_shim_spinlock *)lock; - ARG_UNUSED(flags); - k_spin_unlock(&slock->lock, slock->key); + k_mutex_unlock(lock); } static int zep_shim_pr_dbg(const char *fmt, va_list args) From c7b8611793e7e30fada110a3714496ff7030b93a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 399/881] Revert "[nrf fromlist] drivers: spi: nrfx_spi(m/s): enable cross domain pins for nRF54L15" This reverts commit 018480248f63ca34c4fd9e343be9a54f0aa30d42. Signed-off-by: Jukka Rissanen --- drivers/spi/spi_nrfx_spim.c | 102 ++--------------- drivers/spi/spi_nrfx_spis.c | 106 +++--------------- dts/bindings/spi/nordic,nrf-spi-common.yaml | 10 -- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 4 - ...l15dk_nrf54l15_cpuapp_cross_domain.overlay | 73 ------------ .../spi_controller_peripheral/testcase.yaml | 15 --- 6 files changed, 22 insertions(+), 288 deletions(-) delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index f1d6f8125d6..0646c67b4a3 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -43,16 +43,6 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #define SPI_BUFFER_IN_RAM 1 #endif -/* - * We use NODELABEL here because the nrfx API requires us to call - * functions which are named according to SoC peripheral instance - * being operated on. Since DT_INST() makes no guarantees about that, - * it won't work. - */ -#define SPIM(idx) DT_NODELABEL(spi##idx) -#define SPIM_PROP(idx, prop) DT_PROP(SPIM(idx), prop) -#define SPIM_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIM(idx), prop) - #if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL) #define SPIM_REQUESTS_CLOCK(node) \ DT_NODE_HAS_COMPAT(DT_CLOCKS_CTLR(node), nordic_nrf_hsfll_global) @@ -69,28 +59,6 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); #define SPIM_REQUESTS_CLOCK(node) 0 #endif -#define SPIM_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ - COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIM(prefix##idx)), \ - (SPIM_PROP(idx, cross_domain_pins_supported)), \ - (0)) - -#if NRFX_FOREACH_PRESENT(SPIM, SPIM_PINS_CROSS_DOMAIN, (||), (0)) -#include -/* Certain SPIM instances support usage of cross domain pins in form of dedicated pins on - * a port different from the default one. - */ -#define SPIM_CROSS_DOMAIN_SUPPORTED 1 -#endif - -#if SPIM_CROSS_DOMAIN_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) -#include -/* To use cross domain pins, constant latency mode needs to be applied, which is - * handled via nrf_sys_event requests. - */ -#define SPIM_CROSS_DOMAIN_PINS_HANDLE 1 -#endif - - struct spi_nrfx_data { struct spi_context ctx; const struct device *dev; @@ -130,10 +98,6 @@ struct spi_nrfx_config { const struct device *clk_dev; struct nrf_clock_spec clk_spec; #endif -#if SPIM_CROSS_DOMAIN_SUPPORTED - bool cross_domain; - int8_t default_port; -#endif }; static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context); @@ -183,32 +147,6 @@ static inline void release_clock(const struct device *dev) #endif } -#if SPIM_CROSS_DOMAIN_SUPPORTED -static bool spim_has_cross_domain_connection(const struct spi_nrfx_config *config) -{ - const struct pinctrl_dev_config *pcfg = config->pcfg; - const struct pinctrl_state *state; - int ret; - - ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); - if (ret < 0) { - LOG_ERR("Unable to read pin state"); - return false; - } - - for (uint8_t i = 0U; i < state->pin_cnt; i++) { - uint32_t pin = NRF_GET_PIN(state->pins[i]); - - if ((pin != NRF_PIN_DISCONNECTED) && - (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { - return true; - } - } - - return false; -} -#endif - static inline void finalize_spi_transaction(const struct device *dev, bool deactivate_cs) { struct spi_nrfx_data *dev_data = dev->data; @@ -750,19 +688,6 @@ static int spim_resume(const struct device *dev) #ifdef CONFIG_SOC_NRF54H20_GPD nrf_gpd_retain_pins_set(dev_config->pcfg, false); #endif -#if SPIM_CROSS_DOMAIN_SUPPORTED - if (dev_config->cross_domain && spim_has_cross_domain_connection(dev_config)) { -#if SPIM_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_request_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif return IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) ? request_clock(dev) : 0; } @@ -786,19 +711,6 @@ static void spim_suspend(const struct device *dev) #ifdef CONFIG_SOC_NRF54H20_GPD nrf_gpd_retain_pins_set(dev_config->pcfg, true); #endif -#if SPIM_CROSS_DOMAIN_SUPPORTED - if (dev_config->cross_domain && spim_has_cross_domain_connection(dev_config)) { -#if SPIM_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_request_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -878,6 +790,15 @@ static int spi_nrfx_deinit(const struct device *dev) return 0; } +/* + * We use NODELABEL here because the nrfx API requires us to call + * functions which are named according to SoC peripheral instance + * being operated on. Since DT_INST() makes no guarantees about that, + * it won't work. + */ +#define SPIM(idx) DT_NODELABEL(spi##idx) +#define SPIM_PROP(idx, prop) DT_PROP(SPIM(idx), prop) +#define SPIM_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIM(idx), prop) #define SPIM_MEM_REGION(idx) DT_PHANDLE(SPIM(idx), memory_regions) #define SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \ @@ -969,11 +890,6 @@ static int spi_nrfx_deinit(const struct device *dev) .clk_spec = { \ .frequency = NRF_CLOCK_CONTROL_FREQUENCY_MAX, \ },)) \ - IF_ENABLED(SPIM_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ - (.cross_domain = true, \ - .default_port = \ - DT_PROP_OR(DT_PHANDLE(SPIM(idx), \ - default_gpio_port), port, -1),)) \ }; \ BUILD_ASSERT(!SPIM_HAS_PROP(idx, wake_gpios) || \ !(DT_GPIO_FLAGS(SPIM(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index 8ab8de97955..ceb479c0441 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -36,38 +36,6 @@ LOG_MODULE_REGISTER(spi_nrfx_spis, CONFIG_SPI_LOG_LEVEL); BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); #endif -/* - * Current factors requiring use of DT_NODELABEL: - * - * - HAL design (requirement of drv_inst_idx in nrfx_spis_t) - * - Name-based HAL IRQ handlers, e.g. nrfx_spis_0_irq_handler - */ -#define SPIS_NODE(idx) COND_CODE_1(SPIS_IS_FAST(idx), (spis##idx), (spi##idx)) -#define SPIS(idx) DT_NODELABEL(SPIS_NODE(idx)) -#define SPIS_PROP(idx, prop) DT_PROP(SPIS(idx), prop) -#define SPIS_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIS(idx), prop) - -#define SPIS_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ - COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIS(prefix##idx)), \ - (SPIS_PROP(idx, cross_domain_pins_supported)), \ - (0)) - -#if NRFX_FOREACH_PRESENT(SPIS, SPIS_PINS_CROSS_DOMAIN, (||), (0)) -#include -/* Certain SPIM instances support usage of cross domain pins in form of dedicated pins on - * a port different from the default one. - */ -#define SPIS_CROSS_DOMAIN_SUPPORTED 1 -#endif - -#if SPIS_CROSS_DOMAIN_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) -#include -/* To use cross domain pins, constant latency mode needs to be applied, which is - * handled via nrf_sys_event requests. - */ -#define SPIS_CROSS_DOMAIN_PINS_HANDLE 1 -#endif - struct spi_nrfx_data { struct spi_context ctx; const struct device *dev; @@ -90,38 +58,8 @@ struct spi_nrfx_config { const struct pinctrl_dev_config *pcfg; struct gpio_dt_spec wake_gpio; void *mem_reg; -#if SPIS_CROSS_DOMAIN_SUPPORTED - bool cross_domain; - int8_t default_port; -#endif }; -#if SPIS_CROSS_DOMAIN_SUPPORTED -static bool spis_has_cross_domain_connection(const struct spi_nrfx_config *config) -{ - const struct pinctrl_dev_config *pcfg = config->pcfg; - const struct pinctrl_state *state; - int ret; - - ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); - if (ret < 0) { - LOG_ERR("Unable to read pin state"); - return false; - } - - for (uint8_t i = 0U; i < state->pin_cnt; i++) { - uint32_t pin = NRF_GET_PIN(state->pins[i]); - - if ((pin != NRF_PIN_DISCONNECTED) && - (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { - return true; - } - } - - return false; -} -#endif - static inline nrf_spis_mode_t get_nrf_spis_mode(uint16_t operation) { if (SPI_MODE_GET(operation) & SPI_MODE_CPOL) { @@ -446,19 +384,6 @@ static void spi_nrfx_suspend(const struct device *dev) nrf_gpd_retain_pins_set(dev_config->pcfg, true); } #endif -#if SPIS_CROSS_DOMAIN_SUPPORTED - if (dev_config->cross_domain && spis_has_cross_domain_connection(dev_config)) { -#if SPIS_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_request_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -474,19 +399,6 @@ static void spi_nrfx_resume(const struct device *dev) nrf_gpd_retain_pins_set(dev_config->pcfg, false); } #endif -#if SPIS_CROSS_DOMAIN_SUPPORTED - if (dev_config->cross_domain && spis_has_cross_domain_connection(dev_config)) { -#if SPIS_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_request_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif if (dev_config->wake_gpio.port == NULL) { nrf_spis_enable(dev_config->spis.p_reg); @@ -570,6 +482,19 @@ static int spi_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, spi_nrfx_pm_action); } +/* + * Current factors requiring use of DT_NODELABEL: + * + * - HAL design (requirement of drv_inst_idx in nrfx_spis_t) + * - Name-based HAL IRQ handlers, e.g. nrfx_spis_0_irq_handler + */ + +#define SPIS_NODE(idx) COND_CODE_1(SPIS_IS_FAST(idx), (spis##idx), (spi##idx)) + +#define SPIS(idx) DT_NODELABEL(SPIS_NODE(idx)) + +#define SPIS_PROP(idx, prop) DT_PROP(SPIS(idx), prop) + #define SPI_NRFX_SPIS_DEFINE(idx) \ static void irq_connect##idx(void) \ { \ @@ -608,11 +533,6 @@ static int spi_nrfx_init(const struct device *dev) NRFX_MHZ_TO_HZ(16UL),)) \ .wake_gpio = GPIO_DT_SPEC_GET_OR(SPIS(idx), wake_gpios, {0}), \ .mem_reg = DMM_DEV_TO_REG(SPIS(idx)), \ - IF_ENABLED(SPIS_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ - (.cross_domain = true, \ - .default_port = \ - DT_PROP_OR(DT_PHANDLE(SPIS(idx), \ - default_gpio_port), port, -1),)) \ }; \ BUILD_ASSERT(!DT_NODE_HAS_PROP(SPIS(idx), wake_gpios) || \ !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ diff --git a/dts/bindings/spi/nordic,nrf-spi-common.yaml b/dts/bindings/spi/nordic,nrf-spi-common.yaml index e76d785b2f4..dc81950aed3 100644 --- a/dts/bindings/spi/nordic,nrf-spi-common.yaml +++ b/dts/bindings/spi/nordic,nrf-spi-common.yaml @@ -61,13 +61,3 @@ properties: and SPI master again keeps the line in the low state Please note that the line must be configured and properly handled on both sides for the mechanism to work correctly. - - default-gpio-port: - type: phandle - description: | - SPI default GPIO port. - - cross-domain-pins-supported: - type: boolean - description: | - SPI allows usage of cross domain pins with constant latency mode required. diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index aa259713d2f..9a41f013b3e 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -311,8 +311,6 @@ rx-delay-supported; rx-delay = <1>; status = "disabled"; - default-gpio-port = <&gpio1>; - cross-domain-pins-supported; }; uart20: uart@c6000 { @@ -354,8 +352,6 @@ rx-delay-supported; rx-delay = <1>; status = "disabled"; - default-gpio-port = <&gpio1>; - cross-domain-pins-supported; }; uart21: uart@c7000 { diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay deleted file mode 100644 index f2e1ac5ce4e..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi21_default_alt: spi21_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi21_sleep_alt: spi21_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi22_default_alt: spi22_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi22_sleep_alt: spi22_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -&gpio2 { - status = "okay"; -}; - -&spi21 { - status = "okay"; - pinctrl-0 = <&spi21_default_alt>; - pinctrl-1 = <&spi21_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; - zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -dut_spis: &spi22 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi22_default_alt>; - pinctrl-1 = <&spi22_sleep_alt>; - pinctrl-names = "default", "sleep"; - /delete-property/rx-delay-supported; - /delete-property/rx-delay; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index f385c3073e9..10365d8014d 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -102,18 +102,3 @@ tests: - CONFIG_PM_DEVICE=y - CONFIG_PM_DEVICE_RUNTIME=y filter: CONFIG_SOC_FAMILY_NORDIC_NRF - - drivers.spi.spi_cross_domain: - harness_config: - fixture: spi_p1_p2_loopback - extra_configs: - - CONFIG_TESTED_SPI_MODE=0 - - CONFIG_NRF_SYS_EVENT=y - extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay" - platform_exclude: - - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr - - nrf54l20pdk/nrf54l20/cpuapp - - ophelia4ev/nrf54l15/cpuapp From 4f86a42eef1eaeffe801b233d5479b780dfd0850 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 400/881] Revert "[nrf fromlist] drivers: serial: nrfx_uarte: enable cross domain pins for nRF54L15" This reverts commit 20db3ee4cf31537296f92c68cea67cb7707c8f3d. Signed-off-by: Jukka Rissanen --- drivers/serial/uart_nrfx_uarte.c | 82 ------------------- dts/bindings/serial/nordic,nrf-uarte.yaml | 10 --- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 4 - ...l15dk_nrf54l15_cpuapp_cross_domain.overlay | 31 ------- .../uart/uart_elementary/testcase.yaml | 9 -- 5 files changed, 136 deletions(-) delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 20b6cad541d..1c75f443228 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -148,27 +148,6 @@ BUILD_ASSERT(IS_ENABLED(CONFIG_CLOCK_CONTROL)); */ #define UARTE_ANY_HIGH_SPEED (UARTE_FOR_EACH_INSTANCE(INSTANCE_IS_HIGH_SPEED, (||), (0))) -#define UARTE_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ - COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(UARTE(prefix##idx)), \ - (UARTE_PROP(idx, cross_domain_pins_supported)), \ - (0)) - -#if UARTE_FOR_EACH_INSTANCE(UARTE_PINS_CROSS_DOMAIN, (||), (0)) -#include -/* Certain UARTE instances support usage of cross domain pins in form of dedicated pins on - * a port different from the default one. - */ -#define UARTE_CROSS_DOMAIN_PINS_SUPPORTED 1 -#endif - -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) -#include -/* To use cross domain pins, constant latency mode needs to be applied, which is - * handled via nrf_sys_event requests. - */ -#define UARTE_CROSS_DOMAIN_PINS_HANDLE 1 -#endif - #ifdef UARTE_ANY_CACHE /* uart120 instance does not retain BAUDRATE register when ENABLE=0. When this instance * is used then baudrate must be set after enabling the peripheral and not before. @@ -392,10 +371,6 @@ struct uarte_nrfx_config { #endif uint8_t *poll_out_byte; uint8_t *poll_in_byte; -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED - bool cross_domain; - int8_t default_port; -#endif }; /* Using Macro instead of static inline function to handle NO_OPTIMIZATIONS case @@ -469,32 +444,6 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) nrf_uarte_disable(get_uarte_instance(dev)); } -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED -static bool uarte_has_cross_domain_connection(const struct uarte_nrfx_config *config) -{ - const struct pinctrl_dev_config *pcfg = config->pcfg; - const struct pinctrl_state *state; - int ret; - - ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); - if (ret < 0) { - LOG_ERR("Unable to read pin state"); - return false; - } - - for (uint8_t i = 0U; i < state->pin_cnt; i++) { - uint32_t pin = NRF_GET_PIN(state->pins[i]); - - if ((pin != NRF_PIN_DISCONNECTED) && - (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { - return true; - } - } - - return false; -} -#endif - #if defined(UARTE_ANY_NONE_ASYNC) && !defined(CONFIG_UART_NRFX_UARTE_NO_IRQ) /** * @brief Interrupt service routine. @@ -778,19 +727,6 @@ static void uarte_periph_enable(const struct device *dev) #ifdef CONFIG_SOC_NRF54H20_GPD nrf_gpd_retain_pins_set(config->pcfg, false); #endif -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED - if (config->cross_domain && uarte_has_cross_domain_connection(config)) { -#if UARTE_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_request_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif #if UARTE_BAUDRATE_RETENTION_WORKAROUND nrf_uarte_baudrate_set(uarte, COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, @@ -2475,19 +2411,6 @@ static void uarte_pm_suspend(const struct device *dev) #ifdef CONFIG_SOC_NRF54H20_GPD nrf_gpd_retain_pins_set(cfg->pcfg, true); #endif -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED - if (cfg->cross_domain && uarte_has_cross_domain_connection(cfg)) { -#if UARTE_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_release_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif nrf_uarte_disable(uarte); @@ -2775,11 +2698,6 @@ static int uarte_instance_init(const struct device *dev, .accuracy = 0, \ .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT,\ },)) \ - IF_ENABLED(UARTE_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ - (.cross_domain = true, \ - .default_port = \ - DT_PROP_OR(DT_PHANDLE(UARTE(idx), \ - default_gpio_port), port, -1),)) \ }; \ UARTE_DIRECT_ISR_DECLARE(idx) \ static int uarte_##idx##_init(const struct device *dev) \ diff --git a/dts/bindings/serial/nordic,nrf-uarte.yaml b/dts/bindings/serial/nordic,nrf-uarte.yaml index 4e9ccb0dd40..e6ba4c0b214 100644 --- a/dts/bindings/serial/nordic,nrf-uarte.yaml +++ b/dts/bindings/serial/nordic,nrf-uarte.yaml @@ -14,13 +14,3 @@ properties: type: boolean description: | UARTE has RX frame timeout HW feature. - - default-gpio-port: - type: phandle - description: | - UARTE default GPIO port. - - cross-domain-pins-supported: - type: boolean - description: | - UARTE allows usage of cross domain pins with constant latency mode required. diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 9a41f013b3e..004454191f0 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -320,8 +320,6 @@ status = "disabled"; endtx-stoptx-supported; frame-timeout-supported; - default-gpio-port = <&gpio1>; - cross-domain-pins-supported; }; i2c21: i2c@c7000 { @@ -361,8 +359,6 @@ status = "disabled"; endtx-stoptx-supported; frame-timeout-supported; - default-gpio-port = <&gpio1>; - cross-domain-pins-supported; }; i2c22: i2c@c8000 { diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay deleted file mode 100644 index 49363195160..00000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index 7afdc874269..de3d18a50ee 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -97,12 +97,3 @@ tests: extra_configs: - CONFIG_DUAL_UART_TEST=y - CONFIG_SETUP_MISMATCH_TEST=y - drivers.uart.uart_elementary_cross_domain: - filter: CONFIG_SERIAL_SUPPORT_INTERRUPT - harness_config: - fixture: uart_p1_p2_loopback - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay" - extra_configs: - - CONFIG_NRF_SYS_EVENT=y From ffe722c53f351844b78a6cbd7324893883bf0c8c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 401/881] Revert "[nrf fromlist] tests: nrf: comp: fix VDD reference dependency" This reverts commit adb6384b92f3f31900197975a37a936eac5e4483. Signed-off-by: Jukka Rissanen --- tests/boards/nrf/comp/src/test.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/boards/nrf/comp/src/test.c b/tests/boards/nrf/comp/src/test.c index 1d1876e76fa..2195f0e1ea9 100644 --- a/tests/boards/nrf/comp/src/test.c +++ b/tests/boards/nrf/comp/src/test.c @@ -93,11 +93,8 @@ ZTEST(comparator_runtime_configure, test_comp_config_se_vdd) #ifdef COMP_REFSEL_REFSEL_AVDDAO1V8 conf.refsel = COMP_NRF_COMP_REFSEL_AVDDAO1V8; -#elif defined(COMP_REFSEL_REFSEL_VDD) - conf.refsel = COMP_NRF_COMP_REFSEL_VDD; #else - /* Use internal 1.2 V derived from VDD */ - conf.refsel = COMP_NRF_COMP_REFSEL_INT_1V2; + conf.refsel = COMP_NRF_COMP_REFSEL_VDD; #endif rc = comp_nrf_comp_configure_se(test_dev, &conf); zassert_equal(rc, 0, "Cannot configure comparator."); From 94ea158ac30fff5c6d7fe3aef50737f6ca056e72 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 402/881] Revert "[nrf fromlist] drivers: adc: nrfx_saadc: remove VDD and DVDD inputs for nRF54LV10A" This reverts commit 19ec391a40c62bafb3ac6e3afc249d23f0f57773. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 274a43157e0..bb0b4d5ab0a 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -66,7 +66,7 @@ static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, }; #elif defined(NRF54LV10A_ENGA_XXAA) -static const uint32_t saadc_psels[NRF_SAADC_AIN7 + 1] = { +static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), @@ -75,6 +75,8 @@ static const uint32_t saadc_psels[NRF_SAADC_AIN7 + 1] = { [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(10U, 1), [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), + [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, + [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, }; #endif From f6990e9198be6cb068febb7f4ffb4688774a2ea1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 403/881] Revert "[nrf fromlist] manifest: update hal_nordic revision to integrate nrfx 3.13.0" This reverts commit 2ca44cd5586e5362976046cbbe6531efe2947801. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index acf99c65b10..20d4800519a 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 2f5d4e5868ab573eac932fa4bc142565073c3c04 + revision: 9587b1dcb83d24ab74e89837843a5f7d573f7059 path: modules/hal/nordic groups: - hal From 9e050e4c84695a487a2c6d0615d31346581e118a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:18 +0300 Subject: [PATCH 404/881] Revert "[nrf fromtree] drivers: adc: nrfx_saadc: Fix SAADC shim for nRF54LV10A" This reverts commit 9f47f6c1b7315fa2d1f189c8867269605a222891. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index bb0b4d5ab0a..f9f136f2509 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -283,7 +283,7 @@ static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) #endif default: #else - if (gain != ADC_GAIN_1) { + if (ch_cfg->gain != ADC_GAIN_1) { #endif /* defined(NRF_SAADC_HAS_CH_GAIN) */ LOG_ERR("Selected ADC gain is not valid"); return -EINVAL; From 2e854a34a8d943845176e7a7e7615de5244d2248 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 405/881] Revert "[nrf fromtree] drivers: adc: rework Nordic SAADC driver" This reverts commit 812e93bc9f8fc0a0721b46fd94f4b69f78a379fd. Signed-off-by: Jukka Rissanen --- drivers/adc/Kconfig.nrfx | 1 - drivers/adc/adc_nrfx_saadc.c | 518 ++++++++++++++++++++--------------- 2 files changed, 297 insertions(+), 222 deletions(-) diff --git a/drivers/adc/Kconfig.nrfx b/drivers/adc/Kconfig.nrfx index 0a602f5b97b..d411d5c99e1 100644 --- a/drivers/adc/Kconfig.nrfx +++ b/drivers/adc/Kconfig.nrfx @@ -27,6 +27,5 @@ config ADC_NRFX_SAADC default y depends on DT_HAS_NORDIC_NRF_SAADC_ENABLED select ADC_CONFIGURABLE_INPUTS - select NRFX_SAADC help Enable support for nrfx SAADC driver. diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index f9f136f2509..54719a1136d 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -6,15 +6,18 @@ #define ADC_CONTEXT_USES_KERNEL_TIMER #include "adc_context.h" -#include +#include #include #include #include #include +#include +#include + +#define LOG_LEVEL CONFIG_ADC_LOG_LEVEL #include #include - -LOG_MODULE_REGISTER(adc_nrfx_saadc, CONFIG_ADC_LOG_LEVEL); +LOG_MODULE_REGISTER(adc_nrfx_saadc); #define DT_DRV_COMPAT nordic_nrf_saadc @@ -100,9 +103,16 @@ BUILD_ASSERT((NRF_SAADC_AIN0 == NRF_SAADC_INPUT_AIN0) && #endif #if defined(CONFIG_NRF_PLATFORM_HALTIUM) -#include + /* Haltium devices always use bounce buffers in RAM */ -static uint16_t adc_samples_buffer[SAADC_CH_NUM] DMM_MEMORY_SECTION(DT_NODELABEL(adc)); + +#define SAADC_MEMORY_SECTION \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_NODELABEL(adc), memory_regions), \ + (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ + DT_PHANDLE(DT_NODELABEL(adc), memory_regions)))))), \ + ()) + +static uint16_t adc_samples_buffer[SAADC_CH_NUM] SAADC_MEMORY_SECTION; #define ADC_BUFFER_IN_RAM @@ -110,13 +120,14 @@ static uint16_t adc_samples_buffer[SAADC_CH_NUM] DMM_MEMORY_SECTION(DT_NODELABEL struct driver_data { struct adc_context ctx; + + uint8_t positive_inputs[SAADC_CH_NUM]; uint8_t single_ended_channels; - nrf_saadc_value_t *buffer; /* Pointer to the buffer with converted samples. */ - uint8_t active_channel_cnt; #if defined(ADC_BUFFER_IN_RAM) void *samples_buffer; void *user_buffer; + uint8_t active_channels; #endif }; @@ -129,37 +140,41 @@ static struct driver_data m_data = { #endif }; -/* Forward declaration */ -static void event_handler(const nrfx_saadc_evt_t *event); +/* Helper function to convert number of samples to the byte representation. */ +static uint32_t samples_to_bytes(uint16_t number_of_samples) +{ + return number_of_samples * 2; +} /* Helper function to convert acquisition time to register TACQ value. */ -static int acq_time_set(nrf_saadc_channel_config_t *ch_cfg, uint16_t acquisition_time) +static int adc_convert_acq_time(uint16_t acquisition_time, nrf_saadc_acqtime_t *p_tacq_val) { + int result = 0; + #if NRF_SAADC_HAS_ACQTIME_ENUM switch (acquisition_time) { case ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 3): - ch_cfg->acq_time = NRF_SAADC_ACQTIME_3US; + *p_tacq_val = NRF_SAADC_ACQTIME_3US; break; case ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 5): - ch_cfg->acq_time = NRF_SAADC_ACQTIME_5US; + *p_tacq_val = NRF_SAADC_ACQTIME_5US; break; case ADC_ACQ_TIME_DEFAULT: case ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 10): - ch_cfg->acq_time = NRF_SAADC_ACQTIME_10US; + *p_tacq_val = NRF_SAADC_ACQTIME_10US; break; case ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 15): - ch_cfg->acq_time = NRF_SAADC_ACQTIME_15US; + *p_tacq_val = NRF_SAADC_ACQTIME_15US; break; case ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 20): - ch_cfg->acq_time = NRF_SAADC_ACQTIME_20US; + *p_tacq_val = NRF_SAADC_ACQTIME_20US; break; case ADC_ACQ_TIME_MAX: case ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 40): - ch_cfg->acq_time = NRF_SAADC_ACQTIME_40US; + *p_tacq_val = NRF_SAADC_ACQTIME_40US; break; default: - LOG_ERR("Selected ADC acquisition time is not valid"); - return -EINVAL; + result = -EINVAL; } #else #define MINIMUM_ACQ_TIME_IN_NS 125 @@ -176,138 +191,130 @@ static int acq_time_set(nrf_saadc_channel_config_t *ch_cfg, uint16_t acquisition tacq = (nrf_saadc_acqtime_t)(acq_time / MINIMUM_ACQ_TIME_IN_NS) - 1; if ((tacq > NRF_SAADC_ACQTIME_MAX) || (acq_time < MINIMUM_ACQ_TIME_IN_NS)) { - LOG_ERR("Selected ADC acquisition time is not valid"); - return -EINVAL; + result = -EINVAL; } else { - ch_cfg->acq_time = tacq; + *p_tacq_val = tacq; } #endif - LOG_DBG("ADC acquisition_time: %d", acquisition_time); - - return 0; + return result; } -static int input_assign(nrf_saadc_input_t *pin_p, - nrf_saadc_input_t *pin_n, - const struct adc_channel_cfg *channel_cfg) +static int saadc_pm_hook(const struct device *dev, enum pm_device_action action) { -#if (NRF_SAADC_HAS_AIN_AS_PIN) - if (channel_cfg->input_positive > ARRAY_SIZE(saadc_psels) || - channel_cfg->input_positive < NRF_SAADC_AIN0) { - LOG_ERR("Invalid analog positive input number: %d", channel_cfg->input_positive); - return -EINVAL; - } + ARG_UNUSED(dev); - *pin_p = saadc_psels[channel_cfg->input_positive]; + switch (action) { + case PM_DEVICE_ACTION_SUSPEND: + nrf_saadc_disable(NRF_SAADC); + return 0; - if (channel_cfg->differential) { - if (channel_cfg->input_negative > ARRAY_SIZE(saadc_psels) || - channel_cfg->input_negative < NRF_SAADC_AIN0 || - (IS_ENABLED(CONFIG_NRF_PLATFORM_HALTIUM) && - (channel_cfg->input_positive > NRF_SAADC_AIN7) != - (channel_cfg->input_negative > NRF_SAADC_AIN7))) { - LOG_ERR("Invalid analog negative input number: %d", - channel_cfg->input_negative); - return -EINVAL; - } - *pin_n = saadc_psels[channel_cfg->input_negative]; - } else { - *pin_n = NRF_SAADC_INPUT_DISABLED; + case PM_DEVICE_ACTION_RESUME: + nrf_saadc_enable(NRF_SAADC); + return 0; + + default: + break; } -#else - *pin_p = channel_cfg->input_positive; - *pin_n = channel_cfg->differential ? channel_cfg->input_negative - : NRF_SAADC_INPUT_DISABLED; -#endif - LOG_DBG("ADC positive input: %d", *pin_p); - LOG_DBG("ADC negative input: %d", *pin_n); - return 0; + return -ENOTSUP; } -static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) +/* Implementation of the ADC driver API function: adc_channel_setup. */ +static int adc_nrfx_channel_setup(const struct device *dev, + const struct adc_channel_cfg *channel_cfg) { + nrf_saadc_channel_config_t config = { +#if NRF_SAADC_HAS_CH_CONFIG_RES + .resistor_p = NRF_SAADC_RESISTOR_DISABLED, + .resistor_n = NRF_SAADC_RESISTOR_DISABLED, +#endif +#if NRF_SAADC_HAS_CH_BURST + .burst = NRF_SAADC_BURST_DISABLED, +#endif + }; + uint8_t channel_id = channel_cfg->channel_id; + uint32_t input_negative = channel_cfg->input_negative; + + if (channel_id >= SAADC_CH_NUM) { + return -EINVAL; + } + #if NRF_SAADC_HAS_CH_GAIN - switch (gain) { + switch (channel_cfg->gain) { #if defined(SAADC_CH_CONFIG_GAIN_Gain1_6) case ADC_GAIN_1_6: - ch_cfg->gain = NRF_SAADC_GAIN1_6; + config.gain = NRF_SAADC_GAIN1_6; break; #endif #if defined(SAADC_CH_CONFIG_GAIN_Gain1_5) case ADC_GAIN_1_5: - ch_cfg->gain = NRF_SAADC_GAIN1_5; + config.gain = NRF_SAADC_GAIN1_5; break; #endif #if defined(SAADC_CH_CONFIG_GAIN_Gain1_4) || defined(SAADC_CH_CONFIG_GAIN_Gain2_8) case ADC_GAIN_1_4: - ch_cfg->gain = NRF_SAADC_GAIN1_4; + config.gain = NRF_SAADC_GAIN1_4; break; #endif #if defined(SAADC_CH_CONFIG_GAIN_Gain2_7) case ADC_GAIN_2_7: - ch_cfg->gain = NRF_SAADC_GAIN2_7; + config.gain = NRF_SAADC_GAIN2_7; break; #endif #if defined(SAADC_CH_CONFIG_GAIN_Gain1_3) || defined(SAADC_CH_CONFIG_GAIN_Gain2_6) case ADC_GAIN_1_3: - ch_cfg->gain = NRF_SAADC_GAIN1_3; + config.gain = NRF_SAADC_GAIN1_3; break; #endif #if defined(SAADC_CH_CONFIG_GAIN_Gain2_5) case ADC_GAIN_2_5: - ch_cfg->gain = NRF_SAADC_GAIN2_5; + config.gain = NRF_SAADC_GAIN2_5; break; #endif #if defined(SAADC_CH_CONFIG_GAIN_Gain1_2) || defined(SAADC_CH_CONFIG_GAIN_Gain2_4) case ADC_GAIN_1_2: - ch_cfg->gain = NRF_SAADC_GAIN1_2; + config.gain = NRF_SAADC_GAIN1_2; break; #endif #if defined(SAADC_CH_CONFIG_GAIN_Gain2_3) case ADC_GAIN_2_3: - ch_cfg->gain = NRF_SAADC_GAIN2_3; + config.gain = NRF_SAADC_GAIN2_3; break; #endif case ADC_GAIN_1: - ch_cfg->gain = NRF_SAADC_GAIN1; + config.gain = NRF_SAADC_GAIN1; break; case ADC_GAIN_2: - ch_cfg->gain = NRF_SAADC_GAIN2; + config.gain = NRF_SAADC_GAIN2; break; #if defined(SAADC_CH_CONFIG_GAIN_Gain4) case ADC_GAIN_4: - ch_cfg->gain = NRF_SAADC_GAIN4; + config.gain = NRF_SAADC_GAIN4; break; #endif default: #else - if (ch_cfg->gain != ADC_GAIN_1) { + if (channel_cfg->gain != ADC_GAIN_1) { #endif /* defined(NRF_SAADC_HAS_CH_GAIN) */ LOG_ERR("Selected ADC gain is not valid"); return -EINVAL; } - return 0; -} - -static int reference_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_reference reference) -{ - switch (reference) { + switch (channel_cfg->reference) { #if defined(SAADC_CH_CONFIG_REFSEL_Internal) case ADC_REF_INTERNAL: - ch_cfg->reference = NRF_SAADC_REFERENCE_INTERNAL; + config.reference = NRF_SAADC_REFERENCE_INTERNAL; break; #endif #if defined(SAADC_CH_CONFIG_REFSEL_VDD1_4) case ADC_REF_VDD_1_4: - ch_cfg->reference = NRF_SAADC_REFERENCE_VDD4; + config.reference = NRF_SAADC_REFERENCE_VDD4; break; #endif #if defined(SAADC_CH_CONFIG_REFSEL_External) case ADC_REF_EXTERNAL0: - ch_cfg->reference = NRF_SAADC_REFERENCE_EXTERNAL; + config.reference = NRF_SAADC_REFERENCE_EXTERNAL; break; #endif default: @@ -315,130 +322,133 @@ static int reference_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_reference return -EINVAL; } - return 0; -} - -/* Implementation of the ADC driver API function: adc_channel_setup. */ -static int adc_nrfx_channel_setup(const struct device *dev, - const struct adc_channel_cfg *channel_cfg) -{ - int err; - nrf_saadc_channel_config_t *ch_cfg; - nrfx_saadc_channel_t cfg = { - .channel_config = { -#if NRF_SAADC_HAS_CH_CONFIG_RES - .resistor_p = NRF_SAADC_RESISTOR_DISABLED, - .resistor_n = NRF_SAADC_RESISTOR_DISABLED, -#endif -#if NRF_SAADC_HAS_CH_BURST - .burst = NRF_SAADC_BURST_DISABLED, -#endif - }, - .channel_index = channel_cfg->channel_id, - }; + int ret = adc_convert_acq_time(channel_cfg->acquisition_time, &config.acq_time); - if (channel_cfg->channel_id >= SAADC_CH_NUM) { - LOG_ERR("Invalid channel ID: %d", channel_cfg->channel_id); + if (ret) { + LOG_ERR("Selected ADC acquisition time is not valid"); return -EINVAL; } - ch_cfg = &cfg.channel_config; - - err = input_assign(&cfg.pin_p, &cfg.pin_n, channel_cfg); - if (err != 0) { - return err; - } - - err = gain_set(ch_cfg, channel_cfg->gain); - if (err != 0) { - return err; - } - - err = reference_set(ch_cfg, channel_cfg->reference); - if (err != 0) { - return err; - } - - err = acq_time_set(ch_cfg, channel_cfg->acquisition_time); - if (err != 0) { - return err; - } - /* Store channel mode to allow correcting negative readings in single-ended mode * after ADC sequence ends. */ if (channel_cfg->differential) { - ch_cfg->mode = NRF_SAADC_MODE_DIFFERENTIAL; + config.mode = NRF_SAADC_MODE_DIFFERENTIAL; m_data.single_ended_channels &= ~BIT(channel_cfg->channel_id); } else { - ch_cfg->mode = NRF_SAADC_MODE_SINGLE_ENDED; + config.mode = NRF_SAADC_MODE_SINGLE_ENDED; m_data.single_ended_channels |= BIT(channel_cfg->channel_id); } - nrfx_err_t ret = nrfx_saadc_channel_config(&cfg); - - if (ret != NRFX_SUCCESS) { - LOG_ERR("Cannot configure channel %d: %d", channel_cfg->channel_id, ret); +#if (NRF_SAADC_HAS_AIN_AS_PIN) + if ((channel_cfg->input_positive >= ARRAY_SIZE(saadc_psels)) || + (channel_cfg->input_positive < NRF_SAADC_AIN0)) { return -EINVAL; } + if (config.mode == NRF_SAADC_MODE_DIFFERENTIAL) { +#if defined(CONFIG_NRF_PLATFORM_HALTIUM) + if ((input_negative > NRF_SAADC_AIN7) != + (channel_cfg->input_positive > NRF_SAADC_AIN7)) { +#else + if (input_negative > NRF_SAADC_AIN7 || + input_negative < NRF_SAADC_AIN0) { +#endif + return -EINVAL; + } + + input_negative = saadc_psels[input_negative]; + } else { + input_negative = NRF_SAADC_INPUT_DISABLED; + } +#endif + /* Store the positive input selection in a dedicated array, + * to get it later when the channel is selected for a sampling + * and to mark the channel as configured (ready to be selected). + */ + m_data.positive_inputs[channel_id] = channel_cfg->input_positive; + + nrf_saadc_channel_init(NRF_SAADC, channel_id, &config); + /* Keep the channel disabled in hardware (set positive input to + * NRF_SAADC_INPUT_DISABLED) until it is selected to be included + * in a sampling sequence. + */ + nrf_saadc_channel_input_set(NRF_SAADC, + channel_id, + NRF_SAADC_INPUT_DISABLED, + input_negative); + return 0; } static void adc_context_start_sampling(struct adc_context *ctx) { +#if defined(CONFIG_PM_DEVICE_RUNTIME) + pm_device_runtime_get(DEVICE_DT_INST_GET(0)); +#else + nrf_saadc_enable(NRF_SAADC); +#endif + if (ctx->sequence.calibrate) { - nrfx_saadc_offset_calibrate(event_handler); + nrf_saadc_task_trigger(NRF_SAADC, + NRF_SAADC_TASK_CALIBRATEOFFSET); } else { - nrfx_err_t ret = nrfx_saadc_mode_trigger(); - - if (ret != NRFX_SUCCESS) { - LOG_ERR("Cannot start sampling: 0x%08x", ret); - adc_context_complete(&m_data.ctx, -EIO); - } + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_START); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_SAMPLE); } } -static void adc_context_update_buffer_pointer(struct adc_context *ctx, bool repeat) +static void adc_context_update_buffer_pointer(struct adc_context *ctx, + bool repeat) { + ARG_UNUSED(ctx); + if (!repeat) { #if defined(ADC_BUFFER_IN_RAM) - m_data.user_buffer = (uint16_t *)m_data.user_buffer + m_data.active_channel_cnt; + m_data.user_buffer = (uint8_t *)m_data.user_buffer + + samples_to_bytes(nrfy_saadc_amount_get(NRF_SAADC)); #else - nrf_saadc_value_t *buffer = (uint16_t *)m_data.buffer + m_data.active_channel_cnt; - - nrfx_saadc_buffer_set(buffer, m_data.active_channel_cnt); + nrf_saadc_value_t *buffer = + (uint8_t *)nrf_saadc_buffer_pointer_get(NRF_SAADC) + + samples_to_bytes(nrfy_saadc_amount_get(NRF_SAADC)); + nrfy_saadc_buffer_pointer_set(NRF_SAADC, buffer); #endif } } -static int get_resolution(const struct adc_sequence *sequence, nrf_saadc_resolution_t *resolution) +static int set_resolution(const struct adc_sequence *sequence) { + nrf_saadc_resolution_t nrf_resolution; + switch (sequence->resolution) { - case 8: - *resolution = NRF_SAADC_RESOLUTION_8BIT; + case 8: + nrf_resolution = NRF_SAADC_RESOLUTION_8BIT; break; case 10: - *resolution = NRF_SAADC_RESOLUTION_10BIT; + nrf_resolution = NRF_SAADC_RESOLUTION_10BIT; break; case 12: - *resolution = NRF_SAADC_RESOLUTION_12BIT; + nrf_resolution = NRF_SAADC_RESOLUTION_12BIT; break; case 14: - *resolution = NRF_SAADC_RESOLUTION_14BIT; + nrf_resolution = NRF_SAADC_RESOLUTION_14BIT; break; default: - LOG_ERR("ADC resolution value %d is not valid", sequence->resolution); + LOG_ERR("ADC resolution value %d is not valid", + sequence->resolution); return -EINVAL; } + nrf_saadc_resolution_set(NRF_SAADC, nrf_resolution); return 0; } -static int get_oversampling(const struct adc_sequence *sequence, uint8_t active_channel_cnt, - nrf_saadc_oversample_t *oversampling) +static int set_oversampling(const struct adc_sequence *sequence, + uint8_t active_channels) { - if ((active_channel_cnt > 1) && (sequence->oversampling > 0)) { + nrf_saadc_oversample_t nrf_oversampling; + + if ((active_channels > 1) && (sequence->oversampling > 0)) { LOG_ERR( "Oversampling is supported for single channel only"); return -EINVAL; @@ -446,45 +456,48 @@ static int get_oversampling(const struct adc_sequence *sequence, uint8_t active_ switch (sequence->oversampling) { case 0: - *oversampling = NRF_SAADC_OVERSAMPLE_DISABLED; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_DISABLED; break; case 1: - *oversampling = NRF_SAADC_OVERSAMPLE_2X; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_2X; break; case 2: - *oversampling = NRF_SAADC_OVERSAMPLE_4X; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_4X; break; case 3: - *oversampling = NRF_SAADC_OVERSAMPLE_8X; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_8X; break; case 4: - *oversampling = NRF_SAADC_OVERSAMPLE_16X; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_16X; break; case 5: - *oversampling = NRF_SAADC_OVERSAMPLE_32X; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_32X; break; case 6: - *oversampling = NRF_SAADC_OVERSAMPLE_64X; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_64X; break; case 7: - *oversampling = NRF_SAADC_OVERSAMPLE_128X; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_128X; break; case 8: - *oversampling = NRF_SAADC_OVERSAMPLE_256X; + nrf_oversampling = NRF_SAADC_OVERSAMPLE_256X; break; default: - LOG_ERR("Oversampling value %d is not valid", sequence->oversampling); + LOG_ERR("Oversampling value %d is not valid", + sequence->oversampling); return -EINVAL; } + nrf_saadc_oversample_set(NRF_SAADC, nrf_oversampling); return 0; } -static int check_buffer_size(const struct adc_sequence *sequence, uint8_t active_channel_cnt) +static int check_buffer_size(const struct adc_sequence *sequence, + uint8_t active_channels) { size_t needed_buffer_size; - needed_buffer_size = NRFX_SAADC_SAMPLES_TO_BYTES(active_channel_cnt); + needed_buffer_size = samples_to_bytes(active_channels); if (sequence->options) { needed_buffer_size *= (1 + sequence->options->extra_samplings); @@ -492,7 +505,7 @@ static int check_buffer_size(const struct adc_sequence *sequence, uint8_t active if (sequence->buffer_size < needed_buffer_size) { LOG_ERR("Provided buffer is too small (%u/%u)", - sequence->buffer_size, needed_buffer_size); + sequence->buffer_size, needed_buffer_size); return -ENOMEM; } @@ -509,7 +522,7 @@ static void correct_single_ended(const struct adc_sequence *sequence) uint16_t channel_bit = BIT(0); uint8_t selected_channels = sequence->channels; uint8_t single_ended_channels = m_data.single_ended_channels; - int16_t *sample = (int16_t *)m_data.buffer; + int16_t *sample = nrf_saadc_buffer_pointer_get(NRF_SAADC); while (channel_bit <= single_ended_channels) { if (channel_bit & selected_channels) { @@ -527,13 +540,11 @@ static void correct_single_ended(const struct adc_sequence *sequence) static int start_read(const struct device *dev, const struct adc_sequence *sequence) { - nrfx_err_t nrfx_err; int error; uint32_t selected_channels = sequence->channels; - nrf_saadc_resolution_t resolution; - nrf_saadc_oversample_t oversampling; - uint8_t active_channel_cnt = 0U; - uint8_t channel_id = 0U; + uint8_t active_channels; + uint8_t channel_id; + nrf_saadc_burst_t burst; /* Signal an error if channel selection is invalid (no channels or * a non-existing one is selected). @@ -544,55 +555,88 @@ static int start_read(const struct device *dev, return -EINVAL; } + active_channels = 0U; + + /* Enable only the channels selected for the pointed sequence. + * Disable all the rest. + */ + channel_id = 0U; do { if (selected_channels & BIT(channel_id)) { - /* Signal an error if a selected channel has not been configured yet. */ - if (0 == (nrfx_saadc_channels_configured_get() & BIT(channel_id))) { - LOG_ERR("Channel %u not configured", channel_id); + /* Signal an error if a selected channel has not been + * configured yet. + */ + if (m_data.positive_inputs[channel_id] == 0U) { + LOG_ERR("Channel %u not configured", + channel_id); return -EINVAL; } - ++active_channel_cnt; + /* When oversampling is used, the burst mode needs to + * be activated. Unfortunately, this mode cannot be + * activated permanently in the channel setup, because + * then the multiple channel sampling fails (the END + * event is not generated) after switching to a single + * channel sampling and back. Thus, when oversampling + * is not used (hence, the multiple channel sampling is + * possible), the burst mode have to be deactivated. + */ + burst = (sequence->oversampling != 0U ? + NRF_SAADC_BURST_ENABLED : NRF_SAADC_BURST_DISABLED); +#if NRF_SAADC_HAS_CH_BURST + nrf_saadc_channel_burst_set(NRF_SAADC, channel_id, burst); +#else + nrf_saadc_burst_set(NRF_SAADC, burst); +#endif + nrf_saadc_channel_pos_input_set( + NRF_SAADC, + channel_id, +#if NRF_SAADC_HAS_AIN_AS_PIN + saadc_psels[m_data.positive_inputs[channel_id]] +#else + m_data.positive_inputs[channel_id] +#endif + ); + ++active_channels; + } else { + burst = NRF_SAADC_BURST_DISABLED; +#if NRF_SAADC_HAS_CH_BURST + nrf_saadc_channel_burst_set(NRF_SAADC, channel_id, burst); +#else + nrf_saadc_burst_set(NRF_SAADC, burst); +#endif + nrf_saadc_channel_pos_input_set( + NRF_SAADC, + channel_id, + NRF_SAADC_INPUT_DISABLED); } } while (++channel_id < SAADC_CH_NUM); - if (active_channel_cnt == 0) { - LOG_ERR("No channel configured"); - return -EINVAL; - } - - error = get_resolution(sequence, &resolution); + error = set_resolution(sequence); if (error) { return error; } - error = get_oversampling(sequence, active_channel_cnt, &oversampling); + error = set_oversampling(sequence, active_channels); if (error) { return error; } - nrfx_err = nrfx_saadc_simple_mode_set(selected_channels, - resolution, - oversampling, - event_handler); - if (nrfx_err != NRFX_SUCCESS) { - return -EINVAL; - } - - error = check_buffer_size(sequence, active_channel_cnt); + error = check_buffer_size(sequence, active_channels); if (error) { return error; } - m_data.active_channel_cnt = active_channel_cnt; #if defined(ADC_BUFFER_IN_RAM) m_data.user_buffer = sequence->buffer; + m_data.active_channels = active_channels; - nrfx_saadc_buffer_set(m_data.samples_buffer, active_channel_cnt); + nrf_saadc_buffer_init(NRF_SAADC, + (nrf_saadc_value_t *)m_data.samples_buffer, + active_channels); #else - /* Buffer is filled in chunks, each chunk composed of number of samples equal to number - * of active channels. Buffer pointer is advanced and reloaded after each chunk. - */ - nrfx_saadc_buffer_set(sequence->buffer, active_channel_cnt); + nrf_saadc_buffer_init(NRF_SAADC, + (nrf_saadc_value_t *)sequence->buffer, + active_channels); #endif adc_context_start_read(&m_data.ctx, sequence); @@ -629,12 +673,18 @@ static int adc_nrfx_read_async(const struct device *dev, } #endif /* CONFIG_ADC_ASYNC */ -static void event_handler(const nrfx_saadc_evt_t *event) +static void saadc_irq_handler(const struct device *dev) { - nrfx_err_t err; + if (nrf_saadc_event_check(NRF_SAADC, NRF_SAADC_EVENT_END)) { + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_END); - if (event->type == NRFX_SAADC_EVT_DONE) { - m_data.buffer = event->data.done.p_buffer; + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_STOP); + +#if defined(CONFIG_PM_DEVICE_RUNTIME) + pm_device_runtime_put(DEVICE_DT_INST_GET(0)); +#else + nrf_saadc_disable(NRF_SAADC); +#endif if (has_single_ended(&m_data.ctx.sequence)) { correct_single_ended(&m_data.ctx.sequence); @@ -642,35 +692,39 @@ static void event_handler(const nrfx_saadc_evt_t *event) #if defined(ADC_BUFFER_IN_RAM) memcpy(m_data.user_buffer, m_data.samples_buffer, - NRFX_SAADC_SAMPLES_TO_BYTES(m_data.active_channel_cnt)); + samples_to_bytes(m_data.active_channels)); #endif - adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); - } else if (event->type == NRFX_SAADC_EVT_CALIBRATEDONE) { - err = nrfx_saadc_mode_trigger(); - if (err != NRFX_SUCCESS) { - LOG_ERR("Cannot start sampling: 0x%08x", err); - adc_context_complete(&m_data.ctx, -EIO); - } + adc_context_on_sampling_done(&m_data.ctx, dev); + } else if (nrf_saadc_event_check(NRF_SAADC, + NRF_SAADC_EVENT_CALIBRATEDONE)) { + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_CALIBRATEDONE); + + /* + * The workaround for Nordic nRF52832 anomalies 86 and + * 178 is an explicit STOP after CALIBRATEOFFSET + * before issuing START. + */ + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_STOP); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_START); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_SAMPLE); } } static int init_saadc(const struct device *dev) { - nrfx_err_t err; - - /* The priority value passed here is ignored (see nrfx_glue.h). */ - err = nrfx_saadc_init(0); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize device: %s", dev->name); - return -EIO; - } + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_END); + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_CALIBRATEDONE); + nrf_saadc_int_enable(NRF_SAADC, + NRF_SAADC_INT_END | NRF_SAADC_INT_CALIBRATEDONE); + NRFX_IRQ_ENABLE(DT_INST_IRQN(0)); - IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), nrfx_isr, nrfx_saadc_irq_handler, 0); + IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), + saadc_irq_handler, DEVICE_DT_INST_GET(0), 0); adc_context_unlock_unconditionally(&m_data.ctx); - return 0; + return pm_device_driver_init(dev, saadc_pm_hook); } static DEVICE_API(adc, adc_nrfx_driver_api) = { @@ -709,7 +763,29 @@ static DEVICE_API(adc, adc_nrfx_driver_api) = { "1v8 inputs cannot be mixed with 3v3 inputs"); /* Validate configuration of all channels. */ -DT_FOREACH_CHILD(DT_DRV_INST(0), VALIDATE_CHANNEL_CONFIG) +#define VALIDATE_CHANNELS_CONFIG(inst) DT_FOREACH_CHILD(DT_DRV_INST(inst), VALIDATE_CHANNEL_CONFIG) -DEVICE_DT_INST_DEFINE(0, init_saadc, NULL, NULL, NULL, POST_KERNEL, - CONFIG_ADC_INIT_PRIORITY, &adc_nrfx_driver_api); +/* + * There is only one instance on supported SoCs, so inst is guaranteed + * to be 0 if any instance is okay. (We use adc_0 above, so the driver + * is relying on the numeric instance value in a way that happens to + * be safe.) + * + * Just in case that assumption becomes invalid in the future, we use + * a BUILD_ASSERT(). + */ +#define SAADC_INIT(inst) \ + BUILD_ASSERT((inst) == 0, \ + "multiple instances not supported"); \ + VALIDATE_CHANNELS_CONFIG(inst) \ + PM_DEVICE_DT_INST_DEFINE(0, saadc_pm_hook, 1); \ + DEVICE_DT_INST_DEFINE(0, \ + init_saadc, \ + PM_DEVICE_DT_INST_GET(0), \ + NULL, \ + NULL, \ + POST_KERNEL, \ + CONFIG_ADC_INIT_PRIORITY, \ + &adc_nrfx_driver_api); + +DT_INST_FOREACH_STATUS_OKAY(SAADC_INIT) From 9fee62da30bc1dc08cd9191e1ddadfcdf4b74a8d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 406/881] Revert "[nrf fromtree] modules: hal_nordic: nrfx: Update NRFX API version to 3.12" This reverts commit 52154394a286dddc16b522599f2f5f144b38bec6. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/nrfx/nrfx_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index fac2341c1c5..4a2d5af18b6 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -9,7 +9,7 @@ /* Define nrfx API version used in Zephyr. */ #define NRFX_CONFIG_API_VER_MAJOR 3 -#define NRFX_CONFIG_API_VER_MINOR 12 +#define NRFX_CONFIG_API_VER_MINOR 8 #define NRFX_CONFIG_API_VER_MICRO 0 /* Macros used in zephyr-specific config files. */ From 1d0c080ac127c22d4f7518bdc6dc31662f1f2d82 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 407/881] Revert "[nrf fromtree] drivers: adc_nrfx_saadc: Remove dead and misleading code" This reverts commit 79a29d4e2fc05a59ff10f8287a7f79f36c452b54. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 54719a1136d..986cca49af8 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -141,8 +141,12 @@ static struct driver_data m_data = { }; /* Helper function to convert number of samples to the byte representation. */ -static uint32_t samples_to_bytes(uint16_t number_of_samples) +static uint32_t samples_to_bytes(const struct adc_sequence *sequence, uint16_t number_of_samples) { + if (NRF_SAADC_8BIT_SAMPLE_WIDTH == 8 && sequence->resolution == 8) { + return number_of_samples; + } + return number_of_samples * 2; } @@ -406,11 +410,11 @@ static void adc_context_update_buffer_pointer(struct adc_context *ctx, if (!repeat) { #if defined(ADC_BUFFER_IN_RAM) m_data.user_buffer = (uint8_t *)m_data.user_buffer + - samples_to_bytes(nrfy_saadc_amount_get(NRF_SAADC)); + samples_to_bytes(&ctx->sequence, nrfy_saadc_amount_get(NRF_SAADC)); #else nrf_saadc_value_t *buffer = (uint8_t *)nrf_saadc_buffer_pointer_get(NRF_SAADC) + - samples_to_bytes(nrfy_saadc_amount_get(NRF_SAADC)); + samples_to_bytes(&ctx->sequence, nrfy_saadc_amount_get(NRF_SAADC)); nrfy_saadc_buffer_pointer_set(NRF_SAADC, buffer); #endif } @@ -497,7 +501,7 @@ static int check_buffer_size(const struct adc_sequence *sequence, { size_t needed_buffer_size; - needed_buffer_size = samples_to_bytes(active_channels); + needed_buffer_size = samples_to_bytes(sequence, active_channels); if (sequence->options) { needed_buffer_size *= (1 + sequence->options->extra_samplings); @@ -542,6 +546,7 @@ static int start_read(const struct device *dev, { int error; uint32_t selected_channels = sequence->channels; + uint8_t resolution = sequence->resolution; uint8_t active_channels; uint8_t channel_id; nrf_saadc_burst_t burst; @@ -571,6 +576,22 @@ static int start_read(const struct device *dev, channel_id); return -EINVAL; } + /* Signal an error if the channel is configured as + * single ended with a resolution which is identical + * to the sample bit size. The SAADC's "single ended" + * mode is really differential mode with the + * negative input tied to ground. We can therefore + * observe negative values if the positive input falls + * below ground. If the sample bitsize is larger than + * the resolution, we can detect negative values and + * correct them to 0 after the sequencen has ended. + */ + if ((m_data.single_ended_channels & BIT(channel_id)) && + (NRF_SAADC_8BIT_SAMPLE_WIDTH == 8 && resolution == 8)) { + LOG_ERR("Channel %u invalid single ended resolution", + channel_id); + return -EINVAL; + } /* When oversampling is used, the burst mode needs to * be activated. Unfortunately, this mode cannot be * activated permanently in the channel setup, because @@ -692,7 +713,7 @@ static void saadc_irq_handler(const struct device *dev) #if defined(ADC_BUFFER_IN_RAM) memcpy(m_data.user_buffer, m_data.samples_buffer, - samples_to_bytes(m_data.active_channels)); + samples_to_bytes(&m_data.ctx.sequence, m_data.active_channels)); #endif adc_context_on_sampling_done(&m_data.ctx, dev); From 354721cca1056240a6cefd1889de970bb2e96c66 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 408/881] Revert "[nrf fromtree] manifest: Update hal_nordic with updated cracen hal and rng driver" This reverts commit 24d020f2f5652ee4e9110c190210e25a9078d969. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 20d4800519a..d15e692caa4 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 9587b1dcb83d24ab74e89837843a5f7d573f7059 + revision: 71308dc6d8c021887ce5d98a36cafe9517375a91 path: modules/hal/nordic groups: - hal From f9f5df853c54f5b98b78bf96458343aee758c8b7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 409/881] Revert "[nrf fromtree] tests: drivers: adc: Fix License in board overlay" This reverts commit f18ae796f22bc1f12a1ed8a73484b4a4d8019eb0. Signed-off-by: Jukka Rissanen --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/adc/adc_accuracy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/adc/adc_accuracy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index b11dcebc3d3..bc68f3c8d34 100644 --- a/tests/drivers/adc/adc_accuracy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/adc/adc_accuracy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,7 +1,7 @@ /* * Copyright (c) 2025 Nordic Semiconductor ASA * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ /* From cc02938e0ca5a1d534bc78232556e7bd4e37985b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 410/881] Revert "[nrf fromtree] samples: drivers: adc: Fix License in board overlays" This reverts commit 1c01e1ddefa29efcab98de30f52c8e4ae994cb01. Signed-off-by: Jukka Rissanen --- .../adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 2 +- .../adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/drivers/adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index a93e578fca7..8953de6a547 100644 --- a/samples/drivers/adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/drivers/adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,7 +1,7 @@ /* * Copyright (c) 2025 Nordic Semiconductor ASA * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ / { diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/adc/adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index a83d64e864e..a85e9e7e611 100644 --- a/samples/drivers/adc/adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/drivers/adc/adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,7 +1,7 @@ /* * Copyright (c) 2025 Nordic Semiconductor ASA * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ / { From 6e04901b793edc2c94010b9ce413ca6655695460 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 411/881] Revert "[nrf fromtree] tests: bsim: add early disconnect tests for iso and l2cap" This reverts commit 4c20b69ea6d6358ed106feaabb635892dfd10896. Signed-off-by: Jukka Rissanen --- tests/bsim/bluetooth/host/iso/cis/prj.conf | 1 - .../bluetooth/host/iso/cis/src/cis_central.c | 18 +- .../host/iso/cis/src/cis_peripheral.c | 36 ---- .../cis/tests_scripts/cis_early_disconnect.sh | 29 --- .../stress/overlay-early-disconnect.conf | 1 - .../bluetooth/host/l2cap/stress/src/main.c | 203 +----------------- .../bluetooth/host/l2cap/stress/testcase.yaml | 4 - .../tests_scripts/l2cap_early_disconnect.sh | 47 ---- 8 files changed, 12 insertions(+), 327 deletions(-) delete mode 100755 tests/bsim/bluetooth/host/iso/cis/tests_scripts/cis_early_disconnect.sh delete mode 100644 tests/bsim/bluetooth/host/l2cap/stress/overlay-early-disconnect.conf delete mode 100755 tests/bsim/bluetooth/host/l2cap/stress/tests_scripts/l2cap_early_disconnect.sh diff --git a/tests/bsim/bluetooth/host/iso/cis/prj.conf b/tests/bsim/bluetooth/host/iso/cis/prj.conf index 06f02823296..4ad0a0fd319 100644 --- a/tests/bsim/bluetooth/host/iso/cis/prj.conf +++ b/tests/bsim/bluetooth/host/iso/cis/prj.conf @@ -16,7 +16,6 @@ CONFIG_BT_ISO_TX_MTU=200 CONFIG_BT_ISO_RX_MTU=200 CONFIG_BT_ISO_LOG_LEVEL_DBG=y -CONFIG_NET_BUF_POOL_USAGE=y # Controller Connected ISO configs CONFIG_BT_CTLR_CENTRAL_ISO=y diff --git a/tests/bsim/bluetooth/host/iso/cis/src/cis_central.c b/tests/bsim/bluetooth/host/iso/cis/src/cis_central.c index e3b6ee9284f..dc7d46100a9 100644 --- a/tests/bsim/bluetooth/host/iso/cis/src/cis_central.c +++ b/tests/bsim/bluetooth/host/iso/cis/src/cis_central.c @@ -154,11 +154,6 @@ static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason) err = bt_iso_remove_data_path(chan, BT_HCI_DATAPATH_DIR_HOST_TO_CTLR); TEST_ASSERT(err == 0, "Failed to remove ISO data path: %d", err); - - if (seq_num < 100) { - printk("Channel disconnected early, bumping seq_num to 1000 to end test\n"); - seq_num = 1000; - } } static void sdu_sent_cb(struct bt_iso_chan *chan) @@ -467,16 +462,9 @@ static void test_main(void) k_sleep(K_USEC(interval_us)); } - if (seq_num == 100) { - disconnect_cis(); - disconnect_acl(); - terminate_cig(); - } - - /* check that all buffers returned to pool */ - TEST_ASSERT(atomic_get(&tx_pool.avail_count) == ENQUEUE_COUNT, - "tx_pool has non returned buffers, should be %u but is %u", - ENQUEUE_COUNT, atomic_get(&tx_pool.avail_count)); + disconnect_cis(); + disconnect_acl(); + terminate_cig(); TEST_PASS("Test passed"); } diff --git a/tests/bsim/bluetooth/host/iso/cis/src/cis_peripheral.c b/tests/bsim/bluetooth/host/iso/cis/src/cis_peripheral.c index e8b3ff37a9d..96b8865c1f4 100644 --- a/tests/bsim/bluetooth/host/iso/cis/src/cis_peripheral.c +++ b/tests/bsim/bluetooth/host/iso/cis/src/cis_peripheral.c @@ -35,9 +35,6 @@ static const struct bt_data ad[] = { }; static struct bt_iso_chan iso_chan; -static size_t disconnect_after_recv_cnt; -static size_t iso_recv_cnt; - /** Print data as d_0 d_1 d_2 ... d_(n-2) d_(n-1) d_(n) to show the 3 first and 3 last octets * * Examples: @@ -75,26 +72,14 @@ static void iso_print_data(uint8_t *data, size_t data_len) printk("\t %s\n", data_str); } -static void disconnect_device(struct bt_conn *conn, void *data) -{ - int err = bt_conn_disconnect(conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); - - TEST_ASSERT(!err, "Failed to initate disconnect (err %d)", err); -} - static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *info, struct net_buf *buf) { - iso_recv_cnt++; if (info->flags & BT_ISO_FLAGS_VALID) { printk("Incoming data channel %p len %u\n", chan, buf->len); iso_print_data(buf->data, buf->len); SET_FLAG(flag_data_received); } - if (disconnect_after_recv_cnt && (iso_recv_cnt >= disconnect_after_recv_cnt)) { - printk("Disconnecting\n"); - bt_conn_foreach(BT_CONN_TYPE_LE, disconnect_device, NULL); - } } static void iso_connected(struct bt_iso_chan *chan) @@ -204,33 +189,12 @@ static void test_main(void) } } -static void test_main_early_disconnect(void) -{ - init(); - - disconnect_after_recv_cnt = 10; - - while (true) { - adv_connect(); - bt_testlib_conn_wait_free(); - - if (IS_FLAG_SET(flag_data_received)) { - TEST_PASS("Test passed"); - } - } -} - static const struct bst_test_instance test_def[] = { { .test_id = "peripheral", .test_descr = "Peripheral", .test_main_f = test_main, }, - { - .test_id = "peripheral_early_disconnect", - .test_descr = "Peripheral that tests early disconnect", - .test_main_f = test_main_early_disconnect, - }, BSTEST_END_MARKER, }; diff --git a/tests/bsim/bluetooth/host/iso/cis/tests_scripts/cis_early_disconnect.sh b/tests/bsim/bluetooth/host/iso/cis/tests_scripts/cis_early_disconnect.sh deleted file mode 100755 index bac2c2e82a1..00000000000 --- a/tests/bsim/bluetooth/host/iso/cis/tests_scripts/cis_early_disconnect.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2025 Google LLC -# SPDX-License-Identifier: Apache-2.0 - -source ${ZEPHYR_BASE}/tests/bsim/sh_common.source - -# Tests cleanup within the ble stack for ISO connections when -# peripheral disconnects early while the central still has -# buffers queued for sending. Using the base code, which -# has the central sending 100 ISO packets, the peripheral -# triggers a disconnect after receiving 10 packets. -# The central checks that all tx_pool buffers have been -# returned to the pool after the disconnect. -simulation_id="iso_cis_early_disconnect" -verbosity_level=2 -EXECUTE_TIMEOUT=120 - -cd ${BSIM_OUT_PATH}/bin - -Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_host_iso_cis_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central - -Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_host_iso_cis_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral_early_disconnect - -Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ - -D=2 -sim_length=30e6 $@ - -wait_for_background_jobs diff --git a/tests/bsim/bluetooth/host/l2cap/stress/overlay-early-disconnect.conf b/tests/bsim/bluetooth/host/l2cap/stress/overlay-early-disconnect.conf deleted file mode 100644 index 94dfb1ed30d..00000000000 --- a/tests/bsim/bluetooth/host/l2cap/stress/overlay-early-disconnect.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BT_L2CAP_SEG_RECV=y diff --git a/tests/bsim/bluetooth/host/l2cap/stress/src/main.c b/tests/bsim/bluetooth/host/l2cap/stress/src/main.c index a411354bb79..d05f4e4f0a7 100644 --- a/tests/bsim/bluetooth/host/l2cap/stress/src/main.c +++ b/tests/bsim/bluetooth/host/l2cap/stress/src/main.c @@ -17,7 +17,6 @@ #include #include "babblekit/testcase.h" #include "babblekit/flags.h" -#include "bsim_args_runner.h" #define LOG_MODULE_NAME main #include @@ -32,18 +31,6 @@ DEFINE_FLAG_STATIC(flag_l2cap_connected); #define SDU_LEN 3000 #define RESCHEDULE_DELAY K_MSEC(100) -/* The early_disconnect test has the peripheral disconnect at various - * times: - * - * Peripheral 1: disconnects after all 20 SDUs as before - * Peripheral 2: disconnects immediately before receiving anything - * Peripheral 3: disconnects after receiving first SDU - * Peripheral 4: disconnects after receiving first PDU in second SDU - * Peripheral 5: disconnects after receiving third PDU in third SDU - * Peripheral 6: disconnects atfer receiving tenth PDU in tenth SDU - */ -static unsigned int device_nbr; - static void sdu_destroy(struct net_buf *buf) { LOG_DBG("%p", buf); @@ -69,7 +56,7 @@ NET_BUF_POOL_DEFINE(sdu_rx_pool, 8, rx_destroy); static uint8_t tx_data[SDU_LEN]; -static uint16_t sdu_rx_cnt; +static uint16_t rx_cnt; static uint8_t disconnect_counter; struct test_ctx { @@ -151,66 +138,10 @@ void sent_cb(struct bt_l2cap_chan *chan) continue_sending(ctx); } -#ifdef CONFIG_BT_L2CAP_SEG_RECV -static void disconnect_device_no_wait(struct bt_conn *conn, void *data) -{ - int err; - - err = bt_conn_disconnect(conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); - TEST_ASSERT(!err, "Failed to initate disconnect (err %d)", err); - - UNSET_FLAG(is_connected); -} - -static void seg_recv_cb(struct bt_l2cap_chan *chan, size_t sdu_len, off_t seg_offset, - struct net_buf_simple *seg) -{ - static size_t pdu_rx_cnt; - - if ((seg_offset + seg->len) == sdu_len) { - /* last segment/PDU of a SDU */ - LOG_DBG("len %d", seg->len); - sdu_rx_cnt++; - pdu_rx_cnt = 0; - } else { - LOG_DBG("SDU %u, pdu %u at seg_offset %u, len %u", - sdu_rx_cnt, pdu_rx_cnt, seg_offset, seg->len); - pdu_rx_cnt++; - } - - /* Verify SDU data matches TX'd data. */ - int pos = memcmp(seg->data, &tx_data[seg_offset], seg->len); - - if (pos != 0) { - LOG_ERR("RX data doesn't match TX: pos %d", seg_offset); - LOG_HEXDUMP_ERR(seg->data, seg->len, "RX data"); - LOG_HEXDUMP_INF(tx_data, seg->len, "TX data"); - - for (uint16_t p = 0; p < seg->len; p++) { - __ASSERT(seg->data[p] == tx_data[p + seg_offset], - "Failed rx[%d]=%x != expect[%d]=%x", - p, seg->data[p], p, tx_data[p + seg_offset]); - } - } - - if (((device_nbr == 4) && (sdu_rx_cnt >= 1) && (pdu_rx_cnt == 1)) || - ((device_nbr == 5) && (sdu_rx_cnt >= 2) && (pdu_rx_cnt == 3)) || - ((device_nbr == 6) && (sdu_rx_cnt >= 9) && (pdu_rx_cnt == 10))) { - LOG_INF("disconnecting after receiving PDU %u of SDU %u", - pdu_rx_cnt - 1, sdu_rx_cnt); - bt_conn_foreach(BT_CONN_TYPE_LE, disconnect_device_no_wait, NULL); - return; - } - - if (is_connected) { - bt_l2cap_chan_give_credits(chan, 1); - } -} -#else /* CONFIG_BT_L2CAP_SEG_RECV */ int recv_cb(struct bt_l2cap_chan *chan, struct net_buf *buf) { LOG_DBG("len %d", buf->len); - sdu_rx_cnt++; + rx_cnt++; /* Verify SDU data matches TX'd data. */ int pos = memcmp(buf->data, tx_data, buf->len); @@ -229,7 +160,6 @@ int recv_cb(struct bt_l2cap_chan *chan, struct net_buf *buf) return 0; } -#endif /* CONFIG_BT_L2CAP_SEG_RECV */ void l2cap_chan_connected_cb(struct bt_l2cap_chan *l2cap_chan) { @@ -237,41 +167,25 @@ void l2cap_chan_connected_cb(struct bt_l2cap_chan *l2cap_chan) CONTAINER_OF(l2cap_chan, struct bt_l2cap_le_chan, chan); SET_FLAG(flag_l2cap_connected); - LOG_DBG("%x (tx mtu %d mps %d cr %ld) (tx mtu %d mps %d cr %ld)", + LOG_DBG("%x (tx mtu %d mps %d) (tx mtu %d mps %d)", l2cap_chan, chan->tx.mtu, chan->tx.mps, - atomic_get(&chan->tx.credits), chan->rx.mtu, - chan->rx.mps, - atomic_get(&chan->rx.credits)); + chan->rx.mps); } -void l2cap_chan_disconnected_cb(struct bt_l2cap_chan *l2cap_chan) +void l2cap_chan_disconnected_cb(struct bt_l2cap_chan *chan) { UNSET_FLAG(flag_l2cap_connected); - LOG_DBG("%p", l2cap_chan); - for (int i = 0; i < L2CAP_CHANS; i++) { - if (&contexts[i].le_chan == CONTAINER_OF(l2cap_chan, - struct bt_l2cap_le_chan, chan)) { - if (contexts[i].tx_left > 0) { - LOG_INF("setting tx_left to 0 because of disconnect"); - contexts[i].tx_left = 0; - } - break; - } - } + LOG_DBG("%p", chan); } static struct bt_l2cap_chan_ops ops = { .connected = l2cap_chan_connected_cb, .disconnected = l2cap_chan_disconnected_cb, .alloc_buf = alloc_buf_cb, -#ifdef CONFIG_BT_L2CAP_SEG_RECV - .seg_recv = seg_recv_cb, -#else .recv = recv_cb, -#endif .sent = sent_cb, }; @@ -320,10 +234,6 @@ int server_accept_cb(struct bt_conn *conn, struct bt_l2cap_server *server, memset(le_chan, 0, sizeof(*le_chan)); le_chan->chan.ops = &ops; le_chan->rx.mtu = SDU_LEN; -#ifdef CONFIG_BT_L2CAP_SEG_RECV - le_chan->rx.mps = BT_L2CAP_RX_MTU; - le_chan->rx.credits = CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA; -#endif *chan = &le_chan->chan; return 0; @@ -425,93 +335,15 @@ static void test_peripheral_main(void) LOG_DBG("Registered server PSM %x", psm); LOG_DBG("Peripheral waiting for transfer completion"); - while (sdu_rx_cnt < SDU_NUM) { - k_msleep(100); - } - - bt_conn_foreach(BT_CONN_TYPE_LE, disconnect_device, NULL); - - WAIT_FOR_FLAG_UNSET(is_connected); - LOG_INF("Total received: %d", sdu_rx_cnt); - - /* check that all buffers returned to pool */ - TEST_ASSERT(atomic_get(&sdu_tx_pool.avail_count) == CONFIG_BT_MAX_CONN, - "sdu_tx_pool has non returned buffers, should be %u but is %u", - CONFIG_BT_MAX_CONN, atomic_get(&sdu_tx_pool.avail_count)); - TEST_ASSERT(atomic_get(&sdu_rx_pool.avail_count) == CONFIG_BT_MAX_CONN, - "sdu_rx_pool has non returned buffers, should be %u but is %u", - CONFIG_BT_MAX_CONN, atomic_get(&sdu_rx_pool.avail_count)); - - TEST_PASS("L2CAP STRESS Peripheral passed"); -} - -static void test_peripheral_early_disconnect_main(void) -{ - device_nbr = bsim_args_get_global_device_nbr(); - LOG_DBG("*L2CAP STRESS EARLY DISCONNECT Peripheral started*"); - int err; - - /* Prepare tx_data */ - for (size_t i = 0; i < sizeof(tx_data); i++) { - tx_data[i] = (uint8_t)i; - } - - err = bt_enable(NULL); - if (err) { - TEST_FAIL("Can't enable Bluetooth (err %d)", err); - return; - } - - LOG_DBG("Peripheral Bluetooth initialized."); - LOG_DBG("Connectable advertising..."); - err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, NULL, 0, NULL, 0); - if (err) { - TEST_FAIL("Advertising failed to start (err %d)", err); - return; - } - - LOG_DBG("Advertising started."); - LOG_DBG("Peripheral waiting for connection..."); - WAIT_FOR_FLAG(is_connected); - LOG_DBG("Peripheral Connected."); - - int psm = l2cap_server_register(BT_SECURITY_L1); - - LOG_DBG("Registered server PSM %x", psm); - - if (device_nbr == 2) { - LOG_INF("disconnecting before receiving any SDU"); - k_msleep(1000); - goto disconnect; - } - - LOG_DBG("Peripheral waiting for transfer completion"); - while (sdu_rx_cnt < SDU_NUM) { - if ((device_nbr == 3) && (sdu_rx_cnt >= 1)) { - LOG_INF("disconnecting after receiving SDU %u", sdu_rx_cnt); - break; - } - + while (rx_cnt < SDU_NUM) { k_msleep(100); - if (!is_connected) { - goto done; - } } -disconnect: bt_conn_foreach(BT_CONN_TYPE_LE, disconnect_device, NULL); -done: - WAIT_FOR_FLAG_UNSET(is_connected); - LOG_INF("Total received: %d", sdu_rx_cnt); + LOG_INF("Total received: %d", rx_cnt); - /* check that all buffers returned to pool */ - TEST_ASSERT(atomic_get(&sdu_tx_pool.avail_count) == CONFIG_BT_MAX_CONN, - "sdu_tx_pool has non returned buffers, should be %u but is %u", - CONFIG_BT_MAX_CONN, atomic_get(&sdu_tx_pool.avail_count)); - TEST_ASSERT(atomic_get(&sdu_rx_pool.avail_count) == CONFIG_BT_MAX_CONN, - "sdu_rx_pool has non returned buffers, should be %u but is %u", - CONFIG_BT_MAX_CONN, atomic_get(&sdu_rx_pool.avail_count)); + TEST_ASSERT(rx_cnt == SDU_NUM, "Did not receive expected no of SDUs"); TEST_PASS("L2CAP STRESS Peripheral passed"); } @@ -573,10 +405,6 @@ static void connect_l2cap_channel(struct bt_conn *conn, void *data) le_chan->chan.ops = &ops; le_chan->rx.mtu = SDU_LEN; -#ifdef CONFIG_BT_L2CAP_SEG_RECV - le_chan->rx.mps = BT_L2CAP_RX_MTU; - le_chan->rx.credits = CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA; -#endif UNSET_FLAG(flag_l2cap_connected); @@ -633,14 +461,6 @@ static void test_central_main(void) } LOG_DBG("All peripherals disconnected."); - /* check that all buffers returned to pool */ - TEST_ASSERT(atomic_get(&sdu_tx_pool.avail_count) == CONFIG_BT_MAX_CONN, - "sdu_tx_pool has non returned buffers, should be %u but is %u", - CONFIG_BT_MAX_CONN, atomic_get(&sdu_tx_pool.avail_count)); - TEST_ASSERT(atomic_get(&sdu_rx_pool.avail_count) == CONFIG_BT_MAX_CONN, - "sdu_rx_pool has non returned buffers, should be %u but is %u", - CONFIG_BT_MAX_CONN, atomic_get(&sdu_rx_pool.avail_count)); - TEST_PASS("L2CAP STRESS Central passed"); } @@ -650,11 +470,6 @@ static const struct bst_test_instance test_def[] = { .test_descr = "Peripheral L2CAP STRESS", .test_main_f = test_peripheral_main }, - { - .test_id = "peripheral_early_disconnect", - .test_descr = "Peripheral L2CAP STRESS EARLY DISCONNECT", - .test_main_f = test_peripheral_early_disconnect_main, - }, { .test_id = "central", .test_descr = "Central L2CAP STRESS", diff --git a/tests/bsim/bluetooth/host/l2cap/stress/testcase.yaml b/tests/bsim/bluetooth/host/l2cap/stress/testcase.yaml index 8fbe85a3b64..f872f5873da 100644 --- a/tests/bsim/bluetooth/host/l2cap/stress/testcase.yaml +++ b/tests/bsim/bluetooth/host/l2cap/stress/testcase.yaml @@ -10,10 +10,6 @@ tests: bluetooth.host.l2cap.stress: harness_config: bsim_exe_name: tests_bsim_bluetooth_host_l2cap_stress_prj_conf - bluetooth.host.l2cap.stress_early_disconnect: - harness_config: - bsim_exe_name: tests_bsim_bluetooth_host_l2cap_stress_prj_conf_overlay-early-disc_conf - extra_args: EXTRA_CONF_FILE="overlay-early-disconnect.conf" bluetooth.host.l2cap.stress_nofrag: harness_config: bsim_exe_name: tests_bsim_bluetooth_host_l2cap_stress_prj_conf_overlay-nofrag_conf diff --git a/tests/bsim/bluetooth/host/l2cap/stress/tests_scripts/l2cap_early_disconnect.sh b/tests/bsim/bluetooth/host/l2cap/stress/tests_scripts/l2cap_early_disconnect.sh deleted file mode 100755 index 8741839e762..00000000000 --- a/tests/bsim/bluetooth/host/l2cap/stress/tests_scripts/l2cap_early_disconnect.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2025 Google LLC -# SPDX-License-Identifier: Apache-2.0 - -source ${ZEPHYR_BASE}/tests/bsim/sh_common.source - -# Tests cleanup within the ble stack for L2CAP connections when -# peripheral disconnects early while the central still has -# buffers queued for sending. Using the base code, which -# has the central sending 20 SDUs to 6 different peripherals, -# the test has the peripherals disconnect as follows: -# -# Peripheral 1: disconnects after all 20 SDUs as before -# Peripheral 2: disconnects immediately before receiving anything -# Peripheral 3: disconnects after receiving first SDU -# Peripheral 4: disconnects after receiving first PDU in second SDU -# Peripheral 5: disconnects after receiving third PDU in third SDU -# Peripheral 6: disconnects atfer receiving tenth PDU in tenth SDU -# -# The central and peripherals check that all tx_pool and rx_pool -# buffers have been returned after the disconnect. -simulation_id="l2cap_stress_early_disconnect" -verbosity_level=2 -EXECUTE_TIMEOUT=240 - -bsim_exe=./bs_${BOARD_TS}_tests_bsim_bluetooth_host_l2cap_stress_prj_conf_overlay-early-disc_conf - -cd ${BSIM_OUT_PATH}/bin - -Execute "${bsim_exe}" -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central -rs=43 - -Execute "${bsim_exe}" -v=${verbosity_level} -s=${simulation_id} -d=1 \ - -testid=peripheral_early_disconnect -rs=42 -Execute "${bsim_exe}" -v=${verbosity_level} -s=${simulation_id} -d=2 \ - -testid=peripheral_early_disconnect -rs=10 -Execute "${bsim_exe}" -v=${verbosity_level} -s=${simulation_id} -d=3 \ - -testid=peripheral_early_disconnect -rs=23 -Execute "${bsim_exe}" -v=${verbosity_level} -s=${simulation_id} -d=4 \ - -testid=peripheral_early_disconnect -rs=7884 -Execute "${bsim_exe}" -v=${verbosity_level} -s=${simulation_id} -d=5 \ - -testid=peripheral_early_disconnect -rs=230 -Execute "${bsim_exe}" -v=${verbosity_level} -s=${simulation_id} -d=6 \ - -testid=peripheral_early_disconnect -rs=9 - -Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} -D=7 -sim_length=400e6 $@ - -wait_for_background_jobs From 2ff8357caea7ed933061345f761f34143baa4938 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 412/881] Revert "[nrf fromtree] bluetooth: fix bug when destroying tx queue buffers on disconnect" This reverts commit 720dc042525938bf5bf340c6ddf0b9d697eb5c9c. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/classic/l2cap_br.c | 16 +--- subsys/bluetooth/host/conn.c | 111 +++++++++++++++-------- subsys/bluetooth/host/conn_internal.h | 14 +-- subsys/bluetooth/host/iso.c | 31 +++---- subsys/bluetooth/host/l2cap.c | 30 +++--- 5 files changed, 104 insertions(+), 98 deletions(-) diff --git a/subsys/bluetooth/host/classic/l2cap_br.c b/subsys/bluetooth/host/classic/l2cap_br.c index 1d8616013e9..66343aa512d 100644 --- a/subsys/bluetooth/host/classic/l2cap_br.c +++ b/subsys/bluetooth/host/classic/l2cap_br.c @@ -1574,8 +1574,6 @@ struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, size_t amount, size_t * return NULL; } - __ASSERT_NO_MSG(conn->state == BT_CONN_CONNECTED); - struct bt_l2cap_br_chan *br_chan; br_chan = CONTAINER_OF(pdu_ready, struct bt_l2cap_br_chan, _pdu_ready); @@ -1593,15 +1591,13 @@ struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, size_t amount, size_t * __ASSERT(tx_pdu, "signaled ready but no PDUs in the TX queue"); - struct net_buf *q_pdu = CONTAINER_OF(tx_pdu, struct net_buf, node); + struct net_buf *pdu = CONTAINER_OF(tx_pdu, struct net_buf, node); - if (bt_buf_has_view(q_pdu)) { - LOG_ERR("already have view on %p", q_pdu); + if (bt_buf_has_view(pdu)) { + LOG_ERR("already have view on %p", pdu); return NULL; } - struct net_buf *pdu = net_buf_ref(q_pdu); - /* We can't interleave ACL fragments from different channels for the * same ACL conn -> we have to wait until a full L2 PDU is transferred * before switching channels. @@ -1609,15 +1605,13 @@ struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, size_t amount, size_t * bool last_frag = amount >= pdu->len; if (last_frag) { - LOG_DBG("last frag, removing %p", q_pdu); + LOG_DBG("last frag, removing %p", pdu); __maybe_unused bool found; - found = sys_slist_find_and_remove(&br_chan->_pdu_tx_queue, &q_pdu->node); + found = sys_slist_find_and_remove(&br_chan->_pdu_tx_queue, &pdu->node); __ASSERT_NO_MSG(found); - net_buf_unref(q_pdu); - LOG_DBG("chan %p done", br_chan); lower_data_ready(br_chan); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 9e9f18c040a..0c34dc0b616 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -649,7 +649,7 @@ static bool is_acl_conn(struct bt_conn *conn) } static int send_buf(struct bt_conn *conn, struct net_buf *buf, - size_t len, bt_conn_tx_cb_t cb, void *ud) + size_t len, void *cb, void *ud) { struct net_buf *frag = NULL; struct bt_conn_tx *tx = NULL; @@ -659,15 +659,13 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, if (buf->len == 0) { __ASSERT_NO_MSG(0); - err = -EMSGSIZE; - goto error_return; + return -EMSGSIZE; } if (bt_buf_has_view(buf)) { __ASSERT_NO_MSG(0); - err = -EIO; - goto error_return; + return -EIO; } LOG_DBG("conn %p buf %p len %zu buf->len %u cb %p ud %p", @@ -682,8 +680,7 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, */ __ASSERT(0, "No controller bufs"); - err = -ENOMEM; - goto error_return; + return -ENOMEM; } /* Allocate and set the TX context */ @@ -692,9 +689,8 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, /* See big comment above */ if (!tx) { __ASSERT(0, "No TX context"); - k_sem_give(bt_conn_get_pkts(conn)); - err = -ENOMEM; - goto error_return; + + return -ENOMEM; } tx->cb = cb; @@ -702,17 +698,18 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - /* Check that buf->ref is 1 or 2. It would be 1 if this - * was the only reference (e.g. buf was removed - * from the conn tx_queue). It would be 2 if the - * tx_data_pull kept it on the tx_queue for segmentation. - */ - __ASSERT_NO_MSG((buf->ref == 1) || (buf->ref == 2)); + __ASSERT_NO_MSG(buf->ref == 1); - /* The reference is always transferred to the frag, so when - * the frag is destroyed, the parent reference is decremented. - */ - frag = get_data_frag(buf, frag_len); + if (buf->len > frag_len) { + LOG_DBG("keep %p around", buf); + frag = get_data_frag(net_buf_ref(buf), frag_len); + } else { + LOG_DBG("move %p ref in", buf); + /* Move the ref into `frag` for the last TX. That way `buf` will + * get destroyed when `frag` is destroyed. + */ + frag = get_data_frag(buf, frag_len); + } /* Caller is supposed to check we have all resources to send */ __ASSERT_NO_MSG(frag != NULL); @@ -726,7 +723,7 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, conn->next_is_frag = false; } - LOG_DBG("send frag: buf %p len %d", frag, frag_len); + LOG_DBG("send frag: buf %p len %d", buf, frag_len); /* At this point, the buffer is either a fragment or a full HCI packet. * The flags are also valid. @@ -769,26 +766,15 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, */ net_buf_unref(frag); - /* `buf` might not get destroyed right away because it may - * still be on a conn tx_queue, and its `tx` pointer will still - * be reachable. Make sure that we don't try to use the - * destroyed context later. + /* `buf` might not get destroyed right away, and its `tx` + * pointer will still be reachable. Make sure that we don't try + * to use the destroyed context later. */ conn_tx_destroy(conn, tx); k_sem_give(bt_conn_get_pkts(conn)); /* Merge HCI driver errors */ return -EIO; - -error_return: - /* Runtime handling of fatal errors when ASSERTS are disabled. - * Unref the buf and invoke callback with the error. - */ - net_buf_unref(buf); - if (cb) { - cb(conn, ud, err); - } - return err; } static struct k_poll_signal conn_change = @@ -970,8 +956,8 @@ struct bt_conn *get_conn_ready(void) sys_slist_remove(&bt_dev.le.conn_ready, prev, &conn->_conn_ready); (void)atomic_set(&conn->_conn_ready_lock, 0); - /* Append connection to list if it is connected and still has data */ - if (conn->has_data(conn) && (conn->state == BT_CONN_CONNECTED)) { + /* Append connection to list if it still has data */ + if (conn->has_data(conn)) { LOG_DBG("appending %p to back of TX queue", conn); bt_conn_data_ready(conn); } @@ -999,6 +985,30 @@ static void acl_get_and_clear_cb(struct bt_conn *conn, struct net_buf *buf, } #endif /* defined(CONFIG_BT_CONN) */ +/* Acts as a "null-routed" bt_send(). This fn will decrease the refcount of + * `buf` and call the user callback with an error code. + */ +static void destroy_and_callback(struct bt_conn *conn, + struct net_buf *buf, + bt_conn_tx_cb_t cb, + void *ud) +{ + if (!cb) { + conn->get_and_clear_cb(conn, buf, &cb, &ud); + } + + LOG_DBG("pop: cb %p userdata %p", cb, ud); + + /* bt_send() would've done an unref. Do it here also, so the buffer is + * hopefully destroyed and the user callback can allocate a new one. + */ + net_buf_unref(buf); + + if (cb) { + cb(conn, ud, -ESHUTDOWN); + } +} + static volatile bool _suspend_tx; #if defined(CONFIG_BT_TESTING) @@ -1041,7 +1051,17 @@ void bt_conn_tx_processor(void) if (conn->state != BT_CONN_CONNECTED) { LOG_WRN("conn %p: not connected", conn); - goto raise_and_exit; + + /* Call the user callbacks & destroy (final-unref) the buffers + * we were supposed to send. + */ + buf = conn->tx_data_pull(conn, SIZE_MAX, &buf_len); + while (buf) { + destroy_and_callback(conn, buf, cb, ud); + buf = conn->tx_data_pull(conn, SIZE_MAX, &buf_len); + } + + goto exit; } /* now that we are guaranteed resources, we can pull data from the upper @@ -1075,12 +1095,25 @@ void bt_conn_tx_processor(void) int err = send_buf(conn, buf, buf_len, cb, ud); if (err) { + /* -EIO means `unrecoverable error`. It can be an assertion that + * failed or an error from the HCI driver. + * + * -ENOMEM means we thought we had all the resources to send the + * buf (ie. TX context + controller buffer) but one of them was + * not available. This is likely due to a failure of + * assumption, likely that we have been pre-empted somehow and + * that `tx_processor()` has been re-entered. + * + * In both cases, we destroy the buffer and mark the connection + * as dead. + */ LOG_ERR("Fatal error (%d). Disconnecting %p", err, conn); + destroy_and_callback(conn, buf, cb, ud); bt_conn_disconnect(conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); + goto exit; } -raise_and_exit: /* Always kick the TX work. It will self-suspend if it doesn't get * resources or there is nothing left to send. */ diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 909c0ebd22e..41f396a1aee 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -288,22 +288,10 @@ struct bt_conn { #endif /* Callback into the higher-layers (L2CAP / ISO) to return a buffer for - * sending `amount` of bytes to HCI. Will only be called when - * the state is connected. The higher-layer is responsible for purging - * the remaining buffers on disconnect. + * sending `amount` of bytes to HCI. * * Scheduling from which channel to pull (e.g. for L2CAP) is done at the * upper layer's discretion. - * - * Details about the returned net_buf when it is not NULL: - * - If the net_buf->len <= *length, then the net_buf has been removed - * from the tx_queue of the connection and the caller is now the - * owner of the only reference to the net_buf. - * - Otherwise, the net_buf is still on the tx_queue of the connection, - * and the callback has incremented the reference count to account - * for it having a reference still. - * - The caller must consume *length bytes from the net_buf before - * calling this function again. */ struct net_buf * (*tx_data_pull)(struct bt_conn *conn, size_t amount, diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index a59158a43d3..eb6eaa78350 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -454,18 +454,10 @@ void bt_iso_connected(struct bt_conn *iso) static void bt_iso_chan_disconnected(struct bt_iso_chan *chan, uint8_t reason) { const uint8_t conn_type = chan->iso->iso.info.type; - struct net_buf *buf; - LOG_DBG("%p, reason 0x%02x", chan, reason); __ASSERT(chan->iso != NULL, "NULL conn for iso chan %p", chan); - /* release buffers from tx_queue */ - while ((buf = k_fifo_get(&chan->iso->iso.txq, K_NO_WAIT))) { - __ASSERT_NO_MSG(!bt_buf_has_view(buf)); - net_buf_unref(buf); - } - bt_iso_chan_set_state(chan, BT_ISO_STATE_DISCONNECTED); bt_conn_set_state(chan->iso, BT_CONN_DISCONNECT_COMPLETE); @@ -783,8 +775,7 @@ void bt_iso_recv(struct bt_conn *iso, struct net_buf *buf, uint8_t flags) static bool iso_has_data(struct bt_conn *conn) { #if defined(CONFIG_BT_ISO_TX) - return ((conn->iso.chan->state == BT_ISO_STATE_CONNECTED) && - !k_fifo_is_empty(&conn->iso.txq)); + return !k_fifo_is_empty(&conn->iso.txq); #else /* !CONFIG_BT_ISO_TX */ return false; #endif /* CONFIG_BT_ISO_TX */ @@ -798,9 +789,9 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount, size_t /* Leave the PDU buffer in the queue until we have sent all its * fragments. */ - struct net_buf *q_frag = k_fifo_peek_head(&conn->iso.txq); + struct net_buf *frag = k_fifo_peek_head(&conn->iso.txq); - if (!q_frag) { + if (!frag) { BT_ISO_DATA_DBG("signaled ready but no frag available"); /* Service other connections */ bt_tx_irq_raise(); @@ -808,10 +799,13 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount, size_t return NULL; } - __ASSERT_NO_MSG(conn->state == BT_CONN_CONNECTED); - if (conn->iso.chan->state != BT_ISO_STATE_CONNECTED) { + __maybe_unused struct net_buf *b = k_fifo_get(&conn->iso.txq, K_NO_WAIT); + LOG_DBG("channel has been disconnected"); + __ASSERT_NO_MSG(b == frag); + + net_buf_unref(b); /* Service other connections */ bt_tx_irq_raise(); @@ -819,7 +813,7 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount, size_t return NULL; } - if (bt_buf_has_view(q_frag)) { + if (bt_buf_has_view(frag)) { /* This should not happen. conn.c should wait until the view is * destroyed before requesting more data. */ @@ -827,16 +821,13 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount, size_t return NULL; } - struct net_buf *frag = net_buf_ref(q_frag); bool last_frag = amount >= frag->len; if (last_frag) { - q_frag = k_fifo_get(&conn->iso.txq, K_NO_WAIT); + __maybe_unused struct net_buf *b = k_fifo_get(&conn->iso.txq, K_NO_WAIT); BT_ISO_DATA_DBG("last frag, pop buf"); - __ASSERT_NO_MSG(q_frag == frag); - - net_buf_unref(q_frag); + __ASSERT_NO_MSG(b == frag); } *length = frag->len; diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index ac6fc60dbad..433eb8faef0 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -83,6 +83,11 @@ NET_BUF_POOL_FIXED_DEFINE(disc_pool, 1, #define l2cap_remove_ident(conn, ident) __l2cap_lookup_ident(conn, ident, true) static sys_slist_t servers = SYS_SLIST_STATIC_INIT(&servers); + +static void l2cap_tx_buf_destroy(struct bt_conn *conn, struct net_buf *buf, int err) +{ + net_buf_unref(buf); +} #endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ /* L2CAP signalling channel specific context */ @@ -252,7 +257,6 @@ void bt_l2cap_chan_del(struct bt_l2cap_chan *chan) { const struct bt_l2cap_chan_ops *ops = chan->ops; struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); - struct net_buf *buf; LOG_DBG("conn %p chan %p", chan->conn, chan); @@ -265,7 +269,9 @@ void bt_l2cap_chan_del(struct bt_l2cap_chan *chan) /* Remove buffers on the PDU TX queue. We can't do that in * `l2cap_chan_destroy()` as it is not called for fixed channels. */ - while ((buf = k_fifo_get(&le_chan->tx_queue, K_NO_WAIT))) { + while (chan_has_data(le_chan)) { + struct net_buf *buf = k_fifo_get(&le_chan->tx_queue, K_NO_WAIT); + net_buf_unref(buf); } @@ -913,22 +919,20 @@ struct net_buf *l2cap_data_pull(struct bt_conn *conn, * For SDUs we do the same, we keep it in the queue until all the * segments have been sent, adding the PDU headers just-in-time. */ - struct net_buf *fifo_pdu = k_fifo_peek_head(&lechan->tx_queue); + struct net_buf *pdu = k_fifo_peek_head(&lechan->tx_queue); /* We don't have anything to send for the current channel. We could * however have something to send on another channel that is attached to * the same ACL connection. Re-trigger the TX processor: it will call us * again and this time we will select another channel to pull data from. */ - if (!fifo_pdu) { + if (!pdu) { bt_tx_irq_raise(); return NULL; } - __ASSERT_NO_MSG(conn->state == BT_CONN_CONNECTED); - - if (bt_buf_has_view(fifo_pdu)) { - LOG_ERR("already have view on %p", fifo_pdu); + if (bt_buf_has_view(pdu)) { + LOG_ERR("already have view on %p", pdu); return NULL; } @@ -942,8 +946,6 @@ struct net_buf *l2cap_data_pull(struct bt_conn *conn, return NULL; } - struct net_buf *pdu = net_buf_ref(fifo_pdu); - /* Add PDU header */ if (lechan->_pdu_remaining == 0) { struct bt_l2cap_hdr *hdr; @@ -973,11 +975,9 @@ struct net_buf *l2cap_data_pull(struct bt_conn *conn, if (last_frag && last_seg) { LOG_DBG("last frag of last seg, dequeuing %p", pdu); - fifo_pdu = k_fifo_get(&lechan->tx_queue, K_NO_WAIT); + __maybe_unused struct net_buf *b = k_fifo_get(&lechan->tx_queue, K_NO_WAIT); - __ASSERT_NO_MSG(fifo_pdu == pdu); - - net_buf_unref(fifo_pdu); + __ASSERT_NO_MSG(b == pdu); } if (last_frag && L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { @@ -2290,7 +2290,7 @@ static void l2cap_chan_shutdown(struct bt_l2cap_chan *chan) /* Remove buffers on the TX queue */ while ((buf = k_fifo_get(&le_chan->tx_queue, K_NO_WAIT))) { - net_buf_unref(buf); + l2cap_tx_buf_destroy(chan->conn, buf, -ESHUTDOWN); } /* Remove buffers on the RX queue */ From 51d6acd76dfbd2dc787ebd51ae8660a735bbd2c0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 413/881] Revert "[nrf fromtree] tests: drivers: clock_control: nrf_lf_clock_start: Run on nrf54lm20dk" This reverts commit 09917ddd26f3eae14126804fdf093e6bef790785. Signed-off-by: Jukka Rissanen --- tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index 0b1f9ae3c93..2a4bba57a71 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -51,7 +51,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 From 1917d99c074ec447260106ffcd4cea3248e9d90d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 414/881] Revert "[nrf fromtree] serial: nrfx_uarte: initial pin state to SLEEP" This reverts commit cfacaa878a05971309d67ad2133c763c22057842. Signed-off-by: Jukka Rissanen --- drivers/serial/uart_nrfx_uarte.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 1c75f443228..cd8aab9a475 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2490,11 +2490,6 @@ static int uarte_instance_init(const struct device *dev, ((struct pinctrl_dev_config *)cfg->pcfg)->reg = (uintptr_t)cfg->uarte_regs; } - /* Apply sleep state by default. - * If PM is disabled, the default state will be applied in pm_device_driver_init. - */ - (void)pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP); - #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE err = uarte_nrfx_configure(dev, &((struct uarte_nrfx_data *)dev->data)->uart_config); if (err) { From cbc14570cdc003c2ca8a0d5cdb8b4cce6e2af2a3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 415/881] Revert "[nrf fromtree] drivers: serial: nrfx_uarte: use ifdef instead of IS_ENABLED" This reverts commit 75441a0dfc0eba138ff390837cf4762a44968ab7. Signed-off-by: Jukka Rissanen --- drivers/serial/uart_nrfx_uarte.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index cd8aab9a475..46c5a8b83d2 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -1611,11 +1611,11 @@ static void endrx_isr(const struct device *dev) } irq_unlock(key); -#ifdef UARTE_HAS_FRAME_TIMEOUT - if (start_timeout && !K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { - k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); + if (IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) { + if (start_timeout && !K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { + k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); + } } -#endif } #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) From 78d35ba39efe0e829a057d3f05493c57b97006b9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 416/881] Revert "[nrf fromtree] tests: drivers: uart: uart_mix_fifo_poll: Cleanup after nRF54LM20 rename" This reverts commit 56d98e478ea766904b728c243e0999f500b6ed22. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 43 +++++++++++++++++++ .../uart/uart_mix_fifo_poll/testcase.yaml | 9 ++-- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..945b8628e7a --- /dev/null +++ b/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; + +counter_dev: &timer00 { + status = "okay"; +}; + +&grtc { + interrupts = <228 2>; +}; diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index fee2d1f4646..5a85af65735 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -5,19 +5,20 @@ common: depends_on: gpio harness: ztest platform_allow: - - nrf52_bsim - nrf52840dk/nrf52840 - nrf9160dk/nrf9160 - nrf5340dk/nrf5340/cpuapp - nrf5340bsim/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15bsim/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp + - nrf54l15bsim/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad - ophelia4ev/nrf54l15/cpuapp + - nrf52_bsim integration_platforms: - nrf52840dk/nrf52840 harness_config: From 148e3e4e90869a584ba5133cef5c93d64e7bfe13 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 417/881] Revert "[nrf fromtree] soc: Add SOC_COMPATIBLE_NRF54LM20* options" This reverts commit 8b197fdd0a5472489d603d8d3e53323d7977ed0a. Signed-off-by: Jukka Rissanen --- soc/Kconfig | 6 ------ 1 file changed, 6 deletions(-) diff --git a/soc/Kconfig b/soc/Kconfig index cf1bde8aa4d..a1ea1f97896 100644 --- a/soc/Kconfig +++ b/soc/Kconfig @@ -49,12 +49,6 @@ config SOC_COMPATIBLE_NRF54L15 config SOC_COMPATIBLE_NRF54L15_CPUAPP bool -config SOC_COMPATIBLE_NRF54LM20A - bool - -config SOC_COMPATIBLE_NRF54LM20A_CPUAPP - bool - config SOC_DEPRECATED_RELEASE string help From 3cf4487232014aaa7c75e7348a76db330c524ee4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 418/881] Revert "[nrf fromtree] boards nrf_bsim: Add a new nrf54lm20bsim target" This reverts commit a8f8ee87de2906fccb6e9954b71c68908a9d0b29. Signed-off-by: Jukka Rissanen --- boards/native/nrf_bsim/Kconfig | 10 -- boards/native/nrf_bsim/Kconfig.nrf54lm20bsim | 5 - boards/native/nrf_bsim/board.yml | 5 - boards/native/nrf_bsim/board_soc.h | 2 +- .../nrf54lm20bsim_nrf54lm20a_cpuapp.dts | 144 ------------------ .../nrf54lm20bsim_nrf54lm20a_cpuapp.yaml | 17 --- .../nrf54lm20bsim_nrf54lm20a_cpuapp_defconfig | 8 - modules/hal_nordic/nrfx/CMakeLists.txt | 2 - 8 files changed, 1 insertion(+), 192 deletions(-) delete mode 100644 boards/native/nrf_bsim/Kconfig.nrf54lm20bsim delete mode 100644 boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts delete mode 100644 boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.yaml delete mode 100644 boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp_defconfig diff --git a/boards/native/nrf_bsim/Kconfig b/boards/native/nrf_bsim/Kconfig index 3596ccec024..a8865941d74 100644 --- a/boards/native/nrf_bsim/Kconfig +++ b/boards/native/nrf_bsim/Kconfig @@ -45,16 +45,6 @@ config BOARD_NRF54L15BSIM_NRF54L15_CPUAPP 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_NRF54LM20BSIM_NRF54LM20A_CPUAPP - bool - select SOC_SERIES_BSIM_NRF54LX - select SOC_COMPATIBLE_NRF54LM20A - select SOC_COMPATIBLE_NRF54LM20A_CPUAPP - select CLOCK_CONTROL - help - Simulated NRF54LM20 Application core - Will produce a console Linux process which can be executed natively. - It needs the BabbleSim simulator both in compile time and to execute if SOC_SERIES_BSIM_NRFXX diff --git a/boards/native/nrf_bsim/Kconfig.nrf54lm20bsim b/boards/native/nrf_bsim/Kconfig.nrf54lm20bsim deleted file mode 100644 index f5d8f640097..00000000000 --- a/boards/native/nrf_bsim/Kconfig.nrf54lm20bsim +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NRF54LM20BSIM - select SOC_POSIX diff --git a/boards/native/nrf_bsim/board.yml b/boards/native/nrf_bsim/board.yml index 0a94a177d50..0ba40b33677 100644 --- a/boards/native/nrf_bsim/board.yml +++ b/boards/native/nrf_bsim/board.yml @@ -14,10 +14,5 @@ boards: vendor: zephyr socs: - name: nrf54l15 -- name: nrf54lm20bsim - full_name: nRF54LM20 simulated boards (BabbleSim) - vendor: zephyr - socs: - - name: nrf54lm20a # Note the 53 and 54 are referring to the real SOC yamls, but we only use their name and cpu-cluster # definitions. In practice these board uses the same native SOC (SOC_POSIX) as the nrf52_bsim diff --git a/boards/native/nrf_bsim/board_soc.h b/boards/native/nrf_bsim/board_soc.h index ee77478caab..e0b1cb60a59 100644 --- a/boards/native/nrf_bsim/board_soc.h +++ b/boards/native/nrf_bsim/board_soc.h @@ -38,7 +38,7 @@ #define OFFLOAD_SW_IRQ EGU0_IRQn #elif defined(CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUNET) #define OFFLOAD_SW_IRQ SWI0_IRQn -#elif defined(CONFIG_SOC_SERIES_BSIM_NRF54LX) +#elif defined(CONFIG_BOARD_NRF54L15BSIM) #define OFFLOAD_SW_IRQ SWI00_IRQn #endif diff --git a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts b/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts deleted file mode 100644 index bd424f2e15e..00000000000 --- a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include -#include <../boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi> - -/ { - model = "Nordic NRF54LM20 BSIM NRF54LM20A Application MCU"; - compatible = "bsim,nrf54lm20-bsim-nrf54lm20a-cpuapp", "bsim,nrf54"; - - chosen { - zephyr,console = &uart20; - zephyr,entropy = &rng; - zephyr,bt-c2h-uart = &uart20; - zephyr,flash-controller = &rram_controller; - zephyr,flash = &cpuapp_rram; - }; - - /delete-node/ cpus; - /delete-node/ sw-pwm; - - soc { - /delete-node/ memory@20000000; - /delete-node/ memory@20067c00; - - peripheral@50000000 { - /delete-node/ vpr@4c000; - /delete-node/ interrupt-controller@f0000000; - /delete-node/spi@4d000; - /delete-node/usbhs@5a000; - /delete-node/i2c@c6000; - /delete-node/spi@c6000; - /delete-node/i2c@c7000; - /delete-node/spi@c7000; - /delete-node/i2c@c8000; - /delete-node/spi@c8000; - /delete-node/pdm@d0000; - /delete-node/pdm@d1000; - /delete-node/pwm@d2000; - /delete-node/pwm@d3000; - /delete-node/pwm@d4000; - /delete-node/adc@d5000; - /delete-node/nfct@d6000; - /delete-node/qdec@e0000; - /delete-node/qdec@e1000; - /delete-node/tdm@e8000; - /delete-node/i2c@ed000; - /delete-node/spi@ed000; - /delete-node/i2c@ee000; - /delete-node/spi@ee000; - /delete-node/i2c@104000; - /delete-node/spi@104000; - /delete-node/comparator@106000; - /delete-node/watchdog@108000; - /delete-node/watchdog@109000; - /delete-node/regulator@120000; - }; - }; - - rng: rng { - status = "okay"; - compatible = "nordic,nrf-cracen-ctrdrbg"; - }; - - psa_rng: psa-rng { - status = "disabled"; - }; -}; - -&grtc { - owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>; - /* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */ - child-owned-channels = <3 4 7 8 9 10 11>; - status = "okay"; -}; - -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - storage_partition: partition@0 { - label = "storage"; - reg = <0x0 DT_SIZE_K(500)>; - }; - }; -}; - -&uart20 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart20_default>; - pinctrl-1 = <&uart20_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&uart30 { - current-speed = <115200>; - pinctrl-0 = <&uart30_default>; - pinctrl-1 = <&uart30_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&gpiote20 { - status = "okay"; -}; - -&gpiote30 { - status = "okay"; -}; - -&temp { - status = "okay"; -}; - -&radio { - status = "okay"; - /* These features are not yet supported by the RADIO model */ - /delete-property/ dfe-supported; - /delete-property/ cs-supported; -}; - -&clock { - status = "okay"; -}; diff --git a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.yaml b/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.yaml deleted file mode 100644 index 7941cd317ee..00000000000 --- a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.yaml +++ /dev/null @@ -1,17 +0,0 @@ -identifier: nrf54lm20bsim/nrf54lm20a/cpuapp -name: NRF54LM20 BabbleSim - Application Core target -type: native -arch: posix -simulation: - - name: native -env: - - BSIM_OUT_PATH -toolchain: - - zephyr -supported: - - counter - - gpio -testing: - ignore_tags: - - modem - - bsim_skip_CI diff --git a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp_defconfig b/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp_defconfig deleted file mode 100644 index 0fde4e01b58..00000000000 --- a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp_defconfig +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2023 Nordic Semiconductor ASA - -CONFIG_CONSOLE=y -CONFIG_NO_OPTIMIZATIONS=y - -# Start SYSCOUNTER on driver init -CONFIG_NRF_GRTC_START_SYSCOUNTER=y diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index d063046cfa8..35c46e235f2 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -66,8 +66,6 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L20_ENGA_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA NRF54LM20A_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A NRF54LM20A_ENGA_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9120 NRF9120_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160 NRF9160_XXAA) From 659b2d1ebcc361ebc613375518969e76b1419ff9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 419/881] Revert "[nrf fromtree] tests: drivers: uart: uart_pm: Cleanup after nRF54LM20 rename" This reverts commit 096eef02e4213cc668a08ba62670f393778f0c6d. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 36 +++++++++++++++++++ tests/drivers/uart/uart_pm/testcase.yaml | 27 ++++++++------ 2 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 tests/drivers/uart/uart_pm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/uart/uart_pm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/uart/uart_pm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..033aab401ac --- /dev/null +++ b/tests/drivers/uart/uart_pm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +/ { + chosen { + zephyr,console = &uart20; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index d775e30ae71..767e56b4592 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -4,15 +4,16 @@ common: - uart harness: ztest platform_allow: - - nrf52_bsim - nrf52840dk/nrf52840 - - nrf5340bsim/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15bsim/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp + - nrf54l15bsim/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf52_bsim + - nrf5340bsim/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp harness_config: fixture: gpio_loopback @@ -33,14 +34,15 @@ tests: - CONFIG_UART_0_ENHANCED_POLL_OUT=n extra_args: DTC_OVERLAY_FILE="boards/nrf52840dk_nrf52840.overlay;nrf_rx_disable.overlay" platform_exclude: - - nrf52_bsim - - nrf5340bsim/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15bsim/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp + - nrf54l15bsim/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf52_bsim + - nrf5340bsim/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.uart.pm.enhanced_poll: @@ -49,10 +51,11 @@ tests: - CONFIG_UART_ASYNC_API=n - CONFIG_UART_0_ENHANCED_POLL_OUT=y platform_exclude: - - nrf54h20dk/nrf54h20/cpuapp - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.uart.pm.int_driven: @@ -69,10 +72,11 @@ tests: - CONFIG_UART_ASYNC_API=n - CONFIG_UART_0_ENHANCED_POLL_OUT=y platform_exclude: - - nrf54h20dk/nrf54h20/cpuapp - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.uart.pm.async: @@ -95,8 +99,9 @@ tests: - CONFIG_NRFX_TIMER2=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y platform_exclude: - - nrf54h20dk/nrf54h20/cpuapp - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp From a0b61ce7cc6017cc9a7a28d5ba14bc2344eefeaa Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 420/881] Revert "[nrf fromtree] tests/drivers/uart/: Add overlays for the nrf54lm20bsim" This reverts commit aea9e183d4168ddf5994ab74759ba48b141621de. Signed-off-by: Jukka Rissanen --- .../boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay | 3 --- .../boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay | 7 ------- tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml | 1 - .../uart_pm/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay | 3 --- tests/drivers/uart/uart_pm/testcase.yaml | 2 -- 5 files changed, 16 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_pm/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index aef400ac2b1..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include "nrf54lm20dk_nrf54lm20a_cpuapp.overlay" diff --git a/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 8e7299a0d75..00000000000 --- a/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20a_cpuapp.overlay" diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index 5a85af65735..1ad54eb0dc5 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -13,7 +13,6 @@ common: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20bsim/nrf54lm20a/cpuapp - nrf54l15bsim/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad diff --git a/tests/drivers/uart/uart_pm/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_pm/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index aef400ac2b1..00000000000 --- a/tests/drivers/uart/uart_pm/boards/nrf54lm20bsim_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include "nrf54lm20dk_nrf54lm20a_cpuapp.overlay" diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 767e56b4592..8385db6bf86 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -9,7 +9,6 @@ common: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20bsim/nrf54lm20a/cpuapp - nrf54l15bsim/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf52_bsim @@ -38,7 +37,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20bsim/nrf54lm20a/cpuapp - nrf54l15bsim/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf52_bsim From 43f21c2bf49f8c978e756780289af6e1ef35310b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:19 +0300 Subject: [PATCH 421/881] Revert "[nrf fromtree] Revert "drivers: serial: nrfx_uarte: Deprecate CONFIG_UART_x_NRF_HW_ASYNC"" This reverts commit b4f0e223669f1a0ea7dca1088254455fabe43e21. Signed-off-by: Jukka Rissanen --- drivers/serial/Kconfig.nrfx | 2 +- drivers/serial/Kconfig.nrfx_uart_instance | 7 ++++++- samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf | 3 --- .../net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf | 3 --- .../uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf | 2 -- .../uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf | 2 -- .../uart/uart_async_api/boards/nrf9160dk_nrf9160.conf | 2 -- .../uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf | 2 -- tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml | 3 --- tests/drivers/uart/uart_pm/testcase.yaml | 6 ------ 10 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 8bcb9e49b66..f91980c058b 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -60,7 +60,7 @@ config UART_NRFX_UARTE_ENHANCED_RX bool "Enhanced RX handling" depends on UART_ASYNC_API depends on UART_NRFX_UARTE_LEGACY_SHIM - default y if !(UART_0_NRF_HW_ASYNC || UART_1_NRF_HW_ASYNC || UART_2_NRF_HW_ASYNC) + default y help Enable RX handling mode which is switching buffers on timeout. This is an enhancement compared to other two modes (default and hardware assisted). diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index b1a68d691c4..fa93a814482 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -49,18 +49,23 @@ config UART_$(nrfx_uart_num)_NRF_TX_BUFFER_SIZE particular SoC. config UART_$(nrfx_uart_num)_NRF_HW_ASYNC - bool "Use hardware RX byte counting" + bool "[DEPRECATED] Use hardware RX byte counting" depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) depends on UART_ASYNC_API depends on UART_NRFX_UARTE_LEGACY_SHIM + depends on !UART_NRFX_UARTE_ENHANCED_RX depends on HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC select NRFX_GPPI + select DEPRECATED help If default driver uses interrupts to count incoming bytes, it is possible that with higher speeds and/or high cpu load some data can be lost. It is recommended to use hardware byte counting in such scenarios. Hardware RX byte counting requires timer instance and one PPI channel. + This options is deprecated. Use UART_NRFX_UARTE_ENHANCED_RX which supports + reliable byte counting without additional HW resources (TIMER and (D)PPI). + config UART_$(nrfx_uart_num)_NRF_ASYNC_LOW_POWER bool "Low power mode" depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) diff --git a/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf b/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf index 6cf67ab5f98..226ce728a19 100644 --- a/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf +++ b/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf @@ -1,9 +1,6 @@ CONFIG_UART_ASYNC_API=y CONFIG_UART_1_ASYNC=y CONFIG_UART_1_INTERRUPT_DRIVEN=n -# Enable HW RX byte counting. This especially matters at higher baud rates. -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 # Align with the Serial LTE Modem (SLM) application. CONFIG_MODEM_CELLULAR_UART_BUFFER_SIZES=6000 diff --git a/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf b/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf index a3cfb7919db..907cc9baed1 100644 --- a/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf @@ -1,9 +1,6 @@ CONFIG_UART_ASYNC_API=y CONFIG_UART_1_ASYNC=y CONFIG_UART_1_INTERRUPT_DRIVEN=n -# Enable HW RX byte counting. This especially matters at higher baud rates. -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 # Align with the Serial LTE Modem (SLM) application. CONFIG_MODEM_CELLULAR_UART_BUFFER_SIZES=6000 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf deleted file mode 100644 index e7a460fde6b..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 -CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf index 396d23ba5ae..d70069646c9 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1,3 +1 @@ -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf index 4f738f955e1..83e126780f9 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf @@ -1,4 +1,2 @@ CONFIG_ARM_MPU=n CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 diff --git a/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index 025b9236147..00000000000 --- a/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index 1ad54eb0dc5..a901abda9e4 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -78,9 +78,6 @@ tests: - CONFIG_UART_0_INTERRUPT_DRIVEN=n - CONFIG_UART_0_ASYNC=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y - - CONFIG_UART_0_NRF_HW_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER2=y platform_allow: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 8385db6bf86..9bb36067757 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -82,9 +82,6 @@ tests: - CONFIG_UART_INTERRUPT_DRIVEN=n - CONFIG_UART_ASYNC_API=y - CONFIG_UART_0_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER2=y - CONFIG_UART_0_ENHANCED_POLL_OUT=n drivers.uart.pm.async.enhanced_poll: @@ -92,9 +89,6 @@ tests: - CONFIG_UART_INTERRUPT_DRIVEN=n - CONFIG_UART_ASYNC_API=y - CONFIG_UART_0_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER2=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y platform_exclude: - nrf54l09pdk/nrf54l09/cpuapp From 2ad7c414f39cddbc531503809432773e45aefa48 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 422/881] Revert "[nrf fromlist] drivers: wifi: Pass the connection type" This reverts commit 7a76eef93b6f5222a92fa820c39f7099465c0f05. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 22aa0416550..d06f0792fa2 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -935,11 +935,6 @@ int nrf_wifi_wpa_supp_associate(void *if_priv, struct wpa_driver_associate_param assoc_info.bss_max_idle_time = params->bss_max_idle_period; } - assoc_info.conn_type = NRF_WIFI_CONN_TYPE_OPEN; - if (!(params->key_mgmt_suite & WPA_KEY_MGMT_NONE)) { - assoc_info.conn_type = NRF_WIFI_CONN_TYPE_SECURE; - } - status = nrf_wifi_sys_fmac_assoc(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &assoc_info); if (status != NRF_WIFI_STATUS_SUCCESS) { From fe6424f5302790e4debd094a9a812c257b4b7aa0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 423/881] Revert "[nrf fromlist] net: l2: wifi: Refactor certificates processing code into common file" This reverts commit b1410c56652b1ab9182a3529ebc8b1add1d4a741. Signed-off-by: Jukka Rissanen --- include/zephyr/net/wifi_certs.h | 38 -- modules/hostap/Kconfig | 2 - subsys/net/l2/wifi/CMakeLists.txt | 1 - subsys/net/l2/wifi/Kconfig | 5 - subsys/net/l2/wifi/wifi_certs.c | 366 ------------------ subsys/net/l2/wifi/wifi_shell.c | 292 +++++++++++++- .../wifi_credentials/wifi_credentials_shell.c | 246 +++++++++++- 7 files changed, 525 insertions(+), 425 deletions(-) delete mode 100644 include/zephyr/net/wifi_certs.h delete mode 100644 subsys/net/l2/wifi/wifi_certs.c diff --git a/include/zephyr/net/wifi_certs.h b/include/zephyr/net/wifi_certs.h deleted file mode 100644 index ea9e02cf104..00000000000 --- a/include/zephyr/net/wifi_certs.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef WIFI_CERTS_H__ -#define WIFI_CERTS_H__ - -#include -#include -#include - -/** - * Set Wi-Fi Enterprise credentials. - * - * Sets up the required credentials for Enterprise mode in both - * Access Point and Station modes. - * - * Certificates typically used: - * - CA certificate - * - Client certificate - * - Client private key - * - Server certificate and server key (for AP mode) - * - * @param iface Network interface - * @param is_ap AP or Station mode - * - * @return 0 if ok, < 0 if error - */ -int wifi_set_enterprise_credentials(struct net_if *iface, bool is_ap); - -/** - * Clear Wi-Fi enterprise credentials - */ -void wifi_clear_enterprise_credentials(void); - -#endif /* WIFI_CERTS_H__ */ diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 8e5f7d348a8..f900fea0e85 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -221,7 +221,6 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE select MBEDTLS_X509_CRL_PARSE_C select MBEDTLS_TLS_VERSION_1_2 select NOT_SECURE - select WIFI_CERTIFICATE_LIB depends on !WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE help Enable Enterprise Crypto support for WiFi. This feature @@ -330,7 +329,6 @@ config WIFI_NM_HOSTAPD_AP config WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE bool "Hostapd crypto enterprise support" - select WIFI_CERTIFICATE_LIB depends on WIFI_NM_HOSTAPD_AP if WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE diff --git a/subsys/net/l2/wifi/CMakeLists.txt b/subsys/net/l2/wifi/CMakeLists.txt index 63fb98fa6cf..e1e9606bfd2 100644 --- a/subsys/net/l2/wifi/CMakeLists.txt +++ b/subsys/net/l2/wifi/CMakeLists.txt @@ -13,7 +13,6 @@ zephyr_library_include_directories_ifdef( ) zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_MGMT wifi_mgmt.c) -zephyr_library_sources_ifdef(CONFIG_WIFI_CERTIFICATE_LIB wifi_certs.c) zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_SHELL wifi_shell.c) zephyr_library_sources_ifdef(CONFIG_WIFI_NM wifi_nm.c) zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_UTILS wifi_utils.c) diff --git a/subsys/net/l2/wifi/Kconfig b/subsys/net/l2/wifi/Kconfig index 4b1d309066c..a2e029a592b 100644 --- a/subsys/net/l2/wifi/Kconfig +++ b/subsys/net/l2/wifi/Kconfig @@ -126,11 +126,6 @@ config WIFI_ENT_IDENTITY_MAX_USERS help This option defines the maximum number of identity users allowed connection. -config WIFI_CERTIFICATE_LIB - bool - help - Enable this option to process certificates in enterprise mode. - if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE config WIFI_SHELL_RUNTIME_CERTIFICATES diff --git a/subsys/net/l2/wifi/wifi_certs.c b/subsys/net/l2/wifi/wifi_certs.c deleted file mode 100644 index 545010cbf77..00000000000 --- a/subsys/net/l2/wifi/wifi_certs.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -LOG_MODULE_REGISTER(net_wifi_certs, CONFIG_NET_L2_WIFI_MGMT_LOG_LEVEL); - -#include -#include -#include -#include -#include -#include - -static struct wifi_enterprise_creds_params enterprise_creds_params = { 0 }; - -#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES -#include -enum wifi_enterprise_cert_sec_tags { - WIFI_CERT_CA_SEC_TAG = 0x1020001, - WIFI_CERT_CLIENT_KEY_SEC_TAG, - WIFI_CERT_SERVER_KEY_SEC_TAG, - WIFI_CERT_CLIENT_SEC_TAG, - WIFI_CERT_SERVER_SEC_TAG, - /* Phase 2 */ - WIFI_CERT_CA_P2_SEC_TAG, - WIFI_CERT_CLIENT_KEY_P2_SEC_TAG, - WIFI_CERT_CLIENT_P2_SEC_TAG, -}; - -struct wifi_cert_data { - enum tls_credential_type type; - uint32_t sec_tag; - uint8_t **data; - size_t *len; -}; -#else -static const char ca_cert_test[] = { - #include - '\0' -}; - -static const char client_cert_test[] = { - #include - '\0' -}; - -static const char client_key_test[] = { - #include - '\0' -}; - -static const char ca_cert2_test[] = { - #include - '\0'}; - -static const char client_cert2_test[] = { - #include - '\0'}; - -static const char client_key2_test[] = { - #include - '\0'}; - -static const char server_cert_test[] = { - #include - '\0' -}; - -static const char server_key_test[] = { - #include - '\0' -}; -#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ - -#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES -static int process_certificates(struct wifi_cert_data *certs, size_t cert_count) -{ - for (size_t i = 0; i < cert_count; i++) { - int err; - size_t len = 0; - uint8_t *cert_tmp; - - err = tls_credential_get(certs[i].sec_tag, certs[i].type, NULL, &len); - if (err != -EFBIG) { - LOG_ERR("Failed to get credential tag: %d length, err: %d", - certs[i].sec_tag, err); - return err; - } - - cert_tmp = k_malloc(len); - if (!cert_tmp) { - LOG_ERR("Failed to allocate memory for credential tag: %d", - certs[i].sec_tag); - return -ENOMEM; - } - - err = tls_credential_get(certs[i].sec_tag, certs[i].type, cert_tmp, &len); - if (err) { - LOG_ERR("Failed to get credential tag: %d", certs[i].sec_tag); - k_free(cert_tmp); - return err; - } - - *certs[i].data = cert_tmp; - *certs[i].len = len; - } - - return 0; -} - -static void set_enterprise_creds_params(bool is_ap) -{ - struct wifi_cert_data certs_common[] = { - { - .type = TLS_CREDENTIAL_CA_CERTIFICATE, - .sec_tag = WIFI_CERT_CA_SEC_TAG, - .data = &enterprise_creds_params.ca_cert, - .len = &enterprise_creds_params.ca_cert_len, - }, - }; - struct wifi_cert_data certs_sta[] = { - { - .type = TLS_CREDENTIAL_PRIVATE_KEY, - .sec_tag = WIFI_CERT_CLIENT_KEY_SEC_TAG, - .data = &enterprise_creds_params.client_key, - .len = &enterprise_creds_params.client_key_len, - }, - { - .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, - .sec_tag = WIFI_CERT_CLIENT_SEC_TAG, - .data = &enterprise_creds_params.client_cert, - .len = &enterprise_creds_params.client_cert_len, - }, - { - .type = TLS_CREDENTIAL_CA_CERTIFICATE, - .sec_tag = WIFI_CERT_CA_P2_SEC_TAG, - .data = &enterprise_creds_params.ca_cert2, - .len = &enterprise_creds_params.ca_cert2_len, - }, - { - .type = TLS_CREDENTIAL_PRIVATE_KEY, - .sec_tag = WIFI_CERT_CLIENT_KEY_P2_SEC_TAG, - .data = &enterprise_creds_params.client_key2, - .len = &enterprise_creds_params.client_key2_len, - }, - { - .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, - .sec_tag = WIFI_CERT_CLIENT_P2_SEC_TAG, - .data = &enterprise_creds_params.client_cert2, - .len = &enterprise_creds_params.client_cert2_len, - }, - }; - - struct wifi_cert_data certs_ap[] = { - { - .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, - .sec_tag = WIFI_CERT_SERVER_SEC_TAG, - .data = &enterprise_creds_params.server_cert, - .len = &enterprise_creds_params.server_cert_len, - }, - { - .type = TLS_CREDENTIAL_PRIVATE_KEY, - .sec_tag = WIFI_CERT_SERVER_KEY_SEC_TAG, - .data = &enterprise_creds_params.server_key, - .len = &enterprise_creds_params.server_key_len, - }, - }; - - memset(&enterprise_creds_params, 0, sizeof(struct wifi_enterprise_creds_params)); - - /* Process common certificates */ - if (process_certificates(certs_common, ARRAY_SIZE(certs_common)) != 0) { - goto cleanup; - } - - /* Process STA-specific certificates */ - if (!is_ap) { - if (process_certificates(certs_sta, ARRAY_SIZE(certs_sta)) != 0) { - goto cleanup; - } - } - - /* Process AP-specific certificates if is_ap is true */ - if (is_ap) { - if (process_certificates(certs_ap, ARRAY_SIZE(certs_ap)) != 0) { - goto cleanup; - } - } - - return; - -cleanup: - for (size_t i = 0; i < ARRAY_SIZE(certs_common); i++) { - if (certs_common[i].data) { - k_free(*certs_common[i].data); - } - } - - if (!is_ap) { - for (size_t i = 0; i < ARRAY_SIZE(certs_sta); i++) { - if (certs_sta[i].data) { - k_free(*certs_sta[i].data); - } - } - } - - if (is_ap) { - for (size_t i = 0; i < ARRAY_SIZE(certs_ap); i++) { - if (certs_ap[i].data) { - k_free(*certs_ap[i].data); - } - } - } -} - -void wifi_clear_enterprise_credentials(void) -{ - size_t i; - - const uint8_t *certs[] = { - enterprise_creds_params.ca_cert, - enterprise_creds_params.client_cert, - enterprise_creds_params.client_key, - enterprise_creds_params.server_cert, - enterprise_creds_params.server_key, - enterprise_creds_params.ca_cert2, - enterprise_creds_params.client_cert2, - enterprise_creds_params.client_key2, - }; - - for (i = 0; i < ARRAY_SIZE(certs); i++) { - k_free((void *)certs[i]); - } - memset(&enterprise_creds_params, 0, sizeof(struct wifi_enterprise_creds_params)); -} -#else -int config_process_blob(struct wpa_config *config, char *name, uint8_t *data, - uint32_t data_len) -{ - struct wpa_config_blob *blob; - - if (!data || !data_len) { - return -1; - } - - blob = os_zalloc(sizeof(*blob)); - if (blob == NULL) { - return -1; - } - - blob->data = os_zalloc(data_len); - if (blob->data == NULL) { - os_free(blob); - return -1; - } - - blob->name = os_strdup(name); - - if (blob->name == NULL) { - wpa_config_free_blob(blob); - return -1; - } - - os_memcpy(blob->data, data, data_len); - blob->len = data_len; - - wpa_config_set_blob(config, blob); - - return 0; -} - -int process_certificates(void) -{ - struct wpa_supplicant *wpa_s; - int ret; - char if_name[CONFIG_NET_INTERFACE_NAME_LEN + 1]; - struct net_if *iface = net_if_get_wifi_sta(); - - ret = net_if_get_name(iface, if_name, sizeof(if_name)); - if (!ret) { - LOG_ERR("Cannot get interface name (%d)", ret); - return -1; - } - - wpa_s = zephyr_get_handle_by_ifname(if_name); - if (!wpa_s) { - LOG_ERR("Unable to find the interface: %s, quitting", if_name); - return -1; - } - - wifi_set_enterprise_credentials(iface, 0); - - if (config_process_blob(wpa_s->conf, "ca_cert", - enterprise_creds_params.ca_cert, - enterprise_creds_params.ca_cert_len)) { - return -1; - } - - if (config_process_blob(wpa_s->conf, "client_cert", - enterprise_creds_params.client_cert, - enterprise_creds_params.client_cert_len)) { - return -1; - } - - if (config_process_blob(wpa_s->conf, "private_key", - enterprise_creds_params.client_key, - enterprise_creds_params.client_key_len)) { - return -1; - } - - return 0; -} - -static void set_enterprise_creds_params(bool is_ap) -{ - enterprise_creds_params.ca_cert = (uint8_t *)ca_cert_test; - enterprise_creds_params.ca_cert_len = ARRAY_SIZE(ca_cert_test); - - if (!is_ap) { - enterprise_creds_params.client_cert = (uint8_t *)client_cert_test; - enterprise_creds_params.client_cert_len = ARRAY_SIZE(client_cert_test); - enterprise_creds_params.client_key = (uint8_t *)client_key_test; - enterprise_creds_params.client_key_len = ARRAY_SIZE(client_key_test); - enterprise_creds_params.ca_cert2 = (uint8_t *)ca_cert2_test; - enterprise_creds_params.ca_cert2_len = ARRAY_SIZE(ca_cert2_test); - enterprise_creds_params.client_cert2 = (uint8_t *)client_cert2_test; - enterprise_creds_params.client_cert2_len = ARRAY_SIZE(client_cert2_test); - enterprise_creds_params.client_key2 = (uint8_t *)client_key2_test; - enterprise_creds_params.client_key2_len = ARRAY_SIZE(client_key2_test); - - return; - } - - enterprise_creds_params.server_cert = (uint8_t *)server_cert_test; - enterprise_creds_params.server_cert_len = ARRAY_SIZE(server_cert_test); - enterprise_creds_params.server_key = (uint8_t *)server_key_test; - enterprise_creds_params.server_key_len = ARRAY_SIZE(server_key_test); -} - -void wifi_clear_enterprise_credentials(void) -{ - /** - * No operation needed because Wi-Fi credentials - * are statically configured at build time and - * no dynamic memory needs to be freed. - */ -} -#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ - -int wifi_set_enterprise_credentials(struct net_if *iface, bool is_ap) -{ -#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES - wifi_clear_enterprise_credentials(); -#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ - set_enterprise_creds_params(is_ap); - if (net_mgmt(NET_REQUEST_WIFI_ENTERPRISE_CREDS, iface, - &enterprise_creds_params, sizeof(enterprise_creds_params))) { - LOG_WRN("Set enterprise credentials failed\n"); - return -1; - } - - return 0; -} diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 07514b53a33..346b68e1dae 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -30,10 +30,67 @@ LOG_MODULE_REGISTER(net_wifi_shell, LOG_LEVEL_INF); #include "net_shell_private.h" #include +#if defined CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE || \ + defined CONFIG_WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE +#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES +#include +enum wifi_enterprise_cert_sec_tags { + WIFI_CERT_CA_SEC_TAG = 0x1020001, + WIFI_CERT_CLIENT_KEY_SEC_TAG, + WIFI_CERT_SERVER_KEY_SEC_TAG, + WIFI_CERT_CLIENT_SEC_TAG, + WIFI_CERT_SERVER_SEC_TAG, + /* Phase 2 */ + WIFI_CERT_CA_P2_SEC_TAG, + WIFI_CERT_CLIENT_KEY_P2_SEC_TAG, + WIFI_CERT_CLIENT_P2_SEC_TAG, +}; -#ifdef CONFIG_WIFI_CERTIFICATE_LIB -#include -#endif +struct wifi_cert_data { + enum tls_credential_type type; + uint32_t sec_tag; + uint8_t **data; + size_t *len; +}; +#else +static const char ca_cert_test[] = { + #include + '\0' +}; + +static const char client_cert_test[] = { + #include + '\0' +}; + +static const char client_key_test[] = { + #include + '\0' +}; + +static const char ca_cert2_test[] = { + #include + '\0'}; + +static const char client_cert2_test[] = { + #include + '\0'}; + +static const char client_key2_test[] = { + #include + '\0'}; + +static const char server_cert_test[] = { + #include + '\0' +}; + +static const char server_key_test[] = { + #include + '\0' +}; +#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ #define WIFI_SHELL_MODULE "wifi" @@ -71,6 +128,12 @@ static struct { }; uint8_t all; }; +#if defined CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE || \ + defined CONFIG_WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE +#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES + struct wifi_enterprise_creds_params enterprise_creds_params; +#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ } context; static struct net_mgmt_event_callback wifi_shell_mgmt_cb; @@ -138,6 +201,223 @@ static struct net_if *get_iface(enum iface_type type, int argc, char *argv[]) return iface; } +#if defined CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE || \ + defined CONFIG_WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE +#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES +static int process_certificates(struct wifi_cert_data *certs, size_t cert_count) +{ + for (size_t i = 0; i < cert_count; i++) { + int err; + size_t len = 0; + uint8_t *cert_tmp; + + err = tls_credential_get(certs[i].sec_tag, certs[i].type, NULL, &len); + if (err != -EFBIG) { + LOG_ERR("Failed to get credential tag: %d length, err: %d", + certs[i].sec_tag, err); + return err; + } + + cert_tmp = k_malloc(len); + if (!cert_tmp) { + LOG_ERR("Failed to allocate memory for credential tag: %d", + certs[i].sec_tag); + return -ENOMEM; + } + + err = tls_credential_get(certs[i].sec_tag, certs[i].type, cert_tmp, &len); + if (err) { + LOG_ERR("Failed to get credential tag: %d", certs[i].sec_tag); + k_free(cert_tmp); + return err; + } + + *certs[i].data = cert_tmp; + *certs[i].len = len; + } + + return 0; +} + +static void set_enterprise_creds_params(struct wifi_enterprise_creds_params *params, + bool is_ap) +{ + struct wifi_cert_data certs_common[] = { + { + .type = TLS_CREDENTIAL_CA_CERTIFICATE, + .sec_tag = WIFI_CERT_CA_SEC_TAG, + .data = ¶ms->ca_cert, + .len = ¶ms->ca_cert_len, + }, + }; + + struct wifi_cert_data certs_sta[] = { + { + .type = TLS_CREDENTIAL_PRIVATE_KEY, + .sec_tag = WIFI_CERT_CLIENT_KEY_SEC_TAG, + .data = ¶ms->client_key, + .len = ¶ms->client_key_len, + }, + { + .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, + .sec_tag = WIFI_CERT_CLIENT_SEC_TAG, + .data = ¶ms->client_cert, + .len = ¶ms->client_cert_len, + }, + { + .type = TLS_CREDENTIAL_CA_CERTIFICATE, + .sec_tag = WIFI_CERT_CA_P2_SEC_TAG, + .data = ¶ms->ca_cert2, + .len = ¶ms->ca_cert2_len, + }, + { + .type = TLS_CREDENTIAL_PRIVATE_KEY, + .sec_tag = WIFI_CERT_CLIENT_KEY_P2_SEC_TAG, + .data = ¶ms->client_key2, + .len = ¶ms->client_key2_len, + }, + { + .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, + .sec_tag = WIFI_CERT_CLIENT_P2_SEC_TAG, + .data = ¶ms->client_cert2, + .len = ¶ms->client_cert2_len, + }, + }; + + struct wifi_cert_data certs_ap[] = { + { + .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, + .sec_tag = WIFI_CERT_SERVER_SEC_TAG, + .data = ¶ms->server_cert, + .len = ¶ms->server_cert_len, + }, + { + .type = TLS_CREDENTIAL_PRIVATE_KEY, + .sec_tag = WIFI_CERT_SERVER_KEY_SEC_TAG, + .data = ¶ms->server_key, + .len = ¶ms->server_key_len, + }, + }; + + memset(params, 0, sizeof(*params)); + + /* Process common certificates */ + if (process_certificates(certs_common, ARRAY_SIZE(certs_common)) != 0) { + goto cleanup; + } + + /* Process STA-specific certificates */ + if (!is_ap) { + if (process_certificates(certs_sta, ARRAY_SIZE(certs_sta)) != 0) { + goto cleanup; + } + } + + /* Process AP-specific certificates if is_ap is true */ + if (is_ap) { + if (process_certificates(certs_ap, ARRAY_SIZE(certs_ap)) != 0) { + goto cleanup; + } + } + + memcpy(&context.enterprise_creds_params, params, sizeof(*params)); + return; + +cleanup: + for (size_t i = 0; i < ARRAY_SIZE(certs_common); i++) { + if (certs_common[i].data) { + k_free(*certs_common[i].data); + } + } + + if (!is_ap) { + for (size_t i = 0; i < ARRAY_SIZE(certs_sta); i++) { + if (certs_sta[i].data) { + k_free(*certs_sta[i].data); + } + } + } + + if (is_ap) { + for (size_t i = 0; i < ARRAY_SIZE(certs_ap); i++) { + if (certs_ap[i].data) { + k_free(*certs_ap[i].data); + } + } + } +} + +static void clear_enterprise_creds_params(struct wifi_enterprise_creds_params *params) +{ + size_t i; + + if (!params) { + return; + } + + const uint8_t *certs[] = { + params->ca_cert, + params->client_cert, + params->client_key, + params->server_cert, + params->server_key, + params->ca_cert2, + params->client_cert2, + params->client_key2, + }; + + for (i = 0; i < ARRAY_SIZE(certs); i++) { + k_free((void *)certs[i]); + } + memset(params, 0, sizeof(*params)); +} +#else +static void set_enterprise_creds_params(struct wifi_enterprise_creds_params *params, + bool is_ap) +{ + params->ca_cert = (uint8_t *)ca_cert_test; + params->ca_cert_len = ARRAY_SIZE(ca_cert_test); + + if (!is_ap) { + params->client_cert = (uint8_t *)client_cert_test; + params->client_cert_len = ARRAY_SIZE(client_cert_test); + params->client_key = (uint8_t *)client_key_test; + params->client_key_len = ARRAY_SIZE(client_key_test); + params->ca_cert2 = (uint8_t *)ca_cert2_test; + params->ca_cert2_len = ARRAY_SIZE(ca_cert2_test); + params->client_cert2 = (uint8_t *)client_cert2_test; + params->client_cert2_len = ARRAY_SIZE(client_cert2_test); + params->client_key2 = (uint8_t *)client_key2_test; + params->client_key2_len = ARRAY_SIZE(client_key2_test); + + return; + } + + params->server_cert = (uint8_t *)server_cert_test; + params->server_cert_len = ARRAY_SIZE(server_cert_test); + params->server_key = (uint8_t *)server_key_test; + params->server_key_len = ARRAY_SIZE(server_key_test); +} +#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ + +static int wifi_set_enterprise_creds(const struct shell *sh, struct net_if *iface, + bool is_ap) +{ + struct wifi_enterprise_creds_params params = {0}; + +#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES + clear_enterprise_creds_params(&context.enterprise_creds_params); +#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ + set_enterprise_creds_params(¶ms, is_ap); + if (net_mgmt(NET_REQUEST_WIFI_ENTERPRISE_CREDS, iface, ¶ms, sizeof(params))) { + PR_WARNING("Set enterprise credentials failed\n"); + return -1; + } + + return 0; +} +#endif + static bool parse_number(const struct shell *sh, long *param, char *str, char *pname, long min, long max) { @@ -954,7 +1234,7 @@ static int cmd_wifi_connect(const struct shell *sh, size_t argc, cnx_params.security == WIFI_SECURITY_TYPE_EAP_PEAP_GTC || cnx_params.security == WIFI_SECURITY_TYPE_EAP_TTLS_MSCHAPV2 || cnx_params.security == WIFI_SECURITY_TYPE_EAP_PEAP_TLS) { - wifi_set_enterprise_credentials(iface, 0); + wifi_set_enterprise_creds(sh, iface, 0); } #endif @@ -998,7 +1278,7 @@ static int cmd_wifi_disconnect(const struct shell *sh, size_t argc, #ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES /* Clear the certificates */ - wifi_clear_enterprise_credentials(); + clear_enterprise_creds_params(&context.enterprise_creds_params); #endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ return 0; @@ -2011,7 +2291,7 @@ static int cmd_wifi_ap_disable(const struct shell *sh, size_t argc, #ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES /* Clear the certificates */ - wifi_clear_enterprise_credentials(); + clear_enterprise_creds_params(&context.enterprise_creds_params); #endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ return 0; diff --git a/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c b/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c index 3966a2404bc..c5b8c2a88a3 100644 --- a/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c +++ b/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c @@ -22,15 +22,247 @@ #include -#ifdef CONFIG_WIFI_CERTIFICATE_LIB -#include -#endif - LOG_MODULE_REGISTER(wifi_credentials_shell, CONFIG_WIFI_CREDENTIALS_LOG_LEVEL); #define MAX_BANDS_STR_LEN 64 #define MACSTR "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx" +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE +#ifdef CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES +#include +enum wifi_enterprise_cert_sec_tags { + WIFI_CERT_CA_SEC_TAG = 0x1020001, + WIFI_CERT_CLIENT_KEY_SEC_TAG, + WIFI_CERT_SERVER_KEY_SEC_TAG, + WIFI_CERT_CLIENT_SEC_TAG, + WIFI_CERT_SERVER_SEC_TAG, + /* Phase 2 */ + WIFI_CERT_CA_P2_SEC_TAG, + WIFI_CERT_CLIENT_KEY_P2_SEC_TAG, + WIFI_CERT_CLIENT_P2_SEC_TAG, +}; + +struct wifi_cert_data { + enum tls_credential_type type; + uint32_t sec_tag; + uint8_t **data; + size_t *len; +}; +#else +static const char ca_cert_test[] = { + #include + '\0' +}; + +static const char client_cert_test[] = { + #include + '\0' +}; + +static const char client_key_test[] = { + #include + '\0' +}; + +static const char ca_cert2_test[] = { + #include + '\0'}; + +static const char client_cert2_test[] = { + #include + '\0'}; + +static const char client_key2_test[] = { + #include + '\0'}; +#endif /* CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES */ +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ + +#if defined CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE +#ifdef CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES + +struct wifi_enterprise_creds_params enterprise_creds_params; + +static int process_certificates(struct wifi_cert_data *certs, size_t cert_count) +{ + for (size_t i = 0; i < cert_count; i++) { + int err; + size_t len = 0; + uint8_t *cert_tmp; + + err = tls_credential_get(certs[i].sec_tag, certs[i].type, NULL, &len); + if (err != -EFBIG) { + LOG_ERR("Failed to get credential tag: %d length, err: %d", + certs[i].sec_tag, err); + return err; + } + + cert_tmp = k_malloc(len); + if (!cert_tmp) { + LOG_ERR("Failed to allocate memory for credential tag: %d", + certs[i].sec_tag); + return -ENOMEM; + } + + err = tls_credential_get(certs[i].sec_tag, certs[i].type, cert_tmp, &len); + if (err) { + LOG_ERR("Failed to get credential tag: %d", certs[i].sec_tag); + k_free(cert_tmp); + return err; + } + + *certs[i].data = cert_tmp; + *certs[i].len = len; + } + + return 0; +} + +static void set_enterprise_creds_params(struct wifi_enterprise_creds_params *params, + bool is_ap) +{ + struct wifi_cert_data certs_common[] = { + { + .type = TLS_CREDENTIAL_CA_CERTIFICATE, + .sec_tag = WIFI_CERT_CA_SEC_TAG, + .data = ¶ms->ca_cert, + .len = ¶ms->ca_cert_len, + }, + }; + + struct wifi_cert_data certs_sta[] = { + { + .type = TLS_CREDENTIAL_PRIVATE_KEY, + .sec_tag = WIFI_CERT_CLIENT_KEY_SEC_TAG, + .data = ¶ms->client_key, + .len = ¶ms->client_key_len, + }, + { + .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, + .sec_tag = WIFI_CERT_CLIENT_SEC_TAG, + .data = ¶ms->client_cert, + .len = ¶ms->client_cert_len, + }, + { + .type = TLS_CREDENTIAL_CA_CERTIFICATE, + .sec_tag = WIFI_CERT_CA_P2_SEC_TAG, + .data = ¶ms->ca_cert2, + .len = ¶ms->ca_cert2_len, + }, + { + .type = TLS_CREDENTIAL_PRIVATE_KEY, + .sec_tag = WIFI_CERT_CLIENT_KEY_P2_SEC_TAG, + .data = ¶ms->client_key2, + .len = ¶ms->client_key2_len, + }, + { + .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, + .sec_tag = WIFI_CERT_CLIENT_P2_SEC_TAG, + .data = ¶ms->client_cert2, + .len = ¶ms->client_cert2_len, + }, + }; + + memset(params, 0, sizeof(*params)); + + /* Process common certificates */ + if (process_certificates(certs_common, ARRAY_SIZE(certs_common)) != 0) { + goto cleanup; + } + + /* Process STA-specific certificates */ + if (!is_ap) { + if (process_certificates(certs_sta, ARRAY_SIZE(certs_sta)) != 0) { + goto cleanup; + } + } + + memcpy(&enterprise_creds_params, params, sizeof(*params)); + return; + +cleanup: + for (size_t i = 0; i < ARRAY_SIZE(certs_common); i++) { + if (certs_common[i].data) { + k_free(*certs_common[i].data); + *certs_common[i].data = NULL; + } + } + + if (!is_ap) { + for (size_t i = 0; i < ARRAY_SIZE(certs_sta); i++) { + if (certs_sta[i].data) { + k_free(*certs_sta[i].data); + *certs_sta[i].data = NULL; + } + } + } + +} + +static void clear_enterprise_creds_params(struct wifi_enterprise_creds_params *params) +{ + if (params == NULL) { + return; + } + + const uint8_t *certs[] = { + params->ca_cert, + params->client_cert, + params->client_key, + params->ca_cert2, + params->client_cert2, + params->client_key2, + }; + + for (size_t i = 0; i < ARRAY_SIZE(certs); i++) { + k_free((void *)certs[i]); + } + memset(params, 0, sizeof(*params)); +} +#else +static void set_enterprise_creds_params(struct wifi_enterprise_creds_params *params, + bool is_ap) +{ + params->ca_cert = (uint8_t *)ca_cert_test; + params->ca_cert_len = ARRAY_SIZE(ca_cert_test); + + if (!is_ap) { + params->client_cert = (uint8_t *)client_cert_test; + params->client_cert_len = ARRAY_SIZE(client_cert_test); + params->client_key = (uint8_t *)client_key_test; + params->client_key_len = ARRAY_SIZE(client_key_test); + params->ca_cert2 = (uint8_t *)ca_cert2_test; + params->ca_cert2_len = ARRAY_SIZE(ca_cert2_test); + params->client_cert2 = (uint8_t *)client_cert2_test; + params->client_cert2_len = ARRAY_SIZE(client_cert2_test); + params->client_key2 = (uint8_t *)client_key2_test; + params->client_key2_len = ARRAY_SIZE(client_key2_test); + + return; + } +} +#endif /* CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES */ + +static int wifi_set_enterprise_creds(const struct shell *sh, struct net_if *iface, + bool is_ap) +{ + struct wifi_enterprise_creds_params params = {0}; + +#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES + clear_enterprise_creds_params(&enterprise_creds_params); +#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ + + set_enterprise_creds_params(¶ms, is_ap); + + if (net_mgmt(NET_REQUEST_WIFI_ENTERPRISE_CREDS, iface, ¶ms, sizeof(params))) { + shell_warn(sh, "Set enterprise credentials failed\n"); + return -1; + } + + return 0; +} +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ + static void print_network_info(void *cb_arg, const char *ssid, size_t ssid_len) { int ret = 0; @@ -298,7 +530,7 @@ static int cmd_add_network(const struct shell *sh, size_t argc, char *argv[]) creds.header.type == WIFI_SECURITY_TYPE_EAP_PEAP_GTC || creds.header.type == WIFI_SECURITY_TYPE_EAP_TTLS_MSCHAPV2 || creds.header.type == WIFI_SECURITY_TYPE_EAP_PEAP_TLS) { - wifi_set_enterprise_credentials(iface, 0); + wifi_set_enterprise_creds(sh, iface, 0); } #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ @@ -321,7 +553,7 @@ static int cmd_delete_network(const struct shell *sh, size_t argc, char *argv[]) #ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES /* Clear the certificates */ - wifi_clear_enterprise_credentials(); + clear_enterprise_creds_params(&enterprise_creds_params); #endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ return wifi_credentials_delete_by_ssid(argv[1], strlen(argv[1])); @@ -340,7 +572,7 @@ static int cmd_auto_connect(const struct shell *sh, size_t argc, char *argv[]) struct net_if *iface = net_if_get_wifi_sta(); #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - wifi_set_enterprise_credentials(iface, 0); + wifi_set_enterprise_creds(sh, iface, 0); #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ int rc = net_mgmt(NET_REQUEST_WIFI_CONNECT_STORED, iface, NULL, 0); From d8230b993c965eeed6d3a479da1a693b1e7503c9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 424/881] Revert "[nrf fromlist] modules: hostap: Define dedicated heap for supplicant" This reverts commit c4fd75aff63a850f9e97af5da2b2b101554f0a95. Signed-off-by: Jukka Rissanen --- modules/hostap/Kconfig | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index f900fea0e85..199f38d2386 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -24,24 +24,6 @@ config WIFI_NM_WPA_SUPPLICANT if WIFI_NM_WPA_SUPPLICANT -config WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP - bool "Use Zephyr kernel heap for Wi-Fi driver" - default y - help - Enable this option to use K_HEAP for memory allocations in supplicant. - -if !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP -config WIFI_NM_WPA_SUPPLICANT_HEAP - int "Dedicated memory pool for wpa_supplicant" - def_int 66560 if WIFI_NM_HOSTAPD_AP - def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS - def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP - # 30K is mandatory, but might need more for long duration use cases - def_int 30000 -endif # !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP - -if WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP config HEAP_MEM_POOL_ADD_SIZE_HOSTAP def_int 66560 if WIFI_NM_HOSTAPD_AP def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS @@ -49,8 +31,6 @@ config HEAP_MEM_POOL_ADD_SIZE_HOSTAP def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP # 30K is mandatory, but might need more for long duration use cases def_int 30000 -endif # WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP - config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE int "Stack size for wpa_supplicant thread" From 692e59076ebd93e3f63d59f053d3c668f54892ee Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 425/881] Revert "[nrf fromlist] wifi: Fix fractional part of Tx rate by converting to float" This reverts commit ae694c3e15d6fa771c6303615dab81ae4b4a3a5a. Signed-off-by: Jukka Rissanen --- include/zephyr/net/wifi_mgmt.h | 2 +- subsys/net/l2/wifi/wifi_shell.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 5477b6a3c0e..8c6654f3ef5 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -672,7 +672,7 @@ struct wifi_iface_status { /** is TWT capable? */ bool twt_capable; /** The current 802.11 PHY TX data rate (in Mbps) */ - float current_phy_tx_rate; + int current_phy_tx_rate; }; /** @brief Wi-Fi power save parameters */ diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 346b68e1dae..af0db05855f 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -1484,7 +1484,7 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) PR("DTIM: %d\n", status.dtim_period); PR("TWT: %s\n", status.twt_capable ? "Supported" : "Not supported"); - PR("Current PHY TX rate (Mbps) : %.1f\n", (double)status.current_phy_tx_rate); + PR("Current PHY TX rate (Mbps) : %d\n", status.current_phy_tx_rate); } return 0; From 6c5663db6ac1461ecc849785eebf6cb143d17ec2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 426/881] Revert "[nrf fromtree] hostap: Add CONFIG_HS20 Kconfig for Hotspot 2.0" This reverts commit c5a57b4b22ed8b55093ea43eb97928d461570497. Signed-off-by: Jukka Rissanen --- modules/hostap/Kconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 199f38d2386..2056a43e872 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -564,9 +564,6 @@ config ACS config IEEE80211AC bool -config HS20 - bool - config IEEE80211R bool depends on !WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE From 081ebac0a3ce0e0d0892ea56f6fb436ee96f55a2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 427/881] Revert "[nrf fromlist] nrf_wifi: Fix the DTS compat for nRF71" This reverts commit 96ad8409c0241431894720b6539ee28b63a8f175. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 2 +- modules/nrf_wifi/bus/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 414900f581b..8d414276038 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -6,7 +6,7 @@ # # TODO: Use DTS generated Kconfig once the board support is added -DT_COMPAT_NORDIC_WIFI71 := nordic,nrf7120 +DT_COMPAT_NORDIC_WIFI71 := nordic,wifi71 menuconfig WIFI_NRF70 bool "nRF70 driver" diff --git a/modules/nrf_wifi/bus/Kconfig b/modules/nrf_wifi/bus/Kconfig index 3fed449bb80..fe6b0f34553 100644 --- a/modules/nrf_wifi/bus/Kconfig +++ b/modules/nrf_wifi/bus/Kconfig @@ -10,7 +10,7 @@ DT_COMPAT_NORDIC_NRF7001_QSPI := nordic,nrf7001-qspi DT_COMPAT_NORDIC_NRF7001_SPI := nordic,nrf7001-spi DT_COMPAT_NORDIC_NRF7000_QSPI := nordic,nrf7000-qspi DT_COMPAT_NORDIC_NRF7000_SPI := nordic,nrf7000-spi -DT_COMPAT_NORDIC_WIFI71 := nordic,nrf7120 +DT_COMPAT_NORDIC_WIFI71 := nordic,wifi71 menuconfig NRF70_BUSLIB bool "NRF70 Bus Library" From e84fd1a3088e74fe7423fe61ce16907340fbb56b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 428/881] Revert "[nrf fromtree] drivers: flash: nordic: Introduce nrf_mramc driver" This reverts commit 424e7a54749ab3564bfdbebc24d047294771f087. Signed-off-by: Jukka Rissanen --- drivers/flash/CMakeLists.txt | 1 - drivers/flash/Kconfig | 1 - drivers/flash/Kconfig.nrf_mramc | 26 --- drivers/flash/soc_flash_nrf_mramc.c | 221 ------------------ .../flash_controller/nordic,nrf-mramc.yaml | 16 -- modules/hal_nordic/nrfx/CMakeLists.txt | 1 - modules/hal_nordic/nrfx/Kconfig | 4 - modules/hal_nordic/nrfx/Kconfig.logging | 4 - modules/hal_nordic/nrfx/nrfx_kconfig.h | 7 - 9 files changed, 281 deletions(-) delete mode 100644 drivers/flash/Kconfig.nrf_mramc delete mode 100644 drivers/flash/soc_flash_nrf_mramc.c delete mode 100644 dts/bindings/flash_controller/nordic,nrf-mramc.yaml diff --git a/drivers/flash/CMakeLists.txt b/drivers/flash/CMakeLists.txt index 9c82932b524..b72aa37a360 100644 --- a/drivers/flash/CMakeLists.txt +++ b/drivers/flash/CMakeLists.txt @@ -53,7 +53,6 @@ zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_MAX32 flash_max32.c) zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_MCUX soc_flash_mcux.c) zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NRF soc_flash_nrf.c) zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NRF_MRAM soc_flash_nrf_mram.c) -zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NRF_MRAMC soc_flash_nrf_mramc.c) zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NRF_RRAM soc_flash_nrf_rram.c) zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NUMAKER soc_flash_numaker.c) zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NUMAKER_RMC soc_flash_numaker_rmc.c) diff --git a/drivers/flash/Kconfig b/drivers/flash/Kconfig index 8e18b2deef6..cfa34d3e1c4 100644 --- a/drivers/flash/Kconfig +++ b/drivers/flash/Kconfig @@ -186,7 +186,6 @@ source "drivers/flash/Kconfig.nordic_qspi_nor" source "drivers/flash/Kconfig.npcx_fiu" source "drivers/flash/Kconfig.nrf" source "drivers/flash/Kconfig.nrf_mram" -source "drivers/flash/Kconfig.nrf_mramc" source "drivers/flash/Kconfig.nrf_rram" source "drivers/flash/Kconfig.numaker" source "drivers/flash/Kconfig.numaker_rmc" diff --git a/drivers/flash/Kconfig.nrf_mramc b/drivers/flash/Kconfig.nrf_mramc deleted file mode 100644 index 1637baec896..00000000000 --- a/drivers/flash/Kconfig.nrf_mramc +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config SOC_FLASH_NRF_MRAMC - bool "Nordic Semiconductor flash driver for MRAM using MRAM Controller" - default y - depends on DT_HAS_NORDIC_NRF_MRAMC_ENABLED - select NRFX_MRAMC - select FLASH_HAS_DRIVER_ENABLED - select FLASH_HAS_PAGE_LAYOUT - select FLASH_HAS_NO_EXPLICIT_ERASE - select SOC_FLASH_NRF_MRAMC_FLUSH_CACHE - imply MPU_ALLOW_FLASH_WRITE if ARM_MPU - help - Enables Nordic Semiconductor flash driver for MRAMC in direct write mode. - -config SOC_FLASH_NRF_MRAMC_FLUSH_CACHE - bool "Invalidate MRAM cache after erase operations" - default y - depends on SOC_FLASH_NRF_MRAMC - help - Enables invalidation of the MRAM cache after write and erase operations to - ensure data read consistency. diff --git a/drivers/flash/soc_flash_nrf_mramc.c b/drivers/flash/soc_flash_nrf_mramc.c deleted file mode 100644 index c08f8f32851..00000000000 --- a/drivers/flash/soc_flash_nrf_mramc.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - - #include - - #include - #include - #include - #if defined(CONFIG_SOC_FLASH_NRF_MRAMC_FLUSH_CACHE) - #include - #endif - -LOG_MODULE_REGISTER(flash_nrf_mramc, CONFIG_FLASH_LOG_LEVEL); - -#define DT_DRV_COMPAT nordic_nrf_mramc - -#define _ADD_SIZE(node_id) + DT_REG_SIZE(node_id) -#define _WBS(node_id) DT_PROP(node_id, write_block_size), -#define _EBS(node_id) DT_PROP(node_id, erase_block_size), - -#define MRAM_SIZE (0 DT_INST_FOREACH_CHILD_STATUS_OKAY(0, _ADD_SIZE)) -#define ERASE_VALUE (uint8_t)NRFY_MRAMC_WORD_AFTER_ERASED - -/* Use DT_FOREACH_CHILD_STATUS_OKAY of mramc with _FIRST() helper - * macro to get the write block size and erase block size from - * the first child node. - */ -#define WBS_LIST DT_INST_FOREACH_CHILD_STATUS_OKAY(0, _WBS) -#define EBS_LIST DT_INST_FOREACH_CHILD_STATUS_OKAY(0, _EBS) - -#define _FIRST_HELPER(first, ...) first -#define _FIRST(...) _FIRST_HELPER(__VA_ARGS__) - -#define WRITE_BLOCK_SIZE _FIRST(WBS_LIST) -#define ERASE_BLOCK_SIZE _FIRST(EBS_LIST) - -BUILD_ASSERT((ERASE_BLOCK_SIZE % WRITE_BLOCK_SIZE) == 0, - "erase-block-size expected to be a multiple of write-block-size"); - -/** - * @param[in] addr Address of mram memory. - * @param[in] len Number of bytes for the intended operation. - * @param[in] must_align Require MRAM word alignment, if applicable. - * - * @return true if the address and length are valid, false otherwise. - */ -static bool validate_action(uint32_t addr, size_t len, bool must_align) -{ - if (!nrfx_mramc_valid_address_check(addr, true)) { - LOG_ERR("Invalid address: %x", addr); - return false; - } - - if (!nrfx_mramc_fits_memory_check(addr, true, len)) { - LOG_ERR("Address %x with length %zu exceeds MRAM size", addr, len); - return false; - } - - if (must_align && !(nrfx_is_word_aligned((void const *)addr))) { - LOG_ERR("Address %x is not word aligned", addr); - return false; - } - - return true; -} - -static int nrf_mramc_read(const struct device *dev, off_t offset, void *data, size_t len) -{ - ARG_UNUSED(dev); - uint32_t addr = NRFX_MRAMC_MAP_TO_ADDR(offset); - - if (data == NULL) { - LOG_ERR("Data pointer is NULL"); - return -EINVAL; - } - - /* Validate addr and length in the range */ - if (!validate_action(addr, len, false)) { - return -EINVAL; - } - - LOG_DBG("read: %x:%zu", addr, len); - - /* Buffer read number of bytes and store in data pointer. - */ - nrfx_mramc_buffer_read(data, addr, len); - return 0; -} - -static int nrf_mramc_write(const struct device *dev, off_t offset, - const void *data, size_t len) -{ - ARG_UNUSED(dev); - uint32_t addr = NRFX_MRAMC_MAP_TO_ADDR(offset); - - if (data == NULL) { - LOG_ERR("Data pointer is NULL"); - return -EINVAL; - } - - /* Validate addr and length in the range */ - if (!validate_action(addr, len, true)) { - return -EINVAL; - } - - LOG_DBG("write: %x:%zu", addr, len); - - /* Words write function takes second argument as number of write blocks - * and not number of bytes - */ - nrfx_mramc_words_write(addr, data, len / WRITE_BLOCK_SIZE); -#if defined(CONFIG_SOC_FLASH_NRF_MRAMC_FLUSH_CACHE) - if (nrf_cache_enable_check(NRF_ICACHE)) { - while (nrf_cache_busy_check(NRF_ICACHE)) { - } - nrf_cache_invalidate(NRF_ICACHE); - } -#endif - return 0; -} - -static int nrf_mramc_erase(const struct device *dev, off_t offset, size_t size) -{ - ARG_UNUSED(dev); - uint32_t addr = NRFX_MRAMC_MAP_TO_ADDR(offset); - - /* Validate addr and length in the range */ - if (size == 0) { - LOG_DBG("No data to erase"); - return 0; - } - - if (!validate_action(addr, size, true)) { - return -EINVAL; - } - - LOG_DBG("erase: %p:%zu", (void *)addr, size); - - /* Erase function takes second argument as number of write blocks - * and not number of bytes - */ - nrfx_mramc_area_erase(addr, size / WRITE_BLOCK_SIZE); -#if defined(CONFIG_SOC_FLASH_NRF_MRAMC_FLUSH_CACHE) - if (nrf_cache_enable_check(NRF_ICACHE)) { - while (nrf_cache_busy_check(NRF_ICACHE)) { - } - nrf_cache_invalidate(NRF_ICACHE); - } -#endif - return 0; -} - -static int nrf_mramc_get_size(const struct device *dev, uint64_t *size) -{ - ARG_UNUSED(dev); - *size = nrfx_mramc_memory_size_get(); - return 0; -} - -static const struct flash_parameters *nrf_mramc_get_parameters(const struct device *dev) -{ - ARG_UNUSED(dev); - - static const struct flash_parameters parameters = { - .write_block_size = WRITE_BLOCK_SIZE, - .erase_value = ERASE_VALUE, - .caps = { - .no_explicit_erase = true, - }, - }; - - return ¶meters; -} - -#if defined(CONFIG_FLASH_PAGE_LAYOUT) -static void nrf_mramc_page_layout(const struct device *dev, - const struct flash_pages_layout **layout, size_t *layout_size) -{ - ARG_UNUSED(dev); - - static const struct flash_pages_layout pages_layout = { - .pages_count = MRAM_SIZE / (ERASE_BLOCK_SIZE), - .pages_size = ERASE_BLOCK_SIZE, - }; - - *layout = &pages_layout; - *layout_size = 1; -} -#endif - -static int mramc_sys_init(const struct device *dev) -{ - ARG_UNUSED(dev); - - nrfx_mramc_config_t config = NRFX_MRAMC_DEFAULT_CONFIG(); - nrfx_err_t err = nrfx_mramc_init(&config, NULL); - - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize MRAMC: %d", err); - return -EIO; - } - LOG_DBG("MRAMC initialized successfully"); - return 0; -} - -static DEVICE_API(flash, nrf_mram_api) = { - .read = nrf_mramc_read, - .write = nrf_mramc_write, - .erase = nrf_mramc_erase, - .get_size = nrf_mramc_get_size, - .get_parameters = nrf_mramc_get_parameters, -#if defined(CONFIG_FLASH_PAGE_LAYOUT) - .page_layout = nrf_mramc_page_layout, -#endif -}; - -DEVICE_DT_INST_DEFINE(0, mramc_sys_init, NULL, NULL, NULL, POST_KERNEL, CONFIG_FLASH_INIT_PRIORITY, - &nrf_mram_api); diff --git a/dts/bindings/flash_controller/nordic,nrf-mramc.yaml b/dts/bindings/flash_controller/nordic,nrf-mramc.yaml deleted file mode 100644 index 0afef7563b3..00000000000 --- a/dts/bindings/flash_controller/nordic,nrf-mramc.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -description: | - Nordic MRAMC (Magnetoresistive Random Access Memory Controller) - - The Magnetoresistive random access memory controller (MRAMC) is used for writing - the internal MRAM memory, the secure information configuration registers (SICR), - and the user information configuration registers (UICR). - -compatible: "nordic,nrf-mramc" - -include: base.yaml diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 35c46e235f2..1d18d708d74 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -135,7 +135,6 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_GRTC ${SRC_DIR}/nrfx_grtc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_I2S ${SRC_DIR}/nrfx_i2s.c) zephyr_library_sources_ifdef(CONFIG_NRFX_IPC ${SRC_DIR}/nrfx_ipc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_LPCOMP ${SRC_DIR}/nrfx_lpcomp.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_MRAMC ${SRC_DIR}/nrfx_mramc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_NFCT ${SRC_DIR}/nrfx_nfct.c) zephyr_library_sources_ifdef(CONFIG_NRFX_NVMC ${SRC_DIR}/nrfx_nvmc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PDM ${SRC_DIR}/nrfx_pdm.c) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index b918a2023c3..80610599e60 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -265,10 +265,6 @@ config NRFX_LPCOMP bool "LPCOMP driver" depends on $(dt_nodelabel_exists,comp) && !SOC_NRF52810 && !SOC_NRF52811 && !SOC_NRF52820 -config NRFX_MRAMC - bool "MRAMC driver" - depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_MRAMC)) - config NRFX_NFCT bool "NFCT driver" depends on $(dt_nodelabel_exists,nfct) diff --git a/modules/hal_nordic/nrfx/Kconfig.logging b/modules/hal_nordic/nrfx/Kconfig.logging index 322660f40d1..2bf24721880 100644 --- a/modules/hal_nordic/nrfx/Kconfig.logging +++ b/modules/hal_nordic/nrfx/Kconfig.logging @@ -44,10 +44,6 @@ config NRFX_LPCOMP_LOG bool "LPCOMP driver logging" depends on NRFX_LPCOMP -config NRFX_MRAMC_LOG - bool "MRAMC driver logging" - depends on NRFX_MRAMC - config NRFX_NFCT_LOG bool "NFCT driver logging" depends on NRFX_NFCT diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 5aa856f2299..191855b3ff0 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -239,13 +239,6 @@ #define NRFX_LPCOMP_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_MRAMC -#define NRFX_MRAMC_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_MRAMC_LOG -#define NRFX_MRAMC_CONFIG_LOG_ENABLED 1 -#endif - #ifdef CONFIG_NRFX_NFCT #define NRFX_NFCT_ENABLED 1 #endif From dd86f5ae1b26522cde55739f0529d86210562df1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 429/881] Revert "[nrf fromtree] tests: kernel: timer: timer_behavior: Fix max_stddev calculation" This reverts commit aa5352afba7a4843dbb0f9f36974d5b30ad850a1. Signed-off-by: Jukka Rissanen --- tests/kernel/timer/timer_behavior/src/jitter_drift.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/kernel/timer/timer_behavior/src/jitter_drift.c b/tests/kernel/timer/timer_behavior/src/jitter_drift.c index c3e06b02468..82e178fb602 100644 --- a/tests/kernel/timer/timer_behavior/src/jitter_drift.c +++ b/tests/kernel/timer/timer_behavior/src/jitter_drift.c @@ -237,8 +237,8 @@ static void do_test_using(void (*sample_collection_fn)(void), const char *mechan - expected_time_drift_us; double time_diff_us_abs = time_diff_us >= 0.0 ? time_diff_us : -time_diff_us; - /* If max stddev is lower than a single clock tick then round it up. */ - uint32_t max_stddev = MAX(k_ticks_to_us_ceil32(1), CONFIG_TIMER_TEST_MAX_STDDEV); + /* If max stddev is lower than a single clock cycle then round it up. */ + uint32_t max_stddev = MAX(k_cyc_to_us_ceil32(1), CONFIG_TIMER_TEST_MAX_STDDEV); TC_PRINT("timer clock rate %u, kernel tick rate %d\n", sys_clock_hw_cycles_per_sec(), CONFIG_SYS_CLOCK_TICKS_PER_SEC); From ed30845776e5c0c868cb91cab6b20bf50386a899 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 430/881] Revert "[nrf fromtree] tests: drivers: clock_control: Cleanup after nRF54LM20 rename" This reverts commit 00bd8639325531cb110d9469bc31fff8147c428c. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_cpuapp.conf | 1 + .../clock_control/clock_control_api/testcase.yaml | 2 ++ .../clock_control/nrf_clock_calibration/testcase.yaml | 2 +- .../clock_control/nrf_lf_clock_start/testcase.yaml | 9 ++++++++- tests/drivers/clock_control/onoff/testcase.yaml | 2 +- 5 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 tests/drivers/clock_control/clock_control_api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf diff --git a/tests/drivers/clock_control/clock_control_api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf b/tests/drivers/clock_control/clock_control_api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf new file mode 100644 index 00000000000..11d42321cbc --- /dev/null +++ b/tests/drivers/clock_control/clock_control_api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_TEST_NRF_HF_STARTUP_TIME_US=1000 diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index 4a192e5e3a7..98f8920e162 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -23,6 +23,7 @@ tests: - nrf9160dk/nrf9160 - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -34,6 +35,7 @@ tests: - nrf52840dk/nrf52840 - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index 4600202f0f1..3cdc785cbc7 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -1,6 +1,5 @@ tests: drivers.clock.nrf5_clock_calibration: - timeout: 30 tags: - drivers - clock_control @@ -10,6 +9,7 @@ tests: - nrf52840dk/nrf52840 - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index 2a4bba57a71..94cc046d696 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -4,7 +4,6 @@ common: - clock_control integration_platforms: - nrf51dk/nrf51822 - timeout: 30 tests: drivers.clock.nrf_lf_clock_start_xtal_stable: platform_allow: @@ -16,6 +15,7 @@ tests: - nrf5340dk/nrf5340/cpunet - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -34,6 +34,7 @@ tests: - nrf5340dk/nrf5340/cpunet - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -67,6 +68,7 @@ tests: - nrf5340dk/nrf5340/cpunet - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -84,6 +86,7 @@ tests: - nrf5340dk/nrf5340/cpunet - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -101,6 +104,7 @@ tests: - nrf5340dk/nrf5340/cpunet - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -118,6 +122,7 @@ tests: - nrf5340dk/nrf5340/cpunet - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -135,6 +140,7 @@ tests: - nrf5340dk/nrf5340/cpunet - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -152,6 +158,7 @@ tests: - nrf5340dk/nrf5340/cpunet - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index c26eeca5e3d..51c263dad29 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -9,9 +9,9 @@ tests: - nrf52840dk/nrf52840 - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 - timeout: 30 From 29b436ee4bb61df57e2249d61d2462690f393d86 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 431/881] Revert "[nrf fromtree] tests: subsys: fs: fcb: Cleanup after nRF54LM20 rename" This reverts commit 87b5ed75aa56c17bf53178e58aa0eb05600df061. Signed-off-by: Jukka Rissanen --- tests/subsys/fs/fcb/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/subsys/fs/fcb/testcase.yaml b/tests/subsys/fs/fcb/testcase.yaml index c915dd56840..bd5067eccce 100644 --- a/tests/subsys/fs/fcb/testcase.yaml +++ b/tests/subsys/fs/fcb/testcase.yaml @@ -14,6 +14,7 @@ tests: platform_allow: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp - native_sim From 65e81313963fe21564f738adec8eda286ba0018c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 432/881] Revert "[nrf fromtree] tests: kernel: timer: timer_behavior: Cleanup after nRF54LM20 rename" This reverts commit 3c191f9f52ef07855029ccb2153a7cdfbf60f870. Signed-off-by: Jukka Rissanen --- .../timer/timer_behavior/boards/nrf54l20pdk_nrf54l20_cpuapp.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/kernel/timer/timer_behavior/boards/nrf54l20pdk_nrf54l20_cpuapp.conf diff --git a/tests/kernel/timer/timer_behavior/boards/nrf54l20pdk_nrf54l20_cpuapp.conf b/tests/kernel/timer/timer_behavior/boards/nrf54l20pdk_nrf54l20_cpuapp.conf new file mode 100644 index 00000000000..4b13bc80c7f --- /dev/null +++ b/tests/kernel/timer/timer_behavior/boards/nrf54l20pdk_nrf54l20_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_SYS_CLOCK_TICKS_PER_SEC=10000 From a60100c9a4f12c5c21cce747b285ef5615b9a547 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 433/881] Revert "[nrf fromtree] tests: drivers: watchodg: Cleanup after nRF54LM20 rename" This reverts commit a3ec88e69598522ba08afcf25547c25516001e69. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_cpuapp.overlay | 9 +++++++++ .../boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay} | 0 .../boards/nrf54l20pdk_nrf54l20_cpuapp.overlay | 9 +++++++++ tests/drivers/watchdog/wdt_error_cases/testcase.yaml | 5 +++-- .../boards/nrf54l20pdk_nrf54l20_cpuapp.overlay | 9 +++++++++ tests/drivers/watchdog/wdt_variables/testcase.yaml | 2 +- 6 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay rename tests/drivers/watchdog/{wdt_variables/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay => wdt_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay} (100%) create mode 100644 tests/drivers/watchdog/wdt_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay create mode 100644 tests/drivers/watchdog/wdt_variables/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..8d3dce3b380 --- /dev/null +++ b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/tests/drivers/watchdog/wdt_variables/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay similarity index 100% rename from tests/drivers/watchdog/wdt_variables/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay rename to tests/drivers/watchdog/wdt_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay diff --git a/tests/drivers/watchdog/wdt_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/watchdog/wdt_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..8d3dce3b380 --- /dev/null +++ b/tests/drivers/watchdog/wdt_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/tests/drivers/watchdog/wdt_error_cases/testcase.yaml b/tests/drivers/watchdog/wdt_error_cases/testcase.yaml index f8da32ca72d..951afe9034e 100644 --- a/tests/drivers/watchdog/wdt_error_cases/testcase.yaml +++ b/tests/drivers/watchdog/wdt_error_cases/testcase.yaml @@ -10,10 +10,11 @@ tests: platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54l09pdk/nrf54l09/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad - nrf9280pdk/nrf9280/cpuapp - nrf9280pdk/nrf9280/cpurad - ophelia4ev/nrf54l15/cpuapp diff --git a/tests/drivers/watchdog/wdt_variables/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/watchdog/wdt_variables/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..dc1ea1a9ddc --- /dev/null +++ b/tests/drivers/watchdog/wdt_variables/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/tests/drivers/watchdog/wdt_variables/testcase.yaml b/tests/drivers/watchdog/wdt_variables/testcase.yaml index b504cb5b6b8..d033e4f255e 100644 --- a/tests/drivers/watchdog/wdt_variables/testcase.yaml +++ b/tests/drivers/watchdog/wdt_variables/testcase.yaml @@ -16,8 +16,8 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp From 5dd255487582ae220a3297b6f2e43c887de58e88 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 434/881] Revert "[nrf fromtree] tests: drivers: uart: uart_errors: Cleanup after nRF54LM20 rename" This reverts commit 35f8205ac7fc9d506f1bbcdae6dbfec3e655cdd7. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 54 +++++++++++++++++++ tests/drivers/uart/uart_errors/testcase.yaml | 3 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/uart/uart_errors/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/uart/uart_errors/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/uart/uart_errors/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..babbc740133 --- /dev/null +++ b/tests/drivers/uart/uart_errors/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + uart22_default: uart22_default { + group1 { + psels = + ; + bias-pull-up; + }; + group2 { + psels = ; + }; + }; + + uart22_sleep: uart22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; +}; + +dut_aux: &uart22 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart22_default>; + pinctrl-1 = <&uart22_sleep>; + pinctrl-names = "default", "sleep"; + disable-rx; +}; diff --git a/tests/drivers/uart/uart_errors/testcase.yaml b/tests/drivers/uart/uart_errors/testcase.yaml index c17f071b853..522935adcca 100644 --- a/tests/drivers/uart/uart_errors/testcase.yaml +++ b/tests/drivers/uart/uart_errors/testcase.yaml @@ -6,13 +6,13 @@ common: harness: ztest harness_config: fixture: gpio_loopback - timeout: 30 tests: drivers.uart.uart_errors.int_driven: filter: CONFIG_SERIAL_SUPPORT_INTERRUPT platform_allow: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -21,6 +21,7 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp From 959e41ed22698565a44c40d9dde1ffa18a59fd17 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 435/881] Revert "[nrf fromtree] tests: drivers: uart: uart_elementary: Cleanup after nRF54LM20 rename" This reverts commit 2b3435759b7c0fdf036c5b8deea3645429e59f7f. Signed-off-by: Jukka Rissanen --- ...54l15dk_nrf54l15_cpuapp_dual_uart.overlay} | 0 ...54l15dk_nrf54l15_cpuflpr_dual_uart.overlay | 51 ++++++++++++++ .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 31 ++++++++ .../nrf54l20pdk_nrf54l20_cpuflpr.overlay | 31 ++++++++ .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 7 -- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 2 - .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 2 - .../nrf54lm20dk_nrf54lm20a_dual_uart.overlay | 7 -- .../uart/uart_elementary/testcase.yaml | 70 ++++++++++++------- 9 files changed, 156 insertions(+), 45 deletions(-) rename tests/drivers/uart/uart_elementary/boards/{nrf54l15dk_nrf54l15_dual_uart.overlay => nrf54l15dk_nrf54l15_cpuapp_dual_uart.overlay} (100%) create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuflpr_dual_uart.overlay create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuapp_dual_uart.overlay similarity index 100% rename from tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_dual_uart.overlay rename to tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuapp_dual_uart.overlay diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuflpr_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuflpr_dual_uart.overlay new file mode 100644 index 00000000000..2031f7a2444 --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf54l15dk_nrf54l15_cpuflpr_dual_uart.overlay @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + uart22_default: uart22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + uart22_sleep: uart22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; +}; + +dut_aux: &uart22 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart22_default>; + pinctrl-1 = <&uart22_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..cf481b7a161 --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay new file mode 100644 index 00000000000..cf481b7a161 --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20_common.dtsi index 33d060d30ce..dd9f0b93be0 100644 --- a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -1,10 +1,3 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/* Test requires loopbacks: - * P1.13 - P1.14 - * P1.23 - P1.24 - */ - &pinctrl { uart21_default: uart21_default { group1 { diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 03676317e38..5210e41ef55 100644 --- a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,3 +1 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - #include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay index 03676317e38..5210e41ef55 100644 --- a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay @@ -1,3 +1 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - #include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay index 72e7e968d0b..0dcede29d92 100644 --- a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay +++ b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay @@ -1,10 +1,3 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/* Test requires loopbacks: - * P1.13 - P1.14 - * P1.23 - P1.24 - */ - &pinctrl { uart21_default: uart21_default { group1 { diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index de3d18a50ee..83aba78e828 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -15,7 +15,9 @@ tests: - nrf54l09pdk/nrf54l09/cpuflpr - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54l20pdk/nrf54l20/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -55,45 +57,59 @@ tests: drivers.uart.uart_elementary_dual_nrf54l: filter: CONFIG_SERIAL_SUPPORT_INTERRUPT platform_allow: - - nrf54l09pdk/nrf54l09/cpuapp - - nrf54l09pdk/nrf54l09/cpuflpr - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - ophelia4ev/nrf54l15/cpuapp - - ophelia4ev/nrf54l15/cpuflpr - extra_args: - - platform:nrf54l09pdk/nrf54l09/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l09pdk_nrf54l09_dual_uart.overlay" - - platform:nrf54l09pdk/nrf54l09/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l09pdk_nrf54l09_dual_uart.overlay" - - platform:nrf54l15dk/nrf54l15/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - - platform:nrf54l15dk/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - - platform:nrf54lm20dk/nrf54lm20a/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - - platform:nrf54lm20dk/nrf54lm20a/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - - platform:ophelia4ev/nrf54l15/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - - platform:ophelia4ev/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" + extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_dual_uart.overlay" extra_configs: - CONFIG_DUAL_UART_TEST=y drivers.uart.uart_elementary_dual_setup_mismatch_nrf54l: filter: CONFIG_SERIAL_SUPPORT_INTERRUPT platform_allow: - - nrf54l09pdk/nrf54l09/cpuapp - - nrf54l09pdk/nrf54l09/cpuflpr - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - ophelia4ev/nrf54l15/cpuapp + extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_dual_uart.overlay" + extra_configs: + - CONFIG_DUAL_UART_TEST=y + - CONFIG_SETUP_MISMATCH_TEST=y + drivers.uart.uart_elementary_dual_nrf54l_cpuflpr: + filter: CONFIG_SERIAL_SUPPORT_INTERRUPT + platform_allow: + - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l20pdk/nrf54l20/cpuflpr + - nrf54lm20dk/nrf54lm20a/cpuflpr + - ophelia4ev/nrf54l15/cpuflpr + extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_dual_uart.overlay" + extra_configs: + - CONFIG_DUAL_UART_TEST=y + drivers.uart.uart_elementary_dual_setup_mismatch_nrf54l_cpuflpr: + filter: CONFIG_SERIAL_SUPPORT_INTERRUPT + platform_allow: + - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l20pdk/nrf54l20/cpuflpr + - nrf54lm20dk/nrf54lm20a/cpuflpr - ophelia4ev/nrf54l15/cpuflpr - extra_args: - - platform:nrf54l09pdk/nrf54l09/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l09pdk_nrf54l09_dual_uart.overlay" - - platform:nrf54l09pdk/nrf54l09/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l09pdk_nrf54l09_dual_uart.overlay" - - platform:nrf54l15dk/nrf54l15/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - - platform:nrf54l15dk/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - - platform:nrf54lm20dk/nrf54lm20a/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - - platform:nrf54lm20dk/nrf54lm20a/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - - platform:ophelia4ev/nrf54l15/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - - platform:ophelia4ev/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" + extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_dual_uart.overlay" + extra_configs: + - CONFIG_DUAL_UART_TEST=y + - CONFIG_SETUP_MISMATCH_TEST=y + drivers.uart.uart_elementary_dual_nrf54l09: + filter: CONFIG_SERIAL_SUPPORT_INTERRUPT + platform_allow: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l09pdk/nrf54l09/cpuflpr + extra_args: DTC_OVERLAY_FILE="boards/nrf54l09pdk_nrf54l09_dual_uart.overlay" + extra_configs: + - CONFIG_DUAL_UART_TEST=y + drivers.uart.uart_elementary_dual_setup_mismatch_nrf54l09: + filter: CONFIG_SERIAL_SUPPORT_INTERRUPT + platform_allow: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l09pdk/nrf54l09/cpuflpr + extra_args: DTC_OVERLAY_FILE="boards/nrf54l09pdk_nrf54l09_dual_uart.overlay" extra_configs: - CONFIG_DUAL_UART_TEST=y - CONFIG_SETUP_MISMATCH_TEST=y From 0c08787fed75c0bc584b7faa7d1593d44c8d1418 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 436/881] Revert "[nrf fromtree] tests: drivers: uart: uart_async_api: Cleanup after nRF54LM20 rename" This reverts commit 7ef16031c7ea9b925876bfff45746859f3927b79. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 26 ++++++++++++ .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 6 --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - ...f54lm20dk_nrf54lm20a_cpuapp_uart00.overlay | 42 ------------------- .../drivers/uart/uart_async_api/testcase.yaml | 8 ---- 5 files changed, 26 insertions(+), 57 deletions(-) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..ed4a2de1891 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&pinctrl { + uart21_default_alt: uart21_default_alt { + group1 { + psels = , + ; + }; + }; + + uart21_sleep_alt: uart21_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + pinctrl-0 = <&uart21_default_alt>; + pinctrl-1 = <&uart21_sleep_alt>; + pinctrl-names = "default", "sleep"; + current-speed = <115200>; +}; diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi index 8a8a0363b65..ec39ed93ecf 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - /* Test requires following loopback: * P1.13 - P1.14 */ diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index d70069646c9..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay deleted file mode 100644 index 5f129663e55..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopback: - * P2.02 - P2.00 - */ - -&pinctrl { - uart00_default_alt: uart00_default_alt { - group1 { - psels = ; - }; - - group2 { - psels = ; - bias-pull-up; - }; - }; - - uart00_sleep_alt: uart00_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart00 { - status = "okay"; - pinctrl-0 = <&uart00_default_alt>; - pinctrl-1 = <&uart00_sleep_alt>; - pinctrl-names = "default", "sleep"; - current-speed = <4000000>; -}; - -&gpio2 { - status = "okay"; -}; diff --git a/tests/drivers/uart/uart_async_api/testcase.yaml b/tests/drivers/uart/uart_async_api/testcase.yaml index 3e6c28ddd39..efcf3af9453 100644 --- a/tests/drivers/uart/uart_async_api/testcase.yaml +++ b/tests/drivers/uart/uart_async_api/testcase.yaml @@ -18,14 +18,6 @@ tests: - platform:mimxrt685_evk/mimxrt685s/cm33:"DTC_OVERLAY_FILE=nxp/dut_flexcomm4.overlay" - platform:mimxrt595_evk/mimxrt595s/cm33:"DTC_OVERLAY_FILE=nxp/dut_flexcomm12.overlay" - platform:frdm_rw612/rw612:"DTC_OVERLAY_FILE=nxp/dut_lpc_flexcomm0.overlay" - drivers.uart.async_api.fast: - harness: ztest - harness_config: - fixture: uart_fast_loopback - platform_allow: - - nrf54lm20dk/nrf54lm20a/cpuapp - extra_args: - - DTC_OVERLAY_FILE="boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay" drivers.uart.wide: filter: CONFIG_SERIAL_SUPPORT_ASYNC and not CONFIG_UART_MCUX_LPUART harness: ztest From 465ffa9822a7d8c465702acbe4b1dc7f14bb384a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:20 +0300 Subject: [PATCH 437/881] Revert "[nrf fromtree] tests: drivers: uart: async_api: update wba55cg clock frequency" This reverts commit a835e255dbba7ab851e96432b55413f56c5a0c74. Signed-off-by: Jukka Rissanen --- .../uart/uart_async_api/boards/nucleo_wba55cg.overlay | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/drivers/uart/uart_async_api/boards/nucleo_wba55cg.overlay b/tests/drivers/uart/uart_async_api/boards/nucleo_wba55cg.overlay index df1b3856c1a..9fc34bb26a2 100644 --- a/tests/drivers/uart/uart_async_api/boards/nucleo_wba55cg.overlay +++ b/tests/drivers/uart/uart_async_api/boards/nucleo_wba55cg.overlay @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -&rcc { - clocks = <&clk_hsi>; - clock-frequency = ; -}; - dut: &lpuart1 { dmas = <&gpdma1 0 16 STM32_DMA_PERIPH_TX &gpdma1 1 15 STM32_DMA_PERIPH_RX>; From 4af8dc7ecd993846223d575f0f5f0082bc5cb0dd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 438/881] Revert "[nrf fromtree] tests: drivers: uart_async_api: add tx buffer in nocache memory" This reverts commit 33d8754094c1c047300546f2a3bdb2f9bf32f1b1. Signed-off-by: Jukka Rissanen --- tests/drivers/uart/uart_async_api/src/test_uart_async.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/drivers/uart/uart_async_api/src/test_uart_async.c b/tests/drivers/uart/uart_async_api/src/test_uart_async.c index 936600c96fc..4feec039001 100644 --- a/tests/drivers/uart/uart_async_api/src/test_uart_async.c +++ b/tests/drivers/uart/uart_async_api/src/test_uart_async.c @@ -1068,12 +1068,7 @@ static void *var_buf_length_setup(void) static void test_uart_async_var_buf(size_t buf_len, size_t tx_len) { int ret; - -#if NOCACHE_MEM -static __aligned(sizeof(void *)) uint8_t tx_buffer[VAR_LENGTH_TX_BUF_SIZE] __used __NOCACHE; -#else -static ZTEST_BMEM uint8_t tx_buffer[VAR_LENGTH_TX_BUF_SIZE]; -#endif /* NOCACHE_MEM */ + uint8_t tx_buffer[VAR_LENGTH_TX_BUF_SIZE]; for (size_t i = 0; i < VAR_LENGTH_TX_BUF_SIZE; ++i) { tx_buffer[i] = tx_len; From e633222cdedcdae4121c1d625c46b885f0eb49c7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 439/881] Revert "[nrf fromtree] tests: drivers: uart: Add support test uart_async for ek_ra8p1" This reverts commit cb99f75b590c542056fa95e10a9d4d548a0b5542. Signed-off-by: Jukka Rissanen --- .../ek_ra8p1_r7ka8p1kflcac_cm85.overlay | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay b/tests/drivers/uart/uart_async_api/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay deleted file mode 100644 index ac9bd7768dd..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - sci2_default: sci2_default { - group1 { - /* tx */ - psels = ; - drive-strength = "medium"; - }; - - group2 { - /* rx */ - psels = ; - }; - }; -}; - -&sci2 { - interrupts = <30 1>, <31 1>, <32 1>, <33 1>; - interrupt-names = "rxi", "txi", "tei", "eri"; - pinctrl-0 = <&sci2_default>; - pinctrl-names = "default"; - status = "okay"; - - dut: uart { - current-speed = <115200>; - status = "okay"; - }; -}; From f12c9f56b6676e868700498d2c65e902417b86be Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 440/881] Revert "[nrf fromtree] tests: drivers: uart: async_api: add stm32u3 boards overlays" This reverts commit 276b5c7731a477e390486cb57d97b75b5303c00a. Signed-off-by: Jukka Rissanen --- .../uart_async_api/boards/nucleo_u385rg_q.overlay | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nucleo_u385rg_q.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nucleo_u385rg_q.overlay b/tests/drivers/uart/uart_async_api/boards/nucleo_u385rg_q.overlay deleted file mode 100644 index 87bd131e1ca..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/nucleo_u385rg_q.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 STMicroelectronics - * - * SPDX-License-Identifier: Apache-2.0 - */ - -dut: &lpuart1 { - dmas = <&gpdma1 0 35 STM32_DMA_PERIPH_TX - &gpdma1 1 34 STM32_DMA_PERIPH_RX>; - dma-names = "tx", "rx"; -}; - -&gpdma1 { - status = "okay"; -}; From 12144ffb10defef750b15e129201ea93de4f0a19 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 441/881] Revert "[nrf fromtree] tests: drivers: uart: async_api: Fix chain write" This reverts commit 097c8a28d1888f416411c9948d67806960d4fd93. Signed-off-by: Jukka Rissanen --- tests/drivers/uart/uart_async_api/src/test_uart_async.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/drivers/uart/uart_async_api/src/test_uart_async.c b/tests/drivers/uart/uart_async_api/src/test_uart_async.c index 4feec039001..e0861656643 100644 --- a/tests/drivers/uart/uart_async_api/src/test_uart_async.c +++ b/tests/drivers/uart/uart_async_api/src/test_uart_async.c @@ -17,7 +17,7 @@ #define NOCACHE_MEM 0 #endif /* CONFIG_NOCACHE_MEMORY */ -K_SEM_DEFINE(tx_done, 0, 2); +K_SEM_DEFINE(tx_done, 0, 1); K_SEM_DEFINE(tx_aborted, 0, 1); K_SEM_DEFINE(rx_rdy, 0, 1); K_SEM_DEFINE(rx_buf_coherency, 0, 255); @@ -833,8 +833,8 @@ static void test_chained_write_callback(const struct device *dev, switch (evt->type) { case UART_TX_DONE: if (chained_write_next_buf) { - chained_write_next_buf = false; uart_tx(dev, chained_write_tx_bufs[1], 10, 100 * USEC_PER_MSEC); + chained_write_next_buf = false; } tx_sent = 1; k_sem_give(&tx_done); From 5b8f9a7c698e5a2f72fbd6ce8bfe3bbecaec5f3b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 442/881] Revert "[nrf fromtree] tests: drivers: spi: spi_loopback: Cleanup after nRF54LM20 rename" This reverts commit 90758227e5cb1fd6bc8a07c714b871ec9bfb9d61. Signed-off-by: Jukka Rissanen --- ...ay => nrf54l20pdk_nrf54l20_cpuapp.overlay} | 26 ++++++------------- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 2 -- tests/drivers/spi/spi_loopback/testcase.yaml | 15 +++++------ 4 files changed, 15 insertions(+), 29 deletions(-) rename tests/drivers/spi/spi_loopback/boards/{nrf54lm20dk_nrf54lm20a_cpuapp_spi00.overlay => nrf54l20pdk_nrf54l20_cpuapp.overlay} (59%) delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp_spi00.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay similarity index 59% rename from tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp_spi00.overlay rename to tests/drivers/spi/spi_loopback/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay index 2d1015eaf24..48840969d8e 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp_spi00.overlay +++ b/tests/drivers/spi/spi_loopback/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -4,28 +4,20 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* Test requires following loopback: - * P2.02 - P2.04 - */ - &pinctrl { spi00_default: spi00_default { group1 { - psels = ; - }; - - group2 { - psels = , - ; - nordic,drive-mode = ; + psels = , + , + ; }; }; spi00_sleep: spi00_sleep { group1 { - psels = , - , - ; + psels = , + , + ; low-power-enable; }; }; @@ -38,17 +30,15 @@ pinctrl-names = "default", "sleep"; overrun-character = <0x00>; zephyr,pm-device-runtime-auto; - slow@0 { compatible = "test-spi-loopback-slow"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; - dut_fast: fast@0 { compatible = "test-spi-loopback-fast"; reg = <0>; - spi-max-frequency = ; + spi-max-frequency = ; }; }; diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index ad922ab8d26..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 1dcb91c0f5b..d6e037cdbdf 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -34,13 +34,11 @@ pinctrl-names = "default", "sleep"; overrun-character = <0x00>; zephyr,pm-device-runtime-auto; - slow@0 { compatible = "test-spi-loopback-slow"; reg = <0>; spi-max-frequency = ; }; - dut_fast: fast@0 { compatible = "test-spi-loopback-fast"; reg = <0>; diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index 746cc03c81a..e64aa8cdbf3 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -238,6 +238,8 @@ tests: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_1mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp harness: console harness_config: fixture: spi_loopback @@ -248,26 +250,23 @@ tests: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_8mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_16mhz: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_16mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_32mhz: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_32mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - ophelia4ev/nrf54l15/cpuapp - drivers.spi.nrf54lm20_16mhz_32mhz: - harness: ztest - harness_config: - fixture: spi_fast_loopback - extra_args: - - DTC_OVERLAY_FILE="boards/nrf54lm20dk_nrf54lm20a_cpuapp_spi00.overlay" - platform_allow: + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - ophelia4ev/nrf54l15/cpuapp drivers.spi.ke1xz_flexio_spi.loopback: extra_args: DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_spi.overlay" filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and From be263e1f694c35f9e43c4e429d737a5fbd12753c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 443/881] Revert "[nrf fromtree] tests: spi_loopback: Fix same_buf_cmd test" This reverts commit ab75d58b5309dcf789dc5e8c044d0c2e6fc84d46. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 33 ++++++++++-------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index bb8b9d283b2..e3ad4043c16 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -599,17 +599,18 @@ ZTEST(spi_loopback, test_nop_nil_bufs) /* nothing really to check here, check is done in spi_loopback_transceive */ } -/* test using the same buffer set for RX and TX will write same data back */ +/* test using the same buffer for RX and TX will write same data back */ ZTEST(spi_loopback, test_spi_write_back) { struct spi_dt_spec *spec = loopback_specs[spec_idx]; - - struct spi_buf buf = {.buf = buffer_rx, .len = BUF_SIZE}; - struct spi_buf_set set = {.buffers = &buf, .count = 1}; + const struct spi_buf_set tx = spi_loopback_setup_xfer(rx_bufs_pool, 1, + buffer_rx, BUF_SIZE); + const struct spi_buf_set rx = spi_loopback_setup_xfer(rx_bufs_pool, 1, + buffer_rx, BUF_SIZE); memcpy(buffer_rx, tx_data, sizeof(tx_data)); - spi_loopback_transceive(spec, &set, &set); + spi_loopback_transceive(spec, &tx, &rx); spi_loopback_compare_bufs(tx_data, buffer_rx, BUF_SIZE, buffer_print_tx, buffer_print_rx); @@ -619,25 +620,19 @@ ZTEST(spi_loopback, test_spi_write_back) ZTEST(spi_loopback, test_spi_same_buf_cmd) { struct spi_dt_spec *spec = loopback_specs[spec_idx]; + const struct spi_buf_set tx = spi_loopback_setup_xfer(rx_bufs_pool, 2, + buffer_rx, 1, + NULL, BUF_SIZE - 1); + const struct spi_buf_set rx = spi_loopback_setup_xfer(rx_bufs_pool, 1, + NULL, BUF_SIZE - 1, + buffer_rx+(BUF_SIZE - 1), 1); - struct spi_buf buf[2] = { - {.buf = buffer_rx, .len = 1}, - {.buf = buffer_rx+1, .len = BUF_SIZE - 1} - }; - - const struct spi_buf_set tx = {.buffers = buf, .count = 1}; - const struct spi_buf_set rx = {.buffers = buf, .count = 2}; - - memcpy(buffer_rx, tx_data, BUF_SIZE); + memcpy(buffer_rx, tx_data, sizeof(tx_data)); spi_loopback_transceive(spec, &tx, &rx); - spi_loopback_compare_bufs(tx_data, buffer_rx, 1, + spi_loopback_compare_bufs(tx_data, buffer_rx, BUF_SIZE, buffer_print_tx, buffer_print_rx); - - char zeros[BUF_SIZE - 1] = {0}; - - zassert_ok(memcmp(buffer_rx+1, zeros, BUF_SIZE - 1)); } From 72bfb6945ad5e919bd0d67748b935c8ef40df856 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 444/881] Revert "[nrf fromtree] tests: spi_loopback: skip hold_on_cs test if not supported" This reverts commit d18433fbd8c74ffb1a4dd0234730fca12f322c81. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index e3ad4043c16..9d6c8718472 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -1017,8 +1017,6 @@ ZTEST(spi_extra_api_features, test_spi_hold_on_cs) early_exit: hold_spec->config.operation &= ~SPI_HOLD_ON_CS; zassert_false(ret, "SPI transceive failed, code %d", ret); - /* if there was no error then it was meant to be a skip at this point */ - ztest_test_skip(); } /* From 4afbabf5e30b10965a9e763e51f7bd1afa86bc9b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 445/881] Revert "[nrf fromtree] tests: drivers: spi: Add MAX32657 overlay files" This reverts commit 435493aecb400ded359d5026f3398357824d9227. Signed-off-by: Jukka Rissanen --- .../boards/max32657evkit_max32657.conf | 6 ----- .../boards/max32657evkit_max32657.overlay | 25 ------------------- .../boards/max32657evkit_max32657_ns.conf | 6 ----- .../boards/max32657evkit_max32657_ns.overlay | 18 ------------- 4 files changed, 55 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657.overlay delete mode 100644 tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657_ns.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657_ns.overlay diff --git a/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657.conf b/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657.conf deleted file mode 100644 index 87c673fcdaf..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Analog Devices, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# -CONFIG_SPI_MAX32_INTERRUPT=y diff --git a/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657.overlay b/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657.overlay deleted file mode 100644 index 83a4a0b60da..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Analog Devices, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&dma1 { - status = "okay"; -}; - -&spi0 { - dmas = <&dma1 1 MAX32_DMA_SLOT_SPI_TX>, <&dma1 2 MAX32_DMA_SLOT_SPI_RX>; - dma-names = "tx", "rx"; - - slow@1 { - compatible = "test-spi-loopback-slow"; - reg = <1>; - spi-max-frequency = <128000>; - }; - fast@1 { - compatible = "test-spi-loopback-fast"; - reg = <1>; - spi-max-frequency = <500000>; - }; -}; diff --git a/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657_ns.conf b/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657_ns.conf deleted file mode 100644 index 87c673fcdaf..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657_ns.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Analog Devices, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# -CONFIG_SPI_MAX32_INTERRUPT=y diff --git a/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657_ns.overlay b/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657_ns.overlay deleted file mode 100644 index ee529c8bf48..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/max32657evkit_max32657_ns.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2024 Analog Devices, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&spi0 { - slow@1 { - compatible = "test-spi-loopback-slow"; - reg = <1>; - spi-max-frequency = <128000>; - }; - fast@1 { - compatible = "test-spi-loopback-fast"; - reg = <1>; - spi-max-frequency = <500000>; - }; -}; From 91312fcad2c6056bd9d3b28180812a0e9af5f0ca Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 446/881] Revert "[nrf fromtree] tests: drivers: spi: spi_loopback: Add testcase for cc23x0" This reverts commit 3a1c2e37328d2be463d89734500f3cecff60881a. Signed-off-by: Jukka Rissanen --- .../spi_loopback/boards/lp_em_cc2340r5.conf | 1 - .../spi_loopback/boards/lp_em_cc2340r5.overlay | 18 ------------------ tests/drivers/spi/spi_loopback/testcase.yaml | 7 ------- 3 files changed, 26 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/lp_em_cc2340r5.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/lp_em_cc2340r5.overlay diff --git a/tests/drivers/spi/spi_loopback/boards/lp_em_cc2340r5.conf b/tests/drivers/spi/spi_loopback/boards/lp_em_cc2340r5.conf deleted file mode 100644 index 469620fed4e..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/lp_em_cc2340r5.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_LOOPBACK_MODE_LOOP=y diff --git a/tests/drivers/spi/spi_loopback/boards/lp_em_cc2340r5.overlay b/tests/drivers/spi/spi_loopback/boards/lp_em_cc2340r5.overlay deleted file mode 100644 index 98594dcc472..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/lp_em_cc2340r5.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2024 BayLibre, SAS - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&spi0 { - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = <2000000>; - }; - fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = <3000000>; - }; -}; diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index e64aa8cdbf3..c92c763ec57 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -314,10 +314,3 @@ tests: filter: CONFIG_SOC_FAMILY_SILABS_SIWX91X platform_allow: - siwx917_rb4338a - drivers.spi.cc23x0.loopback.dma.no_async: - filter: CONFIG_SOC_FAMILY_TI_SIMPLELINK - platform_allow: - - lp_em_cc2340r5 - extra_configs: - - CONFIG_SPI_CC23X0_DMA_DRIVEN=y - - CONFIG_SPI_ASYNC=n From 8b635c6ef4c114ad9e295ebce41ec0cc8bd4bd3c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 447/881] Revert "[nrf fromtree] drivers: spi: nxp: fix PCS broken issue and PCS_HOLD_ON support" This reverts commit b2c404f595d756b94d5f94f6d46ceebbf3de434a. Signed-off-by: Jukka Rissanen --- drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi_dma.c | 264 ++++++------------ .../mimxrt1060_evk_mimxrt1062_qspi_C.overlay | 1 - .../mimxrt1170_evk_mimxrt1176_cm7_A.overlay | 3 +- 3 files changed, 83 insertions(+), 185 deletions(-) diff --git a/drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi_dma.c b/drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi_dma.c index 0213a808afa..5b14a66fc19 100644 --- a/drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi_dma.c +++ b/drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi_dma.c @@ -1,5 +1,5 @@ /* - * Copyright 2018, 2024-2025 NXP + * Copyright 2018, 2024 NXP * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,19 +12,6 @@ LOG_MODULE_DECLARE(spi_lpspi, CONFIG_SPI_LOG_LEVEL); #include #include "spi_nxp_lpspi_priv.h" -/* These states indicate what's the status of RX and TX, also synchronization - * status of DMA size of the next DMA transfer. - */ -typedef enum { - LPSPI_TRANSFER_STATE_NULL, - LPSPI_TRANSFER_STATE_ONGOING, - LPSPI_TRANSFER_STATE_NEXT_DMA_SIZE_UPDATED, - LPSPI_TRANSFER_STATE_TX_DONE, - LPSPI_TRANSFER_STATE_RX_DONE, - LPSPI_TRANSFER_STATE_RX_TX_DONE, - LPSPI_TRANSFER_STATE_INVALID = 0xFFFFFFFFUL, -} lpspi_transfer_state_t; - /* dummy memory used for transferring NOP when tx buf is null */ static uint32_t tx_nop_val; /* check compliance says no init to 0, but should be 0 in bss */ /* dummy memory for transferring to when RX buf is null */ @@ -35,58 +22,17 @@ struct spi_dma_stream { uint32_t channel; struct dma_config dma_cfg; struct dma_block_config dma_blk_cfg; + bool chunk_done; }; struct spi_nxp_dma_data { struct spi_dma_stream dma_rx; struct spi_dma_stream dma_tx; - - lpspi_transfer_state_t state; - /* This DMA size is used in callback function for RX and TX context update. - * because of old LPSPI IP limitation, RX complete depend on next TX DMA transfer start, - * so TX and RX not always start at the same time while we can only calculate DMA transfer - * size once and update the buffer pointers at the same time. - */ - size_t synchronize_dma_size; }; -/* - * Issue a TCR (Transmit Command Register) command to properly end RX DMA transfers - * on certain LPSPI versions. The behavior depends on: - * - * 1. LPSPI Hardware Version: - * - Version 1 (RT1170, RT10xx, Kinetis K series): TCR issue always required - * - Version 2 (RT1180, MCXN, RT700, K32W, S32K3xx, MCXL10): TCR issue not needed - * - * 2. SPI_HOLD_ON_CS Configuration: - * - If enabled: Keeps chip select (PCS) asserted between transfers - * - If disabled: Deasserts PCS after each transfer - * - * This function checks the LPSPI version and SPI_HOLD_ON_CS setting to determine - * if a TCR command is needed. For version 1, TCR is always issued. For version 2, - * TCR is only issued if SPI_HOLD_ON_CS is not set. Therefore, SPI_HOLD_ON_CS is not - * supported for version 1. - * - * The LPSPI version can be read from the VERID register, which is typically the - * first register in the memory map. - */ -static void spi_mcux_issue_TCR(const struct device *dev) -{ - LPSPI_Type *base = (LPSPI_Type *)DEVICE_MMIO_NAMED_GET(dev, reg_base); - const struct spi_config *spi_cfg = DEV_DATA(dev)->ctx.config; - uint8_t major_ver = (base->VERID & LPSPI_VERID_MAJOR_MASK) >> LPSPI_VERID_MAJOR_SHIFT; - - /* On old LPSPI versions, we always have to issue TCR, or transaction will never end. - * On a newer LPSPI version, only issue TCR when hold on CS feature is disabled. - */ - if (major_ver < 2 || !(spi_cfg->operation & SPI_HOLD_ON_CS)) { - base->TCR &= ~LPSPI_TCR_CONTC_MASK; - } -} - static struct dma_block_config *lpspi_dma_common_load(struct spi_dma_stream *stream, - const struct device *dev, const uint8_t *buf, - size_t len) + const struct device *dev, + const uint8_t *buf, size_t len) { struct dma_block_config *blk_cfg = &stream->dma_blk_cfg; @@ -145,35 +91,30 @@ static int lpspi_dma_rx_load(const struct device *dev, uint8_t *buf, size_t len) return dma_config(stream->dma_dev, stream->channel, &stream->dma_cfg); } -/* Return values: - * positive value if a data chunk is loaded successfully and return the data chunk size loaded; - * negative value if error happens and return the error code; - * 0 if no data is loaded; - */ -static int lpspi_dma_rxtx_load(const struct device *dev) +static inline int lpspi_dma_rxtx_load(const struct device *dev) { struct lpspi_data *data = dev->data; struct spi_nxp_dma_data *dma_data = (struct spi_nxp_dma_data *)data->driver_data; struct spi_dma_stream *rx = &dma_data->dma_rx; struct spi_dma_stream *tx = &dma_data->dma_tx; struct spi_context *ctx = &data->ctx; - size_t dma_size = spi_context_max_continuous_chunk(ctx); + size_t next_chunk_size = spi_context_max_continuous_chunk(ctx); int ret = 0; - if (dma_size == 0) { + if (next_chunk_size == 0) { /* In case both buffers are 0 length, we should not even be here * and attempting to set up a DMA transfer like this will cause * errors that lock up the system in some cases with eDMA. */ - return 0; + return -ENODATA; } - ret = lpspi_dma_tx_load(dev, ctx->tx_buf, dma_size); + ret = lpspi_dma_tx_load(dev, ctx->tx_buf, next_chunk_size); if (ret != 0) { return ret; } - ret = lpspi_dma_rx_load(dev, ctx->rx_buf, dma_size); + ret = lpspi_dma_rx_load(dev, ctx->rx_buf, next_chunk_size); if (ret != 0) { return ret; } @@ -183,17 +124,24 @@ static int lpspi_dma_rxtx_load(const struct device *dev) return ret; } - ret = dma_start(tx->dma_dev, tx->channel); - if (ret != 0) { - return ret; - } + return dma_start(tx->dma_dev, tx->channel); +} - return dma_size; +static int lpspi_dma_next_fill(const struct device *dev) +{ + struct lpspi_data *data = (struct lpspi_data *)dev->data; + struct spi_nxp_dma_data *dma_data = (struct spi_nxp_dma_data *)data->driver_data; + struct spi_dma_stream *rx = &dma_data->dma_rx; + struct spi_dma_stream *tx = &dma_data->dma_tx; + + rx->chunk_done = false; + tx->chunk_done = false; + + return lpspi_dma_rxtx_load(dev); } static void spi_mcux_dma_callback(const struct device *dev, void *arg, uint32_t channel, int status) { - /* arg directly holds the spi device */ const struct device *spi_dev = arg; LPSPI_Type *base = (LPSPI_Type *)DEVICE_MMIO_NAMED_GET(spi_dev, reg_base); struct lpspi_data *data = (struct lpspi_data *)spi_dev->data; @@ -201,98 +149,63 @@ static void spi_mcux_dma_callback(const struct device *dev, void *arg, uint32_t struct spi_dma_stream *rx = &dma_data->dma_rx; struct spi_dma_stream *tx = &dma_data->dma_tx; struct spi_context *ctx = &data->ctx; - char debug_char = (channel == dma_data->dma_tx.channel) ? 'T' : 'R'; - int ret = 0; + char debug_char; if (status < 0) { - ret = status; goto error; + } else { + /* don't care about positive values, normalize to "okay" = 0 */ + status = 0; } - if (channel != dma_data->dma_tx.channel && channel != dma_data->dma_rx.channel) { - ret = -EIO; + if (channel == rx->channel) { + spi_context_update_rx(ctx, 1, rx->dma_blk_cfg.block_size); + debug_char = 'R'; + rx->chunk_done = true; + } else if (channel == tx->channel) { + spi_context_update_tx(ctx, 1, tx->dma_blk_cfg.block_size); + debug_char = 'T'; + tx->chunk_done = true; + } else { + /* invalid channel */ + status = -EIO; goto error; } - switch (dma_data->state) { - case LPSPI_TRANSFER_STATE_ONGOING: - spi_context_update_tx(ctx, 1, tx->dma_blk_cfg.block_size); - spi_context_update_rx(ctx, 1, rx->dma_blk_cfg.block_size); - /* Calculate next DMA transfer size */ - dma_data->synchronize_dma_size = spi_context_max_continuous_chunk(ctx); - LOG_DBG("tx len:%d rx len:%d next dma size:%d", ctx->tx_len, ctx->rx_len, - dma_data->synchronize_dma_size); - if (dma_data->synchronize_dma_size > 0) { - ret = (channel == dma_data->dma_tx.channel) - ? lpspi_dma_tx_load(spi_dev, ctx->tx_buf, - dma_data->synchronize_dma_size) - : lpspi_dma_rx_load(spi_dev, ctx->rx_buf, - dma_data->synchronize_dma_size); - - if (ret != 0) { - goto error; - } - - ret = dma_start(dev, channel); - if (ret != 0) { - goto error; - } - dma_data->state = LPSPI_TRANSFER_STATE_NEXT_DMA_SIZE_UPDATED; - } else { - ret = dma_stop(dev, channel); - if (ret != 0) { - goto error; - } - /* This is the end of the transfer. */ - if (channel == dma_data->dma_tx.channel) { - spi_mcux_issue_TCR(spi_dev); - dma_data->state = LPSPI_TRANSFER_STATE_TX_DONE; - base->DER &= ~LPSPI_DER_TDDE_MASK; - } else { - dma_data->state = LPSPI_TRANSFER_STATE_RX_DONE; - base->DER &= ~LPSPI_DER_RDDE_MASK; - } - } - break; - case LPSPI_TRANSFER_STATE_NEXT_DMA_SIZE_UPDATED: - ret = (channel == dma_data->dma_tx.channel) - ? lpspi_dma_tx_load(spi_dev, ctx->tx_buf, - dma_data->synchronize_dma_size) - : lpspi_dma_rx_load(spi_dev, ctx->rx_buf, - dma_data->synchronize_dma_size); - dma_data->synchronize_dma_size = 0; - - if (ret != 0) { - goto error; - } - - ret = dma_start(dev, channel); - if (ret != 0) { - goto error; - } - dma_data->state = LPSPI_TRANSFER_STATE_ONGOING; - break; - - case LPSPI_TRANSFER_STATE_TX_DONE: - case LPSPI_TRANSFER_STATE_RX_DONE: - dma_data->state = LPSPI_TRANSFER_STATE_RX_TX_DONE; - /* TX and RX both done here. */ - spi_context_complete(ctx, spi_dev, 0); - spi_context_cs_control(ctx, false); - break; - - default: - LOG_ERR("unknown spi stransfer state:%d", dma_data->state); - ret = -EIO; + LOG_DBG("DMA %cX Block Complete", debug_char); + + /* wait for the other channel to finish if needed */ + if (!rx->chunk_done || !tx->chunk_done) { + return; + } + + + while ((IS_ENABLED(CONFIG_SOC_FAMILY_NXP_IMXRT) || + IS_ENABLED(CONFIG_SOC_FAMILY_KINETIS)) && + (base->SR & LPSPI_SR_MBF_MASK)) { + /* wait until module is idle */ + } + + if (spi_context_max_continuous_chunk(ctx) == 0) { + goto done; + } + + status = lpspi_dma_next_fill(spi_dev); + if (status) { goto error; } - LOG_DBG("DMA %cX Block Complete", debug_char); return; error: - LOG_ERR("DMA callback error with channel %d.", channel); - spi_context_complete(ctx, spi_dev, ret); + LOG_ERR("DMA callback error with channel %d err %d.", channel, status); +done: + base->DER &= ~(LPSPI_DER_TDDE_MASK | LPSPI_DER_RDDE_MASK); + base->TCR &= ~LPSPI_TCR_CONT_MASK; + lpspi_wait_tx_fifo_empty(spi_dev); spi_context_cs_control(ctx, false); + base->CR |= LPSPI_CR_RTF_MASK | LPSPI_CR_RRF_MASK; + spi_context_complete(ctx, spi_dev, status); + spi_context_release(ctx, status); } static int transceive_dma(const struct device *dev, const struct spi_config *spi_cfg, @@ -301,9 +214,7 @@ static int transceive_dma(const struct device *dev, const struct spi_config *spi { LPSPI_Type *base = (LPSPI_Type *)DEVICE_MMIO_NAMED_GET(dev, reg_base); struct lpspi_data *data = dev->data; - struct spi_nxp_dma_data *dma_data = (struct spi_nxp_dma_data *)data->driver_data; struct spi_context *ctx = &data->ctx; - uint8_t major_ver = (base->VERID & LPSPI_VERID_MAJOR_MASK) >> LPSPI_VERID_MAJOR_SHIFT; int ret; spi_context_lock(ctx, asynchronous, cb, userdata, spi_cfg); @@ -313,41 +224,30 @@ static int transceive_dma(const struct device *dev, const struct spi_config *spi goto out; } - /* Check CS hold on feature for DMA mode, it is not supported on some platform. */ - if ((spi_cfg->operation & SPI_HOLD_ON_CS) && major_ver < 2) { - LOG_ERR("SPI CS hold on feature is not supported on this platform."); - return -ENOTSUP; - } - - /* Always use continuous mode to satisfy SPI API requirements. */ - base->TCR |= LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK; + spi_context_buffers_setup(ctx, tx_bufs, rx_bufs, 1); - /* Please set both watermarks as 0 because there are some synchronize requirements - * between RX and TX on RT platform. TX and RX DMA callback must be called in interleaved - * mode, a none-zero TX watermark may break this. - */ - base->FCR = LPSPI_FCR_TXWATER(0) | LPSPI_FCR_RXWATER(0); - spi_context_buffers_setup(&data->ctx, tx_bufs, rx_bufs, 1); - - /* Set next dma size is invalid. */ - dma_data->synchronize_dma_size = 0; - dma_data->state = LPSPI_TRANSFER_STATE_NULL; - - /* Load dma block */ - ret = lpspi_dma_rxtx_load(dev); - if (ret <= 0) { + ret = lpspi_dma_next_fill(dev); + if (ret == -ENODATA) { + /* No transfer to do? So just exit */ + ret = 0; + goto out; + } else if (ret) { goto out; } - dma_data->state = LPSPI_TRANSFER_STATE_ONGOING; - /* Set CS line just before DMA transfer. */ + if (!(IS_ENABLED(CONFIG_SOC_FAMILY_NXP_IMXRT) || IS_ENABLED(CONFIG_SOC_FAMILY_KINETIS))) { + base->TCR |= LPSPI_TCR_CONT_MASK; + } + spi_context_cs_control(ctx, true); - /* Enable DMA Requests */ + + base->CR |= LPSPI_CR_RTF_MASK | LPSPI_CR_RRF_MASK; + base->DER |= LPSPI_DER_TDDE_MASK | LPSPI_DER_RDDE_MASK; ret = spi_context_wait_for_completion(ctx); - if (ret) { - spi_context_cs_control(ctx, false); + if (ret >= 0) { + return ret; } out: spi_context_release(ctx, ret); diff --git a/tests/drivers/spi/spi_loopback/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay b/tests/drivers/spi/spi_loopback/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay index 328dd4198e0..979062e18d9 100644 --- a/tests/drivers/spi/spi_loopback/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay +++ b/tests/drivers/spi/spi_loopback/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* Short J17-pin4 and J17-pin5, populate R356, R350,R346, R362 to enable Pins for SPI1. */ &lpspi1 { slow@0 { compatible = "test-spi-loopback-slow"; diff --git a/tests/drivers/spi/spi_loopback/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay b/tests/drivers/spi/spi_loopback/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay index 57f6c86b644..bbddef98ad6 100644 --- a/tests/drivers/spi/spi_loopback/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay +++ b/tests/drivers/spi/spi_loopback/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay @@ -1,10 +1,9 @@ /* - * Copyright 2023, 2025 NXP + * Copyright 2023 NXP * * SPDX-License-Identifier: Apache-2.0 */ -/* Short J10-pin8 and J10-pin10. */ &lpspi1 { dmas = <&edma0 0 36>, <&edma0 1 37>; dma-names = "rx", "tx"; From 2aed9db77fe3806bd26db267bcf450e956ab3cdc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 448/881] Revert "[nrf fromtree] tests: drivers: spi_loopback: fix buffers alignment size" This reverts commit b5096ac80acf422a7312627b56ee0319f511fa83. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 39 +++++++++--------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index 9d6c8718472..d3d44d79f46 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -66,49 +66,40 @@ const struct gpio_dt_spec mosi_pin = GPIO_DT_SPEC_GET_OR(DT_PATH(zephyr_user), m ******************** */ -#ifdef CONFIG_NOCACHE_MEMORY +#if CONFIG_NOCACHE_MEMORY #define __NOCACHE __attribute__((__section__(".nocache"))) #elif defined(CONFIG_DT_DEFINED_NOCACHE) #define __NOCACHE __attribute__((__section__(CONFIG_DT_DEFINED_NOCACHE_NAME))) #else /* CONFIG_NOCACHE_MEMORY */ #define __NOCACHE -#if CONFIG_DCACHE_LINE_SIZE != 0 -#define __BUF_ALIGN __aligned(CONFIG_DCACHE_LINE_SIZE) -#else -#define __BUF_ALIGN __aligned(DT_PROP_OR(DT_PATH(cpus, cpu_0), d_cache_line_size, 32)) -#endif #endif /* CONFIG_NOCACHE_MEMORY */ -#ifndef __BUF_ALIGN -#define __BUF_ALIGN __aligned(32) -#endif - #define BUF_SIZE 18 static const char tx_data[BUF_SIZE] = "0123456789abcdef-\0"; -static __BUF_ALIGN char buffer_tx[BUF_SIZE] __NOCACHE; -static __BUF_ALIGN char buffer_rx[BUF_SIZE] __NOCACHE; +static __aligned(32) char buffer_tx[BUF_SIZE] __NOCACHE; +static __aligned(32) char buffer_rx[BUF_SIZE] __NOCACHE; #define BUF2_SIZE 36 static const char tx2_data[BUF2_SIZE] = "Thequickbrownfoxjumpsoverthelazydog\0"; -static __BUF_ALIGN char buffer2_tx[BUF2_SIZE] __NOCACHE; -static __BUF_ALIGN char buffer2_rx[BUF2_SIZE] __NOCACHE; +static __aligned(32) char buffer2_tx[BUF2_SIZE] __NOCACHE; +static __aligned(32) char buffer2_rx[BUF2_SIZE] __NOCACHE; #define BUF3_SIZE CONFIG_SPI_LARGE_BUFFER_SIZE static const char large_tx_data[BUF3_SIZE] = "Thequickbrownfoxjumpsoverthelazydog\0"; -static __BUF_ALIGN char large_buffer_tx[BUF3_SIZE] __NOCACHE; -static __BUF_ALIGN char large_buffer_rx[BUF3_SIZE] __NOCACHE; +static __aligned(32) char large_buffer_tx[BUF3_SIZE] __NOCACHE; +static __aligned(32) char large_buffer_rx[BUF3_SIZE] __NOCACHE; #define BUFWIDE_SIZE 12 static const uint16_t tx_data_16[] = {0x1234, 0x5678, 0x9ABC, 0xDEF0, 0xFF00, 0x00FF, 0xAAAA, 0x5555, 0xF0F0, 0x0F0F, 0xA5A5, 0x5A5A}; -static __BUF_ALIGN uint16_t buffer_tx_16[BUFWIDE_SIZE] __NOCACHE; -static __BUF_ALIGN uint16_t buffer_rx_16[BUFWIDE_SIZE] __NOCACHE; +static __aligned(32) uint16_t buffer_tx_16[BUFWIDE_SIZE] __NOCACHE; +static __aligned(32) uint16_t buffer_rx_16[BUFWIDE_SIZE] __NOCACHE; static const uint32_t tx_data_32[] = {0x12345678, 0x56781234, 0x9ABCDEF0, 0xDEF09ABC, 0xFFFF0000, 0x0000FFFF, 0x00FF00FF, 0xFF00FF00, 0xAAAA5555, 0x5555AAAA, 0xAA55AA55, 0x55AA55AA}; -static __BUF_ALIGN uint32_t buffer_tx_32[BUFWIDE_SIZE] __NOCACHE; -static __BUF_ALIGN uint32_t buffer_rx_32[BUFWIDE_SIZE] __NOCACHE; +static __aligned(32) uint32_t buffer_tx_32[BUFWIDE_SIZE] __NOCACHE; +static __aligned(32) uint32_t buffer_rx_32[BUFWIDE_SIZE] __NOCACHE; /* ******************** @@ -676,7 +667,7 @@ ZTEST(spi_loopback, test_spi_word_size_9) { struct spi_dt_spec *spec = loopback_specs[spec_idx]; - static __BUF_ALIGN uint16_t tx_data_9[BUFWIDE_SIZE]; + static __aligned(32) uint16_t tx_data_9[BUFWIDE_SIZE]; for (int i = 0; i < BUFWIDE_SIZE; i++) { tx_data_9[i] = tx_data_16[i] & 0x1FF; @@ -700,7 +691,7 @@ ZTEST(spi_loopback, test_spi_word_size_24) { struct spi_dt_spec *spec = loopback_specs[spec_idx]; - static __BUF_ALIGN uint32_t tx_data_24[BUFWIDE_SIZE]; + static __aligned(32) uint32_t tx_data_24[BUFWIDE_SIZE]; for (int i = 0; i < BUFWIDE_SIZE; i++) { tx_data_24[i] = tx_data_32[i] & 0xFFFFFF; @@ -726,8 +717,8 @@ static struct k_thread thread[3]; static K_SEM_DEFINE(thread_sem, 0, 3); static K_SEM_DEFINE(sync_sem, 0, 1); -static uint8_t __BUF_ALIGN tx_buffer[3][32] __NOCACHE; -static uint8_t __BUF_ALIGN rx_buffer[3][32] __NOCACHE; +static uint8_t __aligned(32) tx_buffer[3][32] __NOCACHE; +static uint8_t __aligned(32) rx_buffer[3][32] __NOCACHE; atomic_t thread_test_fails; From 294ae59e6db6abf34ae71b124f3020ef9f79de33 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 449/881] Revert "[nrf fromtree] tests: drivers: spi: Add support spi_loopback for ek_ra8p1" This reverts commit ee516c959a47e42c62ff8504b475b0f400fc6faf. Signed-off-by: Jukka Rissanen --- .../boards/ek_ra8p1_r7ka8p1kflcac_cm85.conf | 6 ----- .../ek_ra8p1_r7ka8p1kflcac_cm85.overlay | 23 ------------------- 2 files changed, 29 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay diff --git a/tests/drivers/spi/spi_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.conf b/tests/drivers/spi/spi_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.conf deleted file mode 100644 index 9c7b8ccf32d..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_LOOPBACK_MODE_LOOP=y -CONFIG_SPI_B_INTERRUPT=y -CONFIG_SPI_B_RA_DTC=y diff --git a/tests/drivers/spi/spi_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay b/tests/drivers/spi/spi_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay deleted file mode 100644 index 69a4204a1ab..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&spi1 { - rx-dtc; - tx-dtc; - - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = <2000000>; - }; - - fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = <3000000>; - }; -}; From 7bceb76b95fef30d4592e7e6c3025949011fb99c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 450/881] Revert "[nrf fromtree] tests: drivers: spi: Add support ek_ra2l1 for spi_loopback test" This reverts commit 7d1b3d22d979ddfee148236d6664ac7e1d2f3202. Signed-off-by: Jukka Rissanen --- .../spi/spi_loopback/boards/ek_ra2l1.conf | 3 -- .../spi/spi_loopback/boards/ek_ra2l1.overlay | 45 ------------------- 2 files changed, 48 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/ek_ra2l1.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/ek_ra2l1.overlay diff --git a/tests/drivers/spi/spi_loopback/boards/ek_ra2l1.conf b/tests/drivers/spi/spi_loopback/boards/ek_ra2l1.conf deleted file mode 100644 index 65750ba3131..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/ek_ra2l1.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_SPI_LOOPBACK_MODE_LOOP=y -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y diff --git a/tests/drivers/spi/spi_loopback/boards/ek_ra2l1.overlay b/tests/drivers/spi/spi_loopback/boards/ek_ra2l1.overlay deleted file mode 100644 index b87c7818209..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/ek_ra2l1.overlay +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&spi0 { - rx-dtc; - tx-dtc; - - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = <2000000>; - }; - - fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = <3000000>; - }; -}; - -&pinctrl { - spi0_default: spi0_default { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; -}; - -&spi0 { - pinctrl-0 = <&spi0_default>; - pinctrl-names = "default"; - cs-gpios = <&ioport1 3 GPIO_ACTIVE_LOW>; - interrupts = <8 1>, <9 1>, <10 1>, <19 1>; - interrupt-names = "rxi", "txi", "tei", "eri"; - status = "okay"; -}; - -&ioport1 { - status = "okay"; -}; From 64acb3b0b96569813c52afc950077d185ff8d93f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 451/881] Revert "[nrf fromtree] tests: spi: siwx91x: board config file update" This reverts commit 0bf0e5f93631b88423352d666464e05a5aa41b77. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/boards/siwx917_rb4338a.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/spi/spi_loopback/boards/siwx917_rb4338a.conf b/tests/drivers/spi/spi_loopback/boards/siwx917_rb4338a.conf index 940add570e6..368ff560c98 100644 --- a/tests/drivers/spi/spi_loopback/boards/siwx917_rb4338a.conf +++ b/tests/drivers/spi/spi_loopback/boards/siwx917_rb4338a.conf @@ -1,2 +1 @@ CONFIG_SPI_SILABS_SIWX91X_GSPI_DMA=y -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=24 From b9a7c66871979244b6a8356a220602cfdec74156 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 452/881] Revert "[nrf fromtree] tests: drivers: spi: remove useless files and testcases" This reverts commit d72989085916b3200a8421ff3562b041be8cbeea. Signed-off-by: Jukka Rissanen --- ...y-stm32-spi-16bits-dma-dt-nocache-mem.conf | 14 ++++++ .../overlay-stm32-spi-16bits-dma.conf | 11 +++++ .../overlay-stm32-spi-16bits.conf | 6 +++ .../overlay-stm32-spi-16bits.overlay | 43 +++++++++++++++++++ tests/drivers/spi/spi_loopback/testcase.yaml | 34 +++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma-dt-nocache-mem.conf create mode 100644 tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma.conf create mode 100644 tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.conf create mode 100644 tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.overlay diff --git a/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma-dt-nocache-mem.conf b/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma-dt-nocache-mem.conf new file mode 100644 index 00000000000..4bb96e35f58 --- /dev/null +++ b/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma-dt-nocache-mem.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2023 Graphcore Ltd, All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + +# enable DMA mode for SPI loopback test +CONFIG_SPI_STM32_DMA=y +CONFIG_SPI_STM32_INTERRUPT=n +CONFIG_SPI_ASYNC=n +CONFIG_NOCACHE_MEMORY=n +CONFIG_DT_DEFINED_NOCACHE=y +CONFIG_DT_DEFINED_NOCACHE_NAME="SRAM2" +CONFIG_SPI_LOOPBACK_16BITS_FRAMES=y diff --git a/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma.conf b/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma.conf new file mode 100644 index 00000000000..c49efea868a --- /dev/null +++ b/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2023 Graphcore Ltd, All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + +# enable DMA mode for SPI loopback test +CONFIG_SPI_STM32_DMA=y +CONFIG_SPI_STM32_INTERRUPT=n +CONFIG_SPI_ASYNC=n +CONFIG_SPI_LOOPBACK_16BITS_FRAMES=y diff --git a/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.conf b/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.conf new file mode 100644 index 00000000000..00ca04782b4 --- /dev/null +++ b/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2023 Graphcore Ltd, All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_SPI_LOOPBACK_16BITS_FRAMES=y diff --git a/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.overlay b/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.overlay new file mode 100644 index 00000000000..b2df25ac860 --- /dev/null +++ b/tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.overlay @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Graphcore Ltd, All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Set div-q to get test clk freq into acceptable SPI freq range */ +&pll { + /delete-property/ div-q; + div-q = <8>; +}; + +&sram2 { + zephyr,memory-attr = < DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) >; +}; + +&spi1 { + dmas = <&dmamux1 0 38 (STM32_DMA_PERIPH_TX | STM32_DMA_PRIORITY_HIGH | STM32_DMA_MEM_16BITS | STM32_DMA_PERIPH_16BITS) + &dmamux1 1 37 (STM32_DMA_PERIPH_RX | STM32_DMA_PRIORITY_HIGH | STM32_DMA_MEM_16BITS | STM32_DMA_PERIPH_16BITS)>; + dma-names = "tx", "rx"; + slow@0 { + compatible = "test-spi-loopback-slow"; + reg = <0>; + spi-max-frequency = <500000>; + }; + fast@0 { + compatible = "test-spi-loopback-fast"; + reg = <0>; + spi-max-frequency = <16000000>; + }; +}; + +&dma1 { + status = "okay"; +}; + +&dma2 { + status = "okay"; +}; + +&dmamux1 { + status = "okay"; +}; diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index c92c763ec57..ab3322a8d1f 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -51,6 +51,17 @@ tests: - robokit1 integration_platforms: - sam_e70_xplained/same70q21 + drivers.spi.stm32_spi_16bits_frames.loopback: + extra_args: + - EXTRA_CONF_FILE="overlay-stm32-spi-16bits.conf" + - DTC_OVERLAY_FILE="overlay-stm32-spi-16bits.overlay" + platform_allow: + - nucleo_h743zi + - nucleo_h753zi + - nucleo_h745zi_q/stm32h745xx/m4 + - nucleo_h745zi_q/stm32h745xx/m7 + integration_platforms: + - nucleo_h743zi drivers.spi.stm32_spi_dma.loopback: extra_args: EXTRA_CONF_FILE="overlay-stm32-spi-dma.conf" platform_allow: @@ -87,6 +98,29 @@ tests: - nucleo_h745zi_q/stm32h745xx/m7 integration_platforms: - nucleo_h743zi + drivers.spi.stm32_spi_16bits_frames_dma.loopback: + extra_args: + - EXTRA_CONF_FILE="overlay-stm32-spi-16bits-dma.conf" + - DTC_OVERLAY_FILE="overlay-stm32-spi-16bits.overlay" + platform_allow: + - nucleo_h743zi + - nucleo_h753zi + - nucleo_h745zi_q/stm32h745xx/m4 + - nucleo_h745zi_q/stm32h745xx/m7 + integration_platforms: + - nucleo_h743zi + drivers.spi.stm32_spi_16bits_frames_dma_dt_nocache_mem.loopback: + extra_args: + - EXTRA_CONF_FILE="overlay-stm32-spi-16bits-dma-dt-nocache-mem.conf" + - DTC_OVERLAY_FILE="overlay-stm32-spi-16bits.overlay" + filter: CONFIG_CPU_HAS_DCACHE + platform_allow: + - nucleo_h743zi + - nucleo_h753zi + - nucleo_h745zi_q/stm32h745xx/m4 + - nucleo_h745zi_q/stm32h745xx/m7 + integration_platforms: + - nucleo_h743zi drivers.spi.stm32_spi_interrupt.loopback: extra_args: EXTRA_CONF_FILE="overlay-stm32-spi-interrupt.conf" platform_allow: From 68ecd71078370c063e48ce4fddb262575ecc30c1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 453/881] Revert "[nrf fromtree] tests: drivers: spi: spi_loopback: handle rx/tx buffers nocache memory" This reverts commit af7a24bd8ce22d3c3a8e382f400e0dbaa664dd1f. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index d3d44d79f46..1e6b99ae947 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -717,8 +717,8 @@ static struct k_thread thread[3]; static K_SEM_DEFINE(thread_sem, 0, 3); static K_SEM_DEFINE(sync_sem, 0, 1); -static uint8_t __aligned(32) tx_buffer[3][32] __NOCACHE; -static uint8_t __aligned(32) rx_buffer[3][32] __NOCACHE; +static uint8_t __aligned(32) tx_buffer[3][32]; +static uint8_t __aligned(32) rx_buffer[3][32]; atomic_t thread_test_fails; From 4863dd568b96b93d45012a828b29398df1164fde Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:21 +0300 Subject: [PATCH 454/881] Revert "[nrf fromtree] tests: drivers: spi_loopback: add latency tolerance for some boards" This reverts commit 9f79c54364bb75b24ccc7ada1de620da21bbf945. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf | 1 - tests/drivers/spi/spi_loopback/boards/nucleo_f746zg.conf | 1 - tests/drivers/spi/spi_loopback/boards/nucleo_wb55rg.conf | 1 - tests/drivers/spi/spi_loopback/boards/nucleo_wba55cg.conf | 1 - tests/drivers/spi/spi_loopback/boards/nucleo_wl55jc.conf | 1 - tests/drivers/spi/spi_loopback/boards/stm32f3_disco.conf | 1 - 6 files changed, 6 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/nucleo_wb55rg.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/nucleo_wba55cg.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/nucleo_wl55jc.conf diff --git a/tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf b/tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf index 093e1f09d89..895eddcb0c0 100644 --- a/tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf +++ b/tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf @@ -1,2 +1 @@ CONFIG_SPI_LARGE_BUFFER_SIZE=4500 -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=20 diff --git a/tests/drivers/spi/spi_loopback/boards/nucleo_f746zg.conf b/tests/drivers/spi/spi_loopback/boards/nucleo_f746zg.conf index 72f64737820..c448e14811f 100644 --- a/tests/drivers/spi/spi_loopback/boards/nucleo_f746zg.conf +++ b/tests/drivers/spi/spi_loopback/boards/nucleo_f746zg.conf @@ -1,2 +1 @@ CONFIG_NOCACHE_MEMORY=y -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=10 diff --git a/tests/drivers/spi/spi_loopback/boards/nucleo_wb55rg.conf b/tests/drivers/spi/spi_loopback/boards/nucleo_wb55rg.conf deleted file mode 100644 index a527ab8f28d..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/nucleo_wb55rg.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=22 diff --git a/tests/drivers/spi/spi_loopback/boards/nucleo_wba55cg.conf b/tests/drivers/spi/spi_loopback/boards/nucleo_wba55cg.conf deleted file mode 100644 index 1753e2d75c3..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/nucleo_wba55cg.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=50 diff --git a/tests/drivers/spi/spi_loopback/boards/nucleo_wl55jc.conf b/tests/drivers/spi/spi_loopback/boards/nucleo_wl55jc.conf deleted file mode 100644 index 725924348b5..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/nucleo_wl55jc.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15 diff --git a/tests/drivers/spi/spi_loopback/boards/stm32f3_disco.conf b/tests/drivers/spi/spi_loopback/boards/stm32f3_disco.conf index 016bb0000d9..469620fed4e 100644 --- a/tests/drivers/spi/spi_loopback/boards/stm32f3_disco.conf +++ b/tests/drivers/spi/spi_loopback/boards/stm32f3_disco.conf @@ -1,2 +1 @@ CONFIG_SPI_LOOPBACK_MODE_LOOP=y -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15 From 2cc77dd6ab01470be3be81b7f369cf1737e6efa0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 455/881] Revert "[nrf fromtree] tests: drivers: spi: spi_loopback: enable nucleo_c071rb to run test again" This reverts commit 3591996aab8a02ed34945283da4fac64fb72fec9. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf b/tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf index 895eddcb0c0..5e05f18f57a 100644 --- a/tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf +++ b/tests/drivers/spi/spi_loopback/boards/nucleo_c071rb.conf @@ -1 +1 @@ -CONFIG_SPI_LARGE_BUFFER_SIZE=4500 +CONFIG_SPI_LARGE_BUFFER_SIZE=8000 From c22e648648d2c5e4efa3aef6932f09cf54071270 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 456/881] Revert "[nrf fromtree] tests: drivers: spi: spi_loopback: Add NULL spi_buf_set test" This reverts commit fb2fba2bdbeb9c5e128f1ac0cb597163cef0c8df. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index 1e6b99ae947..39a2efb9464 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -572,13 +572,6 @@ ZTEST(spi_loopback, test_spi_null_rx_buf_set) spi_loopback_transceive(spec, &tx, NULL); } -ZTEST(spi_loopback, test_spi_null_tx_rx_buf_set) -{ - struct spi_dt_spec *spec = loopback_specs[spec_idx]; - - spi_loopback_transceive(spec, NULL, NULL); -} - ZTEST(spi_loopback, test_nop_nil_bufs) { struct spi_dt_spec *spec = loopback_specs[spec_idx]; From 8aaf743c52fe0417040d9e68dfffcc18adbe28c7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 457/881] Revert "[nrf fromtree] tests: spi: loopback: get spi controller before timed transfer" This reverts commit 5336faa47576ef444d8dd58c8ad00310a427bae3. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index 39a2efb9464..4a744bf3554 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -293,19 +293,11 @@ ZTEST(spi_loopback, test_spi_complete_multiple_timed) uint32_t start_time, end_time, cycles_spent; uint64_t time_spent_us, expected_transfer_time_us, latency_measurement; - /* - * spi_loopback_transceive() does an inline pm_device_runtime_get(), but since we are - * timing the transfer, we need to get the SPI controller before we start the measurement. - */ - zassert_ok(pm_device_runtime_get(spec->bus)); - /* since this is a test program, there shouldn't be much to interfere with measurement */ start_time = k_cycle_get_32(); spi_loopback_transceive(spec, &tx, &rx); end_time = k_cycle_get_32(); - zassert_ok(pm_device_runtime_put(spec->bus)); - if (end_time >= start_time) { cycles_spent = end_time - start_time; } else { From bafc60c2229ac92e5eca529194f2ff00042e0ca1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 458/881] Revert "[nrf fromtree] tests: drivers: spi: Add configuration for SPI test on RX130" This reverts commit 3bdeaeaa7108ed383e4db88730c5df1c26a93036. Signed-off-by: Jukka Rissanen --- .../spi_loopback/boards/rsk_rx130_512kb.overlay | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/rsk_rx130_512kb.overlay diff --git a/tests/drivers/spi/spi_loopback/boards/rsk_rx130_512kb.overlay b/tests/drivers/spi/spi_loopback/boards/rsk_rx130_512kb.overlay deleted file mode 100644 index ae5393b8811..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/rsk_rx130_512kb.overlay +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&rspi0 { - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = <1000000>; - }; - fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = <3000000>; - }; -}; From fa63e59b3b4beb0cfafea02ebc469fdec76cffa2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 459/881] Revert "[nrf fromtree] tests: drivers: spi_loopback: Fix NULL rx buff testcase" This reverts commit fd0737fb29668f75a520d45d82e10693890e757c. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index 4a744bf3554..fd2302a4ec0 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -559,7 +559,7 @@ ZTEST(spi_loopback, test_spi_null_rx_buf_set) { struct spi_dt_spec *spec = loopback_specs[spec_idx]; const struct spi_buf_set tx = spi_loopback_setup_xfer(tx_bufs_pool, 1, - buffer_tx, BUF_SIZE); + NULL, BUF_SIZE); spi_loopback_transceive(spec, &tx, NULL); } From f485cc40e74881d7d462475fe574dcb316f8aab3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 460/881] Revert "[nrf fromtree] tests: drivers: spi: spi_error_cases: Cleanup after nRF54LM20 rename" This reverts commit 78dfbbb4bdd608fedd4ed855b0c44e8fcd10d9ec. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 78 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 1 - .../drivers/spi/spi_error_cases/testcase.yaml | 2 +- 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 tests/drivers/spi/spi_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/spi/spi_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/spi/spi_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..c723ff2cbd2 --- /dev/null +++ b/tests/drivers/spi/spi_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + spi22_default_alt: spi22_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi22_sleep_alt: spi22_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + spi21_default_alt: spi21_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spi21_sleep_alt: spi21_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; + +}; + + +&gpio1 { + status = "okay"; +}; + +&spi22 { + status = "okay"; + pinctrl-0 = <&spi22_default_alt>; + pinctrl-1 = <&spi22_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; + dut_spi_dt: test-spi-dev@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = <4000000>; + }; +}; + +dut_spis: &spi21 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spi21_default_alt>; + pinctrl-1 = <&spi21_sleep_alt>; + pinctrl-names = "default", "sleep"; + /delete-property/rx-delay-supported; + /delete-property/rx-delay; +}; + +&uicr { + nfct-pins-as-gpios; +}; diff --git a/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 25d68cd4dfa..541fdbb96de 100644 --- a/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -62,7 +62,6 @@ overrun-character = <0x00>; cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_error_cases/testcase.yaml b/tests/drivers/spi/spi_error_cases/testcase.yaml index 9ad509baddb..8e5ae335edd 100644 --- a/tests/drivers/spi/spi_error_cases/testcase.yaml +++ b/tests/drivers/spi/spi_error_cases/testcase.yaml @@ -6,13 +6,13 @@ common: harness: ztest harness_config: fixture: gpio_spi_loopback - timeout: 30 tests: drivers.spi.spi_error_cases: platform_allow: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From f6912f01ab01468fbef80fd71525081c62fd71c7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 461/881] Revert "[nrf fromtree] tests: drivers: spi: spi_controller_peripheral: Disable on nRF54L20pdk" This reverts commit ffefffbb4bc65810f9e3e505671e275ed272b297. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 79 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 1 - .../spi_controller_peripheral/testcase.yaml | 11 ++- 3 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..fe004aa7695 --- /dev/null +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + spi22_default_alt: spi22_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi22_sleep_alt: spi22_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + spi21_default_alt: spi21_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spi21_sleep_alt: spi21_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; + +}; + + +&gpio1 { + status = "okay"; +}; + +&spi22 { + status = "okay"; + pinctrl-0 = <&spi22_default_alt>; + pinctrl-1 = <&spi22_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; + zephyr,pm-device-runtime-auto; + dut_spi_dt: test-spi-dev@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +dut_spis: &spi21 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spi21_default_alt>; + pinctrl-1 = <&spi21_sleep_alt>; + pinctrl-names = "default", "sleep"; + /delete-property/rx-delay-supported; + /delete-property/rx-delay; +}; + +&uicr { + nfct-pins-as-gpios; +}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 25d68cd4dfa..541fdbb96de 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -62,7 +62,6 @@ overrun-character = <0x00>; cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 10365d8014d..cfcf7c149f0 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -8,11 +8,12 @@ common: fixture: gpio_spi_loopback platform_allow: - nrf52840dk/nrf52840 + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp tests: @@ -78,9 +79,10 @@ tests: extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" platform_exclude: - nrf52840dk/nrf52840 + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -91,9 +93,10 @@ tests: extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay" platform_exclude: - nrf52840dk/nrf52840 + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From 22de92a891b4d630c686611ef283714ece4d1f32 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 462/881] Revert "[nrf fromtree] tests: spi: Add overlay for frdm_mcxa156 dual test" This reverts commit f71141c302d80ed541476f14498d998b0a50eb23. Signed-off-by: Jukka Rissanen --- .../boards/frdm_mcxa156.overlay | 31 ------------------- .../spi/spi_controller_peripheral/src/main.c | 3 +- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/frdm_mcxa156.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/frdm_mcxa156.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/frdm_mcxa156.overlay deleted file mode 100644 index c533c11b4fd..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/frdm_mcxa156.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2025 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/ { - zephyr,user { - peripheral-cs = <1>; - }; -}; - -&lpspi0 { - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <10000000>; - }; - transfer-delay = <100>; - sck-pcs-delay = <10>; - pcs-sck-delay = <10>; - /* lower the master interrupt priority so slave can interrupt */ - interrupts = <28 1>; - label = "spi_master"; -}; - -dut_spis: &lpspi1 { - label = "spi_slave"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/src/main.c b/tests/drivers/spi/spi_controller_peripheral/src/main.c index 04c6c27d11a..997e6f5f91f 100644 --- a/tests/drivers/spi/spi_controller_peripheral/src/main.c +++ b/tests/drivers/spi/spi_controller_peripheral/src/main.c @@ -28,8 +28,7 @@ static struct spi_dt_spec spim = SPI_DT_SPEC_GET(DT_NODELABEL(dut_spi_dt), SPIM_OP, 0); static const struct device *spis_dev = DEVICE_DT_GET(DT_NODELABEL(dut_spis)); static const struct spi_config spis_config = { - .operation = SPIS_OP, - .slave = DT_PROP_OR(DT_PATH(zephyr_user), peripheral_cs, 0), + .operation = SPIS_OP }; static struct k_poll_signal async_sig = K_POLL_SIGNAL_INITIALIZER(async_sig); From 5c166ab760c324b341e5bf4d869fc10fb10d302b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 463/881] Revert "[nrf fromtree] tests: drivers: spi: Add support spi_controller_peripheral for RA" This reverts commit c0c66df803c8cd341275a719c2f7d76c6138bc15. Signed-off-by: Jukka Rissanen --- .../boards/ek_ra2a1.conf | 6 --- .../boards/ek_ra2a1.overlay | 50 ----------------- .../boards/ek_ra4m1.conf | 6 --- .../boards/ek_ra4m1.overlay | 50 ----------------- .../boards/ek_ra6e2.conf | 6 --- .../boards/ek_ra6e2.overlay | 52 ------------------ .../boards/ek_ra6m1.conf | 6 --- .../boards/ek_ra6m1.overlay | 54 ------------------- .../boards/ek_ra6m2.conf | 6 --- .../boards/ek_ra6m2.overlay | 54 ------------------- .../boards/ek_ra6m3.conf | 6 --- .../boards/ek_ra6m3.overlay | 54 ------------------- .../boards/ek_ra6m4.conf | 6 --- .../boards/ek_ra6m4.overlay | 52 ------------------ .../boards/ek_ra6m5.conf | 6 --- .../boards/ek_ra6m5.overlay | 52 ------------------ .../boards/fpb_ra6e2.conf | 6 --- .../boards/fpb_ra6e2.overlay | 52 ------------------ 18 files changed, 524 deletions(-) delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra2a1.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra2a1.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra4m1.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra4m1.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6e2.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6e2.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m1.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m1.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m2.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m2.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m3.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m3.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m4.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m4.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m5.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m5.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/fpb_ra6e2.conf delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/fpb_ra6e2.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra2a1.conf b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra2a1.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra2a1.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra2a1.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra2a1.overlay deleted file mode 100644 index d9660d950ac..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra2a1.overlay +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport1 12 GPIO_ACTIVE_LOW>; - interrupts = <24 1>, <25 1>, <26 1>, <27 1>; - interrupt-names = "rxi", "txi", "tei", "eri"; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport2 6 GPIO_ACTIVE_LOW>; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra4m1.conf b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra4m1.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra4m1.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra4m1.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra4m1.overlay deleted file mode 100644 index 8efced0263c..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra4m1.overlay +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK SSL */ - psels = , - , - , - ; - }; - }; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport4 13 GPIO_ACTIVE_LOW>; - interrupts = <23 1>, <24 1>, <25 1>, <26 1>; - interrupt-names = "rxi", "txi", "tei", "eri"; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6e2.conf b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6e2.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6e2.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6e2.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6e2.overlay deleted file mode 100644 index e58fa671a9a..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6e2.overlay +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK SSL */ - psels = , - , - , - ; - }; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport3 1 GPIO_ACTIVE_LOW>; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m1.conf b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m1.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m1.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m1.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m1.overlay deleted file mode 100644 index 521edfef067..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m1.overlay +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK SSL */ - psels = , - , - , - ; - }; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport1 3 GPIO_ACTIVE_LOW>; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; - interrupts = <92 1>, <93 1>, <94 1>, <95 1>; - interrupt-names = "rxi", "txi", "tei", "eri"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m2.conf b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m2.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m2.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m2.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m2.overlay deleted file mode 100644 index 521edfef067..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m2.overlay +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK SSL */ - psels = , - , - , - ; - }; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport1 3 GPIO_ACTIVE_LOW>; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; - interrupts = <92 1>, <93 1>, <94 1>, <95 1>; - interrupt-names = "rxi", "txi", "tei", "eri"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m3.conf b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m3.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m3.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m3.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m3.overlay deleted file mode 100644 index 03de19136a1..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m3.overlay +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK SSL */ - psels = , - , - , - ; - }; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport1 3 GPIO_ACTIVE_LOW>; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; - interrupts = <92 1>, <93 1>, <94 1>, <95 1>; - interrupt-names = "rxi", "txi", "tei", "eri"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m4.conf b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m4.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m4.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m4.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m4.overlay deleted file mode 100644 index 1cf25c94f2b..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m4.overlay +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK SSL */ - psels = , - , - , - ; - }; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport1 8 GPIO_ACTIVE_LOW>; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m5.conf b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m5.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m5.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m5.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m5.overlay deleted file mode 100644 index 1cf25c94f2b..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/ek_ra6m5.overlay +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK SSL */ - psels = , - , - , - ; - }; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport1 8 GPIO_ACTIVE_LOW>; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/fpb_ra6e2.conf b/tests/drivers/spi/spi_controller_peripheral/boards/fpb_ra6e2.conf deleted file mode 100644 index d241d5b0956..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/fpb_ra6e2.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SPI_INTERRUPT=y -CONFIG_SPI_RA_DTC=y -CONFIG_TESTED_SPI_MODE=1 diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/fpb_ra6e2.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/fpb_ra6e2.overlay deleted file mode 100644 index e58fa671a9a..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/fpb_ra6e2.overlay +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi0_default_alt: spi0_default_alt { - group1 { - /* MISO MOSI RSPCK */ - psels = , - , - ; - }; - }; - - spi1_default_alt: spi1_default_alt { - group1 { - /* MISO MOSI RSPCK SSL */ - psels = , - , - , - ; - }; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&spi0 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi0_default_alt>; - pinctrl-names = "default"; - cs-gpios = <&ioport3 1 GPIO_ACTIVE_LOW>; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <1000000>; - }; -}; - -dut_spis: &spi1 { - rx-dtc; - tx-dtc; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-names = "default"; -}; From 8b2d1d73cbe4a1826b09602c735ec84970952b92 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 464/881] Revert "[nrf fromtree] tests: drivers: sensor: temp_sensor: Cleanup after nRF54LM20 rename" This reverts commit be29496b415f11167ec1a79b5a59fbfc963d269d. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_cpuapp.overlay | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/drivers/sensor/temp_sensor/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/sensor/temp_sensor/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/sensor/temp_sensor/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..b1f2a2b9ec5 --- /dev/null +++ b/tests/drivers/sensor/temp_sensor/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +temp_sensor: &temp { + status = "okay"; +}; From 666ccfe924c42770df7971887d44024d1b724dae Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 465/881] Revert "[nrf fromtree] tests: drivers: retianed_mem: api: Cleanup after nRF54LM20 rename" This reverts commit 7afa0ecf6f992b1e741b31629c644c1f7cafcd43. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_cpuapp.conf | 1 + .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 25 +++++++++++++++++++ tests/drivers/retained_mem/api/testcase.yaml | 1 + 3 files changed, 27 insertions(+) create mode 100644 tests/drivers/retained_mem/api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf create mode 100644 tests/drivers/retained_mem/api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/retained_mem/api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf b/tests/drivers/retained_mem/api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf new file mode 100644 index 00000000000..c15ba3ed96d --- /dev/null +++ b/tests/drivers/retained_mem/api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_POWEROFF=y diff --git a/tests/drivers/retained_mem/api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/retained_mem/api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..dc81069eca5 --- /dev/null +++ b/tests/drivers/retained_mem/api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,25 @@ +/ { + cpuapp_sram@2007ec00 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2007ec00 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemtestdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + /* Shrink SRAM size to avoid overlap with retained memory region: + * 511 - 4 = 507KB = 0x7ec00 + */ + reg = <0x20000000 DT_SIZE_K(507)>; + ranges = <0x0 0x20000000 0x7ec00>; +}; diff --git a/tests/drivers/retained_mem/api/testcase.yaml b/tests/drivers/retained_mem/api/testcase.yaml index 88bd6ae16ff..ddcc005a16a 100644 --- a/tests/drivers/retained_mem/api/testcase.yaml +++ b/tests/drivers/retained_mem/api/testcase.yaml @@ -14,6 +14,7 @@ tests: - nrf54l15dk/nrf54l05/cpuapp - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From d90f0a839896559a9607cf68e83d97f477b3c589 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 466/881] Revert "[nrf fromtree] tests: drivers: pwm: pwm_gpio_loopback: Enable test on nrf54lm20dk" This reverts commit a61cbeb6ea3be414cf12154fc0a012e6aa51a6cf. Signed-off-by: Jukka Rissanen --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 36 ------------------- .../pwm/pwm_gpio_loopback/testcase.yaml | 1 - 3 files changed, 38 deletions(-) delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 795414a504a..00000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SKIP_EDGE_NUM=4 diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 89ff80dcb67..00000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - * - * Test requires jumper between: - * - PWM20 OUT[0] at P1.29 <-> GPIO input at P1.00 - */ - -/ { - zephyr,user { - pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>; - gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; - }; -}; - -&pinctrl { - pwm20_alt: pwm20_alt { - group1 { - psels = ; - }; - }; - - pwm20_alt_sleep: pwm20_alt_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; -}; - -&pwm20 { - status = "okay"; - pinctrl-0 = <&pwm20_alt>; - pinctrl-1 = <&pwm20_alt_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml index 99e22b54374..7173c8c2720 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml @@ -20,5 +20,4 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From f68d4a902d20396448934c9ddf7d17b07cdb6501 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 467/881] Revert "[nrf fromtree] tests: drivers: i2s: i2s_speed: Cleanup after nRF54LM20 rename" This reverts commit e97e2089ee0d97a22c1d27109418d0cae0397450. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..09a2cb0459c --- /dev/null +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; From 0d7ecb86b42c17f84f7905d80e880c2ac48cbba9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 468/881] Revert "[nrf fromtree] tests: drivers: i2s: i2s_api: Cleanup after nRF54LM20 rename" This reverts commit c33da1a26e8fc434bc6f907f74371ffd98c5dc4b. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..09a2cb0459c --- /dev/null +++ b/tests/drivers/i2s/i2s_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; From f4c718cfca62163e865b3f10cdd561219dfbf554 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 469/881] Revert "[nrf fromtree] tests: drivers: i2s: i2s_additional: Enable test on nrf54lm20dk" This reverts commit ecc4c9dd57394f4b7de062b8d1aa58cae266434c. Signed-off-by: Jukka Rissanen --- ...0a_cpuapp.overlay => nrf54lm20pdk_nrf54lm20a_cpuapp.overlay} | 0 tests/drivers/i2s/i2s_additional/testcase.yaml | 2 -- 2 files changed, 2 deletions(-) rename tests/drivers/i2s/i2s_additional/boards/{nrf54lm20dk_nrf54lm20a_cpuapp.overlay => nrf54lm20pdk_nrf54lm20a_cpuapp.overlay} (100%) diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay similarity index 100% rename from tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay rename to tests/drivers/i2s/i2s_additional/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/i2s/i2s_additional/testcase.yaml b/tests/drivers/i2s/i2s_additional/testcase.yaml index 9dcb82d61f3..c45a5482b7f 100644 --- a/tests/drivers/i2s/i2s_additional/testcase.yaml +++ b/tests/drivers/i2s/i2s_additional/testcase.yaml @@ -16,12 +16,10 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp drivers.i2s.additional.gpio_loopback.54h: harness_config: From 2febea028a7279ecd5935ff39aa1af2dbd64b969 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 470/881] Revert "[nrf fromtree] tests: drivers: i2c: i2c_target_api: Cleanup after nRF54LM20 rename" This reverts commit ce520ebeb547e1c31d0fe079a39b1658811612ab. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_cpuapp.conf | 1 + .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 68 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 6 -- .../drivers/i2c/i2c_target_api/testcase.yaml | 2 +- 4 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf b/tests/drivers/i2c/i2c_target_api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf new file mode 100644 index 00000000000..2510d6673c1 --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54l20pdk_nrf54l20_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..f04022cf8f3 --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,68 @@ +/* + * SDA = P1.8 and P1.9 + * SCL = P1.14 and P1.15 + */ + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default: i2c22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep: i2c22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; + + eeprom1: eeprom@56 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x56>; + address-width = <8>; + size = <256>; + }; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c22_default>; + pinctrl-1 = <&i2c22_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; + + eeprom0: eeprom@54 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x54>; + address-width = <8>; + size = <256>; + }; +}; diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index f6d76c7253c..3459599351b 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - /* * SDA = P1.13 and P1.14 * SCL = P1.23 and P1.24 diff --git a/tests/drivers/i2c/i2c_target_api/testcase.yaml b/tests/drivers/i2c/i2c_target_api/testcase.yaml index 8c95390a72c..7f888f95e12 100644 --- a/tests/drivers/i2c/i2c_target_api/testcase.yaml +++ b/tests/drivers/i2c/i2c_target_api/testcase.yaml @@ -64,8 +64,8 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - max32690evkit/max32690/m4 - - nrf54l15dk/nrf54l15/cpuapp From 445297e0936682878cb673ab60aaec7d44a9d1d9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:22 +0300 Subject: [PATCH 471/881] Revert "[nrf fromtree] tests: drivers: gpio: gpio_basic_api: Cleanup after nRF54LM20 rename" This reverts commit 05bc31c35dd033829b327518ef8237699a95ee31. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_common.overlay | 21 +++++++++++++++++++ .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 7 +++++++ .../nrf54l20pdk_nrf54l20_cpuflpr.overlay | 7 +++++++ 3 files changed, 35 insertions(+) create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_common.overlay create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_common.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_common.overlay new file mode 100644 index 00000000000..8eb1b3c9f9f --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_common.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + resources { + compatible = "test-gpio-basic-api"; + out-gpios = <&gpio1 10 0>; + in-gpios = <&gpio1 11 0>; + }; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..3ed56c4a6c8 --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l20pdk_nrf54l20_common.overlay" diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay new file mode 100644 index 00000000000..91c033f0f94 --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l20pdk_nrf54l20_common.overlay" From 0adfd90d070dd476f69f9afb096b78a17f3cfff2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 472/881] Revert "[nrf fromtree] tests: drivers: flash: negative_tests: Cleanup after nRF54LM20 rename" This reverts commit 7961ea2e40a08554222ee5d3d720030f81ac1b9b. Signed-off-by: Jukka Rissanen --- tests/drivers/flash/negative_tests/testcase.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/drivers/flash/negative_tests/testcase.yaml b/tests/drivers/flash/negative_tests/testcase.yaml index 7a55212aa3f..3321a0273ba 100644 --- a/tests/drivers/flash/negative_tests/testcase.yaml +++ b/tests/drivers/flash/negative_tests/testcase.yaml @@ -5,8 +5,9 @@ common: tests: drivers.flash.negative_tests: platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp From 2d2133e8cf1d10eb905fa8304b0ae32f56af5114 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 473/881] Revert "[nrf fromtree] tests: drivers: flash: common: Cleanup after nRF54LM20 rename" This reverts commit 9c2ac9b66ba71b50e330f8ada6ed7a6f30b8c8e6. Signed-off-by: Jukka Rissanen --- .../flash/common/boards/nrf54l20pdk_nrf54l20_cpuapp.conf | 4 ++++ .../common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 --------- tests/drivers/flash/common/testcase.yaml | 9 ++------- 3 files changed, 6 insertions(+), 16 deletions(-) create mode 100644 tests/drivers/flash/common/boards/nrf54l20pdk_nrf54l20_cpuapp.conf delete mode 100644 tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/flash/common/boards/nrf54l20pdk_nrf54l20_cpuapp.conf b/tests/drivers/flash/common/boards/nrf54l20pdk_nrf54l20_cpuapp.conf new file mode 100644 index 00000000000..821a5e77e5b --- /dev/null +++ b/tests/drivers/flash/common/boards/nrf54l20pdk_nrf54l20_cpuapp.conf @@ -0,0 +1,4 @@ +CONFIG_FCB=y +CONFIG_FLASH_MAP=y +CONFIG_SETTINGS=y +CONFIG_SETTINGS_FCB=y diff --git a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 8a5afda2ab0..00000000000 --- a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - status = "okay"; -}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 0433d024ff1..cabd1ffa0c6 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -37,8 +37,6 @@ tests: filter: ((CONFIG_FLASH_HAS_DRIVER_ENABLED and not CONFIG_TRUSTED_EXECUTION_NONSECURE) and (dt_label_with_parent_compat_enabled("storage_partition", "fixed-partitions") or dt_label_with_parent_compat_enabled("storage_partition", "nordic,owned-partitions"))) - platform_exclude: - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - qemu_x86 - mimxrt1060_evk/mimxrt1062/qspi @@ -48,13 +46,10 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp - drivers.flash.common.nrf54lm20a: - platform_allow: - - nrf54lm20dk/nrf54lm20a/cpuapp - harness_config: - fixture: external_flash drivers.flash.common.tfm_ns: build_only: true filter: (CONFIG_FLASH_HAS_DRIVER_ENABLED and CONFIG_TRUSTED_EXECUTION_NONSECURE From 169c6997a4adf44c55a8e51da16e9af52643a56a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 474/881] Revert "[nrf fromtree] tests: drivers: flash: common: Fix page size when no erase is required" This reverts commit a0452de0058be9ce382626ac65bbe559f380f458. Signed-off-by: Jukka Rissanen --- tests/drivers/flash/common/src/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index ab0e63bb609..03b3c08a6cf 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -87,8 +87,7 @@ static void flash_driver_before(void *arg) TC_PRINT("No devices with erase requirement present\n"); erase_value = 0x55; page_info.start_offset = TEST_AREA_OFFSET; - /* test_flash_copy uses 2 pages, so split the test area */ - page_info.size = (TEST_AREA_MAX - TEST_AREA_OFFSET) / 2; + page_info.size = TEST_AREA_MAX - TEST_AREA_OFFSET; } @@ -112,10 +111,6 @@ static void flash_driver_before(void *arg) zassert_true((TEST_AREA_OFFSET + EXPECTED_SIZE) <= TEST_AREA_MAX, "Test area exceeds flash size"); - /* Check if test region is suitable for test_flash_copy */ - zassert_true((TEST_AREA_OFFSET + 2 * page_info.size) <= TEST_AREA_MAX, - "test_flash_copy needs 2 flash pages"); - /* Check if flash is cleared */ if (IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && ebw_required) { bool is_buf_clear = true; From 930ce5e00ea162560d8a815a4d3090637e57cbac Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 475/881] Revert "[nrf fromtree] tests: drivers: flash: Add support "common" for Renesas OSPI_B" This reverts commit 876fd2b657036090816aebce0b9acb19d087965d. Signed-off-by: Jukka Rissanen --- tests/drivers/flash/common/boards/ek_ra8d1.overlay | 4 ---- .../flash/common/boards/ek_ra8d1_ospi_b_nor.conf | 4 ---- .../flash/common/boards/ek_ra8d1_ospi_b_nor.overlay | 10 ---------- tests/drivers/flash/common/boards/ek_ra8m1.overlay | 4 ---- .../flash/common/boards/ek_ra8m1_ospi_b_nor.conf | 4 ---- .../flash/common/boards/ek_ra8m1_ospi_b_nor.overlay | 10 ---------- tests/drivers/flash/common/src/main.c | 10 +--------- tests/drivers/flash/common/testcase.yaml | 7 ------- 8 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 tests/drivers/flash/common/boards/ek_ra8d1_ospi_b_nor.conf delete mode 100644 tests/drivers/flash/common/boards/ek_ra8d1_ospi_b_nor.overlay delete mode 100644 tests/drivers/flash/common/boards/ek_ra8m1_ospi_b_nor.conf delete mode 100644 tests/drivers/flash/common/boards/ek_ra8m1_ospi_b_nor.overlay diff --git a/tests/drivers/flash/common/boards/ek_ra8d1.overlay b/tests/drivers/flash/common/boards/ek_ra8d1.overlay index ee45617b009..8e42c66387c 100644 --- a/tests/drivers/flash/common/boards/ek_ra8d1.overlay +++ b/tests/drivers/flash/common/boards/ek_ra8d1.overlay @@ -18,7 +18,3 @@ }; }; }; - -&s28hl512t { - status = "disabled"; -}; diff --git a/tests/drivers/flash/common/boards/ek_ra8d1_ospi_b_nor.conf b/tests/drivers/flash/common/boards/ek_ra8d1_ospi_b_nor.conf deleted file mode 100644 index 349d703d783..00000000000 --- a/tests/drivers/flash/common/boards/ek_ra8d1_ospi_b_nor.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_TEST_DRIVER_FLASH_SIZE=67108864 diff --git a/tests/drivers/flash/common/boards/ek_ra8d1_ospi_b_nor.overlay b/tests/drivers/flash/common/boards/ek_ra8d1_ospi_b_nor.overlay deleted file mode 100644 index cb05c656afa..00000000000 --- a/tests/drivers/flash/common/boards/ek_ra8d1_ospi_b_nor.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -/delete-node/ &storage_partition; - -&s28hl512t { - status = "okay"; -}; diff --git a/tests/drivers/flash/common/boards/ek_ra8m1.overlay b/tests/drivers/flash/common/boards/ek_ra8m1.overlay index ee45617b009..8e42c66387c 100644 --- a/tests/drivers/flash/common/boards/ek_ra8m1.overlay +++ b/tests/drivers/flash/common/boards/ek_ra8m1.overlay @@ -18,7 +18,3 @@ }; }; }; - -&s28hl512t { - status = "disabled"; -}; diff --git a/tests/drivers/flash/common/boards/ek_ra8m1_ospi_b_nor.conf b/tests/drivers/flash/common/boards/ek_ra8m1_ospi_b_nor.conf deleted file mode 100644 index 349d703d783..00000000000 --- a/tests/drivers/flash/common/boards/ek_ra8m1_ospi_b_nor.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 Renesas Electronics Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_TEST_DRIVER_FLASH_SIZE=67108864 diff --git a/tests/drivers/flash/common/boards/ek_ra8m1_ospi_b_nor.overlay b/tests/drivers/flash/common/boards/ek_ra8m1_ospi_b_nor.overlay deleted file mode 100644 index cb05c656afa..00000000000 --- a/tests/drivers/flash/common/boards/ek_ra8m1_ospi_b_nor.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -/delete-node/ &storage_partition; - -&s28hl512t { - status = "okay"; -}; diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index 03b3c08a6cf..fa2fd053fd8 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -12,8 +12,6 @@ #if defined(CONFIG_NORDIC_QSPI_NOR) #define TEST_AREA_DEV_NODE DT_INST(0, nordic_qspi_nor) -#elif defined(CONFIG_FLASH_RENESAS_RA_OSPI_B) -#define TEST_AREA_DEV_NODE DT_INST(0, renesas_ra_ospi_b_nor) #elif defined(CONFIG_SPI_NOR) #define TEST_AREA_DEV_NODE DT_INST(0, jedec_spi_nor) #elif defined(CONFIG_FLASH_MSPI_NOR) @@ -34,18 +32,12 @@ #elif defined(TEST_AREA_DEV_NODE) #define TEST_AREA_DEVICE DEVICE_DT_GET(TEST_AREA_DEV_NODE) -#if defined CONFIG_FLASH_RENESAS_RA_OSPI_B -#define TEST_AREA_OFFSET 0x40000 -#else #define TEST_AREA_OFFSET 0xff000 -#endif #if DT_NODE_HAS_PROP(TEST_AREA_DEV_NODE, size_in_bytes) #define TEST_AREA_MAX DT_PROP(TEST_AREA_DEV_NODE, size_in_bytes) -#elif DT_NODE_HAS_PROP(TEST_AREA_DEV_NODE, size) -#define TEST_AREA_MAX (DT_PROP(TEST_AREA_DEV_NODE, size) / 8) #else -#define TEST_AREA_MAX DT_REG_SIZE(TEST_AREA_DEV_NODE) +#define TEST_AREA_MAX (DT_PROP(TEST_AREA_DEV_NODE, size) / 8) #endif #else diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index cabd1ffa0c6..a46ecb50e11 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -139,10 +139,3 @@ tests: filter: dt_compat_enabled("soc-nv-flash") and dt_compat_enabled("jedec,spi-nor") extra_args: - CONFIG_SPI_NOR=n - drivers.flash.common.ra_ospi_b_nor: - platform_allow: - - ek_ra8m1 - - ek_ra8d1 - extra_args: - - DTC_OVERLAY_FILE="./boards/${BOARD}_ospi_b_nor.overlay" - - CONF_FILE="./prj.conf ./boards/${BOARD}_ospi_b_nor.conf" From 5c31ad1d928bff28354e6d3785ccc7de606347bf Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 476/881] Revert "[nrf fromtree] tests: drivers: counter: counter_basic_api: Cleanup after nRF54LM20 rename" This reverts commit 72768a79687f96c2d11144165a53953ca2cfe865. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_common.dtsi | 36 +++++++++++++++++++ .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 3 ++ .../nrf54l20pdk_nrf54l20_cpuflpr.overlay | 3 ++ 3 files changed, 42 insertions(+) create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_common.dtsi create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_common.dtsi b/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_common.dtsi new file mode 100644 index 00000000000..72941675287 --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_common.dtsi @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&timer00 { + prescaler = <6>; + status = "okay"; +}; + +&timer10 { + prescaler = <4>; + status = "okay"; +}; + +&timer20 { + prescaler = <4>; + status = "okay"; +}; + +&timer21 { + prescaler = <4>; + status = "okay"; +}; + +&timer22 { + prescaler = <4>; + status = "okay"; +}; + +&timer23 { + prescaler = <4>; + status = "okay"; +}; + +&timer24 { + prescaler = <4>; + status = "okay"; +}; diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..42b2852a09f --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +#include "nrf54l20pdk_nrf54l20_common.dtsi" diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay new file mode 100644 index 00000000000..42b2852a09f --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +#include "nrf54l20pdk_nrf54l20_common.dtsi" From 29efdd0f68d7619fb2e63e9ba7fa725889ad1ffc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 477/881] Revert "[nrf fromtree] tests: drivers: comparator: gpio_loopback: Enable test on nrf54lm20dk" This reverts commit df2fdfe5be6749b681f3ce45e2685fbd58170cd7. Signed-off-by: Jukka Rissanen --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 16 ------------ .../snippets/nrf_comp/snippet.yml | 9 +++---- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 12 --------- .../snippets/nrf_lpcomp/snippet.yml | 9 +++---- .../comparator/gpio_loopback/testcase.yaml | 6 ++--- 6 files changed, 8 insertions(+), 69 deletions(-) delete mode 100644 tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 831e235d4c7..00000000000 --- a/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/* - * P1.30 looped back to P1.31 (AIN1) - */ - -/ { - aliases { - test-comp = ∁ - }; - - zephyr,user { - test-gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 2709df53195..00000000000 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&comp { - main-mode = "SE"; - psel = "AIN1"; /* P1.31 */ - refsel = "INT_1V2"; - sp-mode = "HIGH"; - th-up = <63>; - th-down = <59>; - isource = "DISABLED"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml index 9d876bfded0..79fffefe7f4 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml @@ -4,18 +4,15 @@ name: gpio_loopback_nrf_comp boards: - nrf5340dk/nrf5340/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay nrf54h20dk/nrf54h20/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay nrf54l15dk/nrf54l15/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay - nrf54lm20dk/nrf54lm20a/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay ophelia4ev/nrf54l15/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay + nrf5340dk/nrf5340/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 0f51a9951a1..00000000000 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&comp { - compatible = "nordic,nrf-lpcomp"; - psel = "AIN1"; /* P1.31 */ - refsel = "VDD_4_8"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml index c2a2005af4d..82a32cb517e 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml @@ -4,18 +4,15 @@ name: gpio_loopback_nrf_lpcomp boards: - nrf5340dk/nrf5340/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay nrf54h20dk/nrf54h20/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay nrf54l15dk/nrf54l15/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay - nrf54lm20dk/nrf54lm20a/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay ophelia4ev/nrf54l15/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay + nrf5340dk/nrf5340/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index bf0e7d127a0..cfeeabe3a69 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -20,17 +20,15 @@ tests: extra_args: - SNIPPET="gpio_loopback_nrf_comp" platform_allow: - - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: extra_args: - SNIPPET="gpio_loopback_nrf_lpcomp" platform_allow: - - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp From b36ced81896f0c3cd031426e880ccf94ce1d7d6a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 478/881] Revert "[nrf fromtree] tests: drivers: comparator: Add support gpio_loopback for ek_ra8p1" This reverts commit 6708442e4a60dfd78779a55068ff331262f97580. Signed-off-by: Jukka Rissanen --- .../ek_ra8p1_r7ka8p1kflcac_cm85.overlay | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 tests/drivers/comparator/gpio_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay diff --git a/tests/drivers/comparator/gpio_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay b/tests/drivers/comparator/gpio_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay deleted file mode 100644 index cccbaf04e93..00000000000 --- a/tests/drivers/comparator/gpio_loopback/boards/ek_ra8p1_r7ka8p1kflcac_cm85.overlay +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 Renesas Electronics Corporation - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/ { - aliases { - test-comp = &acmphs0; - }; - - zephyr,user { - test-gpios = <&ioport6 0 GPIO_ACTIVE_HIGH>; - }; -}; - -&pinctrl { - acmphs0_ivcmp0: acmphs0_ivcmp0 { - group1 { - /* CH0 IVCMP0 */ - psels = ; - renesas,analog-enable; - }; - }; -}; - -&acmphs_global { - status = "okay"; - - acmphs0 { - pinctrl-0 = <&acmphs0_ivcmp0>; - pinctrl-names = "default"; - interrupts = <90 12>; - interrupt-names = "hs"; - reference-input-source = "ivref2"; - compare-input-source = "ivcmp0"; - noise-filter = <1>; - status = "okay"; - }; -}; From 5aa5a9e84c12a3ac465511136b3bbcad38e29bd9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 479/881] Revert "[nrf fromtree] drivers: comparator: add it51xxx_evb analog comparator driver" This reverts commit 5f066f4842297dde8eb22e10fe6a021679c2f828. Signed-off-by: Jukka Rissanen --- boards/ite/it515xx_evb/it515xx_evb.dts | 8 - drivers/comparator/CMakeLists.txt | 1 - drivers/comparator/Kconfig | 1 - drivers/comparator/Kconfig.it51xxx_vcmp | 15 - drivers/comparator/comparator_it51xxx_vcmp.c | 408 ------------------ dts/bindings/comparator/ite,it51xxx-vcmp.yaml | 65 --- dts/riscv/ite/it51xxx.dtsi | 33 +- .../dt-bindings/comparator/it51xxx-vcmp.h | 21 - .../gpio_loopback/boards/it515xx_evb.conf | 4 - .../gpio_loopback/boards/it515xx_evb.overlay | 24 -- 10 files changed, 1 insertion(+), 579 deletions(-) delete mode 100644 drivers/comparator/Kconfig.it51xxx_vcmp delete mode 100644 drivers/comparator/comparator_it51xxx_vcmp.c delete mode 100644 dts/bindings/comparator/ite,it51xxx-vcmp.yaml delete mode 100644 include/zephyr/dt-bindings/comparator/it51xxx-vcmp.h delete mode 100644 tests/drivers/comparator/gpio_loopback/boards/it515xx_evb.conf delete mode 100644 tests/drivers/comparator/gpio_loopback/boards/it515xx_evb.overlay diff --git a/boards/ite/it515xx_evb/it515xx_evb.dts b/boards/ite/it515xx_evb/it515xx_evb.dts index 08c99ca1ebc..926c93bd921 100644 --- a/boards/ite/it515xx_evb/it515xx_evb.dts +++ b/boards/ite/it515xx_evb/it515xx_evb.dts @@ -153,11 +153,3 @@ &sha256 { status = "okay"; }; - -/* voltage comparator for test */ -&vcmp1 { - status = "okay"; - threshold-mv = <1500>; - scan-period = <0x4>; - io-channels = <&adc0 3>; -}; diff --git a/drivers/comparator/CMakeLists.txt b/drivers/comparator/CMakeLists.txt index bdbc9ce815c..5d8ef055461 100644 --- a/drivers/comparator/CMakeLists.txt +++ b/drivers/comparator/CMakeLists.txt @@ -8,7 +8,6 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_USERSPACE comparator_handlers.c) zephyr_library_sources_ifdef(CONFIG_COMPARATOR_SILABS_ACMP comparator_silabs_acmp.c) zephyr_library_sources_ifdef(CONFIG_COMPARATOR_FAKE_COMP comparator_fake_comp.c) -zephyr_library_sources_ifdef(CONFIG_COMPARATOR_IT51XXX_VCMP comparator_it51xxx_vcmp.c) zephyr_library_sources_ifdef(CONFIG_COMPARATOR_MCUX_ACMP comparator_mcux_acmp.c) zephyr_library_sources_ifdef(CONFIG_COMPARATOR_NRF_COMP comparator_nrf_comp.c) zephyr_library_sources_ifdef(CONFIG_COMPARATOR_NRF_LPCOMP comparator_nrf_lpcomp.c) diff --git a/drivers/comparator/Kconfig b/drivers/comparator/Kconfig index 07707385b05..2cc02c24085 100644 --- a/drivers/comparator/Kconfig +++ b/drivers/comparator/Kconfig @@ -20,7 +20,6 @@ config COMPARATOR_INIT_PRIORITY rsource "Kconfig.fake_comp" rsource "Kconfig.silabs_acmp" -rsource "Kconfig.it51xxx_vcmp" rsource "Kconfig.mcux_acmp" rsource "Kconfig.nrf_comp" rsource "Kconfig.nrf_lpcomp" diff --git a/drivers/comparator/Kconfig.it51xxx_vcmp b/drivers/comparator/Kconfig.it51xxx_vcmp deleted file mode 100644 index 2881beb779a..00000000000 --- a/drivers/comparator/Kconfig.it51xxx_vcmp +++ /dev/null @@ -1,15 +0,0 @@ -# ITE Voltage Comparator driver configuration options - -# Copyright (c) 2025 ITE Technology Corporation. -# SPDX-License-Identifier: Apache-2.0 - -config COMPARATOR_IT51XXX_VCMP - bool "ITE it51xxx Voltage Comparator" - default y - depends on ADC_ITE_IT51XXX - depends on DT_HAS_ITE_IT51XXX_VCMP_ENABLED - depends on DYNAMIC_INTERRUPTS - help - This option enables the ITE it51xxx voltage comparator, - it51xxx supports three 10-bit threshold voltage comparator - channels, and the input of each comparator comes from ADC pin. diff --git a/drivers/comparator/comparator_it51xxx_vcmp.c b/drivers/comparator/comparator_it51xxx_vcmp.c deleted file mode 100644 index e0a3e11b0c0..00000000000 --- a/drivers/comparator/comparator_it51xxx_vcmp.c +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Copyright (c) 2025 ITE Technology Corporation. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT ite_it51xxx_vcmp - -#include -#include -#include -#include -#include -#include - -#include - -#include -LOG_MODULE_REGISTER(comparator_it51xxx_vcmp, CONFIG_COMPARATOR_LOG_LEVEL); - -#define VCMP_CHANNEL_ID_REG_MASK GENMASK(2, 0) -#define VCMP_THRESHOLD BIT(10) -#ifdef CONFIG_ADC_IT51XXX_VOL_FULL_SCALE -#define VCMP_MAX_MVOLT 3300 -#else -#define VCMP_MAX_MVOLT 3000 -#endif - -/* 0x20, 0x28, 0x2c: Voltage Comparator n Control Register (VCMPnCTL) (n=0 to 2) */ -#define REG_VCMP_VCMP0CTL 0x20 -#define REG_VCMP_VCMP1CTL 0x28 -#define REG_VCMP_VCMP2CTL 0x2C -#define VCMP_CMPEN BIT(7) -#define VCMP_CMPINTEN BIT(6) -#define VCMP_GREATER_THRESHOLD BIT(5) -#define VCMP_CMP_EDGE_SENSED_MODE BIT(4) -const uint8_t vcmp_ctrl_reg[VCMP_CHANNEL_CNT] = {REG_VCMP_VCMP0CTL, REG_VCMP_VCMP1CTL, - REG_VCMP_VCMP2CTL}; - -/* 0x21, 0x29, 0x2D: Voltage Comparator n Status and Control Register (VCMPnSCTL) (n=0 to 2) */ -#define REG_VCMP_VCMP0SCTL 0x21 -#define REG_VCMP_VCMP1SCTL 0x29 -#define REG_VCMP_VCMP2SCTL 0x2D -#define VCMP_CMPXRTIS BIT(6) -const uint8_t vcmp_status_ctrl_reg[VCMP_CHANNEL_CNT] = {REG_VCMP_VCMP0SCTL, REG_VCMP_VCMP1SCTL, - REG_VCMP_VCMP2SCTL}; - -/* 0x22, 0x2A, 0x2E: Voltage Comparator 0~2 MSB Threshold Data Buffer (10-bit resolution) */ -#define REG_VCMP_CH_THRDATM 0x02 - -/* 0x23, 0x2B, 0x2F: Voltage Comparator 0~2 LSB Threshold Data Buffer (10-bit resolution) */ -#define REG_VCMP_CH_THRDATL 0x03 - -/* 0x33: Voltage Comparator Scan Period 2 (VCMPSCP2) */ -#define REG_VCMP_VCMPSCP2 0x33 -#define SCAN_PERIOD_MASK GENMASK(7, 4) - -/* Device config */ -struct vcmp_it51xxx_config { - /* Voltage comparator channel base address */ - uintptr_t base_ch; - /* Voltage comparator base address */ - uintptr_t reg_base; - /* Voltage comparator module irq */ - int irq; - /* Voltage comparator channel */ - int vcmp_ch; - /* Comparator 0/1/2 Scan Period */ - uint8_t scan_period; - /* Threshold assert value in mv */ - int32_t threshold_mv; - /* Pointer of ADC device that will be performing measurement */ - const struct device *adc; - /* Channel identifier */ - uint8_t channel_id; -}; - -/* Driver data */ -struct vcmp_it51xxx_data { - /* ADC channel config */ - struct adc_channel_cfg adc_ch_cfg; - comparator_callback_t user_cb; - void *user_cb_data; - uint8_t interrupt_mask; - atomic_t triggered; - /* Pointer of voltage comparator device */ - const struct device *vcmp; -}; -/* - * Because all the three voltage comparators use the same interrupt number, the - * 'irq_connect_dynamic' call in the driver init function sets the passed-in dev pointer in isr - * function to the first instantiated voltage comparator. - * - * For example, when setting vcmp2 and vcmp3 to 'status = "okay";' in dts file, each time an - * interrupt is triggered,the passed-in 'const struct device *dev' argument in isr function always - * points to vcmp2 device. - * - * To access the 'struct vcmp_it51xxx_data' of respective voltage comparator instance, we - * use a array to store their address. - */ -static struct vcmp_it51xxx_data *vcmp_data[VCMP_CHANNEL_CNT]; - -static void vcmp_irq_handler(const struct device *dev) -{ - struct vcmp_it51xxx_data *const data = dev->data; - - if (data->user_cb == NULL) { - atomic_set_bit(&data->triggered, 0); - return; - } - - data->user_cb(dev, data->user_cb_data); - atomic_clear_bit(&data->triggered, 0); -} - -static void clear_vcmp_status(const struct device *dev, int channel) -{ - const struct vcmp_it51xxx_config *const cfg = dev->config; - const uintptr_t reg_base = cfg->reg_base; - - sys_write8(sys_read8(reg_base + vcmp_status_ctrl_reg[channel]), - reg_base + vcmp_status_ctrl_reg[channel]); -} - -static int vcmp_set_threshold(const struct device *dev, int32_t threshold_mv) -{ - const struct vcmp_it51xxx_config *const cfg = dev->config; - const uintptr_t base_ch = cfg->base_ch; - int32_t reg_val; - - /* - * Tranfrom threshold from mv to raw - * NOTE: CMPXTHRDAT[9:0] = threshold(mv) * 1024 / 3000(mv) - */ - reg_val = (threshold_mv * VCMP_THRESHOLD / VCMP_MAX_MVOLT); - - if (reg_val >= VCMP_THRESHOLD) { - LOG_ERR("Vcmp%d threshold only support 10-bits", cfg->vcmp_ch); - return -ENOTSUP; - } - - /* Set threshold raw value */ - sys_write8(reg_val & 0xff, base_ch + REG_VCMP_CH_THRDATL); - sys_write8((reg_val >> 8) & 0xff, base_ch + REG_VCMP_CH_THRDATM); - - return 0; -} - -static void vcmp_set_attr(const struct device *dev, enum comparator_trigger trigger) -{ - const struct vcmp_it51xxx_config *const cfg = dev->config; - const uintptr_t base_ch = cfg->base_ch; - - /* Set lower or higher threshold */ - if (trigger == COMPARATOR_TRIGGER_RISING_EDGE) { - sys_write8(sys_read8(base_ch) | VCMP_GREATER_THRESHOLD, base_ch); - } else { - sys_write8(sys_read8(base_ch) & ~VCMP_GREATER_THRESHOLD, base_ch); - } -} - -static void vcmp_enable(const struct device *dev, bool enable) -{ - const struct vcmp_it51xxx_config *const cfg = dev->config; - const uintptr_t base_ch = cfg->base_ch; - - if (enable) { - /* Enable voltage comparator interrupt */ - sys_write8(sys_read8(base_ch) | VCMP_CMPINTEN, base_ch); - /* Start voltage comparator */ - sys_write8(sys_read8(base_ch) | VCMP_CMPEN, base_ch); - } else { - /* Disable voltage comparator interrupt */ - sys_write8(sys_read8(base_ch) & ~VCMP_CMPINTEN, base_ch); - /* Stop voltage comparator */ - sys_write8(sys_read8(base_ch) & ~VCMP_CMPEN, base_ch); - } -} - -static int it51xxx_vcmp_get_output(const struct device *dev) -{ - ARG_UNUSED(dev); - - LOG_ERR("Unsupported function: %s", __func__); - - return -ENOTSUP; -} - -static int it51xxx_vcmp_set_trigger(const struct device *dev, enum comparator_trigger trigger) -{ - const struct vcmp_it51xxx_config *cfg = dev->config; - struct vcmp_it51xxx_data *data = dev->data; - - /* Disable VCMP interrupt */ - vcmp_enable(dev, false); - - /* W/C voltage comparator specific channel interrupt status */ - clear_vcmp_status(dev, cfg->vcmp_ch); - - switch (trigger) { - case COMPARATOR_TRIGGER_BOTH_EDGES: - LOG_ERR("Unsupported trigger: COMPARATOR_TRIGGER_BOTH_EDGES"); - return -ENOTSUP; - case COMPARATOR_TRIGGER_RISING_EDGE: - data->interrupt_mask = COMPARATOR_TRIGGER_RISING_EDGE; - vcmp_set_attr(dev, COMPARATOR_TRIGGER_RISING_EDGE); - break; - case COMPARATOR_TRIGGER_FALLING_EDGE: - data->interrupt_mask = COMPARATOR_TRIGGER_FALLING_EDGE; - vcmp_set_attr(dev, COMPARATOR_TRIGGER_FALLING_EDGE); - break; - case COMPARATOR_TRIGGER_NONE: - data->interrupt_mask = 0; - break; - default: - return -EINVAL; - } - - if (data->interrupt_mask) { - vcmp_enable(dev, true); - } - - return 0; -} - -static int it51xxx_vcmp_set_trigger_callback(const struct device *dev, - comparator_callback_t callback, void *user_data) -{ - struct vcmp_it51xxx_data *data = dev->data; - - /* Disable voltage comparator and interrupt */ - vcmp_enable(dev, false); - - data->user_cb = callback; - data->user_cb_data = user_data; - - if (callback != NULL && atomic_test_and_clear_bit(&data->triggered, 0)) { - callback(dev, user_data); - } - - /* Re-enable currently set VCMP interrupt */ - if (data->interrupt_mask) { - vcmp_enable(dev, true); - } - - return 0; -} - -static int it51xxx_vcmp_trigger_is_pending(const struct device *dev) -{ - struct vcmp_it51xxx_data *data = dev->data; - - return atomic_test_and_clear_bit(&data->triggered, 0); -} - -/* - * All voltage comparator channels share one irq interrupt, so we - * need to handle all channels, when the interrupt fired. - */ -static void vcmp_it51xxx_isr(const struct device *dev) -{ - const struct vcmp_it51xxx_config *const cfg = dev->config; - const uintptr_t reg_base = cfg->reg_base; - /* - * Comparator n Trigger Mode (CMPnTMOD) - * false (0): Less than or equal to CMPnTHRDAT [9:0] - * true (1): Greater than CMPnTHRDAT [9:0] - */ - bool comparator_mode; - - /* Find out which voltage comparator triggered */ - for (int idx = VCMP_CHANNEL_0; idx < VCMP_CHANNEL_CNT; idx++) { - if (sys_read8(reg_base + vcmp_status_ctrl_reg[idx]) & VCMP_CMPXRTIS) { - struct vcmp_it51xxx_data *data = vcmp_data[idx]; - - comparator_mode = - sys_read8(reg_base + vcmp_ctrl_reg[idx]) & VCMP_GREATER_THRESHOLD; - - if ((comparator_mode && data && - data->interrupt_mask == COMPARATOR_TRIGGER_RISING_EDGE) || - (!comparator_mode && data && - data->interrupt_mask == COMPARATOR_TRIGGER_FALLING_EDGE)) { - - vcmp_irq_handler(data->vcmp); - } - - if (comparator_mode) { - sys_write8(sys_read8(reg_base + vcmp_ctrl_reg[idx]) & - ~VCMP_GREATER_THRESHOLD, - reg_base + vcmp_ctrl_reg[idx]); - } else { - sys_write8(sys_read8(reg_base + vcmp_ctrl_reg[idx]) | - VCMP_GREATER_THRESHOLD, - reg_base + vcmp_ctrl_reg[idx]); - } - - /* W/C voltage comparator specific channel interrupt status */ - clear_vcmp_status(dev, idx); - } - } - - /* W/C voltage comparator irq interrupt status */ - ite_intc_isr_clear(cfg->irq); -} - -static int vcmp_it51xxx_init(const struct device *dev) -{ - const struct vcmp_it51xxx_config *const cfg = dev->config; - struct vcmp_it51xxx_data *const data = dev->data; - uintptr_t base_ch = cfg->base_ch; - uintptr_t reg_vcmpscp2 = cfg->reg_base + REG_VCMP_VCMPSCP2; - uint8_t reg_value; - int err; - - data->adc_ch_cfg.gain = ADC_GAIN_1; - data->adc_ch_cfg.reference = ADC_REF_INTERNAL; - data->adc_ch_cfg.acquisition_time = ADC_ACQ_TIME_DEFAULT; - data->adc_ch_cfg.channel_id = cfg->channel_id; - - /* Disable voltage comparator and interrupt */ - vcmp_enable(dev, false); - - /* - * ADC channel signal output to voltage comparator, - * so we need to set ADC channel to alternate mode first. - */ - if (!device_is_ready(cfg->adc)) { - LOG_ERR("ADC device not ready"); - return -ENODEV; - } - - err = adc_channel_setup(cfg->adc, &data->adc_ch_cfg); - if (err) { - return err; - } - - /* Select which ADC channel output voltage into comparator */ - reg_value = FIELD_PREP(GENMASK(7, 3), sys_read8(base_ch)); - reg_value |= data->adc_ch_cfg.channel_id & VCMP_CHANNEL_ID_REG_MASK; - sys_write8(reg_value, base_ch); - - /* Set VCMP to Edge Sense Mode */ - sys_write8(sys_read8(base_ch) | VCMP_CMP_EDGE_SENSED_MODE, base_ch); - - /* Store the address of driver data for later access in ISR function*/ - if (cfg->vcmp_ch >= VCMP_CHANNEL_CNT) { - LOG_ERR("invalid volt comparator channel setting(%d)", cfg->vcmp_ch); - return -EINVAL; - } - vcmp_data[cfg->vcmp_ch] = dev->data; - - /* - * Set minimum scan period for "all" voltage comparator - * Three voltage comparators share a scan period setting and use the fastest one - */ - if (cfg->scan_period < FIELD_GET(SCAN_PERIOD_MASK, sys_read8(reg_vcmpscp2))) { - sys_write8(FIELD_PREP(SCAN_PERIOD_MASK, cfg->scan_period), reg_vcmpscp2); - } - - /* Data must keep device reference for later access in ISR function */ - data->vcmp = dev; - - err = vcmp_set_threshold(dev, cfg->threshold_mv); - if (err) { - return err; - } - - /* - * All voltage comparator channels share one irq interrupt, - * so if the irq is enabled before, we needn't to enable again. - * And we will figure out the triggered channel in vcmp_it51xxx_isr(). - */ - if (!irq_is_enabled(cfg->irq)) { - ite_intc_isr_clear(cfg->irq); - irq_connect_dynamic(cfg->irq, 0, (void (*)(const void *))vcmp_it51xxx_isr, - (const void *)dev, 0); - irq_enable(cfg->irq); - } - - return 0; -} - -static DEVICE_API(comparator, it51xxx_vcmp_api) = { - .get_output = it51xxx_vcmp_get_output, - .set_trigger = it51xxx_vcmp_set_trigger, - .set_trigger_callback = it51xxx_vcmp_set_trigger_callback, - .trigger_is_pending = it51xxx_vcmp_trigger_is_pending, -}; - -#define VCMP_IT51XXX_INIT(inst) \ - static const struct vcmp_it51xxx_config vcmp_it51xxx_cfg_##inst = { \ - .base_ch = DT_INST_REG_ADDR_BY_IDX(inst, 0), \ - .reg_base = DT_INST_REG_ADDR_BY_IDX(inst, 1), \ - .irq = DT_INST_IRQN(inst), \ - .vcmp_ch = DT_INST_PROP(inst, vcmp_ch), \ - .scan_period = DT_INST_PROP(inst, scan_period), \ - .threshold_mv = DT_INST_PROP(inst, threshold_mv), \ - .adc = DEVICE_DT_GET(DT_INST_IO_CHANNELS_CTLR(inst)), \ - .channel_id = (uint8_t)DT_INST_IO_CHANNELS_INPUT(inst), \ - }; \ - \ - static struct vcmp_it51xxx_data vcmp_it51xxx_data_##inst; \ - \ - DEVICE_DT_INST_DEFINE(inst, vcmp_it51xxx_init, NULL, &vcmp_it51xxx_data_##inst, \ - &vcmp_it51xxx_cfg_##inst, POST_KERNEL, \ - CONFIG_COMPARATOR_INIT_PRIORITY, &it51xxx_vcmp_api); - -DT_INST_FOREACH_STATUS_OKAY(VCMP_IT51XXX_INIT) diff --git a/dts/bindings/comparator/ite,it51xxx-vcmp.yaml b/dts/bindings/comparator/ite,it51xxx-vcmp.yaml deleted file mode 100644 index 08fd821f798..00000000000 --- a/dts/bindings/comparator/ite,it51xxx-vcmp.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2025 ITE Technology Corporation. -# SPDX-License-Identifier: Apache-2.0 - -description: ITE, it51xxx Voltage Comparator node - -compatible: "ite,it51xxx-vcmp" - -include: base.yaml - -properties: - reg: - required: true - - interrupts: - required: true - - vcmp-ch: - type: int - required: true - description: | - Voltage comparator channel. - Check include/zephyr/dt-bindings/comparator/it51xxx-vcmp.h file for - pre-defined values. - - threshold-mv: - type: int - required: true - description: | - 16-bit value in milli-volts present on ADC data as threshold assert. - - io-channels: - type: phandle-array - required: true - description: | - ADC channel that will perform measurement. - - scan-period: - type: int - description: | - 0x1: Set comparator scan period to 100US - 0x2: Set comparator scan period to 200US - 0x3: Set comparator scan period to 400US - 0x4: Set comparator scan period to 600US - 0x5: Set comparator scan period to 800US - 0x6: Set comparator scan period to 1MS - 0x7: Set comparator scan period to 1.5MS - 0x8: Set comparator scan period to 2MS - 0x9: Set comparator scan period to 2.5MS - 0xA: Set comparator scan period to 3MS - 0xB: Set comparator scan period to 4MS - 0xC: Set comparator scan period to 5MS - default: 0x4 - enum: - - 0x1 - - 0x2 - - 0x3 - - 0x4 - - 0x5 - - 0x6 - - 0x7 - - 0x8 - - 0x9 - - 0xA - - 0xB - - 0xC diff --git a/dts/riscv/ite/it51xxx.dtsi b/dts/riscv/ite/it51xxx.dtsi index 16633f3c6b2..8f3b008276e 100644 --- a/dts/riscv/ite/it51xxx.dtsi +++ b/dts/riscv/ite/it51xxx.dtsi @@ -6,10 +6,9 @@ #include #include -#include #include -#include #include +#include #include #include #include @@ -85,36 +84,6 @@ #io-channel-cells = <1>; }; - vcmp0: vcmp@f04520 { - compatible = "ite,it51xxx-vcmp"; - interrupt-parent = <&intc>; - interrupts = ; - reg = <0xf04520 0x08 - 0xf04500 0xc1>; /* vcmp base address */ - vcmp-ch = ; - status = "disabled"; - }; - - vcmp1: vcmp@f04528 { - compatible = "ite,it51xxx-vcmp"; - interrupt-parent = <&intc>; - interrupts = ; - reg = <0xf04528 0x08 - 0xf04500 0xc1>; /* vcmp base address */ - vcmp-ch = ; - status = "disabled"; - }; - - vcmp2: vcmp@f0452c { - compatible = "ite,it51xxx-vcmp"; - interrupt-parent = <&intc>; - interrupts = ; - reg = <0xf0452c 0x08 - 0xf04500 0xc1>; /* vcmp base address */ - vcmp-ch = ; - status = "disabled"; - }; - gpiogcr: gpio-gcr@f01600 { compatible = "ite,it51xxx-gpiogcr"; reg = <0x00f01600 0x100>; diff --git a/include/zephyr/dt-bindings/comparator/it51xxx-vcmp.h b/include/zephyr/dt-bindings/comparator/it51xxx-vcmp.h deleted file mode 100644 index 1296a8d5b31..00000000000 --- a/include/zephyr/dt-bindings/comparator/it51xxx-vcmp.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 ITE Corporation. - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_COMPARATOR_IT51XXX_VCMP_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_COMPARATOR_IT51XXX_VCMP_H_ - -/** - * @name it51xxx voltage comparator channel references - * @{ - */ - -#define VCMP_CHANNEL_0 0 -#define VCMP_CHANNEL_1 1 -#define VCMP_CHANNEL_2 2 -#define VCMP_CHANNEL_CNT 3 - -/** @} */ - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_COMPARATOR_IT51XXX_VCMP_H_ */ diff --git a/tests/drivers/comparator/gpio_loopback/boards/it515xx_evb.conf b/tests/drivers/comparator/gpio_loopback/boards/it515xx_evb.conf deleted file mode 100644 index a51e33c8c63..00000000000 --- a/tests/drivers/comparator/gpio_loopback/boards/it515xx_evb.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 ITE Technology Corporation -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_ADC=y diff --git a/tests/drivers/comparator/gpio_loopback/boards/it515xx_evb.overlay b/tests/drivers/comparator/gpio_loopback/boards/it515xx_evb.overlay deleted file mode 100644 index 6c119b30017..00000000000 --- a/tests/drivers/comparator/gpio_loopback/boards/it515xx_evb.overlay +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 ITE Technology Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/ { - aliases { - test-comp = &vcmp1; - }; - - zephyr,user { - test-gpios = <&gpioa 1 GPIO_ACTIVE_HIGH>; - }; -}; - -&vcmp1 { - status = "okay"; - threshold-mv = <1500>; - scan-period = <0x4>; - io-channels = <&adc0 3>; -}; From af972f2b0c65708aa9ea5fe8de49cc10a4d0fc53 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 480/881] Revert "[nrf fromtree] tests: drivers: audio: dmic_api: Cleanup after nRF54LM20 rename" This reverts commit d56d138cfdcb54a3d7f0e7b34d21c1d849c84817. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/drivers/audio/dmic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/audio/dmic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/audio/dmic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..440ef9828ae --- /dev/null +++ b/tests/drivers/audio/dmic_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + dmic-dev = &pdm20; + }; +}; + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +dmic_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; From 4b785eead1988cd91566d76b5c4d0d18e0b5475d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 481/881] Revert "[nrf fromtree] tests: drivers: adc: adc_error_cases: Cleanup after nRF54LM20 rename" This reverts commit fb16e9c77041d0afcfd31c747a3e8185d4e14d70. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_cpuapp.overlay | 15 +++++++++++++++ tests/drivers/adc/adc_error_cases/testcase.yaml | 1 + 2 files changed, 16 insertions(+) create mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/adc/adc_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..c50279ce8f6 --- /dev/null +++ b/tests/drivers/adc/adc_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,15 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +/ { + aliases { + adc = &adc; + }; +}; + +&adc { + status = "okay"; +}; diff --git a/tests/drivers/adc/adc_error_cases/testcase.yaml b/tests/drivers/adc/adc_error_cases/testcase.yaml index d9d389ab78a..f902aa21af0 100644 --- a/tests/drivers/adc/adc_error_cases/testcase.yaml +++ b/tests/drivers/adc/adc_error_cases/testcase.yaml @@ -9,6 +9,7 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp From 20c244099969e8f3631f6c0d2017cfa2212d603b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 482/881] Revert "[nrf fromtree] tests: drivers: adc: adc_api: Cleanup after nRF54LM20 rename" This reverts commit 9aff91b9c2ba1748cfe9f1f9e056515f25f490e2. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/drivers/adc/adc_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/drivers/adc/adc_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..e1ca1190b33 --- /dev/null +++ b/tests/drivers/adc/adc_api/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,44 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1> , <&adc 2>; + }; +}; + +&adc { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + channel@0 { + reg = <0>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <10>; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1_4"; + zephyr,reference = "ADC_REF_EXTERNAL0"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <12>; + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_2_3"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <10>; + }; +}; From d3af5373cbb9d2965c2da0884e520afdd7244413 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 483/881] Revert "[nrf fromtree] tests: drivers: adc: adc_accuracy_test: Enable test on nrf54lm20dk" This reverts commit 84e9367b1eb4f048008669e179937cab3116eed0. Signed-off-by: Jukka Rissanen --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 32 ------------------- .../adc/adc_accuracy_test/testcase.yaml | 4 +-- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 tests/drivers/adc/adc_accuracy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/adc/adc_accuracy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/adc/adc_accuracy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index bc68f3c8d34..00000000000 --- a/tests/drivers/adc/adc_accuracy_test/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Test requires loopback P1.06 to VDDIO - */ - -/ { - zephyr,user { - io-channels = <&adc 0>; - reference-mv = <1800>; - expected-accuracy = <64>; - }; -}; - -&adc { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - channel@0 { - reg = <0>; - zephyr,gain = "ADC_GAIN_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.06 */ - zephyr,resolution = <14>; - }; -}; diff --git a/tests/drivers/adc/adc_accuracy_test/testcase.yaml b/tests/drivers/adc/adc_accuracy_test/testcase.yaml index b3179bfd5ed..51a4cd53e2a 100644 --- a/tests/drivers/adc/adc_accuracy_test/testcase.yaml +++ b/tests/drivers/adc/adc_accuracy_test/testcase.yaml @@ -21,9 +21,8 @@ tests: - frdm_mcxc242 - frdm_mcxc444 - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp - ek_ra8d1 - mck_ra8t1 @@ -45,4 +44,3 @@ tests: - xg29_rb4412a integration_platforms: - frdm_kl25z - - nrf54l15dk/nrf54l15/cpuapp From bea04c78760ecda7c0303511d6f0a7c018da61e7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 484/881] Revert "[nrf fromtree] tests: boards: nrf: qdec: Cleanup after nRF54LM20 rename" This reverts commit 3c1254d4a06fa56f5db845df4b43f12ee99d38d9. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_common.dtsi | 53 +++++++++++++++++++ .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 6 +++ .../nrf54l20pdk_nrf54l20_cpuflpr.overlay | 6 +++ tests/boards/nrf/qdec/testcase.yaml | 4 +- 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_common.dtsi create mode 100644 tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay create mode 100644 tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay diff --git a/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_common.dtsi new file mode 100644 index 00000000000..f7810df33c0 --- /dev/null +++ b/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_common.dtsi @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + qdec0 = &qdec20; + qenca = &phase_a; + qencb = &phase_b; + }; + + encoder-emulate { + compatible = "gpio-leds"; + phase_a: phase_a { + gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + }; + phase_b: phase_b { + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pinctrl { + qdec_pinctrl: qdec_pinctrl { + group1 { + psels = , + ; + }; + }; + + qdec_sleep_pinctrl: qdec_sleep_pinctrl { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&qdec20 { + status = "okay"; + pinctrl-0 = <&qdec_pinctrl>; + pinctrl-1 = <&qdec_sleep_pinctrl>; + pinctrl-names = "default", "sleep"; + steps = <127>; + led-pre = <500>; + zephyr,pm-device-runtime-auto; +}; diff --git a/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..a16bac11f17 --- /dev/null +++ b/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,6 @@ +/* + * Copyright 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l20pdk_nrf54l20_common.dtsi" diff --git a/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay b/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay new file mode 100644 index 00000000000..638d63e5c54 --- /dev/null +++ b/tests/boards/nrf/qdec/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay @@ -0,0 +1,6 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l20pdk_nrf54l20_common.dtsi" diff --git a/tests/boards/nrf/qdec/testcase.yaml b/tests/boards/nrf/qdec/testcase.yaml index 2908a68a6d1..312761b4459 100644 --- a/tests/boards/nrf/qdec/testcase.yaml +++ b/tests/boards/nrf/qdec/testcase.yaml @@ -5,7 +5,9 @@ common: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54l20pdk/nrf54l20/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr integration_platforms: - nrf52840dk/nrf52840 @@ -13,8 +15,6 @@ common: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr harness: ztest harness_config: fixture: gpio_loopback From 9db3663bd3479132a4d0d19c7a934f5d48fadca7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 485/881] Revert "[nrf fromtree] tests: boards: nrf: i2c: i2c_slave: Cleanup after nRF54LM20 rename" This reverts commit 0b46bef7e934ffdaa3e7d69f419342919934080a. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_cpuapp.conf | 1 + .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 61 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 7 +-- tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 16 ++--- 4 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l20pdk_nrf54l20_cpuapp.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l20pdk_nrf54l20_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l20pdk_nrf54l20_cpuapp.conf new file mode 100644 index 00000000000..b01af3b36a7 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l20pdk_nrf54l20_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..0003711755d --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,61 @@ +/ { + aliases { + i2c-slave = &i2c22; + }; +}; + +&pinctrl { + i2c21_default_alt: i2c21_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c21_sleep_alt: i2c21_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default_alt: i2c22_default_alt { + group1 { +/* Temporary workaround as it is currently not possible + * to configure pins for TWIS with pinctrl. + */ + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep_alt: i2c22_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c21 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c21_default_alt>; + pinctrl-1 = <&i2c21_sleep_alt>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c22_default_alt>; + pinctrl-1 = <&i2c22_sleep_alt>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 3767afee0e7..029c9830186 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,14 +1,10 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - /* * Two loopbacks are required: * P1.13 - P1.14 * P1.23 - P1.24 */ + / { aliases { i2c-slave = &i2c22; @@ -57,7 +53,6 @@ dut_twim: &i2c21 { pinctrl-0 = <&i2c21_default_alt>; pinctrl-1 = <&i2c21_sleep_alt>; pinctrl-names = "default", "sleep"; - sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index 02a2ee5f751..e125548a49a 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -12,32 +12,32 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp boards.nrf.i2c.i2c_slave.fast: platform_allow: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE="boards/i2c_speed_fast.overlay" boards.nrf.i2c.i2c_slave.fast_plus: From f4675966fcada7bc6fc4350d94793b793aaa3c84 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 486/881] Revert "[nrf fromtree] tests: boards: nrf: hwinfo: Cleanup after nRF54LM20 rename" This reverts commit b3c198515bb63fc4a79219ed98d6190f575d1976. Signed-off-by: Jukka Rissanen --- .../boards/nrf54l20pdk_nrf54l20_cpuapp.overlay | 9 +++++++++ tests/boards/nrf/hwinfo/reset_cause/testcase.yaml | 1 + 2 files changed, 10 insertions(+) create mode 100644 tests/boards/nrf/hwinfo/reset_cause/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..dc1ea1a9ddc --- /dev/null +++ b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml index da37f9ef614..9fd5911c284 100644 --- a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml +++ b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml @@ -38,6 +38,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp From 2dc2ec6951359aea341fe8116a25d68e14f0e239 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 487/881] Revert "[nrf fromtree] tests: boards: nrf: comp: Enable test on nrf54lm20dk" This reverts commit a201385108cd3dfd2a78116a419fce9158e0d476. Signed-off-by: Jukka Rissanen --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 4 --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 33 ------------------- tests/boards/nrf/comp/testcase.yaml | 1 - 3 files changed, 38 deletions(-) delete mode 100644 tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 3a7f6a03876..00000000000 --- a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX=1 -CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX=4 -CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX=6 -CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX=5 diff --git a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 55d1937a4fe..00000000000 --- a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,33 +0,0 @@ -/* Two loopbacks are used - * Each loopback is between analog input and GPIO. - * first-gpios (P1.03) -> AIN6 (P1.04) - * second-gpios (P1.30, AIN2) -> AIN1 (P1.31) - * AIN4 (P1.06) tied to VDD - */ - -/ { - aliases { - test-comp = ∁ - }; - - zephyr,user { - first-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; - second-gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&comp { - status = "okay"; - psel = "AIN4"; - refsel = "AREF"; - extrefsel= "AIN3"; - sp-mode = "NORMAL"; - th-up = <36>; - th-down = <30>; - isource = "DISABLED"; - enable-hyst; -}; diff --git a/tests/boards/nrf/comp/testcase.yaml b/tests/boards/nrf/comp/testcase.yaml index 6d158d284ee..d5ac3d9c267 100644 --- a/tests/boards/nrf/comp/testcase.yaml +++ b/tests/boards/nrf/comp/testcase.yaml @@ -12,4 +12,3 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp From 4d7e50b1fefa9f67f99229570b8e97027c7be038 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:23 +0300 Subject: [PATCH 488/881] Revert "[nrf fromtree] samples: sensor: qdec: Enable sample on nrf54lm20dk" This reverts commit 607e1be8d008fad2d610fba7eb573bd36b1fa660. Signed-off-by: Jukka Rissanen --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 49 ------------------- samples/sensor/qdec/sample.yaml | 6 +-- 2 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 samples/sensor/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/sensor/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/sensor/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index d7045779d8a..00000000000 --- a/samples/sensor/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Two loopbacks are required: - * P1.13 - P1.14 - * P1.23 - P1.24 - */ - -/ { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - - encoder-emulate { - compatible = "gpio-leds"; - phase_a: phase_a { - gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - }; - phase_b: phase_b { - gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&pinctrl { - qdec_pinctrl: qdec_pinctrl { - group1 { - psels = , - ; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&qdec20 { - status = "okay"; - pinctrl-0 = <&qdec_pinctrl>; - pinctrl-names = "default"; - steps = <120>; - led-pre = <500>; -}; diff --git a/samples/sensor/qdec/sample.yaml b/samples/sensor/qdec/sample.yaml index fbff236caf1..8fe374bc8b5 100644 --- a/samples/sensor/qdec/sample.yaml +++ b/samples/sensor/qdec/sample.yaml @@ -31,16 +31,14 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp harness_config: fixture: gpio_loopback From bcb3673443dc520d797a178234f2bc5ec7927c73 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 489/881] Revert "[nrf fromtree] samples: drivers: watchdog: Cleanup after nRF54LM20 rename" This reverts commit bd2f8097d51ae5b0e9a6fb46b16a982c42529355. Signed-off-by: Jukka Rissanen --- .../watchdog/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay | 8 ++++++++ .../watchdog/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 samples/drivers/watchdog/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay create mode 100644 samples/drivers/watchdog/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay diff --git a/samples/drivers/watchdog/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/samples/drivers/watchdog/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..5c765a8a896 --- /dev/null +++ b/samples/drivers/watchdog/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,8 @@ +/* + * Copyright 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/samples/drivers/watchdog/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay b/samples/drivers/watchdog/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay new file mode 100644 index 00000000000..cfb41e09b99 --- /dev/null +++ b/samples/drivers/watchdog/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay @@ -0,0 +1,8 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; From 793d55095d01cfee96a9790692b965b58a06ca8d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 490/881] Revert "[nrf fromtree] samples: drivers: spi_flash: Enable sample on nrf54lm20dk" This reverts commit 55e6d51591bf0cbbf461c7d708ab72a60937c63d. Signed-off-by: Jukka Rissanen --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 ------- samples/drivers/spi_flash/sample.yaml | 26 +++---------------- 2 files changed, 4 insertions(+), 31 deletions(-) delete mode 100644 samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 8a5afda2ab0..00000000000 --- a/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/drivers/spi_flash/sample.yaml b/samples/drivers/spi_flash/sample.yaml index 39d94c905da..351e33997a0 100644 --- a/samples/drivers/spi_flash/sample.yaml +++ b/samples/drivers/spi_flash/sample.yaml @@ -1,19 +1,16 @@ sample: name: SPI Flash Sample -common: - tags: - - spi - - flash - depends_on: spi tests: sample.drivers.spi.flash: + tags: + - spi + - flash filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("st,stm32-qspi-nor") or dt_compat_enabled("st,stm32-ospi-nor") or dt_compat_enabled("st,stm32-xspi-nor") or dt_compat_enabled("nordic,qspi-nor") or dt_compat_enabled("jedec,mspi-nor") platform_exclude: - hifive_unmatched/fu740/s7 - hifive_unmatched/fu740/u74 - - nrf54lm20dk/nrf54lm20a/cpuapp harness: console harness_config: type: multi_line @@ -24,19 +21,4 @@ tests: - "Test 2: Flash write" - "Attempting to write 4 bytes" - "Data read matches data written. Good!!" - sample.drivers.spi.flash.nrf54lm20: - platform_allow: - - nrf54lm20dk/nrf54lm20a/cpuapp - integration_platforms: - - nrf54lm20dk/nrf54lm20a/cpuapp - harness: console - harness_config: - fixture: external_flash - type: multi_line - ordered: true - regex: - - "Test 1: Flash erase" - - "Flash erase succeeded!" - - "Test 2: Flash write" - - "Attempting to write 4 bytes" - - "Data read matches data written. Good!!" + depends_on: spi From c6eef1e038dd50f2b034b9d96ca71695ca35be84 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 491/881] Revert "[nrf fromtree] samples: drivers: spi_bitbang: Enable sample on nrf54* targets" This reverts commit 3bd1cb452c9ba417d68845bb1da4209402d934d5. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 23 ------------------- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 23 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 23 ------------------- samples/drivers/spi_bitbang/sample.yaml | 9 +------- 4 files changed, 1 insertion(+), 77 deletions(-) delete mode 100644 samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 samples/drivers/spi_bitbang/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 255834ffd9a..00000000000 --- a/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Test requires loopback between P0.06 and P0.07. - * No other driver on SPI_CLK and SPI_CS. - */ - -/ { - spibb0: spibb0 { - compatible = "zephyr,spi-bitbang"; - status="okay"; - #address-cells = <1>; - #size-cells = <0>; - clk-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; - mosi-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; - miso-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; - cs-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; - }; -}; diff --git a/samples/drivers/spi_bitbang/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/drivers/spi_bitbang/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 6a35bb70f9e..00000000000 --- a/samples/drivers/spi_bitbang/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Test requires loopback between P1.10 and P1.11 - * No other driver on SPI_CLK and SPI_CS. - */ - -/ { - spibb0: spibb0 { - compatible = "zephyr,spi-bitbang"; - status="okay"; - #address-cells = <1>; - #size-cells = <0>; - clk-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - mosi-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; - miso-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; - cs-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; - }; -}; diff --git a/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 9a27384fc40..00000000000 --- a/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Test requires loopback between P1.13 and P1.14 - * No other driver on SPI_CLK and SPI_CS. - */ - -/ { - spibb0: spibb0 { - compatible = "zephyr,spi-bitbang"; - status="okay"; - #address-cells = <1>; - #size-cells = <0>; - clk-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; - mosi-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - miso-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; - cs-gpios = <&gpio1 30 GPIO_ACTIVE_LOW>; - }; -}; diff --git a/samples/drivers/spi_bitbang/sample.yaml b/samples/drivers/spi_bitbang/sample.yaml index c90f02313f2..57fb178b093 100644 --- a/samples/drivers/spi_bitbang/sample.yaml +++ b/samples/drivers/spi_bitbang/sample.yaml @@ -6,14 +6,7 @@ tests: - drivers - spi - gpio - platform_allow: - - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - integration_platforms: - - nrf52840dk/nrf52840 - - nrf54l15dk/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 depends_on: gpio harness: console harness_config: From 41aefdca2d168e3fcc0ffa25f1b152389c2fb343 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 492/881] Revert "[nrf fromtree] samples: drivers: mbox: Cleanup after nRF54LM20 rename" This reverts commit 44b8333b73f517fa9bc4bc6fa07b1d6266f88854. Signed-off-by: Jukka Rissanen --- samples/drivers/mbox/CMakeLists.txt | 1 + samples/drivers/mbox/Kconfig.sysbuild | 1 + .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 20 ++++++++++++++++ samples/drivers/mbox/remote/CMakeLists.txt | 1 + .../nrf54l20pdk_nrf54l20_cpuflpr.overlay | 24 +++++++++++++++++++ samples/drivers/mbox/sample.yaml | 4 ++++ samples/drivers/mbox/sysbuild.cmake | 1 - 7 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 samples/drivers/mbox/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay create mode 100644 samples/drivers/mbox/remote/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay diff --git a/samples/drivers/mbox/CMakeLists.txt b/samples/drivers/mbox/CMakeLists.txt index d6bada1a50e..696b2317aa7 100644 --- a/samples/drivers/mbox/CMakeLists.txt +++ b/samples/drivers/mbox/CMakeLists.txt @@ -27,6 +27,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUAPP OR CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUAPP OR + CONFIG_BOARD_NRF54L20PDK_NRF54L20_CPUAPP OR CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP OR CONFIG_BOARD_STM32H747I_DISCO_STM32H747XX_M7 OR CONFIG_BOARD_BL54L15_DVK_NRF54L15_CPUAPP OR diff --git a/samples/drivers/mbox/Kconfig.sysbuild b/samples/drivers/mbox/Kconfig.sysbuild index 76d3d240abc..97402056c14 100644 --- a/samples/drivers/mbox/Kconfig.sysbuild +++ b/samples/drivers/mbox/Kconfig.sysbuild @@ -21,6 +21,7 @@ config REMOTE_BOARD default "nrf54h20dk/nrf54h20/cpuapp" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpurad" default "nrf54l09pdk/nrf54l09/cpuflpr" if $(BOARD) = "nrf54l09pdk" default "nrf54l15dk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15dk" + default "nrf54l20pdk/nrf54l20/cpuflpr" if $(BOARD) = "nrf54l20pdk" default "nrf54lm20dk/nrf54lm20a/cpuflpr" if $(BOARD) = "nrf54lm20dk" default "ophelia4ev/cpuflpr" if $(BOARD) = "ophelia4ev" default "stm32h747i_disco/stm32h747xx/m4" if $(BOARD) = "stm32h747i_disco" diff --git a/samples/drivers/mbox/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/samples/drivers/mbox/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..fd2f23402f5 --- /dev/null +++ b/samples/drivers/mbox/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,20 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + mbox-consumer { + compatible = "vnd,mbox-consumer"; + mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>; + mbox-names = "rx", "tx"; + }; +}; + +&cpuapp_vevif_rx { + status = "okay"; +}; + +&cpuapp_vevif_tx { + status = "okay"; +}; diff --git a/samples/drivers/mbox/remote/CMakeLists.txt b/samples/drivers/mbox/remote/CMakeLists.txt index c84efec1197..48df8f0cb5b 100644 --- a/samples/drivers/mbox/remote/CMakeLists.txt +++ b/samples/drivers/mbox/remote/CMakeLists.txt @@ -26,6 +26,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUFLPR OR CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUFLPR OR + CONFIG_BOARD_NRF54L20PDK_NRF54L20_CPUFLPR OR CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR OR CONFIG_BOARD_STM32H747I_DISCO_STM32H747XX_M4 OR CONFIG_BOARD_BL54L15_DVK_NRF54L15_CPUFLPR OR diff --git a/samples/drivers/mbox/remote/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay b/samples/drivers/mbox/remote/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay new file mode 100644 index 00000000000..ea88120ad06 --- /dev/null +++ b/samples/drivers/mbox/remote/boards/nrf54l20pdk_nrf54l20_cpuflpr.overlay @@ -0,0 +1,24 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + mbox-consumer { + compatible = "vnd,mbox-consumer"; + mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>; + mbox-names = "rx", "tx"; + }; +}; + +&cpuflpr_vevif_rx { + status = "okay"; +}; + +&cpuflpr_vevif_tx { + status = "okay"; +}; + +&uart30 { + /delete-property/ hw-flow-control; +}; diff --git a/samples/drivers/mbox/sample.yaml b/samples/drivers/mbox/sample.yaml index 809d5e091dc..1aee77b1c67 100644 --- a/samples/drivers/mbox/sample.yaml +++ b/samples/drivers/mbox/sample.yaml @@ -12,6 +12,7 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf5340bsim/nrf5340/cpuapp @@ -77,6 +78,7 @@ tests: platform_allow: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp @@ -94,6 +96,7 @@ tests: platform_allow: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp @@ -114,6 +117,7 @@ tests: platform_allow: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp diff --git a/samples/drivers/mbox/sysbuild.cmake b/samples/drivers/mbox/sysbuild.cmake index 0644500ca48..31802733514 100644 --- a/samples/drivers/mbox/sysbuild.cmake +++ b/samples/drivers/mbox/sysbuild.cmake @@ -14,7 +14,6 @@ ExternalZephyrProject_Add( APPLICATION ${REMOTE_APP} SOURCE_DIR ${APP_DIR}/${REMOTE_APP} BOARD ${SB_CONFIG_REMOTE_BOARD} - BOARD_REVISION ${BOARD_REVISION} ) native_simulator_set_child_images(${DEFAULT_IMAGE} ${REMOTE_APP}) From 21effcc57596f426616755a29c46b9681ca3def0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 493/881] Revert "[nrf fromtree] samples: drivers: jesd216: Enable sample on nrf54lm20dk" This reverts commit 542d6893b1e9517667c6a964069ca5e40d0623b4. Signed-off-by: Jukka Rissanen --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 --------- samples/drivers/jesd216/sample.yaml | 13 ------------- 2 files changed, 22 deletions(-) delete mode 100644 samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 8a5afda2ab0..00000000000 --- a/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/drivers/jesd216/sample.yaml b/samples/drivers/jesd216/sample.yaml index a5b661c492c..4be5e5defbb 100644 --- a/samples/drivers/jesd216/sample.yaml +++ b/samples/drivers/jesd216/sample.yaml @@ -21,7 +21,6 @@ tests: - hifive_unmatched/fu740/u74 - mimxrt1170_evk/mimxrt1176/cm7 - mimxrt1170_evk/mimxrt1176/cm4 - - nrf54lm20dk/nrf54lm20a/cpuapp filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("jedec,mspi-nor") depends_on: spi sample.drivers.jesd216.nrf52840dk_spi: @@ -30,18 +29,6 @@ tests: platform_allow: nrf52840dk/nrf52840 integration_platforms: - nrf52840dk/nrf52840 - sample.drivers.jesd216.nrf54lm20: - platform_allow: - - nrf54lm20dk/nrf54lm20a/cpuapp - integration_platforms: - - nrf54lm20dk/nrf54lm20a/cpuapp - harness_config: - fixture: external_flash - type: multi_line - ordered: true - regex: - - "sfdp-bfp =" - - "jedec-id =" sample.drivers.stm32.jesd216: filter: dt_compat_enabled("st,stm32-xspi-nor") or dt_compat_enabled("st,stm32-ospi-nor") From 051ce67d8c026f5e931951961aa417d5badd3fe4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 494/881] Revert "[nrf fromtree] samples: drivers: i2c: rtio_loopback: Enable sample on nrf54lm20dk" This reverts commit 0d0d6409cad69af02fb9e716a3d439cbb04cd4a3. Signed-off-by: Jukka Rissanen --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 4 -- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 67 ------------------- samples/drivers/i2c/rtio_loopback/sample.yaml | 3 +- 3 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 7dfef7da283..00000000000 --- a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 1fc56cc6329..00000000000 --- a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SDA = P1.13 and P1.14 - * SCL = P1.23 and P1.24 - */ - -/ { - aliases { - i2c-controller = &i2c21; - i2c-controller-target = &i2c22; - }; -}; - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; diff --git a/samples/drivers/i2c/rtio_loopback/sample.yaml b/samples/drivers/i2c/rtio_loopback/sample.yaml index a356a2697fd..a18bfb94070 100644 --- a/samples/drivers/i2c/rtio_loopback/sample.yaml +++ b/samples/drivers/i2c/rtio_loopback/sample.yaml @@ -14,9 +14,8 @@ tests: platform_allow: - b_u585i_iot02a - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - nucleo_f401re - nucleo_h503rb - ophelia4ev/nrf54l15/cpuapp From 73d9ce71c04dd93cd5df99322e03736b8b7d3f16 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 495/881] Revert "[nrf fromtree] samples: drivers: i2c: rtio_loopback: add nucleo_f401re/nucleo_h503rb" This reverts commit 315cc6e208e4f1eccf5159d6623389573dd45361. Signed-off-by: Jukka Rissanen --- .../boards/nucleo_f401re.overlay | 18 ----------- .../boards/nucleo_h503rb.overlay | 32 ------------------- samples/drivers/i2c/rtio_loopback/sample.yaml | 2 -- 3 files changed, 52 deletions(-) delete mode 100644 samples/drivers/i2c/rtio_loopback/boards/nucleo_f401re.overlay delete mode 100644 samples/drivers/i2c/rtio_loopback/boards/nucleo_h503rb.overlay diff --git a/samples/drivers/i2c/rtio_loopback/boards/nucleo_f401re.overlay b/samples/drivers/i2c/rtio_loopback/boards/nucleo_f401re.overlay deleted file mode 100644 index ffd09691a21..00000000000 --- a/samples/drivers/i2c/rtio_loopback/boards/nucleo_f401re.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/* I2C bus pins are exposed on the ST morpho and Arduino headers. - * - * Bus SDA SCL - * Pin Hdr Pin Hdr - * i2c1 PB9 CN5:9 PB8 CN5:10 - * i2c3 PC9 CN10:1 PA8 CN9:8 - * - * Short Pin PB9 to PC9, and PB8 to PA8, for the test to pass. - */ - -/ { - aliases { - i2c-controller = &i2c1; - i2c-controller-target = &i2c3; - }; -}; diff --git a/samples/drivers/i2c/rtio_loopback/boards/nucleo_h503rb.overlay b/samples/drivers/i2c/rtio_loopback/boards/nucleo_h503rb.overlay deleted file mode 100644 index b53a0560eb6..00000000000 --- a/samples/drivers/i2c/rtio_loopback/boards/nucleo_h503rb.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/* I2C bus pins are exposed on the ST morpho and Arduino headers. - * - * Bus SDA SCL - * Pin Hdr Pin Hdr - * i2c1 PB7 CN5:9 PB6 CN5:10/CN10:3 - * i2c2 PB4 CN9:6/CN10:27 PB5 CN9:5/CN10:29 - * - * Short Pin PB7 to PB4, and PB6 to PB5, for the test to pass. - */ - -/ { - aliases { - i2c-controller = &i2c1; - i2c-controller-target = &i2c2; - }; -}; - -&i2c1 { - pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; - pinctrl-names = "default"; - clock-frequency = ; - status = "okay"; -}; - -&i2c2 { - pinctrl-0 = <&i2c2_scl_pb5 &i2c2_sda_pb4>; - pinctrl-names = "default"; - clock-frequency = ; - status = "okay"; -}; diff --git a/samples/drivers/i2c/rtio_loopback/sample.yaml b/samples/drivers/i2c/rtio_loopback/sample.yaml index a18bfb94070..cf081c7670c 100644 --- a/samples/drivers/i2c/rtio_loopback/sample.yaml +++ b/samples/drivers/i2c/rtio_loopback/sample.yaml @@ -16,6 +16,4 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nucleo_f401re - - nucleo_h503rb - ophelia4ev/nrf54l15/cpuapp From 0b23b090f7e3014d8ab0bbd3e8681aee177746ad Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 496/881] Revert "[nrf fromtree] samples: drivers: counter: alarm: Cleanup platform_allow for nrf54*" This reverts commit 7584dae8ce9f9269b8301340f3f8cdb91ddf8bbd. Signed-off-by: Jukka Rissanen --- .../alarm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay | 9 +++++++++ samples/drivers/counter/alarm/sample.yaml | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 samples/drivers/counter/alarm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/samples/drivers/counter/alarm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/samples/drivers/counter/alarm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..0847233437b --- /dev/null +++ b/samples/drivers/counter/alarm/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,9 @@ +/ { + chosen { + counter = &timer24; + }; +}; + +&timer24 { + status = "okay"; +}; diff --git a/samples/drivers/counter/alarm/sample.yaml b/samples/drivers/counter/alarm/sample.yaml index 1b4c34b9146..c3f141f680d 100644 --- a/samples/drivers/counter/alarm/sample.yaml +++ b/samples/drivers/counter/alarm/sample.yaml @@ -21,13 +21,6 @@ tests: - nrf51dk/nrf51822 - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuflpr - - nrf54h20dk/nrf54h20/cpuppr - - nrf54h20dk/nrf54h20/cpurad - - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf9160dk/nrf9160 - samd20_xpro - bl5340_dvk/nrf5340/cpuapp From 121eebe12b211b070de0ee5e7be3561a30a4c5b5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 497/881] Revert "[nrf fromtree] samples: drivers: audio: dmic: Cleanup after nRF54LM20 rename" This reverts commit 8032459514ca951644ab1a2fff64bd3f918a3ad0. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 21 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 4 ---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 samples/drivers/audio/dmic/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/samples/drivers/audio/dmic/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/samples/drivers/audio/dmic/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..3699a9e9563 --- /dev/null +++ b/samples/drivers/audio/dmic/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +dmic_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; diff --git a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index b3e08098722..c850cede53d 100644 --- a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* Test requires loopback between P1.23 and P1.24. - * For best performance, PDM_CLK shall be on 'Clock pin'. - */ - &pinctrl { pdm20_default_alt: pdm20_default_alt { group1 { From d480baca3b3b29989c1b24ef543daa44cfe59c20 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 498/881] Revert "[nrf fromtree] samples: drivers: adc: adc_sequence: Enable sample on nrf54lm20dk" This reverts commit 0c5e5ca00cbb8239f73e1f6afcd44b5781b58f20. Signed-off-by: Jukka Rissanen --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 50 ------------------- samples/drivers/adc/adc_sequence/sample.yaml | 6 +-- 2 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 samples/drivers/adc/adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/adc/adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index a85e9e7e611..00000000000 --- a/samples/drivers/adc/adc_sequence/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - aliases { - adc0 = &adc; - }; -}; - -&adc { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - channel@0 { - reg = <0>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.06 */ - }; - - channel@1 { - reg = <1>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.30 */ - }; - - channel@2 { - reg = <2>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* 0.9 V internal */ - }; - - channel@7 { - reg = <7>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.04 */ - zephyr,input-negative = ; /* P1.03 */ - }; -}; diff --git a/samples/drivers/adc/adc_sequence/sample.yaml b/samples/drivers/adc/adc_sequence/sample.yaml index affa120345b..09edd4cc03c 100644 --- a/samples/drivers/adc/adc_sequence/sample.yaml +++ b/samples/drivers/adc/adc_sequence/sample.yaml @@ -18,9 +18,8 @@ tests: - cy8cproto_063_ble - cy8cproto_062_4343w - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp - raytac_an54l15q_db/nrf54l15/cpuapp - ucans32k1sic @@ -30,9 +29,8 @@ tests: - nrf52840dk/nrf52840 sample.drivers.adc.adc_sequence.8bit: platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_configs: From b78708162852c6f007600699b94a93b6afb3d53b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 499/881] Revert "[nrf fromtree] samples: drivers: adc: Add variant for 8-bit resolution on nRF54x" This reverts commit 7babfb39f48bd4eebadd5dee62567fefb25111cb. Signed-off-by: Jukka Rissanen --- samples/drivers/adc/adc_sequence/sample.yaml | 31 +++++++------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/samples/drivers/adc/adc_sequence/sample.yaml b/samples/drivers/adc/adc_sequence/sample.yaml index 09edd4cc03c..9a824045d13 100644 --- a/samples/drivers/adc/adc_sequence/sample.yaml +++ b/samples/drivers/adc/adc_sequence/sample.yaml @@ -1,19 +1,10 @@ sample: name: ADC driver sequence sample -common: - tags: - - adc - depends_on: adc - harness: console - timeout: 10 - harness_config: - type: multi_line - regex: - - "ADC sequence reading \\[\\d+\\]:" - - "- .+, channel \\d+, \\d+ sequence samples:" - - "- - \\d+ (= \\d+mV)|(\\(value in mV not available\\))" tests: sample.drivers.adc.adc_sequence: + tags: + - adc + depends_on: adc platform_allow: - cy8cproto_063_ble - cy8cproto_062_4343w @@ -27,11 +18,11 @@ tests: - stm32f3_disco integration_platforms: - nrf52840dk/nrf52840 - sample.drivers.adc.adc_sequence.8bit: - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54l15dk/nrf54l15/cpuapp - extra_configs: - - CONFIG_SEQUENCE_RESOLUTION=8 + harness: console + timeout: 10 + harness_config: + type: multi_line + regex: + - "ADC sequence reading \\[\\d+\\]:" + - "- .+, channel \\d+, \\d+ sequence samples:" + - "- - \\d+ (= \\d+mV)|(\\(value in mV not available\\))" From d08d57fe09766f5d765387c991f32cad562dabca Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 500/881] Revert "[nrf fromtree] samples: drivers: adc_sequence: Remove misleading parts of nRF overlays" This reverts commit 8a76c39ec17e3b7672d120ade2d2c89543075a17. Signed-off-by: Jukka Rissanen --- .../adc_sequence/boards/nrf52840dk_nrf52840.overlay | 1 + .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 12 ++++++++++++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 12 ++++++++++++ 3 files changed, 25 insertions(+) diff --git a/samples/drivers/adc/adc_sequence/boards/nrf52840dk_nrf52840.overlay b/samples/drivers/adc/adc_sequence/boards/nrf52840dk_nrf52840.overlay index 99a0e7089ca..34107d84748 100644 --- a/samples/drivers/adc/adc_sequence/boards/nrf52840dk_nrf52840.overlay +++ b/samples/drivers/adc/adc_sequence/boards/nrf52840dk_nrf52840.overlay @@ -28,5 +28,6 @@ zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; + zephyr,oversampling = <8>; }; }; diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index d4f9e8db7c2..24cce679375 100644 --- a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -10,6 +10,12 @@ }; }; +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 7>; + }; +}; + &adc { #address-cells = <1>; #size-cells = <0>; @@ -20,6 +26,7 @@ zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; /* P1.01 */ + zephyr,resolution = <10>; }; channel@1 { @@ -28,6 +35,8 @@ zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; /* P1.02 */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; }; channel@2 { @@ -37,6 +46,8 @@ zephyr,acquisition-time = ; zephyr,input-positive = ; /* P9.01 */ zephyr,vref-mv = <3686>; /* 3.6V * 1024 */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; }; channel@7 { @@ -46,5 +57,6 @@ zephyr,acquisition-time = ; zephyr,input-positive = ; /* P1.03 */ zephyr,input-negative = ; /* P1.07 */ + zephyr,resolution = <12>; }; }; diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/drivers/adc/adc_sequence/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 87b8e373f1d..7fedbe52ad2 100644 --- a/samples/drivers/adc/adc_sequence/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/samples/drivers/adc/adc_sequence/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,6 +4,12 @@ * Copyright (c) 2024 Nordic Semiconductor ASA */ +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 7>; + }; +}; + / { aliases { adc0 = &adc; @@ -20,6 +26,7 @@ zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; /* P1.11 */ + zephyr,resolution = <10>; }; channel@1 { @@ -28,6 +35,8 @@ zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; /* P1.06 */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; }; channel@2 { @@ -36,6 +45,8 @@ zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; /* 0.9 V internal */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; }; channel@7 { @@ -45,5 +56,6 @@ zephyr,acquisition-time = ; zephyr,input-positive = ; /* P1.13 */ zephyr,input-negative = ; /* P1.14 */ + zephyr,resolution = <12>; }; }; From be1526309e85c33e530f6faeca3cdd8c5c209a27 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 501/881] Revert "[nrf fromtree] samples: drivers: adc: adc_dt: Enable sample on nrf54lm20dk" This reverts commit 23fb232f5a3357992357380c75db1f52d065d7ff. Signed-off-by: Jukka Rissanen --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 56 ------------------- samples/drivers/adc/adc_dt/sample.yaml | 3 +- 2 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 samples/drivers/adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/drivers/adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 8953de6a547..00000000000 --- a/samples/drivers/adc/adc_dt/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - zephyr,user { - io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 7>; - }; -}; - -&adc { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - channel@0 { - reg = <0>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.06 */ - zephyr,resolution = <10>; - }; - - channel@1 { - reg = <1>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.30 */ - zephyr,resolution = <12>; - zephyr,oversampling = <8>; - }; - - channel@2 { - reg = <2>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; - zephyr,resolution = <12>; - zephyr,oversampling = <8>; - }; - - channel@7 { - reg = <7>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.04 */ - zephyr,input-negative = ; /* P1.03 */ - zephyr,resolution = <12>; - }; -}; diff --git a/samples/drivers/adc/adc_dt/sample.yaml b/samples/drivers/adc/adc_dt/sample.yaml index 2a32be6983b..1592685e9f7 100644 --- a/samples/drivers/adc/adc_dt/sample.yaml +++ b/samples/drivers/adc/adc_dt/sample.yaml @@ -15,9 +15,8 @@ tests: - stm32h735g_disco - nrf51dk/nrf51822 - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp - mec172xevb_assy6906 - gd32f350r_eval From 0ef177945688bcb37667eb4c529914fa67907dda Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 502/881] Revert "[nrf fromtree] samples: boards: nordic: system_off: Cleanup after nRF54LM20 rename" This reverts commit 196735ca2526e9ae81282be1953e6cfc9d74b331. Signed-off-by: Jukka Rissanen --- .../nrf54l20pdk_nrf54l20_cpuapp.overlay | 25 +++++++++++++++++++ samples/boards/nordic/system_off/sample.yaml | 4 +++ 2 files changed, 29 insertions(+) create mode 100644 samples/boards/nordic/system_off/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay diff --git a/samples/boards/nordic/system_off/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/samples/boards/nordic/system_off/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 00000000000..3a79636a483 --- /dev/null +++ b/samples/boards/nordic/system_off/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,25 @@ +/ { + cpuapp_sram@2007ec00 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2007ec00 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + /* Shrink SRAM size to avoid overlap with retained memory region: + * 511 - 4 = 507KB = 0x7ec00 + */ + reg = <0x20000000 DT_SIZE_K(507)>; + ranges = <0x0 0x20000000 0x7ec00>; +}; diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index b11f3439e7f..9b0e39a6cea 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -14,6 +14,7 @@ tests: - nrf54l15dk/nrf54l05/cpuapp - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp harness: console harness_config: @@ -33,6 +34,7 @@ tests: - nrf54l15dk/nrf54l05/cpuapp - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y @@ -52,6 +54,7 @@ tests: - nrf54l15dk/nrf54l05/cpuapp - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp extra_configs: - CONFIG_GRTC_WAKEUP_ENABLE=y @@ -76,6 +79,7 @@ tests: - nrf54l15dk/nrf54l05/cpuapp - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y From a49279aac02657e20886b5c9ce9c0dc733ce477e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 503/881] Revert "[nrf fromtree] drivers: ieee802154: nrf5: prevent negative timestamps" This reverts commit 7fe19a72a85c5e1389250ef76db13b7fff5f9883. Signed-off-by: Jukka Rissanen --- drivers/ieee802154/ieee802154_nrf5.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index aa67a1f99e1..e5051e731f4 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -1121,12 +1121,8 @@ void nrf_802154_received_timestamp_raw(uint8_t *data, int8_t power, uint8_t lqi, nrf5_data.rx_frames[i].lqi = lqi; #if defined(CONFIG_NET_PKT_TIMESTAMP) - if (time != NRF_802154_NO_TIMESTAMP) { - nrf5_data.rx_frames[i].time = - nrf_802154_timestamp_end_to_phr_convert(time, data[0]); - } else { - nrf5_data.rx_frames[i].time = 0; - } + nrf5_data.rx_frames[i].time = + nrf_802154_timestamp_end_to_phr_convert(time, data[0]); #endif nrf5_data.rx_frames[i].ack_fpb = nrf5_data.last_frame_ack_fpb; From 124ab85f5470c5d228517e9272eaaca37cefd90e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 504/881] Revert "[nrf fromtree] drivers: ieee802154: nrf5: drop packets that are too long" This reverts commit 14324541dbc20b242c6d6e5ff0a16acdd10a06fa. Signed-off-by: Jukka Rissanen --- drivers/ieee802154/ieee802154_nrf5.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index e5051e731f4..25ec35961c7 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -179,12 +179,7 @@ static void nrf5_rx_thread(void *arg1, void *arg2, void *arg3) } #if defined(CONFIG_NET_BUF_DATA_SIZE) - if (pkt_len > CONFIG_NET_BUF_DATA_SIZE) { - LOG_ERR("Received a frame exceeding the buffer size (%u): %u", - CONFIG_NET_BUF_DATA_SIZE, pkt_len); - LOG_HEXDUMP_ERR(rx_frame->psdu, rx_frame->psdu[0] + 1, "Received PSDU"); - goto drop; - } + __ASSERT_NO_MSG(pkt_len <= CONFIG_NET_BUF_DATA_SIZE); #endif LOG_DBG("Frame received"); @@ -237,9 +232,7 @@ static void nrf5_rx_thread(void *arg1, void *arg2, void *arg3) rx_frame->psdu = NULL; nrf_802154_buffer_free_raw(psdu); - if (pkt) { - net_pkt_unref(pkt); - } + net_pkt_unref(pkt); } } From 6529f5eaea4d6a77a672382a1d53f551b22cb55e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:24 +0300 Subject: [PATCH 505/881] Revert "[nrf fromtree] lib: zvfs: Add default eventfd count for hostap" This reverts commit 7393d5b087e428f72bcedecd9da7260744ee01f9. Signed-off-by: Jukka Rissanen --- lib/os/zvfs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index a9c9518a1d5..101e2cce086 100644 --- a/lib/os/zvfs/Kconfig +++ b/lib/os/zvfs/Kconfig @@ -26,7 +26,6 @@ if ZVFS_EVENTFD config ZVFS_EVENTFD_MAX int "Maximum number of ZVFS eventfd's" - default 8 if WIFI_NM_WPA_SUPPLICANT default 1 range 1 4096 help From c3442961fcc885ad096b3a1a5029d8fe5d2f7843 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 506/881] Revert "[nrf fromlist] drivers: nrf_wifi: Fix deadlock in display scan and recovery" This reverts commit 6ec35ab31bc406a96f282cd0520aff5fba8ca664. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 1 - drivers/wifi/nrf_wifi/src/fmac_main.c | 30 ++++++--------------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index c193515ae2d..2f49ed8b055 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -52,7 +52,6 @@ struct nrf_wifi_vif_ctx_zep { uint16_t max_bss_cnt; unsigned int scan_res_cnt; struct k_work_delayable scan_timeout_work; - struct k_work disp_scan_res_work; struct net_eth_addr mac_addr; int if_type; diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 379c3242b18..92a58be9a09 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -171,8 +171,12 @@ void nrf_wifi_event_proc_scan_done_zep(void *vif_ctx, switch (vif_ctx_zep->scan_type) { #ifdef CONFIG_NET_L2_WIFI_MGMT case SCAN_DISPLAY: - /* Schedule scan result processing in system workqueue to avoid deadlock */ - k_work_submit(&vif_ctx_zep->disp_scan_res_work); + status = nrf_wifi_disp_scan_res_get_zep(vif_ctx_zep); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: nrf_wifi_disp_scan_res_get_zep failed", __func__); + return; + } + vif_ctx_zep->scan_in_progress = false; break; #endif /* CONFIG_NET_L2_WIFI_MGMT */ #ifdef CONFIG_NRF70_STA_MODE @@ -238,26 +242,6 @@ void nrf_wifi_scan_timeout_work(struct k_work *work) vif_ctx_zep->scan_in_progress = false; } -void nrf_wifi_disp_scan_res_work_handler(struct k_work *work) -{ - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; - - vif_ctx_zep = CONTAINER_OF(work, struct nrf_wifi_vif_ctx_zep, disp_scan_res_work); - - if (!vif_ctx_zep) { - LOG_ERR("%s: vif_ctx_zep is NULL", __func__); - return; - } - - status = nrf_wifi_disp_scan_res_get_zep(vif_ctx_zep); - if (status != NRF_WIFI_STATUS_SUCCESS) { - LOG_ERR("%s: nrf_wifi_disp_scan_res_get_zep failed", __func__); - return; - } - vif_ctx_zep->scan_in_progress = false; -} - #ifdef CONFIG_NRF70_STA_MODE static void nrf_wifi_process_rssi_from_rx(void *vif_ctx, signed short signal) @@ -853,8 +837,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) #else k_work_init_delayable(&vif_ctx_zep->scan_timeout_work, nrf_wifi_scan_timeout_work); - k_work_init(&vif_ctx_zep->disp_scan_res_work, - nrf_wifi_disp_scan_res_work_handler); #endif /* CONFIG_NRF70_RADIO_TEST */ k_mutex_init(&rpu_drv_priv_zep.rpu_ctx_zep.rpu_lock); From 61293cabfb59b7ea7ac969d4c3a37188c8345c1c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 507/881] Revert "[nrf fromlist] modules: nrf_wifi: Fix bustest QSPI crash" This reverts commit ee7e5ec43237eccdf624b22e5833dd3b209aa635. Signed-off-by: Jukka Rissanen --- .../zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h | 5 ----- modules/nrf_wifi/bus/qspi_if.c | 15 +++++++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h b/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h index 2fecce9cdc7..2524b64ab50 100644 --- a/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h +++ b/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h @@ -31,11 +31,6 @@ enum { NUM_MEM_BLOCKS }; -/* Keeping it higher to avoid changing it ofter, but modify this value - * if rpu_7002_memmap is changed. - */ -#define NRF_WIFI_QSPI_SLAVE_MAX_LATENCY 4 - extern char blk_name[][15]; extern uint32_t rpu_7002_memmap[][3]; diff --git a/modules/nrf_wifi/bus/qspi_if.c b/modules/nrf_wifi/bus/qspi_if.c index 97bab6335c4..949aa591274 100644 --- a/modules/nrf_wifi/bus/qspi_if.c +++ b/modules/nrf_wifi/bus/qspi_if.c @@ -23,8 +23,8 @@ #include #include -#include #include "spi_nor.h" +#include "osal_api.h" /* The QSPI bus node which the NRF70 is on */ #define QSPI_IF_BUS_NODE DT_NODELABEL(qspi) @@ -1290,14 +1290,15 @@ int qspi_read(unsigned int addr, void *data, int len) int qspi_hl_readw(unsigned int addr, void *data) { int status; + uint8_t *rxb = NULL; uint32_t len = 4; - uint8_t rxb[4 + (NRF_WIFI_QSPI_SLAVE_MAX_LATENCY * 4)]; - len += (4 * qspi_cfg->qspi_slave_latency); + len = len + (4 * qspi_cfg->qspi_slave_latency); - if (len > sizeof(rxb)) { - LOG_ERR("%s: len exceeded, check NRF_WIFI_QSPI_SLAVE_MAX_LATENCY (len=%u, rxb=%zu)", - __func__, (unsigned int)len, sizeof(rxb)); + rxb = nrf_wifi_osal_mem_alloc(len); + + if (rxb == NULL) { + LOG_ERR("%s: ERROR ENOMEM line %d", __func__, __LINE__); return -ENOMEM; } @@ -1313,6 +1314,8 @@ int qspi_hl_readw(unsigned int addr, void *data) *(uint32_t *)data = *(uint32_t *)(rxb + (len - 4)); + nrf_wifi_osal_mem_free(rxb); + return status; } From 24e020e915a1c86cda24109efe4dec21c78f4566 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 508/881] Revert "[nrf fromtree] manifest: hostap: Pull fix for warning in interface down" This reverts commit f602a47bdf6ea3a2ee4374fdf731887c55cc43ba. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index d15e692caa4..e1ff77d7c2b 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: e942f86e865d5b24bbbe8b0c333f030cbbe62bfb + revision: bc5d22f5838d017b889d1452a5854f9a32895414 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 05026eb7f39da321d65400b8523cd4446de6f90f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 509/881] Revert "[nrf fromtree] manifest: Use k_fifo for IPC in hostap" This reverts commit 7e7af912181ef1558dc827f28b41f2bc42925e29. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e1ff77d7c2b..c7f54a8dda8 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: bc5d22f5838d017b889d1452a5854f9a32895414 + revision: cf270006050cf944af699301c7f4de2b427cd862 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 71f471917249daadb9dc7c9665114027982aac28 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 510/881] Revert "[nrf fromtree] manifest: hostap: sync for coverity fix" This reverts commit 99b2e349decfd5a91294552de7c253aa540e86ad. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index c7f54a8dda8..9e29918fb21 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: cf270006050cf944af699301c7f4de2b427cd862 + revision: 8412f4b23b6267ee6035d25515a23aaf243f6ad7 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From bde638596f45a1eb8f374b62043993e667ecd9be Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 511/881] Revert "[nrf fromtree] modules: hostap: set the cipher suites for WPA2 & WPA3 SAE mode" This reverts commit 00420dcf6bbbd37e0e43e26c5dae2dbe20289a2e. Signed-off-by: Jukka Rissanen --- modules/hostap/src/supp_api.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index cde1ef95f47..c459171329b 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -752,14 +752,6 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, goto out; } } - - if (!wpa_cli_cmd_v("set_network %d group CCMP", resp.network_id)) { - goto out; - } - - if (!wpa_cli_cmd_v("set_network %d pairwise CCMP", resp.network_id)) { - goto out; - } } else if (params->security == WIFI_SECURITY_TYPE_PSK_SHA256) { if (!wpa_cli_cmd_v("set_network %d psk \"%s\"", resp.network_id, psk_null_terminated)) { @@ -770,14 +762,6 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, resp.network_id)) { goto out; } - - if (!wpa_cli_cmd_v("set_network %d group CCMP", resp.network_id)) { - goto out; - } - - if (!wpa_cli_cmd_v("set_network %d pairwise CCMP", resp.network_id)) { - goto out; - } } else if (params->security == WIFI_SECURITY_TYPE_PSK || params->security == WIFI_SECURITY_TYPE_WPA_PSK) { if (!wpa_cli_cmd_v("set_network %d psk \"%s\"", @@ -795,15 +779,6 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, resp.network_id)) { goto out; } - } else { - if (!wpa_cli_cmd_v("set_network %d group CCMP", resp.network_id)) { - goto out; - } - - if (!wpa_cli_cmd_v("set_network %d pairwise CCMP", - resp.network_id)) { - goto out; - } } } else if (params->security == WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL) { if (!wpa_cli_cmd_v("set_network %d psk \"%s\"", resp.network_id, @@ -831,14 +806,6 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, resp.network_id)) { goto out; } - - if (!wpa_cli_cmd_v("set_network %d group CCMP", resp.network_id)) { - goto out; - } - - if (!wpa_cli_cmd_v("set_network %d pairwise CCMP", resp.network_id)) { - goto out; - } #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE } else if (is_eap_valid_security(params->security)) { if (process_cipher_config(params, &cipher_config)) { From d5f9b20b989f59e1e2de0f6fcaa19c90885b5dc0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 512/881] Revert "[nrf fromtree] modules: hostap: Set default stack size for softAP mode" This reverts commit 7b47aaad615c6ffa50d4c2c9a20654c320f4180d. Signed-off-by: Jukka Rissanen --- modules/hostap/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 2056a43e872..743cbf37204 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -37,8 +37,6 @@ config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE # TODO: Providing higher stack size for Enterprise mode to fix stack # overflow issues. Need to identify the cause for higher stack usage. default 8192 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - # This is needed to handle stack overflow issues on nRF Wi-Fi drivers. - default 5900 if WIFI_NM_WPA_SUPPLICANT_AP default 5800 config WIFI_NM_WPA_SUPPLICANT_WQ_STACK_SIZE From acc8531e89d6d029ccba61f6a27d66d5ea468a88 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 513/881] Revert "[nrf fromtree] modules: hostap: supp_events: Fix possible null deference" This reverts commit 0e4a96918d01cbb7b09a745c3e70fb1a6c550dbb. Signed-off-by: Jukka Rissanen --- modules/hostap/src/supp_events.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/hostap/src/supp_events.c b/modules/hostap/src/supp_events.c index c4175a416be..f13552e8416 100644 --- a/modules/hostap/src/supp_events.c +++ b/modules/hostap/src/supp_events.c @@ -304,15 +304,13 @@ int supplicant_send_wifi_mgmt_ap_sta_event(void *ctx, { struct sta_info *sta = data; struct wpa_supplicant *ap_ctx = ctx; - char *ifname; + char *ifname = ap_ctx->ifname; struct wifi_ap_sta_info sta_info = { 0 }; if (!ap_ctx || !sta) { return -EINVAL; } - ifname = ap_ctx->ifname; - memcpy(sta_info.mac, sta->addr, sizeof(sta_info.mac)); if (event == NET_EVENT_WIFI_CMD_AP_STA_CONNECTED) { From 66c05a17c6cbb56da76c8f531a3143c8764ff4a3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 514/881] Revert "[nrf fromtree] modules: hostap: hapd_events: Fix possible null deference" This reverts commit bd413c5868af9b981d8ca6c6d81e562d86dc2b8b. Signed-off-by: Jukka Rissanen --- modules/hostap/src/hapd_events.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/hostap/src/hapd_events.c b/modules/hostap/src/hapd_events.c index deb4c1705de..2d297b71aff 100644 --- a/modules/hostap/src/hapd_events.c +++ b/modules/hostap/src/hapd_events.c @@ -69,15 +69,13 @@ int hostapd_send_wifi_mgmt_ap_sta_event(struct hostapd_iface *ap_ctx, void *data) { struct sta_info *sta = data; - char *ifname; + char *ifname = ap_ctx->bss[0]->conf->iface; struct wifi_ap_sta_info sta_info = { 0 }; if (!ap_ctx || !sta) { return -EINVAL; } - ifname = ap_ctx->bss[0]->conf->iface; - memcpy(sta_info.mac, sta->addr, sizeof(sta_info.mac)); if (event == NET_EVENT_WIFI_CMD_AP_STA_CONNECTED) { From 370edd2295996d1fb927acbef724bf047f525209 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 515/881] Revert "[nrf fromtree] build: kconfig: Add support for warning insecure features" This reverts commit 938330eeffad4f051e5e05bf30e20c6d0a0e2839. Signed-off-by: Jukka Rissanen --- Kconfig.zephyr | 6 ------ scripts/kconfig/kconfig.py | 12 ------------ share/sysbuild/Kconfig | 6 ------ 3 files changed, 24 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 4993e56c8b2..9baae392209 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -1030,12 +1030,6 @@ config WARN_EXPERIMENTAL Print a warning when the Kconfig tree is parsed if any experimental features are enabled. -config NOT_SECURE - bool - help - Symbol to be selected by a feature to inidicate that feature is - not secure. - config TAINT bool help diff --git a/scripts/kconfig/kconfig.py b/scripts/kconfig/kconfig.py index 74f8513138f..feb0b447a88 100755 --- a/scripts/kconfig/kconfig.py +++ b/scripts/kconfig/kconfig.py @@ -93,8 +93,6 @@ def main(): if kconf.syms.get('WARN_EXPERIMENTAL', kconf.y).tri_value == 2: check_experimental(kconf) - check_not_secure(kconf) - # Hack: Force all symbols to be evaluated, to catch warnings generated # during evaluation. Wait till the end to write the actual output files, so # that we don't generate any output if there are warnings-turned-errors. @@ -268,16 +266,6 @@ def check_experimental(kconf): selector_name = split_expr(selector, AND)[0].name warn(f'Experimental symbol {selector_name} is enabled.') -def check_not_secure(kconf): - not_secure = kconf.syms.get('NOT_SECURE') - dep_expr = kconf.n if not_secure is None else not_secure.rev_dep - - if dep_expr is not kconf.n: - selectors = [s for s in split_expr(dep_expr, OR) if expr_value(s) == 2] - for selector in selectors: - selector_name = split_expr(selector, AND)[0].name - warn(f'Not secure symbol {selector_name} is enabled.') - def promptless(sym): # Returns True if 'sym' has no prompt. Since the symbol might be defined in diff --git a/share/sysbuild/Kconfig b/share/sysbuild/Kconfig index 5f689e07399..e2076941380 100644 --- a/share/sysbuild/Kconfig +++ b/share/sysbuild/Kconfig @@ -69,12 +69,6 @@ config WARN_DEPRECATED Print a warning when the Kconfig tree is parsed if any deprecated features are enabled. -config NOT_SECURE - bool - help - Symbol to be selected by a feature to inidicate that feature is - not secure. - rsource "images/Kconfig" menu "Build options" From 39b6358511cbd0e4f6a2016195832cc28a876e7d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 516/881] Revert "[nrf fromtree] modules: hostap: supp_api: Fix possible null deference" This reverts commit a6ffe954d7c1bead7465efbb33dc1ef1d7407e6f. Signed-off-by: Jukka Rissanen --- modules/hostap/src/supp_api.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index c459171329b..f58a9f7f78a 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -1287,8 +1287,8 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status struct wpa_ssid *ssid = wpa_s->current_ssid; u8 channel; struct signal_poll_resp signal_poll; - u8 *_ssid; - size_t ssid_len; + u8 *_ssid = ssid->ssid; + size_t ssid_len = ssid->ssid_len; struct status_resp cli_status; int proto; int key_mgmt; @@ -1299,8 +1299,6 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status goto out; } - _ssid = ssid->ssid; - ssid_len = ssid->ssid_len; proto = ssid->proto; key_mgmt = ssid->key_mgmt; sae_pwe = wpa_s->conf->sae_pwe; @@ -1491,15 +1489,9 @@ int supplicant_11k_cfg(const struct device *dev, struct wifi_11k_params *params) int supplicant_11k_neighbor_request(const struct device *dev, struct wifi_11k_params *params) { - int ssid_len; + int ssid_len = strlen(params->ssid); - if (params == NULL) { - return -1; - } - - ssid_len = strlen(params->ssid); - - if (ssid_len > 0) { + if (params != NULL && ssid_len > 0) { if (ssid_len > WIFI_SSID_MAX_LEN) { wpa_printf(MSG_ERROR, "%s: ssid too long %u", __func__, ssid_len); From 1fd61fc42f400733684b8ff56a2b90209e8495c5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 517/881] Revert "[nrf fromtree] hostap: Set enterprise crypto insecure" This reverts commit 8c78f8c69f3dec9b128228cf9478ff633eca06a4. Signed-off-by: Jukka Rissanen --- modules/hostap/Kconfig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 743cbf37204..6c8d88483cb 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -198,12 +198,7 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE select MBEDTLS_SERVER_NAME_INDICATION if MBEDTLS_BUILTIN select MBEDTLS_X509_CRL_PARSE_C select MBEDTLS_TLS_VERSION_1_2 - select NOT_SECURE depends on !WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE - help - Enable Enterprise Crypto support for WiFi. This feature - is considered NOT SECURE due the lack of certificate - validation. if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE config EAP_TLS From 10c9edbbfd4e15442668ee1d8144e10418f165e5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 518/881] Revert "[nrf fromtree] modules: hostap: fix connection termination report" This reverts commit 6cc5f638cf2d9653887140b4d4166c1dd2735f60. Signed-off-by: Jukka Rissanen --- modules/hostap/src/supp_events.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/hostap/src/supp_events.c b/modules/hostap/src/supp_events.c index f13552e8416..596ffa6ff56 100644 --- a/modules/hostap/src/supp_events.c +++ b/modules/hostap/src/supp_events.c @@ -224,24 +224,20 @@ int supplicant_send_wifi_mgmt_conn_event(void *ctx, int status_code) int supplicant_send_wifi_mgmt_disc_event(void *ctx, int reason_code) { struct wpa_supplicant *wpa_s = ctx; + int status = wpas_to_wifi_mgmt_disconn_status(reason_code); enum net_event_wifi_cmd event; - int status; if (!wpa_s || !wpa_s->current_ssid) { return -EINVAL; } if (wpa_s->wpa_state >= WPA_COMPLETED) { - /* Disconnect event code & status */ - status = wpas_to_wifi_mgmt_disconn_status(reason_code); if (wpa_s->current_ssid->mode == WPAS_MODE_AP) { event = NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT; } else { event = NET_EVENT_WIFI_CMD_DISCONNECT_RESULT; } } else { - /* Connect event code & status */ - status = WIFI_STATUS_CONN_FAIL; if (wpa_s->current_ssid->mode == WPAS_MODE_AP) { event = NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT; } else { From 3779d694af63fc3245160cab6fe6e10e8ef8c457 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 519/881] Revert "[nrf fromtree] modules: hostap: Fix EAP dependencies" This reverts commit a53d104799903cdfa61a39af955a1dd260753b97. Signed-off-by: Jukka Rissanen --- modules/hostap/Kconfig | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 6c8d88483cb..11feefbb42d 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -200,7 +200,6 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE select MBEDTLS_TLS_VERSION_1_2 depends on !WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE -if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE config EAP_TLS bool "EAP-TLS support" @@ -259,8 +258,7 @@ config EAP_ALL select EAP_GTC select EAP_TTLS select EAP_MSCHAPV2 - default y -endif # WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE + default y if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE config WIFI_NM_WPA_SUPPLICANT_WPA3 bool "WPA3 support" @@ -304,7 +302,6 @@ config WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE bool "Hostapd crypto enterprise support" depends on WIFI_NM_HOSTAPD_AP -if WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE config EAP_SERVER_TLS bool "EAP-TLS server support" @@ -333,9 +330,7 @@ config EAP_SERVER_ALL select EAP_SERVER_PEAP select EAP_SERVER_GTC select EAP_SERVER_TTLS - default y - -endif # WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE + default y if WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE config WIFI_NM_WPA_SUPPLICANT_BSS_MAX_IDLE_TIME int "BSS max idle timeout in seconds" From a29bc9ad41d424a6295feb48b8f58e566bf9dcdc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 520/881] Revert "[nrf fromtree] hostap: Replace wifi event mechanism by k_fifo" This reverts commit b567a543af1492984c401af6bc10b2cb8f326e2c. Signed-off-by: Jukka Rissanen --- modules/hostap/Kconfig | 3 +- modules/hostap/src/supp_main.c | 171 ++++++++++++++++----------------- subsys/net/lib/sockets/Kconfig | 5 + 3 files changed, 87 insertions(+), 92 deletions(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 11feefbb42d..1dfe3541017 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -13,12 +13,11 @@ config WIFI_NM_WPA_SUPPLICANT select XSI_SINGLE_PROCESS select NET_SOCKETS select NET_SOCKETS_PACKET + select NET_SOCKETPAIR select NET_L2_WIFI_MGMT select WIFI_NM select EXPERIMENTAL select COMMON_LIBC_MALLOC - select ZVFS - select ZVFS_EVENTFD help WPA supplicant as a network management backend for WIFI_NM. diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index c2a4866b921..5ba2ef5b10c 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -11,7 +11,6 @@ LOG_MODULE_REGISTER(wifi_supplicant, CONFIG_WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL); #include #include #include -#include #if !defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE) && !defined(CONFIG_MBEDTLS_ENABLE_HEAP) #include @@ -45,7 +44,6 @@ static K_THREAD_STACK_DEFINE(iface_wq_stack, CONFIG_WIFI_NM_WPA_SUPPLICANT_WQ_ST #include "fst/fst.h" #include "includes.h" #include "wpa_cli_zephyr.h" -#include "ctrl_iface_zephyr.h" #ifdef CONFIG_WIFI_NM_HOSTAPD_AP #include "hostapd.h" #include "hapd_main.h" @@ -111,8 +109,7 @@ struct supplicant_context { struct net_mgmt_event_callback cb; struct net_if *iface; char if_name[CONFIG_NET_INTERFACE_NAME_LEN + 1]; - struct k_fifo fifo; - int sock; + int event_socketpair[2]; struct k_work iface_work; struct k_work_q iface_wq; int (*iface_handler)(struct supplicant_context *ctx, struct net_if *iface); @@ -142,25 +139,39 @@ struct k_work_q *get_workq(void) return &get_default_context()->iface_wq; } -/* found in hostap/wpa_supplicant/ctrl_iface_zephyr.c */ -extern int send_data(struct k_fifo *fifo, int sock, const char *buf, size_t len, int flags); - int zephyr_wifi_send_event(const struct wpa_supplicant_event_msg *msg) { struct supplicant_context *ctx; + struct pollfd fds[1]; int ret; /* TODO: Fix this to get the correct container */ ctx = get_default_context(); - if (ctx->sock < 0) { + if (ctx->event_socketpair[1] < 0) { ret = -ENOENT; goto out; } - ret = send_data(&ctx->fifo, ctx->sock, - (const char *)msg, sizeof(*msg), 0); - if (ret != 0) { + fds[0].fd = ctx->event_socketpair[0]; + fds[0].events = POLLOUT; + fds[0].revents = 0; + + ret = zsock_poll(fds, 1, WRITE_TIMEOUT); + if (ret < 0) { + ret = -errno; + LOG_ERR("Cannot write event (%d)", ret); + goto out; + } + + ret = zsock_send(ctx->event_socketpair[1], msg, sizeof(*msg), 0); + if (ret < 0) { + ret = -errno; + LOG_WRN("Event send failed (%d)", ret); + goto out; + } + + if (ret != sizeof(*msg)) { ret = -EMSGSIZE; LOG_WRN("Event partial send (%d)", ret); goto out; @@ -551,105 +562,84 @@ static int setup_interface_monitoring(struct supplicant_context *ctx, struct net static void event_socket_handler(int sock, void *eloop_ctx, void *user_data) { struct supplicant_context *ctx = user_data; - struct wpa_supplicant_event_msg event_msg; - struct zephyr_msg *msg; - zvfs_eventfd_t value; + struct wpa_supplicant_event_msg msg; + int ret; ARG_UNUSED(eloop_ctx); + ARG_UNUSED(ctx); - do { - zvfs_eventfd_read(sock, &value); - - msg = k_fifo_get(&ctx->fifo, K_NO_WAIT); - if (msg == NULL) { - LOG_ERR("fifo(event): %s", "empty"); - return; - } - - if (msg->data == NULL) { - LOG_ERR("fifo(event): %s", "no data"); - goto out; - } - - if (msg->len != sizeof(event_msg)) { - LOG_ERR("Received incomplete message: got: %d, expected:%d", - msg->len, sizeof(event_msg)); - goto out; - } + ret = zsock_recv(sock, &msg, sizeof(msg), 0); + if (ret < 0) { + LOG_ERR("Failed to recv the message (%d)", -errno); + return; + } - memcpy(&event_msg, msg->data, sizeof(event_msg)); + if (ret != sizeof(msg)) { + LOG_ERR("Received incomplete message: got: %d, expected:%d", + ret, sizeof(msg)); + return; + } - LOG_DBG("Passing message %d to wpa_supplicant", event_msg.event); + LOG_DBG("Passing message %d to wpa_supplicant", msg.event); - if (event_msg.global) { - wpa_supplicant_event_global(event_msg.ctx, event_msg.event, - event_msg.data); + if (msg.global) { + wpa_supplicant_event_global(msg.ctx, msg.event, msg.data); #ifdef CONFIG_WIFI_NM_HOSTAPD_AP - } else if (event_msg.hostapd) { - hostapd_event(event_msg.ctx, event_msg.event, event_msg.data); + } else if (msg.hostapd) { + hostapd_event(msg.ctx, msg.event, msg.data); #endif - } else { - wpa_supplicant_event(event_msg.ctx, event_msg.event, event_msg.data); - } - - if (event_msg.data) { - union wpa_event_data *data = event_msg.data; - - /* Free up deep copied data */ - if (event_msg.event == EVENT_AUTH) { - os_free((char *)data->auth.ies); - } else if (event_msg.event == EVENT_RX_MGMT) { - os_free((char *)data->rx_mgmt.frame); - } else if (event_msg.event == EVENT_TX_STATUS) { - os_free((char *)data->tx_status.data); - } else if (event_msg.event == EVENT_ASSOC) { - os_free((char *)data->assoc_info.addr); - os_free((char *)data->assoc_info.req_ies); - os_free((char *)data->assoc_info.resp_ies); - os_free((char *)data->assoc_info.resp_frame); - } else if (event_msg.event == EVENT_ASSOC_REJECT) { - os_free((char *)data->assoc_reject.bssid); - os_free((char *)data->assoc_reject.resp_ies); - } else if (event_msg.event == EVENT_DEAUTH) { - os_free((char *)data->deauth_info.addr); - os_free((char *)data->deauth_info.ie); - } else if (event_msg.event == EVENT_DISASSOC) { - os_free((char *)data->disassoc_info.addr); - os_free((char *)data->disassoc_info.ie); - } else if (event_msg.event == EVENT_UNPROT_DEAUTH) { - os_free((char *)data->unprot_deauth.sa); - os_free((char *)data->unprot_deauth.da); - } else if (event_msg.event == EVENT_UNPROT_DISASSOC) { - os_free((char *)data->unprot_disassoc.sa); - os_free((char *)data->unprot_disassoc.da); - } - - os_free(event_msg.data); + } else { + wpa_supplicant_event(msg.ctx, msg.event, msg.data); + } + + if (msg.data) { + union wpa_event_data *data = msg.data; + + /* Free up deep copied data */ + if (msg.event == EVENT_AUTH) { + os_free((char *)data->auth.ies); + } else if (msg.event == EVENT_RX_MGMT) { + os_free((char *)data->rx_mgmt.frame); + } else if (msg.event == EVENT_TX_STATUS) { + os_free((char *)data->tx_status.data); + } else if (msg.event == EVENT_ASSOC) { + os_free((char *)data->assoc_info.addr); + os_free((char *)data->assoc_info.req_ies); + os_free((char *)data->assoc_info.resp_ies); + os_free((char *)data->assoc_info.resp_frame); + } else if (msg.event == EVENT_ASSOC_REJECT) { + os_free((char *)data->assoc_reject.bssid); + os_free((char *)data->assoc_reject.resp_ies); + } else if (msg.event == EVENT_DEAUTH) { + os_free((char *)data->deauth_info.addr); + os_free((char *)data->deauth_info.ie); + } else if (msg.event == EVENT_DISASSOC) { + os_free((char *)data->disassoc_info.addr); + os_free((char *)data->disassoc_info.ie); + } else if (msg.event == EVENT_UNPROT_DEAUTH) { + os_free((char *)data->unprot_deauth.sa); + os_free((char *)data->unprot_deauth.da); + } else if (msg.event == EVENT_UNPROT_DISASSOC) { + os_free((char *)data->unprot_disassoc.sa); + os_free((char *)data->unprot_disassoc.da); } -out: - os_free(msg->data); - os_free(msg); - - } while (!k_fifo_is_empty(&ctx->fifo)); + os_free(msg.data); + } } static int register_supplicant_event_socket(struct supplicant_context *ctx) { int ret; - ret = zvfs_eventfd(0, ZVFS_EFD_NONBLOCK); + ret = socketpair(AF_UNIX, SOCK_STREAM, 0, ctx->event_socketpair); if (ret < 0) { ret = -errno; LOG_ERR("Failed to initialize socket (%d)", ret); return ret; } - ctx->sock = ret; - - k_fifo_init(&ctx->fifo); - - eloop_register_read_sock(ctx->sock, event_socket_handler, NULL, ctx); + eloop_register_read_sock(ctx->event_socketpair[0], event_socket_handler, NULL, ctx); return 0; } @@ -717,7 +707,7 @@ static void handler(void) supplicant_generate_state_event(ctx->if_name, NET_EVENT_SUPPLICANT_CMD_NOT_READY, 0); - eloop_unregister_read_sock(ctx->sock); + eloop_unregister_read_sock(ctx->event_socketpair[0]); zephyr_global_wpa_ctrl_deinit(); @@ -726,7 +716,8 @@ static void handler(void) out: wpa_supplicant_deinit(ctx->supplicant); - close(ctx->sock); + zsock_close(ctx->event_socketpair[0]); + zsock_close(ctx->event_socketpair[1]); err: os_free(params.pid_file); diff --git a/subsys/net/lib/sockets/Kconfig b/subsys/net/lib/sockets/Kconfig index 791fc464d38..6662582aed8 100644 --- a/subsys/net/lib/sockets/Kconfig +++ b/subsys/net/lib/sockets/Kconfig @@ -350,6 +350,7 @@ if NET_SOCKETPAIR config NET_SOCKETPAIR_BUFFER_SIZE int "Size of the intermediate buffer, in bytes" + default 1024 if WIFI_NM_WPA_SUPPLICANT default 64 range 1 4096 help @@ -371,6 +372,8 @@ if NET_SOCKETPAIR_STATIC config NET_SOCKETPAIR_MAX int "How many socketpairs to pre-allocate" + default 6 if WIFI_NM_HOSTAPD_AP + default 4 if WIFI_NM_WPA_SUPPLICANT default 1 endif # NET_SOCKETPAIR_STATIC @@ -379,6 +382,8 @@ if NET_SOCKETPAIR_HEAP config HEAP_MEM_POOL_ADD_SIZE_SOCKETPAIR int + default 9136 if WIFI_NM_HOSTAPD_AP + default 6852 if WIFI_NM_WPA_SUPPLICANT default 296 endif # NET_SOCKETPAIR_HEAP From 546a18ce987fba67f0f9ee732f1e0707487d4038 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:25 +0300 Subject: [PATCH 521/881] Revert "[nrf fromtree] modules: hostap: Fix getting error stations twt capability issue." This reverts commit c1a5f870cd59abf4b796f8bd8f48783de25484ea. Signed-off-by: Jukka Rissanen --- modules/hostap/src/hapd_events.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/hostap/src/hapd_events.c b/modules/hostap/src/hapd_events.c index 2d297b71aff..c71015f7f92 100644 --- a/modules/hostap/src/hapd_events.c +++ b/modules/hostap/src/hapd_events.c @@ -35,17 +35,10 @@ static enum wifi_link_mode hapd_get_sta_link_mode(struct hostapd_iface *iface, } } -#define HE_MACCAP_TWT_REQUESTER BIT(1) - -static bool hapd_get_sta_he_twt_capable(struct hostapd_iface *iface, struct sta_info *sta) +static bool hapd_is_twt_capable(struct hostapd_iface *iface, struct sta_info *sta) { #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_11AX - if (sta->flags & WLAN_STA_HE) { - return (sta->he_capab->he_mac_capab_info[0] - & HE_MACCAP_TWT_REQUESTER ? true : false); - } else { - return false; - } + return hostapd_get_he_twt_responder(iface->bss[0], IEEE80211_MODE_AP); #else return false; #endif @@ -80,7 +73,7 @@ int hostapd_send_wifi_mgmt_ap_sta_event(struct hostapd_iface *ap_ctx, if (event == NET_EVENT_WIFI_CMD_AP_STA_CONNECTED) { sta_info.link_mode = hapd_get_sta_link_mode(ap_ctx, sta); - sta_info.twt_capable = hapd_get_sta_he_twt_capable(ap_ctx, sta); + sta_info.twt_capable = hapd_is_twt_capable(ap_ctx, sta); } return supplicant_send_wifi_mgmt_event(ifname, From 6def91435c997d3bee5e75001f08636ecbc5e857 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 522/881] Revert "[nrf fromtree] net: wifi: shell: Enable Wi-Fi credentials support" This reverts commit bdc2044a028c6df716cdf015c5d08e1a9a32b907. Signed-off-by: Jukka Rissanen --- modules/hostap/Kconfig | 1 - snippets/wifi-credentials/README.rst | 29 ------------------- snippets/wifi-credentials/snippet.yml | 3 -- .../wifi-credentials/wifi-credentials.conf | 8 ----- 4 files changed, 41 deletions(-) delete mode 100644 snippets/wifi-credentials/README.rst delete mode 100644 snippets/wifi-credentials/snippet.yml delete mode 100644 snippets/wifi-credentials/wifi-credentials.conf diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 1dfe3541017..95dd2531503 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -25,7 +25,6 @@ if WIFI_NM_WPA_SUPPLICANT config HEAP_MEM_POOL_ADD_SIZE_HOSTAP def_int 66560 if WIFI_NM_HOSTAPD_AP - def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP # 30K is mandatory, but might need more for long duration use cases diff --git a/snippets/wifi-credentials/README.rst b/snippets/wifi-credentials/README.rst deleted file mode 100644 index 283bc395858..00000000000 --- a/snippets/wifi-credentials/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. _snippet-wifi-credentials: - -Wi-Fi Credentials Snippet (wifi-credential) -########################################### - -.. code-block:: console - - west build -S wifi-credentials [...] - -Can also be used along with the :ref:`snippet-wifi-enterprise` snippet. - -.. code-block:: console - - west build -S "wifi-enterprise,wifi-credentials" [...] - -Overview -******** - -This snippet enables Wi-Fi credentials support. - -Requirements -************ - -Hardware support for: - -- :kconfig:option:`CONFIG_WIFI` -- :kconfig:option:`CONFIG_WIFI_USE_NATIVE_NETWORKING` -- :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT` -- :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE` diff --git a/snippets/wifi-credentials/snippet.yml b/snippets/wifi-credentials/snippet.yml deleted file mode 100644 index 6046c0865dc..00000000000 --- a/snippets/wifi-credentials/snippet.yml +++ /dev/null @@ -1,3 +0,0 @@ -name: wifi-credentials -append: - EXTRA_CONF_FILE: wifi-credentials.conf diff --git a/snippets/wifi-credentials/wifi-credentials.conf b/snippets/wifi-credentials/wifi-credentials.conf deleted file mode 100644 index 4ac28169825..00000000000 --- a/snippets/wifi-credentials/wifi-credentials.conf +++ /dev/null @@ -1,8 +0,0 @@ -# For use with Wi-Fi Credentials -CONFIG_WIFI_CREDENTIALS=y -CONFIG_FLASH=y -CONFIG_FLASH_PAGE_LAYOUT=y -CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y -CONFIG_SETTINGS_NVS=y From a1ee4e586c8e391a06bcb1eb9d8319544f20fbb0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 523/881] Revert "[nrf fromtree] manifest: nrf_wifi: Pull fix for raw TX memory leak" This reverts commit b6af6cb6ac232d31d5431693633010c36b256809. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 9e29918fb21..9807058ac13 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: 968d55ff22579080466bf2f482596dd6e35361c6 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 5f59c2336c69f28ae83f93812a1d726f9fceabfe + revision: 52286f111b4765e0dd40f43124e7bb5c14758dff path: modules/lib/nrf_wifi - name: open-amp revision: f7f4d083c7909a39d86e217376c69b416ec4faf3 From a8d5874d1270301424dafb788efb103215f0d3fa Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 524/881] Revert "[nrf fromlist] drivers: nrf_wifi: Remove station mode from monitor mode" This reverts commit 193b571ff33dfe73941617c4b40b0144476edeed. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 4 +- drivers/wifi/nrf_wifi/inc/wifi_mgmt.h | 2 - drivers/wifi/nrf_wifi/src/fmac_main.c | 10 ++-- drivers/wifi/nrf_wifi/src/net_if.c | 66 +++++++++++++-------------- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 2 - 5 files changed, 38 insertions(+), 46 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 2f49ed8b055..8c1d8a1851b 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -62,9 +62,6 @@ struct nrf_wifi_vif_ctx_zep { #ifdef CONFIG_NET_STATISTICS_ETHERNET struct net_stats_eth eth_stats; #endif /* CONFIG_NET_STATISTICS_ETHERNET */ -#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) - bool authorized; -#endif #ifdef CONFIG_NRF70_STA_MODE unsigned int assoc_freq; enum nrf_wifi_fmac_if_carr_state if_carr_state; @@ -75,6 +72,7 @@ struct nrf_wifi_vif_ctx_zep { unsigned char twt_flow_in_progress_map; struct wifi_ps_config *ps_info; bool ps_config_info_evnt; + bool authorized; bool cookie_resp_received; #ifdef CONFIG_NRF70_DATA_TX struct k_work nrf_wifi_net_iface_work; diff --git a/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h b/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h index a4ae2030210..e2aa91caa48 100644 --- a/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h +++ b/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h @@ -22,7 +22,6 @@ #define WIFI_MGMT_DATA_CTRL_FILTER_SETTING 0xE #define WIFI_ALL_FILTER_SETTING 0xF -#ifdef CONFIG_NRF70_STA_MODE struct twt_interval_float { unsigned short mantissa; unsigned char exponent; @@ -55,7 +54,6 @@ int nrf_wifi_get_power_save_config(const struct device *dev, void nrf_wifi_event_proc_get_power_save_info(void *vif_ctx, struct nrf_wifi_umac_event_power_save_info *ps_info, unsigned int event_len); -#endif /* CONFIG_NRF70_STA_MODE */ #ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES int nrf_wifi_mode(const struct device *dev, diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 92a58be9a09..72055fb0299 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -350,7 +350,7 @@ int nrf_wifi_reg_domain(const struct device *dev, struct wifi_reg_domain *reg_do goto out; } -#if defined(CONFIG_NRF70_SCAN_ONLY) || defined(CONFIG_NRF70_RAW_DATA_RX) +#ifdef CONFIG_NRF70_SCAN_ONLY if (reg_domain->oper == WIFI_MGMT_SET) { memcpy(reg_domain_info.alpha2, reg_domain->country_code, WIFI_COUNTRY_CODE_LEN); @@ -739,10 +739,10 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) data_config.rate_protection_type = rate_protection_type; callbk_fns.if_carr_state_chg_callbk_fn = nrf_wifi_if_carr_state_chg; callbk_fns.rx_frm_callbk_fn = nrf_wifi_if_rx_frm; -#endif #if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX) callbk_fns.sniffer_callbk_fn = nrf_wifi_if_sniffer_rx_frm; #endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */ +#endif rx_buf_pools[0].num_bufs = rx1_num_bufs; rx_buf_pools[1].num_bufs = rx2_num_bufs; rx_buf_pools[2].num_bufs = rx3_num_bufs; @@ -756,7 +756,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) callbk_fns.scan_start_callbk_fn = nrf_wifi_event_proc_scan_start_zep; callbk_fns.scan_done_callbk_fn = nrf_wifi_event_proc_scan_done_zep; callbk_fns.reg_change_callbk_fn = reg_change_callbk_fn; - callbk_fns.event_get_reg = nrf_wifi_event_get_reg_zep; #ifdef CONFIG_NET_L2_WIFI_MGMT callbk_fns.disp_scan_res_callbk_fn = nrf_wifi_event_proc_disp_scan_res_zep; #endif /* CONFIG_NET_L2_WIFI_MGMT */ @@ -770,6 +769,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) callbk_fns.twt_config_callbk_fn = nrf_wifi_event_proc_twt_setup_zep; callbk_fns.twt_teardown_callbk_fn = nrf_wifi_event_proc_twt_teardown_zep; callbk_fns.twt_sleep_callbk_fn = nrf_wifi_event_proc_twt_sleep_zep; + callbk_fns.event_get_reg = nrf_wifi_event_get_reg_zep; callbk_fns.event_get_ps_info = nrf_wifi_event_proc_get_power_save_info; callbk_fns.cookie_rsp_callbk_fn = nrf_wifi_event_proc_cookie_rsp; callbk_fns.process_rssi_from_rx = nrf_wifi_process_rssi_from_rx; @@ -858,12 +858,10 @@ static const struct wifi_mgmt_ops nrf_wifi_mgmt_ops = { .get_stats = nrf_wifi_stats_get, .reset_stats = nrf_wifi_stats_reset, #endif /* CONFIG_NET_STATISTICS_WIFI */ -#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) - .reg_domain = nrf_wifi_reg_domain, -#endif #ifdef CONFIG_NRF70_STA_MODE .set_power_save = nrf_wifi_set_power_save, .set_twt = nrf_wifi_set_twt, + .reg_domain = nrf_wifi_reg_domain, .get_power_save_config = nrf_wifi_get_power_save_config, .set_rts_threshold = nrf_wifi_set_rts_threshold, .get_rts_threshold = nrf_wifi_get_rts_threshold, diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 4830d63c9d1..a49fdc16498 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -256,6 +256,39 @@ static void nrf_wifi_net_iface_work_handler(struct k_work *work) } } +#if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX) +void nrf_wifi_if_sniffer_rx_frm(void *os_vif_ctx, void *frm, + struct raw_rx_pkt_header *raw_rx_hdr, + bool pkt_free) +{ + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx; + struct net_if *iface = vif_ctx_zep->zep_net_if_ctx; + struct net_pkt *pkt; + struct nrf_wifi_ctx_zep *rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; + struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; + int ret; + + sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx); + + pkt = net_raw_pkt_from_nbuf(iface, frm, sizeof(struct raw_rx_pkt_header), + raw_rx_hdr, + pkt_free); + if (!pkt) { + LOG_DBG("Failed to allocate net_pkt"); + return; + } + + net_capture_pkt(iface, pkt); + + ret = net_recv_data(iface, pkt); + if (ret < 0) { + LOG_DBG("RCV Packet dropped by NET stack: %d", ret); + net_pkt_unref(pkt); + } +} +#endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */ + void nrf_wifi_if_rx_frm(void *os_vif_ctx, void *frm) { struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx; @@ -325,39 +358,6 @@ static bool is_eapol(struct net_pkt *pkt) } #endif /* CONFIG_NRF70_DATA_TX */ -#if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX) -void nrf_wifi_if_sniffer_rx_frm(void *os_vif_ctx, void *frm, - struct raw_rx_pkt_header *raw_rx_hdr, - bool pkt_free) -{ - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx; - struct net_if *iface = vif_ctx_zep->zep_net_if_ctx; - struct net_pkt *pkt; - struct nrf_wifi_ctx_zep *rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; - struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; - int ret; - - sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx); - - pkt = net_raw_pkt_from_nbuf(iface, frm, sizeof(struct raw_rx_pkt_header), - raw_rx_hdr, - pkt_free); - if (!pkt) { - LOG_DBG("Failed to allocate net_pkt"); - return; - } - - net_capture_pkt(iface, pkt); - - ret = net_recv_data(iface, pkt); - if (ret < 0) { - LOG_DBG("RCV Packet dropped by NET stack: %d", ret); - net_pkt_unref(pkt); - } -} -#endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */ - enum ethernet_hw_caps nrf_wifi_if_caps_get(const struct device *dev) { enum ethernet_hw_caps caps = (ETHERNET_LINK_10BASE | diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index a323faf21dd..64003b8ff25 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -25,7 +25,6 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; -#ifdef CONFIG_NRF70_STA_MODE int nrf_wifi_set_power_save(const struct device *dev, struct wifi_ps_params *params) { @@ -744,7 +743,6 @@ void nrf_wifi_event_proc_twt_sleep_zep(void *vif_ctx, out: k_mutex_unlock(&vif_ctx_zep->vif_lock); } -#endif /* CONFIG_NRF70_STA_MODE */ #ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES int nrf_wifi_mode(const struct device *dev, From 1ccd94f81a57647b925905a3586dd614615c7f2d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 525/881] Revert "[nrf fromtree] wifi: nrf_wifi: ignore interface if TX disabled" This reverts commit 4369dc944b2c59a0eeee61b98d53611aaf66f951. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/net_if.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index a49fdc16498..82945ff55c2 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -18,7 +18,6 @@ #include LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); -#include #include #include "net_private.h" @@ -703,11 +702,6 @@ void nrf_wifi_if_init_zep(struct net_if *iface) nrf_wifi_net_iface_work_handler); #endif /* CONFIG_NRF70_DATA_TX */ -#ifdef CONFIG_NRF70_SCAN_ONLY - /* In scan only mode this interface should be ignored by the connectivity manager */ - conn_mgr_ignore_iface(iface); -#endif /* CONFIG_NRF70_SCAN_ONLY */ - #ifdef CONFIG_NRF_WIFI_RPU_RECOVERY k_work_init(&vif_ctx_zep->nrf_wifi_rpu_recovery_work, nrf_wifi_rpu_recovery_work_handler); From ed142708c2b3bf50b704e57446a485a1b932825c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 526/881] Revert "[nrf fromtree] drivers: nrf_wifi: Fix rpu recovery debug info" This reverts commit 453bc099f598fcd2bdd0ffe65096a81883f7214d. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 2 -- drivers/wifi/nrf_wifi/src/net_if.c | 16 ---------------- drivers/wifi/nrf_wifi/src/wifi_util.c | 23 ++++++++--------------- 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 8c1d8a1851b..23f96089eb6 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -118,8 +118,6 @@ struct nrf_wifi_ctx_zep { unsigned int rpu_recovery_retries; int rpu_recovery_success; int rpu_recovery_failure; - int wdt_irq_received; - int wdt_irq_ignored; #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ }; diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 82945ff55c2..f94dc5a1e21 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -72,8 +72,6 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work) struct nrf_wifi_vif_ctx_zep, nrf_wifi_rpu_recovery_work); struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; - struct nrf_wifi_hal_dev_ctx *hal_dev_ctx = NULL; int ret; if (!vif_ctx_zep) { @@ -92,18 +90,6 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work) return; } - fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; - if (!fmac_dev_ctx) { - LOG_ERR("%s: fmac_dev_ctx is NULL", __func__); - return; - } - - hal_dev_ctx = fmac_dev_ctx->hal_dev_ctx; - if (!hal_dev_ctx) { - LOG_ERR("%s: hal_dev_ctx is NULL", __func__); - return; - } - if (rpu_ctx_zep->rpu_recovery_in_progress) { #ifdef CONFIG_NRF_WIFI_RPU_RECOVERY_DEBUG LOG_ERR("%s: RPU recovery already in progress", __func__); @@ -148,8 +134,6 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work) } #endif rpu_ctx_zep->rpu_recovery_in_progress = true; - rpu_ctx_zep->wdt_irq_received += hal_dev_ctx->wdt_irq_received; - rpu_ctx_zep->wdt_irq_ignored += hal_dev_ctx->wdt_irq_ignored; #ifdef CONFIG_NRF_WIFI_RPU_RECOVERY_DEBUG LOG_ERR("%s: Bringing the interface down", __func__); #else diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index 57bda1f4ff4..4a31cae8121 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -938,20 +938,10 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, } fmac_dev_ctx = ctx->rpu_ctx; - if (!fmac_dev_ctx) { - shell_fprintf(sh, SHELL_ERROR, "FMAC context not initialized\n"); - ret = -ENOEXEC; - goto unlock; - } - hal_dev_ctx = fmac_dev_ctx->hal_dev_ctx; - if (!hal_dev_ctx) { - shell_fprintf(sh, SHELL_ERROR, "HAL context not initialized\n"); - ret = -ENOEXEC; - goto unlock; - } - shell_fprintf(sh, SHELL_INFO, + shell_fprintf(sh, + SHELL_INFO, "wdt_irq_received: %d\n" "wdt_irq_ignored: %d\n" "last_wakeup_now_asserted_time_ms: %lu milliseconds\n" @@ -960,11 +950,14 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, "current time: %lu milliseconds\n" "rpu_recovery_success: %d\n" "rpu_recovery_failure: %d\n\n", - ctx->wdt_irq_received, ctx->wdt_irq_ignored, + hal_dev_ctx->wdt_irq_received, + hal_dev_ctx->wdt_irq_ignored, hal_dev_ctx->last_wakeup_now_asserted_time_ms, hal_dev_ctx->last_wakeup_now_deasserted_time_ms, - hal_dev_ctx->last_rpu_sleep_opp_time_ms, current_time_ms, - ctx->rpu_recovery_success, ctx->rpu_recovery_failure); + hal_dev_ctx->last_rpu_sleep_opp_time_ms, + current_time_ms, + ctx->rpu_recovery_success, + ctx->rpu_recovery_failure); ret = 0; unlock: From 6148b838384251b0d5fb80ccef214402291fc586 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 527/881] Revert "[nrf fromtree] drivers: nrf_wifi: Fix return codes for xmit" This reverts commit 420a5b5c0eed0a9daf45459b0d89ebe5d15abf57. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/net_if.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index f94dc5a1e21..9108a0dab3b 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -363,7 +363,7 @@ enum ethernet_hw_caps nrf_wifi_if_caps_get(const struct device *dev) int nrf_wifi_if_send(const struct device *dev, struct net_pkt *pkt) { - int ret = -EINVAL; + int ret = -1; #ifdef CONFIG_NRF70_DATA_TX struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; @@ -404,7 +404,6 @@ int nrf_wifi_if_send(const struct device *dev, if (nbuf == NULL) { LOG_ERR("%s: allocation failed", __func__); - ret = -ENOMEM; goto drop; } @@ -421,7 +420,6 @@ int nrf_wifi_if_send(const struct device *dev, #endif /* CONFIG_NRF70_RAW_DATA_TX */ if ((vif_ctx_zep->if_carr_state != NRF_WIFI_FMAC_IF_CARR_STATE_ON) || (!vif_ctx_zep->authorized && !is_eapol(pkt))) { - ret = -EPERM; goto drop; } @@ -434,8 +432,6 @@ int nrf_wifi_if_send(const struct device *dev, if (ret == NRF_WIFI_STATUS_FAIL) { /* FMAC API takes care of freeing the nbuf */ host_stats->total_tx_drop_pkts++; - /* Could be many reasons, but likely no space in the queue */ - ret = -ENOBUFS; } goto unlock; drop: From 38a33d0270c00bb4de560ae9ff215c87d7aa3fbe Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 528/881] Revert "[nrf fromtree] drivers: wifi: nrf_wifi: wifi_mgmt: remove redundant null check" This reverts commit 2e97bb1307104ce40f56aefac27eacd17a6105ce. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 64003b8ff25..875ce786b57 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -202,6 +202,11 @@ int nrf_wifi_get_power_save_config(const struct device *dev, fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; + if (!rpu_ctx_zep) { + LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); + goto out; + } + vif_ctx_zep->ps_info = ps_config; vif_ctx_zep->ps_config_info_evnt = false; From b4544cf6d7d2c36772032c22a8525e0467efeff8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 529/881] Revert "[nrf fromtree] drivers: nrf_wifi: Fix TX drop statistics" This reverts commit 1aa5abe53df33898e935d99ce5b905a07144aacf. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/net_if.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 9108a0dab3b..19101fab442 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -429,10 +429,6 @@ int nrf_wifi_if_send(const struct device *dev, #ifdef CONFIG_NRF70_RAW_DATA_TX } #endif /* CONFIG_NRF70_RAW_DATA_TX */ - if (ret == NRF_WIFI_STATUS_FAIL) { - /* FMAC API takes care of freeing the nbuf */ - host_stats->total_tx_drop_pkts++; - } goto unlock; drop: if (host_stats != NULL) { From 9287ee309e92653a4dad0c014690b5d3e0483c7e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 530/881] Revert "[nrf fromtree] wifi: nrf70: Fix system work queue stack size override" This reverts commit c237966b7fbacfaaa7e584492b0e720c5cb19ef0. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 6 ++++-- kernel/Kconfig | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 8d414276038..bfc1ce0c7f0 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -599,8 +599,10 @@ endif if NETWORKING # Finetune defaults for certain system components used by the driver -# Note: These will take effect only if the symbol is not defined already -# (i.e., the original symbol is processed after "drivers/Kconfig") + +config SYSTEM_WORKQUEUE_STACK_SIZE + default 4096 + config NET_TX_STACK_SIZE default 4096 diff --git a/kernel/Kconfig b/kernel/Kconfig index 838d44afbf9..536a6624f52 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -577,7 +577,7 @@ rsource "Kconfig.obj_core" menu "System Work Queue Options" config SYSTEM_WORKQUEUE_STACK_SIZE int "System workqueue stack size" - default 4096 if COVERAGE_GCOV || WIFI_NRF70 + default 4096 if COVERAGE_GCOV default 2560 if WIFI_NM_WPA_SUPPLICANT default 1024 From 5b3326f44515d70385bf54a61c2fa56e434e4691 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 531/881] Revert "[nrf fromtree] modules: nrf_wifi: Fix accuracy of microseconds API" This reverts commit b14fd1f61249852f0d2c8e2b07dc2126bad24e76. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/os/shim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index df460d5ab53..14107f13928 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -854,7 +854,7 @@ static void zep_shim_work_kill(void *item) static unsigned long zep_shim_time_get_curr_us(void) { - return k_ticks_to_us_floor64(k_uptime_ticks()); + return k_uptime_get() * USEC_PER_MSEC; } static unsigned int zep_shim_time_elapsed_us(unsigned long start_time_us) From 8dffccfd9d1fd1a966475f92c34d6b86aac44517 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 532/881] Revert "[nrf fromtree] modules: nrf_wifi: Fix interface down hang" This reverts commit d6054d8c397d181d900c59373e0e261ad8eca41a. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/bus/qspi_if.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/nrf_wifi/bus/qspi_if.c b/modules/nrf_wifi/bus/qspi_if.c index 949aa591274..ad0534a95a3 100644 --- a/modules/nrf_wifi/bus/qspi_if.c +++ b/modules/nrf_wifi/bus/qspi_if.c @@ -1196,9 +1196,7 @@ struct device qspi_perip = { int qspi_deinit(void) { - if (nrfx_qspi_init_check()) { - _qspi_device_uninit(&qspi_perip); - } + _qspi_device_uninit(&qspi_perip); return 0; } From afb15a50c4f88899547ce0a60b40b41bf98fc62d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 533/881] Revert "[nrf fromtree] drivers: wifi: Introduce option to use K_HEAP" This reverts commit b0e4801ac20650a9c73b8ec11bf4ae097b4449b1. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 16 ---------------- modules/nrf_wifi/os/shim.c | 24 ------------------------ 2 files changed, 40 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index bfc1ce0c7f0..8980cce8205 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -570,21 +570,6 @@ config NRF70_RSSI_STALE_TIMEOUT_MS value as the driver does not store it and requires RPU to provide the information. -config NRF_WIFI_GLOBAL_HEAP - bool "Use Zephyr kernel heap for Wi-Fi driver" - depends on KERNEL_MEM_POOL && ((HEAP_MEM_POOL_SIZE > 0) || HEAP_MEM_POOL_IGNORE_MIN) - help - Enable this option to use K_HEAP for memory allocations in Wi-Fi driver. - -if NRF_WIFI_GLOBAL_HEAP -config HEAP_MEM_POOL_ADD_SIZE_NRF70 - # Use a maximum that works for typical use cases and boards, each sample/app can override - # this value if needed by using CONFIG_HEAP_MEM_POOL_IGNORE_MIN - def_int 25000 if NRF70_SCAN_ONLY - def_int 150000 -endif # NRF_WIFI_GLOBAL_HEAP - -if !NRF_WIFI_GLOBAL_HEAP config NRF_WIFI_CTRL_HEAP_SIZE int "Dedicated memory pool for control plane" default 20000 @@ -595,7 +580,6 @@ config NRF_WIFI_DATA_HEAP_SIZE default 8000 if NRF70_SCAN_ONLY default 110000 if !SOC_FAMILY_NORDIC_NRF default 130000 -endif if NETWORKING # Finetune defaults for certain system components used by the driver diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index 14107f13928..29b72203b55 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -33,8 +33,6 @@ #include "common/hal_structs_common.h" LOG_MODULE_REGISTER(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); - -#if !defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) #if defined(CONFIG_NOCACHE_MEMORY) K_HEAP_DEFINE_NOCACHE(wifi_drv_ctrl_mem_pool, CONFIG_NRF_WIFI_CTRL_HEAP_SIZE); K_HEAP_DEFINE_NOCACHE(wifi_drv_data_mem_pool, CONFIG_NRF_WIFI_DATA_HEAP_SIZE); @@ -42,8 +40,6 @@ K_HEAP_DEFINE_NOCACHE(wifi_drv_data_mem_pool, CONFIG_NRF_WIFI_DATA_HEAP_SIZE); K_HEAP_DEFINE(wifi_drv_ctrl_mem_pool, CONFIG_NRF_WIFI_CTRL_HEAP_SIZE); K_HEAP_DEFINE(wifi_drv_data_mem_pool, CONFIG_NRF_WIFI_DATA_HEAP_SIZE); #endif /* CONFIG_NOCACHE_MEMORY */ -#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ - #define WORD_SIZE 4 struct zep_shim_intr_priv *intr_priv; @@ -52,22 +48,14 @@ static void *zep_shim_mem_alloc(size_t size) { size_t size_aligned = ROUND_UP(size, 4); -#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) - return k_malloc(size_aligned); -#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ return k_heap_aligned_alloc(&wifi_drv_ctrl_mem_pool, WORD_SIZE, size_aligned, K_FOREVER); -#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } static void *zep_shim_data_mem_alloc(size_t size) { size_t size_aligned = ROUND_UP(size, 4); -#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) - return k_malloc(size_aligned); -#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ return k_heap_aligned_alloc(&wifi_drv_data_mem_pool, WORD_SIZE, size_aligned, K_FOREVER); -#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } static void *zep_shim_mem_zalloc(size_t size) @@ -111,22 +99,14 @@ static void *zep_shim_data_mem_zalloc(size_t size) static void zep_shim_mem_free(void *buf) { if (buf) { -#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) - k_free(buf); -#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ k_heap_free(&wifi_drv_ctrl_mem_pool, buf); -#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } } static void zep_shim_data_mem_free(void *buf) { if (buf) { -#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) - k_free(buf); -#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ k_heap_free(&wifi_drv_data_mem_pool, buf); -#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } } @@ -217,11 +197,7 @@ static void *zep_shim_spinlock_alloc(void) static void zep_shim_spinlock_free(void *lock) { -#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP) - k_free(lock); -#else /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ k_heap_free(&wifi_drv_ctrl_mem_pool, lock); -#endif /* CONFIG_NRF_WIFI_GLOBAL_HEAP */ } static void zep_shim_spinlock_init(void *lock) From a33d357a908f73bde9e231700cc67080d110fdba Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 534/881] Revert "[nrf fromtree] modules: nrf_wifi: Implement SPI deinit" This reverts commit c9c0f975aa75d7756b3b9d6ebffa8ac9107e0521. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/bus/spi_if.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nrf_wifi/bus/spi_if.c b/modules/nrf_wifi/bus/spi_if.c index 641e1322899..7ef1694da58 100644 --- a/modules/nrf_wifi/bus/spi_if.c +++ b/modules/nrf_wifi/bus/spi_if.c @@ -263,7 +263,9 @@ int spim_init(struct qspi_config *config) int spim_deinit(void) { - return spi_release_dt(&spi_spec); + LOG_DBG("TODO : %s", __func__); + + return 0; } static void spim_addr_check(unsigned int addr, const void *data, unsigned int len) From 7e31d57af31fa090d80dd701826f89f59c928372 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:26 +0300 Subject: [PATCH 535/881] Revert "[nrf fromtree] modules: nrf_wifi: Implement QSPI deinit" This reverts commit 80ca34db0140ea6a6d251ee5b84f043792c20851. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/bus/qspi_if.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/modules/nrf_wifi/bus/qspi_if.c b/modules/nrf_wifi/bus/qspi_if.c index ad0534a95a3..6107a5c4157 100644 --- a/modules/nrf_wifi/bus/qspi_if.c +++ b/modules/nrf_wifi/bus/qspi_if.c @@ -528,10 +528,14 @@ static int qspi_device_init(const struct device *dev) return ret; } -static void _qspi_device_uninit(const struct device *dev) +static void qspi_device_uninit(const struct device *dev) { bool last = true; + if (!IS_ENABLED(CONFIG_NRF70_QSPI_LOW_POWER)) { + return; + } + qspi_lock(dev); #ifdef CONFIG_MULTITHREADING @@ -564,15 +568,6 @@ static void _qspi_device_uninit(const struct device *dev) qspi_unlock(dev); } -static void qspi_device_uninit(const struct device *dev) -{ - if (!IS_ENABLED(CONFIG_NRF70_QSPI_LOW_POWER)) { - return; - } - - _qspi_device_uninit(dev); -} - /* QSPI send custom command. * * If this is used for both send and receive the buffer sizes must be @@ -1196,7 +1191,7 @@ struct device qspi_perip = { int qspi_deinit(void) { - _qspi_device_uninit(&qspi_perip); + LOG_DBG("TODO : %s", __func__); return 0; } From ace6307bec5750cc06ea6b3a5ca8eacc51fe9448 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 536/881] Revert "[nrf fromtree] modules: nrf_wifi: Remove co-ex GPIOs first" This reverts commit 06422b585b9a49a79b012ed04a5c5f43b6ff6024. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/bus/rpu_hw_if.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/nrf_wifi/bus/rpu_hw_if.c b/modules/nrf_wifi/bus/rpu_hw_if.c index 39525211486..62291251fb7 100644 --- a/modules/nrf_wifi/bus/rpu_hw_if.c +++ b/modules/nrf_wifi/bus/rpu_hw_if.c @@ -503,13 +503,6 @@ int rpu_disable(void) { int ret; - #ifdef CONFIG_NRF70_SR_COEX_RF_SWITCH - ret = sr_gpio_remove(); - if (ret) { - goto out; - } -#endif - ret = rpu_pwroff(); if (ret) { goto out; @@ -519,7 +512,12 @@ int rpu_disable(void) goto out; } - +#ifdef CONFIG_NRF70_SR_COEX_RF_SWITCH + ret = sr_gpio_remove(); + if (ret) { + goto out; + } +#endif qdev = NULL; cfg = NULL; From 7c6f64d84ce70a093d22f8e44f57c772e77b8e00 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 537/881] Revert "[nrf fromtree] modules: nrf_wifi: Improve power down sequence" This reverts commit fd5e07f6c0f095b358d6f07bf80c035eb91c8297. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/bus/rpu_hw_if.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nrf_wifi/bus/rpu_hw_if.c b/modules/nrf_wifi/bus/rpu_hw_if.c index 62291251fb7..5dd71a86de2 100644 --- a/modules/nrf_wifi/bus/rpu_hw_if.c +++ b/modules/nrf_wifi/bus/rpu_hw_if.c @@ -260,15 +260,15 @@ static int rpu_pwroff(void) { int ret; - ret = gpio_pin_set_dt(&iovdd_ctrl_spec, 0); /* IOVDD CNTRL = 0 */ + ret = gpio_pin_set_dt(&bucken_spec, 0); /* BUCKEN = 0 */ if (ret) { - LOG_ERR("IOVDD GPIO set failed..."); + LOG_ERR("BUCKEN GPIO set failed..."); return ret; } - ret = gpio_pin_set_dt(&bucken_spec, 0); /* BUCKEN = 0 */ + ret = gpio_pin_set_dt(&iovdd_ctrl_spec, 0); /* IOVDD CNTRL = 0 */ if (ret) { - LOG_ERR("BUCKEN GPIO set failed..."); + LOG_ERR("IOVDD GPIO set failed..."); return ret; } From 31acb1078a624b369dba867fcb30860a5a999224 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 538/881] Revert "[nrf fromtree] drivers: nrf_wifi: put driver ops in flash" This reverts commit ebd81dcf098e1183990fe999e32135d932ef3886. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/src/fmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 72055fb0299..b218bc13add 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -852,7 +852,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) #ifndef CONFIG_NRF70_RADIO_TEST #ifdef CONFIG_NET_L2_WIFI_MGMT -static const struct wifi_mgmt_ops nrf_wifi_mgmt_ops = { +static struct wifi_mgmt_ops nrf_wifi_mgmt_ops = { .scan = nrf_wifi_disp_scan_zep, #ifdef CONFIG_NET_STATISTICS_WIFI .get_stats = nrf_wifi_stats_get, @@ -881,7 +881,7 @@ static const struct wifi_mgmt_ops nrf_wifi_mgmt_ops = { #ifdef CONFIG_NRF70_STA_MODE -static const struct zep_wpa_supp_dev_ops wpa_supp_ops = { +static struct zep_wpa_supp_dev_ops wpa_supp_ops = { .init = nrf_wifi_wpa_supp_dev_init, .deinit = nrf_wifi_wpa_supp_dev_deinit, .scan2 = nrf_wifi_wpa_supp_scan2, From 0520e5429c8febb94ab86212230e7db589a370ac Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 539/881] Revert "[nrf fromlist] snippets: wifi-enterprise: Store certificates in Protected storage" This reverts commit e505b90960f1a45ba0c5579b75f24ae7afadf7c3. Signed-off-by: Jukka Rissanen --- snippets/wifi-enterprise/snippet.yml | 3 --- snippets/wifi-enterprise/wifi-enterprise-nrf-ns.conf | 8 -------- 2 files changed, 11 deletions(-) delete mode 100644 snippets/wifi-enterprise/wifi-enterprise-nrf-ns.conf diff --git a/snippets/wifi-enterprise/snippet.yml b/snippets/wifi-enterprise/snippet.yml index ae2fbd2953b..f88b23ec2a4 100644 --- a/snippets/wifi-enterprise/snippet.yml +++ b/snippets/wifi-enterprise/snippet.yml @@ -6,6 +6,3 @@ boards: /.*/nrf.*/cpuapp/: append: EXTRA_CONF_FILE: wifi-enterprise-nrf.conf - /.*/nrf.*/cpuapp/ns/: - append: - EXTRA_CONF_FILE: wifi-enterprise-nrf-ns.conf diff --git a/snippets/wifi-enterprise/wifi-enterprise-nrf-ns.conf b/snippets/wifi-enterprise/wifi-enterprise-nrf-ns.conf deleted file mode 100644 index dd33192d180..00000000000 --- a/snippets/wifi-enterprise/wifi-enterprise-nrf-ns.conf +++ /dev/null @@ -1,8 +0,0 @@ -# For TLS and X.509 processing MbedTLS needs large heap size and using separate heap -# for MbedTLS gives us more control over the heap size. -CONFIG_MBEDTLS_HEAP_SIZE=75000 -CONFIG_LTO=y -CONFIG_ISR_TABLES_LOCAL_DECLARATION=y -CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES=y -CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES=y -CONFIG_TLS_CREDENTIALS_BACKEND_PROTECTED_STORAGE=y From 40727b962d01e7f9c9efb3ca66eca79e0785c072 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 540/881] Revert "[nrf fromlist] samples: net: wifi: Add AES-only certificates" This reverts commit 3aaa9ad1615befbde020a5545c33e12788d4cf53. Signed-off-by: Jukka Rissanen --- .../net/wifi/test_certs/rsa2k_no_des/ca.pem | 24 --------------- .../net/wifi/test_certs/rsa2k_no_des/ca2.pem | 24 --------------- .../test_certs/rsa2k_no_des/client-key.pem | 30 ------------------- .../test_certs/rsa2k_no_des/client-key2.pem | 30 ------------------- .../wifi/test_certs/rsa2k_no_des/client.pem | 22 -------------- .../wifi/test_certs/rsa2k_no_des/client2.pem | 22 -------------- .../test_certs/rsa2k_no_des/server-key.pem | 30 ------------------- .../wifi/test_certs/rsa2k_no_des/server.pem | 22 -------------- 8 files changed, 204 deletions(-) delete mode 100644 samples/net/wifi/test_certs/rsa2k_no_des/ca.pem delete mode 100644 samples/net/wifi/test_certs/rsa2k_no_des/ca2.pem delete mode 100644 samples/net/wifi/test_certs/rsa2k_no_des/client-key.pem delete mode 100644 samples/net/wifi/test_certs/rsa2k_no_des/client-key2.pem delete mode 100644 samples/net/wifi/test_certs/rsa2k_no_des/client.pem delete mode 100644 samples/net/wifi/test_certs/rsa2k_no_des/client2.pem delete mode 100644 samples/net/wifi/test_certs/rsa2k_no_des/server-key.pem delete mode 100644 samples/net/wifi/test_certs/rsa2k_no_des/server.pem diff --git a/samples/net/wifi/test_certs/rsa2k_no_des/ca.pem b/samples/net/wifi/test_certs/rsa2k_no_des/ca.pem deleted file mode 100644 index 2b872d2e30d..00000000000 --- a/samples/net/wifi/test_certs/rsa2k_no_des/ca.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEBzCCAu+gAwIBAgIUK8+d+8IOzeX+DP3VSvdF3lHiCdcwDQYJKoZIhvcNAQEL -BQAwgZIxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZSYWRpdXMxEjAQBgNVBAcMCVNv -bWV3aGVyZTEUMBIGA1UECgwLRXhhbXBsZSBJbmMxJjAkBgNVBAMMHUV4YW1wbGUg -Q2VydGlmaWNhdGUgQXV0aG9yaXR5MSAwHgYJKoZIhvcNAQkBFhFhZG1pbkBleGFt -cGxlLm9yZzAeFw0yNDEwMDgxMDI0MDZaFw0zNDEwMDYxMDI0MDZaMIGSMQswCQYD -VQQGEwJGUjEPMA0GA1UECAwGUmFkaXVzMRIwEAYDVQQHDAlTb21ld2hlcmUxFDAS -BgNVBAoMC0V4YW1wbGUgSW5jMSYwJAYDVQQDDB1FeGFtcGxlIENlcnRpZmljYXRl -IEF1dGhvcml0eTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5vcmcwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCWKIwjdRIp9IrpZELN/ZsN13Xj -qQI6n086PNJ7BZfLi0+tD164rmxFk2eukNNksFCPhvMkqUxouGhc4mJjeivvrZxR -oT3cblOQIkkdEci6iTKC2E1a20W/Ur7cTXoIsnKwjiUjXk+cujkrZu4fcHX+O4vy -wTd5tEbhmifT/4u5nN8U2vBcEZqkGHOCp30VZSxtlGwqp4lc+tVziF3uFViW9MXk -3bVt+s1E7ztwG7+WBgVlLYe3CNSWkMxfyYBafH/l7iep6AFjoTn1z3AAjYi7IUNN -0JkW8MTgafRQIu4QsV5luq/Tiar2vwAm/GNgUJdSzUKARsfQzb/XTIgnLQqtAgMB -AAGjUzBRMB0GA1UdDgQWBBSijSC03/Thi6EOdM91V33zsbQpgzAfBgNVHSMEGDAW -gBSijSC03/Thi6EOdM91V33zsbQpgzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 -DQEBCwUAA4IBAQAvKEfmCDoMTKC6bfP6DSs+MSAGc5tCr6w6cz2AKNJ2fOMhkq55 -JF47oBBGm9SdTB6Jqo6c109Ps69/+LMtEEGwvzL0RL0WAuTYGo6sudm9hj/jDHZh -pAqi/2BQQeVgTa6oW0jtNPFe+/cobXo9TJ7wECGrhvVbmfl5ZPc0YVOIjjR0/LhL -q7lqPAlJ5vx0WvsX+QReN97we8vD0x1D3mCySJTi3Irh+grE0yJOSN2fa7cyqi9+ -vSiNUB1eUgQwrO+S8ZazYNvAZXC2Xf4WB4SOifJD73pYPAdwOejc0FA+zfEKa/6/ -vTUs8cIhlmDWO+BEoc9wygMKMmhT5s7/T5Bv ------END CERTIFICATE----- diff --git a/samples/net/wifi/test_certs/rsa2k_no_des/ca2.pem b/samples/net/wifi/test_certs/rsa2k_no_des/ca2.pem deleted file mode 100644 index 2b872d2e30d..00000000000 --- a/samples/net/wifi/test_certs/rsa2k_no_des/ca2.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEBzCCAu+gAwIBAgIUK8+d+8IOzeX+DP3VSvdF3lHiCdcwDQYJKoZIhvcNAQEL -BQAwgZIxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZSYWRpdXMxEjAQBgNVBAcMCVNv -bWV3aGVyZTEUMBIGA1UECgwLRXhhbXBsZSBJbmMxJjAkBgNVBAMMHUV4YW1wbGUg -Q2VydGlmaWNhdGUgQXV0aG9yaXR5MSAwHgYJKoZIhvcNAQkBFhFhZG1pbkBleGFt -cGxlLm9yZzAeFw0yNDEwMDgxMDI0MDZaFw0zNDEwMDYxMDI0MDZaMIGSMQswCQYD -VQQGEwJGUjEPMA0GA1UECAwGUmFkaXVzMRIwEAYDVQQHDAlTb21ld2hlcmUxFDAS -BgNVBAoMC0V4YW1wbGUgSW5jMSYwJAYDVQQDDB1FeGFtcGxlIENlcnRpZmljYXRl -IEF1dGhvcml0eTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5vcmcwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCWKIwjdRIp9IrpZELN/ZsN13Xj -qQI6n086PNJ7BZfLi0+tD164rmxFk2eukNNksFCPhvMkqUxouGhc4mJjeivvrZxR -oT3cblOQIkkdEci6iTKC2E1a20W/Ur7cTXoIsnKwjiUjXk+cujkrZu4fcHX+O4vy -wTd5tEbhmifT/4u5nN8U2vBcEZqkGHOCp30VZSxtlGwqp4lc+tVziF3uFViW9MXk -3bVt+s1E7ztwG7+WBgVlLYe3CNSWkMxfyYBafH/l7iep6AFjoTn1z3AAjYi7IUNN -0JkW8MTgafRQIu4QsV5luq/Tiar2vwAm/GNgUJdSzUKARsfQzb/XTIgnLQqtAgMB -AAGjUzBRMB0GA1UdDgQWBBSijSC03/Thi6EOdM91V33zsbQpgzAfBgNVHSMEGDAW -gBSijSC03/Thi6EOdM91V33zsbQpgzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 -DQEBCwUAA4IBAQAvKEfmCDoMTKC6bfP6DSs+MSAGc5tCr6w6cz2AKNJ2fOMhkq55 -JF47oBBGm9SdTB6Jqo6c109Ps69/+LMtEEGwvzL0RL0WAuTYGo6sudm9hj/jDHZh -pAqi/2BQQeVgTa6oW0jtNPFe+/cobXo9TJ7wECGrhvVbmfl5ZPc0YVOIjjR0/LhL -q7lqPAlJ5vx0WvsX+QReN97we8vD0x1D3mCySJTi3Irh+grE0yJOSN2fa7cyqi9+ -vSiNUB1eUgQwrO+S8ZazYNvAZXC2Xf4WB4SOifJD73pYPAdwOejc0FA+zfEKa/6/ -vTUs8cIhlmDWO+BEoc9wygMKMmhT5s7/T5Bv ------END CERTIFICATE----- diff --git a/samples/net/wifi/test_certs/rsa2k_no_des/client-key.pem b/samples/net/wifi/test_certs/rsa2k_no_des/client-key.pem deleted file mode 100644 index 6ab70da2452..00000000000 --- a/samples/net/wifi/test_certs/rsa2k_no_des/client-key.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIFLTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQILVdWyEWhWU0CAggA -MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBDMFReIusCg7gSkoUQZV2flBIIE -0BIFQH7+0dc7wHIQQ1y0ao90rrK3ExtCABH6xp4OAHUNPR1549zSEak/9Ba6WLBp -YE0m/lpLz4oUJE4Kd3rg4ekSZk4mapZoW7g5ax4qAEblmM6rqmyjiU0Q6tsAb8n1 -x+RyjUILlgTH1HDmeNA53QNMCw++xIMIJPN29SvFN6vkU2Fd2f74/TuZRSaCEPLO -LKtNMwWCMTrlv0UewEryOvZegPQuEF/Ewmmw/9l5VfkPp6zAtZKzWsfk4jUo5tv2 -5dPoHR+RKjNNVwetnCq59QYMS2My6KLqX4Vzqnbu8K1nlbm85ZHnvLGi8cDn8EB7 -QtRL+Ev5IwcwYJgV5AMojouJLQdR655jeITWI1Gsohz28YG8c1qYX4ZN6albSd1G -fd1tMOWkeu4uEzJ7ijLDfnCzrklnLuAZx8yLzyrOa7i9AwwJmdgUEdbWWsru3L6C -zDJ45rpA0FobdlTem4kpoE9yiyHkIhf3wmI3X+0aodC11pdbHP260KIC8E1K9FUh -s/IoEQCYrBp8UltNTlezwq/E5uOuIu4EpfjEgH1Z3+hSDbnmMAXNX4DbL234x7iy -3Y256DtOeHSElnRz3kDnZVNtM1Kd5fgEYJ1ptYRPYaWyJka7/hC/0UObuM9w+QeO -OlG0QgumQFloyhDa9anPBK4sYJp4g1fK8golUDW4AdpFPNOJvvgOvQUzhPpHjr+N -lpZ75Y6I3JSSKJ/UMlSCOqjak8oZtMtJNMfbx1lgwwDtgjDSJvSdl735gI9VmXXH -qnlGEtyiQ7k1Z1a4HxiY2/CiDHvkymClir/Ik8gt+wmyT9c/9BcehLRf6PxMsDVy -PCkty1LlzN+5tSZJtJnOiTlgsRn/w49Ohp74ITheSdb30/6PnFI+o8rcJHmrjN4d -t3z/bCyWAeC8mS7m0wtXlyBeG9xvdyT8dDHAFOnqxX30dEwEbjNj58kWGAgRf9i3 -HlOAP8yRy7LAV7A4HEPnEzXBxYpsROUw/8d3Jtmr2nAp2hfKP339DYZPHZpRLjJr -WQlJasHHLxHKKjSsuM06WsCO+Tt2FTSgGJuU6nFVK75fssmmJYzj9qMHVM6YSjfY -sT0ZIWRgO9NLFx5O3QxY1wgMLhhv1FREy9NVnMU0W3A1u0F7dwHywZGha2IqEXgu -+UyWIJnePMvluV/s66AN/OpIxKU48c0B4l7XzXkHHd43tDUG3ztfRuPbWCHipuRO -eo+vHGD01iBLSE1ZhrYLHKQhJvIKx/PIEaqJHP/Vy35AD/2/GH09TiIBHzX9aXie -TiKFs30FQv7SpLNHNE7jUxsYGNUbYa70S/Vgn3wkKATcXpCc749XQV4OUbFoqkDm -vuZOjkIOlm/OtZkUuDWmk96mgoVG/gWSEJPynJHUpmWdu/BCdYOgxBk/bmPa1leS -Z5NbO0fGMnNhDMXYA5rqmVzABcNSYhgYw5aciWpBlgYHEYrPxZvCxWftIyb24oEk -wdHEaFbIYbOoVZqo7Ym2hrvVrJb8Qdukf1BmUgfSSSc7BFoSrBUO4SNFtZI55NOB -OM4rnkqfoYR0IpnxzPIpxpsWljG9QsgnTaffStDgIGXiAtBWJFy+44f1IS4EoC6B -+we1Q6atPwYSyPtG8mn4Ce0BNxLDUoFDLMQ7Bt8QBMeX ------END ENCRYPTED PRIVATE KEY----- diff --git a/samples/net/wifi/test_certs/rsa2k_no_des/client-key2.pem b/samples/net/wifi/test_certs/rsa2k_no_des/client-key2.pem deleted file mode 100644 index 6ab70da2452..00000000000 --- a/samples/net/wifi/test_certs/rsa2k_no_des/client-key2.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIFLTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQILVdWyEWhWU0CAggA -MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBDMFReIusCg7gSkoUQZV2flBIIE -0BIFQH7+0dc7wHIQQ1y0ao90rrK3ExtCABH6xp4OAHUNPR1549zSEak/9Ba6WLBp -YE0m/lpLz4oUJE4Kd3rg4ekSZk4mapZoW7g5ax4qAEblmM6rqmyjiU0Q6tsAb8n1 -x+RyjUILlgTH1HDmeNA53QNMCw++xIMIJPN29SvFN6vkU2Fd2f74/TuZRSaCEPLO -LKtNMwWCMTrlv0UewEryOvZegPQuEF/Ewmmw/9l5VfkPp6zAtZKzWsfk4jUo5tv2 -5dPoHR+RKjNNVwetnCq59QYMS2My6KLqX4Vzqnbu8K1nlbm85ZHnvLGi8cDn8EB7 -QtRL+Ev5IwcwYJgV5AMojouJLQdR655jeITWI1Gsohz28YG8c1qYX4ZN6albSd1G -fd1tMOWkeu4uEzJ7ijLDfnCzrklnLuAZx8yLzyrOa7i9AwwJmdgUEdbWWsru3L6C -zDJ45rpA0FobdlTem4kpoE9yiyHkIhf3wmI3X+0aodC11pdbHP260KIC8E1K9FUh -s/IoEQCYrBp8UltNTlezwq/E5uOuIu4EpfjEgH1Z3+hSDbnmMAXNX4DbL234x7iy -3Y256DtOeHSElnRz3kDnZVNtM1Kd5fgEYJ1ptYRPYaWyJka7/hC/0UObuM9w+QeO -OlG0QgumQFloyhDa9anPBK4sYJp4g1fK8golUDW4AdpFPNOJvvgOvQUzhPpHjr+N -lpZ75Y6I3JSSKJ/UMlSCOqjak8oZtMtJNMfbx1lgwwDtgjDSJvSdl735gI9VmXXH -qnlGEtyiQ7k1Z1a4HxiY2/CiDHvkymClir/Ik8gt+wmyT9c/9BcehLRf6PxMsDVy -PCkty1LlzN+5tSZJtJnOiTlgsRn/w49Ohp74ITheSdb30/6PnFI+o8rcJHmrjN4d -t3z/bCyWAeC8mS7m0wtXlyBeG9xvdyT8dDHAFOnqxX30dEwEbjNj58kWGAgRf9i3 -HlOAP8yRy7LAV7A4HEPnEzXBxYpsROUw/8d3Jtmr2nAp2hfKP339DYZPHZpRLjJr -WQlJasHHLxHKKjSsuM06WsCO+Tt2FTSgGJuU6nFVK75fssmmJYzj9qMHVM6YSjfY -sT0ZIWRgO9NLFx5O3QxY1wgMLhhv1FREy9NVnMU0W3A1u0F7dwHywZGha2IqEXgu -+UyWIJnePMvluV/s66AN/OpIxKU48c0B4l7XzXkHHd43tDUG3ztfRuPbWCHipuRO -eo+vHGD01iBLSE1ZhrYLHKQhJvIKx/PIEaqJHP/Vy35AD/2/GH09TiIBHzX9aXie -TiKFs30FQv7SpLNHNE7jUxsYGNUbYa70S/Vgn3wkKATcXpCc749XQV4OUbFoqkDm -vuZOjkIOlm/OtZkUuDWmk96mgoVG/gWSEJPynJHUpmWdu/BCdYOgxBk/bmPa1leS -Z5NbO0fGMnNhDMXYA5rqmVzABcNSYhgYw5aciWpBlgYHEYrPxZvCxWftIyb24oEk -wdHEaFbIYbOoVZqo7Ym2hrvVrJb8Qdukf1BmUgfSSSc7BFoSrBUO4SNFtZI55NOB -OM4rnkqfoYR0IpnxzPIpxpsWljG9QsgnTaffStDgIGXiAtBWJFy+44f1IS4EoC6B -+we1Q6atPwYSyPtG8mn4Ce0BNxLDUoFDLMQ7Bt8QBMeX ------END ENCRYPTED PRIVATE KEY----- diff --git a/samples/net/wifi/test_certs/rsa2k_no_des/client.pem b/samples/net/wifi/test_certs/rsa2k_no_des/client.pem deleted file mode 100644 index 9e815474cd8..00000000000 --- a/samples/net/wifi/test_certs/rsa2k_no_des/client.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDojCCAooCFGZ4UJXBKG70aewILFtsy4mbvaYZMA0GCSqGSIb3DQEBCwUAMIGS -MQswCQYDVQQGEwJGUjEPMA0GA1UECAwGUmFkaXVzMRIwEAYDVQQHDAlTb21ld2hl -cmUxFDASBgNVBAoMC0V4YW1wbGUgSW5jMSYwJAYDVQQDDB1FeGFtcGxlIENlcnRp -ZmljYXRlIEF1dGhvcml0eTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5v -cmcwHhcNMjQxMDA4MTAyNjI1WhcNMzQxMDA2MTAyNjI1WjCBhzELMAkGA1UEBhMC -RlIxDzANBgNVBAgMBlJhZGl1czESMBAGA1UEBwwJU29tZXdoZXJlMRQwEgYDVQQK -DAtFeGFtcGxlIEluYzEbMBkGA1UEAwwSY2xpZW50LmV4YW1wbGUub3JnMSAwHgYJ -KoZIhvcNAQkBFhFhZG1pbkBleGFtcGxlLm9yZzCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAMu3HXJvi2Q4hQnLL4v/sCyEr5x+ZtBcSi2yETMViaf2EStW -UOs1A1pmCQbO7nadLQcWaX4tzefQCRrs1X4hIQuDIqRPNi6h6G1g5HEtqBWZhvwu -hDbmFiX8/Vtw/P0/9sox2DzyLG0mjJUAYAbKtyC1kQalybVBtrSaazyyAyh6oOuU -chAb7SmmNDsRB959TWM/mp+6yCcFGzCDKNBwlwthB6Uw92d3SfOyXEnZm8rPf0hV -4ICL5iB+xEYBv1LKmznFK/4UAyKpxAygc5fxKVWwlSsq8MrES5ak0n6H71wViaXK -BrH5yh9jEkK9XSeaUwg8C9eOOexyx/5JDY3TTE8CAwEAATANBgkqhkiG9w0BAQsF -AAOCAQEAUNddNiRUlJH0acJJv8ztXNWjNewd17tAk1BBHp6yyGAD8b52p6QbDAdS -xO3WsSc2bqSy599jp4GshO27TMQsBRMfoggCG21Aj6sIs0Hd4shTE4T0GUBEBxC2 -/HReuD+cGIzzKMYlvK8RPSaGLPvPw5SryvmOnjD368V0KCHwT04Z14i4sMxlkd5q -wB7fxTkVla9MR4uWObX62mJykmqT86chScJpldtBpRh8wrEa3Gt9FZoi/eqP0De8 -oCxmCZDrozGTZ4IIaNzchx3Ensh1RQwvvxd6ATerYdUjq4V2TlTksDRdCXtj+uNJ -FnB32sUHiIouxudAsqDf8UL9/99RCw== ------END CERTIFICATE----- diff --git a/samples/net/wifi/test_certs/rsa2k_no_des/client2.pem b/samples/net/wifi/test_certs/rsa2k_no_des/client2.pem deleted file mode 100644 index 9e815474cd8..00000000000 --- a/samples/net/wifi/test_certs/rsa2k_no_des/client2.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDojCCAooCFGZ4UJXBKG70aewILFtsy4mbvaYZMA0GCSqGSIb3DQEBCwUAMIGS -MQswCQYDVQQGEwJGUjEPMA0GA1UECAwGUmFkaXVzMRIwEAYDVQQHDAlTb21ld2hl -cmUxFDASBgNVBAoMC0V4YW1wbGUgSW5jMSYwJAYDVQQDDB1FeGFtcGxlIENlcnRp -ZmljYXRlIEF1dGhvcml0eTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5v -cmcwHhcNMjQxMDA4MTAyNjI1WhcNMzQxMDA2MTAyNjI1WjCBhzELMAkGA1UEBhMC -RlIxDzANBgNVBAgMBlJhZGl1czESMBAGA1UEBwwJU29tZXdoZXJlMRQwEgYDVQQK -DAtFeGFtcGxlIEluYzEbMBkGA1UEAwwSY2xpZW50LmV4YW1wbGUub3JnMSAwHgYJ -KoZIhvcNAQkBFhFhZG1pbkBleGFtcGxlLm9yZzCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAMu3HXJvi2Q4hQnLL4v/sCyEr5x+ZtBcSi2yETMViaf2EStW -UOs1A1pmCQbO7nadLQcWaX4tzefQCRrs1X4hIQuDIqRPNi6h6G1g5HEtqBWZhvwu -hDbmFiX8/Vtw/P0/9sox2DzyLG0mjJUAYAbKtyC1kQalybVBtrSaazyyAyh6oOuU -chAb7SmmNDsRB959TWM/mp+6yCcFGzCDKNBwlwthB6Uw92d3SfOyXEnZm8rPf0hV -4ICL5iB+xEYBv1LKmznFK/4UAyKpxAygc5fxKVWwlSsq8MrES5ak0n6H71wViaXK -BrH5yh9jEkK9XSeaUwg8C9eOOexyx/5JDY3TTE8CAwEAATANBgkqhkiG9w0BAQsF -AAOCAQEAUNddNiRUlJH0acJJv8ztXNWjNewd17tAk1BBHp6yyGAD8b52p6QbDAdS -xO3WsSc2bqSy599jp4GshO27TMQsBRMfoggCG21Aj6sIs0Hd4shTE4T0GUBEBxC2 -/HReuD+cGIzzKMYlvK8RPSaGLPvPw5SryvmOnjD368V0KCHwT04Z14i4sMxlkd5q -wB7fxTkVla9MR4uWObX62mJykmqT86chScJpldtBpRh8wrEa3Gt9FZoi/eqP0De8 -oCxmCZDrozGTZ4IIaNzchx3Ensh1RQwvvxd6ATerYdUjq4V2TlTksDRdCXtj+uNJ -FnB32sUHiIouxudAsqDf8UL9/99RCw== ------END CERTIFICATE----- diff --git a/samples/net/wifi/test_certs/rsa2k_no_des/server-key.pem b/samples/net/wifi/test_certs/rsa2k_no_des/server-key.pem deleted file mode 100644 index 5f032cad701..00000000000 --- a/samples/net/wifi/test_certs/rsa2k_no_des/server-key.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIFLTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIjI78fcZSH7oCAggA -MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBDfF676hRrL290F0MgMDZiuBIIE -0Hkz7skRV8Ox0SoX5N8GsOPfN4PS1cLyHgokY6dUhJPU5vUzOn9iSiGQSEzSguQ7 -11mssjRC2T45wB/95VK2EPtRw1f/6VOUR6RJnnGb0PV1Rydp/x5TZ6vzcXpakqly -eljJR/20fIJClsZzhw0iu5la9fkF6G8WYFEkqex5jALSiN4qVLvkiqcTnh5+amem -8+OCKgvgooKD2ids4/0GGfJRQSC6DFf3kuxNl+MMvmDXmz/vrD85ONnyXzKXDA3N -3vRgL/YT6GzwIXb+7/c/tIMpnacxPAdbNOs3DY5ss4xcK68L5PwpM2BljzBa5dGw -Smgf2VRaYRVzmrte5j280QjfrlHRU2cHaxm0GCu2AOTGwMXcSNYMXfDNuxc57oQJ -vHXMeZD4K5lACbhYdZ5lJNFvv29YI7dZ7QOGu6nXlAuhZfbdc/cgT0som7eG8xpT -pERllhQ5ych9sP9nAccN6VUsWgmlF73lbSptBek1ccYkp9LIYCteJUPl2qPcz6zl -A7zrZ54f3Lg0fOm2pCtg+qKBiw1nd3MR/YbRCgyvudyZE2cCN/ZspWqxsavbGYOz -JOfIFNnyAcOYtEv1n1BGLfMa1THW2bDV8XmHVHUtM0k4z250QAmLygWLY2166iUF -qotBkvctKKdulzGdT4nVer1UEKTqcxhDf0dRiHN5spZtFrOee0uGIoQWHt2oecaK -pJovW+i0qO/1DG5spfU2m1bz6jR2u6nxi340oRrMSoe1ELVg3l1/wmM8yzh07GuK -pshzxwqAG/FnaKCvcKGUG2EfnAvOcbMgSa2w3GvyRkcDPn00arvX9nuXj0gkRDBi -eoVMkKKTeeYSGQ4ik+ja3xkgHcxh5W8aoezLvBbmUq206cmhLwfnYMhnvFTs6EBK -E0ENpCHwF/qoVBIzRCijG/eeCuf3a1YkJsWlvEeVrPeOmDFeDft3SSGOzHxE2A/7 -HWmHbWTm7dPOfgsU4zf+HglnBjN3kYU7StyM0EGxmB4lfB2BiWiL/3R13ERHQZfa -oOqa4/hOFXOXfTQk6ufXtBx8L9BemBqh36zbs2xVvIizJKeRMruoRblWZkHhUKR8 -K5GA7FYkU9ZPPP0UPKsO94xzwfbevi+7nWeUZoqcqAUy8Jt5aD2QpvFVbPBBOz17 -PGaubeVn/Ry8swPvkpddtmJ4mgF+3SVctmzY+EE/oN1XS8wa+XeuaThzk89Lvrfa -606nRWrNw3PSKjYoEEtRLhPeJCi9uOVenbOjtclio9mV5Sugwurolczvq8DAGpMG -W4WgALgOWDjQAudiNH5dtcMGkBONbYywkJc7cT2OZFmzkCbchPPWlKGopuaFGAoU -SPj7C9SenHmOWAFRX5jJrOZAuVqkdKN3ShWZUL+cDkOCCQlZ0E31u0m9yozY1MeO -Sx42GtZaSGff37FGYeMZM2ztlutw2zmv2B1g52SBHTjCqQU/ud2Q6/U0kUzjbsdF -/0KQY9wgZRdOvbnA2lBirN1rXzLWPdduOZ5QImfHfvToN+oOlEqVvvWG12DdA4e5 -y4Dumx00lfKEsGutjF3oKgE6jsjwqAwCoYEAFHTtsvA0hKPisQwNHZmpjGARvR56 -yMEmXynKvgyVGvVP2a9VdqBXSpstL24HfDIu+nlyEWGQ ------END ENCRYPTED PRIVATE KEY----- diff --git a/samples/net/wifi/test_certs/rsa2k_no_des/server.pem b/samples/net/wifi/test_certs/rsa2k_no_des/server.pem deleted file mode 100644 index d8f82faf6dd..00000000000 --- a/samples/net/wifi/test_certs/rsa2k_no_des/server.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDojCCAooCFCPQcj7ej5jhr6/mLlAoLYgfgsYcMA0GCSqGSIb3DQEBCwUAMIGS -MQswCQYDVQQGEwJGUjEPMA0GA1UECAwGUmFkaXVzMRIwEAYDVQQHDAlTb21ld2hl -cmUxFDASBgNVBAoMC0V4YW1wbGUgSW5jMSYwJAYDVQQDDB1FeGFtcGxlIENlcnRp -ZmljYXRlIEF1dGhvcml0eTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5v -cmcwHhcNMjQxMDA4MTAyNTI5WhcNMzQxMDA2MTAyNTI5WjCBhzELMAkGA1UEBhMC -RlIxDzANBgNVBAgMBlJhZGl1czESMBAGA1UEBwwJU29tZXdoZXJlMRQwEgYDVQQK -DAtFeGFtcGxlIEluYzEbMBkGA1UEAwwSc2VydmVyLmV4YW1wbGUub3JnMSAwHgYJ -KoZIhvcNAQkBFhFhZG1pbkBleGFtcGxlLm9yZzCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBANcE/OPHQK/y1b6UsIktNK7WIZB528HECY7Bz18EGba0uHod -91RbzHSJ1qI3iQyldI1UW/kY5oYjBW3lhLH0BkD/EsqvNYCV+3YzAM3ITtdOdEU9 -CqjgXttehQHfXvc7jQlF8Q2gYPUz2dDLo/gcTkz1d+mCr6nQUjT8Kq/nG54T0NnD -k8udchjUlNaQsvx/WVs3TUYxMbWzQRtpJIbv99rAWq7YgQbkNZnSYC1VgrU/BiuQ -0KrP6rfkxvBCGwIh2JXIL3FV4N8AsgGZvjXQ3zXKXwuPhxWdSmjKWlioVM3mha2A -/1e1gX6nFY/uk46D60XWxcJ6tHGHoafU7EtN3zMCAwEAATANBgkqhkiG9w0BAQsF -AAOCAQEAWwdTMphD0jxLtYO0iq/+fMtq2R96ZUN9wprZ7qg1evUNQjqLR4jKX306 -ZJX5uw+6r5Ve/k368qvcSF/sSfvBm8yd3JcegTl5t8T2/Aks8o3sfyuS0uyJC1rS -zTrd7FmJG9YMosU1BqYobda64MXq7g+6MyrQoZ6fVdPvC6Sox3+a4fl9xjdm4CTY -MsWqBJMe26LptvRIJ01/B6PjVTvsn/fxxj7rHmnJ/j63AIiBntm0vV/85cwYy/4o -HlPH/Qjvn3hZjUlBcveiYat998F+s9gH2usvCkG3kly/n1/667LLCymmCHxtH8ka -7tF3siO1EANureFY8qj6ZvlKeTkZ6g== ------END CERTIFICATE----- From 9461b29ccf4da1e15dd967d5151d316d5965e68c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 541/881] Revert "[nrf fromlist] snippets: wifi-enterprise: Increase MBEDTLS heap size" This reverts commit e76c1955413736a44380ff0e304b053834d18456. Signed-off-by: Jukka Rissanen --- snippets/wifi-enterprise/snippet.yml | 5 ----- snippets/wifi-enterprise/wifi-enterprise-nrf.conf | 3 --- 2 files changed, 8 deletions(-) delete mode 100644 snippets/wifi-enterprise/wifi-enterprise-nrf.conf diff --git a/snippets/wifi-enterprise/snippet.yml b/snippets/wifi-enterprise/snippet.yml index f88b23ec2a4..6a4f73d38b4 100644 --- a/snippets/wifi-enterprise/snippet.yml +++ b/snippets/wifi-enterprise/snippet.yml @@ -1,8 +1,3 @@ name: wifi-enterprise append: EXTRA_CONF_FILE: wifi-enterprise.conf - -boards: - /.*/nrf.*/cpuapp/: - append: - EXTRA_CONF_FILE: wifi-enterprise-nrf.conf diff --git a/snippets/wifi-enterprise/wifi-enterprise-nrf.conf b/snippets/wifi-enterprise/wifi-enterprise-nrf.conf deleted file mode 100644 index a52390c1687..00000000000 --- a/snippets/wifi-enterprise/wifi-enterprise-nrf.conf +++ /dev/null @@ -1,3 +0,0 @@ -# For TLS and X.509 processing MbedTLS needs large heap size and using separate heap -# for MbedTLS gives us more control over the heap size. -CONFIG_MBEDTLS_HEAP_SIZE=75000 From bbf543928a48a9f074841d766ef133284ac1afe1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 542/881] Revert "[nrf fromlist] secure_storage: increase stack sizes of tests" This reverts commit 31c3a0f03010aa84b972fa6711a409ff6c028b0d. Signed-off-by: Jukka Rissanen --- samples/psa/its/overlay-secure_storage.conf | 4 ++-- samples/psa/persistent_key/overlay-secure_storage.conf | 4 ++-- .../secure_storage/psa/crypto/overlay-secure_storage.conf | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/psa/its/overlay-secure_storage.conf b/samples/psa/its/overlay-secure_storage.conf index b3fcab84205..9265b38ccc7 100644 --- a/samples/psa/its/overlay-secure_storage.conf +++ b/samples/psa/its/overlay-secure_storage.conf @@ -3,9 +3,9 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y -# The default stack size is not enough for the PSA Crypto core. +# The default stack size (1024) is not enough for the PSA Crypto core. # On top of that, the ITS implementation uses the stack for buffers. -CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_MAIN_STACK_SIZE=3072 CONFIG_SECURE_STORAGE=y CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS=y diff --git a/samples/psa/persistent_key/overlay-secure_storage.conf b/samples/psa/persistent_key/overlay-secure_storage.conf index 0b68451db29..c5cff5f364a 100644 --- a/samples/psa/persistent_key/overlay-secure_storage.conf +++ b/samples/psa/persistent_key/overlay-secure_storage.conf @@ -5,9 +5,9 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=1024 -# The default stack size is not enough for the PSA Crypto core. +# The default stack size (1024) is not enough for the PSA Crypto core. # On top of that, the ITS implementation uses the stack for buffers. -CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_MAIN_STACK_SIZE=3072 CONFIG_SECURE_STORAGE=y CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS=y diff --git a/tests/subsys/secure_storage/psa/crypto/overlay-secure_storage.conf b/tests/subsys/secure_storage/psa/crypto/overlay-secure_storage.conf index 97594a4ac44..6df091015be 100644 --- a/tests/subsys/secure_storage/psa/crypto/overlay-secure_storage.conf +++ b/tests/subsys/secure_storage/psa/crypto/overlay-secure_storage.conf @@ -1,5 +1,5 @@ -CONFIG_ZTEST_STACK_SIZE=4096 -CONFIG_MAIN_STACK_SIZE=3072 +CONFIG_ZTEST_STACK_SIZE=3072 +CONFIG_MAIN_STACK_SIZE=2048 CONFIG_MBEDTLS=y CONFIG_ENTROPY_GENERATOR=y From bb563d09fe1d198c8829bfc1bbdb55d18510d1fa Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 543/881] Revert "[nrf fromlist] boards: nordic: nrf54l15dk: Add button/LED aliases" This reverts commit 2241a25a0c4590dc1210be14e8f9c3553b1c09dd. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi index 46f9d797b61..6962fc4b087 100644 --- a/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi @@ -20,11 +20,6 @@ zephyr,ieee802154 = &ieee802154; zephyr,boot-mode = &boot_mode0; }; - - aliases { - mcuboot-button0 = &button0; - mcuboot-led0 = &led0; - }; }; &cpuapp_sram { From d60bee3f10c05124e6c20dde684276039aa89c52 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 544/881] Revert "[nrf fromlist] soc: nordic: nrf54h: s2ram: Add FPU retention" This reverts commit f53524cf05bca32d2ef8f243383309dfa3d5405b. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/pm_s2ram.c | 99 +++++------------------------------- 1 file changed, 13 insertions(+), 86 deletions(-) diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index c9be93ff5c9..1ec5da4aa19 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -15,13 +15,6 @@ #define NVIC_MEMBER_SIZE(member) ARRAY_SIZE(((NVIC_Type *)0)->member) -/* Coprocessor Power Control Register Definitions */ -#define SCnSCB_CPPWR_SU11_Pos 22U /*!< CPPWR: SU11 Position */ -#define SCnSCB_CPPWR_SU11_Msk (1UL << SCnSCB_CPPWR_SU11_Pos) /*!< CPPWR: SU11 Mask */ - -#define SCnSCB_CPPWR_SU10_Pos 20U /*!< CPPWR: SU10 Position */ -#define SCnSCB_CPPWR_SU10_Msk (1UL << SCnSCB_CPPWR_SU10_Pos) /*!< CPPWR: SU10 Mask */ - /* Currently dynamic regions are only used in case of userspace or stack guard and * stack guard is not used by default on Cortex-M33 because there is a dedicated * mechanism for stack overflow detection. Unless those condition change we don't @@ -62,25 +55,12 @@ typedef struct { uint32_t MMFAR; uint32_t BFAR; uint32_t AFSR; - uint32_t CPACR; } _scb_context_t; -#if defined(CONFIG_FPU) && !defined(CONFIG_FPU_SHARING) -typedef struct { - uint32_t FPCCR; - uint32_t FPCAR; - uint32_t FPDSCR; - uint32_t S[32]; -} _fpu_context_t; -#endif - struct backup { _nvic_context_t nvic_context; _mpu_context_t mpu_context; _scb_context_t scb_context; -#if defined(CONFIG_FPU) && !defined(CONFIG_FPU_SHARING) - _fpu_context_t fpu_context; -#endif }; static __noinit struct backup backup_data; @@ -91,7 +71,7 @@ extern int z_arm_mpu_init(void); /* MPU registers cannot be simply copied because content of RBARx RLARx registers * depends on region which is selected by RNR register. */ -static void mpu_save(_mpu_context_t *backup) +static void mpu_suspend(_mpu_context_t *backup) { if (!MPU_USE_DYNAMIC_REGIONS) { return; @@ -109,7 +89,7 @@ static void mpu_save(_mpu_context_t *backup) backup->CTRL = MPU->CTRL; } -static void mpu_restore(_mpu_context_t *backup) +static void mpu_resume(_mpu_context_t *backup) { if (!MPU_USE_DYNAMIC_REGIONS) { z_arm_mpu_init(); @@ -131,21 +111,21 @@ static void mpu_restore(_mpu_context_t *backup) MPU->CTRL = backup->CTRL; } -static void nvic_save(_nvic_context_t *backup) +static void nvic_suspend(_nvic_context_t *backup) { memcpy(backup->ISER, (uint32_t *)NVIC->ISER, sizeof(NVIC->ISER)); memcpy(backup->ISPR, (uint32_t *)NVIC->ISPR, sizeof(NVIC->ISPR)); memcpy(backup->IPR, (uint32_t *)NVIC->IPR, sizeof(NVIC->IPR)); } -static void nvic_restore(_nvic_context_t *backup) +static void nvic_resume(_nvic_context_t *backup) { memcpy((uint32_t *)NVIC->ISER, backup->ISER, sizeof(NVIC->ISER)); memcpy((uint32_t *)NVIC->ISPR, backup->ISPR, sizeof(NVIC->ISPR)); memcpy((uint32_t *)NVIC->IPR, backup->IPR, sizeof(NVIC->IPR)); } -static void scb_save(_scb_context_t *backup) +static void scb_suspend(_scb_context_t *backup) { backup->ICSR = SCB->ICSR; backup->VTOR = SCB->VTOR; @@ -160,10 +140,9 @@ static void scb_save(_scb_context_t *backup) backup->MMFAR = SCB->MMFAR; backup->BFAR = SCB->BFAR; backup->AFSR = SCB->AFSR; - backup->CPACR = SCB->CPACR; } -static void scb_restore(_scb_context_t *backup) +static void scb_resume(_scb_context_t *backup) { SCB->ICSR = backup->ICSR; SCB->VTOR = backup->VTOR; @@ -178,77 +157,25 @@ static void scb_restore(_scb_context_t *backup) SCB->MMFAR = backup->MMFAR; SCB->BFAR = backup->BFAR; SCB->AFSR = backup->AFSR; - SCB->CPACR = backup->CPACR; -} - -#if defined(CONFIG_FPU) -static void fpu_power_down(void) -{ - SCB->CPACR &= (~(CPACR_CP10_Msk | CPACR_CP11_Msk)); - SCnSCB->CPPWR |= (SCnSCB_CPPWR_SU11_Msk | SCnSCB_CPPWR_SU10_Msk); - __DSB(); - __ISB(); -} - -static void fpu_power_up(void) -{ - SCnSCB->CPPWR &= (~(SCnSCB_CPPWR_SU11_Msk | SCnSCB_CPPWR_SU10_Msk)); - SCB->CPACR |= (CPACR_CP10_Msk | CPACR_CP11_Msk); - __DSB(); - __ISB(); -} - -#if !defined(CONFIG_FPU_SHARING) -static void fpu_save(_fpu_context_t *backup) -{ - backup->FPCCR = FPU->FPCCR; - backup->FPCAR = FPU->FPCAR; - backup->FPDSCR = FPU->FPDSCR; - - __asm__ volatile("vstmia %0, {s0-s31}\n" : : "r"(backup->S) : "memory"); -} - -static void fpu_restore(_fpu_context_t *backup) -{ - FPU->FPCCR = backup->FPCCR; - FPU->FPCAR = backup->FPCAR; - FPU->FPDSCR = backup->FPDSCR; - - __asm__ volatile("vldmia %0, {s0-s31}\n" : : "r"(backup->S) : "memory"); } -#endif /* !defined(CONFIG_FPU_SHARING) */ -#endif /* defined(CONFIG_FPU) */ int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) { int ret; - scb_save(&backup_data.scb_context); -#if defined(CONFIG_FPU) -#if !defined(CONFIG_FPU_SHARING) - fpu_save(&backup_data.fpu_context); -#endif - fpu_power_down(); -#endif - nvic_save(&backup_data.nvic_context); - mpu_save(&backup_data.mpu_context); + scb_suspend(&backup_data.scb_context); + nvic_suspend(&backup_data.nvic_context); + mpu_suspend(&backup_data.mpu_context); ret = arch_pm_s2ram_suspend(system_off); - /* Cache and FPU are powered down so power up is needed even if s2ram failed. */ + /* Cache is powered down so power up is needed even if s2ram failed. */ nrf_power_up_cache(); -#if defined(CONFIG_FPU) - fpu_power_up(); -#if !defined(CONFIG_FPU_SHARING) - /* Also the FPU content might be lost. */ - fpu_restore(&backup_data.fpu_context); -#endif -#endif if (ret < 0) { return ret; } - mpu_restore(&backup_data.mpu_context); - nvic_restore(&backup_data.nvic_context); - scb_restore(&backup_data.scb_context); + mpu_resume(&backup_data.mpu_context); + nvic_resume(&backup_data.nvic_context); + scb_resume(&backup_data.scb_context); return ret; } From 3e0dcade36edde6771996b10251599b2b6a41899 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 545/881] Revert "[nrf fromtree] cmake: kconfig: Add APP_DIR to kconfig environment" This reverts commit aca65d1339cb0f97bc41772e612f6972bca082bb. Signed-off-by: Jukka Rissanen --- cmake/modules/kconfig.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index def17f16ae6..65b3bbb0382 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -135,9 +135,6 @@ else() set(_local_TOOLCHAIN_HAS_PICOLIBC n) endif() -# APP_DIR: Path to the main image (sysbuild) or synonym for APPLICATION_SOURCE_DIR (non-sysbuild) -zephyr_get(APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR) - set(COMMON_KCONFIG_ENV_SETTINGS PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} srctree=${ZEPHYR_BASE} @@ -145,7 +142,6 @@ set(COMMON_KCONFIG_ENV_SETTINGS APPVERSION=${APP_VERSION_STRING} APP_VERSION_EXTENDED_STRING=${APP_VERSION_EXTENDED_STRING} APP_VERSION_TWEAK_STRING=${APP_VERSION_TWEAK_STRING} - APP_DIR=${APP_DIR} CONFIG_=${KCONFIG_NAMESPACE}_ KCONFIG_CONFIG=${DOTCONFIG} KCONFIG_BOARD_DIR=${KCONFIG_BOARD_DIR} From 30cf5c2bb5dfb3f81522b439f2a7768f40fb29c2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 546/881] Revert "[nrf fromlist] tests: settings: Add retention test" This reverts commit a5a9f4aab7adcbcc5c763c39a3e526c08f02e6da. Signed-off-by: Jukka Rissanen --- .../subsys/settings/retention/CMakeLists.txt | 7 - .../boards/nrf52840dk_nrf52840.overlay | 39 ------ .../retention/boards/qemu_cortex_m3.overlay | 35 ----- tests/subsys/settings/retention/prj.conf | 7 - .../settings/retention/src/CMakeLists.txt | 12 -- tests/subsys/settings/retention/src/main.c | 130 ------------------ .../settings/retention/src/settings_test.h | 42 ------ tests/subsys/settings/retention/testcase.yaml | 9 -- 8 files changed, 281 deletions(-) delete mode 100644 tests/subsys/settings/retention/CMakeLists.txt delete mode 100644 tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay delete mode 100644 tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay delete mode 100644 tests/subsys/settings/retention/prj.conf delete mode 100644 tests/subsys/settings/retention/src/CMakeLists.txt delete mode 100644 tests/subsys/settings/retention/src/main.c delete mode 100644 tests/subsys/settings/retention/src/settings_test.h delete mode 100644 tests/subsys/settings/retention/testcase.yaml diff --git a/tests/subsys/settings/retention/CMakeLists.txt b/tests/subsys/settings/retention/CMakeLists.txt deleted file mode 100644 index 315cbacf594..00000000000 --- a/tests/subsys/settings/retention/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(settings_retention) - -add_subdirectory(./src zms_test_bindir) diff --git a/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay deleted file mode 100644 index e7806a54b85..00000000000 --- a/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - /delete-property/ zephyr,boot-mode; - }; - - sram@2003F000 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003F000 DT_SIZE_K(4)>; - zephyr,memory-region = "RetainedMem"; - status = "okay"; - - retainedmem { - compatible = "zephyr,retained-ram"; - status = "okay"; - #address-cells = <1>; - #size-cells = <1>; - - settings_partition0: settings_partition@0 { - compatible = "zephyr,retention"; - status = "okay"; - reg = <0x0 0x1000>; - }; - }; - }; - - chosen { - zephyr,settings-partition = &settings_partition0; - }; -}; - -&sram0 { - reg = <0x20000000 DT_SIZE_K(252)>; -}; diff --git a/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay b/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay deleted file mode 100644 index fe9bab6b727..00000000000 --- a/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - sram@2000F000 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000F000 0x1000>; - zephyr,memory-region = "RetainedMem"; - status = "okay"; - - retainedmem { - compatible = "zephyr,retained-ram"; - status = "okay"; - #address-cells = <1>; - #size-cells = <1>; - - settings_partition0: settings_partition@0 { - compatible = "zephyr,retention"; - status = "okay"; - reg = <0x0 0x1000>; - }; - }; - }; - - chosen { - zephyr,settings-partition = &settings_partition0; - }; -}; - -&sram0 { - reg = <0x20000000 0xf000>; -}; diff --git a/tests/subsys/settings/retention/prj.conf b/tests/subsys/settings/retention/prj.conf deleted file mode 100644 index ae8afe82d74..00000000000 --- a/tests/subsys/settings/retention/prj.conf +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG_ZTEST=y -CONFIG_RETAINED_MEM=y -CONFIG_RETENTION=y - -CONFIG_SETTINGS=y -CONFIG_SETTINGS_RUNTIME=y -CONFIG_SETTINGS_RETENTION=y diff --git a/tests/subsys/settings/retention/src/CMakeLists.txt b/tests/subsys/settings/retention/src/CMakeLists.txt deleted file mode 100644 index b2897bddcf9..00000000000 --- a/tests/subsys/settings/retention/src/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2024 BayLibre SAS - -zephyr_include_directories( - ${ZEPHYR_BASE}/subsys/settings/include - ${ZEPHYR_BASE}/subsys/settings/src - ${ZEPHYR_BASE}/tests/subsys/settings/zms/src - ) - -target_sources(app PRIVATE main.c) - -add_subdirectory(../../src settings_test_bindir) diff --git a/tests/subsys/settings/retention/src/main.c b/tests/subsys/settings/retention/src/main.c deleted file mode 100644 index 3673e0b9810..00000000000 --- a/tests/subsys/settings/retention/src/main.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2024 BayLibre SAS - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include - -#include "settings_priv.h" -#include "settings_test.h" - -uint8_t val8; -uint8_t val8_un; -uint32_t val32; -uint64_t val64; - -int test_get_called; -int test_set_called; -int test_commit_called; -int test_export_block; - -int c1_handle_get(const char *name, char *val, int val_len_max); -int c1_handle_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg); -int c1_handle_commit(void); -int c1_handle_export(int (*cb)(const char *name, const void *value, size_t val_len)); - -struct settings_handler c_test_handlers[] = { - {.name = "myfoo", - .h_get = c1_handle_get, - .h_set = c1_handle_set, - .h_commit = c1_handle_commit, - .h_export = c1_handle_export}, -}; - -int c1_handle_get(const char *name, char *val, int val_len_max) -{ - const char *next; - - if (val_len_max < 0) { - return -EINVAL; - } - - test_get_called = 1; - - if (settings_name_steq(name, "mybar", &next) && !next) { - val_len_max = MIN(val_len_max, sizeof(val8)); - memcpy(val, &val8, MIN(val_len_max, sizeof(val8))); - return val_len_max; - } - - if (settings_name_steq(name, "mybar64", &next) && !next) { - val_len_max = MIN(val_len_max, sizeof(val64)); - memcpy(val, &val64, MIN(val_len_max, sizeof(val64))); - return val_len_max; - } - - return -ENOENT; -} - -int c1_handle_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg) -{ - size_t val_len; - int rc; - const char *next; - - test_set_called = 1; - if (settings_name_steq(name, "mybar", &next) && !next) { - rc = read_cb(cb_arg, &val8, sizeof(val8)); - zassert_true(rc >= 0, "SETTINGS_VALUE_SET callback"); - return 0; - } - - if (settings_name_steq(name, "mybar64", &next) && !next) { - rc = read_cb(cb_arg, &val64, sizeof(val64)); - zassert_true(rc >= 0, "SETTINGS_VALUE_SET callback"); - return 0; - } - - if (settings_name_steq(name, "unaligned", &next) && !next) { - val_len = len; - zassert_equal(val_len, sizeof(val8_un), "value length: %zd, ought equal 1", - val_len); - rc = read_cb(cb_arg, &val8_un, sizeof(val8_un)); - zassert_true(rc >= 0, "SETTINGS_VALUE_SET callback"); - return 0; - } - - return -ENOENT; -} - -int c1_handle_commit(void) -{ - test_commit_called = 1; - return 0; -} - -int c1_handle_export(int (*cb)(const char *name, const void *value, size_t val_len)) -{ - if (test_export_block) { - return 0; - } - - (void)cb("myfoo/mybar", &val8, sizeof(val8)); - - (void)cb("myfoo/mybar64", &val64, sizeof(val64)); - - (void)cb("myfoo/unaligned", &val8_un, sizeof(val8_un)); - - return 0; -} - -void ctest_clear_call_state(void) -{ - test_get_called = 0; - test_set_called = 0; - test_commit_called = 0; -} - -int ctest_get_call_state(void) -{ - return test_get_called + test_set_called + test_commit_called; -} - -void config_wipe_srcs(void) -{ - sys_slist_init(&settings_load_srcs); - settings_save_dst = NULL; -} - -ZTEST_SUITE(settings_config, NULL, settings_config_setup, NULL, NULL, settings_config_teardown); diff --git a/tests/subsys/settings/retention/src/settings_test.h b/tests/subsys/settings/retention/src/settings_test.h deleted file mode 100644 index 6a53260e1d4..00000000000 --- a/tests/subsys/settings/retention/src/settings_test.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2024 BayLibre SAS - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef _SETTINGS_TEST_H -#define _SETTINGS_TEST_H - -#include -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -extern uint8_t val8; -extern uint8_t val8_un; -extern uint32_t val32; -extern uint64_t val64; - -extern int test_get_called; -extern int test_set_called; -extern int test_commit_called; -extern int test_export_block; - -extern struct settings_handler c_test_handlers[]; - -void ctest_clear_call_state(void); -int ctest_get_call_state(void); - -void config_wipe_srcs(void); -void *settings_config_setup(void); -void settings_config_teardown(void *fixture); - -#ifdef __cplusplus -} -#endif -#endif /* _SETTINGS_TEST_H */ diff --git a/tests/subsys/settings/retention/testcase.yaml b/tests/subsys/settings/retention/testcase.yaml deleted file mode 100644 index adbd61e4701..00000000000 --- a/tests/subsys/settings/retention/testcase.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - settings.retention: - platform_allow: - - nrf52840dk/nrf52840 - - qemu_cortex_m3 - min_ram: 8 - tags: - - settings - - retention From 0ded7d62cb2ddb20029b37f658e73fe5313f6f96 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 547/881] Revert "[nrf fromlist] settings: Add retention backend" This reverts commit 8f4bffb7a02cbaaa78588bc234f4d9bc3678920b. Signed-off-by: Jukka Rissanen --- subsys/settings/Kconfig | 14 -- subsys/settings/src/CMakeLists.txt | 1 - subsys/settings/src/settings_retention.c | 303 ----------------------- 3 files changed, 318 deletions(-) delete mode 100644 subsys/settings/src/settings_retention.c diff --git a/subsys/settings/Kconfig b/subsys/settings/Kconfig index 5b6a76052b2..fdb3c4bb3ce 100644 --- a/subsys/settings/Kconfig +++ b/subsys/settings/Kconfig @@ -30,20 +30,12 @@ config SETTINGS_DYNAMIC_HANDLERS config SETTINGS_ENCODE_LEN bool -DT_CHOSEN_ZEPHYR_SETTINGS_PARTITION := zephyr,settings-partition -DT_ZEPHYR_RETENTION := zephyr,retention - -config SETTINGS_SUPPORTED_RETENTION - bool - default y if RETENTION && $(dt_chosen_has_compat,$(DT_CHOSEN_ZEPHYR_SETTINGS_PARTITION),$(DT_ZEPHYR_RETENTION)) - choice SETTINGS_BACKEND prompt "Storage back-end" default SETTINGS_ZMS if ZMS default SETTINGS_NVS if NVS default SETTINGS_FCB if FCB default SETTINGS_FILE if FILE_SYSTEM - default SETTINGS_RETENTION if SETTINGS_SUPPORTED_RETENTION default SETTINGS_NONE help Storage back-end to be used by the settings subsystem. @@ -112,12 +104,6 @@ config SETTINGS_NVS_NAME_CACHE_SIZE endif # SETTINGS_NVS -config SETTINGS_RETENTION - bool "Retention storage support" - depends on SETTINGS_SUPPORTED_RETENTION - help - Enables retention storage support (bulk load/save supported only). - config SETTINGS_CUSTOM bool "CUSTOM" help diff --git a/subsys/settings/src/CMakeLists.txt b/subsys/settings/src/CMakeLists.txt index 705fd3dc77d..4aa797fbb35 100644 --- a/subsys/settings/src/CMakeLists.txt +++ b/subsys/settings/src/CMakeLists.txt @@ -14,4 +14,3 @@ zephyr_sources_ifdef(CONFIG_SETTINGS_NVS settings_nvs.c) zephyr_sources_ifdef(CONFIG_SETTINGS_NONE settings_none.c) zephyr_sources_ifdef(CONFIG_SETTINGS_SHELL settings_shell.c) zephyr_sources_ifdef(CONFIG_SETTINGS_ZMS settings_zms.c) -zephyr_sources_ifdef(CONFIG_SETTINGS_RETENTION settings_retention.c) diff --git a/subsys/settings/src/settings_retention.c b/subsys/settings/src/settings_retention.c deleted file mode 100644 index 931bf02cb9f..00000000000 --- a/subsys/settings/src/settings_retention.c +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -#include -#include -#include -#include "settings_priv.h" - -LOG_MODULE_DECLARE(settings, CONFIG_SETTINGS_LOG_LEVEL); - -#if !DT_HAS_CHOSEN(zephyr_settings_partition) -#error "Missing zephyr,settings-partition chosen node" -#elif !DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_settings_partition), zephyr_retention) -#error "zephyr,settings-partition must be a zephyr,retention node" -#endif - -/* - * Retention storage stores each setting in the following format: - * uint16_t length_name - * uint16_t length_value - * uint8_t name[...] - * uint8_t value[...] - * - * Each setting is placed sequentially into the retention memory area, it is assumed that the - * checksum feature is used to ensure data validity upon loading settings from the retained - * memory though this is optional. - * - * Upon saving settings, the whole retention area is cleared first, then settings are written - * one-by-one, it is only supported to save/load all settings in one go. - */ - -/** Retention settings context object */ -struct settings_retention { - /** Settings storage */ - struct settings_store cf_store; - - /** Retention device */ - const struct device *cf_retention; - - /** Last write position when setting was saved */ - uint32_t last_write_pos; -}; - -/** Length of name and value object, used when reading/saving settings */ -struct settings_retention_lengths { - /** Length of name */ - uint16_t length_name; - - /** Length of value */ - uint16_t length_value; - - /* Name and value byte arrays follow past this point... */ -}; - -BUILD_ASSERT(sizeof(struct settings_retention_lengths) == sizeof(uint16_t) + sizeof(uint16_t)); - -/** Used with read callback */ -struct settings_retention_read_arg { - /** Retention device */ - const struct device *cf_retention; - - /** Offset to read from */ - uint32_t offset; -}; - -static int settings_retention_load(struct settings_store *cs, const struct settings_load_arg *arg); -static int settings_retention_save(struct settings_store *cs, const char *name, const char *value, - size_t val_len); -static void *settings_retention_storage_get(struct settings_store *cs); -static int settings_retention_save_start(struct settings_store *cs); - -static const struct device *storage_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_settings_partition)); - -static const struct settings_store_itf settings_retention_itf = { - .csi_load = settings_retention_load, - .csi_save = settings_retention_save, - .csi_storage_get = settings_retention_storage_get, - .csi_save_start = settings_retention_save_start, -}; - -static int settings_retention_src(struct settings_retention *cf) -{ - if (!retention_is_valid(cf->cf_retention)) { - return -EIO; - } - - cf->cf_store.cs_itf = &settings_retention_itf; - settings_src_register(&cf->cf_store); - - return 0; -} - -static int settings_retention_dst(struct settings_retention *cf) -{ - cf->cf_store.cs_itf = &settings_retention_itf; - settings_dst_register(&cf->cf_store); - - return 0; -} - -static int settings_retention_read_value(void *cb_arg, void *data, size_t len) -{ - int rc; - struct settings_retention_read_arg *ctx = cb_arg; - - rc = retention_read(ctx->cf_retention, ctx->offset, data, len); - - if (rc != 0) { - return rc; - } - - return len; -} - -static int settings_retention_load(struct settings_store *cs, const struct settings_load_arg *arg) -{ - int rc; - uint32_t pos = 0; - struct settings_retention *cf = CONTAINER_OF(cs, struct settings_retention, cf_store); - uint32_t max_pos = retention_size(cf->cf_retention); - struct settings_retention_read_arg read_arg = { - .cf_retention = cf->cf_retention, - }; - - while (pos < max_pos) { - struct settings_retention_lengths lengths; - char name[SETTINGS_MAX_NAME_LEN + SETTINGS_EXTRA_LEN + 1]; - - if ((pos + sizeof(lengths)) >= max_pos) { - return -EIO; - } - - /* Read lengths and check validity */ - rc = retention_read(cf->cf_retention, pos, (uint8_t *)&lengths, sizeof(lengths)); - - if (rc != 0) { - return rc; - } - - if ((lengths.length_name == 0 && lengths.length_value == 0) || - (lengths.length_name == USHRT_MAX && lengths.length_value == USHRT_MAX)) { - /* Empty data, finished loading */ - LOG_DBG("Finished loading retentions settings, size: 0x%x", pos); - break; - } else if (lengths.length_name > SETTINGS_MAX_NAME_LEN) { - LOG_ERR("Invalid name length: %d, max supported: %d", - lengths.length_name, SETTINGS_MAX_NAME_LEN); - return -EIO; - } else if (lengths.length_value > SETTINGS_MAX_VAL_LEN) { - LOG_ERR("Invalid value length: %d, max supported: %d", - lengths.length_name, SETTINGS_MAX_VAL_LEN); - return -EIO; - } else if ((lengths.length_name + lengths.length_value + pos) > max_pos) { - LOG_ERR("Data length goes beyond retention area: 0x%x, max size: 0x%x", - (lengths.length_name + lengths.length_value + pos), max_pos); - return -EIO; - } - - /* Read values */ - pos += sizeof(lengths); - rc = retention_read(cf->cf_retention, pos, name, lengths.length_name); - - if (rc != 0) { - return rc; - } - - name[lengths.length_name] = '\0'; - pos += lengths.length_name; - read_arg.offset = pos; - - rc = settings_call_set_handler(name, lengths.length_value, - &settings_retention_read_value, &read_arg, arg); - - if (rc != 0) { - return rc; - } - - pos += lengths.length_value; - } - - return 0; -} - -static int settings_retention_save(struct settings_store *cs, const char *name, const char *value, - size_t val_len) -{ - struct settings_retention *cf = CONTAINER_OF(cs, struct settings_retention, cf_store); - struct settings_retention_lengths lengths; - uint32_t off = cf->last_write_pos; - int rc = -EINVAL; - - if (name == NULL || (value == NULL && val_len > 0)) { - return -EINVAL; - } - - lengths.length_name = (uint16_t)strlen(name); - lengths.length_value = (uint16_t)val_len; - - if (lengths.length_name == 0) { - return -EINVAL; - } else if ((cf->last_write_pos + sizeof(lengths) + lengths.length_name + val_len) > - retention_size(cf->cf_retention)) { - return -E2BIG; - } - - /* Write data before writing length header to ensure that if something happens before one - * is written then the data is not wrongly seen as valid upon reading, as would be the - * case if it was partially written - */ - off += sizeof(lengths); - rc = retention_write(cf->cf_retention, off, name, lengths.length_name); - - if (rc != 0) { - return rc; - } - - off += lengths.length_name; - rc = retention_write(cf->cf_retention, off, value, val_len); - - if (rc != 0) { - goto tidy; - } - - rc = retention_write(cf->cf_retention, cf->last_write_pos, (uint8_t *)&lengths, - sizeof(lengths)); - - if (rc != 0) { - goto tidy; - } - - off += val_len; - cf->last_write_pos = off; - -tidy: - if (rc != 0) { - /* Attempt to clear data header that was partially written */ - uint8_t empty_data[sizeof(lengths)] = { 0x00 }; - uint8_t l = sizeof(lengths) + lengths.length_name + val_len; - uint8_t i = 0; - - while (i < l) { - uint8_t write_len = (i + sizeof(empty_data)) > l ? (l - i) : - sizeof(empty_data); - - rc = retention_write(cf->cf_retention, (cf->last_write_pos + i), - empty_data, write_len); - - if (rc != 0) { - break; - } - - i += write_len; - } - } - - return rc; -} - -static int settings_retention_save_start(struct settings_store *cs) -{ - struct settings_retention *cf = CONTAINER_OF(cs, struct settings_retention, cf_store); - - cf->last_write_pos = 0; - - return retention_clear(cf->cf_retention); -} - -int settings_backend_init(void) -{ - int rc; - static struct settings_retention config_init_settings_retention; - - if (!device_is_ready(storage_dev)) { - return -ENOENT; - } - - config_init_settings_retention.cf_retention = storage_dev; - config_init_settings_retention.last_write_pos = 0; - - rc = settings_retention_src(&config_init_settings_retention); - - if (rc != 0 && rc != -EIO) { - return rc; - } - - rc = settings_retention_dst(&config_init_settings_retention); - - return rc; -} - -static void *settings_retention_storage_get(struct settings_store *cs) -{ - struct settings_retention *cf = CONTAINER_OF(cs, struct settings_retention, cf_store); - - return &cf->cf_retention; -} From 599a947b0959454cc3148638f6544f5c8365306f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 548/881] Revert "[nrf fromlist] tests: drivers: timer: nrf_grtc_timer: Add stress test" This reverts commit 6bbe5d64f72b0843ed16f9ef01704759e4e76cff. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 17 -- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 32 --- .../nrf54l15dk_nrf54l15_cpuflpr.overlay | 32 --- tests/drivers/timer/nrf_grtc_timer/prj.conf | 6 - tests/drivers/timer/nrf_grtc_timer/src/main.c | 247 ------------------ .../timer/nrf_grtc_timer/testcase.yaml | 43 ++- 6 files changed, 20 insertions(+), 357 deletions(-) delete mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 7ae95926703..04580b71480 100644 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -2,21 +2,4 @@ &grtc { /delete-property/ child-owned-channels; - interrupts = <109 2>; -}; - -test_timer: &timer131 { - status = "okay"; - interrupts = <419 1>; -}; - -&timer130 { - status = "okay"; - prescaler = <0>; -}; - -/ { - chosen { - zephyr,cpu-load-counter = &timer130; - }; }; diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 7bcede529b0..00000000000 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&grtc { - interrupts = <228 2>; -}; - -test_timer: &timer21 { - status = "okay"; - interrupts = <203 1>; -}; - -&timer20 { - status = "okay"; - interrupts = <202 0>; -}; - -&timer00 { - status = "okay"; - prescaler = <0>; -}; - -/ { - chosen { - zephyr,cpu-load-counter = &timer00; - }; - - busy-sim { - compatible = "vnd,busy-sim"; - status = "okay"; - counter = <&timer20>; - }; -}; diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay deleted file mode 100644 index cfa72ed0273..00000000000 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&grtc { - /*interrupts = <226 2>;*/ -}; - -test_timer: &timer21 { - status = "okay"; - /*interrupts = <203 2>;*/ -}; - -&timer20 { - status = "okay"; - interrupts = <202 0>; -}; - -&timer00 { - status = "okay"; - prescaler = <0>; -}; - -/ { - chosen { - zephyr,cpu-load-counter = &timer00; - }; - - busy-sim { - compatible = "vnd,busy-sim"; - status = "okay"; - counter = <&timer20>; - }; -}; diff --git a/tests/drivers/timer/nrf_grtc_timer/prj.conf b/tests/drivers/timer/nrf_grtc_timer/prj.conf index 93926f090b7..dea03477519 100644 --- a/tests/drivers/timer/nrf_grtc_timer/prj.conf +++ b/tests/drivers/timer/nrf_grtc_timer/prj.conf @@ -1,8 +1,2 @@ CONFIG_ZTEST=y CONFIG_NRF_GRTC_TIMER=y -CONFIG_COUNTER=y -CONFIG_TEST_RANDOM_GENERATOR=y -CONFIG_XOSHIRO_RANDOM_GENERATOR=y -CONFIG_LOG_PRINTK=y -CONFIG_CPU_LOAD=y -CONFIG_CPU_LOAD_USE_COUNTER=y diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index 9de554256b4..cede54f026f 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -5,15 +5,7 @@ */ #include #include -#include -#include -#include -#include -#include -#include -#include #include -LOG_MODULE_REGISTER(test, 1); #define GRTC_SLEW_TICKS 10 #define NUMBER_OF_TRIES 2000 @@ -161,243 +153,4 @@ ZTEST(nrf_grtc_timer, test_timer_abort_in_compare_mode) z_nrf_grtc_timer_chan_free(channel); } -enum test_timer_state { - TIMER_IDLE, - TIMER_PREPARE, - TIMER_ACTIVE -}; - -enum test_ctx { - TEST_HIGH_PRI, - TEST_TIMER_CB, - TEST_THREAD -}; - -struct test_grtc_timer { - struct k_timer timer; - uint32_t ticks; - uint32_t expire; - uint32_t start_cnt; - uint32_t expire_cnt; - uint32_t abort_cnt; - uint32_t exp_expire; - int max_late; - int min_late; - int avg_late; - uint32_t early_cnt; - enum test_timer_state state; -}; - -static atomic_t test_active_cnt; -static struct test_grtc_timer timers[8]; -static uint32_t test_end; -static k_tid_t test_tid; -static volatile bool test_run; -static uint32_t ctx_cnt[3]; -static const char *const ctx_name[] = { "HIGH PRIO ISR", "TIMER CALLBACK", "THREAD" }; - -static bool stress_test_action(int ctx, int id) -{ - struct test_grtc_timer *timer = &timers[id]; - - ctx_cnt[ctx]++; - if (timer->state == TIMER_ACTIVE) { - /* Aborting soon to expire timers from higher interrupt priority may lead - * to test failures. - */ - if (ctx == 0 && (k_timer_remaining_get(&timer->timer) < 5)) { - return true; - } - - if (timer->abort_cnt < timer->expire_cnt / 2) { - bool any_active; - - timer->state = TIMER_PREPARE; - k_timer_stop(&timer->timer); - timer->abort_cnt++; - any_active = atomic_dec(&test_active_cnt) > 1; - timer->state = TIMER_IDLE; - - return any_active; - } - } else if (timer->state == TIMER_IDLE) { - int ticks = 10 + (sys_rand32_get() & 0x3F); - k_timeout_t t = K_TICKS(ticks); - - timer->exp_expire = k_ticks_to_cyc_floor32(sys_clock_tick_get_32() + ticks); - timer->state = TIMER_PREPARE; - timer->ticks = ticks; - k_timer_start(&timer->timer, t, K_NO_WAIT); - atomic_inc(&test_active_cnt); - timer->start_cnt++; - timer->state = TIMER_ACTIVE; - } - - return true; -} - -static void stress_test_actions(int ctx) -{ - uint32_t r = sys_rand32_get(); - int action_cnt = Z_MAX(r & 0x3, 1); - int tmr_id = (r >> 8) % ARRAY_SIZE(timers); - - /* Occasionally wake thread context from which timer actions are also executed. */ - if ((((r >> 2) & 0x3) == 0) || test_active_cnt < 2) { - LOG_DBG("ctx:%d thread wakeup", ctx); - k_wakeup(test_tid); - } - - for (int i = 0; i < action_cnt; i++) { - if (stress_test_action(ctx, tmr_id) == false) { - stress_test_action(ctx, tmr_id); - } - } -} - -static void timer_cb(struct k_timer *timer) -{ - struct test_grtc_timer *test_timer = CONTAINER_OF(timer, struct test_grtc_timer, timer); - uint32_t now = k_cycle_get_32(); - int diff = now - test_timer->exp_expire; - - atomic_dec(&test_active_cnt); - zassert_true(diff >= 0); - test_timer->max_late = MAX(diff, test_timer->max_late); - test_timer->min_late = MIN(diff, test_timer->min_late); - - if (test_timer->expire_cnt == 0) { - test_timer->avg_late = diff; - } else { - test_timer->avg_late = (test_timer->avg_late * test_timer->expire_cnt + diff) / - (test_timer->expire_cnt + 1); - } - - test_timer->expire_cnt++; - test_timer->state = TIMER_IDLE; - - if (test_run) { - stress_test_actions(TEST_TIMER_CB); - } -} - -static void counter_set(const struct device *dev, struct counter_alarm_cfg *cfg) -{ - int err; - uint32_t us = 150 + (sys_rand32_get() & 0x3F); - - cfg->ticks = counter_us_to_ticks(dev, us); - err = counter_set_channel_alarm(dev, 0, cfg); - zassert_equal(err, 0); -} - -static void counter_cb(const struct device *dev, uint8_t chan_id, uint32_t ticks, void *user_data) -{ - struct counter_alarm_cfg *config = user_data; - - if (test_run) { - stress_test_actions(TEST_HIGH_PRI); - counter_set(dev, config); - } -} - -static void report_progress(uint32_t start, uint32_t end) -{ - static uint32_t next_report; - static uint32_t step; - static uint32_t progress; - - if (next_report == 0) { - step = (end - start) / 10; - next_report = start + step; - } - - if (k_uptime_get_32() > next_report) { - next_report += step; - progress += 10; - printk("%d%%\r", progress); - } -} - -static void grtc_stress_test(bool busy_sim_en) -{ - static struct counter_alarm_cfg alarm_cfg; -#if DT_NODE_EXISTS(DT_NODELABEL(test_timer)) && DT_NODE_HAS_STATUS(DT_NODELABEL(test_timer), okay) - const struct device *const counter_dev = DEVICE_DT_GET(DT_NODELABEL(test_timer)); -#else - const struct device *const counter_dev = NULL; -#endif - uint32_t test_ms = 5000; - uint32_t test_start = k_uptime_get_32(); - uint32_t load; - - test_end = k_cycle_get_32() + k_ms_to_cyc_floor32(test_ms); - test_tid = k_current_get(); - - for (size_t i = 0; i < ARRAY_SIZE(timers); i++) { - k_timer_init(&timers[i].timer, timer_cb, NULL); - } - - if (IS_ENABLED(CONFIG_CPU_LOAD)) { - (void)cpu_load_get(true); - } - - if (counter_dev) { - counter_start(counter_dev); - } - - alarm_cfg.callback = counter_cb; - alarm_cfg.user_data = &alarm_cfg; - test_run = true; - - if (counter_dev) { - counter_set(counter_dev, &alarm_cfg); - } - - if (busy_sim_en) { - busy_sim_start(500, 200, 1000, 400, NULL); - } - - LOG_DBG("Starting test, will end at %d", test_end); - while (k_cycle_get_32() < test_end) { - report_progress(test_start, test_start + test_ms); - stress_test_actions(TEST_THREAD); - k_sleep(K_MSEC(test_ms)); - } - - load = IS_ENABLED(CONFIG_CPU_LOAD) ? cpu_load_get(true) : 0; - - test_run = false; - k_msleep(50); - - for (size_t i = 0; i < ARRAY_SIZE(timers); i++) { - zassert_equal(timers[i].state, TIMER_IDLE, "Unexpected timer %d state:%d", - i, timers[i].state); - TC_PRINT("Timer%d (%p)\r\n\tstart_cnt:%d abort_cnt:%d expire_cnt:%d\n", - i, &timers[i], timers[i].start_cnt, timers[i].abort_cnt, - timers[i].expire_cnt); - TC_PRINT("\tavarage late:%d ticks, max late:%d, min late:%d early:%d\n", - timers[i].avg_late, timers[i].max_late, timers[i].min_late, - timers[i].early_cnt); - } - - for (size_t i = 0; i < ARRAY_SIZE(ctx_cnt); i++) { - TC_PRINT("Context: %s executed %d times\n", ctx_name[i], ctx_cnt[i]); - } - TC_PRINT("CPU load during test:%d.%d\n", load / 10, load % 10); - - if (busy_sim_en) { - busy_sim_stop(); - } - - if (counter_dev) { - counter_stop(counter_dev); - } -} - -ZTEST(nrf_grtc_timer, test_stress) -{ - grtc_stress_test(false); -} - ZTEST_SUITE(nrf_grtc_timer, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index 57835bc386a..cd4f99daede 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -1,24 +1,21 @@ -common: - tags: - - drivers - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuflpr - - nrf54l15bsim/nrf54l15/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr - - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54l20pdk/nrf54l20/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr - - ophelia4ev/nrf54l15/cpuapp - - ophelia4ev/nrf54l15/cpuflpr - integration_platforms: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp tests: - drivers.timer.nrf_grtc_timer: {} - drivers.timer.nrf_grtc_timer.no_assert: - extra_configs: - - CONFIG_ASSERT=n + drivers.timer.nrf_grtc_timer: + tags: drivers + platform_allow: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l09pdk/nrf54l09/cpuflpr + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l15bsim/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad + - nrf54h20dk/nrf54h20/cpuppr + - nrf54l20pdk/nrf54l20/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54l20pdk/nrf54l20/cpuflpr + - nrf54lm20dk/nrf54lm20a/cpuflpr + - ophelia4ev/nrf54l15/cpuapp + - ophelia4ev/nrf54l15/cpuflpr + integration_platforms: + - nrf54l20pdk/nrf54l20/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp From 08de0f2fe09dd3a4b92f9061938de386319adc90 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 549/881] Revert "[nrf fromtree] drivers: timer: nrf_grtc_timer: add last_count initialization" This reverts commit dc5dda3496b940d36f61cd9099bf4a3034e16dbc. Signed-off-by: Jukka Rissanen --- drivers/timer/nrf_grtc_timer.c | 8 -------- include/zephyr/drivers/timer/nrf_grtc_timer.h | 11 ----------- 2 files changed, 19 deletions(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 2809d8b3d60..285e48a57fd 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -66,7 +66,6 @@ static struct k_spinlock lock; static uint64_t last_count; /* Time (SYSCOUNTER value) @last sys_clock_announce() */ static atomic_t int_mask; static uint8_t ext_channels_allocated; -static uint64_t grtc_start_value; static nrfx_grtc_channel_t system_clock_channel_data = { .handler = sys_clock_timeout_handler, .p_context = NULL, @@ -359,11 +358,6 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) return 0; } -uint64_t z_nrf_grtc_timer_startup_value_get(void) -{ - return grtc_start_value; -} - #if defined(CONFIG_POWEROFF) && defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) { @@ -491,8 +485,6 @@ static int sys_clock_driver_init(void) } #endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ - last_count = (counter() / CYC_PER_TICK) * CYC_PER_TICK; - grtc_start_value = last_count; int_mask = NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK; if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { system_timeout_set_relative(CYC_PER_TICK); diff --git a/include/zephyr/drivers/timer/nrf_grtc_timer.h b/include/zephyr/drivers/timer/nrf_grtc_timer.h index 5a51df21744..f8b69d7ddf0 100644 --- a/include/zephyr/drivers/timer/nrf_grtc_timer.h +++ b/include/zephyr/drivers/timer/nrf_grtc_timer.h @@ -189,17 +189,6 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time); */ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us); -/** @brief Get the GRTC counter value latched at startup. - * - * @note The GRTC timer is not cleared by software at startup, - * while the system tick starts counting from zero. - * In some cases, it may be necessary to compare the system tick - * with the GRTC value — in such situations, this offset can be useful. - * - * @return GRTC value latched during system clock initialization. - */ -uint64_t z_nrf_grtc_timer_startup_value_get(void); - /** * @brief Initialize the GRTC clock timer driver from an application- * defined function. From 9ebc09f253d0c80974f1931ff860a570cfaf3d86 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:27 +0300 Subject: [PATCH 550/881] Revert "[nrf fromtree] net: lib: ptp: fix memory slab alignment issues" This reverts commit aacc6227ce25ae298045d791bd95b8c4f0a7ff76. Signed-off-by: Jukka Rissanen --- subsys/net/lib/ptp/msg.c | 2 +- subsys/net/lib/ptp/port.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/net/lib/ptp/msg.c b/subsys/net/lib/ptp/msg.c index 3fb78a40edb..e0b7f14229d 100644 --- a/subsys/net/lib/ptp/msg.c +++ b/subsys/net/lib/ptp/msg.c @@ -19,7 +19,7 @@ LOG_MODULE_REGISTER(ptp_msg, CONFIG_PTP_LOG_LEVEL); static struct k_mem_slab msg_slab; -K_MEM_SLAB_DEFINE_STATIC(msg_slab, sizeof(struct ptp_msg), CONFIG_PTP_MSG_POLL_SIZE, 4); +K_MEM_SLAB_DEFINE_STATIC(msg_slab, sizeof(struct ptp_msg), CONFIG_PTP_MSG_POLL_SIZE, 8); static const char *msg_type_str(struct ptp_msg *msg) { diff --git a/subsys/net/lib/ptp/port.c b/subsys/net/lib/ptp/port.c index 24abec002c8..ef3e19c43e0 100644 --- a/subsys/net/lib/ptp/port.c +++ b/subsys/net/lib/ptp/port.c @@ -38,7 +38,7 @@ BUILD_ASSERT(CONFIG_PTP_FOREIGN_TIME_TRANSMITTER_RECORD_SIZE >= 5 * CONFIG_PTP_N K_MEM_SLAB_DEFINE_STATIC(foreign_tts_slab, sizeof(struct ptp_foreign_tt_clock), CONFIG_PTP_FOREIGN_TIME_TRANSMITTER_RECORD_SIZE, - 4); + 8); #endif char str_port_id[] = "FF:FF:FF:FF:FF:FF:FF:FF-FFFF"; From 0988dd30bc5f2a5a487a0fa0e40a3ab05d4e9c03 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 551/881] Revert "[nrf fromlist] tests: drivers: nrf_clock_control: Test extended API" This reverts commit 2c7ce49379167eeb4a89d655f78cdf0cd7275262. Signed-off-by: Jukka Rissanen --- .../nrf_clock_control/src/main.c | 45 ++++--------------- 1 file changed, 8 insertions(+), 37 deletions(-) diff --git a/tests/drivers/clock_control/nrf_clock_control/src/main.c b/tests/drivers/clock_control/nrf_clock_control/src/main.c index 395e6a0fc00..8db19d38200 100644 --- a/tests/drivers/clock_control/nrf_clock_control/src/main.c +++ b/tests/drivers/clock_control/nrf_clock_control/src/main.c @@ -225,13 +225,10 @@ static void test_request_release_clock_spec(const struct device *clk_dev, static void test_clock_control_request(const struct test_clk_context *clk_contexts, size_t contexts_size) { - int ret; const struct test_clk_context *clk_context; size_t clk_specs_size; const struct device *clk_dev; - const struct nrf_clock_spec *req_spec; - struct nrf_clock_spec res_spec; - uint32_t startup_time_us; + const struct nrf_clock_spec *clk_spec; for (size_t i = 0; i < contexts_size; i++) { clk_context = &clk_contexts[i]; @@ -239,42 +236,16 @@ static void test_clock_control_request(const struct test_clk_context *clk_contex for (size_t u = 0; u < clk_specs_size; u++) { clk_dev = clk_context->clk_dev; - req_spec = &clk_context->clk_specs[u]; + clk_spec = &clk_context->clk_specs[u]; - zassert_true(device_is_ready(clk_dev), "%s is not ready", clk_dev->name); + zassert_true(device_is_ready(clk_dev), + "%s is not ready", clk_dev->name); - TC_PRINT("Requested clock (%s) spec: frequency %d, accuracy %d, precision " - "%d\n", - clk_dev->name, req_spec->frequency, req_spec->accuracy, - req_spec->precision); - - ret = nrf_clock_control_resolve(clk_dev, req_spec, &res_spec); - zassert(ret == 0 || ret == -ENOSYS, - "minimum clock specs could not be resolved"); - if (ret == 0) { - TC_PRINT("Resolved spec: frequency %d, accuracy %d, precision " - "%d\n", - res_spec.frequency, res_spec.accuracy, res_spec.precision); - } else if (ret == -ENOSYS) { - TC_PRINT("resolve not supported\n"); - res_spec.frequency = req_spec->frequency; - res_spec.accuracy = req_spec->accuracy; - res_spec.precision = req_spec->precision; - } - - ret = nrf_clock_control_get_startup_time(clk_dev, &res_spec, - &startup_time_us); - zassert(ret == 0 || ret == -ENOSYS, "failed to get startup time"); - if (ret == 0) { - TC_PRINT("startup time for resloved spec: %uus\n", startup_time_us); - } else if (ret == -ENOSYS) { - TC_PRINT("get startup time not supported\n"); - } - - TC_PRINT("Applying spec: frequency %d, accuracy %d, precision " + TC_PRINT("Applying clock (%s) spec: frequency %d, accuracy %d, precision " "%d\n", - res_spec.frequency, res_spec.accuracy, res_spec.precision); - test_request_release_clock_spec(clk_dev, &res_spec); + clk_dev->name, clk_spec->frequency, clk_spec->accuracy, + clk_spec->precision); + test_request_release_clock_spec(clk_dev, clk_spec); } } } From b15979c2c8786b193792c438b1e72271bf892b44 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 552/881] Revert "[nrf fromtree] doc: migration-guide-4.2: Add note about bt_hci_cmd_create()" This reverts commit 4a63d05e821f80a547e4c3ae058dcc4545b23793. Signed-off-by: Jukka Rissanen --- doc/releases/migration-guide-4.2.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/releases/migration-guide-4.2.rst b/doc/releases/migration-guide-4.2.rst index 08a2a3d0e33..faad669e379 100644 --- a/doc/releases/migration-guide-4.2.rst +++ b/doc/releases/migration-guide-4.2.rst @@ -410,10 +410,6 @@ Bluetooth HCI have been deprecated, but are still usable, with the exception that they can only be called once per buffer. -* The :c:func:`bt_hci_cmd_create` function has been depracated and the new :c:func:`bt_hci_cmd_alloc` - function should be used instead. The new function takes no parameters because the command - sending functions have been updated to do the command header encoding. - Bluetooth Host ============== From ca80c2ce6db7e2399feba3d5cadc5c0b69309d23 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 553/881] Revert "[nrf fromtree] Bluetooth: Host: Mark bt_hci_cmd_create() as deprecated" This reverts commit 08772c54d733713295930c4820ea0edf876b2160. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/hci.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/zephyr/bluetooth/hci.h b/include/zephyr/bluetooth/hci.h index cc0843fb7e3..dd9c60c8ae8 100644 --- a/include/zephyr/bluetooth/hci.h +++ b/include/zephyr/bluetooth/hci.h @@ -56,14 +56,12 @@ static inline const char *bt_hci_err_to_str(uint8_t hci_err) * of the parameters. Upon successful return the buffer is ready to have * the parameters encoded into it. * - * @deprecated Use bt_hci_cmd_alloc() instead. - * * @param opcode Command OpCode. * @param param_len Length of command parameters. * * @return Newly allocated buffer. */ -__deprecated struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len); +struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len); /** Allocate an HCI command buffer. * @@ -82,7 +80,7 @@ struct net_buf *bt_hci_cmd_alloc(k_timeout_t timeout); /** Send a HCI command asynchronously. * * This function is used for sending a HCI command asynchronously. It can - * either be called for a buffer created using bt_hci_cmd_alloc(), or + * either be called for a buffer created using bt_hci_cmd_create(), or * if the command has no parameters a NULL can be passed instead. The * sending of the command will happen asynchronously, i.e. upon successful * return from this function the caller only knows that it was queued @@ -101,7 +99,7 @@ int bt_hci_cmd_send(uint16_t opcode, struct net_buf *buf); /** Send a HCI command synchronously. * * This function is used for sending a HCI command synchronously. It can - * either be called for a buffer created using bt_hci_cmd_alloc(), or + * either be called for a buffer created using bt_hci_cmd_create(), or * if the command has no parameters a NULL can be passed instead. * * The function will block until a Command Status or a Command Complete From 127474dfe521fc76f1943eb5edd8f59634b8d24b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 554/881] Revert "[nrf fromtree] Bluetooth: drivers: Use bt_hci_cmd_alloc()" This reverts commit 61b354b92c5a4f4d82e8190d89b4c0708df26f43. Signed-off-by: Jukka Rissanen --- drivers/bluetooth/hci/apollox_blue.c | 3 ++- drivers/bluetooth/hci/h4_ifx_cyw43xxx.c | 5 +++-- drivers/bluetooth/hci/hci_ifx_cyw208xx.c | 6 +++--- drivers/bluetooth/hci/hci_ifx_psoc6_bless.c | 2 +- drivers/bluetooth/hci/hci_nxp.c | 2 +- drivers/bluetooth/hci/hci_nxp_setup.c | 7 ++++--- drivers/bluetooth/hci/hci_spi_st.c | 2 +- drivers/bluetooth/hci/hci_stm32wba.c | 2 +- drivers/bluetooth/hci/ipm_stm32wb.c | 5 +++-- 9 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/bluetooth/hci/apollox_blue.c b/drivers/bluetooth/hci/apollox_blue.c index 9a4bf5440d8..1fb2ab33fb1 100644 --- a/drivers/bluetooth/hci/apollox_blue.c +++ b/drivers/bluetooth/hci/apollox_blue.c @@ -396,7 +396,8 @@ static int bt_apollo_set_nvds(void) #else uint8_t *p; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(HCI_VSC_UPDATE_NVDS_CFG_CMD_OPCODE, + HCI_VSC_UPDATE_NVDS_CFG_CMD_LENGTH); if (!buf) { return -ENOBUFS; } diff --git a/drivers/bluetooth/hci/h4_ifx_cyw43xxx.c b/drivers/bluetooth/hci/h4_ifx_cyw43xxx.c index e115ea92b47..6bc563fb9f2 100644 --- a/drivers/bluetooth/hci/h4_ifx_cyw43xxx.c +++ b/drivers/bluetooth/hci/h4_ifx_cyw43xxx.c @@ -122,7 +122,8 @@ static int bt_update_controller_baudrate(const struct device *bt_uart_dev, uint3 /* Allocate buffer for update uart baudrate command. * It will be BT_HCI_OP_RESET with extra parameters. */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_VND_OP_UPDATE_BAUDRATE, + HCI_VSC_UPDATE_BAUD_RATE_LENGTH); if (buf == NULL) { LOG_ERR("Unable to allocate command buffer"); return -ENOMEM; @@ -171,7 +172,7 @@ static int bt_firmware_download(const uint8_t *firmware_image, uint32_t size) uint16_t op_code = *(uint16_t *)data; /* Allocate buffer for hci_write_ram/hci_launch_ram command. */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(op_code, data_length); if (buf == NULL) { LOG_ERR("Unable to allocate command buffer"); return err; diff --git a/drivers/bluetooth/hci/hci_ifx_cyw208xx.c b/drivers/bluetooth/hci/hci_ifx_cyw208xx.c index 913d19d514c..1fee53436a6 100644 --- a/drivers/bluetooth/hci/hci_ifx_cyw208xx.c +++ b/drivers/bluetooth/hci/hci_ifx_cyw208xx.c @@ -146,7 +146,7 @@ static int cyw208xx_bt_firmware_download(const uint8_t *firmware_image, uint32_t } /* Allocate buffer for hci_write_ram/hci_launch_ram command. */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(op_code, data_length); if (buf == NULL) { LOG_ERR("Unable to allocate command buffer"); return -ENOBUFS; @@ -211,7 +211,7 @@ static int cyw208xx_setup(const struct device *dev, const struct bt_hci_setup_pa cybt_platform_hci_wait_for_boot_fully_up(false); /* Set public address */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_VND_OP_SET_LOCAL_DEV_ADDR, BTM_SET_LOCAL_DEV_ADDR_LENGTH); if (buf == NULL) { LOG_ERR("Unable to allocate command buffer"); cyhal_syspm_unlock_deepsleep(); @@ -375,7 +375,7 @@ wiced_bt_dev_vendor_specific_command(uint16_t opcode, uint8_t param_len, uint8_t struct net_buf *buf = NULL; /* Allocate a HCI command buffer */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(opcode, param_len); if (!buf) { LOG_ERR("Unable to allocate buffer"); return WICED_NO_MEMORY; diff --git a/drivers/bluetooth/hci/hci_ifx_psoc6_bless.c b/drivers/bluetooth/hci/hci_ifx_psoc6_bless.c index 531a3439d91..db50091c8ae 100644 --- a/drivers/bluetooth/hci/hci_ifx_psoc6_bless.c +++ b/drivers/bluetooth/hci/hci_ifx_psoc6_bless.c @@ -203,7 +203,7 @@ static int psoc6_bless_setup(const struct device *dev, const struct bt_hci_setup addr[5], addr[4], addr[3], addr[2], addr[1], addr[0], BT_ADDR_LE_PUBLIC, }; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(PSOC6_BLESS_OP_SET_PUBLIC_ADDR, sizeof(hci_data)); if (buf == NULL) { LOG_ERR("Unable to allocate command buffer"); return -ENOMEM; diff --git a/drivers/bluetooth/hci/hci_nxp.c b/drivers/bluetooth/hci/hci_nxp.c index a540e264ac0..2cd5511e7c7 100644 --- a/drivers/bluetooth/hci/hci_nxp.c +++ b/drivers/bluetooth/hci/hci_nxp.c @@ -94,7 +94,7 @@ static int nxp_bt_send_vs_command(uint16_t opcode, const uint8_t *params, uint8_ struct net_buf *buf; /* Allocate buffer for the hci command */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(opcode, params_len); if (buf == NULL) { LOG_ERR("Unable to allocate command buffer"); return -ENOMEM; diff --git a/drivers/bluetooth/hci/hci_nxp_setup.c b/drivers/bluetooth/hci/hci_nxp_setup.c index a89e1ede677..a217ffc53bd 100644 --- a/drivers/bluetooth/hci/hci_nxp_setup.c +++ b/drivers/bluetooth/hci/hci_nxp_setup.c @@ -1281,7 +1281,7 @@ static int bt_nxp_set_calibration_data_annex55(void) if (IS_ENABLED(CONFIG_BT_HCI_HOST)) { struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(opcode, HCI_CMD_STORE_BT_CAL_DATA_PARAM_LENGTH); if (buf == NULL) { LOG_ERR("Unable to allocate command buffer"); return -ENOMEM; @@ -1346,7 +1346,7 @@ static int bt_nxp_set_calibration_data_annex100(void) if (IS_ENABLED(CONFIG_BT_HCI_HOST)) { struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(opcode, HCI_CMD_STORE_BT_CAL_DATA_PARAM_ANNEX100_LENGTH); if (buf == NULL) { LOG_ERR("Unable to allocate command buffer"); return -ENOMEM; @@ -1387,7 +1387,8 @@ static int bt_hci_baudrate_update(const struct device *dev, uint32_t baudrate) int err; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_VSC_BAUDRATE_UPDATE_OPCODE, + BT_HCI_VSC_BAUDRATE_UPDATE_LENGTH); if (!buf) { LOG_ERR("Fail to allocate buffer"); return -ENOBUFS; diff --git a/drivers/bluetooth/hci/hci_spi_st.c b/drivers/bluetooth/hci/hci_spi_st.c index ebed8ae1ff4..e6201ec0475 100644 --- a/drivers/bluetooth/hci/hci_spi_st.c +++ b/drivers/bluetooth/hci/hci_spi_st.c @@ -335,7 +335,7 @@ static int bt_spi_send_aci_config(uint8_t offset, const uint8_t *value, size_t v hdr.param_len = data_len; buf = bt_buf_get_tx(BT_BUF_CMD, K_NO_WAIT, &hdr, sizeof(hdr)); #else - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BLUENRG_ACI_WRITE_CONFIG_DATA, data_len); #endif /* CONFIG_BT_HCI_RAW */ if (!buf) { diff --git a/drivers/bluetooth/hci/hci_stm32wba.c b/drivers/bluetooth/hci/hci_stm32wba.c index 57bc54c231a..77654e16bea 100644 --- a/drivers/bluetooth/hci/hci_stm32wba.c +++ b/drivers/bluetooth/hci/hci_stm32wba.c @@ -432,7 +432,7 @@ static int bt_hci_stm32wba_setup(const struct device *dev, return -ENOMSG; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(ACI_HAL_WRITE_CONFIG_DATA, sizeof(*param)); if (!buf) { return -ENOBUFS; } diff --git a/drivers/bluetooth/hci/ipm_stm32wb.c b/drivers/bluetooth/hci/ipm_stm32wb.c index 0f61f7c36f7..3e0dee023dc 100644 --- a/drivers/bluetooth/hci/ipm_stm32wb.c +++ b/drivers/bluetooth/hci/ipm_stm32wb.c @@ -433,7 +433,8 @@ static int bt_ipm_set_addr(void) return -ENOMSG; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(ACI_HAL_WRITE_CONFIG_DATA, sizeof(*param)); + if (!buf) { return -ENOBUFS; } @@ -467,7 +468,7 @@ static int bt_ipm_ble_init(void) LOG_ERR("Can't set BLE UID addr"); } /* Send ACI_WRITE_SET_TX_POWER_LEVEL */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(ACI_WRITE_SET_TX_POWER_LEVEL, 3); if (!buf) { return -ENOBUFS; } From aedf76fd793d6b83e0c50cbfe7a1ae020c6693ae Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 555/881] Revert "[nrf fromtree] drivers: bluetooth: add BT-CAL data load for NXP IW612/IW416 SoC" This reverts commit 5a3c2365ad0a6d399b26731b568cc2a1f898d87c. Signed-off-by: Jukka Rissanen --- drivers/bluetooth/hci/Kconfig.nxp | 8 +- drivers/bluetooth/hci/hci_nxp_setup.c | 216 +------------------------- 2 files changed, 7 insertions(+), 217 deletions(-) diff --git a/drivers/bluetooth/hci/Kconfig.nxp b/drivers/bluetooth/hci/Kconfig.nxp index 9fb0850fa8e..1f6983ee989 100644 --- a/drivers/bluetooth/hci/Kconfig.nxp +++ b/drivers/bluetooth/hci/Kconfig.nxp @@ -13,14 +13,14 @@ config HCI_NXP_ENABLE_AUTO_SLEEP message to the Controller as the Host will need to wake it up. config HCI_NXP_SET_CAL_DATA - bool "Bluetooth Controller calibration data" + bool "BLE Controller calibration data" help - If enabled, the Host will send calibration data to the Bluetooth Controller during HCI init. + If enabled, the Host will send calibration data to the BLE Controller during HCI init. config HCI_NXP_SET_CAL_DATA_ANNEX100 - bool "Bluetooth Controller calibration data annex 100" + bool "BLE Controller calibration data annex 100" help - If enabled, the Host will send calibration data annex 100 to the Bluetooth Controller during HCI + If enabled, the Host will send calibration data annex 100 to the BLE Controller during HCI init. config HCI_NXP_RX_THREAD diff --git a/drivers/bluetooth/hci/hci_nxp_setup.c b/drivers/bluetooth/hci/hci_nxp_setup.c index a217ffc53bd..6fa34d0a24e 100644 --- a/drivers/bluetooth/hci/hci_nxp_setup.c +++ b/drivers/bluetooth/hci/hci_nxp_setup.c @@ -29,25 +29,13 @@ LOG_MODULE_REGISTER(bt_nxp_ctlr); #define DT_DRV_COMPAT nxp_bt_hci_uart -#define FW_UPLOAD_CHANGE_TIMEOUT_RETRY_COUNT 6 -#define HCI_CMD_STORE_BT_CAL_DATA_ANNEX100_OCF 0xFF -#define HCI_CMD_STORE_BT_CAL_DATA_PARAM_ANNEX100_LENGTH 16 -#define HCI_CMD_STORE_BT_CAL_DATA_OCF 0x61 -#define HCI_CMD_STORE_BT_CAL_DATA_PARAM_LENGTH 32 +#define FW_UPLOAD_CHANGE_TIMEOUT_RETRY_COUNT 6 extern const unsigned char *bt_fw_bin; extern const unsigned int bt_fw_bin_len; static const struct device *uart_dev = DEVICE_DT_GET(DT_INST_GPARENT(0)); -#if !defined(CONFIG_HCI_NXP_SET_CAL_DATA) -#define bt_nxp_set_calibration_data_annex55() 0 -#endif - -#if !defined(CONFIG_HCI_NXP_SET_CAL_DATA_ANNEX100) -#define bt_nxp_set_calibration_data_annex100() 0 -#endif - #if DT_NODE_HAS_PROP(DT_DRV_INST(0), sdio_reset_gpios) struct gpio_dt_spec sdio_reset = GPIO_DT_SPEC_GET(DT_DRV_INST(0), sdio_reset_gpios); #endif /* DT_NODE_HAS_PROP(DT_DRV_INST(0), sdio_reset_gpios) */ @@ -1183,189 +1171,6 @@ static int bt_nxp_ctlr_init(void) return 0; } -#if defined(CONFIG_HCI_NXP_SET_CAL_DATA) - -static int bt_nxp_set_calibration_data_annex55(void) -{ - int ret = 0; - uint16_t opcode = BT_OP(BT_OGF_VS, HCI_CMD_STORE_BT_CAL_DATA_OCF); - - const uint8_t hci_cal_data_annex55[HCI_CMD_STORE_BT_CAL_DATA_PARAM_LENGTH] = { -#if defined(CONFIG_BT_NXP_NW612) - 0x00, /* Sequence Number : 0x00 */ - 0x01, /* Action : 0x01 */ - 0x01, /* Type : Not use CheckSum */ - 0x1C, /* File Length : 0x1C */ - 0x37, /* BT Annex Type : BT CFG */ - 0x33, /* Checksum : 0x71 */ - 0x1C, /* Annex Length LSB: 0x001C */ - 0x00, /* Annex Length MSB: 0x001C */ - 0x00, /* Pointer For Next Annex[0] : 0x00000000 */ - 0x00, /* Pointer For Next Annex[1] : 0x00000000 */ - 0x00, /* Pointer For Next Annex[2] : 0x00000000 */ - 0x00, /* Pointer For Next Annex[3] : 0x00000000 */ - 0x01, /* Annex Version : 0x01 */ - 0x81, /* External Xtal Calibration Value : 0x7d */ - 0x0D, /* Initial TX Power : 13 */ - 0x07, /* Front End Loss : 0x07 */ - 0x28, /* BT Options : */ - /* BIT[0] Force Class 2 operation = 0 */ - /* BIT[1] Disable Pwr-ctrl for class 2=0 */ - /* BIT[2] MiscFlg(to indicate ext.XTAL)=0 */ - /* BIT[3] Used Internal Sleep Clock = 1 */ - /* BIT[4] BT AOA location support = 0 */ - /* BIT[5] Force Class 1 mode = 1 */ - /* BIT[7:6] Reserved */ - 0x00, /* AOANumberOfAntennas: 0x00 */ - 0x00, /* RSSI Golden Low : 0 */ - 0x00, /* RSSI Golden High : 0 */ - 0xC0, /* UART Baud Rate[0] : 0x002DC6C0(3000000) */ - 0xC6, /* UART Baud Rate[1] : 0x002DC6C0(3000000) */ - 0x2D, /* UART Baud Rate[2] : 0x002DC6C0(3000000) */ - 0x00, /* UART Baud Rate[3] : 0x002DC6C0(3000000) */ - 0x00, /* BdAddress[0] : 0x000000000000 */ - 0x00, /* BdAddress[1] : 0x000000000000 */ - 0x00, /* BdAddress[2] : 0x000000000000 */ - 0x00, /* BdAddress[3] : 0x000000000000 */ - 0x00, /* BdAddress[4] : 0x000000000000 */ - 0x00, /* BdAddress[5] : 0x000000000000 */ - 0xF0, /* Encr_Key_Len[3:0]: MinEncrKeyLen = 0x0 */ - /* ExEncrKeyLen = 0xF */ - 0x00, /* RegionCode : 0x00 */ -#elif defined(CONFIG_BT_NXP_IW416) - 0x00, /* Sequence Number : 0x00 */ - 0x01, /* Action : 0x01 */ - 0x01, /* Type : Not use CheckSum */ - 0x1C, /* File Length : 0x1C */ - 0x37, /* BT Annex Type : BT CFG */ - 0x33, /* Checksum : 0x71 */ - 0x1C, /* Annex Length LSB: 0x001C */ - 0x00, /* Annex Length MSB: 0x001C */ - 0x00, /* Pointer For Next Annex[0] : 0x00000000 */ - 0x00, /* Pointer For Next Annex[1] : 0x00000000 */ - 0x00, /* Pointer For Next Annex[2] : 0x00000000 */ - 0x00, /* Pointer For Next Annex[3] : 0x00000000 */ - 0x01, /* Annex Version : 0x01 */ - 0x00, /* External Xtal Calibration Value */ - 0x03, /* Initial TX Power : 0x03 */ - 0x03, /* Front End Loss : 0x03 */ - 0x00, /* BT Options : */ - /* BIT[0] Force Class 2 operation = 0 */ - /* BIT[1] Disable Pwr Ctrl for class 2=0 */ - /* BIT[2] MiscFlg(to indicate ext.XTAL)=0 */ - /* BIT[3] Used Internal Sleep Clock = 0 */ - /* BIT[4] BT AOA localtion support = 0 */ - /* BIT[5] Force Class 1 mode = 0 */ - /* BIT[7:6] Reserved */ - 0x00, /* AOANumberOfAntennas: 0x00 */ - 0xBA, /* RSSI Golden Low : 0 */ - 0xCE, /* RSSI Golden High : 0 */ - 0xC0, /* UART Baud Rate[0] : 0x002DC6C0(3000000) */ - 0xC6, /* UART Baud Rate[1] : 0x002DC6C0(3000000) */ - 0x2D, /* UART Baud Rate[2] : 0x002DC6C0(3000000) */ - 0x00, /* UART Baud Rate[3] : 0x002DC6C0(3000000) */ - 0x00, /* BdAddress[0] : 0x000000000000 */ - 0x00, /* BdAddress[1] : 0x000000000000 */ - 0x00, /* BdAddress[2] : 0x000000000000 */ - 0x00, /* BdAddress[3] : 0x000000000000 */ - 0x00, /* BdAddress[4] : 0x000000000000 */ - 0x00, /* BdAddress[5] : 0x000000000000 */ - 0xF0, /* Encr_Key_Len[3:0]: MinEncrKeyLen = 0x0 */ - /* ExEncrKeyLen = 0xF */ - 0x00, /* RegionCode : 0x00 */ -#else -#error "BT Calibration data (annex-55) is not given for selected chipset" -#endif - }; - - if (IS_ENABLED(CONFIG_BT_HCI_HOST)) { - struct net_buf *buf; - - buf = bt_hci_cmd_create(opcode, HCI_CMD_STORE_BT_CAL_DATA_PARAM_LENGTH); - if (buf == NULL) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - - net_buf_add_mem(buf, hci_cal_data_annex55, HCI_CMD_STORE_BT_CAL_DATA_PARAM_LENGTH); - - ret = bt_hci_cmd_send_sync(opcode, buf, NULL); - if (ret) { - LOG_ERR("Failed to send set-calibration cmd (err %d)", ret); - return ret; - } - - (void)k_msleep(CONFIG_BT_H4_NXP_CTLR_WAIT_TIME_AFTER_BAUDRATE_UPDATE); - } - - return ret; -} -#endif /*CONFIG_HCI_NXP_SET_CAL_DATA*/ - -#if defined(CONFIG_HCI_NXP_SET_CAL_DATA_ANNEX100) - -static int bt_nxp_set_calibration_data_annex100(void) -{ - int ret = 0; - const uint8_t hci_cal_data_annex100[HCI_CMD_STORE_BT_CAL_DATA_PARAM_ANNEX100_LENGTH] = { -#if defined(CONFIG_BT_NXP_NW612) - 0x64, /* Annex Type : 0x64 */ - 0x83, /* Checksum */ - 0x10, 0x00, /* Length */ - 0x00, 0x00, 0x00, 0x00, /* Pointer for next Annex-Structure */ - 0x01, /* Ext PA Present (1 bit) + */ - /* Ext. PA Gain (7 bits) */ - 0x00, /* Ext Antenna Gain(1 bit) + */ - /* Ext. Antenna Gain Val(4 bits) */ - 0x04, 0x00, /* BT / LE Ext PA FEM CTRL Bitmask */ - 0x01, /* Ext LNA Present (1 bit) + */ - /* Ext LNA Gain (7 bits) */ - 0x00, /* Reserved */ - 0x04, 0x00 /* BT / LE Ext LNA FEM CTRL Bitmask */ -#elif defined(CONFIG_BT_NXP_IW416) - 0x64, /* Annex Type : 0x64 */ - 0x83, /* Checksum */ - 0x10, 0x00, /* Length */ - 0x00, 0x00, 0x00, 0x00, /* Pointer for next Annex-Structure */ - 0x01, /* Ext PA Present (1 bit) + */ - /* Ext. PA Gain (7 bits) */ - 0x00, /* Ext Antenna Gain(1 bit) + */ - /* Ext. Antenna Gain Val (4 bits) */ - 0x0C, 0x00, /* BT / LE Ext PA FEM CTRL Bitmask */ - 0x01, /* Ext LNA Present (1 bit) + */ - /* Ext LNA Gain (7 bits) */ - 0x00, /* Reserved */ - 0x0C, 0x00 /* BT/LE Ext LNA FEM CTRL Bitmask */ -#else -#error "BT Calibration data (annex-100) is not given for selected chipset" -#endif - }; - - uint16_t opcode = BT_OP(BT_OGF_VS, HCI_CMD_STORE_BT_CAL_DATA_ANNEX100_OCF); - - if (IS_ENABLED(CONFIG_BT_HCI_HOST)) { - struct net_buf *buf; - - buf = bt_hci_cmd_create(opcode, HCI_CMD_STORE_BT_CAL_DATA_PARAM_ANNEX100_LENGTH); - if (buf == NULL) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - - net_buf_add_mem(buf, hci_cal_data_annex100, - HCI_CMD_STORE_BT_CAL_DATA_PARAM_ANNEX100_LENGTH); - - ret = bt_hci_cmd_send_sync(opcode, buf, NULL); - if (ret) { - LOG_ERR("Failed to send set-calibration cmd (err %d)", ret); - return ret; - } - } - - return ret; -} -#endif /* defined(CONFIG_HCI_NXP_SET_CAL_DATA_ANNEX100) */ - int bt_hci_transport_setup(const struct device *dev) { int ret = 0; @@ -1426,7 +1231,6 @@ int bt_h4_vnd_setup(const struct device *dev) flowcontrol_of_hci = (bool)DT_PROP_OR(DT_DRV_INST(0), hw_flow_control, false); if (operation_speed == default_speed) { - fw_upload.is_setup_done = true; return 0; } @@ -1436,7 +1240,7 @@ int bt_h4_vnd_setup(const struct device *dev) return err; } - /* BT waiting time after controller bandrate updated */ + /* BT waiting time after controller bandrate updated */ (void)k_msleep(CONFIG_BT_H4_NXP_CTLR_WAIT_TIME_AFTER_BAUDRATE_UPDATE); } @@ -1446,21 +1250,7 @@ int bt_h4_vnd_setup(const struct device *dev) return err; } - if (!fw_upload.is_setup_done) { - err = bt_nxp_set_calibration_data_annex55(); - if (err) { - LOG_ERR("Fail to load annex-55 calibration data"); - return err; - } - - err = bt_nxp_set_calibration_data_annex100(); - if (err) { - LOG_ERR("Fail to load annex-100 calibration data"); - return err; - } - - fw_upload.is_setup_done = true; - } + fw_upload.is_setup_done = true; return 0; } From b590229a86e11ff48226353e56afc331e955953f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 556/881] Revert "[nrf fromlist] settings: Only use mutexes when multithreading is enabled" This reverts commit 96414e4802cb3d4ae08dd497ced5956a1510a502. Signed-off-by: Jukka Rissanen --- subsys/settings/src/settings.c | 23 ++++------------------- subsys/settings/src/settings_init.c | 7 ++++--- subsys/settings/src/settings_priv.h | 6 ------ subsys/settings/src/settings_store.c | 21 +++++++++++---------- 4 files changed, 19 insertions(+), 38 deletions(-) diff --git a/subsys/settings/src/settings.c b/subsys/settings/src/settings.c index 74f97bc79e5..dde6135a411 100644 --- a/subsys/settings/src/settings.c +++ b/subsys/settings/src/settings.c @@ -23,9 +23,8 @@ LOG_MODULE_REGISTER(settings, CONFIG_SETTINGS_LOG_LEVEL); sys_slist_t settings_handlers; #endif /* CONFIG_SETTINGS_DYNAMIC_HANDLERS */ -#ifdef CONFIG_MULTITHREADING -static K_MUTEX_DEFINE(settings_lock); -#endif +K_MUTEX_DEFINE(settings_lock); + void settings_store_init(void); @@ -48,7 +47,7 @@ int settings_register_with_cprio(struct settings_handler *handler, int cprio) } } - settings_lock_take(); + k_mutex_lock(&settings_lock, K_FOREVER); struct settings_handler *ch; SYS_SLIST_FOR_EACH_CONTAINER(&settings_handlers, ch, node) { @@ -62,7 +61,7 @@ int settings_register_with_cprio(struct settings_handler *handler, int cprio) sys_slist_append(&settings_handlers, &handler->node); end: - settings_lock_release(); + k_mutex_unlock(&settings_lock); return rc; } @@ -320,17 +319,3 @@ int settings_commit_subtree(const char *subtree) return rc; } - -void settings_lock_take(void) -{ -#ifdef CONFIG_MULTITHREADING - k_mutex_lock(&settings_lock, K_FOREVER); -#endif -} - -void settings_lock_release(void) -{ -#ifdef CONFIG_MULTITHREADING - k_mutex_unlock(&settings_lock); -#endif -} diff --git a/subsys/settings/src/settings_init.c b/subsys/settings/src/settings_init.c index a77152d712f..7a478c8707b 100644 --- a/subsys/settings/src/settings_init.c +++ b/subsys/settings/src/settings_init.c @@ -14,7 +14,8 @@ #include #include "settings/settings_file.h" #include -#include "settings_priv.h" + +extern struct k_mutex settings_lock; bool settings_subsys_initialized; @@ -27,7 +28,7 @@ int settings_subsys_init(void) int err = 0; - settings_lock_take(); + k_mutex_lock(&settings_lock, K_FOREVER); if (!settings_subsys_initialized) { settings_init(); @@ -39,7 +40,7 @@ int settings_subsys_init(void) } } - settings_lock_release(); + k_mutex_unlock(&settings_lock); return err; } diff --git a/subsys/settings/src/settings_priv.h b/subsys/settings/src/settings_priv.h index 93b47b9b789..b732bcef2d8 100644 --- a/subsys/settings/src/settings_priv.h +++ b/subsys/settings/src/settings_priv.h @@ -111,12 +111,6 @@ extern sys_slist_t settings_load_srcs; extern sys_slist_t settings_handlers; extern struct settings_store *settings_save_dst; -/** Takes the settings mutex lock (if multithreading is enabled) */ -void settings_lock_take(void); - -/** Releases the settings mutex lock (if multithreading is enabled) */ -void settings_lock_release(void); - #ifdef __cplusplus } #endif diff --git a/subsys/settings/src/settings_store.c b/subsys/settings/src/settings_store.c index cb5b8a0e5bd..4dcdb80b78f 100644 --- a/subsys/settings/src/settings_store.c +++ b/subsys/settings/src/settings_store.c @@ -22,6 +22,7 @@ LOG_MODULE_DECLARE(settings, CONFIG_SETTINGS_LOG_LEVEL); sys_slist_t settings_load_srcs; struct settings_store *settings_save_dst; +extern struct k_mutex settings_lock; void settings_src_register(struct settings_store *cs) { @@ -52,12 +53,12 @@ int settings_load_subtree(const char *subtree) * apply config * commit all */ - settings_lock_take(); + k_mutex_lock(&settings_lock, K_FOREVER); SYS_SLIST_FOR_EACH_CONTAINER(&settings_load_srcs, cs, cs_next) { cs->cs_itf->csi_load(cs, &arg); } rc = settings_commit_subtree(subtree); - settings_lock_release(); + k_mutex_unlock(&settings_lock); return rc; } @@ -79,11 +80,11 @@ int settings_load_subtree_direct( * apply config * commit all */ - settings_lock_take(); + k_mutex_lock(&settings_lock, K_FOREVER); SYS_SLIST_FOR_EACH_CONTAINER(&settings_load_srcs, cs, cs_next) { cs->cs_itf->csi_load(cs, &arg); } - settings_lock_release(); + k_mutex_unlock(&settings_lock); return 0; } @@ -143,7 +144,7 @@ ssize_t settings_get_val_len(const char *name) * for every config store that supports this function * get the value's length. */ - settings_lock_take(); + k_mutex_lock(&settings_lock, K_FOREVER); SYS_SLIST_FOR_EACH_CONTAINER(&settings_load_srcs, cs, cs_next) { if (cs->cs_itf->csi_get_val_len) { val_len = cs->cs_itf->csi_get_val_len(cs, name); @@ -156,7 +157,7 @@ ssize_t settings_get_val_len(const char *name) rc = cs->cs_itf->csi_load(cs, &arg); } } - settings_lock_release(); + k_mutex_unlock(&settings_lock); if (rc >= 0) { return val_len; @@ -176,7 +177,7 @@ ssize_t settings_load_one(const char *name, void *buf, size_t buf_len) * For every config store that defines csi_load_one() function use it. * Otherwise, use the csi_load() function to load the key/value pair */ - settings_lock_take(); + k_mutex_lock(&settings_lock, K_FOREVER); SYS_SLIST_FOR_EACH_CONTAINER(&settings_load_srcs, cs, cs_next) { if (cs->cs_itf->csi_load_one) { rc = cs->cs_itf->csi_load_one(cs, name, (char *)buf, buf_len); @@ -195,7 +196,7 @@ ssize_t settings_load_one(const char *name, void *buf, size_t buf_len) rc = cs->cs_itf->csi_load(cs, &arg); } } - settings_lock_release(); + k_mutex_unlock(&settings_lock); if (rc >= 0) { return val_len; @@ -216,11 +217,11 @@ int settings_save_one(const char *name, const void *value, size_t val_len) return -ENOENT; } - settings_lock_take(); + k_mutex_lock(&settings_lock, K_FOREVER); rc = cs->cs_itf->csi_save(cs, name, (char *)value, val_len); - settings_lock_release(); + k_mutex_unlock(&settings_lock); return rc; } From d2c031814f5db8c1748474856037c7ac2aea5fa9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 557/881] Revert "[nrf fromlist] tests: drivers: spi: Add test cases for non standard frequencies." This reverts commit db1ed59e7a9498328e6fdd8d4aea2c846cc3d544. Signed-off-by: Jukka Rissanen --- .../boards/1m333333hz.overlay | 9 --------- .../boards/2m666666hz.overlay | 9 --------- .../spi/spi_controller_peripheral/testcase.yaml | 16 ---------------- 3 files changed, 34 deletions(-) delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/1m333333hz.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/2m666666hz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/1m333333hz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/1m333333hz.overlay deleted file mode 100644 index 5a35648b752..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/1m333333hz.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&dut_spi_dt { - spi-max-frequency = <1333333>; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/2m666666hz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/2m666666hz.overlay deleted file mode 100644 index 642a3e18e95..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/2m666666hz.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&dut_spi_dt { - spi-max-frequency = <2666666>; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index cfcf7c149f0..56f3545235e 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -45,22 +45,6 @@ tests: integration_platforms: - nrf52840dk/nrf52840 - drivers.spi.spi_1M333333Hz: - extra_configs: - - CONFIG_TESTED_SPI_MODE=0 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/1m333333hz.overlay" - integration_platforms: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - drivers.spi.spi_2M666666Hz: - extra_configs: - - CONFIG_TESTED_SPI_MODE=0 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/2m666666hz.overlay" - integration_platforms: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - drivers.spi.spi_4MHz: extra_configs: - CONFIG_TESTED_SPI_MODE=2 From 0288a5e9bf3f14cf431467df82be9d3389ed2753 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 558/881] Revert "[nrf fromlist] drivers: spi: nrfx_spim: Add support for non standard frequencies" This reverts commit a75db6afe2b83976f8baa9a6eaa67fb810ac7403. Signed-off-by: Jukka Rissanen --- drivers/spi/spi_nrfx_spim.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 0646c67b4a3..a5c4e30f190 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -170,14 +170,11 @@ static inline void finalize_spi_transaction(const struct device *dev, bool deact static inline uint32_t get_nrf_spim_frequency(uint32_t frequency) { - if (NRF_SPIM_HAS_PRESCALER) { - return frequency; - } /* Get the highest supported frequency not exceeding the requested one. */ - if (frequency >= MHZ(32) && NRF_SPIM_HAS_32_MHZ_FREQ) { + if (frequency >= MHZ(32) && (NRF_SPIM_HAS_32_MHZ_FREQ || NRF_SPIM_HAS_PRESCALER)) { return MHZ(32); - } else if (frequency >= MHZ(16) && NRF_SPIM_HAS_16_MHZ_FREQ) { + } else if (frequency >= MHZ(16) && (NRF_SPIM_HAS_16_MHZ_FREQ || NRF_SPIM_HAS_PRESCALER)) { return MHZ(16); } else if (frequency >= MHZ(8)) { return MHZ(8); From cf3ba79382c51b2498d802f85cac06df5904575a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 559/881] Revert "[nrf fromlist] drivers: udc_dwc2: Arm control out endpoint in DMA mode" This reverts commit dc8356f2f7a1f2e7fcfd1018154a3dff9030e79d. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index fca8f607ec7..8995ce295e2 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -1753,10 +1753,7 @@ static int udc_dwc2_ep_set_halt(const struct device *dev, if (ep_idx != 0) { cfg->stat.halted = true; } else { - struct udc_dwc2_data *const priv = udc_get_private(dev); - /* Data/Status stage is STALLed, allow receiving next SETUP */ - priv->pending_dout_feed = 0; dwc2_ensure_setup_ready(dev); } @@ -3323,8 +3320,6 @@ static ALWAYS_INLINE void dwc2_thread_handler(void *const arg) if (evt & BIT(DWC2_DRV_EVT_ENUM_DONE)) { k_event_clear(&priv->drv_evt, BIT(DWC2_DRV_EVT_ENUM_DONE)); - /* Any potential transfer on control IN endpoint is cancelled */ - priv->pending_dout_feed = 0; dwc2_ensure_setup_ready(dev); } From 48b33f08cdf7ba0c61af981bc7b91a2aae94bab3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 560/881] Revert "[nrf fromlist] drivers: udc_dwc2: Add nRF54LM20A vendor quirks" This reverts commit e2d2d6ff7435c4f76826c0d11faea6b028f5bf8b. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2_vendor_quirks.h | 198 ----------------------- 1 file changed, 198 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2_vendor_quirks.h b/drivers/usb/udc/udc_dwc2_vendor_quirks.h index 330ff8d113f..f5a70063c2e 100644 --- a/drivers/usb/udc/udc_dwc2_vendor_quirks.h +++ b/drivers/usb/udc/udc_dwc2_vendor_quirks.h @@ -312,204 +312,6 @@ DT_INST_FOREACH_STATUS_OKAY(QUIRK_NRF_USBHS_DEFINE) #endif /*DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_usbhs) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_usbhs_nrf54l) - -#define USBHS_DT_WRAPPER_REG_ADDR(n) UINT_TO_POINTER(DT_INST_REG_ADDR_BY_NAME(n, wrapper)) - -#include -#include -#include -#include - -#define NRF_DEFAULT_IRQ_PRIORITY 1 - -/* - * On USBHS, we cannot access the DWC2 register until VBUS is detected and - * valid. If the user tries to force usbd_enable() and the corresponding - * udc_enable() without a "VBUS ready" notification, the event wait will block - * until a valid VBUS signal is detected or until the - * CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT timeout expires. - */ -static K_EVENT_DEFINE(usbhs_events); -#define USBHS_VBUS_READY BIT(0) - -static struct onoff_manager *pclk24m_mgr; -static struct onoff_client pclk24m_cli; - -static void vregusb_isr(const void *arg) -{ - const struct device *dev = arg; - - if (NRF_VREGUSB->EVENTS_VBUSDETECTED) { - NRF_VREGUSB->EVENTS_VBUSDETECTED = 0; - k_event_post(&usbhs_events, USBHS_VBUS_READY); - udc_submit_event(dev, UDC_EVT_VBUS_READY, 0); - } - - if (NRF_VREGUSB->EVENTS_VBUSREMOVED) { - NRF_VREGUSB->EVENTS_VBUSREMOVED = 0; - k_event_set_masked(&usbhs_events, 0, USBHS_VBUS_READY); - udc_submit_event(dev, UDC_EVT_VBUS_REMOVED, 0); - } -} - -static inline int usbhs_init_vreg_and_clock(const struct device *dev) -{ - IRQ_CONNECT(VREGUSB_IRQn, NRF_DEFAULT_IRQ_PRIORITY, - vregusb_isr, DEVICE_DT_INST_GET(0), 0); - - NRF_VREGUSB->INTEN = VREGUSB_INTEN_VBUSDETECTED_Msk | - VREGUSB_INTEN_VBUSREMOVED_Msk; - NRF_VREGUSB->TASKS_START = 1; - - /* TODO: Determine conditions when VBUSDETECTED is not generated */ - if (sys_read32((mem_addr_t)NRF_VREGUSB + 0x400) & BIT(2)) { - k_event_post(&usbhs_events, USBHS_VBUS_READY); - udc_submit_event(dev, UDC_EVT_VBUS_READY, 0); - } - - irq_enable(VREGUSB_IRQn); - pclk24m_mgr = z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF24M); - - return 0; -} - -static inline int usbhs_enable_core(const struct device *dev) -{ - LOG_MODULE_DECLARE(udc_dwc2, CONFIG_UDC_DRIVER_LOG_LEVEL); - NRF_USBHS_Type *wrapper = USBHS_DT_WRAPPER_REG_ADDR(0); - k_timeout_t timeout = K_FOREVER; - int err; - - if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, K_NO_WAIT)) { - LOG_WRN("VBUS is not ready, block udc_enable()"); - if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, timeout)) { - return -ETIMEDOUT; - } - } - - /* Request PCLK24M using clock control driver */ - sys_notify_init_spinwait(&pclk24m_cli.notify); - err = onoff_request(pclk24m_mgr, &pclk24m_cli); - if (err < 0) { - LOG_ERR("Failed to start PCLK24M %d", err); - return err; - } - - /* Power up peripheral */ - wrapper->ENABLE = USBHS_ENABLE_CORE_Msk; - - /* Set ID to Device and force D+ pull-up off for now */ - wrapper->PHY.OVERRIDEVALUES = (1 << 31); - wrapper->PHY.INPUTOVERRIDE = (1 << 31) | USBHS_PHY_INPUTOVERRIDE_VBUSVALID_Msk; - - /* Release PHY power-on reset */ - wrapper->ENABLE = USBHS_ENABLE_PHY_Msk | USBHS_ENABLE_CORE_Msk; - - /* Wait for PHY clock to start */ - k_busy_wait(45); - - /* Release DWC2 reset */ - wrapper->TASKS_START = 1UL; - - /* Wait for clock to start to avoid hang on too early register read */ - k_busy_wait(1); - - /* DWC2 opmode is now guaranteed to be Non-Driving, allow D+ pull-up to - * become active once driver clears DCTL SftDiscon bit. - */ - wrapper->PHY.INPUTOVERRIDE = (1 << 31); - - return 0; -} - -static inline int usbhs_disable_core(const struct device *dev) -{ - LOG_MODULE_DECLARE(udc_dwc2, CONFIG_UDC_DRIVER_LOG_LEVEL); - NRF_USBHS_Type *wrapper = USBHS_DT_WRAPPER_REG_ADDR(0); - int err; - - /* Set ID to Device and forcefully disable D+ pull-up */ - wrapper->PHY.OVERRIDEVALUES = (1 << 31); - wrapper->PHY.INPUTOVERRIDE = (1 << 31) | USBHS_PHY_INPUTOVERRIDE_VBUSVALID_Msk; - - wrapper->ENABLE = 0UL; - - /* Release PCLK24M using clock control driver */ - err = onoff_cancel_or_release(pclk24m_mgr, &pclk24m_cli); - if (err < 0) { - LOG_ERR("Failed to stop PCLK24M %d", err); - return err; - } - - return 0; -} - -static inline int usbhs_disable_vreg(const struct device *dev) -{ - NRF_VREGUSB->INTEN = 0; - NRF_VREGUSB->TASKS_STOP = 1; - - return 0; -} - -static inline int usbhs_init_caps(const struct device *dev) -{ - struct udc_data *data = dev->data; - - data->caps.can_detect_vbus = true; - data->caps.hs = true; - - return 0; -} - -static inline int usbhs_is_phy_clk_off(const struct device *dev) -{ - return !k_event_test(&usbhs_events, USBHS_VBUS_READY); -} - -static inline int usbhs_post_hibernation_entry(const struct device *dev) -{ - const struct udc_dwc2_config *const config = dev->config; - struct usb_dwc2_reg *const base = config->base; - NRF_USBHS_Type *wrapper = USBHS_DT_WRAPPER_REG_ADDR(0); - - sys_set_bits((mem_addr_t)&base->pcgcctl, USB_DWC2_PCGCCTL_GATEHCLK); - - wrapper->TASKS_STOP = 1; - - return 0; -} - -static inline int usbhs_pre_hibernation_exit(const struct device *dev) -{ - const struct udc_dwc2_config *const config = dev->config; - struct usb_dwc2_reg *const base = config->base; - NRF_USBHS_Type *wrapper = USBHS_DT_WRAPPER_REG_ADDR(0); - - sys_clear_bits((mem_addr_t)&base->pcgcctl, USB_DWC2_PCGCCTL_GATEHCLK); - - wrapper->TASKS_START = 1; - - return 0; -} - -#define QUIRK_NRF_USBHS_DEFINE(n) \ - struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \ - .init = usbhs_init_vreg_and_clock, \ - .pre_enable = usbhs_enable_core, \ - .disable = usbhs_disable_core, \ - .shutdown = usbhs_disable_vreg, \ - .caps = usbhs_init_caps, \ - .is_phy_clk_off = usbhs_is_phy_clk_off, \ - .post_hibernation_entry = usbhs_post_hibernation_entry, \ - .pre_hibernation_exit = usbhs_pre_hibernation_exit, \ - }; - -DT_INST_FOREACH_STATUS_OKAY(QUIRK_NRF_USBHS_DEFINE) - -#endif /*DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_usbhs_nrf54l) */ - /* Add next vendor quirks definition above this line */ #endif /* ZEPHYR_DRIVERS_USB_UDC_DWC2_VENDOR_QUIRKS_H */ From a344b450bd8b9fc50b0978e4ace558c503dd50d5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 561/881] Revert "[nrf fromtree] drivers: udc_dwc2: Set EP0 IN CNAK only when necessary" This reverts commit a536263ad8e0b09ad1c11d9cdba10a17d4f31a71. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 72 ++++---------------------------------- 1 file changed, 6 insertions(+), 66 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 8995ce295e2..5a47a23294c 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -139,7 +139,6 @@ struct udc_dwc2_data { unsigned int hibernated : 1; unsigned int enumdone : 1; unsigned int enumspd : 2; - unsigned int pending_dout_feed : 1; enum dwc2_suspend_type suspend_type; /* Number of endpoints including control endpoint */ uint8_t numdeveps; @@ -429,28 +428,10 @@ static void dwc2_ensure_setup_ready(const struct device *dev) if (dwc2_in_completer_mode(dev)) { /* In Completer mode EP0 can always receive SETUP data */ return; - } else { - struct udc_dwc2_data *const priv = udc_get_private(dev); - - /* Enable EP0 OUT only if there is no pending EP0 IN transfer - * after which the stack has to enable EP0 OUT. - */ - if (!priv->pending_dout_feed) { - dwc2_ctrl_feed_dout(dev, 8); - } } -} -static void dwc2_clear_control_in_nak(const struct device *dev) -{ - struct usb_dwc2_reg *const base = dwc2_get_base(dev); - mem_addr_t diepctl_reg = (mem_addr_t)&base->in_ep[0].diepctl; - uint32_t diepctl = sys_read32(diepctl_reg); - - if (diepctl & USB_DWC2_DEPCTL_NAKSTS) { - diepctl &= ~USB_DWC2_DEPCTL_EPENA; - diepctl |= USB_DWC2_DEPCTL_CNAK; - sys_write32(diepctl, diepctl_reg); + if (!udc_buf_peek(udc_get_ep_cfg(dev, USB_CONTROL_EP_IN))) { + dwc2_ctrl_feed_dout(dev, 8); } } @@ -609,11 +590,7 @@ static int dwc2_tx_fifo_write(const struct device *dev, } /* Clear NAK and set endpoint enable */ - diepctl |= USB_DWC2_DEPCTL_EPENA; - if (cfg->addr != USB_CONTROL_EP_IN) { - /* Non-control endpoint, set CNAK for all transfers */ - diepctl |= USB_DWC2_DEPCTL_CNAK; - } + diepctl |= USB_DWC2_DEPCTL_EPENA | USB_DWC2_DEPCTL_CNAK; sys_write32(diepctl, diepctl_reg); /* Clear IN Endpoint NAK Effective interrupt in case it was set */ @@ -799,7 +776,6 @@ static void dwc2_prep_rx(const struct device *dev, struct net_buf *buf, static void dwc2_handle_xfer_next(const struct device *dev, struct udc_ep_config *const cfg) { - struct udc_dwc2_data *const priv = udc_get_private(dev); struct net_buf *buf; buf = udc_buf_peek(cfg); @@ -827,8 +803,7 @@ static void dwc2_handle_xfer_next(const struct device *dev, * avoid race condition where the next Control Write * Transfer Data Stage is received into the buffer. */ - if (dwc2_in_buffer_dma_mode(dev) && priv->pending_dout_feed) { - priv->pending_dout_feed = 0; + if (dwc2_in_buffer_dma_mode(dev)) { dwc2_ctrl_feed_dout(dev, 8); } } @@ -897,19 +872,6 @@ static int dwc2_handle_evt_setup(const struct device *dev) /* Allocate and feed buffer for data OUT stage */ LOG_DBG("s:%p|feed for -out-", buf); - priv->pending_dout_feed = 0; - - if (dwc2_in_completer_mode(dev)) { - /* Programming Guide does not clearly describe to clear - * control IN endpoint NAK for Control Write Transfers - * when operating in Completer mode. Set CNAK here, - * because IN endpoint is not armed at this point and - * forced NAKs are not necessary. IN Status stage will - * only finish after IN endpoint is armed. - */ - dwc2_clear_control_in_nak(dev); - } - err = dwc2_ctrl_feed_dout(dev, udc_data_stage_length(buf)); if (err == -ENOMEM) { err = udc_submit_ep_event(dev, buf, err); @@ -917,19 +879,11 @@ static int dwc2_handle_evt_setup(const struct device *dev) } else if (udc_ctrl_stage_is_data_in(dev)) { LOG_DBG("s:%p|feed for -in-status", buf); - dwc2_clear_control_in_nak(dev); - err = udc_ctrl_submit_s_in_status(dev); - - priv->pending_dout_feed = 1; } else { LOG_DBG("s:%p|feed >setup", buf); - dwc2_clear_control_in_nak(dev); - err = udc_ctrl_submit_s_status(dev); - - priv->pending_dout_feed = 1; } return err; @@ -938,7 +892,6 @@ static int dwc2_handle_evt_setup(const struct device *dev) static inline int dwc2_handle_evt_dout(const struct device *dev, struct udc_ep_config *const cfg) { - struct udc_dwc2_data *const priv = udc_get_private(dev); struct udc_data *data = dev->data; struct net_buf *buf; int err = 0; @@ -971,8 +924,6 @@ static inline int dwc2_handle_evt_dout(const struct device *dev, if (udc_ctrl_stage_is_status_in(dev)) { err = udc_ctrl_submit_s_out_status(dev, buf); - - priv->pending_dout_feed = 1; } if (data->stage == CTRL_PIPE_STAGE_ERROR) { @@ -1672,15 +1623,6 @@ static void udc_dwc2_ep_disable(const struct device *dev, /* For IN endpoints STALL is set in addition to SNAK */ dxepctl |= USB_DWC2_DEPCTL_STALL; } - - /* EP0 status stage enabled, but CNAK not yet written. - * Set EPDIS to prevent timeout. - */ - if ((dxepctl & USB_DWC2_DEPCTL_NAKSTS) && - (dxepctl & USB_DWC2_DEPCTL_EPENA)) { - dxepctl |= USB_DWC2_DEPCTL_EPDIS; - } - sys_write32(dxepctl, dxepctl_reg); /* Endpoint gets disabled in INEPNAKEFF handler */ @@ -2809,15 +2751,13 @@ static inline void dwc2_handle_oepint(const struct device *dev) } if (status & USB_DWC2_DOEPINT_STSPHSERCVD) { - /* Allow IN Status stage after control transfer with - * data stage from device to host. Clear the CNAK and - * this interrupt bit is mandatory in Buffer DMA mode. + /* Driver doesn't need any special handling, but it is + * mandatory that the bit is cleared in Buffer DMA mode. * If the bit is not cleared (i.e. when this interrupt * bit is masked), then SETUP interrupts will cease * after first control transfer with data stage from * device to host. */ - dwc2_clear_control_in_nak(dev); } if (status & USB_DWC2_DOEPINT_XFERCOMPL) { From 34d6b04571587d9f6df1e5518744ac93459488a1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 562/881] Revert "[nrf fromtree] drivers: clock_control: nrf: add support for HFCLK24M" This reverts commit 22814fb13bf17cd999ab26035bd150e842de1a83. Signed-off-by: Jukka Rissanen --- drivers/clock_control/clock_control_nrf.c | 25 +------------------ .../drivers/clock_control/nrf_clock_control.h | 5 ---- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf.c b/drivers/clock_control/clock_control_nrf.c index 3d5d0951d32..d148cd49e4e 100644 --- a/drivers/clock_control/clock_control_nrf.c +++ b/drivers/clock_control/clock_control_nrf.c @@ -329,18 +329,6 @@ static void hfclk_stop(void) nrfx_clock_hfclk_stop(); } -#if NRF_CLOCK_HAS_HFCLK24M -static void hfclk24m_start(void) -{ - nrfx_clock_start(NRF_CLOCK_DOMAIN_HFCLK24M); -} - -static void hfclk24m_stop(void) -{ - nrfx_clock_stop(NRF_CLOCK_DOMAIN_HFCLK24M); -} -#endif - #if NRF_CLOCK_HAS_HFCLK192M static void hfclk192m_start(void) { @@ -726,11 +714,7 @@ static void clock_event_handler(nrfx_clock_evt_type_t event) break; } #endif -#if NRF_CLOCK_HAS_HFCLK24M - case NRFX_CLOCK_EVT_HFCLK24M_STARTED: - clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK24M); - break; -#endif + #if NRF_CLOCK_HAS_HFCLK192M case NRFX_CLOCK_EVT_HFCLK192M_STARTED: clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK192M); @@ -859,13 +843,6 @@ static const struct nrf_clock_control_config config = { .stop = lfclk_stop, IF_ENABLED(CONFIG_LOG, (.name = "lfclk",)) }, -#if NRF_CLOCK_HAS_HFCLK24M - [CLOCK_CONTROL_NRF_TYPE_HFCLK24M] = { - .start = hfclk24m_start, - .stop = hfclk24m_stop, - IF_ENABLED(CONFIG_LOG, (.name = "hfclk24m",)) - }, -#endif #if NRF_CLOCK_HAS_HFCLK192M [CLOCK_CONTROL_NRF_TYPE_HFCLK192M] = { .start = hfclk192m_start, diff --git a/include/zephyr/drivers/clock_control/nrf_clock_control.h b/include/zephyr/drivers/clock_control/nrf_clock_control.h index 31c1dea047b..f407be61d4d 100644 --- a/include/zephyr/drivers/clock_control/nrf_clock_control.h +++ b/include/zephyr/drivers/clock_control/nrf_clock_control.h @@ -27,9 +27,6 @@ extern "C" { enum clock_control_nrf_type { CLOCK_CONTROL_NRF_TYPE_HFCLK, CLOCK_CONTROL_NRF_TYPE_LFCLK, -#if NRF_CLOCK_HAS_HFCLK24M - CLOCK_CONTROL_NRF_TYPE_HFCLK24M, -#endif #if NRF_CLOCK_HAS_HFCLK192M CLOCK_CONTROL_NRF_TYPE_HFCLK192M, #endif @@ -46,8 +43,6 @@ enum clock_control_nrf_type { ((clock_control_subsys_t)CLOCK_CONTROL_NRF_TYPE_HFCLK) #define CLOCK_CONTROL_NRF_SUBSYS_LF \ ((clock_control_subsys_t)CLOCK_CONTROL_NRF_TYPE_LFCLK) -#define CLOCK_CONTROL_NRF_SUBSYS_HF24M \ - ((clock_control_subsys_t)CLOCK_CONTROL_NRF_TYPE_HFCLK24M) #define CLOCK_CONTROL_NRF_SUBSYS_HF192M \ ((clock_control_subsys_t)CLOCK_CONTROL_NRF_TYPE_HFCLK192M) #define CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO \ From 27757b32333a06afad3325c3e04be79114ab7802 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 563/881] Revert "[nrf fromtree] usb: hid: Define sensor page usages IDs" This reverts commit da8201be36b725769def0f7fa11267d05ac110b2. Signed-off-by: Jukka Rissanen --- include/zephyr/usb/class/hid.h | 49 +--------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/include/zephyr/usb/class/hid.h b/include/zephyr/usb/class/hid.h index c9561e750c7..96bb8271ed7 100644 --- a/include/zephyr/usb/class/hid.h +++ b/include/zephyr/usb/class/hid.h @@ -141,8 +141,6 @@ extern "C" { #define HID_USAGE_GEN_LEDS 0x08 /** HID Button Usage page */ #define HID_USAGE_GEN_BUTTON 0x09 -/** HID Sensors Usage page */ -#define HID_USAGE_SENSORS 0x20 /** HID Generic Desktop Undefined Usage ID */ #define HID_USAGE_GEN_DESKTOP_UNDEFINED 0x00 @@ -165,33 +163,6 @@ extern "C" { /** HID Generic Desktop Wheel Usage ID */ #define HID_USAGE_GEN_DESKTOP_WHEEL 0x38 -/** HID Sensors Collection Usage ID */ -#define HID_USAGE_SENSOR_TYPE_COLLECTION 0x001 -/** HID Sensors Environmental Temperature Type Usage ID */ -#define HID_USAGE_SENSORS_TYPE_ENVIRONMENTAL_TEMPERATURE 0x033 -/** HID Sensors Event Sensor State Usage ID */ -#define HID_USAGE_SENSORS_EVENT_SENSOR_STATE 0x201 -/** HID Sensors Friendly Name Property Usage ID */ -#define HID_USAGE_SENSORS_PROPERTY_FRIENDLY_NAME 0x301 -/** HID Sensors Enviromental Temperature Data Usage ID */ -#define HID_USAGE_SENSORS_DATA_ENVIRONMENTAL_TEMPERATURE 0x434 -/** HID Sensors Timestamp Property Usage ID */ -#define HID_USAGE_SENSORS_PROPERTY_TIMESTAMP 0x529 -/** HID Sensors Sensor State Undefined Usage ID */ -#define HID_USAGE_SENSORS_SENSOR_STATE_UNDEFINED 0x800 -/** HID Sensors Sensor State Ready Usage ID */ -#define HID_USAGE_SENSORS_SENSOR_STATE_READY 0x801 -/** HID Sensors Sensor State Not Available Usage ID */ -#define HID_USAGE_SENSORS_SENSOR_STATE_NOT_AVAILABLE 0x802 -/** HID Sensors Sensor State No Data Usage ID */ -#define HID_USAGE_SENSORS_SENSOR_STATE_NO_DATA 0x803 -/** HID Sensors Sensor State Initializing Usage ID */ -#define HID_USAGE_SENSORS_SENSOR_STATE_INITIALIZING 0x804 -/** HID Sensors Sensor State Access Denied Usage ID */ -#define HID_USAGE_SENSORS_SENSOR_STATE_ACCESS_DENIED 0x805 -/** HID Sensors Sensor State Error Usage ID */ -#define HID_USAGE_SENSORS_SENSOR_STATE_ERROR 0x806 - /** * @} */ @@ -386,21 +357,12 @@ extern "C" { * For usage examples, see @ref HID_MOUSE_REPORT_DESC(), * @ref HID_KEYBOARD_REPORT_DESC() * - * @param idx HID Usage ID per the HID Usage Table + * @param idx Number of data fields included in the report * @return HID Usage Index item */ #define HID_USAGE(idx) \ HID_ITEM(HID_ITEM_TAG_USAGE, HID_ITEM_TYPE_LOCAL, 1), idx -/** - * @brief Define HID Usage Index item with the data length of two bytes. - * - * @param idx HID Usage ID per the HID Usage Table - * @return HID Usage Index item - */ -#define HID_USAGE16(idx) \ - HID_ITEM(HID_ITEM_TAG_USAGE, HID_ITEM_TYPE_LOCAL, 2), (uint8_t)idx, (idx >> 8) - /** * @brief Define HID Usage Minimum item with the data length of one byte. * @@ -451,15 +413,6 @@ extern "C" { #define HID_USAGE_MAX16(a, b) \ HID_ITEM(HID_ITEM_TAG_USAGE_MAX, HID_ITEM_TYPE_LOCAL, 2), a, b -/** - * @brief Define HID Unit Exponent item. - * - * @param exp Unit exponent, refer to the HID Unit Exponent table - * in the specification for usage - * @return HID Unit Exponent item - */ -#define HID_UNIT_EXPONENT(exp) HID_ITEM(HID_ITEM_TAG_UNIT_EXPONENT, HID_ITEM_TYPE_GLOBAL, 1), exp - /** * @} */ From 961c4fdb8da5bc47d84fb68c80ab191923e7bb52 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:28 +0300 Subject: [PATCH 564/881] Revert "[nrf fromtree] usb: device_next: uac2: support higher bInterval values" This reverts commit 254f1019ad0bb6c9fe93fbd564fd644768f1e101. Signed-off-by: Jukka Rissanen --- .../usb/uac2/zephyr,uac2-audio-streaming.yaml | 8 -------- .../usb/device_next/class/usbd_uac2_macros.h | 20 ++++++------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/dts/bindings/usb/uac2/zephyr,uac2-audio-streaming.yaml b/dts/bindings/usb/uac2/zephyr,uac2-audio-streaming.yaml index d1742344855..6e661d1c73d 100644 --- a/dts/bindings/usb/uac2/zephyr,uac2-audio-streaming.yaml +++ b/dts/bindings/usb/uac2/zephyr,uac2-audio-streaming.yaml @@ -78,11 +78,3 @@ properties: type: int description: | Number of effectively used bits in audio subslot. - - polling-period-us: - type: int - description: | - Input or output endpoint polling period in microseconds. For USB full - speed this could be clamped to 1ms or 32768ms depending on the value. For - USB high speed this could be clamped to 125us or 4096ms depending on the - value. diff --git a/subsys/usb/device_next/class/usbd_uac2_macros.h b/subsys/usb/device_next/class/usbd_uac2_macros.h index bd83a3c42a2..a31278d9cf8 100644 --- a/subsys/usb/device_next/class/usbd_uac2_macros.h +++ b/subsys/usb/device_next/class/usbd_uac2_macros.h @@ -707,22 +707,14 @@ #define AS_BYTES_PER_SAMPLE(node) \ DT_PROP(node, subslot_size) -#define AS_FS_DATA_EP_BINTERVAL(node) \ - USB_FS_ISO_EP_INTERVAL(DT_PROP_OR(node, polling_period_us, 1000)) - -#define AS_HS_DATA_EP_BINTERVAL(node) \ - USB_HS_ISO_EP_INTERVAL(DT_PROP_OR(node, polling_period_us, 125)) - /* Asynchronous endpoints needs space for 1 extra sample */ #define AS_SAMPLES_PER_FRAME(node) \ - (((ROUND_UP(AS_CLK_MAX_FREQUENCY(node), 1000) / 1000) \ - << (AS_FS_DATA_EP_BINTERVAL(node) - 1)) + \ - UTIL_NOT(AS_IS_SOF_SYNCHRONIZED(node))) + ((ROUND_UP(AS_CLK_MAX_FREQUENCY(node), 1000) / 1000) + \ + UTIL_NOT(AS_IS_SOF_SYNCHRONIZED(node))) #define AS_SAMPLES_PER_MICROFRAME(node) \ - (((ROUND_UP(AS_CLK_MAX_FREQUENCY(node), 8000) / 8000) \ - << (AS_HS_DATA_EP_BINTERVAL(node) - 1)) + \ - UTIL_NOT(AS_IS_SOF_SYNCHRONIZED(node))) + ((ROUND_UP(AS_CLK_MAX_FREQUENCY(node), 8000) / 8000) + \ + UTIL_NOT(AS_IS_SOF_SYNCHRONIZED(node))) #define AS_DATA_EP_SYNC_TYPE(node) \ COND_CODE_1(AS_IS_SOF_SYNCHRONIZED(node), (0x3 << 2), (0x1 << 2)) @@ -753,7 +745,7 @@ AS_DATA_EP_ADDR(node), /* bEndpointAddress */ \ AS_DATA_EP_ATTR(node), /* bmAttributes */ \ U16_LE(AS_FS_DATA_EP_MAX_PACKET_SIZE(node)), /* wMaxPacketSize */ \ - AS_FS_DATA_EP_BINTERVAL(node), /* bInterval */ + 0x01, /* bInterval */ #define AS_ISOCHRONOUS_DATA_ENDPOINT_FS_DESCRIPTORS_ARRAYS(node) \ static uint8_t DESCRIPTOR_NAME(fs_std_data_ep, node)[] = { \ @@ -766,7 +758,7 @@ AS_DATA_EP_ADDR(node), /* bEndpointAddress */ \ AS_DATA_EP_ATTR(node), /* bmAttributes */ \ U16_LE(AS_HS_DATA_EP_MAX_PACKET_SIZE(node)), /* wMaxPacketSize */ \ - AS_HS_DATA_EP_BINTERVAL(node), /* bInterval */ + 0x01, /* bInterval */ #define AS_ISOCHRONOUS_DATA_ENDPOINT_HS_DESCRIPTORS_ARRAYS(node) \ static uint8_t DESCRIPTOR_NAME(hs_std_data_ep, node)[] = { \ From e8d0f75f50acaddaeb5a8bf4936748aadf822632 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 565/881] Revert "[nrf fromtree] include: usb_ch9: fix USB_FS_ISO_EP_INTERVAL calculation" This reverts commit 45800f7e4d9ce35db917872b53dd6b794daced46. Signed-off-by: Jukka Rissanen --- include/zephyr/usb/usb_ch9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/usb/usb_ch9.h b/include/zephyr/usb/usb_ch9.h index 0c4a3ac0608..8ecadf64bd8 100644 --- a/include/zephyr/usb/usb_ch9.h +++ b/include/zephyr/usb/usb_ch9.h @@ -354,8 +354,8 @@ struct usb_association_descriptor { /** Calculate high speed interrupt endpoint bInterval from a value in microseconds */ #define USB_HS_INT_EP_INTERVAL(us) CLAMP((ilog2((us) / 125U) + 1U), 1U, 16U) -/** Calculate full speed isochronous endpoint bInterval from a value in microseconds */ -#define USB_FS_ISO_EP_INTERVAL(us) CLAMP((ilog2((us) / 1000U) + 1U), 1U, 16U) +/** Calculate high speed isochronous endpoint bInterval from a value in microseconds */ +#define USB_FS_ISO_EP_INTERVAL(us) CLAMP(((us) / 1000U), 1U, 16U) /** Calculate high speed isochronous endpoint bInterval from a value in microseconds */ #define USB_HS_ISO_EP_INTERVAL(us) CLAMP((ilog2((us) / 125U) + 1U), 1U, 16U) From e2c985b4f66ab20c7bffd9eb8a43de635130d53d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 566/881] Revert "[nrf fromtree] include: kernel: add macros to enable allocation from specific sections" This reverts commit a16e4ca655e5a04b30f58e0dc54aa1810d5c2db1. Signed-off-by: Jukka Rissanen --- include/zephyr/kernel.h | 84 ++++++++--------------------------------- 1 file changed, 15 insertions(+), 69 deletions(-) diff --git a/include/zephyr/kernel.h b/include/zephyr/kernel.h index e7968bd2f85..a407678bcaa 100644 --- a/include/zephyr/kernel.h +++ b/include/zephyr/kernel.h @@ -5440,41 +5440,6 @@ struct k_mem_slab { * @{ */ -/** - * @brief Statically define and initialize a memory slab in a user-provided memory section with - * public (non-static) scope. - * - * The memory slab's buffer contains @a slab_num_blocks memory blocks - * that are @a slab_block_size bytes long. The buffer is aligned to a - * @a slab_align -byte boundary. To ensure that each memory block is similarly - * aligned to this boundary, @a slab_block_size must also be a multiple of - * @a slab_align. - * - * The memory slab can be accessed outside the module where it is defined - * using: - * - * @code extern struct k_mem_slab ; @endcode - * - * @note This macro cannot be used together with a static keyword. - * If such a use-case is desired, use @ref K_MEM_SLAB_DEFINE_IN_SECT_STATIC - * instead. - * - * @param name Name of the memory slab. - * @param in_section Section attribute specifier such as Z_GENERIC_SECTION. - * @param slab_block_size Size of each memory block (in bytes). - * @param slab_num_blocks Number memory blocks. - * @param slab_align Alignment of the memory slab's buffer (power of 2). - */ -#define K_MEM_SLAB_DEFINE_IN_SECT(name, in_section, slab_block_size, slab_num_blocks, slab_align) \ - BUILD_ASSERT(((slab_block_size) % (slab_align)) == 0, \ - "slab_block_size must be a multiple of slab_align"); \ - BUILD_ASSERT((((slab_align) & ((slab_align) - 1)) == 0), \ - "slab_align must be a power of 2"); \ - char in_section __aligned(WB_UP( \ - slab_align)) _k_mem_slab_buf_##name[(slab_num_blocks) * WB_UP(slab_block_size)]; \ - STRUCT_SECTION_ITERABLE(k_mem_slab, name) = Z_MEM_SLAB_INITIALIZER( \ - name, _k_mem_slab_buf_##name, WB_UP(slab_block_size), slab_num_blocks) - /** * @brief Statically define and initialize a memory slab in a public (non-static) scope. * @@ -5498,36 +5463,13 @@ struct k_mem_slab { * @param slab_num_blocks Number memory blocks. * @param slab_align Alignment of the memory slab's buffer (power of 2). */ -#define K_MEM_SLAB_DEFINE(name, slab_block_size, slab_num_blocks, slab_align) \ - K_MEM_SLAB_DEFINE_IN_SECT(name, __noinit_named(k_mem_slab_buf_##name), slab_block_size, \ - slab_num_blocks, slab_align) - -/** - * @brief Statically define and initialize a memory slab in a user-provided memory section with - * private (static) scope. - * - * The memory slab's buffer contains @a slab_num_blocks memory blocks - * that are @a slab_block_size bytes long. The buffer is aligned to a - * @a slab_align -byte boundary. To ensure that each memory block is similarly - * aligned to this boundary, @a slab_block_size must also be a multiple of - * @a slab_align. - * - * @param name Name of the memory slab. - * @param in_section Section attribute specifier such as Z_GENERIC_SECTION. - * @param slab_block_size Size of each memory block (in bytes). - * @param slab_num_blocks Number memory blocks. - * @param slab_align Alignment of the memory slab's buffer (power of 2). - */ -#define K_MEM_SLAB_DEFINE_IN_SECT_STATIC(name, in_section, slab_block_size, slab_num_blocks, \ - slab_align) \ - BUILD_ASSERT(((slab_block_size) % (slab_align)) == 0, \ - "slab_block_size must be a multiple of slab_align"); \ - BUILD_ASSERT((((slab_align) & ((slab_align) - 1)) == 0), \ - "slab_align must be a power of 2"); \ - static char in_section __aligned(WB_UP( \ - slab_align)) _k_mem_slab_buf_##name[(slab_num_blocks) * WB_UP(slab_block_size)]; \ - static STRUCT_SECTION_ITERABLE(k_mem_slab, name) = Z_MEM_SLAB_INITIALIZER( \ - name, _k_mem_slab_buf_##name, WB_UP(slab_block_size), slab_num_blocks) +#define K_MEM_SLAB_DEFINE(name, slab_block_size, slab_num_blocks, slab_align) \ + char __noinit_named(k_mem_slab_buf_##name) \ + __aligned(WB_UP(slab_align)) \ + _k_mem_slab_buf_##name[(slab_num_blocks) * WB_UP(slab_block_size)]; \ + STRUCT_SECTION_ITERABLE(k_mem_slab, name) = \ + Z_MEM_SLAB_INITIALIZER(name, _k_mem_slab_buf_##name, \ + WB_UP(slab_block_size), slab_num_blocks) /** * @brief Statically define and initialize a memory slab in a private (static) scope. @@ -5543,9 +5485,13 @@ struct k_mem_slab { * @param slab_num_blocks Number memory blocks. * @param slab_align Alignment of the memory slab's buffer (power of 2). */ -#define K_MEM_SLAB_DEFINE_STATIC(name, slab_block_size, slab_num_blocks, slab_align) \ - K_MEM_SLAB_DEFINE_IN_SECT_STATIC(name, __noinit_named(k_mem_slab_buf_##name), \ - slab_block_size, slab_num_blocks, slab_align) +#define K_MEM_SLAB_DEFINE_STATIC(name, slab_block_size, slab_num_blocks, slab_align) \ + static char __noinit_named(k_mem_slab_buf_##name) \ + __aligned(WB_UP(slab_align)) \ + _k_mem_slab_buf_##name[(slab_num_blocks) * WB_UP(slab_block_size)]; \ + static STRUCT_SECTION_ITERABLE(k_mem_slab, name) = \ + Z_MEM_SLAB_INITIALIZER(name, _k_mem_slab_buf_##name, \ + WB_UP(slab_block_size), slab_num_blocks) /** * @brief Initialize a memory slab. @@ -5844,7 +5790,7 @@ void k_heap_free(struct k_heap *h, void *mem) __attribute_nonnull(1); * * @param name Symbol name for the struct k_heap object * @param bytes Size of memory region, in bytes - * @param in_section Section attribute specifier such as Z_GENERIC_SECTION. + * @param in_section __attribute__((section(name)) */ #define Z_HEAP_DEFINE_IN_SECT(name, bytes, in_section) \ char in_section \ From 867b35855f8ffa51fad20a9dac66349136382f86 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 567/881] Revert "[nrf fromtree] drivers: udc_dwc2: do not throw error when FIFO settings can be reused" This reverts commit a35a0bb0c2519a9921b4f6a396886a85b2c953f1. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 5a47a23294c..09ed5aaa014 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -1328,6 +1328,12 @@ static int dwc2_set_dedicated_fifo(const struct device *dev, dwc2_unset_unused_fifo(dev); } + if (priv->txf_set & ~BIT_MASK(ep_idx)) { + LOG_WRN("Some of the FIFOs higher than %u are set, %lx", + ep_idx, priv->txf_set & ~BIT_MASK(ep_idx)); + return -EIO; + } + if ((ep_idx - 1) != 0U) { txfaddr = dwc2_get_txfdep(dev, ep_idx - 2) + dwc2_get_txfaddr(dev, ep_idx - 2); @@ -1336,21 +1342,8 @@ static int dwc2_set_dedicated_fifo(const struct device *dev, MIN(UDC_DWC2_FIFO0_DEPTH, priv->max_txfifo_depth[0]); } - if (priv->txf_set & BIT(ep_idx)) { - uint32_t curaddr; - - curaddr = dwc2_get_txfaddr(dev, ep_idx - 1); - txfdep = dwc2_get_txfdep(dev, ep_idx - 1); - if (txfaddr != curaddr || reqdep > txfdep) { - LOG_ERR("FIFO%u cannot be reused, new addr 0x%04x depth %u", - ep_idx, txfaddr, reqdep); - return -ENOMEM; - } - } else { - txfdep = reqdep; - } - /* Make sure to not set TxFIFO greater than hardware allows */ + txfdep = reqdep; if (txfdep > priv->max_txfifo_depth[ep_idx]) { return -ENOMEM; } From c916e50ecf37ceacc18826286926e158b3641e92 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 568/881] Revert "[nrf fromtree] usb: device_next: uac2: Do not leak double buffered endpoint" This reverts commit ab18a04cfb8d294e15b3e075a04f9d2d10d9f66c. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/class/usbd_uac2.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_uac2.c b/subsys/usb/device_next/class/usbd_uac2.c index efa3fd6cdf3..2e55a9a017a 100644 --- a/subsys/usb/device_next/class/usbd_uac2.c +++ b/subsys/usb/device_next/class/usbd_uac2.c @@ -816,9 +816,6 @@ static int uac2_request(struct usbd_class_data *const c_data, struct net_buf *bu ctx->user_data); } else if (!is_feedback) { ctx->ops->buf_release_cb(dev, terminal, buf->__buf, ctx->user_data); - if (buf->frags) { - ctx->ops->buf_release_cb(dev, terminal, buf->frags->__buf, ctx->user_data); - } } usbd_ep_buf_free(uds_ctx, buf); From 90547d3b31f8e948beaa65cfbc62e1cb64889493 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 569/881] Revert "[nrf fromtree] drivers: udc_dwc2: Disable endpoints asynchronously" This reverts commit fb42c976235d7724f895bd9ad2a310877ff203fc. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 230 ++++++++++++++----------------------- 1 file changed, 84 insertions(+), 146 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 09ed5aaa014..779600321e1 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -106,8 +106,6 @@ struct udc_dwc2_data { struct k_thread thread_data; /* Main events the driver thread waits for */ struct k_event drv_evt; - /* Endpoint is considered disabled when there is no active transfer */ - struct k_event ep_disabled; /* Transfer triggers (IN on bits 0-15, OUT on bits 16-31) */ atomic_t xfer_new; /* Finished transactions (IN on bits 0-15, OUT on bits 16-31) */ @@ -120,9 +118,6 @@ struct udc_dwc2_data { uint32_t rx_siz[16]; /* Isochronous endpoint enabled (IN on bits 0-15, OUT on bits 16-31) */ uint32_t iso_enabled; - uint16_t iso_in_rearm; - uint16_t ep_out_disable; - uint16_t ep_out_stall; uint16_t txf_set; uint16_t pending_tx_flush; uint16_t dfifodepth; @@ -150,8 +145,7 @@ struct udc_dwc2_data { }; static void udc_dwc2_ep_disable(const struct device *dev, - struct udc_ep_config *const cfg, - bool stall, bool wait); + struct udc_ep_config *const cfg, bool stall); #if defined(CONFIG_PINCTRL) #include @@ -624,7 +618,6 @@ static int dwc2_tx_fifo_write(const struct device *dev, } } - k_event_clear(&priv->ep_disabled, BIT(ep_idx)); k_spin_unlock(&priv->lock, key); return 0; @@ -768,8 +761,6 @@ static void dwc2_prep_rx(const struct device *dev, struct net_buf *buf, sys_write32(doepctl, doepctl_reg); - k_event_clear(&priv->ep_disabled, BIT(16 + ep_idx)); - LOG_INF("Prepare RX 0x%02x doeptsiz 0x%x", cfg->addr, doeptsiz); } @@ -836,7 +827,7 @@ static int dwc2_handle_evt_setup(const struct device *dev) * transfer beforehand. In Buffer DMA the SETUP can be copied to any EP0 * OUT buffer. If there is any buffer queued, it is obsolete now. */ - udc_dwc2_ep_disable(dev, cfg_in, false, true); + udc_dwc2_ep_disable(dev, cfg_in, false); atomic_and(&priv->xfer_finished, ~(BIT(0) | BIT(16))); buf = udc_buf_get_all(cfg_out); @@ -1531,19 +1522,16 @@ static int dwc2_unset_dedicated_fifo(const struct device *dev, * incoming OUT data (or HS PING) even if there is space available in RxFIFO. * * Set stall parameter to true if caller wants to send STALL instead of NAK. - * Set wait parameter to true to caller wants the function to return only after - * the requested operation is effective (or after 100 ms timeout). */ static void udc_dwc2_ep_disable(const struct device *dev, - struct udc_ep_config *const cfg, - bool stall, bool wait) + struct udc_ep_config *const cfg, bool stall) { struct udc_dwc2_data *const priv = udc_get_private(dev); struct usb_dwc2_reg *const base = dwc2_get_base(dev); uint8_t ep_idx = USB_EP_GET_IDX(cfg->addr); - uint8_t ep_bit = ep_idx + (USB_EP_DIR_IS_OUT(cfg->addr) ? 16 : 0); mem_addr_t dxepctl_reg; uint32_t dxepctl; + const bool is_iso = dwc2_ep_is_iso(cfg); dxepctl_reg = dwc2_get_dxepctl_reg(dev, cfg->addr); dxepctl = sys_read32(dxepctl_reg); @@ -1579,55 +1567,104 @@ static void udc_dwc2_ep_disable(const struct device *dev, priv->pending_tx_flush |= BIT(usb_dwc2_get_depctl_txfnum(dxepctl)); } - k_event_post(&priv->ep_disabled, BIT(ep_bit)); udc_ep_set_busy(cfg, false); return; } - if (k_event_test(&priv->ep_disabled, BIT(ep_bit))) { - /* There is no active transfer, STALL if necessary */ + if (!is_iso && (dxepctl & USB_DWC2_DEPCTL_NAKSTS) && + !(dxepctl & USB_DWC2_DEPCTL_EPENA)) { + /* Endpoint already sends forced NAKs. STALL if necessary. */ if (stall) { dxepctl |= USB_DWC2_DEPCTL_STALL; sys_write32(dxepctl, dxepctl_reg); } - /* Do not start pending transfers (if any) */ - atomic_clear_bit(&priv->xfer_new, ep_bit); - return; } + /* FIXME: This function needs to be changed to not synchronously wait + * for the events to happen because the actions here are racing against + * the USB host packets. It is possible that the IN token or OUT DATA + * gets sent shortly before this function disables the endpoint. If this + * happens, the XferCompl would be set and driver will incorrectly think + * that either: + * * never queued transfer finished, OR + * * transfer queued in incompisoin handler finished (before it really + * does and then it'll "double"-finish when it actually finishes) + * + * For the time being XferCompl is cleared as a workaround. + */ + if (USB_EP_DIR_IS_OUT(cfg->addr)) { - k_spinlock_key_t key = k_spin_lock(&priv->lock); + mem_addr_t dctl_reg, gintsts_reg, doepint_reg; + uint32_t dctl; + + dctl_reg = (mem_addr_t)&base->dctl; + gintsts_reg = (mem_addr_t)&base->gintsts; + doepint_reg = (mem_addr_t)&base->out_ep[ep_idx].doepint; + + dctl = sys_read32(dctl_reg); + + if (sys_read32(gintsts_reg) & USB_DWC2_GINTSTS_GOUTNAKEFF) { + LOG_ERR("GOUTNAKEFF already active"); + } else { + dctl |= USB_DWC2_DCTL_SGOUTNAK; + sys_write32(dctl, dctl_reg); + dctl &= ~USB_DWC2_DCTL_SGOUTNAK; + } + + dwc2_wait_for_bit(dev, gintsts_reg, USB_DWC2_GINTSTS_GOUTNAKEFF); + + /* The application cannot disable control OUT endpoint 0. */ + if (ep_idx != 0) { + dxepctl |= USB_DWC2_DEPCTL_EPENA | USB_DWC2_DEPCTL_EPDIS; + } - priv->ep_out_disable |= BIT(ep_idx); if (stall) { - priv->ep_out_stall |= BIT(ep_idx); + /* For OUT endpoints STALL is set instead of SNAK */ + dxepctl |= USB_DWC2_DEPCTL_STALL; + } else { + dxepctl |= USB_DWC2_DEPCTL_SNAK; } + sys_write32(dxepctl, dxepctl_reg); - sys_set_bits((mem_addr_t)&base->dctl, USB_DWC2_DCTL_SGOUTNAK); + if (ep_idx != 0) { + dwc2_wait_for_bit(dev, doepint_reg, USB_DWC2_DOEPINT_EPDISBLD); + } - k_spin_unlock(&priv->lock, key); + /* Clear Endpoint Disabled interrupt */ + sys_write32(USB_DWC2_DOEPINT_EPDISBLD | USB_DWC2_DOEPINT_XFERCOMPL, doepint_reg); - /* Endpoint gets disabled in GOUTNAKEFF handler */ + dctl |= USB_DWC2_DCTL_CGOUTNAK; + sys_write32(dctl, dctl_reg); } else { - dxepctl |= USB_DWC2_DEPCTL_SNAK; + mem_addr_t diepint_reg; + + diepint_reg = (mem_addr_t)&base->in_ep[ep_idx].diepint; + + dxepctl |= USB_DWC2_DEPCTL_EPENA | USB_DWC2_DEPCTL_SNAK; if (stall) { /* For IN endpoints STALL is set in addition to SNAK */ dxepctl |= USB_DWC2_DEPCTL_STALL; } sys_write32(dxepctl, dxepctl_reg); - /* Endpoint gets disabled in INEPNAKEFF handler */ - } + dwc2_wait_for_bit(dev, diepint_reg, USB_DWC2_DIEPINT_INEPNAKEFF); - if (wait) { - uint32_t ret; + dxepctl |= USB_DWC2_DEPCTL_EPENA | USB_DWC2_DEPCTL_EPDIS; + sys_write32(dxepctl, dxepctl_reg); - ret = k_event_wait(&priv->ep_disabled, BIT(ep_bit), false, K_MSEC(100)); - if (ret == 0) { - LOG_ERR("Endpoint 0x%02x disable timeout", cfg->addr); - } + dwc2_wait_for_bit(dev, diepint_reg, USB_DWC2_DIEPINT_EPDISBLD); + + /* Clear Endpoint Disabled interrupt */ + sys_write32(USB_DWC2_DIEPINT_EPDISBLD | USB_DWC2_DIEPINT_XFERCOMPL, diepint_reg); + + /* TODO: Read DIEPTSIZn here? Programming Guide suggest it to + * let application know how many bytes of interrupted transfer + * were transferred to the host. + */ + + dwc2_flush_tx_fifo(dev, usb_dwc2_get_depctl_txfnum(dxepctl)); } udc_ep_set_busy(cfg, false); @@ -1651,7 +1688,7 @@ static int udc_dwc2_ep_deactivate(const struct device *dev, LOG_DBG("Disable ep 0x%02x DxEPCTL%u %x", cfg->addr, ep_idx, dxepctl); - udc_dwc2_ep_disable(dev, cfg, false, true); + udc_dwc2_ep_disable(dev, cfg, false); dxepctl = sys_read32(dxepctl_reg); dxepctl &= ~USB_DWC2_DEPCTL_USBACTEP; @@ -1682,7 +1719,7 @@ static int udc_dwc2_ep_set_halt(const struct device *dev, { uint8_t ep_idx = USB_EP_GET_IDX(cfg->addr); - udc_dwc2_ep_disable(dev, cfg, true, true); + udc_dwc2_ep_disable(dev, cfg, true); LOG_DBG("Set halt ep 0x%02x", cfg->addr); if (ep_idx != 0) { @@ -1757,7 +1794,7 @@ static int udc_dwc2_ep_dequeue(const struct device *dev, { struct net_buf *buf; - udc_dwc2_ep_disable(dev, cfg, false, true); + udc_dwc2_ep_disable(dev, cfg, false); buf = udc_buf_get_all(cfg); if (buf) { @@ -2147,8 +2184,7 @@ static int udc_dwc2_init_controller(const struct device *dev) USB_DWC2_GINTSTS_INCOMPISOIN |)) USB_DWC2_GINTSTS_OEPINT | USB_DWC2_GINTSTS_IEPINT | USB_DWC2_GINTSTS_ENUMDONE | USB_DWC2_GINTSTS_USBRST | - USB_DWC2_GINTSTS_WKUPINT | USB_DWC2_GINTSTS_USBSUSP | - USB_DWC2_GINTSTS_GOUTNAKEFF, + USB_DWC2_GINTSTS_WKUPINT | USB_DWC2_GINTSTS_USBSUSP, (mem_addr_t)&base->gintmsk); return 0; @@ -2285,10 +2321,6 @@ static int dwc2_driver_preinit(const struct device *dev) k_event_init(&priv->drv_evt); atomic_clear(&priv->xfer_new); atomic_clear(&priv->xfer_finished); - k_event_init(&priv->ep_disabled); - k_event_set(&priv->ep_disabled, UINT32_MAX); - priv->ep_out_disable = 0; - priv->ep_out_stall = 0; priv->iso_enabled = 0; data->caps.rwup = true; @@ -2407,7 +2439,6 @@ static void dwc2_on_bus_reset(const struct device *dev) struct usb_dwc2_reg *const base = dwc2_get_base(dev); struct udc_dwc2_data *const priv = udc_get_private(dev); uint32_t doepmsk; - uint32_t diepmsk; /* Set the NAK bit for all OUT endpoints */ for (uint8_t i = 0U; i < priv->numdeveps; i++) { @@ -2422,16 +2453,13 @@ static void dwc2_on_bus_reset(const struct device *dev) } } - doepmsk = USB_DWC2_DOEPINT_SETUP | USB_DWC2_DOEPINT_EPDISBLD | USB_DWC2_DOEPINT_XFERCOMPL; + doepmsk = USB_DWC2_DOEPINT_SETUP | USB_DWC2_DOEPINT_XFERCOMPL; if (dwc2_in_buffer_dma_mode(dev)) { doepmsk |= USB_DWC2_DOEPINT_STSPHSERCVD; } sys_write32(doepmsk, (mem_addr_t)&base->doepmsk); - - diepmsk = USB_DWC2_DIEPINT_INEPNAKEFF | USB_DWC2_DIEPINT_EPDISBLD | - USB_DWC2_DIEPINT_XFERCOMPL; - sys_write32(diepmsk, (mem_addr_t)&base->diepmsk); + sys_set_bits((mem_addr_t)&base->diepmsk, USB_DWC2_DIEPINT_XFERCOMPL); /* Software has to handle RxFLvl interrupt only in Completer mode */ if (dwc2_in_completer_mode(dev)) { @@ -2555,13 +2583,11 @@ static inline void dwc2_handle_in_xfercompl(const struct device *dev, } atomic_set_bit(&priv->xfer_finished, ep_idx); - k_event_post(&priv->ep_disabled, BIT(ep_idx)); k_event_post(&priv->drv_evt, BIT(DWC2_DRV_EVT_EP_FINISHED)); } static inline void dwc2_handle_iepint(const struct device *dev) { - struct udc_dwc2_data *const priv = udc_get_private(dev); struct usb_dwc2_reg *const base = dwc2_get_base(dev); uint32_t diepmsk; uint32_t epint; @@ -2572,7 +2598,6 @@ static inline void dwc2_handle_iepint(const struct device *dev) while (epint) { uint8_t n = find_lsb_set(epint) - 1; mem_addr_t diepint_reg = (mem_addr_t)&base->in_ep[n].diepint; - mem_addr_t diepctl_reg = (mem_addr_t)&base->in_ep[n].diepctl; uint32_t diepint; uint32_t status; @@ -2588,33 +2613,6 @@ static inline void dwc2_handle_iepint(const struct device *dev) dwc2_handle_in_xfercompl(dev, n); } - if (status & USB_DWC2_DIEPINT_INEPNAKEFF) { - sys_set_bits(diepctl_reg, USB_DWC2_DEPCTL_EPDIS); - } - - if (status & USB_DWC2_DIEPINT_EPDISBLD) { - uint32_t diepctl = sys_read32(diepctl_reg); - - k_event_post(&priv->ep_disabled, BIT(n)); - - /* TODO: Read DIEPTSIZn here? Programming Guide suggest it to - * let application know how many bytes of interrupted transfer - * were transferred to the host. - */ - - dwc2_flush_tx_fifo(dev, usb_dwc2_get_depctl_txfnum(diepctl)); - - if ((usb_dwc2_get_depctl_eptype(diepctl) == USB_DWC2_DEPCTL_EPTYPE_ISO) && - (priv->iso_in_rearm & BIT(n))) { - struct udc_ep_config *cfg = udc_get_ep_cfg(dev, n | USB_EP_DIR_IN); - - /* Try to queue next packet before SOF */ - dwc2_handle_xfer_next(dev, cfg); - - priv->iso_in_rearm &= ~BIT(n); - } - } - epint &= ~BIT(n); } @@ -2690,7 +2688,6 @@ static inline void dwc2_handle_out_xfercompl(const struct device *dev, dwc2_prep_rx(dev, buf, ep_cfg); } else { atomic_set_bit(&priv->xfer_finished, 16 + ep_idx); - k_event_post(&priv->ep_disabled, BIT(16 + ep_idx)); k_event_post(&priv->drv_evt, BIT(DWC2_DRV_EVT_EP_FINISHED)); } } @@ -2757,10 +2754,6 @@ static inline void dwc2_handle_oepint(const struct device *dev) dwc2_handle_out_xfercompl(dev, n); } - if (status & USB_DWC2_DOEPINT_EPDISBLD) { - k_event_post(&priv->ep_disabled, BIT(16 + n)); - } - epint &= ~BIT(n); } @@ -2786,7 +2779,6 @@ static void dwc2_handle_incompisoin(const struct device *dev) usb_dwc2_set_depctl_eptype(USB_DWC2_DEPCTL_EPTYPE_ISO) | USB_DWC2_DEPCTL_USBACTEP; uint32_t eps = priv->iso_enabled & 0x0000FFFFUL; - uint16_t rearm = 0; while (eps) { uint8_t i = find_lsb_set(eps) - 1; @@ -2804,23 +2796,21 @@ static void dwc2_handle_incompisoin(const struct device *dev) __ASSERT_NO_MSG(cfg && cfg->stat.enabled && dwc2_ep_is_iso(cfg)); - udc_dwc2_ep_disable(dev, cfg, false, false); + udc_dwc2_ep_disable(dev, cfg, false); buf = udc_buf_get(cfg); if (buf) { /* Data is no longer relevant */ udc_submit_ep_event(dev, buf, 0); - rearm |= BIT(i); + /* Try to queue next packet before SOF */ + dwc2_handle_xfer_next(dev, cfg); } } eps &= ~BIT(i); } - /* Mark endpoints to re-arm in EPDISBLD handler */ - priv->iso_in_rearm = rearm; - sys_write32(USB_DWC2_GINTSTS_INCOMPISOIN, gintsts_reg); } @@ -2860,7 +2850,7 @@ static void dwc2_handle_incompisoout(const struct device *dev) __ASSERT_NO_MSG(cfg && cfg->stat.enabled && dwc2_ep_is_iso(cfg)); - udc_dwc2_ep_disable(dev, cfg, false, false); + udc_dwc2_ep_disable(dev, cfg, false); buf = udc_buf_get(cfg); if (buf) { @@ -2874,51 +2864,6 @@ static void dwc2_handle_incompisoout(const struct device *dev) sys_write32(USB_DWC2_GINTSTS_INCOMPISOOUT, gintsts_reg); } -static void dwc2_handle_goutnakeff(const struct device *dev) -{ - const struct udc_dwc2_config *const config = dev->config; - struct usb_dwc2_reg *const base = config->base; - struct udc_dwc2_data *const priv = udc_get_private(dev); - k_spinlock_key_t key; - mem_addr_t doepctl_reg; - uint32_t doepctl; - - key = k_spin_lock(&priv->lock); - - while (priv->ep_out_disable) { - uint8_t ep_idx = find_lsb_set(priv->ep_out_disable) - 1; - - priv->ep_out_disable &= ~BIT(ep_idx); - - doepctl_reg = (mem_addr_t)&base->out_ep[ep_idx].doepctl; - doepctl = sys_read32(doepctl_reg); - - /* The application cannot disable control OUT endpoint 0. */ - if (ep_idx != 0) { - doepctl |= USB_DWC2_DEPCTL_EPDIS; - } - - if (priv->ep_out_stall & BIT(ep_idx)) { - /* For OUT endpoints STALL is set instead of SNAK */ - doepctl |= USB_DWC2_DEPCTL_STALL; - priv->ep_out_stall &= ~BIT(ep_idx); - } else { - doepctl |= USB_DWC2_DEPCTL_SNAK; - } - - sys_write32(doepctl, doepctl_reg); - - if (ep_idx == 0) { - /* Consider endpoint to be disabled */ - k_event_post(&priv->ep_disabled, BIT(16)); - } - } - - sys_set_bits((mem_addr_t)&base->dctl, USB_DWC2_DCTL_CGOUTNAK); - - k_spin_unlock(&priv->lock, key); -} - static void udc_dwc2_isr_handler(const struct device *dev) { const struct udc_dwc2_config *const config = dev->config; @@ -3024,13 +2969,6 @@ static void udc_dwc2_isr_handler(const struct device *dev) dwc2_handle_incompisoout(dev); } - if (int_status & USB_DWC2_GINTSTS_GOUTNAKEFF) { - /* Clear Global OUT NAK Effective interrupt. */ - sys_write32(USB_DWC2_GINTSTS_GOUTNAKEFF, gintsts_reg); - - dwc2_handle_goutnakeff(dev); - } - if (int_status & USB_DWC2_GINTSTS_USBSUSP) { /* Clear USB Suspend interrupt. */ sys_write32(USB_DWC2_GINTSTS_USBSUSP, gintsts_reg); From e7b0aae700cc1caced2a4878106ca0e9055889e3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 570/881] Revert "[nrf fromtree] drivers: udc_dwc2: Optimize incomplete iso handling" This reverts commit 77e2d806340cc9d6a33beed45f596572d30130fa. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 100 ++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 57 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 779600321e1..bebe7973a48 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -116,8 +116,6 @@ struct udc_dwc2_data { uint32_t max_pktcnt; uint32_t tx_len[16]; uint32_t rx_siz[16]; - /* Isochronous endpoint enabled (IN on bits 0-15, OUT on bits 16-31) */ - uint32_t iso_enabled; uint16_t txf_set; uint16_t pending_tx_flush; uint16_t dfifodepth; @@ -1477,12 +1475,6 @@ static int udc_dwc2_ep_activate(const struct device *dev, dwc2_set_epint(dev, cfg, true); sys_write32(dxepctl, dxepctl_reg); - if (dwc2_ep_is_iso(cfg)) { - uint8_t ep_bit = ep_idx + (USB_EP_DIR_IS_OUT(cfg->addr) ? 16 : 0); - - priv->iso_enabled |= BIT(ep_bit); - } - for (uint8_t i = 1U; i < priv->ineps; i++) { LOG_DBG("DIEPTXF%u %08x DIEPCTL%u %08x", i, sys_read32((mem_addr_t)&base->dieptxf[i - 1U]), i, dxepctl); @@ -1676,7 +1668,6 @@ static void udc_dwc2_ep_disable(const struct device *dev, static int udc_dwc2_ep_deactivate(const struct device *dev, struct udc_ep_config *const cfg) { - struct udc_dwc2_data *const priv = udc_get_private(dev); uint8_t ep_idx = USB_EP_GET_IDX(cfg->addr); mem_addr_t dxepctl_reg; uint32_t dxepctl; @@ -1705,12 +1696,6 @@ static int udc_dwc2_ep_deactivate(const struct device *dev, sys_write32(dxepctl, dxepctl_reg); dwc2_set_epint(dev, cfg, false); - if (dwc2_ep_is_iso(cfg)) { - uint8_t ep_bit = ep_idx + (USB_EP_DIR_IS_OUT(cfg->addr) ? 16 : 0); - - priv->iso_enabled &= ~BIT(ep_bit); - } - return 0; } @@ -2321,7 +2306,6 @@ static int dwc2_driver_preinit(const struct device *dev) k_event_init(&priv->drv_evt); atomic_clear(&priv->xfer_new); atomic_clear(&priv->xfer_finished); - priv->iso_enabled = 0; data->caps.rwup = true; data->caps.addr_before_status = true; @@ -2778,37 +2762,38 @@ static void dwc2_handle_incompisoin(const struct device *dev) USB_DWC2_DEPCTL_EPENA | usb_dwc2_set_depctl_eptype(USB_DWC2_DEPCTL_EPTYPE_ISO) | USB_DWC2_DEPCTL_USBACTEP; - uint32_t eps = priv->iso_enabled & 0x0000FFFFUL; - while (eps) { - uint8_t i = find_lsb_set(eps) - 1; - mem_addr_t diepctl_reg = dwc2_get_dxepctl_reg(dev, i | USB_EP_DIR_IN); - uint32_t diepctl; + for (uint8_t i = 1U; i < priv->numdeveps; i++) { + uint32_t epdir = usb_dwc2_get_ghwcfg1_epdir(priv->ghwcfg1, i); - diepctl = sys_read32(diepctl_reg); + if (epdir == USB_DWC2_GHWCFG1_EPDIR_IN || + epdir == USB_DWC2_GHWCFG1_EPDIR_BDIR) { + mem_addr_t diepctl_reg = dwc2_get_dxepctl_reg(dev, i | USB_EP_DIR_IN); + uint32_t diepctl; - /* Check if endpoint didn't receive ISO IN data */ - if ((diepctl & mask) == val) { - struct udc_ep_config *cfg; - struct net_buf *buf; + diepctl = sys_read32(diepctl_reg); - cfg = udc_get_ep_cfg(dev, i | USB_EP_DIR_IN); - __ASSERT_NO_MSG(cfg && cfg->stat.enabled && - dwc2_ep_is_iso(cfg)); + /* Check if endpoint didn't receive ISO OUT data */ + if ((diepctl & mask) == val) { + struct udc_ep_config *cfg; + struct net_buf *buf; - udc_dwc2_ep_disable(dev, cfg, false); + cfg = udc_get_ep_cfg(dev, i | USB_EP_DIR_IN); + __ASSERT_NO_MSG(cfg && cfg->stat.enabled && + dwc2_ep_is_iso(cfg)); - buf = udc_buf_get(cfg); - if (buf) { - /* Data is no longer relevant */ - udc_submit_ep_event(dev, buf, 0); + udc_dwc2_ep_disable(dev, cfg, false); - /* Try to queue next packet before SOF */ - dwc2_handle_xfer_next(dev, cfg); + buf = udc_buf_get(cfg); + if (buf) { + /* Data is no longer relevant */ + udc_submit_ep_event(dev, buf, 0); + + /* Try to queue next packet before SOF */ + dwc2_handle_xfer_next(dev, cfg); + } } } - - eps &= ~BIT(i); } sys_write32(USB_DWC2_GINTSTS_INCOMPISOIN, gintsts_reg); @@ -2832,33 +2817,34 @@ static void dwc2_handle_incompisoout(const struct device *dev) usb_dwc2_set_depctl_eptype(USB_DWC2_DEPCTL_EPTYPE_ISO) | ((priv->sof_num & 1) ? USB_DWC2_DEPCTL_DPID : 0) | USB_DWC2_DEPCTL_USBACTEP; - uint32_t eps = (priv->iso_enabled & 0xFFFF0000UL) >> 16; - while (eps) { - uint8_t i = find_lsb_set(eps) - 1; - mem_addr_t doepctl_reg = dwc2_get_dxepctl_reg(dev, i); - uint32_t doepctl; + for (uint8_t i = 1U; i < priv->numdeveps; i++) { + uint32_t epdir = usb_dwc2_get_ghwcfg1_epdir(priv->ghwcfg1, i); - doepctl = sys_read32(doepctl_reg); + if (epdir == USB_DWC2_GHWCFG1_EPDIR_OUT || + epdir == USB_DWC2_GHWCFG1_EPDIR_BDIR) { + mem_addr_t doepctl_reg = dwc2_get_dxepctl_reg(dev, i); + uint32_t doepctl; - /* Check if endpoint didn't receive ISO OUT data */ - if ((doepctl & mask) == val) { - struct udc_ep_config *cfg; - struct net_buf *buf; + doepctl = sys_read32(doepctl_reg); - cfg = udc_get_ep_cfg(dev, i); - __ASSERT_NO_MSG(cfg && cfg->stat.enabled && - dwc2_ep_is_iso(cfg)); + /* Check if endpoint didn't receive ISO OUT data */ + if ((doepctl & mask) == val) { + struct udc_ep_config *cfg; + struct net_buf *buf; - udc_dwc2_ep_disable(dev, cfg, false); + cfg = udc_get_ep_cfg(dev, i); + __ASSERT_NO_MSG(cfg && cfg->stat.enabled && + dwc2_ep_is_iso(cfg)); - buf = udc_buf_get(cfg); - if (buf) { - udc_submit_ep_event(dev, buf, 0); + udc_dwc2_ep_disable(dev, cfg, false); + + buf = udc_buf_get(cfg); + if (buf) { + udc_submit_ep_event(dev, buf, 0); + } } } - - eps &= ~BIT(i); } sys_write32(USB_DWC2_GINTSTS_INCOMPISOOUT, gintsts_reg); From 82f96935be9209889400e119c0be06ebaaffb2ce Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 571/881] Revert "[nrf fromtree] drivers: udc_dwc2: Use spin lock for synchronization" This reverts commit 089285f9ae55d10ace5a5e4c25f84e52ecf3c223. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index bebe7973a48..cb52f711fcb 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -102,7 +102,6 @@ struct dwc2_reg_backup { /* Driver private data per instance */ struct udc_dwc2_data { - struct k_spinlock lock; struct k_thread thread_data; /* Main events the driver thread waits for */ struct k_event drv_evt; @@ -463,7 +462,7 @@ static int dwc2_tx_fifo_write(const struct device *dev, uint32_t max_xfersize, max_pktcnt, pktcnt; const uint32_t addnl = USB_MPS_ADDITIONAL_TRANSACTIONS(cfg->mps); const size_t d = sizeof(uint32_t); - k_spinlock_key_t key; + unsigned int key; uint32_t len; const bool is_periodic = dwc2_ep_is_periodic(cfg); const bool is_iso = dwc2_ep_is_iso(cfg); @@ -538,7 +537,7 @@ static int dwc2_tx_fifo_write(const struct device *dev, priv->tx_len[ep_idx] = len; /* Lock and write to endpoint FIFO */ - key = k_spin_lock(&priv->lock); + key = irq_lock(); /* Set number of packets and transfer size */ sys_write32((is_periodic ? usb_dwc2_set_dieptsizn_mc(1 + addnl) : 0) | @@ -550,7 +549,7 @@ static int dwc2_tx_fifo_write(const struct device *dev, /* Cannot continue unless buffer is bounced. Device will * cease to function. Is fatal error appropriate here? */ - k_spin_unlock(&priv->lock, key); + irq_unlock(key); return -ENOTSUP; } @@ -566,7 +565,7 @@ static int dwc2_tx_fifo_write(const struct device *dev, * no fifo is assigned to inactive endpoint and therefore it is * possible that the write will corrupt other endpoint fifo. */ - k_spin_unlock(&priv->lock, key); + irq_unlock(key); return -ENOENT; } @@ -616,7 +615,7 @@ static int dwc2_tx_fifo_write(const struct device *dev, } } - k_spin_unlock(&priv->lock, key); + irq_unlock(key); return 0; } From 88ff58a8d5f22408c6d28cb20343d467aa862838 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 572/881] Revert "[nrf fromtree] usb: device_next: rework CDC ACM serial for flash usage" This reverts commit 7f1894c15968cbd2ff32861243b12132210c6409. Signed-off-by: Jukka Rissanen --- .../device_next/app/Kconfig.cdc_acm_serial | 7 ------ subsys/usb/device_next/app/cdc_acm_serial.c | 25 ++++++++----------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/subsys/usb/device_next/app/Kconfig.cdc_acm_serial b/subsys/usb/device_next/app/Kconfig.cdc_acm_serial index 5192d5636d9..dba212ba9ba 100644 --- a/subsys/usb/device_next/app/Kconfig.cdc_acm_serial +++ b/subsys/usb/device_next/app/Kconfig.cdc_acm_serial @@ -16,13 +16,6 @@ menuconfig CDC_ACM_SERIAL_INITIALIZE_AT_BOOT if CDC_ACM_SERIAL_INITIALIZE_AT_BOOT -config CDC_ACM_SERIAL_ENABLE_AT_BOOT - bool "USB device will be enabled at boot" - default y - help - When disabled, the application is responsible for enabling/disabling - the USB device. - config CDC_ACM_SERIAL_MANUFACTURER_STRING string "USB device manufacturer string descriptor" default "Zephyr Project" diff --git a/subsys/usb/device_next/app/cdc_acm_serial.c b/subsys/usb/device_next/app/cdc_acm_serial.c index af081469303..6f8e64b3c8c 100644 --- a/subsys/usb/device_next/app/cdc_acm_serial.c +++ b/subsys/usb/device_next/app/cdc_acm_serial.c @@ -12,7 +12,7 @@ #include #include -LOG_MODULE_REGISTER(cdc_acm_serial, CONFIG_USBD_LOG_LEVEL); +LOG_MODULE_REGISTER(cdc_acm_serial, LOG_LEVEL_DBG); /* * This is intended for use with cdc-acm-snippet or as a default serial backend @@ -79,19 +79,19 @@ static int cdc_acm_serial_init_device(void) err = usbd_add_descriptor(&cdc_acm_serial, &cdc_acm_serial_lang); if (err) { - LOG_ERR("Failed to initialize %s (%d)", "language descriptor", err); + LOG_ERR("Failed to initialize language descriptor (%d)", err); return err; } err = usbd_add_descriptor(&cdc_acm_serial, &cdc_acm_serial_mfr); if (err) { - LOG_ERR("Failed to initialize %s (%d)", "manufacturer descriptor", err); + LOG_ERR("Failed to initialize manufacturer descriptor (%d)", err); return err; } err = usbd_add_descriptor(&cdc_acm_serial, &cdc_acm_serial_product); if (err) { - LOG_ERR("Failed to initialize %s (%d)", "product descriptor", err); + LOG_ERR("Failed to initialize product descriptor (%d)", err); return err; } @@ -99,12 +99,11 @@ static int cdc_acm_serial_init_device(void) err = usbd_add_descriptor(&cdc_acm_serial, &cdc_acm_serial_sn); )) if (err) { - LOG_ERR("Failed to initialize %s (%d)", "SN descriptor", err); + LOG_ERR("Failed to initialize SN descriptor (%d)", err); return err; } - if (USBD_SUPPORTS_HIGH_SPEED && - usbd_caps_speed(&cdc_acm_serial) == USBD_SPEED_HS) { + if (usbd_caps_speed(&cdc_acm_serial) == USBD_SPEED_HS) { err = register_cdc_acm_0(&cdc_acm_serial, USBD_SPEED_HS); if (err) { return err; @@ -118,16 +117,14 @@ static int cdc_acm_serial_init_device(void) err = usbd_init(&cdc_acm_serial); if (err) { - LOG_ERR("Failed to initialize %s (%d)", "device support", err); + LOG_ERR("Failed to initialize device support"); return err; } - if (IS_ENABLED(CONFIG_CDC_ACM_SERIAL_ENABLE_AT_BOOT)) { - err = usbd_enable(&cdc_acm_serial); - if (err) { - LOG_ERR("Failed to enable %s (%d)", "device support", err); - return err; - } + err = usbd_enable(&cdc_acm_serial); + if (err) { + LOG_ERR("Failed to enable device support"); + return err; } return 0; From c43f1e17c227615bf2a1be88ee2c9f5eb41b4846 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 573/881] Revert "[nrf fromtree] usb: update USBD_DESC_SERIAL_NUMBER_DEFINE macro description" This reverts commit e91055fb1e804a6914f6a04e54b0e5b0edb24a1a. Signed-off-by: Jukka Rissanen --- include/zephyr/usb/usbd.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/zephyr/usb/usbd.h b/include/zephyr/usb/usbd.h index 029741f076d..27b684101b1 100644 --- a/include/zephyr/usb/usbd.h +++ b/include/zephyr/usb/usbd.h @@ -629,11 +629,8 @@ static inline void *usbd_class_get_private(const struct usbd_class_data *const c * * This macro defines a descriptor node that, when added to the device context, * is automatically used as the serial number string descriptor. A valid serial - * number is obtained from @ref hwinfo_interface whenever this string - * descriptor is requested. - * - * @note The HWINFO driver must be available and the Kconfig option HWINFO - * enabled. + * number is generated from HWID (HWINFO= whenever this string descriptor is + * requested. * * @param d_name String descriptor node identifier. */ From 8f06bef630b98161a9a44b5bc06ac2a7b13963d7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 574/881] Revert "[nrf fromtree] usb: device_next: allow to limit number or digits in serial number" This reverts commit b622ad0225f08c7412f3a52b1bbce006375252ca. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/Kconfig | 10 ---------- subsys/usb/device_next/usbd_ch9.c | 25 ++++++++++++------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/subsys/usb/device_next/Kconfig b/subsys/usb/device_next/Kconfig index 18b6860b0e6..b72de53f0b3 100644 --- a/subsys/usb/device_next/Kconfig +++ b/subsys/usb/device_next/Kconfig @@ -96,16 +96,6 @@ config USBD_MSG_WORK_DELAY Message work may need to be delayed because the device stack is not yet ready to publish the message. The delay unit is milliseconds. -config USBD_HWINFO_DEVID_LENGTH - int "The length of the device ID requested from HWINFO in bytes" - depends on HWINFO - range 8 128 - default 16 - help - Each byte represents two digits in the serial number string - descriptor. This option can be used to limit the length requested - from HWINFO to a meaningful number of digits. - rsource "class/Kconfig" rsource "app/Kconfig.cdc_acm_serial" diff --git a/subsys/usb/device_next/usbd_ch9.c b/subsys/usb/device_next/usbd_ch9.c index 599eb161178..3adb3574f0c 100644 --- a/subsys/usb/device_next/usbd_ch9.c +++ b/subsys/usb/device_next/usbd_ch9.c @@ -533,13 +533,13 @@ static int sreq_get_desc_cfg(struct usbd_context *const uds_ctx, return 0; } -#define USBD_SN_ASCII7_LENGTH (CONFIG_USBD_HWINFO_DEVID_LENGTH * 2) +#define USBD_HWID_SN_MAX 32U /* Generate valid USB device serial number from hwid */ -static ssize_t get_sn_from_hwid(uint8_t sn[static USBD_SN_ASCII7_LENGTH]) +static ssize_t get_sn_from_hwid(uint8_t sn[static USBD_HWID_SN_MAX]) { static const char hex[] = "0123456789ABCDEF"; - uint8_t hwid[USBD_SN_ASCII7_LENGTH / 2U]; + uint8_t hwid[USBD_HWID_SN_MAX / 2U]; ssize_t hwid_len = -ENOSYS; if (IS_ENABLED(CONFIG_HWINFO)) { @@ -554,37 +554,36 @@ static ssize_t get_sn_from_hwid(uint8_t sn[static USBD_SN_ASCII7_LENGTH]) return hwid_len; } - for (ssize_t i = 0; i < MIN(hwid_len, sizeof(hwid)); i++) { + for (ssize_t i = 0; i < hwid_len; i++) { sn[i * 2] = hex[hwid[i] >> 4]; sn[i * 2 + 1] = hex[hwid[i] & 0xF]; } - return MIN(hwid_len, sizeof(hwid)) * 2; + return hwid_len * 2; } /* Copy and convert ASCII-7 string descriptor to UTF16-LE */ static void string_ascii7_to_utf16le(struct usbd_desc_node *const dn, struct net_buf *const buf, const uint16_t wLength) { - uint8_t sn_ascii7_str[USBD_SN_ASCII7_LENGTH]; + uint8_t hwid_sn[USBD_HWID_SN_MAX]; struct usb_desc_header head = { .bDescriptorType = dn->bDescriptorType, }; - const uint8_t *ascii7_str; + uint8_t *ascii7_str; size_t len; size_t i; - if (IS_ENABLED(CONFIG_HWINFO) && - dn->str.utype == USBD_DUT_STRING_SERIAL_NUMBER && dn->str.use_hwinfo) { - ssize_t sn_ascii7_str_len = get_sn_from_hwid(sn_ascii7_str); + if (dn->str.utype == USBD_DUT_STRING_SERIAL_NUMBER && dn->str.use_hwinfo) { + ssize_t hwid_len = get_sn_from_hwid(hwid_sn); - if (sn_ascii7_str_len < 0) { + if (hwid_len < 0) { errno = -ENOTSUP; return; } - head.bLength = sizeof(head) + sn_ascii7_str_len * 2; - ascii7_str = sn_ascii7_str; + head.bLength = sizeof(head) + hwid_len * 2; + ascii7_str = hwid_sn; } else { head.bLength = dn->bLength; ascii7_str = (uint8_t *)dn->ptr; From 78f8d9cbf08c027aec61f256429647387484e542 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 575/881] Revert "[nrf fromtree] usb: device_next: hide Kconfig option USBD_MSG_SLAB_COUNT if not used" This reverts commit 368aac815f1339735603ff4d5b7c862d2df43765. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/Kconfig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subsys/usb/device_next/Kconfig b/subsys/usb/device_next/Kconfig index b72de53f0b3..987ef5e546e 100644 --- a/subsys/usb/device_next/Kconfig +++ b/subsys/usb/device_next/Kconfig @@ -74,6 +74,13 @@ config USBD_MAX_UDC_MSG help Maximum number of USB device controller events that can be queued. +config USBD_MSG_SLAB_COUNT + int "Maximum number of USB device notification messages" + range 4 64 + default 8 + help + Maximum number of USB device notification messages that can be queued. + config USBD_MSG_DEFERRED_MODE bool "Execute message callback from system workqueue" default y @@ -81,13 +88,6 @@ config USBD_MSG_DEFERRED_MODE Execute message callback from system workqueue. If disabled, message callback will be executed in the device stack context. -config USBD_MSG_SLAB_COUNT - int "Maximum number of USB device notification messages" if USBD_MSG_DEFERRED_MODE - range 4 64 - default 8 - help - Maximum number of USB device notification messages that can be queued. - config USBD_MSG_WORK_DELAY int "USB device notification messages work delay" if USBD_MSG_DEFERRED_MODE range 1 100 From 2e4ff911ad39253cada9d6d39949d5471abe0830 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 576/881] Revert "[nrf fromtree] usb: device_next: add the missing const qualifier and save some RAM" This reverts commit b5d478d14b7ae33545de5e96ca9873366c458061. Signed-off-by: Jukka Rissanen --- include/zephyr/usb/usbd.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/zephyr/usb/usbd.h b/include/zephyr/usb/usbd.h index 27b684101b1..1545af66c81 100644 --- a/include/zephyr/usb/usbd.h +++ b/include/zephyr/usb/usbd.h @@ -43,6 +43,18 @@ extern "C" { /* Maximum bulk max packet size the stack supports */ #define USBD_MAX_BULK_MPS COND_CODE_1(USBD_SUPPORTS_HIGH_SPEED, (512), (64)) +/* + * The USB Unicode bString is encoded in UTF16LE, which means it takes up + * twice the amount of bytes than the same string encoded in ASCII7. + * Use this macro to determine the length of the bString array. + * + * bString length without null character: + * bString_length = (sizeof(initializer_string) - 1) * 2 + * or: + * bString_length = sizeof(initializer_string) * 2 - 2 + */ +#define USB_BSTRING_LENGTH(s) (sizeof(s) * 2 - 2) + /* * The length of the string descriptor (bLength) is calculated from the * size of the two octets bLength and bDescriptorType plus the @@ -562,7 +574,7 @@ static inline void *usbd_class_get_private(const struct usbd_class_data *const c * @param name Language string descriptor node identifier. */ #define USBD_DESC_LANG_DEFINE(name) \ - static const uint16_t langid_##name = sys_cpu_to_le16(0x0409); \ + static uint16_t langid_##name = sys_cpu_to_le16(0x0409); \ static struct usbd_desc_node name = { \ .str = { \ .idx = 0, \ @@ -585,7 +597,7 @@ static inline void *usbd_class_get_private(const struct usbd_class_data *const c * @param d_utype String descriptor usage type */ #define USBD_DESC_STRING_DEFINE(d_name, d_string, d_utype) \ - static const uint8_t ascii_##d_name[sizeof(d_string)] = d_string; \ + static uint8_t ascii_##d_name[USB_BSTRING_LENGTH(d_string)] = d_string; \ static struct usbd_desc_node d_name = { \ .str = { \ .utype = d_utype, \ From 7bf64418626de18e452548a13eb8644abbe62c00 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 577/881] Revert "[nrf fromtree] drivers: udc: disable SOF interrupt by default" This reverts commit ddd6b2e7af03aa6a520fa4cf65f22576c1018651. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_ambiq.c | 7 +++---- drivers/usb/udc/udc_dwc2.c | 20 ++++++++------------ drivers/usb/udc/udc_it82xx2.c | 9 ++++++--- drivers/usb/udc/udc_kinetis.c | 4 ++-- drivers/usb/udc/udc_max32.c | 2 +- drivers/usb/udc/udc_mcux_ehci.c | 2 +- drivers/usb/udc/udc_mcux_ip3511.c | 2 +- drivers/usb/udc/udc_nrf.c | 4 ++-- drivers/usb/udc/udc_numaker.c | 6 ++---- drivers/usb/udc/udc_renesas_ra.c | 2 +- drivers/usb/udc/udc_rpi_pico.c | 4 ++-- drivers/usb/udc/udc_sam0.c | 2 +- drivers/usb/udc/udc_skeleton.c | 4 ---- drivers/usb/udc/udc_stm32.c | 2 +- subsys/usb/device_next/class/Kconfig.uac2 | 1 - tests/drivers/udc/prj.conf | 1 - tests/subsys/usb/device_next/prj.conf | 1 - 17 files changed, 31 insertions(+), 42 deletions(-) diff --git a/drivers/usb/udc/udc_ambiq.c b/drivers/usb/udc/udc_ambiq.c index 9b2fdc0addb..6e5f2603edd 100644 --- a/drivers/usb/udc/udc_ambiq.c +++ b/drivers/usb/udc/udc_ambiq.c @@ -156,9 +156,8 @@ static void udc_ambiq_evt_callback(const struct device *dev, am_hal_usb_dev_even case AM_HAL_USB_DEV_EVT_BUS_RESET: /* enable usb bus interrupts */ am_hal_usb_intr_usb_enable(priv->usb_handle, - IF_ENABLED(CONFIG_UDC_ENABLE_SOF, (USB_CFG2_SOFE_Msk |)) - USB_CFG2_ResumeE_Msk | - USB_CFG2_SuspendE_Msk | USB_CFG2_ResetE_Msk); + USB_CFG2_SOFE_Msk | USB_CFG2_ResumeE_Msk | + USB_CFG2_SuspendE_Msk | USB_CFG2_ResetE_Msk); /* init the endpoint */ am_hal_usb_ep_init(priv->usb_handle, 0, 0, EP0_MPS); /* Set USB device speed to HAL */ @@ -175,7 +174,7 @@ static void udc_ambiq_evt_callback(const struct device *dev, am_hal_usb_dev_even udc_submit_event(dev, UDC_EVT_RESUME, 0); break; case AM_HAL_USB_DEV_EVT_SOF: - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); break; case AM_HAL_USB_DEV_EVT_SUSPEND: /* Handle USB Suspend event, then set device state to suspended */ diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index cb52f711fcb..856324942d0 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -2163,12 +2163,11 @@ static int udc_dwc2_init_controller(const struct device *dev) } /* Unmask interrupts */ - sys_write32(IF_ENABLED(CONFIG_UDC_ENABLE_SOF, (USB_DWC2_GINTSTS_SOF | - USB_DWC2_GINTSTS_INCOMPISOOUT | - USB_DWC2_GINTSTS_INCOMPISOIN |)) - USB_DWC2_GINTSTS_OEPINT | USB_DWC2_GINTSTS_IEPINT | + sys_write32(USB_DWC2_GINTSTS_OEPINT | USB_DWC2_GINTSTS_IEPINT | USB_DWC2_GINTSTS_ENUMDONE | USB_DWC2_GINTSTS_USBRST | - USB_DWC2_GINTSTS_WKUPINT | USB_DWC2_GINTSTS_USBSUSP, + USB_DWC2_GINTSTS_WKUPINT | USB_DWC2_GINTSTS_USBSUSP | + USB_DWC2_GINTSTS_INCOMPISOOUT | USB_DWC2_GINTSTS_INCOMPISOIN | + USB_DWC2_GINTSTS_SOF, (mem_addr_t)&base->gintmsk); return 0; @@ -2892,8 +2891,7 @@ static void udc_dwc2_isr_handler(const struct device *dev) LOG_DBG("GINTSTS 0x%x", int_status); - if (IS_ENABLED(CONFIG_UDC_ENABLE_SOF) && - int_status & USB_DWC2_GINTSTS_SOF) { + if (int_status & USB_DWC2_GINTSTS_SOF) { uint32_t dsts; /* Clear USB SOF interrupt. */ @@ -2901,7 +2899,7 @@ static void udc_dwc2_isr_handler(const struct device *dev) dsts = sys_read32((mem_addr_t)&base->dsts); priv->sof_num = usb_dwc2_get_dsts_soffn(dsts); - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); } if (int_status & USB_DWC2_GINTSTS_USBRST) { @@ -2944,13 +2942,11 @@ static void udc_dwc2_isr_handler(const struct device *dev) dwc2_handle_oepint(dev); } - if (IS_ENABLED(CONFIG_UDC_ENABLE_SOF) && - int_status & USB_DWC2_GINTSTS_INCOMPISOIN) { + if (int_status & USB_DWC2_GINTSTS_INCOMPISOIN) { dwc2_handle_incompisoin(dev); } - if (IS_ENABLED(CONFIG_UDC_ENABLE_SOF) && - int_status & USB_DWC2_GINTSTS_INCOMPISOOUT) { + if (int_status & USB_DWC2_GINTSTS_INCOMPISOOUT) { dwc2_handle_incompisoout(dev); } diff --git a/drivers/usb/udc/udc_it82xx2.c b/drivers/usb/udc/udc_it82xx2.c index 6b41cb162d4..85ec9431c63 100644 --- a/drivers/usb/udc/udc_it82xx2.c +++ b/drivers/usb/udc/udc_it82xx2.c @@ -17,6 +17,9 @@ LOG_MODULE_REGISTER(udc_it82xx2, CONFIG_UDC_DRIVER_LOG_LEVEL); #define DT_DRV_COMPAT ite_it82xx2_usb +/* TODO: Replace this definition by Kconfig option */ +#define USB_DEVICE_CONFIG_SOF_NOTIFICATIONS (0U) + #define IT8XXX2_IS_EXTEND_ENDPOINT(n) (USB_EP_GET_IDX(n) >= 4) #define IT82xx2_STATE_OUT_SHARED_FIFO_BUSY 0 @@ -1354,11 +1357,11 @@ static void it82xx2_usb_dc_isr(const void *arg) /* sof received */ if (status & DC_SOF_RECEIVED) { - if (!IS_ENABLED(CONFIG_UDC_ENABLE_SOF)) { + if (!USB_DEVICE_CONFIG_SOF_NOTIFICATIONS) { it82xx2_enable_sof_int(dev, false); } else { usb_regs->dc_interrupt_status = DC_SOF_RECEIVED; - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); } it82xx2_enable_resume_int(dev, false); emit_resume_event(dev); @@ -1408,7 +1411,7 @@ static void suspended_handler(struct k_work *item) it82xx2_enable_resume_int(dev, true); - if (!IS_ENABLED(CONFIG_UDC_ENABLE_SOF)) { + if (!USB_DEVICE_CONFIG_SOF_NOTIFICATIONS) { it82xx2_enable_sof_int(dev, true); } diff --git a/drivers/usb/udc/udc_kinetis.c b/drivers/usb/udc/udc_kinetis.c index 7d227301603..8858ee129c4 100644 --- a/drivers/usb/udc/udc_kinetis.c +++ b/drivers/usb/udc/udc_kinetis.c @@ -653,7 +653,7 @@ static void usbfsotg_isr_handler(const struct device *dev) } if (istatus == USB_ISTAT_SOFTOK_MASK) { - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); } if (istatus == USB_ISTAT_ERROR_MASK) { @@ -1016,7 +1016,7 @@ static int usbfsotg_init(const struct device *dev) base->INTEN = (USB_INTEN_SLEEPEN_MASK | USB_INTEN_STALLEN_MASK | USB_INTEN_TOKDNEEN_MASK | - IF_ENABLED(CONFIG_UDC_ENABLE_SOF, (USB_INTEN_SOFTOKEN_MASK |)) + USB_INTEN_SOFTOKEN_MASK | USB_INTEN_ERROREN_MASK | USB_INTEN_USBRSTEN_MASK); diff --git a/drivers/usb/udc/udc_max32.c b/drivers/usb/udc/udc_max32.c index 526a49b8ba9..1e09f5ef7c6 100644 --- a/drivers/usb/udc/udc_max32.c +++ b/drivers/usb/udc/udc_max32.c @@ -533,7 +533,7 @@ static int udc_max32_event_callback(maxusb_event_t event, void *cbdata) case MAXUSB_EVENT_DPACT: LOG_DBG("DPACT event occurred"); udc_set_suspended(dev, false); - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); break; case MAXUSB_EVENT_BRST: LOG_DBG("BRST event occurred"); diff --git a/drivers/usb/udc/udc_mcux_ehci.c b/drivers/usb/udc/udc_mcux_ehci.c index 041f9b759b1..fc95f7a91d7 100644 --- a/drivers/usb/udc/udc_mcux_ehci.c +++ b/drivers/usb/udc/udc_mcux_ehci.c @@ -531,7 +531,7 @@ usb_status_t USB_DeviceNotificationTrigger(void *handle, void *msg) udc_submit_event(dev, UDC_EVT_VBUS_READY, 0); break; case kUSB_DeviceNotifySOF: - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); break; default: udc_mcux_event_submit(dev, mcux_msg); diff --git a/drivers/usb/udc/udc_mcux_ip3511.c b/drivers/usb/udc/udc_mcux_ip3511.c index c6aab0d0bb1..312acae1784 100644 --- a/drivers/usb/udc/udc_mcux_ip3511.c +++ b/drivers/usb/udc/udc_mcux_ip3511.c @@ -531,7 +531,7 @@ usb_status_t USB_DeviceNotificationTrigger(void *handle, void *msg) udc_submit_event(dev, UDC_EVT_VBUS_READY, 0); break; case kUSB_DeviceNotifySOF: - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); break; default: udc_mcux_event_submit(dev, mcux_msg); diff --git a/drivers/usb/udc/udc_nrf.c b/drivers/usb/udc/udc_nrf.c index 7b18862fa59..71eebbd70d3 100644 --- a/drivers/usb/udc/udc_nrf.c +++ b/drivers/usb/udc/udc_nrf.c @@ -436,7 +436,7 @@ static void ev_sof_handler(void) m_ep_armed &= ~USBD_EPISO_BIT_MASK; - udc_submit_sof_event(udc_nrf_dev); + udc_submit_event(udc_nrf_dev, UDC_EVT_SOF, 0); } static void usbd_in_packet_sent(uint8_t ep) @@ -1547,7 +1547,7 @@ static void udc_nrf_power_handler(nrfx_power_usb_evt_t pwr_evt) break; case NRFX_POWER_USB_EVT_READY: LOG_DBG("POWER event ready"); - nrf_usbd_legacy_start(IS_ENABLED(CONFIG_UDC_ENABLE_SOF)); + nrf_usbd_legacy_start(true); break; case NRFX_POWER_USB_EVT_REMOVED: LOG_DBG("POWER event removed"); diff --git a/drivers/usb/udc/udc_numaker.c b/drivers/usb/udc/udc_numaker.c index 43630010caa..bbc016ecf70 100644 --- a/drivers/usb/udc/udc_numaker.c +++ b/drivers/usb/udc/udc_numaker.c @@ -171,9 +171,7 @@ static inline void numaker_usbd_sw_connect(const struct device *dev) base->INTSTS = base->INTSTS; /* Enable relevant interrupts */ - base->INTEN = USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | - IF_ENABLED(CONFIG_UDC_ENABLE_SOF, (USBD_INT_SOF |)) - USBD_INT_WAKEUP; + base->INTEN = USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP | USBD_INT_SOF; /* Clear SE0 for connect */ base->SE0 &= ~USBD_DRVSE0; @@ -1300,7 +1298,7 @@ static void numaker_udbd_isr(const struct device *dev) base->INTSTS = USBD_INTSTS_SOFIF_Msk; /* UDC stack would handle bottom-half processing */ - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); } /* USB Setup/EP */ diff --git a/drivers/usb/udc/udc_renesas_ra.c b/drivers/usb/udc/udc_renesas_ra.c index 4a3123ec2b9..fa98fda46ac 100644 --- a/drivers/usb/udc/udc_renesas_ra.c +++ b/drivers/usb/udc/udc_renesas_ra.c @@ -79,7 +79,7 @@ static void udc_renesas_ra_event_handler(usbd_callback_arg_t *p_args) break; case USBD_EVENT_SOF: - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); break; default: diff --git a/drivers/usb/udc/udc_rpi_pico.c b/drivers/usb/udc/udc_rpi_pico.c index 70ebf047399..31561f6fce6 100644 --- a/drivers/usb/udc/udc_rpi_pico.c +++ b/drivers/usb/udc/udc_rpi_pico.c @@ -678,7 +678,7 @@ static void rpi_pico_isr_handler(const struct device *dev) if (status & USB_INTS_DEV_SOF_BITS) { handled |= USB_INTS_DEV_SOF_BITS; - udc_submit_sof_event(dev); + sys_read32((mm_reg_t)&base->sof_rd); } if (status & USB_INTS_DEV_CONN_DIS_BITS) { @@ -1048,7 +1048,7 @@ static int udc_rpi_pico_enable(const struct device *dev) sys_write32(USB_SIE_CTRL_EP0_INT_1BUF_BITS, (mm_reg_t)&base->sie_ctrl); /* Enable interrupts */ - sys_write32(IF_ENABLED(CONFIG_UDC_ENABLE_SOF, (USB_INTE_DEV_SOF_BITS |)) + sys_write32(USB_INTE_DEV_SOF_BITS | USB_INTE_SETUP_REQ_BITS | USB_INTE_DEV_RESUME_FROM_HOST_BITS | USB_INTE_DEV_SUSPEND_BITS | diff --git a/drivers/usb/udc/udc_sam0.c b/drivers/usb/udc/udc_sam0.c index e351c98e284..dab462a03fa 100644 --- a/drivers/usb/udc/udc_sam0.c +++ b/drivers/usb/udc/udc_sam0.c @@ -693,7 +693,7 @@ static void sam0_isr_handler(const struct device *dev) base->INTFLAG.reg = intflag; if (intflag & USB_DEVICE_INTFLAG_SOF) { - udc_submit_sof_event(dev); + udc_submit_event(dev, UDC_EVT_SOF, 0); } if (intflag & USB_DEVICE_INTFLAG_EORST) { diff --git a/drivers/usb/udc/udc_skeleton.c b/drivers/usb/udc/udc_skeleton.c index 2c9be371dec..c808cc98ad8 100644 --- a/drivers/usb/udc/udc_skeleton.c +++ b/drivers/usb/udc/udc_skeleton.c @@ -233,10 +233,6 @@ static int udc_skeleton_init(const struct device *dev) return -EIO; } - if (IS_ENABLED(CONFIG_UDC_ENABLE_SOF)) { - LOG_INF("Enable SOF interrupt"); - } - return 0; } diff --git a/drivers/usb/udc/udc_stm32.c b/drivers/usb/udc/udc_stm32.c index f773a1c641d..6cc8c4add1c 100644 --- a/drivers/usb/udc/udc_stm32.c +++ b/drivers/usb/udc/udc_stm32.c @@ -182,7 +182,7 @@ void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd) { struct udc_stm32_data *priv = hpcd2data(hpcd); - udc_submit_sof_event(priv->dev); + udc_submit_event(priv->dev, UDC_EVT_SOF, 0); } static int usbd_ctrl_feed_dout(const struct device *dev, const size_t length) diff --git a/subsys/usb/device_next/class/Kconfig.uac2 b/subsys/usb/device_next/class/Kconfig.uac2 index 5c19e0542c3..ad6fb54b38a 100644 --- a/subsys/usb/device_next/class/Kconfig.uac2 +++ b/subsys/usb/device_next/class/Kconfig.uac2 @@ -4,7 +4,6 @@ config USBD_AUDIO2_CLASS bool "USB Audio 2 class support [EXPERIMENTAL]" - select UDC_ENABLE_SOF help USB Audio 2 device class support. diff --git a/tests/drivers/udc/prj.conf b/tests/drivers/udc/prj.conf index 975887e579c..380d5e74b99 100644 --- a/tests/drivers/udc/prj.conf +++ b/tests/drivers/udc/prj.conf @@ -5,7 +5,6 @@ CONFIG_LOG=y CONFIG_ZTEST=y CONFIG_UDC_DRIVER=y -CONFIG_UDC_ENABLE_SOF=y CONFIG_UDC_BUF_COUNT=16 CONFIG_UDC_BUF_POOL_SIZE=16384 CONFIG_UDC_DRIVER_LOG_LEVEL_INF=y diff --git a/tests/subsys/usb/device_next/prj.conf b/tests/subsys/usb/device_next/prj.conf index 05fc7b0b028..54321edc952 100644 --- a/tests/subsys/usb/device_next/prj.conf +++ b/tests/subsys/usb/device_next/prj.conf @@ -6,7 +6,6 @@ CONFIG_ZTEST=y CONFIG_USB_DEVICE_STACK_NEXT=y CONFIG_USBD_LOOPBACK_CLASS=y -CONFIG_UDC_ENABLE_SOF=y CONFIG_UHC_DRIVER=y CONFIG_USB_HOST_STACK=y From f560347bf680aea13f2a5c30087b995f6e264800 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 578/881] Revert "[nrf fromtree] drivers: udc: add SOF Kconfig option and SOF event helper" This reverts commit ab54afcda7afe12408f1dbb636a231894e085606. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/Kconfig | 6 ------ drivers/usb/udc/udc_common.h | 23 ----------------------- 2 files changed, 29 deletions(-) diff --git a/drivers/usb/udc/Kconfig b/drivers/usb/udc/Kconfig index b2c64634315..b6c49e6b3e7 100644 --- a/drivers/usb/udc/Kconfig +++ b/drivers/usb/udc/Kconfig @@ -42,12 +42,6 @@ config UDC_BUF_FORCE_NOCACHE Place the buffer pools in the nocache memory region if the driver cannot handle buffers in cached memory. -config UDC_ENABLE_SOF - bool "SOF interrupt processing" - help - Enabled SoF interrupts can cause a very high CPU load on high-speed - controllers because the interrupt rate would be 125 µs. - config UDC_WORKQUEUE bool "Use a dedicate work queue for UDC drivers" help diff --git a/drivers/usb/udc/udc_common.h b/drivers/usb/udc/udc_common.h index ed6712e95ae..8cad6b6dd1c 100644 --- a/drivers/usb/udc/udc_common.h +++ b/drivers/usb/udc/udc_common.h @@ -156,29 +156,6 @@ int udc_submit_event(const struct device *dev, int udc_submit_ep_event(const struct device *dev, struct net_buf *const buf, const int err); - -/** - * @brief Helper function to send UDC SOF event to a higher level. - * - * Type of this event is hardcoded to UDC_EVT_SOF. - * - * @param[in] dev Pointer to device struct of the driver instance - */ -#if defined(CONFIG_UDC_ENABLE_SOF) -static inline void udc_submit_sof_event(const struct device *dev) -{ - struct udc_data *data = dev->data; - struct udc_event drv_evt = { - .type = UDC_EVT_SOF, - .dev = dev, - }; - - (void)data->event_cb(dev, &drv_evt); -} -#else -#define udc_submit_sof_event(dev) ARG_UNUSED(dev) -#endif - /** * @brief Helper function to enable endpoint. * From 5645a5bf0abcdf6a405a5f9977167791a8332f07 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:29 +0300 Subject: [PATCH 579/881] Revert "[nrf fromtree] drivers: udc_dwc2: Disable control IN endpoint on SETUP" This reverts commit 105b0e521217db2470538c6c80ca38c46d33b96c. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 856324942d0..02652e0bfc1 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -824,7 +824,6 @@ static int dwc2_handle_evt_setup(const struct device *dev) * transfer beforehand. In Buffer DMA the SETUP can be copied to any EP0 * OUT buffer. If there is any buffer queued, it is obsolete now. */ - udc_dwc2_ep_disable(dev, cfg_in, false); atomic_and(&priv->xfer_finished, ~(BIT(0) | BIT(16))); buf = udc_buf_get_all(cfg_out); @@ -834,6 +833,7 @@ static int dwc2_handle_evt_setup(const struct device *dev) buf = udc_buf_get_all(cfg_in); if (buf) { + udc_dwc2_ep_disable(dev, cfg_in, false); net_buf_unref(buf); } From 2b83435fbc72076eb71ac60c8f47d61c128888d2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 580/881] Revert "[nrf fromtree] drivers: udc_dwc2: Inline vendor quirks if possible" This reverts commit 70ef15a212ab88bb942822923fdb101ce1fb83ef. Signed-off-by: Jukka Rissanen --- drivers/usb/udc/udc_dwc2.c | 10 ++++++++-- drivers/usb/udc/udc_dwc2.h | 16 +++------------- drivers/usb/udc/udc_dwc2_vendor_quirks.h | 17 ++++++++++------- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 02652e0bfc1..269dfd56ee5 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT snps_dwc2 - #include "udc_common.h" #include "udc_dwc2.h" @@ -24,6 +22,7 @@ #include LOG_MODULE_REGISTER(udc_dwc2, CONFIG_UDC_DRIVER_LOG_LEVEL); +#include "udc_dwc2_vendor_quirks.h" enum dwc2_drv_event_type { /* USB connection speed determined after bus reset */ @@ -3197,6 +3196,13 @@ static const struct udc_api udc_dwc2_api = { .ep_dequeue = udc_dwc2_ep_dequeue, }; +#define DT_DRV_COMPAT snps_dwc2 + +#define UDC_DWC2_VENDOR_QUIRK_GET(n) \ + COND_CODE_1(DT_NODE_VENDOR_HAS_IDX(DT_DRV_INST(n), 1), \ + (&dwc2_vendor_quirks_##n), \ + (NULL)) + #define UDC_DWC2_DT_INST_REG_ADDR(n) \ COND_CODE_1(DT_NUM_REGS(DT_DRV_INST(n)), (DT_INST_REG_ADDR(n)), \ (DT_INST_REG_ADDR_BY_NAME(n, core))) diff --git a/drivers/usb/udc/udc_dwc2.h b/drivers/usb/udc/udc_dwc2.h index 77be96adaa5..87e71f81899 100644 --- a/drivers/usb/udc/udc_dwc2.h +++ b/drivers/usb/udc/udc_dwc2.h @@ -46,7 +46,7 @@ struct udc_dwc2_config { /* Pointer to pin control configuration or NULL */ struct pinctrl_dev_config *const pcfg; /* Pointer to vendor quirks or NULL */ - const struct dwc2_vendor_quirks *const quirks; + struct dwc2_vendor_quirks *const quirks; void (*make_thread)(const struct device *dev); void (*irq_enable_func)(const struct device *dev); void (*irq_disable_func)(const struct device *dev); @@ -55,23 +55,13 @@ struct udc_dwc2_config { uint32_t ghwcfg4; }; -#include "udc_dwc2_vendor_quirks.h" - -#define UDC_DWC2_VENDOR_QUIRK_GET(n) \ - COND_CODE_1(DT_NODE_VENDOR_HAS_IDX(DT_DRV_INST(n), 1), \ - (&dwc2_vendor_quirks_##n), \ - (NULL)) - #define DWC2_QUIRK_FUNC_DEFINE(fname) \ static inline int dwc2_quirk_##fname(const struct device *dev) \ { \ const struct udc_dwc2_config *const config = dev->config; \ - const struct dwc2_vendor_quirks *const quirks = \ - COND_CODE_1(IS_EQ(DT_NUM_INST_STATUS_OKAY(snps_dwc2), 1), \ - (UDC_DWC2_VENDOR_QUIRK_GET(0); ARG_UNUSED(config);), \ - (config->quirks;)) \ + struct dwc2_vendor_quirks *quirks = config->quirks; \ \ - if (quirks != NULL && quirks->fname != NULL) { \ + if (quirks != NULL && config->quirks->fname != NULL) { \ return quirks->fname(dev); \ } \ \ diff --git a/drivers/usb/udc/udc_dwc2_vendor_quirks.h b/drivers/usb/udc/udc_dwc2_vendor_quirks.h index f5a70063c2e..0a102188139 100644 --- a/drivers/usb/udc/udc_dwc2_vendor_quirks.h +++ b/drivers/usb/udc/udc_dwc2_vendor_quirks.h @@ -25,6 +25,8 @@ struct usb_dw_stm32_clk { size_t pclken_len; }; +#define DT_DRV_COMPAT snps_dwc2 + static inline int stm32f4_fsotg_enable_clk(const struct usb_dw_stm32_clk *const clk) { int ret; @@ -92,7 +94,7 @@ static inline int stm32f4_fsotg_disable_phy(const struct device *dev) return stm32f4_fsotg_enable_clk(&stm32f4_clk_##n); \ } \ \ - const struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \ + struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \ .pre_enable = stm32f4_fsotg_enable_clk_##n, \ .post_enable = stm32f4_fsotg_enable_phy, \ .disable = stm32f4_fsotg_disable_phy, \ @@ -102,11 +104,14 @@ static inline int stm32f4_fsotg_disable_phy(const struct device *dev) DT_INST_FOREACH_STATUS_OKAY(QUIRK_STM32F4_FSOTG_DEFINE) +#undef DT_DRV_COMPAT + #endif /*DT_HAS_COMPAT_STATUS_OKAY(st_stm32f4_fsotg) */ #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_usbhs) -#include +#define DT_DRV_COMPAT snps_dwc2 + #include #include @@ -124,7 +129,6 @@ static K_EVENT_DEFINE(usbhs_events); static void usbhs_vbus_handler(nrfs_usb_evt_t const *p_evt, void *const context) { - LOG_MODULE_DECLARE(udc_dwc2, CONFIG_UDC_DRIVER_LOG_LEVEL); const struct device *dev = context; switch (p_evt->type) { @@ -152,7 +156,6 @@ static void usbhs_vbus_handler(nrfs_usb_evt_t const *p_evt, void *const context) static inline int usbhs_enable_nrfs_service(const struct device *dev) { - LOG_MODULE_DECLARE(udc_dwc2, CONFIG_UDC_DRIVER_LOG_LEVEL); nrfs_err_t nrfs_err; int err; @@ -179,7 +182,6 @@ static inline int usbhs_enable_nrfs_service(const struct device *dev) static inline int usbhs_enable_core(const struct device *dev) { - LOG_MODULE_DECLARE(udc_dwc2, CONFIG_UDC_DRIVER_LOG_LEVEL); NRF_USBHS_Type *wrapper = USBHS_DT_WRAPPER_REG_ADDR(0); k_timeout_t timeout = K_FOREVER; @@ -227,7 +229,6 @@ static inline int usbhs_disable_core(const struct device *dev) static inline int usbhs_disable_nrfs_service(const struct device *dev) { - LOG_MODULE_DECLARE(udc_dwc2, CONFIG_UDC_DRIVER_LOG_LEVEL); nrfs_err_t nrfs_err; nrfs_err = nrfs_usb_disable_request((void *)dev); @@ -296,7 +297,7 @@ static inline int usbhs_pre_hibernation_exit(const struct device *dev) } #define QUIRK_NRF_USBHS_DEFINE(n) \ - const struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \ + struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \ .init = usbhs_enable_nrfs_service, \ .pre_enable = usbhs_enable_core, \ .disable = usbhs_disable_core, \ @@ -310,6 +311,8 @@ static inline int usbhs_pre_hibernation_exit(const struct device *dev) DT_INST_FOREACH_STATUS_OKAY(QUIRK_NRF_USBHS_DEFINE) +#undef DT_DRV_COMPAT + #endif /*DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_usbhs) */ /* Add next vendor quirks definition above this line */ From b1de29678f5883884198f926a64beab1ce359019 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 581/881] Revert "[nrf fromtree] samples: usb: uac2: Implement feedback on nRF54H20" This reverts commit da47bd000e764bfee47ada326729877fbff2a805. Signed-off-by: Jukka Rissanen --- .../usb/uac2_explicit_feedback/CMakeLists.txt | 4 +- .../subsys/usb/uac2_explicit_feedback/Kconfig | 2 - .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 8 --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 72 ------------------- .../usb/uac2_explicit_feedback/sample.yaml | 4 +- .../src/{feedback_nrf.c => feedback_nrf53.c} | 59 +++------------ .../usb/uac2_implicit_feedback/CMakeLists.txt | 4 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 -- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 67 ----------------- .../usb/uac2_implicit_feedback/sample.yaml | 4 +- .../src/{feedback_nrf.c => feedback_nrf53.c} | 43 ++--------- 11 files changed, 21 insertions(+), 253 deletions(-) delete mode 100644 samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay rename samples/subsys/usb/uac2_explicit_feedback/src/{feedback_nrf.c => feedback_nrf53.c} (89%) delete mode 100644 samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay rename samples/subsys/usb/uac2_implicit_feedback/src/{feedback_nrf.c => feedback_nrf53.c} (85%) diff --git a/samples/subsys/usb/uac2_explicit_feedback/CMakeLists.txt b/samples/subsys/usb/uac2_explicit_feedback/CMakeLists.txt index 56bba10717c..26ce264c421 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/CMakeLists.txt +++ b/samples/subsys/usb/uac2_explicit_feedback/CMakeLists.txt @@ -7,8 +7,8 @@ project(usb_audio_async_i2s) include(${ZEPHYR_BASE}/samples/subsys/usb/common/common.cmake) target_sources(app PRIVATE src/main.c) -if (CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP OR CONFIG_SOC_SERIES_NRF54HX) - target_sources(app PRIVATE src/feedback_nrf.c) +if (CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP) + target_sources(app PRIVATE src/feedback_nrf53.c) else() target_sources(app PRIVATE src/feedback_dummy.c) endif() diff --git a/samples/subsys/usb/uac2_explicit_feedback/Kconfig b/samples/subsys/usb/uac2_explicit_feedback/Kconfig index 76373b61469..bee6118a00d 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/Kconfig +++ b/samples/subsys/usb/uac2_explicit_feedback/Kconfig @@ -9,8 +9,6 @@ config APP_USE_I2S_LRCLK_EDGES_COUNTER Use this to use I2S LRCLK edge counting for calculating feedback. On nRF53 this option requires externally connecting I2S LRCLK back to separate GPIOTE input pin (P1.09). - On nRF54 this option requires externally connecting TDM FSYNC back to - separate GPIOTE input pin (P0.08). endmenu # Source common USB sample options used to initialize new experimental USB diff --git a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index 0e35fa1f491..00000000000 --- a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1,8 +0,0 @@ -# Enable timer for asynchronous feedback -CONFIG_NRFX_GPPI=y -CONFIG_NRFX_TIMER131=y -CONFIG_NRFX_GPIOTE130=y - -# Sample is Full-Speed only, prevent High-Speed enumeration -CONFIG_UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED=n -CONFIG_USBD_MAX_SPEED_FULL=y diff --git a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 0e6b18cbae9..00000000000 --- a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "../app.overlay" - -&pinctrl { - tdm130_default_alt: tdm130_default_alt { - group1 { - psels = , - , - ; - }; - }; -}; - -i2s_tx: &tdm130 { - status = "okay"; - pinctrl-0 = <&tdm130_default_alt>; - pinctrl-names = "default"; - memory-regions = <&cpuapp_dma_region>; - mck-clock-source = "ACLK"; - sck-clock-source = "ACLK"; -}; - -&audiopll { - frequency = ; - status = "okay"; -}; - -&cpuapp_dma_region { - status = "okay"; -}; - -/* PPI channel 0 for TDM130 MAXCNT */ -&dppic132 { - compatible = "nordic,nrf-dppic-global"; - owned-channels = <0>; - source-channels = <0>; - nonsecure-channels = <0>; - status = "okay"; -}; - -/* PPI channel 1 for GPIOTE used for feedback in edge counter mode */ -&gpiote130 { - status = "okay"; - owned-channels = <1>; -}; - -/* GPIOTE130 and TDM130 PPI needs routing to TIMER131 through main APB */ -&dppic130 { - compatible = "nordic,nrf-dppic-global"; - owned-channels = <0 1>; - sink-channels = <0 1>; - source-channels = <0 1>; - nonsecure-channels = <0 1>; - status = "okay"; -}; - -/* TIMER131 PPI channel 2 is used for SOF */ -&dppic133 { - compatible = "nordic,nrf-dppic-global"; - owned-channels = <0 1 2>; - sink-channels = <0 1 2>; - status = "okay"; -}; - -&timer131 { - status = "okay"; -}; diff --git a/samples/subsys/usb/uac2_explicit_feedback/sample.yaml b/samples/subsys/usb/uac2_explicit_feedback/sample.yaml index 9a58d1b6443..bc0797a9812 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/sample.yaml +++ b/samples/subsys/usb/uac2_explicit_feedback/sample.yaml @@ -8,7 +8,5 @@ tests: tags: - usb - i2s - platform_allow: - - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp harness: TBD diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf53.c similarity index 89% rename from samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c rename to samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf53.c index 62a7ad05ef9..7e949d61211 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf53.c @@ -12,56 +12,18 @@ #include #include #include +#include +#include #include LOG_MODULE_REGISTER(feedback, LOG_LEVEL_INF); -#define FEEDBACK_TIMER_USBD_SOF_CAPTURE 0 -#define FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE 1 - -#if IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP) - -#include -#include +static const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(0); #define FEEDBACK_PIN NRF_GPIO_PIN_MAP(1, 9) -#define FEEDBACK_GPIOTE_INSTANCE_NUMBER 0 #define FEEDBACK_TIMER_INSTANCE_NUMBER 2 -#define USB_SOF_EVENT_ADDRESS nrf_usbd_event_address_get(NRF_USBD, NRF_USBD_EVENT_SOF) -#define I2S_FRAMESTART_EVENT_ADDRESS nrf_i2s_event_address_get(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART) - -static inline void feedback_target_init(void) -{ - if (IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)) { - /* App core is using feedback pin */ - nrf_gpio_pin_control_select(FEEDBACK_PIN, NRF_GPIO_PIN_SEL_APP); - } -} - -#elif IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) - -#include - -#define FEEDBACK_PIN NRF_GPIO_PIN_MAP(0, 8) -#define FEEDBACK_GPIOTE_INSTANCE_NUMBER 130 -#define FEEDBACK_TIMER_INSTANCE_NUMBER 131 -#define USB_SOF_EVENT_ADDRESS nrf_timer_event_address_get(NRF_TIMER131, NRF_TIMER_EVENT_COMPARE5) -#define I2S_FRAMESTART_EVENT_ADDRESS nrf_tdm_event_address_get(NRF_TDM130, NRF_TDM_EVENT_MAXCNT) - -static inline void feedback_target_init(void) -{ - /* Enable Start-of-Frame workaround in TIMER131 */ - *(volatile uint32_t *)0x5F9A3C04 = 0x00000002; - *(volatile uint32_t *)0x5F9A3C04 = 0x00000003; - *(volatile uint32_t *)0x5F9A3C80 = 0x00000082; -} - -#else -#error "Unsupported target" -#endif - -static const nrfx_gpiote_t gpiote = - NRFX_GPIOTE_INSTANCE(FEEDBACK_GPIOTE_INSTANCE_NUMBER); +#define FEEDBACK_TIMER_USBD_SOF_CAPTURE 0 +#define FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE 1 static const nrfx_timer_t feedback_timer_instance = NRFX_TIMER_INSTANCE(FEEDBACK_TIMER_INSTANCE_NUMBER); @@ -118,12 +80,13 @@ static nrfx_err_t feedback_edge_counter_setup(void) .trigger = NRFX_GPIOTE_TRIGGER_TOGGLE, .p_in_channel = &feedback_gpiote_channel, }; - nrf_gpio_pin_pull_t pull = NRF_GPIO_PIN_PULLUP; nrfx_gpiote_input_pin_config_t input_pin_config = { - .p_pull_config = &pull, .p_trigger_config = &trigger_config, }; + /* App core is using feedback pin */ + nrf_gpio_pin_control_select(FEEDBACK_PIN, NRF_GPIO_PIN_SEL_APP); + err = nrfx_gpiote_channel_alloc(&gpiote, &feedback_gpiote_channel); if (err != NRFX_SUCCESS) { return err; @@ -188,8 +151,6 @@ struct feedback_ctx *feedback_init(void) uint8_t usbd_sof_gppi_channel; uint8_t i2s_framestart_gppi_channel; - feedback_target_init(); - feedback_reset_ctx(&fb_ctx); if (IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)) { @@ -210,7 +171,7 @@ struct feedback_ctx *feedback_init(void) } nrfx_gppi_channel_endpoints_setup(usbd_sof_gppi_channel, - USB_SOF_EVENT_ADDRESS, + nrf_usbd_event_address_get(NRF_USBD, NRF_USBD_EVENT_SOF), nrfx_timer_capture_task_address_get(&feedback_timer_instance, FEEDBACK_TIMER_USBD_SOF_CAPTURE)); nrfx_gppi_fork_endpoint_setup(usbd_sof_gppi_channel, @@ -227,7 +188,7 @@ struct feedback_ctx *feedback_init(void) } nrfx_gppi_channel_endpoints_setup(i2s_framestart_gppi_channel, - I2S_FRAMESTART_EVENT_ADDRESS, + nrf_i2s_event_address_get(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART), nrfx_timer_capture_task_address_get(&feedback_timer_instance, FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE)); diff --git a/samples/subsys/usb/uac2_implicit_feedback/CMakeLists.txt b/samples/subsys/usb/uac2_implicit_feedback/CMakeLists.txt index 56bba10717c..26ce264c421 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/CMakeLists.txt +++ b/samples/subsys/usb/uac2_implicit_feedback/CMakeLists.txt @@ -7,8 +7,8 @@ project(usb_audio_async_i2s) include(${ZEPHYR_BASE}/samples/subsys/usb/common/common.cmake) target_sources(app PRIVATE src/main.c) -if (CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP OR CONFIG_SOC_SERIES_NRF54HX) - target_sources(app PRIVATE src/feedback_nrf.c) +if (CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP) + target_sources(app PRIVATE src/feedback_nrf53.c) else() target_sources(app PRIVATE src/feedback_dummy.c) endif() diff --git a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index 1b1edb40666..00000000000 --- a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Enable timer for asynchronous feedback -CONFIG_NRFX_GPPI=y -CONFIG_NRFX_TIMER131=y - -# Sample is Full-Speed only, prevent High-Speed enumeration -CONFIG_UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED=n -CONFIG_USBD_MAX_SPEED_FULL=y diff --git a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 7fec156ff7e..00000000000 --- a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "../app.overlay" - -&pinctrl { - tdm130_default_alt: tdm130_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -i2s_rxtx: &tdm130 { - status = "okay"; - pinctrl-0 = <&tdm130_default_alt>; - pinctrl-names = "default"; - memory-regions = <&cpuapp_dma_region>; - mck-clock-source = "ACLK"; - sck-clock-source = "ACLK"; -}; - -&audiopll { - frequency = ; - status = "okay"; -}; - -&cpuapp_dma_region { - status = "okay"; -}; - -/* PPI channel 0 for TDM130 MAXCNT */ -&dppic132 { - compatible = "nordic,nrf-dppic-global"; - owned-channels = <0>; - source-channels = <0>; - nonsecure-channels = <0>; - status = "okay"; -}; - -/* TDM130 PPI needs routing to TIMER131 through main APB */ -&dppic130 { - compatible = "nordic,nrf-dppic-global"; - owned-channels = <0>; - sink-channels = <0>; - source-channels = <0>; - nonsecure-channels = <0>; - status = "okay"; -}; - -/* TIMER131 PPI channel 1 is used for SOF */ -&dppic133 { - compatible = "nordic,nrf-dppic-global"; - owned-channels = <0 1>; - sink-channels = <0 1>; - status = "okay"; -}; - -&timer131 { - status = "okay"; -}; diff --git a/samples/subsys/usb/uac2_implicit_feedback/sample.yaml b/samples/subsys/usb/uac2_implicit_feedback/sample.yaml index 03cf7145e89..6682ac0ed83 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/sample.yaml +++ b/samples/subsys/usb/uac2_implicit_feedback/sample.yaml @@ -8,7 +8,5 @@ tests: tags: - usb - i2s - platform_allow: - - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp harness: TBD diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf53.c similarity index 85% rename from samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c rename to samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf53.c index a7dfad370b8..ecc59f1a35a 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf53.c @@ -10,47 +10,16 @@ #include #include +#include +#include #include LOG_MODULE_REGISTER(feedback, LOG_LEVEL_INF); +#define FEEDBACK_TIMER_INSTANCE_NUMBER 2 #define FEEDBACK_TIMER_USBD_SOF_CAPTURE 0 #define FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE 1 -#if IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP) - -#include -#include - -#define FEEDBACK_TIMER_INSTANCE_NUMBER 2 -#define USB_SOF_EVENT_ADDRESS nrf_usbd_event_address_get(NRF_USBD, NRF_USBD_EVENT_SOF) -#define I2S_FRAMESTART_EVENT_ADDRESS nrf_i2s_event_address_get(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART) - -static inline void feedback_target_init(void) -{ - /* No target specific init necessary */ -} - -#elif IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) - -#include - -#define FEEDBACK_TIMER_INSTANCE_NUMBER 131 -#define USB_SOF_EVENT_ADDRESS nrf_timer_event_address_get(NRF_TIMER131, NRF_TIMER_EVENT_COMPARE5) -#define I2S_FRAMESTART_EVENT_ADDRESS nrf_tdm_event_address_get(NRF_TDM130, NRF_TDM_EVENT_MAXCNT) - -static inline void feedback_target_init(void) -{ - /* Enable Start-of-Frame workaround in TIMER131 */ - *(volatile uint32_t *)0x5F9A3C04 = 0x00000002; - *(volatile uint32_t *)0x5F9A3C04 = 0x00000003; - *(volatile uint32_t *)0x5F9A3C80 = 0x00000082; -} - -#else -#error "Unsupported target" -#endif - static const nrfx_timer_t feedback_timer_instance = NRFX_TIMER_INSTANCE(FEEDBACK_TIMER_INSTANCE_NUMBER); @@ -88,8 +57,6 @@ struct feedback_ctx *feedback_init(void) .p_context = NULL, }; - feedback_target_init(); - feedback_reset_ctx(&fb_ctx); err = nrfx_timer_init(&feedback_timer_instance, &cfg, NULL); @@ -106,7 +73,7 @@ struct feedback_ctx *feedback_init(void) } nrfx_gppi_channel_endpoints_setup(usbd_sof_gppi_channel, - USB_SOF_EVENT_ADDRESS, + nrf_usbd_event_address_get(NRF_USBD, NRF_USBD_EVENT_SOF), nrfx_timer_capture_task_address_get(&feedback_timer_instance, FEEDBACK_TIMER_USBD_SOF_CAPTURE)); nrfx_gppi_fork_endpoint_setup(usbd_sof_gppi_channel, @@ -123,7 +90,7 @@ struct feedback_ctx *feedback_init(void) } nrfx_gppi_channel_endpoints_setup(i2s_framestart_gppi_channel, - I2S_FRAMESTART_EVENT_ADDRESS, + nrf_i2s_event_address_get(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART), nrfx_timer_capture_task_address_get(&feedback_timer_instance, FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE)); From fc71406890a9ef79067d8ad72cc66d30c03edea8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 582/881] Revert "[nrf fromtree] samples: usb: uac2: Make I2S buffers UDC compliant" This reverts commit 50ba46ecf17f40ea9c1d324b3019ae89c27d0708. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/uac2_implicit_feedback/src/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/main.c b/samples/subsys/usb/uac2_implicit_feedback/src/main.c index b7720fe0331..a41f4b3814d 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/main.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/main.c @@ -37,10 +37,8 @@ LOG_MODULE_REGISTER(uac2_sample, LOG_LEVEL_INF); * errors when USB host decides to perform rapid terminal enable/disable cycles. */ #define I2S_BLOCKS 7 -K_MEM_SLAB_DEFINE_STATIC(i2s_tx_slab, ROUND_UP(MAX_BLOCK_SIZE, UDC_BUF_GRANULARITY), - I2S_BLOCKS, UDC_BUF_ALIGN); -K_MEM_SLAB_DEFINE_STATIC(i2s_rx_slab, ROUND_UP(MAX_BLOCK_SIZE, UDC_BUF_GRANULARITY), - I2S_BLOCKS, UDC_BUF_ALIGN); +K_MEM_SLAB_DEFINE_STATIC(i2s_tx_slab, MAX_BLOCK_SIZE, I2S_BLOCKS, 4); +K_MEM_SLAB_DEFINE_STATIC(i2s_rx_slab, MAX_BLOCK_SIZE, I2S_BLOCKS, 4); struct usb_i2s_ctx { const struct device *i2s_dev; From 9dfbc3c7384aa8b55ef7f6125f8925392b65fe93 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 583/881] Revert "[nrf fromtree] samples: usb: uac2: Leave cache management up to drivers" This reverts commit 602b2c4b75a0c934db61f9666a4f98f6dad9857e. Signed-off-by: Jukka Rissanen --- samples/subsys/usb/uac2_explicit_feedback/src/main.c | 2 ++ samples/subsys/usb/uac2_implicit_feedback/src/main.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/main.c b/samples/subsys/usb/uac2_explicit_feedback/src/main.c index 3f4f596f35c..e448416c745 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/main.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/main.c @@ -10,6 +10,7 @@ #include #include "feedback.h" +#include #include #include #include @@ -116,6 +117,7 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, */ size = BLOCK_SIZE; memset(buf, 0, size); + sys_cache_data_flush_range(buf, size); } LOG_DBG("Received %d data to input terminal %d", size, terminal); diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/main.c b/samples/subsys/usb/uac2_implicit_feedback/src/main.c index a41f4b3814d..f52d1227102 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/main.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/main.c @@ -10,6 +10,7 @@ #include #include "feedback.h" +#include #include #include #include @@ -163,6 +164,7 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, size = SAMPLES_PER_SOF * BYTES_PER_SLOT; } memset(buf, 0, size); + sys_cache_data_flush_range(buf, size); } LOG_DBG("Received %d data to input terminal %d", size, terminal); @@ -257,6 +259,7 @@ static void process_mic_data(const struct device *dev, struct usb_i2s_ctx *ctx) /* No data available, I2S will restart soon */ return; } + sys_cache_data_invd_range(rx_block, num_bytes); /* I2S operates on 2 channels (stereo) */ rx_samples = num_bytes / (BYTES_PER_SAMPLE * 2); @@ -311,6 +314,7 @@ static void process_mic_data(const struct device *dev, struct usb_i2s_ctx *ctx) ctx->pending_mic_samples = mic_samples; return; } + sys_cache_data_invd_range(rx_block, num_bytes); src = rx_block; rx_samples = num_bytes / (BYTES_PER_SAMPLE * 2); @@ -420,6 +424,7 @@ static void process_mic_data(const struct device *dev, struct usb_i2s_ctx *ctx) } /* Finally send the microphone samples to host */ + sys_cache_data_flush_range(mic_buf, mic_samples * BYTES_PER_SAMPLE); if (usbd_uac2_send(dev, MICROPHONE_IN_TERMINAL_ID, mic_buf, mic_samples * BYTES_PER_SAMPLE) < 0) { k_mem_slab_free(&i2s_rx_slab, mic_buf); From e5b34c7c5c71b5d18af2c55735925f38b98475f6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 584/881] Revert "[nrf fromtree] dts: nordic: remove nordic,cryptocell compatible" This reverts commit 0ca49a1fe554cfb10a969aadefe84455069f20c5. Signed-off-by: Jukka Rissanen --- dts/arm/nordic/nrf52840.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf91.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index dab5f762058..7c5337eed99 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -568,7 +568,7 @@ }; cryptocell: crypto@5002a000 { - compatible = "arm,cryptocell-310"; + compatible = "nordic,cryptocell", "arm,cryptocell-310"; reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>; reg-names = "wrapper", "core"; interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 30aaf9c9947..1b04be61248 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -100,7 +100,7 @@ }; cryptocell: crypto@50844000 { - compatible = "arm,cryptocell-312"; + compatible = "nordic,cryptocell", "arm,cryptocell-312"; reg = <0x50844000 0x1000>, <0x50845000 0x1000>; reg-names = "wrapper", "core"; interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 1747dcea74a..9a64ed92229 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -47,7 +47,7 @@ /* Additional Secure peripherals */ cryptocell: crypto@50840000 { - compatible = "arm,cryptocell-310"; + compatible = "nordic,cryptocell", "arm,cryptocell-310"; reg = <0x50840000 0x1000>, <0x50841000 0x1000>; reg-names = "wrapper", "core"; interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; From 928f0aeeaa8bbeca186ea5582d60131f21538ccb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 585/881] Revert "[nrf fromtree] drivers: pwm: nrfx: Add option to glitch free 100% duty cycle" This reverts commit c1d7194e05c3798e2acc6a461247eb20e5d27a0a. Signed-off-by: Jukka Rissanen --- drivers/pwm/Kconfig.nrfx | 10 ---------- drivers/pwm/pwm_nrfx.c | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/pwm/Kconfig.nrfx b/drivers/pwm/Kconfig.nrfx index d99b5aaf3ab..933fe7cb29c 100644 --- a/drivers/pwm/Kconfig.nrfx +++ b/drivers/pwm/Kconfig.nrfx @@ -20,13 +20,3 @@ config PWM_NRFX select PINCTRL help Enable support for nrfx Hardware PWM driver for nRF52 MCU series. - -config PWM_NRFX_NO_GLITCH_DUTY_100 - bool "No glitches when using 100% duty" - depends on $(dt_compat_any_has_prop,$(DT_COMPAT_NORDIC_NRF_PWM),idleout-supported,True) - default y - help - Due to how IDLEOUT feature in PWM works it is possible to see a glitch on a channel - with 100% duty cycle when all other channels switches to 0% or 100%. Enabling this - option ensures that there are no glitches but it also means that 100% duty cycle - on any channels requires PWM peripheral to be active. diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 6a106c12841..ec55bef6960 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -240,9 +240,6 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, /* Constantly active (duty 100%). */ /* This value is always greater than or equal to COUNTERTOP. */ compare_value = PWM_NRFX_CH_COMPARE_MASK; - needs_pwm = pwm_is_fast(config) || - (IS_ENABLED(NRF_PWM_HAS_IDLEOUT) && - IS_ENABLED(CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100)); } else { /* PWM generation needed. Check if the requested period matches * the one that is currently set, or the PWM peripheral can be @@ -282,8 +279,20 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, if (inverted) { out_level ^= 1; } - - nrf_gpio_pin_write(psel, out_level); + /* Output of fast PWM instance is directly connected to GPIO pads, + * thus it cannot controlled by GPIO. Use regular 0%/100% duty cycle + * playback instead. + */ +#ifdef PWM_NRFX_FAST_PRESENT + if (pwm_is_fast(config)) { + nrfx_pwm_simple_playback(&config->pwm, &config->seq, 1, + NRFX_PWM_FLAG_NO_EVT_FINISHED); + } else { +#else + { +#endif + nrf_gpio_pin_write(psel, out_level); + } } data->pwm_needed &= ~BIT(channel); From c81aae3408d98059f27356929e7171ec0195c60a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 586/881] Revert "[nrf fromtree] dts: pwm: nordic: Add idleout-supported property" This reverts commit 7dfaa46a277101953232c2bfbe71f257ad3ca271. Signed-off-by: Jukka Rissanen --- dts/bindings/pwm/nordic,nrf-pwm.yaml | 5 ----- dts/vendor/nordic/nrf54h20.dtsi | 5 ----- dts/vendor/nordic/nrf54l20.dtsi | 3 --- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 3 --- dts/vendor/nordic/nrf9280.dtsi | 5 ----- 5 files changed, 21 deletions(-) diff --git a/dts/bindings/pwm/nordic,nrf-pwm.yaml b/dts/bindings/pwm/nordic,nrf-pwm.yaml index e5adfc6ede9..8f481d8971c 100644 --- a/dts/bindings/pwm/nordic,nrf-pwm.yaml +++ b/dts/bindings/pwm/nordic,nrf-pwm.yaml @@ -18,11 +18,6 @@ properties: type: boolean description: Set this to use center-aligned (up and down) counter mode. - idleout-supported: - type: boolean - description: | - Indicates if the PWM instance has the IDLEOUT register. - "#pwm-cells": const: 3 diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 042725a1617..f907dd7fa2e 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -659,7 +659,6 @@ clocks = <&hsfll120>; power-domains = <&gpd NRF_GPD_FAST_ACTIVE1>; #pwm-cells = <3>; - idleout-supported; }; spis120: spi@8e5000 { @@ -1012,7 +1011,6 @@ clocks = <&fll16m>; power-domains = <&gpd NRF_GPD_SLOW_ACTIVE>; #pwm-cells = <3>; - idleout-supported; }; i2c130: i2c@9a5000 { @@ -1146,7 +1144,6 @@ clocks = <&fll16m>; power-domains = <&gpd NRF_GPD_SLOW_ACTIVE>; #pwm-cells = <3>; - idleout-supported; }; i2c132: i2c@9b5000 { @@ -1280,7 +1277,6 @@ clocks = <&fll16m>; #pwm-cells = <3>; power-domains = <&gpd NRF_GPD_SLOW_ACTIVE>; - idleout-supported; }; i2c134: i2c@9c5000 { @@ -1414,7 +1410,6 @@ clocks = <&fll16m>; #pwm-cells = <3>; power-domains = <&gpd NRF_GPD_SLOW_ACTIVE>; - idleout-supported; }; i2c136: i2c@9d5000 { diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi index de63a005c1d..4a4e90e75b4 100644 --- a/dts/vendor/nordic/nrf54l20.dtsi +++ b/dts/vendor/nordic/nrf54l20.dtsi @@ -488,7 +488,6 @@ reg = <0xd2000 0x1000>; interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; pwm21: pwm@d3000 { @@ -497,7 +496,6 @@ reg = <0xd3000 0x1000>; interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; pwm22: pwm@d4000 { @@ -506,7 +504,6 @@ reg = <0xd4000 0x1000>; interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; adc: adc@d5000 { diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 004454191f0..336d642afed 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -477,7 +477,6 @@ reg = <0xd2000 0x1000>; interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; pwm21: pwm@d3000 { @@ -486,7 +485,6 @@ reg = <0xd3000 0x1000>; interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; pwm22: pwm@d4000 { @@ -495,7 +493,6 @@ reg = <0xd4000 0x1000>; interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; adc: adc@d5000 { diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index fb27488e9dc..06e0a3a1514 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -479,7 +479,6 @@ status = "disabled"; interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; spi120: spi@8e6000 { @@ -768,7 +767,6 @@ status = "disabled"; interrupts = <420 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; i2c130: i2c@9a5000 { @@ -883,7 +881,6 @@ status = "disabled"; interrupts = <436 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; i2c132: i2c@9b5000 { @@ -998,7 +995,6 @@ status = "disabled"; interrupts = <452 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; i2c134: i2c@9c5000 { @@ -1113,7 +1109,6 @@ status = "disabled"; interrupts = <468 NRF_DEFAULT_IRQ_PRIORITY>; #pwm-cells = <3>; - idleout-supported; }; i2c136: i2c@9d5000 { From 548ae924f2ebc669030841c3d73cf0713d37c21c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 587/881] Revert "[nrf fromtree] bluetooth: host: Handle failure to disable scan when updating own_addr" This reverts commit 6453478e6c8af1d28036f0cb1bd94bf4a994d0c8. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index e52294cf538..12e8e823aaa 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -1994,8 +1994,8 @@ int bt_id_set_adv_own_addr(struct bt_le_ext_adv *adv, uint32_t options, if (!IS_ENABLED(CONFIG_BT_PRIVACY) && !IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) && dev_scanning) { - err = bt_le_scan_set_enable(BT_HCI_LE_SCAN_DISABLE); - scan_disabled = err == 0; + scan_disabled = true; + bt_le_scan_set_enable(BT_HCI_LE_SCAN_DISABLE); } /* If we are scanning with the identity address, it does From 8d3e3de9cecb699ca2c93f6454188f9a76222c85 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 588/881] Revert "[nrf fromtree] bluetooth: host: Do not try to set NRPA when scanning with identity" This reverts commit 3abc5c2cc2a78873ddc7f5971a82207b3ad6c619. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/id.c | 26 +---- .../host/id/bt_id_set_adv_own_addr/src/main.c | 102 ------------------ .../id/bt_id_set_adv_own_addr/testcase.yaml | 4 - 3 files changed, 5 insertions(+), 127 deletions(-) diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 12e8e823aaa..e791516e74c 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -1987,38 +1987,22 @@ int bt_id_set_adv_own_addr(struct bt_le_ext_adv *adv, uint32_t options, */ #if defined(CONFIG_BT_OBSERVER) bool scan_disabled = false; - bool dev_scanning = atomic_test_bit(bt_dev.flags, - BT_DEV_SCANNING); /* If active scan with NRPA is ongoing refresh NRPA */ if (!IS_ENABLED(CONFIG_BT_PRIVACY) && !IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) && - dev_scanning) { + atomic_test_bit(bt_dev.flags, BT_DEV_SCANNING)) { scan_disabled = true; bt_le_scan_set_enable(BT_HCI_LE_SCAN_DISABLE); } +#endif /* defined(CONFIG_BT_OBSERVER) */ + err = bt_id_set_adv_private_addr(adv); + *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; - /* If we are scanning with the identity address, it does - * not make sense to set an NRPA. - */ - if (!IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) || - !dev_scanning) { - err = bt_id_set_adv_private_addr(adv); - *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; - } else { - if (id_addr->type == BT_ADDR_LE_RANDOM) { - *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; - } else if (id_addr->type == BT_ADDR_LE_PUBLIC) { - *own_addr_type = BT_HCI_OWN_ADDR_PUBLIC; - } - } - +#if defined(CONFIG_BT_OBSERVER) if (scan_disabled) { bt_le_scan_set_enable(BT_HCI_LE_SCAN_ENABLE); } -#else - err = bt_id_set_adv_private_addr(adv); - *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; #endif /* defined(CONFIG_BT_OBSERVER) */ } else { err = bt_id_set_adv_private_addr(adv); diff --git a/tests/bluetooth/host/id/bt_id_set_adv_own_addr/src/main.c b/tests/bluetooth/host/id/bt_id_set_adv_own_addr/src/main.c index 8304906d37e..29c500e9840 100644 --- a/tests/bluetooth/host/id/bt_id_set_adv_own_addr/src/main.c +++ b/tests/bluetooth/host/id/bt_id_set_adv_own_addr/src/main.c @@ -7,10 +7,6 @@ #include "mocks/crypto.h" #include "mocks/scan.h" #include "mocks/scan_expects.h" -#include "mocks/hci_core.h" -#include "mocks/hci_core_expects.h" -#include "mocks/net_buf.h" -#include "mocks/net_buf_expects.h" #include "testing_common_defs.h" #include @@ -28,7 +24,6 @@ static void fff_reset_rule_before(const struct ztest_unit_test *test, void *fixt memset(&bt_dev, 0x00, sizeof(struct bt_dev)); CRYPTO_FFF_FAKES_LIST(RESET_FAKE); - HCI_CORE_FFF_FAKES_LIST(RESET_FAKE); } ZTEST_RULE(fff_reset_rule, fff_reset_rule_before, NULL); @@ -237,7 +232,6 @@ ZTEST(bt_id_set_adv_own_addr, test_observer_scanning_re_enabled_after_updating_a Z_TEST_SKIP_IFDEF(CONFIG_BT_PRIVACY); Z_TEST_SKIP_IFDEF(CONFIG_BT_EXT_ADV); - Z_TEST_SKIP_IFDEF(CONFIG_BT_SCAN_WITH_IDENTITY); Z_TEST_SKIP_IFNDEF(CONFIG_BT_OBSERVER); options &= ~BT_LE_ADV_OPT_CONN; @@ -247,102 +241,6 @@ ZTEST(bt_id_set_adv_own_addr, test_observer_scanning_re_enabled_after_updating_a atomic_set_bit(bt_dev.flags, BT_DEV_SCANNING); bt_id_set_adv_own_addr(&adv, options, true, &own_addr_type); - zassert_true(own_addr_type == BT_HCI_OWN_ADDR_RANDOM, - "Address type reference was incorrectly set"); expect_call_count_bt_le_scan_set_enable(2, expected_args_history); } - -/* - * Test setting the advertiser address while 'CONFIG_BT_SCAN_WITH_IDENTITY' is enabled - * and scanning is ongoing. The scanner is using a random identity address. - * - * Constraints: - * - Options 'BT_LE_ADV_OPT_CONN' bit isn't set - * - * Expected behaviour: - * - Scanning is not disabled. - * - The advertiser doesn't attempt to change the identity addr with bt_id_set_adv_private_addr() - * - The advertiser uses the same identity address as the scanner. - */ -ZTEST(bt_id_set_adv_own_addr, test_set_adv_own_addr_while_scanning_with_identity_random) -{ - uint32_t options = 0; - struct bt_le_ext_adv adv = {0}; - struct net_buf net_buff; - int err; - uint8_t scan_own_addr_type = BT_ADDR_LE_ANONYMOUS; - uint8_t adv_own_addr_type = BT_ADDR_LE_ANONYMOUS; - - Z_TEST_SKIP_IFDEF(CONFIG_BT_PRIVACY); - Z_TEST_SKIP_IFDEF(CONFIG_BT_EXT_ADV); - Z_TEST_SKIP_IFNDEF(CONFIG_BT_OBSERVER); - Z_TEST_SKIP_IFNDEF(CONFIG_BT_SCAN_WITH_IDENTITY); - - bt_hci_cmd_alloc_fake.return_val = &net_buff; - bt_hci_cmd_send_sync_fake.return_val = 0; - - options &= ~BT_LE_ADV_OPT_CONN; - bt_addr_le_copy(&bt_dev.id_addr[BT_ID_DEFAULT], BT_STATIC_RANDOM_LE_ADDR_1); - - err = bt_id_set_scan_own_addr(false, &scan_own_addr_type); - - expect_single_call_bt_hci_cmd_alloc(); - expect_single_call_bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_RANDOM_ADDRESS); - - zassert_ok(err, "Unexpected error code '%d' was returned", err); - zassert_true(scan_own_addr_type == BT_HCI_OWN_ADDR_RANDOM, - "Address type reference was incorrectly set"); - - atomic_set_bit(bt_dev.flags, BT_DEV_SCANNING); - - bt_id_set_adv_own_addr(&adv, options, true, &adv_own_addr_type); - zassert_true(adv_own_addr_type == BT_HCI_OWN_ADDR_RANDOM, - "Address type reference was incorrectly set"); - - expect_call_count_bt_le_scan_set_enable(0, NULL); -} - -/* - * Test setting the advertiser address while 'CONFIG_BT_SCAN_WITH_IDENTITY' is enabled - * and scanning is ongoing. The scanner is using a public identity address. - * - * Constraints: - * - Options 'BT_LE_ADV_OPT_CONN' bit isn't set - * - * Expected behaviour: - * - Scanning is not disabled. - * - The advertiser doesn't attempt to change the identity addr with bt_id_set_adv_private_addr() - * - The advertiser uses the same identity address as the scanner. - */ -ZTEST(bt_id_set_adv_own_addr, test_set_adv_own_addr_while_scanning_with_identity_public) -{ - uint32_t options = 0; - struct bt_le_ext_adv adv = {0}; - int err; - uint8_t scan_own_addr_type = BT_ADDR_LE_ANONYMOUS; - uint8_t adv_own_addr_type = BT_ADDR_LE_ANONYMOUS; - - Z_TEST_SKIP_IFDEF(CONFIG_BT_PRIVACY); - Z_TEST_SKIP_IFDEF(CONFIG_BT_EXT_ADV); - Z_TEST_SKIP_IFNDEF(CONFIG_BT_OBSERVER); - Z_TEST_SKIP_IFNDEF(CONFIG_BT_SCAN_WITH_IDENTITY); - - options &= ~BT_LE_ADV_OPT_CONN; - - bt_addr_le_copy(&bt_dev.id_addr[BT_ID_DEFAULT], BT_LE_ADDR); - - err = bt_id_set_scan_own_addr(false, &scan_own_addr_type); - - zassert_ok(err, "Unexpected error code '%d' was returned", err); - zassert_true(scan_own_addr_type == BT_HCI_OWN_ADDR_PUBLIC, - "Address type reference was incorrectly set"); - - atomic_set_bit(bt_dev.flags, BT_DEV_SCANNING); - - bt_id_set_adv_own_addr(&adv, options, true, &adv_own_addr_type); - zassert_true(adv_own_addr_type == BT_HCI_OWN_ADDR_PUBLIC, - "Address type reference was incorrectly set"); - - expect_call_count_bt_le_scan_set_enable(0, NULL); -} diff --git a/tests/bluetooth/host/id/bt_id_set_adv_own_addr/testcase.yaml b/tests/bluetooth/host/id/bt_id_set_adv_own_addr/testcase.yaml index d5ab3e4ef85..145096d0ce7 100644 --- a/tests/bluetooth/host/id/bt_id_set_adv_own_addr/testcase.yaml +++ b/tests/bluetooth/host/id/bt_id_set_adv_own_addr/testcase.yaml @@ -14,7 +14,3 @@ tests: extra_configs: - CONFIG_BT_SMP=y - CONFIG_BT_PRIVACY=y - bluetooth.host.bt_id_set_adv_own_addr.scan_with_identity: - type: unit - extra_configs: - - CONFIG_BT_SCAN_WITH_IDENTITY=y From ba423107e1ef66f77dfa8202c63ebbc5870551f6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 589/881] Revert "[nrf fromtree] bluetooth: host: rename bool scan_enabled -> scan_disabled" This reverts commit 2d8cdbbd2959dc284e61966e3cbbaf6309374604. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/id.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index e791516e74c..96c2f4e988a 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -1986,13 +1986,13 @@ int bt_id_set_adv_own_addr(struct bt_le_ext_adv *adv, uint32_t options, * problem. */ #if defined(CONFIG_BT_OBSERVER) - bool scan_disabled = false; + bool scan_enabled = false; /* If active scan with NRPA is ongoing refresh NRPA */ if (!IS_ENABLED(CONFIG_BT_PRIVACY) && !IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) && atomic_test_bit(bt_dev.flags, BT_DEV_SCANNING)) { - scan_disabled = true; + scan_enabled = true; bt_le_scan_set_enable(BT_HCI_LE_SCAN_DISABLE); } #endif /* defined(CONFIG_BT_OBSERVER) */ @@ -2000,7 +2000,7 @@ int bt_id_set_adv_own_addr(struct bt_le_ext_adv *adv, uint32_t options, *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; #if defined(CONFIG_BT_OBSERVER) - if (scan_disabled) { + if (scan_enabled) { bt_le_scan_set_enable(BT_HCI_LE_SCAN_ENABLE); } #endif /* defined(CONFIG_BT_OBSERVER) */ From 7a188e34cdc3dcb9a830c08e4339b3abfecc0e8b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 590/881] Revert "[nrf fromtree] bluetooth: host: Fix uninitialized own_addr_type for legacy scan+adv" This reverts commit d8c362172b5a281113bd285540f6eadd4ca40280. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/id.c | 54 +++---------- .../id/bt_id_set_scan_own_addr/src/main.c | 77 ------------------- .../id/bt_id_set_scan_own_addr/testcase.yaml | 4 - 3 files changed, 12 insertions(+), 123 deletions(-) diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 96c2f4e988a..af5176574eb 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -1778,7 +1778,7 @@ int bt_id_set_create_conn_own_addr(bool use_filter, uint8_t *own_addr_type) #endif /* defined(CONFIG_BT_CENTRAL) */ #if defined(CONFIG_BT_OBSERVER) -static bool is_legacy_adv_enabled(void) +static bool is_adv_using_rand_addr(void) { struct bt_le_ext_adv *adv; @@ -1794,27 +1794,7 @@ static bool is_legacy_adv_enabled(void) adv = bt_le_adv_lookup_legacy(); - return adv != NULL && atomic_test_bit(adv->flags, BT_ADV_ENABLED); -} - -static bool is_legacy_adv_using_id_addr(void) -{ - struct bt_le_ext_adv *adv; - - if (!IS_ENABLED(CONFIG_BT_BROADCASTER) || - (IS_ENABLED(CONFIG_BT_EXT_ADV) && - BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features))) { - /* When advertising is not enabled or is using extended - * advertising HCI commands then only the scanner uses the set - * random address command. - */ - return false; - } - - adv = bt_le_adv_lookup_legacy(); - - return adv != NULL && atomic_test_bit(adv->flags, BT_ADV_ENABLED) - && atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY); + return adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED); } int bt_id_set_scan_own_addr(bool active_scan, uint8_t *own_addr_type) @@ -1847,30 +1827,20 @@ int bt_id_set_scan_own_addr(bool active_scan, uint8_t *own_addr_type) * (through Kconfig). * Use same RPA as legacy advertiser if advertising. */ - if (!IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY)) { - /* When using legacy advertising commands, the scanner and advertiser - * share the same address, so we cannot change it. - * When using extended advertising commands, however, the advertising - * sets have their own addresses, so we can always change the scanner - * address here. - */ - if (is_legacy_adv_using_id_addr()) { - if (bt_dev.id_addr[BT_ID_DEFAULT].type == BT_ADDR_LE_RANDOM) { - *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; - } else { - *own_addr_type = BT_HCI_OWN_ADDR_PUBLIC; - } - } else if (is_legacy_adv_enabled()) { - *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; - } else { - err = bt_id_set_private_addr(BT_ID_DEFAULT); - if (err) { + if (!IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) && + !is_adv_using_rand_addr()) { + err = bt_id_set_private_addr(BT_ID_DEFAULT); + if (err) { + if (active_scan || !is_adv_using_rand_addr()) { return err; } - *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; + LOG_WRN("Ignoring failure to set address for passive scan (%d)", + err); } - } else { + + *own_addr_type = BT_HCI_OWN_ADDR_RANDOM; + } else if (IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY)) { if (bt_dev.id_addr[BT_ID_DEFAULT].type == BT_ADDR_LE_RANDOM) { /* If scanning with Identity Address we must set the * random identity address for both active and passive diff --git a/tests/bluetooth/host/id/bt_id_set_scan_own_addr/src/main.c b/tests/bluetooth/host/id/bt_id_set_scan_own_addr/src/main.c index 2c1fbc675d7..c39411897cd 100644 --- a/tests/bluetooth/host/id/bt_id_set_scan_own_addr/src/main.c +++ b/tests/bluetooth/host/id/bt_id_set_scan_own_addr/src/main.c @@ -7,8 +7,6 @@ #include "mocks/crypto.h" #include "mocks/hci_core.h" #include "mocks/rpa.h" -#include "mocks/adv.h" -#include "mocks/adv_expects.h" #include "testing_common_defs.h" #include @@ -77,81 +75,6 @@ ZTEST(bt_id_set_scan_own_addr, test_set_nrpa_scan_address_no_privacy) "Address type reference was incorrectly set"); } -/* - * Test setting scan own address while 'CONFIG_BT_PRIVACY' isn't enabled. - * Advertising is ongoing and uses a random device address. - * - * Constraints: - * - bt_id_set_private_addr() succeeds and returns 0 - * - 'CONFIG_BT_SCAN_WITH_IDENTITY' isn't enabled - * - 'CONFIG_BT_PRIVACY' isn't enabled - * - * Expected behaviour: - * - bt_id_set_scan_own_addr() returns 0 - * - Address type reference is updated - */ -ZTEST(bt_id_set_scan_own_addr, test_set_nrpa_scan_address_no_privacy_adv_ongoing_random_identity) -{ - int err; - struct bt_le_ext_adv *adv = &bt_dev.adv; - uint8_t own_addr_type = BT_ADDR_LE_ANONYMOUS; - - Z_TEST_SKIP_IFDEF(CONFIG_BT_PRIVACY); - Z_TEST_SKIP_IFDEF(CONFIG_BT_SCAN_WITH_IDENTITY); - Z_TEST_SKIP_IFNDEF(CONFIG_BT_BROADCASTER); - - bt_rand_fake.custom_fake = bt_rand_custom_fake; - bt_le_adv_lookup_legacy_fake.return_val = adv; - - bt_addr_le_copy(&bt_dev.id_addr[BT_ID_DEFAULT], BT_STATIC_RANDOM_LE_ADDR_1); - - atomic_set_bit(adv->flags, BT_ADV_ENABLED); - - err = bt_id_set_scan_own_addr(false, &own_addr_type); - - zassert_ok(err, "Unexpected error code '%d' was returned", err); - zassert_true(own_addr_type == BT_HCI_OWN_ADDR_RANDOM, - "Address type reference was incorrectly set"); -} - -/* - * Test setting scan own address while 'CONFIG_BT_PRIVACY' isn't enabled. - * Advertising is ongoing and uses a public device address. - * - * Constraints: - * - bt_id_set_private_addr() succeeds and returns 0 - * - 'CONFIG_BT_SCAN_WITH_IDENTITY' isn't enabled - * - 'CONFIG_BT_PRIVACY' isn't enabled - * - * Expected behaviour: - * - bt_id_set_scan_own_addr() returns 0 - * - Address type reference is updated - */ -ZTEST(bt_id_set_scan_own_addr, test_set_nrpa_scan_address_no_privacy_adv_ongoing_public_identity) -{ - int err; - struct bt_le_ext_adv *adv = &bt_dev.adv; - uint8_t own_addr_type = BT_ADDR_LE_ANONYMOUS; - - Z_TEST_SKIP_IFDEF(CONFIG_BT_PRIVACY); - Z_TEST_SKIP_IFDEF(CONFIG_BT_SCAN_WITH_IDENTITY); - Z_TEST_SKIP_IFNDEF(CONFIG_BT_BROADCASTER); - - bt_rand_fake.custom_fake = bt_rand_custom_fake; - bt_le_adv_lookup_legacy_fake.return_val = adv; - - bt_addr_le_copy(&bt_dev.id_addr[BT_ID_DEFAULT], BT_LE_ADDR); - - atomic_set_bit(adv->flags, BT_ADV_ENABLED); - atomic_set_bit(adv->flags, BT_ADV_USE_IDENTITY); - - err = bt_id_set_scan_own_addr(false, &own_addr_type); - - zassert_ok(err, "Unexpected error code '%d' was returned", err); - zassert_true(own_addr_type == BT_HCI_OWN_ADDR_PUBLIC, - "Address type reference was incorrectly set"); -} - /* * Test setting scan own address while 'CONFIG_BT_PRIVACY' isn't enabled. * If 'CONFIG_BT_SCAN_WITH_IDENTITY' is enabled and the default identity has an RPA address of type diff --git a/tests/bluetooth/host/id/bt_id_set_scan_own_addr/testcase.yaml b/tests/bluetooth/host/id/bt_id_set_scan_own_addr/testcase.yaml index 7e3cab5ce37..4198d2bf91b 100644 --- a/tests/bluetooth/host/id/bt_id_set_scan_own_addr/testcase.yaml +++ b/tests/bluetooth/host/id/bt_id_set_scan_own_addr/testcase.yaml @@ -20,7 +20,3 @@ tests: - CONFIG_BT_SCAN_WITH_IDENTITY=y - CONFIG_BT_SMP=y - CONFIG_BT_PRIVACY=y - bluetooth.host.bt_id_set_scan_own_addr.scan_while_advertising: - type: unit - extra_configs: - - CONFIG_BT_BROADCASTER=y From b62ac92b043b1a059119bb8a3d1cf982af6e1a63 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 591/881] Revert "[nrf fromtree] manifest: nrf_wifi: Pull new raw TX handling" This reverts commit 8e678b1e03730e0876608a8b6431ff6a8a1adcd4. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 9807058ac13..d3a70e36867 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: 968d55ff22579080466bf2f482596dd6e35361c6 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 52286f111b4765e0dd40f43124e7bb5c14758dff + revision: 7cb2f44f46dfc86e4f97477ee90022944e138dd8 path: modules/lib/nrf_wifi - name: open-amp revision: f7f4d083c7909a39d86e217376c69b416ec4faf3 From 9fb73ca5b824dd1d288e54b0c257daa8c34d2d28 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 592/881] Revert "[nrf fromtree] modules: nrf_wifi: Implement new Raw TX APIs" This reverts commit c890bf3f332b38e6a53969c5ab1198fc394ff727. Signed-off-by: Jukka Rissanen --- modules/nrf_wifi/os/shim.c | 57 -------------------------------------- 1 file changed, 57 deletions(-) diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index 29b72203b55..b892d50df7f 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -275,9 +275,6 @@ struct nwb { void (*cleanup_cb)(); unsigned char priority; bool chksum_done; -#ifdef CONFIG_NRF70_RAW_DATA_TX - void *raw_tx_hdr; -#endif /* CONFIG_NRF70_RAW_DATA_TX */ #ifdef CONFIG_NRF_WIFI_ZERO_COPY_TX struct net_pkt *pkt; #endif @@ -403,55 +400,6 @@ static void zep_shim_nbuf_set_chksum_done(void *nbuf, unsigned char chksum_done) nwb->chksum_done = (bool)chksum_done; } -#ifdef CONFIG_NRF70_RAW_DATA_TX -static void *zep_shim_nbuf_set_raw_tx_hdr(void *nbuf, unsigned short raw_hdr_len) -{ - struct nwb *nwb = (struct nwb *)nbuf; - - if (!nwb) { - LOG_ERR("%s: Received network buffer is NULL", __func__); - return NULL; - } - - nwb->raw_tx_hdr = zep_shim_nbuf_data_get(nwb); - if (!nwb->raw_tx_hdr) { - LOG_ERR("%s: Unable to set raw Tx header in network buffer", __func__); - return NULL; - } - - zep_shim_nbuf_data_pull(nwb, raw_hdr_len); - - return nwb->raw_tx_hdr; -} - -static void *zep_shim_nbuf_get_raw_tx_hdr(void *nbuf) -{ - struct nwb *nwb = (struct nwb *)nbuf; - - if (!nwb) { - LOG_ERR("%s: Received network buffer is NULL", __func__); - return NULL; - } - - return nwb->raw_tx_hdr; -} - -static bool zep_shim_nbuf_is_raw_tx(void *nbuf) -{ - struct nwb *nwb = (struct nwb *)nbuf; - - if (!nwb) { - LOG_ERR("%s: Received network buffer is NULL", __func__); - return false; - } - - return (nwb->raw_tx_hdr != NULL); -} -#endif /* CONFIG_NRF70_RAW_DATA_TX */ - - - - #include #include @@ -1244,11 +1192,6 @@ const struct nrf_wifi_osal_ops nrf_wifi_os_zep_ops = { .nbuf_get_priority = zep_shim_nbuf_get_priority, .nbuf_get_chksum_done = zep_shim_nbuf_get_chksum_done, .nbuf_set_chksum_done = zep_shim_nbuf_set_chksum_done, -#ifdef CONFIG_NRF70_RAW_DATA_TX - .nbuf_set_raw_tx_hdr = zep_shim_nbuf_set_raw_tx_hdr, - .nbuf_get_raw_tx_hdr = zep_shim_nbuf_get_raw_tx_hdr, - .nbuf_is_raw_tx = zep_shim_nbuf_is_raw_tx, -#endif /* CONFIG_NRF70_RAW_DATA_TX */ .tasklet_alloc = zep_shim_work_alloc, .tasklet_free = zep_shim_work_free, From feb7e2d0bef28e3eeaac8288ebd31111e1fe2402 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 593/881] Revert "[nrf fromtree] tests: bsim: bluetooth: Remove bt_hci_cmd_create() usage" This reverts commit b704c93b2db67b37885c5f5724a9db5f756b68b2. Signed-off-by: Jukka Rissanen --- .../host/att/pipeline/tester/src/main.c | 14 +++++++------- .../host/att/sequential/tester/src/main.c | 14 +++++++------- .../host/l2cap/reassembly/peer/src/peer.c | 16 ++++++++-------- .../bluetooth/host/l2cap/split/tester/src/main.c | 14 +++++++------- .../host/misc/disconnect/tester/src/main.c | 14 +++++++------- .../host/misc/hfc_multilink/tester/src/tester.c | 16 ++++++++-------- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/bsim/bluetooth/host/att/pipeline/tester/src/main.c b/tests/bsim/bluetooth/host/att/pipeline/tester/src/main.c index 08320f4b6ce..5ad05dfdff1 100644 --- a/tests/bsim/bluetooth/host/att/pipeline/tester/src/main.c +++ b/tests/bsim/bluetooth/host/att/pipeline/tester/src/main.c @@ -66,7 +66,7 @@ static uint16_t conn_handle; static volatile uint16_t active_opcode = 0xFFFF; static struct net_buf *cmd_rsp; -static struct net_buf *create_cmd(uint16_t opcode, uint8_t param_len) +struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len) { struct bt_hci_cmd_hdr *hdr; struct net_buf *buf; @@ -349,7 +349,7 @@ static void send_cmd(uint16_t opcode, struct net_buf *cmd, struct net_buf **rsp) LOG_DBG("opcode %x", opcode); if (!cmd) { - cmd = create_cmd(opcode, 0); + cmd = bt_hci_cmd_create(opcode, 0); } k_sem_take(&cmd_sem, K_FOREVER); @@ -420,7 +420,7 @@ static void read_max_data_len(uint16_t *tx_octets, uint16_t *tx_time) static void write_default_data_len(uint16_t tx_octets, uint16_t tx_time) { struct bt_hci_cp_le_write_default_data_len *cp; - struct net_buf *buf = create_cmd(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); + struct net_buf *buf = bt_hci_cmd_create(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); TEST_ASSERT_NO_MSG(buf); @@ -446,7 +446,7 @@ static void set_event_mask(uint16_t opcode) uint64_t mask = 0U; /* The two commands have the same length/params */ - buf = create_cmd(opcode, sizeof(*cp_mask)); + buf = bt_hci_cmd_create(opcode, sizeof(*cp_mask)); TEST_ASSERT_NO_MSG(buf); /* Forward all events */ @@ -464,7 +464,7 @@ static void set_random_address(void) LOG_DBG("%s", bt_addr_str(&addr.a)); - buf = create_cmd(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); TEST_ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &addr.a, sizeof(addr.a)); @@ -487,12 +487,12 @@ void start_adv(void) set_param.own_addr_type = BT_HCI_OWN_ADDR_RANDOM; /* configure */ - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); net_buf_add_mem(buf, &set_param, sizeof(set_param)); send_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, buf, NULL); /* start */ - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); net_buf_add_u8(buf, BT_HCI_LE_ADV_ENABLE); send_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, buf, NULL); } diff --git a/tests/bsim/bluetooth/host/att/sequential/tester/src/main.c b/tests/bsim/bluetooth/host/att/sequential/tester/src/main.c index 6059b906bca..a3622c956c8 100644 --- a/tests/bsim/bluetooth/host/att/sequential/tester/src/main.c +++ b/tests/bsim/bluetooth/host/att/sequential/tester/src/main.c @@ -61,7 +61,7 @@ static uint16_t conn_handle; static volatile uint16_t active_opcode = 0xFFFF; static struct net_buf *cmd_rsp; -static struct net_buf *create_cmd(uint16_t opcode, uint8_t param_len) +struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len) { struct bt_hci_cmd_hdr *hdr; struct net_buf *buf; @@ -326,7 +326,7 @@ static void send_cmd(uint16_t opcode, struct net_buf *cmd, struct net_buf **rsp) LOG_DBG("opcode %x", opcode); if (!cmd) { - cmd = create_cmd(opcode, 0); + cmd = bt_hci_cmd_create(opcode, 0); } k_sem_take(&cmd_sem, K_FOREVER); @@ -397,7 +397,7 @@ static void read_max_data_len(uint16_t *tx_octets, uint16_t *tx_time) static void write_default_data_len(uint16_t tx_octets, uint16_t tx_time) { struct bt_hci_cp_le_write_default_data_len *cp; - struct net_buf *buf = create_cmd(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); + struct net_buf *buf = bt_hci_cmd_create(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); TEST_ASSERT_NO_MSG(buf); @@ -423,7 +423,7 @@ static void set_event_mask(uint16_t opcode) uint64_t mask = 0U; /* The two commands have the same length/params */ - buf = create_cmd(opcode, sizeof(*cp_mask)); + buf = bt_hci_cmd_create(opcode, sizeof(*cp_mask)); TEST_ASSERT_NO_MSG(buf); /* Forward all events */ @@ -441,7 +441,7 @@ static void set_random_address(void) LOG_DBG("%s", bt_addr_str(&addr.a)); - buf = create_cmd(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); TEST_ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &addr.a, sizeof(addr.a)); @@ -464,12 +464,12 @@ void start_adv(void) set_param.own_addr_type = BT_HCI_OWN_ADDR_RANDOM; /* configure */ - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); net_buf_add_mem(buf, &set_param, sizeof(set_param)); send_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, buf, NULL); /* start */ - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); net_buf_add_u8(buf, BT_HCI_LE_ADV_ENABLE); send_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, buf, NULL); } diff --git a/tests/bsim/bluetooth/host/l2cap/reassembly/peer/src/peer.c b/tests/bsim/bluetooth/host/l2cap/reassembly/peer/src/peer.c index a3e7c20d715..8c953271884 100644 --- a/tests/bsim/bluetooth/host/l2cap/reassembly/peer/src/peer.c +++ b/tests/bsim/bluetooth/host/l2cap/reassembly/peer/src/peer.c @@ -57,7 +57,7 @@ static uint16_t conn_handle; static volatile uint16_t active_opcode = 0xFFFF; static struct net_buf *cmd_rsp; -static struct net_buf *create_cmd(uint16_t opcode, uint8_t param_len) +struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len) { struct bt_hci_cmd_hdr *hdr; struct net_buf *buf; @@ -279,7 +279,7 @@ static void send_cmd(uint16_t opcode, struct net_buf *cmd, struct net_buf **rsp) LOG_DBG("opcode %x", opcode); if (!cmd) { - cmd = create_cmd(opcode, 0); + cmd = bt_hci_cmd_create(opcode, 0); } k_sem_take(&cmd_sem, K_FOREVER); @@ -352,7 +352,7 @@ static void set_event_mask(uint16_t opcode) uint64_t mask = 0U; /* The two commands have the same length/params */ - buf = create_cmd(opcode, sizeof(*cp_mask)); + buf = bt_hci_cmd_create(opcode, sizeof(*cp_mask)); TEST_ASSERT_NO_MSG(buf); /* Forward all events */ @@ -370,7 +370,7 @@ static void set_random_address(void) LOG_DBG("%s", bt_addr_str(&addr.a)); - buf = create_cmd(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); TEST_ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &addr.a, sizeof(addr.a)); @@ -392,7 +392,7 @@ static void start_adv(uint16_t interval, const char *name, size_t name_len) data.data[1] = BT_DATA_NAME_COMPLETE; memcpy(&data.data[2], name, name_len); - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_DATA, sizeof(data)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_DATA, sizeof(data)); __ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &data, sizeof(data)); send_cmd(BT_HCI_OP_LE_SET_ADV_DATA, buf, NULL); @@ -405,13 +405,13 @@ static void start_adv(uint16_t interval, const char *name, size_t name_len) set_param.type = BT_HCI_ADV_IND; set_param.own_addr_type = BT_HCI_OWN_ADDR_RANDOM; - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); __ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &set_param, sizeof(set_param)); send_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, buf, NULL); - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); __ASSERT_NO_MSG(buf); net_buf_add_u8(buf, BT_HCI_LE_ADV_ENABLE); @@ -427,7 +427,7 @@ static void disconnect(void) LOG_INF("Disconnecting"); - buf = create_cmd(BT_HCI_OP_DISCONNECT, sizeof(*disconn)); + buf = bt_hci_cmd_create(BT_HCI_OP_DISCONNECT, sizeof(*disconn)); TEST_ASSERT(buf); disconn = net_buf_add(buf, sizeof(*disconn)); diff --git a/tests/bsim/bluetooth/host/l2cap/split/tester/src/main.c b/tests/bsim/bluetooth/host/l2cap/split/tester/src/main.c index e7c559b83a2..dc7e72d91d0 100644 --- a/tests/bsim/bluetooth/host/l2cap/split/tester/src/main.c +++ b/tests/bsim/bluetooth/host/l2cap/split/tester/src/main.c @@ -49,7 +49,7 @@ static uint16_t conn_handle; static uint16_t active_opcode = 0xFFFF; static struct net_buf *cmd_rsp; -static struct net_buf *create_cmd(uint16_t opcode, uint8_t param_len) +struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len) { struct bt_hci_cmd_hdr *hdr; struct net_buf *buf; @@ -306,7 +306,7 @@ static void send_cmd(uint16_t opcode, struct net_buf *cmd, struct net_buf **rsp) LOG_DBG("opcode %x", opcode); if (!cmd) { - cmd = create_cmd(opcode, 0); + cmd = bt_hci_cmd_create(opcode, 0); } k_sem_take(&cmd_sem, K_FOREVER); @@ -377,7 +377,7 @@ static void read_max_data_len(uint16_t *tx_octets, uint16_t *tx_time) static void write_default_data_len(uint16_t tx_octets, uint16_t tx_time) { struct bt_hci_cp_le_write_default_data_len *cp; - struct net_buf *buf = create_cmd(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); + struct net_buf *buf = bt_hci_cmd_create(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); __ASSERT_NO_MSG(buf); @@ -403,7 +403,7 @@ static void set_event_mask(uint16_t opcode) uint64_t mask = 0U; /* The two commands have the same length/params */ - buf = create_cmd(opcode, sizeof(*cp_mask)); + buf = bt_hci_cmd_create(opcode, sizeof(*cp_mask)); __ASSERT_NO_MSG(buf); /* Forward all events */ @@ -421,7 +421,7 @@ static void set_random_address(void) LOG_DBG("%s", bt_addr_str(&addr.a)); - buf = create_cmd(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); __ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &addr.a, sizeof(addr.a)); @@ -442,13 +442,13 @@ void start_adv(uint16_t interval) set_param.type = BT_HCI_ADV_IND; set_param.own_addr_type = BT_HCI_OWN_ADDR_RANDOM; - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); __ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &set_param, sizeof(set_param)); send_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, buf, NULL); - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); __ASSERT_NO_MSG(buf); net_buf_add_u8(buf, BT_HCI_LE_ADV_ENABLE); diff --git a/tests/bsim/bluetooth/host/misc/disconnect/tester/src/main.c b/tests/bsim/bluetooth/host/misc/disconnect/tester/src/main.c index 32189870581..a4fdb5ab149 100644 --- a/tests/bsim/bluetooth/host/misc/disconnect/tester/src/main.c +++ b/tests/bsim/bluetooth/host/misc/disconnect/tester/src/main.c @@ -59,7 +59,7 @@ static uint16_t conn_handle; static volatile uint16_t active_opcode = 0xFFFF; static struct net_buf *cmd_rsp; -static struct net_buf *create_cmd(uint16_t opcode, uint8_t param_len) +struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len) { struct bt_hci_cmd_hdr *hdr; struct net_buf *buf; @@ -303,7 +303,7 @@ static void send_cmd(uint16_t opcode, struct net_buf *cmd, struct net_buf **rsp) LOG_DBG("opcode %x", opcode); if (!cmd) { - cmd = create_cmd(opcode, 0); + cmd = bt_hci_cmd_create(opcode, 0); } k_sem_take(&cmd_sem, K_FOREVER); @@ -374,7 +374,7 @@ static void read_max_data_len(uint16_t *tx_octets, uint16_t *tx_time) static void write_default_data_len(uint16_t tx_octets, uint16_t tx_time) { struct bt_hci_cp_le_write_default_data_len *cp; - struct net_buf *buf = create_cmd(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); + struct net_buf *buf = bt_hci_cmd_create(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); TEST_ASSERT_NO_MSG(buf); @@ -400,7 +400,7 @@ static void set_event_mask(uint16_t opcode) uint64_t mask = 0U; /* The two commands have the same length/params */ - buf = create_cmd(opcode, sizeof(*cp_mask)); + buf = bt_hci_cmd_create(opcode, sizeof(*cp_mask)); TEST_ASSERT_NO_MSG(buf); /* Forward all events */ @@ -418,7 +418,7 @@ static void set_random_address(void) LOG_DBG("%s", bt_addr_str(&addr.a)); - buf = create_cmd(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); TEST_ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &addr.a, sizeof(addr.a)); @@ -441,12 +441,12 @@ void start_adv(void) set_param.own_addr_type = BT_HCI_OWN_ADDR_RANDOM; /* configure */ - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); net_buf_add_mem(buf, &set_param, sizeof(set_param)); send_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, buf, NULL); /* start */ - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); net_buf_add_u8(buf, BT_HCI_LE_ADV_ENABLE); send_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, buf, NULL); } diff --git a/tests/bsim/bluetooth/host/misc/hfc_multilink/tester/src/tester.c b/tests/bsim/bluetooth/host/misc/hfc_multilink/tester/src/tester.c index f4f38fedc15..a06a5af9b92 100644 --- a/tests/bsim/bluetooth/host/misc/hfc_multilink/tester/src/tester.c +++ b/tests/bsim/bluetooth/host/misc/hfc_multilink/tester/src/tester.c @@ -50,7 +50,7 @@ static uint16_t conn_handle; static uint16_t active_opcode = 0xFFFF; static struct net_buf *cmd_rsp; -static struct net_buf *create_cmd(uint16_t opcode, uint8_t param_len) +struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len) { struct bt_hci_cmd_hdr *hdr; struct net_buf *buf; @@ -317,7 +317,7 @@ static void send_cmd(uint16_t opcode, struct net_buf *cmd, struct net_buf **rsp) LOG_DBG("opcode %x", opcode); if (!cmd) { - cmd = create_cmd(opcode, 0); + cmd = bt_hci_cmd_create(opcode, 0); } k_sem_take(&cmd_sem, K_FOREVER); @@ -388,7 +388,7 @@ static void read_max_data_len(uint16_t *tx_octets, uint16_t *tx_time) static void write_default_data_len(uint16_t tx_octets, uint16_t tx_time) { struct bt_hci_cp_le_write_default_data_len *cp; - struct net_buf *buf = create_cmd(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); + struct net_buf *buf = bt_hci_cmd_create(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, sizeof(*cp)); __ASSERT_NO_MSG(buf); @@ -414,7 +414,7 @@ static void set_event_mask(uint16_t opcode) uint64_t mask = 0U; /* The two commands have the same length/params */ - buf = create_cmd(opcode, sizeof(*cp_mask)); + buf = bt_hci_cmd_create(opcode, sizeof(*cp_mask)); __ASSERT_NO_MSG(buf); /* Forward all events */ @@ -435,7 +435,7 @@ static void set_random_address(void) LOG_DBG("%s", bt_addr_str(&addr.a)); - buf = create_cmd(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(addr.a)); __ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &addr.a, sizeof(addr.a)); @@ -457,7 +457,7 @@ static void start_adv(uint16_t interval, const char *name, size_t name_len) data.data[1] = BT_DATA_NAME_COMPLETE; memcpy(&data.data[2], name, name_len); - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_DATA, sizeof(data)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_DATA, sizeof(data)); __ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &data, sizeof(data)); send_cmd(BT_HCI_OP_LE_SET_ADV_DATA, buf, NULL); @@ -470,13 +470,13 @@ static void start_adv(uint16_t interval, const char *name, size_t name_len) set_param.type = BT_HCI_ADV_IND; set_param.own_addr_type = BT_HCI_OWN_ADDR_RANDOM; - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); __ASSERT_NO_MSG(buf); net_buf_add_mem(buf, &set_param, sizeof(set_param)); send_cmd(BT_HCI_OP_LE_SET_ADV_PARAM, buf, NULL); - buf = create_cmd(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); __ASSERT_NO_MSG(buf); net_buf_add_u8(buf, BT_HCI_LE_ADV_ENABLE); From b7872ce5a7aa12d9b88393b494e8063cec4b68d4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:30 +0300 Subject: [PATCH 594/881] Revert "[nrf fromtree] Bluetooth: tests: Use bt_hci_cmd_alloc()" This reverts commit e4961a8246a8b176941969962f8d2eb7afed179c. Signed-off-by: Jukka Rissanen --- .../src/test_cte_req_enable.c | 2 +- .../src/test_cte_set_rx_params.c | 2 +- .../src/test_set_conn_cte_tx_params.c | 3 ++- .../src/test_set_iq_sampling_enable.c | 3 ++- .../df/connectionless_cte_tx/src/common.c | 3 ++- .../src/test_set_cl_cte_tx_enable.c | 2 +- .../src/test_set_cl_cte_tx_param.c | 3 ++- tests/bluetooth/hci_codecs_info/src/main.c | 4 ++-- tests/bluetooth/host/conn/mocks/hci_core.c | 2 +- tests/bluetooth/host/conn/mocks/hci_core.h | 4 ++-- tests/bluetooth/host/cs/mocks/hci_core.c | 2 +- tests/bluetooth/host/cs/mocks/hci_core.h | 4 ++-- tests/bluetooth/host/id/bt_id_add/src/main.c | 6 +++--- tests/bluetooth/host/id/bt_id_del/src/main.c | 8 ++++---- .../test_suite_setup_static_random_identity.c | 2 +- .../src/test_suite_invalid_cases.c | 4 ++-- .../id/bt_id_set_adv_random_addr/src/main.c | 10 +++++----- .../src/test_suite_invalid_cases.c | 12 ++++++------ .../src/test_suite_invalid_inputs.c | 2 +- .../src/test_suite_invalid_cases.c | 2 +- .../src/test_suite_invalid_inputs.c | 2 +- tests/bluetooth/host/id/mocks/hci_core.c | 2 +- tests/bluetooth/host/id/mocks/hci_core.h | 4 ++-- .../bluetooth/host/id/mocks/hci_core_expects.c | 17 +++++++++++------ .../bluetooth/host/id/mocks/hci_core_expects.h | 12 ++++++------ tests/bsim/bluetooth/host/central/src/main.c | 2 +- 26 files changed, 64 insertions(+), 55 deletions(-) diff --git a/tests/bluetooth/df/connection_cte_req/src/test_cte_req_enable.c b/tests/bluetooth/df/connection_cte_req/src/test_cte_req_enable.c index e44db418cac..f9f10d5ccab 100644 --- a/tests/bluetooth/df/connection_cte_req/src/test_cte_req_enable.c +++ b/tests/bluetooth/df/connection_cte_req/src/test_cte_req_enable.c @@ -63,7 +63,7 @@ int send_conn_cte_req_enable(uint16_t conn_handle, struct bt_hci_cp_le_conn_cte_req_enable *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CONN_CTE_REQ_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } diff --git a/tests/bluetooth/df/connection_cte_req/src/test_cte_set_rx_params.c b/tests/bluetooth/df/connection_cte_req/src/test_cte_set_rx_params.c index e3d4eced1f7..72a0786193d 100644 --- a/tests/bluetooth/df/connection_cte_req/src/test_cte_set_rx_params.c +++ b/tests/bluetooth/df/connection_cte_req/src/test_cte_set_rx_params.c @@ -48,7 +48,7 @@ int send_set_conn_cte_rx_params(uint16_t conn_handle, uint8_t ant_ids_num = (params != NULL ? params->switch_pattern_len : 0); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CONN_CTE_RX_PARAMS, sizeof(*cp) + ant_ids_num); if (!buf) { return -ENOBUFS; } diff --git a/tests/bluetooth/df/connection_cte_tx_params/src/test_set_conn_cte_tx_params.c b/tests/bluetooth/df/connection_cte_tx_params/src/test_set_conn_cte_tx_params.c index 89fef224ebc..11cbf937a39 100644 --- a/tests/bluetooth/df/connection_cte_tx_params/src/test_set_conn_cte_tx_params.c +++ b/tests/bluetooth/df/connection_cte_tx_params/src/test_set_conn_cte_tx_params.c @@ -59,7 +59,8 @@ static int send_set_conn_cte_tx_params(uint16_t conn_handle, uint8_t *dest_ant_ids; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CONN_CTE_TX_PARAMS, + sizeof(*cp) + params->switch_pattern_len); if (!buf) { return -ENOBUFS; } diff --git a/tests/bluetooth/df/connectionless_cte_rx/src/test_set_iq_sampling_enable.c b/tests/bluetooth/df/connectionless_cte_rx/src/test_set_iq_sampling_enable.c index 8a924c0a49c..c29cc168ecb 100644 --- a/tests/bluetooth/df/connectionless_cte_rx/src/test_set_iq_sampling_enable.c +++ b/tests/bluetooth/df/connectionless_cte_rx/src/test_set_iq_sampling_enable.c @@ -56,7 +56,8 @@ int send_set_scan_cte_rx_enable(uint16_t sync_handle, struct bt_hci_cp_le_set_cl_cte_sampling_enable *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CL_CTE_SAMPLING_ENABLE, + sizeof(*cp) + params->num_ant_ids); if (!buf) { return -ENOBUFS; } diff --git a/tests/bluetooth/df/connectionless_cte_tx/src/common.c b/tests/bluetooth/df/connectionless_cte_tx/src/common.c index 3e65132ccbc..f00f96d55ad 100644 --- a/tests/bluetooth/df/connectionless_cte_tx/src/common.c +++ b/tests/bluetooth/df/connectionless_cte_tx/src/common.c @@ -59,7 +59,8 @@ void common_set_cl_cte_tx_params(void) struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CL_CTE_TX_PARAMS, + sizeof(*cp) + ARRAY_SIZE(ant_ids)); zassert_not_null(buf, "Failed to create HCI cmd object"); cp = net_buf_add(buf, sizeof(*cp)); diff --git a/tests/bluetooth/df/connectionless_cte_tx/src/test_set_cl_cte_tx_enable.c b/tests/bluetooth/df/connectionless_cte_tx/src/test_set_cl_cte_tx_enable.c index e5bec0a1d4c..35267739edd 100644 --- a/tests/bluetooth/df/connectionless_cte_tx/src/test_set_cl_cte_tx_enable.c +++ b/tests/bluetooth/df/connectionless_cte_tx/src/test_set_cl_cte_tx_enable.c @@ -35,7 +35,7 @@ int send_set_cl_cte_tx_enable(uint8_t adv_handle, atomic_t *adv_flags, struct bt_hci_cmd_state_set state; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CL_CTE_TX_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } diff --git a/tests/bluetooth/df/connectionless_cte_tx/src/test_set_cl_cte_tx_param.c b/tests/bluetooth/df/connectionless_cte_tx/src/test_set_cl_cte_tx_param.c index 2c2d65ccabf..e539730f964 100644 --- a/tests/bluetooth/df/connectionless_cte_tx/src/test_set_cl_cte_tx_param.c +++ b/tests/bluetooth/df/connectionless_cte_tx/src/test_set_cl_cte_tx_param.c @@ -54,7 +54,8 @@ int send_set_cl_cte_tx_params(uint8_t adv_handle, uint8_t cte_len, struct bt_hci_cp_le_set_cl_cte_tx_params *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CL_CTE_TX_PARAMS, + sizeof(*cp) + switch_pattern_len); zassert_not_null(buf, "Failed to create HCI cmd object"); cp = net_buf_add(buf, sizeof(*cp)); diff --git a/tests/bluetooth/hci_codecs_info/src/main.c b/tests/bluetooth/hci_codecs_info/src/main.c index 5226f6dd3f4..1d2937a21e7 100644 --- a/tests/bluetooth/hci_codecs_info/src/main.c +++ b/tests/bluetooth/hci_codecs_info/src/main.c @@ -185,7 +185,7 @@ ZTEST(test_hci_codecs_info, test_read_codec_capabilities) bt_enable(NULL); /* Read Local Supported Codec Capabilities */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_CODEC_CAPABILITIES, sizeof(*cp)); cp = net_buf_add(buf, sizeof(*cp)); cp->codec_id.coding_format = READ_CAPABS_CODING_FMT; @@ -268,7 +268,7 @@ ZTEST(test_hci_codecs_info, test_read_ctlr_delay) bt_enable(NULL); /* Read Local Supported Controller Delay */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_CTLR_DELAY, sizeof(*cp)); cp = net_buf_add(buf, sizeof(*cp) + sizeof(read_delay_codec_config)); cp->codec_id.coding_format = READ_DELAY_CODING_FMT; diff --git a/tests/bluetooth/host/conn/mocks/hci_core.c b/tests/bluetooth/host/conn/mocks/hci_core.c index 3ba21db49a6..363108dd3c0 100644 --- a/tests/bluetooth/host/conn/mocks/hci_core.c +++ b/tests/bluetooth/host/conn/mocks/hci_core.c @@ -11,7 +11,7 @@ #include "hci_core.h" -DEFINE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_alloc, k_timeout_t); +DEFINE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_create, uint16_t, uint8_t); DEFINE_FAKE_VALUE_FUNC(int, bt_hci_cmd_send_sync, uint16_t, struct net_buf *, struct net_buf **); DEFINE_FAKE_VALUE_FUNC(int, bt_hci_le_read_remote_features, struct bt_conn *); DEFINE_FAKE_VALUE_FUNC(int, bt_hci_disconnect, uint16_t, uint8_t); diff --git a/tests/bluetooth/host/conn/mocks/hci_core.h b/tests/bluetooth/host/conn/mocks/hci_core.h index a12185a537f..abc609c58ce 100644 --- a/tests/bluetooth/host/conn/mocks/hci_core.h +++ b/tests/bluetooth/host/conn/mocks/hci_core.h @@ -9,7 +9,7 @@ /* List of fakes used by this unit tester */ #define HCI_CORE_MOCKS_FFF_FAKES_LIST(FAKE) \ - FAKE(bt_hci_cmd_alloc) \ + FAKE(bt_hci_cmd_create) \ FAKE(bt_hci_cmd_send_sync) \ FAKE(bt_hci_le_read_remote_features) \ FAKE(bt_hci_disconnect) \ @@ -24,7 +24,7 @@ FAKE(bt_lookup_id_addr) \ FAKE(bt_le_set_phy) -DECLARE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_alloc, k_timeout_t); +DECLARE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_create, uint16_t, uint8_t); DECLARE_FAKE_VALUE_FUNC(int, bt_hci_cmd_send_sync, uint16_t, struct net_buf *, struct net_buf **); DECLARE_FAKE_VALUE_FUNC(int, bt_hci_le_read_remote_features, struct bt_conn *); DECLARE_FAKE_VALUE_FUNC(int, bt_hci_disconnect, uint16_t, uint8_t); diff --git a/tests/bluetooth/host/cs/mocks/hci_core.c b/tests/bluetooth/host/cs/mocks/hci_core.c index cb5bbd4acbd..5830c302a47 100644 --- a/tests/bluetooth/host/cs/mocks/hci_core.c +++ b/tests/bluetooth/host/cs/mocks/hci_core.c @@ -9,5 +9,5 @@ #include #include -DEFINE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_alloc, k_timeout_t); +DEFINE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_create, uint16_t, uint8_t); DEFINE_FAKE_VALUE_FUNC(int, bt_hci_cmd_send_sync, uint16_t, struct net_buf *, struct net_buf **); diff --git a/tests/bluetooth/host/cs/mocks/hci_core.h b/tests/bluetooth/host/cs/mocks/hci_core.h index f754a111d6c..8dc28890755 100644 --- a/tests/bluetooth/host/cs/mocks/hci_core.h +++ b/tests/bluetooth/host/cs/mocks/hci_core.h @@ -9,8 +9,8 @@ /* List of fakes used by this unit tester */ #define HCI_CORE_FFF_FAKES_LIST(FAKE) \ - FAKE(bt_hci_cmd_alloc) \ + FAKE(bt_hci_cmd_create) \ FAKE(bt_hci_cmd_send_sync) -DECLARE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_alloc, k_timeout_t); +DECLARE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_create, uint16_t, uint8_t); DECLARE_FAKE_VALUE_FUNC(int, bt_hci_cmd_send_sync, uint16_t, struct net_buf *, struct net_buf **); diff --git a/tests/bluetooth/host/id/bt_id_add/src/main.c b/tests/bluetooth/host/id/bt_id_add/src/main.c index 840dc2bd034..2806414aeb1 100644 --- a/tests/bluetooth/host/id/bt_id_add/src/main.c +++ b/tests/bluetooth/host/id/bt_id_add/src/main.c @@ -218,7 +218,7 @@ ZTEST(bt_id_add, test_conn_lookup_returns_null_broadcaster_no_ext_adv) bt_conn_lookup_state_le_fake.return_val = NULL; /* This makes addr_res_enable() succeeds and returns 0 */ - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = 0; bt_id_add(&keys); @@ -268,7 +268,7 @@ ZTEST(bt_id_add, test_conn_lookup_returns_null_no_ext_adv_no_resolving_entries) /* This makes hci_id_add() succeeds and returns 0 */ net_buf_simple_add_fake.return_val = &cp; - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = 0; bt_id_add(&keys); @@ -326,7 +326,7 @@ ZTEST(bt_id_add, test_scan_re_enabled_observer_enabled_ext_adv) /* This makes hci_id_add() succeeds and returns 0 */ net_buf_simple_add_fake.return_val = &cp; - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = 0; bt_id_add(&keys); diff --git a/tests/bluetooth/host/id/bt_id_del/src/main.c b/tests/bluetooth/host/id/bt_id_del/src/main.c index ac37caf3678..55332b3c01c 100644 --- a/tests/bluetooth/host/id/bt_id_del/src/main.c +++ b/tests/bluetooth/host/id/bt_id_del/src/main.c @@ -232,7 +232,7 @@ ZTEST(bt_id_del, test_conn_lookup_returns_null_broadcaster_no_ext_adv) keys.state |= BT_KEYS_ID_ADDED; /* This makes addr_res_enable() succeeds and returns 0 */ - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = 0; bt_id_del(&keys); @@ -284,7 +284,7 @@ ZTEST(bt_id_del, test_conn_lookup_returns_null_broadcaster_no_ext_adv_privacy_en keys.state |= BT_KEYS_ID_ADDED; /* This makes addr_res_enable() succeeds and returns 0 */ - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = 0; bt_id_del(&keys); @@ -333,7 +333,7 @@ ZTEST(bt_id_del, test_send_hci_id_del) /* This makes hci_id_del() succeeds and returns 0 */ net_buf_simple_add_fake.return_val = &cp; - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = 0; bt_id_del(&keys); @@ -388,7 +388,7 @@ ZTEST(bt_id_del, test_scan_re_enabled_observer_enabled_ext_adv) /* This makes hci_id_del() succeeds and returns 0 */ net_buf_simple_add_fake.return_val = &cp; - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = 0; bt_id_del(&keys); diff --git a/tests/bluetooth/host/id/bt_id_init/src/test_suite_setup_static_random_identity.c b/tests/bluetooth/host/id/bt_id_init/src/test_suite_setup_static_random_identity.c index 67c9e110c9b..81934d79d7d 100644 --- a/tests/bluetooth/host/id/bt_id_init/src/test_suite_setup_static_random_identity.c +++ b/tests/bluetooth/host/id/bt_id_init/src/test_suite_setup_static_random_identity.c @@ -202,7 +202,7 @@ ZTEST(bt_id_init_setup_static_random_identity, test_init_dev_identity_set_random rp->num_addrs * sizeof(struct bt_hci_vs_static_addr); /* This will make set_random_address() returns a negative number error code */ - bt_hci_cmd_alloc_fake.return_val = NULL; + bt_hci_cmd_create_fake.return_val = NULL; bt_hci_cmd_send_sync_fake.custom_fake = bt_hci_cmd_send_sync_custom_fake; err = bt_id_init(); diff --git a/tests/bluetooth/host/id/bt_id_set_adv_private_addr/src/test_suite_invalid_cases.c b/tests/bluetooth/host/id/bt_id_set_adv_private_addr/src/test_suite_invalid_cases.c index 1fd7fe2c185..fbc13c41ebf 100644 --- a/tests/bluetooth/host/id/bt_id_set_adv_private_addr/src/test_suite_invalid_cases.c +++ b/tests/bluetooth/host/id/bt_id_set_adv_private_addr/src/test_suite_invalid_cases.c @@ -86,7 +86,7 @@ ZTEST(bt_id_set_adv_private_addr_invalid_cases, test_set_adv_address_set_adv_ran bt_rand_fake.custom_fake = bt_rand_custom_fake; /* This will make set_random_address() returns a negative number error code */ - bt_hci_cmd_alloc_fake.return_val = NULL; + bt_hci_cmd_create_fake.return_val = NULL; err = bt_id_set_adv_private_addr(&adv_param); @@ -158,7 +158,7 @@ ZTEST(bt_id_set_adv_private_addr_invalid_cases, test_set_adv_address_if_set_adv_ /* This will make bt_id_set_adv_random_addr() returns a negative number error code */ atomic_set_bit(adv_param.flags, BT_ADV_PARAMS_SET); - bt_hci_cmd_alloc_fake.return_val = NULL; + bt_hci_cmd_create_fake.return_val = NULL; err = bt_id_set_adv_private_addr(&adv_param); diff --git a/tests/bluetooth/host/id/bt_id_set_adv_random_addr/src/main.c b/tests/bluetooth/host/id/bt_id_set_adv_random_addr/src/main.c index aeef2b1fc23..8d8b7cf03e3 100644 --- a/tests/bluetooth/host/id/bt_id_set_adv_random_addr/src/main.c +++ b/tests/bluetooth/host/id/bt_id_set_adv_random_addr/src/main.c @@ -52,7 +52,7 @@ ZTEST(bt_id_set_adv_random_addr, test_no_ext_adv) err = bt_id_set_adv_random_addr(&adv_param, &BT_RPA_LE_ADDR->a); - expect_not_called_bt_hci_cmd_alloc(); + expect_not_called_bt_hci_cmd_create(); expect_not_called_bt_hci_cmd_send_sync(); expect_not_called_net_buf_simple_add(); @@ -82,7 +82,7 @@ ZTEST(bt_id_set_adv_random_addr, test_ext_adv_enabled) err = bt_id_set_adv_random_addr(&adv_param, &BT_RPA_LE_ADDR->a); - expect_not_called_bt_hci_cmd_alloc(); + expect_not_called_bt_hci_cmd_create(); expect_not_called_bt_hci_cmd_send_sync(); expect_not_called_net_buf_simple_add(); @@ -102,7 +102,7 @@ ZTEST(bt_id_set_adv_random_addr, test_ext_adv_enabled) * Constraints: * - 'CONFIG_BT_EXT_ADV' is enabled * - 'BT_ADV_PARAMS_SET' flag in advertising parameters reference is set - * - bt_hci_cmd_alloc() returns a valid buffer pointer + * - bt_hci_cmd_create() returns a valid buffer pointer * - bt_hci_cmd_send_sync() returns 0 (success) * * Expected behaviour: @@ -120,13 +120,13 @@ ZTEST(bt_id_set_adv_random_addr, test_ext_adv_enabled_hci_set_adv_set_random_add atomic_set_bit(adv_param.flags, BT_ADV_PARAMS_SET); net_buf_simple_add_fake.return_val = &cp; - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = 0; err = bt_id_set_adv_random_addr(&adv_param, &BT_RPA_LE_ADDR->a); expect_single_call_net_buf_simple_add(&net_buff.b, sizeof(cp)); - expect_single_call_bt_hci_cmd_alloc(); + expect_single_call_bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_SET_RANDOM_ADDR, sizeof(cp)); expect_single_call_bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_ADV_SET_RANDOM_ADDR); zassert_ok(err, "Unexpected error code '%d' was returned", err); diff --git a/tests/bluetooth/host/id/bt_id_set_adv_random_addr/src/test_suite_invalid_cases.c b/tests/bluetooth/host/id/bt_id_set_adv_random_addr/src/test_suite_invalid_cases.c index b9df7be3f9b..a23bf02039a 100644 --- a/tests/bluetooth/host/id/bt_id_set_adv_random_addr/src/test_suite_invalid_cases.c +++ b/tests/bluetooth/host/id/bt_id_set_adv_random_addr/src/test_suite_invalid_cases.c @@ -73,17 +73,17 @@ ZTEST(bt_id_set_adv_random_addr_invalid_cases, test_null_arguments) /* * Test setting advertising random address while 'CONFIG_BT_EXT_ADV' is enabled * and 'BT_ADV_PARAMS_SET' flag in advertising parameters reference is set. - * bt_hci_cmd_alloc() fails to allocate buffers and returns NULL. + * bt_hci_cmd_create() fails to allocate buffers and returns NULL. * * Constraints: * - 'CONFIG_BT_EXT_ADV' is enabled * - 'BT_ADV_PARAMS_SET' flag in advertising parameters reference is set - * - bt_hci_cmd_alloc() returns null + * - bt_hci_cmd_create() returns null * * Expected behaviour: * - bt_id_set_adv_random_addr() returns a negative error code (failure) */ -ZTEST(bt_id_set_adv_random_addr_invalid_cases, test_bt_hci_cmd_alloc_returns_null) +ZTEST(bt_id_set_adv_random_addr_invalid_cases, test_bt_hci_cmd_create_returns_null) { int err; struct bt_le_ext_adv adv_param = {0}; @@ -92,7 +92,7 @@ ZTEST(bt_id_set_adv_random_addr_invalid_cases, test_bt_hci_cmd_alloc_returns_nul atomic_set_bit(adv_param.flags, BT_ADV_PARAMS_SET); - bt_hci_cmd_alloc_fake.return_val = NULL; + bt_hci_cmd_create_fake.return_val = NULL; err = bt_id_set_adv_random_addr(&adv_param, &BT_RPA_LE_ADDR->a); @@ -107,7 +107,7 @@ ZTEST(bt_id_set_adv_random_addr_invalid_cases, test_bt_hci_cmd_alloc_returns_nul * Constraints: * - 'CONFIG_BT_EXT_ADV' is enabled * - 'BT_ADV_PARAMS_SET' flag in advertising parameters reference is set - * - bt_hci_cmd_alloc() returns a valid buffer pointer + * - bt_hci_cmd_create() returns a valid buffer pointer * - bt_hci_cmd_send_sync() fails and returns a negative error code. * * Expected behaviour: @@ -125,7 +125,7 @@ ZTEST(bt_id_set_adv_random_addr_invalid_cases, test_bt_hci_cmd_send_sync_fails) atomic_set_bit(adv_param.flags, BT_ADV_PARAMS_SET); net_buf_simple_add_fake.return_val = &cp; - bt_hci_cmd_alloc_fake.return_val = &net_buff; + bt_hci_cmd_create_fake.return_val = &net_buff; bt_hci_cmd_send_sync_fake.return_val = -1; err = bt_id_set_adv_random_addr(&adv_param, &BT_RPA_LE_ADDR->a); diff --git a/tests/bluetooth/host/id/bt_id_set_create_conn_own_addr/src/test_suite_invalid_inputs.c b/tests/bluetooth/host/id/bt_id_set_create_conn_own_addr/src/test_suite_invalid_inputs.c index adc035eed4b..2c9fe4abf12 100644 --- a/tests/bluetooth/host/id/bt_id_set_create_conn_own_addr/src/test_suite_invalid_inputs.c +++ b/tests/bluetooth/host/id/bt_id_set_create_conn_own_addr/src/test_suite_invalid_inputs.c @@ -59,7 +59,7 @@ ZTEST(bt_id_set_create_conn_own_addr_invalid_inputs, test_set_random_address_fai bt_addr_le_copy(&bt_dev.id_addr[BT_ID_DEFAULT], BT_RPA_LE_ADDR); /* This will cause set_random_address() to return (-ENOBUFS) */ - bt_hci_cmd_alloc_fake.return_val = NULL; + bt_hci_cmd_create_fake.return_val = NULL; err = bt_id_set_create_conn_own_addr(false, &own_addr_type); diff --git a/tests/bluetooth/host/id/bt_id_set_private_addr/src/test_suite_invalid_cases.c b/tests/bluetooth/host/id/bt_id_set_private_addr/src/test_suite_invalid_cases.c index fba9f9af9f7..c6968f3cecb 100644 --- a/tests/bluetooth/host/id/bt_id_set_private_addr/src/test_suite_invalid_cases.c +++ b/tests/bluetooth/host/id/bt_id_set_private_addr/src/test_suite_invalid_cases.c @@ -110,7 +110,7 @@ ZTEST(bt_id_set_private_addr_invalid_cases, test_setting_address_set_random_addr } /* This will make set_random_address() returns a negative number error code */ - bt_hci_cmd_alloc_fake.return_val = NULL; + bt_hci_cmd_create_fake.return_val = NULL; err = bt_id_set_private_addr(BT_ID_DEFAULT); diff --git a/tests/bluetooth/host/id/bt_id_set_scan_own_addr/src/test_suite_invalid_inputs.c b/tests/bluetooth/host/id/bt_id_set_scan_own_addr/src/test_suite_invalid_inputs.c index 0942ae9ca17..367cf3296a3 100644 --- a/tests/bluetooth/host/id/bt_id_set_scan_own_addr/src/test_suite_invalid_inputs.c +++ b/tests/bluetooth/host/id/bt_id_set_scan_own_addr/src/test_suite_invalid_inputs.c @@ -91,7 +91,7 @@ ZTEST(bt_id_set_scan_own_addr_invalid_inputs, test_set_random_address_fails) bt_addr_le_copy(&bt_dev.id_addr[BT_ID_DEFAULT], BT_RPA_LE_ADDR); /* This will cause set_random_address() to return (-ENOBUFS) */ - bt_hci_cmd_alloc_fake.return_val = NULL; + bt_hci_cmd_create_fake.return_val = NULL; err = bt_id_set_scan_own_addr(false, &own_addr_type); diff --git a/tests/bluetooth/host/id/mocks/hci_core.c b/tests/bluetooth/host/id/mocks/hci_core.c index dedaf5f9dc1..bb274e4f75d 100644 --- a/tests/bluetooth/host/id/mocks/hci_core.c +++ b/tests/bluetooth/host/id/mocks/hci_core.c @@ -16,5 +16,5 @@ struct bt_dev bt_dev = { }; DEFINE_FAKE_VALUE_FUNC(int, bt_unpair, uint8_t, const bt_addr_le_t *); -DEFINE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_alloc, k_timeout_t); +DEFINE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_create, uint16_t, uint8_t); DEFINE_FAKE_VALUE_FUNC(int, bt_hci_cmd_send_sync, uint16_t, struct net_buf *, struct net_buf **); diff --git a/tests/bluetooth/host/id/mocks/hci_core.h b/tests/bluetooth/host/id/mocks/hci_core.h index 94de9ca882e..1e30830dcc2 100644 --- a/tests/bluetooth/host/id/mocks/hci_core.h +++ b/tests/bluetooth/host/id/mocks/hci_core.h @@ -11,9 +11,9 @@ /* List of fakes used by this unit tester */ #define HCI_CORE_FFF_FAKES_LIST(FAKE) \ FAKE(bt_unpair) \ - FAKE(bt_hci_cmd_alloc) \ + FAKE(bt_hci_cmd_create) \ FAKE(bt_hci_cmd_send_sync) DECLARE_FAKE_VALUE_FUNC(int, bt_unpair, uint8_t, const bt_addr_le_t *); -DECLARE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_alloc, k_timeout_t); +DECLARE_FAKE_VALUE_FUNC(struct net_buf *, bt_hci_cmd_create, uint16_t, uint8_t); DECLARE_FAKE_VALUE_FUNC(int, bt_hci_cmd_send_sync, uint16_t, struct net_buf *, struct net_buf **); diff --git a/tests/bluetooth/host/id/mocks/hci_core_expects.c b/tests/bluetooth/host/id/mocks/hci_core_expects.c index af8a1ea13cd..8e4deea9c0c 100644 --- a/tests/bluetooth/host/id/mocks/hci_core_expects.c +++ b/tests/bluetooth/host/id/mocks/hci_core_expects.c @@ -35,19 +35,24 @@ void expect_not_called_bt_unpair(void) zassert_equal(bt_unpair_fake.call_count, 0, "'%s()' was called unexpectedly", func_name); } -void expect_single_call_bt_hci_cmd_alloc(void) +void expect_single_call_bt_hci_cmd_create(uint16_t opcode, uint8_t param_len) { - const char *func_name = "bt_hci_cmd_alloc"; + const char *func_name = "bt_hci_cmd_create"; - zassert_equal(bt_hci_cmd_alloc_fake.call_count, 1, "'%s()' was called more than once", + zassert_equal(bt_hci_cmd_create_fake.call_count, 1, "'%s()' was called more than once", func_name); + + zassert_equal(bt_hci_cmd_create_fake.arg0_val, opcode, + "'%s()' was called with incorrect '%s' value", func_name, "opcode"); + zassert_equal(bt_hci_cmd_create_fake.arg1_val, param_len, + "'%s()' was called with incorrect '%s' value", func_name, "param_len"); } -void expect_not_called_bt_hci_cmd_alloc(void) +void expect_not_called_bt_hci_cmd_create(void) { - const char *func_name = "bt_hci_cmd_alloc"; + const char *func_name = "bt_hci_cmd_create"; - zassert_equal(bt_hci_cmd_alloc_fake.call_count, 0, "'%s()' was called unexpectedly", + zassert_equal(bt_hci_cmd_create_fake.call_count, 0, "'%s()' was called unexpectedly", func_name); } diff --git a/tests/bluetooth/host/id/mocks/hci_core_expects.h b/tests/bluetooth/host/id/mocks/hci_core_expects.h index 018747837c0..f87342f1f79 100644 --- a/tests/bluetooth/host/id/mocks/hci_core_expects.h +++ b/tests/bluetooth/host/id/mocks/hci_core_expects.h @@ -23,20 +23,20 @@ void expect_single_call_bt_unpair(uint8_t id, const bt_addr_le_t *addr); void expect_not_called_bt_unpair(void); /* - * Validate expected behaviour when bt_hci_cmd_alloc() is called + * Validate expected behaviour when bt_hci_cmd_create() is called * * Expected behaviour: - * - bt_hci_cmd_alloc() to be called once with correct parameters + * - bt_hci_cmd_create() to be called once with correct parameters */ -void expect_single_call_bt_hci_cmd_alloc(void); +void expect_single_call_bt_hci_cmd_create(uint16_t opcode, uint8_t param_len); /* - * Validate expected behaviour when bt_hci_cmd_alloc() isn't called + * Validate expected behaviour when bt_hci_cmd_create() isn't called * * Expected behaviour: - * - bt_hci_cmd_alloc() isn't called at all + * - bt_hci_cmd_create() isn't called at all */ -void expect_not_called_bt_hci_cmd_alloc(void); +void expect_not_called_bt_hci_cmd_create(void); /* * Validate expected behaviour when bt_hci_cmd_send_sync() is called diff --git a/tests/bsim/bluetooth/host/central/src/main.c b/tests/bsim/bluetooth/host/central/src/main.c index 03bd40397ed..dd12fd91a5b 100644 --- a/tests/bsim/bluetooth/host/central/src/main.c +++ b/tests/bsim/bluetooth/host/central/src/main.c @@ -78,7 +78,7 @@ static void test_central_connect_timeout_with_timeout(uint32_t timeout_ms, bool if (stack_load) { /* Claim all the buffers so that the stack cannot handle the timeout */ for (int i = 0; i < BT_BUF_CMD_TX_COUNT; i++) { - bufs[i] = bt_hci_cmd_alloc(K_FOREVER); + bufs[i] = bt_hci_cmd_create(BT_HCI_LE_ADV_ENABLE, 0); TEST_ASSERT(bufs[i] != NULL, "Failed to claim all command buffers"); } /* Hold all the buffers until after we expect the connection to timeout */ From 250933dd35442a9ed8fada51c31e78561c08ed7a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 595/881] Revert "[nrf fromtree] Bluetooth: samples: Use bt_hci_cmd_alloc()" This reverts commit 11d4a59f344c0b2d6dd026d231dbfd33bdb08b0d. Signed-off-by: Jukka Rissanen --- samples/bluetooth/hci_pwr_ctrl/src/main.c | 8 +++++--- samples/bluetooth/hci_vs_scan_req/src/main.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/samples/bluetooth/hci_pwr_ctrl/src/main.c b/samples/bluetooth/hci_pwr_ctrl/src/main.c index ef6ca0bbbb2..13794328489 100644 --- a/samples/bluetooth/hci_pwr_ctrl/src/main.c +++ b/samples/bluetooth/hci_pwr_ctrl/src/main.c @@ -57,7 +57,7 @@ static void read_conn_rssi(uint16_t handle, int8_t *rssi) int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_RSSI, sizeof(*cp)); if (!buf) { printk("Unable to allocate command buffer\n"); return; @@ -86,7 +86,8 @@ static void set_tx_power(uint8_t handle_type, uint16_t handle, int8_t tx_pwr_lvl struct net_buf *buf, *rsp = NULL; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL, + sizeof(*cp)); if (!buf) { printk("Unable to allocate command buffer\n"); return; @@ -118,7 +119,8 @@ static void get_tx_power(uint8_t handle_type, uint16_t handle, int8_t *tx_pwr_lv int err; *tx_pwr_lvl = 0xFF; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_VS_READ_TX_POWER_LEVEL, + sizeof(*cp)); if (!buf) { printk("Unable to allocate command buffer\n"); return; diff --git a/samples/bluetooth/hci_vs_scan_req/src/main.c b/samples/bluetooth/hci_vs_scan_req/src/main.c index 7682c469edf..6e1c4cb6b77 100644 --- a/samples/bluetooth/hci_vs_scan_req/src/main.c +++ b/samples/bluetooth/hci_vs_scan_req/src/main.c @@ -65,7 +65,7 @@ static void enable_legacy_adv_scan_request_event(bool enable) struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_VS_SET_SCAN_REQ_REPORTS, sizeof(*cp)); if (!buf) { printk("%s: Unable to allocate HCI command buffer\n", __func__); return; From 39d677c77da9ae28e6b1add29620eaec08fdc1af Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 596/881] Revert "[nrf fromtree] Bluetooth: Mesh: shell: Use bt_hci_cmd_alloc()" This reverts commit 74d6f3751bd1a4211bee990b83e249e4018120b6. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/mesh/shell/hci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/shell/hci.c b/subsys/bluetooth/mesh/shell/hci.c index 191a47c2411..6192f3b07b7 100644 --- a/subsys/bluetooth/mesh/shell/hci.c +++ b/subsys/bluetooth/mesh/shell/hci.c @@ -30,7 +30,9 @@ int cmd_mesh_adv(const struct shell *sh, size_t argc, char *argv[]) if (!strcmp(argv[1], "on")) { struct bt_hci_cp_mesh_advertise *cp; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_VS_MESH, + sizeof(struct bt_hci_cp_mesh) + + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -56,7 +58,9 @@ int cmd_mesh_adv(const struct shell *sh, size_t argc, char *argv[]) } else if (!strcmp(argv[1], "off")) { struct bt_hci_cp_mesh_advertise_cancel *cp; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_VS_MESH, + sizeof(struct bt_hci_cp_mesh) + + sizeof(*cp)); if (!buf) { return -ENOBUFS; } From 79e6d8ebb505b0375bbcba928906f9ed286affed Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 597/881] Revert "[nrf fromtree] Bluetooth: Host: shell: Use bt_hci_cmd_alloc()" This reverts commit 897c84fbb48364300b9815282c150691b23a4f80. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/shell/bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 1550644018e..206cae5c0c6 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -1432,7 +1432,7 @@ static int cmd_hci_cmd(const struct shell *sh, size_t argc, char *argv[]) return -ENOEXEC; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_OP(ogf, ocf), len); if (buf == NULL) { shell_error(sh, "Unable to allocate HCI buffer"); return -ENOMEM; From c437b6985b9c471148f33ed667545e7708a2b398 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 598/881] Revert "[nrf fromtree] Bluetooth: Host: scan: Use bt_hci_cmd_alloc()" This reverts commit d635e8cb47e837af0bc2eefd9da5eb0902b601f0. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/scan.c | 42 +++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index b154729438a..7094ebd664d 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -133,7 +133,7 @@ static int cmd_le_set_ext_scan_enable(bool enable, bool filter_duplicates, uint1 struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_EXT_SCAN_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -163,7 +163,7 @@ static int cmd_le_set_scan_enable_legacy(bool enable, bool filter_duplicates) struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -252,7 +252,10 @@ static int start_le_scan_ext(struct bt_le_scan_param *scan_param) return err; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_EXT_SCAN_PARAM, + sizeof(*set_param) + + (phy_1m ? sizeof(*phy_1m) : 0) + + (phy_coded ? sizeof(*phy_coded) : 0)); if (!buf) { return -ENOBUFS; } @@ -319,7 +322,7 @@ static int start_le_scan_legacy(struct bt_le_scan_param *param) return err; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_PARAM, sizeof(set_param)); if (!buf) { return -ENOBUFS; } @@ -1163,7 +1166,8 @@ static int per_adv_sync_terminate(uint16_t handle) struct bt_hci_cp_le_per_adv_terminate_sync *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_PER_ADV_TERMINATE_SYNC, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1355,7 +1359,9 @@ int bt_le_per_adv_sync_subevent(struct bt_le_per_adv_sync *per_adv_sync, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PER_ADV_SYNC_SUBEVENT, + sizeof(*cp) + params->num_subevents); + if (!buf) { return -ENOBUFS; } @@ -1393,7 +1399,9 @@ int bt_le_per_adv_set_response_data(struct bt_le_per_adv_sync *per_adv_sync, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PER_ADV_RESPONSE_DATA, + sizeof(*cp) + data->len); + if (!buf) { return -ENOBUFS; } @@ -1919,7 +1927,7 @@ int bt_le_per_adv_sync_create(const struct bt_le_per_adv_sync_param *param, return -ENOMEM; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_PER_ADV_CREATE_SYNC, sizeof(*cp)); if (!buf) { per_adv_sync_delete(per_adv_sync); return -ENOBUFS; @@ -2026,7 +2034,7 @@ static int bt_le_per_adv_sync_create_cancel( return err; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_PER_ADV_CREATE_SYNC_CANCEL, 0); if (!buf) { return -ENOBUFS; } @@ -2122,7 +2130,8 @@ static int bt_le_set_per_adv_recv_enable( return -EALREADY; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PER_ADV_RECV_ENABLE, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -2180,7 +2189,8 @@ int bt_le_per_adv_sync_transfer(const struct bt_le_per_adv_sync *per_adv_sync, return -ENOTSUP; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_PER_ADV_SYNC_TRANSFER, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -2220,7 +2230,7 @@ static int past_param_set(const struct bt_conn *conn, uint8_t mode, struct bt_hci_cp_le_past_param *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_PAST_PARAM, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -2243,7 +2253,7 @@ static int default_past_param_set(uint8_t mode, uint16_t skip, uint16_t timeout, struct bt_hci_cp_le_default_past_param *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_DEFAULT_PAST_PARAM, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -2371,7 +2381,8 @@ int bt_le_per_adv_list_add(const bt_addr_le_t *addr, uint8_t sid) return -EAGAIN; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_ADD_DEV_TO_PER_ADV_LIST, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -2401,7 +2412,8 @@ int bt_le_per_adv_list_remove(const bt_addr_le_t *addr, uint8_t sid) return -EAGAIN; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_REM_DEV_FROM_PER_ADV_LIST, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } From 79a7fdfd15c76225939f1b468bf6547b9cb92101 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 599/881] Revert "[nrf fromtree] Bluetooth: Host: iso: Use bt_hci_cmd_alloc()" This reverts commit 54cabb79364154bcff27f93c7bef20e6dc8a4e0c. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/iso.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index eb6eaa78350..ffdf3ec0736 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -196,7 +196,7 @@ static int hci_le_setup_iso_data_path(const struct bt_conn *iso, uint8_t dir, uint8_t *cc; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SETUP_ISO_PATH, sizeof(*cp) + path->cc_len); if (!buf) { return -ENOBUFS; } @@ -345,7 +345,7 @@ static int hci_le_remove_iso_data_path(struct bt_conn *iso, uint8_t dir) struct net_buf *buf, *rsp; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_REMOVE_ISO_PATH, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1061,7 +1061,7 @@ int bt_iso_chan_get_tx_sync(const struct bt_iso_chan *chan, struct bt_iso_tx_inf return -ENOTCONN; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_READ_ISO_TX_SYNC, sizeof(*cp)); if (!buf) { return -ENOMEM; } @@ -1491,7 +1491,7 @@ static int hci_le_reject_cis(uint16_t handle, uint8_t reason) struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_REJECT_CIS, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1514,7 +1514,7 @@ static int hci_le_accept_cis(uint16_t handle) struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_ACCEPT_CIS, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1683,7 +1683,7 @@ static int hci_le_remove_cig(uint8_t cig_id) struct bt_hci_cp_le_remove_cig *req; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_REMOVE_CIG, sizeof(*req)); if (!buf) { return -ENOBUFS; } @@ -1706,7 +1706,8 @@ static struct net_buf *hci_le_set_cig_params(const struct bt_iso_cig *cig, struct net_buf *rsp; int i, err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CIG_PARAMS, + sizeof(*req) + sizeof(*cis_param) * param->num_cis); if (!buf) { return NULL; } @@ -1794,7 +1795,8 @@ static struct net_buf *hci_le_set_cig_test_params(const struct bt_iso_cig *cig, struct net_buf *rsp; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CIG_PARAMS_TEST, + sizeof(*req) + sizeof(*cis_param) * param->num_cis); if (!buf) { return NULL; } @@ -2442,7 +2444,7 @@ static int hci_le_create_cis(const struct bt_iso_connect_param *param, size_t co struct bt_hci_cp_le_create_cis *req; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_CIS, sizeof(*req) + sizeof(*cis) * count); if (!buf) { return -ENOBUFS; } @@ -2782,7 +2784,7 @@ static int hci_le_create_big(struct bt_le_ext_adv *padv, struct bt_iso_big *big, int err; struct bt_iso_chan *bis; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_BIG, sizeof(*req)); if (!buf) { return -ENOBUFS; @@ -2842,7 +2844,7 @@ static int hci_le_create_big_test(const struct bt_le_ext_adv *padv, struct bt_is struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_BIG_TEST, sizeof(*req)); if (!buf) { return -ENOBUFS; @@ -3196,7 +3198,7 @@ static int hci_le_terminate_big(struct bt_iso_big *big) struct bt_hci_cp_le_terminate_big *req; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_TERMINATE_BIG, sizeof(*req)); if (!buf) { return -ENOBUFS; } @@ -3216,7 +3218,7 @@ static int hci_le_big_sync_term(struct bt_iso_big *big) struct net_buf *rsp; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_BIG_TERMINATE_SYNC, sizeof(*req)); if (!buf) { return -ENOBUFS; } @@ -3389,7 +3391,7 @@ static int hci_le_big_create_sync(const struct bt_le_per_adv_sync *sync, struct int err; uint8_t bit_idx = 0; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_BIG_CREATE_SYNC, sizeof(*req) + big->num_bis); if (!buf) { return -ENOBUFS; } From 57f38a6e4c833449e0670c480d5a49bee530930d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 600/881] Revert "[nrf fromtree] Bluetooth: Host: id: Use bt_hci_cmd_alloc()" This reverts commit b4964932862ac9744cce05e6ed3b11642d177db4. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/id.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index af5176574eb..926175f8b33 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -142,7 +142,7 @@ static int set_random_address(const bt_addr_t *addr) return 0; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, sizeof(*addr)); if (!buf) { return -ENOBUFS; } @@ -193,7 +193,8 @@ int bt_id_set_adv_random_addr(struct bt_le_ext_adv *adv, return 0; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_SET_RANDOM_ADDR, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -313,7 +314,8 @@ static void le_rpa_timeout_update(void) struct net_buf *buf; struct bt_hci_cp_le_set_rpa_timeout *cp; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RPA_TIMEOUT, + sizeof(*cp)); if (!buf) { LOG_ERR("Failed to create HCI RPA timeout command"); err = -ENOBUFS; @@ -848,7 +850,7 @@ static int le_set_privacy_mode(const bt_addr_le_t *addr, uint8_t mode) bt_addr_le_copy(&cp.id_addr, addr); cp.mode = mode; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PRIVACY_MODE, sizeof(cp)); if (!buf) { return -ENOBUFS; } @@ -869,7 +871,7 @@ static int addr_res_enable(uint8_t enable) LOG_DBG("%s", enable ? "enabled" : "disabled"); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADDR_RES_ENABLE, 1); if (!buf) { return -ENOBUFS; } @@ -891,7 +893,7 @@ static int hci_id_add(uint8_t id, const bt_addr_le_t *addr, uint8_t peer_irk[16] LOG_DBG("addr %s", bt_addr_le_str(addr)); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_ADD_DEV_TO_RL, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1139,7 +1141,7 @@ static int hci_id_del(const bt_addr_le_t *addr) LOG_DBG("addr %s", bt_addr_le_str(addr)); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_REM_DEV_FROM_RL, sizeof(*cp)); if (!buf) { return -ENOBUFS; } From acd19f959e7cfdfc12dac92abefe2f02e90b3c37 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 601/881] Revert "[nrf fromtree] Bluetooth: Host: direction: Use bt_hci_cmd_alloc()" This reverts commit 511df0acc1befe800bf0677b6270e7466b10f803. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/direction.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/host/direction.c b/subsys/bluetooth/host/direction.c index 73a196a8e20..a59cbdada37 100644 --- a/subsys/bluetooth/host/direction.c +++ b/subsys/bluetooth/host/direction.c @@ -129,7 +129,8 @@ static int hci_df_set_cl_cte_tx_params(const struct bt_le_ext_adv *adv, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CL_CTE_TX_PARAMS, + sizeof(*cp) + params->num_ant_ids); if (!buf) { return -ENOBUFS; } @@ -215,7 +216,7 @@ static int hci_df_set_adv_cte_tx_enable(struct bt_le_ext_adv *adv, struct bt_hci_cmd_state_set state; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CL_CTE_TX_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -295,7 +296,9 @@ prepare_cl_cte_rx_enable_cmd_params(struct net_buf **buf, struct bt_le_per_adv_s /* If CTE Rx is enabled, command parameters total length must include * antenna ids, so command size if extended by num_and_ids. */ - *buf = bt_hci_cmd_alloc(K_FOREVER); + *buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CL_CTE_SAMPLING_ENABLE, + (sizeof(struct bt_hci_cp_le_set_cl_cte_sampling_enable) + + (enable ? switch_pattern_len : 0))); if (!(*buf)) { return -ENOBUFS; } @@ -525,6 +528,7 @@ static int hci_df_set_conn_cte_tx_param(struct bt_conn *conn, struct bt_hci_rp_le_set_conn_cte_tx_params *rp; struct bt_hci_cmd_state_set state; struct net_buf *buf, *rsp; + uint8_t num_ant_ids; int err; /* If AoD is not enabled, ant_ids are ignored by controller: @@ -534,7 +538,11 @@ static int hci_df_set_conn_cte_tx_param(struct bt_conn *conn, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + num_ant_ids = ((params->cte_types & (BT_DF_CTE_TYPE_AOD_1US | BT_DF_CTE_TYPE_AOD_2US)) ? + params->num_ant_ids : 0); + + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CONN_CTE_TX_PARAMS, + sizeof(struct bt_hci_cp_le_set_conn_cte_tx_params) + num_ant_ids); if (!buf) { return -ENOBUFS; } @@ -579,7 +587,9 @@ static int prepare_conn_cte_rx_enable_cmd_params(struct net_buf **buf, struct bt /* If CTE Rx is enabled, command parameters total length must include * antenna ids, so command size if extended by num_and_ids. */ - *buf = bt_hci_cmd_alloc(K_FOREVER); + *buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CONN_CTE_RX_PARAMS, + (sizeof(struct bt_hci_cp_le_set_conn_cte_rx_params) + + (enable ? switch_pattern_len : 0))); if (!(*buf)) { return -ENOBUFS; } @@ -813,7 +823,8 @@ static int hci_df_set_conn_cte_req_enable(struct bt_conn *conn, bool enable, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CONN_CTE_REQ_ENABLE, + sizeof(struct bt_hci_cp_le_conn_cte_req_enable)); if (!buf) { return -ENOBUFS; } @@ -898,7 +909,8 @@ static int hci_df_set_conn_cte_rsp_enable(struct bt_conn *conn, bool enable) struct net_buf *buf, *rsp; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CONN_CTE_RSP_ENABLE, + sizeof(struct bt_hci_cp_le_conn_cte_rsp_enable)); if (!buf) { return -ENOBUFS; } From 548b9c44f73e5391df731abb02e86fee73989735 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 602/881] Revert "[nrf fromtree] Bluetooth: Host: cs: Use bt_hci_cmd_alloc()" This reverts commit ce112c5db40f97a8db4328f12f949a00cd978b9b. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/cs.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/subsys/bluetooth/host/cs.c b/subsys/bluetooth/host/cs.c index baad4204bc6..a7bdefa77a1 100644 --- a/subsys/bluetooth/host/cs.c +++ b/subsys/bluetooth/host/cs.c @@ -296,7 +296,7 @@ int bt_le_cs_read_remote_supported_capabilities(struct bt_conn *conn) struct bt_hci_cp_le_read_remote_supported_capabilities *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -439,7 +439,7 @@ int bt_le_cs_set_default_settings(struct bt_conn *conn, struct bt_hci_cp_le_cs_set_default_settings *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_DEFAULT_SETTINGS, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -466,7 +466,7 @@ int bt_le_cs_read_remote_fae_table(struct bt_conn *conn) struct bt_hci_cp_le_read_remote_fae_table *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_READ_REMOTE_FAE_TABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -884,7 +884,7 @@ int bt_le_cs_create_config(struct bt_conn *conn, struct bt_le_cs_create_config_p struct bt_hci_cp_le_cs_create_config *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_CREATE_CONFIG, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -917,7 +917,7 @@ int bt_le_cs_remove_config(struct bt_conn *conn, uint8_t config_id) struct bt_hci_cp_le_cs_remove_config *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_REMOVE_CONFIG, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -934,7 +934,7 @@ int bt_le_cs_security_enable(struct bt_conn *conn) struct bt_hci_cp_le_security_enable *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SECURITY_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -951,7 +951,7 @@ int bt_le_cs_procedure_enable(struct bt_conn *conn, struct bt_hci_cp_le_procedure_enable *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_PROCEDURE_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -970,7 +970,7 @@ int bt_le_cs_set_procedure_parameters(struct bt_conn *conn, struct bt_hci_cp_le_set_procedure_parameters *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_PROCEDURE_PARAMETERS, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -999,7 +999,7 @@ int bt_le_cs_set_channel_classification(uint8_t channel_classification[10]) uint8_t *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_CHANNEL_CLASSIFICATION, 10); if (!buf) { return -ENOBUFS; } @@ -1111,7 +1111,9 @@ int bt_le_cs_write_cached_remote_supported_capabilities( struct bt_hci_cp_le_write_cached_remote_supported_capabilities *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES, + sizeof(*cp)); + if (!buf) { return -ENOBUFS; } @@ -1208,7 +1210,7 @@ int bt_le_cs_write_cached_remote_fae_table(struct bt_conn *conn, int8_t remote_f struct bt_hci_cp_le_write_cached_remote_fae_table *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1306,7 +1308,7 @@ int bt_le_cs_stop_test(void) { struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_TEST_END, 0); if (!buf) { return -ENOBUFS; } From 40e7789797e5ca9902a9a10f7162bbefd089edef Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 603/881] Revert "[nrf fromtree] Bluetooth: Host: conn: Use bt_hci_cmd_alloc()" This reverts commit c2cdce7a7c21fe85d8303aa609ee8f4f78c1cdb9. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/conn.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 0c34dc0b616..a7aca69fa9d 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2472,7 +2472,7 @@ int bt_conn_le_start_encryption(struct bt_conn *conn, uint8_t rand[8], return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_START_ENCRYPTION, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -2511,7 +2511,8 @@ uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) struct net_buf *rsp; uint8_t key_size; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE, + sizeof(*cp)); if (!buf) { return 0; } @@ -2977,7 +2978,7 @@ static int bt_conn_get_tx_power_level(struct bt_conn *conn, uint8_t type, struct bt_hci_cp_read_tx_power_level *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_TX_POWER_LEVEL, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3036,7 +3037,7 @@ int bt_conn_le_enhanced_get_tx_power_level(struct bt_conn *conn, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_ENH_READ_TX_POWER_LEVEL, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3074,7 +3075,7 @@ int bt_conn_le_get_remote_tx_power_level(struct bt_conn *conn, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_READ_REMOTE_TX_POWER_LEVEL, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3098,7 +3099,7 @@ int bt_conn_le_set_tx_power_report_enable(struct bt_conn *conn, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_TX_POWER_REPORT_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3174,7 +3175,7 @@ int bt_conn_le_set_path_loss_mon_param(struct bt_conn *conn, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PATH_LOSS_REPORTING_PARAMETERS, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3200,7 +3201,7 @@ int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool reporting_ena return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PATH_LOSS_REPORTING_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3275,7 +3276,7 @@ int bt_conn_le_subrate_set_defaults(const struct bt_conn_le_subrate_param *param return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_DEFAULT_SUBRATE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3305,7 +3306,7 @@ int bt_conn_le_subrate_request(struct bt_conn *conn, return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SUBRATE_REQUEST, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3935,7 +3936,8 @@ int bt_conn_le_conn_update(struct bt_conn *conn, struct hci_cp_le_conn_update *conn_update; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CONN_UPDATE, + sizeof(*conn_update)); if (!buf) { return -ENOBUFS; } From 13fc0e899c2152cb3d1f0e4e82499ddc5f9e13e1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 604/881] Revert "[nrf fromtree] Bluetooth: Host: Classic: Use bt_hci_cmd_alloc()" This reverts commit 1d58fa2bbf3e31d061035479d72a8138e429f88e. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/classic/br.c | 38 +++++++++++++------------ subsys/bluetooth/host/classic/conn_br.c | 4 +-- subsys/bluetooth/host/classic/sco.c | 4 +-- subsys/bluetooth/host/classic/ssp.c | 25 ++++++++-------- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/subsys/bluetooth/host/classic/br.c b/subsys/bluetooth/host/classic/br.c index 994fcfbd22c..abbd345b44b 100644 --- a/subsys/bluetooth/host/classic/br.c +++ b/subsys/bluetooth/host/classic/br.c @@ -41,7 +41,7 @@ static int reject_conn(const bt_addr_t *bdaddr, uint8_t reason) struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_REJECT_CONN_REQ, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -64,7 +64,7 @@ static int accept_conn(const bt_addr_t *bdaddr) struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_ACCEPT_CONN_REQ, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -118,7 +118,7 @@ static bool br_sufficient_key_size(struct bt_conn *conn) uint8_t key_size; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE, sizeof(*cp)); if (!buf) { LOG_ERR("Failed to allocate command buffer"); return false; @@ -254,7 +254,7 @@ void bt_hci_conn_complete(struct net_buf *buf) bt_conn_unref(conn); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_REMOTE_FEATURES, sizeof(*cp)); if (!buf) { return; } @@ -270,7 +270,7 @@ static int request_name(const bt_addr_t *addr, uint8_t pscan, uint16_t offset) struct bt_hci_cp_remote_name_request *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_REMOTE_NAME_REQUEST, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -637,7 +637,7 @@ void bt_hci_read_remote_features_complete(struct net_buf *buf) goto done; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_REMOTE_EXT_FEATURES, sizeof(*cp)); if (!buf) { goto done; } @@ -711,7 +711,7 @@ static int read_ext_features(void) struct net_buf *buf, *rsp; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_LOCAL_EXT_FEATURES, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -800,6 +800,7 @@ int bt_br_init(void) struct bt_hci_cp_write_ssp_mode *ssp_cp; struct bt_hci_cp_write_inquiry_mode *inq_cp; struct bt_hci_write_local_name *name_cp; + struct bt_hci_cp_write_class_of_device *cod; int err; /* Read extended local features */ @@ -823,7 +824,7 @@ int bt_br_init(void) net_buf_unref(buf); /* Set SSP mode */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_SSP_MODE, sizeof(*ssp_cp)); if (!buf) { return -ENOBUFS; } @@ -836,7 +837,7 @@ int bt_br_init(void) } /* Enable Inquiry results with RSSI or extended Inquiry */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_INQUIRY_MODE, sizeof(*inq_cp)); if (!buf) { return -ENOBUFS; } @@ -849,7 +850,7 @@ int bt_br_init(void) } /* Set local name */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_LOCAL_NAME, sizeof(*name_cp)); if (!buf) { return -ENOBUFS; } @@ -863,7 +864,7 @@ int bt_br_init(void) } /* Set Class of device */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_CLASS_OF_DEVICE, sizeof(*cod)); if (!buf) { return -ENOBUFS; } @@ -876,7 +877,7 @@ int bt_br_init(void) } /* Set page timeout*/ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_PAGE_TIMEOUT, sizeof(uint16_t)); if (!buf) { return -ENOBUFS; } @@ -892,7 +893,7 @@ int bt_br_init(void) if (BT_FEAT_SC(bt_dev.features)) { struct bt_hci_cp_write_sc_host_supp *sc_cp; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_SC_HOST_SUPP, sizeof(*sc_cp)); if (!buf) { return -ENOBUFS; } @@ -915,7 +916,7 @@ static int br_start_inquiry(const struct bt_br_discovery_param *param) struct bt_hci_op_inquiry *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_INQUIRY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1004,7 +1005,7 @@ int bt_br_discovery_stop(void) continue; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_REMOTE_NAME_CANCEL, sizeof(*cp)); if (!buf) { continue; } @@ -1041,7 +1042,7 @@ static int write_scan_enable(uint8_t scan) LOG_DBG("type %u", scan); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_SCAN_ENABLE, 1); if (!buf) { return -ENOBUFS; } @@ -1089,7 +1090,7 @@ static int bt_br_write_current_iac_lap(bool limited) param_len = sizeof(*iac_lap) + (num_current_iac * sizeof(struct bt_hci_iac_lap)); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_CURRENT_IAC_LAP, param_len); if (!buf) { return -ENOBUFS; } @@ -1141,7 +1142,8 @@ static int bt_br_write_cod(uint32_t cod) struct net_buf *buf; /* Set Class of device */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_WRITE_CLASS_OF_DEVICE, + sizeof(struct bt_hci_cp_write_class_of_device)); if (!buf) { return -ENOBUFS; } diff --git a/subsys/bluetooth/host/classic/conn_br.c b/subsys/bluetooth/host/classic/conn_br.c index 582d560c4df..27f6dbb7d8b 100644 --- a/subsys/bluetooth/host/classic/conn_br.c +++ b/subsys/bluetooth/host/classic/conn_br.c @@ -73,7 +73,7 @@ struct bt_conn *bt_conn_create_br(const bt_addr_t *peer, return NULL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_CONNECT, sizeof(*cp)); if (!buf) { bt_conn_unref(conn); return NULL; @@ -107,7 +107,7 @@ int bt_hci_connect_br_cancel(struct bt_conn *conn) struct net_buf *buf, *rsp; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_CONNECT_CANCEL, sizeof(*cp)); if (!buf) { return -ENOBUFS; } diff --git a/subsys/bluetooth/host/classic/sco.c b/subsys/bluetooth/host/classic/sco.c index baee819b42b..9157caaf941 100644 --- a/subsys/bluetooth/host/classic/sco.c +++ b/subsys/bluetooth/host/classic/sco.c @@ -258,7 +258,7 @@ static int accept_sco_conn(const bt_addr_t *bdaddr, struct bt_conn *sco_conn) return err; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_ACCEPT_SYNC_CONN_REQ, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -334,7 +334,7 @@ static int sco_setup_sync_conn(struct bt_conn *sco_conn) struct bt_hci_cp_setup_sync_conn *cp; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_SETUP_SYNC_CONN, sizeof(*cp)); if (!buf) { return -ENOBUFS; } diff --git a/subsys/bluetooth/host/classic/ssp.c b/subsys/bluetooth/host/classic/ssp.c index 722ac09cbb8..1064165a5a1 100644 --- a/subsys/bluetooth/host/classic/ssp.c +++ b/subsys/bluetooth/host/classic/ssp.c @@ -50,7 +50,7 @@ static int pin_code_neg_reply(const bt_addr_t *bdaddr) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_PIN_CODE_NEG_REPLY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -68,7 +68,7 @@ static int pin_code_reply(struct bt_conn *conn, const char *pin, uint8_t len) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_PIN_CODE_REPLY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -186,7 +186,7 @@ static int ssp_confirm_reply(struct bt_conn *conn) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_USER_CONFIRM_REPLY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -204,7 +204,7 @@ static int ssp_confirm_neg_reply(struct bt_conn *conn) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_USER_CONFIRM_NEG_REPLY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -313,7 +313,7 @@ static int ssp_passkey_reply(struct bt_conn *conn, unsigned int passkey) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_USER_PASSKEY_REPLY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -332,7 +332,7 @@ static int ssp_passkey_neg_reply(struct bt_conn *conn) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_USER_PASSKEY_NEG_REPLY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -351,7 +351,7 @@ static int conn_auth(struct bt_conn *conn) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_AUTH_REQUESTED, sizeof(*auth)); if (!buf) { return -ENOBUFS; } @@ -539,7 +539,7 @@ void link_key_neg_reply(const bt_addr_t *bdaddr) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LINK_KEY_NEG_REPLY, sizeof(*cp)); if (!buf) { LOG_ERR("Out of command buffers"); return; @@ -557,7 +557,7 @@ void link_key_reply(const bt_addr_t *bdaddr, const uint8_t *lk) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LINK_KEY_REPLY, sizeof(*cp)); if (!buf) { LOG_ERR("Out of command buffers"); return; @@ -613,7 +613,8 @@ void io_capa_neg_reply(const bt_addr_t *bdaddr, const uint8_t reason) struct bt_hci_cp_io_capability_neg_reply *cp; struct net_buf *resp_buf; - resp_buf = bt_hci_cmd_alloc(K_FOREVER); + resp_buf = bt_hci_cmd_create(BT_HCI_OP_IO_CAPABILITY_NEG_REPLY, + sizeof(*cp)); if (!resp_buf) { LOG_ERR("Out of command buffers"); return; @@ -768,7 +769,7 @@ void bt_hci_io_capa_req(struct net_buf *buf) conn->br.local_auth = auth; - resp_buf = bt_hci_cmd_alloc(K_FOREVER); + resp_buf = bt_hci_cmd_create(BT_HCI_OP_IO_CAPABILITY_REPLY, sizeof(*cp)); if (!resp_buf) { LOG_ERR("Out of command buffers"); bt_conn_unref(conn); @@ -864,7 +865,7 @@ static void link_encr(const uint16_t handle) LOG_DBG(""); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_SET_CONN_ENCRYPT, sizeof(*encr)); if (!buf) { LOG_ERR("Out of command buffers"); return; From 22d8faafe7d6631b92613cd9814252315dc7b713 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 605/881] Revert "[nrf fromtree] Bluetooth: Host: adv: Use bt_hci_cmd_alloc()" This reverts commit a813bd28a864a6d3ace2087b2340d3bd36c99f0c. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/adv.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 25a538614e3..0694c2ce54b 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -335,7 +335,7 @@ int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable) struct bt_hci_cmd_state_set state; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_ENABLE, 1); if (!buf) { return -ENOBUFS; } @@ -364,7 +364,7 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, struct bt_hci_cmd_state_set state; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_EXT_ADV_ENABLE, 6); if (!buf) { return -ENOBUFS; } @@ -551,7 +551,7 @@ static int hci_set_ad(uint16_t hci_op, const struct bt_ad *ad, size_t ad_len) struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(hci_op, sizeof(*set_data)); if (!buf) { return -ENOBUFS; } @@ -585,7 +585,7 @@ static int hci_set_adv_ext_complete(struct bt_le_ext_adv *adv, uint16_t hci_op, cmd_size = sizeof(*set_data) + total_data_len; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(hci_op, cmd_size); if (!buf) { return -ENOBUFS; } @@ -625,7 +625,7 @@ static int hci_set_adv_ext_fragmented(struct bt_le_ext_adv *adv, uint16_t hci_op const size_t data_len = MIN(BT_HCI_LE_EXT_ADV_FRAG_MAX_LEN, stream.remaining_size); const size_t cmd_size = sizeof(*set_data) + data_len; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(hci_op, cmd_size); if (!buf) { return -ENOBUFS; } @@ -738,7 +738,7 @@ static int hci_set_per_adv_data(const struct bt_le_ext_adv *adv, const size_t data_len = MIN(BT_HCI_LE_PER_ADV_FRAG_MAX_LEN, stream.remaining_size); const size_t cmd_size = sizeof(*set_data) + data_len; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PER_ADV_DATA, cmd_size); if (!buf) { return -ENOBUFS; } @@ -1056,7 +1056,7 @@ int bt_le_adv_start_legacy(struct bt_le_ext_adv *adv, set_param.type = BT_HCI_ADV_NONCONN_IND; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(set_param)); if (!buf) { return -ENOBUFS; } @@ -1168,7 +1168,7 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, size = sizeof(struct bt_hci_cp_le_set_ext_adv_param); } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(opcode, size); if (!buf) { return -ENOBUFS; } @@ -1821,7 +1821,7 @@ int bt_le_ext_adv_delete(struct bt_le_ext_adv *adv) return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_REMOVE_ADV_SET, sizeof(*cp)); if (!buf) { LOG_WRN("No HCI buffers"); return -ENOBUFS; @@ -1920,7 +1920,7 @@ int bt_le_per_adv_set_param(struct bt_le_ext_adv *adv, return -ENOTSUP; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(opcode, size); if (!buf) { return -ENOBUFS; } @@ -2029,7 +2029,7 @@ int bt_le_per_adv_set_subevent_data(const struct bt_le_ext_adv *adv, uint8_t num return -EINVAL; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PER_ADV_SUBEVENT_DATA, (uint8_t)cmd_length); if (!buf) { return -ENOBUFS; } @@ -2076,7 +2076,7 @@ static int bt_le_per_adv_enable(struct bt_le_ext_adv *adv, bool enable) return -EALREADY; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PER_ADV_ENABLE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -2230,7 +2230,8 @@ int bt_le_per_adv_set_info_transfer(const struct bt_le_ext_adv *adv, return -ENOTSUP; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_PER_ADV_SET_INFO_TRANSFER, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } From 5ae3ba6d0112ef96b0fd4ad57b636ef9155857d0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 606/881] Revert "[nrf fromtree] Bluetooth: Host: core: Use bt_hci_cmd_alloc()" This reverts commit 4276146948cd29be8bca54b5489c276ecfad871e. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/hci_core.c | 69 +++++++++++++++++++------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 3a866c6346d..6742a2fc7ab 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -268,7 +268,8 @@ void bt_send_one_host_num_completed_packets(uint16_t handle) LOG_DBG("Reporting completed packet for handle %u", handle); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS, + sizeof(*cp) + sizeof(*hc)); BT_ASSERT_MSG(buf, "Unable to alloc for Host NCP"); cp = net_buf_add(buf, sizeof(*cp)); @@ -325,7 +326,8 @@ void bt_hci_host_num_completed_packets(struct net_buf *buf) LOG_DBG("Reporting completed packet for handle %u", handle); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS, + sizeof(*cp) + sizeof(*hc)); if (!buf) { LOG_ERR("Unable to allocate new HCI command"); return; @@ -776,7 +778,8 @@ int bt_le_create_conn_ext(const struct bt_conn *conn) ((bt_dev.create_param.options & BT_CONN_LE_OPT_CODED) ? 1 : 0); - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_EXT_CREATE_CONN, sizeof(*cp) + + num_phys * sizeof(*phy)); if (!buf) { return -ENOBUFS; } @@ -846,7 +849,7 @@ int bt_le_create_conn_synced(const struct bt_conn *conn, const struct bt_le_ext_ } /* There shall only be one Initiating_PHYs */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_EXT_CREATE_CONN_V2, sizeof(*cp) + sizeof(*phy)); if (!buf) { return -ENOBUFS; } @@ -896,7 +899,7 @@ static int bt_le_create_conn_legacy(const struct bt_conn *conn) return err; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_CONN, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -951,7 +954,7 @@ int bt_le_create_conn_cancel(void) struct net_buf *buf; struct bt_hci_cmd_state_set state; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_CONN_CANCEL, 0); if (!buf) { return -ENOBUFS; } @@ -968,7 +971,7 @@ int bt_hci_disconnect(uint16_t handle, uint8_t reason) struct net_buf *buf; struct bt_hci_cp_disconnect *disconn; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_DISCONNECT, sizeof(*disconn)); if (!buf) { return -ENOBUFS; } @@ -1106,7 +1109,8 @@ int bt_hci_le_read_remote_features(struct bt_conn *conn) struct bt_hci_cp_le_read_remote_features *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_READ_REMOTE_FEATURES, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1131,7 +1135,8 @@ int bt_hci_read_remote_version(struct bt_conn *conn) return 0; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_READ_REMOTE_VERSION_INFO, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1151,7 +1156,7 @@ int bt_le_set_data_len(struct bt_conn *conn, uint16_t tx_octets, uint16_t tx_tim struct bt_hci_cp_le_set_data_len *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_DATA_LEN, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1172,7 +1177,7 @@ static int hci_le_read_phy(struct bt_conn *conn) struct net_buf *buf, *rsp; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_READ_PHY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1200,7 +1205,7 @@ int bt_le_set_phy(struct bt_conn *conn, uint8_t all_phys, struct bt_hci_cp_le_set_phy *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_PHY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -1903,7 +1908,8 @@ static void le_conn_param_neg_reply(uint16_t handle, uint8_t reason) struct bt_hci_cp_le_conn_param_req_neg_reply *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY, + sizeof(*cp)); if (!buf) { LOG_ERR("Unable to allocate buffer"); return; @@ -1922,7 +1928,7 @@ static int le_conn_param_req_reply(uint16_t handle, struct bt_hci_cp_le_conn_param_req_reply *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CONN_PARAM_REQ_REPLY, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -2057,7 +2063,8 @@ static int set_flow_control(void) return 0; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_HOST_BUFFER_SIZE, + sizeof(*hbs)); if (!buf) { return -ENOBUFS; } @@ -2072,7 +2079,7 @@ static int set_flow_control(void) return err; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_SET_CTL_TO_HOST_FLOW, 1); if (!buf) { return -ENOBUFS; } @@ -2396,7 +2403,7 @@ static void le_ltk_neg_reply(uint16_t handle) struct bt_hci_cp_le_ltk_req_neg_reply *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_LTK_REQ_NEG_REPLY, sizeof(*cp)); if (!buf) { LOG_ERR("Out of command buffers"); @@ -2414,7 +2421,8 @@ static void le_ltk_reply(uint16_t handle, uint8_t *ltk) struct bt_hci_cp_le_ltk_req_reply *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_LTK_REQ_REPLY, + sizeof(*cp)); if (!buf) { LOG_ERR("Out of command buffers"); return; @@ -3249,7 +3257,7 @@ static int le_set_host_feature(uint8_t bit_number, uint8_t bit_value) struct bt_hci_cp_le_set_host_feature *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_HOST_FEATURE, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3376,7 +3384,7 @@ static int le_set_event_mask(void) uint64_t mask = 0U; /* Set LE event mask */ - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_EVENT_MASK, sizeof(*cp_mask)); if (!buf) { return -ENOBUFS; } @@ -3630,7 +3638,8 @@ static int le_init(void) #endif /* CONFIG_BT_BROADCASTER */ if (BT_FEAT_BREDR(bt_dev.features)) { - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_WRITE_LE_HOST_SUPP, + sizeof(*cp_le)); if (!buf) { return -ENOBUFS; } @@ -3671,7 +3680,8 @@ static int le_init(void) return err; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3692,7 +3702,8 @@ static int le_init(void) #if defined(CONFIG_BT_PRIVACY) struct bt_hci_cp_le_set_rpa_timeout *cp; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RPA_TIMEOUT, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -3787,7 +3798,7 @@ static int set_event_mask(void) struct net_buf *buf; uint64_t mask = 0U; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_SET_EVENT_MASK, sizeof(*ev)); if (!buf) { return -ENOBUFS; } @@ -4641,7 +4652,7 @@ int bt_le_filter_accept_list_add(const bt_addr_le_t *addr) return -EAGAIN; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_ADD_DEV_TO_FAL, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -4669,7 +4680,7 @@ int bt_le_filter_accept_list_remove(const bt_addr_le_t *addr) return -EAGAIN; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_REM_DEV_FROM_FAL, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -4719,7 +4730,8 @@ int bt_le_set_chan_map(uint8_t chan_map[5]) return -ENOTSUP; } - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_HOST_CHAN_CLASSIF, + sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -4760,7 +4772,8 @@ int bt_configure_data_path(uint8_t dir, uint8_t id, uint8_t vs_config_len, struct net_buf *buf; int err; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_CONFIGURE_DATA_PATH, sizeof(*cp) + + vs_config_len); if (!buf) { return -ENOBUFS; } From 8bb5294694021a0abcff5eb71e3a36c023ff1163 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 607/881] Revert "[nrf fromtree] Bluetooth: Host: CS: Fix test HCI command encoding" This reverts commit bd698bf422b26ee8db9782a06d68334686e81c8c. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/host/cs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/cs.c b/subsys/bluetooth/host/cs.c index a7bdefa77a1..ec274f7ab9f 100644 --- a/subsys/bluetooth/host/cs.c +++ b/subsys/bluetooth/host/cs.c @@ -522,7 +522,7 @@ int bt_le_cs_start_test(const struct bt_le_cs_test_param *params) struct bt_hci_op_le_cs_test *cp; struct net_buf *buf; - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_TEST, sizeof(*cp)); if (!buf) { return -ENOBUFS; } @@ -617,6 +617,10 @@ int bt_le_cs_start_test(const struct bt_le_cs_test_param *params) cp->override_parameters_length = override_parameters_length; + struct bt_hci_cmd_hdr *hdr = (struct bt_hci_cmd_hdr *)buf->data; + + hdr->param_len += override_parameters_length; + return bt_hci_cmd_send_sync(BT_HCI_OP_LE_CS_TEST, buf, NULL); } #endif /* CONFIG_BT_CHANNEL_SOUNDING_TEST */ From 386dc248dede5700278f33d5dc732bdbdd85ef41 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 608/881] Revert "[nrf fromtree] Bluetooth: Host: Introduce bt_hci_cmd_alloc()" This reverts commit a0036ce12512bfb3edb095a41bb39ddebb3c1c92. Signed-off-by: Jukka Rissanen --- include/zephyr/bluetooth/hci.h | 14 -------- subsys/bluetooth/host/hci_core.c | 60 +++++++------------------------- 2 files changed, 13 insertions(+), 61 deletions(-) diff --git a/include/zephyr/bluetooth/hci.h b/include/zephyr/bluetooth/hci.h index dd9c60c8ae8..590ea55a84a 100644 --- a/include/zephyr/bluetooth/hci.h +++ b/include/zephyr/bluetooth/hci.h @@ -63,20 +63,6 @@ static inline const char *bt_hci_err_to_str(uint8_t hci_err) */ struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len); -/** Allocate an HCI command buffer. - * - * This function allocates a new buffer for an HCI command. Upon successful - * return the buffer is ready to have the command parameters encoded into it. - * Sufficient headroom gets automatically reserved in the buffer, allowing - * the actual command and H:4 headers to be encoded later, as part of - * calling bt_hci_cmd_send() or bt_hci_cmd_send_sync(). - * - * @param timeout Timeout for the allocation. - * - * @return Newly allocated buffer or NULL if allocation failed. - */ -struct net_buf *bt_hci_cmd_alloc(k_timeout_t timeout); - /** Send a HCI command asynchronously. * * This function is used for sending a HCI command asynchronously. It can diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 6742a2fc7ab..335fdc642a3 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -351,27 +351,8 @@ struct net_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len) LOG_DBG("opcode 0x%04x param_len %u", opcode, param_len); - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - return NULL; - } - - LOG_DBG("buf %p", buf); - - hdr = net_buf_push(buf, sizeof(*hdr)); - hdr->opcode = sys_cpu_to_le16(opcode); - hdr->param_len = param_len; - - net_buf_push_u8(buf, BT_HCI_H4_CMD); - - return buf; -} - -struct net_buf *bt_hci_cmd_alloc(k_timeout_t timeout) -{ - struct net_buf *buf; - - buf = net_buf_alloc(&hci_cmd_pool, timeout); + /* net_buf_alloc(K_FOREVER) can fail when run from the syswq */ + buf = net_buf_alloc(&hci_cmd_pool, K_FOREVER); if (!buf) { LOG_DBG("Unable to allocate a command buffer"); return NULL; @@ -379,41 +360,29 @@ struct net_buf *bt_hci_cmd_alloc(k_timeout_t timeout) LOG_DBG("buf %p", buf); - /* Reserve H:4 header and HCI command header */ - net_buf_reserve(buf, sizeof(uint8_t) + sizeof(struct bt_hci_cmd_hdr)); + net_buf_add_u8(buf, BT_HCI_H4_CMD); - cmd(buf)->opcode = 0; + cmd(buf)->opcode = opcode; cmd(buf)->sync = NULL; cmd(buf)->state = NULL; + hdr = net_buf_add(buf, sizeof(*hdr)); + hdr->opcode = sys_cpu_to_le16(opcode); + hdr->param_len = param_len; + return buf; } int bt_hci_cmd_send(uint16_t opcode, struct net_buf *buf) { - struct bt_hci_cmd_hdr *hdr; - if (!buf) { - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(opcode, 0); if (!buf) { return -ENOBUFS; } } - LOG_DBG("opcode 0x%04x param_len %u", opcode, buf->len); - - cmd(buf)->opcode = opcode; - - /* TODO: Remove this condition when bt_hci_cmd_create() has been removed (after its - * deprecation period) - */ - if (net_buf_headroom(buf) >= sizeof(uint8_t) + sizeof(*hdr)) { - hdr = net_buf_push(buf, sizeof(*hdr)); - hdr->opcode = sys_cpu_to_le16(opcode); - hdr->param_len = buf->len - sizeof(*hdr); - - net_buf_push_u8(buf, BT_HCI_H4_CMD); - } + LOG_DBG("opcode 0x%04x len %u", opcode, buf->len); /* Host Number of Completed Packets can ignore the ncmd value * and does not generate any cmd complete/status events. @@ -445,7 +414,7 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, int err; if (!buf) { - buf = bt_hci_cmd_alloc(K_FOREVER); + buf = bt_hci_cmd_create(opcode, 0); if (!buf) { return -ENOBUFS; } @@ -466,11 +435,8 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, k_sem_init(&sync_sem, 0, 1); cmd(buf)->sync = &sync_sem; - err = bt_hci_cmd_send(opcode, net_buf_ref(buf)); - if (err) { - net_buf_unref(buf); - return err; - } + k_fifo_put(&bt_dev.cmd_tx_queue, net_buf_ref(buf)); + bt_tx_irq_raise(); /* TODO: disallow sending sync commands from syswq altogether */ From eea9f40fbc48234e9387bdb9fc6b770e516982be Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:31 +0300 Subject: [PATCH 609/881] Revert "[nrf fromlist] soc: Enable radio core if BT is selected" This reverts commit acf6e051ccfb830a8bfc5fff4a5109e730d171e0. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index ed9fc86f2fc..c0e619cd1e2 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -69,7 +69,7 @@ config SOC_NRF54H20_CPURAD_COMMON config SOC_NRF54H20_CPURAD_ENABLE bool "Boot the nRF54H20 Radio core" - default y if NRF_802154_SER_HOST || BT_HCI_HOST + default y if NRF_802154_SER_HOST depends on SOC_NRF54H20_CPUAPP select NRF_IRONSIDE_CPUCONF_SERVICE help From 07511e3e6032f6f8145dbd328376e452df0db0d5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 610/881] Revert "[nrf fromtree] mgmt: mcumgr: grp: os_mgmt: Add optional boot mode for reset" This reverts commit c8fe297f3863a6b4f865cb45c12ebc3fea3838cf. Signed-off-by: Jukka Rissanen --- .../mcumgr/grp/os_mgmt/os_mgmt_callbacks.h | 5 -- subsys/mgmt/mcumgr/grp/os_mgmt/Kconfig | 8 --- subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c | 54 +------------------ 3 files changed, 2 insertions(+), 65 deletions(-) diff --git a/include/zephyr/mgmt/mcumgr/grp/os_mgmt/os_mgmt_callbacks.h b/include/zephyr/mgmt/mcumgr/grp/os_mgmt/os_mgmt_callbacks.h index 458b70626c3..c9f7259fa40 100644 --- a/include/zephyr/mgmt/mcumgr/grp/os_mgmt/os_mgmt_callbacks.h +++ b/include/zephyr/mgmt/mcumgr/grp/os_mgmt/os_mgmt_callbacks.h @@ -26,11 +26,6 @@ extern "C" { struct os_mgmt_reset_data { /** Contains the value of the force parameter. */ bool force; - -#if defined(CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE) || defined(__DOXYGEN__) - /** Contains the value of the boot_mode parameter. */ - uint8_t boot_mode; -#endif }; /** diff --git a/subsys/mgmt/mcumgr/grp/os_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/os_mgmt/Kconfig index 36b727c7620..afd2e0d3740 100644 --- a/subsys/mgmt/mcumgr/grp/os_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/os_mgmt/Kconfig @@ -43,14 +43,6 @@ config MCUMGR_GRP_OS_RESET_HOOK and will allow the application to perform any required operations before accepting or declining the reset request. -config MCUMGR_GRP_OS_RESET_BOOT_MODE - bool "Boot mode" - depends on RETENTION_BOOT_MODE - help - Allows applications to set the boot mode using the retention boot mode module which - allows for booting other images e.g. as part of a bootloader. This is done with an - optional field in the reset command which specifies the value of the boot mode. - endif config MCUMGR_GRP_OS_TASKSTAT diff --git a/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c b/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c index 360385a1b95..54ee7e70ed2 100644 --- a/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c @@ -55,17 +55,12 @@ #endif #endif -#ifdef CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE -#include -#include -#endif - LOG_MODULE_REGISTER(mcumgr_os_grp, CONFIG_MCUMGR_GRP_OS_LOG_LEVEL); #if defined(CONFIG_REBOOT) && defined(CONFIG_MULTITHREADING) static void os_mgmt_reset_work_handler(struct k_work *work); -static K_WORK_DELAYABLE_DEFINE(os_mgmt_reset_work, os_mgmt_reset_work_handler); +K_WORK_DELAYABLE_DEFINE(os_mgmt_reset_work, os_mgmt_reset_work_handler); #endif /* This is passed to zcbor_map_start/end_endcode as a number of @@ -378,38 +373,18 @@ static int os_mgmt_reset(struct smp_streamer *ctxt) int32_t err_rc; uint16_t err_group; -#ifdef CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE - uint32_t boot_mode = BOOT_MODE_TYPE_NORMAL; -#endif - struct os_mgmt_reset_data reboot_data = { .force = false }; struct zcbor_map_decode_key_val reset_decode[] = { ZCBOR_MAP_DECODE_KEY_DECODER("force", zcbor_bool_decode, &reboot_data.force), -#ifdef CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE - ZCBOR_MAP_DECODE_KEY_DECODER("boot_mode", zcbor_uint32_decode, &boot_mode), -#endif }; /* Since this is a core command, if we fail to decode the data, ignore the error and - * continue with the default parameters. + * continue with the default parameter of force being false. */ (void)zcbor_map_decode_bulk(zsd, reset_decode, ARRAY_SIZE(reset_decode), &decoded); - -#ifdef CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE - if (zcbor_map_decode_bulk_key_found(reset_decode, ARRAY_SIZE(reset_decode), "boot_mode")) { - if (boot_mode > UCHAR_MAX) { - return MGMT_ERR_EINVAL; - } - - reboot_data.boot_mode = (uint8_t)boot_mode; - } else { - reboot_data.boot_mode = BOOT_MODE_TYPE_NORMAL; - } -#endif - status = mgmt_callback_notify(MGMT_EVT_OP_OS_MGMT_RESET, &reboot_data, sizeof(reboot_data), &err_rc, &err_group); @@ -423,31 +398,6 @@ static int os_mgmt_reset(struct smp_streamer *ctxt) ok = smp_add_cmd_err(zse, err_group, (uint16_t)err_rc); return ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE; } -#elif defined(CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE) - zcbor_state_t *zsd = ctxt->reader->zs; - size_t decoded; - uint32_t boot_mode; - - struct zcbor_map_decode_key_val reset_decode[] = { - ZCBOR_MAP_DECODE_KEY_DECODER("boot_mode", zcbor_uint32_decode, &boot_mode), - }; - - /* Since this is a core command, if we fail to decode the data, ignore the error and - * continue with the default parameters. - */ - (void)zcbor_map_decode_bulk(zsd, reset_decode, ARRAY_SIZE(reset_decode), &decoded); - - if (zcbor_map_decode_bulk_key_found(reset_decode, ARRAY_SIZE(reset_decode), "boot_mode")) { - if (boot_mode > UCHAR_MAX) { - return MGMT_ERR_EINVAL; - } - } -#endif - -#if defined(CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE) - if (zcbor_map_decode_bulk_key_found(reset_decode, ARRAY_SIZE(reset_decode), "boot_mode")) { - (void)bootmode_set((uint8_t)boot_mode); - } #endif #ifdef CONFIG_MULTITHREADING From bc095fcae6076895b7cb71d2e029da4abf0da606 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 611/881] Revert "[nrf fromlist] tests: drivers: mspi: api: make test generic" This reverts commit f9ace89cf705f1dadf8ddcdb4a9cfc267e3d8078. Signed-off-by: Jukka Rissanen --- tests/drivers/mspi/api/src/main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/drivers/mspi/api/src/main.c b/tests/drivers/mspi/api/src/main.c index 148439df6d6..883993f9b3e 100644 --- a/tests/drivers/mspi/api/src/main.c +++ b/tests/drivers/mspi/api/src/main.c @@ -23,8 +23,6 @@ typedef enum mspi_timing_param mspi_timing_param; typedef struct mspi_ambiq_timing_cfg mspi_timing_cfg; typedef enum mspi_ambiq_timing_param mspi_timing_param; #define MSPI_PORT ((DT_REG_ADDR(MSPI_BUS_NODE) - MSPI0_BASE) / (MSPI1_BASE - MSPI0_BASE)) -#else -#define MSPI_PORT 0 #endif static const struct device *mspi_devices[] = { From 237f131eadc07189a3c3ea1a98566545060b57c7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 612/881] Revert "[nrf fromlist] bluetooth: mesh: remove persisted psa key if mesh does not own it" This reverts commit 76772c89184fdb0b51b49a540fff5dc236754d9b. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/mesh/crypto_psa.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/mesh/crypto_psa.c b/subsys/bluetooth/mesh/crypto_psa.c index dcefb18565c..8d95ed912ec 100644 --- a/subsys/bluetooth/mesh/crypto_psa.c +++ b/subsys/bluetooth/mesh/crypto_psa.c @@ -452,14 +452,9 @@ int bt_mesh_key_import(enum bt_mesh_key_type type, const uint8_t in[16], struct psa_set_key_bits(&key_attributes, 128); status = psa_import_key(&key_attributes, in, 16, &out->key); - if (status == PSA_ERROR_ALREADY_EXISTS) { - LOG_WRN("Key with ID 0x%4x already exists (desync between mesh and PSA ITS)", - key_id); - (void)psa_destroy_key(key_id); - status = psa_import_key(&key_attributes, in, 16, &out->key); - } + err = status == PSA_SUCCESS ? 0 : + status == PSA_ERROR_ALREADY_EXISTS ? -EALREADY : -EIO; - err = status == PSA_SUCCESS ? 0 : -EIO; if (err && key_id != PSA_KEY_ID_NULL) { keyid_free(key_id); } From 3df73b16ee4c39ffeafb1ae3d568522034f73719 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 613/881] Revert "[nrf fromtree] doc: networking: Modify the wifi documents" This reverts commit 43f25b65d518ff59eaa4e27115db6b395dd93913. Signed-off-by: Jukka Rissanen --- doc/connectivity/networking/api/wifi.rst | 35 +++++++++---------- .../networking/api/wifi_credentials.rst | 3 +- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/doc/connectivity/networking/api/wifi.rst b/doc/connectivity/networking/api/wifi.rst index ebf58bb6722..473bcf8afca 100644 --- a/doc/connectivity/networking/api/wifi.rst +++ b/doc/connectivity/networking/api/wifi.rst @@ -97,25 +97,25 @@ To facilitate installation of the certificates, a helper script is provided, see The script will install the certificates in the ``rsa2k`` directory to the TLS credentials store in the device over UART and using TLS credentials shell commands. -To initiate a Wi-Fi connection using enterprise security, use one of the following commands depending on the EAP method: +To initiate Wi-Fi connection using enterprise security, use one of the following commands depending on the EAP method: -* EAP-TLS +**EAP-TLS** - .. code-block:: console +.. code-block:: console - uart:~$ wifi connect -s -c -k 7 -w 2 -a --key1-pwd --key2-pwd + uart:~$ wifi connect -s -c -k 7 -w 2 -a --key1-pwd --key2-pwd -* EAP-TTLS-MSCHAPV2 +**EAP-TTLS-MSCHAPV2** - .. code-block:: console +.. code-block:: console - uart:~$ wifi connect -s -c -k 14 -K --eap-id1 --eap-pwd1 -a + uart:~$ wifi connect -s -c -k 14 -K --eap-id1 --eap-pwd1 -a -* EAP-PEAP-MSCHAPV2 +**EAP-PEAP-MSCHAPV2** - .. code-block:: console +.. code-block:: console - uart:~$ wifi connect -s -c -k 12 -K --eap-id1 --eap-pwd1 -a + uart:~$ wifi connect -s -c -k 12 -K --eap-id1 --eap-pwd1 -a Server certificate is also provided in the same directory for testing purposes. Any AAA server can be used for testing purposes, for example, ``FreeRADIUS`` or ``hostapd``. @@ -123,17 +123,16 @@ Any AAA server can be used for testing purposes, for example, ``FreeRADIUS`` or Certificate requirements for EAP methods ---------------------------------------- -Different EAP methods have varying client-side certificate requirements, as outlined below: +Different EAP methods require different certificates on the client side: -* EAP-TLS - Requires both a client certificate (and its private key) and a CA certificate on the client. - The client authenticates itself to the server using its certificate. +* **EAP-TLS**: + Requires both a client certificate (and private key) and the CA certificate on the client. The client authenticates itself to the server using its certificate. -* EAP-TTLS-MSCHAPV2 - Requires only the CA certificate on the client. - The client authenticates to the server using a username and password inside the TLS tunnel. - No client certificate is needed. +* **EAP-TTLS-MSCHAPV2**: + Requires only the CA certificate on the client. The client authenticates to the server using a username and password (MSCHAPV2) inside the TLS tunnel. No client certificate is needed. -* EAP-PEAP-MSCHAPV2 - Requires only the CA certificate on the client. - Like TTLS, the client uses a username and password inside the TLS tunnel and does not require a client certificate. +* **EAP-PEAP-MSCHAPV2**: + Requires only the CA certificate on the client. Like TTLS, the client uses a username and password (MSCHAPV2) inside the TLS tunnel and does not need a client certificate. .. note:: diff --git a/doc/connectivity/networking/api/wifi_credentials.rst b/doc/connectivity/networking/api/wifi_credentials.rst index d13a7d6608b..6713f29729b 100644 --- a/doc/connectivity/networking/api/wifi_credentials.rst +++ b/doc/connectivity/networking/api/wifi_credentials.rst @@ -53,8 +53,7 @@ You can remove credentials using the :c:func:`wifi_credentials_delete_by_ssid` f Shell commands ************** -``wifi cred`` is an extension to the Wi-Fi command line. -It adds the following subcommands to interact with the Wi-Fi credentials library: +``wifi cred`` is an extension to the Wi-Fi command line. It adds the following subcommands to interact with the Wi-Fi credentials library: .. list-table:: Wi-Fi credentials shell subcommands :header-rows: 1 From a79d3864a532d5ddc808c26c6a160c79b75937e5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 614/881] Revert "[nrf fromtree] doc: networking: Add doc for EAP methods" This reverts commit 941422278681e8db7cbccf28e25f047392aebbfe. Signed-off-by: Jukka Rissanen --- doc/connectivity/networking/api/wifi.rst | 32 ++---------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/doc/connectivity/networking/api/wifi.rst b/doc/connectivity/networking/api/wifi.rst index 473bcf8afca..ad7825b5ace 100644 --- a/doc/connectivity/networking/api/wifi.rst +++ b/doc/connectivity/networking/api/wifi.rst @@ -97,43 +97,15 @@ To facilitate installation of the certificates, a helper script is provided, see The script will install the certificates in the ``rsa2k`` directory to the TLS credentials store in the device over UART and using TLS credentials shell commands. -To initiate Wi-Fi connection using enterprise security, use one of the following commands depending on the EAP method: - -**EAP-TLS** - -.. code-block:: console - - uart:~$ wifi connect -s -c -k 7 -w 2 -a --key1-pwd --key2-pwd - -**EAP-TTLS-MSCHAPV2** - -.. code-block:: console - - uart:~$ wifi connect -s -c -k 14 -K --eap-id1 --eap-pwd1 -a - -**EAP-PEAP-MSCHAPV2** +To initiate Wi-Fi connection, the following command can be used: .. code-block:: console - uart:~$ wifi connect -s -c -k 12 -K --eap-id1 --eap-pwd1 -a + uart:~$ wifi connect -s -c 149 -k 7 -w 2 -a client1 --key1-pwd whatever --key2-pwd whatever Server certificate is also provided in the same directory for testing purposes. Any AAA server can be used for testing purposes, for example, ``FreeRADIUS`` or ``hostapd``. -Certificate requirements for EAP methods ----------------------------------------- - -Different EAP methods require different certificates on the client side: - -* **EAP-TLS**: - Requires both a client certificate (and private key) and the CA certificate on the client. The client authenticates itself to the server using its certificate. - -* **EAP-TTLS-MSCHAPV2**: - Requires only the CA certificate on the client. The client authenticates to the server using a username and password (MSCHAPV2) inside the TLS tunnel. No client certificate is needed. - -* **EAP-PEAP-MSCHAPV2**: - Requires only the CA certificate on the client. Like TTLS, the client uses a username and password (MSCHAPV2) inside the TLS tunnel and does not need a client certificate. - .. note:: The certificates are for testing purposes only and should not be used in production. From a1d2f249fd16a06ba2624019273bea23cc65cae6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 615/881] Revert "[nrf fromtree] doc: networking: Add wifi credentials library document" This reverts commit 117ae970f79bf156af9175ecc6c98f2a495cbfab. Signed-off-by: Jukka Rissanen --- doc/connectivity/networking/api/net_tech.rst | 1 - .../networking/api/wifi_credentials.rst | 100 ------------------ 2 files changed, 101 deletions(-) delete mode 100644 doc/connectivity/networking/api/wifi_credentials.rst diff --git a/doc/connectivity/networking/api/net_tech.rst b/doc/connectivity/networking/api/net_tech.rst index 616a6992176..910ec4e0cce 100644 --- a/doc/connectivity/networking/api/net_tech.rst +++ b/doc/connectivity/networking/api/net_tech.rst @@ -11,4 +11,3 @@ Networking Technologies thread.rst ppp.rst wifi.rst - wifi_credentials.rst diff --git a/doc/connectivity/networking/api/wifi_credentials.rst b/doc/connectivity/networking/api/wifi_credentials.rst deleted file mode 100644 index 6713f29729b..00000000000 --- a/doc/connectivity/networking/api/wifi_credentials.rst +++ /dev/null @@ -1,100 +0,0 @@ -.. _lib_wifi_credentials: - -Wi-Fi credentials Library -######################### - -.. contents:: - :local: - :depth: 2 - -The Wi-Fi credentials library provides means to load and store Wi-Fi® network credentials. - -Overview -******** - -This library uses either Zephyr's settings subsystem or Platform Security Architecture (PSA) Internal Trusted Storage (ITS) to store credentials. -It also holds a list of SSIDs in RAM to provide dictionary-like access using SSIDs as keys. - -Configuration -************* - -To use the Wi-Fi credentials library, enable the :kconfig:option:`CONFIG_WIFI_CREDENTIALS` Kconfig option. - -You can pick the backend using the following options: - -* :kconfig:option:`CONFIG_WIFI_CREDENTIALS_BACKEND_PSA` - Default option for non-secure targets, which includes a TF-M partition (non-minimal TF-M profile type). -* :kconfig:option:`CONFIG_WIFI_CREDENTIALS_BACKEND_SETTINGS` - Default option for secure targets. - -To configure the maximum number of networks, use the :kconfig:option:`CONFIG_WIFI_CREDENTIALS_MAX_ENTRIES` Kconfig option. - -The IEEE 802.11 standard does not specify the maximum length of SAE passwords. -To change the default, use the :kconfig:option:`CONFIG_WIFI_CREDENTIALS_SAE_PASSWORD_LENGTH` Kconfig option. - -Adding credentials -****************** - -You can add credentials using the :c:func:`wifi_credentials_set_personal` and :c:func:`wifi_credentials_set_personal_struct` functions. -The former will build the internally used struct from given fields, while the latter takes the struct directly. -If you add credentials with the same SSID twice, the older entry will be overwritten. - -Querying credentials -******************** - -With an SSID, you can query credentials using the :c:func:`wifi_credentials_get_by_ssid_personal` and :c:func:`wifi_credentials_get_by_ssid_personal_struct` functions. - -You can iterate over all stored credentials with the :c:func:`wifi_credentials_for_each_ssid` function. -Deleting or overwriting credentials while iterating is allowed, since these operations do not change internal indices. - -Removing credentials -******************** - -You can remove credentials using the :c:func:`wifi_credentials_delete_by_ssid` function. - -Shell commands -************** - -``wifi cred`` is an extension to the Wi-Fi command line. It adds the following subcommands to interact with the Wi-Fi credentials library: - -.. list-table:: Wi-Fi credentials shell subcommands - :header-rows: 1 - - * - Subcommands - - Description - * - add - - | Add a network to the credentials storage with following parameters: - | <-s --ssid \"\">: SSID. - | [-c --channel]: Channel that needs to be scanned for connection. 0:any channel - | [-b, --band] 0: any band (2:2.4GHz, 5:5GHz, 6:6GHz) - | [-p, --passphrase]: Passphrase (valid only for secure SSIDs) - | [-k, --key-mgmt]: Key management type. - | 0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE-HNP, 4:SAE-H2E, 5:SAE-AUTO, 6:WAPI," - | " 7:EAP-TLS, 8:WEP, 9: WPA-PSK, 10: WPA-Auto-Personal, 11: DPP - | [-w, --ieee-80211w]: MFP (optional: needs security type to be specified) - | : 0:Disable, 1:Optional, 2:Required. - | [-m, --bssid]: MAC address of the AP (BSSID). - | [-t, --timeout]: Duration after which connection attempt needs to fail. - | [-a, --identity]: Identity for enterprise mode. - | [-K, --key-passwd]: Private key passwd for enterprise mode. - | [-h, --help]: Print out the help for the connect command. - * - delete - - Removes network from credentials storage. - * - list - - Lists networks in credential storage. - * - auto_connect - - Automatically connects to any stored network. - -Limitations -*********** - -The library has the following limitations: - -* Although permitted by the IEEE 802.11 standard, this library does not support zero-length SSIDs. -* Wi-Fi Protected Access (WPA) Enterprise credentials are only partially supported. -* The number of networks stored is fixed compile time. - -API documentation -***************** - -The following section provides an overview and reference for the Wi-Fi credentials API available in Zephyr: - -.. doxygengroup:: wifi_credentials From 7b4cd8d2971ae6c8cafdd078f301b68441b93978 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 616/881] Revert "[nrf fromlist] snippets: nordic-flpr: Fix nRF54LM20A memory layout" This reverts commit 05d5faf2d55560f396567c321f89b46acb026b6f. Signed-off-by: Jukka Rissanen --- .../nordic-flpr/soc/nrf54lm20a_cpuapp.overlay | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/snippets/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay b/snippets/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay index 071241cf03d..1d36ba5ac48 100644 --- a/snippets/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay +++ b/snippets/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay @@ -9,27 +9,22 @@ #address-cells = <1>; #size-cells = <1>; - cpuflpr_code_partition: image@1e5000 { + cpuflpr_code_partition: image@1ed000 { /* FLPR core code partition */ - reg = <0x1e5000 DT_SIZE_K(96)>; + reg = <0x1ed000 DT_SIZE_K(64)>; }; }; - cpuflpr_sram_code_data: memory@20067c00 { + cpuflpr_sram_code_data: memory@2006fc00 { compatible = "mmio-sram"; - reg = <0x20067c00 DT_SIZE_K(96)>; + reg = <0x2006fc00 DT_SIZE_K(64)>; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; + ranges = <0x0 0x2006fc00 0x10000>; }; }; }; -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(415)>; - ranges = <0x0 0x20000000 DT_SIZE_K(415)>; -}; - &uart30 { status = "reserved"; }; From 38a43028dce29c725f01fc4f8be8227232a81b10 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 617/881] Revert "[nrf fromtree] soc nrf54lm20a: Fix entropy source" This reverts commit 4de017d6d816812dcefb8f540e4cee5c41d739e4. Signed-off-by: Jukka Rissanen --- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index dc13fb40d6a..fa5ee3252bf 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &prng; }; soc { @@ -31,9 +31,9 @@ nvic: &cpuapp_nvic {}; status = "disabled"; }; - rng: rng { + prng: prng { + compatible = "nordic,entropy-prng"; status = "okay"; - compatible = "nordic,nrf-cracen-ctrdrbg"; }; }; From 53e431119be457b99a384abff0b2c9c3452bf2fe Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 618/881] Revert "[nrf fromtree] tests: samples: Extend support for nRF54LM20A" This reverts commit bc3b447553c016664e41b65972daa4a28344acdf. Signed-off-by: Jukka Rissanen --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 ------ samples/boards/nordic/system_off/sample.yaml | 4 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 21 ----- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 --- samples/drivers/mbox/CMakeLists.txt | 1 - samples/drivers/mbox/Kconfig.sysbuild | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 20 ----- samples/drivers/mbox/remote/CMakeLists.txt | 1 - .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 24 ------ samples/drivers/mbox/sample.yaml | 4 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 8 -- .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 8 -- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 --- .../nrf/hwinfo/reset_cause/testcase.yaml | 1 - .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 67 --------------- tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 2 - .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 60 -------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 6 -- .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 6 -- tests/boards/nrf/qdec/testcase.yaml | 2 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 44 ---------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 15 ---- .../drivers/adc/adc_error_cases/testcase.yaml | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 31 ------- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - .../clock_control_api/testcase.yaml | 2 - .../nrf_clock_calibration/testcase.yaml | 1 - .../nrf_lf_clock_start/testcase.yaml | 8 -- .../drivers/clock_control/onoff/testcase.yaml | 1 - .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 36 --------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 3 - .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 3 - .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 4 - tests/drivers/flash/common/testcase.yaml | 1 - .../flash/negative_tests/testcase.yaml | 1 - .../nrf54lm20dk_nrf54lm20_common.overlay | 21 ----- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 7 -- .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 7 -- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 68 ---------------- .../drivers/i2c/i2c_target_api/testcase.yaml | 1 - .../nrf54lm20pdk_nrf54lm20a_cpuapp.overlay | 30 ------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 30 ------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 30 ------- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 ------ tests/drivers/retained_mem/api/testcase.yaml | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 81 ------------------- .../spi_controller_peripheral/testcase.yaml | 3 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 81 ------------------- .../drivers/spi/spi_error_cases/testcase.yaml | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 51 ------------ tests/drivers/spi/spi_loopback/testcase.yaml | 4 - .../timer/nrf_grtc_timer/testcase.yaml | 3 - .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 28 ------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 1 - .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 1 - .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 29 ------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 1 - .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 1 - .../nrf54lm20dk_nrf54lm20a_dual_uart.overlay | 49 ----------- .../uart/uart_elementary/testcase.yaml | 6 -- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 54 ------------- tests/drivers/uart/uart_errors/testcase.yaml | 2 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 43 ---------- .../uart/uart_mix_fifo_poll/testcase.yaml | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 36 --------- tests/drivers/uart/uart_pm/testcase.yaml | 5 -- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 --- .../nrf54lm20dk_nrf54lm20a_cpuflpr.overlay | 9 --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 --- .../watchdog/wdt_error_cases/testcase.yaml | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 --- .../watchdog/wdt_variables/testcase.yaml | 1 - .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - tests/subsys/fs/fcb/testcase.yaml | 1 - 78 files changed, 1184 deletions(-) delete mode 100644 samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 samples/drivers/mbox/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 samples/drivers/mbox/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay delete mode 100644 samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay delete mode 100644 tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay delete mode 100644 tests/drivers/adc/adc_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay delete mode 100644 tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20_common.overlay delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay delete mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/retained_mem/api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/drivers/retained_mem/api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/sensor/temp_sensor/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay delete mode 100644 tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_pm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay delete mode 100644 tests/drivers/watchdog/wdt_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/watchdog/wdt_variables/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/kernel/timer/timer_behavior/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf diff --git a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 3a79636a483..00000000000 --- a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/ { - cpuapp_sram@2007ec00 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2007ec00 DT_SIZE_K(4)>; - zephyr,memory-region = "RetainedMem"; - status = "okay"; - - retainedmem0: retainedmem { - compatible = "zephyr,retained-ram"; - status = "okay"; - }; - }; - - aliases { - retainedmemdevice = &retainedmem0; - }; -}; - -&cpuapp_sram { - /* Shrink SRAM size to avoid overlap with retained memory region: - * 511 - 4 = 507KB = 0x7ec00 - */ - reg = <0x20000000 DT_SIZE_K(507)>; - ranges = <0x0 0x20000000 0x7ec00>; -}; diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index 9b0e39a6cea..6e17223e12b 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -15,7 +15,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp harness: console harness_config: type: multi_line @@ -35,7 +34,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y harness: console @@ -55,7 +53,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp extra_configs: - CONFIG_GRTC_WAKEUP_ENABLE=y - CONFIG_GPIO_WAKEUP_ENABLE=n @@ -80,7 +77,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y - CONFIG_GRTC_WAKEUP_ENABLE=y diff --git a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index c850cede53d..00000000000 --- a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - pdm20_default_alt: pdm20_default_alt { - group1 { - psels = , - ; - }; - }; -}; - -dmic_dev: &pdm20 { - status = "okay"; - pinctrl-0 = <&pdm20_default_alt>; - pinctrl-names = "default"; - clock-source = "PCLK32M"; -}; diff --git a/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 0847233437b..00000000000 --- a/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/ { - chosen { - counter = &timer24; - }; -}; - -&timer24 { - status = "okay"; -}; diff --git a/samples/drivers/mbox/CMakeLists.txt b/samples/drivers/mbox/CMakeLists.txt index 696b2317aa7..3b154d9afca 100644 --- a/samples/drivers/mbox/CMakeLists.txt +++ b/samples/drivers/mbox/CMakeLists.txt @@ -28,7 +28,6 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUAPP OR CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUAPP OR CONFIG_BOARD_NRF54L20PDK_NRF54L20_CPUAPP OR - CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP OR CONFIG_BOARD_STM32H747I_DISCO_STM32H747XX_M7 OR CONFIG_BOARD_BL54L15_DVK_NRF54L15_CPUAPP OR CONFIG_BOARD_BL54L15U_DVK_NRF54L15_CPUAPP) diff --git a/samples/drivers/mbox/Kconfig.sysbuild b/samples/drivers/mbox/Kconfig.sysbuild index 97402056c14..1c0d77b7ded 100644 --- a/samples/drivers/mbox/Kconfig.sysbuild +++ b/samples/drivers/mbox/Kconfig.sysbuild @@ -22,7 +22,6 @@ config REMOTE_BOARD default "nrf54l09pdk/nrf54l09/cpuflpr" if $(BOARD) = "nrf54l09pdk" default "nrf54l15dk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15dk" default "nrf54l20pdk/nrf54l20/cpuflpr" if $(BOARD) = "nrf54l20pdk" - default "nrf54lm20dk/nrf54lm20a/cpuflpr" if $(BOARD) = "nrf54lm20dk" default "ophelia4ev/cpuflpr" if $(BOARD) = "ophelia4ev" default "stm32h747i_disco/stm32h747xx/m4" if $(BOARD) = "stm32h747i_disco" default "esp32_devkitc/esp32/appcpu" if "$(BOARD)${BOARD_QUALIFIERS}" = "esp32_devkitc/esp32/procpu" diff --git a/samples/drivers/mbox/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/mbox/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index fd2f23402f5..00000000000 --- a/samples/drivers/mbox/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>; - mbox-names = "rx", "tx"; - }; -}; - -&cpuapp_vevif_rx { - status = "okay"; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; diff --git a/samples/drivers/mbox/remote/CMakeLists.txt b/samples/drivers/mbox/remote/CMakeLists.txt index 48df8f0cb5b..baa0e22ff35 100644 --- a/samples/drivers/mbox/remote/CMakeLists.txt +++ b/samples/drivers/mbox/remote/CMakeLists.txt @@ -27,7 +27,6 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET OR CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUFLPR OR CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUFLPR OR CONFIG_BOARD_NRF54L20PDK_NRF54L20_CPUFLPR OR - CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR OR CONFIG_BOARD_STM32H747I_DISCO_STM32H747XX_M4 OR CONFIG_BOARD_BL54L15_DVK_NRF54L15_CPUFLPR OR CONFIG_BOARD_BL54L15U_DVK_NRF54L15_CPUFLPR) diff --git a/samples/drivers/mbox/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/samples/drivers/mbox/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay deleted file mode 100644 index ea88120ad06..00000000000 --- a/samples/drivers/mbox/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>; - mbox-names = "rx", "tx"; - }; -}; - -&cpuflpr_vevif_rx { - status = "okay"; -}; - -&cpuflpr_vevif_tx { - status = "okay"; -}; - -&uart30 { - /delete-property/ hw-flow-control; -}; diff --git a/samples/drivers/mbox/sample.yaml b/samples/drivers/mbox/sample.yaml index 1aee77b1c67..f1a1e56e771 100644 --- a/samples/drivers/mbox/sample.yaml +++ b/samples/drivers/mbox/sample.yaml @@ -13,7 +13,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf5340bsim/nrf5340/cpuapp harness: console @@ -79,7 +78,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: mbox_SNIPPET=nordic-flpr @@ -97,7 +95,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: @@ -118,7 +115,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: diff --git a/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index cfb41e09b99..00000000000 --- a/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay deleted file mode 100644 index cfb41e09b99..00000000000 --- a/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index dc1ea1a9ddc..00000000000 --- a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml index 9fd5911c284..8837f999bdb 100644 --- a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml +++ b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml @@ -39,6 +39,5 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index b01af3b36a7..00000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 029c9830186..00000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Two loopbacks are required: - * P1.13 - P1.14 - * P1.23 - P1.24 - */ - - -/ { - aliases { - i2c-slave = &i2c22; - }; -}; - -&pinctrl { - i2c21_default_alt: i2c21_default_alt { - group1 { - psels = , - ; - }; - }; - - i2c21_sleep_alt: i2c21_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default_alt: i2c22_default_alt { - group1 { -/* Temporary workaround as it is currently not possible - * to configure pins for TWIS with pinctrl. - */ - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep_alt: i2c22_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut_twim: &i2c21 { - compatible = "nordic,nrf-twim"; - status = "okay"; - pinctrl-0 = <&i2c21_default_alt>; - pinctrl-1 = <&i2c21_sleep_alt>; - pinctrl-names = "default", "sleep"; - sensor: sensor@54 { - reg = <0x54>; - }; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - status = "okay"; - pinctrl-0 = <&i2c22_default_alt>; - pinctrl-1 = <&i2c22_sleep_alt>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index e125548a49a..c264c2f30c8 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -14,7 +14,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr integration_platforms: @@ -29,7 +28,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr integration_platforms: diff --git a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index 84e7b1dbc30..00000000000 --- a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Two loopbacks are required: - * P1.13 - P1.14 - * P1.23 - P1.24 - */ - -/ { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - - encoder-emulate { - compatible = "gpio-leds"; - phase_a: phase_a { - gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - }; - phase_b: phase_b { - gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&pinctrl { - qdec_pinctrl: qdec_pinctrl { - group1 { - psels = , - ; - }; - }; - - qdec_sleep_pinctrl: qdec_sleep_pinctrl { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&qdec20 { - status = "okay"; - pinctrl-0 = <&qdec_pinctrl>; - pinctrl-1 = <&qdec_sleep_pinctrl>; - pinctrl-names = "default", "sleep"; - steps = <127>; - led-pre = <500>; - zephyr,pm-device-runtime-auto; -}; diff --git a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 646d6b63311..00000000000 --- a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay deleted file mode 100644 index 646d6b63311..00000000000 --- a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/boards/nrf/qdec/testcase.yaml b/tests/boards/nrf/qdec/testcase.yaml index 312761b4459..1518a86660f 100644 --- a/tests/boards/nrf/qdec/testcase.yaml +++ b/tests/boards/nrf/qdec/testcase.yaml @@ -6,9 +6,7 @@ common: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54l20pdk/nrf54l20/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp diff --git a/tests/drivers/adc/adc_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index f11e7ea0317..00000000000 --- a/tests/drivers/adc/adc_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -/ { - zephyr,user { - io-channels = <&adc 0>, <&adc 1> , <&adc 2>; - }; -}; - -&adc { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - channel@0 { - reg = <0>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.31 */ - zephyr,resolution = <10>; - }; - - channel@1 { - reg = <1>; - zephyr,gain = "ADC_GAIN_1_4"; - zephyr,reference = "ADC_REF_EXTERNAL0"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.30 */ - zephyr,resolution = <12>; - }; - - channel@2 { - reg = <2>; - zephyr,gain = "ADC_GAIN_2_3"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.06 */ - zephyr,resolution = <10>; - }; -}; diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/adc/adc_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index c50279ce8f6..00000000000 --- a/tests/drivers/adc/adc_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -/ { - aliases { - adc = &adc; - }; -}; - -&adc { - status = "okay"; -}; diff --git a/tests/drivers/adc/adc_error_cases/testcase.yaml b/tests/drivers/adc/adc_error_cases/testcase.yaml index f902aa21af0..e5c0225b28c 100644 --- a/tests/drivers/adc/adc_error_cases/testcase.yaml +++ b/tests/drivers/adc/adc_error_cases/testcase.yaml @@ -10,6 +10,5 @@ tests: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp diff --git a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index ebe43a7c825..00000000000 --- a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires loopback between P1.23 and P1.24. - * For best performance, PDM_CLK shall be on 'Clock pin'. - */ - -/ { - aliases { - dmic-dev = &pdm20; - }; -}; - -&pinctrl { - pdm20_default_alt: pdm20_default_alt { - group1 { - psels = , - ; - }; - }; -}; - -dmic_dev: &pdm20 { - status = "okay"; - pinctrl-0 = <&pdm20_default_alt>; - pinctrl-names = "default"; - clock-source = "PCLK32M"; -}; diff --git a/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 11d42321cbc..00000000000 --- a/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_TEST_NRF_HF_STARTUP_TIME_US=1000 diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index 98f8920e162..d624b61fe7c 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -24,7 +24,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -36,7 +35,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index 3cdc785cbc7..756a92a98e3 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -10,7 +10,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index 94cc046d696..eeb034a8ec0 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -16,7 +16,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SYSTEM_CLOCK_WAIT_FOR_STABILITY=y @@ -35,7 +34,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SYSTEM_CLOCK_WAIT_FOR_AVAILABILITY=y @@ -69,7 +67,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -87,7 +84,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -105,7 +101,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -123,7 +118,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -141,7 +135,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -159,7 +152,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index 51c263dad29..f24dce72a7a 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -10,7 +10,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index 72941675287..00000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,36 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&timer00 { - prescaler = <6>; - status = "okay"; -}; - -&timer10 { - prescaler = <4>; - status = "okay"; -}; - -&timer20 { - prescaler = <4>; - status = "okay"; -}; - -&timer21 { - prescaler = <4>; - status = "okay"; -}; - -&timer22 { - prescaler = <4>; - status = "okay"; -}; - -&timer23 { - prescaler = <4>; - status = "okay"; -}; - -&timer24 { - prescaler = <4>; - status = "okay"; -}; diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 03676317e38..00000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay deleted file mode 100644 index 03676317e38..00000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 821a5e77e5b..00000000000 --- a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_FCB=y -CONFIG_FLASH_MAP=y -CONFIG_SETTINGS=y -CONFIG_SETTINGS_FCB=y diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index a46ecb50e11..c1adeeeaaba 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -47,7 +47,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.flash.common.tfm_ns: diff --git a/tests/drivers/flash/negative_tests/testcase.yaml b/tests/drivers/flash/negative_tests/testcase.yaml index 3321a0273ba..5d2441f002e 100644 --- a/tests/drivers/flash/negative_tests/testcase.yaml +++ b/tests/drivers/flash/negative_tests/testcase.yaml @@ -8,6 +8,5 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20_common.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20_common.overlay deleted file mode 100644 index bb1ce76c876..00000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20_common.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - resources { - compatible = "test-gpio-basic-api"; - out-gpios = <&gpio1 30 0>; - in-gpios = <&gpio1 31 0>; - }; -}; - -&gpiote20 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 093894d675a..00000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.overlay" diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay deleted file mode 100644 index 093894d675a..00000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.overlay" diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 2510d6673c1..00000000000 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 3459599351b..00000000000 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SDA = P1.13 and P1.14 - * SCL = P1.23 and P1.24 - */ - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; - - eeprom1: eeprom@56 { - compatible = "zephyr,i2c-target-eeprom"; - reg = <0x56>; - address-width = <8>; - size = <256>; - }; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; - - eeprom0: eeprom@54 { - compatible = "zephyr,i2c-target-eeprom"; - reg = <0x54>; - address-width = <8>; - size = <256>; - }; -}; diff --git a/tests/drivers/i2c/i2c_target_api/testcase.yaml b/tests/drivers/i2c/i2c_target_api/testcase.yaml index 7f888f95e12..e36ab87d4ef 100644 --- a/tests/drivers/i2c/i2c_target_api/testcase.yaml +++ b/tests/drivers/i2c/i2c_target_api/testcase.yaml @@ -65,7 +65,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - max32690evkit/max32690/m4 diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index e93f6df8fd8..00000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index ef680d4b410..00000000000 --- a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index ef680d4b410..00000000000 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/retained_mem/api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/retained_mem/api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index c15ba3ed96d..00000000000 --- a/tests/drivers/retained_mem/api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_POWEROFF=y diff --git a/tests/drivers/retained_mem/api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/retained_mem/api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index dc81069eca5..00000000000 --- a/tests/drivers/retained_mem/api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/ { - cpuapp_sram@2007ec00 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2007ec00 DT_SIZE_K(4)>; - zephyr,memory-region = "RetainedMem"; - status = "okay"; - - retainedmem0: retainedmem { - compatible = "zephyr,retained-ram"; - status = "okay"; - }; - }; - - aliases { - retainedmemtestdevice = &retainedmem0; - }; -}; - -&cpuapp_sram { - /* Shrink SRAM size to avoid overlap with retained memory region: - * 511 - 4 = 507KB = 0x7ec00 - */ - reg = <0x20000000 DT_SIZE_K(507)>; - ranges = <0x0 0x20000000 0x7ec00>; -}; diff --git a/tests/drivers/retained_mem/api/testcase.yaml b/tests/drivers/retained_mem/api/testcase.yaml index ddcc005a16a..7852742241b 100644 --- a/tests/drivers/retained_mem/api/testcase.yaml +++ b/tests/drivers/retained_mem/api/testcase.yaml @@ -15,7 +15,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - qemu_cortex_m3 diff --git a/tests/drivers/sensor/temp_sensor/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/sensor/temp_sensor/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index b1f2a2b9ec5..00000000000 --- a/tests/drivers/sensor/temp_sensor/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -temp_sensor: &temp { - status = "okay"; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 541fdbb96de..00000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopbacks: - * SCK: P1.23 - P1.24 - * MISO: P1.30 - P1.31 - * MOSI: P1.13 - P1.14 - * CS: P1.03 - P1.04 - */ - -&pinctrl { - spi22_default_alt: spi22_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi22_sleep_alt: spi22_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi21_default_alt: spi21_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi21_sleep_alt: spi21_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - - -&gpio1 { - status = "okay"; -}; - -&spi22 { - status = "okay"; - pinctrl-0 = <&spi22_default_alt>; - pinctrl-1 = <&spi22_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -dut_spis: &spi21 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi21_default_alt>; - pinctrl-1 = <&spi21_sleep_alt>; - pinctrl-names = "default", "sleep"; - /delete-property/rx-delay-supported; - /delete-property/rx-delay; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 56f3545235e..c06c1c077fe 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -10,7 +10,6 @@ common: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr @@ -67,7 +66,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.spis_fast: @@ -81,7 +79,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.pm_runtime: diff --git a/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 541fdbb96de..00000000000 --- a/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopbacks: - * SCK: P1.23 - P1.24 - * MISO: P1.30 - P1.31 - * MOSI: P1.13 - P1.14 - * CS: P1.03 - P1.04 - */ - -&pinctrl { - spi22_default_alt: spi22_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi22_sleep_alt: spi22_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi21_default_alt: spi21_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi21_sleep_alt: spi21_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - - -&gpio1 { - status = "okay"; -}; - -&spi22 { - status = "okay"; - pinctrl-0 = <&spi22_default_alt>; - pinctrl-1 = <&spi22_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -dut_spis: &spi21 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi21_default_alt>; - pinctrl-1 = <&spi21_sleep_alt>; - pinctrl-names = "default", "sleep"; - /delete-property/rx-delay-supported; - /delete-property/rx-delay; -}; diff --git a/tests/drivers/spi/spi_error_cases/testcase.yaml b/tests/drivers/spi/spi_error_cases/testcase.yaml index 8e5ae335edd..2f097fb072c 100644 --- a/tests/drivers/spi/spi_error_cases/testcase.yaml +++ b/tests/drivers/spi/spi_error_cases/testcase.yaml @@ -13,7 +13,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index d6e037cdbdf..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopback: - * P1.13 - P1.14 - */ - -&pinctrl { - spi21_default: spi21_default { - group1 { - psels = , - , - ; - }; - }; - - spi21_sleep: spi21_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - -&spi21 { - status = "okay"; - pinctrl-0 = <&spi21_default>; - pinctrl-1 = <&spi21_sleep>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - zephyr,pm-device-runtime-auto; - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = ; - }; - dut_fast: fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index ab3322a8d1f..6eb098c3dcf 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -273,7 +273,6 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp harness: console harness_config: fixture: spi_loopback @@ -285,21 +284,18 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_16mhz: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_16mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_32mhz: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_32mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.ke1xz_flexio_spi.loopback: extra_args: DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_spi.overlay" diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index cd4f99daede..ece1358741a 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -11,11 +11,8 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54l20pdk/nrf54l20/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr integration_platforms: - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index ec39ed93ecf..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,28 +0,0 @@ -/* Test requires following loopback: - * P1.13 - P1.14 - */ - -&pinctrl { - uart21_default_alt: uart21_default_alt { - group1 { - psels = , - ; - }; - }; - - uart21_sleep_alt: uart21_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - pinctrl-0 = <&uart21_default_alt>; - pinctrl-1 = <&uart21_sleep_alt>; - pinctrl-names = "default", "sleep"; - current-speed = <115200>; -}; diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 5210e41ef55..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1 +0,0 @@ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay deleted file mode 100644 index 5210e41ef55..00000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ /dev/null @@ -1 +0,0 @@ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index dd9f0b93be0..00000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,29 +0,0 @@ -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 5210e41ef55..00000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1 +0,0 @@ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay deleted file mode 100644 index 5210e41ef55..00000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ /dev/null @@ -1 +0,0 @@ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay deleted file mode 100644 index 0dcede29d92..00000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay +++ /dev/null @@ -1,49 +0,0 @@ -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - uart22_default: uart22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - uart22_sleep: uart22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; -}; - -dut_aux: &uart22 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart22_default>; - pinctrl-1 = <&uart22_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index 83aba78e828..9c6fea77b62 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -16,9 +16,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54l20pdk/nrf54l20/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr @@ -59,7 +57,6 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_dual_uart.overlay" extra_configs: @@ -69,7 +66,6 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_dual_uart.overlay" extra_configs: @@ -80,7 +76,6 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuflpr - nrf54l20pdk/nrf54l20/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr - ophelia4ev/nrf54l15/cpuflpr extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_dual_uart.overlay" extra_configs: @@ -90,7 +85,6 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuflpr - nrf54l20pdk/nrf54l20/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr - ophelia4ev/nrf54l15/cpuflpr extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_dual_uart.overlay" extra_configs: diff --git a/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 4cc6508c1d1..00000000000 --- a/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,54 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - uart22_default: uart22_default { - group1 { - psels = - ; - bias-pull-up; - }; - group2 { - psels = ; - }; - }; - - uart22_sleep: uart22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; -}; - -dut_aux: &uart22 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart22_default>; - pinctrl-1 = <&uart22_sleep>; - pinctrl-names = "default", "sleep"; - disable-rx; -}; diff --git a/tests/drivers/uart/uart_errors/testcase.yaml b/tests/drivers/uart/uart_errors/testcase.yaml index 522935adcca..d303c73b600 100644 --- a/tests/drivers/uart/uart_errors/testcase.yaml +++ b/tests/drivers/uart/uart_errors/testcase.yaml @@ -13,7 +13,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.uart.uart_errors.async: @@ -22,7 +21,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: diff --git a/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index d335a12e856..00000000000 --- a/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; - -counter_dev: &timer00 { - status = "okay"; -}; - -&grtc { - interrupts = <228 2>; -}; diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index a901abda9e4..0ff023748d2 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -12,7 +12,6 @@ common: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54l15bsim/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad diff --git a/tests/drivers/uart/uart_pm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_pm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 758cb69bd3c..00000000000 --- a/tests/drivers/uart/uart_pm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -/ { - chosen { - zephyr,console = &uart20; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 9bb36067757..329b5546b8b 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -8,7 +8,6 @@ common: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54l15bsim/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf52_bsim @@ -36,7 +35,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54l15bsim/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf52_bsim @@ -52,7 +50,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -73,7 +70,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -94,6 +90,5 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - ophelia4ev/nrf54l15/cpuapp diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index dc1ea1a9ddc..00000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay deleted file mode 100644 index dc1ea1a9ddc..00000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/watchdog/wdt_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index dc1ea1a9ddc..00000000000 --- a/tests/drivers/watchdog/wdt_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_error_cases/testcase.yaml b/tests/drivers/watchdog/wdt_error_cases/testcase.yaml index 951afe9034e..c31e4e7b76d 100644 --- a/tests/drivers/watchdog/wdt_error_cases/testcase.yaml +++ b/tests/drivers/watchdog/wdt_error_cases/testcase.yaml @@ -12,7 +12,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf9280pdk/nrf9280/cpuapp diff --git a/tests/drivers/watchdog/wdt_variables/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/watchdog/wdt_variables/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index dc1ea1a9ddc..00000000000 --- a/tests/drivers/watchdog/wdt_variables/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_variables/testcase.yaml b/tests/drivers/watchdog/wdt_variables/testcase.yaml index d033e4f255e..3ed2ad90b11 100644 --- a/tests/drivers/watchdog/wdt_variables/testcase.yaml +++ b/tests/drivers/watchdog/wdt_variables/testcase.yaml @@ -17,7 +17,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp diff --git a/tests/kernel/timer/timer_behavior/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/kernel/timer/timer_behavior/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 4b13bc80c7f..00000000000 --- a/tests/kernel/timer/timer_behavior/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SYS_CLOCK_TICKS_PER_SEC=10000 diff --git a/tests/subsys/fs/fcb/testcase.yaml b/tests/subsys/fs/fcb/testcase.yaml index bd5067eccce..c8351b8dcf2 100644 --- a/tests/subsys/fs/fcb/testcase.yaml +++ b/tests/subsys/fs/fcb/testcase.yaml @@ -15,7 +15,6 @@ tests: - nrf54l09pdk/nrf54l09/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l20pdk/nrf54l20/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp - native_sim integration_platforms: From 1dbef1cf982e816a4eb2bd58a5e8f8534887d28f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 619/881] Revert "[nrf fromtree] board: nrf: Add nRF54LM20DK board" This reverts commit de8218a621c401af2849ab4ab32014f7435c43ac. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54lm20dk/Kconfig.defconfig | 9 - boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk | 6 - boards/nordic/nrf54lm20dk/board.cmake | 11 -- boards/nordic/nrf54lm20dk/board.yml | 43 ----- boards/nordic/nrf54lm20dk/doc/index.rst | 102 ----------- .../nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 170 ------------------ .../nrf54lm20dk_nrf54lm20a-common.dtsi | 109 ----------- .../nrf54lm20dk_nrf54lm20a-pinctrl.dtsi | 97 ---------- .../nrf54lm20dk_nrf54lm20a_cpuapp.dts | 30 ---- .../nrf54lm20dk_nrf54lm20a_cpuapp.yaml | 23 --- .../nrf54lm20dk_nrf54lm20a_cpuapp_defconfig | 29 --- .../nrf54lm20dk_nrf54lm20a_cpuflpr.dts | 68 ------- .../nrf54lm20dk_nrf54lm20a_cpuflpr.yaml | 16 -- .../nrf54lm20dk_nrf54lm20a_cpuflpr_defconfig | 19 -- 14 files changed, 732 deletions(-) delete mode 100644 boards/nordic/nrf54lm20dk/Kconfig.defconfig delete mode 100644 boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk delete mode 100644 boards/nordic/nrf54lm20dk/board.cmake delete mode 100644 boards/nordic/nrf54lm20dk/board.yml delete mode 100644 boards/nordic/nrf54lm20dk/doc/index.rst delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_defconfig delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.yaml delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr_defconfig diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig deleted file mode 100644 index 266f0f7c13d..00000000000 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP diff --git a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk deleted file mode 100644 index 83b3842211f..00000000000 --- a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NRF54LM20DK - select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP - select SOC_NRF54LM20A_ENGA_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake deleted file mode 100644 index e487ecfb476..00000000000 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP) - board_runner_args(jlink "--device=cortex-m33" "--speed=4000") -elseif(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR) - board_runner_args(jlink "--speed=4000") -endif() - -include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nordic/nrf54lm20dk/board.yml b/boards/nordic/nrf54lm20dk/board.yml deleted file mode 100644 index 2930f9d3dfb..00000000000 --- a/boards/nordic/nrf54lm20dk/board.yml +++ /dev/null @@ -1,43 +0,0 @@ -board: - name: nrf54lm20dk - full_name: nRF54LM20 DK - vendor: nordic - socs: - - name: nrf54lm20a - variants: - - name: xip - cpucluster: cpuflpr -runners: - run_once: - '--recover': - - runners: - - nrfjprog - - nrfutil - run: first - groups: - - boards: - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr/xip - '--erase': - - runners: - - nrfjprog - - jlink - - nrfutil - run: first - groups: - - boards: - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr/xip - '--reset': - - runners: - - nrfjprog - - jlink - - nrfutil - run: last - groups: - - boards: - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr/xip diff --git a/boards/nordic/nrf54lm20dk/doc/index.rst b/boards/nordic/nrf54lm20dk/doc/index.rst deleted file mode 100644 index 007074c5cc5..00000000000 --- a/boards/nordic/nrf54lm20dk/doc/index.rst +++ /dev/null @@ -1,102 +0,0 @@ -.. zephyr:board:: nrf54lm20dk - -Overview -******** - -The nRF54LM20 Development Kit hardware provides support for the Nordic Semiconductor -nRF54LM20A Arm Cortex-M33 CPU and the following devices: - -* :abbr:`SAADC (Successive Approximation Analog to Digital Converter)` -* CLOCK -* RRAM -* :abbr:`GPIO (General Purpose Input Output)` -* :abbr:`TWIM (I2C-compatible two-wire interface master with EasyDMA)` -* MEMCONF -* :abbr:`MPU (Memory Protection Unit)` -* :abbr:`NVIC (Nested Vectored Interrupt Controller)` -* :abbr:`PWM (Pulse Width Modulation)` -* :abbr:`GRTC (Global real-time counter)` -* Segger RTT (RTT Console) -* :abbr:`SPI (Serial Peripheral Interface)` -* :abbr:`UARTE (Universal asynchronous receiver-transmitter)` -* :abbr:`WDT (Watchdog Timer)` - -Hardware -******** - -nRF54LM20 DK has two crystal oscillators: - -* High-frequency 32 MHz crystal oscillator (HFXO) -* Low-frequency 32.768 kHz crystal oscillator (LFXO) - -The crystal oscillators can be configured to use either -internal or external capacitors. - -Supported Features -================== - -.. zephyr:board-supported-hw:: - -Programming and Debugging -************************* - -.. zephyr:board-supported-runners:: - -Applications for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target can be -built, flashed, and debugged in the usual way. See -:ref:`build_an_application` and :ref:`application_run` for more details on -building and running. - -Applications for the ``nrf54lm20dk/nrf54lm20a/cpuflpr`` board target need -to be built using sysbuild to include the ``vpr_launcher`` image for the application core. - -Enter the following command to compile ``hello_world`` for the FLPR core: - -.. code-block:: console - - west build -p -b nrf54lm20dk/nrf54lm20a/cpuflpr --sysbuild - - -Flashing -======== - -As an example, this section shows how to build and flash the :zephyr:code-sample:`hello_world` -application. - -.. warning:: - - When programming the device, you might get an error similar to the following message:: - - ERROR: The operation attempted is unavailable due to readback protection in - ERROR: your device. Please use --recover to unlock the device. - - This error occurs when readback protection is enabled. - To disable the readback protection, you must *recover* your device. - - Enter the following command to recover the core:: - - west flash --recover - - The ``--recover`` command erases the flash memory and then writes a small binary into - the recovered flash memory. - This binary prevents the readback protection from enabling itself again after a pin - reset or power cycle. - -Follow the instructions in the :ref:`nordic_segger` page to install -and configure all the necessary software. Further information can be -found in :ref:`nordic_segger_flashing`. - -To build and program the sample to the nRF54LM20 DK, complete the following steps: - -First, connect the nRF54LM20 DK to you computer using the IMCU USB port on the DK. -Next, build the sample by running the following command: - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: nrf54lm20dk/nrf54lm20a/cpuapp - :goals: build flash - -Testing the LEDs and buttons in the nRF54LM20 DK -************************************************ - -Test the nRF54LM20 DK with a :zephyr:code-sample:`blinky` sample. diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi deleted file mode 100644 index 3591a800948..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* This file is common to the secure and non-secure domain */ - -#include -#include "nrf54lm20dk_nrf54lm20a-common.dtsi" - -/ { - chosen { - zephyr,console = &uart20; - zephyr,shell-uart = &uart20; - zephyr,uart-mcumgr = &uart20; - zephyr,bt-mon-uart = &uart20; - zephyr,bt-c2h-uart = &uart20; - zephyr,flash-controller = &rram_controller; - zephyr,flash = &cpuapp_rram; - zephyr,bt-hci = &bt_hci_sdc; - zephyr,ieee802154 = &ieee802154; - }; -}; - -&cpuapp_sram { - status = "okay"; -}; - -&hfpll { - clock-frequency = ; -}; - -&lfxo { - load-capacitors = "internal"; - load-capacitance-femtofarad = <17000>; -}; - -&hfxo { - load-capacitors = "internal"; - load-capacitance-femtofarad = <15000>; -}; - -&vregmain { - status = "okay"; - regulator-initial-mode = ; -}; - -&grtc { - owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>; - /* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */ - child-owned-channels = <3 4 7 8 9 10 11>; - status = "okay"; -}; - -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(449)>; - }; - - slot0_ns_partition: partition@80400 { - label = "image-0-nonsecure"; - reg = <0x80400 DT_SIZE_K(449)>; - }; - - slot1_partition: partition@f0800 { - label = "image-1"; - reg = <0xf0800 DT_SIZE_K(449)>; - }; - - slot1_ns_partition: partition@160c00 { - label = "image-1-nonsecure"; - reg = <0x160c00 DT_SIZE_K(449)>; - }; - - storage_partition: partition@1d1000 { - label = "storage"; - reg = <0x1d1000 DT_SIZE_K(36)>; - }; - }; -}; - -&uart20 { - status = "okay"; -}; - -&nfct { - status = "okay"; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&gpiote20 { - status = "okay"; -}; - -&gpiote30 { - status = "okay"; -}; - -&radio { - status = "okay"; -}; - -&temp { - status = "okay"; -}; - -&clock { - status = "okay"; -}; - -&bt_hci_controller { - status = "okay"; -}; - -&ieee802154 { - status = "okay"; -}; - -zephyr_udc0: &usbhs { - status = "okay"; -}; - -&spi00 { - status = "okay"; - cs-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi00_default>; - pinctrl-1 = <&spi00_sleep>; - pinctrl-names = "default", "sleep"; - - mx25r64: mx25r6435f@0 { - compatible = "jedec,spi-nor"; - status = "disabled"; - reg = <0>; - spi-max-frequency = <8000000>; - jedec-id = [c2 28 17]; - sfdp-bfp = [ - e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb - ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52 - 10 d8 00 ff 23 72 f5 00 82 ed 04 cc 44 83 48 44 - 30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff - ]; - size = <67108864>; - has-dpd; - t-enter-dpd = <10000>; - t-exit-dpd = <35000>; - }; -}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi deleted file mode 100644 index 525a3a5fdc0..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20a-pinctrl.dtsi" - -/ { - leds { - compatible = "gpio-leds"; - - led0: led_0 { - gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - - led1: led_1 { - gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - - led2: led_2 { - gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; - label = "Green LED 2"; - }; - - led3: led_3 { - gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; - label = "Green LED 3"; - }; - }; - - pwmleds { - compatible = "pwm-leds"; - - /* - * PWM signal can be exposed on GPIO pin only within same domain. - * There is only one domain which contains both PWM and GPIO: - * PWM20/21/22 and GPIO Port P1/P3. - * Only LEDs connected to P1/P3 can work with PWM, for example LED1. - */ - pwm_led1: pwm_led_1 { - pwms = <&pwm20 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; - }; - }; - - buttons { - compatible = "gpio-keys"; - - button0: button_0 { - gpios = <&gpio1 26 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 0"; - zephyr,code = ; - }; - - button1: button_1 { - gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 1"; - zephyr,code = ; - }; - - button2: button_2 { - gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 2"; - zephyr,code = ; - }; - - button3: button_3 { - gpios = <&gpio0 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 3"; - zephyr,code = ; - }; - }; - - aliases { - led0 = &led0; - led1 = &led1; - led2 = &led2; - led3 = &led3; - pwm-led0 = &pwm_led1; - sw0 = &button0; - sw1 = &button1; - sw2 = &button2; - sw3 = &button3; - watchdog0 = &wdt31; - }; -}; - -&uart20 { - current-speed = <115200>; - pinctrl-0 = <&uart20_default>; - pinctrl-1 = <&uart20_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&uart30 { - current-speed = <115200>; - pinctrl-0 = <&uart30_default>; - pinctrl-1 = <&uart30_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&pwm20 { - status = "okay"; - pinctrl-0 = <&pwm20_default>; - pinctrl-1 = <&pwm20_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi deleted file mode 100644 index ec1c81e4f8d..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - /omit-if-no-ref/ uart20_default: uart20_default { - group1 { - psels = , - ; - }; - - group2 { - psels = , - ; - bias-pull-up; - }; - }; - - /omit-if-no-ref/ uart20_sleep: uart20_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; - - /omit-if-no-ref/ pwm20_default: pwm20_default { - group1 { - psels = ; - }; - }; - - /omit-if-no-ref/ pwm20_sleep: pwm20_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; - - /omit-if-no-ref/ uart30_default: uart30_default { - group1 { - psels = , - ; - }; - - group2 { - psels = , - ; - bias-pull-up; - }; - }; - - /omit-if-no-ref/ uart30_sleep: uart30_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; - - /omit-if-no-ref/ spi00_default: spi00_default { - group1 { - psels = , - , - ; - }; - }; - - /omit-if-no-ref/ spi00_sleep: spi00_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - /omit-if-no-ref/ grtc_default: grtc_default { - group1 { - psels = , - ; - }; - }; - - /omit-if-no-ref/ grtc_sleep: grtc_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts deleted file mode 100644 index 29d616b5ece..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include "nrf54lm20a_cpuapp_common.dtsi" - -/ { - compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp"; - model = "Nordic nRF54LM20 DK nRF54LM20A Application MCU"; - - chosen { - zephyr,code-partition = &slot0_partition; - zephyr,sram = &cpuapp_sram; - }; -}; - -&bt_hci_sdc { - status = "okay"; -}; - -&bt_hci_controller { - status = "disabled"; -}; - -/* Get a node label for wi-fi spi to use in shield files */ -wifi_spi: &spi22 {}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml deleted file mode 100644 index 765845fa27f..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54lm20dk/nrf54lm20a/cpuapp -name: nRF54LM20-DK-nRF54LM20A-Application -type: mcu -arch: arm -toolchain: - - gnuarmemb - - zephyr -sysbuild: true -ram: 512 -flash: 449 -supported: - - adc - - counter - - dmic - - gpio - - i2c - - i2s - - pwm - - spi - - watchdog diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_defconfig deleted file mode 100644 index 8424e66c571..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_defconfig +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable GPIO -CONFIG_GPIO=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# MPU-based null-pointer dereferencing detection cannot -# be applied as the (0x0 - 0x400) is unmapped for this target. -CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y - -# Enable Cache -CONFIG_CACHE_MANAGEMENT=y -CONFIG_EXTERNAL_CACHE=y - -# Start SYSCOUNTER on driver init -CONFIG_NRF_GRTC_START_SYSCOUNTER=y diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts deleted file mode 100644 index 3097d3f2775..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf54lm20dk_nrf54lm20a-common.dtsi" - -/ { - model = "Nordic nRF54LM20 DK nRF54LM20A FLPR MCU"; - compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuflpr"; - - chosen { - zephyr,console = &uart30; - zephyr,shell-uart = &uart30; - zephyr,code-partition = &cpuflpr_code_partition; - zephyr,flash = &cpuflpr_rram; - zephyr,sram = &cpuflpr_sram; - }; -}; - -&cpuflpr_sram { - status = "okay"; -}; - -&cpuflpr_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - cpuflpr_code_partition: partition@0 { - label = "image-0"; - reg = <0x0 DT_SIZE_K(96)>; - }; - }; -}; - -&grtc { - owned-channels = <3 4>; - status = "okay"; -}; - -&uart30 { - status = "okay"; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&gpiote20 { - status = "okay"; -}; - -&gpiote30 { - status = "okay"; -}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.yaml deleted file mode 100644 index b99d167bcdf..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54lm20dk/nrf54lm20a/cpuflpr -name: nRF54LM20-DK-nRF54LM20A-Fast-Lightweight-Peripheral-Processor -type: mcu -arch: riscv -toolchain: - - zephyr -sysbuild: true -ram: 96 -flash: 96 -supported: - - counter - - gpio - - watchdog diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr_defconfig deleted file mode 100644 index 75f7c4386e3..00000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr_defconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable GPIO -CONFIG_GPIO=y - -CONFIG_USE_DT_CODE_PARTITION=y - -# Execute from SRAM -CONFIG_XIP=n - -CONFIG_RISCV_ALWAYS_SWITCH_THROUGH_ECALL=y From 386a82bdc903d3501cc6ae539dc0e1c8c187c44c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 620/881] Revert "[nrf fromtree] soc: nrf: Add nRF54LM20A device" This reverts commit 01ea3eec543b3fe31fbdb86b30ee4cf9d4f8b91d. Signed-off-by: Jukka Rissanen --- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 125 --- dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi | 67 -- dts/vendor/nordic/nrf54lm20a.dtsi | 879 ------------------ modules/hal_nordic/nrfx/CMakeLists.txt | 7 +- snippets/nordic-flpr/snippet.yml | 3 - .../nordic-flpr/soc/nrf54lm20a_cpuapp.overlay | 39 - soc/nordic/nrf54l/Kconfig | 6 - .../Kconfig.defconfig.nrf54lm20a_enga_cpuapp | 15 - .../Kconfig.defconfig.nrf54lm20a_enga_cpuflpr | 11 - soc/nordic/nrf54l/Kconfig.soc | 25 - soc/nordic/nrf54l/Kconfig.sysbuild | 2 +- soc/nordic/soc.yml | 13 - 12 files changed, 2 insertions(+), 1190 deletions(-) delete mode 100644 dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi delete mode 100644 dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi delete mode 100644 dts/vendor/nordic/nrf54lm20a.dtsi delete mode 100644 snippets/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay delete mode 100644 soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp delete mode 100644 soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi deleted file mode 100644 index fa5ee3252bf..00000000000 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -cpu: &cpuapp {}; -systick: &cpuapp_systick {}; -nvic: &cpuapp_nvic {}; - -/delete-node/ &cpuflpr; -/delete-node/ &cpuflpr_rram; -/delete-node/ &cpuflpr_sram; -/delete-node/ &cpuflpr_clic; - -/ { - chosen { - zephyr,entropy = &prng; - }; - - soc { - compatible = "simple-bus"; - interrupt-parent = <&cpuapp_nvic>; - ranges; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; - }; - - prng: prng { - compatible = "nordic,entropy-prng"; - status = "okay"; - }; -}; - -&cpuflpr_vpr { - cpuapp_vevif_rx: mailbox@1 { - compatible = "nordic,nrf-vevif-event-rx"; - reg = <0x0 0x1000>; - status = "disabled"; - interrupts = <76 NRF_DEFAULT_IRQ_PRIORITY>; - #mbox-cells = <1>; - nordic,events = <1>; - nordic,events-mask = <0x00100000>; - }; - - cpuapp_vevif_tx: mailbox@0 { - compatible = "nordic,nrf-vevif-task-tx"; - reg = <0x0 0x1000>; - #mbox-cells = <1>; - nordic,tasks = <7>; - nordic,tasks-mask = <0x007f0000>; - status = "disabled"; - }; -}; - -&cpuapp_ppb { - compatible = "simple-bus"; - ranges; -}; - -&grtc { - interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>, - <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ -}; - -&gpiote20 { - interrupts = <219 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&gpiote30 { - interrupts = <269 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&dppic00 { - status = "okay"; -}; - -&dppic10 { - status = "okay"; -}; - -&dppic20 { - status = "okay"; -}; - -&dppic30 { - status = "okay"; -}; - -&ppib00 { - status = "okay"; -}; - -&ppib01 { - status = "okay"; -}; - -&ppib10 { - status = "okay"; -}; - -&ppib11 { - status = "okay"; -}; - -&ppib20 { - status = "okay"; -}; - -&ppib21 { - status = "okay"; -}; - -&ppib22 { - status = "okay"; -}; - -&ppib30 { - status = "okay"; -}; diff --git a/dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi b/dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi deleted file mode 100644 index 82f1b17b2b1..00000000000 --- a/dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -cpu: &cpuflpr {}; -clic: &cpuflpr_clic {}; - -/delete-node/ &cpuapp; -/delete-node/ &cpuapp_rram; -/delete-node/ &cpuapp_ppb; -/delete-node/ &cpuapp_sram; - -/ { - soc { - compatible = "simple-bus"; - interrupt-parent = <&cpuflpr_clic>; - ranges; - }; -}; - -&cpuflpr { - cpuflpr_vevif_rx: mailbox { - compatible = "nordic,nrf-vevif-task-rx"; - status = "disabled"; - interrupt-parent = <&cpuflpr_clic>; - interrupts = <16 NRF_DEFAULT_IRQ_PRIORITY>, - <17 NRF_DEFAULT_IRQ_PRIORITY>, - <18 NRF_DEFAULT_IRQ_PRIORITY>, - <19 NRF_DEFAULT_IRQ_PRIORITY>, - <20 NRF_DEFAULT_IRQ_PRIORITY>, - <21 NRF_DEFAULT_IRQ_PRIORITY>, - <22 NRF_DEFAULT_IRQ_PRIORITY>; - #mbox-cells = <1>; - nordic,tasks = <7>; - nordic,tasks-mask = <0x007f0000>; - }; -}; - -&cpuflpr_vpr { - cpuflpr_vevif_tx: mailbox { - compatible = "nordic,nrf-vevif-event-tx"; - #mbox-cells = <1>; - nordic,events = <1>; - nordic,events-mask = <0x00100000>; - status = "disabled"; - }; -}; - -&cpuflpr_clic { - status = "okay"; -}; - -&grtc { - interrupts = <226 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&gpiote20 { - interrupts = <218 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&gpiote30 { - interrupts = <268 NRF_DEFAULT_IRQ_PRIORITY>; -}; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi deleted file mode 100644 index d673ae94e50..00000000000 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ /dev/null @@ -1,879 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -/delete-node/ &sw_pwm; - -/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ -#define NRF_DOMAIN_ID_APPLICATION 0 -#define NRF_DOMAIN_ID_FLPR 1 - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@0 { - compatible = "arm,cortex-m33f"; - reg = <0>; - device_type = "cpu"; - clocks = <&hfpll>; - #address-cells = <1>; - #size-cells = <1>; - - itm: itm@e0000000 { - compatible = "arm,armv8m-itm"; - reg = <0xe0000000 0x1000>; - swo-ref-frequency = ; - }; - }; - - cpuflpr: cpu@1 { - compatible = "nordic,vpr"; - reg = <1>; - device_type = "cpu"; - riscv,isa = "rv32emc"; - nordic,bus-width = <32>; - }; - }; - - clocks { - pclk: pclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - pclk32m: pclk32m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfxo: lfxo { - compatible = "nordic,nrf54l-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf54l-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1650>; - }; - - hfpll: hfpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - aclk: aclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - ficr: ficr@ffc000 { - compatible = "nordic,nrf-ficr"; - reg = <0xffc000 0x1000>; - #nordic,ficr-cells = <1>; - }; - - uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; - reg = <0xffd000 0x1000>; - }; - - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(511)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 DT_SIZE_K(511)>; - }; - - cpuflpr_sram: memory@20067c00 { - compatible = "mmio-sram"; - reg = <0x20067c00 DT_SIZE_K(96)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; - }; - - global_peripherals: peripheral@50000000 { - ranges = <0x0 0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - - dppic00: dppic@42000 { - compatible = "nordic,nrf-dppic"; - reg = <0x42000 0x808>; - status = "disabled"; - }; - - ppib00: ppib@44000 { - compatible = "nordic,nrf-ppib"; - reg = <0x44000 0x1000>; - status = "disabled"; - }; - - ppib01: ppib@45000 { - compatible = "nordic,nrf-ppib"; - reg = <0x45000 0x1000>; - status = "disabled"; - }; - - cpuflpr_vpr: vpr@4c000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x4c000 0x1000>; - ranges = <0x0 0x4c000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - status = "disabled"; - enable-secure; - - cpuflpr_clic: interrupt-controller@f0000000 { - compatible = "nordic,nrf-clic"; - reg = <0xf0000000 0x143c>; - interrupt-controller; - #interrupt-cells = <2>; - #address-cells = <1>; - status = "disabled"; - }; - }; - - spi00: spi@4d000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart00: uart@4d000 { - compatible = "nordic,nrf-uarte"; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - gpio2: gpio@50400 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x50400 0x300>; - #gpio-cells = <2>; - ngpios = <11>; - status = "disabled"; - port = <2>; - }; - - timer00: timer@55000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x55000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - prescaler = <0>; - }; - - usbhs: usbhs@5a000 { - compatible = "nordic,nrf-usbhs-nrf54l", "snps,dwc2"; - reg = <0x5a000 0x1000>, <0x50020000 0x1a000>; - reg-names = "wrapper", "core"; - interrupts = <90 NRF_DEFAULT_IRQ_PRIORITY>; - num-in-eps = <16>; - num-out-eps = <16>; - ghwcfg1 = <0x0>; - ghwcfg2 = <0x22affc52>; - ghwcfg4 = <0x3e10aa60>; - status = "disabled"; - }; - - dppic10: dppic@82000 { - compatible = "nordic,nrf-dppic"; - reg = <0x82000 0x808>; - status = "disabled"; - }; - - ppib10: ppib@83000 { - compatible = "nordic,nrf-ppib"; - reg = <0x83000 0x1000>; - status = "disabled"; - }; - - ppib11: ppib@84000 { - compatible = "nordic,nrf-ppib"; - reg = <0x84000 0x1000>; - status = "disabled"; - }; - - timer10: timer@85000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x85000 0x1000>; - cc-num = <8>; - max-bit-width = <32>; - interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - prescaler = <0>; - }; - - egu10: egu@87000 { - compatible = "nordic,nrf-egu"; - reg = <0x87000 0x1000>; - interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - radio: radio@8a000 { - compatible = "nordic,nrf-radio"; - reg = <0x8a000 0x1000>; - interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - dfe-supported; - ieee802154-supported; - ble-2mbps-supported; - ble-coded-phy-supported; - cs-supported; - - ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; - }; - - dppic20: dppic@c2000 { - compatible = "nordic,nrf-dppic"; - reg = <0xc2000 0x808>; - status = "disabled"; - }; - - ppib20: ppib@c3000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc3000 0x1000>; - status = "disabled"; - }; - - ppib21: ppib@c4000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc4000 0x1000>; - status = "disabled"; - }; - - ppib22: ppib@c5000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc5000 0x1000>; - status = "disabled"; - }; - - i2c20: i2c@c6000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi20: spi@c6000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart20: uart@c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c21: i2c@c7000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi21: spi@c7000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart21: uart@c7000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c22: i2c@c8000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi22: spi@c8000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart22: uart@c8000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - egu20: egu@c9000 { - compatible = "nordic,nrf-egu"; - reg = <0xc9000 0x1000>; - interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - timer20: timer@ca000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xca000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer21: timer@cb000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcb000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer22: timer@cc000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcc000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer23: timer@cd000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcd000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer24: timer@ce000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xce000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - pdm20: pdm@d0000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd0000 0x1000>; - interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pdm21: pdm@d1000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd1000 0x1000>; - interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pwm20: pwm@d2000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd2000 0x1000>; - interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - pwm21: pwm@d3000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd3000 0x1000>; - interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - pwm22: pwm@d4000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd4000 0x1000>; - interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - adc: adc@d5000 { - compatible = "nordic,nrf-saadc"; - reg = <0xd5000 0x1000>; - interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - zephyr,pm-device-runtime-auto; - }; - - nfct: nfct@d6000 { - compatible = "nordic,nrf-nfct"; - reg = <0xd6000 0x1000>; - interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - temp: temp@d7000 { - compatible = "nordic,nrf-temp"; - reg = <0xd7000 0x1000>; - interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio1: gpio@d8200 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8200 0x300>; - #gpio-cells = <2>; - ngpios = <32>; - status = "disabled"; - port = <1>; - gpiote-instance = <&gpiote20>; - }; - - gpio3: gpio@d8600 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8600 0x300>; - #gpio-cells = <2>; - ngpios = <13>; - status = "disabled"; - port = <3>; - gpiote-instance = <&gpiote20>; - }; - - gpiote20: gpiote@da000 { - compatible = "nordic,nrf-gpiote"; - reg = <0xda000 0x1000>; - status = "disabled"; - instance = <20>; - }; - - qdec20: qdec@e0000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe0000 0x1000>; - interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - qdec21: qdec@e1000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe1000 0x1000>; - interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - grtc: grtc@e2000 { - compatible = "nordic,nrf-grtc"; - reg = <0xe2000 0x1000>; - cc-num = <12>; - clocks = <&lfxo>, <&pclk>; - clock-names = "lfclock", "hfclock"; - status = "disabled"; - }; - - tdm: tdm@e8000 { - compatible = "nordic,nrf-tdm"; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xe8000 0x1000>; - interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - clocks = <&pclk32m>; - nordic,clockpin-enable = , - ; - }; - - i2c23: i2c@ed000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi23: spi@ed000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart23: uart@ed000 { - compatible = "nordic,nrf-uarte"; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c24: i2c@ee000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi24: spi@ee000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart24: uart@ee000 { - compatible = "nordic,nrf-uarte"; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - dppic30: dppic@102000 { - compatible = "nordic,nrf-dppic"; - reg = <0x102000 0x808>; - status = "disabled"; - }; - - ppib30: ppib@103000 { - compatible = "nordic,nrf-ppib"; - reg = <0x103000 0x1000>; - status = "disabled"; - }; - - i2c30: i2c@104000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi30: spi@104000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart30: uart@104000 { - compatible = "nordic,nrf-uarte"; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - comp: comparator@106000 { - /* - * Use compatible "nordic,nrf-comp" to configure as COMP - * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP - */ - compatible = "nordic,nrf-comp"; - reg = <0x106000 0x1000>; - status = "disabled"; - interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - wdt30: watchdog@108000 { - compatible = "nordic,nrf-wdt"; - reg = <0x108000 0x620>; - interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - wdt31: watchdog@109000 { - compatible = "nordic,nrf-wdt"; - reg = <0x109000 0x620>; - interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio0: gpio@10a000 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x10a000 0x300>; - #gpio-cells = <2>; - ngpios = <10>; - status = "disabled"; - port = <0>; - gpiote-instance = <&gpiote30>; - }; - - gpiote30: gpiote@10c000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x10c000 0x1000>; - status = "disabled"; - instance = <30>; - }; - - clock: clock@10e000 { - compatible = "nordic,nrf-clock"; - reg = <0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@51c { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x51c 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@520 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x520 0x1>; - status = "disabled"; - }; - }; - - regulators: regulator@120000 { - compatible = "nordic,nrf54l-regulators"; - reg = <0x120000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - vregmain: regulator@120600 { - compatible = "nordic,nrf5x-regulator"; - reg = <0x120600 0x1>; - status = "disabled"; - regulator-name = "VREGMAIN"; - regulator-initial-mode = ; - }; - }; - }; - - rram_controller: rram-controller@5004e000 { - compatible = "nordic,rram-controller"; - reg = <0x5004e000 0x1000>; - interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(2036)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - - cpuflpr_rram: rram@1e5000 { - compatible = "soc-nv-flash"; - reg = <0x1e5000 DT_SIZE_K(96)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_nvic: interrupt-controller@e000e100 { - #address-cells = <1>; - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - }; - }; -}; diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 1d18d708d74..5d7b4d942b3 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -63,9 +63,6 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54L15_CPUAPP NRF_APPLI zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L20_ENGA NRF54LM20A_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L20_ENGA_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L20_ENGA_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA NRF54LM20A_ENGA_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9120 NRF9120_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160 NRF9160_XXAA) @@ -204,7 +201,7 @@ zephyr_compile_definitions_ifndef(CONFIG_SOC_NRF54L_ANOMALY_56_WORKAROUND NRF54L # Inject code to skip TAMPC setup for nRF54L20 and nRF54L09. It is not supported for now. # It needs to be removed when support is provided. -if(CONFIG_SOC_NRF54L20_ENGA_CPUAPP OR CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP OR CONFIG_SOC_NRF54L09_ENGA_CPUAPP) +if(CONFIG_SOC_NRF54L20_ENGA_CPUAPP OR CONFIG_SOC_NRF54L09_ENGA_CPUAPP) zephyr_compile_definitions(NRF_SKIP_TAMPC_SETUP) endif() @@ -250,8 +247,6 @@ mdk_svd_ifdef(CONFIG_SOC_NRF54L15_CPUAPP nrf54l15_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54L15_CPUFLPR nrf54l15_flpr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54L20_ENGA_CPUAPP nrf54lm20a_enga_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54L20_ENGA_CPUFLPR nrf54lm20a_enga_flpr.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP nrf54lm20a_enga_application.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR nrf54lm20a_enga_flpr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF9120 nrf9120.svd) mdk_svd_ifdef(CONFIG_SOC_NRF9160 nrf9160.svd) mdk_svd_ifdef(CONFIG_SOC_NRF9230_ENGB_CPUAPP nrf9230_engb_application.svd) diff --git a/snippets/nordic-flpr/snippet.yml b/snippets/nordic-flpr/snippet.yml index d35c4581084..e6f6a41e252 100644 --- a/snippets/nordic-flpr/snippet.yml +++ b/snippets/nordic-flpr/snippet.yml @@ -15,6 +15,3 @@ boards: /.*/nrf54l20/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: soc/nrf54l20_cpuapp.overlay - /.*/nrf54lm20a/cpuapp/: - append: - EXTRA_DTC_OVERLAY_FILE: soc/nrf54lm20a_cpuapp.overlay diff --git a/snippets/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay b/snippets/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 1d36ba5ac48..00000000000 --- a/snippets/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - soc { - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - - cpuflpr_code_partition: image@1ed000 { - /* FLPR core code partition */ - reg = <0x1ed000 DT_SIZE_K(64)>; - }; - }; - - cpuflpr_sram_code_data: memory@2006fc00 { - compatible = "mmio-sram"; - reg = <0x2006fc00 DT_SIZE_K(64)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2006fc00 0x10000>; - }; - }; -}; - -&uart30 { - status = "reserved"; -}; - -&cpuflpr_vpr { - execution-memory = <&cpuflpr_sram_code_data>; - source-memory = <&cpuflpr_code_partition>; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 2d968a57bbe..19131154b5b 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -38,9 +38,6 @@ config SOC_NRF54L15_CPUAPP config SOC_NRF54L20_ENGA_CPUAPP select SOC_NRF54L_CPUAPP_COMMON -config SOC_NRF54LM20A_ENGA_CPUAPP - select SOC_NRF54L_CPUAPP_COMMON - config SOC_NRF54L05_CPUFLPR select RISCV_CORE_NORDIC_VPR @@ -56,9 +53,6 @@ config SOC_NRF54L15_CPUFLPR config SOC_NRF54L20_ENGA_CPUFLPR select RISCV_CORE_NORDIC_VPR -config SOC_NRF54LM20A_ENGA_CPUFLPR - select RISCV_CORE_NORDIC_VPR - if SOC_SERIES_NRF54LX config SOC_NRF54LX_SKIP_CLOCK_CONFIG diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp deleted file mode 100644 index c6c083bd7e6..00000000000 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp +++ /dev/null @@ -1,15 +0,0 @@ -# Nordic Semiconductor nRF54LM20A MCU - -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - - -if SOC_NRF54LM20A_ENGA_CPUAPP - -config NUM_IRQS - default 290 - -config UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND - default y - -endif # SOC_NRF54LM20A_ENGA_CPUAPP diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr deleted file mode 100644 index b8065044a5f..00000000000 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr +++ /dev/null @@ -1,11 +0,0 @@ -# Nordic Semiconductor nRF54LM20A MCU - -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if SOC_NRF54LM20A_ENGA_CPUFLPR - -config NUM_IRQS - default 287 - -endif # SOC_NRF54LM20A_ENGA_CPUFLPR diff --git a/soc/nordic/nrf54l/Kconfig.soc b/soc/nordic/nrf54l/Kconfig.soc index c7ddfc8bb39..5fd8260b9bb 100644 --- a/soc/nordic/nrf54l/Kconfig.soc +++ b/soc/nordic/nrf54l/Kconfig.soc @@ -105,34 +105,9 @@ config SOC_NRF54L20_ENGA_CPUFLPR help NRF54L20 ENGA CPUFLPR -config SOC_NRF54LM20A - bool - select SOC_SERIES_NRF54LX - help - NRF54LM20A - -config SOC_NRF54LM20A_ENGA - bool - select SOC_NRF54LM20A - help - NRF54LM20A ENGA - -config SOC_NRF54LM20A_ENGA_CPUAPP - bool - select SOC_NRF54LM20A_ENGA - help - NRF54LM20A ENGA CPUAPP - -config SOC_NRF54LM20A_ENGA_CPUFLPR - bool - select SOC_NRF54LM20A_ENGA - help - NRF54LM20A ENGA CPUFLPR - config SOC default "nrf54l05" if SOC_NRF54L05 default "nrf54l09" if SOC_NRF54L09 default "nrf54l10" if SOC_NRF54L10 default "nrf54l15" if SOC_NRF54L15 default "nrf54l20" if SOC_NRF54L20 - default "nrf54lm20a" if SOC_NRF54LM20A diff --git a/soc/nordic/nrf54l/Kconfig.sysbuild b/soc/nordic/nrf54l/Kconfig.sysbuild index 1517f62bb38..7ad3f9b4f9e 100644 --- a/soc/nordic/nrf54l/Kconfig.sysbuild +++ b/soc/nordic/nrf54l/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54L09_ENGA_CPUFLPR || SOC_NRF54L15_CPUFLPR || SOC_NRF54L20_ENGA_CPUFLPR || SOC_NRF54LM20A_ENGA_CPUFLPR +if SOC_NRF54L09_ENGA_CPUFLPR || SOC_NRF54L15_CPUFLPR || SOC_NRF54L20_ENGA_CPUFLPR config HAS_NORDIC_VPR_LAUNCHER_IMAGE default y diff --git a/soc/nordic/soc.yml b/soc/nordic/soc.yml index 97e5a0d5a63..923403f0530 100644 --- a/soc/nordic/soc.yml +++ b/soc/nordic/soc.yml @@ -41,10 +41,6 @@ family: cpuclusters: - name: cpuapp - name: cpuflpr - - name: nrf54lm20a - cpuclusters: - - name: cpuapp - - name: cpuflpr - name: nrf54h socs: - name: nrf54h20 @@ -128,9 +124,6 @@ runners: - qualifiers: - nrf54l20/cpuapp - nrf54l20/cpuflpr - - qualifiers: - - nrf54lm20a/cpuapp - - nrf54lm20a/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad @@ -197,9 +190,6 @@ runners: - qualifiers: - nrf54l20/cpuapp - nrf54l20/cpuflpr - - qualifiers: - - nrf54lm20a/cpuapp - - nrf54lm20a/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad @@ -266,9 +256,6 @@ runners: - qualifiers: - nrf54l20/cpuapp - nrf54l20/cpuflpr - - qualifiers: - - nrf54lm20a/cpuapp - - nrf54lm20a/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad From 378cb40349bb4503865ab35a0da1d4d06200a3c6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 621/881] Revert "[nrf fromlist] sysbuild: cmake: kconfig: Fix missing sysbuild Kconfig paths" This reverts commit fc8b05e81ad1cd5ad4c62ead0d4ed96d034913f4. Signed-off-by: Jukka Rissanen --- share/sysbuild/cmake/modules/sysbuild_kconfig.cmake | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/share/sysbuild/cmake/modules/sysbuild_kconfig.cmake b/share/sysbuild/cmake/modules/sysbuild_kconfig.cmake index f0e4c29fcad..f366c66dbde 100644 --- a/share/sysbuild/cmake/modules/sysbuild_kconfig.cmake +++ b/share/sysbuild/cmake/modules/sysbuild_kconfig.cmake @@ -102,17 +102,6 @@ set(shield_conf_files) list(APPEND ZEPHYR_KCONFIG_MODULES_DIR BOARD=${BOARD}) set(KCONFIG_NAMESPACE SB_CONFIG) -foreach(module_name ${ZEPHYR_MODULE_NAMES}) - zephyr_string(SANITIZE TOUPPER MODULE_NAME_UPPER ${module_name}) - - if(SYSBUILD_${MODULE_NAME_UPPER}_KCONFIG) - list(APPEND - ZEPHYR_KCONFIG_MODULES_DIR - "SYSBUILD_${MODULE_NAME_UPPER}_KCONFIG=${SYSBUILD_${MODULE_NAME_UPPER}_KCONFIG}" - ) - endif() -endforeach() - if(EXISTS ${APP_DIR}/Kconfig.sysbuild) set(KCONFIG_ROOT ${APP_DIR}/Kconfig.sysbuild) endif() From d4def9089c445b0b838705973c006bd122bc52b8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 622/881] Revert "[nrf fromtree] twister: Enable gathering footprint if test plan exists" This reverts commit 4d4633050d9de0724b4a9c9b1136f2133d2777ed. Signed-off-by: Jukka Rissanen --- scripts/pylib/twister/twisterlib/runner.py | 1 + scripts/tests/twister/test_runner.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/runner.py b/scripts/pylib/twister/twisterlib/runner.py index 9d050ca30a8..5b1a782eca9 100644 --- a/scripts/pylib/twister/twisterlib/runner.py +++ b/scripts/pylib/twister/twisterlib/runner.py @@ -1895,6 +1895,7 @@ def run(self): except queue.Empty: break else: + inst.metrics.update(self.instances[inst.name].metrics) inst.metrics["handler_time"] = inst.execution_time self.instances[inst.name] = inst diff --git a/scripts/tests/twister/test_runner.py b/scripts/tests/twister/test_runner.py index e689095fc7c..0e6227acefe 100644 --- a/scripts/tests/twister/test_runner.py +++ b/scripts/tests/twister/test_runner.py @@ -2530,7 +2530,7 @@ def mock_client_from_environ(jobs): pipeline_q = queue.LifoQueue() done_q = queue.LifoQueue() done_instance = mock.Mock( - metrics={'k': 'v2'}, + metrics={'k2': 'v2'}, execution_time=30 ) done_instance.name='dummy instance' @@ -2568,7 +2568,8 @@ def iteration_increment(value=1, decrement=False): assert tr.jobserver.name == expected_jobserver assert tr.instances['dummy instance'].metrics == { - 'k': 'v2', + 'k': 'v', + 'k2': 'v2', 'handler_time': 30 } From bfa0c06c43090fa39e8fca65a666c4c1620b1721 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 623/881] Revert "[nrf fromtree] cmake: Add a new no_deprecation_warning compiler flag" This reverts commit 62f83d9365def0fd199599358889034765cce051. Signed-off-by: Jukka Rissanen --- CMakeLists.txt | 8 +------- Kconfig.zephyr | 1 + cmake/compiler/compiler_flags_template.cmake | 3 --- cmake/compiler/gcc/compiler_flags.cmake | 4 ---- include/zephyr/toolchain/gcc.h | 4 +--- include/zephyr/toolchain/iar/iccarm.h | 6 +----- tests/kernel/pipe/deprecated/pipe/CMakeLists.txt | 1 + tests/kernel/workq/work/src/main.c | 5 +++++ tests/kernel/workq/work_queue/src/main.c | 5 +++++ 9 files changed, 15 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3157813d65c..0effc0c381c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,19 +159,13 @@ zephyr_compile_options($<$:$:$>) # Extra warnings options for twister run -if(CONFIG_COMPILER_WARNINGS_AS_ERRORS) +if (CONFIG_COMPILER_WARNINGS_AS_ERRORS) zephyr_compile_options($<$:$>) zephyr_compile_options($<$:$>) zephyr_compile_options($<$:$>) zephyr_link_libraries($) endif() -if(CONFIG_DEPRECATION_TEST) - zephyr_compile_options($<$:$>) - zephyr_compile_options($<$:$>) - zephyr_compile_options($<$:$>) -endif() - # @Intent: Set compiler flags to enable buffer overflow checks in libc functions # @details: # Kconfig.zephyr "Detect buffer overflows in libc calls" is a kconfig choice, diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 9baae392209..070b4231eee 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -542,6 +542,7 @@ config LTO config COMPILER_WARNINGS_AS_ERRORS bool "Treat warnings as errors" + depends on !DEPRECATION_TEST help Turn on "warning as error" toolchain flags diff --git a/cmake/compiler/compiler_flags_template.cmake b/cmake/compiler/compiler_flags_template.cmake index 6050c46d385..34acddfa362 100644 --- a/cmake/compiler/compiler_flags_template.cmake +++ b/cmake/compiler/compiler_flags_template.cmake @@ -76,9 +76,6 @@ set_compiler_property(PROPERTY no_strict_aliasing) set_property(TARGET compiler PROPERTY warnings_as_errors) set_property(TARGET asm PROPERTY warnings_as_errors) -set_property(TARGET compiler PROPERTY no_deprecation_warning) -set_property(TARGET asm PROPERTY no_deprecation_warning) - # Flag for disabling exceptions in C++ set_property(TARGET compiler-cpp PROPERTY no_exceptions) diff --git a/cmake/compiler/gcc/compiler_flags.cmake b/cmake/compiler/gcc/compiler_flags.cmake index c3b8c113d42..9d4989fea47 100644 --- a/cmake/compiler/gcc/compiler_flags.cmake +++ b/cmake/compiler/gcc/compiler_flags.cmake @@ -153,10 +153,6 @@ set_compiler_property(PROPERTY no_strict_aliasing -fno-strict-aliasing) set_property(TARGET compiler PROPERTY warnings_as_errors -Werror) set_property(TARGET asm PROPERTY warnings_as_errors -Werror -Wa,--fatal-warnings) -# Deprecation warning -set_property(TARGET compiler PROPERTY no_deprecation_warning -Wno-deprecated-declarations) -set_property(TARGET asm PROPERTY no_deprecation_warning -Wno-deprecated-declarations) - # Disable exceptions flag in C++ set_property(TARGET compiler-cpp PROPERTY no_exceptions "-fno-exceptions") diff --git a/include/zephyr/toolchain/gcc.h b/include/zephyr/toolchain/gcc.h index 4d3d85858d3..58aa13e0a3e 100644 --- a/include/zephyr/toolchain/gcc.h +++ b/include/zephyr/toolchain/gcc.h @@ -334,13 +334,11 @@ do { \ #define __WARN1(s) _Pragma(#s) /* Generic message */ -#ifndef CONFIG_DEPRECATION_TEST +#ifndef __DEPRECATED_MACRO #define __DEPRECATED_MACRO __WARN("Macro is deprecated") /* When adding this, remember to follow the instructions in * https://docs.zephyrproject.org/latest/develop/api/api_lifecycle.html#deprecated */ -#else -#define __DEPRECATED_MACRO #endif /* These macros allow having ARM asm functions callable from thumb */ diff --git a/include/zephyr/toolchain/iar/iccarm.h b/include/zephyr/toolchain/iar/iccarm.h index e6a3cb96d3b..746554d2e12 100644 --- a/include/zephyr/toolchain/iar/iccarm.h +++ b/include/zephyr/toolchain/iar/iccarm.h @@ -243,14 +243,10 @@ do { \ #define __WARN1(s) __PRAGMA(message = #s) /* Generic message */ -#ifndef CONFIG_DEPRECATION_TEST +#ifndef __DEPRECATED_MACRO #define __DEPRECATED_MACRO __WARN("Macro is deprecated") -#else -#define __DEPRECATED_MACRO #endif - - /* These macros allow having ARM asm functions callable from thumb */ #if defined(_ASMLANGUAGE) diff --git a/tests/kernel/pipe/deprecated/pipe/CMakeLists.txt b/tests/kernel/pipe/deprecated/pipe/CMakeLists.txt index ac8bc4dee46..2624f4be400 100644 --- a/tests/kernel/pipe/deprecated/pipe/CMakeLists.txt +++ b/tests/kernel/pipe/deprecated/pipe/CMakeLists.txt @@ -1,6 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 cmake_minimum_required(VERSION 3.20.0) +set(CMAKE_C_FLAGS "-D__deprecated=\"/* deprecated */\" -D__DEPRECATED_MACRO=\"/* deprecated_macro*/\"") find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(pipe) diff --git a/tests/kernel/workq/work/src/main.c b/tests/kernel/workq/work/src/main.c index 11ae39db2a8..ce327cee405 100644 --- a/tests/kernel/workq/work/src/main.c +++ b/tests/kernel/workq/work/src/main.c @@ -8,6 +8,11 @@ * about the use of that API. */ #include +#undef __deprecated +#define __deprecated +#undef __DEPRECATED_MACRO +#define __DEPRECATED_MACRO + #include #define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) diff --git a/tests/kernel/workq/work_queue/src/main.c b/tests/kernel/workq/work_queue/src/main.c index f97f202bcee..b14d2878717 100644 --- a/tests/kernel/workq/work_queue/src/main.c +++ b/tests/kernel/workq/work_queue/src/main.c @@ -10,6 +10,11 @@ * about the use of that API. */ #include +#undef __deprecated +#define __deprecated +#undef __DEPRECATED_MACRO +#define __DEPRECATED_MACRO + #include #include #include From 1c25e490a7c91ce25eda52e9971954408beeceb0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:32 +0300 Subject: [PATCH 624/881] Revert "[nrf fromtree] drivers: clock_control: update nrf2 lfosc_get_accuracy" This reverts commit 010f7c7102ee2e8f6df2748533772e852768fefa. Signed-off-by: Jukka Rissanen --- .../clock_control/clock_control_nrf2_common.c | 37 +++++++++++++++++++ .../clock_control/clock_control_nrf2_common.h | 10 +++++ .../clock_control/clock_control_nrf_lfclk.c | 34 ----------------- 3 files changed, 47 insertions(+), 34 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf2_common.c b/drivers/clock_control/clock_control_nrf2_common.c index c2657f45478..f070d5d7b69 100644 --- a/drivers/clock_control/clock_control_nrf2_common.c +++ b/drivers/clock_control/clock_control_nrf2_common.c @@ -5,6 +5,7 @@ #include "clock_control_nrf2_common.h" #include +#include #include LOG_MODULE_REGISTER(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); @@ -19,6 +20,8 @@ LOG_MODULE_REGISTER(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); (idx * sizeof(array[0])) - \ offsetof(type, array[0])) +#define BICR (NRF_BICR_Type *)DT_REG_ADDR(DT_NODELABEL(bicr)) + /* * Definition of `struct clock_config_generic`. * Used to access `clock_config_*` structures in a common way. @@ -89,6 +92,40 @@ static inline uint8_t get_index_of_highest_bit(uint32_t value) return value ? (uint8_t)(31 - __builtin_clz(value)) : 0; } +int lfosc_get_accuracy(uint16_t *accuracy) +{ + switch (nrf_bicr_lfosc_accuracy_get(BICR)) { + case NRF_BICR_LFOSC_ACCURACY_500PPM: + *accuracy = 500U; + break; + case NRF_BICR_LFOSC_ACCURACY_250PPM: + *accuracy = 250U; + break; + case NRF_BICR_LFOSC_ACCURACY_150PPM: + *accuracy = 150U; + break; + case NRF_BICR_LFOSC_ACCURACY_100PPM: + *accuracy = 100U; + break; + case NRF_BICR_LFOSC_ACCURACY_75PPM: + *accuracy = 75U; + break; + case NRF_BICR_LFOSC_ACCURACY_50PPM: + *accuracy = 50U; + break; + case NRF_BICR_LFOSC_ACCURACY_30PPM: + *accuracy = 30U; + break; + case NRF_BICR_LFOSC_ACCURACY_20PPM: + *accuracy = 20U; + break; + default: + return -EINVAL; + } + + return 0; +} + int clock_config_init(void *clk_cfg, uint8_t onoff_cnt, k_work_handler_t update_work_handler) { struct clock_config_generic *cfg = clk_cfg; diff --git a/drivers/clock_control/clock_control_nrf2_common.h b/drivers/clock_control/clock_control_nrf2_common.h index 4b1c7fe000e..7f934fdac5b 100644 --- a/drivers/clock_control/clock_control_nrf2_common.h +++ b/drivers/clock_control/clock_control_nrf2_common.h @@ -36,6 +36,16 @@ struct clock_onoff { struct clock_onoff onoff[_onoff_cnt]; \ } +/** + * @brief Obtain LFOSC accuracy in ppm. + * + * @param[out] accuracy Accuracy in ppm. + * + * @retval 0 On success + * @retval -EINVAL If accuracy is not configured. + */ +int lfosc_get_accuracy(uint16_t *accuracy); + /** * @brief Initializes a clock configuration structure. * diff --git a/drivers/clock_control/clock_control_nrf_lfclk.c b/drivers/clock_control/clock_control_nrf_lfclk.c index 829416f662c..fcdb8bd573b 100644 --- a/drivers/clock_control/clock_control_nrf_lfclk.c +++ b/drivers/clock_control/clock_control_nrf_lfclk.c @@ -69,40 +69,6 @@ struct lfclk_dev_config { uint32_t fixed_frequency; }; -static int lfosc_get_accuracy(uint16_t *accuracy) -{ - switch (nrf_bicr_lfosc_accuracy_get(BICR)) { - case NRF_BICR_LFOSC_ACCURACY_500PPM: - *accuracy = 500U; - break; - case NRF_BICR_LFOSC_ACCURACY_250PPM: - *accuracy = 250U; - break; - case NRF_BICR_LFOSC_ACCURACY_150PPM: - *accuracy = 150U; - break; - case NRF_BICR_LFOSC_ACCURACY_100PPM: - *accuracy = 100U; - break; - case NRF_BICR_LFOSC_ACCURACY_75PPM: - *accuracy = 75U; - break; - case NRF_BICR_LFOSC_ACCURACY_50PPM: - *accuracy = 50U; - break; - case NRF_BICR_LFOSC_ACCURACY_30PPM: - *accuracy = 30U; - break; - case NRF_BICR_LFOSC_ACCURACY_20PPM: - *accuracy = 20U; - break; - default: - return -EINVAL; - } - - return 0; -} - static void clock_evt_handler(nrfs_clock_evt_t const *p_evt, void *context) { struct lfclk_dev_data *dev_data = context; From 5a05080653bb0c01510a789bb0dce42f31820f44 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 625/881] Revert "[nrf fromtree] tests: drivers: Update nrf2 clock control tests for nrf2_auxpll driver" This reverts commit b10d266342b77fc4a8e44afff305eaaa6bd3890b. Signed-off-by: Jukka Rissanen --- .../nrf_clock_control/src/main.c | 69 ++----------------- 1 file changed, 5 insertions(+), 64 deletions(-) diff --git a/tests/drivers/clock_control/nrf_clock_control/src/main.c b/tests/drivers/clock_control/nrf_clock_control/src/main.c index 8db19d38200..87778bbaae5 100644 --- a/tests/drivers/clock_control/nrf_clock_control/src/main.c +++ b/tests/drivers/clock_control/nrf_clock_control/src/main.c @@ -9,7 +9,6 @@ #include #include #include -#include struct test_clk_context { const struct device *clk_dev; @@ -17,7 +16,6 @@ struct test_clk_context { size_t clk_specs_size; }; -#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL) const struct nrf_clock_spec test_clk_specs_hsfll[] = { { .frequency = MHZ(128), @@ -35,7 +33,6 @@ const struct nrf_clock_spec test_clk_specs_hsfll[] = { .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, }, }; -#endif #if CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP const struct nrf_clock_spec test_clk_specs_fll16m[] = { @@ -102,7 +99,6 @@ static const struct test_clk_context cpurad_hsfll_test_clk_contexts[] = { }; #endif -#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL) const struct nrf_clock_spec test_clk_specs_global_hsfll[] = { { .frequency = MHZ(320), @@ -125,9 +121,7 @@ static const struct test_clk_context global_hsfll_test_clk_contexts[] = { .clk_specs_size = ARRAY_SIZE(test_clk_specs_global_hsfll), }, }; -#endif -#if defined(CONFIG_CLOCK_CONTROL_NRF_LFCLK) const struct nrf_clock_spec test_clk_specs_lfclk[] = { { .frequency = 32768, @@ -153,44 +147,6 @@ static const struct test_clk_context lfclk_test_clk_contexts[] = { .clk_specs_size = ARRAY_SIZE(test_clk_specs_lfclk), }, }; -#endif - -#if defined(CONFIG_CLOCK_CONTROL_NRF_AUXPLL) - -#define AUXPLL_COMPAT nordic_nrf_auxpll -#define AUXPLL_NODE DT_INST(0, AUXPLL_COMPAT) -#define AUXPLL_FREQ DT_PROP(AUXPLL_NODE, nordic_frequency) - -/* Gets selected AUXPLL DIV and selects the expected frequency */ -#if AUXPLL_FREQ == NRF_AUXPLL_FREQUENCY_DIV_MIN -#define AUXPLL_FREQ_OUT 80000000 -#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 -#define AUXPLL_FREQ_OUT 11289591 -#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_USB_24M -#define AUXPLL_FREQ_OUT 24000000 -#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_48K -#define AUXPLL_FREQ_OUT 12287963 -#else -/*No use case for NRF_AUXPLL_FREQ_DIV_MAX or others yet*/ -#error "Unsupported AUXPLL frequency selection" -#endif - -const struct nrf_clock_spec test_clk_specs_auxpll[] = { - { - .frequency = AUXPLL_FREQ_OUT, - .accuracy = 0, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, -}; - -static const struct test_clk_context auxpll_test_clk_contexts[] = { - { - .clk_dev = DEVICE_DT_GET(AUXPLL_NODE), - .clk_specs = test_clk_specs_auxpll, - .clk_specs_size = ARRAY_SIZE(test_clk_specs_auxpll), - }, -}; -#endif static void test_request_release_clock_spec(const struct device *clk_dev, const struct nrf_clock_spec *clk_spec) @@ -310,23 +266,18 @@ ZTEST(nrf2_clock_control, test_cpurad_hsfll_control) } #endif +ZTEST(nrf2_clock_control, test_lfclk_control) +{ + TC_PRINT("LFCLK test\n"); + test_clock_control_request(lfclk_test_clk_contexts, ARRAY_SIZE(lfclk_test_clk_contexts)); +} - -#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL) ZTEST(nrf2_clock_control, test_global_hsfll_control) { TC_PRINT("Global HSFLL test\n"); test_clock_control_request(global_hsfll_test_clk_contexts, ARRAY_SIZE(global_hsfll_test_clk_contexts)); } -#endif - -#if defined(CONFIG_CLOCK_CONTROL_NRF_LFCLK) -ZTEST(nrf2_clock_control, test_lfclk_control) -{ - TC_PRINT("LFCLK test\n"); - test_clock_control_request(lfclk_test_clk_contexts, ARRAY_SIZE(lfclk_test_clk_contexts)); -} ZTEST(nrf2_clock_control, test_safe_request_cancellation) { @@ -352,16 +303,6 @@ ZTEST(nrf2_clock_control, test_safe_request_cancellation) TC_PRINT("Clock control safe cancellation return value: %d\n", ret); zassert_between_inclusive(ret, ONOFF_STATE_ON, ONOFF_STATE_TO_ON); } -#endif - -#if defined(CONFIG_CLOCK_CONTROL_NRF_AUXPLL) -ZTEST(nrf2_clock_control, test_auxpll_control) -{ - TC_PRINT("AUXPLL control test\n"); - test_clock_control_request(auxpll_test_clk_contexts, - ARRAY_SIZE(auxpll_test_clk_contexts)); -} -#endif static void *setup(void) { From 766056ac0d2cd6e455bc5998533975925384b2a3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 626/881] Revert "[nrf fromtree] drivers: can: update clock control to use nrf2_auxpll" This reverts commit 23b235915a3bc20407e7a753680107720b636e8d. Signed-off-by: Jukka Rissanen --- drivers/can/can_nrf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/can/can_nrf.c b/drivers/can/can_nrf.c index f8c037835a8..c538291ecb4 100644 --- a/drivers/can/can_nrf.c +++ b/drivers/can/can_nrf.c @@ -171,7 +171,7 @@ static int can_nrf_init(const struct device *dev) return ret; } - ret = nrf_clock_control_request_sync(config->auxpll, NULL, K_FOREVER); + ret = clock_control_on(config->auxpll, NULL); if (ret < 0) { return ret; } From e7300fdc656ccdcd7df2b8b046182488de0a586f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 627/881] Revert "[nrf fromtree] drivers: clock_control: refactor nrf_auxpll driver to nrf2" This reverts commit c1d603e49d8b7cb2ff7927a0de20c59c86d68a43. Signed-off-by: Jukka Rissanen --- drivers/clock_control/CMakeLists.txt | 2 +- drivers/clock_control/Kconfig | 2 + drivers/clock_control/Kconfig.nrf | 6 - drivers/clock_control/Kconfig.nrf_auxpll | 9 + .../clock_control/clock_control_nrf_auxpll.c | 157 ++++-------------- 5 files changed, 45 insertions(+), 131 deletions(-) create mode 100644 drivers/clock_control/Kconfig.nrf_auxpll diff --git a/drivers/clock_control/CMakeLists.txt b/drivers/clock_control/CMakeLists.txt index 0bf5e0075eb..9acbda0e5dd 100644 --- a/drivers/clock_control/CMakeLists.txt +++ b/drivers/clock_control/CMakeLists.txt @@ -54,7 +54,6 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_FLL16M clock_cont zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF54H_HFXO clock_control_nrf54h_hfxo.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL clock_control_nrf_hsfll_local.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_LFCLK clock_control_nrf_lfclk.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_AUXPLL clock_control_nrf_auxpll.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_BOUFFALOLAB_BL60X clock_control_bl60x.c) if(CONFIG_CLOCK_CONTROL_RENESAS_RZA2M_CPG) @@ -117,4 +116,5 @@ endif() zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_AST10X0 clock_control_ast10x0.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_MAX32 clock_control_max32.c) +zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_AUXPLL clock_control_nrf_auxpll.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_WCH_RCC clock_control_wch_rcc.c) diff --git a/drivers/clock_control/Kconfig b/drivers/clock_control/Kconfig index 05a2a7fb8fa..82fa462ee71 100644 --- a/drivers/clock_control/Kconfig +++ b/drivers/clock_control/Kconfig @@ -104,6 +104,8 @@ source "drivers/clock_control/Kconfig.pwm" source "drivers/clock_control/Kconfig.rpi_pico" +source "drivers/clock_control/Kconfig.nrf_auxpll" + source "drivers/clock_control/Kconfig.arm_scmi" source "drivers/clock_control/Kconfig.silabs" diff --git a/drivers/clock_control/Kconfig.nrf b/drivers/clock_control/Kconfig.nrf index a7c1be10a12..bbd4a86f5a9 100644 --- a/drivers/clock_control/Kconfig.nrf +++ b/drivers/clock_control/Kconfig.nrf @@ -297,9 +297,3 @@ config CLOCK_CONTROL_NRF_LFCLK_CLOCK_TIMEOUT_MS default 1000 endif # CLOCK_CONTROL_NRF_LFCLK - -config CLOCK_CONTROL_NRF_AUXPLL - bool "nRF Auxiliary PLL driver" - default y - depends on DT_HAS_NORDIC_NRF_AUXPLL_ENABLED - select CLOCK_CONTROL_NRF2_COMMON diff --git a/drivers/clock_control/Kconfig.nrf_auxpll b/drivers/clock_control/Kconfig.nrf_auxpll new file mode 100644 index 00000000000..413452c1ac4 --- /dev/null +++ b/drivers/clock_control/Kconfig.nrf_auxpll @@ -0,0 +1,9 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config CLOCK_CONTROL_NRF_AUXPLL + bool "nRF Auxiliary PLL driver" + default y + depends on DT_HAS_NORDIC_NRF_AUXPLL_ENABLED + help + Driver for nRF Auxiliary PLL. diff --git a/drivers/clock_control/clock_control_nrf_auxpll.c b/drivers/clock_control/clock_control_nrf_auxpll.c index d048f4ed1c7..19dee8c4493 100644 --- a/drivers/clock_control/clock_control_nrf_auxpll.c +++ b/drivers/clock_control/clock_control_nrf_auxpll.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * SPDX-License-Identifier: Apache-2.0 */ @@ -9,65 +9,55 @@ #include #include +#include #include -#include +#include +#include #include #include -#include -#include "clock_control_nrf2_common.h" #include - -/* Check dt-bindings match MDK frequency division definitions*/ -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_MIN == NRF_AUXPLL_FREQUENCY_DIV_MIN, - "Different AUXPLL_FREQ_DIV_MIN definition in MDK and devicetree binding"); -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 == NRF_AUXPLL_FREQUENCY_AUDIO_44K1, - "Different AUXPLL_FREQ_DIV_AUDIO_44K1 definition in MDK and devicetree binding"); -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_USB24M == NRF_AUXPLL_FREQUENCY_USB_24M, - "Different AUXPLL_FREQ_DIV_USB24M definition in MDK and devicetree binding"); -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_AUDIO_48K == NRF_AUXPLL_FREQUENCY_AUDIO_48K, - "Different AUXPLL_FREQ_DIV_AUDIO_48K definition in MDK and devicetree binding"); -BUILD_ASSERT(NRF_AUXPLL_FREQ_DIV_MAX == NRF_AUXPLL_FREQUENCY_DIV_MAX, - "Different AUXPLL_FREQ_DIV_MAX definition in MDK and devicetree binding"); - -/* maximum lock time in us, >10x time observed experimentally */ -#define AUXPLL_LOCK_TIME_MAX_US 20000 -/* lock wait step in us*/ -#define AUXPLL_LOCK_WAIT_STEP_US 1000 - -struct dev_data_auxpll { - struct onoff_manager mgr; - onoff_notify_fn notify; - const struct device *dev; -}; +/* maximum lock time in ms, >10x time observed experimentally */ +#define AUXPLL_LOCK_TIME_MAX_MS 20 +/* lock wait step in ms*/ +#define AUXPLL_LOCK_WAIT_STEP_MS 1 struct clock_control_nrf_auxpll_config { NRF_AUXPLL_Type *auxpll; uint32_t ref_clk_hz; uint32_t ficr_ctune; nrf_auxpll_config_t cfg; - nrf_auxpll_freq_div_ratio_t frequency; + uint16_t frequency; nrf_auxpll_ctrl_outsel_t out_div; }; -static int clock_control_nrf_auxpll_on(struct dev_data_auxpll *dev_data) +static int clock_control_nrf_auxpll_on(const struct device *dev, clock_control_subsys_t sys) { - const struct clock_control_nrf_auxpll_config *config = dev_data->dev->config; + const struct clock_control_nrf_auxpll_config *config = dev->config; bool locked; + unsigned int wait = 0U; + + ARG_UNUSED(sys); nrf_auxpll_task_trigger(config->auxpll, NRF_AUXPLL_TASK_START); - NRFX_WAIT_FOR(nrf_auxpll_mode_locked_check(config->auxpll), - AUXPLL_LOCK_TIME_MAX_US / AUXPLL_LOCK_WAIT_STEP_US, - AUXPLL_LOCK_WAIT_STEP_US, locked); + do { + locked = nrf_auxpll_mode_locked_check(config->auxpll); + if (!locked) { + k_msleep(AUXPLL_LOCK_WAIT_STEP_MS); + wait += AUXPLL_LOCK_WAIT_STEP_MS; + } + } while (wait < AUXPLL_LOCK_TIME_MAX_MS && !locked); return locked ? 0 : -ETIMEDOUT; } -static int clock_control_nrf_auxpll_off(struct dev_data_auxpll *dev_data) +static int clock_control_nrf_auxpll_off(const struct device *dev, clock_control_subsys_t sys) { - const struct clock_control_nrf_auxpll_config *config = dev_data->dev->config; + const struct clock_control_nrf_auxpll_config *config = dev->config; + + ARG_UNUSED(sys); nrf_auxpll_task_trigger(config->auxpll, NRF_AUXPLL_TASK_STOP); @@ -77,58 +67,6 @@ static int clock_control_nrf_auxpll_off(struct dev_data_auxpll *dev_data) return 0; } -static void onoff_start_auxpll(struct onoff_manager *mgr, onoff_notify_fn notify) -{ - struct dev_data_auxpll *dev_data = - CONTAINER_OF(mgr, struct dev_data_auxpll, mgr); - - int ret = clock_control_nrf_auxpll_on(dev_data); - - notify(&dev_data->mgr, ret); - -} - -static void onoff_stop_auxpll(struct onoff_manager *mgr, onoff_notify_fn notify) -{ - struct dev_data_auxpll *dev_data = - CONTAINER_OF(mgr, struct dev_data_auxpll, mgr); - - clock_control_nrf_auxpll_off(dev_data); - notify(mgr, 0); -} - -static int api_request_auxpll(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ - struct dev_data_auxpll *dev_data = dev->data; - - ARG_UNUSED(spec); - - return onoff_request(&dev_data->mgr, cli); -} - -static int api_release_auxpll(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - struct dev_data_auxpll *dev_data = dev->data; - - ARG_UNUSED(spec); - - return onoff_release(&dev_data->mgr); -} - -static int api_cancel_or_release_auxpll(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ - struct dev_data_auxpll *dev_data = dev->data; - - ARG_UNUSED(spec); - - return onoff_cancel_or_release(&dev_data->mgr, cli); -} - static int clock_control_nrf_auxpll_get_rate(const struct device *dev, clock_control_subsys_t sys, uint32_t *rate) { @@ -161,21 +99,16 @@ static enum clock_control_status clock_control_nrf_auxpll_get_status(const struc return CLOCK_CONTROL_STATUS_OFF; } -static const struct onoff_transitions transitions = { - .start = onoff_start_auxpll, - .stop = onoff_stop_auxpll +static DEVICE_API(clock_control, clock_control_nrf_auxpll_api) = { + .on = clock_control_nrf_auxpll_on, + .off = clock_control_nrf_auxpll_off, + .get_rate = clock_control_nrf_auxpll_get_rate, + .get_status = clock_control_nrf_auxpll_get_status, }; static int clock_control_nrf_auxpll_init(const struct device *dev) { - struct dev_data_auxpll *dev_data = dev->data; const struct clock_control_nrf_auxpll_config *config = dev->config; - int rc; - - rc = onoff_manager_init(&dev_data->mgr, &transitions); - if (rc < 0) { - return rc; - } nrf_auxpll_ctrl_frequency_set(config->auxpll, config->frequency); @@ -190,31 +123,7 @@ static int clock_control_nrf_auxpll_init(const struct device *dev) return 0; } -static DEVICE_API(nrf_clock_control, drv_api_auxpll) = { - .std_api = { - .on = api_nosys_on_off, - .off = api_nosys_on_off, - .get_rate = clock_control_nrf_auxpll_get_rate, - .get_status = clock_control_nrf_auxpll_get_status, - }, - .request = api_request_auxpll, - .release = api_release_auxpll, - .cancel_or_release = api_cancel_or_release_auxpll, -}; - #define CLOCK_CONTROL_NRF_AUXPLL_DEFINE(n) \ - BUILD_ASSERT( \ - DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_DIV_MIN || \ - DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_AUDIO_44K1 || \ - DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_USB_24M || \ - DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_AUDIO_48K || \ - DT_INST_PROP(n, nordic_frequency) == NRF_AUXPLL_FREQUENCY_DIV_MAX, \ - "Invalid nordic,frequency value in DeviceTree for AUXPLL instance " #n); \ - BUILD_ASSERT(DT_INST_PROP(n, nordic_out_div) > 0, \ - "nordic,out_div must be greater than 0 for AUXPLL instance " #n); \ - static struct dev_data_auxpll data_auxpll##n = { \ - .dev = DEVICE_DT_INST_GET(n), \ - }; \ static const struct clock_control_nrf_auxpll_config config##n = { \ .auxpll = (NRF_AUXPLL_Type *)DT_INST_REG_ADDR(n), \ .ref_clk_hz = DT_PROP(DT_INST_CLOCKS_CTLR(n), clock_frequency), \ @@ -231,9 +140,9 @@ static DEVICE_API(nrf_clock_control, drv_api_auxpll) = { .frequency = DT_INST_PROP(n, nordic_frequency), \ .out_div = DT_INST_PROP(n, nordic_out_div), \ }; \ - \ - DEVICE_DT_INST_DEFINE(n, clock_control_nrf_auxpll_init, NULL, &data_auxpll##n, &config##n, \ + \ + DEVICE_DT_INST_DEFINE(n, clock_control_nrf_auxpll_init, NULL, NULL, &config##n, \ PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, \ - &drv_api_auxpll); + &clock_control_nrf_auxpll_api); DT_INST_FOREACH_STATUS_OKAY(CLOCK_CONTROL_NRF_AUXPLL_DEFINE) From f6d30be9bb3eed8190c07398074dc23e325713c8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 628/881] Revert "[nrf fromtree] dts: vendor: nordic: nrf54h20 update canpll to use auxpll binding" This reverts commit d4e4d6377f22b1bd4d89ab971fa9b2ba30b5f05b. Signed-off-by: Jukka Rissanen --- dts/vendor/nordic/nrf54h20.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index f907dd7fa2e..c12ea5f1ead 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -563,7 +562,7 @@ clocks = <&hfxo>; #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; - nordic,frequency = ; + nordic,frequency = <0>; nordic,out-div = <2>; nordic,out-drive = <0>; nordic,current-tune = <6>; From 13bc1c28e828fe51701251d898d6988c7cb3124c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 629/881] Revert "[nrf fromtree] dts: bindings: clock: add nordic,nrf-auxpll" This reverts commit 5b55f2e0efc9766463845ea0c14512eea23b39ea. Signed-off-by: Jukka Rissanen --- dts/bindings/clock/nordic,nrf-auxpll.yaml | 2 +- include/zephyr/dt-bindings/clock/nrf-auxpll.h | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 include/zephyr/dt-bindings/clock/nrf-auxpll.h diff --git a/dts/bindings/clock/nordic,nrf-auxpll.yaml b/dts/bindings/clock/nordic,nrf-auxpll.yaml index 9555995f0b4..6eec285f39e 100644 --- a/dts/bindings/clock/nordic,nrf-auxpll.yaml +++ b/dts/bindings/clock/nordic,nrf-auxpll.yaml @@ -43,7 +43,7 @@ properties: required: true description: | Value used to set the fractional PLL divider ratio (can be set between - divider ratios 4 to 5). Valid values shown in dt-bindings/clock/nrf-auxpll.h. + divider ratios 4 to 5). Valid values range from 0 to 65535. nordic,out-div: type: int diff --git a/include/zephyr/dt-bindings/clock/nrf-auxpll.h b/include/zephyr/dt-bindings/clock/nrf-auxpll.h deleted file mode 100644 index a07c9699759..00000000000 --- a/include/zephyr/dt-bindings/clock/nrf-auxpll.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_ - -#define NRF_AUXPLL_FREQ_DIV_MIN 0 -#define NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 15309 -#define NRF_AUXPLL_FREQ_DIV_USB24M 32768 -#define NRF_AUXPLL_FREQ_DIV_AUDIO_48K 39845 -#define NRF_AUXPLL_FREQ_DIV_MAX 65535 - -#endif /* #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_ */ From 438dedee252951fad50f8cf49bec919dab4cf92d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 630/881] Revert "[nrf fromtree] drivers: clock_control: Introduce bl60x clock driver" This reverts commit f06d47ec54bffb50b5e47ac5f33256926f88c01d. Signed-off-by: Jukka Rissanen --- drivers/clock_control/CMakeLists.txt | 1 - drivers/clock_control/Kconfig | 2 - drivers/clock_control/Kconfig.bflb | 7 - drivers/clock_control/clock_control_bl60x.c | 913 ------------------ dts/bindings/clock/bflb,bclk.yaml | 19 - .../clock/bflb,bl60x-clock-controller.yaml | 15 - dts/bindings/clock/bflb,bl60x-pll.yaml | 20 - dts/bindings/clock/bflb,bl60x-root-clk.yaml | 23 - dts/bindings/clock/bflb,clock-controller.yaml | 8 - .../dt-bindings/clock/bflb_bl60x_clock.h | 23 - .../dt-bindings/clock/bflb_clock_common.h | 20 - 11 files changed, 1051 deletions(-) delete mode 100644 drivers/clock_control/Kconfig.bflb delete mode 100644 drivers/clock_control/clock_control_bl60x.c delete mode 100644 dts/bindings/clock/bflb,bclk.yaml delete mode 100644 dts/bindings/clock/bflb,bl60x-clock-controller.yaml delete mode 100644 dts/bindings/clock/bflb,bl60x-pll.yaml delete mode 100644 dts/bindings/clock/bflb,bl60x-root-clk.yaml delete mode 100644 dts/bindings/clock/bflb,clock-controller.yaml delete mode 100644 include/zephyr/dt-bindings/clock/bflb_bl60x_clock.h delete mode 100644 include/zephyr/dt-bindings/clock/bflb_clock_common.h diff --git a/drivers/clock_control/CMakeLists.txt b/drivers/clock_control/CMakeLists.txt index 9acbda0e5dd..b1dbe191197 100644 --- a/drivers/clock_control/CMakeLists.txt +++ b/drivers/clock_control/CMakeLists.txt @@ -54,7 +54,6 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_FLL16M clock_cont zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF54H_HFXO clock_control_nrf54h_hfxo.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL clock_control_nrf_hsfll_local.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_LFCLK clock_control_nrf_lfclk.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_BOUFFALOLAB_BL60X clock_control_bl60x.c) if(CONFIG_CLOCK_CONTROL_RENESAS_RZA2M_CPG) zephyr_library_sources(clock_control_renesas_rza2m_cpg.c) diff --git a/drivers/clock_control/Kconfig b/drivers/clock_control/Kconfig index 82fa462ee71..f528aa2dad3 100644 --- a/drivers/clock_control/Kconfig +++ b/drivers/clock_control/Kconfig @@ -32,8 +32,6 @@ source "drivers/clock_control/Kconfig.stm32" source "drivers/clock_control/Kconfig.beetle" -source "drivers/clock_control/Kconfig.bflb" - source "drivers/clock_control/Kconfig.fixed" source "drivers/clock_control/Kconfig.lpc11u6x" diff --git a/drivers/clock_control/Kconfig.bflb b/drivers/clock_control/Kconfig.bflb deleted file mode 100644 index dd89dbdf4f8..00000000000 --- a/drivers/clock_control/Kconfig.bflb +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) -# SPDX-License-Identifier: Apache-2.0 - -config CLOCK_CONTROL_BOUFFALOLAB_BL60X - bool "Bouffalolab BL60x Clock Control" - default y - depends on DT_HAS_BFLB_BL60X_CLOCK_CONTROLLER_ENABLED diff --git a/drivers/clock_control/clock_control_bl60x.c b/drivers/clock_control/clock_control_bl60x.c deleted file mode 100644 index eb81b04eec8..00000000000 --- a/drivers/clock_control/clock_control_bl60x.c +++ /dev/null @@ -1,913 +0,0 @@ -/* - * Copyright (c) 2025 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT bflb_bl60x_clock_controller - -#include -#include -#include -#include -#include -#include -LOG_MODULE_REGISTER(clock_control_bl60x, CONFIG_CLOCK_CONTROL_LOG_LEVEL); - -#include -#include -#include -#include -#include -#include -#include - -#define CLK_SRC_IS(clk, src) \ - DT_SAME_NODE(DT_CLOCKS_CTLR_BY_IDX(DT_INST_CLOCKS_CTLR_BY_NAME(0, clk), 0), \ - DT_INST_CLOCKS_CTLR_BY_NAME(0, src)) - -#define CLOCK_TIMEOUT 1024 -#define EFUSE_RC32M_TRIM_OFFSET 0x0C -#define EFUSE_RC32M_TRIM_EN_POS 19 -#define EFUSE_RC32M_TRIM_PARITY_POS 18 -#define EFUSE_RC32M_TRIM_POS 10 -#define EFUSE_RC32M_TRIM_MSK 0x3FC00 - -#define CRYSTAL_ID_FREQ_32000000 0 -#define CRYSTAL_ID_FREQ_24000000 1 -#define CRYSTAL_ID_FREQ_38400000 2 -#define CRYSTAL_ID_FREQ_40000000 3 -#define CRYSTAL_ID_FREQ_26000000 4 - -#define CRYSTAL_FREQ_TO_ID(freq) CONCAT(CRYSTAL_ID_FREQ_, freq) - -enum bl60x_clkid { - bl60x_clkid_clk_root = BL60X_CLKID_CLK_ROOT, - bl60x_clkid_clk_rc32m = BL60X_CLKID_CLK_RC32M, - bl60x_clkid_clk_crystal = BL60X_CLKID_CLK_CRYSTAL, - bl60x_clkid_clk_pll = BL60X_CLKID_CLK_PLL, - bl60x_clkid_clk_bclk = BL60X_CLKID_CLK_BCLK, -}; - -struct clock_control_bl60x_pll_config { - enum bl60x_clkid source; - bool overclock; -}; - -struct clock_control_bl60x_root_config { - enum bl60x_clkid source; - uint8_t pll_select; - uint8_t divider; -}; - -struct clock_control_bl60x_bclk_config { - uint8_t divider; -}; - -struct clock_control_bl60x_config { - uint32_t crystal_id; -}; - -struct clock_control_bl60x_data { - bool crystal_enabled; - bool pll_enabled; - struct clock_control_bl60x_pll_config pll; - struct clock_control_bl60x_root_config root; - struct clock_control_bl60x_bclk_config bclk; -}; - -const static uint32_t clock_control_bl60x_crystal_SDMIN_table[5] = { - /* 32M */ - 0x3C0000, - /* 24M */ - 0x500000, - /* 38.4M */ - 0x320000, - /* 40M */ - 0x300000, - /* 26M */ - 0x49D39D, -}; - -static inline void clock_control_bl60x_clock_settle(void) -{ - __asm__ volatile(".rept 15 ; nop ; .endr"); -} - -/* 32 Mhz Oscillator: 0 - * crystal: 1 - * PLL and 32M: 2 - * PLL and crystal: 3 - */ -static void clock_control_bl60x_set_root_clock(uint32_t clock) -{ - uint32_t tmp; - - /* invalid value, fallback to internal 32M */ - if (clock > 3) { - clock = 0; - } - tmp = sys_read32(HBN_BASE + HBN_GLB_OFFSET); - tmp = (tmp & HBN_ROOT_CLK_SEL_UMSK) | (clock << HBN_ROOT_CLK_SEL_POS); - sys_write32(tmp, HBN_BASE + HBN_GLB_OFFSET); - - clock_control_bl60x_clock_settle(); -} - -static uint32_t clock_control_bl60x_get_root_clock(void) -{ - uint32_t tmp; - - tmp = sys_read32(HBN_BASE + HBN_GLB_OFFSET); - return (((tmp & HBN_ROOT_CLK_SEL_MSK) >> HBN_ROOT_CLK_SEL_POS) & 0x3); -} - -static int clock_control_bl60x_deinit_crystal(void) -{ - uint32_t tmp; - - /* unpower crystal */ - tmp = sys_read32(AON_BASE + AON_RF_TOP_AON_OFFSET); - tmp = tmp & AON_PU_XTAL_AON_UMSK; - tmp = tmp & AON_PU_XTAL_BUF_AON_UMSK; - sys_write32(tmp, AON_BASE + AON_RF_TOP_AON_OFFSET); - - clock_control_bl60x_clock_settle(); - return 0; -} - -static int clock_control_bl60x_init_crystal(void) -{ - uint32_t tmp; - int count = CLOCK_TIMEOUT; - - /* power crystal */ - tmp = sys_read32(AON_BASE + AON_RF_TOP_AON_OFFSET); - tmp = (tmp & AON_PU_XTAL_AON_UMSK) | (1U << AON_PU_XTAL_AON_POS); - tmp = (tmp & AON_PU_XTAL_BUF_AON_UMSK) | (1U << AON_PU_XTAL_BUF_AON_POS); - sys_write32(tmp, AON_BASE + AON_RF_TOP_AON_OFFSET); - - /* wait for crystal to be powered on */ - do { - clock_control_bl60x_clock_settle(); - tmp = sys_read32(AON_BASE + AON_TSEN_OFFSET); - count--; - } while (!(tmp & AON_XTAL_RDY_MSK) && count > 0); - - clock_control_bl60x_clock_settle(); - if (count < 1) { - return -1; - } - return 0; -} - -/* HCLK is the core clock */ -static int clock_control_bl60x_set_root_clock_dividers(uint32_t hclk_div, uint32_t bclk_div) -{ - uint32_t tmp; - uint32_t old_rootclk; - - old_rootclk = clock_control_bl60x_get_root_clock(); - - /* security RC32M */ - if (old_rootclk > 1) { - clock_control_bl60x_set_root_clock(0); - } - - /* set dividers */ - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG0_OFFSET); - tmp = (tmp & GLB_REG_HCLK_DIV_UMSK) | (hclk_div << GLB_REG_HCLK_DIV_POS); - tmp = (tmp & GLB_REG_BCLK_DIV_UMSK) | (bclk_div << GLB_REG_BCLK_DIV_POS); - sys_write32(tmp, GLB_BASE + GLB_CLK_CFG0_OFFSET); - - /* do something undocumented, probably acknowledging clock change by disabling then - * reenabling bclk - */ - sys_write32(0x00000001, 0x40000FFC); - sys_write32(0x00000000, 0x40000FFC); - - clock_control_bl60x_clock_settle(); - - /* enable clocks */ - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG0_OFFSET); - tmp = (tmp & GLB_REG_BCLK_EN_UMSK) | (1U << GLB_REG_BCLK_EN_POS); - tmp = (tmp & GLB_REG_HCLK_EN_UMSK) | (1U << GLB_REG_HCLK_EN_POS); - sys_write32(tmp, GLB_BASE + GLB_CLK_CFG0_OFFSET); - - clock_control_bl60x_set_root_clock(old_rootclk); - clock_control_bl60x_clock_settle(); - - return 0; -} - -static void clock_control_bl60x_set_machine_timer_clock_enable(bool enable) -{ - uint32_t tmp; - - tmp = sys_read32(GLB_BASE + GLB_CPU_CLK_CFG_OFFSET); - if (enable) { - tmp = (tmp & GLB_CPU_RTC_EN_UMSK) | (1U << GLB_CPU_RTC_EN_POS); - } else { - tmp = (tmp & GLB_CPU_RTC_EN_UMSK) | (0U << GLB_CPU_RTC_EN_POS); - } - sys_write32(tmp, GLB_BASE + GLB_CPU_CLK_CFG_OFFSET); -} - -/* clock: - * 0: BCLK - * 1: 32Khz Oscillator (RC32*K*) - */ -static void clock_control_bl60x_set_machine_timer_clock(bool enable, uint32_t clock, - uint32_t divider) -{ - uint32_t tmp; - - if (divider > 0x1FFFF) { - divider = 0x1FFFF; - } - if (clock > 1) { - clock = 1; - } - - /* disable first, then set div */ - clock_control_bl60x_set_machine_timer_clock_enable(false); - - tmp = sys_read32(GLB_BASE + GLB_CPU_CLK_CFG_OFFSET); - tmp = (tmp & GLB_CPU_RTC_SEL_UMSK) | (clock << GLB_CPU_RTC_SEL_POS); - tmp = (tmp & GLB_CPU_RTC_DIV_UMSK) | (divider << GLB_CPU_RTC_DIV_POS); - sys_write32(tmp, GLB_BASE + GLB_CPU_CLK_CFG_OFFSET); - - clock_control_bl60x_set_machine_timer_clock_enable(enable); -} - -static void clock_control_bl60x_deinit_pll(void) -{ - uint32_t tmp; - - /* PLL Off */ - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_PU_CLKPLL_SFREG_UMSK) | (0U << PDS_PU_CLKPLL_SFREG_POS); - tmp = (tmp & PDS_PU_CLKPLL_UMSK) | (0U << PDS_PU_CLKPLL_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - - /* needs 2 steps ? */ - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_CLKPLL_PU_CP_UMSK) | (0U << PDS_CLKPLL_PU_CP_POS); - tmp = (tmp & PDS_CLKPLL_PU_PFD_UMSK) | (0U << PDS_CLKPLL_PU_PFD_POS); - tmp = (tmp & PDS_CLKPLL_PU_FBDV_UMSK) | (0U << PDS_CLKPLL_PU_FBDV_POS); - tmp = (tmp & PDS_CLKPLL_PU_POSTDIV_UMSK) | (0U << PDS_CLKPLL_PU_POSTDIV_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); -} - -/* RC32M : 0 - * XTAL : 1 - */ -static void clock_control_bl60x_set_pll_source(uint32_t source) -{ - uint32_t tmp; - - tmp = sys_read32(PDS_BASE + PDS_CLKPLL_TOP_CTRL_OFFSET); - if (source > 0) { - tmp = (tmp & PDS_CLKPLL_REFCLK_SEL_UMSK) | (1U << PDS_CLKPLL_REFCLK_SEL_POS); - tmp = (tmp & PDS_CLKPLL_XTAL_RC32M_SEL_UMSK) | - (0U << PDS_CLKPLL_XTAL_RC32M_SEL_POS); - } else { - tmp = (tmp & PDS_CLKPLL_REFCLK_SEL_UMSK) | (0U << PDS_CLKPLL_REFCLK_SEL_POS); - tmp = (tmp & PDS_CLKPLL_XTAL_RC32M_SEL_UMSK) | - (1U << PDS_CLKPLL_XTAL_RC32M_SEL_POS); - } - sys_write32(tmp, PDS_BASE + PDS_CLKPLL_TOP_CTRL_OFFSET); -} - -static void clock_control_bl60x_init_pll(enum bl60x_clkid source, uint32_t crystal_id) -{ - uint32_t tmp; - uint32_t old_rootclk; - - old_rootclk = clock_control_bl60x_get_root_clock(); - - /* security RC32M */ - if (old_rootclk > 1) { - clock_control_bl60x_set_root_clock(0); - } - - clock_control_bl60x_deinit_pll(); - - if (source == BL60X_CLKID_CLK_CRYSTAL) { - clock_control_bl60x_set_pll_source(1); - } else { - clock_control_bl60x_set_pll_source(0); - } - - /* 26M special treatment */ - tmp = sys_read32(PDS_BASE + PDS_CLKPLL_CP_OFFSET); - if (crystal_id == CRYSTAL_ID_FREQ_26000000) { - tmp = (tmp & PDS_CLKPLL_ICP_1U_UMSK) | (1U << PDS_CLKPLL_ICP_1U_POS); - tmp = (tmp & PDS_CLKPLL_ICP_5U_UMSK) | (0U << PDS_CLKPLL_ICP_5U_POS); - tmp = (tmp & PDS_CLKPLL_INT_FRAC_SW_UMSK) | (1U << PDS_CLKPLL_INT_FRAC_SW_POS); - } else { - tmp = (tmp & PDS_CLKPLL_ICP_1U_UMSK) | (0U << PDS_CLKPLL_ICP_1U_POS); - tmp = (tmp & PDS_CLKPLL_ICP_5U_UMSK) | (2U << PDS_CLKPLL_ICP_5U_POS); - tmp = (tmp & PDS_CLKPLL_INT_FRAC_SW_UMSK) | (0U << PDS_CLKPLL_INT_FRAC_SW_POS); - } - sys_write32(tmp, PDS_BASE + PDS_CLKPLL_CP_OFFSET); - - /* More 26M special treatment */ - tmp = sys_read32(PDS_BASE + PDS_CLKPLL_RZ_OFFSET); - if (crystal_id == CRYSTAL_ID_FREQ_26000000) { - tmp = (tmp & PDS_CLKPLL_C3_UMSK) | (2U << PDS_CLKPLL_C3_POS); - tmp = (tmp & PDS_CLKPLL_CZ_UMSK) | (2U << PDS_CLKPLL_CZ_POS); - tmp = (tmp & PDS_CLKPLL_RZ_UMSK) | (5U << PDS_CLKPLL_RZ_POS); - tmp = (tmp & PDS_CLKPLL_R4_SHORT_UMSK) | (0U << PDS_CLKPLL_R4_SHORT_POS); - } else { - tmp = (tmp & PDS_CLKPLL_C3_UMSK) | (3U << PDS_CLKPLL_C3_POS); - tmp = (tmp & PDS_CLKPLL_CZ_UMSK) | (1U << PDS_CLKPLL_CZ_POS); - tmp = (tmp & PDS_CLKPLL_RZ_UMSK) | (1U << PDS_CLKPLL_RZ_POS); - tmp = (tmp & PDS_CLKPLL_R4_SHORT_UMSK) | (1U << PDS_CLKPLL_R4_SHORT_POS); - } - tmp = (tmp & PDS_CLKPLL_R4_UMSK) | (2U << PDS_CLKPLL_R4_POS); - sys_write32(tmp, PDS_BASE + PDS_CLKPLL_RZ_OFFSET); - - /* set pll dividers */ - tmp = sys_read32(PDS_BASE + PDS_CLKPLL_TOP_CTRL_OFFSET); - tmp = (tmp & PDS_CLKPLL_POSTDIV_UMSK) | ((uint32_t)(0x14) << PDS_CLKPLL_POSTDIV_POS); - tmp = (tmp & PDS_CLKPLL_REFDIV_RATIO_UMSK) | (2U << PDS_CLKPLL_REFDIV_RATIO_POS); - sys_write32(tmp, PDS_BASE + PDS_CLKPLL_TOP_CTRL_OFFSET); - - /* set SDMIN */ - tmp = sys_read32(PDS_BASE + PDS_CLKPLL_SDM_OFFSET); - if (source == BL60X_CLKID_CLK_CRYSTAL) { - tmp = (tmp & PDS_CLKPLL_SDMIN_UMSK) | - (clock_control_bl60x_crystal_SDMIN_table[crystal_id] - << PDS_CLKPLL_SDMIN_POS); - } else { - tmp = (tmp & PDS_CLKPLL_SDMIN_UMSK) | - (clock_control_bl60x_crystal_SDMIN_table[CRYSTAL_ID_FREQ_32000000] - << PDS_CLKPLL_SDMIN_POS); - } - sys_write32(tmp, PDS_BASE + PDS_CLKPLL_SDM_OFFSET); - - /* phase comparator settings? */ - tmp = sys_read32(PDS_BASE + PDS_CLKPLL_FBDV_OFFSET); - tmp = (tmp & PDS_CLKPLL_SEL_FB_CLK_UMSK) | (1U << PDS_CLKPLL_SEL_FB_CLK_POS); - tmp = (tmp & PDS_CLKPLL_SEL_SAMPLE_CLK_UMSK) | (1U << PDS_CLKPLL_SEL_SAMPLE_CLK_POS); - sys_write32(tmp, PDS_BASE + PDS_CLKPLL_FBDV_OFFSET); - - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_PU_CLKPLL_SFREG_UMSK) | (1U << PDS_PU_CLKPLL_SFREG_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - clock_control_bl60x_clock_settle(); - - /* enable PPL clock actual? */ - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_PU_CLKPLL_UMSK) | (1U << PDS_PU_CLKPLL_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - - /* More power up sequencing*/ - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_CLKPLL_PU_CP_UMSK) | (1U << PDS_CLKPLL_PU_CP_POS); - tmp = (tmp & PDS_CLKPLL_PU_PFD_UMSK) | (1U << PDS_CLKPLL_PU_PFD_POS); - tmp = (tmp & PDS_CLKPLL_PU_FBDV_UMSK) | (1U << PDS_CLKPLL_PU_FBDV_POS); - tmp = (tmp & PDS_CLKPLL_PU_POSTDIV_UMSK) | (1U << PDS_CLKPLL_PU_POSTDIV_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - - clock_control_bl60x_clock_settle(); - - /* reset couple things one by one? */ - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_CLKPLL_SDM_RESET_UMSK) | (1U << PDS_CLKPLL_SDM_RESET_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_CLKPLL_RESET_FBDV_UMSK) | (1U << PDS_CLKPLL_RESET_FBDV_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_CLKPLL_RESET_FBDV_UMSK) | (0U << PDS_CLKPLL_RESET_FBDV_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - - tmp = sys_read32(PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - tmp = (tmp & PDS_CLKPLL_SDM_RESET_UMSK) | (0U << PDS_CLKPLL_SDM_RESET_POS); - sys_write32(tmp, PDS_BASE + PDS_PU_RST_CLKPLL_OFFSET); - - clock_control_bl60x_set_root_clock(old_rootclk); - clock_control_bl60x_clock_settle(); -} - -/* - * 0: 48M - * 1: 120M - * 2: 160M - * 3: 192M - */ -static void clock_control_bl60x_select_PLL(uint8_t pll) -{ - uint32_t tmp; - - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG0_OFFSET); - tmp = (tmp & GLB_REG_PLL_SEL_UMSK) | (pll << GLB_REG_PLL_SEL_POS); - sys_write32(tmp, GLB_BASE + GLB_CLK_CFG0_OFFSET); -} - -static int clock_control_bl60x_clock_trim_32M(void) -{ - uint32_t tmp; - int err; - uint32_t trim, trim_parity; - const struct device *efuse = DEVICE_DT_GET_ONE(bflb_efuse); - - err = syscon_read_reg(efuse, EFUSE_RC32M_TRIM_OFFSET, &trim); - if (err < 0) { - LOG_ERR("Error: Couldn't read efuses: err: %d.\n", err); - return err; - } - if (!((trim >> EFUSE_RC32M_TRIM_EN_POS) & 1)) { - LOG_ERR("RC32M trim disabled!"); - return -EINVAL; - } - - trim_parity = (trim >> EFUSE_RC32M_TRIM_PARITY_POS) & 1; - trim = (trim & EFUSE_RC32M_TRIM_MSK) >> EFUSE_RC32M_TRIM_POS; - - if (trim_parity != (POPCOUNT(trim) & 1)) { - LOG_ERR("Bad trim parity"); - return -EINVAL; - } - - tmp = sys_read32(PDS_BASE + PDS_RC32M_CTRL0_OFFSET); - tmp = (tmp & PDS_RC32M_EXT_CODE_EN_UMSK) | 1 << PDS_RC32M_EXT_CODE_EN_POS; - tmp = (tmp & PDS_RC32M_CODE_FR_EXT_UMSK) | trim << PDS_RC32M_CODE_FR_EXT_POS; - sys_write32(tmp, PDS_BASE + PDS_RC32M_CTRL0_OFFSET); - - clock_control_bl60x_clock_settle(); - - return 0; -} - -/* source for most clocks, either XTAL or RC32M */ -static uint32_t clock_control_bl60x_get_xclk(const struct device *dev) -{ - uint32_t tmp; - - tmp = sys_read32(HBN_BASE + HBN_GLB_OFFSET); - tmp &= HBN_ROOT_CLK_SEL_MSK; - tmp = tmp >> HBN_ROOT_CLK_SEL_POS; - tmp &= 1; - if (tmp == 0) { - return BFLB_RC32M_FREQUENCY; - } else if (tmp == 1) { - return DT_PROP(DT_INST_CLOCKS_CTLR_BY_NAME(0, crystal), clock_frequency); - } else { - return 0; - } -} - -static uint32_t clock_control_bl60x_get_clk(const struct device *dev) -{ - uint32_t tmp; - uint32_t hclk_div; - - hclk_div = sys_read32(GLB_BASE + GLB_CLK_CFG0_OFFSET); - hclk_div = (hclk_div & GLB_REG_HCLK_DIV_MSK) >> GLB_REG_HCLK_DIV_POS; - - tmp = sys_read32(HBN_BASE + HBN_GLB_OFFSET); - tmp &= HBN_ROOT_CLK_SEL_MSK; - tmp = (tmp >> HBN_ROOT_CLK_SEL_POS) >> 1; - tmp &= 1; - - if (tmp == 0) { - return clock_control_bl60x_get_xclk(dev) / (hclk_div + 1); - } - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG0_OFFSET); - tmp = (tmp & GLB_REG_PLL_SEL_MSK) >> GLB_REG_PLL_SEL_POS; - if (tmp == 3) { - return MHZ(192) / (hclk_div + 1); - } else if (tmp == 2) { - return MHZ(160) / (hclk_div + 1); - } else if (tmp == 1) { - return MHZ(120) / (hclk_div + 1); - } else if (tmp == 0) { - return MHZ(48) / (hclk_div + 1); - } - return 0; -} - -/* most peripherals clock */ -static uint32_t clock_control_bl60x_get_bclk(const struct device *dev) -{ - uint32_t tmp; - uint32_t clock_id; - - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG0_OFFSET); - tmp = (tmp & GLB_REG_BCLK_DIV_MSK) >> GLB_REG_BCLK_DIV_POS; - clock_id = clock_control_bl60x_get_clk(dev); - return clock_id / (tmp + 1); -} - -static uint32_t clock_control_bl60x_mtimer_get_clk_src_div(const struct device *dev) -{ - return clock_control_bl60x_get_bclk(dev) / 1000 / 1000 - 1; -} - -static void clock_control_bl60x_cache_2T(bool yes) -{ - uint32_t tmp; - - tmp = sys_read32(L1C_BASE + L1C_CONFIG_OFFSET); - - if (yes) { - tmp |= L1C_IROM_2T_ACCESS_MSK; - } else { - tmp &= ~L1C_IROM_2T_ACCESS_MSK; - } - - sys_write32(tmp, L1C_BASE + L1C_CONFIG_OFFSET); -} - -/* HCLK: 0 - * PLL120M: 1 - */ -static void clock_control_bl60x_set_PKA_clock(uint32_t pka_clock) -{ - uint32_t tmp; - - tmp = sys_read32(GLB_BASE + GLB_SWRST_CFG2_OFFSET); - tmp = (tmp & GLB_PKA_CLK_SEL_UMSK) | (pka_clock << GLB_PKA_CLK_SEL_POS); - sys_write32(tmp, GLB_BASE + GLB_SWRST_CFG2_OFFSET); -} - -static void clock_control_bl60x_init_root_as_pll(const struct device *dev) -{ - struct clock_control_bl60x_data *data = dev->data; - const struct clock_control_bl60x_config *config = dev->config; - uint32_t tmp; - - clock_control_bl60x_init_pll(data->pll.source, config->crystal_id); - - /* enable all 'PDS' clocks */ - tmp = sys_read32(PDS_BASE + PDS_CLKPLL_OUTPUT_EN_OFFSET); - tmp |= 0x1FF; - sys_write32(tmp, PDS_BASE + PDS_CLKPLL_OUTPUT_EN_OFFSET); - - /* glb enable pll actual? */ - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG0_OFFSET); - tmp = (tmp & GLB_REG_PLL_EN_UMSK) | (1U << GLB_REG_PLL_EN_POS); - sys_write32(tmp, GLB_BASE + GLB_CLK_CFG0_OFFSET); - - clock_control_bl60x_select_PLL(data->root.pll_select); - - if (data->pll.source == bl60x_clkid_clk_crystal) { - clock_control_bl60x_set_root_clock(3); - } else { - clock_control_bl60x_set_root_clock(2); - } - - if (clock_control_bl60x_get_clk(dev) > MHZ(120)) { - clock_control_bl60x_cache_2T(true); - } - - sys_write32(clock_control_bl60x_get_clk(dev), CORECLOCKREGISTER); - clock_control_bl60x_set_PKA_clock(1); -} - -static void clock_control_bl60x_init_root_as_crystal(const struct device *dev) -{ - clock_control_bl60x_set_root_clock(1); - sys_write32(clock_control_bl60x_get_clk(dev), CORECLOCKREGISTER); -} - -static int clock_control_bl60x_update_root(const struct device *dev) -{ - struct clock_control_bl60x_data *data = dev->data; - uint32_t tmp; - int ret; - - /* make sure all clocks are enabled */ - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG0_OFFSET); - tmp = (tmp & GLB_REG_BCLK_EN_UMSK) | (1U << GLB_REG_BCLK_EN_POS); - tmp = (tmp & GLB_REG_HCLK_EN_UMSK) | (1U << GLB_REG_HCLK_EN_POS); - tmp = (tmp & GLB_REG_FCLK_EN_UMSK) | (1U << GLB_REG_FCLK_EN_POS); - sys_write32(tmp, GLB_BASE + GLB_CLK_CFG0_OFFSET); - - /* set root clock to internal 32MHz Oscillator as failsafe */ - clock_control_bl60x_set_root_clock(0); - if (clock_control_bl60x_set_root_clock_dividers(0, 0) != 0) { - return -EIO; - } - sys_write32(BFLB_RC32M_FREQUENCY, CORECLOCKREGISTER); - - clock_control_bl60x_set_PKA_clock(0); - - if (data->crystal_enabled) { - if (clock_control_bl60x_init_crystal() < 0) { - return -EIO; - } - } else { - clock_control_bl60x_deinit_crystal(); - } - - ret = clock_control_bl60x_set_root_clock_dividers(data->root.divider - 1, - data->bclk.divider - 1); - if (ret < 0) { - return ret; - } - - if (data->root.source == bl60x_clkid_clk_pll) { - clock_control_bl60x_init_root_as_pll(dev); - } else if (data->root.source == bl60x_clkid_clk_crystal) { - clock_control_bl60x_init_root_as_crystal(dev); - } else { - /* Root clock already setup as RC32M */ - } - - ret = clock_control_bl60x_clock_trim_32M(); - if (ret < 0) { - return ret; - } - clock_control_bl60x_set_machine_timer_clock( - 1, 0, clock_control_bl60x_mtimer_get_clk_src_div(dev)); - - clock_control_bl60x_clock_settle(); - - return ret; -} - -static void clock_control_bl60x_uart_set_clock_enable(bool enable) -{ - uint32_t tmp; - - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG2_OFFSET); - if (enable) { - tmp = (tmp & GLB_UART_CLK_EN_UMSK) | (1U << GLB_UART_CLK_EN_POS); - } else { - tmp = (tmp & GLB_UART_CLK_EN_UMSK) | (0U << GLB_UART_CLK_EN_POS); - } - sys_write32(tmp, GLB_BASE + GLB_CLK_CFG2_OFFSET); -} - -/* Clock: - * FCLK: 0 - * 160 Mhz PLL: 1 - * When using PLL root clock, we can use either setting, when using the 32Mhz Oscillator with a - * uninitialized PLL, only FCLK will be available. - */ -static void clock_control_bl60x_uart_set_clock(bool enable, uint32_t clock, uint32_t divider) -{ - uint32_t tmp; - - if (divider > 0x7) { - divider = 0x7; - } - if (clock > 1) { - clock = 1; - } - /* disable uart clock */ - clock_control_bl60x_uart_set_clock_enable(false); - - tmp = sys_read32(GLB_BASE + GLB_CLK_CFG2_OFFSET); - tmp = (tmp & GLB_UART_CLK_DIV_UMSK) | (divider << GLB_UART_CLK_DIV_POS); - sys_write32(tmp, GLB_BASE + GLB_CLK_CFG2_OFFSET); - - tmp = sys_read32(HBN_BASE + HBN_GLB_OFFSET); - tmp = (tmp & HBN_UART_CLK_SEL_UMSK) | (clock << HBN_UART_CLK_SEL_POS); - sys_write32(tmp, HBN_BASE + HBN_GLB_OFFSET); - - clock_control_bl60x_uart_set_clock_enable(enable); -} - -/* Simple function to enable all peripherals for now */ -static void clock_control_bl60x_peripheral_clock_init(void) -{ - uint32_t regval = sys_read32(GLB_BASE + GLB_CGEN_CFG1_OFFSET); - - /* enable ADC clock routing */ - regval |= (1 << 2); - /* enable UART0 clock routing */ - regval |= (1 << 16); - /* enable I2C0 clock routing */ - regval |= (1 << 19); - - sys_write32(regval, GLB_BASE + GLB_CGEN_CFG1_OFFSET); - - clock_control_bl60x_uart_set_clock(1, 0, 0); -} - -static int clock_control_bl60x_on(const struct device *dev, clock_control_subsys_t sys) -{ - struct clock_control_bl60x_data *data = dev->data; - int ret = -EINVAL; - uint32_t key; - enum bl60x_clkid oldroot; - - key = irq_lock(); - - if ((enum bl60x_clkid)sys == bl60x_clkid_clk_crystal) { - if (data->crystal_enabled) { - ret = 0; - } else { - data->crystal_enabled = true; - ret = clock_control_bl60x_update_root(dev); - if (ret < 0) { - data->crystal_enabled = false; - } - } - } else if ((enum bl60x_clkid)sys == bl60x_clkid_clk_pll) { - if (data->pll_enabled) { - ret = 0; - } else { - data->pll_enabled = true; - ret = clock_control_bl60x_update_root(dev); - if (ret < 0) { - data->pll_enabled = false; - } - } - } else if ((int)sys == BFLB_FORCE_ROOT_RC32M) { - if (data->root.source == bl60x_clkid_clk_rc32m) { - ret = 0; - } else { - /* Cannot fail to set root to rc32m */ - data->root.source = bl60x_clkid_clk_rc32m; - ret = clock_control_bl60x_update_root(dev); - } - } else if ((int)sys == BFLB_FORCE_ROOT_CRYSTAL) { - if (data->root.source == bl60x_clkid_clk_crystal) { - ret = 0; - } else { - oldroot = data->root.source; - data->root.source = bl60x_clkid_clk_crystal; - ret = clock_control_bl60x_update_root(dev); - if (ret < 0) { - data->root.source = oldroot; - } - } - } else if ((int)sys == BFLB_FORCE_ROOT_PLL) { - if (data->root.source == bl60x_clkid_clk_pll) { - ret = 0; - } else { - oldroot = data->root.source; - data->root.source = bl60x_clkid_clk_pll; - ret = clock_control_bl60x_update_root(dev); - if (ret < 0) { - data->root.source = oldroot; - } - } - } - - irq_unlock(key); - return ret; -} - -static int clock_control_bl60x_off(const struct device *dev, clock_control_subsys_t sys) -{ - struct clock_control_bl60x_data *data = dev->data; - int ret = -EINVAL; - uint32_t key; - - key = irq_lock(); - - if ((enum bl60x_clkid)sys == bl60x_clkid_clk_crystal) { - if (!data->crystal_enabled) { - ret = 0; - } else { - data->crystal_enabled = false; - ret = clock_control_bl60x_update_root(dev); - if (ret < 0) { - data->crystal_enabled = true; - } - } - } else if ((enum bl60x_clkid)sys == bl60x_clkid_clk_pll) { - if (!data->pll_enabled) { - ret = 0; - } else { - data->pll_enabled = false; - ret = clock_control_bl60x_update_root(dev); - if (ret < 0) { - data->pll_enabled = true; - } - } - } - - irq_unlock(key); - return ret; -} - -static enum clock_control_status clock_control_bl60x_get_status(const struct device *dev, - clock_control_subsys_t sys) -{ - struct clock_control_bl60x_data *data = dev->data; - - switch ((enum bl60x_clkid)sys) { - case bl60x_clkid_clk_root: - case bl60x_clkid_clk_bclk: - case bl60x_clkid_clk_rc32m: - return CLOCK_CONTROL_STATUS_ON; - case bl60x_clkid_clk_crystal: - if (data->crystal_enabled) { - return CLOCK_CONTROL_STATUS_ON; - } - return CLOCK_CONTROL_STATUS_OFF; - case bl60x_clkid_clk_pll: - if (data->pll_enabled) { - return CLOCK_CONTROL_STATUS_ON; - } - return CLOCK_CONTROL_STATUS_OFF; - default: - return CLOCK_CONTROL_STATUS_UNKNOWN; - } -} - -static int clock_control_bl60x_get_rate(const struct device *dev, clock_control_subsys_t sys, - uint32_t *rate) -{ - if ((enum bl60x_clkid)sys == bl60x_clkid_clk_root) { - *rate = clock_control_bl60x_get_clk(dev); - } else if ((enum bl60x_clkid)sys == bl60x_clkid_clk_bclk) { - *rate = clock_control_bl60x_get_bclk(dev); - } else if ((enum bl60x_clkid)sys == bl60x_clkid_clk_crystal) { - *rate = DT_PROP(DT_INST_CLOCKS_CTLR_BY_NAME(0, crystal), clock_frequency); - } else if ((enum bl60x_clkid)sys == bl60x_clkid_clk_rc32m) { - *rate = BFLB_RC32M_FREQUENCY; - } else { - return -EINVAL; - } - return 0; -} - -static int clock_control_bl60x_init(const struct device *dev) -{ - int ret; - uint32_t key; - - key = irq_lock(); - - ret = clock_control_bl60x_update_root(dev); - if (ret < 0) { - irq_unlock(key); - return ret; - } - - clock_control_bl60x_peripheral_clock_init(); - - irq_unlock(key); - - return 0; -} - -static DEVICE_API(clock_control, clock_control_bl60x_api) = { - .on = clock_control_bl60x_on, - .off = clock_control_bl60x_off, - .get_rate = clock_control_bl60x_get_rate, - .get_status = clock_control_bl60x_get_status, -}; - -static const struct clock_control_bl60x_config clock_control_bl60x_config = { - .crystal_id = CRYSTAL_FREQ_TO_ID(DT_PROP(DT_INST_CLOCKS_CTLR_BY_NAME(0, crystal), - clock_frequency)), -}; - -static struct clock_control_bl60x_data clock_control_bl60x_data = { - .crystal_enabled = DT_NODE_HAS_STATUS_OKAY(DT_INST_CLOCKS_CTLR_BY_NAME(0, crystal)), - .pll_enabled = DT_NODE_HAS_STATUS_OKAY(DT_INST_CLOCKS_CTLR_BY_NAME(0, pll_192)), - - .root = { -#if CLK_SRC_IS(root, pll_192) - .source = bl60x_clkid_clk_pll, - .pll_select = DT_CLOCKS_CELL(DT_INST_CLOCKS_CTLR_BY_NAME(0, root), select), -#elif CLK_SRC_IS(root, crystal) - .source = bl60x_clkid_clk_crystal, -#else - .source = bl60x_clkid_clk_rc32m, -#endif - .divider = DT_PROP(DT_INST_CLOCKS_CTLR_BY_NAME(0, root), divider), - }, - - .pll = { -#if CLK_SRC_IS(pll_192, crystal) - .source = bl60x_clkid_clk_crystal, -#else - .source = bl60x_clkid_clk_rc32m, -#endif - }, - - .bclk = { - .divider = DT_PROP(DT_INST_CLOCKS_CTLR_BY_NAME(0, bclk), divider), - }, -}; - -BUILD_ASSERT(CLK_SRC_IS(pll_192, crystal) || CLK_SRC_IS(root, crystal) - ? DT_NODE_HAS_STATUS_OKAY(DT_INST_CLOCKS_CTLR_BY_NAME(0, crystal)) - : 1, - "Crystal must be enabled to use it"); - -BUILD_ASSERT(CLK_SRC_IS(root, pll_192) ? - DT_NODE_HAS_STATUS_OKAY(DT_INST_CLOCKS_CTLR_BY_NAME(0, pll_192)) : 1, - "PLL must be enabled to use it"); - -BUILD_ASSERT(DT_NODE_HAS_STATUS_OKAY(DT_INST_CLOCKS_CTLR_BY_NAME(0, rc32m)), "RC32M is always on"); - -BUILD_ASSERT(DT_PROP(DT_INST_CLOCKS_CTLR_BY_NAME(0, rc32m), clock_frequency) - == BFLB_RC32M_FREQUENCY, "RC32M must be 32M"); - -DEVICE_DT_INST_DEFINE(0, clock_control_bl60x_init, NULL, &clock_control_bl60x_data, - &clock_control_bl60x_config, PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, - &clock_control_bl60x_api); diff --git a/dts/bindings/clock/bflb,bclk.yaml b/dts/bindings/clock/bflb,bclk.yaml deleted file mode 100644 index 343c5831ed0..00000000000 --- a/dts/bindings/clock/bflb,bclk.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) -# SPDX-License-Identifier: Apache-2.0 - -description: | - The BCLK clock, or peripheral clock - Source Clock -> Root Clock -> / divider -> BCLK - -compatible: "bflb,bclk" - -include: [base.yaml, clock-controller.yaml] - -properties: - divider: - type: int - required: true - description: Divide root clock by this 8-bits value - - "#clock-cells": - const: 0 diff --git a/dts/bindings/clock/bflb,bl60x-clock-controller.yaml b/dts/bindings/clock/bflb,bl60x-clock-controller.yaml deleted file mode 100644 index a9c02425a9f..00000000000 --- a/dts/bindings/clock/bflb,bl60x-clock-controller.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) -# SPDX-License-Identifier: Apache-2.0 - -description: Bouffalolab BL60x Clock Controller - -compatible: "bflb,bl60x-clock-controller" - -include: [base.yaml, clock-controller.yaml] - -properties: - "#clock-cells": - const: 1 - -clock-cells: - - id diff --git a/dts/bindings/clock/bflb,bl60x-pll.yaml b/dts/bindings/clock/bflb,bl60x-pll.yaml deleted file mode 100644 index a1c9719ea3f..00000000000 --- a/dts/bindings/clock/bflb,bl60x-pll.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) -# SPDX-License-Identifier: Apache-2.0 - -description: The BL60x PLL - -compatible: "bflb,bl60x-pll" - -include: [base.yaml, clock-controller.yaml] - -properties: - clocks: - type: phandle-array - required: true - description: source - - "#clock-cells": - const: 1 - -clock-cells: - - select diff --git a/dts/bindings/clock/bflb,bl60x-root-clk.yaml b/dts/bindings/clock/bflb,bl60x-root-clk.yaml deleted file mode 100644 index 9e1bb7948f6..00000000000 --- a/dts/bindings/clock/bflb,bl60x-root-clk.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) -# SPDX-License-Identifier: Apache-2.0 - -description: | - The BL60x Root Clock - -compatible: "bflb,bl60x-root-clk" - -include: [base.yaml, clock-controller.yaml] - -properties: - clocks: - type: phandle-array - required: true - description: source - - divider: - type: int - required: true - description: Divide source clock by this 8-bits value. Typically 1. - - "#clock-cells": - const: 0 diff --git a/dts/bindings/clock/bflb,clock-controller.yaml b/dts/bindings/clock/bflb,clock-controller.yaml deleted file mode 100644 index c0a63a06656..00000000000 --- a/dts/bindings/clock/bflb,clock-controller.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) -# SPDX-License-Identifier: Apache-2.0 - -description: Bouffalolab Clock Controller for Drivers - -compatible: "bflb,clock-controller" - -include: [base.yaml, clock-controller.yaml] diff --git a/include/zephyr/dt-bindings/clock/bflb_bl60x_clock.h b/include/zephyr/dt-bindings/clock/bflb_bl60x_clock.h deleted file mode 100644 index a08db84b082..00000000000 --- a/include/zephyr/dt-bindings/clock/bflb_bl60x_clock.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_BFLB_BL60X_CLOCK_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_BFLB_BL60X_CLOCK_H_ - -#include "bflb_clock_common.h" - -#define BL60X_CLKID_CLK_ROOT BFLB_CLKID_CLK_ROOT -#define BL60X_CLKID_CLK_RC32M BFLB_CLKID_CLK_RC32M -#define BL60X_CLKID_CLK_CRYSTAL BFLB_CLKID_CLK_CRYSTAL -#define BL60X_CLKID_CLK_BCLK BFLB_CLKID_CLK_BCLK -#define BL60X_CLKID_CLK_PLL 4 - -#define BL60X_PLL_48MHz 0 -#define BL60X_PLL_120MHz 1 -#define BL60X_PLL_160MHz 2 -#define BL60X_PLL_192MHz 3 - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_BFLB_BL60X_CLOCK_H_ */ diff --git a/include/zephyr/dt-bindings/clock/bflb_clock_common.h b/include/zephyr/dt-bindings/clock/bflb_clock_common.h deleted file mode 100644 index 203bac3d434..00000000000 --- a/include/zephyr/dt-bindings/clock/bflb_clock_common.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_BFLB_CLOCK_COMMON_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_BFLB_CLOCK_COMMON_H_ - -#define BFLB_CLKID_CLK_ROOT 0 -#define BFLB_CLKID_CLK_RC32M 1 -#define BFLB_CLKID_CLK_CRYSTAL 2 -#define BFLB_CLKID_CLK_BCLK 3 - -#define BFLB_FORCE_ROOT_RC32M 10 -#define BFLB_FORCE_ROOT_CRYSTAL 11 -#define BFLB_FORCE_ROOT_PLL 12 - -#define BFLB_RC32M_FREQUENCY 32000000 - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_BFLB_CLOCK_COMMON_H_ */ From 190f00d294bced4c393fa8b1727affc18de8e208 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 631/881] Revert "[nrf fromtree] tests: drivers: i2c: target_api: extend nrf overlays with bus gpios" This reverts commit 9c2f8a63dfe3768ab9ce230d1ccf1a89ae902b58. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 9390af2b5cd..2fc033d534a 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -9,23 +9,6 @@ * SCL = P1.2 and P1.3 */ -/ { - zephyr,user { - sda0-gpios = <&gpio2 8 0>; - scl0-gpios = <&gpio1 2 0>; - sda1-gpios = <&gpio2 9 0>; - scl1-gpios = <&gpio1 3 0>; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - &pinctrl { i2c130_default: i2c130_default { group1 { From 57985d945b8e259515e2b17e8e25ac96822a6616 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 632/881] Revert "[nrf fromtree] tests: drivers: i2c: target_api: add device_deinit test case" This reverts commit a6a50c344e61ba4ae47af2be7e8ae882b9ad93d0. Signed-off-by: Jukka Rissanen --- tests/drivers/i2c/i2c_target_api/src/main.c | 57 --------------------- 1 file changed, 57 deletions(-) diff --git a/tests/drivers/i2c/i2c_target_api/src/main.c b/tests/drivers/i2c/i2c_target_api/src/main.c index b249daae90b..5c1540e3e79 100644 --- a/tests/drivers/i2c/i2c_target_api/src/main.c +++ b/tests/drivers/i2c/i2c_target_api/src/main.c @@ -16,7 +16,6 @@ #include #include -#include #include @@ -167,62 +166,6 @@ static int run_program_read(const struct device *i2c, uint8_t addr, return 0; } -ZTEST(i2c_eeprom_target, test_deinit) -{ - const struct device *const i2c_0 = DEVICE_DT_GET(DT_BUS(NODE_EP0)); - const struct device *const i2c_1 = DEVICE_DT_GET(DT_BUS(NODE_EP1)); - const struct gpio_dt_spec sda_pin_0 = - GPIO_DT_SPEC_GET_OR(DT_PATH(zephyr_user), sda0_gpios, {}); - const struct gpio_dt_spec scl_pin_0 = - GPIO_DT_SPEC_GET_OR(DT_PATH(zephyr_user), scl0_gpios, {}); - const struct gpio_dt_spec sda_pin_1 = - GPIO_DT_SPEC_GET_OR(DT_PATH(zephyr_user), sda1_gpios, {}); - const struct gpio_dt_spec scl_pin_1 = - GPIO_DT_SPEC_GET_OR(DT_PATH(zephyr_user), scl1_gpios, {}); - int ret; - - if (i2c_0 == i2c_1) { - TC_PRINT(" gpio loopback required for test\n"); - ztest_test_skip(); - } - - if (scl_pin_0.port == NULL || sda_pin_0.port == NULL || - scl_pin_1.port == NULL || sda_pin_1.port == NULL) { - TC_PRINT(" bus gpios not specified in zephyr,path\n"); - ztest_test_skip(); - } - - ret = device_deinit(i2c_0); - if (ret == -ENOTSUP) { - TC_PRINT(" device deinit not supported\n"); - ztest_test_skip(); - } - - zassert_ok(ret); - - ret = device_deinit(i2c_1); - if (ret == -ENOTSUP) { - TC_PRINT(" device deinit not supported\n"); - zassert_ok(device_init(i2c_0)); - ztest_test_skip(); - } - - zassert_ok(gpio_pin_configure_dt(&sda_pin_0, GPIO_INPUT)); - zassert_ok(gpio_pin_configure_dt(&sda_pin_1, GPIO_OUTPUT_INACTIVE)); - zassert_ok(gpio_pin_configure_dt(&scl_pin_0, GPIO_INPUT)); - zassert_ok(gpio_pin_configure_dt(&scl_pin_1, GPIO_OUTPUT_INACTIVE)); - zassert_equal(gpio_pin_get_dt(&sda_pin_0), 0); - zassert_equal(gpio_pin_get_dt(&scl_pin_0), 0); - zassert_ok(gpio_pin_set_dt(&sda_pin_1, 1)); - zassert_ok(gpio_pin_set_dt(&scl_pin_1, 1)); - zassert_equal(gpio_pin_get_dt(&sda_pin_0), 1); - zassert_equal(gpio_pin_get_dt(&scl_pin_0), 1); - zassert_ok(gpio_pin_configure_dt(&sda_pin_1, GPIO_INPUT)); - zassert_ok(gpio_pin_configure_dt(&scl_pin_1, GPIO_INPUT)); - zassert_ok(device_init(i2c_0)); - zassert_ok(device_init(i2c_1)); -} - ZTEST(i2c_eeprom_target, test_eeprom_target) { const struct device *const eeprom_0 = DEVICE_DT_GET(NODE_EP0); From 9d1c970a8edd4a13d2f04b589f58e3940b8c3f46 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 633/881] Revert "[nrf fromtree] drivers: i2c: nrfx_twis: impl device deinit" This reverts commit ab2858aaedf70d82c4ac33c605591eb562bc8235. Signed-off-by: Jukka Rissanen --- drivers/i2c/i2c_nrfx_twis.c | 43 ++----------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twis.c b/drivers/i2c/i2c_nrfx_twis.c index dca3a457cf2..c37c51ddd74 100644 --- a/drivers/i2c/i2c_nrfx_twis.c +++ b/drivers/i2c/i2c_nrfx_twis.c @@ -73,15 +73,6 @@ static bool shim_nrf_twis_is_resumed(const struct device *dev) (void)pm_device_state_get(dev, &state); return state == PM_DEVICE_STATE_ACTIVE; } - -static bool shim_nrf_twis_is_suspended(const struct device *dev) -{ - enum pm_device_state state; - - (void)pm_device_state_get(dev, &state); - return state == PM_DEVICE_STATE_SUSPENDED || - state == PM_DEVICE_STATE_OFF; -} #else static bool shim_nrf_twis_is_resumed(const struct device *dev) { @@ -208,7 +199,7 @@ static int shim_nrf_twis_pm_action_cb(const struct device *dev, #if CONFIG_PM_DEVICE case PM_DEVICE_ACTION_SUSPEND: - shim_nrf_twis_disable(dev); + shim_nrf_twis_disable(); break; #endif @@ -292,35 +283,6 @@ static int shim_nrf_twis_init(const struct device *dev) return pm_device_driver_init(dev, shim_nrf_twis_pm_action_cb); } -static int shim_nrf_twis_deinit(const struct device *dev) -{ - const struct shim_nrf_twis_config *dev_config = dev->config; - struct shim_nrf_twis_data *dev_data = dev->data; - - if (dev_data->target_config != NULL) { - LOG_ERR("target registered"); - return -EPERM; - } - -#if CONFIG_PM_DEVICE - /* - * PM must have suspended the device before driver can - * be deinitialized - */ - if (!shim_nrf_twis_is_suspended(dev)) { - LOG_ERR("device active"); - return -EBUSY; - } -#else - /* Suspend device */ - shim_nrf_twis_disable(dev); -#endif - - /* Uninit device hardware */ - nrfx_twis_uninit(&dev_config->twis); - return 0; -} - #define SHIM_NRF_TWIS_NAME(id, name) \ _CONCAT_4(shim_nrf_twis_, name, _, id) @@ -361,10 +323,9 @@ static int shim_nrf_twis_deinit(const struct device *dev) shim_nrf_twis_pm_action_cb, \ ); \ \ - DEVICE_DT_DEINIT_DEFINE( \ + DEVICE_DT_DEFINE( \ SHIM_NRF_TWIS_NODE(id), \ shim_nrf_twis_init, \ - shim_nrf_twis_deinit, \ PM_DEVICE_DT_GET(SHIM_NRF_TWIS_NODE(id)), \ &SHIM_NRF_TWIS_NAME(id, data), \ &SHIM_NRF_TWIS_NAME(id, config), \ From 0525d30c1388dd117ef6c4c79ec36d823a11f399 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 634/881] Revert "[nrf fromtree] drivers: i2c: nrfx_twim: impl device deinit" This reverts commit 68e71ff2c42d6d0254fb981a21954d4a491e00c1. Signed-off-by: Jukka Rissanen --- drivers/i2c/i2c_nrfx_twim.c | 8 +---- drivers/i2c/i2c_nrfx_twim_common.c | 50 +++--------------------------- drivers/i2c/i2c_nrfx_twim_common.h | 1 - drivers/i2c/i2c_nrfx_twim_rtio.c | 14 +++------ 4 files changed, 10 insertions(+), 63 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index b6c37f455dc..d5b619bfc5a 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -224,11 +224,6 @@ static int i2c_nrfx_twim_init(const struct device *dev) return i2c_nrfx_twim_common_init(dev); } -static int i2c_nrfx_twim_deinit(const struct device *dev) -{ - return i2c_nrfx_twim_common_deinit(dev); -} - static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { .configure = i2c_nrfx_twim_configure, .transfer = i2c_nrfx_twim_transfer, @@ -285,9 +280,8 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { }; \ PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \ PM_DEVICE_ISR_SAFE); \ - I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \ + I2C_DEVICE_DT_DEFINE(I2C(idx), \ i2c_nrfx_twim_init, \ - i2c_nrfx_twim_deinit, \ PM_DEVICE_DT_GET(I2C(idx)), \ &twim_##idx##_data, \ &twim_##idx##z_config, \ diff --git a/drivers/i2c/i2c_nrfx_twim_common.c b/drivers/i2c/i2c_nrfx_twim_common.c index f7fd0d097b0..1539d7c90dd 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.c +++ b/drivers/i2c/i2c_nrfx_twim_common.c @@ -102,30 +102,18 @@ int i2c_nrfx_twim_msg_transfer(const struct device *dev, uint8_t flags, uint8_t return ret; } -void twim_nrfx_pm_resume(const struct device *dev) -{ - const struct i2c_nrfx_twim_common_config *config = dev->config; - - (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); - nrfx_twim_enable(&config->twim); -} - -void twim_nrfx_pm_suspend(const struct device *dev) +int twim_nrfx_pm_action(const struct device *dev, enum pm_device_action action) { const struct i2c_nrfx_twim_common_config *config = dev->config; - nrfx_twim_disable(&config->twim); - (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); -} - -int twim_nrfx_pm_action(const struct device *dev, enum pm_device_action action) -{ switch (action) { case PM_DEVICE_ACTION_RESUME: - twim_nrfx_pm_resume(dev); + (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); + nrfx_twim_enable(&config->twim); break; case PM_DEVICE_ACTION_SUSPEND: - twim_nrfx_pm_suspend(dev); + nrfx_twim_disable(&config->twim); + (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); break; default: return -ENOTSUP; @@ -150,31 +138,3 @@ int i2c_nrfx_twim_common_init(const struct device *dev) return pm_device_driver_init(dev, twim_nrfx_pm_action); } - -int i2c_nrfx_twim_common_deinit(const struct device *dev) -{ - const struct i2c_nrfx_twim_common_config *config = dev->config; -#if CONFIG_PM_DEVICE - enum pm_device_state state; -#endif - -#if CONFIG_PM_DEVICE - /* - * PM must have suspended the device before driver can - * be deinitialized - */ - (void)pm_device_state_get(dev, &state); - if (state != PM_DEVICE_STATE_SUSPENDED && - state != PM_DEVICE_STATE_OFF) { - LOG_ERR("device active"); - return -EBUSY; - } -#else - /* Suspend device */ - twim_nrfx_pm_suspend(dev); -#endif - - /* Uninit device hardware */ - nrfx_twim_uninit(&config->twim); - return 0; -} diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index 3c5c82311ba..ba7fa72f019 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -43,7 +43,6 @@ struct i2c_nrfx_twim_common_config { }; int i2c_nrfx_twim_common_init(const struct device *dev); -int i2c_nrfx_twim_common_deinit(const struct device *dev); int i2c_nrfx_twim_configure(const struct device *dev, uint32_t i2c_config); int i2c_nrfx_twim_recover_bus(const struct device *dev); int i2c_nrfx_twim_msg_transfer(const struct device *dev, uint8_t flags, uint8_t *buf, diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 5eef549ba2e..6a7504dbd62 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -203,7 +203,7 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { .iodev_submit = i2c_nrfx_twim_rtio_submit, }; -static int i2c_nrfx_twim_rtio_init(const struct device *dev) +int i2c_nrfx_twim_rtio_init(const struct device *dev) { const struct i2c_nrfx_twim_rtio_config *config = dev->config; @@ -211,11 +211,6 @@ static int i2c_nrfx_twim_rtio_init(const struct device *dev) return i2c_nrfx_twim_common_init(dev); } -static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) -{ - return i2c_nrfx_twim_common_deinit(dev); -} - #define CONCAT_BUF_SIZE(idx) \ COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_concat_buf_size), \ (DT_PROP(I2C(idx), zephyr_concat_buf_size)), (0)) @@ -287,10 +282,9 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) .ctx = &_i2c##idx##_twim_rtio, \ }; \ PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \ - I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ - PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ - &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twim_driver_api); + I2C_DEVICE_DT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, PM_DEVICE_DT_GET(I2C(idx)), \ + &twim_##idx##z_data, &twim_##idx##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api); #ifdef CONFIG_HAS_HW_NRF_TWIM0 I2C_NRFX_TWIM_RTIO_DEVICE(0); From 1ff18befd2f1c64e8e080148ba076bba743fe5c8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 635/881] Revert "[nrf fromtree] drivers: i2c: add I2C_DEVICE_DT_DEINIT macros" This reverts commit 8881b5d8c2c10de06737d27947cd247975814850. Signed-off-by: Jukka Rissanen --- include/zephyr/drivers/i2c.h | 37 ++++++++---------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/include/zephyr/drivers/i2c.h b/include/zephyr/drivers/i2c.h index c1972782660..09640e3275d 100644 --- a/include/zephyr/drivers/i2c.h +++ b/include/zephyr/drivers/i2c.h @@ -635,7 +635,7 @@ static inline void i2c_xfer_stats(const struct device *dev, struct i2c_msg *msgs /** @endcond */ /** - * @brief Like DEVICE_DT_DEINIT_DEFINE() with I2C specifics. + * @brief Like DEVICE_DT_DEFINE() with I2C specifics. * * @details Defines a device which implements the I2C API. May * generate a custom device_state container struct and init_fn @@ -645,8 +645,6 @@ static inline void i2c_xfer_stats(const struct device *dev, struct i2c_msg *msgs * * @param init_fn Name of the init function of the driver. Can be `NULL`. * - * @param deinit_fn Name of the deinit function of the driver. Can be `NULL`. - * * @param pm PM device resources reference (NULL if device does not use PM). * * @param data Pointer to the device's private data. @@ -663,14 +661,14 @@ static inline void i2c_xfer_stats(const struct device *dev, struct i2c_msg *msgs * @param api Provides an initial pointer to the API function struct * used by the driver. Can be NULL. */ -#define I2C_DEVICE_DT_DEINIT_DEFINE(node_id, init_fn, deinit_fn, pm, \ - data, config, level, prio, api, ...)\ +#define I2C_DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, level, \ + prio, api, ...) \ Z_I2C_DEVICE_STATE_DEFINE(Z_DEVICE_DT_DEV_ID(node_id)); \ Z_I2C_INIT_FN(Z_DEVICE_DT_DEV_ID(node_id), init_fn) \ Z_DEVICE_DEFINE(node_id, Z_DEVICE_DT_DEV_ID(node_id), \ DEVICE_DT_NAME(node_id), \ &UTIL_CAT(Z_DEVICE_DT_DEV_ID(node_id), _init), \ - deinit_fn, Z_DEVICE_DT_FLAGS(node_id), pm, data,\ + NULL, Z_DEVICE_DT_FLAGS(node_id), pm, data, \ config, level, prio, api, \ &(Z_DEVICE_STATE_NAME(Z_DEVICE_DT_DEV_ID(node_id)).devstate), \ __VA_ARGS__) @@ -685,32 +683,12 @@ static inline void i2c_xfer_stats(const struct device *dev, struct i2c_msg *msgs ARG_UNUSED(num_msgs); } -#define I2C_DEVICE_DT_DEINIT_DEFINE(node_id, init_fn, deinit_fn, pm, \ - data, config, level, prio, api, ...)\ - DEVICE_DT_DEINIT_DEFINE(node_id, init_fn, deinit_fn, pm, data, \ - config, level, prio, api, __VA_ARGS__) - -#endif /* CONFIG_I2C_STATS */ - -/** - * @brief Like I2C_DEVICE_DT_DEINIT_DEFINE() but without deinit_fn - */ #define I2C_DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, level, \ prio, api, ...) \ - I2C_DEVICE_DT_DEINIT_DEFINE(node_id, init_fn, NULL, pm, data, \ - config, level, prio, api, \ - __VA_ARGS__) + DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, level, \ + prio, api, __VA_ARGS__) -/** - * @brief Like I2C_DEVICE_DT_DEINIT_DEFINE() for an instance of a DT_DRV_COMPAT compatible - * - * @param inst instance number. This is replaced by - * DT_DRV_COMPAT(inst) in the call to I2C_DEVICE_DT_DEINIT_DEFINE(). - * - * @param ... other parameters as expected by I2C_DEVICE_DT_DEINIT_DEFINE(). - */ -#define I2C_DEVICE_DT_INST_DEINIT_DEFINE(inst, ...) \ - I2C_DEVICE_DT_DEINIT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__) +#endif /* CONFIG_I2C_STATS */ /** * @brief Like I2C_DEVICE_DT_DEFINE() for an instance of a DT_DRV_COMPAT compatible @@ -723,6 +701,7 @@ static inline void i2c_xfer_stats(const struct device *dev, struct i2c_msg *msgs #define I2C_DEVICE_DT_INST_DEFINE(inst, ...) \ I2C_DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__) + /** * @brief Configure operation of a host controller. * From 5eb644d9b06a1073c3c149b089d52e7f9b50b857 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 636/881] Revert "[nrf fromtree] tests: drivers: spi: loopback: extend nrf overlays with miso/mosi" This reverts commit 722d5bce6a113aa94319e2c15d32d82a34950221. Signed-off-by: Jukka Rissanen --- .../spi_loopback/boards/nrf54h20dk_nrf54h20_common.dtsi | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_common.dtsi index 5111257a557..33170beda44 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - -/ { - zephyr,user { - miso-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; - mosi-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; - }; -}; - &pinctrl { spi130_default: spi130_default { group1 { From ee2e4b733909d21ace03ada6b4af7d8fa91caa44 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 637/881] Revert "[nrf fromtree] tests: drivers: spi: loopback: test device_deinit" This reverts commit 188ea59e2d785838c365a31910d0b74d4cc696e6. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 33 +----------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index fd2302a4ec0..5419a749351 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -57,8 +56,7 @@ static int spec_idx; */ struct spi_dt_spec spec_copies[5]; -const struct gpio_dt_spec miso_pin = GPIO_DT_SPEC_GET_OR(DT_PATH(zephyr_user), miso_gpios, {}); -const struct gpio_dt_spec mosi_pin = GPIO_DT_SPEC_GET_OR(DT_PATH(zephyr_user), mosi_gpios, {}); + /* ******************** @@ -809,35 +807,6 @@ ZTEST(spi_loopback, test_spi_concurrent_transfer_different_spec) test_spi_concurrent_transfer_helper(specs); } -ZTEST(spi_loopback, test_spi_deinit) -{ - struct spi_dt_spec *spec = loopback_specs[0]; - const struct device *dev = spec->bus; - int ret; - - if (miso_pin.port == NULL || mosi_pin.port == NULL) { - TC_PRINT(" zephyr,user miso-gpios or mosi-gpios are not defined\n"); - ztest_test_skip(); - } - - ret = device_deinit(dev); - if (ret == -ENOTSUP) { - TC_PRINT(" device deinit not supported\n"); - ztest_test_skip(); - } - - zassert_ok(ret); - zassert_ok(gpio_pin_configure_dt(&miso_pin, GPIO_INPUT)); - zassert_ok(gpio_pin_configure_dt(&mosi_pin, GPIO_OUTPUT_INACTIVE)); - zassert_equal(gpio_pin_get_dt(&miso_pin), 0); - zassert_ok(gpio_pin_set_dt(&mosi_pin, 1)); - zassert_equal(gpio_pin_get_dt(&miso_pin), 1); - zassert_ok(gpio_pin_set_dt(&mosi_pin, 0)); - zassert_equal(gpio_pin_get_dt(&miso_pin), 0); - zassert_ok(gpio_pin_configure_dt(&mosi_pin, GPIO_INPUT)); - zassert_ok(device_init(dev)); -} - #if (CONFIG_SPI_ASYNC) static struct k_poll_signal async_sig = K_POLL_SIGNAL_INITIALIZER(async_sig); static struct k_poll_event async_evt = From 788040228948a6adf88dcea5a1947a19cf9972ba Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 638/881] Revert "[nrf fromtree] drivers: spi: nrfx spim: impl device deinit" This reverts commit 6bf1032959a3f081be41895ee7612bf8507c11d6. Signed-off-by: Jukka Rissanen --- drivers/spi/spi_nrfx_spim.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index a5c4e30f190..c77e256a7fe 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -765,28 +765,6 @@ static int spi_nrfx_init(const struct device *dev) #endif return pm_device_driver_init(dev, spim_nrfx_pm_action); } - -static int spi_nrfx_deinit(const struct device *dev) -{ -#if defined(CONFIG_PM_DEVICE) - enum pm_device_state state; - - /* - * PM must have suspended the device before driver can - * be deinitialized - */ - (void)pm_device_state_get(dev, &state); - return state == PM_DEVICE_STATE_SUSPENDED || - state == PM_DEVICE_STATE_OFF ? - 0 : -EBUSY; -#else - /* PM suspend implementation does everything we need */ - spim_suspend(dev); -#endif - - return 0; -} - /* * We use NODELABEL here because the nrfx API requires us to call * functions which are named according to SoC peripheral instance @@ -892,9 +870,8 @@ static int spi_nrfx_deinit(const struct device *dev) !(DT_GPIO_FLAGS(SPIM(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ "WAKE line must be configured as active high"); \ PM_DEVICE_DT_DEFINE(SPIM(idx), spim_nrfx_pm_action); \ - SPI_DEVICE_DT_DEINIT_DEFINE(SPIM(idx), \ + SPI_DEVICE_DT_DEFINE(SPIM(idx), \ spi_nrfx_init, \ - spi_nrfx_deinit, \ PM_DEVICE_DT_GET(SPIM(idx)), \ &spi_##idx##_data, \ &spi_##idx##z_config, \ From 019039ce9b88b3c997941f03ea563feb60c67c0b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 639/881] Revert "[nrf fromtree] drivers: spi: add DEINIT_ variants of SPI_DEVICE_ macros" This reverts commit 7d657f646c8ae7d4a4404b4bc1635d94329eff7b. Signed-off-by: Jukka Rissanen --- include/zephyr/drivers/spi.h | 56 +++++++----------------------------- 1 file changed, 10 insertions(+), 46 deletions(-) diff --git a/include/zephyr/drivers/spi.h b/include/zephyr/drivers/spi.h index 08a3f03137b..8e8cdb5a994 100644 --- a/include/zephyr/drivers/spi.h +++ b/include/zephyr/drivers/spi.h @@ -657,16 +657,16 @@ struct spi_device_state { } /** @endcond */ -#define SPI_DEVICE_DT_DEINIT_DEFINE(node_id, init_fn, deinit_fn, \ - pm_device, data_ptr, cfg_ptr, \ - level, prio, api_ptr, ...) \ +#define SPI_DEVICE_DT_DEFINE(node_id, init_fn, pm_device, \ + data_ptr, cfg_ptr, level, prio, \ + api_ptr, ...) \ Z_SPI_DEVICE_STATE_DEFINE(Z_DEVICE_DT_DEV_ID(node_id)); \ Z_SPI_INIT_FN(Z_DEVICE_DT_DEV_ID(node_id), init_fn) \ Z_DEVICE_DEFINE(node_id, Z_DEVICE_DT_DEV_ID(node_id), \ DEVICE_DT_NAME(node_id), \ &UTIL_CAT(Z_DEVICE_DT_DEV_ID(node_id), _init), \ - deinit_fn, Z_DEVICE_DT_FLAGS(node_id), \ - pm_device, data_ptr, cfg_ptr, level, prio, \ + NULL, Z_DEVICE_DT_FLAGS(node_id), pm_device, \ + data_ptr, cfg_ptr, level, prio, \ api_ptr, \ &(Z_DEVICE_STATE_NAME(Z_DEVICE_DT_DEV_ID(node_id)).devstate), \ __VA_ARGS__) @@ -700,9 +700,8 @@ static inline void spi_transceive_stats(const struct device *dev, int error, * @name SPI DT Device Macros * @{ */ - /** - * @brief Like DEVICE_DT_DEINIT_DEFINE() with SPI specifics. + * @brief Like DEVICE_DT_DEFINE() with SPI specifics. * * @details Defines a device which implements the SPI API. May * generate a custom device_state container struct and init_fn @@ -710,7 +709,6 @@ static inline void spi_transceive_stats(const struct device *dev, int error, * * @param node_id The devicetree node identifier. * @param init_fn Name of the init function of the driver. - * @param deinit_fn Name of the deinit function of the driver. * @param pm PM device resources reference (NULL if device does not use PM). * @param data Pointer to the device's private data. * @param config The address to the structure containing the configuration @@ -721,16 +719,16 @@ static inline void spi_transceive_stats(const struct device *dev, int error, * @param api Provides an initial pointer to the API function struct used by * the driver. Can be NULL. */ -#define SPI_DEVICE_DT_DEINIT_DEFINE(node_id, init_fn, deinit_fn, pm, data, \ - config, level, prio, api, ...) \ +#define SPI_DEVICE_DT_DEFINE(node_id, init_fn, pm, \ + data, config, level, prio, \ + api, ...) \ Z_DEVICE_STATE_DEFINE(Z_DEVICE_DT_DEV_ID(node_id)); \ Z_DEVICE_DEFINE(node_id, Z_DEVICE_DT_DEV_ID(node_id), \ - DEVICE_DT_NAME(node_id), init_fn, deinit_fn, \ + DEVICE_DT_NAME(node_id), init_fn, NULL, \ Z_DEVICE_DT_FLAGS(node_id), pm, data, config, \ level, prio, api, \ &Z_DEVICE_STATE_NAME(Z_DEVICE_DT_DEV_ID(node_id)), \ __VA_ARGS__) - /** @} */ #define SPI_STATS_RX_BYTES_INC(dev_) @@ -741,40 +739,6 @@ static inline void spi_transceive_stats(const struct device *dev, int error, #endif /*CONFIG_SPI_STATS*/ -/** - * @brief Like DEVICE_DT_DEINIT_DEFINE() without deinit function. - * - * @details Defines a device which implements the SPI API. May - * generate a custom device_state container struct and init_fn - * wrapper when needed depending on SPI @kconfig{CONFIG_SPI_STATS}. - * - * @param node_id The devicetree node identifier. - * @param init_fn Name of the init function of the driver. - * @param pm PM device resources reference (NULL if device does not use PM). - * @param data Pointer to the device's private data. - * @param config The address to the structure containing the configuration - * information for this instance of the driver. - * @param level The initialization level. See SYS_INIT() for details. - * @param prio Priority within the selected initialization level. See SYS_INIT() - * for details. - * @param api Provides an initial pointer to the API function struct used by - * the driver. Can be NULL. - */ -#define SPI_DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, level, prio, \ - api, ...) \ - SPI_DEVICE_DT_DEINIT_DEFINE(node_id, init_fn, NULL, pm, data, config, \ - level, prio, api, __VA_ARGS__) - -/** - * @brief Like SPI_DEVICE_DT_DEINIT_DEFINE(), but uses an instance of a `DT_DRV_COMPAT` - * compatible instead of a node identifier. - * - * @param inst Instance number. The `node_id` argument to SPI_DEVICE_DT_DEINIT_DEFINE() is - * set to `DT_DRV_INST(inst)`. - * @param ... Other parameters as expected by SPI_DEVICE_DT_DEFINE(). - */ -#define SPI_DEVICE_DT_INST_DEINIT_DEFINE(inst, ...) \ - SPI_DEVICE_DT_DEINIT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__) /** * @brief Like SPI_DEVICE_DT_DEFINE(), but uses an instance of a `DT_DRV_COMPAT` From 81227766cd22b33c9fbc55a340f5a6449d92ed14 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 640/881] Revert "[nrf fromtree] drivers: pinctrl: nrf: patch pin retain to follow lp mode" This reverts commit 971e2e3c7d69adb685d35d3050767064927f7ebf. Signed-off-by: Jukka Rissanen --- drivers/pinctrl/pinctrl_nrf.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 07941fcb5ad..3744abf8031 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -483,13 +483,9 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, } gpd_requested = true; } - } - /* - * Pad power domain now on, retain no longer needed - * as pad config will be persists as pad is powered. - */ - nrf_gpio_pin_retain_disable(pin); + nrf_gpio_pin_retain_disable(pin); + } #endif /* CONFIG_SOC_NRF54H20_GPD */ if (write != NO_WRITE) { @@ -508,13 +504,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, nrf_gpio_pin_clock_set(pin, NRF_GET_CLOCKPIN_ENABLE(pins[i])); #endif #ifdef CONFIG_SOC_NRF54H20_GPD - if (NRF_GET_LP(pins[i]) == NRF_LP_ENABLE) { - /* - * Pad power domain may be turned off, and pad is not - * actively used as pincnf is low-power. Enable retain - * to ensure pad output and config persists if pad - * power domain is suspended. - */ + if (NRF_GET_GPD_FAST_ACTIVE1(pins[i]) == 1U) { nrf_gpio_pin_retain_enable(pin); } #endif /* CONFIG_SOC_NRF54H20_GPD */ From 5e109c511d02eb8695a85467ca3ca32b962b8601 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:33 +0300 Subject: [PATCH 641/881] Revert "[nrf fromtree] drivers: gpio: nrfx: extend pin retain to every pin" This reverts commit 723be97ffae963033c55d6edc2e7e439d5c15e8a. Signed-off-by: Jukka Rissanen --- drivers/gpio/gpio_nrfx.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index 0a94b84c67f..b6548ed22d5 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -64,15 +64,20 @@ static nrf_gpio_pin_pull_t get_pull(gpio_flags_t flags) return NRF_GPIO_PIN_NOPULL; } -static void gpio_nrfx_gpd_retain_set(const struct device *port, uint32_t mask) +static void gpio_nrfx_gpd_retain_set(const struct device *port, uint32_t mask, gpio_flags_t flags) { #ifdef CONFIG_SOC_NRF54H20_GPD const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); + if (cfg->pad_pd != NRF_GPD_FAST_ACTIVE1 || !(flags & GPIO_OUTPUT)) { + return; + } + nrf_gpio_port_retain_enable(cfg->port, mask); #else ARG_UNUSED(port); ARG_UNUSED(mask); + ARG_UNUSED(flags); #endif } @@ -81,6 +86,10 @@ static void gpio_nrfx_gpd_retain_clear(const struct device *port, uint32_t mask) #ifdef CONFIG_SOC_NRF54H20_GPD const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); + if (cfg->pad_pd != NRF_GPD_FAST_ACTIVE1) { + return; + } + nrf_gpio_port_retain_disable(cfg->port, mask); #else ARG_UNUSED(port); @@ -216,7 +225,7 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, } end: - gpio_nrfx_gpd_retain_set(port, BIT(pin)); + gpio_nrfx_gpd_retain_set(port, BIT(pin), flags); return pm_device_runtime_put(port); } @@ -320,7 +329,7 @@ static int gpio_nrfx_port_set_masked_raw(const struct device *port, gpio_nrfx_gpd_retain_clear(port, mask); nrf_gpio_port_out_set(reg, set_mask); nrf_gpio_port_out_clear(reg, clear_mask); - gpio_nrfx_gpd_retain_set(port, mask); + gpio_nrfx_gpd_retain_set(port, mask, GPIO_OUTPUT); return pm_device_runtime_put(port); } @@ -337,7 +346,7 @@ static int gpio_nrfx_port_set_bits_raw(const struct device *port, gpio_nrfx_gpd_retain_clear(port, mask); nrf_gpio_port_out_set(reg, mask); - gpio_nrfx_gpd_retain_set(port, mask); + gpio_nrfx_gpd_retain_set(port, mask, GPIO_OUTPUT); return pm_device_runtime_put(port); } @@ -354,7 +363,7 @@ static int gpio_nrfx_port_clear_bits_raw(const struct device *port, gpio_nrfx_gpd_retain_clear(port, mask); nrf_gpio_port_out_clear(reg, mask); - gpio_nrfx_gpd_retain_set(port, mask); + gpio_nrfx_gpd_retain_set(port, mask, GPIO_OUTPUT); return pm_device_runtime_put(port); } @@ -375,7 +384,7 @@ static int gpio_nrfx_port_toggle_bits(const struct device *port, gpio_nrfx_gpd_retain_clear(port, mask); nrf_gpio_port_out_set(reg, set_mask); nrf_gpio_port_out_clear(reg, clear_mask); - gpio_nrfx_gpd_retain_set(port, mask); + gpio_nrfx_gpd_retain_set(port, mask, GPIO_OUTPUT); return pm_device_runtime_put(port); } From ac9fb9886fd8013fe05cd85b80ee6d1af1b7cf03 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 642/881] Revert "[nrf fromtree] samples: Bluetooth: BAP: BA: Reset states and modify error checking" This reverts commit 27f9e51b1794e4d491e22d77b472e4ed4b845b22. Signed-off-by: Jukka Rissanen --- .../bap_broadcast_assistant/src/main.c | 151 +++++++----------- 1 file changed, 62 insertions(+), 89 deletions(-) diff --git a/samples/bluetooth/bap_broadcast_assistant/src/main.c b/samples/bluetooth/bap_broadcast_assistant/src/main.c index 6458bfe60fe..a0471f2ee6f 100644 --- a/samples/bluetooth/bap_broadcast_assistant/src/main.c +++ b/samples/bluetooth/bap_broadcast_assistant/src/main.c @@ -1,12 +1,11 @@ /* * Copyright (c) 2024 Demant A/S - * Copyright (c) 2024-2025 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #include -#include #include #include #include @@ -25,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -35,8 +33,6 @@ #define PA_SYNC_SKIP 5 #define PA_SYNC_INTERVAL_TO_TIMEOUT_RATIO 20 /* Set the timeout relative to interval */ /* Broadcast IDs are 24bit, so this is out of valid range */ -/* Default semaphore timeout when waiting for an action */ -#define SEM_TIMEOUT K_SECONDS(10) static void scan_for_broadcast_sink(void); @@ -72,7 +68,6 @@ static K_SEM_DEFINE(sem_sink_disconnected, 0, 1); static K_SEM_DEFINE(sem_security_updated, 0, 1); static K_SEM_DEFINE(sem_bass_discovered, 0, 1); static K_SEM_DEFINE(sem_pa_synced, 0, 1); -static K_SEM_DEFINE(sem_pa_sync_terminted, 0, 1); static K_SEM_DEFINE(sem_received_base_subgroups, 0, 1); static bool device_found(struct bt_data *data, void *user_data) @@ -152,7 +147,6 @@ static bool base_store(struct bt_data *data, void *user_data) const struct bt_bap_base *base = bt_bap_base_get_base_from_ad(data); int base_size; int base_subgroup_count; - int err; /* Base is NULL if the data does not contain a valid BASE */ if (base == NULL) { @@ -174,19 +168,13 @@ static bool base_store(struct bt_data *data, void *user_data) } /* Compare BASE and copy if different */ - err = k_mutex_lock(&base_store_mutex, K_MSEC(100)); - if (err != 0) { - /* Could not get BASE mutex, wait for new to avoid blocking */ - return false; - } - + k_mutex_lock(&base_store_mutex, K_FOREVER); if ((size_t)base_size != received_base_size || memcmp(base, received_base, (size_t)base_size) != 0) { (void)memcpy(received_base, base, base_size); received_base_size = (size_t)base_size; } - err = k_mutex_unlock(&base_store_mutex); - __ASSERT_NO_MSG(err == 0); + k_mutex_unlock(&base_store_mutex); /* Stop parsing */ k_sem_give(&sem_received_base_subgroups); @@ -431,7 +419,9 @@ static void scan_for_broadcast_source(void) printk("Scanning for Broadcast Source successfully started\n"); err = k_sem_take(&sem_source_discovered, K_FOREVER); - __ASSERT_NO_MSG(err == 0); + if (err != 0) { + printk("Failed to take sem_source_discovered (err %d)\n", err); + } } static void scan_for_broadcast_sink(void) @@ -449,7 +439,9 @@ static void scan_for_broadcast_sink(void) printk("Scanning for Broadcast Sink successfully started\n"); err = k_sem_take(&sem_sink_discovered, K_FOREVER); - __ASSERT_NO_MSG(err == 0); + if (err != 0) { + printk("Failed to take sem_sink_discovered (err %d)\n", err); + } } static void connected(struct bt_conn *conn, uint8_t err) @@ -536,16 +528,6 @@ static void pa_sync_synced_cb(struct bt_le_per_adv_sync *sync, k_sem_give(&sem_pa_synced); } } -static void pa_sync_term_cb(struct bt_le_per_adv_sync *sync, - const struct bt_le_per_adv_sync_term_info *info) -{ - if (sync == pa_sync) { - printk("PA sync %p terminated with reason %u\n", sync, info->reason); - - k_sem_give(&sem_pa_sync_terminted); - pa_sync = NULL; - } -} static struct bt_bap_broadcast_assistant_cb ba_cbs = { .discover = bap_broadcast_assistant_discover_cb, @@ -554,49 +536,14 @@ static struct bt_bap_broadcast_assistant_cb ba_cbs = { static struct bt_le_per_adv_sync_cb pa_synced_cb = { .synced = pa_sync_synced_cb, - .term = pa_sync_term_cb, .recv = pa_recv, }; static void reset(void) { - int err; - - printk("\n\nResetting...\n\n"); - - if (broadcast_sink_conn != NULL) { - err = bt_conn_disconnect(broadcast_sink_conn, BT_HCI_ERR_LOCALHOST_TERM_CONN); - - if (err != 0) { - printk("bt_conn_disconnect failed with %d\n", err); - } else { - if (k_sem_take(&sem_sink_disconnected, SEM_TIMEOUT) != 0) { - /* This should not happen */ - - __ASSERT_NO_MSG(false); - } - } - __ASSERT_NO_MSG(err == 0); - } - - /* Ignore return value as scanning may already be stopped */ - (void)bt_le_scan_stop(); - - if (pa_sync != NULL) { - err = bt_le_per_adv_sync_delete(pa_sync); - - if (err != 0) { - printk("bt_le_per_adv_sync_delete failed with %d\n", err); - } else { - if (k_sem_take(&sem_pa_sync_terminted, SEM_TIMEOUT) != 0) { - /* This should not happen */ - - __ASSERT_NO_MSG(false); - } - } - __ASSERT_NO_MSG(err == 0); - } + printk("\n\nReset...\n\n"); + broadcast_sink_conn = NULL; selected_broadcast_id = BT_BAP_INVALID_BROADCAST_ID; selected_sid = 0; selected_pa_interval = 0; @@ -621,6 +568,7 @@ BT_CONN_CB_DEFINE(conn_callbacks) = { int main(void) { int err; + struct bt_bap_broadcast_assistant_add_src_param param = { 0 }; err = bt_enable(NULL); if (err) { @@ -637,33 +585,45 @@ int main(void) k_mutex_init(&base_store_mutex); while (true) { - struct bt_bap_broadcast_assistant_add_src_param param = {0}; - - reset(); - scan_for_broadcast_sink(); - err = k_sem_take(&sem_sink_connected, SEM_TIMEOUT); + err = k_sem_take(&sem_sink_connected, K_FOREVER); if (err != 0) { printk("Failed to take sem_sink_connected (err %d)\n", err); - continue; } err = bt_bap_broadcast_assistant_discover(broadcast_sink_conn); if (err != 0) { printk("Failed to discover BASS on the sink (err %d)\n", err); - continue; } - err = k_sem_take(&sem_security_updated, SEM_TIMEOUT); + err = k_sem_take(&sem_security_updated, K_SECONDS(10)); if (err != 0) { - printk("Failed to take sem_security_updated (err %d)\n", err); + printk("Failed to take sem_security_updated (err %d), resetting\n", err); + bt_conn_disconnect(broadcast_sink_conn, BT_HCI_ERR_AUTH_FAIL); + + if (k_sem_take(&sem_sink_disconnected, K_SECONDS(10)) != 0) { + /* This should not happen */ + return -ETIMEDOUT; + } + + reset(); continue; } - err = k_sem_take(&sem_bass_discovered, SEM_TIMEOUT); + err = k_sem_take(&sem_bass_discovered, K_SECONDS(10)); if (err != 0) { - printk("Failed to take sem_bass_discovered (err %d)\n", err); + if (err == -EAGAIN) { + printk("Failed to take sem_bass_discovered (err %d)\n", err); + } + bt_conn_disconnect(broadcast_sink_conn, BT_HCI_ERR_UNSUPP_REMOTE_FEATURE); + + if (k_sem_take(&sem_sink_disconnected, K_SECONDS(10)) != 0) { + /* This should not happen */ + return -ETIMEDOUT; + } + + reset(); continue; } @@ -676,19 +636,19 @@ int main(void) scan_for_broadcast_source(); - printk("Attempting to PA sync to the broadcaster with id 0x%06X\n", + printk("Scan stopped, attempting to PA sync to the broadcaster with id 0x%06X\n", selected_broadcast_id); err = pa_sync_create(); if (err != 0) { - printk("Could not create Broadcast PA sync: %d\n", err); - continue; + printk("Could not create Broadcast PA sync: %d, resetting\n", err); + return -ETIMEDOUT; } printk("Waiting for PA synced\n"); - err = k_sem_take(&sem_pa_synced, SEM_TIMEOUT); + err = k_sem_take(&sem_pa_synced, K_FOREVER); if (err != 0) { - printk("Failed to take sem_pa_synced (err %d)\n", err); - continue; + printk("sem_pa_synced timed out, resetting\n"); + return err; } memset(bass_subgroups, 0, sizeof(bass_subgroups)); @@ -701,29 +661,42 @@ int main(void) /* Wait to receive subgroups */ err = k_sem_take(&sem_received_base_subgroups, K_FOREVER); - __ASSERT_NO_MSG(err == 0); + if (err != 0) { + printk("Failed to take sem_received_base_subgroups (err %d)\n", err); + return err; + } - err = k_mutex_lock(&base_store_mutex, K_FOREVER); - __ASSERT_NO_MSG(err == 0); + k_mutex_lock(&base_store_mutex, K_FOREVER); err = bt_bap_base_foreach_subgroup((const struct bt_bap_base *)received_base, add_pa_sync_base_subgroup_cb, ¶m); - err = k_mutex_unlock(&base_store_mutex); - __ASSERT_NO_MSG(err == 0); + k_mutex_unlock(&base_store_mutex); - if (err != 0) { + if (err < 0) { printk("Could not add BASE to params %d\n", err); continue; } err = bt_bap_broadcast_assistant_add_src(broadcast_sink_conn, ¶m); - if (err != 0) { + if (err) { printk("Failed to add source: %d\n", err); + bt_conn_disconnect(broadcast_sink_conn, BT_HCI_ERR_UNSUPP_REMOTE_FEATURE); + + if (k_sem_take(&sem_sink_disconnected, K_SECONDS(10)) != 0) { + /* This should not happen */ + return -ETIMEDOUT; + } + + reset(); continue; } /* Reset if the sink disconnects */ err = k_sem_take(&sem_sink_disconnected, K_FOREVER); - __ASSERT_NO_MSG(err == 0); + if (err != 0) { + printk("Failed to take sem_sink_disconnected (err %d)\n", err); + } + + reset(); } return 0; From eec6ccc4b75d7b2c2bf968c21cdfc671207f71f9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 643/881] Revert "[nrf fromtree] net: http_client: Fix handling of POLLHUP" This reverts commit bcb3484d592a8a1537652467e56361bb23080fd9. Signed-off-by: Jukka Rissanen --- subsys/net/lib/http/http_client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/net/lib/http/http_client.c b/subsys/net/lib/http/http_client.c index 01cf8fb134e..fe00609322e 100644 --- a/subsys/net/lib/http/http_client.c +++ b/subsys/net/lib/http/http_client.c @@ -517,6 +517,9 @@ static int http_wait_data(int sock, struct http_request *req, const k_timepoint_ } else if (fds[0].revents & ZSOCK_POLLNVAL) { ret = -EBADF; goto error; + } else if (fds[0].revents & ZSOCK_POLLHUP) { + /* Connection closed */ + goto closed; } else if (fds[0].revents & ZSOCK_POLLIN) { received = zsock_recv(sock, req->internal.response.recv_buf + offset, req->internal.response.recv_buf_len - offset, 0); @@ -590,9 +593,6 @@ static int http_wait_data(int sock, struct http_request *req, const k_timepoint_ req->internal.response.recv_buf + processed, offset); } - } else if (fds[0].revents & ZSOCK_POLLHUP) { - /* Connection closed */ - goto closed; } } while (!req->internal.response.message_complete); From 118bfd6ba76188f88557a8c9a7573a645ba9c6ae Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 644/881] Revert "[nrf fromtree] tests: drivers: build_all: add npm1300 and npm1304 devices" This reverts commit 99296da29b10237f76ac26359f50475b31cfffcb. Signed-off-by: Jukka Rissanen --- tests/drivers/build_all/gpio/app.overlay | 24 --------------- tests/drivers/build_all/led/app.overlay | 24 --------------- tests/drivers/build_all/regulator/i2c.dtsi | 14 --------- tests/drivers/build_all/sensor/i2c.dtsi | 29 ------------------- .../build_all/watchdog/i2c_devices.overlay | 18 ------------ 5 files changed, 109 deletions(-) diff --git a/tests/drivers/build_all/gpio/app.overlay b/tests/drivers/build_all/gpio/app.overlay index 367455b5f0d..ccb794dd847 100644 --- a/tests/drivers/build_all/gpio/app.overlay +++ b/tests/drivers/build_all/gpio/app.overlay @@ -413,30 +413,6 @@ ngpios = <16>; int-gpios = <&test_gpio 0 0>; }; - - test_i2c_npm1300: pmic@1d { - compatible = "nordic,npm1300"; - reg = <0x1d>; - - npm1300_gpio: gpio-controller { - compatible = "nordic,npm1300-gpio"; - gpio-controller; - #gpio-cells = <2>; - ngpios = <5>; - }; - }; - - test_i2c_npm1304: pmic@1e { - compatible = "nordic,npm1304"; - reg = <0x1e>; - - npm1304_gpio: gpio-controller { - compatible = "nordic,npm1304-gpio"; - gpio-controller; - #gpio-cells = <2>; - ngpios = <5>; - }; - }; }; nct3807_alert_1 { diff --git a/tests/drivers/build_all/led/app.overlay b/tests/drivers/build_all/led/app.overlay index 6a48cc3d905..e25825064a8 100644 --- a/tests/drivers/build_all/led/app.overlay +++ b/tests/drivers/build_all/led/app.overlay @@ -168,30 +168,6 @@ x-powers,mode = "by-reg"; }; }; - - pmic@13 { - compatible = "nordic,npm1300"; - reg = <0x13>; - - leds { - compatible = "nordic,npm1300-led"; - nordic,led0-mode = "error"; - nordic,led1-mode = "charging"; - nordic,led2-mode = "host"; - }; - }; - - pmic@14 { - compatible = "nordic,npm1304"; - reg = <0x14>; - - leds { - compatible = "nordic,npm1304-led"; - nordic,led0-mode = "error"; - nordic,led1-mode = "charging"; - nordic,led2-mode = "host"; - }; - }; }; }; }; diff --git a/tests/drivers/build_all/regulator/i2c.dtsi b/tests/drivers/build_all/regulator/i2c.dtsi index 4c8cb31958a..ea81c2c3886 100644 --- a/tests/drivers/build_all/regulator/i2c.dtsi +++ b/tests/drivers/build_all/regulator/i2c.dtsi @@ -143,17 +143,3 @@ npm2100@8 { LDOSW {}; }; }; - -npm1304@9 { - compatible = "nordic,npm1304"; - reg = <0x9>; - - regulators { - compatible = "nordic,npm1304-regulator"; - - BUCK1 {}; - BUCK2 {}; - LDO1 {}; - LDO2 {}; - }; -}; diff --git a/tests/drivers/build_all/sensor/i2c.dtsi b/tests/drivers/build_all/sensor/i2c.dtsi index 64edbec396a..6ebced54204 100644 --- a/tests/drivers/build_all/sensor/i2c.dtsi +++ b/tests/drivers/build_all/sensor/i2c.dtsi @@ -1331,32 +1331,3 @@ test_i2c_bh1730: bh1730@b4 { compatible = "rohm,bh1730"; reg = <0xb4>; }; - -test_i2c_npm1300: npm1300@b5 { - compatible = "nordic,npm1300"; - reg = <0xb5>; - - charger { - compatible = "nordic,npm1300-charger"; - vbus-limit-microamp = <1000000>; - thermistor-ohms = <10000>; - thermistor-beta = <3380>; - term-microvolt = <4150000>; - current-microamp = <150000>; - dischg-limit-microamp = <1000000>; - }; -}; - -test_i2c_npm1304: npm1304@b6 { - compatible = "nordic,npm1304"; - reg = <0xb6>; - - charger { - compatible = "nordic,npm1304-charger"; - vbus-limit-microamp = <1000000>; - thermistor-ohms = <10000>; - thermistor-beta = <3380>; - term-microvolt = <4150000>; - current-microamp = <10000>; - }; -}; diff --git a/tests/drivers/build_all/watchdog/i2c_devices.overlay b/tests/drivers/build_all/watchdog/i2c_devices.overlay index 0c709d30b06..fcecf91a122 100644 --- a/tests/drivers/build_all/watchdog/i2c_devices.overlay +++ b/tests/drivers/build_all/watchdog/i2c_devices.overlay @@ -41,24 +41,6 @@ compatible = "nordic,npm2100-wdt"; }; }; - - npm1300_pmic: pmic@2 { - compatible = "nordic,npm1300"; - reg = <0x2>; - - npm1300_wdt: watchdog { - compatible = "nordic,npm1300-wdt"; - }; - }; - - npm1304_pmic: pmic@3 { - compatible = "nordic,npm1304"; - reg = <0x3>; - - npm1304_wdt: watchdog { - compatible = "nordic,npm1304-wdt"; - }; - }; }; }; }; From f9a75fe1d24edf736e570e3ea9042c395b5cead5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 645/881] Revert "[nrf fromtree] doc: release: migration-guide-4.2: add npm13xx changes" This reverts commit 393d9d8dec4a106532cf156c51e4500ca8303eb3. Signed-off-by: Jukka Rissanen --- doc/releases/migration-guide-4.2.rst | 40 ---------------------------- 1 file changed, 40 deletions(-) diff --git a/doc/releases/migration-guide-4.2.rst b/doc/releases/migration-guide-4.2.rst index faad669e379..e643142e0ba 100644 --- a/doc/releases/migration-guide-4.2.rst +++ b/doc/releases/migration-guide-4.2.rst @@ -212,11 +212,6 @@ GPIO * ``arduino-nano-header-r3`` is renamed to :dtcompatible:`arduino-nano-header`. Because the R3 comes from the Arduino UNO R3, which has changed the connector from the former version, and is unrelated to the Arduino Nano. -* Moved file ``include/zephyr/dt-bindings/gpio/nordic-npm1300-gpio.h`` to - :zephyr_file:`include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h` and renamed all instances of - ``NPM1300`` to ``NPM13XX`` in the defines -* Renamed ``CONFIG_GPIO_NPM1300`` to :kconfig:option:`CONFIG_GPIO_NPM13XX`, - ``CONFIG_GPIO_NPM1300_INIT_PRIORITY`` to :kconfig:option:`CONFIG_GPIO_NPM13XX_INIT_PRIORITY` I2S === @@ -224,30 +219,6 @@ I2S * configure the MCLK signal as an output. Older driver versions used the macro * ``I2S_OPT_BIT_CLK_SLAVE`` to configure the MCLK signal direction. (:github:`88554`) -LED -=== - -* Renamed ``CONFIG_LED_NPM1300`` to :kconfig:option:`CONFIG_LED_NPM13XX` - -MFD -=== - -* Moved file ``include/zephyr/drivers/mfd/npm1300.h`` to :zephyr_file:`include/zephyr/drivers/mfd/npm13xx.h` - and renamed all instances of ``npm1300``/``NPM1300`` to ``npm13xx``/``NPM13XX`` in the enums and - function names -* Renamed ``CONFIG_MFD_NPM1300`` to :kconfig:option:`CONFIG_MFD_NPM13XX`, - ``CONFIG_MFD_NPM1300_INIT_PRIORITY`` to :kconfig:option:`CONFIG_MFD_NPM13XX_INIT_PRIORITY` - -Regulator -========= - -* Moved file ``include/zephyr/dt-bindings/regulator/npm1300.h`` to - :zephyr_file:`include/zephyr/dt-bindings/regulator/npm13xx.h` and renamed all instances of - ``NPM1300`` to ``NPM13XX`` in the defines -* Renamed ``CONFIG_REGULATOR_NPM1300`` to :kconfig:option:`CONFIG_REGULATOR_NPM13XX`, - ``CONFIG_REGULATOR_NPM1300_COMMON_INIT_PRIORITY`` to :kconfig:option:`REGULATOR_NPM13XX_COMMON_INIT_PRIORITY`, - ``CONFIG_REGULATOR_NPM1300_INIT_PRIORITY`` to :kconfig:option:`CONFIG_REGULATOR_NPM13XX_INIT_PRIORITY` - Sensors ======= @@ -284,12 +255,6 @@ Sensors * The binding file for :dtcompatible:`raspberrypi,pico-temp.yaml` has been renamed to have a name matching the compatible string. -* Moved file ``include/zephyr/drivers/sensor/npm1300_charger.h`` to - :zephyr_file:`include/zephyr/drivers/sensor/npm13xx_charger.h` and renamed all instances of - ``NPM1300`` to ``NPM13XX`` in the enums - -* Renamed ``CONFIG_NPM1300_CHARGER`` to :kconfig:option:`CONFIG_NPM13XX_CHARGER` - Serial ======= @@ -339,11 +304,6 @@ Timer reg-names = "mtime", "mtimecmp"; }; -Watchdog -======== -* Renamed ``CONFIG_WDT_NPM1300`` to :kconfig:option:`CONFIG_WDT_NPM13XX`, - ``CONFIG_WDT_NPM1300_INIT_PRIORITY`` to :kconfig:option:`CONFIG_WDT_NPM13XX_INIT_PRIORITY` - Modem ===== From 5f3a0bdd4162736af27bedc357a410282f5825ab Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 646/881] Revert "[nrf fromtree] drivers: npm13xx: add support for nPM1304" This reverts commit 37b7c9f56998b1b8d9def06a9d7421803edb3c71. Signed-off-by: Jukka Rissanen --- drivers/gpio/Kconfig.npm13xx | 2 +- drivers/gpio/gpio_npm13xx.c | 21 ++- drivers/led/Kconfig.npm13xx | 2 +- drivers/led/led_npm13xx.c | 17 +-- drivers/mfd/Kconfig.npm13xx | 2 +- drivers/mfd/mfd_npm13xx.c | 32 ++--- drivers/regulator/Kconfig.npm13xx | 2 +- drivers/regulator/regulator_npm13xx.c | 60 ++++---- drivers/sensor/nordic/npm13xx_charger/Kconfig | 2 +- .../nordic/npm13xx_charger/npm13xx_charger.c | 133 +++++++----------- drivers/watchdog/Kconfig.npm13xx | 2 +- drivers/watchdog/wdt_npm13xx.c | 20 +-- 12 files changed, 118 insertions(+), 177 deletions(-) diff --git a/drivers/gpio/Kconfig.npm13xx b/drivers/gpio/Kconfig.npm13xx index 1d3bade047d..828b4e1382f 100644 --- a/drivers/gpio/Kconfig.npm13xx +++ b/drivers/gpio/Kconfig.npm13xx @@ -4,7 +4,7 @@ config GPIO_NPM13XX bool "nPM13xx GPIO driver" default y - depends on DT_HAS_NORDIC_NPM1300_GPIO_ENABLED || DT_HAS_NORDIC_NPM1304_GPIO_ENABLED + depends on DT_HAS_NORDIC_NPM1300_GPIO_ENABLED select I2C select MFD help diff --git a/drivers/gpio/gpio_npm13xx.c b/drivers/gpio/gpio_npm13xx.c index d6eeb4b73b0..c74fc244d93 100644 --- a/drivers/gpio/gpio_npm13xx.c +++ b/drivers/gpio/gpio_npm13xx.c @@ -3,6 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_npm1300_gpio + #include #include @@ -210,25 +212,18 @@ static int gpio_npm13xx_init(const struct device *dev) return 0; } -#define GPIO_NPM13XX_DEFINE(partno, n) \ - static const struct gpio_npm13xx_config gpio_##partno##_config##n = { \ +#define GPIO_NPM13XX_DEFINE(n) \ + static const struct gpio_npm13xx_config gpio_npm13xx_config##n = { \ .common = \ { \ .port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n), \ }, \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(n))}; \ \ - static struct gpio_npm13xx_data gpio_##partno##_data##n; \ + static struct gpio_npm13xx_data gpio_npm13xx_data##n; \ \ - DEVICE_DT_INST_DEFINE(n, gpio_npm13xx_init, NULL, &gpio_##partno##_data##n, \ - &gpio_##partno##_config##n, POST_KERNEL, \ + DEVICE_DT_INST_DEFINE(n, gpio_npm13xx_init, NULL, &gpio_npm13xx_data##n, \ + &gpio_npm13xx_config##n, POST_KERNEL, \ CONFIG_GPIO_NPM13XX_INIT_PRIORITY, &gpio_npm13xx_api); -#define DT_DRV_COMPAT nordic_npm1300_gpio -#define GPIO_NPM1300_DEFINE(n) GPIO_NPM13XX_DEFINE(npm1300, n) -DT_INST_FOREACH_STATUS_OKAY(GPIO_NPM1300_DEFINE) - -#undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1304_gpio -#define GPIO_NPM1304_DEFINE(n) GPIO_NPM13XX_DEFINE(npm1304, n) -DT_INST_FOREACH_STATUS_OKAY(GPIO_NPM1304_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(GPIO_NPM13XX_DEFINE) diff --git a/drivers/led/Kconfig.npm13xx b/drivers/led/Kconfig.npm13xx index 5431c7c8326..e3f40f42a19 100644 --- a/drivers/led/Kconfig.npm13xx +++ b/drivers/led/Kconfig.npm13xx @@ -4,7 +4,7 @@ config LED_NPM13XX bool "nPM13xx LED driver" default y - depends on DT_HAS_NORDIC_NPM1300_LED_ENABLED || DT_HAS_NORDIC_NPM1304_LED_ENABLED + depends on DT_HAS_NORDIC_NPM1300_LED_ENABLED select I2C select MFD help diff --git a/drivers/led/led_npm13xx.c b/drivers/led/led_npm13xx.c index f00864fc74a..eed9b1256be 100644 --- a/drivers/led/led_npm13xx.c +++ b/drivers/led/led_npm13xx.c @@ -3,6 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_npm1300_led + #include #include @@ -85,21 +87,14 @@ static int led_npm13xx_init(const struct device *dev) return 0; } -#define LED_NPM13XX_DEFINE(partno, n) \ - static const struct led_npm13xx_config led_##partno##_config##n = { \ +#define LED_NPM13XX_DEFINE(n) \ + static const struct led_npm13xx_config led_npm13xx_config##n = { \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(n)), \ .mode = {DT_INST_ENUM_IDX(n, nordic_led0_mode), \ DT_INST_ENUM_IDX(n, nordic_led1_mode), \ DT_INST_ENUM_IDX(n, nordic_led2_mode)}}; \ \ - DEVICE_DT_INST_DEFINE(n, &led_npm13xx_init, NULL, NULL, &led_##partno##_config##n, \ + DEVICE_DT_INST_DEFINE(n, &led_npm13xx_init, NULL, NULL, &led_npm13xx_config##n, \ POST_KERNEL, CONFIG_LED_INIT_PRIORITY, &led_npm13xx_api); -#define DT_DRV_COMPAT nordic_npm1300_led -#define LED_NPM1300_DEFINE(n) LED_NPM13XX_DEFINE(npm1300, n) -DT_INST_FOREACH_STATUS_OKAY(LED_NPM1300_DEFINE) - -#undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1304_led -#define LED_NPM1304_DEFINE(n) LED_NPM13XX_DEFINE(npm1304, n) -DT_INST_FOREACH_STATUS_OKAY(LED_NPM1304_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(LED_NPM13XX_DEFINE) diff --git a/drivers/mfd/Kconfig.npm13xx b/drivers/mfd/Kconfig.npm13xx index 6170c074aa8..63f18ac9a3b 100644 --- a/drivers/mfd/Kconfig.npm13xx +++ b/drivers/mfd/Kconfig.npm13xx @@ -4,7 +4,7 @@ config MFD_NPM13XX bool "nPM13xx PMIC multi-function device driver" default y - depends on DT_HAS_NORDIC_NPM1300_ENABLED || DT_HAS_NORDIC_NPM1304_ENABLED + depends on DT_HAS_NORDIC_NPM1300_ENABLED select I2C help Enable the Nordic nPM13xx PMIC multi-function device driver diff --git a/drivers/mfd/mfd_npm13xx.c b/drivers/mfd/mfd_npm13xx.c index 0d0b8e89f5f..9847e4a9e49 100644 --- a/drivers/mfd/mfd_npm13xx.c +++ b/drivers/mfd/mfd_npm13xx.c @@ -3,6 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_npm1300 + #include #include @@ -306,26 +308,18 @@ int mfd_npm13xx_remove_callback(const struct device *dev, struct gpio_callback * return gpio_manage_callback(&data->callbacks, callback, false); } -#define MFD_NPM13XX_DEFINE(partno, n) \ - static struct mfd_npm13xx_data mfd_##partno##_data##n; \ +#define MFD_NPM13XX_DEFINE(inst) \ + static struct mfd_npm13xx_data data_##inst; \ \ - static const struct mfd_npm13xx_config mfd_##partno##_config##n = { \ - .i2c = I2C_DT_SPEC_INST_GET(n), \ - .host_int_gpios = GPIO_DT_SPEC_INST_GET_OR(n, host_int_gpios, {0}), \ - .pmic_int_pin = DT_INST_PROP_OR(n, pmic_int_pin, 0), \ - .active_time = DT_INST_ENUM_IDX(n, ship_to_active_time_ms), \ - .lp_reset = DT_INST_ENUM_IDX_OR(n, long_press_reset, 0), \ + static const struct mfd_npm13xx_config config##inst = { \ + .i2c = I2C_DT_SPEC_INST_GET(inst), \ + .host_int_gpios = GPIO_DT_SPEC_INST_GET_OR(inst, host_int_gpios, {0}), \ + .pmic_int_pin = DT_INST_PROP_OR(inst, pmic_int_pin, 0), \ + .active_time = DT_INST_ENUM_IDX(inst, ship_to_active_time_ms), \ + .lp_reset = DT_INST_ENUM_IDX_OR(inst, long_press_reset, 0), \ }; \ \ - DEVICE_DT_INST_DEFINE(n, mfd_npm13xx_init, NULL, &mfd_##partno##_data##n, \ - &mfd_##partno##_config##n, POST_KERNEL, \ - CONFIG_MFD_NPM13XX_INIT_PRIORITY, NULL); - -#define DT_DRV_COMPAT nordic_npm1300 -#define MFD_NPM1300_DEFINE(n) MFD_NPM13XX_DEFINE(npm1300, n) -DT_INST_FOREACH_STATUS_OKAY(MFD_NPM1300_DEFINE) + DEVICE_DT_INST_DEFINE(inst, mfd_npm13xx_init, NULL, &data_##inst, &config##inst, \ + POST_KERNEL, CONFIG_MFD_NPM13XX_INIT_PRIORITY, NULL); -#undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1304 -#define MFD_NPM1304_DEFINE(n) MFD_NPM13XX_DEFINE(npm1304, n) -DT_INST_FOREACH_STATUS_OKAY(MFD_NPM1304_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(MFD_NPM13XX_DEFINE) diff --git a/drivers/regulator/Kconfig.npm13xx b/drivers/regulator/Kconfig.npm13xx index a075ca72dc7..4d243b8cdf8 100644 --- a/drivers/regulator/Kconfig.npm13xx +++ b/drivers/regulator/Kconfig.npm13xx @@ -4,7 +4,7 @@ config REGULATOR_NPM13XX bool "nPM13xx PMIC regulator driver" default y - depends on DT_HAS_NORDIC_NPM1300_REGULATOR_ENABLED || DT_HAS_NORDIC_NPM1304_REGULATOR_ENABLED + depends on DT_HAS_NORDIC_NPM1300_REGULATOR_ENABLED select I2C select MFD help diff --git a/drivers/regulator/regulator_npm13xx.c b/drivers/regulator/regulator_npm13xx.c index c07970bb5c6..89ee1993ed3 100644 --- a/drivers/regulator/regulator_npm13xx.c +++ b/drivers/regulator/regulator_npm13xx.c @@ -3,6 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_npm1300_regulator + #include #include @@ -687,6 +689,9 @@ int regulator_npm13xx_init(const struct device *dev) } ret = regulator_npm13xx_set_pin_ctrl(dev, &config->pwm_gpios, NPM13XX_GPIO_TYPE_PWM); + if (ret != 0) { + return ret; + } return ret; } @@ -707,13 +712,13 @@ static DEVICE_API(regulator, api) = { !!(DT_PROP_BY_IDX(node_id, prop, 1) & GPIO_ACTIVE_LOW)}), \ ({NPM13XX_GPIO_UNUSED, false})) -#define REGULATOR_NPM13XX_DEFINE(partno, node_id, id, _source) \ +#define REGULATOR_NPM13XX_DEFINE(node_id, id, _source) \ BUILD_ASSERT(DT_PROP_LEN_OR(node_id, enable_gpio_config, 2) == 2); \ BUILD_ASSERT(DT_PROP_LEN_OR(node_id, retention_gpio_config, 2) == 2); \ BUILD_ASSERT(DT_PROP_LEN_OR(node_id, pwm_gpio_config, 2) == 2); \ - static struct regulator_npm13xx_data regulator_##partno##_data_##id; \ + static struct regulator_npm13xx_data data_##id; \ \ - static const struct regulator_npm13xx_config regulator_##partno##_config_##id = { \ + static const struct regulator_npm13xx_config config_##id = { \ .common = REGULATOR_DT_COMMON_CONFIG_INIT(node_id), \ .mfd = DEVICE_DT_GET(DT_GPARENT(node_id)), \ .source = _source, \ @@ -725,39 +730,30 @@ static DEVICE_API(regulator, api) = { .active_discharge = DT_PROP(node_id, active_discharge), \ .ldo_disable_workaround = DT_PROP(node_id, nordic_anomaly38_disable_workaround)}; \ \ - DEVICE_DT_DEFINE(node_id, regulator_npm13xx_init, NULL, ®ulator_##partno##_data_##id, \ - ®ulator_##partno##_config_##id, POST_KERNEL, \ - CONFIG_REGULATOR_NPM13XX_INIT_PRIORITY, &api); + DEVICE_DT_DEFINE(node_id, regulator_npm13xx_init, NULL, &data_##id, &config_##id, \ + POST_KERNEL, CONFIG_REGULATOR_NPM13XX_INIT_PRIORITY, &api); -#define REGULATOR_NPM13XX_DEFINE_COND(partno, n, child, source) \ - COND_CODE_1(DT_NODE_EXISTS(DT_INST_CHILD(n, child)), \ - (REGULATOR_NPM13XX_DEFINE(partno, DT_INST_CHILD(n, child), child##n, source)), \ +#define REGULATOR_NPM13XX_DEFINE_COND(inst, child, source) \ + COND_CODE_1(DT_NODE_EXISTS(DT_INST_CHILD(inst, child)), \ + (REGULATOR_NPM13XX_DEFINE(DT_INST_CHILD(inst, child), child##inst, source)), \ ()) -#define REGULATOR_NPM13XX_DEFINE_ALL(partno, n) \ - static const struct regulator_npm13xx_pconfig regulator_##partno##_config##n = { \ - .mfd = DEVICE_DT_GET(DT_INST_PARENT(n)), \ - .dvs_state_pins = {GPIO_DT_SPEC_INST_GET_BY_IDX_OR(n, dvs_gpios, 0, {0}), \ - GPIO_DT_SPEC_INST_GET_BY_IDX_OR(n, dvs_gpios, 1, {0}), \ - GPIO_DT_SPEC_INST_GET_BY_IDX_OR(n, dvs_gpios, 2, {0}), \ - GPIO_DT_SPEC_INST_GET_BY_IDX_OR(n, dvs_gpios, 3, {0}), \ - GPIO_DT_SPEC_INST_GET_BY_IDX_OR(n, dvs_gpios, 4, {0})}}; \ +#define REGULATOR_NPM13XX_DEFINE_ALL(inst) \ + static const struct regulator_npm13xx_pconfig config_##inst = { \ + .mfd = DEVICE_DT_GET(DT_INST_PARENT(inst)), \ + .dvs_state_pins = {GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 0, {0}), \ + GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 1, {0}), \ + GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 2, {0}), \ + GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 3, {0}), \ + GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 4, {0})}}; \ \ - DEVICE_DT_INST_DEFINE(n, regulator_npm13xx_common_init, NULL, NULL, \ - ®ulator_##partno##_config##n, POST_KERNEL, \ - CONFIG_REGULATOR_NPM13XX_COMMON_INIT_PRIORITY, \ + DEVICE_DT_INST_DEFINE(inst, regulator_npm13xx_common_init, NULL, NULL, &config_##inst, \ + POST_KERNEL, CONFIG_REGULATOR_NPM13XX_COMMON_INIT_PRIORITY, \ &parent_api); \ \ - REGULATOR_NPM13XX_DEFINE_COND(partno, n, buck1, NPM13XX_SOURCE_BUCK1) \ - REGULATOR_NPM13XX_DEFINE_COND(partno, n, buck2, NPM13XX_SOURCE_BUCK2) \ - REGULATOR_NPM13XX_DEFINE_COND(partno, n, ldo1, NPM13XX_SOURCE_LDO1) \ - REGULATOR_NPM13XX_DEFINE_COND(partno, n, ldo2, NPM13XX_SOURCE_LDO2) - -#define DT_DRV_COMPAT nordic_npm1300_regulator -#define REGULATOR_NPM1300_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(npm1300, n) -DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM1300_DEFINE_ALL) + REGULATOR_NPM13XX_DEFINE_COND(inst, buck1, NPM13XX_SOURCE_BUCK1) \ + REGULATOR_NPM13XX_DEFINE_COND(inst, buck2, NPM13XX_SOURCE_BUCK2) \ + REGULATOR_NPM13XX_DEFINE_COND(inst, ldo1, NPM13XX_SOURCE_LDO1) \ + REGULATOR_NPM13XX_DEFINE_COND(inst, ldo2, NPM13XX_SOURCE_LDO2) -#undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1304_regulator -#define REGULATOR_NPM1304_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(npm1304, n) -DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM1304_DEFINE_ALL) +DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM13XX_DEFINE_ALL) diff --git a/drivers/sensor/nordic/npm13xx_charger/Kconfig b/drivers/sensor/nordic/npm13xx_charger/Kconfig index a113a4ede47..e511e393fa2 100644 --- a/drivers/sensor/nordic/npm13xx_charger/Kconfig +++ b/drivers/sensor/nordic/npm13xx_charger/Kconfig @@ -5,7 +5,7 @@ config NPM13XX_CHARGER bool "nPM13xx Charger" default y - depends on DT_HAS_NORDIC_NPM1300_CHARGER_ENABLED || DT_HAS_NORDIC_NPM1304_CHARGER_ENABLED + depends on DT_HAS_NORDIC_NPM1300_CHARGER_ENABLED select I2C select MFD select REQUIRES_FULL_LIBC diff --git a/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c b/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c index 08e2763e655..bf5afe2d3f4 100644 --- a/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c +++ b/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c @@ -3,6 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_npm1300_charger + #include #include #include @@ -14,10 +16,7 @@ struct npm13xx_charger_config { const struct device *mfd; int32_t term_microvolt; int32_t term_warm_microvolt; - const struct linear_range term_volt_ranges[2U]; int32_t current_microamp; - const struct linear_range current_range; - const int32_t full_scale_discharge_factors[2U]; int32_t dischg_limit_microamp; uint8_t dischg_limit_idx; int32_t vbus_limit_microamp; @@ -138,22 +137,14 @@ struct adc_results_t { #define DIETEMP_FACTOR_DIV 5000 /* Linear range for charger terminal voltage */ -#define NPM1300_CHARGER_VOLT_RANGES \ - {LINEAR_RANGE_INIT(3500000, 50000, 0U, 3U), LINEAR_RANGE_INIT(4000000, 50000, 4U, 13U)} -#define NPM1304_CHARGER_VOLT_RANGES \ - {LINEAR_RANGE_INIT(3600000, 50000, 0U, 1U), LINEAR_RANGE_INIT(4000000, 50000, 2U, 15U)} +static const struct linear_range charger_volt_ranges[] = { + LINEAR_RANGE_INIT(3500000, 50000, 0U, 3U), LINEAR_RANGE_INIT(4000000, 50000, 4U, 13U)}; /* Linear range for charger current */ -#define NPM1300_CHARGER_CURRENT_RANGE LINEAR_RANGE_INIT(32000, 2000, 16U, 400U) -#define NPM1304_CHARGER_CURRENT_RANGE LINEAR_RANGE_INIT(4000, 500, 8U, 200U) - -/* Full-scale factors for calculating current */ -#define NPM1300_FULL_SCALE_DISCHARGE_FACTORS {112, 100} -#define NPM1304_FULL_SCALE_DISCHARGE_FACTORS {415, 400} -static const int32_t full_scale_charge_factors[] = {125, 100}; +static const struct linear_range charger_current_range = LINEAR_RANGE_INIT(32000, 2000, 16U, 400U); /* Allowed values for discharge limit */ -static const uint16_t npm1300_discharge_limits[] = {84U, 415U}; +static const uint16_t discharge_limits[] = {84U, 415U}; /* Linear range for vbusin current limit */ static const struct linear_range vbus_current_range = LINEAR_RANGE_INIT(100000, 100000, 1U, 15U); @@ -202,49 +193,41 @@ static void calc_current(const struct npm13xx_charger_config *const config, int32_t full_scale_ua; int32_t current_ua; + /* Largest value of discharge limit and charge limit is 1A. + * We can therefore guarantee that multiplying the uA by 1000 does not overflow. + * 1000 * 1'000'000 uA < 2**31 + * 1000000000 < 2147483648 + */ switch (data->ibat_stat) { case IBAT_STAT_DISCHARGE: - /* nPM1300: Largest discharge limit is 1A. Multiplying it by 112 will not overflow. - * 112 * -1_000_000 > INT32_MIN - * -112_000_000 > -2_147_483_648 - * nPM1304: Discharge limit is 125mA. Multiplying it by 415 will not overflow. - * 415 * -125_000 > INT32_MIN - * -51_875_000 > -2_147_483_648 - */ - full_scale_ua = -config->dischg_limit_microamp * - config->full_scale_discharge_factors[0] / - config->full_scale_discharge_factors[1]; + /* Ref: PS v1.2 Section 7.1.7: Full scale multiplied by 1.12 */ + full_scale_ua = -(1000 * config->dischg_limit_microamp) / 893; break; case IBAT_STAT_CHARGE_TRICKLE: /* Fallthrough */ case IBAT_STAT_CHARGE_COOL: /* Fallthrough */ case IBAT_STAT_CHARGE_NORMAL: - /* nPM1300: Largest charge limit is 800mA. Multiplying it by 125 will not overflow. - * 125 * 800_000 < INT32_MAX - * 100_000_000 < 2_147_483_647 - * nPM1304: Largest charge limit is even lower - no overflow. - */ - full_scale_ua = config->current_microamp * full_scale_charge_factors[0] / - full_scale_charge_factors[1]; + /* Ref: PS v1.2 Section 7.1.7: Full scale multiplied by 1.25 */ + full_scale_ua = (1000 * config->current_microamp) / 800; break; default: full_scale_ua = 0; break; } - /* Largest possible value for data->current is 1023 (10-bit ADC) - * Limits for full_scale_ua are -1_120_000 and 1_000_000 - * 1023 * -1_120_000 > INT32_MIN - * -1_145_760_000 > -2_147_483_648 - * 1023 * 1_000_000 < INT32_MAX - * 1_023_000_000 < 2_147_483_647 + /* Largest possible value for data->current is 1023 + * Limits for full_scale_ua are -1'119'820 and 1'000'000 + * 1023 * -1119820 > -2**31 + * -1145575860 > -2147483648 + * 1023 * 1000000 < 2**31 + * 1023000000 < 2147483648 */ __ASSERT_NO_MSG(data->current <= 1023); __ASSERT_NO_MSG(full_scale_ua <= 1000000); - __ASSERT_NO_MSG(full_scale_ua >= -1120000); + __ASSERT_NO_MSG(full_scale_ua >= -1119820); - current_ua = (data->current * full_scale_ua) / 1023; + current_ua = (data->current * full_scale_ua) / 1024; (void)sensor_value_from_micro(valp, current_ua); } @@ -341,6 +324,9 @@ int npm13xx_charger_sample_fetch(const struct device *dev, enum sensor_channel c /* Read vbus status */ ret = mfd_npm13xx_reg_read(config->mfd, VBUS_BASE, VBUS_OFFSET_STATUS, &data->vbus_stat); + if (ret != 0) { + return ret; + } return ret; } @@ -546,9 +532,9 @@ int npm13xx_charger_init(const struct device *dev) } /* Configure termination voltages */ - ret = linear_range_group_get_win_index( - config->term_volt_ranges, ARRAY_SIZE(config->term_volt_ranges), - config->term_microvolt, config->term_microvolt, &idx); + ret = linear_range_group_get_win_index(charger_volt_ranges, ARRAY_SIZE(charger_volt_ranges), + config->term_microvolt, config->term_microvolt, + &idx); if (ret == -EINVAL) { return ret; } @@ -557,9 +543,9 @@ int npm13xx_charger_init(const struct device *dev) return ret; } - ret = linear_range_group_get_win_index( - config->term_volt_ranges, ARRAY_SIZE(config->term_volt_ranges), - config->term_warm_microvolt, config->term_warm_microvolt, &idx); + ret = linear_range_group_get_win_index(charger_volt_ranges, ARRAY_SIZE(charger_volt_ranges), + config->term_warm_microvolt, + config->term_warm_microvolt, &idx); if (ret == -EINVAL) { return ret; } @@ -570,29 +556,22 @@ int npm13xx_charger_init(const struct device *dev) } /* Set current, allow rounding down to closest value */ - ret = linear_range_get_win_index(&config->current_range, - config->current_microamp - config->current_range.step + 1, + ret = linear_range_get_win_index(&charger_current_range, + config->current_microamp - charger_current_range.step, config->current_microamp, &idx); if (ret == -EINVAL) { return ret; } - if (config->dischg_limit_idx == UINT8_MAX) { - /* Set only charge current MSB for nPM1304 */ - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET, idx); - } else { - /* Set charge current MSB and LSB and discharge limit for nPM1300 */ - ret = mfd_npm13xx_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET, idx / 2U, - idx & 1U); - if (ret != 0) { - return ret; - } - - ret = mfd_npm13xx_reg_write2( - config->mfd, CHGR_BASE, CHGR_OFFSET_ISET_DISCHG, - npm1300_discharge_limits[config->dischg_limit_idx] / 2U, - npm1300_discharge_limits[config->dischg_limit_idx] & 1U); + ret = mfd_npm13xx_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET, idx / 2U, idx & 1U); + if (ret != 0) { + return ret; } + + /* Set discharge limit */ + ret = mfd_npm13xx_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET_DISCHG, + discharge_limits[config->dischg_limit_idx] / 2U, + discharge_limits[config->dischg_limit_idx] & 1U); if (ret != 0) { return ret; } @@ -687,23 +666,19 @@ static DEVICE_API(sensor, npm13xx_charger_battery_driver_api) = { .attr_get = npm13xx_charger_attr_get, }; -#define NPM13XX_CHARGER_INIT(partno, n) \ - BUILD_ASSERT(DT_INST_ENUM_IDX_OR(n, dischg_limit_microamp, 0) < \ - ARRAY_SIZE(npm1300_discharge_limits)); \ +#define NPM13XX_CHARGER_INIT(n) \ + BUILD_ASSERT(DT_INST_ENUM_IDX(n, dischg_limit_microamp) < ARRAY_SIZE(discharge_limits)); \ \ - static struct npm13xx_charger_data charger_##partno##_data##n; \ + static struct npm13xx_charger_data npm13xx_charger_data_##n; \ \ - static const struct npm13xx_charger_config charger_##partno##_config##n = { \ + static const struct npm13xx_charger_config npm13xx_charger_config_##n = { \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(n)), \ .term_microvolt = DT_INST_PROP(n, term_microvolt), \ .term_warm_microvolt = \ DT_INST_PROP_OR(n, term_warm_microvolt, DT_INST_PROP(n, term_microvolt)), \ - .term_volt_ranges = partno##_CHARGER_VOLT_RANGES, \ .current_microamp = DT_INST_PROP(n, current_microamp), \ - .current_range = partno##_CHARGER_CURRENT_RANGE, \ - .full_scale_discharge_factors = partno##_FULL_SCALE_DISCHARGE_FACTORS, \ .dischg_limit_microamp = DT_INST_PROP(n, dischg_limit_microamp), \ - .dischg_limit_idx = DT_INST_ENUM_IDX_OR(n, dischg_limit_microamp, UINT8_MAX), \ + .dischg_limit_idx = DT_INST_ENUM_IDX(n, dischg_limit_microamp), \ .vbus_limit_microamp = DT_INST_PROP(n, vbus_limit_microamp), \ .thermistor_ohms = DT_INST_PROP(n, thermistor_ohms), \ .thermistor_idx = DT_INST_ENUM_IDX(n, thermistor_ohms), \ @@ -721,17 +696,9 @@ static DEVICE_API(sensor, npm13xx_charger_battery_driver_api) = { DT_INST_PROP_OR(n, thermistor_warm_millidegrees, INT32_MAX), \ DT_INST_PROP_OR(n, thermistor_hot_millidegrees, INT32_MAX)}}; \ \ - SENSOR_DEVICE_DT_INST_DEFINE(n, &npm13xx_charger_init, NULL, &charger_##partno##_data##n, \ - &charger_##partno##_config##n, POST_KERNEL, \ + SENSOR_DEVICE_DT_INST_DEFINE(n, &npm13xx_charger_init, NULL, &npm13xx_charger_data_##n, \ + &npm13xx_charger_config_##n, POST_KERNEL, \ CONFIG_SENSOR_INIT_PRIORITY, \ &npm13xx_charger_battery_driver_api); -#undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1300_charger -#define NPM1300_CHARGER_INIT(n) NPM13XX_CHARGER_INIT(NPM1300, n) -DT_INST_FOREACH_STATUS_OKAY(NPM1300_CHARGER_INIT) - -#undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1304_charger -#define NPM1304_CHARGER_INIT(n) NPM13XX_CHARGER_INIT(NPM1304, n) -DT_INST_FOREACH_STATUS_OKAY(NPM1304_CHARGER_INIT) +DT_INST_FOREACH_STATUS_OKAY(NPM13XX_CHARGER_INIT) diff --git a/drivers/watchdog/Kconfig.npm13xx b/drivers/watchdog/Kconfig.npm13xx index 910da6574a9..2318349c85e 100644 --- a/drivers/watchdog/Kconfig.npm13xx +++ b/drivers/watchdog/Kconfig.npm13xx @@ -4,7 +4,7 @@ config WDT_NPM13XX bool "nPM13xx Watchdog driver" default y - depends on DT_HAS_NORDIC_NPM1300_WDT_ENABLED || DT_HAS_NORDIC_NPM1304_WDT_ENABLED + depends on DT_HAS_NORDIC_NPM1300_WDT_ENABLED select I2C select MFD help diff --git a/drivers/watchdog/wdt_npm13xx.c b/drivers/watchdog/wdt_npm13xx.c index 351da6b7d5a..cfbee7f3398 100644 --- a/drivers/watchdog/wdt_npm13xx.c +++ b/drivers/watchdog/wdt_npm13xx.c @@ -3,6 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_npm13xx_wdt + #include #include @@ -152,23 +154,15 @@ static int wdt_npm13xx_init(const struct device *dev) return 0; } -#define WDT_NPM13XX_DEFINE(partno, n) \ - static struct wdt_npm13xx_data wdt_##partno##_data##n; \ +#define WDT_NPM13XX_DEFINE(n) \ + static struct wdt_npm13xx_data data##n; \ \ - static const struct wdt_npm13xx_config wdt_##partno##_config##n = { \ + static const struct wdt_npm13xx_config config##n = { \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(n)), \ .reset_gpios = GPIO_DT_SPEC_INST_GET_OR(n, reset_gpios, {0}), \ }; \ \ - DEVICE_DT_INST_DEFINE(n, &wdt_npm13xx_init, NULL, &wdt_##partno##_data##n, \ - &wdt_##partno##_config##n, POST_KERNEL, \ + DEVICE_DT_INST_DEFINE(n, &wdt_npm13xx_init, NULL, &data##n, &config##n, POST_KERNEL, \ CONFIG_WDT_NPM13XX_INIT_PRIORITY, &wdt_npm13xx_api); -#define DT_DRV_COMPAT nordic_npm1300_wdt -#define WDT_NPM1300_DEFINE(n) WDT_NPM13XX_DEFINE(npm1300, n) -DT_INST_FOREACH_STATUS_OKAY(WDT_NPM1300_DEFINE) - -#undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1304_wdt -#define WDT_NPM1304_DEFINE(n) WDT_NPM13XX_DEFINE(npm1304, n) -DT_INST_FOREACH_STATUS_OKAY(WDT_NPM1304_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(WDT_NPM13XX_DEFINE) From 088353244aef518b6de87b5058223eef47c746e3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 647/881] Revert "[nrf fromtree] dts: bindings: add npm1304 extracting common from npm1300" This reverts commit 0ebf53410c2f811c93db101ee17a1e2914261ee8. Signed-off-by: Jukka Rissanen --- dts/bindings/gpio/nordic,npm1304-gpio.yaml | 12 --- dts/bindings/led/nordic,npm1300-led.yaml | 28 ++++++- dts/bindings/led/nordic,npm1304-led.yaml | 13 --- .../led/nordic,npm13xx-led-common.yaml | 32 ------- dts/bindings/mfd/nordic,npm1300.yaml | 38 ++++++++- dts/bindings/mfd/nordic,npm1304.yaml | 8 -- dts/bindings/mfd/nordic,npm13xx-common.yaml | 42 ---------- .../regulator/nordic,npm1300-regulator.yaml | 80 +++++++++++++++++- .../regulator/nordic,npm1304-regulator.yaml | 35 -------- .../nordic,npm13xx-regulator-common.yaml | 84 ------------------- .../sensor/nordic,npm1300-charger.yaml | 79 ++++++++++++++++- .../sensor/nordic,npm1304-charger.yaml | 48 ----------- .../sensor/nordic,npm13xx-charger-common.yaml | 83 ------------------ dts/bindings/watchdog/nordic,npm1304-wdt.yaml | 13 --- 14 files changed, 221 insertions(+), 374 deletions(-) delete mode 100644 dts/bindings/gpio/nordic,npm1304-gpio.yaml delete mode 100644 dts/bindings/led/nordic,npm1304-led.yaml delete mode 100644 dts/bindings/led/nordic,npm13xx-led-common.yaml delete mode 100644 dts/bindings/mfd/nordic,npm1304.yaml delete mode 100644 dts/bindings/mfd/nordic,npm13xx-common.yaml delete mode 100644 dts/bindings/regulator/nordic,npm1304-regulator.yaml delete mode 100644 dts/bindings/regulator/nordic,npm13xx-regulator-common.yaml delete mode 100644 dts/bindings/sensor/nordic,npm1304-charger.yaml delete mode 100644 dts/bindings/sensor/nordic,npm13xx-charger-common.yaml delete mode 100644 dts/bindings/watchdog/nordic,npm1304-wdt.yaml diff --git a/dts/bindings/gpio/nordic,npm1304-gpio.yaml b/dts/bindings/gpio/nordic,npm1304-gpio.yaml deleted file mode 100644 index a6ff1a4656c..00000000000 --- a/dts/bindings/gpio/nordic,npm1304-gpio.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: nPM1304 GPIO Controller - -compatible: "nordic,npm1304-gpio" - -include: gpio-controller.yaml - -gpio-cells: - - pin - - flags diff --git a/dts/bindings/led/nordic,npm1300-led.yaml b/dts/bindings/led/nordic,npm1300-led.yaml index 3c240a94e35..90c420832f9 100644 --- a/dts/bindings/led/nordic,npm1300-led.yaml +++ b/dts/bindings/led/nordic,npm1300-led.yaml @@ -10,4 +10,30 @@ description: | compatible: "nordic,npm1300-led" -include: "nordic,npm13xx-led-common.yaml" +properties: + nordic,led0-mode: + type: string + required: true + enum: + - error + - charging + - host + description: LED 0 mode + + nordic,led1-mode: + type: string + required: true + enum: + - error + - charging + - host + description: LED 1 mode + + nordic,led2-mode: + type: string + required: true + enum: + - error + - charging + - host + description: LED 2 mode diff --git a/dts/bindings/led/nordic,npm1304-led.yaml b/dts/bindings/led/nordic,npm1304-led.yaml deleted file mode 100644 index d0e66857465..00000000000 --- a/dts/bindings/led/nordic,npm1304-led.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic nPM1304 LED controller - - The nPM1304 has three LED outputs. - Each LED can automatically display error or charging status, - or be controlled by software. - -compatible: "nordic,npm1304-led" - -include: "nordic,npm13xx-led-common.yaml" diff --git a/dts/bindings/led/nordic,npm13xx-led-common.yaml b/dts/bindings/led/nordic,npm13xx-led-common.yaml deleted file mode 100644 index 6171258d785..00000000000 --- a/dts/bindings/led/nordic,npm13xx-led-common.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic nPM13xx LED controller common properties - -properties: - nordic,led0-mode: - type: string - required: true - enum: - - error - - charging - - host - description: LED 0 mode - - nordic,led1-mode: - type: string - required: true - enum: - - error - - charging - - host - description: LED 1 mode - - nordic,led2-mode: - type: string - required: true - enum: - - error - - charging - - host - description: LED 2 mode diff --git a/dts/bindings/mfd/nordic,npm1300.yaml b/dts/bindings/mfd/nordic,npm1300.yaml index accd7887c95..1fdfb42ef93 100644 --- a/dts/bindings/mfd/nordic,npm1300.yaml +++ b/dts/bindings/mfd/nordic,npm1300.yaml @@ -5,4 +5,40 @@ description: Nordic nPM1300 compatible: "nordic,npm1300" -include: "nordic,npm13xx-common.yaml" +include: i2c-device.yaml + +properties: + reg: + required: true + + host-int-gpios: + type: phandle-array + description: Host pin for interrupt input + + pmic-int-pin: + type: int + description: Pmic pin number for interrupt output + + ship-to-active-time-ms: + type: int + description: | + Press duration required to wake from ship / hibernate in ms. + The default is the device powerup value. + enum: + - 16 + - 32 + - 64 + - 96 + - 304 + - 608 + - 1008 + - 3008 + default: 96 + + long-press-reset: + type: string + description: Long press reset configuration + enum: + - "one-button" + - "disabled" + - "two-button" diff --git a/dts/bindings/mfd/nordic,npm1304.yaml b/dts/bindings/mfd/nordic,npm1304.yaml deleted file mode 100644 index a861cd79e48..00000000000 --- a/dts/bindings/mfd/nordic,npm1304.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic nPM1304 - -compatible: "nordic,npm1304" - -include: nordic,npm13xx-common.yaml diff --git a/dts/bindings/mfd/nordic,npm13xx-common.yaml b/dts/bindings/mfd/nordic,npm13xx-common.yaml deleted file mode 100644 index ed2bf7cbf68..00000000000 --- a/dts/bindings/mfd/nordic,npm13xx-common.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic nPM13xx common properties - -include: i2c-device.yaml - -properties: - reg: - required: true - - host-int-gpios: - type: phandle-array - description: Host pin for interrupt input - - pmic-int-pin: - type: int - description: Pmic pin number for interrupt output - - ship-to-active-time-ms: - type: int - description: | - Press duration required to wake from ship / hibernate in ms. - The default is the device powerup value. - enum: - - 16 - - 32 - - 64 - - 96 - - 304 - - 608 - - 1008 - - 3008 - default: 96 - - long-press-reset: - type: string - description: Long press reset configuration - enum: - - "one-button" - - "disabled" - - "two-button" diff --git a/dts/bindings/regulator/nordic,npm1300-regulator.yaml b/dts/bindings/regulator/nordic,npm1300-regulator.yaml index e42199b68dd..1b77f6c1ab4 100644 --- a/dts/bindings/regulator/nordic,npm1300-regulator.yaml +++ b/dts/bindings/regulator/nordic,npm1300-regulator.yaml @@ -32,4 +32,82 @@ description: | compatible: "nordic,npm1300-regulator" -include: "nordic,npm13xx-regulator-common.yaml" +include: base.yaml + +properties: + dvs-gpios: + type: phandle-array + description: | + List of SOC GPIOs connected to PMIC GPIOs. + Set_dvs_mode will drive these pins as follows: + DVS mode 1 will enable the first pin + DVS mode 2 will enable the second pin + DVS mode 3 will drive the first and second pins + etc. + The effect of the mode change is defined by the enable-gpios + and pwm_gpios fields for each of the regulator blocks. + +child-binding: + include: + - name: regulator.yaml + property-allowlist: + - regulator-always-on + - regulator-boot-on + - regulator-boot-off + - regulator-min-microvolt + - regulator-max-microvolt + - regulator-init-microvolt + - regulator-allowed-modes + - regulator-initial-mode + - regulator-min-microamp + - regulator-max-microamp + - startup-delay-us + - off-on-delay-us + + properties: + retention-microvolt: + type: int + description: | + Retention mode voltage in microvolts. + + enable-gpio-config: + type: array + description: | + Regulator enable controlled by specified GPIO pin . + When set regulator must be enabled/disabled using set_dvs_mode. + + pwm-gpio-config: + type: array + description: | + Regulator enable controlled by specified GPIO pin . + When set regulator must be enabled/disabled using set_dvs_mode. + + retention-gpio-config: + type: array + description: | + Retention mode controlled by specified GPIO pin . + + soft-start-microamp: + type: int + enum: + - 10000 + - 20000 + - 35000 + - 50000 + description: | + Soft start current limit in microamps. + + active-discharge: + type: boolean + description: | + Enable active-discharge on the BUCK/LDO/LDSW output when disabled. + + nordic,anomaly38-disable-workaround: + type: boolean + description: | + Disable the SW workaround for nPM1300 anomaly #38. + When nPM1300 is in ULP mode, LDO is supplied from VSYS and + then LDO is enabled, it can take long time until the LDO + output has reached its target voltage. To avoid this, an i2c + read is performed shortly after an LDO is enabled. + See nPM1300 Errata manual for more details. diff --git a/dts/bindings/regulator/nordic,npm1304-regulator.yaml b/dts/bindings/regulator/nordic,npm1304-regulator.yaml deleted file mode 100644 index 51ae13e675b..00000000000 --- a/dts/bindings/regulator/nordic,npm1304-regulator.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic nPM1304 PMIC - - The PMIC has two buck converters and two LDOs. - The regulators need to be defined as child nodes, strictly following the - BUCK1,2 LDO1..2, node names. For - example: - - pmic@6b { - reg = <0x6b>; - ... - regulators { - compatible = "nordic,npm1304-regulator"; - - BUCK1 { - /* all properties for BUCK1 */ - }; - BUCK2 { - /* all properties for BUCK2 */ - }; - LDO1 { - /* all properties for LDO1 */ - }; - LDO2 { - /* all properties for LDO2 */ - }; - }; - }; - -compatible: "nordic,npm1304-regulator" - -include: "nordic,npm13xx-regulator-common.yaml" diff --git a/dts/bindings/regulator/nordic,npm13xx-regulator-common.yaml b/dts/bindings/regulator/nordic,npm13xx-regulator-common.yaml deleted file mode 100644 index 35900c7ba37..00000000000 --- a/dts/bindings/regulator/nordic,npm13xx-regulator-common.yaml +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic nPM13xx PMIC regulators common properties - -include: base.yaml - -properties: - dvs-gpios: - type: phandle-array - description: | - List of SOC GPIOs connected to PMIC GPIOs. - Set_dvs_mode will drive these pins as follows: - DVS mode 1 will enable the first pin - DVS mode 2 will enable the second pin - DVS mode 3 will drive the first and second pins - etc. - The effect of the mode change is defined by the enable-gpios - and pwm_gpios fields for each of the regulator blocks. - -child-binding: - include: - - name: regulator.yaml - property-allowlist: - - regulator-always-on - - regulator-boot-on - - regulator-boot-off - - regulator-min-microvolt - - regulator-max-microvolt - - regulator-init-microvolt - - regulator-allowed-modes - - regulator-initial-mode - - regulator-min-microamp - - regulator-max-microamp - - startup-delay-us - - off-on-delay-us - - properties: - retention-microvolt: - type: int - description: | - Retention mode voltage in microvolts. - - enable-gpio-config: - type: array - description: | - Regulator enable controlled by specified GPIO pin . - When set regulator must be enabled/disabled using set_dvs_mode. - - pwm-gpio-config: - type: array - description: | - Regulator enable controlled by specified GPIO pin . - When set regulator must be enabled/disabled using set_dvs_mode. - - retention-gpio-config: - type: array - description: | - Retention mode controlled by specified GPIO pin . - - soft-start-microamp: - type: int - enum: - - 10000 - - 20000 - - 35000 - - 50000 - description: | - Soft start current limit in microamps. - - active-discharge: - type: boolean - description: | - Enable active-discharge on the BUCK/LDO/LDSW output when disabled. - - nordic,anomaly38-disable-workaround: - type: boolean - description: | - Disable the SW workaround for nPM13xx anomaly #38. - When nPM13xx is in ULP mode, LDO is supplied from VSYS and - then LDO is enabled, it can take long time until the LDO - output has reached its target voltage. To avoid this, an i2c - read is performed shortly after an LDO is enabled. - See nPM13xx Errata manual for more details. diff --git a/dts/bindings/sensor/nordic,npm1300-charger.yaml b/dts/bindings/sensor/nordic,npm1300-charger.yaml index af825cc5970..3fb83a85174 100644 --- a/dts/bindings/sensor/nordic,npm1300-charger.yaml +++ b/dts/bindings/sensor/nordic,npm1300-charger.yaml @@ -8,7 +8,7 @@ description: NPM1300 PMIC Charger compatible: "nordic,npm1300-charger" -include: "nordic,npm13xx-charger-common.yaml" +include: [sensor-device.yaml] properties: term-microvolt: @@ -31,6 +31,7 @@ properties: description: | Charge current in uA. Available range is 32 mA to 800 mA in 2mA steps. + The value specified will be rounded down to the closest implemented value. dischg-limit-microamp: type: int @@ -42,6 +43,60 @@ properties: Discharge current limit in uA. Available values are 200 mA and 1000 mA. + vbus-limit-microamp: + type: int + required: true + description: | + Vbus current limit in uA. + Available range is 100 mA to 1500 mA in 100 mA steps. + + thermistor-ohms: + type: int + required: true + enum: + - 0 + - 10000 + - 47000 + - 100000 + description: Thermistor nominal resistance type in ohms. + + thermistor-beta: + type: int + required: true + description: Beta value of selected thermistor. + + thermistor-cold-millidegrees: + type: int + description: Thermistor cold threshold in milli-degrees + + thermistor-cool-millidegrees: + type: int + description: Thermistor cool threshold in milli-degrees + + thermistor-warm-millidegrees: + type: int + description: Thermistor warm threshold in milli-degrees + + thermistor-hot-millidegrees: + type: int + description: Thermistor hot threshold in milli-degrees + + charging-enable: + type: boolean + description: | + Enable charging. + + trickle-microvolt: + type: int + enum: + - 2900000 + - 2500000 + default: 2900000 + description: | + Trickle voltage threshold in uV. + Trickle charging is enabled below this value. + If omitted the device default of 2.9V is used. + term-current-percent: type: int enum: @@ -52,3 +107,25 @@ properties: Termination current, as a percentage of current-microamp. Charge completes when the charge current falls below this value. If omitted the device default of 10% is used. + + vbatlow-charge-enable: + type: boolean + description: | + Allow charging when below the vbatlow threshold. + + disable-recharge: + type: boolean + description: | + Disable automatic recharge. + + dietemp-stop-millidegrees: + type: int + description: | + Die temperature halt threshold in milli-degrees. + When die temperature exceeds this threshold, charging will be inhibited. + + dietemp-resume-millidegrees: + type: int + description: | + Die temperature resume threshold in milli-degrees. + When die temperature falls below this threshold, charging will be permitted. diff --git a/dts/bindings/sensor/nordic,npm1304-charger.yaml b/dts/bindings/sensor/nordic,npm1304-charger.yaml deleted file mode 100644 index 70a1a754b81..00000000000 --- a/dts/bindings/sensor/nordic,npm1304-charger.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: nPM1304 PMIC Charger - -compatible: "nordic,npm1304-charger" - -include: "nordic,npm13xx-charger-common.yaml" - -properties: - term-microvolt: - type: int - required: true - description: | - Charge termination voltage in uV. - Available range is 3.6 V to 3.65 V and 4.0 V to 4.65 V in 50 mV steps. - - term-warm-microvolt: - type: int - description: | - Charge termination voltage when warm in uV. - Available range is 3.6 V to 3.65 V and 4.0 V to 4.65 V in 50 mV steps. - If omitted, the term-microvolt value will be used. - - current-microamp: - type: int - required: true - description: | - Charge current in uA. - Available range is 4 mA to 100 mA in 0.5 mA steps. - - dischg-limit-microamp: - type: int - const: 125000 - default: 125000 - description: | - Discharge current limit in uA. Fixed to 125 mA on nPM1304. - - term-current-percent: - type: int - enum: - - 10 - - 5 - default: 10 - description: | - Termination current, as a percentage of current-microamp. - Charge completes when the charge current falls below this value. - If omitted the device default of 10% is used. diff --git a/dts/bindings/sensor/nordic,npm13xx-charger-common.yaml b/dts/bindings/sensor/nordic,npm13xx-charger-common.yaml deleted file mode 100644 index c24f279c7b2..00000000000 --- a/dts/bindings/sensor/nordic,npm13xx-charger-common.yaml +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: nPM13xx PMIC Charger common properties - -include: sensor-device.yaml - -properties: - vbus-limit-microamp: - type: int - required: true - description: | - Vbus current limit in uA. - Available range is 100 mA to 1500 mA in 100 mA steps. - - thermistor-ohms: - type: int - required: true - enum: - - 0 - - 10000 - - 47000 - - 100000 - description: Thermistor nominal resistance type in ohms. - - thermistor-beta: - type: int - required: true - description: Beta value of selected thermistor. - - thermistor-cold-millidegrees: - type: int - description: Thermistor cold threshold in milli-degrees - - thermistor-cool-millidegrees: - type: int - description: Thermistor cool threshold in milli-degrees - - thermistor-warm-millidegrees: - type: int - description: Thermistor warm threshold in milli-degrees - - thermistor-hot-millidegrees: - type: int - description: Thermistor hot threshold in milli-degrees - - charging-enable: - type: boolean - description: | - Enable charging. - - trickle-microvolt: - type: int - enum: - - 2900000 - - 2500000 - default: 2900000 - description: | - Trickle voltage threshold in uV. - Trickle charging is enabled below this value. - If omitted the device default of 2.9V is used. - - vbatlow-charge-enable: - type: boolean - description: | - Allow charging when below the vbatlow threshold. - - disable-recharge: - type: boolean - description: | - Disable automatic recharge. - - dietemp-stop-millidegrees: - type: int - description: | - Die temperature halt threshold in milli-degrees. - When die temperature exceeds this threshold, charging will be inhibited. - - dietemp-resume-millidegrees: - type: int - description: | - Die temperature resume threshold in milli-degrees. - When die temperature falls below this threshold, charging will be permitted. diff --git a/dts/bindings/watchdog/nordic,npm1304-wdt.yaml b/dts/bindings/watchdog/nordic,npm1304-wdt.yaml deleted file mode 100644 index 0fc81437199..00000000000 --- a/dts/bindings/watchdog/nordic,npm1304-wdt.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: nPM1304 Watchdog - -compatible: "nordic,npm1304-wdt" - -include: base.yaml - -properties: - reset-gpios: - type: phandle-array - description: nPM1304 pin used as NRESETOUT From 7c31ca82103f66e07e5e25489b90bc131b8d1bc1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 648/881] Revert "[nrf fromtree] drivers: npm13xx: rename npm1300 to npm13xx" This reverts commit b74ed06cdb8e394718bdf2220b6bb2ed80cc0265. Signed-off-by: Jukka Rissanen --- .../nrf9131ek/nrf9131ek_nrf9131_ns_defconfig | 1 + drivers/gpio/CMakeLists.txt | 2 +- drivers/gpio/Kconfig.npm13xx | 14 +- drivers/gpio/gpio_npm13xx.c | 150 +++---- drivers/led/CMakeLists.txt | 2 +- drivers/led/Kconfig.npm13xx | 6 +- drivers/led/led_npm13xx.c | 54 +-- drivers/mfd/CMakeLists.txt | 2 +- drivers/mfd/Kconfig.npm13xx | 14 +- drivers/mfd/mfd_npm13xx.c | 126 +++--- drivers/regulator/CMakeLists.txt | 2 +- drivers/regulator/Kconfig.npm13xx | 22 +- drivers/regulator/regulator_npm13xx.c | 376 +++++++++--------- drivers/sensor/nordic/CMakeLists.txt | 2 +- drivers/sensor/nordic/npm13xx_charger/Kconfig | 6 +- .../nordic/npm13xx_charger/npm13xx_charger.c | 158 ++++---- drivers/watchdog/CMakeLists.txt | 2 +- drivers/watchdog/Kconfig.npm13xx | 16 +- drivers/watchdog/wdt_npm13xx.c | 72 ++-- include/zephyr/drivers/mfd/npm13xx.h | 94 ++--- .../zephyr/drivers/sensor/npm13xx_charger.h | 26 +- .../dt-bindings/gpio/nordic-npm13xx-gpio.h | 44 +- .../zephyr/dt-bindings/regulator/npm13xx.h | 26 +- .../npm1300_ek/nrf52dk_nrf52832.overlay | 4 +- samples/shields/npm1300_ek/src/main.c | 12 +- 25 files changed, 617 insertions(+), 616 deletions(-) diff --git a/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig b/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig index d15d371416b..5690c239b7b 100644 --- a/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig +++ b/boards/nordic/nrf9131ek/nrf9131ek_nrf9131_ns_defconfig @@ -26,3 +26,4 @@ CONFIG_UART_CONSOLE=y CONFIG_I2C=y CONFIG_REGULATOR=y CONFIG_SENSOR=y +CONFIG_NPM1300_CHARGER=y diff --git a/drivers/gpio/CMakeLists.txt b/drivers/gpio/CMakeLists.txt index 08adaf2d640..8a5ea48cb65 100644 --- a/drivers/gpio/CMakeLists.txt +++ b/drivers/gpio/CMakeLists.txt @@ -67,7 +67,7 @@ zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX gpio_nct38xx_port.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX_ALERT gpio_nct38xx_alert.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NEORV32 gpio_neorv32.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NPCX gpio_npcx.c) -zephyr_library_sources_ifdef(CONFIG_GPIO_NPM13XX gpio_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_NPM1300 gpio_npm13xx.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NPM2100 gpio_npm2100.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NPM6001 gpio_npm6001.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NRFX gpio_nrfx.c) diff --git a/drivers/gpio/Kconfig.npm13xx b/drivers/gpio/Kconfig.npm13xx index 828b4e1382f..65cb81a3686 100644 --- a/drivers/gpio/Kconfig.npm13xx +++ b/drivers/gpio/Kconfig.npm13xx @@ -1,19 +1,19 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config GPIO_NPM13XX - bool "nPM13xx GPIO driver" +config GPIO_NPM1300 + bool "nPM1300 GPIO driver" default y depends on DT_HAS_NORDIC_NPM1300_GPIO_ENABLED select I2C select MFD help - Enable the nPM13xx GPIO driver. + Enable the nPM1300 GPIO driver. -config GPIO_NPM13XX_INIT_PRIORITY - int "nPM13xx GPIO driver initialization priority" - depends on GPIO_NPM13XX +config GPIO_NPM1300_INIT_PRIORITY + int "nPM1300 GPIO driver initialization priority" + depends on GPIO_NPM1300 default 85 help - Initialization priority for the nPM13xx GPIO driver. It must be + Initialization priority for the nPM1300 GPIO driver. It must be greater than the I2C controller init priority. diff --git a/drivers/gpio/gpio_npm13xx.c b/drivers/gpio/gpio_npm13xx.c index c74fc244d93..40c5aaf1098 100644 --- a/drivers/gpio/gpio_npm13xx.c +++ b/drivers/gpio/gpio_npm13xx.c @@ -14,10 +14,10 @@ #include #include -/* nPM13xx GPIO base address */ +/* nPM1300 GPIO base address */ #define NPM_GPIO_BASE 0x06U -/* nPM13xx GPIO registers offsets */ +/* nPM1300 GPIO registers offsets */ #define NPM_GPIO_OFFSET_MODE 0x00U #define NPM_GPIO_OFFSET_DRIVE 0x05U #define NPM_GPIO_OFFSET_PULLUP 0x0AU @@ -26,36 +26,36 @@ #define NPM_GPIO_OFFSET_DEBOUNCE 0x19U #define NPM_GPIO_OFFSET_STATUS 0x1EU -/* nPM13xx Channel counts */ -#define NPM13XX_GPIO_PINS 5U - -#define NPM13XX_GPIO_GPIINPUT 0 -#define NPM13XX_GPIO_GPILOGIC1 1 -#define NPM13XX_GPIO_GPILOGIC0 2 -#define NPM13XX_GPIO_GPIEVENTRISE 3 -#define NPM13XX_GPIO_GPIEVENTFALL 4 -#define NPM13XX_GPIO_GPOIRQ 5 -#define NPM13XX_GPIO_GPORESET 6 -#define NPM13XX_GPIO_GPOPWRLOSSWARN 7 -#define NPM13XX_GPIO_GPOLOGIC1 8 -#define NPM13XX_GPIO_GPOLOGIC0 9 - -struct gpio_npm13xx_config { +/* nPM1300 Channel counts */ +#define NPM1300_GPIO_PINS 5U + +#define NPM1300_GPIO_GPIINPUT 0 +#define NPM1300_GPIO_GPILOGIC1 1 +#define NPM1300_GPIO_GPILOGIC0 2 +#define NPM1300_GPIO_GPIEVENTRISE 3 +#define NPM1300_GPIO_GPIEVENTFALL 4 +#define NPM1300_GPIO_GPOIRQ 5 +#define NPM1300_GPIO_GPORESET 6 +#define NPM1300_GPIO_GPOPWRLOSSWARN 7 +#define NPM1300_GPIO_GPOLOGIC1 8 +#define NPM1300_GPIO_GPOLOGIC0 9 + +struct gpio_npm1300_config { struct gpio_driver_config common; const struct device *mfd; }; -struct gpio_npm13xx_data { +struct gpio_npm1300_data { struct gpio_driver_data common; }; -static int gpio_npm13xx_port_get_raw(const struct device *dev, uint32_t *value) +static int gpio_npm1300_port_get_raw(const struct device *dev, uint32_t *value) { - const struct gpio_npm13xx_config *config = dev->config; + const struct gpio_npm1300_config *config = dev->config; int ret; uint8_t data; - ret = mfd_npm13xx_reg_read(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_STATUS, &data); + ret = mfd_npm1300_reg_read(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_STATUS, &data); if (ret < 0) { return ret; @@ -66,22 +66,22 @@ static int gpio_npm13xx_port_get_raw(const struct device *dev, uint32_t *value) return 0; } -static int gpio_npm13xx_port_set_masked_raw(const struct device *dev, gpio_port_pins_t mask, +static int gpio_npm1300_port_set_masked_raw(const struct device *dev, gpio_port_pins_t mask, gpio_port_value_t value) { - const struct gpio_npm13xx_config *config = dev->config; + const struct gpio_npm1300_config *config = dev->config; int ret = 0; - for (size_t idx = 0; idx < NPM13XX_GPIO_PINS; idx++) { + for (size_t idx = 0; idx < NPM1300_GPIO_PINS; idx++) { if ((mask & BIT(idx)) != 0U) { if ((value & BIT(idx)) != 0U) { - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + idx, - NPM13XX_GPIO_GPOLOGIC1); + NPM1300_GPIO_GPOLOGIC1); } else { - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + idx, - NPM13XX_GPIO_GPOLOGIC0); + NPM1300_GPIO_GPOLOGIC0); } if (ret != 0U) { return ret; @@ -92,53 +92,53 @@ static int gpio_npm13xx_port_set_masked_raw(const struct device *dev, gpio_port_ return ret; } -static int gpio_npm13xx_port_set_bits_raw(const struct device *dev, gpio_port_pins_t pins) +static int gpio_npm1300_port_set_bits_raw(const struct device *dev, gpio_port_pins_t pins) { - return gpio_npm13xx_port_set_masked_raw(dev, pins, pins); + return gpio_npm1300_port_set_masked_raw(dev, pins, pins); } -static int gpio_npm13xx_port_clear_bits_raw(const struct device *dev, gpio_port_pins_t pins) +static int gpio_npm1300_port_clear_bits_raw(const struct device *dev, gpio_port_pins_t pins) { - return gpio_npm13xx_port_set_masked_raw(dev, pins, 0U); + return gpio_npm1300_port_set_masked_raw(dev, pins, 0U); } -static inline int gpio_npm13xx_configure(const struct device *dev, gpio_pin_t pin, +static inline int gpio_npm1300_configure(const struct device *dev, gpio_pin_t pin, gpio_flags_t flags) { - const struct gpio_npm13xx_config *config = dev->config; + const struct gpio_npm1300_config *config = dev->config; int ret = 0; if (k_is_in_isr()) { return -EWOULDBLOCK; } - if (pin >= NPM13XX_GPIO_PINS) { + if (pin >= NPM1300_GPIO_PINS) { return -EINVAL; } /* Configure mode */ if ((flags & GPIO_INPUT) != 0U) { if (flags & GPIO_ACTIVE_LOW) { - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, - NPM13XX_GPIO_GPIEVENTFALL); + NPM1300_GPIO_GPIEVENTFALL); } else { - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, - NPM13XX_GPIO_GPIEVENTRISE); + NPM1300_GPIO_GPIEVENTRISE); } - } else if ((flags & NPM13XX_GPIO_WDT_RESET_ON) != 0U) { - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, - NPM13XX_GPIO_GPORESET); - } else if ((flags & NPM13XX_GPIO_PWRLOSSWARN_ON) != 0U) { - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, - NPM13XX_GPIO_GPOPWRLOSSWARN); + } else if ((flags & NPM1300_GPIO_WDT_RESET_ON) != 0U) { + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, + NPM1300_GPIO_GPORESET); + } else if ((flags & NPM1300_GPIO_PWRLOSSWARN_ON) != 0U) { + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, + NPM1300_GPIO_GPOPWRLOSSWARN); } else if ((flags & GPIO_OUTPUT_INIT_HIGH) != 0U) { - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, - NPM13XX_GPIO_GPOLOGIC1); + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, + NPM1300_GPIO_GPOLOGIC1); } else if ((flags & GPIO_OUTPUT) != 0U) { - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, - NPM13XX_GPIO_GPOLOGIC0); + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_MODE + pin, + NPM1300_GPIO_GPOLOGIC0); } if (ret < 0) { @@ -146,64 +146,64 @@ static inline int gpio_npm13xx_configure(const struct device *dev, gpio_pin_t pi } /* Configure open drain */ - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_OPENDRAIN + pin, + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_OPENDRAIN + pin, !!(flags & GPIO_SINGLE_ENDED)); if (ret < 0) { return ret; } /* Configure pulls */ - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_PULLUP + pin, + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_PULLUP + pin, !!(flags & GPIO_PULL_UP)); if (ret < 0) { return ret; } - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_PULLDOWN + pin, + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_PULLDOWN + pin, !!(flags & GPIO_PULL_DOWN)); if (ret < 0) { return ret; } /* Configure drive strength and debounce */ - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_DRIVE + pin, - !!(flags & NPM13XX_GPIO_DRIVE_6MA)); + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_DRIVE + pin, + !!(flags & NPM1300_GPIO_DRIVE_6MA)); if (ret < 0) { return ret; } - ret = mfd_npm13xx_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_DEBOUNCE + pin, - !!(flags & NPM13XX_GPIO_DEBOUNCE_ON)); + ret = mfd_npm1300_reg_write(config->mfd, NPM_GPIO_BASE, NPM_GPIO_OFFSET_DEBOUNCE + pin, + !!(flags & NPM1300_GPIO_DEBOUNCE_ON)); return ret; } -static int gpio_npm13xx_port_toggle_bits(const struct device *dev, gpio_port_pins_t pins) +static int gpio_npm1300_port_toggle_bits(const struct device *dev, gpio_port_pins_t pins) { int ret; uint32_t value; - ret = gpio_npm13xx_port_get_raw(dev, &value); + ret = gpio_npm1300_port_get_raw(dev, &value); if (ret < 0) { return ret; } - return gpio_npm13xx_port_set_masked_raw(dev, pins, ~value); + return gpio_npm1300_port_set_masked_raw(dev, pins, ~value); } -static DEVICE_API(gpio, gpio_npm13xx_api) = { - .pin_configure = gpio_npm13xx_configure, - .port_get_raw = gpio_npm13xx_port_get_raw, - .port_set_masked_raw = gpio_npm13xx_port_set_masked_raw, - .port_set_bits_raw = gpio_npm13xx_port_set_bits_raw, - .port_clear_bits_raw = gpio_npm13xx_port_clear_bits_raw, - .port_toggle_bits = gpio_npm13xx_port_toggle_bits, +static DEVICE_API(gpio, gpio_npm1300_api) = { + .pin_configure = gpio_npm1300_configure, + .port_get_raw = gpio_npm1300_port_get_raw, + .port_set_masked_raw = gpio_npm1300_port_set_masked_raw, + .port_set_bits_raw = gpio_npm1300_port_set_bits_raw, + .port_clear_bits_raw = gpio_npm1300_port_clear_bits_raw, + .port_toggle_bits = gpio_npm1300_port_toggle_bits, }; -static int gpio_npm13xx_init(const struct device *dev) +static int gpio_npm1300_init(const struct device *dev) { - const struct gpio_npm13xx_config *config = dev->config; + const struct gpio_npm1300_config *config = dev->config; if (!device_is_ready(config->mfd)) { return -ENODEV; @@ -212,18 +212,18 @@ static int gpio_npm13xx_init(const struct device *dev) return 0; } -#define GPIO_NPM13XX_DEFINE(n) \ - static const struct gpio_npm13xx_config gpio_npm13xx_config##n = { \ +#define GPIO_NPM1300_DEFINE(n) \ + static const struct gpio_npm1300_config gpio_npm1300_config##n = { \ .common = \ { \ .port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n), \ }, \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(n))}; \ \ - static struct gpio_npm13xx_data gpio_npm13xx_data##n; \ + static struct gpio_npm1300_data gpio_npm1300_data##n; \ \ - DEVICE_DT_INST_DEFINE(n, gpio_npm13xx_init, NULL, &gpio_npm13xx_data##n, \ - &gpio_npm13xx_config##n, POST_KERNEL, \ - CONFIG_GPIO_NPM13XX_INIT_PRIORITY, &gpio_npm13xx_api); + DEVICE_DT_INST_DEFINE(n, gpio_npm1300_init, NULL, &gpio_npm1300_data##n, \ + &gpio_npm1300_config##n, POST_KERNEL, \ + CONFIG_GPIO_NPM1300_INIT_PRIORITY, &gpio_npm1300_api); -DT_INST_FOREACH_STATUS_OKAY(GPIO_NPM13XX_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(GPIO_NPM1300_DEFINE) diff --git a/drivers/led/CMakeLists.txt b/drivers/led/CMakeLists.txt index 1d8b9d2aa96..c4c0752b255 100644 --- a/drivers/led/CMakeLists.txt +++ b/drivers/led/CMakeLists.txt @@ -12,7 +12,7 @@ zephyr_library_sources_ifdef(CONFIG_IS31FL3733 is31fl3733.c) zephyr_library_sources_ifdef(CONFIG_LED_AXP192_AXP2101 led_axp192.c) zephyr_library_sources_ifdef(CONFIG_LED_DAC led_dac.c) zephyr_library_sources_ifdef(CONFIG_LED_GPIO led_gpio.c) -zephyr_library_sources_ifdef(CONFIG_LED_NPM13XX led_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_LED_NPM1300 led_npm13xx.c) zephyr_library_sources_ifdef(CONFIG_LED_PWM led_pwm.c) zephyr_library_sources_ifdef(CONFIG_LED_XEC led_mchp_xec.c) zephyr_library_sources_ifdef(CONFIG_LP3943 lp3943.c) diff --git a/drivers/led/Kconfig.npm13xx b/drivers/led/Kconfig.npm13xx index e3f40f42a19..e5180aa1dd1 100644 --- a/drivers/led/Kconfig.npm13xx +++ b/drivers/led/Kconfig.npm13xx @@ -1,11 +1,11 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config LED_NPM13XX - bool "nPM13xx LED driver" +config LED_NPM1300 + bool "nPM1300 LED driver" default y depends on DT_HAS_NORDIC_NPM1300_LED_ENABLED select I2C select MFD help - Enable the nPM13xx LED driver. + Enable the nPM1300 LED driver. diff --git a/drivers/led/led_npm13xx.c b/drivers/led/led_npm13xx.c index eed9b1256be..9052159e739 100644 --- a/drivers/led/led_npm13xx.c +++ b/drivers/led/led_npm13xx.c @@ -11,30 +11,30 @@ #include #include -/* nPM13xx LED base address */ +/* nPM1300 LED base address */ #define NPM_LED_BASE 0x0AU -/* nPM13xx LED register offsets */ +/* nPM1300 LED register offsets */ #define NPM_LED_OFFSET_MODE 0x00U #define NPM_LED_OFFSET_SET 0x03U #define NPM_LED_OFFSET_CLR 0x04U -/* nPM13xx Channel counts */ -#define NPM13XX_LED_PINS 3U +/* nPM1300 Channel counts */ +#define NPM1300_LED_PINS 3U -/* nPM13xx LED modes */ +/* nPM1300 LED modes */ #define NPM_LED_HOST 2U -struct led_npm13xx_config { +struct led_npm1300_config { const struct device *mfd; - uint8_t mode[NPM13XX_LED_PINS]; + uint8_t mode[NPM1300_LED_PINS]; }; -static int led_npm13xx_on(const struct device *dev, uint32_t led) +static int led_npm1300_on(const struct device *dev, uint32_t led) { - const struct led_npm13xx_config *config = dev->config; + const struct led_npm1300_config *config = dev->config; - if (led >= NPM13XX_LED_PINS) { + if (led >= NPM1300_LED_PINS) { return -EINVAL; } @@ -42,15 +42,15 @@ static int led_npm13xx_on(const struct device *dev, uint32_t led) return -EPERM; } - return mfd_npm13xx_reg_write(config->mfd, NPM_LED_BASE, NPM_LED_OFFSET_SET + (led * 2U), + return mfd_npm1300_reg_write(config->mfd, NPM_LED_BASE, NPM_LED_OFFSET_SET + (led * 2U), 1U); } -static int led_npm13xx_off(const struct device *dev, uint32_t led) +static int led_npm1300_off(const struct device *dev, uint32_t led) { - const struct led_npm13xx_config *config = dev->config; + const struct led_npm1300_config *config = dev->config; - if (led >= NPM13XX_LED_PINS) { + if (led >= NPM1300_LED_PINS) { return -EINVAL; } @@ -58,25 +58,25 @@ static int led_npm13xx_off(const struct device *dev, uint32_t led) return -EPERM; } - return mfd_npm13xx_reg_write(config->mfd, NPM_LED_BASE, NPM_LED_OFFSET_CLR + (led * 2U), + return mfd_npm1300_reg_write(config->mfd, NPM_LED_BASE, NPM_LED_OFFSET_CLR + (led * 2U), 1U); } -static DEVICE_API(led, led_npm13xx_api) = { - .on = led_npm13xx_on, - .off = led_npm13xx_off, +static DEVICE_API(led, led_npm1300_api) = { + .on = led_npm1300_on, + .off = led_npm1300_off, }; -static int led_npm13xx_init(const struct device *dev) +static int led_npm1300_init(const struct device *dev) { - const struct led_npm13xx_config *config = dev->config; + const struct led_npm1300_config *config = dev->config; if (!device_is_ready(config->mfd)) { return -ENODEV; } - for (uint8_t led = 0U; led < NPM13XX_LED_PINS; led++) { - int ret = mfd_npm13xx_reg_write(config->mfd, NPM_LED_BASE, + for (uint8_t led = 0U; led < NPM1300_LED_PINS; led++) { + int ret = mfd_npm1300_reg_write(config->mfd, NPM_LED_BASE, NPM_LED_OFFSET_MODE + led, config->mode[led]); if (ret < 0) { @@ -87,14 +87,14 @@ static int led_npm13xx_init(const struct device *dev) return 0; } -#define LED_NPM13XX_DEFINE(n) \ - static const struct led_npm13xx_config led_npm13xx_config##n = { \ +#define LED_NPM1300_DEFINE(n) \ + static const struct led_npm1300_config led_npm1300_config##n = { \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(n)), \ .mode = {DT_INST_ENUM_IDX(n, nordic_led0_mode), \ DT_INST_ENUM_IDX(n, nordic_led1_mode), \ DT_INST_ENUM_IDX(n, nordic_led2_mode)}}; \ \ - DEVICE_DT_INST_DEFINE(n, &led_npm13xx_init, NULL, NULL, &led_npm13xx_config##n, \ - POST_KERNEL, CONFIG_LED_INIT_PRIORITY, &led_npm13xx_api); + DEVICE_DT_INST_DEFINE(n, &led_npm1300_init, NULL, NULL, &led_npm1300_config##n, \ + POST_KERNEL, CONFIG_LED_INIT_PRIORITY, &led_npm1300_api); -DT_INST_FOREACH_STATUS_OKAY(LED_NPM13XX_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(LED_NPM1300_DEFINE) diff --git a/drivers/mfd/CMakeLists.txt b/drivers/mfd/CMakeLists.txt index 3c477fc7da8..24a1c698e76 100644 --- a/drivers/mfd/CMakeLists.txt +++ b/drivers/mfd/CMakeLists.txt @@ -6,7 +6,7 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_MFD_ADP5585 mfd_adp5585.c) zephyr_library_sources_ifdef(CONFIG_MFD_MAX20335 mfd_max20335.c) zephyr_library_sources_ifdef(CONFIG_MFD_NCT38XX mfd_nct38xx.c) -zephyr_library_sources_ifdef(CONFIG_MFD_NPM13XX mfd_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_MFD_NPM1300 mfd_npm13xx.c) zephyr_library_sources_ifdef(CONFIG_MFD_NPM2100 mfd_npm2100.c) zephyr_library_sources_ifdef(CONFIG_MFD_NPM6001 mfd_npm6001.c) zephyr_library_sources_ifdef(CONFIG_MFD_AXP192_AXP2101 mfd_axp192.c) diff --git a/drivers/mfd/Kconfig.npm13xx b/drivers/mfd/Kconfig.npm13xx index 63f18ac9a3b..56a54f3005a 100644 --- a/drivers/mfd/Kconfig.npm13xx +++ b/drivers/mfd/Kconfig.npm13xx @@ -1,17 +1,17 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config MFD_NPM13XX - bool "nPM13xx PMIC multi-function device driver" +config MFD_NPM1300 + bool "nPM1300 PMIC multi-function device driver" default y depends on DT_HAS_NORDIC_NPM1300_ENABLED select I2C help - Enable the Nordic nPM13xx PMIC multi-function device driver + Enable the Nordic nPM1300 PMIC multi-function device driver -config MFD_NPM13XX_INIT_PRIORITY - int "nPM13xx MFD initialization priority" +config MFD_NPM1300_INIT_PRIORITY + int "nPM1300 MFD initialization priority" default MFD_INIT_PRIORITY - depends on MFD_NPM13XX + depends on MFD_NPM1300 help - Multi-function device initialization priority for nPM13xx. + Multi-function device initialization priority for nPM1300. diff --git a/drivers/mfd/mfd_npm13xx.c b/drivers/mfd/mfd_npm13xx.c index 9847e4a9e49..21961b1696a 100644 --- a/drivers/mfd/mfd_npm13xx.c +++ b/drivers/mfd/mfd_npm13xx.c @@ -42,7 +42,7 @@ #define GPIO_MODE_GPOIRQ 5 -struct mfd_npm13xx_config { +struct mfd_npm1300_config { struct i2c_dt_spec i2c; struct gpio_dt_spec host_int_gpios; uint8_t pmic_int_pin; @@ -50,7 +50,7 @@ struct mfd_npm13xx_config { uint8_t lp_reset; }; -struct mfd_npm13xx_data { +struct mfd_npm1300_data { struct k_mutex mutex; const struct device *dev; struct gpio_callback gpio_cb; @@ -63,51 +63,51 @@ struct event_reg_t { uint8_t mask; }; -static const struct event_reg_t event_reg[NPM13XX_EVENT_MAX] = { - [NPM13XX_EVENT_CHG_COMPLETED] = {0x0AU, 0x10U}, - [NPM13XX_EVENT_CHG_ERROR] = {0x0AU, 0x20U}, - [NPM13XX_EVENT_BATTERY_DETECTED] = {0x0EU, 0x01U}, - [NPM13XX_EVENT_BATTERY_REMOVED] = {0x0EU, 0x02U}, - [NPM13XX_EVENT_SHIPHOLD_PRESS] = {0x12U, 0x01U}, - [NPM13XX_EVENT_SHIPHOLD_RELEASE] = {0x12U, 0x02U}, - [NPM13XX_EVENT_WATCHDOG_WARN] = {0x12U, 0x08U}, - [NPM13XX_EVENT_VBUS_DETECTED] = {0x16U, 0x01U}, - [NPM13XX_EVENT_VBUS_REMOVED] = {0x16U, 0x02U}, - [NPM13XX_EVENT_GPIO0_EDGE] = {0x22U, 0x01U}, - [NPM13XX_EVENT_GPIO1_EDGE] = {0x22U, 0x02U}, - [NPM13XX_EVENT_GPIO2_EDGE] = {0x22U, 0x04U}, - [NPM13XX_EVENT_GPIO3_EDGE] = {0x22U, 0x08U}, - [NPM13XX_EVENT_GPIO4_EDGE] = {0x22U, 0x10U}, +static const struct event_reg_t event_reg[NPM1300_EVENT_MAX] = { + [NPM1300_EVENT_CHG_COMPLETED] = {0x0AU, 0x10U}, + [NPM1300_EVENT_CHG_ERROR] = {0x0AU, 0x20U}, + [NPM1300_EVENT_BATTERY_DETECTED] = {0x0EU, 0x01U}, + [NPM1300_EVENT_BATTERY_REMOVED] = {0x0EU, 0x02U}, + [NPM1300_EVENT_SHIPHOLD_PRESS] = {0x12U, 0x01U}, + [NPM1300_EVENT_SHIPHOLD_RELEASE] = {0x12U, 0x02U}, + [NPM1300_EVENT_WATCHDOG_WARN] = {0x12U, 0x08U}, + [NPM1300_EVENT_VBUS_DETECTED] = {0x16U, 0x01U}, + [NPM1300_EVENT_VBUS_REMOVED] = {0x16U, 0x02U}, + [NPM1300_EVENT_GPIO0_EDGE] = {0x22U, 0x01U}, + [NPM1300_EVENT_GPIO1_EDGE] = {0x22U, 0x02U}, + [NPM1300_EVENT_GPIO2_EDGE] = {0x22U, 0x04U}, + [NPM1300_EVENT_GPIO3_EDGE] = {0x22U, 0x08U}, + [NPM1300_EVENT_GPIO4_EDGE] = {0x22U, 0x10U}, }; static void gpio_callback(const struct device *dev, struct gpio_callback *cb, uint32_t pins) { - struct mfd_npm13xx_data *data = CONTAINER_OF(cb, struct mfd_npm13xx_data, gpio_cb); + struct mfd_npm1300_data *data = CONTAINER_OF(cb, struct mfd_npm1300_data, gpio_cb); k_work_submit(&data->work); } static void work_callback(struct k_work *work) { - struct mfd_npm13xx_data *data = CONTAINER_OF(work, struct mfd_npm13xx_data, work); - const struct mfd_npm13xx_config *config = data->dev->config; + struct mfd_npm1300_data *data = CONTAINER_OF(work, struct mfd_npm1300_data, work); + const struct mfd_npm1300_config *config = data->dev->config; uint8_t buf[MAIN_SIZE]; int ret; /* Read all MAIN registers into temporary buffer */ - ret = mfd_npm13xx_reg_read_burst(data->dev, MAIN_BASE, 0U, buf, sizeof(buf)); + ret = mfd_npm1300_reg_read_burst(data->dev, MAIN_BASE, 0U, buf, sizeof(buf)); if (ret < 0) { k_work_submit(&data->work); return; } - for (int i = 0; i < NPM13XX_EVENT_MAX; i++) { + for (int i = 0; i < NPM1300_EVENT_MAX; i++) { int offset = event_reg[i].offset + MAIN_OFFSET_CLR; if ((buf[offset] & event_reg[i].mask) != 0U) { gpio_fire_callbacks(&data->callbacks, data->dev, BIT(i)); - ret = mfd_npm13xx_reg_write(data->dev, MAIN_BASE, offset, + ret = mfd_npm1300_reg_write(data->dev, MAIN_BASE, offset, event_reg[i].mask); if (ret < 0) { k_work_submit(&data->work); @@ -122,10 +122,10 @@ static void work_callback(struct k_work *work) } } -static int mfd_npm13xx_init(const struct device *dev) +static int mfd_npm1300_init(const struct device *dev) { - const struct mfd_npm13xx_config *config = dev->config; - struct mfd_npm13xx_data *mfd_data = dev->data; + const struct mfd_npm1300_config *config = dev->config; + struct mfd_npm1300_data *mfd_data = dev->data; int ret; if (!i2c_is_ready_dt(&config->i2c)) { @@ -138,7 +138,7 @@ static int mfd_npm13xx_init(const struct device *dev) if (config->host_int_gpios.port != NULL) { /* Set specified PMIC pin to be interrupt output */ - ret = mfd_npm13xx_reg_write(dev, GPIO_BASE, GPIO_OFFSET_MODE + config->pmic_int_pin, + ret = mfd_npm1300_reg_write(dev, GPIO_BASE, GPIO_OFFSET_MODE + config->pmic_int_pin, GPIO_MODE_GPOIRQ); if (ret < 0) { return ret; @@ -171,64 +171,64 @@ static int mfd_npm13xx_init(const struct device *dev) } } - ret = mfd_npm13xx_reg_write(dev, SHIP_BASE, SHIP_OFFSET_CONFIG, config->active_time); + ret = mfd_npm1300_reg_write(dev, SHIP_BASE, SHIP_OFFSET_CONFIG, config->active_time); if (ret < 0) { return ret; } - ret = mfd_npm13xx_reg_write(dev, SHIP_BASE, SHIP_OFFSET_LPCONFIG, config->lp_reset); + ret = mfd_npm1300_reg_write(dev, SHIP_BASE, SHIP_OFFSET_LPCONFIG, config->lp_reset); if (ret < 0) { return ret; } - return mfd_npm13xx_reg_write(dev, SHIP_BASE, SHIP_OFFSET_CFGSTROBE, 1U); + return mfd_npm1300_reg_write(dev, SHIP_BASE, SHIP_OFFSET_CFGSTROBE, 1U); } -int mfd_npm13xx_reg_read_burst(const struct device *dev, uint8_t base, uint8_t offset, void *data, +int mfd_npm1300_reg_read_burst(const struct device *dev, uint8_t base, uint8_t offset, void *data, size_t len) { - const struct mfd_npm13xx_config *config = dev->config; + const struct mfd_npm1300_config *config = dev->config; uint8_t buff[] = {base, offset}; return i2c_write_read_dt(&config->i2c, buff, sizeof(buff), data, len); } -int mfd_npm13xx_reg_read(const struct device *dev, uint8_t base, uint8_t offset, uint8_t *data) +int mfd_npm1300_reg_read(const struct device *dev, uint8_t base, uint8_t offset, uint8_t *data) { - return mfd_npm13xx_reg_read_burst(dev, base, offset, data, 1U); + return mfd_npm1300_reg_read_burst(dev, base, offset, data, 1U); } -int mfd_npm13xx_reg_write(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data) +int mfd_npm1300_reg_write(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data) { - const struct mfd_npm13xx_config *config = dev->config; + const struct mfd_npm1300_config *config = dev->config; uint8_t buff[] = {base, offset, data}; return i2c_write_dt(&config->i2c, buff, sizeof(buff)); } -int mfd_npm13xx_reg_write2(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data1, +int mfd_npm1300_reg_write2(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data1, uint8_t data2) { - const struct mfd_npm13xx_config *config = dev->config; + const struct mfd_npm1300_config *config = dev->config; uint8_t buff[] = {base, offset, data1, data2}; return i2c_write_dt(&config->i2c, buff, sizeof(buff)); } -int mfd_npm13xx_reg_update(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data, +int mfd_npm1300_reg_update(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data, uint8_t mask) { - struct mfd_npm13xx_data *mfd_data = dev->data; + struct mfd_npm1300_data *mfd_data = dev->data; uint8_t reg; int ret; k_mutex_lock(&mfd_data->mutex, K_FOREVER); - ret = mfd_npm13xx_reg_read(dev, base, offset, ®); + ret = mfd_npm1300_reg_read(dev, base, offset, ®); if (ret == 0) { reg = (reg & ~mask) | (data & mask); - ret = mfd_npm13xx_reg_write(dev, base, offset, reg); + ret = mfd_npm1300_reg_write(dev, base, offset, reg); } k_mutex_unlock(&mfd_data->mutex); @@ -236,9 +236,9 @@ int mfd_npm13xx_reg_update(const struct device *dev, uint8_t base, uint8_t offse return ret; } -int mfd_npm13xx_set_timer(const struct device *dev, uint32_t time_ms) +int mfd_npm1300_set_timer(const struct device *dev, uint32_t time_ms) { - const struct mfd_npm13xx_config *config = dev->config; + const struct mfd_npm1300_config *config = dev->config; uint8_t buff[5] = {TIME_BASE, TIME_OFFSET_TIMER}; uint32_t ticks = time_ms / TIMER_PRESCALER_MS; @@ -254,34 +254,34 @@ int mfd_npm13xx_set_timer(const struct device *dev, uint32_t time_ms) return ret; } - return mfd_npm13xx_reg_write(dev, TIME_BASE, TIME_OFFSET_LOAD, 1U); + return mfd_npm1300_reg_write(dev, TIME_BASE, TIME_OFFSET_LOAD, 1U); } -int mfd_npm13xx_reset(const struct device *dev) +int mfd_npm1300_reset(const struct device *dev) { - return mfd_npm13xx_reg_write(dev, MAIN_BASE, MAIN_OFFSET_RESET, 1U); + return mfd_npm1300_reg_write(dev, MAIN_BASE, MAIN_OFFSET_RESET, 1U); } -int mfd_npm13xx_hibernate(const struct device *dev, uint32_t time_ms) +int mfd_npm1300_hibernate(const struct device *dev, uint32_t time_ms) { - int ret = mfd_npm13xx_set_timer(dev, time_ms); + int ret = mfd_npm1300_set_timer(dev, time_ms); if (ret != 0) { return ret; } - return mfd_npm13xx_reg_write(dev, SHIP_BASE, SHIP_OFFSET_HIBERNATE, 1U); + return mfd_npm1300_reg_write(dev, SHIP_BASE, SHIP_OFFSET_HIBERNATE, 1U); } -int mfd_npm13xx_add_callback(const struct device *dev, struct gpio_callback *callback) +int mfd_npm1300_add_callback(const struct device *dev, struct gpio_callback *callback) { - struct mfd_npm13xx_data *data = dev->data; + struct mfd_npm1300_data *data = dev->data; /* Enable interrupts for specified events */ - for (int i = 0; i < NPM13XX_EVENT_MAX; i++) { + for (int i = 0; i < NPM1300_EVENT_MAX; i++) { if ((callback->pin_mask & BIT(i)) != 0U) { /* Clear pending interrupt */ - int ret = mfd_npm13xx_reg_write(data->dev, MAIN_BASE, + int ret = mfd_npm1300_reg_write(data->dev, MAIN_BASE, event_reg[i].offset + MAIN_OFFSET_CLR, event_reg[i].mask); @@ -289,7 +289,7 @@ int mfd_npm13xx_add_callback(const struct device *dev, struct gpio_callback *cal return ret; } - ret = mfd_npm13xx_reg_write(data->dev, MAIN_BASE, + ret = mfd_npm1300_reg_write(data->dev, MAIN_BASE, event_reg[i].offset + MAIN_OFFSET_INTENSET, event_reg[i].mask); if (ret < 0) { @@ -301,17 +301,17 @@ int mfd_npm13xx_add_callback(const struct device *dev, struct gpio_callback *cal return gpio_manage_callback(&data->callbacks, callback, true); } -int mfd_npm13xx_remove_callback(const struct device *dev, struct gpio_callback *callback) +int mfd_npm1300_remove_callback(const struct device *dev, struct gpio_callback *callback) { - struct mfd_npm13xx_data *data = dev->data; + struct mfd_npm1300_data *data = dev->data; return gpio_manage_callback(&data->callbacks, callback, false); } -#define MFD_NPM13XX_DEFINE(inst) \ - static struct mfd_npm13xx_data data_##inst; \ +#define MFD_NPM1300_DEFINE(inst) \ + static struct mfd_npm1300_data data_##inst; \ \ - static const struct mfd_npm13xx_config config##inst = { \ + static const struct mfd_npm1300_config config##inst = { \ .i2c = I2C_DT_SPEC_INST_GET(inst), \ .host_int_gpios = GPIO_DT_SPEC_INST_GET_OR(inst, host_int_gpios, {0}), \ .pmic_int_pin = DT_INST_PROP_OR(inst, pmic_int_pin, 0), \ @@ -319,7 +319,7 @@ int mfd_npm13xx_remove_callback(const struct device *dev, struct gpio_callback * .lp_reset = DT_INST_ENUM_IDX_OR(inst, long_press_reset, 0), \ }; \ \ - DEVICE_DT_INST_DEFINE(inst, mfd_npm13xx_init, NULL, &data_##inst, &config##inst, \ - POST_KERNEL, CONFIG_MFD_NPM13XX_INIT_PRIORITY, NULL); + DEVICE_DT_INST_DEFINE(inst, mfd_npm1300_init, NULL, &data_##inst, &config##inst, \ + POST_KERNEL, CONFIG_MFD_NPM1300_INIT_PRIORITY, NULL); -DT_INST_FOREACH_STATUS_OKAY(MFD_NPM13XX_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(MFD_NPM1300_DEFINE) diff --git a/drivers/regulator/CMakeLists.txt b/drivers/regulator/CMakeLists.txt index 283fd976de7..817518d9b2f 100644 --- a/drivers/regulator/CMakeLists.txt +++ b/drivers/regulator/CMakeLists.txt @@ -13,7 +13,7 @@ zephyr_library_sources_ifdef(CONFIG_REGULATOR_FIXED regulator_fixed.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_GPIO regulator_gpio.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_MAX20335 regulator_max20335.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM1100 regulator_npm1100.c) -zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM13XX regulator_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM1300 regulator_npm13xx.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM2100 regulator_npm2100.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM6001 regulator_npm6001.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_PCA9420 regulator_pca9420.c) diff --git a/drivers/regulator/Kconfig.npm13xx b/drivers/regulator/Kconfig.npm13xx index 4d243b8cdf8..19adee0ebab 100644 --- a/drivers/regulator/Kconfig.npm13xx +++ b/drivers/regulator/Kconfig.npm13xx @@ -1,29 +1,29 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config REGULATOR_NPM13XX - bool "nPM13xx PMIC regulator driver" +config REGULATOR_NPM1300 + bool "nPM1300 PMIC regulator driver" default y depends on DT_HAS_NORDIC_NPM1300_REGULATOR_ENABLED select I2C select MFD help - Enable the Nordic nPM13xx PMIC regulator driver + Enable the Nordic nPM1300 PMIC regulator driver -if REGULATOR_NPM13XX +if REGULATOR_NPM1300 -config REGULATOR_NPM13XX_COMMON_INIT_PRIORITY - int "nPM13xx regulator driver init priority (common part)" +config REGULATOR_NPM1300_COMMON_INIT_PRIORITY + int "nPM1300 regulator driver init priority (common part)" default 85 help - Init priority for the Nordic nPM13xx regulator driver (common part). + Init priority for the Nordic nPM1300 regulator driver (common part). It must be greater than I2C init priority. -config REGULATOR_NPM13XX_INIT_PRIORITY - int "nPM13xx regulator driver init priority" +config REGULATOR_NPM1300_INIT_PRIORITY + int "nPM1300 regulator driver init priority" default 86 help - Init priority for the Nordic nPM13xx regulator driver. It must be - greater than REGULATOR_NPM13XX_COMMON_INIT_PRIORITY. + Init priority for the Nordic nPM1300 regulator driver. It must be + greater than REGULATOR_NPM1300_COMMON_INIT_PRIORITY. endif diff --git a/drivers/regulator/regulator_npm13xx.c b/drivers/regulator/regulator_npm13xx.c index 89ee1993ed3..913f51456af 100644 --- a/drivers/regulator/regulator_npm13xx.c +++ b/drivers/regulator/regulator_npm13xx.c @@ -15,27 +15,27 @@ #include #include -/* nPM13xx voltage sources */ -enum npm13xx_sources { - NPM13XX_SOURCE_BUCK1, - NPM13XX_SOURCE_BUCK2, - NPM13XX_SOURCE_LDO1, - NPM13XX_SOURCE_LDO2, +/* nPM1300 voltage sources */ +enum npm1300_sources { + NPM1300_SOURCE_BUCK1, + NPM1300_SOURCE_BUCK2, + NPM1300_SOURCE_LDO1, + NPM1300_SOURCE_LDO2, }; -/* nPM13xx gpio control channels */ -enum npm13xx_gpio_type { - NPM13XX_GPIO_TYPE_ENABLE, - NPM13XX_GPIO_TYPE_RETENTION, - NPM13XX_GPIO_TYPE_PWM +/* nPM1300 gpio control channels */ +enum npm1300_gpio_type { + NPM1300_GPIO_TYPE_ENABLE, + NPM1300_GPIO_TYPE_RETENTION, + NPM1300_GPIO_TYPE_PWM }; -/* nPM13xx regulator base addresses */ +/* nPM1300 regulator base addresses */ #define BUCK_BASE 0x04U #define LDSW_BASE 0x08U #define SHIP_BASE 0x0BU -/* nPM13xx regulator register offsets */ +/* nPM1300 regulator register offsets */ #define BUCK_OFFSET_EN_SET 0x00U #define BUCK_OFFSET_EN_CLR 0x01U #define BUCK_OFFSET_PWM_SET 0x04U @@ -50,7 +50,7 @@ enum npm13xx_gpio_type { #define BUCK_OFFSET_CTRL0 0x15U #define BUCK_OFFSET_STATUS 0x34U -/* nPM13xx ldsw register offsets */ +/* nPM1300 ldsw register offsets */ #define LDSW_OFFSET_EN_SET 0x00U #define LDSW_OFFSET_EN_CLR 0x01U #define LDSW_OFFSET_STATUS 0x04U @@ -59,7 +59,7 @@ enum npm13xx_gpio_type { #define LDSW_OFFSET_LDOSEL 0x08U #define LDSW_OFFSET_VOUTSEL 0x0CU -/* nPM13xx ship register offsets */ +/* nPM1300 ship register offsets */ #define SHIP_OFFSET_SHIP 0x02U #define BUCK1_ON_MASK 0x04U @@ -77,62 +77,62 @@ enum npm13xx_gpio_type { #define LDSW2_SOFTSTART_SHIFT 4U #define LDSW2_ACTIVE_DISCHARGE_MASK BIT(7) -#define NPM13XX_GPIO_UNUSED UINT8_MAX +#define NPM1300_GPIO_UNUSED UINT8_MAX -struct npm13xx_gpio_info { +struct npm1300_gpio_info { uint8_t pin; bool invert; }; -struct regulator_npm13xx_pconfig { +struct regulator_npm1300_pconfig { const struct device *mfd; struct gpio_dt_spec dvs_state_pins[5]; }; -struct regulator_npm13xx_config { +struct regulator_npm1300_config { struct regulator_common_config common; const struct device *mfd; uint8_t source; int32_t retention_uv; - struct npm13xx_gpio_info enable_gpios; - struct npm13xx_gpio_info retention_gpios; - struct npm13xx_gpio_info pwm_gpios; + struct npm1300_gpio_info enable_gpios; + struct npm1300_gpio_info retention_gpios; + struct npm1300_gpio_info pwm_gpios; uint8_t soft_start; bool active_discharge; bool ldo_disable_workaround; }; -struct regulator_npm13xx_data { +struct regulator_npm1300_data { struct regulator_common_data data; }; /* Linear range for output voltage, common for all bucks and LDOs on this device */ static const struct linear_range buckldo_range = LINEAR_RANGE_INIT(1000000, 100000, 0U, 23U); -unsigned int regulator_npm13xx_count_voltages(const struct device *dev) +unsigned int regulator_npm1300_count_voltages(const struct device *dev) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: - case NPM13XX_SOURCE_BUCK2: - case NPM13XX_SOURCE_LDO1: - case NPM13XX_SOURCE_LDO2: + case NPM1300_SOURCE_BUCK1: + case NPM1300_SOURCE_BUCK2: + case NPM1300_SOURCE_LDO1: + case NPM1300_SOURCE_LDO2: return linear_range_values_count(&buckldo_range); default: return 0; } } -int regulator_npm13xx_list_voltage(const struct device *dev, unsigned int idx, int32_t *volt_uv) +int regulator_npm1300_list_voltage(const struct device *dev, unsigned int idx, int32_t *volt_uv) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: - case NPM13XX_SOURCE_BUCK2: - case NPM13XX_SOURCE_LDO1: - case NPM13XX_SOURCE_LDO2: + case NPM1300_SOURCE_BUCK1: + case NPM1300_SOURCE_BUCK2: + case NPM1300_SOURCE_LDO1: + case NPM1300_SOURCE_LDO2: return linear_range_get_value(&buckldo_range, idx, volt_uv); default: return -EINVAL; @@ -141,16 +141,16 @@ int regulator_npm13xx_list_voltage(const struct device *dev, unsigned int idx, i static int retention_set_voltage(const struct device *dev, int32_t retention_uv) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint16_t idx; uint8_t chan; int ret; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: + case NPM1300_SOURCE_BUCK1: chan = 0U; break; - case NPM13XX_SOURCE_BUCK2: + case NPM1300_SOURCE_BUCK2: chan = 1U; break; default: @@ -163,17 +163,17 @@ static int retention_set_voltage(const struct device *dev, int32_t retention_uv) return ret; } - return mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_VOUT_RET + (chan * 2U), + return mfd_npm1300_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_VOUT_RET + (chan * 2U), idx); } static int buck_get_voltage_index(const struct device *dev, uint8_t chan, uint8_t *idx) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint8_t sel; int ret; - ret = mfd_npm13xx_reg_read(config->mfd, BUCK_BASE, BUCK_OFFSET_SW_CTRL, &sel); + ret = mfd_npm1300_reg_read(config->mfd, BUCK_BASE, BUCK_OFFSET_SW_CTRL, &sel); if (ret < 0) { return ret; @@ -181,17 +181,17 @@ static int buck_get_voltage_index(const struct device *dev, uint8_t chan, uint8_ if ((sel >> chan) & 1U) { /* SW control */ - return mfd_npm13xx_reg_read(config->mfd, BUCK_BASE, + return mfd_npm1300_reg_read(config->mfd, BUCK_BASE, BUCK_OFFSET_VOUT_NORM + (chan * 2U), idx); } /* VSET pin control */ - return mfd_npm13xx_reg_read(config->mfd, BUCK_BASE, BUCK_OFFSET_VOUT_STAT + chan, idx); + return mfd_npm1300_reg_read(config->mfd, BUCK_BASE, BUCK_OFFSET_VOUT_STAT + chan, idx); } static int buck_set_voltage(const struct device *dev, uint8_t chan, int32_t min_uv, int32_t max_uv) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint8_t mask; uint8_t curr_idx; uint16_t idx; @@ -210,7 +210,7 @@ static int buck_set_voltage(const struct device *dev, uint8_t chan, int32_t min_ return ret; } - ret = mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_VOUT_NORM + (chan * 2U), + ret = mfd_npm1300_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_VOUT_NORM + (chan * 2U), idx); if (ret < 0) { @@ -219,12 +219,12 @@ static int buck_set_voltage(const struct device *dev, uint8_t chan, int32_t min_ /* Enable SW control of buck output */ mask = BIT(chan); - return mfd_npm13xx_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_SW_CTRL, mask, mask); + return mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_SW_CTRL, mask, mask); } static int ldo_set_voltage(const struct device *dev, uint8_t chan, int32_t min_uv, int32_t max_uv) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint16_t idx; int ret; @@ -234,21 +234,21 @@ static int ldo_set_voltage(const struct device *dev, uint8_t chan, int32_t min_u return ret; } - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_VOUTSEL + chan, idx); + return mfd_npm1300_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_VOUTSEL + chan, idx); } -int regulator_npm13xx_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) +int regulator_npm1300_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: + case NPM1300_SOURCE_BUCK1: return buck_set_voltage(dev, 0, min_uv, max_uv); - case NPM13XX_SOURCE_BUCK2: + case NPM1300_SOURCE_BUCK2: return buck_set_voltage(dev, 1, min_uv, max_uv); - case NPM13XX_SOURCE_LDO1: + case NPM1300_SOURCE_LDO1: return ldo_set_voltage(dev, 0, min_uv, max_uv); - case NPM13XX_SOURCE_LDO2: + case NPM1300_SOURCE_LDO2: return ldo_set_voltage(dev, 1, min_uv, max_uv); default: return -ENODEV; @@ -271,11 +271,11 @@ static int buck_get_voltage(const struct device *dev, uint8_t chan, int32_t *vol static int ldo_get_voltage(const struct device *dev, uint8_t chan, int32_t *volt_uv) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint8_t idx; int ret; - ret = mfd_npm13xx_reg_read(config->mfd, LDSW_BASE, LDSW_OFFSET_VOUTSEL + chan, &idx); + ret = mfd_npm1300_reg_read(config->mfd, LDSW_BASE, LDSW_OFFSET_VOUTSEL + chan, &idx); if (ret < 0) { return ret; @@ -284,18 +284,18 @@ static int ldo_get_voltage(const struct device *dev, uint8_t chan, int32_t *volt return linear_range_get_value(&buckldo_range, idx, volt_uv); } -int regulator_npm13xx_get_voltage(const struct device *dev, int32_t *volt_uv) +int regulator_npm1300_get_voltage(const struct device *dev, int32_t *volt_uv) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: + case NPM1300_SOURCE_BUCK1: return buck_get_voltage(dev, 0, volt_uv); - case NPM13XX_SOURCE_BUCK2: + case NPM1300_SOURCE_BUCK2: return buck_get_voltage(dev, 1, volt_uv); - case NPM13XX_SOURCE_LDO1: + case NPM1300_SOURCE_LDO1: return ldo_get_voltage(dev, 0, volt_uv); - case NPM13XX_SOURCE_LDO2: + case NPM1300_SOURCE_LDO2: return ldo_get_voltage(dev, 1, volt_uv); default: return -ENODEV; @@ -304,22 +304,22 @@ int regulator_npm13xx_get_voltage(const struct device *dev, int32_t *volt_uv) static int set_buck_mode(const struct device *dev, uint8_t chan, regulator_mode_t mode) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint8_t pfm_mask = BIT(chan); uint8_t pfm_data; uint8_t pwm_reg; int ret; switch (mode) { - case NPM13XX_BUCK_MODE_PWM: + case NPM1300_BUCK_MODE_PWM: pfm_data = 0U; pwm_reg = BUCK_OFFSET_PWM_SET; break; - case NPM13XX_BUCK_MODE_AUTO: + case NPM1300_BUCK_MODE_AUTO: pfm_data = 0U; pwm_reg = BUCK_OFFSET_PWM_CLR; break; - case NPM13XX_BUCK_MODE_PFM: + case NPM1300_BUCK_MODE_PFM: pfm_data = pfm_mask; pwm_reg = BUCK_OFFSET_PWM_CLR; break; @@ -327,61 +327,61 @@ static int set_buck_mode(const struct device *dev, uint8_t chan, regulator_mode_ return -ENOTSUP; } - ret = mfd_npm13xx_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_CTRL0, pfm_data, pfm_mask); + ret = mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_CTRL0, pfm_data, pfm_mask); if (ret < 0) { return ret; } - return mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, pwm_reg + (chan * 2U), 1U); + return mfd_npm1300_reg_write(config->mfd, BUCK_BASE, pwm_reg + (chan * 2U), 1U); } static int set_ldsw_mode(const struct device *dev, uint8_t chan, regulator_mode_t mode) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (mode) { - case NPM13XX_LDSW_MODE_LDO: - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_LDOSEL + chan, 1U); - case NPM13XX_LDSW_MODE_LDSW: - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_LDOSEL + chan, 0U); + case NPM1300_LDSW_MODE_LDO: + return mfd_npm1300_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_LDOSEL + chan, 1U); + case NPM1300_LDSW_MODE_LDSW: + return mfd_npm1300_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_LDOSEL + chan, 0U); default: return -ENOTSUP; } } -int regulator_npm13xx_set_mode(const struct device *dev, regulator_mode_t mode) +int regulator_npm1300_set_mode(const struct device *dev, regulator_mode_t mode) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: + case NPM1300_SOURCE_BUCK1: return set_buck_mode(dev, 0, mode); - case NPM13XX_SOURCE_BUCK2: + case NPM1300_SOURCE_BUCK2: return set_buck_mode(dev, 1, mode); - case NPM13XX_SOURCE_LDO1: + case NPM1300_SOURCE_LDO1: return set_ldsw_mode(dev, 0, mode); - case NPM13XX_SOURCE_LDO2: + case NPM1300_SOURCE_LDO2: return set_ldsw_mode(dev, 1, mode); default: return -ENOTSUP; } } -int regulator_npm13xx_enable(const struct device *dev) +int regulator_npm1300_enable(const struct device *dev) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; int ret; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: - return mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_SET, 1U); - case NPM13XX_SOURCE_BUCK2: - return mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_SET + 2U, 1U); - case NPM13XX_SOURCE_LDO1: - ret = mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_EN_SET, 1U); + case NPM1300_SOURCE_BUCK1: + return mfd_npm1300_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_SET, 1U); + case NPM1300_SOURCE_BUCK2: + return mfd_npm1300_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_SET + 2U, 1U); + case NPM1300_SOURCE_LDO1: + ret = mfd_npm1300_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_EN_SET, 1U); break; - case NPM13XX_SOURCE_LDO2: - ret = mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_EN_SET + 2U, 1U); + case NPM1300_SOURCE_LDO2: + ret = mfd_npm1300_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_EN_SET + 2U, 1U); break; default: return 0; @@ -395,35 +395,35 @@ int regulator_npm13xx_enable(const struct device *dev) uint8_t unused; k_msleep(2); - return mfd_npm13xx_reg_read(config->mfd, LDSW_BASE, LDSW_OFFSET_STATUS, &unused); + return mfd_npm1300_reg_read(config->mfd, LDSW_BASE, LDSW_OFFSET_STATUS, &unused); } return ret; } -int regulator_npm13xx_disable(const struct device *dev) +int regulator_npm1300_disable(const struct device *dev) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: - return mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_CLR, 1U); - case NPM13XX_SOURCE_BUCK2: - return mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_CLR + 2U, 1U); - case NPM13XX_SOURCE_LDO1: - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_EN_CLR, 1U); - case NPM13XX_SOURCE_LDO2: - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_EN_CLR + 2U, 1U); + case NPM1300_SOURCE_BUCK1: + return mfd_npm1300_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_CLR, 1U); + case NPM1300_SOURCE_BUCK2: + return mfd_npm1300_reg_write(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_CLR + 2U, 1U); + case NPM1300_SOURCE_LDO1: + return mfd_npm1300_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_EN_CLR, 1U); + case NPM1300_SOURCE_LDO2: + return mfd_npm1300_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_EN_CLR + 2U, 1U); default: return 0; } } -static int regulator_npm13xx_set_buck_pin_ctrl(const struct device *dev, uint8_t chan, - const struct npm13xx_gpio_info *pin_info, - enum npm13xx_gpio_type type) +static int regulator_npm1300_set_buck_pin_ctrl(const struct device *dev, uint8_t chan, + const struct npm1300_gpio_info *pin_info, + enum npm1300_gpio_type type) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint8_t inv = pin_info->invert ? 1 : 0; uint8_t ctrl; uint8_t mask; @@ -444,63 +444,63 @@ static int regulator_npm13xx_set_buck_pin_ctrl(const struct device *dev, uint8_t } switch (type) { - case NPM13XX_GPIO_TYPE_ENABLE: - return mfd_npm13xx_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_CTRL, ctrl, + case NPM1300_GPIO_TYPE_ENABLE: + return mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_EN_CTRL, ctrl, mask); - case NPM13XX_GPIO_TYPE_PWM: - return mfd_npm13xx_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_PWM_CTRL, ctrl, + case NPM1300_GPIO_TYPE_PWM: + return mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_PWM_CTRL, ctrl, mask); - case NPM13XX_GPIO_TYPE_RETENTION: - return mfd_npm13xx_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_VRET_CTRL, ctrl, + case NPM1300_GPIO_TYPE_RETENTION: + return mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_VRET_CTRL, ctrl, mask); default: return -ENOTSUP; } } -static int regulator_npm13xx_set_ldsw_pin_ctrl(const struct device *dev, uint8_t chan, - const struct npm13xx_gpio_info *pin_info, - enum npm13xx_gpio_type type) +static int regulator_npm1300_set_ldsw_pin_ctrl(const struct device *dev, uint8_t chan, + const struct npm1300_gpio_info *pin_info, + enum npm1300_gpio_type type) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint8_t inv = pin_info->invert ? 1 : 0; uint8_t ctrl; - if (type != NPM13XX_GPIO_TYPE_ENABLE) { + if (type != NPM1300_GPIO_TYPE_ENABLE) { return -ENOTSUP; } ctrl = (pin_info->pin + 1U) | (inv << 3U); - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_GPISEL + chan, ctrl); + return mfd_npm1300_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_GPISEL + chan, ctrl); } -int regulator_npm13xx_set_pin_ctrl(const struct device *dev, const struct npm13xx_gpio_info *info, - enum npm13xx_gpio_type type) +int regulator_npm1300_set_pin_ctrl(const struct device *dev, const struct npm1300_gpio_info *info, + enum npm1300_gpio_type type) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; - if (info->pin == NPM13XX_GPIO_UNUSED) { + if (info->pin == NPM1300_GPIO_UNUSED) { return 0; } switch (config->source) { - case NPM13XX_SOURCE_BUCK1: - return regulator_npm13xx_set_buck_pin_ctrl(dev, 0, info, type); - case NPM13XX_SOURCE_BUCK2: - return regulator_npm13xx_set_buck_pin_ctrl(dev, 1, info, type); - case NPM13XX_SOURCE_LDO1: - return regulator_npm13xx_set_ldsw_pin_ctrl(dev, 0, info, type); - case NPM13XX_SOURCE_LDO2: - return regulator_npm13xx_set_ldsw_pin_ctrl(dev, 1, info, type); + case NPM1300_SOURCE_BUCK1: + return regulator_npm1300_set_buck_pin_ctrl(dev, 0, info, type); + case NPM1300_SOURCE_BUCK2: + return regulator_npm1300_set_buck_pin_ctrl(dev, 1, info, type); + case NPM1300_SOURCE_LDO1: + return regulator_npm1300_set_ldsw_pin_ctrl(dev, 0, info, type); + case NPM1300_SOURCE_LDO2: + return regulator_npm1300_set_ldsw_pin_ctrl(dev, 1, info, type); default: return -ENODEV; } } -int regulator_npm13xx_dvs_state_set(const struct device *dev, regulator_dvs_state_t state) +int regulator_npm1300_dvs_state_set(const struct device *dev, regulator_dvs_state_t state) { - const struct regulator_npm13xx_pconfig *pconfig = dev->config; + const struct regulator_npm1300_pconfig *pconfig = dev->config; const struct gpio_dt_spec *spec; int ret; @@ -519,21 +519,21 @@ int regulator_npm13xx_dvs_state_set(const struct device *dev, regulator_dvs_stat return 0; } -int regulator_npm13xx_ship_mode(const struct device *dev) +int regulator_npm1300_ship_mode(const struct device *dev) { - const struct regulator_npm13xx_pconfig *pconfig = dev->config; + const struct regulator_npm1300_pconfig *pconfig = dev->config; - return mfd_npm13xx_reg_write(pconfig->mfd, SHIP_BASE, SHIP_OFFSET_SHIP, 1U); + return mfd_npm1300_reg_write(pconfig->mfd, SHIP_BASE, SHIP_OFFSET_SHIP, 1U); } static DEVICE_API(regulator_parent, parent_api) = { - .dvs_state_set = regulator_npm13xx_dvs_state_set, - .ship_mode = regulator_npm13xx_ship_mode, + .dvs_state_set = regulator_npm1300_dvs_state_set, + .ship_mode = regulator_npm1300_ship_mode, }; -int regulator_npm13xx_common_init(const struct device *dev) +int regulator_npm1300_common_init(const struct device *dev) { - const struct regulator_npm13xx_pconfig *pconfig = dev->config; + const struct regulator_npm1300_pconfig *pconfig = dev->config; const struct gpio_dt_spec *spec; int ret; @@ -558,10 +558,10 @@ int regulator_npm13xx_common_init(const struct device *dev) static int get_enabled_reg(const struct device *dev, uint8_t base, uint8_t offset, uint8_t mask, bool *enabled) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; uint8_t data; - int ret = mfd_npm13xx_reg_read(config->mfd, base, offset, &data); + int ret = mfd_npm1300_reg_read(config->mfd, base, offset, &data); if (ret < 0) { return ret; @@ -574,16 +574,16 @@ static int get_enabled_reg(const struct device *dev, uint8_t base, uint8_t offse static int get_enabled(const struct device *dev, bool *enabled) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: + case NPM1300_SOURCE_BUCK1: return get_enabled_reg(dev, BUCK_BASE, BUCK_OFFSET_STATUS, BUCK1_ON_MASK, enabled); - case NPM13XX_SOURCE_BUCK2: + case NPM1300_SOURCE_BUCK2: return get_enabled_reg(dev, BUCK_BASE, BUCK_OFFSET_STATUS, BUCK2_ON_MASK, enabled); - case NPM13XX_SOURCE_LDO1: + case NPM1300_SOURCE_LDO1: return get_enabled_reg(dev, LDSW_BASE, LDSW_OFFSET_STATUS, LDSW1_ON_MASK, enabled); - case NPM13XX_SOURCE_LDO2: + case NPM1300_SOURCE_LDO2: return get_enabled_reg(dev, LDSW_BASE, LDSW_OFFSET_STATUS, LDSW2_ON_MASK, enabled); default: return -ENODEV; @@ -592,15 +592,15 @@ static int get_enabled(const struct device *dev, bool *enabled) static int soft_start_set(const struct device *dev, uint8_t soft_start) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_LDO1: - return mfd_npm13xx_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, + case NPM1300_SOURCE_LDO1: + return mfd_npm1300_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, soft_start << LDSW1_SOFTSTART_SHIFT, LDSW1_SOFTSTART_MASK); - case NPM13XX_SOURCE_LDO2: - return mfd_npm13xx_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, + case NPM1300_SOURCE_LDO2: + return mfd_npm1300_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, soft_start << LDSW2_SOFTSTART_SHIFT, LDSW2_SOFTSTART_MASK); default: @@ -610,23 +610,23 @@ static int soft_start_set(const struct device *dev, uint8_t soft_start) static int active_discharge_set(const struct device *dev, bool enabled) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; switch (config->source) { - case NPM13XX_SOURCE_BUCK1: - return mfd_npm13xx_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_CTRL0, + case NPM1300_SOURCE_BUCK1: + return mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_CTRL0, enabled ? BUCK1_EN_PULLDOWN_MASK : 0, BUCK1_EN_PULLDOWN_MASK); - case NPM13XX_SOURCE_BUCK2: - return mfd_npm13xx_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_CTRL0, + case NPM1300_SOURCE_BUCK2: + return mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_CTRL0, enabled ? BUCK2_EN_PULLDOWN_MASK : 0, BUCK2_EN_PULLDOWN_MASK); - case NPM13XX_SOURCE_LDO1: - return mfd_npm13xx_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, + case NPM1300_SOURCE_LDO1: + return mfd_npm1300_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, enabled ? LDSW1_ACTIVE_DISCHARGE_MASK : 0, LDSW1_ACTIVE_DISCHARGE_MASK); - case NPM13XX_SOURCE_LDO2: - return mfd_npm13xx_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, + case NPM1300_SOURCE_LDO2: + return mfd_npm1300_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, enabled ? LDSW2_ACTIVE_DISCHARGE_MASK : 0, LDSW2_ACTIVE_DISCHARGE_MASK); default: @@ -634,9 +634,9 @@ static int active_discharge_set(const struct device *dev, bool enabled) } } -int regulator_npm13xx_init(const struct device *dev) +int regulator_npm1300_init(const struct device *dev) { - const struct regulator_npm13xx_config *config = dev->config; + const struct regulator_npm1300_config *config = dev->config; bool enabled; int ret = 0; @@ -677,18 +677,18 @@ int regulator_npm13xx_init(const struct device *dev) } /* Configure GPIO pin control */ - ret = regulator_npm13xx_set_pin_ctrl(dev, &config->enable_gpios, NPM13XX_GPIO_TYPE_ENABLE); + ret = regulator_npm1300_set_pin_ctrl(dev, &config->enable_gpios, NPM1300_GPIO_TYPE_ENABLE); if (ret != 0) { return ret; } - ret = regulator_npm13xx_set_pin_ctrl(dev, &config->retention_gpios, - NPM13XX_GPIO_TYPE_RETENTION); + ret = regulator_npm1300_set_pin_ctrl(dev, &config->retention_gpios, + NPM1300_GPIO_TYPE_RETENTION); if (ret != 0) { return ret; } - ret = regulator_npm13xx_set_pin_ctrl(dev, &config->pwm_gpios, NPM13XX_GPIO_TYPE_PWM); + ret = regulator_npm1300_set_pin_ctrl(dev, &config->pwm_gpios, NPM1300_GPIO_TYPE_PWM); if (ret != 0) { return ret; } @@ -697,28 +697,28 @@ int regulator_npm13xx_init(const struct device *dev) } static DEVICE_API(regulator, api) = { - .enable = regulator_npm13xx_enable, - .disable = regulator_npm13xx_disable, - .count_voltages = regulator_npm13xx_count_voltages, - .list_voltage = regulator_npm13xx_list_voltage, - .set_voltage = regulator_npm13xx_set_voltage, - .get_voltage = regulator_npm13xx_get_voltage, - .set_mode = regulator_npm13xx_set_mode, + .enable = regulator_npm1300_enable, + .disable = regulator_npm1300_disable, + .count_voltages = regulator_npm1300_count_voltages, + .list_voltage = regulator_npm1300_list_voltage, + .set_voltage = regulator_npm1300_set_voltage, + .get_voltage = regulator_npm1300_get_voltage, + .set_mode = regulator_npm1300_set_mode, }; #define GPIO_CONFIG_DEFINE(node_id, prop) \ COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \ ({DT_PROP_BY_IDX(node_id, prop, 0), \ !!(DT_PROP_BY_IDX(node_id, prop, 1) & GPIO_ACTIVE_LOW)}), \ - ({NPM13XX_GPIO_UNUSED, false})) + ({NPM1300_GPIO_UNUSED, false})) -#define REGULATOR_NPM13XX_DEFINE(node_id, id, _source) \ +#define REGULATOR_NPM1300_DEFINE(node_id, id, _source) \ BUILD_ASSERT(DT_PROP_LEN_OR(node_id, enable_gpio_config, 2) == 2); \ BUILD_ASSERT(DT_PROP_LEN_OR(node_id, retention_gpio_config, 2) == 2); \ BUILD_ASSERT(DT_PROP_LEN_OR(node_id, pwm_gpio_config, 2) == 2); \ - static struct regulator_npm13xx_data data_##id; \ + static struct regulator_npm1300_data data_##id; \ \ - static const struct regulator_npm13xx_config config_##id = { \ + static const struct regulator_npm1300_config config_##id = { \ .common = REGULATOR_DT_COMMON_CONFIG_INIT(node_id), \ .mfd = DEVICE_DT_GET(DT_GPARENT(node_id)), \ .source = _source, \ @@ -730,16 +730,16 @@ static DEVICE_API(regulator, api) = { .active_discharge = DT_PROP(node_id, active_discharge), \ .ldo_disable_workaround = DT_PROP(node_id, nordic_anomaly38_disable_workaround)}; \ \ - DEVICE_DT_DEFINE(node_id, regulator_npm13xx_init, NULL, &data_##id, &config_##id, \ - POST_KERNEL, CONFIG_REGULATOR_NPM13XX_INIT_PRIORITY, &api); + DEVICE_DT_DEFINE(node_id, regulator_npm1300_init, NULL, &data_##id, &config_##id, \ + POST_KERNEL, CONFIG_REGULATOR_NPM1300_INIT_PRIORITY, &api); -#define REGULATOR_NPM13XX_DEFINE_COND(inst, child, source) \ +#define REGULATOR_NPM1300_DEFINE_COND(inst, child, source) \ COND_CODE_1(DT_NODE_EXISTS(DT_INST_CHILD(inst, child)), \ - (REGULATOR_NPM13XX_DEFINE(DT_INST_CHILD(inst, child), child##inst, source)), \ + (REGULATOR_NPM1300_DEFINE(DT_INST_CHILD(inst, child), child##inst, source)), \ ()) -#define REGULATOR_NPM13XX_DEFINE_ALL(inst) \ - static const struct regulator_npm13xx_pconfig config_##inst = { \ +#define REGULATOR_NPM1300_DEFINE_ALL(inst) \ + static const struct regulator_npm1300_pconfig config_##inst = { \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(inst)), \ .dvs_state_pins = {GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 0, {0}), \ GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 1, {0}), \ @@ -747,13 +747,13 @@ static DEVICE_API(regulator, api) = { GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 3, {0}), \ GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, dvs_gpios, 4, {0})}}; \ \ - DEVICE_DT_INST_DEFINE(inst, regulator_npm13xx_common_init, NULL, NULL, &config_##inst, \ - POST_KERNEL, CONFIG_REGULATOR_NPM13XX_COMMON_INIT_PRIORITY, \ + DEVICE_DT_INST_DEFINE(inst, regulator_npm1300_common_init, NULL, NULL, &config_##inst, \ + POST_KERNEL, CONFIG_REGULATOR_NPM1300_COMMON_INIT_PRIORITY, \ &parent_api); \ \ - REGULATOR_NPM13XX_DEFINE_COND(inst, buck1, NPM13XX_SOURCE_BUCK1) \ - REGULATOR_NPM13XX_DEFINE_COND(inst, buck2, NPM13XX_SOURCE_BUCK2) \ - REGULATOR_NPM13XX_DEFINE_COND(inst, ldo1, NPM13XX_SOURCE_LDO1) \ - REGULATOR_NPM13XX_DEFINE_COND(inst, ldo2, NPM13XX_SOURCE_LDO2) + REGULATOR_NPM1300_DEFINE_COND(inst, buck1, NPM1300_SOURCE_BUCK1) \ + REGULATOR_NPM1300_DEFINE_COND(inst, buck2, NPM1300_SOURCE_BUCK2) \ + REGULATOR_NPM1300_DEFINE_COND(inst, ldo1, NPM1300_SOURCE_LDO1) \ + REGULATOR_NPM1300_DEFINE_COND(inst, ldo2, NPM1300_SOURCE_LDO2) -DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM13XX_DEFINE_ALL) +DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM1300_DEFINE_ALL) diff --git a/drivers/sensor/nordic/CMakeLists.txt b/drivers/sensor/nordic/CMakeLists.txt index bd72ded9ccc..cfda4b85b47 100644 --- a/drivers/sensor/nordic/CMakeLists.txt +++ b/drivers/sensor/nordic/CMakeLists.txt @@ -3,7 +3,7 @@ # zephyr-keep-sorted-start add_subdirectory(temp) -add_subdirectory_ifdef(CONFIG_NPM13XX_CHARGER npm13xx_charger) +add_subdirectory_ifdef(CONFIG_NPM1300_CHARGER npm13xx_charger) add_subdirectory_ifdef(CONFIG_NPM2100_VBAT npm2100_vbat) add_subdirectory_ifdef(CONFIG_QDEC_NRFX qdec_nrfx) # zephyr-keep-sorted-stop diff --git a/drivers/sensor/nordic/npm13xx_charger/Kconfig b/drivers/sensor/nordic/npm13xx_charger/Kconfig index e511e393fa2..abafa530950 100644 --- a/drivers/sensor/nordic/npm13xx_charger/Kconfig +++ b/drivers/sensor/nordic/npm13xx_charger/Kconfig @@ -2,12 +2,12 @@ # # SPDX-License-Identifier: Apache-2.0 -config NPM13XX_CHARGER - bool "nPM13xx Charger" +config NPM1300_CHARGER + bool "NPM1300 Charger" default y depends on DT_HAS_NORDIC_NPM1300_CHARGER_ENABLED select I2C select MFD select REQUIRES_FULL_LIBC help - Enable nPM13xx charger driver. + Enable NPM1300 charger driver. diff --git a/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c b/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c index bf5afe2d3f4..829ce6a2265 100644 --- a/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c +++ b/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c @@ -12,7 +12,7 @@ #include #include -struct npm13xx_charger_config { +struct npm1300_charger_config { const struct device *mfd; int32_t term_microvolt; int32_t term_warm_microvolt; @@ -32,7 +32,7 @@ struct npm13xx_charger_config { bool disable_recharge; }; -struct npm13xx_charger_data { +struct npm1300_charger_data { uint16_t voltage; uint16_t current; uint16_t temp; @@ -43,12 +43,12 @@ struct npm13xx_charger_data { uint8_t vbus_stat; }; -/* nPM13xx base addresses */ +/* nPM1300 base addresses */ #define CHGR_BASE 0x03U #define ADC_BASE 0x05U #define VBUS_BASE 0x02U -/* nPM13xx charger register offsets */ +/* nPM1300 charger register offsets */ #define CHGR_OFFSET_ERR_CLR 0x00U #define CHGR_OFFSET_EN_SET 0x04U #define CHGR_OFFSET_EN_CLR 0x05U @@ -65,7 +65,7 @@ struct npm13xx_charger_data { #define CHGR_OFFSET_ERR_REASON 0x36U #define CHGR_OFFSET_VBATLOW_EN 0x50U -/* nPM13xx ADC register offsets */ +/* nPM1300 ADC register offsets */ #define ADC_OFFSET_TASK_VBAT 0x00U #define ADC_OFFSET_TASK_TEMP 0x01U #define ADC_OFFSET_TASK_DIE 0x02U @@ -75,7 +75,7 @@ struct npm13xx_charger_data { #define ADC_OFFSET_RESULTS 0x10U #define ADC_OFFSET_IBAT_EN 0x24U -/* nPM13xx VBUS register offsets */ +/* nPM1300 VBUS register offsets */ #define VBUS_OFFSET_ILIMUPDATE 0x00U #define VBUS_OFFSET_ILIM 0x01U #define VBUS_OFFSET_ILIMSTARTUP 0x02U @@ -149,7 +149,7 @@ static const uint16_t discharge_limits[] = {84U, 415U}; /* Linear range for vbusin current limit */ static const struct linear_range vbus_current_range = LINEAR_RANGE_INIT(100000, 100000, 1U, 15U); -static void calc_temp(const struct npm13xx_charger_config *const config, uint16_t code, +static void calc_temp(const struct npm1300_charger_config *const config, uint16_t code, struct sensor_value *valp) { /* Ref: PS v1.2 Section 7.1.4: Battery temperature (Kelvin) */ @@ -161,7 +161,7 @@ static void calc_temp(const struct npm13xx_charger_config *const config, uint16_ (void)sensor_value_from_float(valp, temp); } -static void calc_dietemp(const struct npm13xx_charger_config *const config, uint16_t code, +static void calc_dietemp(const struct npm1300_charger_config *const config, uint16_t code, struct sensor_value *valp) { /* Ref: PS v1.2 Section 7.1.4: Die temperature (Celsius) */ @@ -171,7 +171,7 @@ static void calc_dietemp(const struct npm13xx_charger_config *const config, uint (void)sensor_value_from_milli(valp, temp); } -static uint32_t calc_ntc_res(const struct npm13xx_charger_config *const config, int32_t temp_mdegc) +static uint32_t calc_ntc_res(const struct npm1300_charger_config *const config, int32_t temp_mdegc) { float inv_t0 = 1.f / 298.15f; float temp = (float)temp_mdegc / 1000.f; @@ -187,8 +187,8 @@ static uint16_t adc_get_res(uint8_t msb, uint8_t lsb, uint16_t lsb_shift) return ((uint16_t)msb << ADC_MSB_SHIFT) | ((lsb >> lsb_shift) & ADC_LSB_MASK); } -static void calc_current(const struct npm13xx_charger_config *const config, - struct npm13xx_charger_data *const data, struct sensor_value *valp) +static void calc_current(const struct npm1300_charger_config *const config, + struct npm1300_charger_data *const data, struct sensor_value *valp) { int32_t full_scale_ua; int32_t current_ua; @@ -232,11 +232,11 @@ static void calc_current(const struct npm13xx_charger_config *const config, (void)sensor_value_from_micro(valp, current_ua); } -int npm13xx_charger_channel_get(const struct device *dev, enum sensor_channel chan, +int npm1300_charger_channel_get(const struct device *dev, enum sensor_channel chan, struct sensor_value *valp) { - const struct npm13xx_charger_config *const config = dev->config; - struct npm13xx_charger_data *const data = dev->data; + const struct npm1300_charger_config *const config = dev->config; + struct npm1300_charger_data *const data = dev->data; switch ((uint32_t)chan) { case SENSOR_CHAN_GAUGE_VOLTAGE: @@ -251,11 +251,11 @@ int npm13xx_charger_channel_get(const struct device *dev, enum sensor_channel ch case SENSOR_CHAN_GAUGE_AVG_CURRENT: calc_current(config, data, valp); break; - case SENSOR_CHAN_NPM13XX_CHARGER_STATUS: + case SENSOR_CHAN_NPM1300_CHARGER_STATUS: valp->val1 = data->status; valp->val2 = 0; break; - case SENSOR_CHAN_NPM13XX_CHARGER_ERROR: + case SENSOR_CHAN_NPM1300_CHARGER_ERROR: valp->val1 = data->error; valp->val2 = 0; break; @@ -268,7 +268,7 @@ int npm13xx_charger_channel_get(const struct device *dev, enum sensor_channel ch case SENSOR_CHAN_DIE_TEMP: calc_dietemp(config, data->dietemp, valp); break; - case SENSOR_CHAN_NPM13XX_CHARGER_VBUS_STATUS: + case SENSOR_CHAN_NPM1300_CHARGER_VBUS_STATUS: valp->val1 = data->vbus_stat; valp->val2 = 0; break; @@ -279,26 +279,26 @@ int npm13xx_charger_channel_get(const struct device *dev, enum sensor_channel ch return 0; } -int npm13xx_charger_sample_fetch(const struct device *dev, enum sensor_channel chan) +int npm1300_charger_sample_fetch(const struct device *dev, enum sensor_channel chan) { - const struct npm13xx_charger_config *const config = dev->config; - struct npm13xx_charger_data *data = dev->data; + const struct npm1300_charger_config *const config = dev->config; + struct npm1300_charger_data *data = dev->data; struct adc_results_t results; int ret; /* Read charge status and error reason */ - ret = mfd_npm13xx_reg_read(config->mfd, CHGR_BASE, CHGR_OFFSET_CHG_STAT, &data->status); + ret = mfd_npm1300_reg_read(config->mfd, CHGR_BASE, CHGR_OFFSET_CHG_STAT, &data->status); if (ret != 0) { return ret; } - ret = mfd_npm13xx_reg_read(config->mfd, CHGR_BASE, CHGR_OFFSET_ERR_REASON, &data->error); + ret = mfd_npm1300_reg_read(config->mfd, CHGR_BASE, CHGR_OFFSET_ERR_REASON, &data->error); if (ret != 0) { return ret; } /* Read adc results */ - ret = mfd_npm13xx_reg_read_burst(config->mfd, ADC_BASE, ADC_OFFSET_RESULTS, &results, + ret = mfd_npm1300_reg_read_burst(config->mfd, ADC_BASE, ADC_OFFSET_RESULTS, &results, sizeof(results)); if (ret != 0) { return ret; @@ -311,19 +311,19 @@ int npm13xx_charger_sample_fetch(const struct device *dev, enum sensor_channel c data->ibat_stat = results.ibat_stat; /* Trigger ntc and die temperature measurements */ - ret = mfd_npm13xx_reg_write2(config->mfd, ADC_BASE, ADC_OFFSET_TASK_TEMP, 1U, 1U); + ret = mfd_npm1300_reg_write2(config->mfd, ADC_BASE, ADC_OFFSET_TASK_TEMP, 1U, 1U); if (ret != 0) { return ret; } /* Trigger current and voltage measurement */ - ret = mfd_npm13xx_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_TASK_VBAT, 1U); + ret = mfd_npm1300_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_TASK_VBAT, 1U); if (ret != 0) { return ret; } /* Read vbus status */ - ret = mfd_npm13xx_reg_read(config->mfd, VBUS_BASE, VBUS_OFFSET_STATUS, &data->vbus_stat); + ret = mfd_npm1300_reg_read(config->mfd, VBUS_BASE, VBUS_OFFSET_STATUS, &data->vbus_stat); if (ret != 0) { return ret; } @@ -331,7 +331,7 @@ int npm13xx_charger_sample_fetch(const struct device *dev, enum sensor_channel c return ret; } -static int set_ntc_thresholds(const struct npm13xx_charger_config *const config) +static int set_ntc_thresholds(const struct npm1300_charger_config *const config) { for (uint8_t idx = 0U; idx < 4U; idx++) { if (config->temp_thresholds[idx] < INT32_MAX) { @@ -340,7 +340,7 @@ static int set_ntc_thresholds(const struct npm13xx_charger_config *const config) /* Ref: Datasheet Figure 14: Equation for battery temperature */ uint16_t code = (1024 * res) / (res + config->thermistor_ohms); - int ret = mfd_npm13xx_reg_write2( + int ret = mfd_npm1300_reg_write2( config->mfd, CHGR_BASE, CHGR_OFFSET_NTC_TEMPS + (idx * 2U), code >> NTCTEMP_MSB_SHIFT, code & NTCTEMP_LSB_MASK); @@ -353,7 +353,7 @@ static int set_ntc_thresholds(const struct npm13xx_charger_config *const config) return 0; } -static int set_dietemp_thresholds(const struct npm13xx_charger_config *const config) +static int set_dietemp_thresholds(const struct npm1300_charger_config *const config) { for (uint8_t idx = 0U; idx < 2U; idx++) { if (config->dietemp_thresholds[idx] < INT32_MAX) { @@ -363,7 +363,7 @@ static int set_dietemp_thresholds(const struct npm13xx_charger_config *const con DIETEMP_FACTOR_DIV; uint16_t code = DIV_ROUND_CLOSEST(numerator, DIETEMP_FACTOR_MUL); - int ret = mfd_npm13xx_reg_write2( + int ret = mfd_npm1300_reg_write2( config->mfd, CHGR_BASE, CHGR_OFFSET_DIE_TEMPS + (idx * 2U), code >> DIETEMP_MSB_SHIFT, code & DIETEMP_LSB_MASK); @@ -376,10 +376,10 @@ static int set_dietemp_thresholds(const struct npm13xx_charger_config *const con return 0; } -static int npm13xx_charger_attr_get(const struct device *dev, enum sensor_channel chan, +static int npm1300_charger_attr_get(const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, struct sensor_value *val) { - const struct npm13xx_charger_config *const config = dev->config; + const struct npm1300_charger_config *const config = dev->config; uint8_t data; int ret; @@ -389,7 +389,7 @@ static int npm13xx_charger_attr_get(const struct device *dev, enum sensor_channe return -ENOTSUP; } - ret = mfd_npm13xx_reg_read(config->mfd, CHGR_BASE, CHGR_OFFSET_EN_SET, &data); + ret = mfd_npm1300_reg_read(config->mfd, CHGR_BASE, CHGR_OFFSET_EN_SET, &data); if (ret == 0) { val->val1 = data; val->val2 = 0U; @@ -401,7 +401,7 @@ static int npm13xx_charger_attr_get(const struct device *dev, enum sensor_channe return -ENOTSUP; } - ret = mfd_npm13xx_reg_read(config->mfd, VBUS_BASE, VBUS_OFFSET_DETECT, &data); + ret = mfd_npm1300_reg_read(config->mfd, VBUS_BASE, VBUS_OFFSET_DETECT, &data); if (ret < 0) { return ret; } @@ -418,29 +418,29 @@ static int npm13xx_charger_attr_get(const struct device *dev, enum sensor_channe return 0; - case SENSOR_CHAN_NPM13XX_CHARGER_VBUS_STATUS: - ret = mfd_npm13xx_reg_read(config->mfd, VBUS_BASE, VBUS_OFFSET_STATUS, &data); + case SENSOR_CHAN_NPM1300_CHARGER_VBUS_STATUS: + ret = mfd_npm1300_reg_read(config->mfd, VBUS_BASE, VBUS_OFFSET_STATUS, &data); if (ret < 0) { return ret; } - switch ((enum sensor_attribute_npm13xx_charger)attr) { - case SENSOR_ATTR_NPM13XX_CHARGER_VBUS_PRESENT: + switch ((enum sensor_attribute_npm1300_charger)attr) { + case SENSOR_ATTR_NPM1300_CHARGER_VBUS_PRESENT: val->val1 = (data & STATUS_PRESENT_MASK) != 0; break; - case SENSOR_ATTR_NPM13XX_CHARGER_VBUS_CUR_LIMIT: + case SENSOR_ATTR_NPM1300_CHARGER_VBUS_CUR_LIMIT: val->val1 = (data & STATUS_CUR_LIMIT_MASK) != 0; break; - case SENSOR_ATTR_NPM13XX_CHARGER_VBUS_OVERVLT_PROT: + case SENSOR_ATTR_NPM1300_CHARGER_VBUS_OVERVLT_PROT: val->val1 = (data & STATUS_OVERVLT_PROT_MASK) != 0; break; - case SENSOR_ATTR_NPM13XX_CHARGER_VBUS_UNDERVLT: + case SENSOR_ATTR_NPM1300_CHARGER_VBUS_UNDERVLT: val->val1 = (data & STATUS_UNDERVLT_MASK) != 0; break; - case SENSOR_ATTR_NPM13XX_CHARGER_VBUS_SUSPENDED: + case SENSOR_ATTR_NPM1300_CHARGER_VBUS_SUSPENDED: val->val1 = (data & STATUS_SUSPENDED_MASK) != 0; break; - case SENSOR_ATTR_NPM13XX_CHARGER_VBUS_BUSOUT: + case SENSOR_ATTR_NPM1300_CHARGER_VBUS_BUSOUT: val->val1 = (data & STATUS_BUSOUT_MASK) != 0; break; default: @@ -454,10 +454,10 @@ static int npm13xx_charger_attr_get(const struct device *dev, enum sensor_channe } } -static int npm13xx_charger_attr_set(const struct device *dev, enum sensor_channel chan, +static int npm1300_charger_attr_set(const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, const struct sensor_value *val) { - const struct npm13xx_charger_config *const config = dev->config; + const struct npm1300_charger_config *const config = dev->config; int ret; if (attr != SENSOR_ATTR_CONFIGURATION) { @@ -468,16 +468,16 @@ static int npm13xx_charger_attr_set(const struct device *dev, enum sensor_channe case SENSOR_CHAN_GAUGE_DESIRED_CHARGING_CURRENT: if (val->val1 == 0) { /* Disable charging */ - return mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_EN_CLR, + return mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_EN_CLR, 1U); } /* Clear any errors and enable charging */ - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_ERR_CLR, 1U); + ret = mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_ERR_CLR, 1U); if (ret != 0) { return ret; } - return mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_EN_SET, 1U); + return mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_EN_SET, 1U); case SENSOR_CHAN_CURRENT: /* Set vbus current limit */ @@ -490,22 +490,22 @@ static int npm13xx_charger_attr_set(const struct device *dev, enum sensor_channe return ret; } - ret = mfd_npm13xx_reg_write(config->mfd, VBUS_BASE, VBUS_OFFSET_ILIM, idx); + ret = mfd_npm1300_reg_write(config->mfd, VBUS_BASE, VBUS_OFFSET_ILIM, idx); if (ret != 0) { return ret; } /* Switch to new current limit, this will be reset automatically on USB removal */ - return mfd_npm13xx_reg_write(config->mfd, VBUS_BASE, VBUS_OFFSET_ILIMUPDATE, 1U); + return mfd_npm1300_reg_write(config->mfd, VBUS_BASE, VBUS_OFFSET_ILIMUPDATE, 1U); default: return -ENOTSUP; } } -int npm13xx_charger_init(const struct device *dev) +int npm1300_charger_init(const struct device *dev) { - const struct npm13xx_charger_config *const config = dev->config; + const struct npm1300_charger_config *const config = dev->config; uint16_t idx; uint8_t byte = 0U; int ret; @@ -515,7 +515,7 @@ int npm13xx_charger_init(const struct device *dev) } /* Configure temperature thresholds */ - ret = mfd_npm13xx_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_NTCR_SEL, + ret = mfd_npm1300_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_NTCR_SEL, config->thermistor_idx); if (ret != 0) { return ret; @@ -538,7 +538,7 @@ int npm13xx_charger_init(const struct device *dev) if (ret == -EINVAL) { return ret; } - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_VTERM, idx); + ret = mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_VTERM, idx); if (ret != 0) { return ret; } @@ -550,7 +550,7 @@ int npm13xx_charger_init(const struct device *dev) return ret; } - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_VTERM_R, idx); + ret = mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_VTERM_R, idx); if (ret != 0) { return ret; } @@ -563,13 +563,13 @@ int npm13xx_charger_init(const struct device *dev) return ret; } - ret = mfd_npm13xx_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET, idx / 2U, idx & 1U); + ret = mfd_npm1300_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET, idx / 2U, idx & 1U); if (ret != 0) { return ret; } /* Set discharge limit */ - ret = mfd_npm13xx_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET_DISCHG, + ret = mfd_npm1300_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET_DISCHG, discharge_limits[config->dischg_limit_idx] / 2U, discharge_limits[config->dischg_limit_idx] & 1U); if (ret != 0) { @@ -582,52 +582,52 @@ int npm13xx_charger_init(const struct device *dev) if (ret == -EINVAL) { return ret; } - ret = mfd_npm13xx_reg_write(config->mfd, VBUS_BASE, VBUS_OFFSET_ILIMSTARTUP, idx); + ret = mfd_npm1300_reg_write(config->mfd, VBUS_BASE, VBUS_OFFSET_ILIMSTARTUP, idx); if (ret != 0) { return ret; } /* Configure trickle voltage threshold */ - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_TRICKLE_SEL, + ret = mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_TRICKLE_SEL, config->trickle_sel); if (ret != 0) { return ret; } /* Configure termination current */ - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_ITERM_SEL, + ret = mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_ITERM_SEL, config->iterm_sel); if (ret != 0) { return ret; } /* Enable current measurement */ - ret = mfd_npm13xx_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_IBAT_EN, 1U); + ret = mfd_npm1300_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_IBAT_EN, 1U); if (ret != 0) { return ret; } /* Trigger current and voltage measurement */ - ret = mfd_npm13xx_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_TASK_VBAT, 1U); + ret = mfd_npm1300_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_TASK_VBAT, 1U); if (ret != 0) { return ret; } /* Trigger ntc and die temperature measurements */ - ret = mfd_npm13xx_reg_write2(config->mfd, ADC_BASE, ADC_OFFSET_TASK_TEMP, 1U, 1U); + ret = mfd_npm1300_reg_write2(config->mfd, ADC_BASE, ADC_OFFSET_TASK_TEMP, 1U, 1U); if (ret != 0) { return ret; } /* Enable automatic temperature measurements during charging */ - ret = mfd_npm13xx_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_TASK_AUTO, 1U); + ret = mfd_npm1300_reg_write(config->mfd, ADC_BASE, ADC_OFFSET_TASK_AUTO, 1U); if (ret != 0) { return ret; } /* Enable charging at low battery if configured */ if (config->vbatlow_charge_enable) { - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_VBATLOW_EN, 1U); + ret = mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_VBATLOW_EN, 1U); if (ret != 0) { return ret; } @@ -643,14 +643,14 @@ int npm13xx_charger_init(const struct device *dev) WRITE_BIT(byte, 1U, true); } - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_DIS_SET, byte); + ret = mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_DIS_SET, byte); if (ret != 0) { return ret; } /* Enable charging if configured */ if (config->charging_enable) { - ret = mfd_npm13xx_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_EN_SET, 1U); + ret = mfd_npm1300_reg_write(config->mfd, CHGR_BASE, CHGR_OFFSET_EN_SET, 1U); if (ret != 0) { return ret; } @@ -659,19 +659,19 @@ int npm13xx_charger_init(const struct device *dev) return 0; } -static DEVICE_API(sensor, npm13xx_charger_battery_driver_api) = { - .sample_fetch = npm13xx_charger_sample_fetch, - .channel_get = npm13xx_charger_channel_get, - .attr_set = npm13xx_charger_attr_set, - .attr_get = npm13xx_charger_attr_get, +static DEVICE_API(sensor, npm1300_charger_battery_driver_api) = { + .sample_fetch = npm1300_charger_sample_fetch, + .channel_get = npm1300_charger_channel_get, + .attr_set = npm1300_charger_attr_set, + .attr_get = npm1300_charger_attr_get, }; -#define NPM13XX_CHARGER_INIT(n) \ +#define NPM1300_CHARGER_INIT(n) \ BUILD_ASSERT(DT_INST_ENUM_IDX(n, dischg_limit_microamp) < ARRAY_SIZE(discharge_limits)); \ \ - static struct npm13xx_charger_data npm13xx_charger_data_##n; \ + static struct npm1300_charger_data npm1300_charger_data_##n; \ \ - static const struct npm13xx_charger_config npm13xx_charger_config_##n = { \ + static const struct npm1300_charger_config npm1300_charger_config_##n = { \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(n)), \ .term_microvolt = DT_INST_PROP(n, term_microvolt), \ .term_warm_microvolt = \ @@ -696,9 +696,9 @@ static DEVICE_API(sensor, npm13xx_charger_battery_driver_api) = { DT_INST_PROP_OR(n, thermistor_warm_millidegrees, INT32_MAX), \ DT_INST_PROP_OR(n, thermistor_hot_millidegrees, INT32_MAX)}}; \ \ - SENSOR_DEVICE_DT_INST_DEFINE(n, &npm13xx_charger_init, NULL, &npm13xx_charger_data_##n, \ - &npm13xx_charger_config_##n, POST_KERNEL, \ + SENSOR_DEVICE_DT_INST_DEFINE(n, &npm1300_charger_init, NULL, &npm1300_charger_data_##n, \ + &npm1300_charger_config_##n, POST_KERNEL, \ CONFIG_SENSOR_INIT_PRIORITY, \ - &npm13xx_charger_battery_driver_api); + &npm1300_charger_battery_driver_api); -DT_INST_FOREACH_STATUS_OKAY(NPM13XX_CHARGER_INIT) +DT_INST_FOREACH_STATUS_OKAY(NPM1300_CHARGER_INIT) diff --git a/drivers/watchdog/CMakeLists.txt b/drivers/watchdog/CMakeLists.txt index e247de4e9fe..4d6f75e4d9e 100644 --- a/drivers/watchdog/CMakeLists.txt +++ b/drivers/watchdog/CMakeLists.txt @@ -28,7 +28,7 @@ zephyr_library_sources_ifdef(CONFIG_WDT_MCUX_WDOG wdt_mcux_wdog.c) zephyr_library_sources_ifdef(CONFIG_WDT_MCUX_WDOG32 wdt_mcux_wdog32.c) zephyr_library_sources_ifdef(CONFIG_WDT_MCUX_WWDT wdt_mcux_wwdt.c) zephyr_library_sources_ifdef(CONFIG_WDT_NPCX wdt_npcx.c) -zephyr_library_sources_ifdef(CONFIG_WDT_NPM13XX wdt_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_WDT_NPM1300 wdt_npm13xx.c) zephyr_library_sources_ifdef(CONFIG_WDT_NPM2100 wdt_npm2100.c) zephyr_library_sources_ifdef(CONFIG_WDT_NPM6001 wdt_npm6001.c) zephyr_library_sources_ifdef(CONFIG_WDT_NRFX wdt_nrfx.c) diff --git a/drivers/watchdog/Kconfig.npm13xx b/drivers/watchdog/Kconfig.npm13xx index 2318349c85e..b18e4b69b13 100644 --- a/drivers/watchdog/Kconfig.npm13xx +++ b/drivers/watchdog/Kconfig.npm13xx @@ -1,19 +1,19 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config WDT_NPM13XX - bool "nPM13xx Watchdog driver" +config WDT_NPM1300 + bool "nPM1300 Watchdog driver" default y depends on DT_HAS_NORDIC_NPM1300_WDT_ENABLED select I2C select MFD help - Enable nPM13xx Watchdog driver + Enable nPM1300 Watchdog driver -config WDT_NPM13XX_INIT_PRIORITY - int "nPM13xx Watchdog driver initialization priority" - depends on WDT_NPM13XX +config WDT_NPM1300_INIT_PRIORITY + int "nPM1300 Watchdog driver initialization priority" + depends on WDT_NPM1300 default 85 help - Initialization priority for the nPM13xx Watchdog driver. - It must be greater than GPIO_NPM13XX_INIT_PRIORITY. + Initialization priority for the nPM1300 Watchdog driver. + It must be greater than GPIO_NPM1300_INIT_PRIORITY. diff --git a/drivers/watchdog/wdt_npm13xx.c b/drivers/watchdog/wdt_npm13xx.c index cfbee7f3398..6dc9f2d49ea 100644 --- a/drivers/watchdog/wdt_npm13xx.c +++ b/drivers/watchdog/wdt_npm13xx.c @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT nordic_npm13xx_wdt +#define DT_DRV_COMPAT nordic_npm1300_wdt #include @@ -13,49 +13,49 @@ #include #include -/* nPM13xx TIMER base address */ +/* nPM1300 TIMER base address */ #define TIME_BASE 0x07U -/* nPM13xx timer register offsets */ +/* nPM1300 timer register offsets */ #define TIME_OFFSET_START 0x00U #define TIME_OFFSET_STOP 0x01U #define TIME_OFFSET_WDOG_KICK 0x04U #define TIME_OFFSET_MODE 0x05U -/* nPM13xx timer modes */ +/* nPM1300 timer modes */ #define TIME_MODE_BOOT 0x00U #define TIME_MODE_WARN 0x01U #define TIME_MODE_RESET 0x02U #define TIME_MODE_GEN 0x03U -struct wdt_npm13xx_config { +struct wdt_npm1300_config { const struct device *mfd; struct gpio_dt_spec reset_gpios; }; -struct wdt_npm13xx_data { +struct wdt_npm1300_data { bool timeout_valid; }; -static int wdt_npm13xx_setup(const struct device *dev, uint8_t options) +static int wdt_npm1300_setup(const struct device *dev, uint8_t options) { - const struct wdt_npm13xx_config *config = dev->config; - struct wdt_npm13xx_data *data = dev->data; + const struct wdt_npm1300_config *config = dev->config; + struct wdt_npm1300_data *data = dev->data; if (!data->timeout_valid) { return -EINVAL; } - return mfd_npm13xx_reg_write(config->mfd, TIME_BASE, TIME_OFFSET_START, 1U); + return mfd_npm1300_reg_write(config->mfd, TIME_BASE, TIME_OFFSET_START, 1U); } -static int wdt_npm13xx_disable(const struct device *dev) +static int wdt_npm1300_disable(const struct device *dev) { - const struct wdt_npm13xx_config *config = dev->config; - struct wdt_npm13xx_data *data = dev->data; + const struct wdt_npm1300_config *config = dev->config; + struct wdt_npm1300_data *data = dev->data; int ret; - ret = mfd_npm13xx_reg_write(config->mfd, TIME_BASE, TIME_OFFSET_STOP, 1U); + ret = mfd_npm1300_reg_write(config->mfd, TIME_BASE, TIME_OFFSET_STOP, 1U); if (ret < 0) { return ret; } @@ -65,11 +65,11 @@ static int wdt_npm13xx_disable(const struct device *dev) return 0; } -static int wdt_npm13xx_install_timeout(const struct device *dev, +static int wdt_npm1300_install_timeout(const struct device *dev, const struct wdt_timeout_cfg *timeout) { - const struct wdt_npm13xx_config *config = dev->config; - struct wdt_npm13xx_data *data = dev->data; + const struct wdt_npm1300_config *config = dev->config; + struct wdt_npm1300_data *data = dev->data; uint8_t mode; int ret; @@ -81,7 +81,7 @@ static int wdt_npm13xx_install_timeout(const struct device *dev, return -EINVAL; } - ret = mfd_npm13xx_set_timer(config->mfd, timeout->window.max); + ret = mfd_npm1300_set_timer(config->mfd, timeout->window.max); if (ret < 0) { return ret; } @@ -103,7 +103,7 @@ static int wdt_npm13xx_install_timeout(const struct device *dev, return -EINVAL; } - ret = mfd_npm13xx_reg_write(config->mfd, TIME_BASE, TIME_OFFSET_MODE, mode); + ret = mfd_npm1300_reg_write(config->mfd, TIME_BASE, TIME_OFFSET_MODE, mode); if (ret < 0) { return ret; } @@ -113,27 +113,27 @@ static int wdt_npm13xx_install_timeout(const struct device *dev, return 0; } -static int wdt_npm13xx_feed(const struct device *dev, int channel_id) +static int wdt_npm1300_feed(const struct device *dev, int channel_id) { - const struct wdt_npm13xx_config *config = dev->config; + const struct wdt_npm1300_config *config = dev->config; if (channel_id != 0) { return -EINVAL; } - return mfd_npm13xx_reg_write(config->mfd, TIME_BASE, TIME_OFFSET_WDOG_KICK, 1U); + return mfd_npm1300_reg_write(config->mfd, TIME_BASE, TIME_OFFSET_WDOG_KICK, 1U); } -static DEVICE_API(wdt, wdt_npm13xx_api) = { - .setup = wdt_npm13xx_setup, - .disable = wdt_npm13xx_disable, - .install_timeout = wdt_npm13xx_install_timeout, - .feed = wdt_npm13xx_feed, +static DEVICE_API(wdt, wdt_npm1300_api) = { + .setup = wdt_npm1300_setup, + .disable = wdt_npm1300_disable, + .install_timeout = wdt_npm1300_install_timeout, + .feed = wdt_npm1300_feed, }; -static int wdt_npm13xx_init(const struct device *dev) +static int wdt_npm1300_init(const struct device *dev) { - const struct wdt_npm13xx_config *config = dev->config; + const struct wdt_npm1300_config *config = dev->config; int ret; if (!device_is_ready(config->mfd)) { @@ -145,7 +145,7 @@ static int wdt_npm13xx_init(const struct device *dev) return -ENODEV; } - ret = gpio_pin_configure_dt(&config->reset_gpios, NPM13XX_GPIO_WDT_RESET_ON); + ret = gpio_pin_configure_dt(&config->reset_gpios, NPM1300_GPIO_WDT_RESET_ON); if (ret != 0) { return ret; } @@ -154,15 +154,15 @@ static int wdt_npm13xx_init(const struct device *dev) return 0; } -#define WDT_NPM13XX_DEFINE(n) \ - static struct wdt_npm13xx_data data##n; \ +#define WDT_NPM1300_DEFINE(n) \ + static struct wdt_npm1300_data data##n; \ \ - static const struct wdt_npm13xx_config config##n = { \ + static const struct wdt_npm1300_config config##n = { \ .mfd = DEVICE_DT_GET(DT_INST_PARENT(n)), \ .reset_gpios = GPIO_DT_SPEC_INST_GET_OR(n, reset_gpios, {0}), \ }; \ \ - DEVICE_DT_INST_DEFINE(n, &wdt_npm13xx_init, NULL, &data##n, &config##n, POST_KERNEL, \ - CONFIG_WDT_NPM13XX_INIT_PRIORITY, &wdt_npm13xx_api); + DEVICE_DT_INST_DEFINE(n, &wdt_npm1300_init, NULL, &data##n, &config##n, POST_KERNEL, \ + CONFIG_WDT_NPM1300_INIT_PRIORITY, &wdt_npm1300_api); -DT_INST_FOREACH_STATUS_OKAY(WDT_NPM13XX_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(WDT_NPM1300_DEFINE) diff --git a/include/zephyr/drivers/mfd/npm13xx.h b/include/zephyr/drivers/mfd/npm13xx.h index b9e6d5120f6..a1b941a4fb7 100644 --- a/include/zephyr/drivers/mfd/npm13xx.h +++ b/include/zephyr/drivers/mfd/npm13xx.h @@ -11,7 +11,7 @@ extern "C" { #endif /** - * @defgroup mfd_interface_npm13xx MFD NPM13XX Interface + * @defgroup mdf_interface_npm1300 MFD NPM1300 Interface * @ingroup mfd_interfaces * @{ */ @@ -22,28 +22,28 @@ extern "C" { #include #include -enum mfd_npm13xx_event_t { - NPM13XX_EVENT_CHG_COMPLETED, - NPM13XX_EVENT_CHG_ERROR, - NPM13XX_EVENT_BATTERY_DETECTED, - NPM13XX_EVENT_BATTERY_REMOVED, - NPM13XX_EVENT_SHIPHOLD_PRESS, - NPM13XX_EVENT_SHIPHOLD_RELEASE, - NPM13XX_EVENT_WATCHDOG_WARN, - NPM13XX_EVENT_VBUS_DETECTED, - NPM13XX_EVENT_VBUS_REMOVED, - NPM13XX_EVENT_GPIO0_EDGE, - NPM13XX_EVENT_GPIO1_EDGE, - NPM13XX_EVENT_GPIO2_EDGE, - NPM13XX_EVENT_GPIO3_EDGE, - NPM13XX_EVENT_GPIO4_EDGE, - NPM13XX_EVENT_MAX +enum mfd_npm1300_event_t { + NPM1300_EVENT_CHG_COMPLETED, + NPM1300_EVENT_CHG_ERROR, + NPM1300_EVENT_BATTERY_DETECTED, + NPM1300_EVENT_BATTERY_REMOVED, + NPM1300_EVENT_SHIPHOLD_PRESS, + NPM1300_EVENT_SHIPHOLD_RELEASE, + NPM1300_EVENT_WATCHDOG_WARN, + NPM1300_EVENT_VBUS_DETECTED, + NPM1300_EVENT_VBUS_REMOVED, + NPM1300_EVENT_GPIO0_EDGE, + NPM1300_EVENT_GPIO1_EDGE, + NPM1300_EVENT_GPIO2_EDGE, + NPM1300_EVENT_GPIO3_EDGE, + NPM1300_EVENT_GPIO4_EDGE, + NPM1300_EVENT_MAX }; /** - * @brief Read multiple registers from npm13xx + * @brief Read multiple registers from npm1300 * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param base Register base address (bits 15..8 of 16-bit address) * @param offset Register offset address (bits 7..0 of 16-bit address) * @param data Pointer to buffer for received data @@ -51,37 +51,37 @@ enum mfd_npm13xx_event_t { * @retval 0 If successful * @retval -errno In case of any bus error (see i2c_write_read_dt()) */ -int mfd_npm13xx_reg_read_burst(const struct device *dev, uint8_t base, uint8_t offset, void *data, +int mfd_npm1300_reg_read_burst(const struct device *dev, uint8_t base, uint8_t offset, void *data, size_t len); /** - * @brief Read single register from npm13xx + * @brief Read single register from npm1300 * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param base Register base address (bits 15..8 of 16-bit address) * @param offset Register offset address (bits 7..0 of 16-bit address) * @param data Pointer to buffer for received data * @retval 0 If successful * @retval -errno In case of any bus error (see i2c_write_read_dt()) */ -int mfd_npm13xx_reg_read(const struct device *dev, uint8_t base, uint8_t offset, uint8_t *data); +int mfd_npm1300_reg_read(const struct device *dev, uint8_t base, uint8_t offset, uint8_t *data); /** - * @brief Write single register to npm13xx + * @brief Write single register to npm1300 * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param base Register base address (bits 15..8 of 16-bit address) * @param offset Register offset address (bits 7..0 of 16-bit address) * @param data data to write * @retval 0 If successful * @retval -errno In case of any bus error (see i2c_write_dt()) */ -int mfd_npm13xx_reg_write(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data); +int mfd_npm1300_reg_write(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data); /** - * @brief Write two registers to npm13xx + * @brief Write two registers to npm1300 * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param base Register base address (bits 15..8 of 16-bit address) * @param offset Register offset address (bits 7..0 of 16-bit address) * @param data1 first byte of data to write @@ -89,13 +89,13 @@ int mfd_npm13xx_reg_write(const struct device *dev, uint8_t base, uint8_t offset * @retval 0 If successful * @retval -errno In case of any bus error (see i2c_write_dt()) */ -int mfd_npm13xx_reg_write2(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data1, +int mfd_npm1300_reg_write2(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data1, uint8_t data2); /** - * @brief Update selected bits in npm13xx register + * @brief Update selected bits in npm1300 register * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param base Register base address (bits 15..8 of 16-bit address) * @param offset Register offset address (bits 7..0 of 16-bit address) * @param data data to write @@ -103,59 +103,59 @@ int mfd_npm13xx_reg_write2(const struct device *dev, uint8_t base, uint8_t offse * @retval 0 If successful * @retval -errno In case of any bus error (see i2c_write_read_dt(), i2c_write_dt()) */ -int mfd_npm13xx_reg_update(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data, +int mfd_npm1300_reg_update(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data, uint8_t mask); /** - * @brief Write npm13xx timer register + * @brief Write npm1300 timer register * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param time_ms timer value in ms * @retval 0 If successful * @retval -EINVAL if time value is too large * @retval -errno In case of any bus error (see i2c_write_dt()) */ -int mfd_npm13xx_set_timer(const struct device *dev, uint32_t time_ms); +int mfd_npm1300_set_timer(const struct device *dev, uint32_t time_ms); /** - * @brief npm13xx full power reset + * @brief npm1300 full power reset * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @retval 0 If successful * @retval -errno In case of any bus error (see i2c_write_dt()) */ -int mfd_npm13xx_reset(const struct device *dev); +int mfd_npm1300_reset(const struct device *dev); /** - * @brief npm13xx hibernate + * @brief npm1300 hibernate * * Enters low power state, and wakes after specified time * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param time_ms timer value in ms * @retval 0 If successful * @retval -EINVAL if time value is too large * @retval -errno In case of any bus error (see i2c_write_dt()) */ -int mfd_npm13xx_hibernate(const struct device *dev, uint32_t time_ms); +int mfd_npm1300_hibernate(const struct device *dev, uint32_t time_ms); /** - * @brief Add npm13xx event callback + * @brief Add npm1300 event callback * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param callback callback * @return 0 on success, -errno on failure */ -int mfd_npm13xx_add_callback(const struct device *dev, struct gpio_callback *callback); +int mfd_npm1300_add_callback(const struct device *dev, struct gpio_callback *callback); /** - * @brief Remove npm13xx event callback + * @brief Remove npm1300 event callback * - * @param dev npm13xx mfd device + * @param dev npm1300 mfd device * @param callback callback * @return 0 on success, -errno on failure */ -int mfd_npm13xx_remove_callback(const struct device *dev, struct gpio_callback *callback); +int mfd_npm1300_remove_callback(const struct device *dev, struct gpio_callback *callback); /** @} */ diff --git a/include/zephyr/drivers/sensor/npm13xx_charger.h b/include/zephyr/drivers/sensor/npm13xx_charger.h index b3319096dd1..05176b36122 100644 --- a/include/zephyr/drivers/sensor/npm13xx_charger.h +++ b/include/zephyr/drivers/sensor/npm13xx_charger.h @@ -8,21 +8,21 @@ #include -/* NPM13XX charger specific channels */ -enum sensor_channel_npm13xx_charger { - SENSOR_CHAN_NPM13XX_CHARGER_STATUS = SENSOR_CHAN_PRIV_START, - SENSOR_CHAN_NPM13XX_CHARGER_ERROR, - SENSOR_CHAN_NPM13XX_CHARGER_VBUS_STATUS, +/* NPM1300 charger specific channels */ +enum sensor_channel_npm1300_charger { + SENSOR_CHAN_NPM1300_CHARGER_STATUS = SENSOR_CHAN_PRIV_START, + SENSOR_CHAN_NPM1300_CHARGER_ERROR, + SENSOR_CHAN_NPM1300_CHARGER_VBUS_STATUS, }; -/* NPM13XX charger specific attributes */ -enum sensor_attribute_npm13xx_charger { - SENSOR_ATTR_NPM13XX_CHARGER_VBUS_PRESENT = SENSOR_ATTR_PRIV_START, - SENSOR_ATTR_NPM13XX_CHARGER_VBUS_CUR_LIMIT, - SENSOR_ATTR_NPM13XX_CHARGER_VBUS_OVERVLT_PROT, - SENSOR_ATTR_NPM13XX_CHARGER_VBUS_UNDERVLT, - SENSOR_ATTR_NPM13XX_CHARGER_VBUS_SUSPENDED, - SENSOR_ATTR_NPM13XX_CHARGER_VBUS_BUSOUT, +/* NPM1300 charger specific attributes */ +enum sensor_attribute_npm1300_charger { + SENSOR_ATTR_NPM1300_CHARGER_VBUS_PRESENT = SENSOR_ATTR_PRIV_START, + SENSOR_ATTR_NPM1300_CHARGER_VBUS_CUR_LIMIT, + SENSOR_ATTR_NPM1300_CHARGER_VBUS_OVERVLT_PROT, + SENSOR_ATTR_NPM1300_CHARGER_VBUS_UNDERVLT, + SENSOR_ATTR_NPM1300_CHARGER_VBUS_SUSPENDED, + SENSOR_ATTR_NPM1300_CHARGER_VBUS_BUSOUT, }; #endif diff --git a/include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h b/include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h index 41097b741b2..8e99213702b 100644 --- a/include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h +++ b/include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h @@ -7,8 +7,8 @@ #define ZEPHYR_INCLUDE_DT_BINDINGS_GPIO_NORDIC_NPM13XX_GPIO_H_ /** - * @brief nPM13xx-specific GPIO Flags - * @defgroup gpio_interface_npm13xx nPM13xx-specific GPIO Flags + * @brief nPM1300-specific GPIO Flags + * @defgroup gpio_interface_npm1300 nPM1300-specific GPIO Flags * * The drive flags are encoded in the 8 upper bits of @ref gpio_dt_flags_t as * follows: @@ -23,74 +23,74 @@ */ /** - * @name nPM13xx GPIO drive strength flags - * @brief nPM13xx GPIO drive strength flags + * @name nPM1300 GPIO drive strength flags + * @brief nPM1300 GPIO drive strength flags * @{ */ /** @cond INTERNAL_HIDDEN */ /** Drive mode field mask */ -#define NPM13XX_GPIO_DRIVE_MSK 0x0100U +#define NPM1300_GPIO_DRIVE_MSK 0x0100U /** @endcond */ /** 1mA drive */ -#define NPM13XX_GPIO_DRIVE_1MA (0U << 8U) +#define NPM1300_GPIO_DRIVE_1MA (0U << 8U) /** 6mA drive */ -#define NPM13XX_GPIO_DRIVE_6MA (1U << 8U) +#define NPM1300_GPIO_DRIVE_6MA (1U << 8U) /** @} */ /** - * @name nPM13xx GPIO debounce flags - * @brief nPM13xx GPIO debounce flags + * @name nPM1300 GPIO debounce flags + * @brief nPM1300 GPIO debounce flags * @{ */ /** @cond INTERNAL_HIDDEN */ /** Debounce field mask */ -#define NPM13XX_GPIO_DEBOUNCE_MSK 0x0200U +#define NPM1300_GPIO_DEBOUNCE_MSK 0x0200U /** @endcond */ /** Normal drive */ -#define NPM13XX_GPIO_DEBOUNCE_OFF (0U << 9U) +#define NPM1300_GPIO_DEBOUNCE_OFF (0U << 9U) /** High drive */ -#define NPM13XX_GPIO_DEBOUNCE_ON (1U << 9U) +#define NPM1300_GPIO_DEBOUNCE_ON (1U << 9U) /** @} */ /** - * @name nPM13xx GPIO watchdog reset flags - * @brief nPM13xx GPIO watchdog reset flags + * @name nPM1300 GPIO watchdog reset flags + * @brief nPM1300 GPIO watchdog reset flags * @{ */ /** @cond INTERNAL_HIDDEN */ /** watchdog reset field mask */ -#define NPM13XX_GPIO_WDT_RESET_MSK 0x0400U +#define NPM1300_GPIO_WDT_RESET_MSK 0x0400U /** @endcond */ /** Off */ -#define NPM13XX_GPIO_WDT_RESET_OFF (0U << 10U) +#define NPM1300_GPIO_WDT_RESET_OFF (0U << 10U) /** On */ -#define NPM13XX_GPIO_WDT_RESET_ON (1U << 10U) +#define NPM1300_GPIO_WDT_RESET_ON (1U << 10U) /** @} */ /** - * @name nPM13xx GPIO power loss warning flags - * @brief nPM13xx GPIO power loss warning flags + * @name nPM1300 GPIO power loss warning flags + * @brief nPM1300 GPIO power loss warning flags * @{ */ /** @cond INTERNAL_HIDDEN */ /** power loss warning field mask */ -#define NPM13XX_GPIO_PWRLOSSWARN_MSK 0x0800U +#define NPM1300_GPIO_PWRLOSSWARN_MSK 0x0800U /** @endcond */ /** Off */ -#define NPM13XX_GPIO_PWRLOSSWARN_OFF (0U << 11U) +#define NPM1300_GPIO_PWRLOSSWARN_OFF (0U << 11U) /** On */ -#define NPM13XX_GPIO_PWRLOSSWARN_ON (1U << 11U) +#define NPM1300_GPIO_PWRLOSSWARN_ON (1U << 11U) /** @} */ diff --git a/include/zephyr/dt-bindings/regulator/npm13xx.h b/include/zephyr/dt-bindings/regulator/npm13xx.h index 19890261b8a..e24283dceab 100644 --- a/include/zephyr/dt-bindings/regulator/npm13xx.h +++ b/include/zephyr/dt-bindings/regulator/npm13xx.h @@ -8,31 +8,31 @@ #define ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NPM13XX_H_ /** - * @defgroup regulator_npm13xx nPM13xx Devicetree helpers. + * @defgroup regulator_npm1300 NPM1300 Devicetree helpers. * @ingroup regulator_interface * @{ */ /** - * @name nPM13xx Regulator modes + * @name NPM1300 Regulator modes * @{ */ /* Buck modes */ -#define NPM13XX_BUCK_MODE_AUTO 0x00U -#define NPM13XX_BUCK_MODE_PWM 0x01U -#define NPM13XX_BUCK_MODE_PFM 0x04U +#define NPM1300_BUCK_MODE_AUTO 0x00U +#define NPM1300_BUCK_MODE_PWM 0x01U +#define NPM1300_BUCK_MODE_PFM 0x04U /* LDSW / LDO modes */ -#define NPM13XX_LDSW_MODE_LDO 0x02U -#define NPM13XX_LDSW_MODE_LDSW 0x03U +#define NPM1300_LDSW_MODE_LDO 0x02U +#define NPM1300_LDSW_MODE_LDSW 0x03U /* GPIO control configuration */ -#define NPM13XX_GPIO_CHAN_NONE 0x00U -#define NPM13XX_GPIO_CHAN_0 0x01U -#define NPM13XX_GPIO_CHAN_1 0x02U -#define NPM13XX_GPIO_CHAN_2 0x03U -#define NPM13XX_GPIO_CHAN_3 0x04U -#define NPM13XX_GPIO_CHAN_4 0x05U +#define NPM1300_GPIO_CHAN_NONE 0x00U +#define NPM1300_GPIO_CHAN_0 0x01U +#define NPM1300_GPIO_CHAN_1 0x02U +#define NPM1300_GPIO_CHAN_2 0x03U +#define NPM1300_GPIO_CHAN_3 0x04U +#define NPM1300_GPIO_CHAN_4 0x05U /** @} */ diff --git a/samples/shields/npm1300_ek/nrf52dk_nrf52832.overlay b/samples/shields/npm1300_ek/nrf52dk_nrf52832.overlay index e4f2cca20ce..7bcc1bef5a4 100644 --- a/samples/shields/npm1300_ek/nrf52dk_nrf52832.overlay +++ b/samples/shields/npm1300_ek/nrf52dk_nrf52832.overlay @@ -26,12 +26,12 @@ }; &npm1300_ek_ldo1 { - regulator-initial-mode = ; + regulator-initial-mode = ; enable-gpio-config = <2 GPIO_ACTIVE_LOW>; }; &npm1300_ek_ldo2 { - regulator-initial-mode = ; + regulator-initial-mode = ; enable-gpio-config = <2 GPIO_ACTIVE_LOW>; }; diff --git a/samples/shields/npm1300_ek/src/main.c b/samples/shields/npm1300_ek/src/main.c index 9ecffb69e21..ac2a6ca245b 100644 --- a/samples/shields/npm1300_ek/src/main.c +++ b/samples/shields/npm1300_ek/src/main.c @@ -68,9 +68,9 @@ void configure_events(void) /* Setup callback for shiphold button press */ static struct gpio_callback event_cb; - gpio_init_callback(&event_cb, event_callback, BIT(NPM13XX_EVENT_SHIPHOLD_PRESS)); + gpio_init_callback(&event_cb, event_callback, BIT(NPM1300_EVENT_SHIPHOLD_PRESS)); - mfd_npm13xx_add_callback(pmic, &event_cb); + mfd_npm1300_add_callback(pmic, &event_cb); } void read_sensors(void) @@ -86,11 +86,11 @@ void read_sensors(void) sensor_channel_get(charger, SENSOR_CHAN_GAUGE_VOLTAGE, &volt); sensor_channel_get(charger, SENSOR_CHAN_GAUGE_AVG_CURRENT, ¤t); sensor_channel_get(charger, SENSOR_CHAN_GAUGE_TEMP, &temp); - sensor_channel_get(charger, (enum sensor_channel)SENSOR_CHAN_NPM13XX_CHARGER_STATUS, + sensor_channel_get(charger, (enum sensor_channel)SENSOR_CHAN_NPM1300_CHARGER_STATUS, &status); - sensor_channel_get(charger, (enum sensor_channel)SENSOR_CHAN_NPM13XX_CHARGER_ERROR, &error); - sensor_attr_get(charger, (enum sensor_channel)SENSOR_CHAN_NPM13XX_CHARGER_VBUS_STATUS, - (enum sensor_attribute)SENSOR_ATTR_NPM13XX_CHARGER_VBUS_PRESENT, + sensor_channel_get(charger, (enum sensor_channel)SENSOR_CHAN_NPM1300_CHARGER_ERROR, &error); + sensor_attr_get(charger, (enum sensor_channel)SENSOR_CHAN_NPM1300_CHARGER_VBUS_STATUS, + (enum sensor_attribute)SENSOR_ATTR_NPM1300_CHARGER_VBUS_PRESENT, &vbus_present); printk("V: %d.%03d ", volt.val1, volt.val2 / 1000); From 2338b2e1ac433c498b33d6ae0976b145290e7620 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 649/881] Revert "[nrf fromtree] drivers: npm1300: rename to npm13xx" This reverts commit df84dcade739b4f0b2e7b158921820dfc052d3e6. Signed-off-by: Jukka Rissanen --- boards/shields/npm1300_ek/npm1300_ek.overlay | 2 +- drivers/gpio/CMakeLists.txt | 2 +- drivers/gpio/Kconfig | 2 +- drivers/gpio/{Kconfig.npm13xx => Kconfig.npm1300} | 0 drivers/gpio/{gpio_npm13xx.c => gpio_npm1300.c} | 4 ++-- drivers/led/CMakeLists.txt | 2 +- drivers/led/Kconfig | 2 +- drivers/led/{Kconfig.npm13xx => Kconfig.npm1300} | 0 drivers/led/{led_npm13xx.c => led_npm1300.c} | 2 +- drivers/mfd/CMakeLists.txt | 2 +- drivers/mfd/Kconfig | 2 +- drivers/mfd/{Kconfig.npm13xx => Kconfig.npm1300} | 0 drivers/mfd/{mfd_npm13xx.c => mfd_npm1300.c} | 2 +- drivers/regulator/CMakeLists.txt | 2 +- drivers/regulator/Kconfig | 2 +- drivers/regulator/{Kconfig.npm13xx => Kconfig.npm1300} | 0 .../regulator/{regulator_npm13xx.c => regulator_npm1300.c} | 4 ++-- drivers/sensor/nordic/CMakeLists.txt | 2 +- drivers/sensor/nordic/Kconfig | 2 +- .../{npm13xx_charger => npm1300_charger}/CMakeLists.txt | 2 +- .../nordic/{npm13xx_charger => npm1300_charger}/Kconfig | 0 .../npm13xx_charger.c => npm1300_charger/npm1300_charger.c} | 4 ++-- drivers/watchdog/CMakeLists.txt | 2 +- drivers/watchdog/Kconfig | 2 +- drivers/watchdog/{Kconfig.npm13xx => Kconfig.npm1300} | 0 drivers/watchdog/{wdt_npm13xx.c => wdt_npm1300.c} | 4 ++-- include/zephyr/drivers/mfd/{npm13xx.h => npm1300.h} | 6 +++--- .../drivers/sensor/{npm13xx_charger.h => npm1300_charger.h} | 4 ++-- .../gpio/{nordic-npm13xx-gpio.h => nordic-npm1300-gpio.h} | 6 +++--- .../zephyr/dt-bindings/regulator/{npm13xx.h => npm1300.h} | 6 +++--- samples/shields/npm1300_ek/src/main.c | 6 +++--- 31 files changed, 38 insertions(+), 38 deletions(-) rename drivers/gpio/{Kconfig.npm13xx => Kconfig.npm1300} (100%) rename drivers/gpio/{gpio_npm13xx.c => gpio_npm1300.c} (98%) rename drivers/led/{Kconfig.npm13xx => Kconfig.npm1300} (100%) rename drivers/led/{led_npm13xx.c => led_npm1300.c} (98%) rename drivers/mfd/{Kconfig.npm13xx => Kconfig.npm1300} (100%) rename drivers/mfd/{mfd_npm13xx.c => mfd_npm1300.c} (99%) rename drivers/regulator/{Kconfig.npm13xx => Kconfig.npm1300} (100%) rename drivers/regulator/{regulator_npm13xx.c => regulator_npm1300.c} (99%) rename drivers/sensor/nordic/{npm13xx_charger => npm1300_charger}/CMakeLists.txt (71%) rename drivers/sensor/nordic/{npm13xx_charger => npm1300_charger}/Kconfig (100%) rename drivers/sensor/nordic/{npm13xx_charger/npm13xx_charger.c => npm1300_charger/npm1300_charger.c} (99%) rename drivers/watchdog/{Kconfig.npm13xx => Kconfig.npm1300} (100%) rename drivers/watchdog/{wdt_npm13xx.c => wdt_npm1300.c} (97%) rename include/zephyr/drivers/mfd/{npm13xx.h => npm1300.h} (97%) rename include/zephyr/drivers/sensor/{npm13xx_charger.h => npm1300_charger.h} (86%) rename include/zephyr/dt-bindings/gpio/{nordic-npm13xx-gpio.h => nordic-npm1300-gpio.h} (91%) rename include/zephyr/dt-bindings/regulator/{npm13xx.h => npm1300.h} (81%) diff --git a/boards/shields/npm1300_ek/npm1300_ek.overlay b/boards/shields/npm1300_ek/npm1300_ek.overlay index d0a9b0eda22..592aa55f124 100644 --- a/boards/shields/npm1300_ek/npm1300_ek.overlay +++ b/boards/shields/npm1300_ek/npm1300_ek.overlay @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include &arduino_i2c { diff --git a/drivers/gpio/CMakeLists.txt b/drivers/gpio/CMakeLists.txt index 8a5ea48cb65..728a883e109 100644 --- a/drivers/gpio/CMakeLists.txt +++ b/drivers/gpio/CMakeLists.txt @@ -67,7 +67,7 @@ zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX gpio_nct38xx_port.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NCT38XX_ALERT gpio_nct38xx_alert.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NEORV32 gpio_neorv32.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NPCX gpio_npcx.c) -zephyr_library_sources_ifdef(CONFIG_GPIO_NPM1300 gpio_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_NPM1300 gpio_npm1300.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NPM2100 gpio_npm2100.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NPM6001 gpio_npm6001.c) zephyr_library_sources_ifdef(CONFIG_GPIO_NRFX gpio_nrfx.c) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index dcf5a8c043c..e95aded5613 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -153,7 +153,7 @@ source "drivers/gpio/Kconfig.mspm0" source "drivers/gpio/Kconfig.nct38xx" source "drivers/gpio/Kconfig.neorv32" source "drivers/gpio/Kconfig.npcx" -source "drivers/gpio/Kconfig.npm13xx" +source "drivers/gpio/Kconfig.npm1300" source "drivers/gpio/Kconfig.npm2100" source "drivers/gpio/Kconfig.npm6001" source "drivers/gpio/Kconfig.nrfx" diff --git a/drivers/gpio/Kconfig.npm13xx b/drivers/gpio/Kconfig.npm1300 similarity index 100% rename from drivers/gpio/Kconfig.npm13xx rename to drivers/gpio/Kconfig.npm1300 diff --git a/drivers/gpio/gpio_npm13xx.c b/drivers/gpio/gpio_npm1300.c similarity index 98% rename from drivers/gpio/gpio_npm13xx.c rename to drivers/gpio/gpio_npm1300.c index 40c5aaf1098..a941e1f3f6f 100644 --- a/drivers/gpio/gpio_npm13xx.c +++ b/drivers/gpio/gpio_npm1300.c @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/drivers/led/CMakeLists.txt b/drivers/led/CMakeLists.txt index c4c0752b255..73a808d7d5a 100644 --- a/drivers/led/CMakeLists.txt +++ b/drivers/led/CMakeLists.txt @@ -12,7 +12,7 @@ zephyr_library_sources_ifdef(CONFIG_IS31FL3733 is31fl3733.c) zephyr_library_sources_ifdef(CONFIG_LED_AXP192_AXP2101 led_axp192.c) zephyr_library_sources_ifdef(CONFIG_LED_DAC led_dac.c) zephyr_library_sources_ifdef(CONFIG_LED_GPIO led_gpio.c) -zephyr_library_sources_ifdef(CONFIG_LED_NPM1300 led_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_LED_NPM1300 led_npm1300.c) zephyr_library_sources_ifdef(CONFIG_LED_PWM led_pwm.c) zephyr_library_sources_ifdef(CONFIG_LED_XEC led_mchp_xec.c) zephyr_library_sources_ifdef(CONFIG_LP3943 lp3943.c) diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig index 0e411ce21f0..bac815242c3 100644 --- a/drivers/led/Kconfig +++ b/drivers/led/Kconfig @@ -40,7 +40,7 @@ source "drivers/led/Kconfig.lp5562" source "drivers/led/Kconfig.lp5569" source "drivers/led/Kconfig.modulino" source "drivers/led/Kconfig.ncp5623" -source "drivers/led/Kconfig.npm13xx" +source "drivers/led/Kconfig.npm1300" source "drivers/led/Kconfig.pca9633" source "drivers/led/Kconfig.pwm" source "drivers/led/Kconfig.tlc59108" diff --git a/drivers/led/Kconfig.npm13xx b/drivers/led/Kconfig.npm1300 similarity index 100% rename from drivers/led/Kconfig.npm13xx rename to drivers/led/Kconfig.npm1300 diff --git a/drivers/led/led_npm13xx.c b/drivers/led/led_npm1300.c similarity index 98% rename from drivers/led/led_npm13xx.c rename to drivers/led/led_npm1300.c index 9052159e739..f23fde1dfa2 100644 --- a/drivers/led/led_npm13xx.c +++ b/drivers/led/led_npm1300.c @@ -9,7 +9,7 @@ #include #include -#include +#include /* nPM1300 LED base address */ #define NPM_LED_BASE 0x0AU diff --git a/drivers/mfd/CMakeLists.txt b/drivers/mfd/CMakeLists.txt index 24a1c698e76..8560a10655f 100644 --- a/drivers/mfd/CMakeLists.txt +++ b/drivers/mfd/CMakeLists.txt @@ -6,7 +6,7 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_MFD_ADP5585 mfd_adp5585.c) zephyr_library_sources_ifdef(CONFIG_MFD_MAX20335 mfd_max20335.c) zephyr_library_sources_ifdef(CONFIG_MFD_NCT38XX mfd_nct38xx.c) -zephyr_library_sources_ifdef(CONFIG_MFD_NPM1300 mfd_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_MFD_NPM1300 mfd_npm1300.c) zephyr_library_sources_ifdef(CONFIG_MFD_NPM2100 mfd_npm2100.c) zephyr_library_sources_ifdef(CONFIG_MFD_NPM6001 mfd_npm6001.c) zephyr_library_sources_ifdef(CONFIG_MFD_AXP192_AXP2101 mfd_axp192.c) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 86a11a72b41..325e29c864a 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -30,7 +30,7 @@ source "drivers/mfd/Kconfig.max31790" source "drivers/mfd/Kconfig.maxq10xx" source "drivers/mfd/Kconfig.mchp_sam" source "drivers/mfd/Kconfig.nct38xx" -source "drivers/mfd/Kconfig.npm13xx" +source "drivers/mfd/Kconfig.npm1300" source "drivers/mfd/Kconfig.npm2100" source "drivers/mfd/Kconfig.npm6001" source "drivers/mfd/Kconfig.pf1550" diff --git a/drivers/mfd/Kconfig.npm13xx b/drivers/mfd/Kconfig.npm1300 similarity index 100% rename from drivers/mfd/Kconfig.npm13xx rename to drivers/mfd/Kconfig.npm1300 diff --git a/drivers/mfd/mfd_npm13xx.c b/drivers/mfd/mfd_npm1300.c similarity index 99% rename from drivers/mfd/mfd_npm13xx.c rename to drivers/mfd/mfd_npm1300.c index 21961b1696a..2ea0818faee 100644 --- a/drivers/mfd/mfd_npm13xx.c +++ b/drivers/mfd/mfd_npm1300.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #define TIME_BASE 0x07U #define MAIN_BASE 0x00U diff --git a/drivers/regulator/CMakeLists.txt b/drivers/regulator/CMakeLists.txt index 817518d9b2f..ed5a1996da9 100644 --- a/drivers/regulator/CMakeLists.txt +++ b/drivers/regulator/CMakeLists.txt @@ -13,7 +13,7 @@ zephyr_library_sources_ifdef(CONFIG_REGULATOR_FIXED regulator_fixed.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_GPIO regulator_gpio.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_MAX20335 regulator_max20335.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM1100 regulator_npm1100.c) -zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM1300 regulator_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM1300 regulator_npm1300.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM2100 regulator_npm2100.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_NPM6001 regulator_npm6001.c) zephyr_library_sources_ifdef(CONFIG_REGULATOR_PCA9420 regulator_pca9420.c) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index ca2bf41ae89..dc331b2139d 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -35,7 +35,7 @@ source "drivers/regulator/Kconfig.fixed" source "drivers/regulator/Kconfig.gpio" source "drivers/regulator/Kconfig.max20335" source "drivers/regulator/Kconfig.npm1100" -source "drivers/regulator/Kconfig.npm13xx" +source "drivers/regulator/Kconfig.npm1300" source "drivers/regulator/Kconfig.npm2100" source "drivers/regulator/Kconfig.npm6001" source "drivers/regulator/Kconfig.pca9420" diff --git a/drivers/regulator/Kconfig.npm13xx b/drivers/regulator/Kconfig.npm1300 similarity index 100% rename from drivers/regulator/Kconfig.npm13xx rename to drivers/regulator/Kconfig.npm1300 diff --git a/drivers/regulator/regulator_npm13xx.c b/drivers/regulator/regulator_npm1300.c similarity index 99% rename from drivers/regulator/regulator_npm13xx.c rename to drivers/regulator/regulator_npm1300.c index 913f51456af..19d8a2a179e 100644 --- a/drivers/regulator/regulator_npm13xx.c +++ b/drivers/regulator/regulator_npm1300.c @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/drivers/sensor/nordic/CMakeLists.txt b/drivers/sensor/nordic/CMakeLists.txt index cfda4b85b47..49a0a48d7fd 100644 --- a/drivers/sensor/nordic/CMakeLists.txt +++ b/drivers/sensor/nordic/CMakeLists.txt @@ -3,7 +3,7 @@ # zephyr-keep-sorted-start add_subdirectory(temp) -add_subdirectory_ifdef(CONFIG_NPM1300_CHARGER npm13xx_charger) +add_subdirectory_ifdef(CONFIG_NPM1300_CHARGER npm1300_charger) add_subdirectory_ifdef(CONFIG_NPM2100_VBAT npm2100_vbat) add_subdirectory_ifdef(CONFIG_QDEC_NRFX qdec_nrfx) # zephyr-keep-sorted-stop diff --git a/drivers/sensor/nordic/Kconfig b/drivers/sensor/nordic/Kconfig index 717c941973f..0cdbaaf41e7 100644 --- a/drivers/sensor/nordic/Kconfig +++ b/drivers/sensor/nordic/Kconfig @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # zephyr-keep-sorted-start -source "drivers/sensor/nordic/npm13xx_charger/Kconfig" +source "drivers/sensor/nordic/npm1300_charger/Kconfig" source "drivers/sensor/nordic/npm2100_vbat/Kconfig" source "drivers/sensor/nordic/qdec_nrfx/Kconfig" source "drivers/sensor/nordic/temp/Kconfig" diff --git a/drivers/sensor/nordic/npm13xx_charger/CMakeLists.txt b/drivers/sensor/nordic/npm1300_charger/CMakeLists.txt similarity index 71% rename from drivers/sensor/nordic/npm13xx_charger/CMakeLists.txt rename to drivers/sensor/nordic/npm1300_charger/CMakeLists.txt index 512e0f9eecd..51083775eff 100644 --- a/drivers/sensor/nordic/npm13xx_charger/CMakeLists.txt +++ b/drivers/sensor/nordic/npm1300_charger/CMakeLists.txt @@ -4,4 +4,4 @@ zephyr_library() -zephyr_library_sources(npm13xx_charger.c) +zephyr_library_sources(npm1300_charger.c) diff --git a/drivers/sensor/nordic/npm13xx_charger/Kconfig b/drivers/sensor/nordic/npm1300_charger/Kconfig similarity index 100% rename from drivers/sensor/nordic/npm13xx_charger/Kconfig rename to drivers/sensor/nordic/npm1300_charger/Kconfig diff --git a/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c b/drivers/sensor/nordic/npm1300_charger/npm1300_charger.c similarity index 99% rename from drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c rename to drivers/sensor/nordic/npm1300_charger/npm1300_charger.c index 829ce6a2265..a5b2a0b1054 100644 --- a/drivers/sensor/nordic/npm13xx_charger/npm13xx_charger.c +++ b/drivers/sensor/nordic/npm1300_charger/npm1300_charger.c @@ -7,10 +7,10 @@ #include #include -#include +#include #include #include -#include +#include struct npm1300_charger_config { const struct device *mfd; diff --git a/drivers/watchdog/CMakeLists.txt b/drivers/watchdog/CMakeLists.txt index 4d6f75e4d9e..e7264362e3f 100644 --- a/drivers/watchdog/CMakeLists.txt +++ b/drivers/watchdog/CMakeLists.txt @@ -28,7 +28,7 @@ zephyr_library_sources_ifdef(CONFIG_WDT_MCUX_WDOG wdt_mcux_wdog.c) zephyr_library_sources_ifdef(CONFIG_WDT_MCUX_WDOG32 wdt_mcux_wdog32.c) zephyr_library_sources_ifdef(CONFIG_WDT_MCUX_WWDT wdt_mcux_wwdt.c) zephyr_library_sources_ifdef(CONFIG_WDT_NPCX wdt_npcx.c) -zephyr_library_sources_ifdef(CONFIG_WDT_NPM1300 wdt_npm13xx.c) +zephyr_library_sources_ifdef(CONFIG_WDT_NPM1300 wdt_npm1300.c) zephyr_library_sources_ifdef(CONFIG_WDT_NPM2100 wdt_npm2100.c) zephyr_library_sources_ifdef(CONFIG_WDT_NPM6001 wdt_npm6001.c) zephyr_library_sources_ifdef(CONFIG_WDT_NRFX wdt_nrfx.c) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 4fed392fd22..bd445bda94f 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -107,7 +107,7 @@ source "drivers/watchdog/Kconfig.rpi_pico" source "drivers/watchdog/Kconfig.gd32" -source "drivers/watchdog/Kconfig.npm13xx" +source "drivers/watchdog/Kconfig.npm1300" source "drivers/watchdog/Kconfig.npm2100" diff --git a/drivers/watchdog/Kconfig.npm13xx b/drivers/watchdog/Kconfig.npm1300 similarity index 100% rename from drivers/watchdog/Kconfig.npm13xx rename to drivers/watchdog/Kconfig.npm1300 diff --git a/drivers/watchdog/wdt_npm13xx.c b/drivers/watchdog/wdt_npm1300.c similarity index 97% rename from drivers/watchdog/wdt_npm13xx.c rename to drivers/watchdog/wdt_npm1300.c index 6dc9f2d49ea..71002875af0 100644 --- a/drivers/watchdog/wdt_npm13xx.c +++ b/drivers/watchdog/wdt_npm1300.c @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include /* nPM1300 TIMER base address */ #define TIME_BASE 0x07U diff --git a/include/zephyr/drivers/mfd/npm13xx.h b/include/zephyr/drivers/mfd/npm1300.h similarity index 97% rename from include/zephyr/drivers/mfd/npm13xx.h rename to include/zephyr/drivers/mfd/npm1300.h index a1b941a4fb7..4dd03fa2ec3 100644 --- a/include/zephyr/drivers/mfd/npm13xx.h +++ b/include/zephyr/drivers/mfd/npm1300.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_NPM13XX_H_ -#define ZEPHYR_INCLUDE_DRIVERS_MFD_NPM13XX_H_ +#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_NPM1300_H_ +#define ZEPHYR_INCLUDE_DRIVERS_MFD_NPM1300_H_ #ifdef __cplusplus extern "C" { @@ -163,4 +163,4 @@ int mfd_npm1300_remove_callback(const struct device *dev, struct gpio_callback * } #endif -#endif /* ZEPHYR_INCLUDE_DRIVERS_MFD_NPM13XX_H_ */ +#endif /* ZEPHYR_INCLUDE_DRIVERS_MFD_NPM1300_H_ */ diff --git a/include/zephyr/drivers/sensor/npm13xx_charger.h b/include/zephyr/drivers/sensor/npm1300_charger.h similarity index 86% rename from include/zephyr/drivers/sensor/npm13xx_charger.h rename to include/zephyr/drivers/sensor/npm1300_charger.h index 05176b36122..d2a166340d1 100644 --- a/include/zephyr/drivers/sensor/npm13xx_charger.h +++ b/include/zephyr/drivers/sensor/npm1300_charger.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_NPM13XX_CHARGER_H_ -#define ZEPHYR_INCLUDE_DRIVERS_SENSOR_NPM13XX_CHARGER_H_ +#ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_NPM1300_CHARGER_H_ +#define ZEPHYR_INCLUDE_DRIVERS_SENSOR_NPM1300_CHARGER_H_ #include diff --git a/include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h b/include/zephyr/dt-bindings/gpio/nordic-npm1300-gpio.h similarity index 91% rename from include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h rename to include/zephyr/dt-bindings/gpio/nordic-npm1300-gpio.h index 8e99213702b..fed166e651a 100644 --- a/include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h +++ b/include/zephyr/dt-bindings/gpio/nordic-npm1300-gpio.h @@ -3,8 +3,8 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_GPIO_NORDIC_NPM13XX_GPIO_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_GPIO_NORDIC_NPM13XX_GPIO_H_ +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_GPIO_NORDIC_NPM1300_GPIO_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_GPIO_NORDIC_NPM1300_GPIO_H_ /** * @brief nPM1300-specific GPIO Flags @@ -96,4 +96,4 @@ /** @} */ -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_GPIO_NORDIC_NPM13XX_GPIO_H_ */ +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_GPIO_NORDIC_NPM1300_GPIO_H_ */ diff --git a/include/zephyr/dt-bindings/regulator/npm13xx.h b/include/zephyr/dt-bindings/regulator/npm1300.h similarity index 81% rename from include/zephyr/dt-bindings/regulator/npm13xx.h rename to include/zephyr/dt-bindings/regulator/npm1300.h index e24283dceab..bf3f8cfa3ee 100644 --- a/include/zephyr/dt-bindings/regulator/npm13xx.h +++ b/include/zephyr/dt-bindings/regulator/npm1300.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NPM13XX_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NPM13XX_H_ +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NPM1300_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NPM1300_H_ /** * @defgroup regulator_npm1300 NPM1300 Devicetree helpers. @@ -38,4 +38,4 @@ /** @} */ -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NPM13XX_H_*/ +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NPM1300_H_*/ diff --git a/samples/shields/npm1300_ek/src/main.c b/samples/shields/npm1300_ek/src/main.c index ac2a6ca245b..7ced0145662 100644 --- a/samples/shields/npm1300_ek/src/main.c +++ b/samples/shields/npm1300_ek/src/main.c @@ -9,10 +9,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include From 50ea4e789c5ea1416b9544322a4f8498931b82c9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 650/881] Revert "[nrf fromtree] regulator: npm1300: configure active discharge" This reverts commit d2a01f5b5c5f399878b5ba0df407b4624ae2b0a1. Signed-off-by: Jukka Rissanen --- drivers/regulator/regulator_npm1300.c | 50 +++---------------- .../regulator/nordic,npm1300-regulator.yaml | 5 -- 2 files changed, 6 insertions(+), 49 deletions(-) diff --git a/drivers/regulator/regulator_npm1300.c b/drivers/regulator/regulator_npm1300.c index 19d8a2a179e..8b5b64572c4 100644 --- a/drivers/regulator/regulator_npm1300.c +++ b/drivers/regulator/regulator_npm1300.c @@ -62,20 +62,16 @@ enum npm1300_gpio_type { /* nPM1300 ship register offsets */ #define SHIP_OFFSET_SHIP 0x02U -#define BUCK1_ON_MASK 0x04U -#define BUCK2_ON_MASK 0x40U -#define BUCK1_EN_PULLDOWN_MASK BIT(2) -#define BUCK2_EN_PULLDOWN_MASK BIT(3) +#define BUCK1_ON_MASK 0x04U +#define BUCK2_ON_MASK 0x40U #define LDSW1_ON_MASK 0x03U #define LDSW2_ON_MASK 0x0CU -#define LDSW1_SOFTSTART_MASK 0x0CU -#define LDSW1_SOFTSTART_SHIFT 2U -#define LDSW1_ACTIVE_DISCHARGE_MASK BIT(6) -#define LDSW2_SOFTSTART_MASK 0x30U -#define LDSW2_SOFTSTART_SHIFT 4U -#define LDSW2_ACTIVE_DISCHARGE_MASK BIT(7) +#define LDSW1_SOFTSTART_MASK 0x0CU +#define LDSW1_SOFTSTART_SHIFT 2U +#define LDSW2_SOFTSTART_MASK 0x30U +#define LDSW2_SOFTSTART_SHIFT 4U #define NPM1300_GPIO_UNUSED UINT8_MAX @@ -98,7 +94,6 @@ struct regulator_npm1300_config { struct npm1300_gpio_info retention_gpios; struct npm1300_gpio_info pwm_gpios; uint8_t soft_start; - bool active_discharge; bool ldo_disable_workaround; }; @@ -608,32 +603,6 @@ static int soft_start_set(const struct device *dev, uint8_t soft_start) } } -static int active_discharge_set(const struct device *dev, bool enabled) -{ - const struct regulator_npm1300_config *config = dev->config; - - switch (config->source) { - case NPM1300_SOURCE_BUCK1: - return mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_CTRL0, - enabled ? BUCK1_EN_PULLDOWN_MASK : 0, - BUCK1_EN_PULLDOWN_MASK); - case NPM1300_SOURCE_BUCK2: - return mfd_npm1300_reg_update(config->mfd, BUCK_BASE, BUCK_OFFSET_CTRL0, - enabled ? BUCK2_EN_PULLDOWN_MASK : 0, - BUCK2_EN_PULLDOWN_MASK); - case NPM1300_SOURCE_LDO1: - return mfd_npm1300_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, - enabled ? LDSW1_ACTIVE_DISCHARGE_MASK : 0, - LDSW1_ACTIVE_DISCHARGE_MASK); - case NPM1300_SOURCE_LDO2: - return mfd_npm1300_reg_update(config->mfd, LDSW_BASE, LDSW_OFFSET_CONFIG, - enabled ? LDSW2_ACTIVE_DISCHARGE_MASK : 0, - LDSW2_ACTIVE_DISCHARGE_MASK); - default: - return -ENODEV; - } -} - int regulator_npm1300_init(const struct device *dev) { const struct regulator_npm1300_config *config = dev->config; @@ -670,12 +639,6 @@ int regulator_npm1300_init(const struct device *dev) } } - /* Configure active discharge */ - ret = active_discharge_set(dev, config->active_discharge); - if (ret != 0) { - return ret; - } - /* Configure GPIO pin control */ ret = regulator_npm1300_set_pin_ctrl(dev, &config->enable_gpios, NPM1300_GPIO_TYPE_ENABLE); if (ret != 0) { @@ -727,7 +690,6 @@ static DEVICE_API(regulator, api) = { .enable_gpios = GPIO_CONFIG_DEFINE(node_id, enable_gpio_config), \ .retention_gpios = GPIO_CONFIG_DEFINE(node_id, retention_gpio_config), \ .pwm_gpios = GPIO_CONFIG_DEFINE(node_id, pwm_gpio_config), \ - .active_discharge = DT_PROP(node_id, active_discharge), \ .ldo_disable_workaround = DT_PROP(node_id, nordic_anomaly38_disable_workaround)}; \ \ DEVICE_DT_DEFINE(node_id, regulator_npm1300_init, NULL, &data_##id, &config_##id, \ diff --git a/dts/bindings/regulator/nordic,npm1300-regulator.yaml b/dts/bindings/regulator/nordic,npm1300-regulator.yaml index 1b77f6c1ab4..28b50dd34b7 100644 --- a/dts/bindings/regulator/nordic,npm1300-regulator.yaml +++ b/dts/bindings/regulator/nordic,npm1300-regulator.yaml @@ -97,11 +97,6 @@ child-binding: description: | Soft start current limit in microamps. - active-discharge: - type: boolean - description: | - Enable active-discharge on the BUCK/LDO/LDSW output when disabled. - nordic,anomaly38-disable-workaround: type: boolean description: | From ed0d4e7d1903f48f983776371be6bde8150e36e3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 651/881] Revert "[nrf fromtree] libc: minimal: Add "prohibit_lto" flag to avoid problems with LTO" This reverts commit dec4c5b99a995f15afbb7551424a00a6ec8f0530. Signed-off-by: Jukka Rissanen --- lib/libc/minimal/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libc/minimal/CMakeLists.txt b/lib/libc/minimal/CMakeLists.txt index 29f2db74367..10610b855c8 100644 --- a/lib/libc/minimal/CMakeLists.txt +++ b/lib/libc/minimal/CMakeLists.txt @@ -12,7 +12,6 @@ set(GEN_DIR ${ZEPHYR_BINARY_DIR}/include/generated) set(STRERROR_TABLE_H ${GEN_DIR}/libc/minimal/strerror_table.h) zephyr_library_compile_options($) -zephyr_library_compile_options($) zephyr_library_sources( source/stdlib/atoi.c From f827c6350e47cffea165ee15543c0624464602b7 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 652/881] Revert "[nrf fromtree] tests: spi: loopback: use CONFIG_ZTEST_STACK_SIZE for thread stacks" This reverts commit 2d0c2aac414b48c5e8514d1b3b0c945038e599f0. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/src/spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index 5419a749351..64649ce7566 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -693,8 +693,7 @@ ZTEST(spi_loopback, test_spi_word_size_32) sizeof(buffer_tx_32), &spec_copies[4], 32); } -static K_THREAD_STACK_DEFINE(thread_stack[3], CONFIG_ZTEST_STACK_SIZE + - CONFIG_TEST_EXTRA_STACK_SIZE); +static K_THREAD_STACK_DEFINE(thread_stack[3], 512); static struct k_thread thread[3]; static K_SEM_DEFINE(thread_sem, 0, 3); From b75f318369cab7aacea5a3626d7ebe61963928c5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 653/881] Revert "[nrf fromlist] tests: kernel: interrupt: Fix for nRF54H20 FLPR" This reverts commit 68e055a660fc7907cb92da5870b4bbeafa8d0f31. Signed-off-by: Jukka Rissanen --- tests/kernel/interrupt/src/nested_irq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/kernel/interrupt/src/nested_irq.c b/tests/kernel/interrupt/src/nested_irq.c index 6bfc81b8965..e1edfc3442f 100644 --- a/tests/kernel/interrupt/src/nested_irq.c +++ b/tests/kernel/interrupt/src/nested_irq.c @@ -56,8 +56,7 @@ */ #define IRQ0_PRIO IRQ_DEFAULT_PRIORITY #define IRQ1_PRIO 0x0 -#elif (defined(CONFIG_SOC_SERIES_NRF54LX) || defined(CONFIG_SOC_NRF54H20_CPUFLPR)) && \ - defined(CONFIG_RISCV_CORE_NORDIC_VPR) +#elif defined(CONFIG_SOC_SERIES_NRF54LX) && defined(CONFIG_RISCV_CORE_NORDIC_VPR) #define IRQ0_LINE 16 #define IRQ1_LINE 17 From f1dbfd13fd62c3166bdc793b37e03ffbd0eb59e0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 654/881] Revert "[nrf fromtree] scripts: kconfig: Add hex variants of arithmetic functions" This reverts commit a2838ea67c96a21cbf0e44a756699df586cbafc5. Signed-off-by: Jukka Rissanen --- doc/build/kconfig/preprocessor-functions.rst | 11 ----- scripts/kconfig/kconfigfunctions.py | 35 ++----------- tests/kconfig/functions/Kconfig | 52 ++++++++++---------- tests/kconfig/functions/src/main.c | 4 +- 4 files changed, 32 insertions(+), 70 deletions(-) diff --git a/doc/build/kconfig/preprocessor-functions.rst b/doc/build/kconfig/preprocessor-functions.rst index e3ed5f40636..9de5110bfdb 100644 --- a/doc/build/kconfig/preprocessor-functions.rst +++ b/doc/build/kconfig/preprocessor-functions.rst @@ -81,29 +81,18 @@ Integer functions The functions listed below can be used to do arithmetic operations on integer variables, such as addition, subtraction and more. -Functions with and without the ``_hex`` suffix in their names -return hexadecimal and decimal values respectively. .. code-block:: none $(add,[,value]...) - $(add_hex,[,value]...) $(dec,[,value]...) - $(dec_hex,[,value]...) $(div,[,value]...) - $(div_hex,[,value]...) $(inc,[,value]...) - $(inc_hex,[,value]...) $(max,[,value]...) - $(max_hex,[,value]...) $(min,[,value]...) - $(min_hex,[,value]...) $(mod,[,value]...) - $(mod_hex,[,value]...) $(mul,[,value]...) - $(mul_hex,[,value]...) $(sub,[,value]...) - $(sub_hex,[,value]...) String functions diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 4b42ce30cef..ce4ce2aa6c2 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -983,8 +983,8 @@ def arith(kconf, name, *args): the operation on the first two arguments and operates the same operation as the result and the following argument. For interoperability with inc and dec, - each argument can be a single number or a comma-separated list of numbers, - but all numbers are processed as if they were individual arguments. + if there is only one argument, it will be split with a comma and processed + as a sequence of numbers. Examples in Kconfig: @@ -1008,36 +1008,22 @@ def arith(kconf, name, *args): $(div, $(dec, 1, 1)) # Error (0 div 0) """ - intarray = (int(val, base=0) for arg in args for val in arg.split(",")) + intarray = map(int, args if len(args) > 1 else args[0].split(",")) if name == "add": return str(int(functools.reduce(operator.add, intarray))) - elif name == "add_hex": - return hex(int(functools.reduce(operator.add, intarray))) elif name == "sub": return str(int(functools.reduce(operator.sub, intarray))) - elif name == "sub_hex": - return hex(int(functools.reduce(operator.sub, intarray))) elif name == "mul": return str(int(functools.reduce(operator.mul, intarray))) - elif name == "mul_hex": - return hex(int(functools.reduce(operator.mul, intarray))) elif name == "div": return str(int(functools.reduce(operator.truediv, intarray))) - elif name == "div_hex": - return hex(int(functools.reduce(operator.truediv, intarray))) elif name == "mod": return str(int(functools.reduce(operator.mod, intarray))) - elif name == "mod_hex": - return hex(int(functools.reduce(operator.mod, intarray))) elif name == "max": return str(int(functools.reduce(max, intarray))) - elif name == "max_hex": - return hex(int(functools.reduce(max, intarray))) elif name == "min": return str(int(functools.reduce(min, intarray))) - elif name == "min_hex": - return hex(int(functools.reduce(min, intarray))) else: assert False @@ -1048,16 +1034,12 @@ def inc_dec(kconf, name, *args): Returns a string that concatenates numbers with a comma as a separator. """ - intarray = (int(val, base=0) for arg in args for val in arg.split(",")) + intarray = map(int, args if len(args) > 1 else args[0].split(",")) if name == "inc": return ",".join(map(lambda a: str(a + 1), intarray)) - if name == "inc_hex": - return ",".join(map(lambda a: hex(a + 1), intarray)) elif name == "dec": return ",".join(map(lambda a: str(a - 1), intarray)) - elif name == "dec_hex": - return ",".join(map(lambda a: hex(a - 1), intarray)) else: assert False @@ -1124,21 +1106,12 @@ def inc_dec(kconf, name, *args): "shields_list_contains": (shields_list_contains, 1, 1), "substring": (substring, 2, 3), "add": (arith, 1, 255), - "add_hex": (arith, 1, 255), "sub": (arith, 1, 255), - "sub_hex": (arith, 1, 255), "mul": (arith, 1, 255), - "mul_hex": (arith, 1, 255), "div": (arith, 1, 255), - "div_hex": (arith, 1, 255), "mod": (arith, 1, 255), - "mod_hex": (arith, 1, 255), "max": (arith, 1, 255), - "max_hex": (arith, 1, 255), "min": (arith, 1, 255), - "min_hex": (arith, 1, 255), "inc": (inc_dec, 1, 255), - "inc_hex": (inc_dec, 1, 255), "dec": (inc_dec, 1, 255), - "dec_hex": (inc_dec, 1, 255), } diff --git a/tests/kconfig/functions/Kconfig b/tests/kconfig/functions/Kconfig index 1e46730c98a..50868eb7b6a 100644 --- a/tests/kconfig/functions/Kconfig +++ b/tests/kconfig/functions/Kconfig @@ -6,60 +6,60 @@ config KCONFIG_ARITHMETIC_ADD_10 default $(add, 10) config KCONFIG_ARITHMETIC_ADD_10_3 - hex - default $(add_hex, 10, 3) + int + default $(add, 10, 3) config KCONFIG_ARITHMETIC_ADD_10_3_2 int - default $(add, 0xa, 3, 0b10) + default $(add, 10, 3, 2) config KCONFIG_ARITHMETIC_SUB_10 int default $(sub, 10) config KCONFIG_ARITHMETIC_SUB_10_3 - hex - default $(sub_hex, 10, 3) + int + default $(sub, 10, 3) config KCONFIG_ARITHMETIC_SUB_10_3_2 int - default $(sub, 0xa, 3, 0b10) + default $(sub, 10, 3, 2) config KCONFIG_ARITHMETIC_MUL_10 int default $(mul, 10) config KCONFIG_ARITHMETIC_MUL_10_3 - hex - default $(mul_hex, 10, 3) + int + default $(mul, 10, 3) config KCONFIG_ARITHMETIC_MUL_10_3_2 int - default $(mul, 0xa, 3, 0b10) + default $(mul, 10, 3, 2) config KCONFIG_ARITHMETIC_DIV_10 int default $(div, 10) config KCONFIG_ARITHMETIC_DIV_10_3 - hex - default $(div_hex, 10, 3) + int + default $(div, 10, 3) config KCONFIG_ARITHMETIC_DIV_10_3_2 int - default $(div, 0xa, 3, 0b10) + default $(div, 10, 3, 2) config KCONFIG_ARITHMETIC_MOD_10 int default $(mod, 10) config KCONFIG_ARITHMETIC_MOD_10_3 - hex - default $(mod_hex, 10, 3) + int + default $(mod, 10, 3) config KCONFIG_ARITHMETIC_MOD_10_3_2 int - default $(mod, 0xa, 3, 0b10) + default $(mod, 10, 3, 2) config KCONFIG_ARITHMETIC_INC_1 int @@ -67,11 +67,11 @@ config KCONFIG_ARITHMETIC_INC_1 config KCONFIG_ARITHMETIC_INC_1_1 string - default "$(inc_hex, 1, 1)" + default "$(inc, 1, 1)" config KCONFIG_ARITHMETIC_INC_INC_1_1 string - default "$(inc, $(inc_hex, 0x1, 0b1))" + default "$(inc, $(inc, 1, 1))" config KCONFIG_ARITHMETIC_DEC_1 int @@ -79,38 +79,38 @@ config KCONFIG_ARITHMETIC_DEC_1 config KCONFIG_ARITHMETIC_DEC_1_1 string - default "$(dec_hex, 1, 1)" + default "$(dec, 1, 1)" config KCONFIG_ARITHMETIC_DEC_DEC_1_1 string - default "$(dec, $(dec_hex, 0x1, 0b1))" + default "$(dec, $(dec, 1, 1))" config KCONFIG_ARITHMETIC_ADD_INC_1_1 int - default $(add, $(inc_hex, 1, 1)) + default $(add, $(inc, 1, 1)) config KCONFIG_MIN_10 int default $(min, 10) config KCONFIG_MIN_10_3 - hex - default $(min_hex, 10, 3) + int + default $(min, 10, 3) config KCONFIG_MIN_10_3_2 int - default $(min, 0xa, 3, 0b10) + default $(min, 10, 3, 2) config KCONFIG_MAX_10 int default $(max, 10) config KCONFIG_MAX_10_3 - hex - default $(max_hex, 10, 3) + int + default $(max, 10, 3) config KCONFIG_MAX_10_3_2 int - default $(max, 0xa, 3, 0b10) + default $(max, 10, 3, 2) source "Kconfig.zephyr" diff --git a/tests/kconfig/functions/src/main.c b/tests/kconfig/functions/src/main.c index 7492e3b5b93..39962c2a4f8 100644 --- a/tests/kconfig/functions/src/main.c +++ b/tests/kconfig/functions/src/main.c @@ -27,10 +27,10 @@ ZTEST(test_kconfig_functions, test_arithmetic) zassert_equal(CONFIG_KCONFIG_ARITHMETIC_MOD_10_3, 10 % 3); zassert_equal(CONFIG_KCONFIG_ARITHMETIC_MOD_10_3_2, 10 % 3 % 2); zassert_equal(CONFIG_KCONFIG_ARITHMETIC_INC_1, 1 + 1); - zassert_str_equal(CONFIG_KCONFIG_ARITHMETIC_INC_1_1, "0x2,0x2"); + zassert_str_equal(CONFIG_KCONFIG_ARITHMETIC_INC_1_1, "2,2"); zassert_str_equal(CONFIG_KCONFIG_ARITHMETIC_INC_INC_1_1, "3,3"); zassert_equal(CONFIG_KCONFIG_ARITHMETIC_DEC_1, 1 - 1); - zassert_str_equal(CONFIG_KCONFIG_ARITHMETIC_DEC_1_1, "0x0,0x0"); + zassert_str_equal(CONFIG_KCONFIG_ARITHMETIC_DEC_1_1, "0,0"); zassert_str_equal(CONFIG_KCONFIG_ARITHMETIC_DEC_DEC_1_1, "-1,-1"); zassert_equal(CONFIG_KCONFIG_ARITHMETIC_ADD_INC_1_1, (1 + 1) + (1 + 1)); } From 3f8499509576911718c8f2b5cd4193f988419a65 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 655/881] Revert "[nrf fromlist] soc: nordic: nrf54l: add Kconfig to control whether to apply Errata 56" This reverts commit f328a81a2b2200142aa352824a5eb9e009cfca8a. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/nrfx/CMakeLists.txt | 1 - soc/nordic/nrf54l/Kconfig | 6 ------ 2 files changed, 7 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 5d7b4d942b3..d1972356fcc 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -197,7 +197,6 @@ endif() zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_DISABLE_FICR_TRIMCNF NRF_DISABLE_FICR_TRIMCNF) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE NRF_SKIP_GLITCHDETECTOR_DISABLE) -zephyr_compile_definitions_ifndef(CONFIG_SOC_NRF54L_ANOMALY_56_WORKAROUND NRF54L_CONFIGURATION_56_ENABLE=0) # Inject code to skip TAMPC setup for nRF54L20 and nRF54L09. It is not supported for now. # It needs to be removed when support is provided. diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 19131154b5b..6dc5e9f13cd 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -84,10 +84,4 @@ config SOC_NRF_FORCE_CONSTLAT of base resources on while in sleep. The advantage of having a constant and predictable latency will be at the cost of having increased power consumption. -config SOC_NRF54L_ANOMALY_56_WORKAROUND - bool "Apply workaround 56 for nRF54L SoCs" - default y - help - This option enables configuration workaround 56 for nRF54L Series SoCs. - endif # SOC_SERIES_NRF54LX From a46895d955f52a4e340e519485d8fb767f6d22f1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 656/881] Revert "[nrf fromtree] drivers: nrfx: help select clock control when needed" This reverts commit fb23f7c4c115395816a466fdbad37663b62e1349. Signed-off-by: Jukka Rissanen --- drivers/counter/Kconfig.nrfx | 3 +-- drivers/serial/Kconfig.nrfx | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/counter/Kconfig.nrfx b/drivers/counter/Kconfig.nrfx index ed02411de26..775406a5198 100644 --- a/drivers/counter/Kconfig.nrfx +++ b/drivers/counter/Kconfig.nrfx @@ -12,8 +12,7 @@ config COUNTER_NRF_RTC config COUNTER_NRFX_TIMER_USE_CLOCK_CONTROL def_bool y depends on $(dt_nodelabel_enabled,timer120) || \ - $(dt_nodelabel_enabled,timer121) - depends on !SOC_NRF54H20_CPUFLPR && !SOC_NRF54H20_CPUPPR + $(dt_nodelabel_enabled,timer121) select CLOCK_CONTROL # Internal flag which detects if PPI wrap feature is enabled for any instance diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index f91980c058b..0bac5150a24 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -28,13 +28,6 @@ config UART_NRFX_UARTE imply NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG if !UART_NRFX_UARTE_LEGACY_SHIM imply NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG if !UART_NRFX_UARTE_LEGACY_SHIM -config UART_NRFX_UARTE_USE_CLOCK_CONTROL - def_bool y - depends on UART_NRFX_UARTE - depends on $(dt_nodelabel_enabled,uart120) - depends on !SOC_NRF54H20_CPUFLPR && !SOC_NRF54H20_CPUPPR - select CLOCK_CONTROL - config UART_NRFX_UARTE_NO_IRQ bool "Polling without interrupt" depends on UART_NRFX_UARTE From 2d017cca531b6a5c9a17b49aca6d27f6b4798668 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:34 +0300 Subject: [PATCH 657/881] Revert "[nrf fromtree] dts: vendor: nordic: nrf54h20.dtsi: disable cpurad_hsfll" This reverts commit 2322f1f389d4ae9039438f41def0ea175ce017f3. Signed-off-by: Jukka Rissanen --- dts/vendor/nordic/nrf54h20.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index c12ea5f1ead..37a6a3f394b 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -336,7 +336,6 @@ compatible = "nordic,nrf-hsfll-local"; #clock-cells = <0>; reg = <0xd000 0x1000>; - status = "disabled"; clocks = <&fll16m>; clock-frequency = ; nordic,ficrs = From aeadc6f6fc8b98d4fdd82ed524b95cb5bde958bb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 658/881] Revert "[nrf fromtree] drivers: serial: nrfx_uarte: assert clock control enabled" This reverts commit 69ba6b5cc9cb0293ec29d401528c3ed7cbdc172f. Signed-off-by: Jukka Rissanen --- drivers/serial/uart_nrfx_uarte.c | 5 ++--- .../uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 46c5a8b83d2..80e296cc51d 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -129,11 +129,10 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); (0))), (0)) #if UARTE_FOR_EACH_INSTANCE(INSTANCE_IS_FAST_PD, (||), (0)) -/* Instance in fast power domain (PD) requires special PM treatment and clock control, so - * device runtime PM and clock control must be enabled. +/* Instance in fast power domain (PD) requires special PM treatment so device runtime PM must + * be enabled. */ BUILD_ASSERT(IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)); -BUILD_ASSERT(IS_ENABLED(CONFIG_CLOCK_CONTROL)); #define UARTE_ANY_FAST_PD 1 #endif #endif diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 6dffc1fe4e1..74cc8d7691e 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,3 +1,2 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y -CONFIG_CLOCK_CONTROL=y From 354180f866cf44ff26f45011cf774c02b385a7fe Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 659/881] Revert "[nrf fromtree] drivers: serial: nrfx: remove deprecated config" This reverts commit 6e376b0661c92c7b629d6a24ee4b805005a26cc9. Signed-off-by: Jukka Rissanen --- drivers/serial/Kconfig.nrfx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 0bac5150a24..3fb1f0fd120 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -135,6 +135,11 @@ rsource "Kconfig.nrfx_uart_instance" endif if HAS_HW_NRF_UARTE120 + +config UART_NRFX_UARTE_USE_CLOCK_CONTROL + def_bool y + select CLOCK_CONTROL + nrfx_uart_num = 120 rsource "Kconfig.nrfx_uart_instance" endif From 92bbd4f9f0d355d67870328896674eca5925300f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 660/881] Revert "[nrf fromtree] drivers: clock_control: nrf2: split configs per driver" This reverts commit 1b2f57c6d8db7a638012805108681ae949cb3752. Signed-off-by: Jukka Rissanen --- drivers/clock_control/CMakeLists.txt | 13 +-- drivers/clock_control/Kconfig.nrf | 83 ++++++------------- .../clock_control_nrf_hsfll_local.c | 2 +- .../drivers/clock_control/nrf_clock_control.h | 5 ++ .../platform/nrf_802154_clock_zephyr.c | 3 +- 5 files changed, 41 insertions(+), 65 deletions(-) diff --git a/drivers/clock_control/CMakeLists.txt b/drivers/clock_control/CMakeLists.txt index b1dbe191197..bc70784ebec 100644 --- a/drivers/clock_control/CMakeLists.txt +++ b/drivers/clock_control/CMakeLists.txt @@ -49,11 +49,14 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL clock_cont zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_RTS5912_SCCON clock_control_rts5912_sccon.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL clock_control_nrfs_audiopll.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_IT51XXX clock_control_it51xxx.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF2_COMMON clock_control_nrf2_common.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_FLL16M clock_control_nrf_fll16m.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF54H_HFXO clock_control_nrf54h_hfxo.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL clock_control_nrf_hsfll_local.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_LFCLK clock_control_nrf_lfclk.c) + +if(CONFIG_CLOCK_CONTROL_NRF2) + zephyr_library_sources(clock_control_nrf2_common.c) + zephyr_library_sources(clock_control_nrf_fll16m.c) + zephyr_library_sources(clock_control_nrf54h_hfxo.c) + zephyr_library_sources(clock_control_nrf_hsfll_local.c) + zephyr_library_sources(clock_control_nrf_lfclk.c) +endif() if(CONFIG_CLOCK_CONTROL_RENESAS_RZA2M_CPG) zephyr_library_sources(clock_control_renesas_rza2m_cpg.c) diff --git a/drivers/clock_control/Kconfig.nrf b/drivers/clock_control/Kconfig.nrf index bbd4a86f5a9..a1b61e941a4 100644 --- a/drivers/clock_control/Kconfig.nrf +++ b/drivers/clock_control/Kconfig.nrf @@ -201,16 +201,34 @@ config CLOCK_CONTROL_NRF_ACCURACY endif # CLOCK_CONTROL_NRF -config CLOCK_CONTROL_NRF2_COMMON - bool "NRF2 clock control common framework" +config CLOCK_CONTROL_NRF2 + bool "nRF clock control support" + default y + depends on SOC_SERIES_NRF54HX && !RISCV_CORE_NORDIC_VPR select ONOFF + select NRFS if HAS_NRFS + help + Support for nRF clock control devices. + +if CLOCK_CONTROL_NRF2 + +config CLOCK_CONTROL_NRF_HSFLL_LOCAL_REQ_LOW_FREQ + bool "Local domain scale down after init" + default y if NRFS_DVFS_LOCAL_DOMAIN + help + Request the lowest operating point after DVFS initialization. + +config CLOCK_CONTROL_NRF_HSFLL_LOCAL_NRFS_DVFS_TIMEOUT_MS + int "Timeout waiting for nrfs dvfs service callback in milliseconds" + default 2000 + +config CLOCK_CONTROL_NRF_LFCLK_CLOCK_TIMEOUT_MS + int "Timeout waiting for nrfs clock service callback in milliseconds" + default 1000 config CLOCK_CONTROL_NRF_HSFLL_GLOBAL bool "Clock control for global HSFLL" - depends on DT_HAS_NORDIC_NRF_HSFLL_GLOBAL_ENABLED - select NRFS - select NRFS_GDFS_SERVICE_ENABLED - select CLOCK_CONTROL_NRF2_COMMON + depends on NRFS_GDFS_SERVICE_ENABLED default y if CLOCK_CONTROL_NRF_HSFLL_GLOBAL @@ -244,56 +262,7 @@ endif # CLOCK_CONTROL_NRF_HSFLL_GLOBAL config CLOCK_CONTROL_NRFS_AUDIOPLL bool "NRFS AudioPLL driver support" depends on DT_HAS_NORDIC_NRFS_AUDIOPLL_ENABLED - select NRFS - select NRFS_AUDIOPLL_SERVICE_ENABLED - select CLOCK_CONTROL_NRF2_COMMON - default y - -config CLOCK_CONTROL_NRF_FLL16M - bool "NRF FLL16M driver support" - depends on DT_HAS_NORDIC_NRF_FLL16M_ENABLED - select CLOCK_CONTROL_NRF2_COMMON - default y - -config CLOCK_CONTROL_NRF54H_HFXO - bool "NRF54H HFXO driver support" - depends on DT_HAS_NORDIC_NRF54H_HFXO_ENABLED - select CLOCK_CONTROL_NRF2_COMMON + depends on NRFS_AUDIOPLL_SERVICE_ENABLED default y -config CLOCK_CONTROL_NRF_HSFLL_LOCAL - bool "NRF HSFLL LOCAL driver support" - depends on DT_HAS_NORDIC_NRF_HSFLL_LOCAL_ENABLED - select NRFS - select NRFS_DVFS_LOCAL_DOMAIN - select CLOCK_CONTROL_NRF2_COMMON - default y - -if CLOCK_CONTROL_NRF_HSFLL_LOCAL - -config CLOCK_CONTROL_NRF_HSFLL_LOCAL_REQ_LOW_FREQ - bool "Local domain scale down after init" - help - Request the lowest operating point after DVFS initialization. - -config CLOCK_CONTROL_NRF_HSFLL_LOCAL_NRFS_DVFS_TIMEOUT_MS - int "Timeout waiting for nrfs dvfs service callback in milliseconds" - default 2000 - -endif # CLOCK_CONTROL_NRF_HSFLL_LOCAL - -config CLOCK_CONTROL_NRF_LFCLK - bool "NRF LFCLK driver support" - depends on DT_HAS_NORDIC_NRF_LFCLK_ENABLED - select NRFS - select NRFS_CLOCK_SERVICE_ENABLED - select CLOCK_CONTROL_NRF2_COMMON - default y - -if CLOCK_CONTROL_NRF_LFCLK - -config CLOCK_CONTROL_NRF_LFCLK_CLOCK_TIMEOUT_MS - int "Timeout waiting for nrfs clock service callback in milliseconds" - default 1000 - -endif # CLOCK_CONTROL_NRF_LFCLK +endif # CLOCK_CONTROL_NRF2 diff --git a/drivers/clock_control/clock_control_nrf_hsfll_local.c b/drivers/clock_control/clock_control_nrf_hsfll_local.c index 942f16ed444..ab2cab3b920 100644 --- a/drivers/clock_control/clock_control_nrf_hsfll_local.c +++ b/drivers/clock_control/clock_control_nrf_hsfll_local.c @@ -259,7 +259,7 @@ static DEVICE_API(nrf_clock_control, hsfll_drv_api) = { static struct hsfll_dev_data hsfll_data; #endif -#ifdef CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL_REQ_LOW_FREQ +#ifdef CONFIG_CLOCK_CONTROL_NRF2_HSFLL_REQ_LOW_FREQ static int dvfs_low_init(void) { static const k_timeout_t timeout = NRFS_DVFS_TIMEOUT; diff --git a/include/zephyr/drivers/clock_control/nrf_clock_control.h b/include/zephyr/drivers/clock_control/nrf_clock_control.h index f407be61d4d..7ef524dd4dc 100644 --- a/include/zephyr/drivers/clock_control/nrf_clock_control.h +++ b/include/zephyr/drivers/clock_control/nrf_clock_control.h @@ -171,6 +171,9 @@ uint32_t z_nrf_clock_bt_ctlr_hf_get_startup_time_us(void); #endif /* defined(CONFIG_CLOCK_CONTROL_NRF) */ + +#if defined(CONFIG_CLOCK_CONTROL_NRF2) + /* Specifies to use the maximum available frequency for a given clock. */ #define NRF_CLOCK_CONTROL_FREQUENCY_MAX UINT32_MAX @@ -399,6 +402,8 @@ void nrf_clock_control_hfxo_request(void); */ void nrf_clock_control_hfxo_release(void); +#endif /* defined(CONFIG_CLOCK_CONTROL_NRF2) */ + #ifdef __cplusplus } #endif diff --git a/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c b/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c index 1dcf724b0e5..1ade977118e 100644 --- a/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c +++ b/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c @@ -88,8 +88,7 @@ void nrf_802154_clock_hfclk_stop(void) hfclk_is_running = false; } -#elif DT_NODE_HAS_STATUS(DT_NODELABEL(hfxo), okay) && \ - DT_NODE_HAS_COMPAT(DT_NODELABEL(hfxo), nordic_nrf54h_hfxo) +#elif defined(CONFIG_CLOCK_CONTROL_NRF2) void nrf_802154_clock_hfclk_start(void) { From 08fca4ee7599b22b551d3d23d6ed024b917f519d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 661/881] Revert "[nrf fromtree] drivers: clock_control: nrf2: align with hw binding names" This reverts commit ac70df046a1e7004f4482dce95c3bf0ac4dc0b19. Signed-off-by: Jukka Rissanen --- drivers/audio/dmic_nrfx_pdm.c | 8 ++++---- drivers/clock_control/CMakeLists.txt | 12 +++++------ drivers/clock_control/Kconfig.nrf | 20 +++++++++---------- ...diopll.c => clock_control_nrf2_audiopll.c} | 0 ...f_fll16m.c => clock_control_nrf2_fll16m.c} | 0 ...al.c => clock_control_nrf2_global_hsfll.c} | 6 +++--- ...rf54h_hfxo.c => clock_control_nrf2_hfxo.c} | 0 ...fll_local.c => clock_control_nrf2_hsfll.c} | 4 ++-- ...nrf_lfclk.c => clock_control_nrf2_lfclk.c} | 2 +- drivers/counter/counter_nrfx_timer.c | 2 +- drivers/i2s/i2s_nrf_tdm.c | 4 ++-- drivers/pwm/pwm_nrfx.c | 8 ++++---- drivers/serial/uart_nrfx_uarte.c | 2 +- drivers/spi/spi_nrfx_spim.c | 8 ++++---- .../boards/nordic/clock_control/sample.yaml | 2 +- 15 files changed, 39 insertions(+), 39 deletions(-) rename drivers/clock_control/{clock_control_nrfs_audiopll.c => clock_control_nrf2_audiopll.c} (100%) rename drivers/clock_control/{clock_control_nrf_fll16m.c => clock_control_nrf2_fll16m.c} (100%) rename drivers/clock_control/{clock_control_nrf_hsfll_global.c => clock_control_nrf2_global_hsfll.c} (98%) rename drivers/clock_control/{clock_control_nrf54h_hfxo.c => clock_control_nrf2_hfxo.c} (100%) rename drivers/clock_control/{clock_control_nrf_hsfll_local.c => clock_control_nrf2_hsfll.c} (97%) rename drivers/clock_control/{clock_control_nrf_lfclk.c => clock_control_nrf2_lfclk.c} (99%) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index b2fcb7abb86..2e8d71b0a93 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -30,7 +30,7 @@ struct dmic_nrfx_pdm_drv_data { const nrfx_pdm_t *pdm; #if CONFIG_CLOCK_CONTROL_NRF struct onoff_manager *clk_mgr; -#elif CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL +#elif CONFIG_CLOCK_CONTROL_NRF2_AUDIOPLL const struct device *audiopll_dev; #endif struct onoff_client clk_cli; @@ -75,7 +75,7 @@ static int request_clock(struct dmic_nrfx_pdm_drv_data *drv_data) } #if CONFIG_CLOCK_CONTROL_NRF return onoff_request(drv_data->clk_mgr, &drv_data->clk_cli); -#elif CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL +#elif CONFIG_CLOCK_CONTROL_NRF2_AUDIOPLL return nrf_clock_control_request(drv_data->audiopll_dev, NULL, &drv_data->clk_cli); #else return -ENOTSUP; @@ -90,7 +90,7 @@ static int release_clock(struct dmic_nrfx_pdm_drv_data *drv_data) #if CONFIG_CLOCK_CONTROL_NRF return onoff_release(drv_data->clk_mgr); -#elif CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL +#elif CONFIG_CLOCK_CONTROL_NRF2_AUDIOPLL return nrf_clock_control_release(drv_data->audiopll_dev, NULL); #else return -ENOTSUP; @@ -673,7 +673,7 @@ static void init_clock_manager(const struct device *dev) drv_data->clk_mgr = z_nrf_clock_control_get_onoff(subsys); __ASSERT_NO_MSG(drv_data->clk_mgr != NULL); -#elif CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL +#elif CONFIG_CLOCK_CONTROL_NRF2_AUDIOPLL struct dmic_nrfx_pdm_drv_data *drv_data = dev->data; drv_data->audiopll_dev = DEVICE_DT_GET(DT_NODELABEL(audiopll)); diff --git a/drivers/clock_control/CMakeLists.txt b/drivers/clock_control/CMakeLists.txt index bc70784ebec..886c92b6357 100644 --- a/drivers/clock_control/CMakeLists.txt +++ b/drivers/clock_control/CMakeLists.txt @@ -45,17 +45,17 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_RENESAS_RZ_CPG clock_cont zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_AMBIQ clock_control_ambiq.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_PWM clock_control_pwm.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_RPI_PICO clock_control_rpi_pico.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL clock_control_nrf_hsfll_global.c) +zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL clock_control_nrf2_global_hsfll.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_RTS5912_SCCON clock_control_rts5912_sccon.c) -zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL clock_control_nrfs_audiopll.c) +zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF2_AUDIOPLL clock_control_nrf2_audiopll.c) zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_IT51XXX clock_control_it51xxx.c) if(CONFIG_CLOCK_CONTROL_NRF2) zephyr_library_sources(clock_control_nrf2_common.c) - zephyr_library_sources(clock_control_nrf_fll16m.c) - zephyr_library_sources(clock_control_nrf54h_hfxo.c) - zephyr_library_sources(clock_control_nrf_hsfll_local.c) - zephyr_library_sources(clock_control_nrf_lfclk.c) + zephyr_library_sources(clock_control_nrf2_fll16m.c) + zephyr_library_sources(clock_control_nrf2_hfxo.c) + zephyr_library_sources(clock_control_nrf2_hsfll.c) + zephyr_library_sources(clock_control_nrf2_lfclk.c) endif() if(CONFIG_CLOCK_CONTROL_RENESAS_RZA2M_CPG) diff --git a/drivers/clock_control/Kconfig.nrf b/drivers/clock_control/Kconfig.nrf index a1b61e941a4..07ee365603b 100644 --- a/drivers/clock_control/Kconfig.nrf +++ b/drivers/clock_control/Kconfig.nrf @@ -212,32 +212,32 @@ config CLOCK_CONTROL_NRF2 if CLOCK_CONTROL_NRF2 -config CLOCK_CONTROL_NRF_HSFLL_LOCAL_REQ_LOW_FREQ +config CLOCK_CONTROL_NRF2_HSFLL_REQ_LOW_FREQ bool "Local domain scale down after init" default y if NRFS_DVFS_LOCAL_DOMAIN help Request the lowest operating point after DVFS initialization. -config CLOCK_CONTROL_NRF_HSFLL_LOCAL_NRFS_DVFS_TIMEOUT_MS +config CLOCK_CONTROL_NRF2_NRFS_DVFS_TIMEOUT_MS int "Timeout waiting for nrfs dvfs service callback in milliseconds" default 2000 -config CLOCK_CONTROL_NRF_LFCLK_CLOCK_TIMEOUT_MS +config CLOCK_CONTROL_NRF2_NRFS_CLOCK_TIMEOUT_MS int "Timeout waiting for nrfs clock service callback in milliseconds" default 1000 -config CLOCK_CONTROL_NRF_HSFLL_GLOBAL +config CLOCK_CONTROL_NRF2_GLOBAL_HSFLL bool "Clock control for global HSFLL" depends on NRFS_GDFS_SERVICE_ENABLED default y -if CLOCK_CONTROL_NRF_HSFLL_GLOBAL +if CLOCK_CONTROL_NRF2_GLOBAL_HSFLL -config CLOCK_CONTROL_NRF_HSFLL_GLOBAL_TIMEOUT_MS +config CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_TIMEOUT_MS int "Frequency request timeout in milliseconds" default 10000 -config CLOCK_CONTROL_NRF_HSFLL_GLOBAL_REQ_LOW_FREQ +config CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_REQ_LOW_FREQ bool "Request LOW frequency on init" default y help @@ -251,15 +251,15 @@ config CLOCK_CONTROL_NRF_HSFLL_GLOBAL_REQ_LOW_FREQ unnecessary HIGH -> LOW -> HIGH cycle given some module will request a HIGH frequency on init anyway. -config CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY +config CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY int "Init priority of global HSFLL device driver" default 52 help Must be higher than NRFS backend -endif # CLOCK_CONTROL_NRF_HSFLL_GLOBAL +endif # CLOCK_CONTROL_NRF2_GLOBAL_HSFLL -config CLOCK_CONTROL_NRFS_AUDIOPLL +config CLOCK_CONTROL_NRF2_AUDIOPLL bool "NRFS AudioPLL driver support" depends on DT_HAS_NORDIC_NRFS_AUDIOPLL_ENABLED depends on NRFS_AUDIOPLL_SERVICE_ENABLED diff --git a/drivers/clock_control/clock_control_nrfs_audiopll.c b/drivers/clock_control/clock_control_nrf2_audiopll.c similarity index 100% rename from drivers/clock_control/clock_control_nrfs_audiopll.c rename to drivers/clock_control/clock_control_nrf2_audiopll.c diff --git a/drivers/clock_control/clock_control_nrf_fll16m.c b/drivers/clock_control/clock_control_nrf2_fll16m.c similarity index 100% rename from drivers/clock_control/clock_control_nrf_fll16m.c rename to drivers/clock_control/clock_control_nrf2_fll16m.c diff --git a/drivers/clock_control/clock_control_nrf_hsfll_global.c b/drivers/clock_control/clock_control_nrf2_global_hsfll.c similarity index 98% rename from drivers/clock_control/clock_control_nrf_hsfll_global.c rename to drivers/clock_control/clock_control_nrf2_global_hsfll.c index 605b788b539..30a64ea9fdc 100644 --- a/drivers/clock_control/clock_control_nrf_hsfll_global.c +++ b/drivers/clock_control/clock_control_nrf2_global_hsfll.c @@ -23,10 +23,10 @@ LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); DT_INST_PROP_LEN(0, supported_clock_frequencies) #define GLOBAL_HSFLL_FREQ_REQ_TIMEOUT \ - K_MSEC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_TIMEOUT_MS) + K_MSEC(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_TIMEOUT_MS) #define GLOBAL_HSFLL_INIT_LOW_REQ \ - CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_REQ_LOW_FREQ + CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_REQ_LOW_FREQ BUILD_ASSERT(GLOBAL_HSFLL_CLOCK_FREQUENCIES_SIZE == 4); BUILD_ASSERT(GLOBAL_HSFLL_CLOCK_FREQUENCIES_IDX(0) == 64000000); @@ -339,6 +339,6 @@ DEVICE_DT_INST_DEFINE( &driver_data, &driver_config, POST_KERNEL, - CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY, + CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY, &driver_api ); diff --git a/drivers/clock_control/clock_control_nrf54h_hfxo.c b/drivers/clock_control/clock_control_nrf2_hfxo.c similarity index 100% rename from drivers/clock_control/clock_control_nrf54h_hfxo.c rename to drivers/clock_control/clock_control_nrf2_hfxo.c diff --git a/drivers/clock_control/clock_control_nrf_hsfll_local.c b/drivers/clock_control/clock_control_nrf2_hsfll.c similarity index 97% rename from drivers/clock_control/clock_control_nrf_hsfll_local.c rename to drivers/clock_control/clock_control_nrf2_hsfll.c index ab2cab3b920..e8f8449b24d 100644 --- a/drivers/clock_control/clock_control_nrf_hsfll_local.c +++ b/drivers/clock_control/clock_control_nrf2_hsfll.c @@ -25,7 +25,7 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, #define HSFLL_FREQ_MEDLOW MHZ(128) #define HSFLL_FREQ_HIGH MHZ(320) -#define NRFS_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL_NRFS_DVFS_TIMEOUT_MS) +#define NRFS_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF2_NRFS_DVFS_TIMEOUT_MS) /* Clock options sorted from lowest to highest frequency */ static const struct clock_options { @@ -262,7 +262,7 @@ static struct hsfll_dev_data hsfll_data; #ifdef CONFIG_CLOCK_CONTROL_NRF2_HSFLL_REQ_LOW_FREQ static int dvfs_low_init(void) { - static const k_timeout_t timeout = NRFS_DVFS_TIMEOUT; + static const k_timeout_t timeout = K_MSEC(CONFIG_CLOCK_CONTROL_NRF2_NRFS_DVFS_TIMEOUT_MS); static const struct device *hsfll_dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(DT_NODELABEL(cpu))); static const struct nrf_clock_spec clk_spec = { .frequency = HSFLL_FREQ_LOW diff --git a/drivers/clock_control/clock_control_nrf_lfclk.c b/drivers/clock_control/clock_control_nrf2_lfclk.c similarity index 99% rename from drivers/clock_control/clock_control_nrf_lfclk.c rename to drivers/clock_control/clock_control_nrf2_lfclk.c index fcdb8bd573b..6be9deee657 100644 --- a/drivers/clock_control/clock_control_nrf_lfclk.c +++ b/drivers/clock_control/clock_control_nrf2_lfclk.c @@ -28,7 +28,7 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, #define LFCLK_MAX_OPTS 5 #define LFCLK_DEF_OPTS 3 -#define NRFS_CLOCK_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_LFCLK_CLOCK_TIMEOUT_MS) +#define NRFS_CLOCK_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF2_NRFS_CLOCK_TIMEOUT_MS) #define BICR (NRF_BICR_Type *)DT_REG_ADDR(DT_NODELABEL(bicr)) diff --git a/drivers/counter/counter_nrfx_timer.c b/drivers/counter/counter_nrfx_timer.c index 71f7f7edd33..52e525717a9 100644 --- a/drivers/counter/counter_nrfx_timer.c +++ b/drivers/counter/counter_nrfx_timer.c @@ -481,7 +481,7 @@ static DEVICE_API(counter, counter_nrfx_driver_api) = { */ #define TIMER_INIT_PRIO(idx) \ COND_CODE_1(INSTANCE_IS_FAST(idx), \ - (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ + (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY)), \ (CONFIG_COUNTER_INIT_PRIORITY)) /* diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index f8fa4773d37..f61c5c8849b 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -127,7 +127,7 @@ static int audio_clock_request(struct tdm_drv_data *drv_data) { #if DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRF return onoff_request(drv_data->clk_mgr, &drv_data->clk_cli); -#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL +#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRF2_AUDIOPLL return nrf_clock_control_request(audiopll, &aclk_spec, &drv_data->clk_cli); #else (void)drv_data; @@ -140,7 +140,7 @@ static int audio_clock_release(struct tdm_drv_data *drv_data) { #if DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRF return onoff_release(drv_data->clk_mgr); -#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL +#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRF2_AUDIOPLL (void)drv_data; return nrf_clock_control_release(audiopll, &aclk_spec); diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index ec55bef6960..bab8b0f003e 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -55,7 +55,7 @@ LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL); BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); #endif -#if defined(PWM_NRFX_FAST_PRESENT) && CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL +#if defined(PWM_NRFX_FAST_PRESENT) && CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL #define PWM_NRFX_USE_CLOCK_CONTROL 1 #endif @@ -493,11 +493,11 @@ static int pwm_nrfx_init(const struct device *dev) * must be initialized after that controller driver, hence the default PWM * initialization priority may be too early for them. */ -#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY) && \ - CONFIG_PWM_INIT_PRIORITY < CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY +#if defined(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY) && \ + CONFIG_PWM_INIT_PRIORITY < CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY #define PWM_INIT_PRIORITY(idx) \ COND_CODE_1(PWM_NRFX_IS_FAST(_, /*empty*/, idx, _), \ - (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ + (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY)), \ (CONFIG_PWM_INIT_PRIORITY)) #else #define PWM_INIT_PRIORITY(idx) CONFIG_PWM_INIT_PRIORITY diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 80e296cc51d..55aea85f3d3 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2587,7 +2587,7 @@ static int uarte_instance_init(const struct device *dev, */ #define UARTE_INIT_PRIO(idx) \ COND_CODE_1(INSTANCE_IS_FAST_PD(_, /*empty*/, idx, _), \ - (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ + (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY)), \ (CONFIG_SERIAL_INIT_PRIORITY)) /* Macro for setting nRF specific configuration structures. */ diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index c77e256a7fe..dcfee1c5ede 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -43,7 +43,7 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #define SPI_BUFFER_IN_RAM 1 #endif -#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL) +#if defined(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL) #define SPIM_REQUESTS_CLOCK(node) \ DT_NODE_HAS_COMPAT(DT_CLOCKS_CTLR(node), nordic_nrf_hsfll_global) #define SPIM_REQUESTS_CLOCK_OR(node) SPIM_REQUESTS_CLOCK(node) || @@ -796,11 +796,11 @@ static int spi_nrfx_init(const struct device *dev) * must be initialized after that controller driver, hence the default SPI * initialization priority may be too early for them. */ -#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY) && \ - CONFIG_SPI_INIT_PRIORITY < CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY +#if defined(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY) && \ + CONFIG_SPI_INIT_PRIORITY < CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY #define SPIM_INIT_PRIORITY(idx) \ COND_CODE_1(SPIM_REQUESTS_CLOCK(SPIM(idx)), \ - (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ + (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY)), \ (CONFIG_SPI_INIT_PRIORITY)) #else #define SPIM_INIT_PRIORITY(idx) CONFIG_SPI_INIT_PRIORITY diff --git a/samples/boards/nordic/clock_control/sample.yaml b/samples/boards/nordic/clock_control/sample.yaml index 6e455d29ebc..ee63e7c518e 100644 --- a/samples/boards/nordic/clock_control/sample.yaml +++ b/samples/boards/nordic/clock_control/sample.yaml @@ -37,7 +37,7 @@ tests: sample.boards.nrf.clock_control.global_hsfll.req_low_freq_n: filter: dt_nodelabel_enabled("hsfll120") extra_configs: - - CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_REQ_LOW_FREQ=n + - CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_REQ_LOW_FREQ=n extra_args: - CONF_FILE="configs/global_hsfll.conf" - DTC_OVERLAY_FILE="configs/global_hsfll.overlay" From 5faafb0078bfc98e6c7dda8fd21ad1744a7f453c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 662/881] Revert "[nrf fromtree] clock_control: nrf: fix nrf_clock_control_get_startup_time desc" This reverts commit 82427548eac12f540c46f00404ed8fcbf622ef8f. Signed-off-by: Jukka Rissanen --- include/zephyr/drivers/clock_control/nrf_clock_control.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/zephyr/drivers/clock_control/nrf_clock_control.h b/include/zephyr/drivers/clock_control/nrf_clock_control.h index 7ef524dd4dc..d12dca3c074 100644 --- a/include/zephyr/drivers/clock_control/nrf_clock_control.h +++ b/include/zephyr/drivers/clock_control/nrf_clock_control.h @@ -355,10 +355,9 @@ static inline int nrf_clock_control_resolve(const struct device *dev, } /** - * @brief Get the startup time of a clock. + * @brief Get the startup timme of a clock. * * @param dev Device structure. - * @param spec Clock specification to get startup time for. * @param startup_time_us Destination for startup time in microseconds. * * @retval Successful if successful. From 7a1faa9505fcced55a4494bcc1e59ff4b4fccb6f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 663/881] Revert "[nrf fromtree] drivers: mspi_dw: Add support for RX dummy cycles in single line mode" This reverts commit 0b6756bc2976b0e120e0dfee4b4f4a2910e07412. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index adc59e765b1..019f613218e 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -844,16 +844,13 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) (dev_data->xfer.cmd_length != 0 || dev_data->xfer.addr_length != 0)) { uint32_t rx_total_bytes; - uint32_t dummy_cycles = dev_data->xfer.rx_dummy; dev_data->bytes_to_discard = dev_data->xfer.cmd_length - + dev_data->xfer.addr_length - + dummy_cycles / 8; + + dev_data->xfer.addr_length; rx_total_bytes = dev_data->bytes_to_discard + packet->num_bytes; - dev_data->dummy_bytes = dummy_cycles / 8 - + packet->num_bytes; + dev_data->dummy_bytes = packet->num_bytes; imr = IMR_TXEIM_BIT | IMR_RXFIM_BIT; tmod = CTRLR0_TMOD_TX_RX; @@ -865,13 +862,11 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) tmod = CTRLR0_TMOD_RX; rx_fifo_threshold = MIN(packet_frames - 1, dev_config->rx_fifo_threshold); - - dev_data->spi_ctrlr0 |= - FIELD_PREP(SPI_CTRLR0_WAIT_CYCLES_MASK, - dev_data->xfer.rx_dummy); } dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_TMOD_MASK, tmod); + dev_data->spi_ctrlr0 |= FIELD_PREP(SPI_CTRLR0_WAIT_CYCLES_MASK, + dev_data->xfer.rx_dummy); write_rxftlr(dev, FIELD_PREP(RXFTLR_RFT_MASK, rx_fifo_threshold)); @@ -1044,15 +1039,10 @@ static int _api_transceive(const struct device *dev, return -EINVAL; } - if (dev_data->standard_spi) { - if (req->tx_dummy) { - LOG_ERR("TX dummy cycles unsupported in single line mode"); - return -EINVAL; - } - if (req->rx_dummy % 8) { - LOG_ERR("Unsupported RX (%u) dummy cycles", req->rx_dummy); - return -EINVAL; - } + if (dev_data->standard_spi && + (req->rx_dummy != 0 || req->tx_dummy != 0)) { + LOG_ERR("Dummy cycles unsupported in single line mode"); + return -EINVAL; } else if (req->rx_dummy > SPI_CTRLR0_WAIT_CYCLES_MAX || req->tx_dummy > SPI_CTRLR0_WAIT_CYCLES_MAX) { LOG_ERR("Unsupported RX (%u) or TX (%u) dummy cycles", From 0938238aadfa3f511f555f01008303fd8b7995e9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 664/881] Revert "[nrf fromtree] drivers: mspi_dw: Add error reporting on RX FIFO overflow" This reverts commit c8e872bd549ef01bb9ba3d45e3f0e888365e606c. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 12 +----------- drivers/mspi/mspi_dw.h | 13 ------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 019f613218e..7df0cdd8a09 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -101,7 +101,6 @@ DEFINE_MM_REG_RD(rxflr, 0x24) DEFINE_MM_REG_RD(sr, 0x28) DEFINE_MM_REG_WR(imr, 0x2c) DEFINE_MM_REG_RD(isr, 0x30) -DEFINE_MM_REG_RD(risr, 0x34) DEFINE_MM_REG_RD_WR(dr, 0x60) DEFINE_MM_REG_WR(spi_ctrlr0, 0xf4) @@ -280,11 +279,6 @@ static void mspi_dw_isr(const struct device *dev) break; } - if (read_risr(dev) & RISR_RXOIR_BIT) { - finished = true; - break; - } - int_status = read_isr(dev); } @@ -983,11 +977,7 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) write_imr(dev, imr); rc = k_sem_take(&dev_data->finished, timeout); - if (read_risr(dev) & RISR_RXOIR_BIT) { - LOG_ERR("RX FIFO overflow occurred"); - rc = -EIO; - } else if (rc < 0) { - LOG_ERR("Transfer timed out"); + if (rc < 0) { rc = -ETIMEDOUT; } diff --git a/drivers/mspi/mspi_dw.h b/drivers/mspi/mspi_dw.h index c35778cb1c5..a3c6329bd87 100644 --- a/drivers/mspi/mspi_dw.h +++ b/drivers/mspi/mspi_dw.h @@ -66,19 +66,6 @@ #define ISR_RXFIS_BIT BIT(4) #define ISR_MSTIS_BIT BIT(5) -/* RISR - Raw Interrupt Status Register */ -#define RISR_TXEIR_BIT BIT(0) -#define RISR_TXOIR_BIT BIT(1) -#define RISR_RXUIR_BIT BIT(2) -#define RISR_RXOIR_BIT BIT(3) -#define RISR_RXFIR_BIT BIT(4) -#define RISR_MSTIR_BIT BIT(5) -#define RISR_XRXOIR_BIT BIT(6) -#define RISR_TXUIR_BIT BIT(7) -#define RISR_AXIER_BIT BIT(8) -#define RISR_SPITER_BIT BIT(10) -#define RISR_DONER_BIT BIT(11) - /* SPI_CTRLR0 - SPI Control Register */ #define SPI_CTRLR0_CLK_STRETCH_EN_BIT BIT(30) #define SPI_CTRLR0_XIP_PREFETCH_EN_BIT BIT(29) From 22b76b41a86d0803c98f05c88c7bc483194a1294 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 665/881] Revert "[nrf fromtree] drivers: mspi_dw: Improve transfer handling" This reverts commit 5b212c6e473fb7b2d89d59a7f4db9316111bce93. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 172 ++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 106 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 7df0cdd8a09..3254458d81d 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -19,6 +19,8 @@ LOG_MODULE_REGISTER(mspi_dw, CONFIG_MSPI_LOG_LEVEL); +#define DUMMY_BYTE 0xAA + #if defined(CONFIG_MSPI_XIP) struct xip_params { uint32_t read_cmd; @@ -149,9 +151,6 @@ static void tx_data(const struct device *dev, write_dr(dev, data); if (buf_pos >= buf_end) { - /* Set the threshold to 0 to get the next interrupt - * when the FIFO is completely emptied. - */ write_txftlr(dev, 0); break; } @@ -165,38 +164,35 @@ static void tx_data(const struct device *dev, dev_data->buf_pos = (uint8_t *)buf_pos; } -static bool tx_dummy_bytes(const struct device *dev) +static bool make_rx_cycles(const struct device *dev) { struct mspi_dw_data *dev_data = dev->data; const struct mspi_dw_config *dev_config = dev->config; - uint8_t fifo_room = dev_config->tx_fifo_depth_minus_1 + 1 - - FIELD_GET(TXFLR_TXTFL_MASK, read_txflr(dev)); uint16_t dummy_bytes = dev_data->dummy_bytes; - const uint8_t dummy_val = 0; - - if (dummy_bytes > fifo_room) { - dev_data->dummy_bytes = dummy_bytes - fifo_room; - - do { - write_dr(dev, dummy_val); - } while (--fifo_room); - - return false; - } + /* See tx_data(). */ + uint32_t room = 1; + uint8_t tx_fifo_depth = dev_config->tx_fifo_depth_minus_1 + 1; do { - write_dr(dev, dummy_val); - } while (--dummy_bytes); + write_dr(dev, DUMMY_BYTE); - /* Set the threshold to 0 to get the next interrupt when the FIFO is - * completely emptied. - */ - write_txftlr(dev, 0); + --dummy_bytes; + if (!dummy_bytes) { + dev_data->dummy_bytes = 0; + return true; + } - return true; + if (--room == 0) { + room = tx_fifo_depth + - FIELD_GET(TXFLR_TXTFL_MASK, read_txflr(dev)); + } + } while (room); + + dev_data->dummy_bytes = dummy_bytes; + return false; } -static bool read_rx_fifo(const struct device *dev, +static void read_rx_fifo(const struct device *dev, const struct mspi_xfer_packet *packet) { struct mspi_dw_data *dev_data = dev->data; @@ -227,8 +223,9 @@ static bool read_rx_fifo(const struct device *dev, } if (buf_pos >= buf_end) { + dev_data->bytes_to_discard = bytes_to_discard; dev_data->buf_pos = buf_pos; - return true; + return; } } @@ -245,7 +242,6 @@ static bool read_rx_fifo(const struct device *dev, dev_data->bytes_to_discard = bytes_to_discard; dev_data->buf_pos = buf_pos; - return false; } static void mspi_dw_isr(const struct device *dev) @@ -253,49 +249,32 @@ static void mspi_dw_isr(const struct device *dev) struct mspi_dw_data *dev_data = dev->data; const struct mspi_xfer_packet *packet = &dev_data->xfer.packets[dev_data->packets_done]; - bool finished = false; + uint32_t int_status = read_isr(dev); - if (packet->dir == MSPI_TX) { - if (dev_data->buf_pos < dev_data->buf_end) { - tx_data(dev, packet); - } else { - /* It may happen that at this point the controller is - * still shifting out the last frame (the last interrupt - * occurs when the TX FIFO is empty). Wait if it signals - * that it is busy. - */ - while (read_sr(dev) & SR_BUSY_BIT) { - } + if (int_status & ISR_RXFIS_BIT) { + read_rx_fifo(dev, packet); + } - finished = true; + if (dev_data->buf_pos >= dev_data->buf_end) { + write_imr(dev, 0); + /* It may happen that at this point the controller is still + * shifting out the last frame (the last interrupt occurs when + * the TX FIFO is empty). Wait if it signals that it is busy. + */ + while (read_sr(dev) & SR_BUSY_BIT) { } - } else { - uint32_t int_status = read_isr(dev); - - do { - if (int_status & ISR_RXFIS_BIT) { - if (read_rx_fifo(dev, packet)) { - finished = true; - break; - } - int_status = read_isr(dev); - } - - if (int_status & ISR_TXEIS_BIT) { - if (tx_dummy_bytes(dev)) { + k_sem_give(&dev_data->finished); + } else { + if (int_status & ISR_TXEIS_BIT) { + if (dev_data->dummy_bytes) { + if (make_rx_cycles(dev)) { write_imr(dev, IMR_RXFIM_BIT); } - - int_status = read_isr(dev); + } else { + tx_data(dev, packet); } - } while (int_status); - } - - if (finished) { - write_imr(dev, 0); - - k_sem_give(&dev_data->finished); + } } vendor_specific_irq_clear(dev); @@ -770,6 +749,7 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) (dev_data->xip_enabled != 0), (false)); unsigned int key; + uint8_t tx_fifo_threshold; uint32_t packet_frames; uint32_t imr; int rc = 0; @@ -781,7 +761,6 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) } dev_data->dummy_bytes = 0; - dev_data->bytes_to_discard = 0; dev_data->ctrlr0 &= ~CTRLR0_TMOD_MASK & ~CTRLR0_DFS_MASK; @@ -822,6 +801,7 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) dev_data->xfer.tx_dummy); write_rxftlr(dev, 0); + tx_fifo_threshold = dev_config->tx_fifo_threshold; } else { uint32_t tmod; uint8_t rx_fifo_threshold; @@ -848,12 +828,14 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) imr = IMR_TXEIM_BIT | IMR_RXFIM_BIT; tmod = CTRLR0_TMOD_TX_RX; + tx_fifo_threshold = dev_config->tx_fifo_threshold; /* For standard SPI, only 1-byte frames are used. */ rx_fifo_threshold = MIN(rx_total_bytes - 1, dev_config->rx_fifo_threshold); } else { imr = IMR_RXFIM_BIT; tmod = CTRLR0_TMOD_RX; + tx_fifo_threshold = 0; rx_fifo_threshold = MIN(packet_frames - 1, dev_config->rx_fifo_threshold); } @@ -899,49 +881,23 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) dev_data->buf_pos = packet->data_buf; dev_data->buf_end = &packet->data_buf[packet->num_bytes]; - /* Set the TX FIFO threshold and its transmit start level. */ - if (packet->num_bytes) { - /* If there is some data to send/receive, set the threshold to - * the value configured for the driver instance and the start - * level to the maximum possible value (it will be updated later - * in tx_fifo() or tx_dummy_bytes() when TX is to be finished). - * This helps avoid a situation when the TX FIFO becomes empty - * before the transfer is complete and the SSI core finishes the - * transaction and deactivates the CE line. This could occur - * right before the data phase in enhanced SPI modes, when the - * clock stretching feature does not work yet, or in Standard - * SPI mode, where the clock stretching is not available at all. - */ - write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, - dev_config->tx_fifo_depth_minus_1) | - FIELD_PREP(TXFTLR_TFT_MASK, - dev_config->tx_fifo_threshold)); - } else { - uint32_t total_tx_entries = 0; + if ((imr & IMR_TXEIM_BIT) && dev_data->buf_pos < dev_data->buf_end) { + uint32_t start_level = tx_fifo_threshold; - /* It the whole transfer is to contain only the command and/or - * address, set up the transfer to start right after entries - * for those appear in the TX FIFO, and the threshold to 0, - * so that the interrupt occurs when the TX FIFO gets emptied. - */ - if (dev_data->xfer.cmd_length) { - if (dev_data->standard_spi) { - total_tx_entries += dev_data->xfer.cmd_length; - } else { - total_tx_entries += 1; - } - } + if (dev_data->dummy_bytes) { + uint32_t tx_total = dev_data->bytes_to_discard + + dev_data->dummy_bytes; - if (dev_data->xfer.addr_length) { - if (dev_data->standard_spi) { - total_tx_entries += dev_data->xfer.addr_length; - } else { - total_tx_entries += 1; + if (start_level > tx_total - 1) { + start_level = tx_total - 1; } } - write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, - total_tx_entries - 1)); + write_txftlr(dev, + FIELD_PREP(TXFTLR_TXFTHR_MASK, start_level) | + FIELD_PREP(TXFTLR_TFT_MASK, tx_fifo_threshold)); + } else { + write_txftlr(dev, 0); } /* Ensure that there will be no interrupt from the controller yet. */ @@ -949,10 +905,6 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) /* Enable the controller. This must be done before DR is written. */ write_ssienr(dev, SSIENR_SSIC_EN_BIT); - /* Since the FIFO depth in SSI is always at least 8, it can be safely - * assumed that the command and address fields (max. 2 and 4 bytes, - * respectively) can be written here before the TX FIFO gets filled up. - */ if (dev_data->standard_spi) { if (dev_data->xfer.cmd_length) { tx_control_field(dev, packet->cmd, @@ -973,6 +925,14 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) } } + if (dev_data->dummy_bytes) { + if (make_rx_cycles(dev)) { + imr = IMR_RXFIM_BIT; + } + } else if (packet->dir == MSPI_TX && packet->num_bytes) { + tx_data(dev, packet); + } + /* Enable interrupts now and wait until the packet is done. */ write_imr(dev, imr); From 21b1ec1b9f12a512ab694783828eb07f35ee5630 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 666/881] Revert "[nrf fromtree] drivers: mspi_dw: Add waiting for clock in nRF EXMIF specific resume" This reverts commit 2c537a2b6664163e0894dcf14ae83c1e0bb245eb. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 3 +-- drivers/mspi/mspi_dw_vendor_specific.h | 11 ----------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 3254458d81d..21088ad1bf6 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -16,6 +16,7 @@ #include #include "mspi_dw.h" +#include "mspi_dw_vendor_specific.h" LOG_MODULE_REGISTER(mspi_dw, CONFIG_MSPI_LOG_LEVEL); @@ -115,8 +116,6 @@ DEFINE_MM_REG_WR(xip_write_wrap_inst, 0x144) DEFINE_MM_REG_WR(xip_write_ctrl, 0x148) #endif -#include "mspi_dw_vendor_specific.h" - static void tx_data(const struct device *dev, const struct mspi_xfer_packet *packet) { diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index e34d8a5db60..4913e536c92 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -33,17 +33,6 @@ static inline void vendor_specific_resume(const struct device *dev) ARG_UNUSED(dev); NRF_EXMIF->TASKS_START = 1; - - /* Try to write an SSI register and wait until the write is successful - * to ensure that the clock that drives the SSI core is ready. - */ - uint32_t rxftlr = read_rxftlr(dev); - uint32_t rxftlr_mod = rxftlr ^ 1; - - do { - write_rxftlr(dev, rxftlr_mod); - rxftlr = read_rxftlr(dev); - } while (rxftlr != rxftlr_mod); } static inline void vendor_specific_irq_clear(const struct device *dev) From ff73f82b937cb393799181dba8e6339d081a9f79 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 667/881] Revert "[nrf fromtree] drivers: mspi_dw: Apply a few minor corrections" This reverts commit 58efe6efd66b05a54b62406ed4ba759f06060938. Signed-off-by: Jukka Rissanen --- drivers/mspi/mspi_dw.c | 21 ++++++--------------- drivers/mspi/mspi_dw.h | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 21088ad1bf6..39cf463f4be 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -372,7 +372,7 @@ static bool apply_cmd_length(struct mspi_dw_data *dev_data, uint32_t cmd_length) SPI_CTRLR0_INST_L16); break; default: - LOG_ERR("Command length %u not supported", cmd_length); + LOG_ERR("Command length %d not supported", cmd_length); return false; } @@ -382,11 +382,6 @@ static bool apply_cmd_length(struct mspi_dw_data *dev_data, uint32_t cmd_length) static bool apply_addr_length(struct mspi_dw_data *dev_data, uint32_t addr_length) { - if (addr_length > 4) { - LOG_ERR("Address length %u not supported", addr_length); - return false; - } - dev_data->spi_ctrlr0 |= FIELD_PREP(SPI_CTRLR0_ADDR_L_MASK, addr_length * 2); @@ -498,7 +493,7 @@ static bool apply_xip_cmd_length(const struct mspi_dw_data *dev_data, XIP_WRITE_CTRL_INST_L16); break; default: - LOG_ERR("Command length %u not supported", cmd_length); + LOG_ERR("Command length %d not supported", cmd_length); return false; } @@ -510,11 +505,6 @@ static bool apply_xip_addr_length(const struct mspi_dw_data *dev_data, { uint8_t addr_length = dev_data->xip_params_active.addr_length; - if (addr_length > 4) { - LOG_ERR("Address length %u not supported", addr_length); - return false; - } - ctrl->read |= FIELD_PREP(XIP_CTRL_ADDR_L_MASK, addr_length * 2); ctrl->write |= FIELD_PREP(XIP_WRITE_CTRL_ADDR_L_MASK, addr_length * 2); @@ -980,7 +970,8 @@ static int _api_transceive(const struct device *dev, struct mspi_dw_data *dev_data = dev->data; int rc; - dev_data->spi_ctrlr0 &= ~SPI_CTRLR0_INST_L_MASK + dev_data->spi_ctrlr0 &= ~SPI_CTRLR0_WAIT_CYCLES_MASK + & ~SPI_CTRLR0_INST_L_MASK & ~SPI_CTRLR0_ADDR_L_MASK; if (!apply_cmd_length(dev_data, req->cmd_length) || @@ -1100,8 +1091,8 @@ static int _api_xip_config(const struct device *dev, return -EINVAL; } - if (params->rx_dummy > XIP_CTRL_WAIT_CYCLES_MAX || - params->tx_dummy > XIP_WRITE_CTRL_WAIT_CYCLES_MAX) { + if (params->rx_dummy > SPI_CTRLR0_WAIT_CYCLES_MAX || + params->tx_dummy > SPI_CTRLR0_WAIT_CYCLES_MAX) { LOG_ERR("Unsupported RX (%u) or TX (%u) dummy cycles", params->rx_dummy, params->tx_dummy); return -EINVAL; diff --git a/drivers/mspi/mspi_dw.h b/drivers/mspi/mspi_dw.h index a3c6329bd87..bd81d061e09 100644 --- a/drivers/mspi/mspi_dw.h +++ b/drivers/mspi/mspi_dw.h @@ -127,6 +127,21 @@ #define XIP_CTRL_FRF_QUAD 2UL #define XIP_CTRL_FRF_OCTAL 3UL +/* XIP_CTRL - XIP Control Register */ +#define XIP_CTRL_XIP_PREFETCH_EN_BIT BIT(28) +#define XIP_CTRL_XIP_MBL_MASK GENMASK(27, 26) +#define XIP_CTRL_XIP_MBL_2 0UL +#define XIP_CTRL_XIP_MBL_4 1UL +#define XIP_CTRL_XIP_MBL_8 2UL +#define XIP_CTRL_XIP_MBL_16 3UL +#define XIP_CTRL_XIP_HYBERBUS_EN_BIT BIT(24) +#define XIP_CTRL_CONT_XFER_EN_BIT BIT(23) +#define XIP_CTRL_INST_EN_BIT BIT(22) +#define XIP_CTRL_RXDS_EN_BIT BIT(21) +#define XIP_CTRL_INST_DDR_EN_BIT BIT(20) +#define XIP_CTRL_DDR_EN_BIT BIT(19) +#define XIP_CTRL_DFS_HC_BIT BIT(18) + /* XIP_WRITE_CTRL - XIP Write Control Register */ #define XIP_WRITE_CTRL_WAIT_CYCLES_MASK GENMASK(20, 16) #define XIP_WRITE_CTRL_WAIT_CYCLES_MAX BIT_MASK(5) From 5cbc951b2c1f72ba678f6e87524733c7b3e0b2bc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 668/881] Revert "[nrf fromtree] drivers: flash_mspi_nor: Omit quad_enable_set() when QER is set to NONE" This reverts commit f8b7ffa66d60f44a590d0f22da2f65b5117a2917. Signed-off-by: Jukka Rissanen --- drivers/flash/flash_mspi_nor.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index b7ca6341d3a..e297b01f5d9 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -567,20 +567,15 @@ static int default_io_mode(const struct device *dev) enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode; int rc = 0; - if (dev_config->dw15_qer != JESD216_DW15_QER_VAL_NONE) { - /* For Quad 1-1-4 and 1-4-4, entering or leaving mode is defined - * in JEDEC216 BFP DW15 QER - */ - if (io_mode == MSPI_IO_MODE_SINGLE) { - rc = quad_enable_set(dev, false); - } else if (io_mode == MSPI_IO_MODE_QUAD_1_1_4 || - io_mode == MSPI_IO_MODE_QUAD_1_4_4) { - rc = quad_enable_set(dev, true); - } + /* For Quad 1-1-4 and 1-4-4, entering or leaving mode is defined in JEDEC216 BFP DW15 QER */ + if (io_mode == MSPI_IO_MODE_SINGLE) { + rc = quad_enable_set(dev, false); + } else if ((io_mode == MSPI_IO_MODE_QUAD_1_1_4) || (io_mode == MSPI_IO_MODE_QUAD_1_4_4)) { + rc = quad_enable_set(dev, true); + } - if (rc < 0) { - LOG_ERR("Failed to modify Quad Enable bit: %d", rc); - } + if (rc < 0) { + LOG_ERR("Failed to modify Quad Enable bit: %d", rc); } if ((dev_config->quirks != NULL) && (dev_config->quirks->post_switch_mode != NULL)) { @@ -651,10 +646,8 @@ static int flash_chip_init(const struct device *dev) /* Some chips reuse RESET pin for data in Quad modes: * force single line mode before resetting. */ - if (dev_config->dw15_qer != JESD216_DW15_QER_VAL_NONE && - (io_mode == MSPI_IO_MODE_SINGLE || - io_mode == MSPI_IO_MODE_QUAD_1_1_4 || - io_mode == MSPI_IO_MODE_QUAD_1_4_4)) { + if ((io_mode == MSPI_IO_MODE_SINGLE) || (io_mode == MSPI_IO_MODE_QUAD_1_1_4) || + (io_mode == MSPI_IO_MODE_QUAD_1_4_4)) { rc = quad_enable_set(dev, false); if (rc < 0) { From 3cdce0265fd73ecab95be44d68cbf41e905dfdfd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 669/881] Revert "[nrf fromtree] drivers: flash: nrf_qspi_nor: Handle properly multiple XIP users" This reverts commit e9002cf6ad6d7a04662395d55e25b846baa5adbe. Signed-off-by: Jukka Rissanen --- drivers/flash/nrf_qspi_nor.c | 65 +++++++++++++----------------------- 1 file changed, 23 insertions(+), 42 deletions(-) diff --git a/drivers/flash/nrf_qspi_nor.c b/drivers/flash/nrf_qspi_nor.c index 34b36b4d7e3..12eeb3f4a3e 100644 --- a/drivers/flash/nrf_qspi_nor.c +++ b/drivers/flash/nrf_qspi_nor.c @@ -41,7 +41,7 @@ struct qspi_nor_data { */ volatile bool ready; #endif /* CONFIG_MULTITHREADING */ - uint32_t xip_users; + bool xip_enabled; }; struct qspi_nor_config { @@ -313,7 +313,7 @@ static void qspi_acquire(const struct device *dev) qspi_lock(dev); - if (dev_data->xip_users == 0) { + if (!dev_data->xip_enabled) { qspi_clock_div_change(); pm_device_busy_set(dev); @@ -331,7 +331,7 @@ static void qspi_release(const struct device *dev) deactivate = atomic_dec(&dev_data->usage_count) == 1; #endif - if (dev_data->xip_users == 0) { + if (!dev_data->xip_enabled) { qspi_clock_div_restore(); if (deactivate) { @@ -1344,54 +1344,35 @@ static int qspi_nor_pm_action(const struct device *dev, } #endif /* CONFIG_PM_DEVICE */ -static void on_xip_enable(const struct device *dev) -{ -#if NRF_QSPI_HAS_XIPEN - nrf_qspi_xip_set(NRF_QSPI, true); -#endif - (void)nrfx_qspi_activate(false); -} - -static void on_xip_disable(const struct device *dev) -{ - /* It turns out that when the QSPI peripheral is deactivated - * after a XIP transaction, it cannot be later successfully - * reactivated and an attempt to perform another XIP transaction - * results in the CPU being hung; even a debug session cannot be - * started then and the SoC has to be recovered. - * As a workaround, at least until the cause of such behavior - * is fully clarified, perform a simple non-XIP transaction - * (a read of the status register) before deactivating the QSPI. - * This prevents the issue from occurring. - */ - (void)qspi_rdsr(dev, 1); - -#if NRF_QSPI_HAS_XIPEN - nrf_qspi_xip_set(NRF_QSPI, false); -#endif -} - void z_impl_nrf_qspi_nor_xip_enable(const struct device *dev, bool enable) { struct qspi_nor_data *dev_data = dev->data; + if (dev_data->xip_enabled == enable) { + return; + } + qspi_acquire(dev); +#if NRF_QSPI_HAS_XIPEN + nrf_qspi_xip_set(NRF_QSPI, enable); +#endif if (enable) { - if (dev_data->xip_users == 0) { - on_xip_enable(dev); - } - - ++dev_data->xip_users; - } else if (dev_data->xip_users == 0) { - LOG_ERR("Unbalanced XIP disabling"); + (void)nrfx_qspi_activate(false); } else { - --dev_data->xip_users; - - if (dev_data->xip_users == 0) { - on_xip_disable(dev); - } + /* It turns out that when the QSPI peripheral is deactivated + * after a XIP transaction, it cannot be later successfully + * reactivated and an attempt to perform another XIP transaction + * results in the CPU being hung; even a debug session cannot be + * started then and the SoC has to be recovered. + * As a workaround, at least until the cause of such behavior + * is fully clarified, perform a simple non-XIP transaction + * (a read of the status register) before deactivating the QSPI. + * This prevents the issue from occurring. + */ + (void)qspi_rdsr(dev, 1); } + dev_data->xip_enabled = enable; qspi_release(dev); } From 93bbd6a5a4d5cd7230095bbc68fa159c582c4c1c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 670/881] Revert "[nrf fromtree] drivers: gpio_nrfx: Free channel when changing mode" This reverts commit 542b84305fd05720a37f1d323eb75e33f07a2607. Signed-off-by: Jukka Rissanen --- drivers/gpio/gpio_nrfx.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index b6548ed22d5..39377d7b777 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -444,15 +444,6 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, } trigger_config.p_in_channel = &ch; - } else { - /* If edge mode with channel was previously used and we are changing to sense or - * level triggered, we must free the channel. - */ - err = nrfx_gpiote_channel_get(&cfg->gpiote, abs_pin, &ch); - if (err == NRFX_SUCCESS) { - err = nrfx_gpiote_channel_free(&cfg->gpiote, ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); - } } err = nrfx_gpiote_input_configure(&cfg->gpiote, abs_pin, &input_pin_config); From bf61e71caff6560e08001d80201542fec8d08700 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 671/881] Revert "[nrf fromtree] net: openthread: Add missing include for logging in diag.c" This reverts commit 2b67e55872094d6df44748974c5c0928bbe2b68d. Signed-off-by: Jukka Rissanen --- modules/openthread/platform/diag.c | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/openthread/platform/diag.c b/modules/openthread/platform/diag.c index afa09c7e68d..74781cad4a1 100644 --- a/modules/openthread/platform/diag.c +++ b/modules/openthread/platform/diag.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include "platform-zephyr.h" From 9fd593ca120be4dbced0a36395da817d92369d1c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 672/881] Revert "[nrf fromtree] tests: drivers: i2s: Run I2S tests on nRF54H20" This reverts commit 6aacec8e810878e82b5395254e0bbf4d4c5f3eb0. Signed-off-by: Jukka Rissanen --- tests/drivers/i2s/i2s_api/testcase.yaml | 13 ------------- tests/drivers/i2s/i2s_speed/testcase.yaml | 15 --------------- 2 files changed, 28 deletions(-) diff --git a/tests/drivers/i2s/i2s_api/testcase.yaml b/tests/drivers/i2s/i2s_api/testcase.yaml index 5b36b91c8fe..1932607d655 100644 --- a/tests/drivers/i2s/i2s_api/testcase.yaml +++ b/tests/drivers/i2s/i2s_api/testcase.yaml @@ -10,7 +10,6 @@ tests: - mcx_n9xx_evk/mcxn947/cpu0 - mimxrt595_evk/mimxrt595s/cm33 - mimxrt685_evk/mimxrt685s/cm33 - - nrf54h20dk/nrf54h20/cpuapp drivers.i2s.gpio_loopback: depends_on: - i2s @@ -25,17 +24,5 @@ tests: - mcx_n9xx_evk/mcxn947/cpu0 - mimxrt595_evk/mimxrt595s/cm33 - mimxrt685_evk/mimxrt685s/cm33 - - nrf54h20dk/nrf54h20/cpuapp harness_config: fixture: gpio_loopback - drivers.i2s.gpio_loopback.nrf54h: - depends_on: i2s - tags: - - drivers - - userspace - harness_config: - fixture: i2s_loopback - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp diff --git a/tests/drivers/i2s/i2s_speed/testcase.yaml b/tests/drivers/i2s/i2s_speed/testcase.yaml index 56065f5ef62..6bc15a41364 100644 --- a/tests/drivers/i2s/i2s_speed/testcase.yaml +++ b/tests/drivers/i2s/i2s_speed/testcase.yaml @@ -5,8 +5,6 @@ tests: - drivers - i2s filter: not CONFIG_I2S_TEST_USE_GPIO_LOOPBACK - platform_exclude: - - nrf54h20dk/nrf54h20/cpuapp drivers.i2s.speed.gpio_loopback: depends_on: - i2s @@ -15,8 +13,6 @@ tests: - drivers - i2s filter: CONFIG_I2S_TEST_USE_GPIO_LOOPBACK - platform_exclude: - - nrf54h20dk/nrf54h20/cpuapp harness: ztest harness_config: fixture: gpio_loopback @@ -33,14 +29,3 @@ tests: fixture: gpio_loopback extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay" platform_allow: nrf5340dk/nrf5340/cpuapp - drivers.i2s.speed.gpio_loopback.nrf54h: - depends_on: i2s - tags: - - drivers - - i2s - harness_config: - fixture: i2s_loopback - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp From 80d90579042783b1454829556d5df38380cc9d17 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:35 +0300 Subject: [PATCH 673/881] Revert "[nrf fromtree] drivers: i2c: Support i2c23 and i2c24 instances" This reverts commit 5e6a0881d299c6417eadb7198caf000248961550. Signed-off-by: Jukka Rissanen --- drivers/i2c/Kconfig.nrfx | 4 ---- drivers/i2c/i2c_nrfx_twim.c | 8 -------- drivers/i2c/i2c_nrfx_twim_rtio.c | 8 -------- drivers/i2c/i2c_nrfx_twis.c | 8 -------- modules/hal_nordic/nrfx/Kconfig | 20 -------------------- modules/hal_nordic/nrfx/nrfx_kconfig.h | 12 ------------ soc/nordic/common/Kconfig.peripherals | 12 ------------ soc/nordic/validate_base_addresses.c | 2 -- 8 files changed, 74 deletions(-) diff --git a/drivers/i2c/Kconfig.nrfx b/drivers/i2c/Kconfig.nrfx index 54d53363674..2213175d5d6 100644 --- a/drivers/i2c/Kconfig.nrfx +++ b/drivers/i2c/Kconfig.nrfx @@ -30,8 +30,6 @@ config I2C_NRFX_TWIM select NRFX_TWIM20 if HAS_HW_NRF_TWIM20 select NRFX_TWIM21 if HAS_HW_NRF_TWIM21 select NRFX_TWIM22 if HAS_HW_NRF_TWIM22 - select NRFX_TWIM23 if HAS_HW_NRF_TWIM23 - select NRFX_TWIM24 if HAS_HW_NRF_TWIM24 select NRFX_TWIM30 if HAS_HW_NRF_TWIM30 select NRFX_TWIM120 if HAS_HW_NRF_TWIM120 select NRFX_TWIM130 if HAS_HW_NRF_TWIM130 @@ -63,8 +61,6 @@ config I2C_NRFX_TWIS select NRFX_TWIS20 if HAS_HW_NRF_TWIS20 select NRFX_TWIS21 if HAS_HW_NRF_TWIS21 select NRFX_TWIS22 if HAS_HW_NRF_TWIS22 - select NRFX_TWIS23 if HAS_HW_NRF_TWIS23 - select NRFX_TWIS24 if HAS_HW_NRF_TWIS24 select NRFX_TWIS30 if HAS_HW_NRF_TWIS30 select NRFX_TWIS130 if HAS_HW_NRF_TWIS130 select NRFX_TWIS131 if HAS_HW_NRF_TWIS131 diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index d5b619bfc5a..953a03a7b73 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -323,14 +323,6 @@ I2C_NRFX_TWIM_DEVICE(21); I2C_NRFX_TWIM_DEVICE(22); #endif -#ifdef CONFIG_HAS_HW_NRF_TWIM23 -I2C_NRFX_TWIM_DEVICE(23); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM24 -I2C_NRFX_TWIM_DEVICE(24); -#endif - #ifdef CONFIG_HAS_HW_NRF_TWIM30 I2C_NRFX_TWIM_DEVICE(30); #endif diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 6a7504dbd62..68d93a3a06e 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -314,14 +314,6 @@ I2C_NRFX_TWIM_RTIO_DEVICE(21); I2C_NRFX_TWIM_RTIO_DEVICE(22); #endif -#ifdef CONFIG_HAS_HW_NRF_TWIM23 -I2C_NRFX_TWIM_RTIO_DEVICE(23); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM24 -I2C_NRFX_TWIM_RTIO_DEVICE(24); -#endif - #ifdef CONFIG_HAS_HW_NRF_TWIM30 I2C_NRFX_TWIM_RTIO_DEVICE(30); #endif diff --git a/drivers/i2c/i2c_nrfx_twis.c b/drivers/i2c/i2c_nrfx_twis.c index c37c51ddd74..9e2b0759f2a 100644 --- a/drivers/i2c/i2c_nrfx_twis.c +++ b/drivers/i2c/i2c_nrfx_twis.c @@ -362,14 +362,6 @@ SHIM_NRF_TWIS_DEVICE_DEFINE(21); SHIM_NRF_TWIS_DEVICE_DEFINE(22); #endif -#ifdef CONFIG_HAS_HW_NRF_TWIS23 -SHIM_NRF_TWIS_DEVICE_DEFINE(23); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS24 -SHIM_NRF_TWIS_DEVICE_DEFINE(24); -#endif - #ifdef CONFIG_HAS_HW_NRF_TWIS30 SHIM_NRF_TWIS_DEVICE_DEFINE(30); #endif diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 80610599e60..08c5df62599 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -921,16 +921,6 @@ config NRFX_TWIM22 depends on $(dt_nodelabel_exists,i2c22) select NRFX_TWIM -config NRFX_TWIM23 - bool "TWIM23 driver instance" - depends on $(dt_nodelabel_exists,i2c23) - select NRFX_TWIM - -config NRFX_TWIM24 - bool "TWIM24 driver instance" - depends on $(dt_nodelabel_exists,i2c24) - select NRFX_TWIM - config NRFX_TWIM30 bool "TWIM30 driver instance" depends on $(dt_nodelabel_exists,i2c30) @@ -1019,16 +1009,6 @@ config NRFX_TWIS22 depends on $(dt_nodelabel_exists,i2c22) select NRFX_TWIS -config NRFX_TWIS23 - bool "TWIS23 driver instance" - depends on $(dt_nodelabel_exists,i2c23) - select NRFX_TWIS - -config NRFX_TWIS24 - bool "TWIS24 driver instance" - depends on $(dt_nodelabel_exists,i2c24) - select NRFX_TWIS - config NRFX_TWIS30 bool "TWIS30 driver instance" depends on $(dt_nodelabel_exists,i2c30) diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 191855b3ff0..ed1948a3931 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -759,12 +759,6 @@ #ifdef CONFIG_NRFX_TWIM22 #define NRFX_TWIM22_ENABLED 1 #endif -#ifdef CONFIG_NRFX_TWIM23 -#define NRFX_TWIM23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM24 -#define NRFX_TWIM24_ENABLED 1 -#endif #ifdef CONFIG_NRFX_TWIM30 #define NRFX_TWIM30_ENABLED 1 #endif @@ -829,12 +823,6 @@ #ifdef CONFIG_NRFX_TWIS22 #define NRFX_TWIS22_ENABLED 1 #endif -#ifdef CONFIG_NRFX_TWIS23 -#define NRFX_TWIS23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS24 -#define NRFX_TWIS24_ENABLED 1 -#endif #ifdef CONFIG_NRFX_TWIS30 #define NRFX_TWIS30_ENABLED 1 #endif diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 083fcc4e089..900effed141 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -514,12 +514,6 @@ config HAS_HW_NRF_TWIM21 config HAS_HW_NRF_TWIM22 def_bool $(dt_nodelabel_enabled_with_compat,i2c22,$(DT_COMPAT_NORDIC_NRF_TWIM)) -config HAS_HW_NRF_TWIM23 - def_bool $(dt_nodelabel_enabled_with_compat,i2c23,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM24 - def_bool $(dt_nodelabel_enabled_with_compat,i2c24,$(DT_COMPAT_NORDIC_NRF_TWIM)) - config HAS_HW_NRF_TWIM30 def_bool $(dt_nodelabel_enabled_with_compat,i2c30,$(DT_COMPAT_NORDIC_NRF_TWIM)) @@ -571,12 +565,6 @@ config HAS_HW_NRF_TWIS21 config HAS_HW_NRF_TWIS22 def_bool $(dt_nodelabel_enabled_with_compat,i2c22,$(DT_COMPAT_NORDIC_NRF_TWIS)) -config HAS_HW_NRF_TWIS23 - def_bool $(dt_nodelabel_enabled_with_compat,i2c23,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS24 - def_bool $(dt_nodelabel_enabled_with_compat,i2c24,$(DT_COMPAT_NORDIC_NRF_TWIS)) - config HAS_HW_NRF_TWIS30 def_bool $(dt_nodelabel_enabled_with_compat,i2c30,$(DT_COMPAT_NORDIC_NRF_TWIS)) diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 1c5c39f74ec..02413e3f174 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -199,8 +199,6 @@ CHECK_DT_REG(i2c3, NRF_TWIM3); CHECK_DT_REG(i2c20, NRF_TWIM20); CHECK_DT_REG(i2c21, NRF_TWIM21); CHECK_DT_REG(i2c22, NRF_TWIM22); -CHECK_DT_REG(i2c23, NRF_TWIM23); -CHECK_DT_REG(i2c24, NRF_TWIM24); CHECK_DT_REG(i2c30, NRF_TWIM30); CHECK_DT_REG(i2c130, NRF_TWIM130); CHECK_DT_REG(i2c131, NRF_TWIM131); From eb37bdd095683d01d1bdb5de488b606beaa9edd0 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 674/881] Revert "[nrf fromtree] manifest: Update bsim to version v2.7" This reverts commit ea07de464e8e94723feab6389c418037660b6eba. Signed-off-by: Jukka Rissanen --- west.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/west.yml b/west.yml index d3a70e36867..594f7db44b4 100644 --- a/west.yml +++ b/west.yml @@ -37,7 +37,7 @@ manifest: remote: babblesim repo-path: base path: tools/bsim/components - revision: 2cfac3dca2071452ae481d115d8541880568753d + revision: d562cd57317d33531ee3655d84660c57b8dc64c9 groups: - babblesim - name: babblesim_ext_2G4_channel_NtNcable @@ -79,7 +79,7 @@ manifest: remote: babblesim repo-path: ext_2G4_libPhyComv1 path: tools/bsim/components/ext_2G4_libPhyComv1 - revision: e18e41e8e3fa9f996559ed98b9238a5702dcdd36 + revision: 15ae0f87fa049e04cbec48a866f3bc37d903f950 groups: - babblesim - name: babblesim_ext_2G4_modem_BLE_simple @@ -100,7 +100,7 @@ manifest: remote: babblesim repo-path: ext_2G4_phy_v1 path: tools/bsim/components/ext_2G4_phy_v1 - revision: 8964ed1eb94606c2ea555340907bdc5171793e65 + revision: dbfd6b068f3bde8e56dcea58b4e686a8efc01cbe groups: - babblesim - name: babblesim_ext_libCryptov1 @@ -112,7 +112,7 @@ manifest: - babblesim - name: bsim repo-path: babblesim-manifest - revision: 2ba22a0608ad9f46da1b96ee5121af357053c791 + revision: 193b8ba94cdc6ecbc3bb7fe80b87dee456e5eab0 path: tools/bsim groups: - babblesim From a1a49566d7c87d33848ee22be511e13f3fc959f5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 675/881] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit e5563ce2e0c022280b3feaa450e64afb935764e0. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 594f7db44b4..c394b576621 100644 --- a/west.yml +++ b/west.yml @@ -325,7 +325,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 968d55ff22579080466bf2f482596dd6e35361c6 + revision: 9eb489fdcde23d4f69ded78bca872bfc31b5ee79 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: 7cb2f44f46dfc86e4f97477ee90022944e138dd8 From fa6130fa11faf777aeedfe77fff93f36cbfa3cae Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 676/881] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit 3a87edf0416b7d0bcff8beb90dc1b576f3d36092. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index c394b576621..76ca9284ec8 100644 --- a/west.yml +++ b/west.yml @@ -325,7 +325,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 9eb489fdcde23d4f69ded78bca872bfc31b5ee79 + revision: c6296f600a6851bd652f207ab4908d339e1ce705 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: 7cb2f44f46dfc86e4f97477ee90022944e138dd8 From a355f474fa5d88abae03ea4b2f6435b3fd18f188 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 677/881] Revert "[nrf fromtree] tests: kernel: interrupt: Add ISR offset definitions for nrf9280" This reverts commit 23857cc300e7708a267e08a08be75ae9318cd5ee. Signed-off-by: Jukka Rissanen --- tests/kernel/interrupt/src/nested_irq.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/kernel/interrupt/src/nested_irq.c b/tests/kernel/interrupt/src/nested_irq.c index e1edfc3442f..3e6a798e604 100644 --- a/tests/kernel/interrupt/src/nested_irq.c +++ b/tests/kernel/interrupt/src/nested_irq.c @@ -66,12 +66,6 @@ #define IRQ0_LINE 14 #define IRQ1_LINE 15 -#define IRQ0_PRIO 1 -#define IRQ1_PRIO 2 -#elif defined(CONFIG_SOC_NRF9280_CPUPPR) -#define IRQ0_LINE 14 -#define IRQ1_LINE 15 - #define IRQ0_PRIO 1 #define IRQ1_PRIO 2 #else From 470f682784ba51747ce8b0b271815a7c2bf6720b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 678/881] Revert "[nrf fromtree] tests: kernel: gen_isr_table: Add ISR offset definitions for nrf9280" This reverts commit 49a70a2233f3d16691aaf928264bda4736d8e328. Signed-off-by: Jukka Rissanen --- tests/kernel/gen_isr_table/src/main.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/kernel/gen_isr_table/src/main.c b/tests/kernel/gen_isr_table/src/main.c index d3e3291573a..d6b92731fc5 100644 --- a/tests/kernel/gen_isr_table/src/main.c +++ b/tests/kernel/gen_isr_table/src/main.c @@ -31,11 +31,6 @@ extern uintptr_t _irq_vector_table[]; #define ISR3_OFFSET 15 #define ISR5_OFFSET 16 #define TRIG_CHECK_SIZE 17 -#elif defined(CONFIG_SOC_NRF9280_CPUPPR) -#define ISR1_OFFSET 14 -#define ISR3_OFFSET 15 -#define ISR5_OFFSET 16 -#define TRIG_CHECK_SIZE 17 #else #error "Target not supported" #endif From 4c6d9eabf95f4a17e5e7bf3a58cc37506b5d7f14 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 679/881] Revert "[nrf fromtree] tests: drivers: adc: Enable adc test for nrf9280 iron" This reverts commit b45da2ee2795c53540503bd7850193237dc30183. Signed-off-by: Jukka Rissanen --- .../boards/nrf9280pdk_nrf9280_common.dtsi | 43 ------------------- .../boards/nrf9280pdk_nrf9280_cpuapp.overlay | 40 ++++++++++++++++- .../nrf9280pdk_nrf9280_cpuapp_iron.overlay | 7 --- 3 files changed, 38 insertions(+), 52 deletions(-) delete mode 100644 tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_common.dtsi delete mode 100644 tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay diff --git a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_common.dtsi b/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_common.dtsi deleted file mode 100644 index d90e7fc93c1..00000000000 --- a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_common.dtsi +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -/ { - zephyr,user { - io-channels = <&adc 0>, <&adc 1>, <&adc 2>; - }; -}; - -&adc { - #address-cells = <1>; - #size-cells = <0>; - - channel@0 { - reg = <0>; - zephyr,gain = "ADC_GAIN_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; - zephyr,resolution = <10>; - }; - - channel@1 { - reg = <1>; - zephyr,gain = "ADC_GAIN_2"; - zephyr,reference = "ADC_REF_EXTERNAL0"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; - zephyr,resolution = <10>; - }; - - channel@2 { - reg = <2>; - zephyr,gain = "ADC_GAIN_2_3"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; - zephyr,resolution = <10>; - }; -}; diff --git a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay index cd9ca89b82a..d9c1f965add 100644 --- a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay +++ b/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay @@ -1,7 +1,43 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA */ -#include "nrf9280pdk_nrf9280_common.dtsi" +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1>, <&adc 2>; + }; +}; + +&adc { + #address-cells = <1>; + #size-cells = <0>; + + channel@0 { + reg = <0>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <10>; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_2"; + zephyr,reference = "ADC_REF_EXTERNAL0"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <10>; + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <10>; + }; +}; diff --git a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay deleted file mode 100644 index cd9ca89b82a..00000000000 --- a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -#include "nrf9280pdk_nrf9280_common.dtsi" From 64a871b12b1a46a69e7a010114aaa4b04395b7fc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 680/881] Revert "[nrf fromtree] tests: drivers: watchdog: Enable watchdog test for nrf9280 iron" This reverts commit 485f9d333cadafa94088b7119e43685edd41937c. Signed-off-by: Jukka Rissanen --- .../boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay deleted file mode 100644 index 102abfc8ef2..00000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "okay"; -}; From deedd71e8451d69bdb8a91d45d2d0e1132de6ef1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 681/881] Revert "[nrf fromtree] samples: watchdog: Add nrf9280 iron to sample" This reverts commit 822c4d9ab28a5dccf531c406cea9c0848b73db1e. Signed-off-by: Jukka Rissanen --- .../boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay diff --git a/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay deleted file mode 100644 index 102abfc8ef2..00000000000 --- a/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "okay"; -}; From aba1d7804902ffca038f1bbb0d08b4a0cba28bd5 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 682/881] Revert "[nrf fromtree] drivers: firmware: nrf_ironside: Update doxygen header for API." This reverts commit dd8cf228f04843ffc655974343ef877466858e19. Signed-off-by: Jukka Rissanen --- include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h index d769a319def..e6f2150b6e2 100644 --- a/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h +++ b/include/zephyr/drivers/firmware/nrf_ironside/cpuconf.h @@ -53,7 +53,7 @@ BUILD_ASSERT(IRONSIDE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); * @param cpu The CPU to be booted * @param vector_table Pointer to the vector table used to boot the CPU. * @param cpu_wait When this is true, the CPU will WAIT even if the CPU has clock. - * @param msg A message that can be placed in cpu's boot report. + * @param msg A message that can be placed in radiocore's boot report. * @param msg_size Size of the message in bytes. * * @note cpu_wait is only intended to be enabled for debug purposes From 61313c3bb7817591be9f3409ee1bc0e278794ccc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 683/881] Revert "[nrf fromtree] boards: nordic: add 'iron' board variant to application" This reverts commit 00e6cd3c040bf4379627057ea3fe413508e3f5ff. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf9280pdk/Kconfig.defconfig | 10 --- boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk | 8 +- boards/nordic/nrf9280pdk/board.yml | 2 - .../nrf9280pdk_nrf9280-ipc_conf_iron.dtsi | 30 ------- .../nrf9280pdk_nrf9280-memory_map_iron.dtsi | 79 ------------------- .../nrf9280pdk_nrf9280_cpuapp_iron.dts | 41 ---------- .../nrf9280pdk_nrf9280_cpuapp_iron.yaml | 23 ------ .../nrf9280pdk_nrf9280_cpuapp_iron_defconfig | 29 ------- 8 files changed, 3 insertions(+), 219 deletions(-) delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig diff --git a/boards/nordic/nrf9280pdk/Kconfig.defconfig b/boards/nordic/nrf9280pdk/Kconfig.defconfig index ae7cb48cbc3..d1252a0a3a2 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.defconfig +++ b/boards/nordic/nrf9280pdk/Kconfig.defconfig @@ -19,13 +19,3 @@ config ASSERT default n if ZTEST endif # BOARD_NRF9280PDK_NRF9280_CPUPPR - -if BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -config FLASH_LOAD_OFFSET - default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) if !USE_DT_CODE_PARTITION - -endif # BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON diff --git a/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk b/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk index d66fe31da88..54865a1b235 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk +++ b/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk @@ -2,9 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF9280PDK - select SOC_NRF9280_CPUAPP if (BOARD_NRF9280PDK_NRF9280_CPUAPP || \ - BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON) + select SOC_NRF9280_CPUAPP if BOARD_NRF9280PDK_NRF9280_CPUAPP select SOC_NRF9280_CPURAD if BOARD_NRF9280PDK_NRF9280_CPURAD - select SOC_NRF9280_CPUPPR if (BOARD_NRF9280PDK_NRF9280_CPUPPR || \ - BOARD_NRF9280PDK_NRF9280_CPUPPR_XIP) - select SOC_NRF9280_IRON if BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON + select SOC_NRF9280_CPUPPR if BOARD_NRF9280PDK_NRF9280_CPUPPR || \ + BOARD_NRF9280PDK_NRF9280_CPUPPR_XIP diff --git a/boards/nordic/nrf9280pdk/board.yml b/boards/nordic/nrf9280pdk/board.yml index 2cce133d95c..963eae59ba0 100644 --- a/boards/nordic/nrf9280pdk/board.yml +++ b/boards/nordic/nrf9280pdk/board.yml @@ -7,5 +7,3 @@ board: variants: - name: xip cpucluster: cpuppr - - name: iron - cpucluster: cpuapp diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi deleted file mode 100644 index a44db40538d..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* This file is to be merged with the original ipc_conf.dtsi in the future. */ - -/ { - ipc { - /delete-node/ ipc-1-2; - /delete-node/ ipc-1-3; - - cpusec_cpuapp_ipc: ipc-1-2 { - compatible = "nordic,ironside-call"; - memory-region = <&cpusec_cpuapp_ipc_shm>; - mboxes = <&cpusec_bellboard 12>, - <&cpuapp_bellboard 0>; - status = "disabled"; - }; - - cpusec_cpurad_ipc: ipc-1-3 { - compatible = "nordic,ironside-call"; - memory-region = <&cpusec_cpurad_ipc_shm>; - mboxes = <&cpusec_bellboard 18>, - <&cpurad_bellboard 0>; - status = "disabled"; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi deleted file mode 100644 index aa95021d887..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* This file is to be merged with the original memory_map.dtsi in the future. - * The following nodes will be replaced: - */ -/delete-node/ &cpuapp_cpusys_ipc_shm; -/delete-node/ &cpusec_cpuapp_ipc_shm; -/delete-node/ &cpusys_cpuapp_ipc_shm; -/delete-node/ &cpuapp_rw_partitions; -/delete-node/ &cpuapp_rx_partitions; -/delete-node/ &cpurad_rx_partitions; - -/ { - reserved-memory { - cpuapp_cpusys_ipc_shm: memory@2f88f600 { - reg = <0x2f88f600 0x80>; - }; - - cpusys_cpuapp_ipc_shm: memory@2f88f680 { - reg = <0x2f88f680 0x80>; - }; - - cpusec_cpuapp_ipc_shm: memory@2f88fb80 { - reg = <0x2f88fb80 0x80>; - }; - - cpuapp_ironside_se_event_report: memory@2f88fc00 { - reg = <0x2f88fc00 0x100>; - }; - - cpuapp_ironside_se_boot_report: memory@2f88fd00 { - reg = <0x2f88fd00 0x200>; - }; - }; -}; - -&mram1x { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_boot_partition: partition@312000 { - reg = <0x312000 DT_SIZE_K(64)>; - }; - - cpuapp_slot0_partition: partition@322000 { - reg = <0x322000 DT_SIZE_K(336)>; - }; - - cpuapp_slot1_partition: partition@376000 { - reg = <0x376000 DT_SIZE_K(440)>; - }; - - cpuppr_code_partition: partition@3E4000 { - reg = <0x3E4000 DT_SIZE_K(64)>; - }; - - cpuflpr_code_partition: partition@3F4000 { - reg = <0x3F4000 DT_SIZE_K(48)>; - }; - - cpurad_slot0_partition: partition@400000 { - reg = <0x400000 DT_SIZE_K(336)>; - }; - - cpurad_slot1_partition: partition@454000 { - reg = <0x454000 DT_SIZE_K(336)>; - }; - - storage_partition: partition@600000 { - reg = <0x600000 DT_SIZE_K(40)>; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts deleted file mode 100644 index a3ca908f59d..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280_cpuapp.dts" -#include "nrf9280pdk_nrf9280-ipc_conf_iron.dtsi" -#include "nrf9280pdk_nrf9280-memory_map_iron.dtsi" - -/delete-node/ &cpusec_cpurad_ipc; - -/ { - chosen { - zephyr,code-partition = &slot0_partition; - zephyr,uart-mcumgr = &uart136; - }; -}; - -&cpusec_bellboard { - status = "okay"; -}; - -&cpusec_cpuapp_ipc { - mbox-names = "tx", "rx"; - status = "okay"; -}; - -ironside_se_boot_report: &cpuapp_ironside_se_boot_report {}; - -boot_partition: &cpuapp_boot_partition { - label = "mcuboot"; -}; - -slot0_partition: &cpuapp_slot0_partition { - label = "image-0"; -}; - -slot1_partition: &cpuapp_slot1_partition { - label = "image-1"; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml deleted file mode 100644 index 029f133993b..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf9280pdk/nrf9280/cpuapp/iron -name: nRF9280-DK-nRF9280-Application -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -sysbuild: true -ram: 512 -flash: 1024 -supported: - - adc - - counter - - gpio - - i2c - - pwm - - spi - - watchdog - - usbd diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig deleted file mode 100644 index 01f3bec3932..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# MPU-based null-pointer dereferencing detection cannot be applied -# as the (0x0 - 0x400) region is unmapped for this target. -CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y - -# Enable cache -CONFIG_CACHE_MANAGEMENT=y -CONFIG_EXTERNAL_CACHE=y - -# Enable GPIO -CONFIG_GPIO=y - -# UICR generation is not supported, and when reintroduced will not use nrf-regtool. -CONFIG_NRF_REGTOOL_GENERATE_UICR=n From b310623b31bec129f39b21a820d471f83dd1c0ac Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 684/881] Revert "[nrf fromtree] soc: nordic: add support of 'iron' variant to application" This reverts commit 1535701627fddf03bcb01f90e9c003d2156db25f. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf92/Kconfig | 4 ---- soc/nordic/nrf92/Kconfig.soc | 5 ----- soc/nordic/nrf92/soc.c | 6 +++++- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index a7769c00b6f..7fdf57d61c3 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -7,7 +7,6 @@ config SOC_SERIES_NRF92X select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS - select SOC_EARLY_INIT_HOOK if ARM select NRF_PLATFORM_HALTIUM config SOC_NRF9230_ENGB_CPUAPP @@ -49,6 +48,3 @@ config SOC_NRF9230_ENGB_CPURAD config SOC_NRF9230_ENGB_CPUPPR select RISCV_CORE_NORDIC_VPR - -config SOC_NRF9280_IRON - select EXPERIMENTAL if MCUBOOT diff --git a/soc/nordic/nrf92/Kconfig.soc b/soc/nordic/nrf92/Kconfig.soc index 49891687a29..99fc28643b7 100644 --- a/soc/nordic/nrf92/Kconfig.soc +++ b/soc/nordic/nrf92/Kconfig.soc @@ -62,10 +62,5 @@ config SOC_NRF9280_CPUPPR help nRF9280 CPUPPR -config SOC_NRF9280_IRON - bool - help - Indicates that local domain firmware is compatible with Nordic IRONside SE. - config SOC default "nrf9280" if SOC_NRF9280 diff --git a/soc/nordic/nrf92/soc.c b/soc/nordic/nrf92/soc.c index 3652b554711..d9a54e4f1aa 100644 --- a/soc/nordic/nrf92/soc.c +++ b/soc/nordic/nrf92/soc.c @@ -84,7 +84,7 @@ static int trim_hsfll(void) return 0; } -void soc_early_init_hook(void) +static int nordicsemi_nrf92_init(void) { sys_cache_instr_enable(); sys_cache_data_enable(); @@ -102,9 +102,13 @@ void soc_early_init_hook(void) nrf_spu_periph_perm_dmasec_set(spu, nrf_address_slave_get(ccm030_addr), true); #endif + + return 0; } void arch_busy_wait(uint32_t time_us) { nrfx_coredep_delay_us(time_us); } + +SYS_INIT(nordicsemi_nrf92_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); From e4bf13cf5de757220bbd07940e6c81c5eaab734f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 685/881] Revert "[nrf fromtree] usb: device_next: allow to use label as interface string descriptor" This reverts commit 89d7a6fbd5a773a985fee7315de82922c3ceaf2a. Signed-off-by: Jukka Rissanen --- dts/bindings/usb/zephyr,hid-device.yaml | 7 +++--- samples/subsys/usb/hid-keyboard/app.overlay | 2 +- .../usb/hid-keyboard/large_in_report.overlay | 2 +- .../subsys/usb/hid-mouse/usbd_next.overlay | 2 +- subsys/usb/device_next/class/usbd_hid.c | 23 ------------------- 5 files changed, 7 insertions(+), 29 deletions(-) diff --git a/dts/bindings/usb/zephyr,hid-device.yaml b/dts/bindings/usb/zephyr,hid-device.yaml index 1b055cf18d2..2d20b450986 100644 --- a/dts/bindings/usb/zephyr,hid-device.yaml +++ b/dts/bindings/usb/zephyr,hid-device.yaml @@ -8,10 +8,11 @@ compatible: "zephyr,hid-device" include: base.yaml properties: - label: + interface-name: + type: string description: | - The string defined by the label property is also used for the USB device - interface string descriptor. + HID device name. When this property is present, a USB device will use it + as the string descriptor of the interface. protocol-code: type: string diff --git a/samples/subsys/usb/hid-keyboard/app.overlay b/samples/subsys/usb/hid-keyboard/app.overlay index 0905e8850bf..0d3d2ee7bd8 100644 --- a/samples/subsys/usb/hid-keyboard/app.overlay +++ b/samples/subsys/usb/hid-keyboard/app.overlay @@ -7,7 +7,7 @@ / { hid_dev_0: hid_dev_0 { compatible = "zephyr,hid-device"; - label = "HID0"; + interface-name = "HID0"; protocol-code = "keyboard"; in-report-size = <64>; in-polling-period-us = <1000>; diff --git a/samples/subsys/usb/hid-keyboard/large_in_report.overlay b/samples/subsys/usb/hid-keyboard/large_in_report.overlay index 548342f4b3e..93b47691a77 100644 --- a/samples/subsys/usb/hid-keyboard/large_in_report.overlay +++ b/samples/subsys/usb/hid-keyboard/large_in_report.overlay @@ -7,7 +7,7 @@ / { hid_dev_0: hid_dev_0 { compatible = "zephyr,hid-device"; - label = "HID0"; + interface-name = "HID0"; in-report-size = <256>; in-polling-period-us = <1000>; }; diff --git a/samples/subsys/usb/hid-mouse/usbd_next.overlay b/samples/subsys/usb/hid-mouse/usbd_next.overlay index 86365a94ae5..ce74aa51879 100644 --- a/samples/subsys/usb/hid-mouse/usbd_next.overlay +++ b/samples/subsys/usb/hid-mouse/usbd_next.overlay @@ -7,7 +7,7 @@ / { hid_dev_0: hid_dev_0 { compatible = "zephyr,hid-device"; - label = "HID0"; + interface-name = "HID0"; protocol-code = "none"; in-polling-period-us = <1000>; in-report-size = <64>; diff --git a/subsys/usb/device_next/class/usbd_hid.c b/subsys/usb/device_next/class/usbd_hid.c index d5476a88ed6..fd10eba3c85 100644 --- a/subsys/usb/device_next/class/usbd_hid.c +++ b/subsys/usb/device_next/class/usbd_hid.c @@ -65,7 +65,6 @@ struct hid_device_config { struct usbd_class_data *c_data; struct net_buf_pool *pool_out; struct net_buf_pool *pool_in; - struct usbd_desc_node *const if_desc_data; const struct usb_desc_header **fs_desc; const struct usb_desc_header **hs_desc; }; @@ -489,21 +488,8 @@ static void *usbd_hid_get_desc(struct usbd_class_data *const c_data, static int usbd_hid_init(struct usbd_class_data *const c_data) { - struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); - const struct device *dev = usbd_class_get_private(c_data); - const struct hid_device_config *dcfg = dev->config; - struct usbd_hid_descriptor *const desc = dcfg->desc; - LOG_DBG("HID class %s init", c_data->name); - if (dcfg->if_desc_data != NULL && desc->if0.iInterface == 0) { - if (usbd_add_descriptor(uds_ctx, dcfg->if_desc_data)) { - LOG_ERR("Failed to add interface string descriptor"); - } else { - desc->if0.iInterface = usbd_str_desc_get_idx(dcfg->if_desc_data); - } - } - return 0; } @@ -764,12 +750,6 @@ static const struct hid_device_driver_api hid_device_api = { HID_OUT_POOL_DEFINE(n); \ USBD_HID_INTERFACE_DEFINE(n); \ \ - IF_ENABLED(DT_INST_NODE_HAS_PROP(n, label), ( \ - USBD_DESC_STRING_DEFINE(hid_if_desc_data_##n, \ - DT_INST_PROP(n, label), \ - USBD_DUT_STRING_INTERFACE); \ - )) \ - \ USBD_DEFINE_CLASS(hid_##n, \ &usbd_hid_api, \ (void *)DEVICE_DT_GET(DT_DRV_INST(n)), NULL); \ @@ -781,9 +761,6 @@ static const struct hid_device_driver_api hid_device_api = { .pool_out = HID_OUT_POOL_ADDR(n), \ .fs_desc = hid_fs_desc_##n, \ .hs_desc = hid_hs_desc_##n, \ - IF_ENABLED(DT_INST_NODE_HAS_PROP(n, label), ( \ - .if_desc_data = &hid_if_desc_data_##n, \ - )) \ }; \ \ static struct hid_device_data hid_data_##n; \ From 82784ba4a776eff66f6fb39ebe12f67635229d09 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 686/881] Revert "[nrf fromtree] usb: device_next: bt_hci: do not take semaphore if transfer enqueue fail" This reverts commit ed400c8eb9edfa1a894d9526c7d1105e1b4bd7e5. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/class/bt_hci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/subsys/usb/device_next/class/bt_hci.c b/subsys/usb/device_next/class/bt_hci.c index 7a2dc6da598..c78e64bbfe1 100644 --- a/subsys/usb/device_next/class/bt_hci.c +++ b/subsys/usb/device_next/class/bt_hci.c @@ -189,12 +189,8 @@ static void bt_hci_tx_sync_in(struct usbd_class_data *const c_data, } net_buf_add_mem(buf, bt_buf->data, bt_buf->len); - if (usbd_ep_enqueue(c_data, buf)) { - LOG_ERR("Failed to enqueue transfer"); - } else { - k_sem_take(&hci_data->sync_sem, K_FOREVER); - } - + usbd_ep_enqueue(c_data, buf); + k_sem_take(&hci_data->sync_sem, K_FOREVER); net_buf_unref(buf); } From 9d5c11dbef677eb264a36967c278451ecfc1ff6a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 687/881] Revert "[nrf fromtree] usb: device: fix Bluetooth buffer handling" This reverts commit eef332c0fd5bcd7e5902f7802b7d9a1fe467de64. Signed-off-by: Jukka Rissanen --- subsys/usb/device/class/bluetooth.c | 12 +++--- subsys/usb/device_next/class/bt_hci.c | 56 +++++++-------------------- 2 files changed, 19 insertions(+), 49 deletions(-) diff --git a/subsys/usb/device/class/bluetooth.c b/subsys/usb/device/class/bluetooth.c index 7edd4792749..33774eef90d 100644 --- a/subsys/usb/device/class/bluetooth.c +++ b/subsys/usb/device/class/bluetooth.c @@ -154,20 +154,20 @@ static void hci_tx_thread(void *p1, void *p2, void *p3) type = net_buf_pull_u8(buf); switch (type) { - case BT_HCI_H4_EVT: + case BT_BUF_EVT: usb_transfer_sync( bluetooth_ep_data[HCI_INT_EP_IDX].ep_addr, buf->data, buf->len, USB_TRANS_WRITE | USB_TRANS_NO_ZLP); break; - case BT_HCI_H4_ACL: + case BT_BUF_ACL_IN: usb_transfer_sync( bluetooth_ep_data[HCI_IN_EP_IDX].ep_addr, buf->data, buf->len, USB_TRANS_WRITE); break; default: - LOG_ERR("Unsupported type %u", type); + LOG_ERR("Unknown type %u", type); break; } @@ -200,11 +200,11 @@ static uint16_t hci_acl_pkt_len(const uint8_t *data, size_t data_len) struct bt_hci_acl_hdr *acl_hdr; size_t hdr_len = sizeof(*acl_hdr); - if (data_len < hdr_len) { + if (data_len - 1 < hdr_len) { return 0; } - acl_hdr = (struct bt_hci_acl_hdr *)data; + acl_hdr = (struct bt_hci_acl_hdr *)(data + 1); return sys_le16_to_cpu(acl_hdr->len) + hdr_len; } @@ -250,7 +250,7 @@ static void acl_read_cb(uint8_t ep, int size, void *priv) LOG_DBG("len %u, chunk %u", buf->len, size); } - if (buf != NULL && pkt_len == buf->len - 1) { + if (buf != NULL && pkt_len == buf->len) { k_fifo_put(&rx_queue, buf); LOG_DBG("put"); buf = NULL; diff --git a/subsys/usb/device_next/class/bt_hci.c b/subsys/usb/device_next/class/bt_hci.c index c78e64bbfe1..13665c78a1d 100644 --- a/subsys/usb/device_next/class/bt_hci.c +++ b/subsys/usb/device_next/class/bt_hci.c @@ -210,14 +210,14 @@ static void bt_hci_tx_thread(void *p1, void *p2, void *p3) type = net_buf_pull_u8(bt_buf); switch (type) { - case BT_HCI_H4_EVT: + case BT_BUF_EVT: ep = bt_hci_get_int_in(c_data); break; - case BT_HCI_H4_ACL: + case BT_BUF_ACL_IN: ep = bt_hci_get_bulk_in(c_data); break; default: - LOG_ERR("Unsupported type %u", type); + LOG_ERR("Unknown type %u", type); continue; } @@ -273,43 +273,19 @@ static int bt_hci_acl_out_start(struct usbd_class_data *const c_data) return ret; } -static uint16_t hci_pkt_get_len(const uint8_t h4_type, - const uint8_t *data, const size_t size) +static uint16_t hci_acl_pkt_len(struct net_buf *const buf) { - size_t hdr_len = 0; - uint16_t len = 0; + struct bt_hci_acl_hdr *acl_hdr; + size_t hdr_len; - switch (h4_type) { - case BT_HCI_H4_CMD: { - struct bt_hci_cmd_hdr *cmd_hdr; - - hdr_len = sizeof(*cmd_hdr); - cmd_hdr = (struct bt_hci_cmd_hdr *)data; - len = cmd_hdr->param_len + hdr_len; - break; - } - case BT_HCI_H4_ACL: { - struct bt_hci_acl_hdr *acl_hdr; - - hdr_len = sizeof(*acl_hdr); - acl_hdr = (struct bt_hci_acl_hdr *)data; - len = sys_le16_to_cpu(acl_hdr->len) + hdr_len; - break; - } - case BT_HCI_H4_ISO: { - struct bt_hci_iso_hdr *iso_hdr; - - hdr_len = sizeof(*iso_hdr); - iso_hdr = (struct bt_hci_iso_hdr *)data; - len = bt_iso_hdr_len(sys_le16_to_cpu(iso_hdr->len)) + hdr_len; - break; - } - default: - LOG_ERR("Unknown H4 buffer type"); + hdr_len = sizeof(*acl_hdr); + if (buf->len - 1 < hdr_len) { return 0; } - return (size < hdr_len) ? 0 : len; + acl_hdr = (struct bt_hci_acl_hdr *)(buf->data + 1); + + return sys_le16_to_cpu(acl_hdr->len) + hdr_len; } static int bt_hci_acl_out_cb(struct usbd_class_data *const c_data, @@ -329,9 +305,7 @@ static int bt_hci_acl_out_cb(struct usbd_class_data *const c_data, goto restart_out_transfer; } - hci_data->acl_len = hci_pkt_get_len(BT_HCI_H4_ACL, - buf->data, - buf->len); + hci_data->acl_len = hci_acl_pkt_len(hci_data->acl_buf); LOG_DBG("acl_len %u, chunk %u", hci_data->acl_len, buf->len); @@ -356,11 +330,7 @@ static int bt_hci_acl_out_cb(struct usbd_class_data *const c_data, LOG_INF("len %u, chunk %u", hci_data->acl_buf->len, buf->len); } - /* - * The buffer obtained from bt_buf_get_tx() stores the type at the top. - * Take this into account when comparing received data length. - */ - if (hci_data->acl_buf != NULL && hci_data->acl_len == hci_data->acl_buf->len - 1) { + if (hci_data->acl_buf != NULL && hci_data->acl_len == hci_data->acl_buf->len) { k_fifo_put(&bt_hci_rx_queue, hci_data->acl_buf); hci_data->acl_buf = NULL; hci_data->acl_len = 0; From eadedd4a1c06ad80c66d308256e393b9325eec5f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 688/881] Revert "[nrf fromtree] usb: device_next: fix the null pointer dereference on FS devices" This reverts commit bd5002b5d9c8b224f6a730aa6a69ec264017cf71. Signed-off-by: Jukka Rissanen --- subsys/usb/device_next/usbd_ch9.c | 17 ++++++----------- subsys/usb/device_next/usbd_device.c | 10 ---------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/subsys/usb/device_next/usbd_ch9.c b/subsys/usb/device_next/usbd_ch9.c index 3adb3574f0c..c9f806960d7 100644 --- a/subsys/usb/device_next/usbd_ch9.c +++ b/subsys/usb/device_next/usbd_ch9.c @@ -683,6 +683,12 @@ static int sreq_get_dev_qualifier(struct usbd_context *const uds_ctx, struct usb_device_qualifier_descriptor q_desc = { .bLength = sizeof(struct usb_device_qualifier_descriptor), .bDescriptorType = USB_DESC_DEVICE_QUALIFIER, + .bcdUSB = d_desc->bcdUSB, + .bDeviceClass = d_desc->bDeviceClass, + .bDeviceSubClass = d_desc->bDeviceSubClass, + .bDeviceProtocol = d_desc->bDeviceProtocol, + .bMaxPacketSize0 = d_desc->bMaxPacketSize0, + .bNumConfigurations = d_desc->bNumConfigurations, .bReserved = 0U, }; size_t len; @@ -697,17 +703,6 @@ static int sreq_get_dev_qualifier(struct usbd_context *const uds_ctx, return 0; } - if (d_desc == NULL) { - return -EINVAL; - } - - q_desc.bcdUSB = d_desc->bcdUSB; - q_desc.bDeviceClass = d_desc->bDeviceClass; - q_desc.bDeviceSubClass = d_desc->bDeviceSubClass; - q_desc.bDeviceProtocol = d_desc->bDeviceProtocol; - q_desc.bMaxPacketSize0 = d_desc->bMaxPacketSize0; - q_desc.bNumConfigurations = d_desc->bNumConfigurations; - LOG_DBG("Get Device Qualifier"); len = MIN(setup->wLength, net_buf_tailroom(buf)); net_buf_add_mem(buf, &q_desc, MIN(len, q_desc.bLength)); diff --git a/subsys/usb/device_next/usbd_device.c b/subsys/usb/device_next/usbd_device.c index fcb689a5c56..bb011e0731c 100644 --- a/subsys/usb/device_next/usbd_device.c +++ b/subsys/usb/device_next/usbd_device.c @@ -66,11 +66,6 @@ int usbd_device_set_bcd_usb(struct usbd_context *const uds_ctx, } desc = get_device_descriptor(uds_ctx, speed); - if (desc == NULL) { - ret = -EINVAL; - goto set_bcd_exit; - } - desc->bcdUSB = sys_cpu_to_le16(bcd); set_bcd_exit: @@ -172,11 +167,6 @@ int usbd_device_set_code_triple(struct usbd_context *const uds_ctx, } desc = get_device_descriptor(uds_ctx, speed); - if (desc == NULL) { - ret = -EINVAL; - goto set_code_triple_exit; - } - desc->bDeviceClass = base_class; desc->bDeviceSubClass = subclass; desc->bDeviceProtocol = protocol; From 118a832056e99387cd99bf6ec103c166b8f44d65 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 689/881] Revert "[nrf fromtree] samples: boards: nordic: clock_control: add resolve and startup time" This reverts commit d052f3e3f9f168b02efc9621430d0546598023cb. Signed-off-by: Jukka Rissanen --- .../boards/nordic/clock_control/src/main.c | 39 ++++--------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/samples/boards/nordic/clock_control/src/main.c b/samples/boards/nordic/clock_control/src/main.c index d2823db92ac..ebaaa0cecbd 100644 --- a/samples/boards/nordic/clock_control/src/main.c +++ b/samples/boards/nordic/clock_control/src/main.c @@ -45,13 +45,6 @@ int main(void) int res; int64_t req_start_uptime; int64_t req_stop_uptime; - struct nrf_clock_spec res_spec; - const struct nrf_clock_spec req_spec = { - .frequency = CONFIG_SAMPLE_CLOCK_FREQUENCY_HZ, - .accuracy = CONFIG_SAMPLE_CLOCK_ACCURACY_PPM, - .precision = CONFIG_SAMPLE_CLOCK_PRECISION, - }; - uint32_t startup_time_us; printk("\n"); printk("clock name: %s\n", SAMPLE_CLOCK_NAME); @@ -59,29 +52,11 @@ int main(void) printk("minimum accuracy request: %uPPM\n", CONFIG_SAMPLE_CLOCK_ACCURACY_PPM); printk("minimum precision request: %u\n", CONFIG_SAMPLE_CLOCK_PRECISION); - printk("\n"); - ret = nrf_clock_control_resolve(sample_clock_dev, &req_spec, &res_spec); - if (ret == 0) { - printk("resolved frequency request: %uHz\n", res_spec.frequency); - printk("resolved accuracy request: %uPPM\n", res_spec.accuracy); - printk("resolved precision request: %u\n", res_spec.precision); - } else if (ret == -ENOSYS) { - printk("resolve not supported\n"); - } else { - printk("minimum clock specs could not be resolved\n"); - return 0; - } - - printk("\n"); - ret = nrf_clock_control_get_startup_time(sample_clock_dev, &req_spec, &startup_time_us); - if (ret == 0) { - printk("startup time for requested spec: %uus\n", startup_time_us); - } else if (ret == -ENOSYS) { - printk("get startup time not supported\n"); - } else { - printk("failed to get startup time\n"); - return 0; - } + const struct nrf_clock_spec spec = { + .frequency = CONFIG_SAMPLE_CLOCK_FREQUENCY_HZ, + .accuracy = CONFIG_SAMPLE_CLOCK_ACCURACY_PPM, + .precision = CONFIG_SAMPLE_CLOCK_PRECISION, + }; sys_notify_init_callback(&cli.notify, sample_notify_cb); @@ -90,7 +65,7 @@ int main(void) printk("\n"); printk("requesting minimum clock specs\n"); req_start_uptime = k_uptime_get(); - ret = nrf_clock_control_request(sample_clock_dev, &req_spec, &cli); + ret = nrf_clock_control_request(sample_clock_dev, &spec, &cli); if (ret < 0) { printk("minimum clock specs could not be met\n"); return 0; @@ -120,7 +95,7 @@ int main(void) printk("\n"); printk("releasing requested clock specs\n"); - ret = nrf_clock_control_release(sample_clock_dev, &req_spec); + ret = nrf_clock_control_release(sample_clock_dev, &spec); if (ret < 0) { printk("failed to release requested clock specs\n"); return 0; From a5a627866a6e57fbdccb961fdba812840ef3e337 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:36 +0300 Subject: [PATCH 690/881] Revert "[nrf fromtree] drivers: clock_control: nrf2_global_hsfll: impl resolve" This reverts commit 542922847fcbded7337b25062b75607fe5330d92. Signed-off-by: Jukka Rissanen --- .../clock_control_nrf2_global_hsfll.c | 80 +++++-------------- 1 file changed, 19 insertions(+), 61 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf2_global_hsfll.c b/drivers/clock_control/clock_control_nrf2_global_hsfll.c index 30a64ea9fdc..50f3396429c 100644 --- a/drivers/clock_control/clock_control_nrf2_global_hsfll.c +++ b/drivers/clock_control/clock_control_nrf2_global_hsfll.c @@ -62,69 +62,43 @@ static uint32_t global_hsfll_get_max_clock_frequency(const struct device *dev) return dev_config->clock_frequencies[ARRAY_SIZE(dev_config->clock_frequencies) - 1]; } -static int global_hsfll_resolve_spec_to_idx(const struct device *dev, - const struct nrf_clock_spec *req_spec) +static struct onoff_manager *global_hsfll_find_mgr(const struct device *dev, + const struct nrf_clock_spec *spec) { + struct global_hsfll_dev_data *dev_data = dev->data; const struct global_hsfll_dev_config *dev_config = dev->config; - uint32_t req_frequency; + uint32_t frequency; + + if (!spec) { + return &dev_data->clk_cfg.onoff[0].mgr; + } - if (req_spec->accuracy || req_spec->precision) { + if (spec->accuracy || spec->precision) { LOG_ERR("invalid specification of accuracy or precision"); - return -EINVAL; + return NULL; } - req_frequency = req_spec->frequency == NRF_CLOCK_CONTROL_FREQUENCY_MAX - ? global_hsfll_get_max_clock_frequency(dev) - : req_spec->frequency; + frequency = spec->frequency == NRF_CLOCK_CONTROL_FREQUENCY_MAX + ? global_hsfll_get_max_clock_frequency(dev) + : spec->frequency; for (uint8_t i = 0; i < ARRAY_SIZE(dev_config->clock_frequencies); i++) { - if (dev_config->clock_frequencies[i] < req_frequency) { + if (dev_config->clock_frequencies[i] < frequency) { continue; } - return i; + return &dev_data->clk_cfg.onoff[i].mgr; } LOG_ERR("invalid frequency"); - return -EINVAL; -} - -static void global_hsfll_get_spec_by_idx(const struct device *dev, - uint8_t idx, - struct nrf_clock_spec *spec) -{ - const struct global_hsfll_dev_config *dev_config = dev->config; - - spec->frequency = dev_config->clock_frequencies[idx]; - spec->accuracy = 0; - spec->precision = 0; -} - -static struct onoff_manager *global_hsfll_get_mgr_by_idx(const struct device *dev, uint8_t idx) -{ - struct global_hsfll_dev_data *dev_data = dev->data; - - return &dev_data->clk_cfg.onoff[idx].mgr; -} - -static struct onoff_manager *global_hsfll_find_mgr_by_spec(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - int idx; - - if (!spec) { - return global_hsfll_get_mgr_by_idx(dev, 0); - } - - idx = global_hsfll_resolve_spec_to_idx(dev, spec); - return idx < 0 ? NULL : global_hsfll_get_mgr_by_idx(dev, idx); + return NULL; } static int api_request_global_hsfll(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { - struct onoff_manager *mgr = global_hsfll_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = global_hsfll_find_mgr(dev, spec); if (mgr) { return clock_config_request(mgr, cli); @@ -136,7 +110,7 @@ static int api_request_global_hsfll(const struct device *dev, static int api_release_global_hsfll(const struct device *dev, const struct nrf_clock_spec *spec) { - struct onoff_manager *mgr = global_hsfll_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = global_hsfll_find_mgr(dev, spec); if (mgr) { return onoff_release(mgr); @@ -149,7 +123,7 @@ static int api_cancel_or_release_global_hsfll(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { - struct onoff_manager *mgr = global_hsfll_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = global_hsfll_find_mgr(dev, spec); if (mgr) { return onoff_cancel_or_release(mgr, cli); @@ -158,21 +132,6 @@ static int api_cancel_or_release_global_hsfll(const struct device *dev, return -EINVAL; } -static int api_resolve_global_hsfll(const struct device *dev, - const struct nrf_clock_spec *req_spec, - struct nrf_clock_spec *res_spec) -{ - int idx; - - idx = global_hsfll_resolve_spec_to_idx(dev, req_spec); - if (idx < 0) { - return -EINVAL; - } - - global_hsfll_get_spec_by_idx(dev, idx, res_spec); - return 0; -} - static DEVICE_API(nrf_clock_control, driver_api) = { .std_api = { .on = api_nosys_on_off, @@ -181,7 +140,6 @@ static DEVICE_API(nrf_clock_control, driver_api) = { .request = api_request_global_hsfll, .release = api_release_global_hsfll, .cancel_or_release = api_cancel_or_release_global_hsfll, - .resolve = api_resolve_global_hsfll, }; static enum gdfs_frequency_setting global_hsfll_freq_idx_to_nrfs_freq(const struct device *dev, From d0a9df30d526210615ce8d1f86c05501710d855f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 691/881] Revert "[nrf fromtree] drivers: clock_control: nrf2_hsfll: impl resolve" This reverts commit 6398757ca7aa7350a2591c28ca9e2ecc9cd29528. Signed-off-by: Jukka Rissanen --- .../clock_control/clock_control_nrf2_hsfll.c | 79 +++++-------------- 1 file changed, 19 insertions(+), 60 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf2_hsfll.c b/drivers/clock_control/clock_control_nrf2_hsfll.c index e8f8449b24d..eb2dfde989c 100644 --- a/drivers/clock_control/clock_control_nrf2_hsfll.c +++ b/drivers/clock_control/clock_control_nrf2_hsfll.c @@ -100,56 +100,35 @@ static void hsfll_work_handler(struct k_work *work) k_timer_start(&dev_data->timer, NRFS_DVFS_TIMEOUT, K_NO_WAIT); } -static int hsfll_resolve_spec_to_idx(const struct nrf_clock_spec *req_spec) +static struct onoff_manager *hsfll_find_mgr(const struct device *dev, + const struct nrf_clock_spec *spec) { - uint32_t req_frequency; + struct hsfll_dev_data *dev_data = dev->data; + uint32_t frequency; + + if (!spec) { + return &dev_data->clk_cfg.onoff[0].mgr; + } - if (req_spec->accuracy || req_spec->precision) { + if (spec->accuracy || spec->precision) { LOG_ERR("invalid specification of accuracy or precision"); - return -EINVAL; + return NULL; } - req_frequency = req_spec->frequency == NRF_CLOCK_CONTROL_FREQUENCY_MAX - ? HSFLL_FREQ_HIGH - : req_spec->frequency; + frequency = spec->frequency == NRF_CLOCK_CONTROL_FREQUENCY_MAX + ? HSFLL_FREQ_HIGH + : spec->frequency; for (int i = 0; i < ARRAY_SIZE(clock_options); ++i) { - if (req_frequency > clock_options[i].frequency) { + if (frequency > clock_options[i].frequency) { continue; } - return i; + return &dev_data->clk_cfg.onoff[i].mgr; } LOG_ERR("invalid frequency"); - return -EINVAL; -} - -static void hsfll_get_spec_by_idx(uint8_t idx, struct nrf_clock_spec *spec) -{ - spec->frequency = clock_options[idx].frequency; - spec->accuracy = 0; - spec->precision = 0; -} - -static struct onoff_manager *hsfll_get_mgr_by_idx(const struct device *dev, uint8_t idx) -{ - struct hsfll_dev_data *dev_data = dev->data; - - return &dev_data->clk_cfg.onoff[idx].mgr; -} - -static struct onoff_manager *hsfll_find_mgr_by_spec(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - int idx; - - if (!spec) { - return hsfll_get_mgr_by_idx(dev, 0); - } - - idx = hsfll_resolve_spec_to_idx(spec); - return idx < 0 ? NULL : hsfll_get_mgr_by_idx(dev, idx); + return NULL; } #endif /* CONFIG_NRFS_DVFS_LOCAL_DOMAIN */ @@ -158,7 +137,7 @@ static int api_request_hsfll(const struct device *dev, struct onoff_client *cli) { #ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN - struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = hsfll_find_mgr(dev, spec); if (mgr) { return clock_config_request(mgr, cli); @@ -174,7 +153,7 @@ static int api_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec) { #ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN - struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = hsfll_find_mgr(dev, spec); if (mgr) { return onoff_release(mgr); @@ -191,7 +170,7 @@ static int api_cancel_or_release_hsfll(const struct device *dev, struct onoff_client *cli) { #ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN - struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = hsfll_find_mgr(dev, spec); if (mgr) { return onoff_cancel_or_release(mgr, cli); @@ -203,25 +182,6 @@ static int api_cancel_or_release_hsfll(const struct device *dev, #endif } -static int api_resolve_hsfll(const struct device *dev, - const struct nrf_clock_spec *req_spec, - struct nrf_clock_spec *res_spec) -{ -#ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN - int idx; - - idx = hsfll_resolve_spec_to_idx(req_spec); - if (idx < 0) { - return -EINVAL; - } - - hsfll_get_spec_by_idx(idx, res_spec); - return 0; -#else - return -ENOTSUP; -#endif -} - static int hsfll_init(const struct device *dev) { #ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN @@ -252,7 +212,6 @@ static DEVICE_API(nrf_clock_control, hsfll_drv_api) = { .request = api_request_hsfll, .release = api_release_hsfll, .cancel_or_release = api_cancel_or_release_hsfll, - .resolve = api_resolve_hsfll, }; #ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN From 6eba4221c71c8177a5d12028b608f66359bf4737 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 692/881] Revert "[nrf fromtree] drivers: clock_control: nrf2_fll16m: impl resolve and startup_time" This reverts commit 4346d85612360baac5de171aa1131bf4e65aa823. Signed-off-by: Jukka Rissanen --- .../clock_control/clock_control_nrf2_fll16m.c | 132 +++--------------- dts/bindings/clock/nordic,nrf-fll16m.yaml | 6 - dts/vendor/nordic/nrf54h20.dtsi | 1 - 3 files changed, 22 insertions(+), 117 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf2_fll16m.c b/drivers/clock_control/clock_control_nrf2_fll16m.c index 92b09804b8a..7bb10263d5b 100644 --- a/drivers/clock_control/clock_control_nrf2_fll16m.c +++ b/drivers/clock_control/clock_control_nrf2_fll16m.c @@ -34,7 +34,6 @@ BUILD_ASSERT(FLL16M_MODE_CLOSED_LOOP == NRF_LRCCONF_CLK_SRC_CLOSED_LOOP); #define FLL16M_HFXO_ACCURACY DT_PROP(FLL16M_HFXO_NODE, accuracy_ppm) #define FLL16M_OPEN_LOOP_ACCURACY DT_INST_PROP(0, open_loop_accuracy_ppm) #define FLL16M_MAX_ACCURACY FLL16M_HFXO_ACCURACY -#define FLL16M_OPEN_LOOP_STARTUP_TIME_US DT_INST_PROP(0, open_loop_startup_time_us) #define BICR (NRF_BICR_Type *)DT_REG_ADDR(DT_NODELABEL(bicr)) @@ -58,7 +57,6 @@ struct fll16m_dev_data { STRUCT_CLOCK_CONFIG(fll16m, ARRAY_SIZE(clock_options)) clk_cfg; struct onoff_client hfxo_cli; sys_snode_t fll16m_node; - uint32_t bypass_startup_time_us; }; struct fll16m_dev_config { @@ -135,98 +133,49 @@ static void fll16m_work_handler(struct k_work *work) } } -static int fll16m_resolve_spec_to_idx(const struct device *dev, - const struct nrf_clock_spec *req_spec) +static struct onoff_manager *fll16m_find_mgr(const struct device *dev, + const struct nrf_clock_spec *spec) { + struct fll16m_dev_data *dev_data = dev->data; const struct fll16m_dev_config *dev_config = dev->config; - uint16_t req_accuracy; + uint16_t accuracy; + + if (!spec) { + return &dev_data->clk_cfg.onoff[0].mgr; + } - if (req_spec->frequency > dev_config->fixed_frequency) { + if (spec->frequency > dev_config->fixed_frequency) { LOG_ERR("invalid frequency"); - return -EINVAL; + return NULL; } - if (req_spec->precision) { + if (spec->precision) { LOG_ERR("invalid precision"); - return -EINVAL; + return NULL; } - req_accuracy = req_spec->accuracy == NRF_CLOCK_CONTROL_ACCURACY_MAX - ? FLL16M_MAX_ACCURACY - : req_spec->accuracy; + accuracy = spec->accuracy == NRF_CLOCK_CONTROL_ACCURACY_MAX + ? FLL16M_MAX_ACCURACY + : spec->accuracy; for (int i = 0; i < ARRAY_SIZE(clock_options); ++i) { - if (req_accuracy && - req_accuracy < clock_options[i].accuracy) { + if (accuracy && + accuracy < clock_options[i].accuracy) { continue; } - return i; + return &dev_data->clk_cfg.onoff[i].mgr; } LOG_ERR("invalid accuracy"); - return -EINVAL; -} - -static void fll16m_get_spec_by_idx(const struct device *dev, - uint8_t idx, - struct nrf_clock_spec *spec) -{ - const struct fll16m_dev_config *dev_config = dev->config; - - spec->frequency = dev_config->fixed_frequency; - spec->accuracy = clock_options[idx].accuracy; - spec->precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT; -} - -static int fll16m_get_startup_time_by_idx(const struct device *dev, - uint8_t idx, - uint32_t *startup_time_us) -{ - const struct fll16m_dev_data *dev_data = dev->data; - uint8_t mode = clock_options[idx].mode; - - switch (mode) { - case FLL16M_MODE_OPEN_LOOP: - *startup_time_us = FLL16M_OPEN_LOOP_STARTUP_TIME_US; - return 0; - - case FLL16M_MODE_BYPASS: - *startup_time_us = dev_data->bypass_startup_time_us; - return 0; - - default: - break; - } - - return -EINVAL; -} - -static struct onoff_manager *fll16m_get_mgr_by_idx(const struct device *dev, uint8_t idx) -{ - struct fll16m_dev_data *dev_data = dev->data; - - return &dev_data->clk_cfg.onoff[idx].mgr; -} - -static struct onoff_manager *fll16m_find_mgr_by_spec(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - int idx; - - if (!spec) { - return fll16m_get_mgr_by_idx(dev, 0); - } - - idx = fll16m_resolve_spec_to_idx(dev, spec); - return idx < 0 ? NULL : fll16m_get_mgr_by_idx(dev, idx); + return NULL; } static int api_request_fll16m(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { - struct onoff_manager *mgr = fll16m_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = fll16m_find_mgr(dev, spec); if (mgr) { return clock_config_request(mgr, cli); @@ -238,7 +187,7 @@ static int api_request_fll16m(const struct device *dev, static int api_release_fll16m(const struct device *dev, const struct nrf_clock_spec *spec) { - struct onoff_manager *mgr = fll16m_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = fll16m_find_mgr(dev, spec); if (mgr) { return onoff_release(mgr); @@ -251,7 +200,7 @@ static int api_cancel_or_release_fll16m(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { - struct onoff_manager *mgr = fll16m_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = fll16m_find_mgr(dev, spec); if (mgr) { return onoff_cancel_or_release(mgr, cli); @@ -273,45 +222,10 @@ static int api_get_rate_fll16m(const struct device *dev, return 0; } -static int api_resolve(const struct device *dev, - const struct nrf_clock_spec *req_spec, - struct nrf_clock_spec *res_spec) -{ - int idx; - - idx = fll16m_resolve_spec_to_idx(dev, req_spec); - if (idx < 0) { - return -EINVAL; - } - - fll16m_get_spec_by_idx(dev, idx, res_spec); - return 0; -} - -static int api_get_startup_time(const struct device *dev, - const struct nrf_clock_spec *spec, - uint32_t *startup_time_us) -{ - int idx; - - idx = fll16m_resolve_spec_to_idx(dev, spec); - if (idx < 0) { - return -EINVAL; - } - - return fll16m_get_startup_time_by_idx(dev, idx, startup_time_us); -} - static int fll16m_init(const struct device *dev) { struct fll16m_dev_data *dev_data = dev->data; - dev_data->bypass_startup_time_us = nrf_bicr_hfxo_startup_time_us_get(BICR); - if (dev_data->bypass_startup_time_us == NRF_BICR_HFXO_STARTUP_TIME_UNCONFIGURED) { - LOG_ERR("BICR HFXO startup time invalid"); - return -ENODEV; - } - return clock_config_init(&dev_data->clk_cfg, ARRAY_SIZE(dev_data->clk_cfg.onoff), fll16m_work_handler); @@ -326,8 +240,6 @@ static DEVICE_API(nrf_clock_control, fll16m_drv_api) = { .request = api_request_fll16m, .release = api_release_fll16m, .cancel_or_release = api_cancel_or_release_fll16m, - .resolve = api_resolve, - .get_startup_time = api_get_startup_time, }; static struct fll16m_dev_data fll16m_data; diff --git a/dts/bindings/clock/nordic,nrf-fll16m.yaml b/dts/bindings/clock/nordic,nrf-fll16m.yaml index cfbbb0c4093..4f23a7a1de1 100644 --- a/dts/bindings/clock/nordic,nrf-fll16m.yaml +++ b/dts/bindings/clock/nordic,nrf-fll16m.yaml @@ -18,7 +18,6 @@ description: | fll16m { open-loop-accuracy-ppm = <20000>; - open-loop-startup-time-us = <400>; clocks = <&hfxo>, <&lfxo>; clock-names = "hfxo", "lfxo"; }; @@ -35,8 +34,3 @@ properties: type: int description: Clock accuracy in parts per million required: true - - open-loop-startup-time-us: - type: int - description: Clock startup time if open-loop clock source is used. - required: true diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 37a6a3f394b..3db33dd3c5a 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -177,7 +177,6 @@ #clock-cells = <0>; clock-frequency = ; open-loop-accuracy-ppm = <20000>; - open-loop-startup-time-us = <200>; /* To be measured */ clocks = <&hfxo>, <&lfxo>; clock-names = "hfxo", "lfxo"; }; From 504c1578df39e5b7a1b0f10f091f3327b322f283 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 693/881] Revert "[nrf fromtree] drivers: clock_control: nrf2_lfclk: impl resolve and startup_time" This reverts commit 3bc9d24a1b307971397199da2b7ffcb3769a115b. Signed-off-by: Jukka Rissanen --- .../clock_control/clock_control_nrf2_lfclk.c | 152 +++--------------- dts/bindings/clock/nordic,nrf-fll16m.yaml | 3 +- dts/bindings/clock/nordic,nrf-lfclk.yaml | 10 -- dts/vendor/nordic/nrf54h20.dtsi | 2 - 4 files changed, 21 insertions(+), 146 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf2_lfclk.c b/drivers/clock_control/clock_control_nrf2_lfclk.c index 6be9deee657..c5f70c1497b 100644 --- a/drivers/clock_control/clock_control_nrf2_lfclk.c +++ b/drivers/clock_control/clock_control_nrf2_lfclk.c @@ -22,8 +22,6 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, #define LFCLK_LFLPRC_ACCURACY DT_INST_PROP(0, lflprc_accuracy_ppm) #define LFCLK_LFRC_ACCURACY DT_INST_PROP(0, lfrc_accuracy_ppm) #define LFCLK_HFXO_ACCURACY DT_PROP(LFCLK_HFXO_NODE, accuracy_ppm) -#define LFCLK_LFLPRC_STARTUP_TIME_US DT_INST_PROP(0, lflprc_startup_time_us) -#define LFCLK_LFRC_STARTUP_TIME_US DT_INST_PROP(0, lfrc_startup_time_us) #define LFCLK_MAX_OPTS 5 #define LFCLK_DEF_OPTS 3 @@ -61,8 +59,6 @@ struct lfclk_dev_data { struct k_timer timer; uint16_t max_accuracy; uint8_t clock_options_cnt; - uint32_t hfxo_startup_time_us; - uint32_t lfxo_startup_time_us; }; struct lfclk_dev_config { @@ -109,108 +105,45 @@ static void lfclk_work_handler(struct k_work *work) } } -static int lfclk_resolve_spec_to_idx(const struct device *dev, - const struct nrf_clock_spec *req_spec) +static struct onoff_manager *lfclk_find_mgr(const struct device *dev, + const struct nrf_clock_spec *spec) { struct lfclk_dev_data *dev_data = dev->data; const struct lfclk_dev_config *dev_config = dev->config; - uint16_t req_accuracy; + uint16_t accuracy; - if (req_spec->frequency > dev_config->fixed_frequency) { + if (!spec) { + return &dev_data->clk_cfg.onoff[0].mgr; + } + + if (spec->frequency > dev_config->fixed_frequency) { LOG_ERR("invalid frequency"); - return -EINVAL; + return NULL; } - req_accuracy = req_spec->accuracy == NRF_CLOCK_CONTROL_ACCURACY_MAX - ? dev_data->max_accuracy - : req_spec->accuracy; + accuracy = spec->accuracy == NRF_CLOCK_CONTROL_ACCURACY_MAX + ? dev_data->max_accuracy + : spec->accuracy; for (int i = 0; i < dev_data->clock_options_cnt; ++i) { - if ((req_accuracy && - req_accuracy < clock_options[i].accuracy) || - req_spec->precision > clock_options[i].precision) { + if ((accuracy && + accuracy < clock_options[i].accuracy) || + spec->precision > clock_options[i].precision) { continue; } - return i; + return &dev_data->clk_cfg.onoff[i].mgr; } LOG_ERR("invalid accuracy or precision"); - return -EINVAL; -} - -static void lfclk_get_spec_by_idx(const struct device *dev, - uint8_t idx, - struct nrf_clock_spec *spec) -{ - const struct lfclk_dev_config *dev_config = dev->config; - - spec->frequency = dev_config->fixed_frequency; - spec->accuracy = clock_options[idx].accuracy; - spec->precision = clock_options[idx].precision; -} - -static struct onoff_manager *lfclk_get_mgr_by_idx(const struct device *dev, uint8_t idx) -{ - struct lfclk_dev_data *dev_data = dev->data; - - return &dev_data->clk_cfg.onoff[idx].mgr; -} - -static int lfclk_get_startup_time_by_idx(const struct device *dev, - uint8_t idx, - uint32_t *startup_time_us) -{ - struct lfclk_dev_data *dev_data = dev->data; - nrfs_clock_src_t src = clock_options[idx].src; - - switch (src) { - case NRFS_CLOCK_SRC_LFCLK_LFLPRC: - *startup_time_us = LFCLK_LFLPRC_STARTUP_TIME_US; - return 0; - - case NRFS_CLOCK_SRC_LFCLK_LFRC: - *startup_time_us = LFCLK_LFRC_STARTUP_TIME_US; - return 0; - - case NRFS_CLOCK_SRC_LFCLK_XO_PIXO: - case NRFS_CLOCK_SRC_LFCLK_XO_PIERCE: - case NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE: - case NRFS_CLOCK_SRC_LFCLK_XO_EXT_SQUARE: - case NRFS_CLOCK_SRC_LFCLK_XO_PIERCE_HP: - case NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE_HP: - *startup_time_us = dev_data->lfxo_startup_time_us; - return 0; - - case NRFS_CLOCK_SRC_LFCLK_SYNTH: - *startup_time_us = dev_data->hfxo_startup_time_us; - return 0; - - default: - break; - } - - return -EINVAL; -} - -static struct onoff_manager *lfclk_find_mgr_by_spec(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - int idx; - - if (!spec) { - return lfclk_get_mgr_by_idx(dev, 0); - } - - idx = lfclk_resolve_spec_to_idx(dev, spec); - return idx < 0 ? NULL : lfclk_get_mgr_by_idx(dev, idx); + return NULL; } static int api_request_lfclk(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { - struct onoff_manager *mgr = lfclk_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = lfclk_find_mgr(dev, spec); if (mgr) { return clock_config_request(mgr, cli); @@ -222,7 +155,7 @@ static int api_request_lfclk(const struct device *dev, static int api_release_lfclk(const struct device *dev, const struct nrf_clock_spec *spec) { - struct onoff_manager *mgr = lfclk_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = lfclk_find_mgr(dev, spec); if (mgr) { return onoff_release(mgr); @@ -235,7 +168,7 @@ static int api_cancel_or_release_lfclk(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { - struct onoff_manager *mgr = lfclk_find_mgr_by_spec(dev, spec); + struct onoff_manager *mgr = lfclk_find_mgr(dev, spec); if (mgr) { return onoff_cancel_or_release(mgr, cli); @@ -244,36 +177,6 @@ static int api_cancel_or_release_lfclk(const struct device *dev, return -EINVAL; } - -static int api_resolve(const struct device *dev, - const struct nrf_clock_spec *req_spec, - struct nrf_clock_spec *res_spec) -{ - int idx; - - idx = lfclk_resolve_spec_to_idx(dev, req_spec); - if (idx < 0) { - return -EINVAL; - } - - lfclk_get_spec_by_idx(dev, idx, res_spec); - return 0; -} - -static int api_get_startup_time(const struct device *dev, - const struct nrf_clock_spec *spec, - uint32_t *startup_time_us) -{ - int idx; - - idx = lfclk_resolve_spec_to_idx(dev, spec); - if (idx < 0) { - return -EINVAL; - } - - return lfclk_get_startup_time_by_idx(dev, idx, startup_time_us); -} - static int api_get_rate_lfclk(const struct device *dev, clock_control_subsys_t sys, uint32_t *rate) @@ -348,19 +251,6 @@ static int lfclk_init(const struct device *dev) LOG_ERR("Unexpected LFOSC mode"); return -EINVAL; } - - dev_data->lfxo_startup_time_us = nrf_bicr_lfosc_startup_time_ms_get(BICR) - * USEC_PER_MSEC; - if (dev_data->lfxo_startup_time_us == NRF_BICR_LFOSC_STARTUP_TIME_UNCONFIGURED) { - LOG_ERR("BICR LFXO startup time invalid"); - return -ENODEV; - } - } - - dev_data->hfxo_startup_time_us = nrf_bicr_hfxo_startup_time_us_get(BICR); - if (dev_data->hfxo_startup_time_us == NRF_BICR_HFXO_STARTUP_TIME_UNCONFIGURED) { - LOG_ERR("BICR HFXO startup time invalid"); - return -ENODEV; } k_timer_init(&dev_data->timer, lfclk_update_timeout_handler, NULL); @@ -379,8 +269,6 @@ static DEVICE_API(nrf_clock_control, lfclk_drv_api) = { .request = api_request_lfclk, .release = api_release_lfclk, .cancel_or_release = api_cancel_or_release_lfclk, - .resolve = api_resolve, - .get_startup_time = api_get_startup_time, }; static struct lfclk_dev_data lfclk_data; diff --git a/dts/bindings/clock/nordic,nrf-fll16m.yaml b/dts/bindings/clock/nordic,nrf-fll16m.yaml index 4f23a7a1de1..8c7187965ae 100644 --- a/dts/bindings/clock/nordic,nrf-fll16m.yaml +++ b/dts/bindings/clock/nordic,nrf-fll16m.yaml @@ -32,5 +32,4 @@ properties: open-loop-accuracy-ppm: type: int - description: Clock accuracy in parts per million - required: true + description: Clock accuracy in parts per million if open-loop clock source is used. diff --git a/dts/bindings/clock/nordic,nrf-lfclk.yaml b/dts/bindings/clock/nordic,nrf-lfclk.yaml index a0f95d6c927..f7df4d8a435 100644 --- a/dts/bindings/clock/nordic,nrf-lfclk.yaml +++ b/dts/bindings/clock/nordic,nrf-lfclk.yaml @@ -21,8 +21,6 @@ description: | lfclk { lfrc-accuracy-ppm = <500>; lflprc-accuracy-ppm = <1000>; - lfrc-startup-time-us = <400>; - lflprc-startup-time-us = <400>; clocks = <&hfxo>, <&lfxo>; clock-names = "hfxo", "lfxo"; }; @@ -42,11 +40,3 @@ properties: lflprc-accuracy-ppm: type: int description: Clock accuracy in parts per million if LFLPRC clock source is used. - - lfrc-startup-time-us: - type: int - description: Clock startup time in microseconds if LFRC clock source is used. - - lflprc-startup-time-us: - type: int - description: Clock startup time in microseconds if LFLPRC clock source is used. diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 3db33dd3c5a..5fcb941aaae 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -199,8 +199,6 @@ status = "okay"; lfrc-accuracy-ppm = <500>; lflprc-accuracy-ppm = <1000>; - lfrc-startup-time-us = <200>; /* To be measured */ - lflprc-startup-time-us = <200>; /* To be measured */ clocks = <&hfxo>, <&lfxo>; clock-names = "hfxo", "lfxo"; }; From 9f276a8fbe5e108a9153dcde14be8244833d6029 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 694/881] Revert "[nrf fromtree] drivers: clock_control: nrf2_hfxo: impl resolve and startup_time" This reverts commit 4c363f3cf6f0294fb2ace3eafccb610dd3c1a444. Signed-off-by: Jukka Rissanen --- .../clock_control/clock_control_nrf2_hfxo.c | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf2_hfxo.c b/drivers/clock_control/clock_control_nrf2_hfxo.c index 1c8d6f8ed18..21d3d33f7e8 100644 --- a/drivers/clock_control/clock_control_nrf2_hfxo.c +++ b/drivers/clock_control/clock_control_nrf2_hfxo.c @@ -271,39 +271,6 @@ static int init_hfxo(const struct device *dev) return 0; } -static int api_resolve(const struct device *dev, - const struct nrf_clock_spec *req_spec, - struct nrf_clock_spec *res_spec) -{ - const struct dev_config_hfxo *dev_config = dev->config; - - if (!is_clock_spec_valid(dev, req_spec)) { - return -EINVAL; - } - - res_spec->frequency = dev_config->fixed_frequency; - res_spec->accuracy = dev_config->fixed_accuracy; - res_spec->precision = NRF_CLOCK_CONTROL_PRECISION_HIGH; - return 0; -} - -static int api_get_startup_time(const struct device *dev, - const struct nrf_clock_spec *spec, - uint32_t *startup_time_us) -{ - if (!is_clock_spec_valid(dev, spec)) { - return -EINVAL; - } - - *startup_time_us = nrf_bicr_hfxo_startup_time_us_get(BICR); - - if (*startup_time_us == NRF_BICR_HFXO_STARTUP_TIME_UNCONFIGURED) { - return -EINVAL; - } - - return 0; -} - static DEVICE_API(nrf_clock_control, drv_api_hfxo) = { .std_api = { .on = api_nosys_on_off, @@ -313,8 +280,6 @@ static DEVICE_API(nrf_clock_control, drv_api_hfxo) = { .request = api_request_hfxo, .release = api_release_hfxo, .cancel_or_release = api_cancel_or_release_hfxo, - .resolve = api_resolve, - .get_startup_time = api_get_startup_time, }; static struct dev_data_hfxo data_hfxo; From 213c32375475e14c38a19b7456e515729eeba3a3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 695/881] Revert "[nrf fromtree] drivers: clock_control: nrf_clock_control: introduce startup time" This reverts commit a73cec112a62c1e7bd66b7bb0e2d9a5d0b910824. Signed-off-by: Jukka Rissanen --- .../drivers/clock_control/nrf_clock_control.h | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/include/zephyr/drivers/clock_control/nrf_clock_control.h b/include/zephyr/drivers/clock_control/nrf_clock_control.h index d12dca3c074..a50128cad43 100644 --- a/include/zephyr/drivers/clock_control/nrf_clock_control.h +++ b/include/zephyr/drivers/clock_control/nrf_clock_control.h @@ -207,9 +207,6 @@ __subsystem struct nrf_clock_control_driver_api { int (*resolve)(const struct device *dev, const struct nrf_clock_spec *req_spec, struct nrf_clock_spec *res_spec); - int (*get_startup_time)(const struct device *dev, - const struct nrf_clock_spec *spec, - uint32_t *startup_time_us); }; /** @@ -354,29 +351,6 @@ static inline int nrf_clock_control_resolve(const struct device *dev, return api->resolve(dev, req_spec, res_spec); } -/** - * @brief Get the startup timme of a clock. - * - * @param dev Device structure. - * @param startup_time_us Destination for startup time in microseconds. - * - * @retval Successful if successful. - * @retval -errno code if failure. - */ -static inline int nrf_clock_control_get_startup_time(const struct device *dev, - const struct nrf_clock_spec *spec, - uint32_t *startup_time_us) -{ - const struct nrf_clock_control_driver_api *api = - (const struct nrf_clock_control_driver_api *)dev->api; - - if (api->get_startup_time == NULL) { - return -ENOSYS; - } - - return api->get_startup_time(dev, spec, startup_time_us); -} - /** @brief Request the HFXO from Zero Latency Interrupt context. * * Function is optimized for use in Zero Latency Interrupt context. From 27f4ea8524b69576c6f3d2a8f8f984642d580d07 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 696/881] Revert "[nrf fromtree] drivers: clock_control: nrf_clock_control: introduce resolve API" This reverts commit 7c93a60e3b88af43e5af9b92b432067623a55768. Signed-off-by: Jukka Rissanen --- .../drivers/clock_control/nrf_clock_control.h | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/include/zephyr/drivers/clock_control/nrf_clock_control.h b/include/zephyr/drivers/clock_control/nrf_clock_control.h index a50128cad43..bbc581f96c4 100644 --- a/include/zephyr/drivers/clock_control/nrf_clock_control.h +++ b/include/zephyr/drivers/clock_control/nrf_clock_control.h @@ -204,9 +204,6 @@ __subsystem struct nrf_clock_control_driver_api { int (*cancel_or_release)(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli); - int (*resolve)(const struct device *dev, - const struct nrf_clock_spec *req_spec, - struct nrf_clock_spec *res_spec); }; /** @@ -327,30 +324,6 @@ int nrf_clock_control_cancel_or_release(const struct device *dev, return api->cancel_or_release(dev, spec, cli); } -/** - * @brief Resolve a requested clock spec to resulting spec. - * - * @param dev Device structure. - * @param req_spec The requested clock specification. - * @param res_spec Destination for the resulting clock specification. - * - * @retval Successful if successful. - * @retval -errno code if failure - */ -static inline int nrf_clock_control_resolve(const struct device *dev, - const struct nrf_clock_spec *req_spec, - struct nrf_clock_spec *res_spec) -{ - const struct nrf_clock_control_driver_api *api = - (const struct nrf_clock_control_driver_api *)dev->api; - - if (api->resolve == NULL) { - return -ENOSYS; - } - - return api->resolve(dev, req_spec, res_spec); -} - /** @brief Request the HFXO from Zero Latency Interrupt context. * * Function is optimized for use in Zero Latency Interrupt context. From db1fc291f62515cd005610b31585523decdebc20 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 697/881] Revert "[nrf fromtree] drivers: serial: nrfx_uarte: Add workaround for FRAMETIMEOUT corner case" This reverts commit 68df545336a99b9a7db9bc193d537c636ea989ec. Signed-off-by: Jukka Rissanen --- drivers/serial/uart_nrfx_uarte.c | 47 ++------------------------------ 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 55aea85f3d3..05ffa453570 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -95,17 +95,6 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); #define UARTE_HAS_FRAME_TIMEOUT 1 #endif -/* Frame timeout has a bug that countdown counter may not be triggered in some - * specific condition. It may happen if RX is manually started after ENDRX (STOPRX - * task was not triggered) and there is ongoing reception of a byte. RXDRDY event - * triggered by the reception of that byte may not trigger frame timeout counter. - * If this is the last byte of a transfer then without the workaround there will - * be no expected RX timeout. - */ -#ifdef UARTE_HAS_FRAME_TIMEOUT -#define RX_FRAMETIMEOUT_WORKAROUND 1 -#endif - #define INSTANCE_NEEDS_CACHE_MGMT(unused, prefix, i, prop) UARTE_IS_CACHEABLE(prefix##i) #if UARTE_FOR_EACH_INSTANCE(INSTANCE_NEEDS_CACHE_MGMT, (+), (0), _) @@ -262,8 +251,6 @@ struct uarte_nrfx_data { #define UARTE_FLAG_LOW_POWER (UARTE_FLAG_LOW_POWER_TX | UARTE_FLAG_LOW_POWER_RX) #define UARTE_FLAG_TRIG_RXTO BIT(2) #define UARTE_FLAG_POLL_OUT BIT(3) -/* Flag indicating that a workaround for not working frame timeout is active. */ -#define UARTE_FLAG_FTIMEOUT_WATCH BIT(4) /* If enabled then ENDTX is PPI'ed to TXSTOP */ #define UARTE_CFG_FLAG_PPI_ENDTX BIT(0) @@ -1330,22 +1317,9 @@ static void rx_timeout(struct k_timer *timer) NRF_UARTE_Type *uarte = get_uarte_instance(dev); #ifdef UARTE_HAS_FRAME_TIMEOUT - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - bool rxdrdy = nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY); - - if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND) && - (atomic_and(&data->flags, ~UARTE_FLAG_FTIMEOUT_WATCH) & UARTE_FLAG_FTIMEOUT_WATCH)) { - if (rxdrdy) { - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); - k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); - } - } else { - if (!rxdrdy) { - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - } + if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY)) { + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); } - return; #else /* UARTE_HAS_FRAME_TIMEOUT */ struct uarte_nrfx_data *data = dev->data; @@ -1571,7 +1545,6 @@ static void endrx_isr(const struct device *dev) async_rx->offset = 0; if (async_rx->enabled) { - bool start_timeout = false; /* If there is a next buffer, then STARTRX will have already been * invoked by the short (the next buffer will be filling up already) * and here we just do the swap of which buffer the driver is following, @@ -1597,11 +1570,6 @@ static void endrx_isr(const struct device *dev) */ if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED)) { nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); - if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND)) { - data->flags |= UARTE_FLAG_FTIMEOUT_WATCH; - start_timeout = true; - } } /* Remove the short until the subsequent next buffer is setup */ nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); @@ -1610,11 +1578,6 @@ static void endrx_isr(const struct device *dev) } irq_unlock(key); - if (IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) { - if (start_timeout && !K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { - k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); - } - } } #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) @@ -1672,12 +1635,6 @@ static void rxto_isr(const struct device *dev) struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; - if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND)) { - if (atomic_test_and_clear_bit(&data->flags, UARTE_FLAG_FTIMEOUT_WATCH)) { - k_timer_stop(&async_rx->timer); - } - } - if (async_rx->buf) { #ifdef CONFIG_HAS_NORDIC_DMM (void)dmm_buffer_in_release(config->mem_reg, async_rx->usr_buf, 0, async_rx->buf); From 8a30ff2c52f3e4e83927a392d014dd1c7d7b446b Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 698/881] Revert "[nrf fromtree] net: sockets_offload: Fix build error with NO_OPTIMIZATIONS" This reverts commit 08ad1f291223f24d71a6345574f1d858f101e32c. Signed-off-by: Jukka Rissanen --- include/zephyr/net/socket_offload.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/zephyr/net/socket_offload.h b/include/zephyr/net/socket_offload.h index ad86de887f3..4dcf27250b4 100644 --- a/include/zephyr/net/socket_offload.h +++ b/include/zephyr/net/socket_offload.h @@ -67,7 +67,10 @@ void socket_offload_dns_enable(bool enable); #if defined(CONFIG_NET_SOCKETS_OFFLOAD) bool socket_offload_dns_is_enabled(void); #else -#define socket_offload_dns_is_enabled() false +static inline bool socket_offload_dns_is_enabled(void) +{ + return false; +} #endif /* defined(CONFIG_NET_SOCKETS_OFFLOAD) */ From 777c629c4711ca74d98dcc4a723ece650af819a3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 699/881] Revert "[nrf fromtree] drivers: cache: nrf: Resolve NRF_CACHE_HAS_LINEADDR issue" This reverts commit bd14c2e7fe86abcccaf178f70005607cb98508cf. Signed-off-by: Jukka Rissanen --- drivers/cache/cache_nrf.c | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/drivers/cache/cache_nrf.c b/drivers/cache/cache_nrf.c index 6a9a4b6b49e..3cf79897874 100644 --- a/drivers/cache/cache_nrf.c +++ b/drivers/cache/cache_nrf.c @@ -94,7 +94,6 @@ static inline int _cache_all(NRF_CACHE_Type *cache, enum k_nrf_cache_op op) return 0; } -#if NRF_CACHE_HAS_LINEADDR static inline void _cache_line(NRF_CACHE_Type *cache, enum k_nrf_cache_op op, uintptr_t line_addr) { do { @@ -161,7 +160,7 @@ static inline int _cache_checks(NRF_CACHE_Type *cache, enum k_nrf_cache_op op, v size_t size, bool is_range) { /* Check if the cache is enabled */ - if (!nrf_cache_enable_check(cache)) { + if (!(cache->ENABLE & CACHE_ENABLE_ENABLE_Enabled)) { return -EAGAIN; } @@ -176,16 +175,6 @@ static inline int _cache_checks(NRF_CACHE_Type *cache, enum k_nrf_cache_op op, v return _cache_range(cache, op, addr, size); } -#else -static inline int _cache_all_checks(NRF_CACHE_Type *cache, enum k_nrf_cache_op op) -{ - /* Check if the cache is enabled */ - if (!nrf_cache_enable_check(cache)) { - return -EAGAIN; - } - return _cache_all(cache, op); -} -#endif /* NRF_CACHE_HAS_LINEADDR */ #if defined(NRF_DCACHE) && NRF_CACHE_HAS_TASKS @@ -307,11 +296,7 @@ void cache_instr_disable(void) int cache_instr_flush_all(void) { #if NRF_CACHE_HAS_TASK_CLEAN -#if NRF_CACHE_HAS_LINEADDR return _cache_checks(NRF_ICACHE, K_NRF_CACHE_CLEAN, NULL, 0, false); -#else - return _cache_all_checks(NRF_ICACHE, K_NRF_CACHE_CLEAN); -#endif #else return -ENOTSUP; #endif @@ -319,21 +304,13 @@ int cache_instr_flush_all(void) int cache_instr_invd_all(void) { -#if NRF_CACHE_HAS_LINEADDR return _cache_checks(NRF_ICACHE, K_NRF_CACHE_INVD, NULL, 0, false); -#else - return _cache_all_checks(NRF_ICACHE, K_NRF_CACHE_INVD); -#endif } int cache_instr_flush_and_invd_all(void) { #if NRF_CACHE_HAS_TASK_FLUSH -#if NRF_CACHE_HAS_LINEADDR return _cache_checks(NRF_ICACHE, K_NRF_CACHE_FLUSH, NULL, 0, false); -#else - return _cache_all_checks(NRF_ICACHE, K_NRF_CACHE_FLUSH); -#endif #else return -ENOTSUP; #endif @@ -341,7 +318,7 @@ int cache_instr_flush_and_invd_all(void) int cache_instr_flush_range(void *addr, size_t size) { -#if NRF_CACHE_HAS_TASK_CLEAN && NRF_CACHE_HAS_LINEADDR +#if NRF_CACHE_HAS_TASK_CLEAN return _cache_checks(NRF_ICACHE, K_NRF_CACHE_CLEAN, addr, size, true); #else return -ENOTSUP; @@ -350,16 +327,12 @@ int cache_instr_flush_range(void *addr, size_t size) int cache_instr_invd_range(void *addr, size_t size) { -#if NRF_CACHE_HAS_LINEADDR return _cache_checks(NRF_ICACHE, K_NRF_CACHE_INVD, addr, size, true); -#else - return -ENOTSUP; -#endif } int cache_instr_flush_and_invd_range(void *addr, size_t size) { -#if NRF_CACHE_HAS_TASK_FLUSH && NRF_CACHE_HAS_LINEADDR +#if NRF_CACHE_HAS_TASK_FLUSH return _cache_checks(NRF_ICACHE, K_NRF_CACHE_FLUSH, addr, size, true); #else return -ENOTSUP; From 5c61b6dda997368b8764d3f0c13fdc24a093d300 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 700/881] Revert "[nrf fromlist] drivers: nrf_wifi: Add Kconfig for Dynamic ED" This reverts commit e69c07a1c917de8a5827f0cb77704226e9b015a4. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 8980cce8205..e0a39f2123e 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -913,10 +913,4 @@ config NRF_WIFI_DYNAMIC_BANDWIDTH_SIGNALLING bool "Dynamic bandwidth signalling for Wi-Fi" help This option enables support for dynamic bandwidth signalling. - -config NRF_WIFI_DYNAMIC_ED - bool "Dynamic ED" - help - This option enables support for proprietary algorithm to - enhance performance in high-traffic channels. endif # WIFI_NRF70 From a96ad3ac42abeb191a51e50957ccae82a4416d8e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 701/881] Revert "[nrf fromlist] manifest: Update nrf_wifi for dynamic ED control" This reverts commit b3c8104b597559980411045606fb8faf2243673f. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 76ca9284ec8..5105d7c83f6 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: c6296f600a6851bd652f207ab4908d339e1ce705 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 7cb2f44f46dfc86e4f97477ee90022944e138dd8 + revision: 294314b8622bfa582f43b229504d42201e1a3443 path: modules/lib/nrf_wifi - name: open-amp revision: f7f4d083c7909a39d86e217376c69b416ec4faf3 From 24e3f25a19e7fbd327370791bd16705c762b562e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 702/881] Revert "[nrf fromtree] drivers: nrf_wifi: Add Kconfig for Dynamic Bandwidth Signalling" This reverts commit 5924412ad01bbc394672058d1eb3952164158c3e. Signed-off-by: Jukka Rissanen --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index e0a39f2123e..ade3b5de5cf 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -908,9 +908,4 @@ config NRF_WIFI_RX_STBC_HT help Receive packets encoded with STBC (Space-Time Block Coding) in HT (Wi-Fi4) mode. - -config NRF_WIFI_DYNAMIC_BANDWIDTH_SIGNALLING - bool "Dynamic bandwidth signalling for Wi-Fi" - help - This option enables support for dynamic bandwidth signalling. endif # WIFI_NRF70 From a6971038c7268a49caa7b75728e57eb102400a38 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 703/881] Revert "[nrf fromtree] manifest: Update nrf_wifi for dynamic bandwidth signal controlling" This reverts commit bce4d0f565ee8af9b43219a62c3d25c1069b3ad5. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 5105d7c83f6..1509f37e62b 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: c6296f600a6851bd652f207ab4908d339e1ce705 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 294314b8622bfa582f43b229504d42201e1a3443 + revision: 1c1a7003ce90e492590c4a8a604eb9881bc8c5c1 path: modules/lib/nrf_wifi - name: open-amp revision: f7f4d083c7909a39d86e217376c69b416ec4faf3 From 7bb986b7d67a235856e17657d7d9bf1bc7ac2ae8 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 704/881] Revert "[nrf fromtree] manifest: nrf_wifi: Pull TX optimization" This reverts commit 513fef7af575b82f46db08646f453368c8bb5785. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 1509f37e62b..609c9f20a4f 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: c6296f600a6851bd652f207ab4908d339e1ce705 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 1c1a7003ce90e492590c4a8a604eb9881bc8c5c1 + revision: 0cd7f28d34a5279cd839940c199658a294165722 path: modules/lib/nrf_wifi - name: open-amp revision: f7f4d083c7909a39d86e217376c69b416ec4faf3 From cdb90c128d8babca6adb9a27abbf96ce3d80b2bf Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 705/881] Revert "[nrf fromtree] west: runners: Add ncs-provision to west flash command" This reverts commit 19af3cf53098543f5a88cce7d89a924b49fa7944. Signed-off-by: Jukka Rissanen --- scripts/west_commands/runners/nrf_common.py | 8 -------- scripts/west_commands/runners/nrfutil.py | 2 -- 2 files changed, 10 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index a6af477c61a..af4f8286722 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -469,14 +469,6 @@ def program_hex(self): core = "Application" self.op_program(self.hex_, erase_arg, ext_mem_erase_opt, defer=True, core=core) - - if self.erase or self.recover: - # provision keys if keyfile.json exists in the build directory - keyfile = Path(self.cfg.build_dir).parent / 'keyfile.json' - if keyfile.exists(): - self.logger.info(f'Provisioning key file: {keyfile}') - self.exec_op('x-provision-keys', keyfile=str(keyfile), defer=True) - self.flush(force=False) diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index f11d2a7ad13..1fb44949507 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -147,8 +147,6 @@ def _append_batch(self, op, json_file): cmd += ['--reset-kind', _op['kind']] elif op_type == 'erase': cmd.append(f'--{_op["kind"]}') - elif op_type == 'x-provision-keys': - cmd += ['--key-file', _op['keyfile']] cmd += ['--core', op['core']] if op.get('core') else [] cmd += ['--x-family', f'{self.family}'] From 0ccae2cd48dca4f8822d86c5b4e4a55c8af6abe2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 706/881] Revert "[nrf fromlist] manifest: update hal_nordic for errata 55 on nRF54LV10A Eng A" This reverts commit c4d342e3dd69d38adf8795022ddcbff4796cddfd. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 609c9f20a4f..53b29c849ca 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 71308dc6d8c021887ce5d98a36cafe9517375a91 + revision: 6e39d4f2b078afaebdb84875089486152fcacb9c path: modules/hal/nordic groups: - hal From 94e7990d9a20185ce0c2df50a310d013525ff09d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 707/881] Revert "[nrf fromtree] tests: drivers: i2s: Add i2s_additional tests" This reverts commit 47939c23763333f501a79764f2aff9eaf56fe962. Signed-off-by: Jukka Rissanen --- .../drivers/i2s/i2s_additional/CMakeLists.txt | 9 - tests/drivers/i2s/i2s_additional/Kconfig | 168 ---- .../boards/nrf52840dk_nrf52840.conf | 1 - .../boards/nrf52840dk_nrf52840.overlay | 28 - .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 32 - .../nrf5340dk_nrf5340_cpuapp_aclk.overlay | 9 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 31 - .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 30 - tests/drivers/i2s/i2s_additional/prj.conf | 2 - tests/drivers/i2s/i2s_additional/src/main.c | 850 ------------------ .../drivers/i2s/i2s_additional/testcase.yaml | 39 - 11 files changed, 1199 deletions(-) delete mode 100644 tests/drivers/i2s/i2s_additional/CMakeLists.txt delete mode 100644 tests/drivers/i2s/i2s_additional/Kconfig delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf52840dk_nrf52840.conf delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf52840dk_nrf52840.overlay delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf5340dk_nrf5340_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_additional/prj.conf delete mode 100644 tests/drivers/i2s/i2s_additional/src/main.c delete mode 100644 tests/drivers/i2s/i2s_additional/testcase.yaml diff --git a/tests/drivers/i2s/i2s_additional/CMakeLists.txt b/tests/drivers/i2s/i2s_additional/CMakeLists.txt deleted file mode 100644 index 490a0ddb7d6..00000000000 --- a/tests/drivers/i2s/i2s_additional/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(i2s_additional) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/i2s/i2s_additional/Kconfig b/tests/drivers/i2s/i2s_additional/Kconfig deleted file mode 100644 index 3c80dba4853..00000000000 --- a/tests/drivers/i2s/i2s_additional/Kconfig +++ /dev/null @@ -1,168 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -mainmenu "I2S Additional Test" - -source "Kconfig.zephyr" - -config I2S_TEST_USE_GPIO_LOOPBACK - bool "Use GPIO loopback" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - help - Use wiring between the data-out and data-in pins for looping back - data. This option is intended to be used for devices that do not - provide the internal loopback functionality. - -config I2S_TEST_ALLOWED_DATA_OFFSET - int "Allowed offset in received data" - default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - default 0 - help - Maximum allowed offset between sent and received samples. Non-zero - value of this option may be needed when GPIO loopback is used. - -config I2S_TEST_WORD_SIZE_8_BIT_UNSUPPORTED - bool "8 bit word size is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_WORD_SIZE_16_BIT_UNSUPPORTED - bool "16 bit word size is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_WORD_SIZE_24_BIT_UNSUPPORTED - bool "24 bit word size is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED - bool "32 bit word size is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_WORD_SIZE_48_BIT_UNSUPPORTED - bool "48 bit word size is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_ONE_CHANNEL_UNSUPPORTED - bool "Single audio channel is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_FOUR_CHANNELS_UNSUPPORTED - bool "Four audio channels are not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED - bool "Eight audio channels are not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_DATA_FORMAT_I2S_UNSUPPORTED - bool "I2S_FMT_DATA_FORMAT_I2S is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_DATA_FORMAT_LEFT_JUSTIFIED_UNSUPPORTED - bool "I2S_FMT_DATA_FORMAT_LEFT_JUSTIFIED is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_DATA_FORMAT_RIGHT_JUSTIFIED_UNSUPPORTED - bool "I2S_FMT_DATA_FORMAT_RIGHT_JUSTIFIED is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_DATA_FORMAT_PCM_LONG_UNSUPPORTED - bool "I2S_FMT_DATA_FORMAT_PCM_LONG is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_DATA_FORMAT_PCM_SHORT_UNSUPPORTED - bool "I2S_FMT_DATA_FORMAT_PCM_SHORT is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_DATA_ORDER_MSB_UNSUPPORTED - bool "I2S_FMT_DATA_ORDER_MSB is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_DATA_ORDER_LSB_UNSUPPORTED - bool "I2S_FMT_DATA_ORDER_LSB is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_BIT_CLK_INV_UNSUPPORTED - bool "I2S_FMT_BIT_CLK_INV is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_FRAME_CLK_INV_UNSUPPORTED - bool "I2S_FMT_FRAME_CLK_INV is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_BLOCK_SIZE_6_UNSUPPORTED - bool "Block_size of 6 is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_OPTIONS_BIT_CLK_CONT_UNSUPPORTED - bool "I2S_OPT_BIT_CLK_CONT is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_OPTIONS_BIT_CLK_GATED_UNSUPPORTED - bool "I2S_OPT_BIT_CLK_GATED is not supported by the driver" - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_OPTIONS_LOOPBACK_UNSUPPORTED - bool "I2S_OPT_LOOPBACK is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. - -config I2S_TEST_OPTIONS_PINGPONG_UNSUPPORTED - bool "I2S_OPT_PINGPONG is not supported by the driver" - default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED - help - When set to 'y', test will check that i2s_configure() returns -EINVAL. - When set to 'n', test will do the transmission. diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf52840dk_nrf52840.conf b/tests/drivers/i2s/i2s_additional/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index 8ed6ee234db..00000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED=y diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf52840dk_nrf52840.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf52840dk_nrf52840.overlay deleted file mode 100644 index ca21135bca4..00000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf52840dk_nrf52840.overlay +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - i2s-node0 = &i2s0; - }; -}; - -&pinctrl { - i2s0_default_alt: i2s0_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&i2s0 { - status = "okay"; - pinctrl-0 = <&i2s0_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf5340dk_nrf5340_cpuapp.overlay deleted file mode 100644 index a4c595b1bcd..00000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - i2s-node0 = &i2s0; - }; -}; - -&pinctrl { - i2s0_default_alt: i2s0_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&uart1 { - status = "disabled"; -}; - -&i2s0 { - status = "okay"; - pinctrl-0 = <&i2s0_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay deleted file mode 100644 index e262ca8d8a8..00000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* Drive i2s peripheral from ACLK. */ - -&clock { - hfclkaudio-frequency = <11289600>; -}; - -&i2s0 { - clock-source = "ACLK"; -}; diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 7734b5cf284..00000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm130; - }; -}; - -&pinctrl { - tdm130_default_alt: tdm130_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&tdm130 { - status = "okay"; - pinctrl-0 = <&tdm130_default_alt>; - pinctrl-names = "default"; - memory-regions = <&cpuapp_dma_region>; -}; diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index c8ede4b8c2b..00000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &i2s20; - }; -}; - -&pinctrl { - i2s20_default_alt: i2s20_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&i2s20 { - status = "okay"; - pinctrl-0 = <&i2s20_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/i2s/i2s_additional/prj.conf b/tests/drivers/i2s/i2s_additional/prj.conf deleted file mode 100644 index 99ff252406a..00000000000 --- a/tests/drivers/i2s/i2s_additional/prj.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_I2S=y -CONFIG_ZTEST=y diff --git a/tests/drivers/i2s/i2s_additional/src/main.c b/tests/drivers/i2s/i2s_additional/src/main.c deleted file mode 100644 index e8852850cee..00000000000 --- a/tests/drivers/i2s/i2s_additional/src/main.c +++ /dev/null @@ -1,850 +0,0 @@ -/* - * Copyright (c) 2017 comsuisse AG - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -#include -LOG_MODULE_REGISTER(i2s_add, LOG_LEVEL_INF); - -#define I2S_DEV_NODE DT_ALIAS(i2s_node0) - -#define WORD_SIZE 16U -#define NUMBER_OF_CHANNELS 2 -#define FRAME_CLK_FREQ 44100 - -#define NUM_BLOCKS 20 -#define TIMEOUT 1000 - -#define SAMPLES_COUNT 64 - -/* The data_l represent a sine wave */ -static int16_t data_l[SAMPLES_COUNT] = { - 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, - 25329, 27244, 28897, 30272, 31356, 32137, 32609, 32767, - 32609, 32137, 31356, 30272, 28897, 27244, 25329, 23169, - 20787, 18204, 15446, 12539, 9511, 6392, 3211, 0, - -3212, -6393, -9512, -12540, -15447, -18205, -20788, -23170, - -25330, -27245, -28898, -30273, -31357, -32138, -32610, -32767, - -32610, -32138, -31357, -30273, -28898, -27245, -25330, -23170, - -20788, -18205, -15447, -12540, -9512, -6393, -3212, -1, -}; - -/* The data_r represent a sine wave shifted by 90 deg to data_l sine wave */ -static int16_t data_r[SAMPLES_COUNT] = { - 32609, 32137, 31356, 30272, 28897, 27244, 25329, 23169, - 20787, 18204, 15446, 12539, 9511, 6392, 3211, 0, - -3212, -6393, -9512, -12540, -15447, -18205, -20788, -23170, - -25330, -27245, -28898, -30273, -31357, -32138, -32610, -32767, - -32610, -32138, -31357, -30273, -28898, -27245, -25330, -23170, - -20788, -18205, -15447, -12540, -9512, -6393, -3212, -1, - 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, - 25329, 27244, 28897, 30272, 31356, 32137, 32609, 32767, -}; - -#define BLOCK_SIZE (2 * sizeof(data_l)) - -#ifdef CONFIG_NOCACHE_MEMORY - #define MEM_SLAB_CACHE_ATTR __nocache -#else - #define MEM_SLAB_CACHE_ATTR -#endif /* CONFIG_NOCACHE_MEMORY */ - -/* - * NUM_BLOCKS is the number of blocks used by the test. Some of the drivers, - * permanently keep ownership of a few RX buffers. Add a two more - * RX blocks to satisfy this requirement - */ -static char MEM_SLAB_CACHE_ATTR __aligned(WB_UP(32)) - _k_mem_slab_buf_rx_0_mem_slab[(NUM_BLOCKS + 2) * WB_UP(BLOCK_SIZE)]; -STRUCT_SECTION_ITERABLE(k_mem_slab, rx_0_mem_slab) = - Z_MEM_SLAB_INITIALIZER(rx_0_mem_slab, _k_mem_slab_buf_rx_0_mem_slab, - WB_UP(BLOCK_SIZE), NUM_BLOCKS + 2); - -static char MEM_SLAB_CACHE_ATTR __aligned(WB_UP(32)) - _k_mem_slab_buf_tx_0_mem_slab[(NUM_BLOCKS) * WB_UP(BLOCK_SIZE)]; -STRUCT_SECTION_ITERABLE(k_mem_slab, tx_0_mem_slab) = - Z_MEM_SLAB_INITIALIZER(tx_0_mem_slab, _k_mem_slab_buf_tx_0_mem_slab, - WB_UP(BLOCK_SIZE), NUM_BLOCKS); - -static const struct device *dev_i2s; - -static const struct i2s_config default_i2s_cfg = { - .word_size = WORD_SIZE, - .channels = NUMBER_OF_CHANNELS, - .format = I2S_FMT_DATA_FORMAT_I2S, - .frame_clk_freq = FRAME_CLK_FREQ, - .block_size = BLOCK_SIZE, - .timeout = TIMEOUT, -#if defined(CONFIG_I2S_TEST_USE_GPIO_LOOPBACK) - .options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER, -#else - .options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER | I2S_OPT_LOOPBACK, -#endif - .mem_slab = &tx_0_mem_slab, -}; - -#if (CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET > 0) -/* Data offset may differ when test uses I2S with different configuration. */ -static int offset; -static int16_t word_size_bytes; -static int16_t sample_in_bytes; -#endif - -/* Fill in TX buffer with test samples. */ -static void fill_buf(int16_t *tx_block, uint8_t word_size) -{ - - /* Technically, this is correct for word_size of 16 bits only - * (incorrect for word_size of 8, 24 and 32 bit). - * However, tests checks if received bytes are identical to - * the transmitted ones. Meaning of transmitted data is irrelevant. - */ - if (word_size == 24) { - int8_t *tx_block_8bit = (int8_t *) tx_block; - int8_t *data_l_8bit = (int8_t *) &data_l; - int8_t *data_r_8bit = (int8_t *) &data_r; - int16_t tx_cnt = 0; - int16_t l_cnt = 0; - int16_t r_cnt = 0; - - while (tx_cnt < BLOCK_SIZE) { - tx_block_8bit[tx_cnt++] = data_l_8bit[l_cnt++]; - tx_block_8bit[tx_cnt++] = data_l_8bit[l_cnt++]; - tx_block_8bit[tx_cnt++] = data_l_8bit[l_cnt++]; - tx_block_8bit[tx_cnt++] = 0; - tx_block_8bit[tx_cnt++] = data_r_8bit[r_cnt++]; - tx_block_8bit[tx_cnt++] = data_r_8bit[r_cnt++]; - tx_block_8bit[tx_cnt++] = data_r_8bit[r_cnt++]; - tx_block_8bit[tx_cnt++] = 0; - } - } else { - for (int i = 0; i < SAMPLES_COUNT; i++) { - tx_block[2 * i] = data_l[i]; - tx_block[2 * i + 1] = data_r[i]; - } - } -} - -static int verify_buf(int16_t *rx_block, uint8_t word_size, uint8_t channels) -{ - int sample_no = SAMPLES_COUNT; - bool same = true; - -/* Find offset. - * This doesn't handle correctly situation when - * word_size is 8 bit and offset is odd. - */ -#if (CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET > 0) - /* Offset -1 means that offset has to be detected. */ - if (offset < 0) { - LOG_HEXDUMP_DBG(rx_block, BLOCK_SIZE, "Received"); - - /* When word_size is: - * 8 bit, it occupies 8/8 = 1 byte, - * 16 bit, it occupies 16/8 = 2 bytes, - * 24 bit, it occupies 4 bytes, - * 32 bit, it occupies 32/8 = 4 bytes, - * in TX/RX buffers. - */ - word_size_bytes = (word_size == 24) ? 4 : word_size / 8; - LOG_DBG("word_size_bytes = %u", word_size_bytes); - - /* Offset is in 'samples'. - * - * One 'sample' is data for all channels: - * two channels, 8 bit word -> sample is 2 bytes - * two channels, 16 bit word -> sample is 4 bytes - * two channels, 24 bit word -> sample is 8 bytes (24 bit extended to 32 bit) - * two channels, 32 bit word -> sample is 8 bytes - */ - sample_in_bytes = channels * word_size_bytes; - LOG_DBG("sample_in_bytes = %u", sample_in_bytes); - - do { - ++offset; - if (offset > CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET) { - TC_PRINT("Allowed data offset (%d) exceeded\n", - CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET); - return -TC_FAIL; - } - } while (rx_block[offset * sample_in_bytes / 2] != data_l[0]); - TC_PRINT("Using data offset: %d (%u bytes)\n", offset, - offset * sample_in_bytes); - } - - /* Divided by 2 because rx_block is uint16 */ - rx_block += (offset * sample_in_bytes / 2); - sample_no -= (offset * word_size_bytes / 2); - LOG_DBG("sample_no = %u", sample_no); -#endif - - /* Compare received data with sent values. */ - if (word_size == 24) { - int8_t *rx_block_8bit = (int8_t *) rx_block; - int8_t *data_l_8bit = (int8_t *) &data_l; - int8_t *data_r_8bit = (int8_t *) &data_r; - int16_t rx_cnt = 0; - int16_t temp = 0; - int8_t expected = 0; - - while (rx_cnt < (BLOCK_SIZE - offset * sample_in_bytes)) { -/* Map byte number from RX array to channel array - * - * rx_cnt | l_index | r_index || rx_cnt/8 | rx_cnt%4 | (rx_cnt/8)*3+(rx_cnt%4) - * 0 | 0 | || 0 | 0 | 0*3+0 = 0 data_l - * 1 | 1 | || 0 | 1 | 0*3+1 = 1 data_l - * 2 | 2 | || 0 | 2 | 0*3+2 = 2 data_l - * 3 | - | || 0 | 3 | 0*3+3 = 3 ignore - * 4 | | 0 || 0 | 0 | 0*3+0 = 0 data_r - * 5 | | 1 || 0 | 1 | 0*3+1 = 1 data_r - * 6 | | 2 || 0 | 2 | 0*3+2 = 2 data_r - * 7 | | - || 0 | 3 | 0*3+3 = 3 ignore - * - * 8 | 3 | || 1 | 0 | 1*3+0 = 3 data_l - * 9 | 4 | || 1 | 1 | 1*3+1 = 4 data_l - * 10 | 5 | || 1 | 2 | 1*3+2 = 5 data_l - * 11 | - | || 1 | 3 | 1*3+3 = 6 ignore - * 12 | | 3 || 1 | 0 | 1*3+0 = 3 data_r - * 13 | | 4 || 1 | 1 | 1*3+1 = 4 data_r - * 14 | | 5 || 1 | 2 | 1*3+2 = 5 data_r - * 15 | | - || 1 | 3 | 1*3+3 = 6 ignore - * - * 16 | 6 | || 2 | 0 | 2*3+0 = 6 data_l - * ... - */ - temp = ((rx_cnt / 8) * 3) + (rx_cnt % 4); - - if ((rx_cnt % 8) < 4) { - /* Compare with left channel. */ - expected = data_l_8bit[temp]; - } else { - /* Compare with right channel. */ - expected = data_r_8bit[temp]; - } - - if ((rx_cnt % 4) == 3) { - /* Ignore every fourth byte */ - } else { - /* Compare received data with expected value. */ - if (rx_block_8bit[rx_cnt] != expected) { - TC_PRINT("Index %d, expected 0x%x, actual 0x%x\n", - rx_cnt, expected, rx_block_8bit[rx_cnt]); - same = false; - } - } - /* Move to next received byte. */ - rx_cnt++; - } - - } else { - for (int i = 0; i < sample_no; i++) { - if (rx_block[2 * i] != data_l[i]) { - TC_PRINT("data_l, index %d, expected 0x%x, actual 0x%x\n", - i, data_l[i], rx_block[2 * i]); - same = false; - } - if (rx_block[2 * i + 1] != data_r[i]) { - TC_PRINT("data_r, index %d, expected 0x%x, actual 0x%x\n", - i, data_r[i], rx_block[2 * i + 1]); - same = false; - } - } - } - - if (!same) { - return -TC_FAIL; - } else { - return TC_PASS; - } -} - -static int configure_stream(const struct device *dev, enum i2s_dir dir, - struct i2s_config *i2s_cfg) -{ - int ret; - - if (dir == I2S_DIR_TX) { - /* Configure the Transmit port as Master */ - i2s_cfg->options = I2S_OPT_FRAME_CLK_MASTER - | I2S_OPT_BIT_CLK_MASTER; - } else if (dir == I2S_DIR_RX) { - /* Configure the Receive port as Slave */ - i2s_cfg->options = I2S_OPT_FRAME_CLK_SLAVE - | I2S_OPT_BIT_CLK_SLAVE; - } else { /* dir == I2S_DIR_BOTH */ - i2s_cfg->options = I2S_OPT_FRAME_CLK_MASTER - | I2S_OPT_BIT_CLK_MASTER; - } - - if (dir == I2S_DIR_TX || dir == I2S_DIR_BOTH) { - i2s_cfg->mem_slab = &tx_0_mem_slab; - ret = i2s_configure(dev, I2S_DIR_TX, i2s_cfg); - if (ret < 0) { - TC_PRINT("Failed to configure I2S TX stream (%d)\n", - ret); - return -TC_FAIL; - } - } - - if (dir == I2S_DIR_RX || dir == I2S_DIR_BOTH) { - i2s_cfg->mem_slab = &rx_0_mem_slab; - ret = i2s_configure(dev, I2S_DIR_RX, i2s_cfg); - if (ret < 0) { - TC_PRINT("Failed to configure I2S RX stream (%d)\n", - ret); - return -TC_FAIL; - } - } - - return TC_PASS; -} - -static void i2s_dir_both_transfer_long(struct i2s_config *i2s_cfg) -{ - void *rx_block[NUM_BLOCKS]; - void *tx_block[NUM_BLOCKS]; - size_t rx_size; - int tx_idx; - int rx_idx = 0; - int num_verified; - int ret; - - /* Configure I2S Dir Both transfer. */ - ret = configure_stream(dev_i2s, I2S_DIR_BOTH, i2s_cfg); - zassert_equal(ret, TC_PASS); - - /* Prepare TX data blocks */ - for (tx_idx = 0; tx_idx < NUM_BLOCKS; tx_idx++) { - ret = k_mem_slab_alloc(&tx_0_mem_slab, &tx_block[tx_idx], - K_FOREVER); - zassert_equal(ret, 0); - fill_buf((uint16_t *)tx_block[tx_idx], i2s_cfg->word_size); - } - - LOG_HEXDUMP_DBG(tx_block[0], BLOCK_SIZE, "transmitted"); - - tx_idx = 0; - - /* Prefill TX queue */ - ret = i2s_write(dev_i2s, tx_block[tx_idx++], BLOCK_SIZE); - zassert_equal(ret, 0); - - ret = i2s_write(dev_i2s, tx_block[tx_idx++], BLOCK_SIZE); - zassert_equal(ret, 0); - - ret = i2s_trigger(dev_i2s, I2S_DIR_BOTH, I2S_TRIGGER_START); - zassert_equal(ret, 0, "RX/TX START trigger failed\n"); - - while (tx_idx < NUM_BLOCKS) { - ret = i2s_write(dev_i2s, tx_block[tx_idx++], BLOCK_SIZE); - zassert_equal(ret, 0); - - ret = i2s_read(dev_i2s, &rx_block[rx_idx++], &rx_size); - zassert_equal(ret, 0, "Got unexpected %d", ret); - zassert_equal(rx_size, BLOCK_SIZE); - } - - /* All data written, drain TX queue and stop both streams. */ - ret = i2s_trigger(dev_i2s, I2S_DIR_BOTH, I2S_TRIGGER_DRAIN); - zassert_equal(ret, 0, "RX/TX DRAIN trigger failed"); - - ret = i2s_read(dev_i2s, &rx_block[rx_idx++], &rx_size); - zassert_equal(ret, 0); - zassert_equal(rx_size, BLOCK_SIZE); - - ret = i2s_read(dev_i2s, &rx_block[rx_idx++], &rx_size); - zassert_equal(ret, 0); - zassert_equal(rx_size, BLOCK_SIZE); - - TC_PRINT("%d TX blocks sent\n", tx_idx); - TC_PRINT("%d RX blocks received\n", rx_idx); - - /* Verify received data */ - num_verified = 0; - for (rx_idx = 0; rx_idx < NUM_BLOCKS; rx_idx++) { - ret = verify_buf((uint16_t *)rx_block[rx_idx], - i2s_cfg->word_size, i2s_cfg->channels); - if (ret != 0) { - TC_PRINT("%d RX block invalid\n", rx_idx); - } else { - num_verified++; - } - k_mem_slab_free(&rx_0_mem_slab, rx_block[rx_idx]); - } - zassert_equal(num_verified, NUM_BLOCKS, "Invalid RX blocks received"); -} - -/** @brief Test I2S transfer with word_size_8bit - */ -ZTEST(i2s_additional, test_01a_word_size_08bit) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.word_size = 8; - -#if defined(CONFIG_I2S_TEST_WORD_SIZE_8_BIT_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with word_size_16bit - */ -ZTEST(i2s_additional, test_01b_word_size_16bit) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.word_size = 16; - -#if defined(CONFIG_I2S_TEST_WORD_SIZE_16_BIT_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with word_size_24bit - */ -ZTEST(i2s_additional, test_01c_word_size_24bit) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.word_size = 24; - -#if defined(CONFIG_I2S_TEST_WORD_SIZE_24_BIT_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with word_size_32bit - */ -ZTEST(i2s_additional, test_01d_word_size_32bit) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.word_size = 32; - -#if defined(CONFIG_I2S_TEST_WORD_SIZE_32_BIT_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with word_size_48bit - */ -ZTEST(i2s_additional, test_01e_word_size_48bit) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.word_size = 48; - -#if defined(CONFIG_I2S_TEST_WORD_SIZE_48_BIT_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with one channel. - */ -ZTEST(i2s_additional, test_02a_one_channel) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.channels = 1; - -#if defined(CONFIG_I2S_TEST_ONE_CHANNEL_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with four channels. - */ -ZTEST(i2s_additional, test_02b_four_channels) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.channels = 4; - -#if defined(CONFIG_I2S_TEST_FOUR_CHANNELS_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else /* CONFIG_I2S_TEST_FOUR_CHANNELS_UNSUPPORTED */ - - /* Select format that supports four channels. */ -#if !defined(CONFIG_I2S_TEST_DATA_FORMAT_PCM_LONG_UNSUPPORTED) - i2s_cfg.format = I2S_FMT_DATA_FORMAT_PCM_LONG; - TC_PRINT("Selected format is I2S_FMT_DATA_FORMAT_PCM_LONG\n"); -#elif !defined(CONFIG_I2S_TEST_DATA_FORMAT_PCM_SHORT_UNSUPPORTED) - i2s_cfg.format = I2S_FMT_DATA_FORMAT_PCM_SHORT; - TC_PRINT("Selected format is I2S_FMT_DATA_FORMAT_PCM_SHORT\n"); -#else -#error "Don't know what format supports four channels." -#endif - - i2s_dir_both_transfer_long(&i2s_cfg); -#endif /* CONFIG_I2S_TEST_FOUR_CHANNELS_UNSUPPORTED */ -} - -/** @brief Test I2S transfer with eight channels. - */ -ZTEST(i2s_additional, test_02c_eight_channels) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.channels = 8; - -#if defined(CONFIG_I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else /* CONFIG_I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED */ - - /* Select format that supports eight channels. */ -#if !defined(CONFIG_I2S_TEST_DATA_FORMAT_PCM_LONG_UNSUPPORTED) - i2s_cfg.format = I2S_FMT_DATA_FORMAT_PCM_LONG; - TC_PRINT("Selected format is I2S_FMT_DATA_FORMAT_PCM_LONG\n"); -#elif !defined(CONFIG_I2S_TEST_DATA_FORMAT_PCM_SHORT_UNSUPPORTED) - i2s_cfg.format = I2S_FMT_DATA_FORMAT_PCM_SHORT; - TC_PRINT("Selected format is I2S_FMT_DATA_FORMAT_PCM_SHORT\n"); -#else -#error "Don't know what format supports eight channels." -#endif - - i2s_dir_both_transfer_long(&i2s_cfg); -#endif /* CONFIG_I2S_TEST_EIGHT_CHANNELS_UNSUPPORTED */ -} - -/** @brief Test I2S transfer with format I2S_FMT_DATA_FORMAT_I2S - */ -ZTEST(i2s_additional, test_03a_format_i2s) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format = I2S_FMT_DATA_FORMAT_I2S; - -#if defined(CONFIG_I2S_TEST_DATA_FORMAT_I2S_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with format I2S_FMT_DATA_FORMAT_LEFT_JUSTIFIED - */ -ZTEST(i2s_additional, test_03b_format_left_justified) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format = I2S_FMT_DATA_FORMAT_LEFT_JUSTIFIED; - -#if defined(CONFIG_I2S_TEST_DATA_FORMAT_LEFT_JUSTIFIED_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with format I2S_FMT_DATA_FORMAT_RIGHT_JUSTIFIED - */ -ZTEST(i2s_additional, test_03c_format_right_justified) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format = I2S_FMT_DATA_FORMAT_RIGHT_JUSTIFIED; - -#if defined(CONFIG_I2S_TEST_DATA_FORMAT_RIGHT_JUSTIFIED_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with format I2S_FMT_DATA_FORMAT_PCM_LONG - */ -ZTEST(i2s_additional, test_03d_format_pcm_long) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format = I2S_FMT_DATA_FORMAT_PCM_LONG; - -#if defined(CONFIG_I2S_TEST_DATA_FORMAT_PCM_LONG_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with format I2S_FMT_DATA_FORMAT_PCM_SHORT - */ -ZTEST(i2s_additional, test_03e_format_pcm_short) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format = I2S_FMT_DATA_FORMAT_PCM_SHORT; - -#if defined(CONFIG_I2S_TEST_DATA_FORMAT_PCM_SHORT_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with format I2S_FMT_DATA_ORDER_MSB - */ -ZTEST(i2s_additional, test_04a_format_data_order_MSB) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format |= I2S_FMT_DATA_ORDER_MSB; - -#if defined(CONFIG_I2S_TEST_DATA_ORDER_MSB_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with format I2S_FMT_DATA_ORDER_LSB - */ -ZTEST(i2s_additional, test_04b_format_data_order_LSB) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format |= I2S_FMT_DATA_ORDER_LSB; - -#if defined(CONFIG_I2S_TEST_DATA_ORDER_LSB_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with format I2S_FMT_BIT_CLK_INV - */ -ZTEST(i2s_additional, test_05a_format_bit_clk_inv) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format |= I2S_FMT_BIT_CLK_INV; - -#if defined(CONFIG_I2S_TEST_BIT_CLK_INV_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with format I2S_FMT_FRAME_CLK_INV - */ -ZTEST(i2s_additional, test_05b_format_frame_clk_inv) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.format |= I2S_FMT_FRAME_CLK_INV; - -#if defined(CONFIG_I2S_TEST_FRAME_CLK_INV_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with block_size set to 6. - */ -ZTEST(i2s_additional, test_06_block_size_6) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.block_size = 6; - -#if defined(CONFIG_I2S_TEST_BLOCK_SIZE_6_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with I2S_OPT_BIT_CLK_CONT. - */ -ZTEST(i2s_additional, test_07a_options_bit_clk_cont) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.options |= I2S_OPT_BIT_CLK_CONT; - -#if defined(CONFIG_I2S_TEST_OPTIONS_BIT_CLK_CONT_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with I2S_OPT_BIT_CLK_GATED. - */ -ZTEST(i2s_additional, test_07b_options_bit_clk_gated) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.options |= I2S_OPT_BIT_CLK_GATED; - -#if defined(CONFIG_I2S_TEST_OPTIONS_BIT_CLK_GATED_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Check error when I2S is configured with unsupported - * combination of bit CLK and frame CLK options. - */ -ZTEST(i2s_additional, test_08_options_bit_frame_clk_mixed) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - int ret; - - i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_SLAVE; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); - - i2s_cfg.options = I2S_OPT_FRAME_CLK_SLAVE | I2S_OPT_BIT_CLK_MASTER; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -} - -/** @brief Test I2S transfer with I2S_OPT_LOOPBACK. - */ -ZTEST(i2s_additional, test_09a_options_loopback) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.options |= I2S_OPT_LOOPBACK; - -#if defined(CONFIG_I2S_TEST_OPTIONS_LOOPBACK_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -/** @brief Test I2S transfer with I2S_OPT_PINGPONG. - */ -ZTEST(i2s_additional, test_09b_options_pingpong) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - - i2s_cfg.options |= I2S_OPT_PINGPONG; - -#if defined(CONFIG_I2S_TEST_OPTIONS_LOOPBACK_UNSUPPORTED) - int ret; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_equal(ret, -EINVAL, "Unexpected result %d", ret); -#else - i2s_dir_both_transfer_long(&i2s_cfg); -#endif -} - -static void *suite_setup(void) -{ - /* Check I2S Device. */ - dev_i2s = DEVICE_DT_GET_OR_NULL(I2S_DEV_NODE); - zassert_not_null(dev_i2s, "I2S device not found"); - zassert(device_is_ready(dev_i2s), "I2S device not ready"); - - LOG_HEXDUMP_DBG(&data_l, 2 * SAMPLES_COUNT, "data_l"); - LOG_HEXDUMP_DBG(&data_r, 2 * SAMPLES_COUNT, "data_r"); - TC_PRINT("===================================================================\n"); - - return 0; -} - -static void before(void *not_used) -{ - ARG_UNUSED(not_used); - -#if (CONFIG_I2S_TEST_ALLOWED_DATA_OFFSET > 0) - /* Data offset may differ when test uses I2S - * with different configuration. - * Force offset callculation for every test. - */ - offset = -1; -#endif -} - -ZTEST_SUITE(i2s_additional, NULL, suite_setup, before, NULL, NULL); diff --git a/tests/drivers/i2s/i2s_additional/testcase.yaml b/tests/drivers/i2s/i2s_additional/testcase.yaml deleted file mode 100644 index c45a5482b7f..00000000000 --- a/tests/drivers/i2s/i2s_additional/testcase.yaml +++ /dev/null @@ -1,39 +0,0 @@ -common: - tags: - - drivers - - i2s - depends_on: - - i2s - - gpio - filter: CONFIG_I2S_TEST_USE_GPIO_LOOPBACK - harness: ztest - -tests: - drivers.i2s.additional.gpio_loopback: - harness_config: - fixture: gpio_loopback - platform_allow: - - nrf52840dk/nrf52840 - - nrf5340dk/nrf5340/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - integration_platforms: - - nrf52840dk/nrf52840 - - nrf5340dk/nrf5340/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - - drivers.i2s.additional.gpio_loopback.54h: - harness_config: - fixture: i2s_loopback - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - - drivers.i2s.additional.gpio_loopback.aclk: - harness_config: - fixture: gpio_loopback - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf5340dk_nrf5340_cpuapp_aclk.overlay" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - integration_platforms: - - nrf5340dk/nrf5340/cpuapp From 8a3a0951d7c4c1155d74027055a38bc8372c1b3d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:37 +0300 Subject: [PATCH 708/881] Revert "[nrf fromlist] tests: drivers: timer: nrf_grtc_timer: Align tests with uptime changes" This reverts commit 6b5f7ae654a14942896d7165b0efe69ed2af0e0a. Signed-off-by: Jukka Rissanen --- tests/drivers/timer/nrf_grtc_timer/src/main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index cede54f026f..f53188841bd 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -28,7 +28,6 @@ ZTEST(nrf_grtc_timer, test_get_ticks) { k_timeout_t t = K_MSEC(1); - uint64_t grtc_start_value = z_nrf_grtc_timer_startup_value_get(); uint64_t exp_ticks = z_nrf_grtc_timer_read() + t.ticks * CYC_PER_TICK; int64_t ticks; @@ -52,7 +51,6 @@ ZTEST(nrf_grtc_timer, test_get_ticks) curr_tick2 = sys_clock_tick_get(); } while (curr_tick != curr_tick2); - curr_tick += (grtc_start_value / CYC_PER_TICK); t = Z_TIMEOUT_TICKS(Z_TICK_ABS(curr_tick - K_MSEC(1).ticks)); exp_ticks = curr_grtc_tick - K_MSEC(1).ticks * CYC_PER_TICK; @@ -71,7 +69,6 @@ ZTEST(nrf_grtc_timer, test_get_ticks) curr_tick2 = sys_clock_tick_get(); } while (curr_tick != curr_tick2); - curr_tick += (grtc_start_value / CYC_PER_TICK); t = Z_TIMEOUT_TICKS(Z_TICK_ABS(curr_tick + K_MSEC(10).ticks)); exp_ticks = curr_grtc_tick + K_MSEC(10).ticks * CYC_PER_TICK; ticks = z_nrf_grtc_timer_get_ticks(t); From f7a495ee81345a46a3b52c7f661575aeecc165dc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 709/881] Revert "[nrf fromtree] drivers: adc: adc_nrfx_saadc: Extend internal reference values" This reverts commit 3613ade88e9b997a565c3adf1a26357c31d88d22. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 986cca49af8..a9cc1c4f36b 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -754,9 +754,7 @@ static DEVICE_API(adc, adc_nrfx_driver_api) = { #ifdef CONFIG_ADC_ASYNC .read_async = adc_nrfx_read_async, #endif -#if defined(NRF54LV10A_ENGA_XXAA) - .ref_internal = 1300, -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) .ref_internal = 900, #elif defined(CONFIG_NRF_PLATFORM_HALTIUM) .ref_internal = 1024, From f16a62cf0186f8407f3ffcfcde00ebe8b33ec443 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 710/881] Revert "[nrf fromtree] tests: boards: nrf: i2c: Fix nrf52 and nrf53 pin assignment" This reverts commit 524d8073b4caa3d49beda3020fbc7b69459392d9. Signed-off-by: Jukka Rissanen --- .../boards/nrf52840dk_nrf52840.overlay | 18 ++++++++++-------- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 14 ++++++++------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay index 121ac01b7a7..40c74354e30 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay @@ -7,31 +7,33 @@ &pinctrl { i2c0_default_alt: i2c0_default_alt { group1 { - psels = , - ; + psels = , + ; }; }; i2c0_sleep_alt: i2c0_sleep_alt { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; i2c1_default_alt: i2c1_default_alt { group1 { - psels = , - ; +/* Temporary workaround as it is currently not possible + * to configure pins for TWIS with pinctrl. */ + psels = , + ; bias-pull-up; }; }; i2c1_sleep_alt: i2c1_sleep_alt { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay index 2ccac66dc72..48577a5a8ed 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -8,30 +8,32 @@ i2c1_default_alt: i2c1_default_alt { group1 { psels = , - ; + ; }; }; i2c1_sleep_alt: i2c1_sleep_alt { group1 { psels = , - ; + ; low-power-enable; }; }; i2c2_default_alt: i2c2_default_alt { group1 { - psels = , - ; +/* Temporary workaround as it is currently not possible + * to configure pins for TWIS with pinctrl. */ + psels = , + ; bias-pull-up; }; }; i2c2_sleep_alt: i2c2_sleep_alt { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; From b3633fcd256c7f7a1e64590f972a292990256955 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 711/881] Revert "[nrf fromtree] tests: drivers: spi: spi_loopback: configure spi latency expectation" This reverts commit 8c6c814d571bc9df6092d44a040d0ae308238a49. Signed-off-by: Jukka Rissanen --- tests/drivers/spi/spi_loopback/Kconfig | 4 ---- .../spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 - tests/drivers/spi/spi_loopback/src/spi.c | 6 ++---- 4 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/tests/drivers/spi/spi_loopback/Kconfig b/tests/drivers/spi/spi_loopback/Kconfig index b1d81eb13aa..f3d89bf7317 100644 --- a/tests/drivers/spi/spi_loopback/Kconfig +++ b/tests/drivers/spi/spi_loopback/Kconfig @@ -11,10 +11,6 @@ config SPI_LARGE_BUFFER_SIZE int "Large buffer size" default 8192 -config SPI_IDEAL_TRANSFER_DURATION_SCALING - int "Scaling factor to compare ideal and measured SPI transfer duration" - default 8 - if SOC_SERIES_STM32H7X config SPI_LOOPBACK_16BITS_FRAMES diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index ad922ab8d26..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index ad922ab8d26..00000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 diff --git a/tests/drivers/spi/spi_loopback/src/spi.c b/tests/drivers/spi/spi_loopback/src/spi.c index 64649ce7566..f00a720677a 100644 --- a/tests/drivers/spi/spi_loopback/src/spi.c +++ b/tests/drivers/spi/spi_loopback/src/spi.c @@ -327,7 +327,7 @@ ZTEST(spi_loopback, test_spi_complete_multiple_timed) /* Fail if transfer is faster than theoretically possible */ zassert_true(time_spent_us >= minimum_transfer_time_us, - "Transfer faster than theoretically possible"); + "Transfer faster than theoretically possible"); /* handle overflow for print statement */ latency_measurement = time_spent_us - expected_transfer_time_us; @@ -337,9 +337,7 @@ ZTEST(spi_loopback, test_spi_complete_multiple_timed) TC_PRINT("Latency measurement: %llu us\n", latency_measurement); /* Allow some overhead, but not too much */ - zassert_true(time_spent_us <= - expected_transfer_time_us * CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING, - "Very high latency"); + zassert_true(time_spent_us <= expected_transfer_time_us * 8, "Very high latency"); spi_loopback_compare_bufs(buffer_tx, buffer_rx, BUF_SIZE, buffer_print_tx, buffer_print_rx); From 2f38139c6590cc7c0d8fc9da82ba176eb9e7b3ba Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 712/881] Revert "[nrf fromtree] modules: hal_nordic: nrfx: Add mising UARTE23/24 Kconfigs" This reverts commit d03f1689ee5cbfe7abfffee9a65771495055a22e. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/nrfx/Kconfig | 10 ---------- modules/hal_nordic/nrfx/nrfx_kconfig.h | 6 ------ soc/nordic/validate_base_addresses.c | 2 -- 3 files changed, 18 deletions(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 08c5df62599..3ce57f1e4de 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -1105,16 +1105,6 @@ config NRFX_UARTE22 depends on $(dt_nodelabel_exists,uart22) select NRFX_UARTE -config NRFX_UARTE23 - bool "UARTE23 driver instance" - depends on $(dt_nodelabel_exists,uart23) - select NRFX_UARTE - -config NRFX_UARTE24 - bool "UARTE24 driver instance" - depends on $(dt_nodelabel_exists,uart24) - select NRFX_UARTE - config NRFX_UARTE30 bool "UARTE30 driver instance" depends on $(dt_nodelabel_exists,uart30) diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index ed1948a3931..3ba891f60ec 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -891,12 +891,6 @@ #ifdef CONFIG_NRFX_UARTE22 #define NRFX_UARTE22_ENABLED 1 #endif -#ifdef CONFIG_NRFX_UARTE23 -#define NRFX_UARTE23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE24 -#define NRFX_UARTE24_ENABLED 1 -#endif #ifdef CONFIG_NRFX_UARTE30 #define NRFX_UARTE30_ENABLED 1 #endif diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 02413e3f174..6acefccdfec 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -321,8 +321,6 @@ CHECK_DT_REG(uart00, NRF_UARTE00); CHECK_DT_REG(uart20, NRF_UARTE20); CHECK_DT_REG(uart21, NRF_UARTE21); CHECK_DT_REG(uart22, NRF_UARTE22); -CHECK_DT_REG(uart23, NRF_UARTE23); -CHECK_DT_REG(uart24, NRF_UARTE24); CHECK_DT_REG(uart30, NRF_UARTE30); CHECK_DT_REG(uart120, NRF_UARTE120); CHECK_DT_REG(uart130, NRF_UARTE130); From 3cb319164adf927e95d5cff6009ea4114b1b3f7f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 713/881] Revert "[nrf fromtree] drivers: spi: Support spim23 and spim24 instances" This reverts commit 287ea0179242ae064dd013a1d7bbfd9258c9f0be. Signed-off-by: Jukka Rissanen --- drivers/spi/Kconfig.nrfx | 4 ---- modules/hal_nordic/nrfx/Kconfig | 20 -------------------- modules/hal_nordic/nrfx/nrfx_kconfig.h | 12 ------------ soc/nordic/common/Kconfig.peripherals | 12 ------------ soc/nordic/validate_base_addresses.c | 2 -- 5 files changed, 50 deletions(-) diff --git a/drivers/spi/Kconfig.nrfx b/drivers/spi/Kconfig.nrfx index f3afa79c4c3..d3debe5a5de 100644 --- a/drivers/spi/Kconfig.nrfx +++ b/drivers/spi/Kconfig.nrfx @@ -31,8 +31,6 @@ config SPI_NRFX_SPIM select NRFX_SPIM20 if HAS_HW_NRF_SPIM20 select NRFX_SPIM21 if HAS_HW_NRF_SPIM21 select NRFX_SPIM22 if HAS_HW_NRF_SPIM22 - select NRFX_SPIM23 if HAS_HW_NRF_SPIM23 - select NRFX_SPIM24 if HAS_HW_NRF_SPIM24 select NRFX_SPIM30 if HAS_HW_NRF_SPIM30 select NRFX_SPIM120 if HAS_HW_NRF_SPIM120 select NRFX_SPIM121 if HAS_HW_NRF_SPIM121 @@ -57,8 +55,6 @@ config SPI_NRFX_SPIS select NRFX_SPIS20 if HAS_HW_NRF_SPIS20 select NRFX_SPIS21 if HAS_HW_NRF_SPIS21 select NRFX_SPIS22 if HAS_HW_NRF_SPIS22 - select NRFX_SPIS23 if HAS_HW_NRF_SPIS23 - select NRFX_SPIS24 if HAS_HW_NRF_SPIS24 select NRFX_SPIS30 if HAS_HW_NRF_SPIS30 select NRFX_SPIS120 if HAS_HW_NRF_SPIS120 select NRFX_SPIS130 if HAS_HW_NRF_SPIS130 diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 3ce57f1e4de..ceccf25997c 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -562,16 +562,6 @@ config NRFX_SPIM22 depends on $(dt_nodelabel_exists,spi22) select NRFX_SPIM -config NRFX_SPIM23 - bool "SPIM23 driver instance" - depends on $(dt_nodelabel_exists,spi23) - select NRFX_SPIM - -config NRFX_SPIM24 - bool "SPIM24 driver instance" - depends on $(dt_nodelabel_exists,spi24) - select NRFX_SPIM - config NRFX_SPIM30 bool "SPIM30 driver instance" depends on $(dt_nodelabel_exists,spi30) @@ -670,16 +660,6 @@ config NRFX_SPIS22 depends on $(dt_nodelabel_exists,spi22) select NRFX_SPIS -config NRFX_SPIS23 - bool "SPIS23 driver instance" - depends on $(dt_nodelabel_exists,spi23) - select NRFX_SPIS - -config NRFX_SPIS24 - bool "SPIS24 driver instance" - depends on $(dt_nodelabel_exists,spi24) - select NRFX_SPIS - config NRFX_SPIS30 bool "SPIS30 driver instance" depends on $(dt_nodelabel_exists,spi30) diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 3ba891f60ec..73a26272d4d 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -512,12 +512,6 @@ #ifdef CONFIG_NRFX_SPIM22 #define NRFX_SPIM22_ENABLED 1 #endif -#ifdef CONFIG_NRFX_SPIM23 -#define NRFX_SPIM23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM24 -#define NRFX_SPIM24_ENABLED 1 -#endif #ifdef CONFIG_NRFX_SPIM30 #define NRFX_SPIM30_ENABLED 1 #endif @@ -582,12 +576,6 @@ #ifdef CONFIG_NRFX_SPIS22 #define NRFX_SPIS22_ENABLED 1 #endif -#ifdef CONFIG_NRFX_SPIS23 -#define NRFX_SPIS23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS24 -#define NRFX_SPIS24_ENABLED 1 -#endif #ifdef CONFIG_NRFX_SPIS30 #define NRFX_SPIS30_ENABLED 1 #endif diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 900effed141..ce91800a615 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -280,12 +280,6 @@ config HAS_HW_NRF_SPIM21 config HAS_HW_NRF_SPIM22 def_bool $(dt_nodelabel_enabled_with_compat,spi22,$(DT_COMPAT_NORDIC_NRF_SPIM)) -config HAS_HW_NRF_SPIM23 - def_bool $(dt_nodelabel_enabled_with_compat,spi23,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM24 - def_bool $(dt_nodelabel_enabled_with_compat,spi24,$(DT_COMPAT_NORDIC_NRF_SPIM)) - config HAS_HW_NRF_SPIM30 def_bool $(dt_nodelabel_enabled_with_compat,spi30,$(DT_COMPAT_NORDIC_NRF_SPIM)) @@ -343,12 +337,6 @@ config HAS_HW_NRF_SPIS21 config HAS_HW_NRF_SPIS22 def_bool $(dt_nodelabel_enabled_with_compat,spi22,$(DT_COMPAT_NORDIC_NRF_SPIS)) -config HAS_HW_NRF_SPIS23 - def_bool $(dt_nodelabel_enabled_with_compat,spi23,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS24 - def_bool $(dt_nodelabel_enabled_with_compat,spi24,$(DT_COMPAT_NORDIC_NRF_SPIS)) - config HAS_HW_NRF_SPIS30 def_bool $(dt_nodelabel_enabled_with_compat,spi30,$(DT_COMPAT_NORDIC_NRF_SPIS)) diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 6acefccdfec..9de947a5c7f 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -266,8 +266,6 @@ CHECK_DT_REG(spi00, NRF_SPIM00); CHECK_DT_REG(spi20, NRF_SPIM20); CHECK_DT_REG(spi21, NRF_SPIM21); CHECK_DT_REG(spi22, NRF_SPIM22); -CHECK_DT_REG(spi23, NRF_SPIM23); -CHECK_DT_REG(spi24, NRF_SPIM24); CHECK_DT_REG(spi30, NRF_SPIM30); CHECK_DT_REG(spi120, NRF_SPIM120); CHECK_DT_REG(spi121, NRF_SPIM121); From a94e898a18ac425fd2fe90cf8822c056408f4cb2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 714/881] Revert "[nrf fromtree] boards: nrf54h20_iron: Allow radio updates" This reverts commit 5307c307d683219c13cb49d739bd314f1a9dee7b. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54h20dk/Kconfig.defconfig | 7 ------- .../nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts | 8 -------- .../nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts | 8 -------- modules/Kconfig.mcuboot | 1 - soc/nordic/nrf54h/soc.c | 3 +-- 5 files changed, 1 insertion(+), 26 deletions(-) diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 4023f3b0232..60c9345eb04 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -27,10 +27,3 @@ config FLASH_LOAD_OFFSET default 0x2c000 if !USE_DT_CODE_PARTITION endif # BOARD_NRF54H20DK_NRF54H20_CPUAPP_IRON - -if BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_NRF54H20DK_NRF54H20_CPURAD_IRON diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts index e822cf2c911..d455e200b0b 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_iron.dts @@ -35,11 +35,3 @@ slot0_partition: &cpuapp_slot0_partition { slot1_partition: &cpuapp_slot1_partition { label = "image-1"; }; - -slot2_partition: &cpurad_slot0_partition { - label = "image-2"; -}; - -slot3_partition: &cpurad_slot1_partition { - label = "image-3"; -}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts index 16b599f554e..669143a79da 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_iron.dts @@ -19,11 +19,3 @@ mbox-names = "tx", "rx"; status = "okay"; }; - -slot0_partition: &cpurad_slot0_partition { - label = "image-0"; -}; - -slot1_partition: &cpurad_slot1_partition { - label = "image-1"; -}; diff --git a/modules/Kconfig.mcuboot b/modules/Kconfig.mcuboot index c02ee43f5eb..2c4dbfa930d 100644 --- a/modules/Kconfig.mcuboot +++ b/modules/Kconfig.mcuboot @@ -227,7 +227,6 @@ config MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP config MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT bool "MCUboot has been configured for DirectXIP with revert" - select MCUBOOT_BOOTUTIL_LIB select MCUBOOT_BOOTUTIL_LIB_FOR_DIRECT_XIP select MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE select MCUBOOT_BOOTLOADER_NO_DOWNGRADE diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index e55f56242b9..e053953b821 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -175,8 +175,7 @@ void soc_late_init_hook(void) void *radiocore_address = (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL_CPURAD_SLOT0_PARTITION)) + - DT_REG_ADDR(DT_NODELABEL_CPURAD_SLOT0_PARTITION) + - CONFIG_ROM_START_OFFSET); + DT_REG_ADDR(DT_NODELABEL_CPURAD_SLOT0_PARTITION)); /* Don't wait as this is not yet supported. */ bool cpu_wait = false; From 2db62e258dcd2a76ae8b40ac1062381acfc075cd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 715/881] Revert "[nrf fromtree] net: stats: Make byte counters 64-bit" This reverts commit 44066038087d8ccdffb677f8c693c37069741c7b. Signed-off-by: Jukka Rissanen --- include/zephyr/net/net_stats.h | 18 +++++++++--------- samples/net/stats/src/main.c | 10 +++++----- subsys/net/ip/net_stats.c | 10 +++++----- subsys/net/l2/wifi/wifi_shell.c | 4 ++-- subsys/net/lib/shell/stats.c | 22 +++++++++++----------- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/include/zephyr/net/net_stats.h b/include/zephyr/net/net_stats.h index de95b35fbb7..1a5531a1a27 100644 --- a/include/zephyr/net/net_stats.h +++ b/include/zephyr/net/net_stats.h @@ -49,9 +49,9 @@ typedef uint32_t net_stats_t; */ struct net_stats_bytes { /** Number of bytes sent */ - uint64_t sent; + net_stats_t sent; /** Number of bytes received */ - uint64_t received; + net_stats_t received; }; /** @@ -319,8 +319,6 @@ struct net_stats_rx_time { struct net_stats_tc { /** TX statistics for each traffic class */ struct { - /** Number of bytes sent for this traffic class */ - uint64_t bytes; /** Helper for calculating average TX time statistics */ struct net_stats_tx_time tx_time; #if defined(CONFIG_NET_PKT_TXTIME_STATS_DETAIL) @@ -332,14 +330,14 @@ struct net_stats_tc { net_stats_t pkts; /** Number of packets dropped for this traffic class */ net_stats_t dropped; + /** Number of bytes sent for this traffic class */ + net_stats_t bytes; /** Priority of this traffic class */ uint8_t priority; } sent[NET_TC_TX_STATS_COUNT]; /** RX statistics for each traffic class */ struct { - /** Number of bytes received for this traffic class */ - uint64_t bytes; /** Helper for calculating average RX time statistics */ struct net_stats_rx_time rx_time; #if defined(CONFIG_NET_PKT_RXTIME_STATS_DETAIL) @@ -351,6 +349,8 @@ struct net_stats_tc { net_stats_t pkts; /** Number of packets dropped for this traffic class */ net_stats_t dropped; + /** Number of bytes received for this traffic class */ + net_stats_t bytes; /** Priority of this traffic class */ uint8_t priority; } recv[NET_TC_RX_STATS_COUNT]; @@ -404,15 +404,15 @@ struct net_stats_pkt_filter { * @brief All network statistics in one struct. */ struct net_stats { + /** Count of malformed packets or packets we do not have handler for */ + net_stats_t processing_error; + /** * This calculates amount of data transferred through all the * network interfaces. */ struct net_stats_bytes bytes; - /** Count of malformed packets or packets we do not have handler for */ - net_stats_t processing_error; - /** IP layer errors */ struct net_stats_ip_errors ip_errors; diff --git a/samples/net/stats/src/main.c b/samples/net/stats/src/main.c index 7b3d1a844aa..c91ad4e15f2 100644 --- a/samples/net/stats/src/main.c +++ b/samples/net/stats/src/main.c @@ -99,7 +99,7 @@ static void print_stats(struct net_if *iface, struct net_stats *data) #endif #if defined(CONFIG_NET_STATISTICS_TCP) - printk("TCP bytes recv %llu\tsent\t%llu\n", + printk("TCP bytes recv %u\tsent\t%u\n", GET_STAT(iface, tcp.bytes.received), GET_STAT(iface, tcp.bytes.sent)); printk("TCP seg recv %u\tsent\t%u\tdrop\t%u\n", @@ -119,8 +119,8 @@ static void print_stats(struct net_if *iface, struct net_stats *data) GET_STAT(iface, tcp.connrst)); #endif - printk("Bytes received %llu\n", GET_STAT(iface, bytes.received)); - printk("Bytes sent %llu\n", GET_STAT(iface, bytes.sent)); + printk("Bytes received %u\n", GET_STAT(iface, bytes.received)); + printk("Bytes sent %u\n", GET_STAT(iface, bytes.sent)); printk("Processing err %u\n", GET_STAT(iface, processing_error)); } @@ -141,8 +141,8 @@ static void print_eth_stats(struct net_if *iface, struct net_stats_eth *data) printk("Statistics for Ethernet interface %p [%d]\n", iface, net_if_get_by_iface(iface)); - printk("Bytes received : %llu\n", data->bytes.received); - printk("Bytes sent : %llu\n", data->bytes.sent); + printk("Bytes received : %u\n", data->bytes.received); + printk("Bytes sent : %u\n", data->bytes.sent); printk("Packets received : %u\n", data->pkts.rx); printk("Packets sent : %u\n", data->pkts.tx); printk("Bcast received : %u\n", data->broadcast.rx); diff --git a/subsys/net/ip/net_stats.c b/subsys/net/ip/net_stats.c index 5da625faeb6..3f9352922a0 100644 --- a/subsys/net/ip/net_stats.c +++ b/subsys/net/ip/net_stats.c @@ -152,7 +152,7 @@ static inline void stats(struct net_if *iface) #endif #if defined(CONFIG_NET_STATISTICS_TCP) - NET_INFO("TCP bytes recv %llu\tsent\t%llu", + NET_INFO("TCP bytes recv %u\tsent\t%u", GET_STAT(iface, tcp.bytes.received), GET_STAT(iface, tcp.bytes.sent)); NET_INFO("TCP seg recv %u\tsent\t%u\tdrop\t%u", @@ -172,8 +172,8 @@ static inline void stats(struct net_if *iface) GET_STAT(iface, tcp.connrst)); #endif - NET_INFO("Bytes received %llu", GET_STAT(iface, bytes.received)); - NET_INFO("Bytes sent %llu", GET_STAT(iface, bytes.sent)); + NET_INFO("Bytes received %u", GET_STAT(iface, bytes.received)); + NET_INFO("Bytes sent %u", GET_STAT(iface, bytes.sent)); NET_INFO("Processing err %u", GET_STAT(iface, processing_error)); @@ -183,7 +183,7 @@ static inline void stats(struct net_if *iface) NET_INFO("TC Priority\tSent pkts\tbytes"); for (i = 0; i < NET_TC_TX_COUNT; i++) { - NET_INFO("[%d] %s (%u)\t%u\t\t%llu", i, + NET_INFO("[%d] %s (%u)\t%u\t\t%u", i, priority2str(GET_STAT(iface, tc.sent[i].priority)), GET_STAT(iface, tc.sent[i].priority), @@ -197,7 +197,7 @@ static inline void stats(struct net_if *iface) NET_INFO("TC Priority\tRecv pkts\tbytes"); for (i = 0; i < NET_TC_RX_COUNT; i++) { - NET_INFO("[%d] %s (%u)\t%u\t\t%llu", i, + NET_INFO("[%d] %s (%u)\t%u\t\t%u", i, priority2str(GET_STAT(iface, tc.recv[i].priority)), GET_STAT(iface, tc.recv[i].priority), diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index af0db05855f..c5dc9d88977 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -1562,8 +1562,8 @@ static void print_wifi_stats(struct net_if *iface, struct net_stats_wifi *data, PR("Statistics for Wi-Fi interface %p [%d]\n", iface, net_if_get_by_iface(iface)); - PR("Bytes received : %llu\n", data->bytes.received); - PR("Bytes sent : %llu\n", data->bytes.sent); + PR("Bytes received : %u\n", data->bytes.received); + PR("Bytes sent : %u\n", data->bytes.sent); PR("Packets received : %u\n", data->pkts.rx); PR("Packets sent : %u\n", data->pkts.tx); PR("Receive errors : %u\n", data->errors.rx); diff --git a/subsys/net/lib/shell/stats.c b/subsys/net/lib/shell/stats.c index 1c31f56ec8f..e73cbf61410 100644 --- a/subsys/net/lib/shell/stats.c +++ b/subsys/net/lib/shell/stats.c @@ -50,8 +50,8 @@ static void print_eth_stats(struct net_if *iface, struct net_stats_eth *data, PR("Statistics for Ethernet interface %p [%d]\n", iface, net_if_get_by_iface(iface)); - PR("Bytes received : %llu\n", data->bytes.received); - PR("Bytes sent : %llu\n", data->bytes.sent); + PR("Bytes received : %u\n", data->bytes.received); + PR("Bytes sent : %u\n", data->bytes.sent); PR("Packets received : %u\n", data->pkts.rx); PR("Packets sent : %u\n", data->pkts.tx); PR("Bcast received : %u\n", data->broadcast.rx); @@ -315,13 +315,13 @@ static void print_tc_tx_stats(const struct shell *sh, struct net_if *iface) net_stats_t count = GET_STAT(iface, tc.sent[i].tx_time.count); if (count == 0) { - PR("[%d] %s (%u)\t%u\t\t%llu\t-\n", i, + PR("[%d] %s (%u)\t%u\t\t%u\t-\n", i, priority2str(GET_STAT(iface, tc.sent[i].priority)), GET_STAT(iface, tc.sent[i].priority), GET_STAT(iface, tc.sent[i].pkts), GET_STAT(iface, tc.sent[i].bytes)); } else { - PR("[%d] %s (%u)\t%u\t\t%llu\t%u us%s\n", i, + PR("[%d] %s (%u)\t%u\t\t%u\t%u us%s\n", i, priority2str(GET_STAT(iface, tc.sent[i].priority)), GET_STAT(iface, tc.sent[i].priority), GET_STAT(iface, tc.sent[i].pkts), @@ -336,7 +336,7 @@ static void print_tc_tx_stats(const struct shell *sh, struct net_if *iface) PR("TC Priority\tSent pkts\tbytes\n"); for (i = 0; i < NET_TC_TX_COUNT; i++) { - PR("[%d] %s (%u)\t%u\t\t%llu\n", i, + PR("[%d] %s (%u)\t%u\t\t%u\n", i, priority2str(GET_STAT(iface, tc.sent[i].priority)), GET_STAT(iface, tc.sent[i].priority), GET_STAT(iface, tc.sent[i].pkts), @@ -374,14 +374,14 @@ static void print_tc_rx_stats(const struct shell *sh, struct net_if *iface) net_stats_t count = GET_STAT(iface, tc.recv[i].rx_time.count); if (count == 0) { - PR("[%d] %s (%u)\t%u\t%u\t\t%llu\t-\n", i, + PR("[%d] %s (%u)\t%u\t%u\t\t%u\t-\n", i, priority2str(GET_STAT(iface, tc.recv[i].priority)), GET_STAT(iface, tc.recv[i].priority), GET_STAT(iface, tc.recv[i].pkts), GET_STAT(iface, tc.recv[i].dropped), GET_STAT(iface, tc.recv[i].bytes)); } else { - PR("[%d] %s (%u)\t%u\t%u\t\t%llu\t%u us%s\n", i, + PR("[%d] %s (%u)\t%u\t%u\t\t%u\t%u us%s\n", i, priority2str(GET_STAT(iface, tc.recv[i].priority)), GET_STAT(iface, tc.recv[i].priority), GET_STAT(iface, tc.recv[i].pkts), @@ -397,7 +397,7 @@ static void print_tc_rx_stats(const struct shell *sh, struct net_if *iface) PR("TC Priority\tRecv pkts\tDrop pkts\tbytes\n"); for (i = 0; i < NET_TC_RX_COUNT; i++) { - PR("[%d] %s (%u)\t%u\t%u\t\t%llu\n", i, + PR("[%d] %s (%u)\t%u\t%u\t\t%u\n", i, priority2str(GET_STAT(iface, tc.recv[i].priority)), GET_STAT(iface, tc.recv[i].priority), GET_STAT(iface, tc.recv[i].pkts), @@ -533,7 +533,7 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data) #endif #if defined(CONFIG_NET_STATISTICS_TCP) && defined(CONFIG_NET_NATIVE_TCP) - PR("TCP bytes recv %llu\tsent\t%llu\tresent\t%u\n", + PR("TCP bytes recv %u\tsent\t%u\tresent\t%u\n", GET_STAT(iface, tcp.bytes.received), GET_STAT(iface, tcp.bytes.sent), GET_STAT(iface, tcp.resent)); @@ -575,8 +575,8 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data) GET_STAT(iface, pkt_filter.tx.drop)); #endif /* CONFIG_NET_STATISTICS_DNS */ - PR("Bytes received %llu\n", GET_STAT(iface, bytes.received)); - PR("Bytes sent %llu\n", GET_STAT(iface, bytes.sent)); + PR("Bytes received %u\n", GET_STAT(iface, bytes.received)); + PR("Bytes sent %u\n", GET_STAT(iface, bytes.sent)); PR("Processing err %u\n", GET_STAT(iface, processing_error)); print_tc_tx_stats(sh, iface); From 40ed994510b89c09d5fe159a70b1a98f3e1abe39 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 716/881] Revert "[nrf fromtree] net: stats: Use correct format specifiers when printing stats" This reverts commit 263a1a8fcdcbecdce7bb3a1129f75b4b988b1ec7. Signed-off-by: Jukka Rissanen --- samples/net/stats/src/main.c | 36 ++++++++++---------- subsys/net/ip/net_stats.c | 42 +++++++++++------------ subsys/net/lib/shell/stats.c | 64 ++++++++++++++++++------------------ 3 files changed, 71 insertions(+), 71 deletions(-) diff --git a/samples/net/stats/src/main.c b/samples/net/stats/src/main.c index c91ad4e15f2..fdfb7e4339c 100644 --- a/samples/net/stats/src/main.c +++ b/samples/net/stats/src/main.c @@ -32,25 +32,25 @@ static void print_stats(struct net_if *iface, struct net_stats *data) } #if defined(CONFIG_NET_IPV6) - printk("IPv6 recv %u\tsent\t%u\tdrop\t%u\tforwarded\t%u\n", + printk("IPv6 recv %d\tsent\t%d\tdrop\t%d\tforwarded\t%d\n", GET_STAT(iface, ipv6.recv), GET_STAT(iface, ipv6.sent), GET_STAT(iface, ipv6.drop), GET_STAT(iface, ipv6.forwarded)); #if defined(CONFIG_NET_IPV6_ND) - printk("IPv6 ND recv %u\tsent\t%u\tdrop\t%u\n", + printk("IPv6 ND recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv6_nd.recv), GET_STAT(iface, ipv6_nd.sent), GET_STAT(iface, ipv6_nd.drop)); #endif /* CONFIG_NET_IPV6_ND */ #if defined(CONFIG_NET_IPV6_PMTU) - printk("IPv6 PMTU recv %u\tsent\t%u\tdrop\t%u\n", + printk("IPv6 PMTU recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv6_pmtu.recv), GET_STAT(iface, ipv6_pmtu.sent), GET_STAT(iface, ipv6_pmtu.drop)); #endif /* CONFIG_NET_IPV6_PMTU */ #if defined(CONFIG_NET_STATISTICS_MLD) - printk("IPv6 MLD recv %u\tsent\t%u\tdrop\t%u\n", + printk("IPv6 MLD recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv6_mld.recv), GET_STAT(iface, ipv6_mld.sent), GET_STAT(iface, ipv6_mld.drop)); @@ -58,70 +58,70 @@ static void print_stats(struct net_if *iface, struct net_stats *data) #endif /* CONFIG_NET_IPV6 */ #if defined(CONFIG_NET_IPV4) - printk("IPv4 recv %u\tsent\t%u\tdrop\t%u\tforwarded\t%u\n", + printk("IPv4 recv %d\tsent\t%d\tdrop\t%d\tforwarded\t%d\n", GET_STAT(iface, ipv4.recv), GET_STAT(iface, ipv4.sent), GET_STAT(iface, ipv4.drop), GET_STAT(iface, ipv4.forwarded)); #endif /* CONFIG_NET_IPV4 */ - printk("IP vhlerr %u\thblener\t%u\tlblener\t%u\n", + printk("IP vhlerr %d\thblener\t%d\tlblener\t%d\n", GET_STAT(iface, ip_errors.vhlerr), GET_STAT(iface, ip_errors.hblenerr), GET_STAT(iface, ip_errors.lblenerr)); - printk("IP fragerr %u\tchkerr\t%u\tprotoer\t%u\n", + printk("IP fragerr %d\tchkerr\t%d\tprotoer\t%d\n", GET_STAT(iface, ip_errors.fragerr), GET_STAT(iface, ip_errors.chkerr), GET_STAT(iface, ip_errors.protoerr)); #if defined(CONFIG_NET_IPV4_PMTU) - printk("IPv4 PMTU recv %u\tsent\t%u\tdrop\t%u\n", + printk("IPv4 PMTU recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv4_pmtu.recv), GET_STAT(iface, ipv4_pmtu.sent), GET_STAT(iface, ipv4_pmtu.drop)); #endif /* CONFIG_NET_IPV4_PMTU */ - printk("ICMP recv %u\tsent\t%u\tdrop\t%u\n", + printk("ICMP recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, icmp.recv), GET_STAT(iface, icmp.sent), GET_STAT(iface, icmp.drop)); - printk("ICMP typeer %u\tchkerr\t%u\n", + printk("ICMP typeer %d\tchkerr\t%d\n", GET_STAT(iface, icmp.typeerr), GET_STAT(iface, icmp.chkerr)); #if defined(CONFIG_NET_UDP) - printk("UDP recv %u\tsent\t%u\tdrop\t%u\n", + printk("UDP recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, udp.recv), GET_STAT(iface, udp.sent), GET_STAT(iface, udp.drop)); - printk("UDP chkerr %u\n", + printk("UDP chkerr %d\n", GET_STAT(iface, udp.chkerr)); #endif #if defined(CONFIG_NET_STATISTICS_TCP) - printk("TCP bytes recv %u\tsent\t%u\n", + printk("TCP bytes recv %u\tsent\t%d\n", GET_STAT(iface, tcp.bytes.received), GET_STAT(iface, tcp.bytes.sent)); - printk("TCP seg recv %u\tsent\t%u\tdrop\t%u\n", + printk("TCP seg recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, tcp.recv), GET_STAT(iface, tcp.sent), GET_STAT(iface, tcp.drop)); - printk("TCP seg resent %u\tchkerr\t%u\tackerr\t%u\n", + printk("TCP seg resent %d\tchkerr\t%d\tackerr\t%d\n", GET_STAT(iface, tcp.resent), GET_STAT(iface, tcp.chkerr), GET_STAT(iface, tcp.ackerr)); - printk("TCP seg rsterr %u\trst\t%u\tre-xmit\t%u\n", + printk("TCP seg rsterr %d\trst\t%d\tre-xmit\t%d\n", GET_STAT(iface, tcp.rsterr), GET_STAT(iface, tcp.rst), GET_STAT(iface, tcp.rexmit)); - printk("TCP conn drop %u\tconnrst\t%u\n", + printk("TCP conn drop %d\tconnrst\t%d\n", GET_STAT(iface, tcp.conndrop), GET_STAT(iface, tcp.connrst)); #endif printk("Bytes received %u\n", GET_STAT(iface, bytes.received)); printk("Bytes sent %u\n", GET_STAT(iface, bytes.sent)); - printk("Processing err %u\n", GET_STAT(iface, processing_error)); + printk("Processing err %d\n", GET_STAT(iface, processing_error)); } #if defined(CONFIG_NET_STATISTICS_PER_INTERFACE) diff --git a/subsys/net/ip/net_stats.c b/subsys/net/ip/net_stats.c index 3f9352922a0..3f9df8c8cf1 100644 --- a/subsys/net/ip/net_stats.c +++ b/subsys/net/ip/net_stats.c @@ -85,25 +85,25 @@ static inline void stats(struct net_if *iface) } #if defined(CONFIG_NET_STATISTICS_IPV6) - NET_INFO("IPv6 recv %u\tsent\t%u\tdrop\t%u\tforwarded\t%u", + NET_INFO("IPv6 recv %d\tsent\t%d\tdrop\t%d\tforwarded\t%d", GET_STAT(iface, ipv6.recv), GET_STAT(iface, ipv6.sent), GET_STAT(iface, ipv6.drop), GET_STAT(iface, ipv6.forwarded)); #if defined(CONFIG_NET_STATISTICS_IPV6_ND) - NET_INFO("IPv6 ND recv %u\tsent\t%u\tdrop\t%u", + NET_INFO("IPv6 ND recv %d\tsent\t%d\tdrop\t%d", GET_STAT(iface, ipv6_nd.recv), GET_STAT(iface, ipv6_nd.sent), GET_STAT(iface, ipv6_nd.drop)); #endif /* CONFIG_NET_STATISTICS_IPV6_ND */ #if defined(CONFIG_NET_STATISTICS_IPV6_PMTU) - NET_INFO("IPv6 PMTU recv %u\tsent\t%u\tdrop\t%u", + NET_INFO("IPv6 PMTU recv %d\tsent\t%d\tdrop\t%d", GET_STAT(iface, ipv6_pmtu.recv), GET_STAT(iface, ipv6_pmtu.sent), GET_STAT(iface, ipv6_pmtu.drop)); #endif /* CONFIG_NET_STATISTICS_IPV6_PMTU */ #if defined(CONFIG_NET_STATISTICS_MLD) - NET_INFO("IPv6 MLD recv %u\tsent\t%u\tdrop\t%u", + NET_INFO("IPv6 MLD recv %d\tsent\t%d\tdrop\t%d", GET_STAT(iface, ipv6_mld.recv), GET_STAT(iface, ipv6_mld.sent), GET_STAT(iface, ipv6_mld.drop)); @@ -111,70 +111,70 @@ static inline void stats(struct net_if *iface) #endif /* CONFIG_NET_STATISTICS_IPV6 */ #if defined(CONFIG_NET_STATISTICS_IPV4) - NET_INFO("IPv4 recv %u\tsent\t%u\tdrop\t%u\tforwarded\t%u", + NET_INFO("IPv4 recv %d\tsent\t%d\tdrop\t%d\tforwarded\t%d", GET_STAT(iface, ipv4.recv), GET_STAT(iface, ipv4.sent), GET_STAT(iface, ipv4.drop), GET_STAT(iface, ipv4.forwarded)); #endif /* CONFIG_NET_STATISTICS_IPV4 */ - NET_INFO("IP vhlerr %u\thblener\t%u\tlblener\t%u", + NET_INFO("IP vhlerr %d\thblener\t%d\tlblener\t%d", GET_STAT(iface, ip_errors.vhlerr), GET_STAT(iface, ip_errors.hblenerr), GET_STAT(iface, ip_errors.lblenerr)); - NET_INFO("IP fragerr %u\tchkerr\t%u\tprotoer\t%u", + NET_INFO("IP fragerr %d\tchkerr\t%d\tprotoer\t%d", GET_STAT(iface, ip_errors.fragerr), GET_STAT(iface, ip_errors.chkerr), GET_STAT(iface, ip_errors.protoerr)); #if defined(CONFIG_NET_STATISTICS_IPV4_PMTU) - NET_INFO("IPv4 PMTU recv %u\tsent\t%u\tdrop\t%u", + NET_INFO("IPv4 PMTU recv %d\tsent\t%d\tdrop\t%d", GET_STAT(iface, ipv4_pmtu.recv), GET_STAT(iface, ipv4_pmtu.sent), GET_STAT(iface, ipv4_pmtu.drop)); #endif /* CONFIG_NET_STATISTICS_IPV4_PMTU */ - NET_INFO("ICMP recv %u\tsent\t%u\tdrop\t%u", + NET_INFO("ICMP recv %d\tsent\t%d\tdrop\t%d", GET_STAT(iface, icmp.recv), GET_STAT(iface, icmp.sent), GET_STAT(iface, icmp.drop)); - NET_INFO("ICMP typeer %u\tchkerr\t%u", + NET_INFO("ICMP typeer %d\tchkerr\t%d", GET_STAT(iface, icmp.typeerr), GET_STAT(iface, icmp.chkerr)); #if defined(CONFIG_NET_STATISTICS_UDP) - NET_INFO("UDP recv %u\tsent\t%u\tdrop\t%u", + NET_INFO("UDP recv %d\tsent\t%d\tdrop\t%d", GET_STAT(iface, udp.recv), GET_STAT(iface, udp.sent), GET_STAT(iface, udp.drop)); - NET_INFO("UDP chkerr %u", + NET_INFO("UDP chkerr %d", GET_STAT(iface, udp.chkerr)); #endif #if defined(CONFIG_NET_STATISTICS_TCP) - NET_INFO("TCP bytes recv %u\tsent\t%u", + NET_INFO("TCP bytes recv %u\tsent\t%d", GET_STAT(iface, tcp.bytes.received), GET_STAT(iface, tcp.bytes.sent)); - NET_INFO("TCP seg recv %u\tsent\t%u\tdrop\t%u", + NET_INFO("TCP seg recv %d\tsent\t%d\tdrop\t%d", GET_STAT(iface, tcp.recv), GET_STAT(iface, tcp.sent), GET_STAT(iface, tcp.drop)); - NET_INFO("TCP seg resent %u\tchkerr\t%u\tackerr\t%u", + NET_INFO("TCP seg resent %d\tchkerr\t%d\tackerr\t%d", GET_STAT(iface, tcp.resent), GET_STAT(iface, tcp.chkerr), GET_STAT(iface, tcp.ackerr)); - NET_INFO("TCP seg rsterr %u\trst\t%u\tre-xmit\t%u", + NET_INFO("TCP seg rsterr %d\trst\t%d\tre-xmit\t%d", GET_STAT(iface, tcp.rsterr), GET_STAT(iface, tcp.rst), GET_STAT(iface, tcp.rexmit)); - NET_INFO("TCP conn drop %u\tconnrst\t%u", + NET_INFO("TCP conn drop %d\tconnrst\t%d", GET_STAT(iface, tcp.conndrop), GET_STAT(iface, tcp.connrst)); #endif NET_INFO("Bytes received %u", GET_STAT(iface, bytes.received)); NET_INFO("Bytes sent %u", GET_STAT(iface, bytes.sent)); - NET_INFO("Processing err %u", + NET_INFO("Processing err %d", GET_STAT(iface, processing_error)); #if NET_TC_COUNT > 1 @@ -183,7 +183,7 @@ static inline void stats(struct net_if *iface) NET_INFO("TC Priority\tSent pkts\tbytes"); for (i = 0; i < NET_TC_TX_COUNT; i++) { - NET_INFO("[%d] %s (%u)\t%u\t\t%u", i, + NET_INFO("[%d] %s (%d)\t%d\t\t%d", i, priority2str(GET_STAT(iface, tc.sent[i].priority)), GET_STAT(iface, tc.sent[i].priority), @@ -197,7 +197,7 @@ static inline void stats(struct net_if *iface) NET_INFO("TC Priority\tRecv pkts\tbytes"); for (i = 0; i < NET_TC_RX_COUNT; i++) { - NET_INFO("[%d] %s (%u)\t%u\t\t%u", i, + NET_INFO("[%d] %s (%d)\t%d\t\t%d", i, priority2str(GET_STAT(iface, tc.recv[i].priority)), GET_STAT(iface, tc.recv[i].priority), @@ -213,7 +213,7 @@ static inline void stats(struct net_if *iface) NET_INFO("Power management statistics:"); NET_INFO("Last suspend time: %u ms", GET_STAT(iface, pm.last_suspend_time)); - NET_INFO("Got suspended %u times", + NET_INFO("Got suspended %d times", GET_STAT(iface, pm.suspend_count)); NET_INFO("Average suspend time: %u ms", (uint32_t)(GET_STAT(iface, pm.overall_suspend_time) / diff --git a/subsys/net/lib/shell/stats.c b/subsys/net/lib/shell/stats.c index e73cbf61410..64256bc7473 100644 --- a/subsys/net/lib/shell/stats.c +++ b/subsys/net/lib/shell/stats.c @@ -315,13 +315,13 @@ static void print_tc_tx_stats(const struct shell *sh, struct net_if *iface) net_stats_t count = GET_STAT(iface, tc.sent[i].tx_time.count); if (count == 0) { - PR("[%d] %s (%u)\t%u\t\t%u\t-\n", i, + PR("[%d] %s (%d)\t%d\t\t%d\t-\n", i, priority2str(GET_STAT(iface, tc.sent[i].priority)), GET_STAT(iface, tc.sent[i].priority), GET_STAT(iface, tc.sent[i].pkts), GET_STAT(iface, tc.sent[i].bytes)); } else { - PR("[%d] %s (%u)\t%u\t\t%u\t%u us%s\n", i, + PR("[%d] %s (%d)\t%d\t\t%d\t%u us%s\n", i, priority2str(GET_STAT(iface, tc.sent[i].priority)), GET_STAT(iface, tc.sent[i].priority), GET_STAT(iface, tc.sent[i].pkts), @@ -336,7 +336,7 @@ static void print_tc_tx_stats(const struct shell *sh, struct net_if *iface) PR("TC Priority\tSent pkts\tbytes\n"); for (i = 0; i < NET_TC_TX_COUNT; i++) { - PR("[%d] %s (%u)\t%u\t\t%u\n", i, + PR("[%d] %s (%d)\t%d\t\t%d\n", i, priority2str(GET_STAT(iface, tc.sent[i].priority)), GET_STAT(iface, tc.sent[i].priority), GET_STAT(iface, tc.sent[i].pkts), @@ -374,14 +374,14 @@ static void print_tc_rx_stats(const struct shell *sh, struct net_if *iface) net_stats_t count = GET_STAT(iface, tc.recv[i].rx_time.count); if (count == 0) { - PR("[%d] %s (%u)\t%u\t%u\t\t%u\t-\n", i, + PR("[%d] %s (%d)\t%d\t%d\t\t%d\t-\n", i, priority2str(GET_STAT(iface, tc.recv[i].priority)), GET_STAT(iface, tc.recv[i].priority), GET_STAT(iface, tc.recv[i].pkts), GET_STAT(iface, tc.recv[i].dropped), GET_STAT(iface, tc.recv[i].bytes)); } else { - PR("[%d] %s (%u)\t%u\t%u\t\t%u\t%u us%s\n", i, + PR("[%d] %s (%d)\t%d\t%d\t\t%d\t%u us%s\n", i, priority2str(GET_STAT(iface, tc.recv[i].priority)), GET_STAT(iface, tc.recv[i].priority), GET_STAT(iface, tc.recv[i].pkts), @@ -397,7 +397,7 @@ static void print_tc_rx_stats(const struct shell *sh, struct net_if *iface) PR("TC Priority\tRecv pkts\tDrop pkts\tbytes\n"); for (i = 0; i < NET_TC_RX_COUNT; i++) { - PR("[%d] %s (%u)\t%u\t%u\t\t%u\n", i, + PR("[%d] %s (%d)\t%d\t%d\t\t%d\n", i, priority2str(GET_STAT(iface, tc.recv[i].priority)), GET_STAT(iface, tc.recv[i].priority), GET_STAT(iface, tc.recv[i].pkts), @@ -459,25 +459,25 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data) } #if defined(CONFIG_NET_STATISTICS_IPV6) && defined(CONFIG_NET_NATIVE_IPV6) - PR("IPv6 recv %u\tsent\t%u\tdrop\t%u\tforwarded\t%u\n", + PR("IPv6 recv %d\tsent\t%d\tdrop\t%d\tforwarded\t%d\n", GET_STAT(iface, ipv6.recv), GET_STAT(iface, ipv6.sent), GET_STAT(iface, ipv6.drop), GET_STAT(iface, ipv6.forwarded)); #if defined(CONFIG_NET_STATISTICS_IPV6_ND) - PR("IPv6 ND recv %u\tsent\t%u\tdrop\t%u\n", + PR("IPv6 ND recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv6_nd.recv), GET_STAT(iface, ipv6_nd.sent), GET_STAT(iface, ipv6_nd.drop)); #endif /* CONFIG_NET_STATISTICS_IPV6_ND */ #if defined(CONFIG_NET_STATISTICS_IPV6_PMTU) - PR("IPv6 PMTU recv %u\tsent\t%u\tdrop\t%u\n", + PR("IPv6 PMTU recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv6_pmtu.recv), GET_STAT(iface, ipv6_pmtu.sent), GET_STAT(iface, ipv6_pmtu.drop)); #endif /* CONFIG_NET_STATISTICS_IPV6_PMTU */ #if defined(CONFIG_NET_STATISTICS_MLD) - PR("IPv6 MLD recv %u\tsent\t%u\tdrop\t%u\n", + PR("IPv6 MLD recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv6_mld.recv), GET_STAT(iface, ipv6_mld.sent), GET_STAT(iface, ipv6_mld.drop)); @@ -485,86 +485,86 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data) #endif /* CONFIG_NET_STATISTICS_IPV6 */ #if defined(CONFIG_NET_STATISTICS_IPV4) && defined(CONFIG_NET_NATIVE_IPV4) - PR("IPv4 recv %u\tsent\t%u\tdrop\t%u\tforwarded\t%u\n", + PR("IPv4 recv %d\tsent\t%d\tdrop\t%d\tforwarded\t%d\n", GET_STAT(iface, ipv4.recv), GET_STAT(iface, ipv4.sent), GET_STAT(iface, ipv4.drop), GET_STAT(iface, ipv4.forwarded)); #endif /* CONFIG_NET_STATISTICS_IPV4 */ - PR("IP vhlerr %u\thblener\t%u\tlblener\t%u\n", + PR("IP vhlerr %d\thblener\t%d\tlblener\t%d\n", GET_STAT(iface, ip_errors.vhlerr), GET_STAT(iface, ip_errors.hblenerr), GET_STAT(iface, ip_errors.lblenerr)); - PR("IP fragerr %u\tchkerr\t%u\tprotoer\t%u\n", + PR("IP fragerr %d\tchkerr\t%d\tprotoer\t%d\n", GET_STAT(iface, ip_errors.fragerr), GET_STAT(iface, ip_errors.chkerr), GET_STAT(iface, ip_errors.protoerr)); #if defined(CONFIG_NET_STATISTICS_IPV4_PMTU) - PR("IPv4 PMTU recv %u\tsent\t%u\tdrop\t%u\n", + PR("IPv4 PMTU recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv4_pmtu.recv), GET_STAT(iface, ipv4_pmtu.sent), GET_STAT(iface, ipv4_pmtu.drop)); #endif /* CONFIG_NET_STATISTICS_IPV4_PMTU */ #if defined(CONFIG_NET_STATISTICS_ICMP) && defined(CONFIG_NET_NATIVE_IPV4) - PR("ICMP recv %u\tsent\t%u\tdrop\t%u\n", + PR("ICMP recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, icmp.recv), GET_STAT(iface, icmp.sent), GET_STAT(iface, icmp.drop)); - PR("ICMP typeer %u\tchkerr\t%u\n", + PR("ICMP typeer %d\tchkerr\t%d\n", GET_STAT(iface, icmp.typeerr), GET_STAT(iface, icmp.chkerr)); #endif #if defined(CONFIG_NET_STATISTICS_IGMP) - PR("IGMP recv %u\tsent\t%u\tdrop\t%u\n", + PR("IGMP recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, ipv4_igmp.recv), GET_STAT(iface, ipv4_igmp.sent), GET_STAT(iface, ipv4_igmp.drop)); #endif /* CONFIG_NET_STATISTICS_IGMP */ #if defined(CONFIG_NET_STATISTICS_UDP) && defined(CONFIG_NET_NATIVE_UDP) - PR("UDP recv %u\tsent\t%u\tdrop\t%u\n", + PR("UDP recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, udp.recv), GET_STAT(iface, udp.sent), GET_STAT(iface, udp.drop)); - PR("UDP chkerr %u\n", + PR("UDP chkerr %d\n", GET_STAT(iface, udp.chkerr)); #endif #if defined(CONFIG_NET_STATISTICS_TCP) && defined(CONFIG_NET_NATIVE_TCP) - PR("TCP bytes recv %u\tsent\t%u\tresent\t%u\n", + PR("TCP bytes recv %u\tsent\t%d\tresent\t%d\n", GET_STAT(iface, tcp.bytes.received), GET_STAT(iface, tcp.bytes.sent), GET_STAT(iface, tcp.resent)); - PR("TCP seg recv %u\tsent\t%u\tdrop\t%u\n", + PR("TCP seg recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, tcp.recv), GET_STAT(iface, tcp.sent), GET_STAT(iface, tcp.seg_drop)); - PR("TCP seg resent %u\tchkerr\t%u\tackerr\t%u\n", + PR("TCP seg resent %d\tchkerr\t%d\tackerr\t%d\n", GET_STAT(iface, tcp.rexmit), GET_STAT(iface, tcp.chkerr), GET_STAT(iface, tcp.ackerr)); - PR("TCP seg rsterr %u\trst\t%u\n", + PR("TCP seg rsterr %d\trst\t%d\n", GET_STAT(iface, tcp.rsterr), GET_STAT(iface, tcp.rst)); - PR("TCP conn drop %u\tconnrst\t%u\n", + PR("TCP conn drop %d\tconnrst\t%d\n", GET_STAT(iface, tcp.conndrop), GET_STAT(iface, tcp.connrst)); - PR("TCP pkt drop %u\n", GET_STAT(iface, tcp.drop)); + PR("TCP pkt drop %d\n", GET_STAT(iface, tcp.drop)); #endif #if defined(CONFIG_NET_STATISTICS_DNS) - PR("DNS recv %u\tsent\t%u\tdrop\t%u\n", + PR("DNS recv %d\tsent\t%d\tdrop\t%d\n", GET_STAT(iface, dns.recv), GET_STAT(iface, dns.sent), GET_STAT(iface, dns.drop)); #endif /* CONFIG_NET_STATISTICS_DNS */ #if defined(CONFIG_NET_STATISTICS_PKT_FILTER) - PR("Filter drop rx %u" - IF_ENABLED(CONFIG_NET_PKT_FILTER_IPV4_HOOK, ("\tIPv4\t%u")) - IF_ENABLED(CONFIG_NET_PKT_FILTER_IPV6_HOOK, ("\tIPv6\t%u")) - IF_ENABLED(CONFIG_NET_PKT_FILTER_LOCAL_IN_HOOK, ("\tlocal\t%u")) - "\ttx\t%u\n", + PR("Filter drop rx %d" + IF_ENABLED(CONFIG_NET_PKT_FILTER_IPV4_HOOK, ("\tIPv4\t%d")) + IF_ENABLED(CONFIG_NET_PKT_FILTER_IPV6_HOOK, ("\tIPv6\t%d")) + IF_ENABLED(CONFIG_NET_PKT_FILTER_LOCAL_IN_HOOK, ("\tlocal\t%d")) + "\ttx\t%d\n", GET_STAT(iface, pkt_filter.rx.drop), IF_ENABLED(CONFIG_NET_PKT_FILTER_IPV4_HOOK, (GET_STAT(iface, pkt_filter.rx.ipv4_drop),)) @@ -577,7 +577,7 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data) PR("Bytes received %u\n", GET_STAT(iface, bytes.received)); PR("Bytes sent %u\n", GET_STAT(iface, bytes.sent)); - PR("Processing err %u\n", GET_STAT(iface, processing_error)); + PR("Processing err %d\n", GET_STAT(iface, processing_error)); print_tc_tx_stats(sh, iface); print_tc_rx_stats(sh, iface); From e0cadf1e86dad888e2f93b4977f88c26a0ec8fe2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 717/881] Revert "[nrf fromtree] net: sockets_offload: Allow to enable/disable DNS offload at runtime" This reverts commit cc1ccd035ce8e4836d26ec1d65c1c322b5e12d94. Signed-off-by: Jukka Rissanen --- include/zephyr/net/socket_offload.h | 33 ------------------------- subsys/net/lib/sockets/getaddrinfo.c | 4 +-- subsys/net/lib/sockets/socket_offload.c | 30 +--------------------- 3 files changed, 3 insertions(+), 64 deletions(-) diff --git a/include/zephyr/net/socket_offload.h b/include/zephyr/net/socket_offload.h index 4dcf27250b4..988d0fb686b 100644 --- a/include/zephyr/net/socket_offload.h +++ b/include/zephyr/net/socket_offload.h @@ -41,39 +41,6 @@ struct socket_dns_offload { */ void socket_offload_dns_register(const struct socket_dns_offload *ops); -/** - * @brief Deregister an offloaded socket DNS API interface. - * - * @param ops A pointer to the offloaded socket DNS API interface. - * - * @retval 0 On success - * @retval -EINVAL Offloaded DNS API was not regsitered. - */ -int socket_offload_dns_deregister(const struct socket_dns_offload *ops); - -/** - * @brief Enable/disable DNS offloading at runtime. - * - * @param enable Whether to enable or disable the DNS offloading. - */ -void socket_offload_dns_enable(bool enable); - -/** - * @brief Check if DNS offloading is enabled. - * - * @retval true DNS offloaded API is registered and enabled. - * @retval false DNS offloading is disabled. - */ -#if defined(CONFIG_NET_SOCKETS_OFFLOAD) -bool socket_offload_dns_is_enabled(void); -#else -static inline bool socket_offload_dns_is_enabled(void) -{ - return false; -} -#endif /* defined(CONFIG_NET_SOCKETS_OFFLOAD) */ - - /** @cond INTERNAL_HIDDEN */ int socket_offload_getaddrinfo(const char *node, const char *service, diff --git a/subsys/net/lib/sockets/getaddrinfo.c b/subsys/net/lib/sockets/getaddrinfo.c index a53f3a005a4..86ee417d929 100644 --- a/subsys/net/lib/sockets/getaddrinfo.c +++ b/subsys/net/lib/sockets/getaddrinfo.c @@ -433,7 +433,7 @@ int zsock_getaddrinfo(const char *host, const char *service, const struct zsock_addrinfo *hints, struct zsock_addrinfo **res) { - if (socket_offload_dns_is_enabled()) { + if (IS_ENABLED(CONFIG_NET_SOCKETS_OFFLOAD)) { return socket_offload_getaddrinfo(host, service, hints, res); } @@ -471,7 +471,7 @@ int zsock_getaddrinfo(const char *host, const char *service, void zsock_freeaddrinfo(struct zsock_addrinfo *ai) { - if (socket_offload_dns_is_enabled()) { + if (IS_ENABLED(CONFIG_NET_SOCKETS_OFFLOAD)) { socket_offload_freeaddrinfo(ai); return; } diff --git a/subsys/net/lib/sockets/socket_offload.c b/subsys/net/lib/sockets/socket_offload.c index 3e4ea3b8bbe..b6c2ef4fd64 100644 --- a/subsys/net/lib/sockets/socket_offload.c +++ b/subsys/net/lib/sockets/socket_offload.c @@ -12,8 +12,7 @@ LOG_MODULE_REGISTER(net_socket_offload, CONFIG_NET_SOCKETS_LOG_LEVEL); #include "sockets_internal.h" -static const struct socket_dns_offload *dns_offload; -static bool dns_offload_enabled; +const struct socket_dns_offload *dns_offload; void socket_offload_dns_register(const struct socket_dns_offload *ops) { @@ -21,33 +20,6 @@ void socket_offload_dns_register(const struct socket_dns_offload *ops) __ASSERT_NO_MSG(dns_offload == NULL); dns_offload = ops; - - socket_offload_dns_enable(true); -} - -int socket_offload_dns_deregister(const struct socket_dns_offload *ops) -{ - __ASSERT_NO_MSG(ops != NULL); - - if (dns_offload != ops) { - return -EINVAL; - } - - dns_offload = NULL; - - socket_offload_dns_enable(false); - - return 0; -} - -void socket_offload_dns_enable(bool enable) -{ - dns_offload_enabled = enable; -} - -bool socket_offload_dns_is_enabled(void) -{ - return (dns_offload != NULL) && dns_offload_enabled; } int socket_offload_getaddrinfo(const char *node, const char *service, From 35be7b0872741b1318b6265bf4449695e6d10614 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 718/881] Revert "[nrf fromtree] net: mqtt: Allow to bind client to a specific interface" This reverts commit e3a33ba9b8c3147958c82d3e0298f45edee73062. Signed-off-by: Jukka Rissanen --- include/zephyr/net/mqtt.h | 5 ----- .../net/lib/mqtt/mqtt_transport_socket_tcp.c | 22 ++----------------- .../net/lib/mqtt/mqtt_transport_socket_tls.c | 18 --------------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index b992714afd3..d5dce240230 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -809,11 +809,6 @@ struct mqtt_transport { */ enum mqtt_transport_type type; - /** Name of the interface that the MQTT client instance should be bound to. - * Leave as NULL if not specified. - */ - const char *if_name; - /** Use either unsecured TCP or secured TLS transport */ union { /** TCP socket transport for MQTT */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tcp.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tcp.c index 58f37857bb2..ffb8bcdb683 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tcp.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tcp.c @@ -29,26 +29,6 @@ int mqtt_client_tcp_connect(struct mqtt_client *client) return -errno; } - NET_DBG("Created socket %d", client->transport.tcp.sock); - - if (client->transport.if_name != NULL) { - struct ifreq ifname = { 0 }; - - strncpy(ifname.ifr_name, client->transport.if_name, - sizeof(ifname.ifr_name) - 1); - - ret = zsock_setsockopt(client->transport.tcp.sock, SOL_SOCKET, - SO_BINDTODEVICE, &ifname, - sizeof(struct ifreq)); - if (ret < 0) { - NET_ERR("Failed to bind ot interface %s error (%d)", - ifname.ifr_name, -errno); - goto error; - } - - NET_DBG("Bound to interface %s", ifname.ifr_name); - } - #if defined(CONFIG_SOCKS) if (client->transport.proxy.addrlen != 0) { ret = setsockopt(client->transport.tcp.sock, @@ -61,6 +41,8 @@ int mqtt_client_tcp_connect(struct mqtt_client *client) } #endif + NET_DBG("Created socket %d", client->transport.tcp.sock); + size_t peer_addr_size = sizeof(struct sockaddr_in6); if (broker->sa_family == AF_INET) { diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 2ff337eef34..a33cee5aecf 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -32,24 +32,6 @@ int mqtt_client_tls_connect(struct mqtt_client *client) NET_DBG("Created socket %d", client->transport.tls.sock); - if (client->transport.if_name != NULL) { - struct ifreq ifname = { 0 }; - - strncpy(ifname.ifr_name, client->transport.if_name, - sizeof(ifname.ifr_name) - 1); - - ret = zsock_setsockopt(client->transport.tls.sock, SOL_SOCKET, - SO_BINDTODEVICE, &ifname, - sizeof(struct ifreq)); - if (ret < 0) { - NET_ERR("Failed to bind ot interface %s error (%d)", - ifname.ifr_name, -errno); - goto error; - } - - NET_DBG("Bound to interface %s", ifname.ifr_name); - } - #if defined(CONFIG_SOCKS) if (client->transport.proxy.addrlen != 0) { ret = setsockopt(client->transport.tls.sock, From 6d81433752aab21d42a2886b373389ea5a6ad9ec Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 719/881] Revert "[nrf fromtree] dts: bindings: nordic-nrf-nfct-v2: Extend description" This reverts commit 1f9b5b32f8b2d9db4273e30e7e82c82c4de77262. Signed-off-by: Jukka Rissanen --- dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml b/dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml index f7602739114..e6b34aff3ec 100644 --- a/dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml +++ b/dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml @@ -12,8 +12,7 @@ properties: type: boolean description: | When enabled this property will configure pins dedicated to NFCT - peripheral as regular GPIOs. If this property is applied in cpuapp then node - can be disabled or reserved (because NFCT is by default assigned to cpuapp). - If property is applied in cpurad CPU then node must be reserved. + peripheral as regular GPIOs. This property must be applied in cpuapp + if NFCT pins are intended to be used as regular GPIOs by any core. NFC pins in nRF54H series: P2.10 and P2.11 From 3fea999afa2740c7f0c25c45986149f861039080 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 720/881] Revert "[nrf fromtree] soc: nordic: nrf54h: Allow using NFCT pins as gpios on cpurad" This reverts commit b0f414596b7e6ebfa0d86537e5b1e63bb76bf36c. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/soc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index e053953b821..c1849ab3a23 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -153,9 +153,7 @@ void soc_early_init_hook(void) nrf_spu_periph_perm_dmasec_set(spu, nrf_address_slave_get(ccm030_addr), true); #endif - if (((IS_ENABLED(CONFIG_SOC_NRF54H20_CPUAPP) && - DT_NODE_HAS_STATUS(DT_NODELABEL(nfct), disabled)) || - DT_NODE_HAS_STATUS(DT_NODELABEL(nfct), reserved)) && + if (DT_NODE_HAS_STATUS(DT_NODELABEL(nfct), disabled) && DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } From 873a1309b330c1ba9fa18f6d21e30ea69d7a40b2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 721/881] Revert "[nrf fromtree] dts: vendor: nordic: Fix nfct compatible" This reverts commit 9ae44c864700b51d8dc4e3bdabf994420b5c4d66. Signed-off-by: Jukka Rissanen --- dts/arm/nordic/nrf54h20_cpuapp.dtsi | 4 ++++ dts/vendor/nordic/nrf54h20.dtsi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index c56df42ddd5..15eac9c5d19 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -59,3 +59,7 @@ wdt011: &cpuapp_wdt011 {}; &grtc { interrupts = <109 NRF_DEFAULT_IRQ_PRIORITY>; }; + +&nfct { + compatible = "nordic,nrf-nfct-v2"; +}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 5fcb941aaae..96d4ff53af1 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -918,7 +918,7 @@ }; nfct: nfct@985000 { - compatible = "nordic,nrf-nfct-v2"; + compatible = "nordic,nrf-nfct"; reg = <0x985000 0x1000>; status = "disabled"; interrupts = <389 NRF_DEFAULT_IRQ_PRIORITY>; From d739798b32ca0fdaff7ff438bd47a135b97df767 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 722/881] Revert "[nrf fromtree] soc: nordic: common: Fix HAS_HW_NRF_NFCT condition" This reverts commit 2335e7f94853e6850bf9254b82d43a8a8243dc59. Signed-off-by: Jukka Rissanen --- soc/nordic/common/Kconfig.peripherals | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index ce91800a615..5a6e820efcb 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -118,8 +118,7 @@ config HAS_HW_NRF_MWU def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_MWU)) config HAS_HW_NRF_NFCT - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_NFCT)) || \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_NFCT_V2)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_NFCT)) config HAS_HW_NRF_NVMC_PE def_bool $(dt_nodelabel_bool_prop,flash_controller,partial-erase) From 53c0d557c96195a8d63cc2404c30890d557bd712 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 723/881] Revert "[nrf fromtree] net: l2: wifi: Fix mode change issue in Wi-Fi shell" This reverts commit d58d68a1c7b22fbb7d79313bb749b9a1fc4d85ee. Signed-off-by: Jukka Rissanen --- subsys/net/l2/wifi/wifi_shell.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index c5dc9d88977..0b8257695dd 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -2865,11 +2865,11 @@ void parse_mode_args_to_params(const struct shell *sh, int argc, {"monitor", no_argument, 0, 'm'}, {"ap", no_argument, 0, 'a'}, {"softap", no_argument, 0, 'k'}, + {"get", no_argument, 0, 'g'}, {"help", no_argument, 0, 'h'}, {0, 0, 0, 0}}; - mode->oper = WIFI_MGMT_GET; - while ((opt = getopt_long(argc, argv, "i:smtpakh", + while ((opt = getopt_long(argc, argv, "i:smtpakgh", long_options, &opt_index)) != -1) { state = getopt_state_get(); switch (opt) { @@ -2889,6 +2889,10 @@ void parse_mode_args_to_params(const struct shell *sh, int argc, mode->mode |= WIFI_SOFTAP_MODE; opt_num++; break; + case 'g': + mode->oper = WIFI_MGMT_GET; + opt_num++; + break; case 'i': mode->if_index = (uint8_t)atoi(state->optarg); /* Don't count iface as it's common for both get and set */ @@ -2904,7 +2908,7 @@ void parse_mode_args_to_params(const struct shell *sh, int argc, } } - if (opt_num != 0) { + if (opt_num == 0) { mode->oper = WIFI_MGMT_SET; } } @@ -4060,8 +4064,9 @@ SHELL_SUBCMD_ADD((wifi), mode, NULL, "[-a, --ap] : AP mode\n" "[-k, --softap] : Softap mode\n" "[-h, --help] : Help\n" + "[-g, --get] : Get current mode for a specific interface index\n" "Usage: Get operation example for interface index 1\n" - "wifi mode -i1\n" + "wifi mode -g -i1\n" "Set operation example for interface index 1 - set station+promiscuous\n" "wifi mode -i1 -sp.\n", cmd_wifi_mode, From 2130025bc9840f6adffc6555fc58eb95b313b491 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:38 +0300 Subject: [PATCH 724/881] Revert "[nrf fromtree] kernel: Guard SYS_CLOCK_HW_CYCLES_PER_SEC to avoid spurious empty macro" This reverts commit abcf8fc2c12403f5912344a41f5af259615f110a. Signed-off-by: Jukka Rissanen --- kernel/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/Kconfig b/kernel/Kconfig index 536a6624f52..6e7058ffc43 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -828,7 +828,6 @@ config SYS_CLOCK_TICKS_PER_SEC config SYS_CLOCK_HW_CYCLES_PER_SEC int "System clock's h/w timer frequency" default 0 if TIMER_READS_ITS_FREQUENCY_AT_RUNTIME - depends on SYS_CLOCK_EXISTS help This option specifies the frequency of the hardware timer used for the system clock (in Hz). This option is set by the SOC's or board's Kconfig file From 565f9d0e0a21376bd4f0d620a986a0b7c3255d14 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 725/881] Revert "[nrf fromtree] bluetooth: mesh: clarify mesh dfu fwid max length" This reverts commit 576de35b2fe8ec34351cf0b2bc05d1332ade2b80. Signed-off-by: Jukka Rissanen --- subsys/bluetooth/mesh/Kconfig | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index e51ad2ccac0..b876e88dae6 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1085,15 +1085,10 @@ menu "Firmware Update model configuration" config BT_MESH_DFU_FWID_MAXLEN int "DFU FWID max length" - default 106 + default 16 range 0 106 help - This value defines the maximum length of the vendor-specific version information - that the mesh stack can manage, describing the image. Please note that - only 106 octets size allows the device to be compliant with - the Bluetooth Mesh DFU specification. If smaller than 106 octets are set, - then the device will fail with managing firmware images that have - a longer vendor-specific version information. + This value defines the maximum length of an image's firmware ID. config BT_MESH_DFU_METADATA_MAXLEN int "DFU metadata max length" From 606a1d043d67b80e9595f1b8710b8b3ebd453a94 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 726/881] Revert "[nrf fromtree] tests: bluetooth: tester: fix configuration to use max fwid length" This reverts commit 7038ae2f234221e3cda6c35becc3eb09bc36f19b. Signed-off-by: Jukka Rissanen --- tests/bluetooth/tester/overlay-mesh.conf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/bluetooth/tester/overlay-mesh.conf b/tests/bluetooth/tester/overlay-mesh.conf index 9def34c62ac..04e6c074e21 100644 --- a/tests/bluetooth/tester/overlay-mesh.conf +++ b/tests/bluetooth/tester/overlay-mesh.conf @@ -19,9 +19,9 @@ CONFIG_BT_MESH_CFG_CLI=y CONFIG_BT_MESH_HEALTH_CLI=y CONFIG_BT_MESH_FRIEND=y CONFIG_BT_MESH_FRIEND_QUEUE_SIZE=32 -CONFIG_BT_MESH_RX_SEG_MAX=32 -CONFIG_BT_MESH_TX_SEG_MAX=32 -CONFIG_BT_MESH_TX_SEG_MSG_COUNT=10 +CONFIG_BT_MESH_RX_SEG_MAX=13 +CONFIG_BT_MESH_TX_SEG_MAX=8 +CONFIG_BT_MESH_TX_SEG_MSG_COUNT=3 CONFIG_BT_MESH_LPN_POLL_TIMEOUT=100 CONFIG_BT_MESH_PROVISIONER=y CONFIG_BT_MESH_CDB=y @@ -38,6 +38,7 @@ CONFIG_BT_MESH_LARGE_COMP_DATA_CLI=y CONFIG_BT_MESH_LARGE_COMP_DATA_SRV=y CONFIG_BT_MESH_SAR_CFG_SRV=y CONFIG_BT_MESH_SAR_CFG_CLI=y +CONFIG_BT_MESH_TX_SEG_MSG_COUNT=10 CONFIG_BT_MESH_RPR_SRV=y CONFIG_BT_MESH_RPR_CLI=y CONFIG_BT_MESH_RPR_AD_TYPES_MAX=2 From 64b0795b7342efbae4138f5e9e86891bffbb2448 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 727/881] Revert "[nrf fromtree] include: sys_clock: Fix compilation when SYS_CLOCK_EXISTS is disabled" This reverts commit 364eba60a02157520c5a2c1155ecc221528a6fcf. Signed-off-by: Jukka Rissanen --- include/zephyr/sys_clock.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/zephyr/sys_clock.h b/include/zephyr/sys_clock.h index 5f31d585ff1..6c3589a5102 100644 --- a/include/zephyr/sys_clock.h +++ b/include/zephyr/sys_clock.h @@ -162,11 +162,10 @@ typedef struct { /** @endcond */ #ifndef CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME -#if defined(CONFIG_SYS_CLOCK_EXISTS) -#if CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0 +#if defined(CONFIG_SYS_CLOCK_EXISTS) && \ + (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0) #error "SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!" -#endif /* CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0 */ -#endif /* CONFIG_SYS_CLOCK_EXISTS */ +#endif #endif /* CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME */ /* kernel clocks */ From 7a08fb2aa7d0fd7c74e7917508fd8f4c063ef2d4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 728/881] Revert "[nrf fromtree] drivers: spi_nrfx_spim: Fix SPIM_REQUESTS_CLOCK() and calls to it" This reverts commit 11286f42e1bf5693860408640524645675027666. Signed-off-by: Jukka Rissanen --- drivers/spi/spi_nrfx_spim.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index dcfee1c5ede..21a454c5ff8 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -45,7 +45,7 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #if defined(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL) #define SPIM_REQUESTS_CLOCK(node) \ - DT_NODE_HAS_COMPAT(DT_CLOCKS_CTLR(node), nordic_nrf_hsfll_global) + DT_NODE_HAS_COMPAT(DT_NODELABEL(DT_CLOCKS_CTLR(node)), nordic_nrf_hsfll_global) #define SPIM_REQUESTS_CLOCK_OR(node) SPIM_REQUESTS_CLOCK(node) || #if (DT_FOREACH_STATUS_OKAY(nordic_nrf_spim, SPIM_REQUESTS_CLOCK_OR) 0) #define USE_CLOCK_REQUESTS 1 @@ -56,7 +56,7 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); #endif #else -#define SPIM_REQUESTS_CLOCK(node) 0 +#define SPIM_REQUESTS_CLOCK(idx) 0 #endif struct spi_nrfx_data { @@ -799,7 +799,7 @@ static int spi_nrfx_init(const struct device *dev) #if defined(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY) && \ CONFIG_SPI_INIT_PRIORITY < CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY #define SPIM_INIT_PRIORITY(idx) \ - COND_CODE_1(SPIM_REQUESTS_CLOCK(SPIM(idx)), \ + COND_CODE_1(SPIM_REQUESTS_CLOCK(idx), \ (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY)), \ (CONFIG_SPI_INIT_PRIORITY)) #else @@ -858,8 +858,8 @@ static int spi_nrfx_init(const struct device *dev) .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPIM(idx)), \ IF_ENABLED(CONFIG_DCACHE, \ (.mem_attr = SPIM_GET_MEM_ATTR(idx),)) \ - IF_ENABLED(USE_CLOCK_REQUESTS, \ - (.clk_dev = SPIM_REQUESTS_CLOCK(SPIM(idx)) \ + IF_ENABLED(USE_CLOCK_REQUESTS, \ + (.clk_dev = SPIM_REQUESTS_CLOCK(idx) \ ? DEVICE_DT_GET(DT_CLOCKS_CTLR(SPIM(idx))) \ : NULL, \ .clk_spec = { \ From af314a1eba825b4be8a1662d0800b6e3a1a81cab Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 729/881] Revert "[nrf fromlist] drivers: Extend analog pins mapping for nRF54L." This reverts commit ecabf6ad9cc204ae103798776d8e49f0f25dea72. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 17 +++-------------- drivers/comparator/comparator_nrf_common.h | 11 +---------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index a9cc1c4f36b..8072e0c7eaf 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -54,7 +54,7 @@ static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { [NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD, [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, }; -#elif defined(NRF54LM20A_ENGA_XXAA) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), @@ -65,20 +65,9 @@ static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, +#if defined(NRF_SAADC_INPUT_AVDD) [NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD, - [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, -}; -#elif defined(NRF54LV10A_ENGA_XXAA) -static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { - [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), - [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), - [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(10U, 1), - [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), - [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), - [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, +#endif [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, }; #endif diff --git a/drivers/comparator/comparator_nrf_common.h b/drivers/comparator/comparator_nrf_common.h index e86fc9f6369..c45e6676e2d 100644 --- a/drivers/comparator/comparator_nrf_common.h +++ b/drivers/comparator/comparator_nrf_common.h @@ -28,7 +28,7 @@ static const uint32_t shim_nrf_comp_ain_map[] = { NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), -#elif defined(NRF54LM20A_ENGA_XXAA) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), @@ -37,15 +37,6 @@ static const uint32_t shim_nrf_comp_ain_map[] = { NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), -#elif defined(NRF54LV10A_ENGA_XXAA) - NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(10U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), #endif }; #endif From c50c77a298794636da90b432f1145900ef02065e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 730/881] Revert "[nrf fromlist] modules: hal_nordic: nrf_802154: set clock startup latency" This reverts commit f75eb49bc4b2c7af71e81af488dcc3e268f36d79. Signed-off-by: Jukka Rissanen --- .../sl_opensource/platform/nrf_802154_clock_zephyr.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c b/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c index 1ade977118e..87aa85261e9 100644 --- a/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c +++ b/modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c @@ -18,11 +18,7 @@ static bool hfclk_is_running; void nrf_802154_clock_init(void) { -#ifdef NRF54L_SERIES - uint32_t clock_latency_us = z_nrf_clock_bt_ctlr_hf_get_startup_time_us(); - - nrf_802154_clock_hfclk_latency_set(clock_latency_us); -#endif + /* Intentionally empty. */ } void nrf_802154_clock_deinit(void) From 2721b10f45f956e4e20ac16c70fdcb7a9b1d8f40 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 731/881] Revert "[nrf fromlist] boards: nordic: nRF54L15DK: set HFXO clock latency to 854" This reverts commit 4d99f0a7a308498ddd97c4828f5ed2bcf21191dc. Signed-off-by: Jukka Rissanen --- boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi index 6740544b524..c030c2c5518 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi @@ -108,9 +108,5 @@ pinctrl-names = "default", "sleep"; }; -&hfxo { - startup-time-us = <854>; -}; - /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; From 47a2f04a7ce50fceecbc582185f5c6455bcbc834 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 732/881] Revert "[nrf fromtree] tests: kernel: timer: cycle64: Add support for GRTC" This reverts commit 0ef6cddb84188c85bdd22d50f18fe75cfbf65872. Signed-off-by: Jukka Rissanen --- tests/kernel/timer/cycle64/testcase.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/kernel/timer/cycle64/testcase.yaml b/tests/kernel/timer/cycle64/testcase.yaml index 1598c07337b..f1a65dbb00a 100644 --- a/tests/kernel/timer/cycle64/testcase.yaml +++ b/tests/kernel/timer/cycle64/testcase.yaml @@ -14,7 +14,7 @@ tests: tags: - kernel - timer - filter: CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER and not CONFIG_NRF_GRTC_TIMER + filter: CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER arch_exclude: posix timeout: 140 slow: true @@ -22,13 +22,5 @@ tests: tags: - kernel - timer - filter: CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER and not CONFIG_NRF_GRTC_TIMER + filter: CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER arch_allow: posix - kernel.timer.cycle64.grtc: - tags: - - kernel - - timer - filter: CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER and CONFIG_NRF_GRTC_TIMER - arch_exclude: posix - timeout: 8600 - slow: true From 03b844314458821a04c8ee3ae4995300791638f4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 733/881] Revert "[nrf fromtree] tests: boards: nrf: i2c_slave: allow more instances" This reverts commit 9d98e46b5b4c49c9f86f2b2db4dc01bacdf571f7. Signed-off-by: Jukka Rissanen --- tests/boards/nrf/i2c/i2c_slave/src/main.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/boards/nrf/i2c/i2c_slave/src/main.c b/tests/boards/nrf/i2c/i2c_slave/src/main.c index 403c8568290..1de4b16bc2c 100644 --- a/tests/boards/nrf/i2c/i2c_slave/src/main.c +++ b/tests/boards/nrf/i2c/i2c_slave/src/main.c @@ -21,14 +21,8 @@ #define I2C_S_INSTANCE 1 #elif CONFIG_NRFX_TWIS2 #define I2C_S_INSTANCE 2 -#elif CONFIG_NRFX_TWIS20 -#define I2C_S_INSTANCE 20 -#elif CONFIG_NRFX_TWIS21 -#define I2C_S_INSTANCE 21 #elif CONFIG_NRFX_TWIS22 #define I2C_S_INSTANCE 22 -#elif CONFIG_NRFX_TWIS30 -#define I2C_S_INSTANCE 30 #elif CONFIG_NRFX_TWIS131 #define I2C_S_INSTANCE 131 #else From d930656842ded59cb317bea3d7992b9751e32005 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 734/881] Revert "[nrf fromtree] sysbuild: Allow to use file suffix DTS overlays" This reverts commit d324d762445ac06a7d59fbec0407685419ed5ab3. Signed-off-by: Jukka Rissanen --- .../cmake/modules/sysbuild_extensions.cmake | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake index 75778f655a8..db6e60f9ab7 100644 --- a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake +++ b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake @@ -261,7 +261,7 @@ function(ExternalZephyrProject_Add) set(sysbuild_image_conf_dir ${APP_DIR}/sysbuild) set(sysbuild_image_name_conf_dir ${APP_DIR}/sysbuild/${ZBUILD_APPLICATION}) # User defined `-D_CONF_FILE=` takes precedence over anything else. - if(NOT ${ZBUILD_APPLICATION}_CONF_FILE) + if (NOT ${ZBUILD_APPLICATION}_CONF_FILE) if(EXISTS ${sysbuild_image_name_conf_dir}) set(${ZBUILD_APPLICATION}_APPLICATION_CONFIG_DIR ${sysbuild_image_name_conf_dir} CACHE INTERNAL "Application configuration dir controlled by sysbuild" @@ -275,7 +275,7 @@ function(ExternalZephyrProject_Add) NAMES ${ZBUILD_APPLICATION}.conf SUFFIX ${FILE_SUFFIX} ) - if(NOT (${ZBUILD_APPLICATION}_OVERLAY_CONFIG OR ${ZBUILD_APPLICATION}_EXTRA_CONF_FILE) + if (NOT (${ZBUILD_APPLICATION}_OVERLAY_CONFIG OR ${ZBUILD_APPLICATION}_EXTRA_CONF_FILE) AND EXISTS ${sysbuild_image_conf_fragment} ) set(${ZBUILD_APPLICATION}_EXTRA_CONF_FILE ${sysbuild_image_conf_fragment} @@ -283,23 +283,12 @@ function(ExternalZephyrProject_Add) ) endif() - if(NOT ${ZBUILD_APPLICATION}_DTC_OVERLAY_FILE) - # Check for overlay named .overlay. - set(sysbuild_image_dts_overlay_files ${sysbuild_image_conf_dir}/${ZBUILD_APPLICATION}.overlay) - - # Check for overlay named _.overlay. - if(FILE_SUFFIX) - list(PREPEND sysbuild_image_dts_overlay_files ${sysbuild_image_conf_dir}/${ZBUILD_APPLICATION}_${FILE_SUFFIX}.overlay) - endif() - - foreach(overlay_file ${sysbuild_image_dts_overlay_files}) - if(EXISTS ${overlay_file}) - set(${ZBUILD_APPLICATION}_DTC_OVERLAY_FILE ${overlay_file} - CACHE INTERNAL "devicetree overlay file defined by main application" - ) - break() - endif() - endforeach() + # Check for overlay named .overlay. + set(sysbuild_image_dts_overlay ${sysbuild_image_conf_dir}/${ZBUILD_APPLICATION}.overlay) + if (NOT ${ZBUILD_APPLICATION}_DTC_OVERLAY_FILE AND EXISTS ${sysbuild_image_dts_overlay}) + set(${ZBUILD_APPLICATION}_DTC_OVERLAY_FILE ${sysbuild_image_dts_overlay} + CACHE INTERNAL "devicetree overlay file defined by main application" + ) endif() endif() From 0892493a0bdc197fc484c57cd4ec2d50b25adbbe Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 735/881] Revert "[nrf fromtree] manifest: update hal_nordic revision to integrate nrfx 3.12.1" This reverts commit 29c0626e5120f3795f31ee7cae3f57f1dba47d9b. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 53b29c849ca..b8b35cb5ef8 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 6e39d4f2b078afaebdb84875089486152fcacb9c + revision: 1f169d927e367eb1e161972e9504da5aa1f10c42 path: modules/hal/nordic groups: - hal From 3ae0e484b03ed4654577800206469b664d29eec3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 736/881] Revert "[nrf fromtree] drivers: adc: nrf: align to non-gain configuration" This reverts commit e6cec3ed74f1e5c9f5ced466d3a97a6aeefb671e. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 8072e0c7eaf..d627dd250e3 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -65,9 +65,7 @@ static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, -#if defined(NRF_SAADC_INPUT_AVDD) [NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD, -#endif [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, }; #endif @@ -233,7 +231,6 @@ static int adc_nrfx_channel_setup(const struct device *dev, return -EINVAL; } -#if NRF_SAADC_HAS_CH_GAIN switch (channel_cfg->gain) { #if defined(SAADC_CH_CONFIG_GAIN_Gain1_6) case ADC_GAIN_1_6: @@ -287,9 +284,6 @@ static int adc_nrfx_channel_setup(const struct device *dev, break; #endif default: -#else - if (channel_cfg->gain != ADC_GAIN_1) { -#endif /* defined(NRF_SAADC_HAS_CH_GAIN) */ LOG_ERR("Selected ADC gain is not valid"); return -EINVAL; } From c0716847293eeb61035096420b37be7f66492fa3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 737/881] Revert "[nrf fromtree] drivers: adc: nrf: align to channel-wide burst configuration" This reverts commit 27c091a6ab28bf77e5a3e2e1ac5c7e1d1c044256. Signed-off-by: Jukka Rissanen --- drivers/adc/adc_nrfx_saadc.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index d627dd250e3..8d8c6a01ad3 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -220,9 +220,7 @@ static int adc_nrfx_channel_setup(const struct device *dev, .resistor_p = NRF_SAADC_RESISTOR_DISABLED, .resistor_n = NRF_SAADC_RESISTOR_DISABLED, #endif -#if NRF_SAADC_HAS_CH_BURST .burst = NRF_SAADC_BURST_DISABLED, -#endif }; uint8_t channel_id = channel_cfg->channel_id; uint32_t input_negative = channel_cfg->input_negative; @@ -532,7 +530,6 @@ static int start_read(const struct device *dev, uint8_t resolution = sequence->resolution; uint8_t active_channels; uint8_t channel_id; - nrf_saadc_burst_t burst; /* Signal an error if channel selection is invalid (no channels or * a non-existing one is selected). @@ -584,13 +581,10 @@ static int start_read(const struct device *dev, * is not used (hence, the multiple channel sampling is * possible), the burst mode have to be deactivated. */ - burst = (sequence->oversampling != 0U ? - NRF_SAADC_BURST_ENABLED : NRF_SAADC_BURST_DISABLED); -#if NRF_SAADC_HAS_CH_BURST - nrf_saadc_channel_burst_set(NRF_SAADC, channel_id, burst); -#else - nrf_saadc_burst_set(NRF_SAADC, burst); -#endif + nrf_saadc_burst_set(NRF_SAADC, channel_id, + (sequence->oversampling != 0U ? + NRF_SAADC_BURST_ENABLED : + NRF_SAADC_BURST_DISABLED)); nrf_saadc_channel_pos_input_set( NRF_SAADC, channel_id, @@ -602,12 +596,10 @@ static int start_read(const struct device *dev, ); ++active_channels; } else { - burst = NRF_SAADC_BURST_DISABLED; -#if NRF_SAADC_HAS_CH_BURST - nrf_saadc_channel_burst_set(NRF_SAADC, channel_id, burst); -#else - nrf_saadc_burst_set(NRF_SAADC, burst); -#endif + nrf_saadc_burst_set( + NRF_SAADC, + channel_id, + NRF_SAADC_BURST_DISABLED); nrf_saadc_channel_pos_input_set( NRF_SAADC, channel_id, From 29f78c4dd4fafc88015f4b03e91529f6970936be Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 738/881] Revert "[nrf fromtree] manifest: update hal_nordic revision to integrate nrfx 3.12.0" This reverts commit 6648c9d3821ea9f7b8e1e5cad31e83d129daef7b. Signed-off-by: Jukka Rissanen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index b8b35cb5ef8..72255ca8b11 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 1f169d927e367eb1e161972e9504da5aa1f10c42 + revision: 4eafaa44a55a557595e529f8cbdfc8dc1248da36 path: modules/hal/nordic groups: - hal From 13901be82880ad24e94077ee687ca161171fa7fb Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 739/881] Revert "[nrf fromtree] test: drivers: clock_control_api: Fix conf file application" This reverts commit fced75e9087afccf7964ff8fe4bc2c9000aab2d2. Signed-off-by: Jukka Rissanen --- tests/drivers/clock_control/clock_control_api/testcase.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index d624b61fe7c..847e4d41ddf 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -38,4 +38,4 @@ tests: - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 - extra_args: EXTRA_CONF_FILE="nrf_lfclk_rc.conf" + extra_args: CONF_FILE="nrf_lfclk_rc.conf" From 629cde16b4121c41362fd843b93c606ef73cb620 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 740/881] Revert "[nrf fromlist] modules: hal_nordic: nrf_802154: CCA threshold config in dBm" This reverts commit 8d09c7c8284bba85a80683baac288357a7c36f9d. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/Kconfig | 8 ++++---- modules/hal_nordic/nrf_802154/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/hal_nordic/Kconfig b/modules/hal_nordic/Kconfig index 665fe2cc95b..8053017170e 100644 --- a/modules/hal_nordic/Kconfig +++ b/modules/hal_nordic/Kconfig @@ -163,12 +163,12 @@ config NRF_802154_CCA_MODE_CARRIER_OR_ED endchoice -config NRF_802154_CCA_ED_THRESHOLD_DBM - int "nRF IEEE 802.15.4 CCA Energy Detection threshold in dBm" - default -75 +config NRF_802154_CCA_ED_THRESHOLD + int "nRF IEEE 802.15.4 CCA Energy Detection threshold" + default 45 help If energy detected in a given channel is above the value then the - channel is deemed busy. The unit is dBm. + channel is deemed busy. The unit is defined as per 802.15.4-2006 spec. config NRF_802154_CCA_CORR_THRESHOLD int "nRF IEEE 802.15.4 CCA Correlator threshold" diff --git a/modules/hal_nordic/nrf_802154/CMakeLists.txt b/modules/hal_nordic/nrf_802154/CMakeLists.txt index 957019ff1e6..1fc5c85ec0b 100644 --- a/modules/hal_nordic/nrf_802154/CMakeLists.txt +++ b/modules/hal_nordic/nrf_802154/CMakeLists.txt @@ -52,7 +52,7 @@ target_compile_definitions(zephyr-802154-interface # CCA mode options NRF_802154_CCA_CORR_LIMIT_DEFAULT=${CONFIG_NRF_802154_CCA_CORR_LIMIT} NRF_802154_CCA_CORR_THRESHOLD_DEFAULT=${CONFIG_NRF_802154_CCA_CORR_THRESHOLD} - NRF_802154_CCA_ED_THRESHOLD_DBM_DEFAULT=${CONFIG_NRF_802154_CCA_ED_THRESHOLD_DBM} + NRF_802154_CCA_ED_THRESHOLD_DEFAULT=${CONFIG_NRF_802154_CCA_ED_THRESHOLD} # Key storage size NRF_802154_SECURITY_KEY_STORAGE_SIZE=${CONFIG_NRF_802154_SECURITY_KEY_STORAGE_SIZE} From 99b1a0c450d615de2d2ad76e8d1f419500b28014 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:39 +0300 Subject: [PATCH 741/881] Revert "[nrf fromtree] samples: boards: nordic: system_off fixes" This reverts commit 737ba8dd6f199a785641c3c19b5244b922c615c7. Signed-off-by: Jukka Rissanen --- samples/boards/nordic/system_off/sample.yaml | 6 +++--- samples/boards/nordic/system_off/src/main.c | 20 +++++--------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index 6e17223e12b..81c2f0f262b 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -42,7 +42,7 @@ tests: ordered: true regex: - "system off demo" - - "Retained data: valid" + - "Retained data: INVALID" - "Boot count: 1" - "Off count: 0" - "Active Ticks:" @@ -87,7 +87,7 @@ tests: ordered: true regex: - "system off demo" - - "Retained data: valid" + - "Retained data: INVALID" - "Boot count: 1" - "Off count: 0" - "Active Ticks:" @@ -134,7 +134,7 @@ tests: ordered: true regex: - "system off demo" - - "Retained data: valid" + - "Retained data: INVALID" - "Boot count: 1" - "Off count: 0" - "Active Ticks:" diff --git a/samples/boards/nordic/system_off/src/main.c b/samples/boards/nordic/system_off/src/main.c index d119eff87da..0b0cbf3cb0b 100644 --- a/samples/boards/nordic/system_off/src/main.c +++ b/samples/boards/nordic/system_off/src/main.c @@ -18,8 +18,6 @@ #include #include -#define NON_WAKEUP_RESET_REASON (RESET_PIN | RESET_SOFTWARE | RESET_POR | RESET_DEBUG) - #if defined(CONFIG_GRTC_WAKEUP_ENABLE) #include #define DEEP_SLEEP_TIME_S 2 @@ -31,14 +29,15 @@ static const struct gpio_dt_spec sw0 = GPIO_DT_SPEC_GET(DT_ALIAS(sw0), gpios); static const struct device *comp_dev = DEVICE_DT_GET(DT_NODELABEL(comp)); #endif -void print_reset_cause(uint32_t reset_cause) +void print_reset_cause(void) { + uint32_t reset_cause; + + hwinfo_get_reset_cause(&reset_cause); if (reset_cause & RESET_DEBUG) { printf("Reset by debugger.\n"); } else if (reset_cause & RESET_CLOCK) { printf("Wakeup from System OFF by GRTC.\n"); - } else if (reset_cause & RESET_LOW_POWER_WAKE) { - printf("Wakeup from System OFF by GPIO.\n"); } else { printf("Other wake up cause 0x%08X.\n", reset_cause); } @@ -47,7 +46,6 @@ void print_reset_cause(uint32_t reset_cause) int main(void) { int rc; - uint32_t reset_cause; const struct device *const cons = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); if (!device_is_ready(cons)) { @@ -56,19 +54,11 @@ int main(void) } printf("\n%s system off demo\n", CONFIG_BOARD); - hwinfo_get_reset_cause(&reset_cause); - print_reset_cause(reset_cause); + print_reset_cause(); if (IS_ENABLED(CONFIG_APP_USE_RETAINED_MEM)) { bool retained_ok = retained_validate(); - if (reset_cause & NON_WAKEUP_RESET_REASON) { - retained.boots = 0; - retained.off_count = 0; - retained.uptime_sum = 0; - retained.uptime_latest = 0; - retained_ok = true; - } /* Increment for this boot attempt and update. */ retained.boots += 1; retained_update(); From 3962d49669635f43a2cd2ccc2e085a72d940f4a4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:40 +0300 Subject: [PATCH 742/881] Revert "[nrf fromlist] net: lib: wifi_credentials: Add support for Enterprise security" This reverts commit 7cad1bb6b8455a7fde871e1302b4ffe03a868d27. Signed-off-by: Jukka Rissanen --- subsys/net/lib/wifi_credentials/Kconfig | 26 -- .../wifi_credentials/wifi_credentials_shell.c | 224 ++---------------- 2 files changed, 16 insertions(+), 234 deletions(-) diff --git a/subsys/net/lib/wifi_credentials/Kconfig b/subsys/net/lib/wifi_credentials/Kconfig index d0843d689a2..f50e210b080 100644 --- a/subsys/net/lib/wifi_credentials/Kconfig +++ b/subsys/net/lib/wifi_credentials/Kconfig @@ -73,32 +73,6 @@ config WIFI_CREDENTIALS_CONNECT_STORED_CONNECTION_TIMEOUT help Wait period before falling back to the next entry in the list of stored SSIDs. - -if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - -config WIFI_CREDENTIALS_RUNTIME_CERTIFICATES - bool "Provide Wi-Fi enterprise security certificates at run-time" - select TLS_CREDENTIALS - select TLS_CREDENTIALS_SHELL - select BASE64 - default y if WIFI_SHELL_RUNTIME_CERTIFICATES - help - This option enables providing Wi-Fi enterprise security certificates at run-time. - Uses the TLS credentials subsystem to store and manage the certificates. - -if WIFI_CREDENTIALS_RUNTIME_CERTIFICATES - -config HEAP_MEM_POOL_ADD_SIZE_WIFI_CERT - int "Wi-Fi enterprise security certificates memory pool size" - # STA - 6 certs and each assume 1500 bytes - default 12000 - help - The size of the memory pool used by the Wi-Fi enterprise security certificates. - -endif # WIFI_CREDENTIALS_RUNTIME_CERTIFICATES - -endif # WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - endif # WIFI_CREDENTIALS_CONNECT_STORED endif # WIFI_CREDENTIALS diff --git a/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c b/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c index c5b8c2a88a3..4a51de48e12 100644 --- a/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c +++ b/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c @@ -22,33 +22,10 @@ #include -LOG_MODULE_REGISTER(wifi_credentials_shell, CONFIG_WIFI_CREDENTIALS_LOG_LEVEL); - #define MAX_BANDS_STR_LEN 64 #define MACSTR "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx" #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE -#ifdef CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES -#include -enum wifi_enterprise_cert_sec_tags { - WIFI_CERT_CA_SEC_TAG = 0x1020001, - WIFI_CERT_CLIENT_KEY_SEC_TAG, - WIFI_CERT_SERVER_KEY_SEC_TAG, - WIFI_CERT_CLIENT_SEC_TAG, - WIFI_CERT_SERVER_SEC_TAG, - /* Phase 2 */ - WIFI_CERT_CA_P2_SEC_TAG, - WIFI_CERT_CLIENT_KEY_P2_SEC_TAG, - WIFI_CERT_CLIENT_P2_SEC_TAG, -}; - -struct wifi_cert_data { - enum tls_credential_type type; - uint32_t sec_tag; - uint8_t **data; - size_t *len; -}; -#else static const char ca_cert_test[] = { #include '\0' @@ -75,184 +52,25 @@ static const char client_cert2_test[] = { static const char client_key2_test[] = { #include '\0'}; -#endif /* CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES */ #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ #if defined CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE -#ifdef CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES - -struct wifi_enterprise_creds_params enterprise_creds_params; - -static int process_certificates(struct wifi_cert_data *certs, size_t cert_count) -{ - for (size_t i = 0; i < cert_count; i++) { - int err; - size_t len = 0; - uint8_t *cert_tmp; - - err = tls_credential_get(certs[i].sec_tag, certs[i].type, NULL, &len); - if (err != -EFBIG) { - LOG_ERR("Failed to get credential tag: %d length, err: %d", - certs[i].sec_tag, err); - return err; - } - - cert_tmp = k_malloc(len); - if (!cert_tmp) { - LOG_ERR("Failed to allocate memory for credential tag: %d", - certs[i].sec_tag); - return -ENOMEM; - } - - err = tls_credential_get(certs[i].sec_tag, certs[i].type, cert_tmp, &len); - if (err) { - LOG_ERR("Failed to get credential tag: %d", certs[i].sec_tag); - k_free(cert_tmp); - return err; - } - - *certs[i].data = cert_tmp; - *certs[i].len = len; - } - - return 0; -} - -static void set_enterprise_creds_params(struct wifi_enterprise_creds_params *params, - bool is_ap) -{ - struct wifi_cert_data certs_common[] = { - { - .type = TLS_CREDENTIAL_CA_CERTIFICATE, - .sec_tag = WIFI_CERT_CA_SEC_TAG, - .data = ¶ms->ca_cert, - .len = ¶ms->ca_cert_len, - }, - }; - - struct wifi_cert_data certs_sta[] = { - { - .type = TLS_CREDENTIAL_PRIVATE_KEY, - .sec_tag = WIFI_CERT_CLIENT_KEY_SEC_TAG, - .data = ¶ms->client_key, - .len = ¶ms->client_key_len, - }, - { - .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, - .sec_tag = WIFI_CERT_CLIENT_SEC_TAG, - .data = ¶ms->client_cert, - .len = ¶ms->client_cert_len, - }, - { - .type = TLS_CREDENTIAL_CA_CERTIFICATE, - .sec_tag = WIFI_CERT_CA_P2_SEC_TAG, - .data = ¶ms->ca_cert2, - .len = ¶ms->ca_cert2_len, - }, - { - .type = TLS_CREDENTIAL_PRIVATE_KEY, - .sec_tag = WIFI_CERT_CLIENT_KEY_P2_SEC_TAG, - .data = ¶ms->client_key2, - .len = ¶ms->client_key2_len, - }, - { - .type = TLS_CREDENTIAL_PUBLIC_CERTIFICATE, - .sec_tag = WIFI_CERT_CLIENT_P2_SEC_TAG, - .data = ¶ms->client_cert2, - .len = ¶ms->client_cert2_len, - }, - }; - - memset(params, 0, sizeof(*params)); - - /* Process common certificates */ - if (process_certificates(certs_common, ARRAY_SIZE(certs_common)) != 0) { - goto cleanup; - } - - /* Process STA-specific certificates */ - if (!is_ap) { - if (process_certificates(certs_sta, ARRAY_SIZE(certs_sta)) != 0) { - goto cleanup; - } - } - - memcpy(&enterprise_creds_params, params, sizeof(*params)); - return; - -cleanup: - for (size_t i = 0; i < ARRAY_SIZE(certs_common); i++) { - if (certs_common[i].data) { - k_free(*certs_common[i].data); - *certs_common[i].data = NULL; - } - } - - if (!is_ap) { - for (size_t i = 0; i < ARRAY_SIZE(certs_sta); i++) { - if (certs_sta[i].data) { - k_free(*certs_sta[i].data); - *certs_sta[i].data = NULL; - } - } - } - -} - -static void clear_enterprise_creds_params(struct wifi_enterprise_creds_params *params) -{ - if (params == NULL) { - return; - } - - const uint8_t *certs[] = { - params->ca_cert, - params->client_cert, - params->client_key, - params->ca_cert2, - params->client_cert2, - params->client_key2, - }; - - for (size_t i = 0; i < ARRAY_SIZE(certs); i++) { - k_free((void *)certs[i]); - } - memset(params, 0, sizeof(*params)); -} -#else -static void set_enterprise_creds_params(struct wifi_enterprise_creds_params *params, - bool is_ap) -{ - params->ca_cert = (uint8_t *)ca_cert_test; - params->ca_cert_len = ARRAY_SIZE(ca_cert_test); - - if (!is_ap) { - params->client_cert = (uint8_t *)client_cert_test; - params->client_cert_len = ARRAY_SIZE(client_cert_test); - params->client_key = (uint8_t *)client_key_test; - params->client_key_len = ARRAY_SIZE(client_key_test); - params->ca_cert2 = (uint8_t *)ca_cert2_test; - params->ca_cert2_len = ARRAY_SIZE(ca_cert2_test); - params->client_cert2 = (uint8_t *)client_cert2_test; - params->client_cert2_len = ARRAY_SIZE(client_cert2_test); - params->client_key2 = (uint8_t *)client_key2_test; - params->client_key2_len = ARRAY_SIZE(client_key2_test); - - return; - } -} -#endif /* CONFIG_WIFI_CREDENTIALS_RUNTIME_CERTIFICATES */ - -static int wifi_set_enterprise_creds(const struct shell *sh, struct net_if *iface, - bool is_ap) +static int cmd_wifi_set_enterprise_creds(const struct shell *sh, struct net_if *iface) { struct wifi_enterprise_creds_params params = {0}; -#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES - clear_enterprise_creds_params(&enterprise_creds_params); -#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ - - set_enterprise_creds_params(¶ms, is_ap); + params.ca_cert = (uint8_t *)ca_cert_test; + params.ca_cert_len = ARRAY_SIZE(ca_cert_test); + params.client_cert = (uint8_t *)client_cert_test; + params.client_cert_len = ARRAY_SIZE(client_cert_test); + params.client_key = (uint8_t *)client_key_test; + params.client_key_len = ARRAY_SIZE(client_key_test); + params.ca_cert2 = (uint8_t *)ca_cert2_test; + params.ca_cert2_len = ARRAY_SIZE(ca_cert2_test); + params.client_cert2 = (uint8_t *)client_cert2_test; + params.client_cert2_len = ARRAY_SIZE(client_cert2_test); + params.client_key2 = (uint8_t *)client_key2_test; + params.client_key2_len = ARRAY_SIZE(client_key2_test); if (net_mgmt(NET_REQUEST_WIFI_ENTERPRISE_CREDS, iface, ¶ms, sizeof(params))) { shell_warn(sh, "Set enterprise credentials failed\n"); @@ -522,7 +340,7 @@ static int cmd_add_network(const struct shell *sh, size_t argc, char *argv[]) } #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - struct net_if *iface = net_if_get_wifi_sta(); + struct net_if *iface = net_if_get_first_by_type(&NET_L2_GET_NAME(ETHERNET)); /* Load the enterprise credentials if needed */ if (creds.header.type == WIFI_SECURITY_TYPE_EAP_TLS || @@ -530,7 +348,7 @@ static int cmd_add_network(const struct shell *sh, size_t argc, char *argv[]) creds.header.type == WIFI_SECURITY_TYPE_EAP_PEAP_GTC || creds.header.type == WIFI_SECURITY_TYPE_EAP_TTLS_MSCHAPV2 || creds.header.type == WIFI_SECURITY_TYPE_EAP_PEAP_TLS) { - wifi_set_enterprise_creds(sh, iface, 0); + cmd_wifi_set_enterprise_creds(sh, iface); } #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ @@ -550,12 +368,6 @@ static int cmd_delete_network(const struct shell *sh, size_t argc, char *argv[]) } shell_print(sh, "\tDeleting network ssid: \"%s\", ssid_len: %d", argv[1], strlen(argv[1])); - -#ifdef CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES - /* Clear the certificates */ - clear_enterprise_creds_params(&enterprise_creds_params); -#endif /* CONFIG_WIFI_SHELL_RUNTIME_CERTIFICATES */ - return wifi_credentials_delete_by_ssid(argv[1], strlen(argv[1])); } @@ -569,11 +381,7 @@ static int cmd_list_networks(const struct shell *sh, size_t argc, char *argv[]) static int cmd_auto_connect(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_wifi_sta(); - -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - wifi_set_enterprise_creds(sh, iface, 0); -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE */ + struct net_if *iface = net_if_get_first_by_type(&NET_L2_GET_NAME(ETHERNET)); int rc = net_mgmt(NET_REQUEST_WIFI_CONNECT_STORED, iface, NULL, 0); if (rc) { From e08dea452e59c0288c3926f1c6d7b8ea13d10d8c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:40 +0300 Subject: [PATCH 743/881] Revert "[nrf fromlist] soc: nordic: s2ram: Optimize s2am marking functions" This reverts commit 80b7b93c475b80e11d2cfd90ed33c2b99c5f24f6. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/pm_s2ram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index 1ec5da4aa19..3ebd0a2f6bb 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -187,16 +187,18 @@ void pm_s2ram_mark_set(void) bool pm_s2ram_mark_check_and_clear(void) { + bool unretained_wake; bool restore_valid; uint32_t reset_reason = nrf_resetinfo_resetreas_local_get(NRF_RESETINFO); if (reset_reason != NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK) { return false; } + unretained_wake = reset_reason & NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK; nrf_resetinfo_resetreas_local_set(NRF_RESETINFO, 0); restore_valid = nrf_resetinfo_restore_valid_check(NRF_RESETINFO); nrf_resetinfo_restore_valid_set(NRF_RESETINFO, false); - return restore_valid ? true : false; + return (unretained_wake & restore_valid) ? true : false; } From aa6d23302bcdfb2182cca5855f224b00a42b2d56 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:40 +0300 Subject: [PATCH 744/881] Revert "[nrf fromlist] Revert "soc: nordic: s2ram: Align s2ram marking procedures"" This reverts commit eb17e7d76ef3971680fdd62e8717fb026132f792. Signed-off-by: Jukka Rissanen --- soc/nordic/nrf54h/pm_s2ram.c | 49 ++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index 3ebd0a2f6bb..c18c9650cdc 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -180,25 +180,48 @@ int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) return ret; } -void pm_s2ram_mark_set(void) +void __attribute__((naked)) pm_s2ram_mark_set(void) { /* empty */ + __asm__ volatile("bx lr\n"); } -bool pm_s2ram_mark_check_and_clear(void) +bool __attribute__((naked)) pm_s2ram_mark_check_and_clear(void) { - bool unretained_wake; - bool restore_valid; - uint32_t reset_reason = nrf_resetinfo_resetreas_local_get(NRF_RESETINFO); + __asm__ volatile( + /* Set return value to 0 */ + "mov r0, #0\n" - if (reset_reason != NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK) { - return false; - } - unretained_wake = reset_reason & NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK; - nrf_resetinfo_resetreas_local_set(NRF_RESETINFO, 0); + /* Load and check RESETREAS register */ + "ldr r3, [%[resetinfo_addr], %[resetreas_offs]]\n" + "cmp r3, %[resetreas_unretained_mask]\n" + + "bne exit\n" + + /* Clear RESETREAS register */ + "str r0, [%[resetinfo_addr], %[resetreas_offs]]\n" + + /* Load RESTOREVALID register */ + "ldr r3, [%[resetinfo_addr], %[restorevalid_offs]]\n" + + /* Clear RESTOREVALID */ + "str r0, [%[resetinfo_addr], %[restorevalid_offs]]\n" + + /* Check RESTOREVALID register */ + "cmp r3, %[restorevalid_present_mask]\n" + "bne exit\n" + + /* Set return value to 1 */ + "mov r0, #1\n" - restore_valid = nrf_resetinfo_restore_valid_check(NRF_RESETINFO); - nrf_resetinfo_restore_valid_set(NRF_RESETINFO, false); + "exit:\n" + "bx lr\n" + : + : [resetinfo_addr] "r"(NRF_RESETINFO), + [resetreas_offs] "r"(offsetof(NRF_RESETINFO_Type, RESETREAS.LOCAL)), + [resetreas_unretained_mask] "r"(NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK), + [restorevalid_offs] "r"(offsetof(NRF_RESETINFO_Type, RESTOREVALID)), + [restorevalid_present_mask] "r"(RESETINFO_RESTOREVALID_RESTOREVALID_Msk) - return (unretained_wake & restore_valid) ? true : false; + : "r0", "r1", "r3", "r4", "memory"); } From e44e044c66c163abe7730b6753430c210b243bee Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:40 +0300 Subject: [PATCH 745/881] Revert "[nrf fromtree] modules: hal_nordic: nrfx: Use owned-channels property for DPPIC" This reverts commit 73bd5efabec5b88e745b12b2387154c2510ffe6b. Signed-off-by: Jukka Rissanen --- modules/hal_nordic/nrfx/nrfx_zephyr_utils.h | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/modules/hal_nordic/nrfx/nrfx_zephyr_utils.h b/modules/hal_nordic/nrfx/nrfx_zephyr_utils.h index a7f05ca372d..e1fa4d4c321 100644 --- a/modules/hal_nordic/nrfx/nrfx_zephyr_utils.h +++ b/modules/hal_nordic/nrfx/nrfx_zephyr_utils.h @@ -34,7 +34,7 @@ * definitions required by the interconnect/apb layer: * - NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) * - NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) - * - NRFX_DPPI_OWNED_MASK(inst_num) + * - NRFX_DPPI_PUB_OR_SUB_MASK(inst_num) * - NRFX_DPPI_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num) * - NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE * - NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE @@ -42,14 +42,6 @@ */ #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || \ DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_local) - -/* Channels masks generation. */ -#define NRFX_CONFIG_DPPI_MASK_DT(node_id) \ - COND_CODE_1(DT_NODE_HAS_PROP(node_id, owned_channels), \ - (NRFX_CONFIG_MASK_DT(node_id, owned_channels)), \ - (COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, nordic_nrf_dppic_local), \ - (BIT64_MASK(DT_PROP(node_id, channels))), (0)))) - /* Source (publish) channels masks generation. */ #define NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \ NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels) @@ -58,9 +50,9 @@ #define NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \ NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels) -#define NRFX_DPPI_OWNED_MASK(inst_num) \ - UTIL_OR(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), owned_channels), \ - DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), channels)) +#define NRFX_DPPI_PUB_OR_SUB_MASK(inst_num) \ + UTIL_OR(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels), \ + DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels)) /* Variables names generation. */ #define NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) _CONCAT(_CONCAT(m_, node_id), _channels) @@ -70,7 +62,9 @@ /* Variables entries generation. */ #define NRFX_CONFIG_DPPI_CHANNELS_ENTRY(node_id) \ static nrfx_atomic_t NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) \ - __attribute__((used)) = (uint32_t)NRFX_CONFIG_DPPI_MASK_DT(node_id); + __attribute__((used)) = \ + NRFX_CONFIG_MASK_DT(node_id, source_channels) | \ + NRFX_CONFIG_MASK_DT(node_id, sink_channels); #define NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE \ DT_FOREACH_STATUS_OKAY(nordic_nrf_dppic_global, NRFX_CONFIG_DPPI_CHANNELS_ENTRY) #define NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE \ From 2f548eef2c292e39dcaf04d766b7103baf9f41da Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:40 +0300 Subject: [PATCH 746/881] Revert "[nrf fromtree] dts: nordic: Add channels property for local DPPI" This reverts commit a83d5969b2e2f3dbff5df6870177fe1f2468497f. Signed-off-by: Jukka Rissanen --- dts/bindings/misc/nordic,nrf-dppic-local.yaml | 6 ------ dts/vendor/nordic/nrf54h20.dtsi | 1 - dts/vendor/nordic/nrf9280.dtsi | 1 - 3 files changed, 8 deletions(-) diff --git a/dts/bindings/misc/nordic,nrf-dppic-local.yaml b/dts/bindings/misc/nordic,nrf-dppic-local.yaml index a96b5a994c9..41029bb3062 100644 --- a/dts/bindings/misc/nordic,nrf-dppic-local.yaml +++ b/dts/bindings/misc/nordic,nrf-dppic-local.yaml @@ -11,9 +11,3 @@ description: | compatible: "nordic,nrf-dppic-local" include: ["nordic,nrf-dppic.yaml", "nordic,nrf-dppic-links.yaml"] - -properties: - channels: - type: int - required: true - description: Number of channels implemented by the DPPIC instance. diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 96d4ff53af1..32f126dddfd 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -366,7 +366,6 @@ dppic020: dppic@22000 { compatible = "nordic,nrf-dppic-local"; reg = <0x22000 0x1000>; - channels = <32>; status = "disabled"; }; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 06e0a3a1514..d7c20e855c1 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -250,7 +250,6 @@ dppic020: dppic@22000 { compatible = "nordic,nrf-dppic-local"; reg = <0x22000 0x1000>; - channels = <32>; status = "disabled"; }; From 7e1d465c6bc4aeee92d2e9e1b4407e36071572e2 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:40 +0300 Subject: [PATCH 747/881] Revert "[nrf fromtree] cmake: add tfm / tfa image information to build info" This reverts commit e40777b62489c1a5ce62df81c22d7eb95845af8b. Signed-off-by: Jukka Rissanen --- modules/trusted-firmware-a/CMakeLists.txt | 3 --- modules/trusted-firmware-m/CMakeLists.txt | 3 --- 2 files changed, 6 deletions(-) diff --git a/modules/trusted-firmware-a/CMakeLists.txt b/modules/trusted-firmware-a/CMakeLists.txt index 0c0230174f0..72c1ea5c75a 100644 --- a/modules/trusted-firmware-a/CMakeLists.txt +++ b/modules/trusted-firmware-a/CMakeLists.txt @@ -8,9 +8,6 @@ if (CONFIG_BUILD_WITH_TFA) include(ExternalProject) - set(tfa_image_info MAP "name: tfa, source-dir: ${ZEPHYR_TRUSTED_FIRMWARE_A_MODULE_DIR}") - build_info(images VALUE ${tfa_image_info}) - ExternalProject_Add( tfa SOURCE_DIR ${ZEPHYR_TRUSTED_FIRMWARE_A_MODULE_DIR} diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index c76812198a3..9130f962978 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -315,9 +315,6 @@ if (CONFIG_BUILD_WITH_TFM) # threads. Which is num_cores+2 on Ninja and MAKEFLAGS with Make. endif() - set(tfm_image_info MAP "name: tfm, source-dir: ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}") - build_info(images VALUE ${tfm_image_info}) - ExternalProject_Add( tfm SOURCE_DIR ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR} From 529341a042b7ef4b1df9ccb2678a871d0b3b6c65 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:40 +0300 Subject: [PATCH 748/881] Revert "[nrf fromtree] Revert "tests: arm_thread_swap: Add overlay for nRF54H20"" This reverts commit ec41d056fa9183df05c3d8b2c6047f75b00c2fde. Signed-off-by: Jukka Rissanen --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/arch/arm/arm_thread_swap/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/arch/arm/arm_thread_swap/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/arch/arm/arm_thread_swap/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 00000000000..f9615d1b35e --- /dev/null +++ b/tests/arch/arm/arm_thread_swap/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&cpusec_cpuapp_ipc { + status = "disabled"; +}; + +&cpusec_bellboard { + status = "disabled"; +}; From 7201708a9c40518d2ff38b3624f719025e4f17f6 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 11 Sep 2025 17:12:40 +0300 Subject: [PATCH 749/881] Revert "[nrf fromtree] ipc: ipc_service: Parametrize workqueue stack size" This reverts commit 6e85928cd49667ec14e254126c1e8a28f27feeba. Signed-off-by: Jukka Rissanen --- subsys/ipc/ipc_service/backends/Kconfig.icbmsg | 8 -------- subsys/ipc/ipc_service/backends/ipc_icbmsg.c | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/subsys/ipc/ipc_service/backends/Kconfig.icbmsg b/subsys/ipc/ipc_service/backends/Kconfig.icbmsg index 3a34c63c06c..e31b5cadd77 100644 --- a/subsys/ipc/ipc_service/backends/Kconfig.icbmsg +++ b/subsys/ipc/ipc_service/backends/Kconfig.icbmsg @@ -23,14 +23,6 @@ config IPC_SERVICE_BACKEND_ICBMSG_NUM_EP backend. The number of endpoints are applied to all the instances, so this value should be maximum number among all the instances. -config IPC_SERVICE_BACKEND_ICBMSG_EP_BOUND_WORK_Q_STACK_SIZE - int "Workqueue stack size" - default 1024 if NO_OPTIMIZATIONS - default 512 - help - Workqueue stack size for bounding processing - (this configuration is not optimized). - module = IPC_SERVICE_BACKEND_ICBMSG module-str = ICMSG backend with separate buffers module-help = Sets log level for ICMsg backend with buffers diff --git a/subsys/ipc/ipc_service/backends/ipc_icbmsg.c b/subsys/ipc/ipc_service/backends/ipc_icbmsg.c index 312642aafeb..46ecfe1233f 100644 --- a/subsys/ipc/ipc_service/backends/ipc_icbmsg.c +++ b/subsys/ipc/ipc_service/backends/ipc_icbmsg.c @@ -118,8 +118,7 @@ LOG_MODULE_REGISTER(ipc_icbmsg, #define FLAG_EPT_COUNT_MASK 0xFFFF /** Workqueue stack size for bounding processing (this configuration is not optimized). */ -#define EP_BOUND_WORK_Q_STACK_SIZE \ - (CONFIG_IPC_SERVICE_BACKEND_ICBMSG_EP_BOUND_WORK_Q_STACK_SIZE) +#define EP_BOUND_WORK_Q_STACK_SIZE (512U) /** Workqueue priority for bounding processing. */ #define EP_BOUND_WORK_Q_PRIORITY (CONFIG_SYSTEM_WORKQUEUE_PRIORITY) From e62c833fdefb88eebb821e1e9f6c6d2d4ee0a256 Mon Sep 17 00:00:00 2001 From: Aymen LAOUINI Date: Wed, 18 Jun 2025 17:26:00 +0300 Subject: [PATCH 750/881] [nrf fromtree] tests: kernel: gen_isr_table: Add ISR offset definitions for nrf9280 - Correct test by adding ISR offset definitions for nrf9280 ppr and flrp. Signed-off-by: Aymen LAOUINI (cherry picked from commit 07d9f151e71f3960ab1ea0dd81afd86775d522dc) --- tests/arch/common/gen_isr_table/src/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/arch/common/gen_isr_table/src/main.c b/tests/arch/common/gen_isr_table/src/main.c index e716f0ddf4b..ed764e05b4b 100644 --- a/tests/arch/common/gen_isr_table/src/main.c +++ b/tests/arch/common/gen_isr_table/src/main.c @@ -42,6 +42,11 @@ extern const uintptr_t _irq_vector_table[]; #define ISR3_OFFSET 15 #define ISR5_OFFSET 16 #define TRIG_CHECK_SIZE 17 +#elif defined(CONFIG_SOC_NRF9280_CPUPPR) +#define ISR1_OFFSET 14 +#define ISR3_OFFSET 15 +#define ISR5_OFFSET 16 +#define TRIG_CHECK_SIZE 17 #else #error "Target not supported" #endif From 2e273110181620ce8c122e81e668e8c93b91865b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 19 May 2025 15:42:20 +0200 Subject: [PATCH 751/881] [nrf fromlist] tests: drivers: timer: nrf_grtc_timer: Add stress test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add stress test that randomly starts and aborts multiple timers from various contexts. Test checks if timers do not expire prematurely. Upstream PR #: 87944 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 8af4f9f53d90c24ce275dc364aa035eb544a155e) (cherry picked from commit 6bbe5d64f72b0843ed16f9ef01704759e4e76cff) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 17 ++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 32 +++ .../nrf54l15dk_nrf54l15_cpuflpr.overlay | 32 +++ tests/drivers/timer/nrf_grtc_timer/prj.conf | 6 + tests/drivers/timer/nrf_grtc_timer/src/main.c | 247 ++++++++++++++++++ .../timer/nrf_grtc_timer/testcase.yaml | 37 +-- 6 files changed, 355 insertions(+), 16 deletions(-) create mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay create mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 04580b71480..7ae95926703 100644 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -2,4 +2,21 @@ &grtc { /delete-property/ child-owned-channels; + interrupts = <109 2>; +}; + +test_timer: &timer131 { + status = "okay"; + interrupts = <419 1>; +}; + +&timer130 { + status = "okay"; + prescaler = <0>; +}; + +/ { + chosen { + zephyr,cpu-load-counter = &timer130; + }; }; diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 00000000000..7bcede529b0 --- /dev/null +++ b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&grtc { + interrupts = <228 2>; +}; + +test_timer: &timer21 { + status = "okay"; + interrupts = <203 1>; +}; + +&timer20 { + status = "okay"; + interrupts = <202 0>; +}; + +&timer00 { + status = "okay"; + prescaler = <0>; +}; + +/ { + chosen { + zephyr,cpu-load-counter = &timer00; + }; + + busy-sim { + compatible = "vnd,busy-sim"; + status = "okay"; + counter = <&timer20>; + }; +}; diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay new file mode 100644 index 00000000000..cfa72ed0273 --- /dev/null +++ b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&grtc { + /*interrupts = <226 2>;*/ +}; + +test_timer: &timer21 { + status = "okay"; + /*interrupts = <203 2>;*/ +}; + +&timer20 { + status = "okay"; + interrupts = <202 0>; +}; + +&timer00 { + status = "okay"; + prescaler = <0>; +}; + +/ { + chosen { + zephyr,cpu-load-counter = &timer00; + }; + + busy-sim { + compatible = "vnd,busy-sim"; + status = "okay"; + counter = <&timer20>; + }; +}; diff --git a/tests/drivers/timer/nrf_grtc_timer/prj.conf b/tests/drivers/timer/nrf_grtc_timer/prj.conf index dea03477519..93926f090b7 100644 --- a/tests/drivers/timer/nrf_grtc_timer/prj.conf +++ b/tests/drivers/timer/nrf_grtc_timer/prj.conf @@ -1,2 +1,8 @@ CONFIG_ZTEST=y CONFIG_NRF_GRTC_TIMER=y +CONFIG_COUNTER=y +CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_XOSHIRO_RANDOM_GENERATOR=y +CONFIG_LOG_PRINTK=y +CONFIG_CPU_LOAD=y +CONFIG_CPU_LOAD_USE_COUNTER=y diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index cede54f026f..9de554256b4 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -5,7 +5,15 @@ */ #include #include +#include +#include +#include +#include +#include +#include +#include #include +LOG_MODULE_REGISTER(test, 1); #define GRTC_SLEW_TICKS 10 #define NUMBER_OF_TRIES 2000 @@ -153,4 +161,243 @@ ZTEST(nrf_grtc_timer, test_timer_abort_in_compare_mode) z_nrf_grtc_timer_chan_free(channel); } +enum test_timer_state { + TIMER_IDLE, + TIMER_PREPARE, + TIMER_ACTIVE +}; + +enum test_ctx { + TEST_HIGH_PRI, + TEST_TIMER_CB, + TEST_THREAD +}; + +struct test_grtc_timer { + struct k_timer timer; + uint32_t ticks; + uint32_t expire; + uint32_t start_cnt; + uint32_t expire_cnt; + uint32_t abort_cnt; + uint32_t exp_expire; + int max_late; + int min_late; + int avg_late; + uint32_t early_cnt; + enum test_timer_state state; +}; + +static atomic_t test_active_cnt; +static struct test_grtc_timer timers[8]; +static uint32_t test_end; +static k_tid_t test_tid; +static volatile bool test_run; +static uint32_t ctx_cnt[3]; +static const char *const ctx_name[] = { "HIGH PRIO ISR", "TIMER CALLBACK", "THREAD" }; + +static bool stress_test_action(int ctx, int id) +{ + struct test_grtc_timer *timer = &timers[id]; + + ctx_cnt[ctx]++; + if (timer->state == TIMER_ACTIVE) { + /* Aborting soon to expire timers from higher interrupt priority may lead + * to test failures. + */ + if (ctx == 0 && (k_timer_remaining_get(&timer->timer) < 5)) { + return true; + } + + if (timer->abort_cnt < timer->expire_cnt / 2) { + bool any_active; + + timer->state = TIMER_PREPARE; + k_timer_stop(&timer->timer); + timer->abort_cnt++; + any_active = atomic_dec(&test_active_cnt) > 1; + timer->state = TIMER_IDLE; + + return any_active; + } + } else if (timer->state == TIMER_IDLE) { + int ticks = 10 + (sys_rand32_get() & 0x3F); + k_timeout_t t = K_TICKS(ticks); + + timer->exp_expire = k_ticks_to_cyc_floor32(sys_clock_tick_get_32() + ticks); + timer->state = TIMER_PREPARE; + timer->ticks = ticks; + k_timer_start(&timer->timer, t, K_NO_WAIT); + atomic_inc(&test_active_cnt); + timer->start_cnt++; + timer->state = TIMER_ACTIVE; + } + + return true; +} + +static void stress_test_actions(int ctx) +{ + uint32_t r = sys_rand32_get(); + int action_cnt = Z_MAX(r & 0x3, 1); + int tmr_id = (r >> 8) % ARRAY_SIZE(timers); + + /* Occasionally wake thread context from which timer actions are also executed. */ + if ((((r >> 2) & 0x3) == 0) || test_active_cnt < 2) { + LOG_DBG("ctx:%d thread wakeup", ctx); + k_wakeup(test_tid); + } + + for (int i = 0; i < action_cnt; i++) { + if (stress_test_action(ctx, tmr_id) == false) { + stress_test_action(ctx, tmr_id); + } + } +} + +static void timer_cb(struct k_timer *timer) +{ + struct test_grtc_timer *test_timer = CONTAINER_OF(timer, struct test_grtc_timer, timer); + uint32_t now = k_cycle_get_32(); + int diff = now - test_timer->exp_expire; + + atomic_dec(&test_active_cnt); + zassert_true(diff >= 0); + test_timer->max_late = MAX(diff, test_timer->max_late); + test_timer->min_late = MIN(diff, test_timer->min_late); + + if (test_timer->expire_cnt == 0) { + test_timer->avg_late = diff; + } else { + test_timer->avg_late = (test_timer->avg_late * test_timer->expire_cnt + diff) / + (test_timer->expire_cnt + 1); + } + + test_timer->expire_cnt++; + test_timer->state = TIMER_IDLE; + + if (test_run) { + stress_test_actions(TEST_TIMER_CB); + } +} + +static void counter_set(const struct device *dev, struct counter_alarm_cfg *cfg) +{ + int err; + uint32_t us = 150 + (sys_rand32_get() & 0x3F); + + cfg->ticks = counter_us_to_ticks(dev, us); + err = counter_set_channel_alarm(dev, 0, cfg); + zassert_equal(err, 0); +} + +static void counter_cb(const struct device *dev, uint8_t chan_id, uint32_t ticks, void *user_data) +{ + struct counter_alarm_cfg *config = user_data; + + if (test_run) { + stress_test_actions(TEST_HIGH_PRI); + counter_set(dev, config); + } +} + +static void report_progress(uint32_t start, uint32_t end) +{ + static uint32_t next_report; + static uint32_t step; + static uint32_t progress; + + if (next_report == 0) { + step = (end - start) / 10; + next_report = start + step; + } + + if (k_uptime_get_32() > next_report) { + next_report += step; + progress += 10; + printk("%d%%\r", progress); + } +} + +static void grtc_stress_test(bool busy_sim_en) +{ + static struct counter_alarm_cfg alarm_cfg; +#if DT_NODE_EXISTS(DT_NODELABEL(test_timer)) && DT_NODE_HAS_STATUS(DT_NODELABEL(test_timer), okay) + const struct device *const counter_dev = DEVICE_DT_GET(DT_NODELABEL(test_timer)); +#else + const struct device *const counter_dev = NULL; +#endif + uint32_t test_ms = 5000; + uint32_t test_start = k_uptime_get_32(); + uint32_t load; + + test_end = k_cycle_get_32() + k_ms_to_cyc_floor32(test_ms); + test_tid = k_current_get(); + + for (size_t i = 0; i < ARRAY_SIZE(timers); i++) { + k_timer_init(&timers[i].timer, timer_cb, NULL); + } + + if (IS_ENABLED(CONFIG_CPU_LOAD)) { + (void)cpu_load_get(true); + } + + if (counter_dev) { + counter_start(counter_dev); + } + + alarm_cfg.callback = counter_cb; + alarm_cfg.user_data = &alarm_cfg; + test_run = true; + + if (counter_dev) { + counter_set(counter_dev, &alarm_cfg); + } + + if (busy_sim_en) { + busy_sim_start(500, 200, 1000, 400, NULL); + } + + LOG_DBG("Starting test, will end at %d", test_end); + while (k_cycle_get_32() < test_end) { + report_progress(test_start, test_start + test_ms); + stress_test_actions(TEST_THREAD); + k_sleep(K_MSEC(test_ms)); + } + + load = IS_ENABLED(CONFIG_CPU_LOAD) ? cpu_load_get(true) : 0; + + test_run = false; + k_msleep(50); + + for (size_t i = 0; i < ARRAY_SIZE(timers); i++) { + zassert_equal(timers[i].state, TIMER_IDLE, "Unexpected timer %d state:%d", + i, timers[i].state); + TC_PRINT("Timer%d (%p)\r\n\tstart_cnt:%d abort_cnt:%d expire_cnt:%d\n", + i, &timers[i], timers[i].start_cnt, timers[i].abort_cnt, + timers[i].expire_cnt); + TC_PRINT("\tavarage late:%d ticks, max late:%d, min late:%d early:%d\n", + timers[i].avg_late, timers[i].max_late, timers[i].min_late, + timers[i].early_cnt); + } + + for (size_t i = 0; i < ARRAY_SIZE(ctx_cnt); i++) { + TC_PRINT("Context: %s executed %d times\n", ctx_name[i], ctx_cnt[i]); + } + TC_PRINT("CPU load during test:%d.%d\n", load / 10, load % 10); + + if (busy_sim_en) { + busy_sim_stop(); + } + + if (counter_dev) { + counter_stop(counter_dev); + } +} + +ZTEST(nrf_grtc_timer, test_stress) +{ + grtc_stress_test(false); +} + ZTEST_SUITE(nrf_grtc_timer, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index 6f4486de913..ca67bddef30 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -1,17 +1,22 @@ +common: + tags: + - drivers + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l15bsim/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad + - nrf54h20dk/nrf54h20/cpuppr + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuflpr + - ophelia4ev/nrf54l15/cpuapp + - ophelia4ev/nrf54l15/cpuflpr + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp tests: - drivers.timer.nrf_grtc_timer: - tags: drivers - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr - - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuflpr - - nrf54l15bsim/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - - ophelia4ev/nrf54l15/cpuapp - - ophelia4ev/nrf54l15/cpuflpr - integration_platforms: - - nrf54lm20dk/nrf54lm20a/cpuapp - timeout: 30 + drivers.timer.nrf_grtc_timer: {} + drivers.timer.nrf_grtc_timer.no_assert: + extra_configs: + - CONFIG_ASSERT=n From 40a88b6d05f6e21c99efc4ae6baec08f591a9e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 30 Jun 2025 08:03:06 +0200 Subject: [PATCH 752/881] [nrf fromlist] dts: bindings: serial: nrf-uarte: Add timer property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Timer property indicates which TIMER instance should be used for byte counting. If timer property is present then given instance is using TIMER to count received bytes. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit b83628773c322abb2347726371b6a63441188e33) --- dts/bindings/serial/nordic,nrf-uarte.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dts/bindings/serial/nordic,nrf-uarte.yaml b/dts/bindings/serial/nordic,nrf-uarte.yaml index 4e9ccb0dd40..c8eb2bbc758 100644 --- a/dts/bindings/serial/nordic,nrf-uarte.yaml +++ b/dts/bindings/serial/nordic,nrf-uarte.yaml @@ -24,3 +24,11 @@ properties: type: boolean description: | UARTE allows usage of cross domain pins with constant latency mode required. + + timer: + type: phandle + description: | + Timer instance used to count received bytes. Due to issues with frame timeout + feature it is required to reliably receive data in cases where flow control + is not used and new byte can appear on the line when frame timeout expires + but before it is handled. From f588dd1d85a27b1f993fc336be6ed85a4c41f210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 7 Jul 2025 12:02:24 +0200 Subject: [PATCH 753/881] [nrf fromlist] tests: drivers: uart: async_dual: Add progress report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add reporting about the test progress. Test lasts few seconds and progress report helps to see if test stuck or how it is progressing. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 249e3bf5abbe03e3a493915ca89b3ad585207022) --- tests/drivers/uart/uart_async_dual/src/main.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index 37ce73120ac..d14e0f88a11 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -365,6 +365,26 @@ static void config_baudrate(uint32_t rate) } } +static void report_progress(uint32_t start) +{ + static const uint32_t inc = CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT / 20; + static uint32_t next; + static uint32_t progress; + + if ((k_uptime_get_32() - start < inc) && progress) { + /* Reset state. */ + next = inc; + progress = 0; + } + + if (k_uptime_get_32() > (start + next)) { + progress += 5; + TC_PRINT("\r%d%%", progress); + next += inc; + } +} + + /* Test is running following scenario. Transmitter is sending packets which * has 1 byte header with length followed by the payload. Transmitter can send * packets in two modes: bulk where data is send in chunks without gaps between @@ -380,6 +400,7 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) { int err; uint32_t load = 0; + uint32_t start = k_uptime_get_32(); config_baudrate(baudrate); @@ -420,8 +441,10 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) while (tx_data.cont || rx_data.cont) { fill_tx(&tx_data); k_msleep(1); + report_progress(start); try_tx(tx_dev, false); } + TC_PRINT("\n"); if (IS_ENABLED(CONFIG_CPU_LOAD)) { load = cpu_load_get(true); @@ -653,6 +676,7 @@ static void hci_like_rx(void) uint8_t len; bool cont; bool explicit_pm = IS_ENABLED(CONFIG_PM_RUNTIME_IN_TEST); + uint32_t start = k_uptime_get_32(); while (1) { if (explicit_pm) { @@ -704,7 +728,9 @@ static void hci_like_rx(void) PM_CHECK(rx_dev, tx_dev, false); check_payload(rx_data.buf, len); + report_progress(start); } + TC_PRINT("\n"); } #define HCI_LIKE_TX_STACK_SIZE 2048 From 5d2658f3a6deaafa40831018d9e522c351922efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 7 Jul 2025 12:02:46 +0200 Subject: [PATCH 754/881] [nrf fromlist] tests: drivers: uart: async_dual: Extend testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend test with a mode where HWFC is off and receiver is providing buffers on time. In that case receiver should be able to continuously receive data without losing any byte (even without HWFC). Additionally, TX data is chopped to verify that receiver does not loose bytes when new TX data collides with detected RX timeout. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit bac4ea5d135b521c269cbceb231467468e0b49a6) --- tests/drivers/uart/uart_async_dual/Kconfig | 8 + tests/drivers/uart/uart_async_dual/src/main.c | 218 ++++++++++++++---- .../uart/uart_async_dual/testcase.yaml | 15 ++ 3 files changed, 191 insertions(+), 50 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/Kconfig b/tests/drivers/uart/uart_async_dual/Kconfig index 6e80ec3a795..f0087aa48e3 100644 --- a/tests/drivers/uart/uart_async_dual/Kconfig +++ b/tests/drivers/uart/uart_async_dual/Kconfig @@ -16,5 +16,13 @@ config PM_RUNTIME_IN_TEST select PM_DEVICE select PM_DEVICE_RUNTIME +config TEST_CHOPPED_TX + bool "Test chopped TX data" + default y + help + When enabled then test cases that transmits TX packets in random chunks are + performed. Some driver implementation do not support case when new TX data + collides with handling of the RX timeout. + # Include Zephyr's Kconfig source "Kconfig" diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index d14e0f88a11..c2ad5d8a0a0 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -28,9 +28,10 @@ LOG_MODULE_REGISTER(test); #endif #define TX_TIMEOUT 100000 -#define RX_TIMEOUT 2000 +#define RX_TIMEOUT_BYTES 50 #define MAX_PACKET_LEN 128 +#define MIN_PACKET_LEN 10 struct dut_data { const struct device *dev; @@ -100,6 +101,7 @@ static const struct device *tx_dev; enum test_tx_mode { TX_BULK, TX_PACKETS, + TX_CHOPPED, }; struct test_tx_data { @@ -111,6 +113,8 @@ struct test_tx_data { volatile bool cont; volatile enum test_tx_mode mode; struct k_sem sem; + uint32_t idx; + uint32_t rx_timeout; }; enum test_rx_state { @@ -121,17 +125,21 @@ enum test_rx_state { enum test_rx_mode { RX_CONT, RX_DIS, + RX_ALL, }; struct test_rx_data { uint8_t hdr[1]; uint8_t buf[256]; uint32_t rx_cnt; + uint32_t payload_idx; enum test_rx_state state; enum test_rx_mode mode; volatile bool cont; bool buf_req; struct k_sem sem; + uint32_t timeout; + uint32_t buf_idx; }; static struct test_tx_data tx_data; @@ -143,8 +151,8 @@ static void fill_tx(struct test_tx_data *data) uint32_t len; int err; - if (data->mode == TX_PACKETS) { - err = k_sem_take(&data->sem, K_MSEC(100)); + if (data->mode != TX_BULK) { + err = k_sem_take(&data->sem, K_MSEC(200)); if (err < 0 && !data->cont) { return; } @@ -153,9 +161,10 @@ static void fill_tx(struct test_tx_data *data) uint8_t len = sys_rand8_get(); len = len % MAX_PACKET_LEN; - len = MAX(2, len); + len = MAX(MIN_PACKET_LEN, len); data->packet_len = len; + data->idx = 0; for (int i = 0; i < len; i++) { data->buf[i] = len - i; } @@ -163,12 +172,11 @@ static void fill_tx(struct test_tx_data *data) return; } - while ((len = ring_buf_put_claim(&data->rbuf, &buf, 255)) > 1) { + while ((len = ring_buf_put_claim(&data->rbuf, &buf, 255)) > 0) { uint8_t r = (sys_rand8_get() % MAX_PACKET_LEN) % len; - uint8_t packet_len = MAX(r, 2); - uint8_t rem = len - packet_len; + uint8_t packet_len = MAX(r, MIN_PACKET_LEN); - packet_len = (rem < 3) ? len : packet_len; + packet_len = (len <= MIN_PACKET_LEN) ? len : packet_len; buf[0] = packet_len; for (int i = 1; i < packet_len; i++) { buf[i] = packet_len - i; @@ -189,7 +197,7 @@ static void try_tx(const struct device *dev, bool irq) return; } - if ((tx_data.mode == TX_PACKETS) && (tx_data.packet_len > 0)) { + if (tx_data.mode == TX_PACKETS) { uint8_t len = tx_data.packet_len; tx_data.packet_len = 0; @@ -199,19 +207,50 @@ static void try_tx(const struct device *dev, bool irq) err, irq, tx_data.cont); return; } - zassert_true(tx_data.mode == TX_BULK); - if (!atomic_cas(&tx_data.busy, 0, 1)) { + if (tx_data.mode == TX_BULK) { + if (!atomic_cas(&tx_data.busy, 0, 1)) { + return; + } + + len = ring_buf_get_claim(&tx_data.rbuf, &buf, 255); + if (len > 0) { + err = uart_tx(dev, buf, len, TX_TIMEOUT); + zassert_equal(err, 0, + "Unexpected err:%d irq:%d cont:%d\n", + err, irq, tx_data.cont); + } else { + tx_data.busy = 0; + } return; } - len = ring_buf_get_claim(&tx_data.rbuf, &buf, 255); - if (len > 0) { - err = uart_tx(dev, buf, len, TX_TIMEOUT); - zassert_equal(err, 0, - "Unexpected err:%d irq:%d cont:%d\n", - err, irq, tx_data.cont); + zassert_true(tx_data.mode == TX_CHOPPED); + + uint32_t rem = tx_data.packet_len - tx_data.idx; + + if (tx_data.packet_len > 12) { + len = sys_rand8_get() % (tx_data.packet_len / 4); + } else { + len = 0; } + len = MAX(3, len); + len = MIN(rem, len); + + buf = &tx_data.buf[tx_data.idx]; + tx_data.idx += len; + + err = uart_tx(dev, buf, len, TX_TIMEOUT); + zassert_equal(err, 0, + "Unexpected err:%d irq:%d cont:%d\n", + err, irq, tx_data.cont); +} + +static void tx_backoff(uint32_t rx_timeout) +{ + uint32_t delay = (rx_timeout / 2) + (sys_rand32_get() % rx_timeout); + + k_busy_wait(delay); } static void on_tx_done(const struct device *dev, struct uart_event *evt) @@ -221,6 +260,17 @@ static void on_tx_done(const struct device *dev, struct uart_event *evt) return; } + if (tx_data.mode == TX_CHOPPED) { + if (tx_data.idx == tx_data.packet_len) { + k_sem_give(&tx_data.sem); + } else { + + tx_backoff(tx_data.rx_timeout); + try_tx(dev, true); + } + return; + } + /* Finish previous data chunk and start new if any pending. */ ring_buf_get_finish(&tx_data.rbuf, evt->data.tx.len); atomic_set(&tx_data.busy, 0); @@ -239,7 +289,16 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) rx_data.rx_cnt += evt->data.rx.len; if (evt->data.rx.buf == rx_data.hdr) { + if (rx_data.hdr[0] == 1) { + /* single byte packet. */ + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); + return; + } + + zassert_equal(rx_data.payload_idx, 0); rx_data.state = RX_PAYLOAD; + rx_data.payload_idx = rx_data.hdr[0] - 1; if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { size_t l = rx_data.hdr[0] - 1; @@ -248,16 +307,19 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) err = uart_rx_buf_rsp(dev, rx_data.buf, rx_data.hdr[0] - 1); } } else { - /* Payload received */ - rx_data.state = RX_HDR; - zassert_equal(len, rx_data.hdr[0] - 1); - for (int i = 0; i < len; i++) { - bool ok = evt->data.rx.buf[off + i] == (uint8_t)(len - i); + bool ok; + + if ((rx_data.mode == RX_ALL) && (rx_data.payload_idx == 0)) { + rx_data.payload_idx = evt->data.rx.buf[off + i]; + ok = true; + } else { + ok = evt->data.rx.buf[off + i] == (uint8_t)rx_data.payload_idx; + } if (!ok) { LOG_ERR("Unexpected data at %d, exp:%02x got:%02x", - i, len - i, evt->data.rx.buf[off + i]); + i, rx_data.payload_idx, evt->data.rx.buf[off + i]); } zassert_true(ok, "Unexpected data at %d, exp:%02x got:%02x", @@ -270,21 +332,52 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) */ return; } - } - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + rx_data.payload_idx--; + if (rx_data.payload_idx == 0) { + if (rx_data.mode != RX_ALL) { + zassert_equal(i + 1, len, "len:%d i:%d", len, i); + } + rx_data.state = RX_HDR; + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); + } + } } } } +static void on_rx_buf_req(const struct device *dev) +{ + if (rx_data.mode != RX_ALL) { + rx_data.buf_req = true; + return; + } + + size_t len = sizeof(rx_data.buf) / 2; + uint8_t *buf = &rx_data.buf[len * rx_data.buf_idx]; + + rx_data.buf_idx = (rx_data.buf_idx + 1) & 0x1; + uart_rx_buf_rsp(dev, buf, len); +} + static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *user_data) { ARG_UNUSED(evt); struct test_rx_data *data = user_data; int err; - uint8_t *buf = (data->state == RX_HDR) ? data->hdr : data->buf; - uint32_t len = (data->state == RX_HDR) ? 1 : (data->hdr[0] - 1); + uint8_t *buf; + uint32_t len; + + if (data->mode == RX_ALL) { + buf = data->buf; + len = sizeof(data->buf) / 2; + } else { + buf = (data->state == RX_HDR) ? data->hdr : data->buf; + len = (data->state == RX_HDR) ? 1 : (data->hdr[0] - 1); + data->buf_idx = 1; + } data->buf_req = false; @@ -294,7 +387,7 @@ static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *us zassert_true(len > 0); - err = uart_rx_enable(dev, buf, len, RX_TIMEOUT); + err = uart_rx_enable(dev, buf, len, data->timeout); zassert_equal(err, 0, "Unexpected err:%d", err); } @@ -330,8 +423,8 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void zassert_true(dev == rx_dev); break; case UART_RX_BUF_REQUEST: - rx_data.buf_req = true; zassert_true(dev == rx_dev); + on_rx_buf_req(dev); break; case UART_RX_DISABLED: zassert_true(dev == rx_dev); @@ -346,7 +439,7 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void } } -static void config_baudrate(uint32_t rate) +static void config_baudrate(uint32_t rate, bool hwfc) { struct uart_config config; int err; @@ -354,6 +447,7 @@ static void config_baudrate(uint32_t rate) err = uart_config_get(rx_dev, &config); zassert_equal(err, 0, "Unexpected err:%d", err); + config.flow_ctrl = hwfc ? UART_CFG_FLOW_CTRL_RTS_CTS : UART_CFG_FLOW_CTRL_NONE; config.baudrate = rate; err = uart_configure(rx_dev, &config); @@ -396,13 +490,14 @@ static void report_progress(uint32_t start) * * Test has busy simulator running if it is enabled in the configuration. */ -static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) +static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, + enum test_rx_mode rx_mode, bool hwfc) { int err; uint32_t load = 0; uint32_t start = k_uptime_get_32(); - config_baudrate(baudrate); + config_baudrate(baudrate, hwfc); if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { uint32_t active_avg = (baudrate == 1000000) ? 5 : 30; @@ -414,13 +509,15 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) memset(&tx_data, 0, sizeof(tx_data)); memset(&rx_data, 0, sizeof(rx_data)); tx_data.cont = true; - tx_data.mode = tx_packets ? TX_PACKETS : TX_BULK; - k_sem_init(&tx_data.sem, tx_packets ? 1 : 0, 1); + tx_data.mode = tx_mode; + k_sem_init(&tx_data.sem, (tx_mode != TX_BULK) ? 1 : 0, 1); + rx_data.timeout = (RX_TIMEOUT_BYTES * 1000000 * 10) / baudrate; + tx_data.rx_timeout = rx_data.timeout; rx_data.cont = true; rx_data.rx_cnt = 0; rx_data.state = RX_HDR; - rx_data.mode = cont ? RX_CONT : RX_DIS; + rx_data.mode = rx_mode; ring_buf_init(&tx_data.rbuf, sizeof(tx_data.buf), tx_data.buf); @@ -459,62 +556,82 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) /* Flush all TX data that may be already started. */ k_msleep(10); - (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), RX_TIMEOUT); + (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); k_msleep(10); (void)uart_rx_disable(rx_dev); k_msleep(10); TC_PRINT("Received %d bytes for %d ms, CPU load:%d.%d\n", rx_data.rx_cnt, CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT, load / 10, load % 10); - zassert_true(rx_data.rx_cnt > 1000, "Unexected RX cnt: %d", rx_data.rx_cnt); + zassert_true(rx_data.rx_cnt > 1000, "Unexpected RX cnt: %d", rx_data.rx_cnt); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_dis_hwfc) { /* TX in bulk mode, RX in DIS mode, 115k2 */ - var_packet_hwfc(115200, false, false); + var_packet(115200, TX_BULK, RX_DIS, true); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_cont_hwfc) { /* TX in bulk mode, RX in CONT mode, 115k2 */ - var_packet_hwfc(115200, false, true); + var_packet(115200, TX_BULK, RX_CONT, true); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_dis_hwfc_1m) { /* TX in bulk mode, RX in DIS mode, 1M */ - var_packet_hwfc(1000000, false, false); + var_packet(1000000, TX_BULK, RX_DIS, true); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_cont_hwfc_1m) { /* TX in bulk mode, RX in CONT mode, 1M */ - var_packet_hwfc(1000000, false, true); + var_packet(1000000, TX_BULK, RX_CONT, true); } ZTEST(uart_async_dual, test_var_packets_dis_hwfc) { /* TX in packet mode, RX in DIS mode, 115k2 */ - var_packet_hwfc(115200, true, false); + var_packet(115200, TX_PACKETS, RX_DIS, true); } ZTEST(uart_async_dual, test_var_packets_cont_hwfc) { /* TX in packet mode, RX in CONT mode, 115k2 */ - var_packet_hwfc(115200, true, true); + var_packet(115200, TX_PACKETS, RX_CONT, true); } ZTEST(uart_async_dual, test_var_packets_dis_hwfc_1m) { /* TX in packet mode, RX in DIS mode, 1M */ - var_packet_hwfc(1000000, true, false); + var_packet(1000000, TX_PACKETS, RX_DIS, true); } ZTEST(uart_async_dual, test_var_packets_cont_hwfc_1m) { /* TX in packet mode, RX in CONT mode, 1M */ - var_packet_hwfc(1000000, true, true); + var_packet(1000000, TX_PACKETS, RX_CONT, true); +} + +ZTEST(uart_async_dual, test_var_packets_chopped_all) +{ + if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { + ztest_test_skip(); + } + + /* TX in chopped mode, RX in receive ALL mode, 115k2 */ + var_packet(115200, TX_CHOPPED, RX_ALL, false); +} + +ZTEST(uart_async_dual, test_var_packets_chopped_all_1m) +{ + if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { + ztest_test_skip(); + } + + /* TX in chopped mode, RX in receive ALL mode, 1M */ + var_packet(1000000, TX_CHOPPED, RX_ALL, false); } static void hci_like_callback(const struct device *dev, struct uart_event *evt, void *user_data) @@ -563,7 +680,7 @@ static bool rx(uint8_t *buf, size_t len) { int err; - err = uart_rx_enable(rx_dev, buf, len, RX_TIMEOUT); + err = uart_rx_enable(rx_dev, buf, len, rx_data.timeout); zassert_equal(err, 0, "Unexpected err:%d", err); err = k_sem_take(&rx_data.sem, K_MSEC(100)); @@ -751,7 +868,7 @@ static void hci_like_test(uint32_t baudrate) int err; uint32_t load = 0; - config_baudrate(baudrate); + config_baudrate(baudrate, true); if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { uint32_t active_avg = (baudrate == 1000000) ? 10 : 50; @@ -765,6 +882,7 @@ static void hci_like_test(uint32_t baudrate) tx_data.cnt = 0; tx_data.cont = true; rx_data.cont = true; + rx_data.timeout = (RX_TIMEOUT_BYTES * 1000000 * 10) / baudrate; k_sem_init(&tx_data.sem, 1, 1); k_sem_init(&rx_data.sem, 0, 1); @@ -802,7 +920,7 @@ static void hci_like_test(uint32_t baudrate) k_msleep(10); PM_CHECK(tx_dev, rx_dev, false); - (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), RX_TIMEOUT); + (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); k_msleep(1); (void)uart_rx_disable(rx_dev); diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index 1a2d811bbfe..1722d5e5e7d 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -73,3 +73,18 @@ tests: - nrf52_bsim extra_configs: - CONFIG_PM_RUNTIME_IN_TEST=y + drivers.uart.async_dual.no_tx_chopped: + harness: ztest + harness_config: + fixture: uart_loopback + depends_on: gpio + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad + - nrf54h20dk/nrf54h20/cpuppr + - nrf9160dk/nrf9160 + - nrf52_bsim + extra_configs: + - CONFIG_TEST_CHOPPED_TX=n + - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER=n From 40c5e1acef59a7593bd04aae3ba8732b215f5dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 30 Jun 2025 08:08:26 +0200 Subject: [PATCH 755/881] [nrf fromlist] tests: drivers: uart: async_dual: Update configuration for nrf54l MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add timer property to the uart device under test. Add zephyr,pm-device-runtime-auto to the uart device under test. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 9880309e77a33c49f91906f9355d845f11984432) --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index a1e29cbf0ff..d8995e36971 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -42,6 +42,7 @@ dut: &uart21 { pinctrl-1 = <&uart21_sleep_alt>; pinctrl-names = "default", "sleep"; current-speed = <115200>; + timer = <&timer21>; }; dut2: &uart00 { diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 93ad73f3b37..224399ccaa9 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -38,6 +38,10 @@ }; }; +&timer21 { + status = "reserved"; +}; + dut: &uart21 { status = "okay"; current-speed = <115200>; @@ -45,6 +49,8 @@ dut: &uart21 { pinctrl-1 = <&uart21_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; + timer = <&timer21>; + zephyr,pm-device-runtime-auto; }; dut_aux: &uart22 { @@ -54,6 +60,7 @@ dut_aux: &uart22 { pinctrl-1 = <&uart22_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; + zephyr,pm-device-runtime-auto; }; &timer20 { From 2e20798406e884a790dcb1fa240a8a8c33fd0d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 4 Jul 2025 13:02:21 +0200 Subject: [PATCH 756/881] [nrf fromlist] tests: drivers: uart: async_dual: Extend nrf54h20dk configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add workaround timer to instances that are used for reception in the test. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 95ceeea1d07954d763c357cbe667def4ea1fd17f) --- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 22 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 12 ++++++++++ 2 files changed, 34 insertions(+) diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi index e651cf5399e..1ca0775f629 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -60,6 +60,16 @@ }; }; +&timer134 { + status = "reserved"; +}; + +&dppic135 { + owned-channels = <0>; + source-channels = <0>; + status = "okay"; +}; + dut: &uart134 { status = "okay"; current-speed = <115200>; @@ -67,6 +77,7 @@ dut: &uart134 { pinctrl-1 = <&uart134_alt_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; + timer = <&timer134>; zephyr,pm-device-runtime-auto; }; @@ -80,12 +91,23 @@ dut_aux: &uart137 { zephyr,pm-device-runtime-auto; }; +&dppic120 { + owned-channels = <0>; + source-channels = <0>; + status = "okay"; +}; + +&timer120 { + status = "reserved"; +}; + dut2: &uart120 { pinctrl-0 = <&uart120_default_alt>; pinctrl-1 = <&uart120_sleep_alt>; pinctrl-names = "default", "sleep"; current-speed = <115200>; hw-flow-control; + timer = <&timer120>; zephyr,pm-device-runtime-auto; }; diff --git a/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index fcdc838a54e..65a2c52016e 100644 --- a/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -9,3 +9,15 @@ status = "reserved"; interrupt-parent = <&cpuppr_clic>; }; + +&timer134 { + interrupt-parent = <&cpuppr_clic>; +}; + +&dppic135 { + child-owned-channels = <0>; +}; + +&uart136 { + current-speed = <1000000>; +}; From d1480f4b899f8f55682741e5bc2d2274cd39d504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 11 Jul 2025 12:46:55 +0200 Subject: [PATCH 757/881] [nrf fromlist] tests: drivers: uart: async_dual: Optimize test data handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stress test is executed on CPUs with slow clock (16MHz). Handling of test data in UART_RX_RDY event is optimized to reduce time spent in the interrupt context. Since payload is always a decrementing sequence, fixed array is used to compare memory which allows to use standard memcmp instead of byte by byte comparison. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 29526b1e69a2ac46c13da6ca44251bdaa73f14e1) --- tests/drivers/uart/uart_async_dual/src/main.c | 152 +++++++++++------- 1 file changed, 94 insertions(+), 58 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index c2ad5d8a0a0..160d8c76104 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -61,6 +61,25 @@ ZTEST_DMEM struct dut_data duts[] = { #endif }; +/* Array that contains potential payload. It is used to memcmp against incoming packets. */ +static const uint8_t test_buf[256] = { + 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, + 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, + 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, + 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, + 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, + 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, + 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, + 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, + 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, + 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, + 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, + 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, + 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, + 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, + 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, + 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; + static void pm_check(const struct device *dev, const struct device *second_dev, bool exp_on, int line) { @@ -128,6 +147,8 @@ enum test_rx_mode { RX_ALL, }; +typedef bool (*test_on_rx_rdy_t)(const struct device *dev, uint8_t *buf, size_t len); + struct test_rx_data { uint8_t hdr[1]; uint8_t buf[256]; @@ -140,6 +161,7 @@ struct test_rx_data { struct k_sem sem; uint32_t timeout; uint32_t buf_idx; + test_on_rx_rdy_t on_rx_rdy; }; static struct test_tx_data tx_data; @@ -277,75 +299,86 @@ static void on_tx_done(const struct device *dev, struct uart_event *evt) try_tx(dev, true); } -static void on_rx_rdy(const struct device *dev, struct uart_event *evt) +static bool on_rx_rdy_rx_all(const struct device *dev, uint8_t *buf, size_t len) { - uint32_t len = evt->data.rx.len; - uint32_t off = evt->data.rx.offset; - int err; + bool ok; - if (!rx_data.cont) { - return; + if (rx_data.payload_idx == 0) { + rx_data.payload_idx = buf[0] - 1; + buf++; + len--; } - rx_data.rx_cnt += evt->data.rx.len; - if (evt->data.rx.buf == rx_data.hdr) { - if (rx_data.hdr[0] == 1) { - /* single byte packet. */ - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); - return; + ok = memcmp(buf, &test_buf[256 - rx_data.payload_idx], len) == 0; + rx_data.payload_idx -= len; + + return ok; +} + +static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len); + +static bool on_rx_rdy_payload(const struct device *dev, uint8_t *buf, size_t len) +{ + bool ok; + int err; + + ok = memcmp(buf, &test_buf[255 - rx_data.payload_idx], len) == 0; + if (!ok) { + for (int i = 0; i < len; i++) { + if (buf[i] != test_buf[255 - rx_data.payload_idx + i]) { + zassert_true(false, "Byte %d expected: %02x got: %02x", + i, buf[i], test_buf[255 - rx_data.payload_idx + i]); + } } + rx_data.cont = false; + tx_data.cont = false; + zassert_true(ok); + return false; + } - zassert_equal(rx_data.payload_idx, 0); - rx_data.state = RX_PAYLOAD; - rx_data.payload_idx = rx_data.hdr[0] - 1; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - size_t l = rx_data.hdr[0] - 1; + rx_data.payload_idx -= len; - zassert_true(l > 0); + if (rx_data.payload_idx == 0) { + rx_data.state = RX_HDR; + rx_data.on_rx_rdy = on_rx_rdy_hdr; + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.buf, rx_data.hdr[0] - 1); + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); } - } else { - for (int i = 0; i < len; i++) { - bool ok; + } - if ((rx_data.mode == RX_ALL) && (rx_data.payload_idx == 0)) { - rx_data.payload_idx = evt->data.rx.buf[off + i]; - ok = true; - } else { - ok = evt->data.rx.buf[off + i] == (uint8_t)rx_data.payload_idx; - } + return true; +} - if (!ok) { - LOG_ERR("Unexpected data at %d, exp:%02x got:%02x", - i, rx_data.payload_idx, evt->data.rx.buf[off + i]); - } +static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) +{ + int err; - zassert_true(ok, "Unexpected data at %d, exp:%02x got:%02x", - i, len - i, evt->data.rx.buf[off + i]); - if (!ok) { - rx_data.cont = false; - tx_data.cont = false; - /* Avoid flood of errors as we are in the interrupt and ztest - * cannot abort from here. - */ - return; - } - rx_data.payload_idx--; - if (rx_data.payload_idx == 0) { - if (rx_data.mode != RX_ALL) { - zassert_equal(i + 1, len, "len:%d i:%d", len, i); - } - rx_data.state = RX_HDR; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); - } - } + zassert_equal(buf, rx_data.hdr); + zassert_equal(len, 1); + if (rx_data.hdr[0] == 1) { + /* single byte packet. */ + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); } + return true; } + + zassert_equal(rx_data.payload_idx, 0); + rx_data.on_rx_rdy = on_rx_rdy_payload; + rx_data.payload_idx = rx_data.hdr[0] - 1; + rx_data.state = RX_PAYLOAD; + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + size_t l = rx_data.hdr[0] - 1; + + zassert_true(l > 0); + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.buf, buf[0] - 1); + } + + return true; } static void on_rx_buf_req(const struct device *dev) @@ -385,7 +418,6 @@ static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *us return; } - zassert_true(len > 0); err = uart_rx_enable(dev, buf, len, data->timeout); zassert_equal(err, 0, "Unexpected err:%d", err); @@ -417,7 +449,11 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void break; case UART_RX_RDY: zassert_true(dev == rx_dev); - on_rx_rdy(dev, evt); + if (rx_data.cont) { + rx_data.on_rx_rdy(dev, &evt->data.rx.buf[evt->data.rx.offset], + evt->data.rx.len); + rx_data.rx_cnt += evt->data.rx.len; + } break; case UART_RX_BUF_RELEASED: zassert_true(dev == rx_dev); @@ -516,7 +552,7 @@ static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, tx_data.rx_timeout = rx_data.timeout; rx_data.cont = true; rx_data.rx_cnt = 0; - rx_data.state = RX_HDR; + rx_data.on_rx_rdy = rx_mode == RX_ALL ? on_rx_rdy_rx_all : on_rx_rdy_hdr; rx_data.mode = rx_mode; ring_buf_init(&tx_data.rbuf, sizeof(tx_data.buf), tx_data.buf); From e130f6dbc9dae9153dc4d8ec2ac68bd52155ecad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 15 Jul 2025 10:13:10 +0200 Subject: [PATCH 758/881] [nrf fromlist] drivers: serial: nrfx_uarte: Prepare code for extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rearrange code to prepare for upcoming extension that adds special receive mode. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit d3fb28f406efd0b218b85a5e749be9a95992260b) --- drivers/serial/uart_nrfx_uarte.c | 133 +++++++++++++++++-------------- 1 file changed, 72 insertions(+), 61 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index a5436eb0ec6..5196b21a082 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -870,6 +870,78 @@ static void tx_start(const struct device *dev, const uint8_t *buf, size_t len) static void rx_timeout(struct k_timer *timer); static void tx_timeout(struct k_timer *timer); +static void user_callback(const struct device *dev, struct uart_event *evt) +{ + struct uarte_nrfx_data *data = dev->data; + + if (data->async->user_callback) { + data->async->user_callback(dev, evt, data->async->user_data); + } +} + +static void rx_buf_release(const struct device *dev, uint8_t *buf) +{ + struct uart_event evt = { + .type = UART_RX_BUF_RELEASED, + .data.rx_buf.buf = buf, + }; + + user_callback(dev, &evt); +} + +static void notify_rx_disable(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uart_event evt = { + .type = UART_RX_DISABLED, + }; + + if (LOW_POWER_ENABLED(cfg)) { + uint32_t key = irq_lock(); + + uarte_disable_locked(dev, UARTE_FLAG_LOW_POWER_RX); + irq_unlock(key); + } + + user_callback(dev, (struct uart_event *)&evt); + + /* runtime PM is put after the callback. In case uart is re-enabled from that + * callback we avoid suspending/resuming the device. + */ + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put_async(dev, K_NO_WAIT); + } +} + +static int uarte_nrfx_rx_disable(const struct device *dev) +{ + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + int key; + + if (async_rx->buf == NULL) { + return -EFAULT; + } + + k_timer_stop(&async_rx->timer); + + key = irq_lock(); + + if (async_rx->next_buf != NULL) { + nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + } + + async_rx->enabled = false; + async_rx->discard_fifo = true; + + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + irq_unlock(key); + + return 0; +} + #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -1068,15 +1140,6 @@ static int uarte_nrfx_tx_abort(const struct device *dev) return 0; } -static void user_callback(const struct device *dev, struct uart_event *evt) -{ - struct uarte_nrfx_data *data = dev->data; - - if (data->async->user_callback) { - data->async->user_callback(dev, evt, data->async->user_data); - } -} - static void notify_uart_rx_rdy(const struct device *dev, size_t len) { struct uarte_nrfx_data *data = dev->data; @@ -1090,29 +1153,6 @@ static void notify_uart_rx_rdy(const struct device *dev, size_t len) user_callback(dev, &evt); } -static void rx_buf_release(const struct device *dev, uint8_t *buf) -{ - struct uart_event evt = { - .type = UART_RX_BUF_RELEASED, - .data.rx_buf.buf = buf, - }; - - user_callback(dev, &evt); -} - -static void notify_rx_disable(const struct device *dev) -{ - struct uart_event evt = { - .type = UART_RX_DISABLED, - }; - - user_callback(dev, (struct uart_event *)&evt); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put_async(dev, K_NO_WAIT); - } -} - #ifdef UARTE_HAS_FRAME_TIMEOUT static uint32_t us_to_bauds(uint32_t baudrate, int32_t timeout) { @@ -1339,35 +1379,6 @@ static int uarte_nrfx_callback_set(const struct device *dev, return 0; } -static int uarte_nrfx_rx_disable(const struct device *dev) -{ - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - int key; - - if (async_rx->buf == NULL) { - return -EFAULT; - } - - k_timer_stop(&async_rx->timer); - - key = irq_lock(); - - if (async_rx->next_buf != NULL) { - nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - } - - async_rx->enabled = false; - async_rx->discard_fifo = true; - - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - irq_unlock(key); - - return 0; -} - static void tx_timeout(struct k_timer *timer) { const struct device *dev = k_timer_user_data_get(timer); From 9b0828a1edd04b47f66ed10dc48b333ac8ba7cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 30 Jun 2025 07:48:03 +0200 Subject: [PATCH 759/881] [nrf fromlist] drivers: serial: nrfx_uarte: Add mode with TIMER byte counting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add mode to be used on UARTE with frame timeout which is using a bounce buffers and TIMER to count bytes. This mode shall be used to reliably receive data without HWFC as frame timeout approach is not 100% reliable because it can loose or corrupt a byte when new byte arrives after frame timeout is detected but before it is fully handled. This mode is similar to the one enabled with CONFIG_UART_x_NRF_HW_ASYNC but additional bounce buffers are used and UARTE is receiving data to internal buffers and copies data to the user buffer. Legacy apporach cannot be used because in new SoC DMA attempts to copy data in words so when byte is received it stays in the DMA internal buffer until 4 bytes are received or end of transfer happens then internal DMA buffer is flushed. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit a07f73b6ff7eb85041a2f643b54840fa22c6a193) (cherry picked from commit 2b7fae8f92faf11993a2fbaee758c56f48bbd060) --- drivers/serial/Kconfig.nrfx | 26 + drivers/serial/Kconfig.nrfx_uart_instance | 7 + drivers/serial/uart_nrfx_uarte.c | 1026 +++++++++++++++++++-- 3 files changed, 971 insertions(+), 88 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 647e8cbb2e6..a39f882f644 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -79,6 +79,32 @@ config UART_ASYNC_TX_CACHE_SIZE in RAM, because EasyDMA in UARTE peripherals can only transfer data from RAM. +config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + bool "Use TIMER to count RX bytes" + depends on UART_ASYNC_API + depends on UART_NRFX_UARTE_LEGACY_SHIM + depends on !ARCH_POSIX # Mode not supported on BSIM target + select NRFX_GPPI + +config UART_NRFX_UARTE_BOUNCE_BUF_LEN + int "RX bounce buffer size" + depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + default 256 + range 64 1024 + help + Buffer is used when workaround with bounce buffers is applied + +config UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY + int "RX bounce buffer swap latency (in microseconds)" + depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + default 300 + help + Option decides how long before current bounce buffer is filled driver + attempts to swap the buffer. It must be long enough to ensure that + space following the buffer is not overwritten. Too high value results + in more frequent buffer swaps so it impacts performance. Setting should + take into account potential interrupt handling latency. + config UART_NRFX_UARTE_DIRECT_ISR bool "Use direct ISR" diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index b1a68d691c4..82ffaa10fcb 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -18,6 +18,13 @@ config UART_$(nrfx_uart_num)_ASYNC help This option enables UART Asynchronous API support on port $(nrfx_uart_num). +config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER + bool + depends on $(dt_nodelabel_has_prop,uart$(nrfx_uart_num),timer) + depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) + default y + imply UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + config UART_$(nrfx_uart_num)_ENHANCED_POLL_OUT bool "Efficient poll out on port $(nrfx_uart_num)" depends on !$(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),endtx-stoptx-supported) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 5196b21a082..00489e7d885 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -188,6 +188,16 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); /* Size of hardware fifo in RX path. */ #define UARTE_HW_RX_FIFO_SIZE 5 +/* TIMER CC channels for counting bytes with TIMER. */ +/* Channel used for capturing current counter value. */ +#define UARTE_TIMER_CAPTURE_CH 0 +/* Channel used to get compare event when number of received bytes reaches user buffer size. */ +#define UARTE_TIMER_USR_CNT_CH 1 +/* Channel used to get compare event when bounce buffer need to be switched. */ +#define UARTE_TIMER_BUF_SWITCH_CH 2 +/* Magic byte that is used to fill the buffer. */ +#define UARTE_MAGIC_BYTE 0xAA + #ifdef UARTE_ANY_ASYNC struct uarte_async_tx { @@ -201,6 +211,30 @@ struct uarte_async_tx { bool pending; }; +/* Structure with data for Count Bytes With Timer receiver mode (cbwt). */ +struct uarte_async_rx_cbwt { + uint8_t *curr_bounce_buf; + uint8_t *anomaly_byte_addr; + uint32_t usr_rd_off; + uint32_t usr_wr_off; + uint32_t bounce_off; + uint32_t bounce_limit; + uint32_t last_cnt; + uint32_t cc_usr; + uint32_t cc_swap; +#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE + size_t bounce_buf_swap_len; +#endif +#ifdef UARTE_ANY_CACHE + uint8_t *anomaly_byte_dst; + uint8_t anomaly_byte; +#endif + uint8_t bounce_idx; + uint8_t ppi_ch; + bool in_irq; + bool discard_fifo; +}; + struct uarte_async_rx { struct k_timer timer; #ifdef CONFIG_HAS_NORDIC_DMM @@ -212,8 +246,9 @@ struct uarte_async_rx { size_t offset; uint8_t *next_buf; size_t next_buf_len; -#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX -#if !defined(UARTE_HAS_FRAME_TIMEOUT) +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) uint32_t idle_cnt; #endif k_timeout_t timeout; @@ -286,6 +321,10 @@ struct uarte_nrfx_data { #define UARTE_FLAG_POLL_OUT BIT(3) /* Flag indicating that a workaround for not working frame timeout is active. */ #define UARTE_FLAG_FTIMEOUT_WATCH BIT(4) +/* Flag indicating that UART_RX_BUF_REQUEST event need to be called from the interrupt context. */ +#define UARTE_FLAG_RX_BUF_REQ BIT(5) +/* Flag indicating that CC value in TIMER was set too late. */ +#define UARTE_FLAG_LATE_CC BIT(6) /* If enabled then ENDTX is PPI'ed to TXSTOP */ #define UARTE_CFG_FLAG_PPI_ENDTX BIT(0) @@ -304,6 +343,12 @@ struct uarte_nrfx_data { /* Indicates that workaround for spurious RXTO during restart shall be applied. */ #define UARTE_CFG_FLAG_SPURIOUS_RXTO BIT(3) +/* Indicates that UARTE/TIMER interrupt priority differs from system clock (GRTC/RTC). */ +#define UARTE_CFG_FLAG_VAR_IRQ BIT(4) + +/* Indicates that instance needs special handling of BAUDRATE register. */ +#define UARTE_CFG_FLAG_VOLATILE_BAUDRATE BIT(5) + /* Formula for getting the baudrate settings is following: * 2^12 * (2^20 / (f_PCLK / desired_baudrate)) where f_PCLK is a frequency that * drives the UARTE. @@ -340,6 +385,14 @@ struct uarte_nrfx_data { (baudrate) == 921600 ? NRF_UARTE_BAUDRATE_921600 : \ (baudrate) == 1000000 ? NRF_UARTE_BAUDRATE_1000000 : 0) +#define UARTE_MIN_BUF_SWAP_LEN 10 + +#define UARTE_US_TO_BYTES(baudrate) \ + DIV_ROUND_UP((CONFIG_UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY * baudrate), 10000000) + +#define UARTE_BUF_SWAP_LEN(bounce_buf_len, baudrate) \ + ((bounce_buf_len) - MAX(UARTE_MIN_BUF_SWAP_LEN, UARTE_US_TO_BYTES(baudrate))) + #define LOW_POWER_ENABLED(_config) \ (IS_ENABLED(UARTE_ANY_LOW_POWER) && \ !IS_ENABLED(CONFIG_PM_DEVICE) && \ @@ -386,6 +439,15 @@ struct uarte_nrfx_config { #endif /* CONFIG_UART_USE_RUNTIME_CONFIGURE */ #ifdef UARTE_ANY_ASYNC +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + NRF_TIMER_Type * timer_regs; + IRQn_Type timer_irqn; + IRQn_Type uarte_irqn; + uint8_t *bounce_buf[2]; + size_t bounce_buf_len; + size_t bounce_buf_swap_len; + struct uarte_async_rx_cbwt *cbwt_data; +#endif nrfx_timer_t timer; uint8_t *tx_cache; uint8_t *rx_flush_buf; @@ -405,6 +467,12 @@ struct uarte_nrfx_config { (IS_ENABLED(UARTE_ANY_HW_ASYNC) ? \ (config->flags & UARTE_CFG_FLAG_HW_BYTE_COUNTING) : false) +/* Determine if instance is using an approach with counting bytes with TIMER (cbwt). */ +#define IS_CBWT(dev) \ + COND_CODE_1(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ + ((((const struct uarte_nrfx_config *)dev->config)->cbwt_data != NULL)), \ + (false)) + static inline NRF_UARTE_Type *get_uarte_instance(const struct device *dev) { const struct uarte_nrfx_config *config = dev->config; @@ -596,10 +664,23 @@ static int baudrate_set(const struct device *dev, uint32_t baudrate) return -EINVAL; } +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + struct uarte_async_rx_cbwt *cbwt_data = config->cbwt_data; + + cbwt_data->bounce_buf_swap_len = UARTE_BUF_SWAP_LEN(config->bounce_buf_len, + baudrate); + } +#endif + #ifdef UARTE_BAUDRATE_RETENTION_WORKAROUND - struct uarte_nrfx_data *data = dev->data; + if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { + struct uarte_nrfx_data *data = dev->data; - data->nrf_baudrate = nrf_baudrate; + data->nrf_baudrate = nrf_baudrate; + } else { + nrf_uarte_baudrate_set(get_uarte_instance(dev), nrf_baudrate); + } #else nrf_uarte_baudrate_set(get_uarte_instance(dev), nrf_baudrate); #endif @@ -787,9 +868,11 @@ static void uarte_periph_enable(const struct device *dev) #endif #if UARTE_BAUDRATE_RETENTION_WORKAROUND - nrf_uarte_baudrate_set(uarte, - COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, - (data->nrf_baudrate), (config->nrf_baudrate))); + if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { + nrf_uarte_baudrate_set(uarte, + COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, + (data->nrf_baudrate), (config->nrf_baudrate))); + } #endif #ifdef UARTE_ANY_ASYNC @@ -889,13 +972,17 @@ static void rx_buf_release(const struct device *dev, uint8_t *buf) user_callback(dev, &evt); } -static void notify_rx_disable(const struct device *dev) +static void rx_disable_finalize(const struct device *dev) { const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; struct uart_event evt = { .type = UART_RX_DISABLED, }; + async_rx->enabled = false; + if (LOW_POWER_ENABLED(cfg)) { uint32_t key = irq_lock(); @@ -913,28 +1000,42 @@ static void notify_rx_disable(const struct device *dev) } } -static int uarte_nrfx_rx_disable(const struct device *dev) +static int rx_disable(const struct device *dev, bool api) { struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); int key; - if (async_rx->buf == NULL) { - return -EFAULT; - } - k_timer_stop(&async_rx->timer); key = irq_lock(); +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + if (cbwt_data) { + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_BUF_SWITCH_CH)); + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); + nrf_timer_int_disable(cfg->timer_regs, + nrf_timer_compare_int_get(UARTE_TIMER_BUF_SWITCH_CH) | + nrf_timer_compare_int_get(UARTE_TIMER_USR_CNT_CH)); + nrf_uarte_shorts_disable(cfg->uarte_regs, NRF_UARTE_SHORT_ENDRX_STARTRX); + } +#endif + if (async_rx->next_buf != NULL) { nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); } async_rx->enabled = false; - async_rx->discard_fifo = true; + if (api) { + async_rx->discard_fifo = true; + } nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); irq_unlock(key); @@ -942,6 +1043,18 @@ static int uarte_nrfx_rx_disable(const struct device *dev) return 0; } +static int uarte_nrfx_rx_disable(const struct device *dev) +{ + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + + if (async_rx->buf == NULL) { + return -EFAULT; + } + + return rx_disable(dev, true); +} + #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -966,10 +1079,10 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) if (ret != NRFX_SUCCESS) { LOG_ERR("Timer already initialized"); return -EINVAL; - } else { - nrfx_timer_clear(&cfg->timer); } + nrfx_timer_clear(&cfg->timer); + ret = nrfx_gppi_channel_alloc(&data->async->rx.cnt.ppi); if (ret != NRFX_SUCCESS) { LOG_ERR("Failed to allocate PPI Channel"); @@ -987,6 +1100,653 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) } #endif /* !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) */ +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + +static uint32_t get_byte_cnt(NRF_TIMER_Type *timer) +{ + nrf_timer_task_trigger(timer, nrf_timer_capture_task_get(UARTE_TIMER_CAPTURE_CH)); + + nrf_barrier_w(); + + return nrf_timer_cc_get(timer, UARTE_TIMER_CAPTURE_CH); +} + +static void rx_buf_req(const struct device *dev) +{ + struct uart_event evt = { + .type = UART_RX_BUF_REQUEST, + }; + + user_callback(dev, &evt); +} + +static bool notify_rx_rdy(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + size_t len = cbwt_data->usr_wr_off - cbwt_data->usr_rd_off; + + if (len == 0) { + return async_rx->buf != NULL; + } + + struct uart_event evt = { + .type = UART_RX_RDY, + .data.rx.buf = async_rx->buf, + .data.rx.len = len, + .data.rx.offset = cbwt_data->usr_rd_off + }; + user_callback(dev, &evt); + cbwt_data->usr_rd_off += len; + + if (cbwt_data->usr_rd_off == async_rx->buf_len) { + rx_buf_release(dev, async_rx->buf); + async_rx->buf = async_rx->next_buf; + async_rx->buf_len = async_rx->next_buf_len; + async_rx->next_buf_len = 0; + async_rx->next_buf = 0; + cbwt_data->usr_rd_off = 0; + cbwt_data->usr_wr_off = 0; + + if (async_rx->buf_len == 0) { + return false; + } + + /* Set past value to ensure that event will not expire after clearing but + * before setting the new value. + */ + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, cbwt_data->cc_usr - 1); + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); + cbwt_data->cc_usr += async_rx->buf_len; + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, cbwt_data->cc_usr); + + /* Check if CC is already in the past. In that case trigger CC handling.*/ + if (cbwt_data->cc_usr <= get_byte_cnt(cfg->timer_regs)) { + atomic_or(&data->flags, UARTE_FLAG_LATE_CC); + NRFX_IRQ_PENDING_SET(cfg->timer_irqn); + } else { + atomic_and(&data->flags, ~UARTE_FLAG_LATE_CC); + } + } + + return true; +} + +static void anomaly_byte_handle(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint8_t curr_byte, anomaly_byte; + uint32_t diff; + + if (cbwt_data->anomaly_byte_addr == NULL) { + return; + } + + diff = cfg->uarte_regs->DMA.RX.PTR - (uint32_t)cbwt_data->curr_bounce_buf; + /* Anomaly can be checked only if more than 1 byte is received to the current buffer. */ + if (diff < 2) { + return; + } + + if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + sys_cache_data_invd_range(cbwt_data->curr_bounce_buf, 1); + sys_cache_data_invd_range(cbwt_data->anomaly_byte_addr, 1); + } + + curr_byte = cbwt_data->curr_bounce_buf[0]; + anomaly_byte = *cbwt_data->anomaly_byte_addr; + if ((curr_byte == UARTE_MAGIC_BYTE) && (anomaly_byte != UARTE_MAGIC_BYTE)) { +#ifdef UARTE_ANY_CACHE + if (cfg->flags & UARTE_CFG_FLAG_CACHEABLE) { + /* We cannot write directly to curr_bounce_buf as it is written by + * DMA and with cache operations data may be overwritten. Copying + * need to be postponed to the moment when user buffer is filled. + */ + cbwt_data->anomaly_byte = anomaly_byte; + cbwt_data->anomaly_byte_dst = &cbwt_data->curr_bounce_buf[0]; + } else { + cbwt_data->curr_bounce_buf[0] = anomaly_byte; + } +#else + cbwt_data->curr_bounce_buf[0] = anomaly_byte; +#endif + } + + cbwt_data->anomaly_byte_addr = NULL; +} + +static uint32_t fill_usr_buf(const struct device *dev, uint32_t len) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + uint8_t *buf = cfg->bounce_buf[cbwt_data->bounce_idx]; + uint32_t usr_rem = async_rx->buf_len - cbwt_data->usr_wr_off; + uint32_t bounce_rem = cbwt_data->bounce_limit - cbwt_data->bounce_off; + uint32_t cpy_len = MIN(bounce_rem, MIN(usr_rem, len)); + + __ASSERT(cpy_len + cbwt_data->bounce_off <= cfg->bounce_buf_len, + "Exceeding the buffer cpy_len:%d off:%d limit:%d", + cpy_len, cbwt_data->bounce_off, cbwt_data->bounce_limit); + + if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + sys_cache_data_invd_range(&buf[cbwt_data->bounce_off], cpy_len); + } + + memcpy(&async_rx->buf[cbwt_data->usr_wr_off], &buf[cbwt_data->bounce_off], cpy_len); +#ifdef UARTE_ANY_CACHE + if ((buf == cbwt_data->anomaly_byte_dst) && (cbwt_data->bounce_off == 0)) { + async_rx->buf[cbwt_data->usr_wr_off] = cbwt_data->anomaly_byte; + cbwt_data->anomaly_byte_dst = NULL; + } +#endif + cbwt_data->bounce_off += cpy_len; + cbwt_data->usr_wr_off += cpy_len; + cbwt_data->last_cnt += cpy_len; + if (cbwt_data->bounce_off == cbwt_data->bounce_limit) { + /* Bounce buffer drained */ + cbwt_data->bounce_idx = cbwt_data->bounce_idx == 0 ? 1 : 0; + cbwt_data->bounce_off = 0; + cbwt_data->bounce_limit = cfg->bounce_buf_len; + } + + return cpy_len; +} + +static bool update_usr_buf(const struct device *dev, uint32_t len, bool notify_any, bool buf_req) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + anomaly_byte_handle(dev); + + do { + uint32_t cpy_len = len ? fill_usr_buf(dev, len) : 0; + bool usr_buf_full = cbwt_data->usr_wr_off == async_rx->buf_len; + + len -= cpy_len; + if (((len == 0) && notify_any) || usr_buf_full) { + if (!notify_rx_rdy(dev)) { + return false; + } + + if (usr_buf_full && buf_req) { + rx_buf_req(dev); + } + } + } while (len > 0); + + return true; +} + +static void prepare_bounce_buf(const struct device *dev, uint8_t *buf, + size_t swap_len, size_t len) +{ + const struct uarte_nrfx_config *cfg = dev->config; + + buf[0] = UARTE_MAGIC_BYTE; + for (size_t i = swap_len; i < len; i++) { + buf[i] = UARTE_MAGIC_BYTE; + } + + if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + sys_cache_data_flush_range(buf, 1); + sys_cache_data_flush_range(&buf[swap_len], len); + } +} + +/* This function is responsible for swapping the bounce buffer and it is the most + * tricky part of the solution. Receiver is continuously working and we want to + * change DMA pointer on the fly. DMA is also incrementing that pointer so there are + * moments in the reception when updating the pointer will result in different behavior. + * + * There are two main cases that need to be handled: + * 1. PTR is updated and there was no byte boundary (in the middle of a byte or there is + * no byte on the line). It is a safe spot. + * + * The most common and simplest case. PTR is update but since + * DMA already started the reception of the previous byte it means that next byte will + * be stored in the previous PTR and bytes following that byte will be stored to the + * new bounce buffer + * + * 2. Updating the pointer collided with byte boundary. + * + * RXDRDY and RXSTARTED events are used to detect if collision occurred. + * There are few scenarios that may happen and the driver must detect which one occurred. + * Detection is done by reading back the PTR register. Following cases are considered: + * + * - PTR did not change. It means that it was written after byte boundary. It is the same + * case as if PTR was updated in the safe spot. + * + * - PTR is updated by 1. There is an anomaly and it is unclear where next byte will be + * copied. PTR state indicates that it should be copied to the beginning of the new + * bounce buffer but it might be copied to the previous bounce buffer. Both locations + * are written with a magic byte (0xAA) and later on it is checked which location has + * changed and if byte was written to the previous bounce buffer it is copied to the + * start of the new bounce buffer. + * + * - PTR is not updated with the new bounce buffer location. DMA is incrementing PTR content + * and it is possible that SW writes new value between read and modify and DMA may + * overwrite value written by the driver. In that case reception continuous to the + * previous bounce buffer and swap procedure need to be repeated. + */ +static int bounce_buf_swap(const struct device *dev, uint8_t *prev_bounce_buf) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t prev_buf_cnt, new_cnt, cnt, ptr; + uint32_t prev_buf_inc = 1; + int key; + + key = irq_lock(); + /* Clear events that indicates byte boundary and set PTR. If events are set + * after PTR is set then we know that setting PTR collided with byte boundary. + */ + nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED); + nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); + cfg->uarte_regs->DMA.RX.PTR = (uint32_t)cbwt_data->curr_bounce_buf; + cnt = get_byte_cnt(cfg->timer_regs); + + if (!nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY) && + !nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED)) { + /* RXDRDY did not happen when PTR was set. Safest case. PTR was updated + * correctly. Last byte will be received to the previous buffer. + */ + new_cnt = 0; + prev_buf_cnt = cnt - cbwt_data->last_cnt; + goto no_collision; + } + + /* Setting PTR collided with byte boundary we need to detect what happened. */ + while (!nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED)) { + } + + /* Read pointer when there is no new byte coming. */ + do { + cnt = get_byte_cnt(cfg->timer_regs); + ptr = cfg->uarte_regs->DMA.RX.PTR; + } while (cnt != get_byte_cnt(cfg->timer_regs)); + + new_cnt = ptr - (uint32_t)cbwt_data->curr_bounce_buf; + prev_buf_cnt = cnt - cbwt_data->last_cnt; + + if (new_cnt == 0) { + /* New PTR is not incremented. It was written after LIST post ENDRX + * incrementation. + */ + } else if (new_cnt == 1) { + /* new_cnt == 1. New PTR incremented. It's possible that data is already + * copied to that new location or it is written to the tail of the previous + * bounce buffer. We try to detect what happens. + */ + prev_buf_inc = 0; + cbwt_data->anomaly_byte_addr = + &prev_bounce_buf[cbwt_data->bounce_off + prev_buf_cnt]; + } else if (new_cnt <= cfg->bounce_buf_len) { + prev_buf_inc = 0; + prev_buf_cnt = cnt - cbwt_data->last_cnt - (new_cnt - 1); + } else { + /* New PTR value is not set. Re-set PTR is needed. Transfer continues to + * previous buffer whole buffer swapping need to be repeat. + */ + irq_unlock(key); + return -EAGAIN; + } + +no_collision: + cbwt_data->bounce_limit = cbwt_data->bounce_off + prev_buf_cnt + prev_buf_inc; + __ASSERT(cbwt_data->bounce_limit < cfg->bounce_buf_len, + "Too high limit (%d, max:%d), increase latency", + cbwt_data->bounce_limit, cfg->bounce_buf_len); + irq_unlock(key); + + return prev_buf_cnt; +} + +static size_t get_swap_len(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; +#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + return cbwt_data->bounce_buf_swap_len; +#else + return cfg->bounce_buf_swap_len; +#endif +} + +static void bounce_buf_switch(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + int new_data = cbwt_data->cc_swap - cbwt_data->last_cnt; + uint8_t *prev_bounce_buf = cbwt_data->curr_bounce_buf; + int prev_cnt; + + /* Fill user buffer with all pending data. */ + if (!update_usr_buf(dev, new_data < 0 ? 0 : new_data, false, true)) { + rx_disable(dev, false); + return; + } + + cbwt_data->curr_bounce_buf = (cbwt_data->curr_bounce_buf == cfg->bounce_buf[0]) ? + cfg->bounce_buf[1] : cfg->bounce_buf[0]; + prepare_bounce_buf(dev, cbwt_data->curr_bounce_buf, get_swap_len(dev), + cfg->bounce_buf_len); + + /* Swapping may need retry. */ + while ((prev_cnt = bounce_buf_swap(dev, prev_bounce_buf)) < 0) { + } + + /* Update user buffer with data that was received during swapping. */ + if (update_usr_buf(dev, prev_cnt, false, true)) { + /* Set compare event for next moment when bounce buffers need to be swapped. */ + cbwt_data->cc_swap += get_swap_len(dev); + __ASSERT(cbwt_data->cc_swap > get_byte_cnt(cfg->timer_regs), + "Setting CC too late next:%d cnt:%d", + cbwt_data->cc_swap, get_byte_cnt(cfg->timer_regs)); + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH, cbwt_data->cc_swap); + } else { + /* Stop RX. */ + rx_disable(dev, false); + } +} + +static void usr_buf_complete(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t rem = async_rx->buf_len - cbwt_data->usr_wr_off; + + __ASSERT_NO_MSG(rem <= (get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt)); + + if (!update_usr_buf(dev, rem, true, true)) { + /* Stop RX if there is no next buffer. */ + rx_disable(dev, false); + } +} + +static void notify_new_data(const struct device *dev, bool buf_req) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t cnt = get_byte_cnt(cfg->timer_regs); + uint32_t new_data = cnt - cbwt_data->last_cnt; + + (void)update_usr_buf(dev, new_data, true, buf_req); +} + +static void cbwt_rx_timeout(struct k_timer *timer) +{ + const struct device *dev = k_timer_user_data_get(timer); + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + struct uarte_async_rx *async_rx = &data->async->rx; + + if (nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY)) { + nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); + async_rx->idle_cnt = 0; + } else { + async_rx->idle_cnt++; + if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { + if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { + if (cbwt_data->in_irq) { + /* TIMER or UARTE interrupt preempted. Lets try again + * later. + */ + k_timer_start(timer, async_rx->timeout, K_NO_WAIT); + return; + } + irq_disable(cfg->uarte_irqn); + irq_disable(cfg->timer_irqn); + } + + nrf_uarte_int_enable(cfg->uarte_regs, NRF_UARTE_INT_RXDRDY_MASK); + notify_new_data(dev, true); + + if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { + irq_enable(cfg->uarte_irqn); + irq_enable(cfg->timer_irqn); + } + return; + } + } + + k_timer_start(timer, async_rx->timeout, K_NO_WAIT); +} + +static void cbwt_rx_flush_handle(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t rem_data = get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt; + uint32_t bbuf_rem_data = cbwt_data->bounce_limit - cbwt_data->bounce_off; + uint32_t amount; + uint8_t *dst; + + nrf_uarte_rx_buffer_set(uarte, cfg->rx_flush_buf, UARTE_HW_RX_FIFO_SIZE); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_FLUSHRX); + while (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) { + /* empty */ + } + + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); + if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED)) { + /* FIFO is empty. */ + return; + } + + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + amount = nrf_uarte_rx_amount_get(uarte); + + if (rem_data <= bbuf_rem_data) { + /* instead of -1 it should be -amount but RXDRDY event is not generated + * for bytes following first that goes to FIFO they are generated during flushing. + */ + dst = &cfg->bounce_buf[cbwt_data->bounce_idx][cbwt_data->bounce_off + rem_data - 1]; + } else { + /* See comment in if clause. */ + dst = &cbwt_data->curr_bounce_buf[rem_data - bbuf_rem_data - 1]; + } + + if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + sys_cache_data_invd_range(cfg->rx_flush_buf, amount); + sys_cache_data_invd_range(dst, amount); + } + + memcpy(dst, cfg->rx_flush_buf, amount); +} + +static void cbwt_rxto_isr(const struct device *dev, bool do_flush) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + if (async_rx->buf) { + notify_new_data(dev, false); + } + + if (async_rx->buf) { + rx_buf_release(dev, async_rx->buf); + async_rx->buf = NULL; + } + + if (async_rx->next_buf) { + rx_buf_release(dev, async_rx->next_buf); + async_rx->next_buf = NULL; + } + + if (do_flush) { + cbwt_rx_flush_handle(dev); + } + + if (async_rx->discard_fifo) { + cbwt_data->discard_fifo = async_rx->discard_fifo; + async_rx->discard_fifo = false; + } + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_STOP); + rx_disable_finalize(dev); +} + +static bool timer_ch_evt_check_clear(NRF_TIMER_Type *timer, uint32_t ch) +{ + nrf_timer_event_t evt = nrf_timer_compare_event_get(ch); + + if (nrf_timer_event_check(timer, evt)) { + nrf_timer_event_clear(timer, evt); + return true; + } + + return false; +} + +static void timer_isr(const void *arg) +{ + const struct device *dev = arg; + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + static const uint32_t flags_to_check = UARTE_FLAG_RX_BUF_REQ | + UARTE_FLAG_TRIG_RXTO | + UARTE_FLAG_LATE_CC; + uint32_t flags = atomic_and(&data->flags, ~flags_to_check); + + cbwt_data->in_irq = true; + + if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH) || + (flags & UARTE_FLAG_LATE_CC)) { + usr_buf_complete(dev); + } + + /* Must be after user buf complet CC handling. */ + if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH)) { + bounce_buf_switch(dev); + } + + if (flags & UARTE_FLAG_RX_BUF_REQ) { + rx_buf_req(dev); + } + + if (flags & UARTE_FLAG_TRIG_RXTO) { + cbwt_rxto_isr(dev, false); + } + + cbwt_data->in_irq = false; +} + +static void cbwt_rx_enable(const struct device *dev, bool with_timeout) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t rem_data; + uint32_t len = async_rx->buf_len; + uint32_t rx_int_mask = NRF_UARTE_INT_RXTO_MASK | + (with_timeout ? NRF_UARTE_INT_RXDRDY_MASK : 0); + + if (cbwt_data->discard_fifo) { + rem_data = 0; + cbwt_data->discard_fifo = false; + } else { + rem_data = get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt; + } + + cbwt_data->usr_rd_off = 0; + cbwt_data->usr_wr_off = 0; + + if (rem_data >= len) { + atomic_or(&data->flags, UARTE_FLAG_TRIG_RXTO); + NRFX_IRQ_PENDING_SET(cfg->timer_irqn); + return; + } else if (rem_data) { + (void)update_usr_buf(dev, rem_data, false, true); + len -= rem_data; + } + + prepare_bounce_buf(dev, cfg->bounce_buf[0], get_swap_len(dev), cfg->bounce_buf_len); + + cbwt_data->last_cnt = 0; + cbwt_data->bounce_off = 0; + cbwt_data->bounce_idx = 0; + cbwt_data->curr_bounce_buf = cfg->bounce_buf[0]; + cbwt_data->bounce_limit = cfg->bounce_buf_len; + /* Enable ArrayList. */ + nrf_uarte_shorts_enable(cfg->uarte_regs, NRF_UARTE_SHORT_ENDRX_STARTRX); + nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); + nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); + nrf_uarte_rx_buffer_set(cfg->uarte_regs, cbwt_data->curr_bounce_buf, 1); + + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_BUF_SWITCH_CH)); + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); + nrf_timer_int_enable(cfg->timer_regs, + nrf_timer_compare_int_get(UARTE_TIMER_BUF_SWITCH_CH) | + nrf_timer_compare_int_get(UARTE_TIMER_USR_CNT_CH)); + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_CLEAR); + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_START); + cbwt_data->cc_usr = len; + cbwt_data->cc_swap = get_swap_len(dev); + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH, get_swap_len(dev)); + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, len); + + atomic_or(&data->flags, UARTE_FLAG_RX_BUF_REQ); + nrf_uarte_task_trigger(cfg->uarte_regs, NRF_UARTE_TASK_STARTRX); + NRFX_IRQ_PENDING_SET(cfg->timer_irqn); +} + +static int cbwt_uarte_async_init(const struct device *dev) +{ + /* As this approach does not use nrfx_timer driver but only HAL special setup + * function is used. + */ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + static const uint32_t rx_int_mask = NRF_UARTE_INT_ERROR_MASK | + NRF_UARTE_INT_RXTO_MASK; + uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); + uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT); + nrfx_err_t ret; + + nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER); + nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32); + + ret = nrfx_gppi_channel_alloc(&cbwt_data->ppi_ch); + if (ret != NRFX_SUCCESS) { + return -ENOMEM; + } + + nrfx_gppi_channel_endpoints_setup(cbwt_data->ppi_ch, evt, tsk); + nrfx_gppi_channels_enable(BIT(cbwt_data->ppi_ch)); + +#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE + cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; +#endif + + /* Enable EasyDMA LIST feature (it is exposed in SPIM but not in UARTE). */ + *(volatile uint32_t *)((uint32_t)cfg->uarte_regs + 0x714) = 1; + nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); + + return 0; +} +#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER */ + static int uarte_async_init(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; @@ -999,6 +1759,17 @@ static int uarte_async_init(const struct device *dev) ((IS_ENABLED(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && !IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) ? NRF_UARTE_INT_RXDRDY_MASK : 0); + k_timer_init(&data->async->rx.timer, rx_timeout, NULL); + k_timer_user_data_set(&data->async->rx.timer, (void *)dev); + k_timer_init(&data->async->tx.timer, tx_timeout, NULL); + k_timer_user_data_set(&data->async->tx.timer, (void *)dev); + +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + return cbwt_uarte_async_init(dev); + } +#endif + #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) int ret = uarte_nrfx_rx_counting_init(dev); @@ -1009,11 +1780,6 @@ static int uarte_async_init(const struct device *dev) nrf_uarte_int_enable(uarte, rx_int_mask); - k_timer_init(&data->async->rx.timer, rx_timeout, NULL); - k_timer_user_data_set(&data->async->rx.timer, (void *)dev); - k_timer_init(&data->async->tx.timer, tx_timeout, NULL); - k_timer_user_data_set(&data->async->tx.timer, (void *)dev); - return 0; } @@ -1162,6 +1928,7 @@ static uint32_t us_to_bauds(uint32_t baudrate, int32_t timeout) } #endif + static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, size_t len, int32_t timeout) @@ -1171,6 +1938,11 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, const struct uarte_nrfx_config *cfg = dev->config; NRF_UARTE_Type *uarte = get_uarte_instance(dev); +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + bool with_timeout = timeout != SYS_FOREVER_US; +#endif + if (cfg->disable_rx) { __ASSERT(false, "TX only UARTE instance"); return -ENOTSUP; @@ -1185,35 +1957,45 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } #ifdef CONFIG_HAS_NORDIC_DMM - uint8_t *dma_buf; - int ret = 0; + if (!IS_CBWT(dev)) { + void *dma_buf; + int ret = 0; - ret = dmm_buffer_in_prepare(cfg->mem_reg, buf, len, (void **)&dma_buf); - if (ret < 0) { - return ret; - } + ret = dmm_buffer_in_prepare(cfg->mem_reg, buf, len, &dma_buf); + if (ret < 0) { + return ret; + } - async_rx->usr_buf = buf; - buf = dma_buf; + async_rx->usr_buf = buf; + buf = dma_buf; + } #endif -#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + #ifdef UARTE_HAS_FRAME_TIMEOUT - if (timeout != SYS_FOREVER_US) { + if (!IS_CBWT(dev) && with_timeout) { uint32_t baudrate = COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, - (data->uart_config.baudrate), (cfg->baudrate)); - - async_rx->timeout = K_USEC(timeout); + (data->uart_config.baudrate), (cfg->baudrate)); nrf_uarte_frame_timeout_set(uarte, us_to_bauds(baudrate, timeout)); nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_FRAME_TIMEOUT_STOPRX); + } +#endif +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + async_rx->idle_cnt = 0; +#endif + + if (with_timeout) { + if (!IS_CBWT(dev) && IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) { + async_rx->timeout = K_USEC(timeout); + } else { + async_rx->timeout = with_timeout ? + K_USEC(timeout / RX_TIMEOUT_DIV) : K_NO_WAIT; + } } else { async_rx->timeout = K_NO_WAIT; } -#else - async_rx->timeout = (timeout == SYS_FOREVER_US) ? - K_NO_WAIT : K_USEC(timeout / RX_TIMEOUT_DIV); - async_rx->idle_cnt = 0; -#endif /* UARTE_HAS_FRAME_TIMEOUT */ #else async_rx->timeout_us = timeout; async_rx->timeout_slab = timeout / RX_TIMEOUT_DIV; @@ -1241,8 +2023,20 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } } pm_device_runtime_get(dev); + } else if (LOW_POWER_ENABLED(cfg)) { + unsigned int key = irq_lock(); + + uarte_enable_locked(dev, UARTE_FLAG_LOW_POWER_RX); + irq_unlock(key); } +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + cbwt_rx_enable(dev, with_timeout); + return 0; + } +#endif + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) || LOW_POWER_ENABLED(cfg)) { if (async_rx->flush_cnt) { int cpy_len = MIN(len, async_rx->flush_cnt); @@ -1279,7 +2073,7 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, return 0; } else { #ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX - if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { + if (with_timeout) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); @@ -1304,13 +2098,6 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, async_rx->enabled = true; - if (LOW_POWER_ENABLED(cfg)) { - unsigned int key = irq_lock(); - - uarte_enable_locked(dev, UARTE_FLAG_LOW_POWER_RX); - irq_unlock(key); - } - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); return 0; @@ -1329,29 +2116,33 @@ static int uarte_nrfx_rx_buf_rsp(const struct device *dev, uint8_t *buf, err = -EACCES; } else if (async_rx->next_buf == NULL) { #ifdef CONFIG_HAS_NORDIC_DMM - uint8_t *dma_buf; - const struct uarte_nrfx_config *config = dev->config; + if (!IS_CBWT(dev)) { + uint8_t *dma_buf; + const struct uarte_nrfx_config *config = dev->config; - err = dmm_buffer_in_prepare(config->mem_reg, buf, len, (void **)&dma_buf); - if (err < 0) { - return err; + err = dmm_buffer_in_prepare(config->mem_reg, buf, len, (void **)&dma_buf); + if (err < 0) { + return err; + } + async_rx->next_usr_buf = buf; + buf = dma_buf; } - async_rx->next_usr_buf = buf; - buf = dma_buf; #endif async_rx->next_buf = buf; async_rx->next_buf_len = len; - nrf_uarte_rx_buffer_set(uarte, buf, len); - /* If buffer is shorter than RX FIFO then there is a risk that due - * to interrupt handling latency ENDRX event is not handled on time - * and due to ENDRX_STARTRX short data will start to be overwritten. - * In that case short is not enabled and ENDRX event handler will - * manually start RX for that buffer. Thanks to RX FIFO there is - * 5 byte time for doing that. If interrupt latency is higher and - * there is no HWFC in both cases data will be lost or corrupted. - */ - if (len >= UARTE_HW_RX_FIFO_SIZE) { - nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + if (!IS_CBWT(dev)) { + nrf_uarte_rx_buffer_set(uarte, buf, len); + /* If buffer is shorter than RX FIFO then there is a risk that due + * to interrupt handling latency ENDRX event is not handled on time + * and due to ENDRX_STARTRX short data will start to be overwritten. + * In that case short is not enabled and ENDRX event handler will + * manually start RX for that buffer. Thanks to RX FIFO there is + * 5 byte time for doing that. If interrupt latency is higher and + * there is no HWFC in both cases data will be lost or corrupted. + */ + if (len >= UARTE_HW_RX_FIFO_SIZE) { + nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + } } err = 0; } else { @@ -1401,6 +2192,13 @@ static void rx_timeout(struct k_timer *timer) NRF_UARTE_Type *uarte = get_uarte_instance(dev); #ifdef UARTE_HAS_FRAME_TIMEOUT +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + cbwt_rx_timeout(timer); + return; + } +#endif + struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; bool rxdrdy = nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY); @@ -1547,7 +2345,7 @@ static void error_isr(const struct device *dev) nrf_uarte_errorsrc_clear(uarte, err); user_callback(dev, &evt); - (void) uarte_nrfx_rx_disable(dev); + (void)rx_disable(dev, false); } static void rxstarted_isr(const struct device *dev) @@ -1766,7 +2564,6 @@ static void rxto_isr(const struct device *dev) * In the second case, additionally, data from the UARTE internal RX * FIFO need to be discarded. */ - async_rx->enabled = false; if (async_rx->discard_fifo) { async_rx->discard_fifo = false; #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) @@ -1794,15 +2591,7 @@ static void rxto_isr(const struct device *dev) #endif nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); #endif - - if (LOW_POWER_ENABLED(config)) { - uint32_t key = irq_lock(); - - uarte_disable_locked(dev, UARTE_FLAG_LOW_POWER_RX); - irq_unlock(key); - } - - notify_rx_disable(dev); + rx_disable_finalize(dev); } static void txstopped_isr(const struct device *dev) @@ -1892,10 +2681,12 @@ static void txstopped_isr(const struct device *dev) static void rxdrdy_isr(const struct device *dev) { -#if !defined(UARTE_HAS_FRAME_TIMEOUT) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) struct uarte_nrfx_data *data = dev->data; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + NRF_UARTE_Type *uarte = get_uarte_instance(dev); data->async->rx.idle_cnt = 0; @@ -1927,8 +2718,9 @@ static void uarte_nrfx_isr_async(const void *arg) struct uarte_async_rx *async_rx = &data->async->rx; uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); - if (!(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) - && event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { + if ((IS_CBWT(dev) || + !(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT))) && + event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { rxdrdy_isr(dev); } @@ -1956,6 +2748,12 @@ static void uarte_nrfx_isr_async(const void *arg) rxstarted_isr(dev); } +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev) && + event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask)) { + cbwt_rxto_isr(dev, true); + } else +#endif /* RXTO must be handled after ENDRX which should notify the buffer. * Skip if ENDRX is set when RXTO is set. It means that * ENDRX occurred after check for ENDRX in isr which may happen when @@ -1980,7 +2778,8 @@ static void uarte_nrfx_isr_async(const void *arg) txstopped_isr(dev); } - if (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO) { + if (!IS_CBWT(dev) && + (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO)) { #ifdef CONFIG_HAS_NORDIC_DMM int ret; @@ -1995,7 +2794,7 @@ static void uarte_nrfx_isr_async(const void *arg) rx_buf_release(dev, async_rx->buf); async_rx->buf_len = 0; async_rx->buf = NULL; - notify_rx_disable(dev); + rx_disable_finalize(dev); } } @@ -2609,6 +3408,44 @@ static int uarte_instance_deinit(const struct device *dev) return pm_device_driver_deinit(dev, uarte_nrfx_pm_action); } +#define UARTE_TIMER_REG(idx) (NRF_TIMER_Type *)DT_REG_ADDR(DT_PHANDLE(UARTE(idx), timer)) + +#define UARTE_TIMER_IRQN(idx) DT_IRQN(DT_PHANDLE(UARTE(idx), timer)) + +#define UARTE_TIMER_IRQ_PRIO(idx) DT_IRQ(DT_PHANDLE(UARTE(idx), timer), priority) + +#define UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx) \ + IF_ENABLED(UARTE_HAS_PROP(idx, timer), \ + (.timer_regs = UARTE_TIMER_REG(idx), \ + .timer_irqn = UARTE_TIMER_IRQN(idx), \ + .uarte_irqn = DT_IRQN(UARTE(idx)), \ + .bounce_buf = { \ + uart##idx##_bounce_buf, \ + &uart##idx##_bounce_buf[sizeof(uart##idx##_bounce_buf) / 2] \ + }, \ + .bounce_buf_len = sizeof(uart##idx##_bounce_buf) / 2, \ + .bounce_buf_swap_len = UARTE_BUF_SWAP_LEN(sizeof(uart##idx##_bounce_buf) / 2,\ + UARTE_US_TO_BYTES(UARTE_PROP(idx, current_speed))), \ + .cbwt_data = &uart##idx##_bounce_data,)) + +#define UARTE_COUNT_BYTES_WITH_TIMER_VALIDATE_CONFIG(idx) \ + __ASSERT_NO_MSG(UARTE_TIMER_IRQ_PRIO(idx) == DT_IRQ(UARTE(idx), priority)) + +#define UARTE_TIMER_IRQ_CONNECT(idx, func) \ + IF_ENABLED(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ + UARTE_HAS_PROP(idx, timer)), \ + (UARTE_COUNT_BYTES_WITH_TIMER_VALIDATE_CONFIG(idx); \ + IRQ_CONNECT(UARTE_TIMER_IRQN(idx), UARTE_TIMER_IRQ_PRIO(idx), func, \ + DEVICE_DT_GET(UARTE(idx)), 0); \ + irq_enable(UARTE_TIMER_IRQN(idx));)) + +/* Macro sets flag to indicate that uart use different interrupt priority than the system clock. */ +#define UARTE_HAS_VAR_PRIO(idx) \ + COND_CODE_1(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ + UARTE_HAS_PROP(idx, timer)), \ + ((DT_IRQ(UARTE(idx), priority) != DT_IRQ(DT_NODELABEL(grtc), priority)) ? \ + UARTE_CFG_FLAG_VAR_IRQ : 0), (0)) + #define UARTE_GET_ISR(idx) \ COND_CODE_1(CONFIG_UART_##idx##_ASYNC, (uarte_nrfx_isr_async), (uarte_nrfx_isr_int)) @@ -2624,16 +3461,18 @@ static int uarte_instance_deinit(const struct device *dev) )) /* Depending on configuration standard or direct IRQ is connected. */ -#define UARTE_IRQ_CONNECT(idx, irqn, prio) \ - COND_CODE_1(CONFIG_UART_NRFX_UARTE_NO_IRQ, (), \ - (COND_CODE_1(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, \ - (IRQ_DIRECT_CONNECT(irqn, prio, uarte_##idx##_direct_isr, 0)), \ - (IRQ_CONNECT(irqn, prio, UARTE_GET_ISR(idx), DEVICE_DT_GET(UARTE(idx)), 0))))) +#define UARTE_IRQ_CONNECT(idx, irqn, prio) \ + COND_CODE_1(CONFIG_UART_NRFX_UARTE_NO_IRQ, (), \ + (COND_CODE_1(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, \ + (IRQ_DIRECT_CONNECT(irqn, prio, uarte_##idx##_direct_isr, 0)), \ + (IRQ_CONNECT(irqn, prio, UARTE_GET_ISR(idx), \ + DEVICE_DT_GET(UARTE(idx)), 0))))) #define UARTE_IRQ_CONFIGURE(idx) \ do { \ UARTE_IRQ_CONNECT(idx, DT_IRQN(UARTE(idx)), DT_IRQ(UARTE(idx), priority)); \ irq_enable(DT_IRQN(UARTE(idx))); \ + UARTE_TIMER_IRQ_CONNECT(idx, timer_isr) \ } while (false) /* Low power mode is used when disable_rx is not defined or in async mode if @@ -2740,6 +3579,12 @@ static int uarte_instance_deinit(const struct device *dev) UARTE_INT_DRIVEN(idx); \ PINCTRL_DT_DEFINE(UARTE(idx)); \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, ( \ + IF_ENABLED(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ + UARTE_HAS_PROP(idx, timer)), \ + (static uint8_t uart##idx##_bounce_buf[CONFIG_UART_NRFX_UARTE_BOUNCE_BUF_LEN] \ + DMM_MEMORY_SECTION(UARTE(idx)); \ + static struct uarte_async_rx_cbwt uart##idx##_bounce_data; \ + )) \ static uint8_t \ uarte##idx##_tx_cache[CONFIG_UART_ASYNC_TX_CACHE_SIZE] \ DMM_MEMORY_SECTION(UARTE(idx)); \ @@ -2781,6 +3626,10 @@ static int uarte_instance_deinit(const struct device *dev) (IS_ENABLED(CONFIG_UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND) && \ INSTANCE_IS_HIGH_SPEED(_, /*empty*/, idx, _) ? \ UARTE_CFG_FLAG_SPURIOUS_RXTO : 0) | \ + ((IS_ENABLED(UARTE_BAUDRATE_RETENTION_WORKAROUND) && \ + UARTE_IS_CACHEABLE(idx)) ? \ + UARTE_CFG_FLAG_VOLATILE_BAUDRATE : 0) | \ + UARTE_HAS_VAR_PRIO(idx) | \ USE_LOW_POWER(idx), \ UARTE_DISABLE_RX_INIT(UARTE(idx)), \ .poll_out_byte = &uarte##idx##_poll_out_byte, \ @@ -2788,6 +3637,8 @@ static int uarte_instance_deinit(const struct device *dev) IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ (.tx_cache = uarte##idx##_tx_cache, \ .rx_flush_buf = uarte##idx##_flush_buf,)) \ + IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ + (UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx))) \ IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ (.timer = NRFX_TIMER_INSTANCE( \ CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ @@ -2840,5 +3691,4 @@ static int uarte_instance_deinit(const struct device *dev) #define COND_UART_NRF_UARTE_DEVICE(unused, prefix, i, _) \ IF_ENABLED(CONFIG_HAS_HW_NRF_UARTE##prefix##i, (UART_NRF_UARTE_DEVICE(prefix##i);)) - UARTE_FOR_EACH_INSTANCE(COND_UART_NRF_UARTE_DEVICE, (), ()) From c7eb6edd3fcb12a369c90b9df922dfcae3f3db9a Mon Sep 17 00:00:00 2001 From: Triveni Danda Date: Tue, 29 Jul 2025 15:10:10 +0530 Subject: [PATCH 760/881] [nrf fromlist] soc: nordic: nrf54h: Add DT_NODE_EXISTS check Add `DT_NODE_EXISTS` check to ensure cpurad partition nodes exist before referencing their addresses. This prevents build errors when these partitions are not defined in the devicetree. Upstream PR #: 93815 Signed-off-by: Triveni Danda (cherry picked from commit 1b785f57b67170f8c163fa617783a91013ce9b1f) --- soc/nordic/nrf54h/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 01cacf48f62..fb1c3f426d3 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -216,7 +216,7 @@ void soc_late_init_hook(void) DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + CONFIG_ROM_START_OFFSET); } -#else +#elif DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot0_partition)) radiocore_address = (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) + DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + From 84402c1d95c3556481040613973dbe7849b8fe07 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 26 Jan 2021 15:43:08 +0100 Subject: [PATCH 761/881] [nrf noup] ci: set `ZEPHYR__KCONFIG` for NCS modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit sets `ZEPHYR__KCONFIG` variable for each Kconfig file discovered in `nrf/modules//Kconfig`. This is not meant as a permanent solution; we should do more careful consideration on the optimal approach forward that will allow compliance_check.py to be used downstream with custom module_ext_roots, and at the same time keep current flexibility for module glue code handling intact. Adds a static path for the NRF Kconfig variable in the check compliance script, this is a temporary workaround due to supporting an external root for NCS that should be reworked to use package helper in future Signed-off-by: Torsten Rasmussen Signed-off-by: Martí Bolívar Signed-off-by: Carles Cufi Signed-off-by: Jamie McCrae (cherry picked from commit 26572f95c09d9c063ad9dda85b6e6368f015ce94) --- scripts/ci/check_compliance.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index a600004aae7..4ef7c81cfd0 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -540,6 +540,13 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] + nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') + nrf_modules = [] + if os.path.exists(nrf_modules_dir): + nrf_modules = [name for name in os.listdir(nrf_modules_dir) if + os.path.exists(os.path.join(nrf_modules_dir, name, + 'Kconfig'))] + with open(modules_file, 'r') as fp_module_file: content = fp_module_file.read() @@ -549,8 +556,31 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se re.sub('[^a-zA-Z0-9]', '_', module).upper(), modules_dir / module / 'Kconfig' )) + for module in nrf_modules: + fp_module_file.write("ZEPHYR_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + nrf_modules_dir / module / 'Kconfig' + )) + fp_module_file.write("NCS_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + modules_dir / module / 'Kconfig' + )) + # Add NRF as static entry as workaround for ext Kconfig root support + fp_module_file.write("ZEPHYR_NRF_KCONFIG = {}\n".format( + nrf_modules_dir / '..' / 'Kconfig.nrf' + )) fp_module_file.write(content) + with open(sysbuild_modules_file, 'r') as fp_sysbuild_module_file: + content = fp_sysbuild_module_file.read() + + with open(sysbuild_modules_file, 'w') as fp_sysbuild_module_file: + # Add NRF as static entry as workaround for ext Kconfig root support + fp_sysbuild_module_file.write("SYSBUILD_NRF_KCONFIG = {}\n".format( + nrf_modules_dir / '..' / 'sysbuild' / 'Kconfig.sysbuild' + )) + fp_sysbuild_module_file.write(content) + def get_kconfig_dts(self, kconfig_dts_file, settings_file): """ Generate the Kconfig.dts using dts/bindings as the source. From 3a68c28e29487d7ee1cdd658470b3e32ebdf1771 Mon Sep 17 00:00:00 2001 From: Piotr Golyzniak Date: Mon, 1 Aug 2022 13:06:01 +0200 Subject: [PATCH 762/881] [nrf noup] ci: scripts: add quarantine file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add scripts/quarantine.yaml file, which will be used in CI. Signed-off-by: Piotr Golyzniak Signed-off-by: Andrzej Głąbek Signed-off-by: Maciej Perkowski Signed-off-by: Robert Lubos (cherry picked from commit 88c7330e9305bcb19c46cb7f4d03db556753bab1) --- scripts/quarantine.yaml | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 scripts/quarantine.yaml diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml new file mode 100644 index 00000000000..20c4f9248ea --- /dev/null +++ b/scripts/quarantine.yaml @@ -0,0 +1,88 @@ +# The configurations resulting as a product of scenarios and platforms +# will be skipped if quarantine is used. More details here: +# https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine + +- scenarios: + - testing.ztest.busy_sim + - testing.ztest.busy_sim_nrf52840dk_pin + platforms: + - nrf52840dk_nrf52840 + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.unary_f64 + platforms: + - nrf5340dk_nrf5340_cpunet + - qemu_cortex_m3 + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_f16 + - libraries.cmsis_dsp.matrix.binary_f16.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_q15 + - libraries.cmsis_dsp.matrix.binary_q15.fpu + - libraries.cmsis_dsp.matrix.unary_f32 + - libraries.cmsis_dsp.matrix.unary_f32.fpu + - libraries.cmsis_dsp.matrix.unary_f64 + - libraries.cmsis_dsp.matrix.unary_f64.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Flash overflows" + +# libsdl2-dev package should be added into docker image +- scenarios: + - sample.boards.nrf.nrf_led_matrix + - sample.display.lvgl.gui + platforms: + - native_posix + comment: "libsdl2-dev package not available" + +- scenarios: + - sample.net.sockets.echo_server.usbnet + - sample.net.sockets.echo_server.usbnet_composite + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - sample.net.zperf.netusb_ecm + - sample.net.zperf.netusb_eem + - sample.net.zperf.netusb_rndis + platforms: + - nrf52833dk_nrf52833 + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - net.mqtt.tls + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - kernel.common.picolibc + - libraries.picolibc + - libraries.libc.picolibc.mem_alloc + - libraries.picolibc.sprintf_new + platforms: + - nrf52dk_nrf52832 + comment: "Ram overflows, also in the upstream" + +- scenarios: + - sample.psa_crypto + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Due to using sdk-zephyr manifest instead of nrf. Should be fixed after the change" From 5f7e4813f1683467e701489da981aec8c50b941b Mon Sep 17 00:00:00 2001 From: Sebastian Wezel Date: Tue, 15 Mar 2022 13:12:25 +0100 Subject: [PATCH 763/881] [nrf noup] ci: add .github/test-spec.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file is used for NCS-specific testing configuration based on modifications to files in this repository. Signed-off-by: Alperen Sener Signed-off-by: Elisabeth Solheim Klakken Signed-off-by: Mariusz Poslinski Signed-off-by: Markus Swarowsky Signed-off-by: Robert Lubos Signed-off-by: Sebastian Wezel Signed-off-by: Tomasz Tyzenhauz Signed-off-by: Fredrik Ås Signed-off-by: Michał Szablowski Signed-off-by: Tony Le Signed-off-by: Krishna T Signed-off-by: Dawid Przybylo Signed-off-by: Rubin Gerritsen Signed-off-by: Jørgen Kvalvaag Signed-off-by: Magne Værnes Signed-off-by: Lang Xie Signed-off-by: Alexander Svensen Signed-off-by: Jan Gałda Signed-off-by: Vladislav Litvinov Signed-off-by: Guojun Wang Signed-off-by: Piotr Kosycarz Signed-off-by: Thomas Stilwell Signed-off-by: Krzysztof Szromek Signed-off-by: Grzegorz Chwierut Signed-off-by: Eduardo Montoya Signed-off-by: Pavel Vasilyev (cherry picked from commit fc65d19b1f987439ab158c74e32f2085060baf09) --- .github/test-spec.yml | 392 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 .github/test-spec.yml diff --git a/.github/test-spec.yml b/.github/test-spec.yml new file mode 100644 index 00000000000..6da6bdbaa87 --- /dev/null +++ b/.github/test-spec.yml @@ -0,0 +1,392 @@ +# This is the Jenkins ci variant of the .github/labler.yaml + +"CI-run-zephyr-twister": + - any: + - "!.github/**/*" + - "!doc/**/*" + - "!CODEOWNERS" + - "!LICENSE" + - "!**/*.rst" + - "!VERSION" + - "!submanifests/**/*" + - "!MAINTAINERS.yml" + - "!version.h.in" + - "!Jenkinsfile" + - "!**/*.md" + +"CI-iot-zephyr-lwm2m-test": + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "subsys/dfu/boot/**/*" + - "subsys/net/ip/**/*" + - "subsys/net/lib/http/**/*" + - "subsys/net/lib/lwm2m//**/*" + - "subsys/net/**/*" + +"CI-iot-samples-test": + - "boards/nordic/nrf9160dk/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/**/*" + - "subsys/net/lib/**/*" + +"CI-iot-libraries-test": + - "boards/nordic/nrf9160dk/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/socket_ncs.h" + - "subsys/testsuite/ztest/**/*" + +"CI-lwm2m-test": null +# Not necessary to run tests on changes to this repo. + +"CI-boot-test": + - "subsys/mgmt/mcumgr/**/*" + - "subsys/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/dfu/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "tests/boot/**/*" + - "tests/subsys/dfu/**/*" + - "tests/subsys/mgmt/mcumgr/**/*" + +"CI-tfm-test": + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf9160dk/**/*" + - "drivers/entropy/*" + - "dts/arm/nordic/nrf5340*" + - "dts/arm/nordic/nrf9160*" + - "modules/trusted-firmware-m/**/*" + - "samples/tfm_integration/**/*" + +"CI-ble-test": + - any: + - "drivers/bluetooth/**/*" + - any: + - "dts/arm/nordic/nrf5*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + - any: + - "include/zephyr/bluetooth/**/*" + - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/hci_ipc/**/*" + +"CI-ble-samples-test": + - any: + - "drivers/bluetooth/**/*" + - any: + - "dts/arm/nordic/nrf5*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + - any: + - "include/zephyr/bluetooth/**/*" + - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/**/*" + +"CI-mesh-test": + - "subsys/bluetooth/mesh/**/*" + - "include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh_demo/**/*" + - "samples/bluetooth/mesh_provisioner/**/*" + - "tests/bluetooth/mesh/**/*" + - "tests/bluetooth/mesh_shell/**/*" + +"CI-thingy91-test": + - "boards/nordic/nrf9160dk/**/*" + - "arch/x86/core/**/*" + - "arch/x86/include/**/*" + - "drivers/console/**/*" + - "drivers/ethernet/**/*" + - "drivers/flash/**/*" + - "drivers/hwinfo/**/*" + - "drivers/interrupt_controller/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/timer/**/*" + - "include/**/*" + - "kernel/**/*" + - "lib/libc/common/source/stdlib/**/*" + - "lib/libc/newlib/**/*" + - "lib/libc/picolibc/**/*" + - "lib/os/**/*" + - "lib/posix/**/*" + - "misc/**/*" + - "modules/mbedtls/**/*" + - "soc/x86/ia32/**/*" + - "subsys/fs/fcb/**/*" + - "subsys/logging/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/include/**/*" + - "subsys/settings/src/**/*" + - "subsys/stats/**/*" + - "subsys/storage/flash_map/**/*" + - "subsys/storage/stream/**/*" + - "subsys/tracing/**/*" + +"CI-desktop-test": + - "drivers/bluetooth/*" + - "subsys/bluetooth/*" + - "include/zephyr/bluetooth/*" + +"CI-crypto-test": + - "boards/nordic/nrf52840dk/**/*" + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf9160dk/**/*" + - "drivers/entropy/*" + - "drivers/serial/**/*" + - "dts/arm/nordic/nrf52840*" + - "dts/arm/nordic/nrf5340*" + - "dts/arm/nordic/nrf9160*" + - "include/drivers/serial/**/*" + - "modules/mbedtls/**/*" + +"CI-fem-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "dts/bindings/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/arch/**/*" + - "lib/libc/**/*" + - "lib/open-amp/**/*" + - "modules/hal_nordic/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "modules/trusted-firmware-m/**/*" + - "samples/net/sockets/echo_*/**/*" + - "share/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + - "subsys/bluetooth/shell/**/*" + - "subsys/ipc/**/*" + - "Kconfig" + - "CMakeLists.txt" + +"CI-rs-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "dts/bindings/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/arch/**/*" + - "lib/libc/**/*" + - "lib/open-amp/**/*" + - "modules/hal_nordic/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "modules/trusted-firmware-m/**/*" + - "samples/net/sockets/echo_*/**/*" + - "share/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + - "subsys/bluetooth/shell/**/*" + - "subsys/ipc/**/*" + - "Kconfig" + - "CMakeLists.txt" + +"CI-thread-test": + - "include/zephyr/net/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "samples/net/openthread/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-nfc-test": + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "drivers/flash/**/*" + - "drivers/mbox/**/*" + - "drivers/spi/**/*" + - "lib/crc/**/*" + - "modules/hal_nordic/**/*" + - "soc/nordic/**/*" + - "subsys/ipc/ipc_service/**/*" + - "subsys/fs/**/*" + - "subsys/mem_mgmt/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/**/*" + - "subsys/shell/**/*" + - "subsys/storage/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-matter-test": + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/settings/**/*" + - "subsys/net/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "drivers/net/**/*" + - "samples/bluetooth/hci_ipc/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + +"CI-find-my-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/**/*" + - "drivers/entropy/**/*" + - "drivers/flash/**/*" + - "drivers/usb/**/*" + - "drivers/regulator/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/fs/**/*" + - "subsys/ipc/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/**/*" + - "subsys/storage/**/*" + - "subsys/tracing/**/*" + - "subsys/usb/device/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-rpc-test": + - "subsys/ipc/ipc_service/**/*" + - "subsys/random/**/*" + - "soc/nordic/nrf53/**/*" + +"CI-modemshell-test": + - "include/net/**/*" + - "include/posix/**/*" + - "include/shell/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "subsys/shell/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-positioning-test": + - "include/net/**/*" + - "include/posix/**/*" + - "drivers/net/**/*" + - "drivers/wifi/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-cloud-test": + - "include/zephyr/dfu/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/posix/**/*" + - "include/zephyr/settings/**/*" + - "drivers/led/**/*" + - "drivers/net/**/*" + - "drivers/sensor/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "lib/posix/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-wifi": + - "subsys/net/l2/wifi/**/*" + - "subsys/net/l2/ethernet/**/*" + +"CI-audio-test": + - "boards/nordic/nrf5340_audio_dk/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/gpio/**/*" + - "drivers/i2c/**/*" + - "drivers/watchdog/**/*" + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/bluetooth/hci_ipc/**/*" + - "soc/nordic/**/*" + - "subsys/bluetooth/audio/**/*" + - "subsys/bluetooth/host/**/*" + - "subsys/dfu/**/*" + - "subsys/fs/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "subsys/sd/**/*" + - "subsys/storage/**/*" + - "subsys/task_wdt/**/*" + - "subsys/usb/**/*" + - "subsys/zbus/**/*" + +"CI-pmic-samples-test": + - "samples/shields/npm1300_ek/**/*" + - "boards/shields/npm1300_ek/**/*" + - "**/**npm1300**/**" + - "drivers/regulator/regulator_common.c" + - "drivers/regulator/regulator_shell.c" + - "drivers/gpio/gpio_shell.c" + - "drivers/sensor/sensor_shell.c" + +"CI-test-low-level": + - "arch/**/*" + - "boards/nordic/nrf54*/**/*" + - "drivers/**/*" + - "dts/**/*" + - "include/zephyr/**/*" + - "kernel/**/*" + - "modules/hal_nordic/**/*" + - "samples/basic/blinky_pwm/**/*" + - "samples/basic/fade_led/**/*" + - "samples/boards/nrf/**/*" + - "samples/boards/nordic/**/*" + - "samples/drivers/adc/**/*" + - "samples/drivers/jesd216/**/*" + - "samples/drivers/mbox/**/*" + - "samples/drivers/soc_flash_nrf/**/*" + - "samples/drivers/spi_flash/**/*" + - "samples/drivers/watchdog/**/*" + - "samples/hello_world/**/*" + - "samples/sensor/**/*" + - "samples/subsys/ipc/**/*" + - "samples/subsys/logging/**/*" + - "samples/subsys/settings/**/*" + - "samples/subsys/usb/cdc_acm/**/*" + - "samples/subsys/usb/mass/**/*" + - "samples/synchronization/**/*" + - "subsys/logging/**/*" + - "subsys/settings/**/*" + - "tests/arch/**/*" + - "tests/boards/nrf/**/*" + - "tests/boards/nordic/**/*" + - "tests/drivers/**/*" + - "tests/kernel/**/*" + +"CI-suit-dfu-test": + - "subsys/mgmt/mcumgr/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "subsys/bluetooth/**/*" + - "drivers/bluetooth/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/console/**/*" + - "drivers/gpio/**/*" + - "dts/common/nordic/*" + - "dts/arm/nordic/nrf54h*/**/*" + - "dts/riscv/nordic/nrf54h*/**/*" + - "boards/nordic/nrf54h*/**/*" + - "soc/nordic/nrf54h/**/*" + - "include/zephyr/**/*" + - "subsys/logging/**/*" + - "subsys/tracing/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/nrfutil.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" From 8d06771b280e78e0d27c840c64ae6a02b67acf4e Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 1 Jun 2023 15:58:56 +0200 Subject: [PATCH 764/881] [nrf noup] tests: drivers: build_all: regulator: use old schema New Twister schema is not supported yet in sdk-zephyr, drop this patch once Twister is updated. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit e6f28400604c1307aa5768438749b9686e891947) --- tests/drivers/build_all/regulator/testcase.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/drivers/build_all/regulator/testcase.yaml b/tests/drivers/build_all/regulator/testcase.yaml index 30d494aca23..b662f0ac205 100644 --- a/tests/drivers/build_all/regulator/testcase.yaml +++ b/tests/drivers/build_all/regulator/testcase.yaml @@ -3,9 +3,7 @@ tests: drivers.regulator.build: - tags: - - drivers - - regulator + tags: drivers regulator build_only: true platform_allow: - native_sim From ad676097058e7c1932a70bc6c47bc0d4c66ec565 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 19 Jun 2023 12:19:05 +0200 Subject: [PATCH 765/881] [nrf noup] Revert "twister: Use natural sort when generating hardware map" This reverts commit c37deeb0c4602dc3eeb700a7dc3ed317283fff17. This is only a temporary change, until we align our CI. To be removed once natsort is avaialble in the NCS CI. Signed-off-by: Robert Lubos (cherry picked from commit 0250cd1c9fb33c0d9b5da883b24bdfdb7df522c2) --- scripts/pylib/twister/twisterlib/hardwaremap.py | 2 +- scripts/requirements-run-test.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 74c384ab5d6..6deca0ac4ad 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -386,7 +386,7 @@ def save(self, hwm_file): boot_ids = [] # use existing map - self.detected = natsorted(self.detected, key=lambda x: x.serial or '') + self.detected.sort(key=lambda x: x.serial or '') if os.path.exists(hwm_file): with open(hwm_file) as yaml_file: hwm = yaml.load(yaml_file, Loader=SafeLoader) diff --git a/scripts/requirements-run-test.txt b/scripts/requirements-run-test.txt index 6c3f3d93cf8..4faa17b7b65 100644 --- a/scripts/requirements-run-test.txt +++ b/scripts/requirements-run-test.txt @@ -7,7 +7,6 @@ pyocd>=0.35.0 # used by twister for board/hardware map tabulate -natsort # used by mcuboot cbor>=1.0.0 From 48e4ce366a6545aeb51544749550cfb6f5b549cd Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 3 Mar 2022 15:28:16 +0100 Subject: [PATCH 766/881] [nrf noup] doc: remove Kconfig search Kconfig search is handled in a separate docset in NCS, so remove the page. This is a long-term noup patch. Signed-off-by: Gerard Marull-Paretas Signed-off-by: Krishna T (cherry picked from commit 68cba0c8e64da160f49c2296ef956fe1512369d9) --- MAINTAINERS.yml | 1 - doc/build/kconfig/setting.rst | 6 ++---- doc/develop/application/index.rst | 5 ++--- doc/kconfig.rst | 8 -------- 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 doc/kconfig.rst diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 0160330ac59..aa0718740df 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1147,7 +1147,6 @@ Documentation: - doc/images/Zephyr-Kite-in-tree.png - doc/index-tex.rst - doc/index.rst - - doc/kconfig.rst - doc/templates/sample.tmpl - doc/templates/board.tmpl - boards/index.rst diff --git a/doc/build/kconfig/setting.rst b/doc/build/kconfig/setting.rst index ad62d86eb3d..6fe1feaed7d 100644 --- a/doc/build/kconfig/setting.rst +++ b/doc/build/kconfig/setting.rst @@ -7,8 +7,7 @@ The :ref:`menuconfig and guiconfig interfaces ` can be used to test out configurations during application development. This page explains how to make settings permanent. -All Kconfig options can be searched in the :ref:`Kconfig search page -`. +All Kconfig options can be searched in the Kconfig search page. .. note:: @@ -115,8 +114,7 @@ Assignments in configuration files are only respected if the dependencies for the symbol are satisfied. A warning is printed otherwise. To figure out what the dependencies of a symbol are, use one of the :ref:`interactive configuration interfaces ` (you can jump directly to a symbol with -:kbd:`/`), or look up the symbol in the :ref:`Kconfig search page -`. +:kbd:`/`), or look up the symbol in the Kconfig search page. .. _initial-conf: diff --git a/doc/develop/application/index.rst b/doc/develop/application/index.rst index c28fa011f3c..4f8b5f868a5 100644 --- a/doc/develop/application/index.rst +++ b/doc/develop/application/index.rst @@ -649,9 +649,8 @@ started. See :ref:`setting_configuration_values` for detailed documentation on setting Kconfig configuration values. The :ref:`initial-conf` section on the same page -explains how the initial configuration is derived. See :ref:`kconfig-search` -for a complete list of configuration options. -See :ref:`hardening` for security information related with Kconfig options. +explains how the initial configuration is derived. See :ref:`hardening` for +security information related with Kconfig options. The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration diff --git a/doc/kconfig.rst b/doc/kconfig.rst deleted file mode 100644 index 1123de2adbd..00000000000 --- a/doc/kconfig.rst +++ /dev/null @@ -1,8 +0,0 @@ -:orphan: - -.. _kconfig-search: - -Kconfig Search -============== - -.. kconfig:search:: From ee3b25f7358af9c71d37449c7990f890269389ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 13 Jan 2022 11:37:18 +0100 Subject: [PATCH 767/881] [nrf noup] modules: tf-m: use of PSA_HAS_XXXX_SUPPORT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This allows configurations enabled by PSA_WANTS_ALG_XXXX to be used to control which TF-M module is enabled -If the TF-M image doesn't support e.g. the MAC APIs, then the MAC interface is not enabled Note: This functionality requires that nrf_security is enabled ref: NCSDK-11689 Make TF-M crypto module depend on PSA_WANT_GENERATE_RANDOM, same as all other crypto modules, which have PSA_HAS to group all PSA features that require the module. This makes TF-M by default exclude the RNG module when not needed. Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Joakim Andersson (cherry picked from commit 5620a796e91d9e65c6a02d7585ca8909eb674c77) --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 1d70a2c44d2..02d3580c22f 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -10,6 +10,7 @@ if TFM_PARTITION_CRYPTO config TFM_CRYPTO_RNG_MODULE_ENABLED bool "Random number generator crypto module" default y + depends on PSA_WANT_GENERATE_RANDOM && NRF_SECURITY help Enables the random number generator module within the crypto partition. Unset this option if 'psa_generate_random' is not used. @@ -17,6 +18,7 @@ config TFM_CRYPTO_RNG_MODULE_ENABLED config TFM_CRYPTO_KEY_MODULE_ENABLED bool "KEY crypto module" default y + depends on PSA_HAS_KEY_SUPPORT && NRF_SECURITY help Enables the KEY crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_management.c' @@ -25,6 +27,7 @@ config TFM_CRYPTO_KEY_MODULE_ENABLED config TFM_CRYPTO_AEAD_MODULE_ENABLED bool "AEAD crypto module" default y + depends on PSA_HAS_AEAD_SUPPORT && NRF_SECURITY help Enables the AEAD crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_aead.c' @@ -33,6 +36,7 @@ config TFM_CRYPTO_AEAD_MODULE_ENABLED config TFM_CRYPTO_MAC_MODULE_ENABLED bool "MAC crypto module" default y + depends on PSA_HAS_MAC_SUPPORT && NRF_SECURITY help Enables the MAC crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_mac.c' @@ -41,6 +45,7 @@ config TFM_CRYPTO_MAC_MODULE_ENABLED config TFM_CRYPTO_HASH_MODULE_ENABLED bool "HASH crypto module" default y + depends on PSA_HAS_HASH_SUPPORT && NRF_SECURITY help Enables the HASH crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_hash.c' @@ -49,6 +54,7 @@ config TFM_CRYPTO_HASH_MODULE_ENABLED config TFM_CRYPTO_CIPHER_MODULE_ENABLED bool "CIPHER crypto module" default y + depends on PSA_HAS_CIPHER_SUPPORT && NRF_SECURITY help Enables the CIPHER crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_cipher.c' @@ -57,6 +63,7 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED bool "ASYM ENCRYPT crypto module" default y + depends on PSA_HAS_ASYM_ENCRYPT_SUPPORT && NRF_SECURITY help Enables the ASYM ENCRYPT crypto module within the crypto partition. Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' @@ -65,6 +72,7 @@ config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED bool "ASYM SIGN crypto module" default y + depends on PSA_HAS_ASYM_SIGN_SUPPORT && NRF_SECURITY help Enables the ASYM SIGN crypto module within the crypto partition. Unset this option if the sign functionality provided by 'crypto_asymmetric.c' @@ -73,10 +81,12 @@ config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED bool "KEY DERIVATION crypto module" default y + depends on (PSA_HAS_KEY_DERIVATION || PSA_HAS_KEY_AGREEMENT) && NRF_SECURITY help Enables the KEY_DERIVATION crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_derivation.c' is not used. + Note that key agreement is under key derivation in the current implementation. endif # TFM_PARTITION_CRYPTO From 0b493c73d81a8b6d688524e09a874ea4c1b8ae94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Sat, 29 Jan 2022 13:03:08 +0100 Subject: [PATCH 768/881] [nrf noup] modules: mbedtls: Allow MBEDTLS_BUILTIN to be deselected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Out-of-tree crypto subsystems need to deselect MBEDTLS_BUILTIN, but deselection is not supported. It is however supported to select a dependency in a ! expression. Signed-off-by: Sebastian Bøe (cherry picked from commit 0556e7f7d3e2e046bb334ef2133c071179caf189) --- modules/mbedtls/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index bf165473f17..f7bc6a609f1 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -29,6 +29,7 @@ choice MBEDTLS_IMPLEMENTATION config MBEDTLS_BUILTIN bool "Use Zephyr in-tree mbedTLS version" + depends on ! DISABLE_MBEDTLS_BUILTIN help Link with mbedTLS sources included with Zephyr distribution. Included mbedTLS version is well integrated with and supported @@ -42,6 +43,11 @@ config MBEDTLS_LIBRARY endchoice +# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select +# DISABLE_MBEDTLS_BUILTIN. +config DISABLE_MBEDTLS_BUILTIN + bool + config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" help From f82ebedbb13a0776e822dcbfcd1be96958563dfd Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Mon, 12 Feb 2024 14:30:23 +0100 Subject: [PATCH 769/881] [nrf noup] modules: mbedtls: Add include folders We moved the header files in sdk-mbedtls from the library folder to the include/library folder. This was done to avoid issues when building MbedTLS with the nrf_security module and the Oberon PSA core. The Oberon PSA core provides a subset of these header files and since they are included with quotes we cannot have them in the same directory. This change make the needed adaptions in CMake for the applications that don't use nrf_security. Signed-off-by: Georgios Vasilakis Signed-off-by: Markus Swarowsky (cherry picked from commit a3505ca86f9f4bb9a1d33116259bb2d7e08196db) --- modules/mbedtls/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index 83a8cb674a5..7e16f0de251 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -40,6 +40,8 @@ zephyr_interface_library_named(mbedTLS) # Add regular includes target_include_directories(mbedTLS INTERFACE ${ZEPHYR_CURRENT_MODULE_DIR}/include + ${ZEPHYR_CURRENT_MODULE_DIR}/include/library + ${ZEPHYR_CURRENT_MODULE_DIR}/library configs include ) From 5091ee8046fbe3020f7e01125ba0778de7a777e5 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 13 Jul 2023 13:42:10 +0000 Subject: [PATCH 770/881] [nrf noup] drivers/flashdisk: Add support for Partition Manager The commits adds support for generating flash disks from Partition Manager defined partitions. Signed-off-by: Dominik Ermel (cherry picked from commit a01de066f17e286537b4979a04ca69c286806bc9) --- drivers/disk/flashdisk.c | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index 1ac3d15ba62..4d8e3f1eee0 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -469,6 +469,8 @@ static const struct disk_operations flash_disk_ops = { .ioctl = disk_flash_access_ioctl, }; +#ifndef USE_PARTITION_MANAGER +/* The non-Partition manager, DTS based generators below */ #define DT_DRV_COMPAT zephyr_flash_disk #define PARTITION_PHANDLE(n) DT_PHANDLE_BY_IDX(DT_DRV_INST(n), partition, 0) @@ -510,6 +512,82 @@ DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) "Devicetree node " DT_NODE_PATH(DT_DRV_INST(n)) \ " has cache size which is not a multiple of its sector size"); DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) +#else /* ifndef USE_PARTITION_MANAGER */ +/* Partition Manager based generators below */ + +/* Gets the PM_..._EXTRA_PARAM_##param value */ +#define PM_FLASH_DISK_ENTRY_EXTRA_PARAM(name, param) PM_##name##_EXTRA_PARAM_disk_##param + +/* Gets the PM_..._NAME value which is originally cased, as in yaml, partition name */ +#define PM_FLASH_DISK_ENTRY_PARTITION_NAME(name) PM_##name##_NAME + +/* Generates flashdiskN_cache variable name, where N is partition ID */ +#define PM_FLASH_DISK_CACHE_VARIABLE(n) UTIL_CAT(flashdisk, UTIL_CAT(FIXED_PARTITION_ID(n), _cache)) + +/* Generate cache buffers */ +#define CACHE_SIZE(n) (COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), (0), (1)) * \ + PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size)) +#define DEFINE_FLASHDISKS_CACHE(n) \ + static uint8_t __aligned(4) PM_FLASH_DISK_CACHE_VARIABLE(n)[CACHE_SIZE(n)]; + +PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) + +/* Generated single Flash Disk device data from Partition Manager partition. + * Partition is required to have type set to disk in partition definitions: + * type: disk + * and following extra params can be provided: + * extra_params: { + * name = "", + * cache_size = , + * sector_size = , + * read_only = + * } + * where: + * is mandatory device name that will be used by Disk Access and FAT FS to mount device; + * is cache r/w cache size, which is mandatory if read_only = 0 or not present, + * and should be multiple of ; + * is mandatory device sector size information, usually should be erase page size, + * for flash devices, for example 4096 bytes; + * read_only is optional, if not present then assumed false; can be 0(false) or 1(true). + */ +#define DEFINE_FLASHDISKS_DEVICE(n) \ +{ \ + .info = { \ + .ops = &flash_disk_ops, \ + .name = STRINGIFY(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, name)), \ + }, \ + .area_id = FIXED_PARTITION_ID(n), \ + .offset = FIXED_PARTITION_OFFSET(n), \ + .cache = PM_FLASH_DISK_CACHE_VARIABLE(n), \ + .cache_size = sizeof(PM_FLASH_DISK_CACHE_VARIABLE(n)), \ + .size = FIXED_PARTITION_SIZE(n), \ + .sector_size = PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size), \ +}, + +/* The bellow used PM_FOREACH_TYPE_disk is generated by Partition Manager foreach + * loop macro. The lower case _disk is type name for which the macro has been generated; + * partition entry can have multiple types set and foreach macro will be generated + * for every type found across partition definitions. + */ +static struct flashdisk_data flash_disks[] = { + PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE) +}; + +#define VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY(n) \ + COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), \ + (/* cache-size is not used for read-only disks */), \ + (BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) != 0, \ + "Flash disk partition " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n))\ + " must have non-zero cache-size");)) +PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) + +#define VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE(n) \ + BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) % \ + PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size) == 0, \ + "Devicetree node " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n)) \ + " has cache size which is not a multiple of its sector size"); +PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) +#endif /* USE_PARTITION_MANAGER */ static int disk_flash_init(void) { From d67e24d482872faa3478c18dee61aa6da5cc7a98 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Fri, 5 May 2023 11:12:26 +0200 Subject: [PATCH 771/881] [nrf noup] mcumgr: img_mgmt: Fix check for chosen code partition The "zephyr-code-partition" chosen DTS node cannot be used when build uses Partition Manager. In that case, mcumgr must rely on the definitions provided by the Partition Manager. Jira: NCSDK-21381 Signed-off-by: Marek Pieta Signed-off-by: Dominik Ermel (cherry picked from commit 6b04ceee078c40901b3ddd15e821fde8333d5f5c) --- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c index 7abcac8afad..4c3975f3aad 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -43,6 +43,23 @@ #if !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) +#if USE_PARTITION_MANAGER +#include + +#ifdef PM_MCUBOOT_SECONDARY_PAD_SIZE +BUILD_ASSERT(PM_MCUBOOT_PAD_SIZE == PM_MCUBOOT_SECONDARY_PAD_SIZE); +#endif + +#if CONFIG_BUILD_WITH_TFM + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) +#else + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) +#endif + +#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + (FIXED_PARTITION_OFFSET(label) == (PM_ADDRESS - PM_ADDRESS_OFFSET)) + +#else /* ! USE_PARTITION_MANAGER */ #ifndef CONFIG_FLASH_LOAD_OFFSET #error MCUmgr requires application to be built with CONFIG_FLASH_LOAD_OFFSET set \ to be able to figure out application running slot. @@ -50,6 +67,7 @@ #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ (FIXED_PARTITION_OFFSET(label) == CONFIG_FLASH_LOAD_OFFSET) +#endif /* USE_PARTITION_MANAGER */ BUILD_ASSERT(sizeof(struct image_header) == IMAGE_HEADER_SIZE, "struct image_header not required size"); From 0207484c12e49e7616fc4e33b034804b5dbd32b3 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 23 Jun 2022 14:10:01 +0000 Subject: [PATCH 772/881] [nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit adds bootutil hook, for nrf5340, to allow it handling the non-accessible image-1/primary slot. Signed-off-by: Andrzej Głąbek Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Johann Fischer Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit c82b5f3d3859c3aa32c1157bd4225a2186a47856) --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 +++++ subsys/mgmt/mcumgr/Kconfig | 1 + .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 35 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 39d4a4ca8ce..ad088eca067 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -16,3 +16,11 @@ add_subdirectory(transport) add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) + +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 49bd17f4669..1c6a3a2a516 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,6 +6,7 @@ menuconfig MCUMGR bool "mcumgr Support" depends on NET_BUF depends on ZCBOR + imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c new file mode 100644 index 00000000000..f1ac8a168e6 --- /dev/null +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "bootutil/bootutil_public.h" + +#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 +/* Sysbuild */ +#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER +#else +/* Legacy child/parent */ +#define NET_CORE_IMAGE 1 +#endif + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) +{ + if (image_index == NET_CORE_IMAGE) { + /* Pretend that primary slot of image 1 unpopulated */ + state->magic = BOOT_MAGIC_UNSET; + state->swap_type = BOOT_SWAP_TYPE_NONE; + state->image_num = image_index; + state->copy_done = BOOT_FLAG_UNSET; + state->image_ok = BOOT_FLAG_UNSET; + + /* Prevent bootutil from trying to obtain true info */ + return 0; + } + + return BOOT_HOOK_REGULAR; +} From 204695e1f40900bb889797dd0232022b55a3fa08 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 16 Oct 2023 08:40:38 +0100 Subject: [PATCH 773/881] [nrf noup] samples: bluetooth: hci_pow_ctrl: Migrate child image config Migrates child image configuration for this sample over to sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit 757558096a07cc71ee4afc0f6aebe766bbb61d01) --- samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf new file mode 100644 index 00000000000..e6749ae6399 --- /dev/null +++ b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf @@ -0,0 +1 @@ +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From 428469c20909a8f988592d3f065a84056c2360a9 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 16 Oct 2023 08:41:27 +0100 Subject: [PATCH 774/881] [nrf noup] samples: mgmt: mcumgr smp_svr: Migrate child image config Migrates child image configuration for this sample over to sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit cda7620299116bde3df5639d50b9c1b9169ee1e3) --- .../subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf new file mode 100644 index 00000000000..98260877332 --- /dev/null +++ b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2022 Nordic Semiconductor +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_BT_MAX_CONN=2 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=502 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 From 81996aac7bd6acc3fb2b2b033900bded83f4bada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 1 Dec 2022 14:41:13 +0100 Subject: [PATCH 775/881] [nrf noup] samples&tests: Restore a few CONFIG_NEWLIB_LIBC_NANO=n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit 9dd570f8a2207a02c886480b0065cd5a0e3a2e94. Since in NCS, unlike in vanilla Zephyr, the nano variant of newlib is the default one, restore entries that disable the nano variant in one sample and one test that require the full newlib variant. This patch is supposed to be removed when picolibc becomes the default. Signed-off-by: Andrzej Głąbek Signed-off-by: Dominik Ermel (cherry picked from commit a6e6112a4c064a3d280153bc8644236153105c0e) --- tests/lib/newlib/heap_listener/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib/newlib/heap_listener/prj.conf b/tests/lib/newlib/heap_listener/prj.conf index e5a5dc6df4c..7282777ff1c 100644 --- a/tests/lib/newlib/heap_listener/prj.conf +++ b/tests/lib/newlib/heap_listener/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y +CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y From 74d986e55c318adbb13b2672e01239aee5db031f Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 15 Dec 2023 07:57:14 +0000 Subject: [PATCH 776/881] [nrf noup] samples/tests: Disable PM for some sysbuild builds Disables partition manager when building some samples and tests which use sysbuild to prevent build issues Signed-off-by: Jamie McCrae (cherry picked from commit d1cb7a90e291f4b336ff4729bc5fa7923f228df5) --- samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf | 1 + samples/drivers/mbox/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf | 1 + samples/subsys/logging/multidomain/sysbuild.conf | 1 + tests/boot/mcuboot_recovery_retention/sysbuild.conf | 1 + tests/boot/test_mcuboot/sysbuild.conf | 1 + tests/drivers/flash/common/sysbuild.conf | 1 + tests/drivers/flash/negative_tests/sysbuild.conf | 1 + tests/subsys/fs/fcb/sysbuild.conf | 1 + tests/subsys/fs/littlefs/sysbuild.conf | 1 + 12 files changed, 12 insertions(+) create mode 100644 samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf create mode 100644 samples/drivers/mbox/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf create mode 100644 samples/subsys/logging/multidomain/sysbuild.conf create mode 100644 tests/drivers/flash/common/sysbuild.conf create mode 100644 tests/drivers/flash/negative_tests/sysbuild.conf create mode 100644 tests/subsys/fs/fcb/sysbuild.conf create mode 100644 tests/subsys/fs/littlefs/sysbuild.conf diff --git a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/drivers/mbox/sysbuild.conf b/samples/drivers/mbox/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/samples/drivers/mbox/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/logging/multidomain/sysbuild.conf b/samples/subsys/logging/multidomain/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/samples/subsys/logging/multidomain/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/mcuboot_recovery_retention/sysbuild.conf b/tests/boot/mcuboot_recovery_retention/sysbuild.conf index 47f00ff3cff..3b5b3c96380 100644 --- a/tests/boot/mcuboot_recovery_retention/sysbuild.conf +++ b/tests/boot/mcuboot_recovery_retention/sysbuild.conf @@ -1 +1,2 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/test_mcuboot/sysbuild.conf b/tests/boot/test_mcuboot/sysbuild.conf index 47f00ff3cff..3b5b3c96380 100644 --- a/tests/boot/test_mcuboot/sysbuild.conf +++ b/tests/boot/test_mcuboot/sysbuild.conf @@ -1 +1,2 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/tests/drivers/flash/common/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/negative_tests/sysbuild.conf b/tests/drivers/flash/negative_tests/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/tests/drivers/flash/negative_tests/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/fcb/sysbuild.conf b/tests/subsys/fs/fcb/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/tests/subsys/fs/fcb/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/littlefs/sysbuild.conf b/tests/subsys/fs/littlefs/sysbuild.conf new file mode 100644 index 00000000000..6408669a847 --- /dev/null +++ b/tests/subsys/fs/littlefs/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n From e0b82ec041eecdc0423d53aa1300274632bdcbfd Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Thu, 29 Feb 2024 13:38:48 +0100 Subject: [PATCH 777/881] [nrf noup] modules: tfm: Add Kconfig for CRYPTO_PAKE_MODULE_ENABLED Add a Kconfig for th TFM_CRYPTO_PAKE_MODULE_ENABLED to support the PAKE APIs. noup as the PAKE support including the PAKE module doesn't exist yet in upstream TF-M as they depend on mbed TLS support for it Ref: NCSDK-22416 Signed-off-by: Markus Swarowsky (cherry picked from commit 821fa521c423a67c7ac013a36345241f7841e4a8) --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 02d3580c22f..9604319ca01 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -88,6 +88,17 @@ config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED is not used. Note that key agreement is under key derivation in the current implementation. +config TFM_CRYPTO_PAKE_MODULE_ENABLED + bool "PAKE crypto module" + default y + depends on PSA_HAS_PAKE_SUPPORT + depends on NRF_SECURITY + depends on PSA_CRYPTO_DRIVER_OBERON || PSA_CRYPTO_DRIVER_CRACEN + help + Enables the PAKE crypto module within the crypto partition. + Unset this option if the functionality provided by 'crypto_pake.c' + is not used. + endif # TFM_PARTITION_CRYPTO endif # BUILD_WITH_TFM From cd1d8bb15a5ce94660851ba419cace20361fe133 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 7 Feb 2023 12:39:12 +0100 Subject: [PATCH 778/881] [nrf noup] Bluetooth: Mesh: zero randomization for friend's adv Friend's replies on LPN's polls do not assume randomization in advertiser. Zero randomization will help to optimize time when LPN keeps receiving window open and save power. Signed-off-by: Aleksandr Khromykh Signed-off-by: Olivier Lesage (cherry picked from commit 71c24b8a084e7ae6290b678ce2e4418d75720a39) --- subsys/bluetooth/mesh/Kconfig | 2 +- subsys/bluetooth/mesh/adv_ext.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 2c03c4e9ea3..d39ea25616a 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1692,7 +1692,7 @@ config BT_MESH_LPN_INIT_POLL_TIMEOUT config BT_MESH_LPN_SCAN_LATENCY int "Latency for enabling scanning" range 0 50 - default 15 + default 2 help Latency in milliseconds that it takes to enable scanning. This is in practice how much time in advance before the Receive Window diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index b056f74a587..7caff2f91d2 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -13,6 +13,9 @@ #include #include #include +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#endif #include "common/bt_str.h" @@ -149,6 +152,28 @@ static inline struct bt_mesh_ext_adv *gatt_adv_get(void) } } +static int set_adv_randomness(uint8_t handle, int rand_us) +{ +#if defined(CONFIG_BT_LL_SOFTDEVICE) + struct net_buf *buf; + sdc_hci_cmd_vs_set_adv_randomness_t *cmd_params; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (!buf) { + LOG_ERR("Could not allocate command buffer"); + return -ENOMEM; + } + + cmd_params = net_buf_add(buf, sizeof(*cmd_params)); + cmd_params->adv_handle = handle; + cmd_params->rand_us = rand_us; + + return bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_SET_ADV_RANDOMNESS, buf, NULL); +#else + return 0; +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ +} + static int adv_start(struct bt_mesh_ext_adv *ext_adv, const struct bt_le_adv_param *param, struct bt_le_ext_adv_start_param *start, @@ -542,6 +567,13 @@ int bt_mesh_adv_enable(void) if (err) { return err; } + + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { + err = set_adv_randomness(adv->instance->handle, 0); + if (err) { + LOG_ERR("Failed to set zero randomness: %d", err); + } + } } return 0; From 67d3a55b921eb744ce365fe5a57cf71ef8d10c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Storr=C3=B8?= Date: Wed, 8 Mar 2023 12:17:09 +0100 Subject: [PATCH 779/881] [nrf noup] Bluetooth: Mesh: Fix adv randomness bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue where randomness can be removed for advertising sets that have to handle other adv types than the BT_MESH_FRIEND_ADV tag type. Signed-off-by: Anders Storrø Signed-off-by: Aleksandr Khromykh Signed-off-by: Dominik Ermel (cherry picked from commit 43189afa7eec1ea93bd83e7c7fb2284779723402) --- subsys/bluetooth/mesh/adv_ext.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 7caff2f91d2..0e6f6120f73 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -568,8 +568,10 @@ int bt_mesh_adv_enable(void) return err; } - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { - err = set_adv_randomness(adv->instance->handle, 0); + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && + IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_FRIEND_SEPARATE) && + advs[i].tags == BT_MESH_ADV_TAG_BIT_FRIEND) { + err = set_adv_randomness(advs[i].instance->handle, 0); if (err) { LOG_ERR("Failed to set zero randomness: %d", err); } From fbb42e8d8de6586dba7cadf5e7ce92c197005937 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Thu, 28 Mar 2024 15:04:41 +0100 Subject: [PATCH 780/881] [nrf noup] dfu/boot/mcuboot: fix confirmation in case of USE_PARTITION_MANAGER Active partition ID need to be extracted basing on PARTITION_MANAGER products. ref.:NCSDK-26693 Signed-off-by: Andrzej Puzdrowski Signed-off-by: Jamie McCrae (cherry picked from commit a6e4092bd9d38f7416f4387c446ac77da3a8a9d8) (cherry picked from commit b24d5100b9a635d4bb2bc2e041b5fdbc0ad452a0) --- subsys/dfu/boot/mcuboot.c | 47 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/subsys/dfu/boot/mcuboot.c b/subsys/dfu/boot/mcuboot.c index ad8ade044d4..70c746cf7ce 100644 --- a/subsys/dfu/boot/mcuboot.c +++ b/subsys/dfu/boot/mcuboot.c @@ -58,8 +58,49 @@ enum IMAGE_INDEXES { IMAGE_INDEX_2 }; -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \ - defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) +#if USE_PARTITION_MANAGER +#include + +#if CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 +/* Sysbuild */ +#ifdef CONFIG_MCUBOOT +/* lib is part of MCUboot -> operate on the primary application slot */ +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#else +/* TODO: Add firmware loader support */ +/* lib is part of the app -> operate on active slot */ +#if defined(CONFIG_NCS_IS_VARIANT_IMAGE) +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif /* CONFIG_MCUBOOT */ +#else +/* Legacy child/parent */ +#if CONFIG_BUILD_WITH_TFM + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) +#else + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) +#endif + +#ifdef CONFIG_MCUBOOT + /* lib is part of MCUboot -> operate on the primary application slot */ + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#else + /* lib is part of the App -> operate on active slot */ +#if (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_PRIMARY_ADDRESS + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#elif (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_SECONDARY_ADDRESS + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID +#else + #error Missing partition definitions. +#endif +#endif /* CONFIG_MCUBOOT */ +#endif /* CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 */ + +#else + +#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) /* For RAM LOAD mode, the active image must be fetched from the bootloader */ #define ACTIVE_SLOT_FLASH_AREA_ID boot_fetch_active_slot() #define INVALID_SLOT_ID 255 @@ -68,6 +109,8 @@ enum IMAGE_INDEXES { #define ACTIVE_SLOT_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_code_partition)) #endif +#endif /* USE_PARTITION_MANAGER */ + /* * Raw (on-flash) representation of the v1 image header. */ From dd473eb724b46ac6f48eb02f2fc797595d733ea7 Mon Sep 17 00:00:00 2001 From: Sigurd Hellesvik Date: Tue, 26 Mar 2024 16:35:05 +0100 Subject: [PATCH 781/881] [nrf noup] modules: mbedtls: Use help for DISABLE_MBEDTLS_BUILTIN info Using a comment to explain Kconfig options make them invisible to Kconfig search. Use help instead. Signed-off-by: Sigurd Hellesvik (cherry picked from commit c289b579cd65da72777519d2305d1c7cf46ad609) --- modules/mbedtls/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index f7bc6a609f1..aa8c479e89f 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -43,10 +43,11 @@ config MBEDTLS_LIBRARY endchoice -# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select -# DISABLE_MBEDTLS_BUILTIN. config DISABLE_MBEDTLS_BUILTIN bool + help + Subsystems cannot deselect MBEDTLS_BUILTIN, but they can select + DISABLE_MBEDTLS_BUILTIN. config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" From b507e6c2f979fccc31365d38b98c4a896a8d9dc5 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Wed, 27 Sep 2023 09:41:10 +0000 Subject: [PATCH 782/881] [nrf noup] test: schedule_api: Use Minimal C library There is no point to use PICOLIB here as it bloats the tests. Signed-off-by: Dominik Ermel (cherry picked from commit cbdf3c203fd490636e1e34ef134da580d5a42c9b) (cherry picked from commit 8cb54eb26cbce8c31af83154d863dd72bca036a4) --- tests/kernel/pipe/deprecated/pipe_api/prj.conf | 9 +++++++++ tests/kernel/sched/schedule_api/prj.conf | 1 + tests/kernel/sched/schedule_api/prj_multiq.conf | 1 + 3 files changed, 11 insertions(+) create mode 100644 tests/kernel/pipe/deprecated/pipe_api/prj.conf diff --git a/tests/kernel/pipe/deprecated/pipe_api/prj.conf b/tests/kernel/pipe/deprecated/pipe_api/prj.conf new file mode 100644 index 00000000000..df3270adfdf --- /dev/null +++ b/tests/kernel/pipe/deprecated/pipe_api/prj.conf @@ -0,0 +1,9 @@ +CONFIG_ZTEST=y +CONFIG_IRQ_OFFLOAD=y +CONFIG_TEST_USERSPACE=y +CONFIG_DYNAMIC_OBJECTS=y +CONFIG_MP_MAX_NUM_CPUS=1 +CONFIG_ZTEST_FATAL_HOOK=y +CONFIG_PIPES=y +CONFIG_DEPRECATION_TEST=y +CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj.conf b/tests/kernel/sched/schedule_api/prj.conf index a5ceef69433..8b649a3b7fc 100644 --- a/tests/kernel/sched/schedule_api/prj.conf +++ b/tests/kernel/sched/schedule_api/prj.conf @@ -7,3 +7,4 @@ CONFIG_MAX_THREAD_BYTES=6 CONFIG_TEST_USERSPACE=y CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y +CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index c8dd4bf786b..84c9d80ac61 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -7,3 +7,4 @@ CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y CONFIG_NUM_COOP_PRIORITIES=30 CONFIG_NUM_PREEMPT_PRIORITIES=40 +CONFIG_MINIMAL_LIBC=y From 94168ea25653f0499719f76bba15f0083c653427 Mon Sep 17 00:00:00 2001 From: Jan Tore Guggedal Date: Mon, 18 May 2020 20:50:13 +0200 Subject: [PATCH 783/881] [nrf noup] net: mqtt: Provide option to enable TLS session caching Provides an option to enable TLS session caching for an MQTT client's secure socket. Signed-off-by: Jan Tore Guggedal Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Johann Fischer (cherry picked from commit e15a1164f1ce13a1b67291fdc880e31d8cf63abd) --- include/zephyr/net/mqtt.h | 3 +++ subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index b992714afd3..d63cc131624 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -763,6 +763,9 @@ struct mqtt_sec_config { uint32_t alpn_protocol_name_count; #endif + /** Indicates the preference for enabling TLS session caching. */ + int session_cache; + /** Peer hostname for ceritificate verification. * May be NULL to skip hostname verification. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 2ff337eef34..68a101e6c84 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -109,6 +109,16 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } + if (tls_config->session_cache == TLS_SESSION_CACHE_ENABLED) { + ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, + TLS_SESSION_CACHE, + &tls_config->session_cache, + sizeof(tls_config->session_cache)); + if (ret < 0) { + goto error; + } + } + if (tls_config->cert_nocopy != TLS_CERT_NOCOPY_NONE) { ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, TLS_CERT_NOCOPY, &tls_config->cert_nocopy, From ed29068d073eb7cd4614349bae74fae1057ce221 Mon Sep 17 00:00:00 2001 From: Mirko Covizzi Date: Thu, 10 Mar 2022 00:25:50 -0800 Subject: [PATCH 784/881] [nrf noup] net: mqtt: add native TLS support This commit adds an extra parameter in the configuration structure to configure native TLS support at runtime. Signed-off-by: Mirko Covizzi (cherry picked from commit 3fbd1c5c3c5217423087ea1075acc4b5b79ac330) --- doc/connectivity/networking/api/mqtt.rst | 3 +++ include/zephyr/net/mqtt.h | 3 +++ subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/connectivity/networking/api/mqtt.rst b/doc/connectivity/networking/api/mqtt.rst index 2775d77315b..c2fb612e1cc 100644 --- a/doc/connectivity/networking/api/mqtt.rst +++ b/doc/connectivity/networking/api/mqtt.rst @@ -150,6 +150,7 @@ additional configuration information: tls_config->sec_tag_list = m_sec_tags; tls_config->sec_tag_count = ARRAY_SIZE(m_sec_tags); tls_config->hostname = MQTT_BROKER_HOSTNAME; + tls_config->set_native_tls = true; In this sample code, the ``m_sec_tags`` array holds a list of tags, referencing TLS credentials that the MQTT library should use for authentication. We do not specify @@ -162,6 +163,8 @@ Note, that TLS credentials referenced by the ``m_sec_tags`` array must be registered in the system first. For more information on how to do that, refer to :ref:`secure sockets documentation `. +Finally, ``set_native_tls`` can be optionally set to enable native TLS support instead of offloading TLS operations to the modem. + An example of how to use TLS with MQTT is also present in :zephyr:code-sample:`mqtt-publisher` sample application. diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index d63cc131624..797f8f339d7 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -773,6 +773,9 @@ struct mqtt_sec_config { /** Indicates the preference for copying certificates to the heap. */ int cert_nocopy; + + /** Set socket to native TLS */ + bool set_native_tls; }; /** @brief MQTT transport type. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 68a101e6c84..617dec4b4d2 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -22,10 +22,15 @@ int mqtt_client_tls_connect(struct mqtt_client *client) { const struct sockaddr *broker = client->broker; struct mqtt_sec_config *tls_config = &client->transport.tls.config; + int type = SOCK_STREAM; int ret; + if (tls_config->set_native_tls) { + type |= SOCK_NATIVE_TLS; + } + client->transport.tls.sock = zsock_socket(broker->sa_family, - SOCK_STREAM, IPPROTO_TLS_1_2); + type, IPPROTO_TLS_1_2); if (client->transport.tls.sock < 0) { return -errno; } From 8953b1cb81abab520f7c225d7fa5bd298ce971e3 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Mon, 4 Dec 2023 15:27:08 +0100 Subject: [PATCH 785/881] [nrf noup] soc: arm: nRF53: Add SPU Flash/RAM alignment TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF53 Signed-off-by: Markus Swarowsky (cherry picked from commit bc60d5ca3563061a00c35873e3e5c225e6de3750) --- soc/nordic/nrf53/Kconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 7260d5c7d66..e326322044a 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -167,12 +167,26 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral +config NRF_SPU_FLASH_REGION_ALIGNMENT + hex + default 0x4000 + help + FLASH regions must be aligned to this value due to SPU HW + limitations. + config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 help RAM region size for the NRF_SPU peripheral +config NRF_SPU_RAM_REGION_ALIGNMENT + hex + default 0x2000 + help + RAM regions must be aligned to this value due to SPU HW + limitations. + config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" depends on NRF_SOC_SECURE_SUPPORTED From d0a3d37d791f0bfc1c0ed29b87f07b709eb82209 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Mon, 4 Dec 2023 15:27:14 +0100 Subject: [PATCH 786/881] [nrf noup] soc: arm: nRF91: Add SPU Flash/RAM alignment TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF91 The nRF54L15 doesn't use the SPU for setting the security attributes for flash/RAM regions. In order to avoid having multiple Kconfigs with similar meaning renamed the alignment Kconfig option to something more generic in order to use the same symbol for all the TrustZone enabled devices. Ref: NCSDK-25023 Signed-off-by: Markus Swarowsky Signed-off-by: Georgios Vasilakis (cherry picked from commit a562d9663033995572b1e3269c687cbb343773e0) --- soc/nordic/nrf53/Kconfig | 22 ++++++++++++++-------- soc/nordic/nrf91/Kconfig | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index e326322044a..6e53dc277c6 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -167,12 +167,15 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_SPU_FLASH_REGION_ALIGNMENT +config NRF_TRUSTZONE_FLASH_REGION_SIZE hex - default 0x4000 + default NRF_SPU_FLASH_REGION_SIZE help - FLASH regions must be aligned to this value due to SPU HW - limitations. + Define the flash region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. config NRF_SPU_RAM_REGION_SIZE hex @@ -180,12 +183,15 @@ config NRF_SPU_RAM_REGION_SIZE help RAM region size for the NRF_SPU peripheral -config NRF_SPU_RAM_REGION_ALIGNMENT +config NRF_TRUSTZONE_RAM_REGION_SIZE hex - default 0x2000 + default NRF_SPU_RAM_REGION_SIZE help - RAM regions must be aligned to this value due to SPU HW - limitations. + Define the RAM region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" diff --git a/soc/nordic/nrf91/Kconfig b/soc/nordic/nrf91/Kconfig index ed38eff73a2..9f55cdd77ed 100644 --- a/soc/nordic/nrf91/Kconfig +++ b/soc/nordic/nrf91/Kconfig @@ -24,6 +24,16 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default NRF_SPU_FLASH_REGION_SIZE + help + Define the flash region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. + config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 @@ -34,4 +44,14 @@ config NRF_ENABLE_ICACHE bool "Instruction cache (I-Cache)" default y +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default NRF_SPU_RAM_REGION_SIZE + help + Define the RAM region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. + endif # SOC_SERIES_NRF91X From d1ed94edb4d60908d5a826cbda6eac0f0fabc4e1 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 14 Nov 2022 11:22:06 +0100 Subject: [PATCH 787/881] [nrf noup] boards: thingy53_nrf5340: Add common partition map Change introduces common static Partition Manager configuration. The tfm_nonsecure partition must be SPU region aligned. Ref: NCSDK-18033 Ref: NCSDK-19515 Signed-off-by: Marek Pieta Signed-off-by: Markus Swarowsky (cherry picked from commit afef9ef461a574f57a785bf220060468ad3ebbde) --- .../pm_static_thingy53_nrf5340_cpuapp.yml | 55 ++++++++++++++ .../pm_static_thingy53_nrf5340_cpuapp_ns.yml | 73 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml create mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml new file mode 100644 index 00000000000..7a48d51ec33 --- /dev/null +++ b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml @@ -0,0 +1,55 @@ +app: + address: 0x10200 + region: flash_primary + size: 0xdfe00 +mcuboot: + address: 0x0 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + region: flash_primary + size: 0x200 +mcuboot_primary: + address: 0x10000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0xe0000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + orig_span: &id002 + - app + region: flash_primary + size: 0xdfe00 + span: *id002 +settings_storage: + address: 0xf0000 + region: flash_primary + size: 0x10000 +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x00000 + size: 0xe0000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xe0000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x120000 + size: 0x6e0000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml new file mode 100644 index 00000000000..70ffe6d9c12 --- /dev/null +++ b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml @@ -0,0 +1,73 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + region: flash_primary + size: 0x200 +tfm_secure: + address: 0x10000 + size: 0xc000 + span: [mcuboot_pad, tfm] +tfm_nonsecure: + address: 0x1c000 + size: 0xd4000 + span: [app] +tfm: + address: 0x10200 + region: flash_primary + size: 0xbe00 +app: + address: 0x1c000 + region: flash_primary + size: 0xd4000 +mcuboot_primary: + address: 0x10000 + orig_span: &id001 + - mcuboot_pad + - tfm + - app + region: flash_primary + size: 0xe0000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + orig_span: &id002 + - tfm + - app + region: flash_primary + size: 0xdfe00 + span: *id002 +nonsecure_storage: + address: 0xf0000 + size: 0x10000 + span: [settings_storage] +settings_storage: + address: 0xf0000 + region: flash_primary + size: 0x10000 +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x00000 + size: 0xe0000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xe0000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x120000 + size: 0x6e0000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary From d0fe98dafa7b30268d72aab038c45b83b4a0f009 Mon Sep 17 00:00:00 2001 From: Mateusz Kapala Date: Thu, 2 Feb 2023 11:04:23 +0100 Subject: [PATCH 788/881] [nrf noup] boards: arm: thingy53: Disable USB CDC added by MCUBoot Enabling USB CDC by default in Thingy:53 board configuration caused that there were two instances of USB CDC in MCUBoot. Change disables one instance which was added automatically by NCS if MCUBoot bootloader was built as a child image. Jira: NCSDK-18596 Signed-off-by: Mateusz Kapala Signed-off-by: Johann Fischer (cherry picked from commit 6d1e3772d63562e2e30fa3176805538d2f0c4117) --- boards/nordic/thingy53/Kconfig.defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index c1139f0dca1..1aa0d7d082e 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -84,6 +84,13 @@ endif # !TRUSTED_EXECUTION_SECURE source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" +# By default, a USB CDC ACM instance is already enabled in the board's DTS. +# It is not necessary for nRF Connect SDK to add another instance if MCUBoot +# bootloader is built as a child image. +config MCUBOOT_USB_SUPPORT + bool + default n + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From 12663119088b737ebad2a8a0e3c3d87a0a2a896b Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 28 Nov 2022 15:31:33 +0100 Subject: [PATCH 789/881] [nrf noup] boards: thingy53_nrf5340: Enable MCUboot by default Change enables MCUboot bootloader by default to allow programming samples and applications without external programmer (using MCUboot serial recovery). Change also enables network core to prevent build failures when building MCUboot with nRF53 multi image DFU. Jira: NCSDK-18263 Signed-off-by: Marek Pieta Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Johann Fischer Signed-off-by: Joakim Andersson (cherry picked from commit ce70796db5dd9a8d99c55732c0292bbeffc38f77) --- boards/nordic/thingy53/Kconfig.defconfig | 6 ++++++ boards/nordic/thingy53/thingy53_nrf5340_common.dtsi | 1 + 2 files changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 1aa0d7d082e..badcb5c20e5 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -8,6 +8,12 @@ config HW_STACK_PROTECTION if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS +config BOOTLOADER_MCUBOOT + default y if !MCUBOOT + +config BOARD_ENABLE_CPUNET + default y if !MCUBOOT + # Code Partition: # # For the secure version of the board the firmware is linked at the beginning diff --git a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi index fabd5d177a9..c8042b28475 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi +++ b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi @@ -13,6 +13,7 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; + nordic,pm-ext-flash = &mx25r64; }; buttons { From 4e0141487e02b8d578ebeccffce4f80b521fe7d4 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Fri, 19 Apr 2024 12:58:47 +0200 Subject: [PATCH 790/881] [nrf noup] samples: psa_crypto: Remove support for Nordic boards We have our own psa crypto samples to show how to used PSA crypto with NCS. This sample still uses CONFIG_MBEDTLS_BUILTIN which is not supported anymore, therefore removing the support for it in NCS. Ref: NCSDK-17944 Signed-off-by: Markus Swarowsky (cherry picked from commit 27f225d5ae6e3f73b609970b81881d504f1b956d) --- samples/tfm_integration/psa_crypto/sample.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/tfm_integration/psa_crypto/sample.yaml b/samples/tfm_integration/psa_crypto/sample.yaml index ea9844730fc..7d287985bf3 100644 --- a/samples/tfm_integration/psa_crypto/sample.yaml +++ b/samples/tfm_integration/psa_crypto/sample.yaml @@ -16,8 +16,6 @@ tests: platform_allow: - mps2/an521/cpu0/ns - v2m_musca_s1/musca_s1/ns - - nrf5340dk/nrf5340/cpuapp/ns - - nrf9160dk/nrf9160/ns - stm32l562e_dk/stm32l562xx/ns - bl5340_dvk/nrf5340/cpuapp/ns - max32657evkit/max32657/ns From a09d97cb5b07a75a7dbb1ede8471eadabbeef696 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 9 May 2024 09:34:06 +0100 Subject: [PATCH 791/881] [nrf noup] boards: nordic: thingy53: Add sysbuild Kconfig file Adds a sysbuild Kconfig file which enables external flash when partition manager is enabled Signed-off-by: Jamie McCrae (cherry picked from commit fa07e94d6a760f8a4e025b408f3ddd5db47acaf5) --- boards/nordic/thingy53/Kconfig.sysbuild | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 boards/nordic/thingy53/Kconfig.sysbuild diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild new file mode 100644 index 00000000000..2110f226e6b --- /dev/null +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY + default y if BOOTLOADER_MCUBOOT From db374758faed743da1e979a0fd0641ee0bf37f6e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 14 May 2024 12:22:51 +0100 Subject: [PATCH 792/881] [nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir Uses sysbuild by default when building an application which resides in an allowed NCS-based directory when the sysbuild config key is not set. Do not use sysbuild if the mps2 board is being used to avoid problems with CI testing. Signed-off-by: Jamie McCrae (cherry picked from commit 5bbb2c8dd32e564667eb7b6bc3bd27f9f58e1bfb) --- scripts/west_commands/build.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index fb3894944cd..a271e4075a5 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -642,7 +642,12 @@ def _run_cmake(self, board, origin, cmake_opts): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', False) + config_sysbuild = config_getboolean('sysbuild', None) + + if config_sysbuild is None: + # If no option is set, then enable sysbuild globally + config_sysbuild = True + if self.args.sysbuild or (config_sysbuild and not self.args.no_sysbuild): cmake_opts.extend([f'-S{SYSBUILD_PROJ_DIR}', f'-DAPP_DIR:PATH={self.source_dir}']) From 0d2e7a84af00f09832b9f1c70cc315f76bf862e6 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 17 May 2024 10:15:33 +0100 Subject: [PATCH 793/881] [nrf noup] board: nordic: thingy53: Enable default images for sysbuild Enables MCUboot, empty network core and network core updates by default when building for the thingy53 Signed-off-by: Jamie McCrae (cherry picked from commit f730f82960010af1f6fd988d15842de0920dc9af) --- boards/nordic/thingy53/Kconfig.sysbuild | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index 2110f226e6b..c03d191b370 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -1,5 +1,22 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +config SECURE_BOOT_NETCORE + default y + +config NETCORE_APP_UPDATE + default y if SECURE_BOOT_NETCORE + +config NRF_DEFAULT_EMPTY + default y if SECURE_BOOT_NETCORE + +endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY default y if BOOTLOADER_MCUBOOT From a509c3bf6ca67d79f1d401ddc78a9394136c916c Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 1 Oct 2018 10:27:32 +0200 Subject: [PATCH 794/881] [nrf noup] include: net: add NCS extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add some socket options and address family extensions to Zephyr headers, which will be useful for nRF Connect SDK. Add secure socket options: * Add CID socket options to NCS specific options. * Add TLS/DTLS tls ciphersuite chosen socket option to NCS specific options. * Add TLS/DTLS connection save/load socket options to NCS specific options. * Add TLS/DTLS handshake status socket option to NCS specific options. * Add SO_KEEPOPEN socket option. * Add SO_RAI socket options. * Add SO_IPV6_DELAYED_ADDR_REFRESH socket option. The "author" of this commit is a contact person; various people with s-o-b lines following here have contributed to the maintenance of this patch. Signed-off-by: Andreas Moltumyr Signed-off-by: Andrzej Głąbek Signed-off-by: Christopher Métrailler Signed-off-by: Emanuele Di Santo Signed-off-by: Glenn Ruben Bakke Signed-off-by: Håkon Alseth Signed-off-by: Ioannis Glaropoulos Signed-off-by: Jan Tore Guggedal Signed-off-by: Joakim Andersson Signed-off-by: Martí Bolívar Signed-off-by: Mirko Covizzi Signed-off-by: Petri Honkala Signed-off-by: Robert Lubos Signed-off-by: Tommi Mammela Signed-off-by: Trond Einar Snekvik Signed-off-by: Torsten Rasmussen Signed-off-by: Eivind Jølsgard Signed-off-by: Dominik Ermel (cherry picked from commit d7a627775d65077527e6272d627e2b88bfecc9cd) --- include/zephyr/net/socket.h | 1 + include/zephyr/net/socket_ncs.h | 170 ++++++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+) create mode 100644 include/zephyr/net/socket_ncs.h diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index 2eab2d96462..d5447b097e5 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #ifdef __cplusplus diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h new file mode 100644 index 00000000000..92a8447c47f --- /dev/null +++ b/include/zephyr/net/socket_ncs.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ +#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ + +/** + * @file + * @brief NCS specific additions to the BSD sockets API definitions + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence + * when creating a new socket. Combine this flag with a socket type when + * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). + * If it's desired to create a native TLS socket, but still offload the + * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. + */ +#define SOCK_NATIVE 0x80000000 +#define SOCK_NATIVE_TLS 0x40000000 + +/** Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options. + */ +#define NET_SOCKET_NCS_BASE 1000 + +/* NCS specific TLS level socket options */ + +/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. + * The option accepts an integer, indicating the total handshake timeout, + * including retransmissions, in seconds. + * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. + */ +#define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) + +/** Socket option to save DTLS connection, specifically for nRF sockets. + */ +#define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) + +/** Socket option to load DTLS connection, specifically for nRF sockets. + */ +#define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) + +/** Socket option to get result of latest TLS/DTLS completed handshakes end status, + * specifically for nRF sockets. + * The option accepts an integer, indicating the setting. + * Accepted vaules for the option are: 0 and 1. + */ +#define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) + +/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ +#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */ +#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ +#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ + +/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */ +#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 +#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 + +/* NCS specific socket options */ + +/** sockopt: enable sending data as part of exceptional events */ +#define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) +/** sockopt: Keep socket open when its PDN connection is lost + * or the device is put into flight mode. + */ +#define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) +/** sockopt: bind to PDN */ +#define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) + +/** sockopt: Release assistance indication (RAI). + * The option accepts an integer, indicating the type of RAI. + * Accepted values for the option are: @ref RAI_NO_DATA, @ref RAI_LAST, @ref RAI_ONE_RESP, + * @ref RAI_ONGOING, @ref RAI_WAIT_MORE. + */ +#define SO_RAI (NET_SOCKET_NCS_BASE + 61) + +/** Release assistance indication (RAI). + * Indicate that the application does not intend to send more data. + * This applies immediately and lets the modem exit connected mode more + * quickly. + * + * @note This requires the socket to be connected. + */ +#define RAI_NO_DATA 1 +/** Release assistance indication (RAI). + * Indicate that the application does not intend to send more data + * after the next call to send() or sendto(). + * This lets the modem exit connected mode more quickly after sending the data. + */ +#define RAI_LAST 2 +/** Release assistance indication (RAI). + * Indicate that the application is expecting to receive just one data packet + * after the next call to send() or sendto(). + * This lets the modem exit connected mode more quickly after having received the data. + */ +#define RAI_ONE_RESP 3 +/** Release assistance indication (RAI). + * Indicate that the socket is in active use by a client application. + * This lets the modem stay in connected mode longer. + */ +#define RAI_ONGOING 4 +/** Release assistance indication (RAI). + * Indicate that the socket is in active use by a server application. + * This lets the modem stay in connected mode longer. + */ +#define RAI_WAIT_MORE 5 + +/* NCS specific IPPROTO_ALL level socket options */ + +/** IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. */ +#define IPPROTO_ALL 512 +/** sockopt: disable all replies to unexpected traffics */ +#define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) + +/* NCS specific IPPROTO_IP level socket options */ + +/** sockopt: enable IPv4 ICMP replies */ +#define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) + +/* NCS specific IPPROTO_IPV6 level socket options */ + +/** sockopt: enable IPv6 ICMP replies */ +#define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) + +/** sockopt: Delay IPv6 address refresh during power saving mode */ +#define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) + +/* NCS specific TCP level socket options */ + +/** sockopt: Configurable TCP server session timeout in minutes. + * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). + */ +#define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) + +/* NCS specific gettaddrinfo() flags */ + +/** Assume `service` contains a Packet Data Network (PDN) ID. + * When specified together with the AI_NUMERICSERV flag, + * `service` shall be formatted as follows: "port:pdn_id" + * where "port" is the port number and "pdn_id" is the PDN ID. + * Example: "8080:1", port 8080 PDN ID 1. + * Example: "42:0", port 42 PDN ID 0. + */ +#define AI_PDNSERV 0x1000 + +/* NCS specific send() and sendto() flags */ + +/** Request a blocking send operation until the request is acknowledged. + * When used in send() or sendto(), the request will not return until the + * send operation is completed by lower layers, or until the timeout, given by the SO_SNDTIMEO + * socket option, is reached. Valid timeout values are 1 to 600 seconds. + */ +#define MSG_WAITACK 0x200 + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ From 585fd8e2f6b64cbb22635e54da654307a281edfa Mon Sep 17 00:00:00 2001 From: Sigvart Hovland Date: Fri, 3 May 2019 14:21:52 +0200 Subject: [PATCH 795/881] [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition Manager (PM) is a component of the nRF Connect SDK (NCS) which uses yaml files to resolve flash partition placement with a holistic view of the entire device, including each firmware image present on the flash device, and various subsystems, such as settings and NFFS. When this NCS extension is used, various source files which would use partition information from devicetree in "vanilla" zephyr instead use defines generated by PM instead. This commit removes support for HEX_FILES_TO_MERGE, as it conflicts with PM. The settings subsystem pm.yml defines a partition 'settings_storage'. The nffs subsystem pm.yml defines 'nffs_storage'. Leverage label translation to avoid patching partition names. Refer to the NCS documentation page for this feature for more details. This is a long-running out of tree patch which has been worked on by several people. The following sign-offs are in alphabetical order by first name. Signed-off-by: Andrzej Głąbek Signed-off-by: Andrzej Puzdrowski Signed-off-by: Håkon Øye Amundsen Signed-off-by: Ioannis Glaropoulos Signed-off-by: Joakim Andersson Signed-off-by: Johann Fischer Signed-off-by: Martí Bolívar Signed-off-by: Ole Sæther Signed-off-by: Robert Lubos Signed-off-by: Sebastian Bøe Signed-off-by: Sigvart Hovland Signed-off-by: Thomas Stenersen Signed-off-by: Torsten Rasmussen Signed-off-by: Øyvind Rønningstad Signed-off-by: Trond Einar Snekvik Signed-off-by: Gerard Marull-Paretas Signed-off-by: Tomasz Moń Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit 5c2eecf1ef8bc3bc714dff8adf8f023bd921227a) --- arch/arm/core/mpu/arm_mpu_regions.c | 13 +++++ cmake/linker/ld/target.cmake | 1 + cmake/linker/lld/target.cmake | 1 + cmake/modules/kernel.cmake | 4 ++ drivers/flash/soc_flash_nrf.c | 11 ++++ drivers/flash/soc_flash_nrf_rram.c | 11 ++++ .../arch/arm/cortex_m/scripts/linker.ld | 50 +++++++++++++++++++ include/zephyr/storage/flash_map.h | 6 +++ lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 18 ++++++- subsys/dfu/boot/mcuboot_shell.c | 40 +++++++++++++++ subsys/fs/littlefs_fs.c | 7 ++- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ++++++++++ 13 files changed, 187 insertions(+), 4 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 0bf7a219c27..383fd573513 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,6 +8,9 @@ #include #include +#if USE_PARTITION_MANAGER +#include +#endif static const struct arm_mpu_region mpu_regions[] = { #ifdef CONFIG_XIP @@ -24,6 +27,14 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -31,6 +42,8 @@ static const struct arm_mpu_region mpu_regions[] = { #else REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif + +#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index 592596576d1..ccf6a190316 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,6 +80,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index 96df1c12379..fe8aad62c73 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,6 +52,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index c6319611c8c..5c8fa184b20 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -256,3 +256,7 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() + +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 9e1ba68319f..574739082dc 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,6 +37,11 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -166,6 +171,12 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index d26a15cf723..d46e3524ea8 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,6 +54,11 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -279,6 +284,12 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index 688165d0698..c8579f2a802 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,6 +34,39 @@ #define ROMSTART_REGION ROMABLE_REGION #endif +#if USE_PARTITION_MANAGER + +#include + +#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ + +#define ROM_ADDR PM_ADDRESS +#define ROM_SIZE PM_SIZE + +#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) +#define RAM_SIZE CONFIG_PM_SRAM_SIZE +#else +#define RAM_SIZE PM_SRAM_SIZE +#endif +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -55,6 +88,23 @@ #define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index d8ba414abd3..f62f1c21718 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -348,6 +348,10 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + /** * Returns non-0 value if fixed-partition of given DTS node label exists. * @@ -469,6 +473,8 @@ DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) #undef FOR_EACH_PARTITION_TABLE /** @endcond */ +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index 0d97da3e340..9a39ab8ad73 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -81,7 +81,7 @@ config HEAP_LISTENER choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) + default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) && !PARTITION_MANAGER_ENABLED default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 2b01e152f00..2821ae8173a 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,6 +25,20 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); +#if USE_PARTITION_MANAGER + +#include + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + +#define RAM_SIZE (KB((size_t) CONFIG_SRAM_SIZE)) +#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS + +#endif /* USE_PARTITION_MANAGER */ + #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -106,8 +120,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ - ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((RAM_SIZE - \ + ((size_t) HEAP_BASE - (size_t) RAM_ADDR)), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index be4e558713f..e167bc1e39b 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,6 +20,16 @@ #endif #endif +#if USE_PARTITION_MANAGER +#include + +#ifdef CONFIG_NCS_IS_VARIANT_IMAGE +#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif + struct area_desc { const char *name; unsigned int id; @@ -93,6 +103,35 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ +#if USE_PARTITION_MANAGER +#ifdef PM_MCUBOOT_ID + if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { + shell_error(sh, "Cannot erase boot partition"); + return -EACCES; + } +#endif + +#ifdef PM_APP_ID + if (id == PM_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef PM_MCUBOOT_PRIMARY_APP_ID + if (id == PM_MCUBOOT_PRIMARY_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef ACTIVE_IMAGE_ID + if (id == ACTIVE_IMAGE_ID) { + shell_error(sh, "Cannot erase active partitions"); + return -EACCES; + } +#endif +#else #if FIXED_PARTITION_EXISTS(boot_partition) if (id == FIXED_PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -105,6 +144,7 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } +#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index 7cf8aaa44c7..5abbf95f949 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1103,7 +1103,12 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ + .storage_dev = (void *) \ + COND_CODE_1(USE_PARTITION_MANAGER, \ + (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ + (FIXED_PARTITION_ID(littlefs_storage)), \ + (FIXED_PARTITION_ID(storage)))), \ + (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index a74e46b8520..9996e1d74d9 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,8 +13,35 @@ extern "C" { #endif +#if CONFIG_PARTITION_MANAGER_ENABLED + +#include "pm_config.h" + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) +#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE +#else +/* The current image is a child image in a different domain than the image + * which defined the required values. To reach the values of the parent domain + * we use the 'PM__' variant of the define. + */ +#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ + +#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ + +#else + +#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) +#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) + +#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From a69570979c7385756f8fd683801d912cca73227a Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Fri, 17 May 2024 14:10:51 +0200 Subject: [PATCH 796/881] [nrf noup] kernel: Disable boot banner if NCS_BOOT_BANNER is enabled Zephyr's boot banner should not be used if NCS boot banner is enabled. Signed-off-by: Robert Lubos (cherry picked from commit 4b7a867eabe9e6e3724e8b3c210b9506c9c2cfef) --- kernel/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/Kconfig b/kernel/Kconfig index bb2c5bade90..bac45c64d33 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -457,6 +457,7 @@ config SKIP_BSS_CLEAR config BOOT_BANNER bool "Boot banner" default y + depends on !NCS_BOOT_BANNER select PRINTK select EARLY_CONSOLE help From eda0874655de248778b352efbb30fb5eec49beac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Fri, 31 May 2024 08:21:51 +0200 Subject: [PATCH 797/881] =?UTF-8?q?[nrf=20noup]=C2=A0Bluetooth:=20Mesh:=20?= =?UTF-8?q?remove=20legacy=20adv=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes explicit support for the legacy advertiser due to incompatibility with SDC. The legacy advertiser can be used (experimentally) with the Zephyr Link Layer enabled, but is not recommended. Signed-off-by: Håvard Reierstad (cherry picked from commit 10b13619fcdedaa5ae25f62eb7acd86f5f768635) --- subsys/bluetooth/mesh/Kconfig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index d39ea25616a..bb0e8be8eb8 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -59,12 +59,16 @@ choice BT_MESH_ADV menuconfig BT_MESH_ADV_LEGACY bool "Legacy advertising" + depends on BT_LL_SW_SPLIT help Use legacy advertising commands for mesh sending. Legacy - advertising is significantly slower than the extended advertising, but - is supported by all controllers. + advertising is significantly slower than the extended advertising. - WARNING: The legacy advertiser can occasionally do more message + WARNING: This feature is not supported in NCS. The legacy advertiser will not work + with SDC, as attempting to start an advertisement during the scanner duty cycle + will result in an error. The Zephyr Link Layer can be used experimentally as an + alternative. + The legacy advertiser can occasionally do more message retransmissions than requested because of limitations of HCI interface API. From 64bd0f7993c3a01e29a2b3c9cdaefe43bffad6f2 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 5 Jun 2024 13:37:34 +0100 Subject: [PATCH 798/881] [nrf noup] board: nordic: thingy53: Default to update only MCUboot type Changes the default MCUboot mode to update only for the thingy53, to align with previous bootloader builds Changes the thingy53 default configuration for sysbuild to enable using all RAM in the MCUboot image Signed-off-by: Jamie McCrae (cherry picked from commit a06f9582999650d0f950952b4799510871e23948) --- boards/nordic/thingy53/Kconfig.sysbuild | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index c03d191b370..df489c1dd54 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -7,6 +7,10 @@ choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice +choice MCUBOOT_MODE + default MCUBOOT_MODE_OVERWRITE_ONLY +endchoice + config SECURE_BOOT_NETCORE default y @@ -16,6 +20,9 @@ config NETCORE_APP_UPDATE config NRF_DEFAULT_EMPTY default y if SECURE_BOOT_NETCORE +config MCUBOOT_USE_ALL_AVAILABLE_RAM + default y if BOARD_THINGY53_NRF5340_CPUAPP_NS && BOOTLOADER_MCUBOOT + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY From a296050ec84ed69b63599e98e636b14923ef0d77 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 12 Jun 2024 16:15:29 +0200 Subject: [PATCH 799/881] [nrf noup] samples: sysbuild: hello_world: support PM on nRF53 PM support is still required for nRF53/nRF54l15 in the context of NCS. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 470fcc9ac884ec9698e1d838160c7c3aadf706e0) --- samples/sysbuild/hello_world/sysbuild.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index c7c2615c665..8f8fc49dbff 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -11,5 +11,17 @@ ExternalZephyrProject_Add( BOARD ${SB_CONFIG_REMOTE_BOARD} ) +if(SB_CONFIG_SOC_SERIES_NRF53X) + set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) + set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) + set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) + set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") +else(SB_CONFIG_SOC_SERIES_NRF54LX) + set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) + set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) + set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) + set(CPUFLPR_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") +endif() + add_dependencies(${DEFAULT_IMAGE} remote) sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote) From a5da2ea2ad61cd4bb960542cb481b42f79d45678 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Mon, 25 Sep 2023 16:41:15 +0200 Subject: [PATCH 800/881] [nrf noup] settings: nvs: use dedicated lookup cache hash function Introduce NVS_LOOKUP_CACHE_FOR_SETTINGS Kconfig option that enables a dedicated hash function for the NVS lookup cache that takes advantage of the NVS ID allocation scheme used by the NVS settings backend. As such, this option should only be used if an application uses NVS via the settings layer. Signed-off-by: Damian Krolik (cherry picked from commit 1deb982783fff1ca9368fbe649123fbdeedfd304) --- subsys/fs/nvs/Kconfig | 9 +++++++++ subsys/fs/nvs/nvs.c | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/subsys/fs/nvs/Kconfig b/subsys/fs/nvs/Kconfig index 48915c2f048..21798932f52 100644 --- a/subsys/fs/nvs/Kconfig +++ b/subsys/fs/nvs/Kconfig @@ -29,6 +29,15 @@ config NVS_LOOKUP_CACHE_SIZE Number of entries in Non-volatile Storage lookup cache. It is recommended that it be a power of 2. +config NVS_LOOKUP_CACHE_FOR_SETTINGS + bool "Non-volatile Storage lookup cache optimized for settings" + depends on NVS_LOOKUP_CACHE + help + Use the lookup cache hash function that results in the least number of + collissions and, in turn, the best NVS performance provided that the NVS + is used as the settings backend only. This option should NOT be enabled + if the NVS is also written to directly, outside the settings layer. + config NVS_DATA_CRC bool "Non-volatile Storage CRC protection on the data" help diff --git a/subsys/fs/nvs/nvs.c b/subsys/fs/nvs/nvs.c index 8a710d570fb..f36d5b76dd5 100644 --- a/subsys/fs/nvs/nvs.c +++ b/subsys/fs/nvs/nvs.c @@ -13,6 +13,11 @@ #include #include "nvs_priv.h" +#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS +#include +#include +#endif + #include LOG_MODULE_REGISTER(fs_nvs, CONFIG_NVS_LOG_LEVEL); @@ -21,6 +26,45 @@ static int nvs_ate_valid(struct nvs_fs *fs, const struct nvs_ate *entry); #ifdef CONFIG_NVS_LOOKUP_CACHE +#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS + +static inline size_t nvs_lookup_cache_pos(uint16_t id) +{ + /* + * 1. The NVS settings backend uses up to (NVS_NAME_ID_OFFSET - 1) NVS IDs to + store keys and equal number of NVS IDs to store values. + * 2. For each key-value pair, the value is stored at NVS ID greater by exactly + * NVS_NAME_ID_OFFSET than NVS ID that holds the key. + * 3. The backend tries to minimize the range of NVS IDs used to store keys. + * That is, NVS IDs are allocated sequentially, and freed NVS IDs are reused + * before allocating new ones. + * + * Therefore, to assure the least number of collisions in the lookup cache, + * the least significant bit of the hash indicates whether the given NVS ID + * represents a key or a value, and remaining bits of the hash are set to + * the ordinal number of the key-value pair. Consequently, the hash function + * provides the following mapping: + * + * 1st settings key => hash 0 + * 1st settings value => hash 1 + * 2nd settings key => hash 2 + * 2nd settings value => hash 3 + * ... + */ + BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAMECNT_ID), "NVS_NAMECNT_ID is not power of 2"); + BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAME_ID_OFFSET), "NVS_NAME_ID_OFFSET is not power of 2"); + + uint16_t key_value_bit; + uint16_t key_value_ord; + + key_value_bit = (id >> LOG2(NVS_NAME_ID_OFFSET)) & 1; + key_value_ord = id & (NVS_NAME_ID_OFFSET - 1); + + return ((key_value_ord << 1) | key_value_bit) % CONFIG_NVS_LOOKUP_CACHE_SIZE; +} + +#else /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ + static inline size_t nvs_lookup_cache_pos(uint16_t id) { uint16_t hash; @@ -36,6 +80,8 @@ static inline size_t nvs_lookup_cache_pos(uint16_t id) return hash % CONFIG_NVS_LOOKUP_CACHE_SIZE; } +#endif /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ + static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) { int rc; From f27284fc9f7fb6657d15f0f76a8f15b3ab148a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Fri, 24 May 2024 15:32:07 +0200 Subject: [PATCH 801/881] [nrf noup] soc: nordic: nrf54l: Skip clock configuration from ns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not permit configuring clocks from non-secure as NRF_OSCILLATORS is a not supported as a non-secure peripheral Signed-off-by: Sebastian Bøe (cherry picked from commit 4a163d030c88bc9d9a8c3f2069d4140d1f990d1c) --- soc/nordic/nrf54l/Kconfig | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 114c1dc6b5a..a3473c96745 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -56,10 +56,18 @@ config SOC_NRF54LM20A_ENGA_CPUFLPR if SOC_SERIES_NRF54LX config SOC_NRF54LX_SKIP_CLOCK_CONFIG - bool "Skip clock frequency configuration in system initialization" + bool + prompt "Skip clock frequency configuration in system initialization" if TRUSTED_EXECUTION_SECURE + default y if TRUSTED_EXECUTION_NONSECURE help - With this option, the CPU clock frequency is not set during system initialization. - The CPU runs with the default, hardware-selected frequency. + With this option, the CPU clock frequency is not set during this + Zephyr image's system initialization. The CPU runs with either + the HW reset values, or with the configuration set by an image + earlier in the boot chain. + + Note that for security reasons it is not supported to configure + the clock peripheral (NRF_OSCILLATORS) from the non-secure + domain. config SOC_NRF54LX_DISABLE_FICR_TRIMCNF bool "Disable trimming of the device" From 7fd622588550a708880601e82571cfe2ac92a623 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Mon, 8 Jul 2024 10:08:10 +0200 Subject: [PATCH 802/881] [nrf noup] ci: Enable action-manifest-pr This action will automatically manage a PR to sdk-nrf once a PR to sdk-zephyr is created. This includes: - Creating an initial PR - Updating and (optionally) rebase it once the PR to sdk-nrf is merged. The action can be disabled by adding the string "manifest-pr-skip" to the title or body of the PR. This will simplify cherry-picking changes from upstream zephyr. Signed-off-by: Rubin Gerritsen (cherry picked from commit 7cf6f4fa8083e27ae79ba2c3160a870a1054380e) --- .github/workflows/manifest-PR.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/manifest-PR.yml diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml new file mode 100644 index 00000000000..a871aa381de --- /dev/null +++ b/.github/workflows/manifest-PR.yml @@ -0,0 +1,17 @@ +name: handle manifest PR +on: + pull_request_target: + types: [opened, synchronize, closed] + branches: + - main + + +jobs: + call-manifest-pr-action: + runs-on: ubuntu-latest + steps: + - name: handle manifest PR + uses: nrfconnect/action-manifest-pr@main + with: + token: ${{ secrets.NCS_GITHUB_TOKEN }} + manifest-pr-title-details: ${{ github.event.pull_request.title }} From f6c8ac126a77ada9f857f33a25f2e21af29e72a7 Mon Sep 17 00:00:00 2001 From: Mateusz Michalek Date: Mon, 17 Jun 2024 14:57:09 +0200 Subject: [PATCH 803/881] [nrf noup] drivers: flash: kconfig: nrf_rram region resolution adjusting region resolution to match erase-block-size Signed-off-by: Mateusz Michalek (cherry picked from commit 73823d3b105fd8547e1363ec07d91d0da1665ba1) --- drivers/flash/Kconfig.nrf_rram | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/flash/Kconfig.nrf_rram b/drivers/flash/Kconfig.nrf_rram index 3dea687a0f8..a59560e86a4 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -70,14 +70,14 @@ config SOC_FLASH_NRF_TIMEOUT_MULTIPLIER config NRF_RRAM_REGION_ADDRESS_RESOLUTION hex - default 0x400 + default 0x1000 help RRAMC's region protection address resolution. Applies to region with configurable start address. config NRF_RRAM_REGION_SIZE_UNIT hex - default 0x400 + default 0x1000 help Base unit for the size of RRAMC's region protection. From 37c49abd06a3d32aa4e0b7e77ccc932fbba0e03d Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Tue, 16 Jul 2024 14:43:30 +0200 Subject: [PATCH 804/881] [nrf noup] dts: Add Bluetooth Controller to nRF54H20 The nRF54H20 supports a Bluetooth controller. The HCI driver interface has changed upstream in https://github.com/zephyrproject-rtos/zephyr/pull/72323 so now we need to add it to device tree. Signed-off-by: Rubin Gerritsen (cherry picked from commit e9a13c3d91f2ce76abcdb72c62455578fbf2257a) (cherry picked from commit 6f17dc3e1d057a260efb291a63f4d2d94cb94d6d) --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 8 ++++++++ dts/vendor/nordic/nrf54h20.dtsi | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 279bc758111..bf194df4478 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -23,6 +23,10 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &cpuflpr; / { + chosen { + zephyr,bt-hci = &bt_hci_controller; + }; + soc { compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; @@ -159,3 +163,7 @@ wdt011: &cpurad_wdt011 {}; &gpio_pad_group9 { status = "okay"; }; + +&bt_hci_controller { + status = "okay"; +}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index b6bf93238b4..1f4160ac897 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -482,6 +482,14 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; + + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; }; ccm030: ccm@3a000 { From dc9145b744e954a88c8826ce62d59e67a30aff4d Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Fri, 14 Jun 2024 09:13:48 +0200 Subject: [PATCH 805/881] [nrf noup] bluetooth: att: Allow ATT sent callback after data TX is done By default, the BLE stack calls sent callback for ATT data when the data is passed to BLE controller for transmission. Enabling this Kconfig option delays calling the sent callback until data transmission is finished by BLE controller (the callback is delayed until receiving the num complete packets event). Jira: NCSDK-27422 Signed-off-by: Marek Pieta (cherry picked from commit 5b9ea8c24b78a4be7e83f5cdbe1fead42b659f44) --- subsys/bluetooth/host/Kconfig.gatt | 17 +++++++++++++++++ subsys/bluetooth/host/att.c | 17 ++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index a04241a3e94..221bc413c4b 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -38,6 +38,23 @@ config BT_ATT_RETRY_ON_SEC_ERR If an ATT request fails due to insufficient security, the host will try to elevate the security level and retry the ATT request. +config BT_ATT_SENT_CB_AFTER_TX + bool "Delay ATT sent callback until data transmission is done by controller [EXPERIMENTAL]" + select EXPERIMENTAL + help + By default, the BLE stack calls sent callback for ATT data when the + data is passed to BLE controller for transmission. Enabling this + Kconfig option delays calling the sent callback until data + transmission is finished by BLE controller (the callback is called + upon receiving the Number of Completed Packets HCI Event). + + The feature is not available in Zephyr RTOS (it's specific to NCS + Zephyr fork). It is a temporary solution allowing to control flow of + GATT notifications with HID reports for HID use-case. + + Enabling this option may require increasing CONFIG_BT_CONN_TX_MAX in + configuration, because ATT would use additional TX contexts. + config BT_EATT bool "Enhanced ATT Bearers support [EXPERIMENTAL]" depends on BT_L2CAP_ECRED diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 82d82526b5b..37d8856bad2 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -328,6 +328,13 @@ static void att_disconnect(struct bt_att_chan *chan) } } +static void chan_sent_cb(struct bt_conn *conn, void *user_data, int err) +{ + struct net_buf *nb = user_data; + + net_buf_unref(nb); +} + /* In case of success the ownership of the buffer is transferred to the stack * which takes care of releasing it when it completes transmitting to the * controller. @@ -421,7 +428,15 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf) data->att_chan = chan; - err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); + if (IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX)) { + err = bt_l2cap_send_pdu(&chan->chan, buf, chan_sent_cb, net_buf_ref(buf)); + if (err) { + net_buf_unref(buf); + } + } else { + err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); + } + if (err) { if (err == -ENOBUFS) { LOG_ERR("Ran out of TX buffers or contexts."); From e6261f82b09b83c5525abfbec9ac75eeca263ecb Mon Sep 17 00:00:00 2001 From: Sigurd Hellesvik Date: Fri, 23 Aug 2024 11:24:06 +0200 Subject: [PATCH 806/881] [nrf noup] board: nordic_ thingy53: Enable QSPI by default The Thingy:53 enabled MCUboot and external flash by default. Therefore, it should also enable drivers for its external flash by default. Signed-off-by: Sigurd Hellesvik (cherry picked from commit 20671bcf45981a4491aea49326e530978e79d792) --- boards/nordic/thingy53/Kconfig.defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index badcb5c20e5..b7f33e89bf1 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -97,6 +97,9 @@ config MCUBOOT_USB_SUPPORT bool default n +config NORDIC_QSPI_NOR + default y + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From a2ae6e5c1ec857034c789224fb09c7415ba47610 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 9 Sep 2024 08:31:03 +0100 Subject: [PATCH 807/881] [nrf noup] mgmt: mcumgr: grp: img_mgmt: Add handling for QSPI XIP Adds handling code to allow selecting the correct image slot when using QSPI XIP in DirectXIP mode In case of Direct XIP and multiple images, the radio active slot changes accordingly (i.e. application slot 1 boots radio slot 1). Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Chyrowicz (cherry picked from commit a5b67c16269292d3f1f921238591cb8cb848c004) --- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 ++++++++ subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index 0915d70e870..5f122fcf71f 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -219,6 +219,14 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS This will enable the slot info function hooks which can be used to add additional information to responses. +config MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE + bool "QSPI XIP Split image mode" + depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP + help + This option should not be selected by users and should automatically be selected by + sysbuild if needed. This enables selecting the correct slot when running a QSPI XIP + split image application in DirectXIP mode. + module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c index 4c3975f3aad..05e3a9c6488 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -235,6 +235,14 @@ int img_mgmt_active_slot(int image) /* Multi image does not support DirectXIP or RAM load currently */ #if CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER > 1 slot = (image << 1); + +#if defined(CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE) || \ + defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) || \ + defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) + if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) { + slot += 1; + } +#endif #elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) /* RAM load requires querying bootloader */ int rc; From 13fbf6edf4a2977063d550a8d343fda31cc8fc84 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Mon, 16 Sep 2024 15:09:50 +0200 Subject: [PATCH 808/881] [nrf noup] boards/nordic/nrf54l15dk: Set ROM offset by PM While Partition Manager is enabled, it manages the offset by itself. Signed-off-by: Andrzej Puzdrowski (cherry picked from commit cea66ec75f604cbdc74f67165cb50ea478c716cd) --- boards/nordic/nrf54l15dk/Kconfig.defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/nordic/nrf54l15dk/Kconfig.defconfig b/boards/nordic/nrf54l15dk/Kconfig.defconfig index 49e38070a01..c9155426d02 100644 --- a/boards/nordic/nrf54l15dk/Kconfig.defconfig +++ b/boards/nordic/nrf54l15dk/Kconfig.defconfig @@ -8,6 +8,7 @@ if BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ BOARD_NRF54L15DK_NRF54L15_CPUAPP config ROM_START_OFFSET + default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ From 80dbcaaaa69c3f119c9817a2c019a660f38b2dd5 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 26 Sep 2024 12:40:33 +0200 Subject: [PATCH 809/881] [nrf noup] samples: basic: blinky: add eGPIO tests configuration Add overlay for nrf54l15dk to enable eGPIO tests. Signed-off-by: Jakub Zymelka Signed-off-by: Marcin Szymczyk (cherry picked from commit 40b222de413d542f187f039da8eb1e9e3d9a359d) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay diff --git a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay new file mode 100644 index 00000000000..bd1ceb2f894 --- /dev/null +++ b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&led0 { + gpios = <&hpf_gpio 9 GPIO_ACTIVE_HIGH>; +}; From 9900fce58e2c51482cddaf9ccec4e12c51c11795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 11 Sep 2024 10:17:28 +0200 Subject: [PATCH 810/881] [nrf noup] modules: mbedtls: Disable configurations in Kconfig.tls-generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit prevents legacy mbed TLS configurations from being in conflict with PSA Configurations while using nrf_security. -This [nrf noup] is reworked from an earlier cherry-pick of commit d8c96cfab37d3738dac933075780f6ca24593447, but has the following changes: - Endif's relevant that is using our pattern for masking configs duplicated or in conflict in nrf_security (by using if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)) is made clearer by adding a comment at their corresponding endif (# !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)) - Changes to zephyr_init.c for entropy_dev checking for CONFIG_NRF_CC3XX_PLATFORM is removed as the symbol entropy_dev doesn't exist in this file anymore ref: NCSDK-13503 Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit c62b6ebb411e687814e89652273b333a4b47bbae) --- modules/mbedtls/Kconfig.mbedtls | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 4a71ec49614..df2422d4c1e 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -7,6 +7,8 @@ menu "Mbed TLS configuration" depends on MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-mbedtls.h" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + menu "TLS" config MBEDTLS_TLS_VERSION_1_2 @@ -40,6 +42,8 @@ endif # MBEDTLS_TLS_VERSION_1_2 || MBEDTLS_TLS_VERSION_1_3 endmenu # TLS +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + menu "Ciphersuite configuration" comment "Supported key exchange modes" @@ -60,6 +64,8 @@ config MBEDTLS_GENPRIME_ENABLED endif # MBEDTLS_RSA_C +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_MD @@ -92,6 +98,8 @@ config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED bool "RSA-PSK based ciphersuite modes" depends on MBEDTLS_PKCS1_V15 || MBEDTLS_PKCS1_V21 +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -99,6 +107,8 @@ config MBEDTLS_PSK_MAX_LEN Max size of TLS pre-shared keys, in bytes. It has no effect if no PSK key exchange is used. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "RSA-only based ciphersuite modes" depends on MBEDTLS_MD @@ -236,8 +246,12 @@ config MBEDTLS_ECP_NIST_OPTIM endif +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Supported ciphers and cipher modes" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers and modes" select MBEDTLS_CIPHER_AES_ENABLED @@ -328,8 +342,12 @@ config MBEDTLS_CMAC bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers." depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Supported hash algorithms" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_HASH_ALL_ENABLED bool "All available MAC methods" select MBEDTLS_MD5 @@ -370,10 +388,14 @@ config MBEDTLS_SHA512 config MBEDTLS_POLY1305 bool "Poly1305 hash family" +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + endmenu comment "Random number generators" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CTR_DRBG_ENABLED bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED @@ -383,15 +405,21 @@ config MBEDTLS_HMAC_DRBG_ENABLED bool "HMAC_DRBG random generator" select MBEDTLS_MD +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Other configurations" config MBEDTLS_CIPHER bool "generic cipher layer." default y if PSA_WANT_ALG_CMAC +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_MD bool "generic message digest layer." +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ASN1_PARSE_C bool "Support for ASN1 parser functions" @@ -431,6 +459,8 @@ config MBEDTLS_HAVE_ASM of asymmetric cryptography, however this might have an impact on the code size. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ENTROPY_C bool "Mbed TLS entropy accumulator" depends on MBEDTLS_SHA256 || MBEDTLS_SHA384 || MBEDTLS_SHA512 @@ -439,6 +469,8 @@ config MBEDTLS_ENTROPY_C mostly used in conjunction with CTR_DRBG or HMAC_DRBG to create a deterministic random number generator. +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ENTROPY_POLL_ZEPHYR bool "Provide entropy data to Mbed TLS through entropy driver or random generator" default y From 40491883c052d0e48dc49a5eacd1a410272ce305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Mon, 9 Sep 2024 14:55:05 +0200 Subject: [PATCH 811/881] [nrf noup] mbedtls: Enable PSA_WANT_GENERATE_RANDOM for PSA RNG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] because PSA_WANT_GENERATE_RANDOM is a Nordic configuration that is not found upstream. This was previously in commit 5cfe5750b622efff77427425bf61854a95ade9fb but has been split out Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 3c07722fbc78e7432f561696e82bf77982f4550a) --- drivers/entropy/Kconfig.psa_crypto | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/entropy/Kconfig.psa_crypto b/drivers/entropy/Kconfig.psa_crypto index d06001225b0..18514a071d1 100644 --- a/drivers/entropy/Kconfig.psa_crypto +++ b/drivers/entropy/Kconfig.psa_crypto @@ -7,6 +7,7 @@ config ENTROPY_PSA_CRYPTO_RNG bool "PSA Crypto Random source Entropy driver" depends on DT_HAS_ZEPHYR_PSA_CRYPTO_RNG_ENABLED select ENTROPY_HAS_DRIVER + select PSA_WANT_GENERATE_RANDOM default y help Enable the PSA Crypto source Entropy driver. From 7286dec03bfd85d4bc3282b4857f6a6929db6bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:35:25 +0200 Subject: [PATCH 812/881] [nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit is a [nrf noup] because it removes configuration options for cryptographic algortihms available in Mbed TLS but which is not actively supported in nRF Connect SDK. The list of algorithms removed: - AES CFB - Cipher Feedback block cipher - AES OFB - Output Feedback block cipher - FFDH - RIPEMD160 - Aria - Camellia - DES The removal of these algorithms is based both on a wish to remove weaker cryptography and unsupported features in the products we have today. Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 32fa048131dc1eb8dd223c99c3e40649efb720bf) --- modules/mbedtls/Kconfig.psa.auto | 61 ------------------------------- modules/mbedtls/Kconfig.psa.logic | 7 ---- 2 files changed, 68 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 08b1bbc0241..56a81dd6efd 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -36,10 +36,6 @@ config PSA_WANT_ALG_CMAC bool "PSA_WANT_ALG_CMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_CFB - bool "PSA_WANT_ALG_CFB" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_ALG_CHACHA20_POLY1305 bool "PSA_WANT_ALG_CHACHA20_POLY1305" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -60,10 +56,6 @@ config PSA_WANT_ALG_ECDH bool "PSA_WANT_ALG_ECDH" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_FFDH - bool "PSA_WANT_ALG_FFDH" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_ALG_ECDSA bool "PSA_WANT_ALG_ECDSA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -96,9 +88,6 @@ config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_OFB - bool "PSA_WANT_ALG_OFB" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -108,9 +97,6 @@ config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_RIPEMD160 - bool "PSA_WANT_ALG_RIPEMD160" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -228,26 +214,6 @@ config PSA_WANT_ECC_SECP_R1_521 bool "PSA_WANT_ECC_SECP_R1_521" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_DH_RFC7919_2048 - bool "PSA_WANT_DH_RFC7919_2048" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_3072 - bool "PSA_WANT_DH_RFC7919_3072" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_4096 - bool "PSA_WANT_DH_RFC7919_4096" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_6144 - bool "PSA_WANT_DH_RFC7919_6144" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_8192 - bool "PSA_WANT_DH_RFC7919_8192" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_DERIVE bool "PSA_WANT_KEY_TYPE_DERIVE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -268,30 +234,15 @@ config PSA_WANT_KEY_TYPE_AES bool "PSA_WANT_KEY_TYPE_AES" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_ARIA - bool "PSA_WANT_KEY_TYPE_ARIA" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_CAMELLIA - bool "PSA_WANT_KEY_TYPE_CAMELLIA" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DES - bool "PSA_WANT_KEY_TYPE_DES" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY - bool "PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_RAW_DATA bool "PSA_WANT_KEY_TYPE_RAW_DATA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -328,16 +279,4 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - endif # PSA_CRYPTO_CLIENT diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index dcea9e35405..2de81163dc1 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -18,10 +18,3 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC - bool - default y - depends on PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT || \ - PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT || \ - PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE From 7f829614ce9215ba1761a8f609d70f89f2a0b737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:49:58 +0200 Subject: [PATCH 813/881] [nrf noup] mbedtls: Add dependency logic for PSA crypto configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] as this the upstream version of PSA crypto configs is generated by tooling, and there is no mechanisms to qualify that dependent configurations are enabled (by depends or select). -This adds dependency-mapping between configurations in the Kconfigs added for PSA crypto in upstream. -Selecting CHACHA20 key type if PSA_WANT_ALG_STREAM_CIPHER is enabled Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 2abfddff4d8f12849a31dd0842e0a7a07825847e) --- modules/mbedtls/Kconfig.psa.auto | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 56a81dd6efd..fa8cdbc7b53 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -71,6 +71,7 @@ config PSA_WANT_ALG_GCM config PSA_WANT_ALG_HKDF bool "PSA_WANT_ALG_HKDF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_HKDF_EXTRACT bool "PSA_WANT_ALG_HKDF_EXTRACT" if !MBEDTLS_PROMPTLESS @@ -92,11 +93,12 @@ config PSA_WANT_ALG_MD5 config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + depends on PSA_WANT_ALG_CMAC config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -153,18 +155,22 @@ config PSA_WANT_ALG_SHA3_512 config PSA_WANT_ALG_STREAM_CIPHER bool "PSA_WANT_ALG_STREAM_CIPHER" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + select PSA_WANT_KEY_TYPE_CHACHA20 config PSA_WANT_ALG_TLS12_PRF bool "PSA_WANT_ALG_TLS12_PRF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_PSK_TO_MS bool "PSA_WANT_ALG_TLS12_PSK_TO_MS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS bool "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_SHA_256 config PSA_WANT_ECC_BRAINPOOL_P_R1_256 bool "PSA_WANT_ECC_BRAINPOOL_P_R1_256" if !MBEDTLS_PROMPTLESS @@ -237,7 +243,8 @@ config PSA_WANT_KEY_TYPE_AES config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + depends on PSA_WANT_ALG_CHACHA20_POLY1305 || \ + PSA_WANT_ALG_STREAM_CIPHER config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS @@ -253,30 +260,37 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL endif # PSA_CRYPTO_CLIENT From 293d6d16d7c04305bf34601b664b8337c769e3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:53:27 +0200 Subject: [PATCH 814/881] [nrf noup] mbedtls: Adding helptext warnings for weak crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit is a [nrf noup] because PSA crypto configs in upstream Zephyr doesn't have help-text in their configurations and we don't want to duplicate configurations to control the value -This adds warning for SHA-1 and MD5 usage Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 76dee8cd798e036c3d034df18006e06c1b9431f6) --- modules/mbedtls/Kconfig.psa.auto | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index fa8cdbc7b53..834252432b5 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -88,7 +88,9 @@ config PSA_WANT_ALG_HMAC config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + help + Warning: The MD5 hash is weak and deprecated and is only recommended + for use in legacy protocols. config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -119,6 +121,9 @@ config PSA_WANT_ALG_RSA_PSS config PSA_WANT_ALG_SHA_1 bool "PSA_WANT_ALG_SHA_1" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + help + Warning: The SHA-1 hash is weak and deprecated and is only recommended + for use in legacy protocols. config PSA_WANT_ALG_SHA_224 bool "PSA_WANT_ALG_SHA_224" if !MBEDTLS_PROMPTLESS From 7cc81c67fa305da90086f6b90c6c0e8d1dc295a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:56:48 +0200 Subject: [PATCH 815/881] [nrf noup] mbedtls: Adding missing configuration for RSA key type derive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] because the upstream Zephyr is generated using a script and is not committed as-is as source-code. The relevant responsible person for this feature has received information about the missing configuration and this will be resolved upstream in Mbed TLS and will propagate down to zephyr. Once this has happened, this [nrf noup] can be dropped. -Add missing PSA_WANT_KEY_TYPE_RSA_KEY_DERIVE Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 414a6c3008ad17b54a22682962c6eddfa47d6368) --- modules/mbedtls/Kconfig.psa.auto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 834252432b5..b235c30380f 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -298,4 +298,9 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE + bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + default y if PSA_CRYPTO_ENABLE_ALL + endif # PSA_CRYPTO_CLIENT From dccf3bd3433f7bc41b3f64c88a6e801d0ddbb8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 5 Sep 2024 15:05:43 +0200 Subject: [PATCH 816/881] [nrf noup] mbedtls: Don't select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC is internally resolved by Mbed TLS. It has been made promptless in a previous commit. Keeping this change separated since the Kconfig.psa is auto-generated and it would likely be a bit more complex to handle this in a single commit. Upstream maintainers have been notified about this mismatch in configurations. Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 34341c43b31bb2c60c84b98e4322b465edd0e433) --- modules/mbedtls/Kconfig.mbedtls | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index df2422d4c1e..b0077361908 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -117,6 +117,7 @@ config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE if PSA_CRYPTO_CLIENT + select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE if PSA_CRYPTO_CLIENT config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED bool "DHE-RSA based ciphersuite modes" From a3de2d48bfda209c0690bfa5014587b33366e7b2 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 7 May 2024 08:27:09 +0100 Subject: [PATCH 817/881] [nrf noup] kernel: banner: Make function weak Makes the boot banner function weak, this resolves an issue when building with llext enabled which uses different build options than a normal zephyr build Signed-off-by: Jamie McCrae (cherry picked from commit 717e659b48410693135e5e630579ab4671633cb7) --- kernel/banner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/banner.c b/kernel/banner.c index 5cadda0a5e9..a16784cb975 100644 --- a/kernel/banner.c +++ b/kernel/banner.c @@ -24,7 +24,7 @@ #endif /* BUILD_VERSION */ #endif /* !BANNER_VERSION */ -void boot_banner(void) +__weak void boot_banner(void) { #if defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0) #ifdef CONFIG_BOOT_BANNER From 2c4b09301fa4f95109e420d14f39c9eacfb6bd7d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 20 Sep 2024 14:48:37 +0200 Subject: [PATCH 818/881] [nrf noup] lib: os: zvfs: Remove EXPERIMENTAL from ZVFS Although ZVFS is experimental, the warning is annoying the matter team. Therefore, remove the experimental selection. This may be reverted once upstream unselects experimental. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit f52f65458f060758f18daf2b572383b6938eceae) --- lib/os/zvfs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index a9c9518a1d5..495d5c84968 100644 --- a/lib/os/zvfs/Kconfig +++ b/lib/os/zvfs/Kconfig @@ -6,7 +6,6 @@ menuconfig ZVFS bool "Zephyr virtual filesystem (ZVFS) support [EXPERIMENTAL]" select FDTABLE - select EXPERIMENTAL help ZVFS is a central, Zephyr-native library that provides a common interoperable API for all types of file descriptors such as those from the non-virtual FS, sockets, eventfds, FILE *'s From e8fd615c578c28ed35a144a842bf5a6ac7123748 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 7 Oct 2024 15:36:43 +0200 Subject: [PATCH 819/881] [nrf noup] samples: net: Enable Wi-Fi driver in sysbuild builds Make sure Wi-Fi driver is enabled in networking samples supporting Wi-Fi when sysbuild is used. For shields we cannot automate this, as sysbuild doesn't recognize shields, so, Wi-Fi has to be explicitly enabled, this is done for twister in Wi-Fi sample. Signed-off-by: Robert Lubos Signed-off-by: Chaitanya Tata (cherry picked from commit ccf6152219b7547248f52b752f19f770ad444c66) --- samples/net/dns_resolve/Kconfig.sysbuild | 13 +++++++++++++ samples/net/ipv4_autoconf/Kconfig.sysbuild | 13 +++++++++++++ samples/net/lwm2m_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mdns_responder/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mqtt_publisher/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mqtt_sn_publisher/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/coap_server/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_async/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_server/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/http_get/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/sntp_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/syslog_net/Kconfig.sysbuild | 13 +++++++++++++ samples/net/telnet/Kconfig.sysbuild | 13 +++++++++++++ samples/net/wifi/Kconfig.sysbuild | 13 +++++++++++++ samples/net/wifi/shell/sample.yaml | 2 ++ 16 files changed, 197 insertions(+) create mode 100644 samples/net/dns_resolve/Kconfig.sysbuild create mode 100644 samples/net/ipv4_autoconf/Kconfig.sysbuild create mode 100644 samples/net/lwm2m_client/Kconfig.sysbuild create mode 100644 samples/net/mdns_responder/Kconfig.sysbuild create mode 100644 samples/net/mqtt_publisher/Kconfig.sysbuild create mode 100644 samples/net/mqtt_sn_publisher/Kconfig.sysbuild create mode 100644 samples/net/sockets/coap_server/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_async/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_client/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_server/Kconfig.sysbuild create mode 100644 samples/net/sockets/http_get/Kconfig.sysbuild create mode 100644 samples/net/sockets/sntp_client/Kconfig.sysbuild create mode 100644 samples/net/syslog_net/Kconfig.sysbuild create mode 100644 samples/net/telnet/Kconfig.sysbuild create mode 100644 samples/net/wifi/Kconfig.sysbuild diff --git a/samples/net/dns_resolve/Kconfig.sysbuild b/samples/net/dns_resolve/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/dns_resolve/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/ipv4_autoconf/Kconfig.sysbuild b/samples/net/ipv4_autoconf/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/ipv4_autoconf/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/lwm2m_client/Kconfig.sysbuild b/samples/net/lwm2m_client/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/lwm2m_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mdns_responder/Kconfig.sysbuild b/samples/net/mdns_responder/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/mdns_responder/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_publisher/Kconfig.sysbuild b/samples/net/mqtt_publisher/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/mqtt_publisher/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/coap_server/Kconfig.sysbuild b/samples/net/sockets/coap_server/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/sockets/coap_server/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_async/Kconfig.sysbuild b/samples/net/sockets/echo_async/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/sockets/echo_async/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_client/Kconfig.sysbuild b/samples/net/sockets/echo_client/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/sockets/echo_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_server/Kconfig.sysbuild b/samples/net/sockets/echo_server/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/sockets/echo_server/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/http_get/Kconfig.sysbuild b/samples/net/sockets/http_get/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/sockets/http_get/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/sntp_client/Kconfig.sysbuild b/samples/net/sockets/sntp_client/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/sockets/sntp_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/syslog_net/Kconfig.sysbuild b/samples/net/syslog_net/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/syslog_net/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/telnet/Kconfig.sysbuild b/samples/net/telnet/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/telnet/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/Kconfig.sysbuild b/samples/net/wifi/Kconfig.sysbuild new file mode 100644 index 00000000000..158551060c5 --- /dev/null +++ b/samples/net/wifi/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index 5f72e068611..8543e6bfb38 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -58,6 +58,7 @@ tests: - nrf7002dk/nrf5340/cpuapp/nrf7001 sample.net.wifi.nrf7002ek: extra_args: + - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002ek platform_allow: @@ -69,6 +70,7 @@ tests: sample.net.wifi.nrf7002eb: extra_args: - CONFIG_NRF70_UTIL=y + - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002eb platform_allow: From 08d5c2f5de5e6e8a39cbed54a768a024c76b2c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 13:49:59 +0200 Subject: [PATCH 820/881] [nrf noup] mbedtls: Don't enable auto-generation of Mbed TLS files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - We don't use this mechanism in nRF Connect SDK Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit d268008fb254d5fcb01e92931864fca8165a1246) --- tests/crypto/mbedtls/CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/crypto/mbedtls/CMakeLists.txt b/tests/crypto/mbedtls/CMakeLists.txt index 7ebdc9d76a9..47670bead01 100644 --- a/tests/crypto/mbedtls/CMakeLists.txt +++ b/tests/crypto/mbedtls/CMakeLists.txt @@ -6,15 +6,5 @@ project(mbedtls) set(output_file ${PROJECT_BINARY_DIR}/mbedtls-check.timestamp) -add_custom_command( - COMMENT "Check Mbed TLS auto-generated files" - COMMAND - ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/modules/mbedtls/create_psa_files.py --check - OUTPUT - ${output_file} -) - -add_custom_target(check_mbedtls_auto_generated_files ALL DEPENDS ${output_file}) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) From 8fec56ddcb3140604cd417efa6eeaf1e857fe3d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 14:05:41 +0200 Subject: [PATCH 821/881] [nrf noup] net: tests: Add legacy crypto API support for big_http_download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -We handle legacy Crypto API support specially (favoring PSA crypto) the tests here require MD interface to build, which needs the config MBEDTLS_LEGACY_CRYPTO_C to be enable to get access to Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit d9e0b36c715d2afa68d885ae3a0435efd4cac4a9) --- samples/net/sockets/big_http_download/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/net/sockets/big_http_download/prj.conf b/samples/net/sockets/big_http_download/prj.conf index a406f314dfb..8677e7113e4 100644 --- a/samples/net/sockets/big_http_download/prj.conf +++ b/samples/net/sockets/big_http_download/prj.conf @@ -3,6 +3,7 @@ CONFIG_REQUIRES_FULL_LIBC=y CONFIG_MBEDTLS=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_MD=y +CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y CONFIG_MAIN_STACK_SIZE=2536 # Networking config From b0d1b2831f0ced77281e60ac1d180cafce96c9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 14:31:02 +0200 Subject: [PATCH 822/881] [nrf noup] net: tests: crypto: Adding legacy Crypto support ipv6 tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This adds crypto support for ipv6 tests by enabling CONFIG_MBEDTLS_LEGACY_CRYPTO_C Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 462b528e3f91ce8139309d0d07c8bc64edc65042) --- tests/net/ipv6/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index 9f9f21d5905..6a6be5dba36 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -33,6 +33,7 @@ CONFIG_NET_IF_MAX_IPV6_COUNT=2 CONFIG_NET_IPV6_PE=y CONFIG_NET_IPV6_PE_FILTER_PREFIX_COUNT=2 CONFIG_NET_IPV6_PE_PREFER_PUBLIC_ADDRESSES=n +CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y # Increase the stack a bit for mps2/an385 CONFIG_NET_RX_STACK_SIZE=1700 From 01d225b2799ec5f18b3ca6762e202eda02c8f799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayt=C3=BCrk=20D=C3=BCzen?= Date: Wed, 20 Nov 2024 13:06:23 +0100 Subject: [PATCH 823/881] [nrf noup] tests: bluetooth: tester: sysbuild configurable 53/54H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for sysbuild 54h20 building added nrf54h20 cpurad configuration to hci_ipc sample. Signed-off-by: Aytürk Düzen Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 63f0faef7bd0ccffd1970b1677efa04b696b8d70) --- .../nrf54h20_cpurad-bt_ll_softdevice.conf | 33 +++++++++++++++++++ tests/bluetooth/tester/Kconfig.sysbuild | 1 + tests/bluetooth/tester/sysbuild.cmake | 16 +++++++-- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf diff --git a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf new file mode 100644 index 00000000000..1f7748e5cd7 --- /dev/null +++ b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf @@ -0,0 +1,33 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_ISR_STACK_SIZE=1024 +CONFIG_IDLE_STACK_SIZE=256 +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 +CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y + +CONFIG_BT_BUF_EVT_RX_COUNT=16 +CONFIG_BT_BUF_EVT_RX_SIZE=255 +CONFIG_BT_BUF_ACL_RX_SIZE=255 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_BUF_CMD_TX_SIZE=255 + +# Host +CONFIG_BT_BROADCASTER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_PER_ADV=y +CONFIG_BT_PER_ADV_SYNC=y + +# Controller +CONFIG_BT_LL_SW_SPLIT=n +CONFIG_BT_LL_SOFTDEVICE=y +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/tests/bluetooth/tester/Kconfig.sysbuild b/tests/bluetooth/tester/Kconfig.sysbuild index 69e4d5a97fb..e14a6e1aa8e 100644 --- a/tests/bluetooth/tester/Kconfig.sysbuild +++ b/tests/bluetooth/tester/Kconfig.sysbuild @@ -5,6 +5,7 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string + default "nrf54h20dk/nrf54h20/cpurad" if "$(BOARD)" = "nrf54h20dk" default "nrf5340dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340dk" default "nrf5340_audio_dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340_audio_dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP" diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index a9ddf127947..bcd564733c5 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) - # For builds in the nrf5340, we build the netcore image with the controller - set(NET_APP hci_ipc) set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP}) @@ -13,6 +11,20 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) BOARD ${SB_CONFIG_NET_CORE_BOARD} ) + if(SB_CONFIG_SOC_NRF5340_CPUAPP) + set(${NET_APP}_SNIPPET + "bt-ll-sw-split" + CACHE INTERNAL "" + ) + endif() + + if(SB_CONFIG_SOC_NRF54H20_CPUAPP) + set(${NET_APP}_CONF_FILE + ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf + CACHE INTERNAL "" + ) + endif() + set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" From b3991bd174ca77f3031e2df7010753fa95ed30f2 Mon Sep 17 00:00:00 2001 From: Ingar Kulbrandstad Date: Tue, 21 May 2024 13:59:58 +0200 Subject: [PATCH 824/881] [nrf noup] Bluetooth: Mesh: Disable processing of ext ADV packets Disable processing of extended ADV packets by mesh scanner. This is done to prevent loss of scan time due to reception of pointer packets while scanning for mesh packets. Signed-off-by: Ingar Kulbrandstad (cherry picked from commit bc11d5db02692ffaa2a6e75ec939f2b9fa404d03) --- subsys/bluetooth/mesh/Kconfig | 11 +++++++++++ subsys/bluetooth/mesh/adv_ext.c | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index bb0e8be8eb8..80846310c63 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -214,6 +214,17 @@ config BT_MESH_ADV_EXT_FRIEND_SEPARATE messages as close to the start of the ReceiveWindow as possible, thus reducing the scanning time on the Low Power node. +config BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS + bool "Reject or accept extended advertising packets" + depends on BT_LL_SOFTDEVICE + help + Configure the scanner and initiator to either reject or accept extended + advertising packets by the SoftDevice Controller. This is set to false + by default, to prevent loss of scan time when receiving a pointer packet + while scanning for Bluetooth Mesh packets. Set to true if extended + advertising packets are to be received by the SoftDevice Controller for + purposes other than Bluetooth Mesh. + endif # BT_MESH_ADV_EXT endchoice diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 0e6f6120f73..c74f0a40d99 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -519,6 +519,18 @@ void bt_mesh_adv_init(void) K_PRIO_COOP(MESH_WORKQ_PRIORITY), NULL); k_thread_name_set(&bt_mesh_workq.thread, "BT MESH WQ"); } + +#if defined(CONFIG_BT_LL_SOFTDEVICE) + const sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t cmd_params = { + .accept_ext_adv_packets = IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS), + }; + + int err = sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set(&cmd_params); + + if (err) { + LOG_ERR("Failed to set accept_ext_adv_packets: %d", err); + } +#endif } static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance) From 6bc909e38a14f1c071ef7f4d422342fa2a6ed31a Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Mon, 16 Jan 2023 14:15:22 +0100 Subject: [PATCH 825/881] [nrf noup] dts: choose a crypto accelerator for entropy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a long-term noup patch because crypto driver support is NCS-only for both cryptocell and CRACEN. Set HAS_HW_NRF_CC3XX to be defined in NS build when cryptocell is accessed through the PSA API. We need to know which CC3XX features are available. Set PSA as the entropy source for 54L. PSA is the only NCS-supported interface to CRACEN. Signed-off-by: Georgios Vasilakis Signed-off-by: Joakim Andersson Signed-off-by: Dominik Ermel Signed-off-by: Sebastian Bøe Signed-off-by: Robert Lubos Signed-off-by: Rubin Gerritsen (cherry picked from commit 53fae56efca3c201e8faa1433b7c3ee98b4e6dd6) --- dts/arm/nordic/nrf52840.dtsi | 4 ++-- dts/arm/nordic/nrf5340_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf91.dtsi | 3 ++- soc/nordic/common/Kconfig.peripherals | 6 ++++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index dab5f762058..bcbfd926c9b 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -8,7 +8,7 @@ / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -572,7 +572,7 @@ reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>; reg-names = "wrapper", "core"; interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index b9762248a5d..b4c077ea2bf 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -34,7 +34,7 @@ }; chosen { - zephyr,entropy = &rng_hci; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -104,7 +104,7 @@ reg = <0x50844000 0x1000>, <0x50845000 0x1000>; reg-names = "wrapper", "core"; interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 3f1fe655b6e..8b0339eda39 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -16,7 +16,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -32,7 +32,7 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 1747dcea74a..7b7d4891651 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -28,6 +28,7 @@ }; chosen { + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -51,7 +52,7 @@ reg = <0x50840000 0x1000>, <0x50841000 0x1000>; reg-names = "wrapper", "core"; interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; ctrlap: ctrlap@50006000 { diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index d7e489b446a..fa7fd2a411a 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -13,10 +13,12 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) || \ + ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91X) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \ + ($(dt_nodelabel_enabled,psa_rng) && SOC_NRF5340_CPUAPP) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM)) From 24cdaf5cf4bb5bf6c1417bc23002db94ba4ac477 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Thu, 5 Sep 2024 08:04:15 +0200 Subject: [PATCH 826/881] [nrf noup] dts: Select SoftDevice Controller DTS binding as default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. It should therefore have its own device tree binding. This commit converts the SoftDevice Controller driver to use this new DTS binding instead of reusing the existing one. This commit updates or adds additional overlays for existing samples, applications and tests that were using the open source link layer. Signed-off-by: Rubin Gerritsen Signed-off-by: Kristoffer Rist Skøien Signed-off-by: Rafał Kuźnia (cherry picked from commit 946fcec6c632424ca0a7e2ee7cc9a5df7eb1180e) (cherry picked from commit 6d216e1a427579ef6fba03c6cb0fa90d4d9e1504) --- .../nrf54l20pdk/nrf54l20_cpuapp_common.dtsi | 131 +++ dts/arm/nordic/nrf52805.dtsi | 11 +- dts/arm/nordic/nrf52810.dtsi | 11 +- dts/arm/nordic/nrf52811.dtsi | 11 +- dts/arm/nordic/nrf52820.dtsi | 11 +- dts/arm/nordic/nrf52832.dtsi | 11 +- dts/arm/nordic/nrf52833.dtsi | 11 +- dts/arm/nordic/nrf52840.dtsi | 11 +- dts/arm/nordic/nrf5340_cpunet.dtsi | 11 +- dts/arm/nordic/nrf54h20_cpurad.dtsi | 4 +- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +- dts/vendor/nordic/nrf54h20.dtsi | 7 +- dts/vendor/nordic/nrf54l20.dtsi | 852 ++++++++++++++++++ dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 +- .../bluetooth/bap_broadcast_sink/sample.yaml | 4 +- .../bap_broadcast_sink/sysbuild.cmake | 4 + .../bap_broadcast_source/sample.yaml | 4 +- .../bap_broadcast_source/sysbuild.cmake | 4 + .../bluetooth/bap_unicast_client/sample.yaml | 4 +- .../bap_unicast_client/sysbuild.cmake | 4 + .../bluetooth/bap_unicast_server/sample.yaml | 4 +- .../bap_unicast_server/sysbuild.cmake | 4 + samples/bluetooth/beacon/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sysbuild.cmake | 4 + samples/bluetooth/cap_initiator/sample.yaml | 4 +- .../bluetooth/cap_initiator/sysbuild.cmake | 4 + .../direction_finding_central/sample.yaml | 15 +- .../sample.yaml | 14 +- .../sample.yaml | 14 +- .../direction_finding_peripheral/sample.yaml | 15 +- samples/bluetooth/hci_ipc/sample.yaml | 34 +- samples/bluetooth/hci_uart/sample.yaml | 18 +- samples/bluetooth/hci_vs_scan_req/sample.yaml | 2 + samples/bluetooth/iso_central/sample.yaml | 6 +- .../pbp_public_broadcast_sink/sample.yaml | 4 +- .../pbp_public_broadcast_sink/sysbuild.cmake | 4 + .../pbp_public_broadcast_source/sample.yaml | 4 +- .../sysbuild.cmake | 4 + .../bt-ll-sw-split/bt-ll-sw-split.overlay | 4 + .../controller/ll_sw/nordic/lll/lll.c | 2 +- .../controller/ctrl_api/testcase.yaml | 2 + .../controller/ctrl_chmu/testcase.yaml | 2 + .../controller/ctrl_cis_create/testcase.yaml | 2 + .../ctrl_cis_terminate/testcase.yaml | 2 + .../controller/ctrl_collision/testcase.yaml | 2 + .../controller/ctrl_conn_update/testcase.yaml | 11 +- .../controller/ctrl_cte_req/testcase.yaml | 2 + .../ctrl_data_length_update/testcase.yaml | 10 +- .../controller/ctrl_encrypt/testcase.yaml | 2 + .../ctrl_feature_exchange/testcase.yaml | 2 + .../controller/ctrl_hci/testcase.yaml | 2 + .../controller/ctrl_invalid/testcase.yaml | 2 + .../controller/ctrl_le_ping/testcase.yaml | 2 + .../ctrl_min_used_chans/testcase.yaml | 2 + .../controller/ctrl_phy_update/testcase.yaml | 6 +- .../controller/ctrl_sca_update/testcase.yaml | 2 + .../controller/ctrl_sw_privacy/testcase.yaml | 2 + .../controller/ctrl_terminate/testcase.yaml | 2 + .../ctrl_tx_buffer_alloc/testcase.yaml | 22 +- .../controller/ctrl_tx_queue/testcase.yaml | 2 + .../controller/ctrl_unsupported/testcase.yaml | 6 +- .../controller/ctrl_user_ext/testcase.yaml | 2 + .../controller/ctrl_version/testcase.yaml | 2 + .../df/connection_cte_req/testcase.yaml | 2 + .../df/connection_cte_tx_params/testcase.yaml | 2 + .../connectionless_cte_chains/testcase.yaml | 2 + .../df/connectionless_cte_rx/testcase.yaml | 2 + .../df/connectionless_cte_tx/testcase.yaml | 2 + tests/bluetooth/init/testcase.yaml | 101 ++- 70 files changed, 1366 insertions(+), 122 deletions(-) create mode 100644 boards/nordic/nrf54l20pdk/nrf54l20_cpuapp_common.dtsi create mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/boards/nordic/nrf54l20pdk/nrf54l20_cpuapp_common.dtsi b/boards/nordic/nrf54l20pdk/nrf54l20_cpuapp_common.dtsi new file mode 100644 index 00000000000..f719b2d9392 --- /dev/null +++ b/boards/nordic/nrf54l20pdk/nrf54l20_cpuapp_common.dtsi @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is common to the secure and non-secure domain */ + +#include +#include "nrf54l20pdk_nrf54l20-common.dtsi" + +/ { + chosen { + zephyr,console = &uart20; + zephyr,shell-uart = &uart20; + zephyr,uart-mcumgr = &uart20; + zephyr,bt-mon-uart = &uart20; + zephyr,bt-c2h-uart = &uart20; + zephyr,flash-controller = &rram_controller; + zephyr,flash = &cpuapp_rram; + zephyr,bt-hci = &bt_hci_sdc; + zephyr,ieee802154 = &ieee802154; + }; +}; + +&cpuapp_sram { + status = "okay"; +}; + +&lfxo { + load-capacitors = "internal"; + load-capacitance-femtofarad = <15500>; +}; + +&hfxo { + load-capacitors = "internal"; + load-capacitance-femtofarad = <15000>; +}; + +&grtc { + owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>; + /* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */ + child-owned-channels = <3 4 7 8 9 10 11>; + status = "okay"; +}; + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(449)>; + }; + + slot0_ns_partition: partition@80400 { + label = "image-0-nonsecure"; + reg = <0x80400 DT_SIZE_K(449)>; + }; + + slot1_partition: partition@f0800 { + label = "image-1"; + reg = <0xf0800 DT_SIZE_K(449)>; + }; + + slot1_ns_partition: partition@160c00 { + label = "image-1-nonsecure"; + reg = <0x160c00 DT_SIZE_K(449)>; + }; + + storage_partition: partition@1d1000 { + label = "storage"; + reg = <0x1d1000 DT_SIZE_K(36)>; + }; + }; +}; + +&uart20 { + status = "okay"; +}; + +&nfct { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpiote30 { + status = "okay"; +}; + +&radio { + status = "okay"; +}; + +&temp { + status = "okay"; +}; + +&clock { + status = "okay"; +}; + +&bt_hci_sdc { + status = "okay"; +}; + +&ieee802154 { + status = "okay"; +}; diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 45a54f97b06..2134605c9f8 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -106,12 +106,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 217758dd161..6e09220e78b 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -110,12 +110,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 670f569c0ac..12d0a0ea4d6 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -122,12 +122,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index 50c8d2ba07f..d15fbb2ae4e 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -124,12 +124,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK another Bluetooth controller - * is added and set as the default. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index 7bd62c70754..eef2297c43b 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -110,12 +110,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 8202ddc4543..1b3620aa01c 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -124,12 +124,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index bcbfd926c9b..f19383ba7e7 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -112,12 +112,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 4f9164767f1..be0fad16d66 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -9,7 +9,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -102,12 +102,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index bf194df4478..8bd3c045906 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -24,7 +24,7 @@ wdt011: &cpurad_wdt011 {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; }; soc { @@ -164,6 +164,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 8b0339eda39..80875058f5f 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -15,7 +15,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -36,7 +36,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 1f4160ac897..d9703493a49 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -483,9 +483,10 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi new file mode 100644 index 00000000000..bee70effa0e --- /dev/null +++ b/dts/vendor/nordic/nrf54l20.dtsi @@ -0,0 +1,852 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr"; + reg = <1>; + device_type = "cpu"; + riscv,isa = "rv32emc"; + nordic,bus-width = <64>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + pclk32m: pclk32m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + aclk: aclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; + + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(447)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 0x6fc00>; + }; + + cpuflpr_sram: memory@2006fc00 { + compatible = "mmio-sram"; + reg = <0x2006fc00 DT_SIZE_K(64)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2006fc00 0x10000>; + }; + + global_peripherals: peripheral@50000000 { + ranges = <0x0 0x50000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x143c>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + spi00: spi@4d000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart00: uart@4d000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + pdm20: pdm@d0000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd0000 0x1000>; + interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pdm21: pdm@d1000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd1000 0x1000>; + interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pwm20: pwm@d2000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd2000 0x1000>; + interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm21: pwm@d3000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd3000 0x1000>; + interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm22: pwm@d4000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd4000 0x1000>; + interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <16>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + tdm: tdm@e8000 { + compatible = "nordic,nrf-tdm"; + easydma-maxcnt-bits = <15>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xe8000 0x1000>; + interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + clocks = <&pclk32m>; + }; + + i2c23: i2c@ed000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi23: spi@ed000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart23: uart@ed000 { + compatible = "nordic,nrf-uarte"; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c24: i2c@ee000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi24: spi@ee000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart24: uart@ee000 { + compatible = "nordic,nrf-uarte"; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <5>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@51c { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x51c 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@520 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x520 0x1>; + status = "disabled"; + }; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1972)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + + cpuflpr_rram: rram@1ed000 { + compatible = "soc-nv-flash"; + reg = <0x1ed000 DT_SIZE_K(64)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index aa259713d2f..95c27375038 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -250,9 +250,11 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/samples/bluetooth/bap_broadcast_sink/sample.yaml b/samples/bluetooth/bap_broadcast_sink/sample.yaml index 5d06dee0bf8..148b8b64169 100644 --- a/samples/bluetooth/bap_broadcast_sink/sample.yaml +++ b/samples/bluetooth/bap_broadcast_sink/sample.yaml @@ -24,5 +24,7 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake index 2523aac8ea7..d5d260789ff 100644 --- a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_broadcast_source/sample.yaml b/samples/bluetooth/bap_broadcast_source/sample.yaml index 5e5b01d942d..5f745cd0895 100644 --- a/samples/bluetooth/bap_broadcast_source/sample.yaml +++ b/samples/bluetooth/bap_broadcast_source/sample.yaml @@ -36,5 +36,7 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake index 2523aac8ea7..d5d260789ff 100644 --- a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_client/sample.yaml b/samples/bluetooth/bap_unicast_client/sample.yaml index 7283090b878..44f32934ce9 100644 --- a/samples/bluetooth/bap_unicast_client/sample.yaml +++ b/samples/bluetooth/bap_unicast_client/sample.yaml @@ -22,5 +22,7 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_client/sysbuild.cmake b/samples/bluetooth/bap_unicast_client/sysbuild.cmake index 2523aac8ea7..d5d260789ff 100644 --- a/samples/bluetooth/bap_unicast_client/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_client/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_server/sample.yaml b/samples/bluetooth/bap_unicast_server/sample.yaml index 068f752b626..266ced73f66 100644 --- a/samples/bluetooth/bap_unicast_server/sample.yaml +++ b/samples/bluetooth/bap_unicast_server/sample.yaml @@ -22,5 +22,7 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_server/sysbuild.cmake b/samples/bluetooth/bap_unicast_server/sysbuild.cmake index 2523aac8ea7..d5d260789ff 100644 --- a/samples/bluetooth/bap_unicast_server/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_server/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index 23ffad73c79..00215341924 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -20,7 +20,9 @@ tests: - ophelia4ev/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp sample.bluetooth.beacon-coex: - extra_args: CONF_FILE="prj-coex.conf" + extra_args: + - CONF_FILE="prj-coex.conf" + - SNIPPET="bt-ll-sw-split" harness: bluetooth platform_allow: - nrf52840dk/nrf52840 diff --git a/samples/bluetooth/cap_acceptor/sample.yaml b/samples/bluetooth/cap_acceptor/sample.yaml index 824e744eeca..9061f44679f 100644 --- a/samples/bluetooth/cap_acceptor/sample.yaml +++ b/samples/bluetooth/cap_acceptor/sample.yaml @@ -26,5 +26,7 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/cap_acceptor/sysbuild.cmake b/samples/bluetooth/cap_acceptor/sysbuild.cmake index 2523aac8ea7..d5d260789ff 100644 --- a/samples/bluetooth/cap_acceptor/sysbuild.cmake +++ b/samples/bluetooth/cap_acceptor/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/cap_initiator/sample.yaml b/samples/bluetooth/cap_initiator/sample.yaml index b4f593c9912..e3e557f4830 100644 --- a/samples/bluetooth/cap_initiator/sample.yaml +++ b/samples/bluetooth/cap_initiator/sample.yaml @@ -26,5 +26,7 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/cap_initiator/sysbuild.cmake b/samples/bluetooth/cap_initiator/sysbuild.cmake index 2523aac8ea7..d5d260789ff 100644 --- a/samples/bluetooth/cap_initiator/sysbuild.cmake +++ b/samples/bluetooth/cap_initiator/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index b7a118e6cdc..ffdf634c6e3 100644 --- a/samples/bluetooth/direction_finding_central/sample.yaml +++ b/samples/bluetooth/direction_finding_central/sample.yaml @@ -14,15 +14,24 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.central.aod: + sample.bluetooth.direction_finding.central.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aod.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aod.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding.central.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aod.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml index 8e6097de58a..c500cc80dce 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml @@ -12,14 +12,22 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless_rx.aod: + sample.bluetooth.direction_finding_connectionless_rx.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aod.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aod.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless_rx.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aod.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 78d21b2c95f..2a4fa93d19d 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -12,14 +12,22 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless.aoa: + sample.bluetooth.direction_finding_connectionless.aoa_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aoa.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless.aoa_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_peripheral/sample.yaml b/samples/bluetooth/direction_finding_peripheral/sample.yaml index f300cb415cc..01f612ad08a 100644 --- a/samples/bluetooth/direction_finding_peripheral/sample.yaml +++ b/samples/bluetooth/direction_finding_peripheral/sample.yaml @@ -14,15 +14,24 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.peripheral.aod: + sample.bluetooth.direction_finding.peripheral.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aoa.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding.peripheral.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/hci_ipc/sample.yaml b/samples/bluetooth/hci_ipc/sample.yaml index b758b254768..3763478b6b3 100644 --- a/samples/bluetooth/hci_ipc/sample.yaml +++ b/samples/bluetooth/hci_ipc/sample.yaml @@ -15,7 +15,9 @@ tests: sample.bluetooth.hci_ipc.iso_broadcast.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -25,7 +27,9 @@ tests: sample.bluetooth.hci_ipc.iso_receive.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -35,7 +39,9 @@ tests: sample.bluetooth.hci_ipc.bis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -45,7 +51,9 @@ tests: sample.bluetooth.hci_ipc.iso_central.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -55,7 +63,9 @@ tests: sample.bluetooth.hci_ipc.iso_peripheral.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -65,7 +75,9 @@ tests: sample.bluetooth.hci_ipc.cis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -75,7 +87,9 @@ tests: sample.bluetooth.hci_ipc.iso.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -99,6 +113,7 @@ tests: extra_args: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet @@ -109,13 +124,16 @@ tests: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - CONFIG_BT_CTLR_PHY_CODED=n + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet sample.bluetooth.hci_ipc.mesh.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet diff --git a/samples/bluetooth/hci_uart/sample.yaml b/samples/bluetooth/hci_uart/sample.yaml index df2b40135c6..8555c65cf0d 100644 --- a/samples/bluetooth/hci_uart/sample.yaml +++ b/samples/bluetooth/hci_uart/sample.yaml @@ -24,7 +24,9 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -33,7 +35,9 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -44,7 +48,9 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -54,7 +60,9 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df.iq_report: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -88,6 +96,7 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth @@ -99,6 +108,7 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf54l15dk_nrf54l15_cpuapp_df.overlay + - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth diff --git a/samples/bluetooth/hci_vs_scan_req/sample.yaml b/samples/bluetooth/hci_vs_scan_req/sample.yaml index 245a83aa0d9..49526522d16 100644 --- a/samples/bluetooth/hci_vs_scan_req/sample.yaml +++ b/samples/bluetooth/hci_vs_scan_req/sample.yaml @@ -9,4 +9,6 @@ tests: - nrf52dk/nrf52832 extra_configs: - CONFIG_BT_LL_SW_SPLIT=y + extra_args: + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/iso_central/sample.yaml b/samples/bluetooth/iso_central/sample.yaml index 3a7dedd404a..57254ee809a 100644 --- a/samples/bluetooth/iso_central/sample.yaml +++ b/samples/bluetooth/iso_central/sample.yaml @@ -11,11 +11,11 @@ tests: sample.bluetooth.iso_central.bt_ll_sw_split: harness: bluetooth platform_allow: - - qemu_cortex_m3 - - qemu_x86 - nrf52_bsim - nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml index d7c816ee5b7..901d40b00d4 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml @@ -23,5 +23,7 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake index 2523aac8ea7..d5d260789ff 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml index 80c90704211..1d2e31306e2 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml @@ -23,5 +23,7 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake index d3bf7be5b6c..e0a7fd9d175 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake @@ -18,6 +18,10 @@ if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay index 04bf83ef44d..a57a0e82ba6 100644 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay +++ b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay @@ -2,6 +2,10 @@ status = "okay"; }; +&bt_hci_sdc { + status = "disabled"; +}; + / { chosen { zephyr,bt-hci = &bt_hci_controller; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index b44847c0585..cada046f049 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -62,7 +62,7 @@ static struct { /* FIXME: This could probably use a chosen entropy device instead on relying on * the nodelabel being the same as for the old nrf rng. */ -static const struct device *const dev_entropy = DEVICE_DT_GET(DT_NODELABEL(rng)); +static const struct device *const dev_entropy = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy)); #endif /* CONFIG_ENTROPY_HAS_DRIVER */ static int init_reset(void); diff --git a/tests/bluetooth/controller/ctrl_api/testcase.yaml b/tests/bluetooth/controller/ctrl_api/testcase.yaml index 19bf6c9ab49..21f178bf9b2 100644 --- a/tests/bluetooth/controller/ctrl_api/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_api/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_api.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml index f7e8068d60e..9c3ee626433 100644 --- a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_chmu.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml index 99612a89bc3..2371d7063eb 100644 --- a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cis_create.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml index 956172a89b2..a98229ba45f 100644 --- a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cis_terminate.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_collision/testcase.yaml b/tests/bluetooth/controller/ctrl_collision/testcase.yaml index 6086a9a4ebc..daa8f3bc6c3 100644 --- a/tests/bluetooth/controller/ctrl_collision/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_collision/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_collision.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml index 5b0bda4b908..fc4ecb0b647 100644 --- a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml @@ -7,11 +7,18 @@ common: tests: bluetooth.controller.ctrl_conn_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_conn_update.apm_test: type: unit - extra_args: CONF_FILE=prj_apm.conf + extra_args: + - CONF_FILE=prj_apm.conf + - SNIPPET="bt-ll-sw-split" + bluetooth.controller.ctrl_conn_update.no_param_req_test: type: unit - extra_args: CONF_FILE=prj_no_param_req.conf + extra_args: + - CONF_FILE=prj_no_param_req.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml index fd6ff51118d..c6288aecc43 100644 --- a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cte_req.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml index 9778af435b4..c7d1174e12b 100644 --- a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml @@ -6,11 +6,17 @@ common: tests: bluetooth.controller.ctrl_data_length_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nocodedphy: type: unit - extra_args: CONF_FILE=prj_nocoded.conf + extra_args: + - CONF_FILE=prj_nocoded.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nophy: type: unit - extra_args: CONF_FILE=prj_nophy.conf + extra_args: + - CONF_FILE=prj_nophy.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml index d5bb2cb8b11..86dd5bfe4d3 100644 --- a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_encrypt.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml index 257542f3612..087e49575ff 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_feature_exchange.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_hci/testcase.yaml b/tests/bluetooth/controller/ctrl_hci/testcase.yaml index d7f7ce7168d..e0735bae696 100644 --- a/tests/bluetooth/controller/ctrl_hci/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_hci/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_hci.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml index 2d1741931e3..cee54e6b09e 100644 --- a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_invalid.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml index b6a77528f32..54178905da1 100644 --- a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_le_ping.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml index 0991b0cdd43..a9445cbf8c4 100644 --- a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_min_used_chans.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml index 1d7da169f1d..d5c49d587a8 100644 --- a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml @@ -6,6 +6,10 @@ common: tests: bluetooth.controller.ctrl_phy_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_phy_update.test_reduced_buf: type: unit - extra_args: CONF_FILE=prj_rx_cnt.conf + extra_args: + - CONF_FILE=prj_rx_cnt.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml index cbf63aa1b57..cbc3c3faf72 100644 --- a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_sca_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml index 778606d6954..ac5dd6e957e 100644 --- a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml @@ -4,3 +4,5 @@ common: tests: bluetooth.ctrl_sw_privacy.test: platform_allow: nrf52_bsim + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml index cbe639401ea..6b1409e9653 100644 --- a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_terminate.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml index 614eb7fe94c..363986bd3d3 100644 --- a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml @@ -6,23 +6,35 @@ common: tests: bluetooth.controller.ctrl_tx_buffer_alloc.test_0_per_conn: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_1_per_conn: type: unit - extra_args: CONF_FILE=prj_1.conf + extra_args: + - CONF_FILE=prj_1.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_2_per_conn: type: unit - extra_args: CONF_FILE=prj_2.conf + extra_args: + - CONF_FILE=prj_2.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_3_per_conn: type: unit - extra_args: CONF_FILE=prj_3.conf + extra_args: + - CONF_FILE=prj_3.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_max_per_conn_alloc: type: unit - extra_args: CONF_FILE=prj_max.conf + extra_args: + - CONF_FILE=prj_max.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_max_common_alloc: type: unit - extra_args: CONF_FILE=prj_max_common.conf + extra_args: + - CONF_FILE=prj_max_common.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml index 295ad891a63..282b620b317 100644 --- a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml @@ -5,3 +5,5 @@ common: tests: bluetooth.ctrl_tx_queue.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml index 28aba1a752a..48b18af9353 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml @@ -6,7 +6,11 @@ common: tests: bluetooth.controller.ctrl_unsupported.default.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_unsupported.test: type: unit - extra_args: CONF_FILE=prj_unsupported.conf + extra_args: + - CONF_FILE=prj_unsupported.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml index af319a7a719..be963df24a8 100644 --- a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml @@ -4,3 +4,5 @@ common: tests: bluetooth.ctrl_user_ext.test: platform_allow: nrf52_bsim + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_version/testcase.yaml b/tests/bluetooth/controller/ctrl_version/testcase.yaml index 6badcbc7254..5df86b9bca9 100644 --- a/tests/bluetooth/controller/ctrl_version/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_version/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_version.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_req/testcase.yaml b/tests/bluetooth/df/connection_cte_req/testcase.yaml index 768aba4a51f..fbfe4b0d9a1 100644 --- a/tests/bluetooth/df/connection_cte_req/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_req/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.conection_cte_req: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml index 38a23b0950e..a9986c5b0e5 100644 --- a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.conection_cte_tx_params: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml index 6aa5bb0f0c1..844a7bbb524 100644 --- a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_chains: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml index f839b1910eb..c8f08a90843 100644 --- a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_rx: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml index 77d651d0cbc..491cc0e7e59 100644 --- a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_tx: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/init/testcase.yaml b/tests/bluetooth/init/testcase.yaml index dd44257e012..a5cc40cd39e 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -74,7 +74,9 @@ tests: extra_args: CONF_FILE=prj_9.conf platform_allow: qemu_cortex_m3 bluetooth.init.test_ctlr: - extra_args: CONF_FILE=prj_ctlr.conf + extra_args: + - CONF_FILE=prj_ctlr.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -86,7 +88,9 @@ tests: - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_4_0: - extra_args: CONF_FILE=prj_ctlr_4_0.conf + extra_args: + - CONF_FILE=prj_ctlr_4_0.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -95,7 +99,9 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_4_0_dbg: - extra_args: CONF_FILE=prj_ctlr_4_0_dbg.conf + extra_args: + - CONF_FILE=prj_ctlr_4_0_dbg.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -104,7 +110,9 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_tiny: - extra_args: CONF_FILE=prj_ctlr_tiny.conf + extra_args: + - CONF_FILE=prj_ctlr_tiny.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -116,6 +124,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -126,6 +135,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr_5_x_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -137,6 +147,7 @@ tests: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_CTLR_ADVANCED_FEATURES=y - CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf52840dk/nrf52840 @@ -146,13 +157,16 @@ tests: bluetooth.init.test_ctlr_ticker: extra_args: - CONF_FILE=prj_ctlr_ticker.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_broadcaster: - extra_args: CONF_FILE=prj_ctlr_broadcaster.conf + extra_args: + - CONF_FILE=prj_ctlr_broadcaster.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -161,7 +175,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral: - extra_args: CONF_FILE=prj_ctlr_peripheral.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -170,7 +186,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral_priv: - extra_args: CONF_FILE=prj_ctlr_peripheral_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -179,7 +197,9 @@ tests: integration_platforms: - nrf52840dk/nrf52840 bluetooth.init.test_ctlr_observer: - extra_args: CONF_FILE=prj_ctlr_observer.conf + extra_args: + - CONF_FILE=prj_ctlr_observer.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -188,7 +208,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_central: - extra_args: CONF_FILE=prj_ctlr_central.conf + extra_args: + - CONF_FILE=prj_ctlr_central.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -198,7 +220,9 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_central_priv: - extra_args: CONF_FILE=prj_ctlr_central_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_central_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -208,7 +232,9 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_broadcaster_ext: - extra_args: CONF_FILE=prj_ctlr_broadcaster_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_broadcaster_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -217,7 +243,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext: - extra_args: CONF_FILE=prj_ctlr_peripheral_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -226,7 +254,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext_priv: - extra_args: CONF_FILE=prj_ctlr_peripheral_ext_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_ext_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -235,7 +265,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_oberver_ext: - extra_args: CONF_FILE=prj_ctlr_observer_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_observer_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -244,7 +276,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext: - extra_args: CONF_FILE=prj_ctlr_central_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_central_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -253,7 +287,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext_priv: - extra_args: CONF_FILE=prj_ctlr_central_ext_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_central_ext_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -262,7 +298,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv: - extra_args: CONF_FILE=prj_ctlr_per_adv.conf + extra_args: + - CONF_FILE=prj_ctlr_per_adv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -271,7 +309,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv_no_adi: - extra_args: CONF_FILE=prj_ctlr_per_adv_no_adi.conf + extra_args: + - CONF_FILE=prj_ctlr_per_adv_no_adi.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -280,7 +320,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync: - extra_args: CONF_FILE=prj_ctlr_per_sync.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -289,7 +331,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_adi: - extra_args: CONF_FILE=prj_ctlr_per_sync_no_adi.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync_no_adi.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -298,7 +342,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_filter: - extra_args: CONF_FILE=prj_ctlr_per_sync_no_filter.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync_no_filter.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -307,7 +353,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_iso: - extra_args: CONF_FILE=prj_ctlr_peripheral_iso.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_iso.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -316,7 +364,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_iso: - extra_args: CONF_FILE=prj_ctlr_central_iso.conf + extra_args: + - CONF_FILE=prj_ctlr_central_iso.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -335,7 +385,9 @@ tests: - DTC_OVERLAY_FILE=h5.overlay platform_allow: qemu_cortex_m3 bluetooth.init.test_llcp: - extra_args: CONF_FILE=prj_llcp.conf + extra_args: + - CONF_FILE=prj_llcp.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -347,6 +399,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_RECV_WORKQ_BT=y + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 bluetooth.init.test_host_6_x: From 668f6e7d8940655dedc66d5329df10eed585e386 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 21 Jun 2024 13:25:22 +0200 Subject: [PATCH 827/881] [nrf noup] soc: nrf54l: Add custom section for KMU Add a custom section in the linker which should always be placed in the top of RAM. This will be used by the KMU to push keys into it. Since when you provision a key into the KMU you need to set specific a memory location for the PUSH operation we need to keep this memory location static across images/dfus. The linker script inclusion which places the KMU reserved buffer on the top of RAM doesn't work for non-XIP builds. The Zephyr linker script will firstly load the code for an non-XIP build in RAM and then include this KMU related linker script which results in an unpredictable placement of the KMU reserved area and a failed build. In order to support non-XIP builds the linker file is not included and the a DTS reserved-memory entry should be used. To limit the scope, the DTS reserved memory region is currently only supported for non-XIP builds. This is a noup since the KMU is not supported upstream. Ref: NCSDK-25121 Signed-off-by: Georgios Vasilakis (cherry picked from commit e9da911d1d201b953c920a536f1c1c6b0cda5327) --- soc/nordic/nrf54l/CMakeLists.txt | 9 +++++++++ soc/nordic/nrf54l/kmu_push_area_section.ld | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 soc/nordic/nrf54l/kmu_push_area_section.ld diff --git a/soc/nordic/nrf54l/CMakeLists.txt b/soc/nordic/nrf54l/CMakeLists.txt index cebbda571b6..d986fe9c20d 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -6,3 +6,12 @@ zephyr_library_sources( ../validate_rram_partitions.c ) zephyr_include_directories(.) + +# We need a buffer in memory in a static location which can be used by +# the KMU peripheral. The KMU has a static destination address, we chose +# this address to be 0x20000000, which is the first address in the SRAM. +if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND CONFIG_XIP) +# Exclamation mark is printable character with the lowest number in ASCII table. +# We are sure that this file will be included first. +zephyr_linker_sources(RAM_SECTIONS SORT_KEY ! kmu_push_area_section.ld) +endif() diff --git a/soc/nordic/nrf54l/kmu_push_area_section.ld b/soc/nordic/nrf54l/kmu_push_area_section.ld new file mode 100644 index 00000000000..e8c8cd9f09a --- /dev/null +++ b/soc/nordic/nrf54l/kmu_push_area_section.ld @@ -0,0 +1,19 @@ +# This section must be loaded first of all the +# custom sections because we want it to be placed +# at the top address of RAM. +SECTION_PROLOGUE(NRF_KMU_RESERVED_PUSH_SECTION,(NOLOAD) ,) +{ + __nrf_kmu_reserved_push_area = .; + *(.nrf_kmu_reserved_push_area) + __nrf_kmu_reserved_push_area_end = .; +} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) + +# It doesn't seem to be possible to enforce placing a section +# at a specific address in memory using the Zephyr SECTION macros. +# So this assert is necessary to avoid accidentatly moving this +# section to a different address. +ASSERT(__nrf_kmu_reserved_push_area == RAM_ADDR, "Error: \ + The section NRF_KMU_RESERVED_PUSH_SECTION needs to be \ + placed on the top RAM address but it is not, please edit \ + your linker scripts to make sure that it is placed on \ + the to RAM address.") From c198b98e3a6cd1399dacb68378c90b3300b12c1c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 12 Dec 2024 07:58:06 +0000 Subject: [PATCH 828/881] [nrf noup] samples/tests: Add TF-M sysbuild config files Fixes some issues with samples/tests by adding configuration files to satisfy TF-M requirements Signed-off-by: Jamie McCrae (cherry picked from commit 0d882bd5dfc71bf18fd548404dc30d6674308f09) --- samples/subsys/usb/dfu/sysbuild.conf | 1 + tests/drivers/flash/common/sysbuild.conf | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 samples/subsys/usb/dfu/sysbuild.conf delete mode 100644 tests/drivers/flash/common/sysbuild.conf diff --git a/samples/subsys/usb/dfu/sysbuild.conf b/samples/subsys/usb/dfu/sysbuild.conf new file mode 100644 index 00000000000..47f00ff3cff --- /dev/null +++ b/samples/subsys/usb/dfu/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf deleted file mode 100644 index 6408669a847..00000000000 --- a/tests/drivers/flash/common/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n From 9edcd13cdd3683b4377f8cddeef4b6c296c899a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 10:48:30 +0100 Subject: [PATCH 829/881] [nrf noup] Revert "mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ac6d8342728c8a63f9fea965ce41610618aeed5a. Temporarily revert an upstream change that leads to a Kconfig dependency loop with MBEDTLS_CIPHER_AES_ENABLED. This is supposed to be replaced with a better fix later. Signed-off-by: Andrzej Głąbek (cherry picked from commit a83567fd12f3f2f0e5dc1a4c6ed6d667e7154bb0) --- modules/mbedtls/Kconfig.mbedtls | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index b0077361908..b4932b31635 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -283,7 +283,6 @@ config MBEDTLS_SOME_CIPHER_ENABLED config MBEDTLS_CIPHER_AES_ENABLED bool "AES block cipher" - default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C if MBEDTLS_CIPHER_AES_ENABLED From b4d9fbcf8fb5374ec5d0d61540280ff835bd2092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 24 Jan 2025 17:57:54 +0100 Subject: [PATCH 830/881] [nrf noup] tests: arm_irq_vector_table: Disable starting of SSF client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test cannot be executed with the SDFW Service Framework client started, so disable its initialization. Signed-off-by: Andrzej Głąbek (cherry picked from commit dbd39369412159c1a9655f17f3d8636ec3722abe) (cherry picked from commit 1449016262127173218fd276fab23c4b97800c7d) --- .../arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 2 ++ .../arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf create mode 100644 tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 00000000000..025c842f70b --- /dev/null +++ b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_SOC_NRF54H20_GPD=n +CONFIG_SSF_CLIENT_SYS_INIT=n diff --git a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 00000000000..025c842f70b --- /dev/null +++ b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,2 @@ +CONFIG_SOC_NRF54H20_GPD=n +CONFIG_SSF_CLIENT_SYS_INIT=n From ece8d9d68faf271996859a98faface902137abf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grochala?= Date: Fri, 31 Jan 2025 16:09:26 +0000 Subject: [PATCH 831/881] [nrf noup] bluetooth: Temporary Kconfig fix for BT RPC configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The BT_DRIVERS symbol default value 'y' used to depend on !BT_CTLR but now it is always on when BT is set. For BT_RPC the BT_DRIVERS symbol must not be enabled on the client side as no driver is used. The temporary solution is to set BT_DRIVERS to 'y' by default only when BT_HCI stack selection is enabled. It will be 'n' when BT_RPC_STACK is enabled. The fix should be fine as NCS uses either HCI or RPC stack. Signed-off-by: Michał Grochala (cherry picked from commit 8797d168475faaa8c96cab970881b8ee35dfa2c1) --- drivers/bluetooth/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index a1680af6583..e64a33f663c 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -12,7 +12,7 @@ menuconfig BT_DRIVERS bool "Bluetooth drivers" default y - depends on BT + depends on BT && BT_HCI if BT_DRIVERS From a53b2b80a54e712ae7800e249f7aee223a438627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Tue, 4 Feb 2025 14:55:58 +0100 Subject: [PATCH 832/881] [nrf noup] ble: Adding missing AES config for BT_CRYPTO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Adding imply MBEDTLS_CIPHER_AES_ENABLED if not TF-M build in BT_CRYPTO -Needed to set a specific symbol for MBEDTLS + MBEDTLS_BUILTIN to work on network core build. -This [nrf noup] can be removed once PSA crypto is fully supported in network core, or PSA crypto is not compiled in at all and is provided as a RPC-mechanism via the app-core Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit b3b520b40258b238a58133f568353a852ca8eb87) --- subsys/bluetooth/crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/crypto/Kconfig b/subsys/bluetooth/crypto/Kconfig index 0856daf9d9a..0f46a0f59a0 100644 --- a/subsys/bluetooth/crypto/Kconfig +++ b/subsys/bluetooth/crypto/Kconfig @@ -8,6 +8,7 @@ config BT_CRYPTO select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_CMAC select PSA_WANT_ALG_ECB_NO_PADDING + imply MBEDTLS_CIPHER_AES_ENABLED if !BUILD_WITH_TFM imply MBEDTLS_AES_ROM_TABLES if MBEDTLS_PSA_CRYPTO_C help This option enables the Bluetooth Cryptographic Toolbox. From 6a3fb86579ee8417c4d30afc1d890a397a68e873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 18 Feb 2025 12:17:47 +0100 Subject: [PATCH 833/881] [nrf noup] entropy: Add fake entropy nRF PRNG driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds temporary entropy driver simulation for nRF54l09 device since final entropy source is not available yet. TODO: Remove this commit when proper solution will be available. Signed-off-by: Rafał Kuźnia (cherry picked from commit 3d02dc6fb7c7a29dde82faf53d17dd1ec25e35de) (cherry picked from commit a0d10324b63734e313e07415908fcca08936e5fb) --- dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi | 142 +++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi diff --git a/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi new file mode 100644 index 00000000000..1dfc5ce133c --- /dev/null +++ b/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +cpu: &cpuapp {}; +systick: &cpuapp_systick {}; +nvic: &cpuapp_nvic {}; + +/delete-node/ &cpuflpr; +/delete-node/ &cpuflpr_rram; +/delete-node/ &cpuflpr_sram; +/delete-node/ &cpuflpr_clic; + +/ { + chosen { + zephyr,bt-hci = &bt_hci_controller; + zephyr,entropy = &prng; + }; + + soc { + compatible = "simple-bus"; + interrupt-parent = <&cpuapp_nvic>; + ranges; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "disabled"; + }; + + prng: prng { + compatible = "nordic,entropy-prng"; + status = "okay"; + }; +}; + +&bt_hci_controller { + status = "okay"; +}; + +&cpuflpr_vpr { + cpuapp_vevif_rx: mailbox@1 { + compatible = "nordic,nrf-vevif-event-rx"; + reg = <0x1 0x1000>; + status = "disabled"; + interrupts = <76 NRF_DEFAULT_IRQ_PRIORITY>; + #mbox-cells = <1>; + nordic,events = <1>; + nordic,events-mask = <0x00100000>; + }; + + cpuapp_vevif_tx: mailbox@0 { + compatible = "nordic,nrf-vevif-task-tx"; + reg = <0x0 0x1000>; + #mbox-cells = <1>; + nordic,tasks = <7>; + nordic,tasks-mask = <0x007f0000>; + status = "disabled"; + }; +}; + +&cpuapp_ppb { + compatible = "simple-bus"; + ranges; +}; + +&grtc { +#ifdef USE_NON_SECURE_ADDRESS_MAP + interrupts = <227 NRF_DEFAULT_IRQ_PRIORITY>, +#else + interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>, +#endif + <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ +}; + +&gpiote20 { +#ifdef USE_NON_SECURE_ADDRESS_MAP + interrupts = <218 NRF_DEFAULT_IRQ_PRIORITY>; +#else + interrupts = <219 NRF_DEFAULT_IRQ_PRIORITY>; +#endif +}; + +&gpiote30 { +#ifdef USE_NON_SECURE_ADDRESS_MAP + interrupts = <268 NRF_DEFAULT_IRQ_PRIORITY>; +#else + interrupts = <269 NRF_DEFAULT_IRQ_PRIORITY>; +#endif +}; + +&dppic00 { + status = "okay"; +}; + +&dppic10 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; + +&dppic30 { + status = "okay"; +}; + +&ppib00 { + status = "okay"; +}; + +&ppib01 { + status = "okay"; +}; + +&ppib10 { + status = "okay"; +}; + +&ppib11 { + status = "okay"; +}; + +&ppib20 { + status = "okay"; +}; + +&ppib21 { + status = "okay"; +}; + +&ppib22 { + status = "okay"; +}; + +&ppib30 { + status = "okay"; +}; From 0b305306521a061d0378330dcd93ed4330eecad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Wed, 19 Feb 2025 15:47:07 +0100 Subject: [PATCH 834/881] [nrf noup] dts: Select SoftDevice Controller on nRF54L09 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SDC HCI controller is defined as a device tree node. A node representing the SDC controller is added and selected as the default over the open source link layer. This is consistent with other SoCs. Signed-off-by: Rafał Kuźnia (cherry picked from commit da86248f40248d863adfed61bb35019e61a5dadf) (cherry picked from commit e40f5313c37dc245a8812643924cdba02afe1252) --- .../nrf54l09pdk/nrf54l09_cpuapp_common.dtsi | 128 ++++ dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi | 4 +- dts/vendor/nordic/nrf54l09.dtsi | 628 ++++++++++++++++++ 3 files changed, 758 insertions(+), 2 deletions(-) create mode 100644 boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi create mode 100644 dts/vendor/nordic/nrf54l09.dtsi diff --git a/boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi b/boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi new file mode 100644 index 00000000000..e1347c35948 --- /dev/null +++ b/boards/nordic/nrf54l09pdk/nrf54l09_cpuapp_common.dtsi @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is common to the secure and non-secure domain */ + +#include +#include "nrf54l09pdk_nrf54l09-common.dtsi" + +/ { + chosen { + zephyr,console = &uart20; + zephyr,shell-uart = &uart20; + zephyr,uart-mcumgr = &uart20; + zephyr,bt-mon-uart = &uart20; + zephyr,bt-c2h-uart = &uart20; + zephyr,flash-controller = &rram_controller; + zephyr,flash = &cpuapp_rram; + zephyr,bt-hci = &bt_hci_sdc; + zephyr,ieee802154 = &ieee802154; + }; +}; + +&cpuapp_sram { + status = "okay"; +}; + +&hfpll { + /* For now use 64 MHz clock for CPU and fast peripherals. */ + clock-frequency = ; +}; + +&lfxo { + load-capacitors = "internal"; + load-capacitance-femtofarad = <15500>; +}; + +&hfxo { + load-capacitors = "internal"; + load-capacitance-femtofarad = <15000>; +}; + +&grtc { + owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>; + /* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */ + child-owned-channels = <3 4 7 8 9 10 11>; + status = "okay"; +}; + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(212)>; + }; + + slot0_ns_partition: partition@45000 { + label = "image-0-nonsecure"; + reg = <0x45000 DT_SIZE_K(212)>; + }; + + slot1_partition: partition@7a000 { + label = "image-1"; + reg = <0x7a000 DT_SIZE_K(212)>; + }; + + slot1_ns_partition: partition@af000 { + label = "image-1-nonsecure"; + reg = <0xaf000 DT_SIZE_K(212)>; + }; + + storage_partition: partition@e4000 { + label = "storage"; + reg = <0xe4000 DT_SIZE_K(36)>; + }; + }; +}; + +&uart20 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpiote30 { + status = "okay"; +}; + +&radio { + status = "okay"; +}; + +&temp { + status = "okay"; +}; + +&clock { + status = "okay"; +}; + +&bt_hci_sdc { + status = "okay"; +}; + +&ieee802154 { + status = "okay"; +}; diff --git a/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi index 1dfc5ce133c..6c7f34d3b21 100644 --- a/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l09_enga_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &prng; }; @@ -38,7 +38,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54l09.dtsi b/dts/vendor/nordic/nrf54l09.dtsi new file mode 100644 index 00000000000..90ecc49b877 --- /dev/null +++ b/dts/vendor/nordic/nrf54l09.dtsi @@ -0,0 +1,628 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr"; + reg = <1>; + device_type = "cpu"; + clock-frequency = ; + riscv,isa = "rv32emc"; + nordic,bus-width = <32>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + #ifdef USE_NON_SECURE_ADDRESS_MAP + /* intentionally empty because UICR is hardware fixed to Secure */ + #else + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; + #endif + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + + cpuapp_sram: memory@20000000 { + reg = <0x20000000 DT_SIZE_K(143)>; + ranges = <0x0 0x20000000 DT_SIZE_K(143)>; + compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; + }; + + cpuflpr_sram: memory@20023c00 { + compatible = "mmio-sram"; + reg = <0x20023c00 DT_SIZE_K(48)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20023c00 DT_SIZE_K(48)>; + }; + + #ifdef USE_NON_SECURE_ADDRESS_MAP + global_peripherals: peripheral@40000000 { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x40000000 0x10000000>; + #else + global_peripherals: peripheral@50000000 { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x50000000 0x10000000>; + #endif + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x1780>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <16>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@51c { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x51c 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@520 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x520 0x1>; + status = "disabled"; + }; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + #ifdef USE_NON_SECURE_ADDRESS_MAP + /* intentionally empty because WDT30 is hardware fixed to Secure */ + #else + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + #endif + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <5>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + interrupts = <75 NRF_DEFAULT_IRQ_PRIORITY>; + + /* 952 + 60 = 1012KB */ + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + erase-block-size = <4096>; + write-block-size = <16>; + reg = <0x0 DT_SIZE_K(952)>; + }; + + cpuflpr_rram: rram@ee000 { + compatible = "soc-nv-flash"; + reg = <0xee000 DT_SIZE_K(60)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; From f781fca302e0cf8744a845dfc37cc7de85c78e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 22 Oct 2024 08:55:47 +0200 Subject: [PATCH 835/881] [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added ncs-specific modules to nrfx_config_reserved_resources. The modules are: - mpsl - nrfe Signed-off-by: Rafał Kuźnia Signed-off-by: Nikodem Kastelik Co-authored-by: Krzysztof Chruściński Signed-off-by: Eivind Jølsgard Signed-off-by: Aleksandar Stanoev Signed-off-by: Piotr Pryga (cherry picked from commit 609c11851694ecaee87cda239066273e2410b8e3) --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ++++++++++++++++++ 2 files changed, 949 insertions(+), 1 deletion(-) create mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 0b1882ba7a6..523931be649 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -1307,6 +1307,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_reserved_resources.h" + default "nrfx_config_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h new file mode 100644 index 00000000000..ec8a9acaf7b --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h @@ -0,0 +1,948 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ +#define NRFX_CONFIG_RESERVED_RESOURCES_H__ + +/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE130_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) + +/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE131_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) + +/** @brief Bitmask that defines EGU instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_EGUS_USED 0 + +/** @brief Bitmask that defines TIMER instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_TIMERS_USED 0 + +/* If the GRTC system timer driver is to be used, prepare definitions required + * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and + * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. + */ +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) +#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ + (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ + ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) +#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ + (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ + DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ + +/* + * The enabled Bluetooth controller subsystem is responsible for providing + * definitions of the BT_CTLR_USED_* symbols used below in a file named + * bt_ctlr_used_resources.h and for adding its location to global include + * paths so that the file can be included here for all Zephyr libraries that + * are to be built. + */ +#if defined(CONFIG_BT_LL_SW_SPLIT) +#include +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#endif +#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +/* Define auxiliary symbols needed for SDC device dispatch. */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRF52_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRF53_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRF54L_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF71X) +#define NRF71_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRF54H_SERIES +#endif +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_NRF_802154_RADIO_DRIVER) +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#include <../src/nrf_802154_peripherals_nrf52.h> +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#include <../src/nrf_802154_peripherals_nrf53.h> +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#include <../src/nrf_802154_peripherals_nrf54l.h> +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#include <../src/nrf_802154_peripherals_nrf54h.h> +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL +#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL +#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL +#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL +#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL +#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL +#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL +#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL +#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL +#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL +#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL +#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL +#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL +#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL +#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL +#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL +#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL +#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 +#endif + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_CHANNELS_USED \ + (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI0_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_GROUPS_USED \ + (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI0_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_CHANNELS_USED \ + (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI00_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_GROUPS_USED \ + (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI00_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_CHANNELS_USED \ + (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI10_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_GROUPS_USED \ + (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI10_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_CHANNELS_USED \ + (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI20_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_GROUPS_USED \ + (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI20_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_CHANNELS_USED \ + (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI30_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_GROUPS_USED \ + (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI30_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_CHANNELS_USED \ + (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI020_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_GROUPS_USED \ + (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI020_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_CHANNELS_USED \ + (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI030_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_GROUPS_USED \ + (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI030_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_CHANNELS_USED \ + (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI120_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_GROUPS_USED \ + (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI120_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_CHANNELS_USED \ + (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI130_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_GROUPS_USED \ + (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI130_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_CHANNELS_USED \ + (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI131_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_GROUPS_USED \ + (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI131_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_CHANNELS_USED \ + (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI132_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_GROUPS_USED \ + (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI132_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_CHANNELS_USED \ + (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI133_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_GROUPS_USED \ + (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI133_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_CHANNELS_USED \ + (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI134_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_GROUPS_USED \ + (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI134_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_CHANNELS_USED \ + (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI135_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_GROUPS_USED \ + (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI135_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_CHANNELS_USED \ + (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI136_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_GROUPS_USED \ + (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI136_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines PPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_CHANNELS_USED \ + (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) + +#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED +#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED + +/** @brief Bitmask that defines PPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_GROUPS_USED \ + (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ + NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) + +#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ + (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ + (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ + (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ + (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ + (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ + (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ + (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ + NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) + +#if defined(CONFIG_SOFTDEVICE) +#include +#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED +#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED +#else +#define NRFX_PPI_CHANNELS_USED_BY_SD 0 +#define NRFX_PPI_GROUPS_USED_BY_SD 0 +#endif + +#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ From cd377971613c56a4370a67085811b9980695fc59 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 25 Feb 2025 10:35:24 +0100 Subject: [PATCH 836/881] [nrf noup] samples: bluetooth: mesh: Disable secure storage for real targets. Mesh currently works with trusted storage on real targets. Until secure storage is supported by default disable it. Signed-off-by: Aleksandr Khromykh (cherry picked from commit f331133c270974e2a33087c12dab21419fc0b0ba) --- samples/bluetooth/mesh/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh/prj.conf | 2 +- samples/bluetooth/mesh_demo/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh_demo/prj.conf | 2 +- samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh_provisioner/prj.conf | 2 +- samples/boards/nordic/mesh/onoff-app/prj.conf | 2 +- .../nordic/mesh/onoff_level_lighting_vnd_app/prj.conf | 2 +- tests/bluetooth/mesh_shell/boards/qemu_x86.conf | 6 ++++++ tests/bluetooth/mesh_shell/prj.conf | 2 +- 10 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 samples/bluetooth/mesh/boards/qemu_x86.conf create mode 100644 samples/bluetooth/mesh_demo/boards/qemu_x86.conf create mode 100644 samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf create mode 100644 tests/bluetooth/mesh_shell/boards/qemu_x86.conf diff --git a/samples/bluetooth/mesh/boards/qemu_x86.conf b/samples/bluetooth/mesh/boards/qemu_x86.conf new file mode 100644 index 00000000000..bfb57193b78 --- /dev/null +++ b/samples/bluetooth/mesh/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh/prj.conf b/samples/bluetooth/mesh/prj.conf index 14b19316a86..cd7d6532b61 100644 --- a/samples/bluetooth/mesh/prj.conf +++ b/samples/bluetooth/mesh/prj.conf @@ -5,7 +5,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_HWINFO=y CONFIG_BT=y diff --git a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf new file mode 100644 index 00000000000..bfb57193b78 --- /dev/null +++ b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_demo/prj.conf b/samples/bluetooth/mesh_demo/prj.conf index bcb738ae5bd..b7016b02c65 100644 --- a/samples/bluetooth/mesh_demo/prj.conf +++ b/samples/bluetooth/mesh_demo/prj.conf @@ -31,7 +31,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y # Limit the number of key slots in PSA Crypto core to reduce # RAM footprint diff --git a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf new file mode 100644 index 00000000000..bfb57193b78 --- /dev/null +++ b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 10949c5480d..24176780516 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -45,7 +45,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y #CONFIG_BT_MESH_LOG_LEVEL_DBG=y #CONFIG_BT_MESH_SETTINGS_LOG_LEVEL_DBG=y diff --git a/samples/boards/nordic/mesh/onoff-app/prj.conf b/samples/boards/nordic/mesh/onoff-app/prj.conf index 0e67042b265..0783579e795 100644 --- a/samples/boards/nordic/mesh/onoff-app/prj.conf +++ b/samples/boards/nordic/mesh/onoff-app/prj.conf @@ -9,7 +9,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf index 3bb984208c7..96b5466b4a1 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf @@ -7,7 +7,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT_OBSERVER=y CONFIG_BT_BROADCASTER=y diff --git a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf new file mode 100644 index 00000000000..bfb57193b78 --- /dev/null +++ b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index 2af60029568..aab2745d359 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT=y CONFIG_BT_OBSERVER=y From a9dc950fae5ebd5acdc917686e32cae5d4b4bed0 Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Fri, 28 Feb 2025 12:27:22 +0100 Subject: [PATCH 837/881] [nrf noup] samples: bluetooth: hci_ipc: increase main stack size for Cracen driver on nRF54H20 A larger stack is needed to accomodate the Cracen driver. Signed-off-by: Gordon Klaus (cherry picked from commit 316cce07af745093d8056a50ff27c88e15f7d9b6) --- .../bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 00000000000..296e6836638 --- /dev/null +++ b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,2 @@ +# Increase stack size for Cracen driver. +CONFIG_MAIN_STACK_SIZE=1024 From 597f1d86431a1937114bc277047773893db3b674 Mon Sep 17 00:00:00 2001 From: Kamil Gawor Date: Tue, 9 Apr 2024 14:24:34 +0200 Subject: [PATCH 838/881] [nrf noup] entropy: Add fake entropy nRF PRNG driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds temporary entropy driver simulation for nRF54h20 device since final entropy source is not available yet. TODO: Remove this commit when proper solution will be available. Jira: NCSDK-25947 Signed-off-by: Kamil Gawor Signed-off-by: Robert Lubos Signed-off-by: Andreas Moltumyr Signed-off-by: Karol Lasończyk (cherry picked from commit 27b137c9ee18b4b2ced382e5af255769a096727e) (cherry picked from commit e2aa08c6d7cbba17349065d497885731a21715df) --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 6 + .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 5 + .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 6 + .../nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 5 + drivers/entropy/CMakeLists.txt | 7 + drivers/entropy/Kconfig | 1 + drivers/entropy/Kconfig.nrf_prng | 19 +++ drivers/entropy/fake_entropy_nrf_prng.c | 101 ++++++++++++++ dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi | 125 ++++++++++++++++++ dts/bindings/rng/nordic,nrf-prng.yaml | 8 ++ 10 files changed, 283 insertions(+) create mode 100644 drivers/entropy/Kconfig.nrf_prng create mode 100644 drivers/entropy/fake_entropy_nrf_prng.c create mode 100644 dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi create mode 100644 dts/bindings/rng/nordic,nrf-prng.yaml diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index ba22403a9ac..e086601abae 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -27,6 +27,7 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; + zephyr,entropy = &prng; }; aliases { @@ -107,6 +108,11 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; + + prng: prng { + compatible = "nordic,entropy-prng"; + status = "okay"; + }; }; &cpuapp_bellboard { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 5473d9a7405..7e1a1c8e9e0 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -28,6 +28,11 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &prng; + }; + prng: prng { + compatible = "nordic,entropy-prng"; + status = "okay"; }; aliases { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 622fc04e96a..8920d7966bb 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -26,6 +26,7 @@ zephyr,shell-uart = &uart136; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &prng; }; aliases { @@ -107,6 +108,11 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; + + prng: prng { + compatible = "nordic,entropy-prng"; + status = "okay"; + }; }; &cpuapp_ram0x_region { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index 5efa7dbd471..d6c03bc4a51 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -28,6 +28,11 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &prng; + }; + prng: prng { + compatible = "nordic,entropy-prng"; + status = "okay"; }; aliases { diff --git a/drivers/entropy/CMakeLists.txt b/drivers/entropy/CMakeLists.txt index 541be8478b1..6f6c20b7a60 100644 --- a/drivers/entropy/CMakeLists.txt +++ b/drivers/entropy/CMakeLists.txt @@ -43,4 +43,11 @@ zephyr_library_sources_ifdef(CONFIG_ENTROPY_TELINK_B91_TRNG entropy_b91_trng zephyr_library_sources_ifdef(CONFIG_ENTROPY_VIRTIO entropy_virtio.c) # zephyr-keep-sorted-stop +if (CONFIG_FAKE_ENTROPY_NRF_PRNG) + zephyr_library_sources(fake_entropy_nrf_prng.c) + + message(WARNING "\nA nRF PRNG is used, which does not produce real random bits." + "This is not secure and should therefore never be used in a product.") +endif() + zephyr_library_link_libraries_ifdef(CONFIG_BUILD_WITH_TFM tfm_api) diff --git a/drivers/entropy/Kconfig b/drivers/entropy/Kconfig index 59b93ccf022..bab82a83f2c 100644 --- a/drivers/entropy/Kconfig +++ b/drivers/entropy/Kconfig @@ -37,6 +37,7 @@ source "drivers/entropy/Kconfig.neorv32" source "drivers/entropy/Kconfig.npcx" source "drivers/entropy/Kconfig.nrf5" source "drivers/entropy/Kconfig.nrf_cracen" +source "drivers/entropy/Kconfig.nrf_prng" source "drivers/entropy/Kconfig.nxp" source "drivers/entropy/Kconfig.psa_crypto" source "drivers/entropy/Kconfig.renesas_ra" diff --git a/drivers/entropy/Kconfig.nrf_prng b/drivers/entropy/Kconfig.nrf_prng new file mode 100644 index 00000000000..e81db4de4b1 --- /dev/null +++ b/drivers/entropy/Kconfig.nrf_prng @@ -0,0 +1,19 @@ +# nRF fake entropy prng generator driver configuration + +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if ENTROPY_GENERATOR + +config FAKE_ENTROPY_NRF_PRNG + bool "A fake nRF entropy driver" + default y + depends on DT_HAS_NORDIC_ENTROPY_PRNG_ENABLED + depends on (SOC_SERIES_NRF54HX || SOC_SERIES_NRF92X || SOC_SERIES_NRF54LX) + select ENTROPY_HAS_DRIVER + help + This is a super simple PRNG driver that can be used on nRF platforms that + do not have an entropy source. + This is NOT SAFE to use for cryptographic operations! + +endif diff --git a/drivers/entropy/fake_entropy_nrf_prng.c b/drivers/entropy/fake_entropy_nrf_prng.c new file mode 100644 index 00000000000..8624c844405 --- /dev/null +++ b/drivers/entropy/fake_entropy_nrf_prng.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include + +#define DT_DRV_COMPAT nordic_entropy_prng + +/* This file implements a pseudo-RNG + * https://vigna.di.unimi.it/xorshift/xoshiro128plus.c + */ + +static uint32_t s[4]; + +static inline uint32_t rotl(const uint32_t x, int k) +{ + return (x << k) | (x >> (32 - k)); +} + +static uint32_t rng_next(void) +{ + const uint32_t result = rotl(s[0] + s[3], 7) + s[0]; + + const uint32_t t = s[1] << 9; + + s[2] ^= s[0]; + s[3] ^= s[1]; + s[1] ^= s[2]; + s[0] ^= s[3]; + + s[2] ^= t; + + s[3] = rotl(s[3], 11); + + return result; +} + +static int entropy_prng_get_entropy(const struct device *dev, uint8_t *buffer, uint16_t length) +{ + ARG_UNUSED(dev); + + while (length) { + /* + * Note that only 1 thread (Zephyr thread or HW models), runs at + * a time, therefore there is no need to use random_r() + */ + uint32_t value = rng_next(); + + size_t to_copy = MIN(length, sizeof(long)); + + memcpy(buffer, &value, to_copy); + buffer += to_copy; + length -= to_copy; + } + + return 0; +} + +static int entropy_prng_get_entropy_isr(const struct device *dev, uint8_t *buf, uint16_t len, + uint32_t flags) +{ + ARG_UNUSED(flags); + + int err; + + /* + * entropy_prng_get_entropy() is also safe for ISRs + * and always produces data. + */ + err = entropy_prng_get_entropy(dev, buf, len); + if (err < 0) { + return err; + } else { + return len; + } +} + +static int entropy_prng_init(const struct device *dev) +{ + ARG_UNUSED(dev); + + /* Picked some arbitrary initial seed. */ + s[0] = 0xAF568BC0; + s[1] = 0xAC34307E; + s[2] = 0x9B7F6DD1; + s[3] = 0xD84319FC; + return 0; +} + +static const struct entropy_driver_api entropy_prng_api_funcs = { + .get_entropy = entropy_prng_get_entropy, .get_entropy_isr = entropy_prng_get_entropy_isr}; + +DEVICE_DT_INST_DEFINE(0, entropy_prng_init, NULL, NULL, NULL, PRE_KERNEL_1, + CONFIG_ENTROPY_INIT_PRIORITY, &entropy_prng_api_funcs); diff --git a/dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi new file mode 100644 index 00000000000..5c7e5db3001 --- /dev/null +++ b/dts/arm/nordic/nrf54l20_enga_cpuapp.dtsi @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +cpu: &cpuapp {}; +systick: &cpuapp_systick {}; +nvic: &cpuapp_nvic {}; + +/delete-node/ &cpuflpr; +/delete-node/ &cpuflpr_rram; +/delete-node/ &cpuflpr_sram; +/delete-node/ &cpuflpr_clic; + +/ { + chosen { + zephyr,entropy = &prng; + }; + + soc { + compatible = "simple-bus"; + interrupt-parent = <&cpuapp_nvic>; + ranges; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "disabled"; + }; + + prng: prng { + compatible = "nordic,entropy-prng"; + status = "okay"; + }; +}; + +&cpuflpr_vpr { + cpuapp_vevif_rx: mailbox@1 { + compatible = "nordic,nrf-vevif-event-rx"; + reg = <0x0 0x1000>; + status = "disabled"; + interrupts = <76 NRF_DEFAULT_IRQ_PRIORITY>; + #mbox-cells = <1>; + nordic,events = <1>; + nordic,events-mask = <0x00100000>; + }; + + cpuapp_vevif_tx: mailbox@0 { + compatible = "nordic,nrf-vevif-task-tx"; + reg = <0x0 0x1000>; + #mbox-cells = <1>; + nordic,tasks = <7>; + nordic,tasks-mask = <0x007f0000>; + status = "disabled"; + }; +}; + +&cpuapp_ppb { + compatible = "simple-bus"; + ranges; +}; + +&grtc { + interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>, + <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ +}; + +&gpiote20 { + interrupts = <219 NRF_DEFAULT_IRQ_PRIORITY>; +}; + +&gpiote30 { + interrupts = <269 NRF_DEFAULT_IRQ_PRIORITY>; +}; + +&dppic00 { + status = "okay"; +}; + +&dppic10 { + status = "okay"; +}; + +&dppic20 { + status = "okay"; +}; + +&dppic30 { + status = "okay"; +}; + +&ppib00 { + status = "okay"; +}; + +&ppib01 { + status = "okay"; +}; + +&ppib10 { + status = "okay"; +}; + +&ppib11 { + status = "okay"; +}; + +&ppib20 { + status = "okay"; +}; + +&ppib21 { + status = "okay"; +}; + +&ppib22 { + status = "okay"; +}; + +&ppib30 { + status = "okay"; +}; diff --git a/dts/bindings/rng/nordic,nrf-prng.yaml b/dts/bindings/rng/nordic,nrf-prng.yaml new file mode 100644 index 00000000000..8936393a0b6 --- /dev/null +++ b/dts/bindings/rng/nordic,nrf-prng.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +description: This is a super simple PRNG + +compatible: "nordic,entropy-prng" + +include: base.yaml From 0239ae26a6dc9cd102a1e348d531736bcdeead1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Tue, 17 Dec 2024 21:45:47 +0100 Subject: [PATCH 839/881] [nrf noup] drivers: spi_dw: Bring back custom EXMIF peripheral handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit brings back modifications from these reverted commits: - f68b2edaa2233cde29d955bc3d3b3dd75ff50334 - e606246f0fc3e9299cb5bdd3c1e34a091e5d85a1 slightly adjusted so that the EXMIF peripheral is still by default handled by the mspi_dw driver, and in cases where this driver cannot be used because something still does not work correctly, one can switch to the old solution based on the tweaked spi_dw driver. Signed-off-by: Andrzej Głąbek (cherry picked from commit e2ee4c0ffea72be2e9385b81594cbad94ac00ae9) --- drivers/pinctrl/pinctrl_nrf.c | 3 +- drivers/spi/spi_dw.c | 32 +++++++++++++++++++++- dts/bindings/spi/nordic,nrf-exmif-spi.yaml | 8 ++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 dts/bindings/spi/nordic,nrf-exmif-spi.yaml diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index bbcaea06435..6026bc8f24d 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -513,7 +513,8 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) || \ + DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif_spi) /* Pin routing is controlled by secure domain, via UICR */ case NRF_FUN_EXMIF_CK: case NRF_FUN_EXMIF_DQ0: diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index bd10447e442..6941bfdaaa7 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -41,6 +41,14 @@ LOG_MODULE_REGISTER(spi_dw); #include #endif +#ifdef CONFIG_HAS_NRFX +#include +#endif + +#ifdef CONFIG_SOC_NRF54H20_GPD +#include +#endif + static inline bool spi_dw_is_slave(struct spi_dw_data *spi) { return (IS_ENABLED(CONFIG_SPI_SLAVE) && @@ -258,6 +266,7 @@ static int spi_dw_configure(const struct device *dev, /* Baud rate and Slave select, for master only */ write_baudr(dev, SPI_DW_CLK_DIVIDER(info->clock_frequency, config->frequency)); + write_ser(dev, BIT(config->slave)); } if (spi_dw_is_slave(spi)) { @@ -512,6 +521,10 @@ void spi_dw_isr(const struct device *dev) uint32_t int_status; int error; +#ifdef CONFIG_HAS_NRFX + NRF_EXMIF->EVENTS_CORE = 0; +#endif + int_status = read_isr(dev); LOG_DBG("SPI %p int_status 0x%x - (tx: %d, rx: %d)", dev, int_status, @@ -560,6 +573,18 @@ int spi_dw_init(const struct device *dev) DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); +#ifdef CONFIG_HAS_NRFX + NRF_EXMIF->INTENSET = BIT(0); + NRF_EXMIF->TASKS_START = 1; + +#ifdef CONFIG_SOC_NRF54H20_GPD + err = nrf_gpd_request(NRF_GPD_FAST_ACTIVE1); + if (err < 0) { + return err; + } +#endif +#endif + info->config_func(); /* Masking interrupt and making sure controller is disabled */ @@ -584,6 +609,11 @@ int spi_dw_init(const struct device *dev) return 0; } +#define REG_ADDR(inst) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), nordic_nrf_exmif_spi), \ + (Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(core, DT_DRV_INST(inst))), \ + (DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)))) + #define SPI_CFG_IRQS_SINGLE_ERR_LINE(inst) \ IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, rx_avail, irq), \ DT_INST_IRQ_BY_NAME(inst, rx_avail, priority), \ @@ -656,7 +686,7 @@ COND_CODE_1(IS_EQ(DT_NUM_IRQS(DT_DRV_INST(inst)), 1), \ SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ }; \ static const struct spi_dw_config spi_dw_config_##inst = { \ - DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ + REG_ADDR(inst), \ .clock_frequency = COND_CODE_1( \ DT_NODE_HAS_PROP(DT_INST_PHANDLE(inst, clocks), clock_frequency), \ (DT_INST_PROP_BY_PHANDLE(inst, clocks, clock_frequency)), \ diff --git a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml new file mode 100644 index 00000000000..d988b414687 --- /dev/null +++ b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic External Memory Interface (EXMIF) used in SPI mode only + +compatible: "nordic,nrf-exmif-spi" + +include: snps,designware-spi.yaml From 511bda189acac3378fd5d707fe3758db8457f9d3 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Mon, 25 Nov 2024 14:14:40 +0100 Subject: [PATCH 840/881] [nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure SDP MSPI pins to switch their control to VPR core Signed-off-by: Jakub Zymelka Signed-off-by: Andrzej Głąbek Signed-off-by: Magdalena Pastula (cherry picked from commit a9bcc44f74eed83f28506e8fcd44f0f70c65ea9c) (cherry picked from commit 2e74ea72fa61061c4caf1beb6dda304473838774) --- drivers/pinctrl/pinctrl_nrf.c | 32 +++++++++++ .../zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 56 +++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 6026bc8f24d..09c4d19f570 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -201,6 +201,18 @@ static void port_pin_clock_set(uint16_t pin_number, bool enable) #endif +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || \ + defined(CONFIG_MSPI_HPF) || \ + DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(nordic_nrf_vpr_coprocessor, pinctrl_0) +#if defined(CONFIG_SOC_SERIES_NRF54LX) +#define NRF_PSEL_SDP_MSPI(psel) \ + nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_VPR); +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +/* On nRF54H, pin routing is controlled by secure domain, via UICR. */ +#define NRF_PSEL_SDP_MSPI(psel) +#endif +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || ... */ + int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg) { @@ -550,6 +562,26 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* defined(NRF_PSEL_TWIS) */ +#if defined(NRF_PSEL_SDP_MSPI) + case NRF_FUN_SDP_MSPI_CS0: + case NRF_FUN_SDP_MSPI_CS1: + case NRF_FUN_SDP_MSPI_CS2: + case NRF_FUN_SDP_MSPI_CS3: + case NRF_FUN_SDP_MSPI_CS4: + case NRF_FUN_SDP_MSPI_SCK: + case NRF_FUN_SDP_MSPI_DQ0: + case NRF_FUN_SDP_MSPI_DQ1: + case NRF_FUN_SDP_MSPI_DQ2: + case NRF_FUN_SDP_MSPI_DQ3: + case NRF_FUN_SDP_MSPI_DQ4: + case NRF_FUN_SDP_MSPI_DQ5: + case NRF_FUN_SDP_MSPI_DQ6: + case NRF_FUN_SDP_MSPI_DQ7: + NRF_PSEL_SDP_MSPI(psel); + dir = NRF_GPIO_PIN_DIR_OUTPUT; + input = NRF_GPIO_PIN_INPUT_CONNECT; + break; +#endif /* defined(NRF_PSEL_SDP_MSPI) */ default: return -ENOTSUP; } diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 9de74061e8d..088cfce648b 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -172,6 +172,62 @@ #define NRF_FUN_GRTC_CLKOUT_FAST 55U /** GRTC slow clock output */ #define NRF_FUN_GRTC_CLKOUT_32K 56U +/** SDP_MSPI clock pin */ +#define NRF_FUN_SDP_MSPI_SCK 57U +/** SDP_MSPI data pin 0 */ +#define NRF_FUN_SDP_MSPI_DQ0 58U +/** SDP_MSPI data pin 1 */ +#define NRF_FUN_SDP_MSPI_DQ1 59U +/** SDP_MSPI data pin 2 */ +#define NRF_FUN_SDP_MSPI_DQ2 60U +/** SDP_MSPI data pin 3 */ +#define NRF_FUN_SDP_MSPI_DQ3 61U +/** SDP_MSPI data pin 4 */ +#define NRF_FUN_SDP_MSPI_DQ4 62U +/** SDP_MSPI data pin 5 */ +#define NRF_FUN_SDP_MSPI_DQ5 63U +/** SDP_MSPI data pin 6 */ +#define NRF_FUN_SDP_MSPI_DQ6 64U +/** SDP_MSPI data pin 7 */ +#define NRF_FUN_SDP_MSPI_DQ7 65U +/** SDP_MSPI chip select 0 */ +#define NRF_FUN_SDP_MSPI_CS0 66U +/** SDP_MSPI chip select 1 */ +#define NRF_FUN_SDP_MSPI_CS1 67U +/** SDP_MSPI chip select 2 */ +#define NRF_FUN_SDP_MSPI_CS2 68U +/** SDP_MSPI chip select 3 */ +#define NRF_FUN_SDP_MSPI_CS3 69U +/** SDP_MSPI chip select 4 */ +#define NRF_FUN_SDP_MSPI_CS4 70U +/** High-Performance Framework MSPI clock pin */ +#define NRF_FUN_HPF_MSPI_SCK NRF_FUN_SDP_MSPI_SCK +/** High-Performance Framework MSPI data pin 0 */ +#define NRF_FUN_HPF_MSPI_DQ0 NRF_FUN_SDP_MSPI_DQ0 +/** High-Performance Framework MSPI data pin 1 */ +#define NRF_FUN_HPF_MSPI_DQ1 NRF_FUN_SDP_MSPI_DQ1 +/** High-Performance Framework MSPI data pin 2 */ +#define NRF_FUN_HPF_MSPI_DQ2 NRF_FUN_SDP_MSPI_DQ2 +/** High-Performance Framework MSPI data pin 3 */ +#define NRF_FUN_HPF_MSPI_DQ3 NRF_FUN_SDP_MSPI_DQ3 +/** High-Performance Framework MSPI data pin 4 */ +#define NRF_FUN_HPF_MSPI_DQ4 NRF_FUN_SDP_MSPI_DQ4 +/** High-Performance Framework MSPI data pin 5 */ +#define NRF_FUN_HPF_MSPI_DQ5 NRF_FUN_SDP_MSPI_DQ5 +/** High-Performance Framework MSPI data pin 6 */ +#define NRF_FUN_HPF_MSPI_DQ6 NRF_FUN_SDP_MSPI_DQ6 +/** High-Performance Framework MSPI data pin 7 */ +#define NRF_FUN_HPF_MSPI_DQ7 NRF_FUN_SDP_MSPI_DQ7 +/** High-Performance Framework MSPI chip select pin 0 */ +#define NRF_FUN_HPF_MSPI_CS0 NRF_FUN_SDP_MSPI_CS0 +/** High-Performance Framework MSPI chip select pin 1 */ +#define NRF_FUN_HPF_MSPI_CS1 NRF_FUN_SDP_MSPI_CS1 +/** High-Performance Framework MSPI chip select pin 2 */ +#define NRF_FUN_HPF_MSPI_CS2 NRF_FUN_SDP_MSPI_CS2 +/** High-Performance Framework MSPI chip select pin 3 */ +#define NRF_FUN_HPF_MSPI_CS3 NRF_FUN_SDP_MSPI_CS3 +/** High-Performance Framework MSPI chip select pin 4 */ +#define NRF_FUN_HPF_MSPI_CS4 NRF_FUN_SDP_MSPI_CS4 /** TDM SCK in master mode */ #define NRF_FUN_TDM_SCK_M 71U /** TDM SCK in slave mode */ From 6e3893abb9a9397a936b7f7a6115604cbe05326a Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 20 Nov 2020 14:44:03 +0100 Subject: [PATCH 841/881] [nrf noup] Bluetooth: update experimental for qualification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Kconfig options for qualification: - Remove experimental on qualified feature. - Add experimental on unqualified feature. - BT_L2CAP_ECRED is not marked as experimental upstream and we qualify it downstream. Signed-off-by: Joakim Andersson Signed-off-by: Trond Einar Snekvik Signed-off-by: Martí Bolívar Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Ingar Kulbrandstad Signed-off-by: Torsten Rasmussen Signed-off-by: Herman Berget Signed-off-by: Tomasz Moń Signed-off-by: Théo Battrel (cherry picked from commit a29db90830b199845cccdcf81544fc0129a228f9) --- subsys/bluetooth/controller/Kconfig | 4 +++- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 926fc060a89..ca1a5bbede4 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -138,10 +138,12 @@ config HAS_BT_CTLR bool config BT_LL_SW_SPLIT - bool "Software-based Bluetooth LE Link Layer" + bool "Software-based Bluetooth LE Link Layer [EXPERIMENTAL]" default y depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED select HAS_BT_CTLR + select EXPERIMENTAL + select ENTROPY_GENERATOR help Use Zephyr software Bluetooth LE Link Layer ULL LLL split implementation. diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index 2841e7d8a12..34e862378c5 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -52,7 +52,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support" + bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From 5fa53f44aeb7652ab3adff7f9f36735305f674aa Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 21 Mar 2025 14:43:43 +0100 Subject: [PATCH 842/881] [nrf noup] tests: crypto: Set size for PSA slot noup since this option does not exist upstream. The Oberon PSA core has an option to manually set the buffer size of the PSA key slots in bytes. This option here: MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE This option has a default value of 16 since it directly affects the memory usage. The crypto tests use a secp256r1 key and thus since the public key for this key is 65 bytes long we need to set the option in the sample. Signed-off-by: Georgios Vasilakis (cherry picked from commit 39b7cf4e0af13a0a08afd68b0b94976dc0ce8bac) --- tests/crypto/secp256r1/mbedtls.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/crypto/secp256r1/mbedtls.conf b/tests/crypto/secp256r1/mbedtls.conf index bbc2eb0e656..c4ea620de55 100644 --- a/tests/crypto/secp256r1/mbedtls.conf +++ b/tests/crypto/secp256r1/mbedtls.conf @@ -1,6 +1,7 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED=y +CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE=65 CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=2 From 2d24e3e00ba84089b595768701e0bc9640759aad Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 8 Apr 2025 10:16:33 +0100 Subject: [PATCH 843/881] [nrf noup] mgmt: mcumgr: Fix nRF5340 network core hook Fixes an issue whereby just enabling hooks would enable the nrf5340 network core hook despite lacking other requirements Signed-off-by: Jamie McCrae (cherry picked from commit 730c36b0bbb62f31816baeb0f3efaa84dc522c90) --- subsys/mgmt/mcumgr/CMakeLists.txt | 13 +++++++------ subsys/mgmt/mcumgr/Kconfig | 2 +- subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 15 +++------------ subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 ++++++++ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index ad088eca067..3bb21e16f79 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -17,10 +17,11 @@ add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) -if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +if(CONFIG_MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 1c6a3a2a516..c45cb7f81d6 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,7 @@ menuconfig MCUMGR bool "mcumgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) + imply BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP && MCUMGR_GRP_IMG && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c index f1ac8a168e6..b372ce4e494 100644 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -8,19 +8,10 @@ #include #include "bootutil/bootutil_public.h" -#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 -/* Sysbuild */ -#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER -#else -/* Legacy child/parent */ -#define NET_CORE_IMAGE 1 -#endif - -int boot_read_swap_state_primary_slot_hook(int image_index, - struct boot_swap_state *state) +int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state) { - if (image_index == NET_CORE_IMAGE) { - /* Pretend that primary slot of image 1 unpopulated */ + if (image_index == CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER) { + /* Pretend that primary slot of the network core update image is unpopulated */ state->magic = BOOT_MAGIC_UNSET; state->swap_type = BOOT_SWAP_TYPE_NONE; state->image_num = image_index; diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index 5f122fcf71f..d95f9b5849a 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -227,6 +227,14 @@ config MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE sysbuild if needed. This enables selecting the correct slot when running a QSPI XIP split image application in DirectXIP mode. +config MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK + bool "nRF5340 network core bootutil hook" + depends on SOC_NRF5340_CPUAPP && BOOT_IMAGE_ACCESS_HOOKS && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 + default y + help + This option will enable a bootutil hook that populates the network core update image + slot with dummy data to allow for uploading a firmware update to the network core. + module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" From abea383c077da646652c60d465744a576b941a83 Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Tue, 8 Apr 2025 17:56:00 +0200 Subject: [PATCH 844/881] [nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20 The PSA is a cryptographically secure random number generator. It will be enabled by default, eventually, For now, enable it manually. Signed-off-by: Gordon Klaus (cherry picked from commit 892f60bbd28790a22fbaa5631fd32aaa6a6f755f) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 ++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 +++++++ tests/bluetooth/tester/sysbuild.cmake | 7 ---- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 40 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 13 ++++++ .../tester/sysbuild/hci_ipc/prj.conf | 23 +++++++++++ 6 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 5bb1c4d8284..51b0ef5fa8d 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -22,3 +22,10 @@ CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_BTTESTER_LOG_LEVEL_DBG=y CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable PSA RNG +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index e6d4f675f57..4f9de686b7e 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,3 +12,17 @@ status = "okay"; hw-flow-control; }; + +// Enable PSA RNG +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; + + /delete-node/ prng; +}; diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index bcd564733c5..b640a7d0493 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -18,13 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) ) endif() - if(SB_CONFIG_SOC_NRF54H20_CPUAPP) - set(${NET_APP}_CONF_FILE - ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf - CACHE INTERNAL "" - ) - endif() - set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 00000000000..b7d64a9e6a0 --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,40 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_ISR_STACK_SIZE=1024 +CONFIG_IDLE_STACK_SIZE=256 +CONFIG_MAIN_STACK_SIZE=1024 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 +CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y + +CONFIG_BT_BUF_EVT_RX_COUNT=16 +CONFIG_BT_BUF_EVT_RX_SIZE=255 +CONFIG_BT_BUF_ACL_RX_SIZE=255 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_BUF_CMD_TX_SIZE=255 + +# Host +CONFIG_BT_BROADCASTER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_PER_ADV=y +CONFIG_BT_PER_ADV_SYNC=y + +# Controller +CONFIG_BT_LL_SW_SPLIT=n +CONFIG_BT_LL_SOFTDEVICE=y +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 + +# Enable PSA RNG +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 00000000000..e34567fe834 --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,13 @@ +// Enable PSA RNG +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; + + /delete-node/ prng; +}; diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf new file mode 100644 index 00000000000..08b1aed9e7f --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf @@ -0,0 +1,23 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_HEAP_MEM_POOL_SIZE=4096 + +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y +CONFIG_BT_MAX_CONN=16 + + +# Workaround: Unable to allocate command buffer when using K_NO_WAIT since +# Host number of completed commands does not follow normal flow control. +CONFIG_BT_BUF_CMD_TX_COUNT=10 + +# Enable and adjust the below value as necessary +# CONFIG_BT_BUF_EVT_RX_COUNT=16 +# CONFIG_BT_BUF_EVT_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_TX_SIZE=251 +# CONFIG_BT_BUF_CMD_TX_SIZE=255 From 126a83eaf6a9f2c3028e5345449e5a3a7b107aa7 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 30 Nov 2018 14:07:56 +0100 Subject: [PATCH 845/881] [nrf noup] ci: NCS-specific CI tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Necessary changes for NCS CI. - Add a Jenkinsfile - Add a commit-tags workflow: This enables sauce tag checking in sdk-zephyr - compliance.yml: Disable check for merge commits, since we have upmerges downstream. Also, since in the code we refer to Kconfig symbols that are defined in the sdk-nrf repository, the Kconfig checks ((SysBuild)Kconfig, (SysBuild)KconfigBasic and (SysBuild)KconfigBasicNoModules) will not pass so exclude them. Also, disable any maintainers-related checks - scripts/gitlint: Extend the max commit line lengths for Gitlint to account for sauce tags - Adapt to the changes in: https://github.com/nrfconnect/action-commit-tags/pull/4 Signed-off-by: Carles Cufi Signed-off-by: Dominik Ermel Signed-off-by: Martí Bolívar Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Krishna T Signed-off-by: Dominik Ermel (cherry picked from commit ad003a38b2a4230828df44ea025f179a64256947) --- .github/workflows/commit-tags.yml | 28 ++++++++++++++++++++++++++ .github/workflows/compliance.yml | 13 +++++------- Jenkinsfile | 5 +++++ scripts/gitlint/zephyr_commit_rules.py | 4 ++-- 4 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/commit-tags.yml create mode 100644 Jenkinsfile diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml new file mode 100644 index 00000000000..828f0297167 --- /dev/null +++ b/.github/workflows/commit-tags.yml @@ -0,0 +1,28 @@ +name: Commit tags + +on: + pull_request: + types: [synchronize, opened, reopened, edited, labeled, unlabeled, + milestoned, demilestoned, assigned, unassigned, ready_for_review, + review_requested] + +jobs: + commit_tags: + runs-on: ubuntu-22.04 + name: Run commit tags checks on patch series (PR) + steps: + - name: Update PATH for west + run: | + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Checkout the code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Run the commit tags + uses: nrfconnect/action-commit-tags@main + with: + target: . + upstream: zephyrproject-rtos/zephyr/main diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 9d19b5a69e6..0e39baa4732 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -34,8 +34,8 @@ jobs: git config --global user.name "Your Name" git remote -v # Ensure there's no merge commits in the PR - [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ - (echo "::error ::Merge commits not allowed, rebase instead";false) + #[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ + #(echo "::error ::Merge commits not allowed, rebase instead";false) rm -fr ".git/rebase-apply" rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} @@ -72,12 +72,9 @@ jobs: git log --pretty=oneline | head -n 10 # Increase rename limit to allow for large PRs git config diff.renameLimit 10000 - excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat" - # The signed-off-by check for dependabot should be skipped - if [ "${{ github.actor }}" == "dependabot[bot]" ]; then - excludes="$excludes -e Identity" - fi - ./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}.. + ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic \ + -e Kconfig -e SysbuildKconfig -e KconfigBasicNoModules -e SysbuildKconfigBasicNoModules \ + -e ModulesMaintainers -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000000..3b9cf002239 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,5 @@ +@Library("CI_LIB") _ + +def pipeline = new ncs.sdk_zephyr.Main() + +pipeline.run(JOB_NAME) diff --git a/scripts/gitlint/zephyr_commit_rules.py b/scripts/gitlint/zephyr_commit_rules.py index a2c9cd3cb7f..ef317e22684 100644 --- a/scripts/gitlint/zephyr_commit_rules.py +++ b/scripts/gitlint/zephyr_commit_rules.py @@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule): name = "title-max-length-no-revert" id = "UC5" target = CommitMessageTitle - options_spec = [IntOption('line-length', 75, "Max line length")] + options_spec = [IntOption('line-length', 120, "Max line length")] violation_message = "Commit title exceeds max length ({0}>{1})" def validate(self, line, _commit): @@ -103,7 +103,7 @@ class MaxLineLengthExceptions(LineRule): name = "max-line-length-with-exceptions" id = "UC4" target = CommitMessageBody - options_spec = [IntOption('line-length', 75, "Max line length")] + options_spec = [IntOption('line-length', 120, "Max line length")] violation_message = "Commit message body line exceeds max length ({0}>{1})" def validate(self, line, _commit): From dc8ba1dc8a3d89510400cbd5c3670a1b945f381e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 12 May 2025 08:47:55 +0100 Subject: [PATCH 846/881] [nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs Adds symbols used in NCS to the sysbuild Kconfig allow list Signed-off-by: Jamie McCrae (cherry picked from commit 77ba279d1f02d409714133c72ca70852193d5e3c) --- scripts/ci/check_compliance.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 4ef7c81cfd0..d52f9c15878 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1445,6 +1445,30 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop + + # NCS-specific allowlist + # zephyr-keep-sorted-start re(^\s+") + "APP_CPUNET_RUN", # Used by sample + "APP_DFU", # Used by sample + "BT_FAST_PAIR", # Legacy/removed, used in migration documentation + "COMP_DATA_LAYOUT_ARRAY", # Used by test + "COMP_DATA_LAYOUT_MULTIPLE", # Used by test + "COMP_DATA_LAYOUT_SINGLE", # Used by test + "DTM_NO_DFE", # Used by DTM application + "DTM_TRANSPORT_HCI", # Used by DTM application + "INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation + "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "ML_APP_REMOTE_BOARD", # Used by machine learning application + "MY_APP_IMAGE_ABC", # Used in documentation + "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests + "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation + "SUIT_ENVELOPE_", # Used by jinja + "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation + "SUIT_MPI_", # Used by jinja + "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation + "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample + # zephyr-keep-sorted-stop } From 9eb8aa594c43e17e3ff1935f45b724c43b7ce6b9 Mon Sep 17 00:00:00 2001 From: Robert Stypa Date: Wed, 18 Jun 2025 07:45:47 +0200 Subject: [PATCH 847/881] [nrf noup] ci: Update CI-boot-test patterns and remove SUIT labels Add boards/nordic/**/* to the CI-boot-test scope and remove SUIT labels. Signed-off-by: Robert Stypa (cherry picked from commit b68aa7bd7be4df7d7d6cb924c1f963cb590b9ce9) --- .github/test-spec.yml | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 6da6bdbaa87..5337249f7da 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,6 +39,7 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": + - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" @@ -364,29 +365,3 @@ - "tests/boards/nordic/**/*" - "tests/drivers/**/*" - "tests/kernel/**/*" - -"CI-suit-dfu-test": - - "subsys/mgmt/mcumgr/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "subsys/bluetooth/**/*" - - "drivers/bluetooth/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/console/**/*" - - "drivers/gpio/**/*" - - "dts/common/nordic/*" - - "dts/arm/nordic/nrf54h*/**/*" - - "dts/riscv/nordic/nrf54h*/**/*" - - "boards/nordic/nrf54h*/**/*" - - "soc/nordic/nrf54h/**/*" - - "include/zephyr/**/*" - - "subsys/logging/**/*" - - "subsys/tracing/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/nrfutil.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" From 2b3c5671644e27d6b8c02560fb74fe6b1bd7fe17 Mon Sep 17 00:00:00 2001 From: Richa Pandey Date: Thu, 19 Jun 2025 11:07:37 +0200 Subject: [PATCH 848/881] [nrf noup] zephyr: doc: fix board page Fixed board page in zephyr. Signed-off-by: Richa Pandey (cherry picked from commit 45023b2d4f10fbbcb6f0be9da7d666a1cc5dee46) --- boards/index.rst | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/boards/index.rst b/boards/index.rst index 3cc92770cfe..2ffe426fc24 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -12,33 +12,8 @@ template available under :zephyr_file:`doc/templates/board.tmpl`. Shields are hardware add-ons that can be stacked on top of a board to add extra functionality. Refer to the :ref:`shield_porting_guide` for more information on how to port a shield. -.. admonition:: Search Tips - :class: dropdown - - * Use the form below to filter the list of supported boards and shields. If a field is left - empty, it will not be used in the filtering process. - - * Filtering by name and vendor is available for both boards and shields. The rest of the fields - apply only to boards. - - * A board/shield must meet **all** criteria selected across different fields. For example, if you - select both a vendor and an architecture, only boards that match both will be displayed. Within - a single field, selecting multiple options (such as two architectures) will show boards - matching **either** option. - - * The list of supported hardware features for each board is automatically generated using - information from the Devicetree. It may not be reflecting the full list of supported features - since some of them may not be enabled by default. - - * Can't find your exact board? Don't worry! If a similar board with the same or a closely related - MCU exists, you can use it as a :ref:`starting point ` for adding - support for your own board. - .. toctree:: :maxdepth: 2 :glob: - :hidden: */index - -.. zephyr:board-catalog:: From 9ee1e51a2cfef2f9c3ef70dbcb3fee4c01424ff4 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 10 Jun 2025 23:20:32 +0200 Subject: [PATCH 849/881] [nrf noup] bluetooth: host: Add support for bonding with same peer This commit adds a new Kconfig option by enabling which Host will keep bonding with the same Central instead of rejecting pairing. Brief implementation details: This implementation adds a new flag to bt_keys struct: BT_KEYS_ID_CONFLICT. The flag is set, when: - bonding with the same peer and conflict identified - when loading conflicting keys from persistent storage. When bonding and conflict is identified, the new keys aren't added to the Resolving List immediately. Instead, the old keys stay in the Resolving List. When start advertising, Host finds conflicting keys that are already added to the Resolving List and substitues them. If, however, there is another advertiser already started for the added keys, the new request is reject and advertising start function returns -EPERM. This is supported by Peripheral role only for now. Signed-off-by: Pavel Vasilyev (cherry picked from commit 93b8dd96508ddc5b86ea2f34ea57501fce5311b2) (cherry picked from commit 1890dbafd139c48deecd082099fb036fb4ca1649) --- include/zephyr/bluetooth/bluetooth.h | 10 ++ subsys/bluetooth/host/Kconfig | 18 +++ subsys/bluetooth/host/adv.c | 52 +++++++ subsys/bluetooth/host/adv.h | 1 + subsys/bluetooth/host/hci_core.h | 23 ++- subsys/bluetooth/host/id.c | 219 ++++++++++++++++++++++++--- subsys/bluetooth/host/id.h | 23 +++ subsys/bluetooth/host/keys.c | 79 +++++++++- subsys/bluetooth/host/keys.h | 6 + subsys/bluetooth/host/smp.c | 18 ++- tests/bluetooth/host/id/mocks/adv.c | 1 + tests/bluetooth/host/id/mocks/adv.h | 4 +- tests/bluetooth/host/id/mocks/keys.c | 1 + tests/bluetooth/host/id/mocks/keys.h | 4 +- 14 files changed, 427 insertions(+), 32 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 1656f1f5684..a769b49967f 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1370,6 +1370,10 @@ struct bt_le_per_adv_param { * This error code is only guaranteed when using Zephyr * controller, for other controllers code returned in * this case may be -EIO. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_adv_start(const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, @@ -1497,6 +1501,12 @@ struct bt_le_ext_adv_start_param { * * @param adv Advertising set object. * @param param Advertise start parameters. + * + * @return Zero on success or (negative) error code otherwise. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, const struct bt_le_ext_adv_start_param *param); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 72deb4343dc..4e275e6cc28 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -658,6 +658,24 @@ config BT_ID_UNPAIR_MATCHING_BONDS link-layer. The Host does not have control over this acknowledgment, and the order of distribution is fixed by the specification. +config BT_ID_AUTO_SWAP_MATCHING_BONDS + bool "Automatically swap conflicting entries in the Resolving List" + depends on !BT_ID_UNPAIR_MATCHING_BONDS + depends on BT_PRIVACY && BT_PERIPHERAL && !BT_CENTRAL + help + If this option is enabled, the Host will not add a new bond with + the same peer address (or IRK) to the Resolving List if there is + already a bond with the same peer address (or IRK) on another local + identity. + + In case of Peripheral, the Host will swap the existing entry in the + Resolving List with the new one, so that the new bond will be used for + address resolution for the new local identity if the device starts + advertising with the new local identity. + + Important: this option is supported exclusively in the Peripheral + role. Excluding the Central role. + config BT_ID_ALLOW_UNAUTH_OVERWRITE bool "Allow unauthenticated pairing with same peer with other local identity" depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 749495bcb56..ab86e8b8858 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -235,6 +235,25 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) #endif /* CONFIG_BT_BROADCASTER */ #endif /* defined(CONFIG_BT_EXT_ADV) */ +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id) +{ +#if defined(CONFIG_BT_EXT_ADV) + for (size_t i = 0; i < ARRAY_SIZE(adv_pool); i++) { + if (atomic_test_bit(adv_pool[i].flags, BT_ADV_CREATED) && + adv_pool[i].id == id) { + return &adv_pool[i]; + } + } +#else + if (atomic_test_bit(bt_dev.adv.flags, BT_ADV_CREATED) && bt_dev.adv.id == id) { + return &bt_dev.adv; + } +#endif + + return NULL; +} + + void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), void *data) { @@ -928,6 +947,14 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, adv->id = param->id; bt_dev.adv_conn_id = adv->id; + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = bt_id_set_adv_own_addr(adv, param->options, dir_adv, &set_param.own_addr_type); if (err) { @@ -1223,6 +1250,15 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } adv->id = param->id; + + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = le_ext_adv_param_set(adv, param, sd != NULL); if (err) { return err; @@ -1613,6 +1649,22 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, return -EALREADY; } + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + const bt_addr_le_t *peer; + + if (bt_addr_le_eq(&adv->target_addr, BT_ADDR_LE_ANY)) { + peer = NULL; + } else { + peer = &adv->target_addr; + } + + err = bt_id_resolving_list_check_and_update(adv->id, peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index 65ad51135ce..1bd15854db2 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -25,3 +25,4 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable); int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv); void bt_adv_reset_adv_pool(void); +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 315db2d3888..bb91c3732dd 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -497,7 +497,28 @@ struct bt_keys; void bt_id_add(struct bt_keys *keys); void bt_id_del(struct bt_keys *keys); -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate); +/** @brief Find a conflict in the resolving list for a candidate IRK. + * + * @param candidate The candidate keys to check for conflicts. + * @param all If true, check all IRKs, otherwise check only added keys. + * + * @return The conflicting key if there is one, or NULL if no conflict was found. + */ +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool all); + +/** * @brief Find multiple conflicts in the resolving list for a candidate IRK. + * + * This function iterates over all keys (added and not added to the Resolving List). If there are + * multiple conflicts, this function will return true. Otherwise, it will return false. + * + * If @c firt_conflict is not NULL, it will be set to the first found conflict. + * + * @param candidate The candidate key to check for conflicts. + * @param first_conflict Pointer to store the first found conflict, if any. Can be NULL. + * + * @return True if there are multiple conflicts, otherwise it returns false. + */ +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict); int bt_setup_random_id_addr(void); int bt_setup_public_id_addr(void); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index a43aaef78f4..775f08182b7 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -942,9 +942,33 @@ void bt_id_pending_keys_update(void) } } +static bool keys_conflict_check(const struct bt_keys *candidate, const struct bt_keys *resident) +{ + bool addr_conflict; + bool irk_conflict; + + addr_conflict = bt_addr_le_eq(&candidate->addr, &resident->addr); + + /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ + irk_conflict = (!bt_irk_eq(&candidate->irk, &(struct bt_irk){}) && + bt_irk_eq(&candidate->irk, &resident->irk)); + + if (addr_conflict || irk_conflict) { + LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&candidate->addr), + bt_hex(candidate->irk.val, sizeof(candidate->irk.val))); + + return true; + } + + return false; +} + struct bt_id_conflict { struct bt_keys *candidate; struct bt_keys *found; + bool check_all_irk; }; /* The Controller Resolve List is constrained by 7.8.38 "LE Add Device To @@ -956,8 +980,6 @@ struct bt_id_conflict { static void find_rl_conflict(struct bt_keys *resident, void *user_data) { struct bt_id_conflict *conflict = user_data; - bool addr_conflict; - bool irk_conflict; __ASSERT_NO_MSG(conflict != NULL); __ASSERT_NO_MSG(conflict->candidate != NULL); @@ -970,32 +992,26 @@ static void find_rl_conflict(struct bt_keys *resident, void *user_data) } /* Test against committed bonds only. */ - if ((resident->state & BT_KEYS_ID_ADDED) == 0) { + if (!conflict->check_all_irk && (resident->state & BT_KEYS_ID_ADDED) == 0) { + /* If the resident bond is not committed, we cannot have a conflict. */ return; } - addr_conflict = bt_addr_le_eq(&conflict->candidate->addr, &resident->addr); - - /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ - irk_conflict = (!bt_irk_eq(&conflict->candidate->irk, &(struct bt_irk){}) && - bt_irk_eq(&conflict->candidate->irk, &resident->irk)); - - if (addr_conflict || irk_conflict) { - LOG_DBG("Resident : addr %s and IRK %s, id: %d", bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val)), resident->id); - LOG_DBG("Candidate: addr %s and IRK %s, id: %d", - bt_addr_le_str(&conflict->candidate->addr), - bt_hex(conflict->candidate->irk.val, sizeof(conflict->candidate->irk.val)), - conflict->candidate->id); + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + if (keys_conflict_check(conflict->candidate, resident)) { conflict->found = resident; } } -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_irk) { struct bt_id_conflict conflict = { .candidate = candidate, + .check_all_irk = check_all_irk, }; bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict, &conflict); @@ -1003,6 +1019,59 @@ struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) return conflict.found; } +struct bt_id_conflict_multiple { + struct bt_keys *candidate; + struct bt_keys *found; + bool found_multiple; +}; + +void find_rl_conflict_multiple(struct bt_keys *resident, void *user_data) +{ + struct bt_id_conflict_multiple *conflict = user_data; + + __ASSERT_NO_MSG(conflict != NULL); + __ASSERT_NO_MSG(conflict->candidate != NULL); + __ASSERT_NO_MSG(resident != NULL); + + if (conflict->found_multiple) { + /* If we already found enough conflicts, we can stop searching. */ + return; + } + + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + + if (keys_conflict_check(conflict->candidate, resident)) { + if (conflict->found) { + conflict->found_multiple = true; + + LOG_WRN("Found multiple conflicts for %s: addr %s and IRK %s", + bt_addr_le_str(&conflict->candidate->addr), + bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + } else { + conflict->found = resident; + } + } +} + +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict) +{ + struct bt_id_conflict_multiple conflict = { + .candidate = candidate, + }; + + bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict_multiple, &conflict); + + if (first_conflict != NULL) { + *first_conflict = conflict.found; + } + + return conflict.found_multiple; +} + void bt_id_add(struct bt_keys *keys) { CHECKIF(keys == NULL) { @@ -1265,6 +1334,122 @@ void bt_id_del(struct bt_keys *keys) bt_le_ext_adv_foreach(adv_unpause_enabled, NULL); } } + +static int conflict_check_and_replace(uint8_t id, struct bt_keys *keys) +{ + /* For the given key check if it has conflicts with other keys in the Resolving List + * (such keys have BT_KEYS_ID_ADDED state and BT_KEYS_ID_CONFLICT flag set). If it does, we + * need to remove the conflicting key from the Resolving List and add the new key. + * + * If the key is not in the Resolving List, we can add the new key right away. + * + * If advertiser for the conflicting key is enabled, we cannot remove the key from the + * Resolving List, so we return an error. + */ + + struct bt_keys *conflict; + const struct bt_le_ext_adv *adv; + + if (!(keys->flags & BT_KEYS_ID_CONFLICT)) { + LOG_DBG("Key has no conflicts for id %u addr %s", id, bt_addr_le_str(&keys->addr)); + return 0; + } + + if (keys->state & BT_KEYS_ID_ADDED) { + LOG_DBG("Key is already added to resolving list for id %u addr %s", id, + bt_addr_le_str(&keys->addr)); + return 0; + } + + /* bt_id_find_conflict returns only keys added to the Resolving List (state is + * BT_KEYS_ID_ADDED). If the key has conflict, but no keys were added (for example, if the + * last added key was removed after bt_unpair()), then this function will return NULL. Then, + * we don't need to remove a conflicting key from the Resolving List. Otherwise, we need to + * remove the conflicting key from the Resolving List before adding the new key. + */ + conflict = bt_id_find_conflict(keys, false); + if (conflict != NULL) { + __ASSERT_NO_MSG((conflict->flags & BT_KEYS_ID_CONFLICT) != 0); + + LOG_DBG("Found conflicting key with id %u addr %s", conflict->id, + bt_addr_le_str(&conflict->addr)); + + adv = bt_adv_lookup_by_id(conflict->id); + if (adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { + LOG_WRN("Cannot remove the conflicting key from the Resolving List while" + " advertising"); + return -EPERM; + } + + /* Drop BT_KEYS_ID_PENDING_DEL flag if we were about to delete the keys since we + * delete it here. + */ + conflict->state &= ~BT_KEYS_ID_PENDING_DEL; + bt_id_del(conflict); + } + + bt_id_add(keys); + + return 0; +} + +struct bt_id_resolve { + uint8_t id; + int err; +}; + +static void check_and_add_keys_for_id(struct bt_keys *keys, void *data) +{ + struct bt_id_resolve *resolve = data; + + if (resolve->err) { + /* Skipping other keys because we got error. */ + return; + } + + if (resolve->id != keys->id) { + /* We are only interested in keys for the given id */ + return; + } + + resolve->err = conflict_check_and_replace(resolve->id, keys); +} + +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer) +{ + int err; + + if (peer == NULL) { + struct bt_id_resolve resolve = { + .id = id, + }; + + LOG_DBG("Updating resolving list for id %u without peer address", id); + + bt_keys_foreach_type(BT_KEYS_IRK, check_and_add_keys_for_id, &resolve); + err = resolve.err; + } else { + struct bt_keys *keys; + + LOG_DBG("Updating resolving list for id %u addr %s", id, bt_addr_le_str(peer)); + + keys = bt_keys_get_addr(id, peer); + if (!keys) { + LOG_DBG("No keys found for id %u addr %s", id, bt_addr_le_str(peer)); + return -ENOENT; + } + + err = conflict_check_and_replace(id, keys); + } + + if (err) { + LOG_ERR("Failed to update resolving list for id %u addr %s (err %d)", id, + peer ? bt_addr_le_str(peer) : "NULL", err); + return err; + } + + return err; +} #endif /* defined(CONFIG_BT_SMP) */ void bt_id_get(bt_addr_le_t *addrs, size_t *count) diff --git a/subsys/bluetooth/host/id.h b/subsys/bluetooth/host/id.h index 8824d3bb496..cd66784a503 100644 --- a/subsys/bluetooth/host/id.h +++ b/subsys/bluetooth/host/id.h @@ -60,3 +60,26 @@ void bt_id_pending_keys_update(void); void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag); void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv); + +/** + * @brief Check and update the resolving list for a given identity. + * + * This function checks if the resolving list contains the keys for the given + * identity and peer address. If the keys are not present, it adds them to the + * resolving list. If the keys are present, it checks for conflicts with + * existing keys in the resolving list. If a conflict is found, it replaces + * the conflicting key with the new key. + * + * If the peer address is NULL, it updates the resolving list for all keys that belong to the given + * identity. + * + * If for any of the keys belonging to the given identity a conflict is found and the advertiser for + * that key is enabled, the function returns an error. + * + * @param id The identity ID to check and update. + * @param peer The peer address to check against the resolving list. + * + * @return 0 on success, or a negative error code on failure. + * @return -EPERM if a conflict is found and the advertiser for the conflicting key is enabled. + */ +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer); diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 1205494e856..e2116f3bede 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -310,16 +310,57 @@ void bt_keys_add_type(struct bt_keys *keys, enum bt_keys_type type) keys->keys |= type; } +static void add_id_cb(struct k_work *work) +{ + bt_id_pending_keys_update(); +} + +static K_WORK_DEFINE(add_id_work, add_id_cb); + void bt_keys_clear(struct bt_keys *keys) { + struct bt_keys *conflict = NULL; + __ASSERT_NO_MSG(keys != NULL); LOG_DBG("%s (keys 0x%04x)", bt_addr_le_str(&keys->addr), keys->keys); + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + (keys->flags & BT_KEYS_ID_CONFLICT) != 0) { + /* We need to check how many conflicting keys left. If there is only one conflicting + * key left, we can remove the BT_KEYS_ID_CONFLICT flag from it so that Host don't + * need to check and update the Resolving List whenever this is needed. The key + * should be re-added to the Resolving List. + */ + bool found_multiple; + + found_multiple = bt_id_find_conflict_multiple(keys, &conflict); + if (conflict) { + if (found_multiple || (conflict->state & BT_KEYS_ID_ADDED) != 0) { + /* If we found multiple conflicting keys or the conflicting key + * is already added to the ID list, we don't need to clear the + * conflict flag for it and re-add it to the Resolving List. + */ + conflict = NULL; + } else { + /* Clear the conflict flag for the conflicting key */ + conflict->flags &= ~BT_KEYS_ID_CONFLICT; + } + } + } + if (keys->state & BT_KEYS_ID_ADDED) { bt_id_del(keys); } + if (conflict) { + /* Re-add the conflicting key to the Resolving List if it was the last conflicting + * key. + */ + bt_id_pending_keys_update_set(conflict, BT_KEYS_ID_PENDING_ADD); + k_work_submit(&add_id_work); + } + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { /* Delete stored keys from flash */ bt_settings_delete_keys(keys->id, &keys->addr); @@ -347,6 +388,28 @@ int bt_keys_store(struct bt_keys *keys) return 0; } +static void check_and_set_id_conflict_flag(struct bt_keys *keys) +{ + struct bt_keys *conflict; + + if (!IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + /* If auto-swap is not enabled, we don't need to check for conflicts */ + return; + } + + /* Use bt_id_find_conflict() to check if there are any conflicting keys for the given keys. + * If there is at least one, set the BT_KEYS_ID_CONFLICT flag for both the keys and the + * conflicting key. + */ + conflict = bt_id_find_conflict(keys, true); + if (conflict != NULL) { + LOG_DBG("Found conflicting key %p.", conflict); + + keys->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + } +} + static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { @@ -427,6 +490,8 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, memcpy(keys->storage_start, val, len); } + check_and_set_id_conflict_flag(keys); + LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { @@ -436,17 +501,17 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return 0; } -static void add_id_cb(struct k_work *work) -{ - bt_id_pending_keys_update(); -} - -static K_WORK_DEFINE(add_id_work, add_id_cb); - static void id_add(struct bt_keys *keys, void *user_data) { __ASSERT_NO_MSG(keys != NULL); + if (keys->flags & BT_KEYS_ID_CONFLICT) { + /* If the keys have the conflict flag set, we don't want to add them to the ID list, + * as this will cause issues with resolving list. + */ + return; + } + bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD); k_work_submit(&add_id_work); } diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index b53635ce2c5..185fd610e77 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -45,6 +45,12 @@ enum { /* Bit 2 and 3 might accidentally exist in old stored keys */ BT_KEYS_SC = BIT(4), BT_KEYS_OOB = BIT(5), + /** Indicates that the keys are in conflict with existing keys. + * + * This is used to indicate that the keys being added conflict with + * existing keys from different identity. + */ + BT_KEYS_ID_CONFLICT = BIT(6), }; struct bt_ltk { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 4590f5d411a..5854612a2af 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -910,7 +910,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) bt_id_del(keys); } - conflict = bt_id_find_conflict(keys); + conflict = bt_id_find_conflict(keys, false); if (conflict != NULL) { int err; @@ -920,7 +920,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) __ASSERT_NO_MSG(!err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(keys)); + __ASSERT_NO_MSG(!bt_id_find_conflict(keys, false)); bt_id_add(keys); } @@ -4096,16 +4096,24 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) */ __ASSERT_NO_MSG(!(smp->remote_dist & BT_SMP_DIST_ID_KEY)); - conflict = bt_id_find_conflict(new_bond); + conflict = bt_id_find_conflict(new_bond, IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)); if (conflict) { LOG_DBG("New bond conflicts with a bond on id %d.", conflict->id); } - if (conflict && !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { + if (conflict && !IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { LOG_WRN("Refusing new pairing. The old bond must be unpaired first."); return BT_SMP_ERR_AUTH_REQUIREMENTS; } + if (conflict && IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + LOG_WRN("Conflict detected with %p. Don't add key to Resolve List.", conflict); + new_bond->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + return 0; + } + if (conflict && IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { bool trust_ok; int unpair_err; @@ -4122,7 +4130,7 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) __ASSERT_NO_MSG(!unpair_err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond)); + __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond, false)); bt_id_add(new_bond); return 0; } diff --git a/tests/bluetooth/host/id/mocks/adv.c b/tests/bluetooth/host/id/mocks/adv.c index 2c2d4f3f3c7..a22123dea3d 100644 --- a/tests/bluetooth/host/id/mocks/adv.c +++ b/tests/bluetooth/host/id/mocks/adv.c @@ -15,3 +15,4 @@ DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv *, DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DEFINE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/adv.h b/tests/bluetooth/host/id/mocks/adv.h index bfb74400159..1602ddf4718 100644 --- a/tests/bluetooth/host/id/mocks/adv.h +++ b/tests/bluetooth/host/id/mocks/adv.h @@ -18,7 +18,8 @@ typedef void (*bt_le_ext_adv_foreach_cb)(struct bt_le_ext_adv *adv, void *data); FAKE(bt_le_adv_lookup_legacy) \ FAKE(bt_le_ext_adv_get_index) \ FAKE(bt_le_adv_set_enable_ext) \ - FAKE(bt_le_ext_adv_foreach) + FAKE(bt_le_ext_adv_foreach) \ + FAKE(bt_adv_lookup_by_id) DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable, struct bt_le_ext_adv *, bool); DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_le_adv_lookup_legacy); @@ -27,3 +28,4 @@ DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv * DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DECLARE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/keys.c b/tests/bluetooth/host/id/mocks/keys.c index f885ab875c0..61f73569c46 100644 --- a/tests/bluetooth/host/id/mocks/keys.c +++ b/tests/bluetooth/host/id/mocks/keys.c @@ -10,3 +10,4 @@ DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DEFINE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); diff --git a/tests/bluetooth/host/id/mocks/keys.h b/tests/bluetooth/host/id/mocks/keys.h index b6901e315ab..1912472b78d 100644 --- a/tests/bluetooth/host/id/mocks/keys.h +++ b/tests/bluetooth/host/id/mocks/keys.h @@ -15,7 +15,9 @@ typedef void (*bt_keys_foreach_type_cb)(struct bt_keys *keys, void *data); /* List of fakes used by this unit tester */ #define KEYS_FFF_FAKES_LIST(FAKE) \ FAKE(bt_keys_find_irk) \ - FAKE(bt_keys_foreach_type) + FAKE(bt_keys_foreach_type) \ + FAKE(bt_keys_get_addr) DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DECLARE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); From 6be8762cd9ac3e2e2d716fc5f3301f5c0346ca0d Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 12 Jun 2025 13:09:23 +0200 Subject: [PATCH 850/881] [nrf noup] boards: nrf54h20dk: Enable default images for sysbuild Enable the `empty_app_core` image when building for `cpurad`. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 91e50002e9f067dff6727639670c1719308e9a6a) --- boards/nordic/nrf54h20dk/Kconfig.sysbuild | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 boards/nordic/nrf54h20dk/Kconfig.sysbuild diff --git a/boards/nordic/nrf54h20dk/Kconfig.sysbuild b/boards/nordic/nrf54h20dk/Kconfig.sysbuild new file mode 100644 index 00000000000..29bd62b4992 --- /dev/null +++ b/boards/nordic/nrf54h20dk/Kconfig.sysbuild @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_NRF54H20DK_NRF54H20_CPURAD + +config NRF_DEFAULT_EMPTY + default y + +endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From c25c0fce2141717138f40c72d999aaae95f6fa85 Mon Sep 17 00:00:00 2001 From: Aleksandar Stanoev Date: Thu, 3 Jul 2025 15:37:01 +0100 Subject: [PATCH 851/881] [nrf noup] boards: xiao_ble: Add static partition manager configuration The xiao_ble boards ship with a bootloader requiring an app offset of 0x27000. The upstream board defines this via DT partitions, which will not be used if partition manager is enabled. Add a static partition configuration to allow binaries built for this board to work out-of-the-box in NCS, and match the behavior with sysbuild disabled. Signed-off-by: Aleksandar Stanoev (cherry picked from commit f8d62960ff1247572cc783278a6fd42900e8621a) --- boards/seeed/xiao_ble/pm_static.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 boards/seeed/xiao_ble/pm_static.yml diff --git a/boards/seeed/xiao_ble/pm_static.yml b/boards/seeed/xiao_ble/pm_static.yml new file mode 100644 index 00000000000..02915293177 --- /dev/null +++ b/boards/seeed/xiao_ble/pm_static.yml @@ -0,0 +1,18 @@ +# Mirror of partitions defined in nrf52840_partition_uf2_sdv7.dtsi +# Default flash layout for nrf52840 using UF2 and SoftDevice s140 v7 + +softdevice_reserved: + address: 0x00 + size: 0x27000 + +app: + address: 0x27000 + size: 0xC5000 + +settings_storage: + address: 0xEC000 + size: 0x8000 + +uf2_partition: + address: 0xF4000 + size: 0xC000 From 7b6510df08c2491bca427725b1597e15a7bdf25c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 4 Jul 2025 14:38:28 +0200 Subject: [PATCH 852/881] [nrf noup] modem: backend: uart: SLM optimized modem UART backend This noup does the following: - Adds the modem_backend_uart_slm modem backend which is optimized for UART communication to SLM. The noup is intended to live until upstream zephyr has proper consistent RTS/CTS flow control support across multiple drivers, and DTR, RTS and CTS support has been added to the upstream modem UART backends, and lastly, SLM has been updated to use DTR, so everything is in sync. Ask Bjarki Arge Andreasen, Markus Lassila or Seppo Takalo when this noup is to be altered as part of an upmerge for example. Signed-off-by: Bjarki Arge Andreasen Signed-off-by: Markus Lassila (cherry picked from commit 3290b8b98587cafc91c483cdd217a40f9c51bad0) --- include/zephyr/modem/backend/uart_slm.h | 61 +++ subsys/modem/backends/CMakeLists.txt | 1 + subsys/modem/backends/Kconfig | 23 + .../modem/backends/modem_backend_uart_slm.c | 514 ++++++++++++++++++ 4 files changed, 599 insertions(+) create mode 100644 include/zephyr/modem/backend/uart_slm.h create mode 100644 subsys/modem/backends/modem_backend_uart_slm.c diff --git a/include/zephyr/modem/backend/uart_slm.h b/include/zephyr/modem/backend/uart_slm.h new file mode 100644 index 00000000000..e522c6cf791 --- /dev/null +++ b/include/zephyr/modem/backend/uart_slm.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +#ifndef ZEPHYR_MODEM_BACKEND_UART_SLM_ +#define ZEPHYR_MODEM_BACKEND_UART_SLM_ + +#ifdef __cplusplus +extern "C" { +#endif + +struct slm_rx_queue_event { + uint8_t *buf; + size_t len; +}; + +struct modem_backend_uart_slm { + const struct device *uart; + struct modem_pipe pipe; + struct k_work_delayable receive_ready_work; + struct k_work transmit_idle_work; + +#ifdef CONFIG_MODEM_STATS + struct modem_stats_buffer receive_buf_stats; + struct modem_stats_buffer transmit_buf_stats; +#endif + struct ring_buf transmit_rb; + struct k_work rx_disabled_work; + atomic_t state; + + struct k_mem_slab rx_slab; + struct k_msgq rx_queue; + struct slm_rx_queue_event rx_event; + struct slm_rx_queue_event rx_queue_buf[CONFIG_MODEM_BACKEND_UART_SLM_BUFFER_COUNT]; + uint32_t rx_buf_size; + uint8_t rx_buf_count; +}; + +struct modem_backend_uart_slm_config { + const struct device *uart; + uint8_t *receive_buf; /* Address must be word-aligned. */ + uint32_t receive_buf_size; + uint8_t *transmit_buf; + uint32_t transmit_buf_size; +}; + +struct modem_pipe *modem_backend_uart_slm_init(struct modem_backend_uart_slm *backend, + const struct modem_backend_uart_slm_config *config); + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_MODEM_BACKEND_UART_SLM_ */ diff --git a/subsys/modem/backends/CMakeLists.txt b/subsys/modem/backends/CMakeLists.txt index e2247a8a09d..787697a84e1 100644 --- a/subsys/modem/backends/CMakeLists.txt +++ b/subsys/modem/backends/CMakeLists.txt @@ -10,3 +10,4 @@ if(CONFIG_MODEM_BACKEND_UART_ASYNC) zephyr_library_sources_ifdef(CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC modem_backend_uart_async_hwfc.c) zephyr_library_sources_ifndef(CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC modem_backend_uart_async.c) endif() +zephyr_library_sources_ifdef(CONFIG_MODEM_BACKEND_UART_SLM modem_backend_uart_slm.c) diff --git a/subsys/modem/backends/Kconfig b/subsys/modem/backends/Kconfig index 2ce81c6dce1..5f8d804ed35 100644 --- a/subsys/modem/backends/Kconfig +++ b/subsys/modem/backends/Kconfig @@ -64,3 +64,26 @@ endif # MODEM_BACKEND_UART_ASYNC_HWFC endif # MODEM_BACKEND_UART_ASYNC endif # MODEM_BACKEND_UART + +config MODEM_BACKEND_UART_SLM + bool "SLM-optimized modem UART backend" + select MODEM_PIPE + select RING_BUFFER + depends on UART_ASYNC_API + +if MODEM_BACKEND_UART_SLM + +config MODEM_BACKEND_UART_SLM_BUFFER_COUNT + int "SLM modem UART backend buffer count" + range 2 4 + default 3 + +config MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS + int "SLM modem UART transmit timeout in milliseconds" + default 1000 + +config MODEM_BACKEND_UART_SLM_RECEIVE_IDLE_TIMEOUT_MS + int "SLM modem UART receive idle timeout in milliseconds" + default 30 + +endif # MODEM_BACKEND_UART_SLM diff --git a/subsys/modem/backends/modem_backend_uart_slm.c b/subsys/modem/backends/modem_backend_uart_slm.c new file mode 100644 index 00000000000..f1aa1b0bb40 --- /dev/null +++ b/subsys/modem/backends/modem_backend_uart_slm.c @@ -0,0 +1,514 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include +LOG_MODULE_REGISTER(modem_backend_uart_slm, CONFIG_MODEM_MODULES_LOG_LEVEL); + +#include +#include +#include + +struct rx_buf_t { + atomic_t ref_counter; + uint8_t buf[]; +}; + +static inline struct rx_buf_t *block_start_get(struct modem_backend_uart_slm *backend, uint8_t *buf) +{ + size_t block_num; + + /* Find the correct block. */ + block_num = (((size_t)buf - sizeof(struct rx_buf_t) - (size_t)backend->rx_slab.buffer) / + backend->rx_buf_size); + + return (struct rx_buf_t *)&backend->rx_slab.buffer[block_num * backend->rx_buf_size]; +} + +static struct rx_buf_t *rx_buf_alloc(struct modem_backend_uart_slm *backend) +{ + struct rx_buf_t *buf; + + if (k_mem_slab_alloc(&backend->rx_slab, (void **)&buf, K_NO_WAIT)) { + return NULL; + } + atomic_set(&buf->ref_counter, 1); + + return buf; +} + +static void rx_buf_ref(struct modem_backend_uart_slm *backend, void *buf) +{ + atomic_inc(&(block_start_get(backend, buf)->ref_counter)); +} + +static void rx_buf_unref(struct modem_backend_uart_slm *backend, void *buf) +{ + struct rx_buf_t *uart_buf = block_start_get(backend, buf); + atomic_t ref_counter = atomic_dec(&uart_buf->ref_counter); + + if (ref_counter == 1) { + k_mem_slab_free(&backend->rx_slab, (void *)uart_buf); + } +} + +enum { + MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT, + MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT, + MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT, +}; + +static int modem_backend_uart_slm_rx_enable(struct modem_backend_uart_slm *backend) +{ + int ret; + struct rx_buf_t *buf = rx_buf_alloc(backend); + + if (!buf) { + return -ENOMEM; + } + + ret = uart_rx_enable(backend->uart, buf->buf, + backend->rx_buf_size - sizeof(struct rx_buf_t), + CONFIG_MODEM_BACKEND_UART_SLM_RECEIVE_IDLE_TIMEOUT_MS * 1000); + if (ret) { + rx_buf_unref(backend, buf->buf); + return ret; + } + + return 0; +} + +static void modem_backend_uart_slm_rx_recovery(struct modem_backend_uart_slm *backend) +{ + int err; + + if (!atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT)) { + return; + } + + err = modem_backend_uart_slm_rx_enable(backend); + if (err) { + LOG_DBG("RX recovery failed: %d", err); + return; + } + + if (!atomic_test_and_clear_bit(&backend->state, + MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT)) { + /* Closed during recovery. */ + uart_rx_disable(backend->uart); + } else { + LOG_DBG("RX recovery success"); + } +} + +static bool modem_backend_uart_slm_is_uart_stopped(const struct modem_backend_uart_slm *backend) +{ + if (!atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT) && + !atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT) && + !atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT)) { + return true; + } + + return false; +} + +static bool modem_backend_uart_slm_is_open(const struct modem_backend_uart_slm *backend) +{ + return atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT); +} + +static void modem_backend_uart_slm_event_handler(const struct device *dev, struct uart_event *evt, + void *user_data) +{ + struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)user_data; + struct slm_rx_queue_event rx_event; + int err; + + switch (evt->type) { + case UART_TX_DONE: + ring_buf_get_finish(&backend->transmit_rb, evt->data.tx.len); + atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + k_work_submit(&backend->transmit_idle_work); + break; + + case UART_TX_ABORTED: + ring_buf_get_finish(&backend->transmit_rb, evt->data.tx.len); + if (!modem_backend_uart_slm_is_open(backend)) { + /* When we are closing, send the remaining data after re-open. */ + atomic_clear_bit(&backend->state, + MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + break; + } + if (evt->data.tx.len != 0) { + /* If we were able to send some data, attempt to send the remaining + * data before releasing the transmit bit. + */ + uint8_t *buf; + size_t bytes_to_transmit = + ring_buf_get_claim(&backend->transmit_rb, &buf, + ring_buf_capacity_get(&backend->transmit_rb)); + + err = uart_tx(backend->uart, buf, bytes_to_transmit, + CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS * 1000L); + if (err) { + LOG_ERR("Failed to %s %u bytes. (%d)", "start async transmit for", + bytes_to_transmit, err); + atomic_clear_bit(&backend->state, + MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + } + break; + } + + /* We were not able to send anything. Start dropping data. */ + LOG_ERR("Transmit aborted (%u bytes dropped)", + ring_buf_size_get(&backend->transmit_rb)); + atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + k_work_submit(&backend->transmit_idle_work); + break; + + case UART_RX_BUF_REQUEST: + struct rx_buf_t *buf = rx_buf_alloc(backend); + + if (!buf) { + LOG_DBG("No receive buffer, disabling RX"); + break; + } + err = uart_rx_buf_rsp(backend->uart, buf->buf, + backend->rx_buf_size - sizeof(struct rx_buf_t)); + if (err) { + LOG_ERR("uart_rx_buf_rsp: %d", err); + rx_buf_unref(backend, buf->buf); + } + break; + + case UART_RX_BUF_RELEASED: + if (evt->data.rx_buf.buf) { + rx_buf_unref(backend, evt->data.rx_buf.buf); + } + break; + + case UART_RX_RDY: + if (evt->data.rx.buf) { + rx_buf_ref(backend, evt->data.rx.buf); + rx_event.buf = &evt->data.rx.buf[evt->data.rx.offset]; + rx_event.len = evt->data.rx.len; + err = k_msgq_put(&backend->rx_queue, &rx_event, K_NO_WAIT); + if (err) { + LOG_WRN("RX queue overflow: %d (dropped %u)", err, + evt->data.rx.len); + rx_buf_unref(backend, evt->data.rx.buf); + break; + } + k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + } + break; + + case UART_RX_DISABLED: + if (atomic_test_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT)) { + if (!atomic_test_and_set_bit(&backend->state, + MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT)) { + k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + LOG_DBG("RX recovery started"); + } + } + break; + + case UART_RX_STOPPED: + LOG_WRN("Receive stopped for reasons: %u", (uint8_t)evt->data.rx_stop.reason); + break; + + default: + break; + } + + if (modem_backend_uart_slm_is_uart_stopped(backend)) { + k_work_submit(&backend->rx_disabled_work); + } +} + +static int modem_backend_uart_slm_open(void *data) +{ + struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)data; + struct rx_buf_t *rx_buf = rx_buf_alloc(backend); + int ret; + + if (!rx_buf) { + return -ENOMEM; + } + + atomic_clear(&backend->state); + atomic_set_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + atomic_set_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT); + + if (!ring_buf_is_empty(&backend->transmit_rb)) { + /* Transmit was aborted due to modem_backend_uart_slm_close. + * Send the remaining data before allowing further transmits. + */ + uint8_t *tx_buf; + const uint32_t tx_buf_size = ring_buf_get_claim( + &backend->transmit_rb, &tx_buf, ring_buf_size_get(&backend->transmit_rb)); + + ret = uart_tx(backend->uart, tx_buf, tx_buf_size, + CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS * 1000L); + if (ret) { + LOG_ERR("Failed to %s %u bytes. (%d)", "start async transmit for", + tx_buf_size, ret); + atomic_clear_bit(&backend->state, + MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + } + } else { + /* Previous transmit was not aborted. */ + atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + } + + ret = uart_rx_enable(backend->uart, rx_buf->buf, + backend->rx_buf_size - sizeof(struct rx_buf_t), + CONFIG_MODEM_BACKEND_UART_SLM_RECEIVE_IDLE_TIMEOUT_MS * 1000L); + if (ret < 0) { + rx_buf_unref(backend, rx_buf->buf); + atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT); + return ret; + } + + modem_pipe_notify_opened(&backend->pipe); + return 0; +} + +#ifdef CONFIG_MODEM_STATS +static uint32_t get_transmit_buf_size(const struct modem_backend_uart_slm *backend) +{ + return ring_buf_capacity_get(&backend->transmit_rb); +} + +static uint32_t get_receive_buf_size(struct modem_backend_uart_slm *backend) +{ + return (backend->rx_buf_size - sizeof(struct rx_buf_t)) * backend->rx_buf_count; +} + +static void advertise_transmit_buf_stats(struct modem_backend_uart_slm *backend, uint32_t length) +{ + modem_stats_buffer_advertise_length(&backend->transmit_buf_stats, length); +} + +static void advertise_receive_buf_stats(struct modem_backend_uart_slm *backend, uint32_t reserved) +{ + modem_stats_buffer_advertise_length(&backend->receive_buf_stats, reserved); +} +#endif + +static int modem_backend_uart_slm_transmit(void *data, const uint8_t *buf, size_t size) +{ + struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)data; + bool transmitting; + uint32_t bytes_to_transmit; + int ret; + uint8_t *tx_buf; + + if (!modem_backend_uart_slm_is_open(backend)) { + return -EPERM; + } + + transmitting = + atomic_test_and_set_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + if (transmitting) { + return 0; + } + + /* Copy buf to transmit ring buffer which is passed to UART. */ + ring_buf_reset(&backend->transmit_rb); + ring_buf_put(&backend->transmit_rb, buf, size); + bytes_to_transmit = ring_buf_get_claim(&backend->transmit_rb, &tx_buf, size); + + ret = uart_tx(backend->uart, tx_buf, bytes_to_transmit, + CONFIG_MODEM_BACKEND_UART_SLM_TRANSMIT_TIMEOUT_MS * 1000L); + +#ifdef CONFIG_MODEM_STATS + advertise_transmit_buf_stats(backend, bytes_to_transmit); +#endif + + if (ret != 0) { + LOG_ERR("Failed to %s %u bytes. (%d)", "start async transmit for", + bytes_to_transmit, ret); + atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_TRANSMIT_BIT); + + return ret; + } + + return (int)bytes_to_transmit; +} + +static int modem_backend_uart_slm_receive(void *data, uint8_t *buf, size_t size) +{ + struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)data; + size_t received = 0; + size_t copy_size = 0; + +#ifdef CONFIG_MODEM_STATS + struct slm_rx_queue_event rx_event; + size_t reserved = backend->rx_event.len; + + for (int i = 0; i < k_msgq_num_used_get(&backend->rx_queue); i++) { + if (k_msgq_peek_at(&backend->rx_queue, &rx_event, i)) { + break; + } + reserved += rx_event.len; + } + advertise_receive_buf_stats(backend, reserved); +#endif + while (size > received) { + /* Keeping track of the rx_event allows us to receive less than what the event + * indicates. + */ + if (backend->rx_event.len == 0) { + if (k_msgq_get(&backend->rx_queue, &backend->rx_event, K_NO_WAIT)) { + break; + } + } + copy_size = MIN(size - received, backend->rx_event.len); + memcpy(buf, backend->rx_event.buf, copy_size); + buf += copy_size; + received += copy_size; + backend->rx_event.buf += copy_size; + backend->rx_event.len -= copy_size; + + if (backend->rx_event.len == 0) { + rx_buf_unref(backend, backend->rx_event.buf); + } + } + + if (backend->rx_event.len != 0 || k_msgq_num_used_get(&backend->rx_queue) != 0) { + k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + } + + modem_backend_uart_slm_rx_recovery(backend); + + return (int)received; +} + +static int modem_backend_uart_slm_close(void *data) +{ + struct modem_backend_uart_slm *backend = (struct modem_backend_uart_slm *)data; + + atomic_clear_bit(&backend->state, MODEM_BACKEND_UART_SLM_STATE_OPEN_BIT); + uart_tx_abort(backend->uart); + + if (!atomic_test_and_clear_bit(&backend->state, + MODEM_BACKEND_UART_SLM_STATE_RECOVERY_BIT)) { + /* Disable the RX, if recovery is not ongoing. */ + uart_rx_disable(backend->uart); + } + + return 0; +} + +static void modem_backend_uart_slm_receive_ready_handler(struct k_work *item) +{ + struct modem_backend_uart_slm *backend = + CONTAINER_OF(k_work_delayable_from_work(item), struct modem_backend_uart_slm, + receive_ready_work); + + modem_pipe_notify_receive_ready(&backend->pipe); +} + +static void modem_backend_uart_slm_transmit_idle_handler(struct k_work *item) +{ + struct modem_backend_uart_slm *backend = + CONTAINER_OF(item, struct modem_backend_uart_slm, transmit_idle_work); + + modem_pipe_notify_transmit_idle(&backend->pipe); +} + +static void modem_backend_uart_slm_notify_closed(struct k_work *item) +{ + + struct modem_backend_uart_slm *backend = + CONTAINER_OF(item, struct modem_backend_uart_slm, rx_disabled_work); + + modem_pipe_notify_closed(&backend->pipe); +} + +#ifdef CONFIG_MODEM_STATS +static void init_stats(struct modem_backend_uart_slm *backend) +{ + char name[CONFIG_MODEM_STATS_BUFFER_NAME_SIZE]; + uint32_t receive_buf_size; + uint32_t transmit_buf_size; + + receive_buf_size = get_receive_buf_size(backend); + transmit_buf_size = get_transmit_buf_size(backend); + + snprintk(name, sizeof(name), "%s_%s", backend->uart->name, "rx"); + modem_stats_buffer_init(&backend->receive_buf_stats, name, receive_buf_size); + snprintk(name, sizeof(name), "%s_%s", backend->uart->name, "tx"); + modem_stats_buffer_init(&backend->transmit_buf_stats, name, transmit_buf_size); +} +#endif + +static const struct modem_pipe_api modem_backend_uart_slm_api = { + .open = modem_backend_uart_slm_open, + .transmit = modem_backend_uart_slm_transmit, + .receive = modem_backend_uart_slm_receive, + .close = modem_backend_uart_slm_close, +}; + +struct modem_pipe *modem_backend_uart_slm_init(struct modem_backend_uart_slm *backend, + const struct modem_backend_uart_slm_config *config) +{ + int err; + + __ASSERT_NO_MSG(config->uart != NULL); + __ASSERT_NO_MSG(config->receive_buf != NULL); + __ASSERT_NO_MSG(config->receive_buf_size > 1); + __ASSERT_NO_MSG((config->receive_buf_size % 2) == 0); + __ASSERT_NO_MSG(config->transmit_buf != NULL); + __ASSERT_NO_MSG(config->transmit_buf_size > 0); + + memset(backend, 0x00, sizeof(*backend)); + backend->uart = config->uart; + k_work_init_delayable(&backend->receive_ready_work, + modem_backend_uart_slm_receive_ready_handler); + k_work_init(&backend->transmit_idle_work, modem_backend_uart_slm_transmit_idle_handler); + k_work_init(&backend->rx_disabled_work, modem_backend_uart_slm_notify_closed); + + err = uart_callback_set(backend->uart, modem_backend_uart_slm_event_handler, backend); + if (err) { + LOG_ERR("uart_callback_set failed. (%d)", err); + return NULL; + } + + int32_t buf_size = (int32_t)config->receive_buf_size; + + backend->rx_buf_count = CONFIG_MODEM_BACKEND_UART_SLM_BUFFER_COUNT; + + /* k_mem_slab_init requires a word-aligned buffer. */ + __ASSERT((uintptr_t)config->receive_buf % sizeof(void *) == 0, + "Receive buffer is not word-aligned"); + + /* Make sure all the buffers will be aligned. */ + buf_size -= (config->receive_buf_size % (sizeof(uint32_t) * backend->rx_buf_count)); + backend->rx_buf_size = buf_size / backend->rx_buf_count; + __ASSERT_NO_MSG(backend->rx_buf_size > sizeof(struct rx_buf_t)); + + /* Initialize the RX buffers and event queue. */ + err = k_mem_slab_init(&backend->rx_slab, config->receive_buf, backend->rx_buf_size, + backend->rx_buf_count); + if (err) { + LOG_ERR("k_mem_slab_init failed. (%d)", err); + return NULL; + } + k_msgq_init(&backend->rx_queue, (char *)backend->rx_queue_buf, + sizeof(struct slm_rx_queue_event), CONFIG_MODEM_BACKEND_UART_SLM_BUFFER_COUNT); + + ring_buf_init(&backend->transmit_rb, config->transmit_buf_size, config->transmit_buf); + + modem_pipe_init(&backend->pipe, backend, &modem_backend_uart_slm_api); + +#ifdef CONFIG_MODEM_STATS + init_stats(backend); +#endif + return &backend->pipe; +} From a7c4f280cc413ebc8f49e0dd66be033fe9c734ae Mon Sep 17 00:00:00 2001 From: Mateusz Michalek Date: Mon, 14 Jul 2025 10:13:32 +0200 Subject: [PATCH 853/881] [nrf noup] boards: nordic: nrf54lm20 adjust ROM_START_OFFSET adds kconfig that was probably skipped during migration. Signed-off-by: Mateusz Michalek (cherry picked from commit cd135b25e4e48e649c8fdfa97abee3989c5300f6) --- boards/nordic/nrf54lm20dk/Kconfig.defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig index 1f0a706ae6c..3424e7a9e78 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54lm20dk/Kconfig.defconfig @@ -7,6 +7,7 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION config ROM_START_OFFSET + default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP From 747e74a932d135c5f12496366fb737ddd7652f92 Mon Sep 17 00:00:00 2001 From: Krzysztof Szromek Date: Fri, 18 Jul 2025 08:05:27 +0200 Subject: [PATCH 854/881] [nrf noup] ci: update test_spec label for E2E DFU tests Ref: NCSDK-34052 Signed-off-by: Krzysztof Szromek (cherry picked from commit 1b7ccc6e935529a3a464097925b31d69a3a9f9f2) --- .github/test-spec.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5337249f7da..76def875e0b 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -49,6 +49,33 @@ - "tests/subsys/dfu/**/*" - "tests/subsys/mgmt/mcumgr/**/*" +"CI-dfu-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/**/*" + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/spi/**/*" + - "dts/arm/nordic/nrf54h*" + - "dts/common/nordic/*" + - "dts/riscv/nordic/nrf54h*" + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/zephyr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" + - "scripts/west_commands/runners/nrfutil.py" + - "soc/nordic/nrf54h/**/*" + - "subsys/bluetooth/**/*" + - "subsys/dfu/**/*" + - "subsys/logging/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "subsys/tracing/**/*" + "CI-tfm-test": - "boards/nordic/nrf5340dk/**/*" - "boards/nordic/nrf9160dk/**/*" From a39813b91d87fbd49ef449ca8378290f9385ab7d Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Fri, 14 Jun 2024 12:08:55 +0200 Subject: [PATCH 855/881] [nrf noup] bluetooth: conn: Allow for an extra ref in bt_l2cap_send_pdu Allow for an additional buffer reference if callback is provided. This can be used to extend lifetime of the net buffer until the data transmission is confirmed by ACK of the remote. Signed-off-by: Marek Pieta (cherry picked from commit 90daf74e59ef2ef4d6d385d39632fa9cd736c80a) --- subsys/bluetooth/host/conn.c | 17 ++++++++++++----- subsys/bluetooth/host/l2cap.c | 8 ++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index f3abf67d4fb..7248f7c5495 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -711,12 +711,19 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - /* Check that buf->ref is 1 or 2. It would be 1 if this - * was the only reference (e.g. buf was removed - * from the conn tx_queue). It would be 2 if the - * tx_data_pull kept it on the tx_queue for segmentation. + /* Check that buf->ref is 1 or 2. It would be 1 if this was + * the only reference (e.g. buf was removed from the conn + * tx_queue). It would be 2 if the tx_data_pull kept it on + * the tx_queue for segmentation. + * + * Allow for an additional buffer reference if callback is + * provided. This can be used to extend lifetime of the net + * buffer until the data transmission is confirmed by ACK of + * the remote. */ - __ASSERT_NO_MSG((buf->ref == 1) || (buf->ref == 2)); + if (buf->ref > 2 + (cb ? 1 : 0)) { + __ASSERT_NO_MSG(false); + } /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index f65827fac1b..0879163a8a1 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -761,13 +761,17 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, return -ENOTCONN; } - if (pdu->ref != 1) { + /* Allow for an additional buffer reference if callback is provided. This can be used to + * extend lifetime of the net buffer until the data transmission is confirmed by ACK of the + * remote. + */ + if (pdu->ref > 1 + (cb ? 1 : 0)) { /* The host may alter the buf contents when fragmenting. Higher * layers cannot expect the buf contents to stay intact. Extra * refs suggests a silent data corruption would occur if not for * this error. */ - LOG_ERR("Expecting 1 ref, got %d", pdu->ref); + LOG_ERR("Expecting up to %d refs, got %d", cb ? 2 : 1, pdu->ref); return -EINVAL; } From f8fe8d67c116337aefad680d6b258e26698f8571 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Wed, 7 Aug 2024 10:29:21 +0200 Subject: [PATCH 856/881] [nrf noup] bluetooth: conn: Skip buffer ref count check in send_buf If ATT sent callback is delayed until data transmission is done by BLE controller, the transmitted buffer may have an additional reference. The reference is used to extend lifetime of the net buffer until the data transmission is confirmed by ACK of the remote. send_buf function can be called multiple times, if buffer has to be fragmented over HCI. In that case, the callback is provided as an argument only for the last transmitted fragment. The `buf->ref == 1` check is skipped because it's impossible to properly validate number of references for the sent fragments if buffers may have the additional reference. Jira: NCSDK-28624 Signed-off-by: Marek Pieta (cherry picked from commit cc098c6faa2fbcac2be22af3586102d17e81e5ea) --- subsys/bluetooth/host/conn.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 7248f7c5495..d0b6264aaed 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -711,19 +711,27 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - /* Check that buf->ref is 1 or 2. It would be 1 if this was - * the only reference (e.g. buf was removed from the conn - * tx_queue). It would be 2 if the tx_data_pull kept it on - * the tx_queue for segmentation. + /* If ATT sent callback is delayed until data transmission + * is done by BLE controller, the transmitted buffer may + * have an additional reference. The reference is used to + * extend lifetime of the net buffer until the data + * transmission is confirmed by ACK of the remote. * - * Allow for an additional buffer reference if callback is - * provided. This can be used to extend lifetime of the net - * buffer until the data transmission is confirmed by ACK of - * the remote. + * send_buf function can be called multiple times, if buffer + * has to be fragmented over HCI. In that case, the callback + * is provided as an argument only for the last transmitted + * fragment. The `buf->ref == 1` (or 2) check is skipped + * because it's impossible to properly validate number of + * references for the sent fragments if buffers may have the + * additional reference. + * + * Otherwise, check that buf->ref is 1 or 2. It would be 1 + * if this was the only reference (e.g. buf was removed from + * the conn tx_queue). It would be 2 if the tx_data_pull + * kept it on the tx_queue for segmentation. */ - if (buf->ref > 2 + (cb ? 1 : 0)) { - __ASSERT_NO_MSG(false); - } + __ASSERT_NO_MSG(IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX) || (buf->ref == 1) || + (buf->ref == 2)); /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. From a45890c2188a4be9be103c19020cffe1dfdf7abf Mon Sep 17 00:00:00 2001 From: Juha Ylinen Date: Fri, 19 Jan 2024 15:26:33 +0200 Subject: [PATCH 857/881] [nrf noup] samples: lwm2m_client: Add support for nRF91x Add support for nRF91x by providing overlay configuration file. Signed-off-by: Juha Ylinen Signed-off-by: Robert Lubos (cherry picked from commit 1b4e2efade1fa707bf264d4da17fa6b78e9d67fa) --- samples/net/lwm2m_client/overlay-nrf91x.conf | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 samples/net/lwm2m_client/overlay-nrf91x.conf diff --git a/samples/net/lwm2m_client/overlay-nrf91x.conf b/samples/net/lwm2m_client/overlay-nrf91x.conf new file mode 100644 index 00000000000..7b902178e07 --- /dev/null +++ b/samples/net/lwm2m_client/overlay-nrf91x.conf @@ -0,0 +1,53 @@ +# Configuration file for nRF91x +# This file is merged with prj.conf in the application folder, and options +# set here will take precedence if they are present in both files. + +# General +CONFIG_MAIN_STACK_SIZE=4096 + +CONFIG_NET_SOCKETS=y +CONFIG_NET_NATIVE=y +CONFIG_NET_SOCKETS_OFFLOAD=y + +CONFIG_NET_CONFIG_MY_IPV6_ADDR="" +CONFIG_NET_CONFIG_PEER_IPV6_ADDR="" +CONFIG_NET_CONFIG_MY_IPV4_ADDR="" +CONFIG_NET_CONFIG_MY_IPV4_GW="" + +CONFIG_NET_CONFIG_NEED_IPV6=n +CONFIG_NET_CONFIG_NEED_IPV4=n +CONFIG_NET_CONFIG_AUTO_INIT=n + +# Modem related configurations +CONFIG_NRF_MODEM_LIB_NET_IF=y +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_DOWN=n +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=n +CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y + +CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=n +CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=n + +# Disable Duplicate Address Detection (DAD) +# due to not being properly implemented for offloaded interfaces. +CONFIG_NET_IPV6_NBR_CACHE=n +CONFIG_NET_IPV6_MLD=n + +# Zephyr NET Connection Manager and Connectivity layer. +CONFIG_NET_CONNECTION_MANAGER=y +CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024 + +CONFIG_NET_SAMPLE_LWM2M_ID="nrf91x" +CONFIG_NET_SAMPLE_LWM2M_SERVER="coaps://leshan.eclipseprojects.io:5684" +CONFIG_LWM2M_DNS_SUPPORT=y + +## Enable DTLS support +CONFIG_LWM2M_DTLS_SUPPORT=y +CONFIG_LWM2M_TLS_SESSION_CACHING=y +CONFIG_LWM2M_DTLS_CID=y +CONFIG_TLS_CREDENTIALS=y + +## Crypto +CONFIG_OBERON_BACKEND=y +CONFIG_NORDIC_SECURITY_BACKEND=y +CONFIG_MBEDTLS_SHA256_C=y From c308feef4e6c43d2d6732c31936b88e84402893c Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Tue, 22 Apr 2025 14:34:11 +0200 Subject: [PATCH 858/881] [nrf noup] modules: hal_nordic: require nrf-regtool Same as commit 6ec9d10 but with the REQUIRED keyword on its own line to attempt to avoid a merge conflict when reverting/reapplying this patch. Signed-off-by: Jonathan Nilsen (cherry picked from commit e606b2aaf5ebd69b03c5fd92c99d9ef1d9c7e96a) --- modules/hal_nordic/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index b6f35286412..e5b1ab60dfc 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -13,6 +13,7 @@ if(CONFIG_NRF_REGTOOL_GENERATE_UICR) endif() if(DEFINED nrf_regtool_components) find_package(nrf-regtool 9.2.0 + REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From acac0e68c295659ce3ecfd2864d93b24ca765675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 11:15:56 +0100 Subject: [PATCH 859/881] [nrf noup] boards: nordic: nrf7002dk: Bring back NS variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Non-secure variants for nRF7002 DK were removed from upstream in commit 10d49736cffa14d3798e615e70d58b3be8ee2cfc. Revert these changes downstream, so that the NS variants are still available. Signed-off-by: Andrzej Głąbek Signed-off-by: Johann Fischer (cherry picked from commit c1643faea535faad9caf5852960c2d9cb09db101) --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 +++ boards/nordic/nrf7002dk/Kconfig | 4 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 72 +++++++++++++++++++ boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 18 ++++- boards/nordic/nrf7002dk/board.yml | 4 ++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ++++++++++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 +++++ ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 24 +++++++ .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 +++++++++++ .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 +++++ .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 23 ++++++ 12 files changed, 273 insertions(+), 4 deletions(-) create mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt new file mode 100644 index 00000000000..db20255712b --- /dev/null +++ b/boards/nordic/nrf7002dk/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND + CONFIG_BOARD_ENABLE_CPUNET) + zephyr_library() + zephyr_library_sources(nrf5340_cpunet_reset.c) +endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index fa6c8097ae3..d4b7030a65a 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,7 +10,9 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS config BT_HCI_IPC default y if BT diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig index 48510d6e24f..0d89a008996 100644 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -9,3 +9,75 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION endif # BOARD_NRF7002DK + +if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +# By default, if we build for a Non-Secure version of the board, +# force building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +# Code Partition: +# +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# SRAM Partition: +# +# If the secure firmware is to be combined with a non-secure image +# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always +# be restricted to the secure image SRAM partition (sram-secure-partition). +# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram +# may be used by the image. +# +# For the non-secure version of the board, the firmware image SRAM is +# always restricted to the allocated non-secure SRAM partition. +# +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ + TRUSTED_EXECUTION_SECURE + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config SRAM_SIZE + default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) + +endif + +if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif + +endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 61b9e818f36..91f52ee6f08 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,4 +4,6 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index f85bbc86f48..11a27910eeb 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,10 +1,24 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 4f41341e442..39db5dcfa3a 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,5 +5,9 @@ board: socs: - name: nrf5340 variants: + - name: ns + cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp + variants: + - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts new file mode 100644 index 00000000000..5ff28accf3f --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7001@1 { + compatible = "nordic,nrf7001-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml new file mode 100644 index 00000000000..16575969126 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns +name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig new file mode 100644 index 00000000000..2c435653140 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig @@ -0,0 +1,24 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts new file mode 100644 index 00000000000..0deb8ccc1bf --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns_app; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7002@1 { + compatible = "nordic,nrf7002-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + #include "nrf70_common_5g.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml new file mode 100644 index 00000000000..ea43785b455 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/ns +name: NRF7002-DK-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig new file mode 100644 index 00000000000..1886b926bfd --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y From fe723ab816ddece8752411f69a80a6f2898f5e53 Mon Sep 17 00:00:00 2001 From: Maximilian Deubel Date: Wed, 15 Nov 2023 12:55:40 +0100 Subject: [PATCH 860/881] [nrf noup] boards: arm: nrf9131ek: enable tfm This patch backports the nrf9131ek to a time before tfm was refactored. To be reverted when TF-M is updated. Signed-off-by: Maximilian Deubel (cherry picked from commit 797a60e8542a450d615b7fd1007f3c407fae87b8) --- boards/nordic/nrf9131ek/Kconfig.defconfig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index e1d8de241c0..1a30d006b4c 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -8,3 +8,22 @@ config HW_STACK_PROTECTION config BOARD_NRF9131EK select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS + +if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF9131EK_NRF9131_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS From 6d864eb7649d8746b1961f24e9fc516eecaff5fd Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Mon, 4 Aug 2025 09:37:08 +0200 Subject: [PATCH 861/881] [nrf noup] samples: bluetooth: Add support for nRF54lm20a to hci_uart Add support for nRF54lm20a to the hci_uart sample. Signed-off-by: Gordon Klaus (cherry picked from commit 1512388b59efaa75c4f87e7139b878d0a58d8101) --- .../hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bluetooth/hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/bluetooth/hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 7613ab836ba..0388a57baec 100644 --- a/samples/bluetooth/hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/bluetooth/hci_uart/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ From 17ae62daaf4307c3c80d555f6c5a1f78473feaac Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Thu, 31 Jul 2025 14:26:40 +0200 Subject: [PATCH 862/881] [nrf noup] bluetooth: host: Allow auto swap feature without privacy Allow to use CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS Kconfig option even if CONFIG_BT_PRIVACY is disabled. This is because CONFIG_BT_PRIVACY configures privacy of local device will still allows to resolve peer address. During pairing, peer device may send its Identity Address and IRK which then can be used for address resolution. This doesn't require CONFIG_BT_PRIVACY be enabled. nrf-squash! [nrf noup] bluetooth: host: Add support for bonding with same peer Signed-off-by: Pavel Vasilyev (cherry picked from commit c1ddd14ed35f577e22cdd0021781a70bda2a0926) --- subsys/bluetooth/host/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 4e275e6cc28..126649f1502 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -661,7 +661,7 @@ config BT_ID_UNPAIR_MATCHING_BONDS config BT_ID_AUTO_SWAP_MATCHING_BONDS bool "Automatically swap conflicting entries in the Resolving List" depends on !BT_ID_UNPAIR_MATCHING_BONDS - depends on BT_PRIVACY && BT_PERIPHERAL && !BT_CENTRAL + depends on BT_SMP && BT_PERIPHERAL && !BT_CENTRAL help If this option is enabled, the Host will not add a new bond with the same peer address (or IRK) to the Resolving List if there is From 382aabb1432633b8cb93af2a312688ae19ba677d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Thu, 31 Jul 2025 13:09:12 +0200 Subject: [PATCH 863/881] [nrf fromlist] tests: boards: nrf: qdec: Fix test for multiple instances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed pin configuration for nRF54L15 (QDECs can use only port 1) - Changed the way the test handles testing multiple instances to make it possible to output quadrature signal to one QDEC instance at a time. Upstream PR #: 93927 Signed-off-by: Michał Bainczyk (cherry picked from commit e6948df926e1027caeb3914a2dc37430aca3d09c) --- .../boards/bl54l15_dvk_nrf54l15_common.dtsi | 14 +- .../boards/bl54l15u_dvk_nrf54l15_common.dtsi | 14 +- .../qdec/boards/nrf52840dk_nrf52840.overlay | 11 + .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 14 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 25 +- .../boards/nrf54l15dk_nrf54l15_common.dtsi | 45 +-- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 14 +- .../qdec/dts/bindings/test-qdec-loopback.yaml | 20 ++ tests/boards/nrf/qdec/src/main.c | 313 ++++++++---------- 9 files changed, 241 insertions(+), 229 deletions(-) create mode 100644 tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml diff --git a/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi index 4db67a49a5e..19ca5e83647 100644 --- a/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi @@ -5,12 +5,6 @@ */ / { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - encoder-emulate { compatible = "gpio-leds"; @@ -22,6 +16,14 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi index 4db67a49a5e..19ca5e83647 100644 --- a/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi @@ -5,12 +5,6 @@ */ / { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - encoder-emulate { compatible = "gpio-leds"; @@ -22,6 +16,14 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay index 9ee3749b4ff..caa5510e714 100644 --- a/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay @@ -21,6 +21,17 @@ gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; }; }; +<<<<<<< HEAD +======= + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec0>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; +>>>>>>> e6948df926e ([nrf fromlist] tests: boards: nrf: qdec: Fix test for multiple instances) }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay index 22f5307a760..04872e1de5c 100644 --- a/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,12 +4,6 @@ */ / { - aliases { - qdec0 = &qdec1; - qenca = &phase_a; - qencb = &phase_b; - }; - encoder-emulate { compatible = "gpio-leds"; phase_a: phase_a { @@ -21,6 +15,14 @@ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec1>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 78f3aa09ace..7e43c70dac0 100644 --- a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -11,21 +11,12 @@ */ / { - aliases { - qdec0 = &qdec130; - qdec1 = &qdec131; - qenca = &phase_a; - qencb = &phase_b; - qenca1 = &phase_a1; - qencb1 = &phase_b1; - }; - encoder-emulate { compatible = "gpio-leds"; - phase_a: phase_a { + phase_a0: phase_a0 { gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; }; - phase_b: phase_b { + phase_b0: phase_b0 { gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; }; phase_a1: phase_a1 { @@ -35,6 +26,18 @@ gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec130>; + qenc-emul-gpios = <&phase_a0 &phase_b0>; + }; + loopback1 { + qdec = <&qdec131>; + qenc-emul-gpios = <&phase_a1 &phase_b1>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi index 06a490d1da0..f2729414652 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi @@ -4,35 +4,38 @@ */ /* Required loopbacks - * P1.8 <-> P1.9 - * P1.10 >-> P1.11 - * P2.8 <-> P2.9 - * P2.10 <-> P1.14 + * P1.8 <-> P1.9 + * P1.10 <-> P1.11 + * P1.12 <-> P1.13 + * P1.14 <-> P2.10 */ / { - aliases { - qdec0 = &qdec20; - qdec1 = &qdec21; - qenca = &phase_a; - qencb = &phase_b; - qenca1 = &phase_a1; - qencb1 = &phase_b1; - }; - encoder-emulate { compatible = "gpio-leds"; - phase_a: phase_a { + phase_a0: phase_a0 { gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; - phase_b: phase_b { + phase_b0: phase_b0 { gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; phase_a1: phase_a1 { - gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; }; phase_b1: phase_b1 { - gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; + }; + }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a0 &phase_b0>; + }; + loopback1 { + qdec = <&qdec21>; + qenc-emul-gpios = <&phase_a1 &phase_b1>; }; }; }; @@ -55,15 +58,15 @@ qdec_21_pinctrl: qdec_21_pinctrl { group1 { - psels = , - ; + psels = , + ; }; }; qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; diff --git a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi index 84e7b1dbc30..6f8f3a18431 100644 --- a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -11,12 +11,6 @@ */ / { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - encoder-emulate { compatible = "gpio-leds"; phase_a: phase_a { @@ -26,6 +20,14 @@ gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml b/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml new file mode 100644 index 00000000000..e03b2ff3bc3 --- /dev/null +++ b/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml @@ -0,0 +1,20 @@ +description: | + Binding describing loopbacks required to run tests/boards/nrf/qdec test in Zephyr. + +compatible: "test-qdec-loopbacks" + +child-binding: + description: | + Binding describing a single loopback pair consisting of a QDEC device and two "gpio-leds" pins + working as a quadrature encoder for the test. + properties: + qdec: + type: phandle + required: true + description: Node of the QDEC device used to capture quadrature signal in the loopback. + qenc-emul-gpios: + type: phandles + required: true + description: | + Children nodes of "gpio-leds" compatible used to generate quadrature signal. The first + phandles outputs phase A signal, the second one outputs phase B signal. diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 7df97be2a43..9d138d325fb 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -11,27 +11,40 @@ #include #include -static K_SEM_DEFINE(sem, 0, 1); -static const struct gpio_dt_spec phase_a = GPIO_DT_SPEC_GET(DT_ALIAS(qenca), gpios); -static const struct gpio_dt_spec phase_b = GPIO_DT_SPEC_GET(DT_ALIAS(qencb), gpios); -static const struct device *const qdec_dev = DEVICE_DT_GET(DT_ALIAS(qdec0)); -static const uint32_t qdec_config_step = DT_PROP(DT_ALIAS(qdec0), steps); - -/* Disable testing second QDEC instance - * until the issue with multiple - * QDEC instances support is resolved +/** + * Structure grouping gpio pins used for QENC emulation connected with a QDEC device + * with a loopback. */ -#if DT_NODE_EXISTS(DT_ALIAS(qdecX)) -#define SECOND_QDEC_INSTANCE - -static const struct gpio_dt_spec phase_a1 = GPIO_DT_SPEC_GET(DT_ALIAS(qenca1), gpios); -static const struct gpio_dt_spec phase_b1 = GPIO_DT_SPEC_GET(DT_ALIAS(qencb1), gpios); -static const struct device *const qdec_1_dev = DEVICE_DT_GET(DT_ALIAS(qdec1)); -static const uint32_t qdec_1_config_step = DT_PROP(DT_ALIAS(qdec1), steps); -#endif +struct qdec_qenc_loopback { + struct gpio_dt_spec qenc_phase_a; + struct gpio_dt_spec qenc_phase_b; + + const struct device *qdec; + uint32_t qdec_config_step; +}; + +static K_SEM_DEFINE(sem, 0, 1); + +#define GET_QDEC_QENC_LOOPBACK(x) \ + { \ + .qenc_phase_a = GPIO_DT_SPEC_GET(DT_PHANDLE_BY_IDX(x, qenc_emul_gpios, 0), gpios), \ + .qenc_phase_b = GPIO_DT_SPEC_GET(DT_PHANDLE_BY_IDX(x, qenc_emul_gpios, 1), gpios), \ + .qdec = DEVICE_DT_GET(DT_PHANDLE(x, qdec)), \ + .qdec_config_step = DT_PROP_BY_PHANDLE(x, qdec, steps) \ + } + + +struct qdec_qenc_loopback loopbacks[] = { + DT_FOREACH_CHILD_SEP(DT_NODELABEL(qdec_loopbacks), GET_QDEC_QENC_LOOPBACK, (,)) +}; + +#define TESTED_QDEC_COUNT ARRAY_SIZE(loopbacks) + static struct sensor_trigger qdec_trigger = {.type = SENSOR_TRIG_DATA_READY, .chan = SENSOR_CHAN_ROTATION}; + static bool toggle_a = true; +static struct qdec_qenc_loopback *loopback_currently_under_test; static void qdec_trigger_handler(const struct device *dev, const struct sensor_trigger *trigger) { @@ -48,15 +61,9 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t static void qenc_emulate_work_handler(struct k_work *work) { if (toggle_a) { - gpio_pin_toggle_dt(&phase_a); -#if defined(SECOND_QDEC_INSTANCE) - gpio_pin_toggle_dt(&phase_a1); -#endif + gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_a); } else { - gpio_pin_toggle_dt(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - gpio_pin_toggle_dt(&phase_b1); -#endif + gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_b); } toggle_a = !toggle_a; } @@ -89,52 +96,46 @@ static void qenc_emulate_setup_pin(const struct gpio_dt_spec *gpio_dt) zassert_true(rc == 0, "%s: pin configure failed: %d", gpio_dt->port->name, rc); } -static void qenc_emulate_start(k_timeout_t period, bool forward) +static void qenc_emulate_start(struct qdec_qenc_loopback *loopback, k_timeout_t period, + bool forward) { - qenc_emulate_reset_pin(&phase_a); - qenc_emulate_reset_pin(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - qenc_emulate_reset_pin(&phase_a1); - qenc_emulate_reset_pin(&phase_b1); -#endif + qenc_emulate_reset_pin(&loopback->qenc_phase_a); + qenc_emulate_reset_pin(&loopback->qenc_phase_b); toggle_a = !forward; - + loopback_currently_under_test = loopback; k_timer_start(&qenc_emulate_timer, period, period); } static void qenc_emulate_stop(void) { - k_timer_stop(&qenc_emulate_timer); - - qenc_emulate_reset_pin(&phase_a); - qenc_emulate_reset_pin(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - qenc_emulate_reset_pin(&phase_a1); - qenc_emulate_reset_pin(&phase_b1); -#endif + if (loopback_currently_under_test) { + k_timer_stop(&qenc_emulate_timer); + qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_a); + qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_b); + } } -static void qenc_emulate_verify_reading(const struct device *const dev, int emulator_period_ms, - int emulation_duration_ms, bool forward, bool overflow_expected, - const uint32_t config_step) +static void qenc_emulate_verify_reading(struct qdec_qenc_loopback *loopback, + int emulator_period_ms, int emulation_duration_ms, bool forward, + bool overflow_expected) { int rc; struct sensor_value val = {0}; int32_t expected_steps = emulation_duration_ms / emulator_period_ms; - int32_t expected_reading = 360 * expected_steps / config_step; - int32_t delta = expected_reading / 5; + int32_t expected_reading = 360 * expected_steps / loopback->qdec_config_step; + int32_t delta = expected_reading / 4; if (!forward) { expected_reading *= -1; } - qenc_emulate_start(K_MSEC(emulator_period_ms), forward); + qenc_emulate_start(loopback, K_MSEC(emulator_period_ms), forward); /* wait for some readings */ k_msleep(emulation_duration_ms); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(loopback->qdec); if (!overflow_expected) { zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); @@ -142,7 +143,7 @@ static void qenc_emulate_verify_reading(const struct device *const dev, int emul zassert_true(rc == -EOVERFLOW, "Failed to detect overflow"); } - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); TC_PRINT("Expected reading: %d, actual value: %d, delta: %d\n", @@ -157,31 +158,31 @@ static void qenc_emulate_verify_reading(const struct device *const dev, int emul /* wait and get readings to clear state */ k_msleep(100); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(loopback->qdec); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); } -static void sensor_trigger_set_and_disable(const struct device *const dev) +static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } k_sem_give(&sem); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ALL; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* emulation working, handler should be called */ rc = k_sem_take(&sem, K_MSEC(200)); @@ -193,7 +194,7 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) rc = k_sem_take(&sem, K_MSEC(200)); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } /* there should be no triggers now*/ @@ -201,21 +202,21 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } /* register empty trigger - disable trigger */ - rc = sensor_trigger_set(dev, &qdec_trigger, NULL); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, NULL); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* emulation working, but handler not set, thus should not be called */ rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } } @@ -227,49 +228,50 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_trigger_set_and_disable) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_and_disable(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_and_disable(qdec_1_dev); -#endif - + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_trigger_set_and_disable(&loopbacks[i]); + } } -static void sensor_trigger_set_test(const struct device *const dev) +static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* emulation working now */ rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == 0, "qdec handler should be triggered (%d)", rc); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(loopback->qdec); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); TC_PRINT("QDEC reading: %d\n", val.val1); zassert_true(val.val1 != 0, "No readings from QDEC"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } + + qenc_emulate_stop(); + /* emulation not working, but there may be old trigger which needs to be cleaned up */ + rc = k_sem_take(&sem, K_MSEC(200)); } /** @@ -280,39 +282,37 @@ static void sensor_trigger_set_test(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_trigger_set) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_test(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_trigger_set_test(&loopbacks[i]); + } } -static void sensor_trigger_set_negative(const struct device *const dev) +static void sensor_trigger_set_negative(struct qdec_qenc_loopback *loopback) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); qdec_trigger.type = SENSOR_TRIG_MAX; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid trigger type"); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_MAX; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid channel"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } } @@ -324,12 +324,10 @@ static void sensor_trigger_set_negative(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_trigger_set_negative) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_negative(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_negative(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_trigger_set_negative(&loopbacks[i]); + } } /** @@ -340,37 +338,22 @@ ZTEST(qdec_sensor, test_sensor_trigger_set_negative) */ ZTEST(qdec_sensor, test_qdec_readings) { - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(qdec_dev); + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_get(loopbacks[i].qdec); + } + + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + qenc_emulate_verify_reading(&loopbacks[i], 10, 100, true, false); + qenc_emulate_verify_reading(&loopbacks[i], 2, 500, true, false); + qenc_emulate_verify_reading(&loopbacks[i], 10, 200, false, false); + qenc_emulate_verify_reading(&loopbacks[i], 1, 1000, false, true); + qenc_emulate_verify_reading(&loopbacks[i], 1, 1000, true, true); + + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put(loopbacks[i].qdec); + } } - - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - qenc_emulate_verify_reading(qdec_dev, 10, 100, true, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 2, 500, true, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 10, 200, false, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 1, 1000, false, true, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 1, 1000, true, true, qdec_config_step); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(qdec_dev); - } - -#if defined(SECOND_QDEC_INSTANCE) - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(qdec_1_dev); - } - - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - qenc_emulate_verify_reading(qdec_1_dev, 10, 100, true, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 2, 500, true, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 10, 200, false, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, false, true, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, true, true, qdec_1_config_step); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(qdec_1_dev); - } -#endif } static void sensor_channel_get_empty(const struct device *const dev) @@ -419,40 +402,38 @@ static void sensor_channel_get_empty(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_channel_get_empty) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_empty(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_empty(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_channel_get_empty(loopbacks[i].qdec); + } } -static void sensor_channel_get_test(const struct device *const dev) +static void sensor_channel_get_test(struct qdec_qenc_loopback *loopback) { int rc; struct sensor_value val_first = {0}; struct sensor_value val_second = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(qdec_dev); + pm_device_runtime_get(loopback->qdec); } - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(qdec_dev); + rc = sensor_sample_fetch(loopback->qdec); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val_first); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val_first); zassert_true(rc == 0, "Failed to get sample (%d)", rc); zassert_true(val_first.val1 != 0, "No readings from QDEC"); /* wait for more readings*/ k_msleep(200); - rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val_second); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val_second); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); zassert_true(val_second.val1 != 0, "No readings from QDEC"); @@ -470,7 +451,7 @@ static void sensor_channel_get_test(const struct device *const dev) val_second.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(qdec_dev); + pm_device_runtime_put(loopback->qdec); } } @@ -482,38 +463,36 @@ static void sensor_channel_get_test(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_channel_get) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_test(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_channel_get_test(&loopbacks[i]); + } } -static void sensor_channel_get_negative(const struct device *const dev) +static void sensor_channel_get_negative(struct qdec_qenc_loopback *loopback) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(loopback->qdec); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_MAX, &val); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_MAX, &val); zassert_true(rc < 0, "Should failed to get sample (%d)", rc); zassert_true(val.val1 == 0, "Some readings from QDEC: %d", val.val1); zassert_true(val.val2 == 0, "Some readings from QDEC: %d", val.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } } @@ -525,12 +504,10 @@ static void sensor_channel_get_negative(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_channel_get_negative) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_negative(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_negative(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_channel_get_negative(&loopbacks[i]); + } } static void sensor_sample_fetch_test(const struct device *const dev) @@ -563,32 +540,22 @@ static void sensor_sample_fetch_test(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_sample_fetch) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_sample_fetch_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_sample_fetch_test(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_sample_fetch_test(loopbacks[i].qdec); + } } static void *setup(void) { - int rc; - - rc = device_is_ready(qdec_dev); - zassert_true(rc, "QDEC device not ready: %d", rc); + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + int rc = device_is_ready(loopbacks[i].qdec); - qenc_emulate_setup_pin(&phase_a); - qenc_emulate_setup_pin(&phase_b); - -#if defined(SECOND_QDEC_INSTANCE) - rc = device_is_ready(qdec_1_dev); - zassert_true(rc, "QDEC 1 device not ready: %d", rc); - - qenc_emulate_setup_pin(&phase_a1); - qenc_emulate_setup_pin(&phase_b1); -#endif + zassert_true(rc, "QDEC index %d not ready: %d", i, rc); + qenc_emulate_setup_pin(&loopbacks[i].qenc_phase_a); + qenc_emulate_setup_pin(&loopbacks[i].qenc_phase_b); + } return NULL; } From efff9bcdb626beebe3ffe164e5397c9876348b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stine=20=C3=85kredalen?= Date: Mon, 4 Aug 2025 01:26:12 +0200 Subject: [PATCH 864/881] [nrf noup] samples: bluetooth: mesh: update stack sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increased stack sizes for mesh provisoner sample. Values are based of thread analysis, plus added margin. Signed-off-by: Stine Åkredalen (cherry picked from commit 8876f35b0208e315d554ca1fec6f66643340fd0d) --- samples/bluetooth/mesh_provisioner/prj.conf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 24176780516..0e5f6490ede 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -1,6 +1,10 @@ #CONFIG_INIT_STACKS=y -CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 +# Stack sizes from thread analysis + 50% margin, rounded to nearest 100 +CONFIG_MAIN_STACK_SIZE=4400 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4800 +CONFIG_BT_MESH_SETTINGS_WORKQ_STACK_SIZE=1700 +CONFIG_BT_MESH_ADV_STACK_SIZE=4000 +CONFIG_BT_RX_STACK_SIZE=3300 # The Bluetooth API should not be used from a preemptive thread: CONFIG_MAIN_THREAD_PRIORITY=-2 From c18c864fb667e09f70a609af684677f77d54cf19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Wed, 6 Aug 2025 09:22:26 +0200 Subject: [PATCH 865/881] [nrf noup] soc: nordic: ironside: fix typo in Kconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This typo was fixed in upstream but not ported to NCS This creates conflicts when cherry picking. Signed-off-by: Łukasz Stępnicki (cherry picked from commit ec8bfd85d4ec9a7e883345312633c8dfae54e9d2) --- soc/nordic/ironside/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index ce4878b7b18..32c6ef38165 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -76,7 +76,7 @@ config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS range 0 255 default 50 help - Maximum attempts with 10us intervals before busy status will be reported. + Maximum timeout when waiting for DVFS oppoint change mutex lock. endif # NRF_IRONSIDE_DVFS_SERVICE From dddc729f2b0f0b18dc556ca6209190e214b7d507 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Fri, 31 Jan 2025 14:47:05 +0200 Subject: [PATCH 866/881] [nrf noup] tests: secure_storage: fix test w/ ZMS backend on 54L15 noup because it's about partition manager. Fix the build of secure_storage.psa.its.secure_storage.store.zms on nrf54l15dk/nrf54l15/cpuapp by disabling partition manager, which is incompatible with the ZMS implementation of the ITS store module. Disabling it only for that test as it's not needed for the others and even makes the NS board targets fail if disabling PM. Signed-off-by: Tomi Fontanilles (cherry picked from commit eb02a0210ff85ff00c9bacdf14c692f97d2e4d35) --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index 75950a79814..0125b9d1e21 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -27,6 +27,7 @@ tests: - EXTRA_DTC_OVERLAY_FILE=zms.overlay - EXTRA_CONF_FILE=\ overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf + - SB_CONFIG_PARTITION_MANAGER=n secure_storage.psa.its.secure_storage.store.zms.64-bit_uids: platform_allow: *zms_platform_allow From 983a91881e1877af51274abf0d7c1baf86ec5b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Wed, 13 Aug 2025 10:33:25 +0200 Subject: [PATCH 867/881] [nrf fromlist] tests: boards: nrf: qdec: Fix test for nRF54L15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added additional cleanups between tests, which fixed the issue of a failing testcase on nRF54L15. Upstream PR #: 93927 Signed-off-by: Michał Bainczyk (cherry picked from commit d24c26f9852942beb447cd6a352aa95873fb6b7a) --- tests/boards/nrf/qdec/src/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 9d138d325fb..6bc867f8aa9 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -60,6 +60,11 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t static void qenc_emulate_work_handler(struct k_work *work) { + /* Check if emulation has been stopped after submitting this work item. */ + if (loopback_currently_under_test == NULL) { + return; + } + if (toggle_a) { gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_a); } else { @@ -113,6 +118,8 @@ static void qenc_emulate_stop(void) k_timer_stop(&qenc_emulate_timer); qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_a); qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_b); + + loopback_currently_under_test = NULL; } } @@ -218,6 +225,9 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { pm_device_runtime_put(loopback->qdec); } + + qenc_emulate_stop(); + k_sem_reset(&sem); } /** @@ -270,8 +280,7 @@ static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) } qenc_emulate_stop(); - /* emulation not working, but there may be old trigger which needs to be cleaned up */ - rc = k_sem_take(&sem, K_MSEC(200)); + k_sem_reset(&sem); } /** @@ -571,6 +580,7 @@ static void after(void *fixture) ARG_UNUSED(fixture); qenc_emulate_stop(); + k_sem_reset(&sem); } ZTEST_SUITE(qdec_sensor, NULL, setup, before, after, NULL); From 0d964854929755f133d61fe524f2f89b043b9caa Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 8 Aug 2025 12:26:35 +0200 Subject: [PATCH 868/881] [nrf noup] soc: nrf54l: Change logic for KMU reserved area nrf-squash! [nrf noup] soc: nrf54l: Add custom section for KMU Change how the KMU reserved area is included in the linker file. Now there is a separate Kconfig which shows it the there is a dts entry for the KMU reserved area. Signed-off-by: Georgios Vasilakis (cherry picked from commit 793e93e14667c87968d75c1666a9a99b44a054c9) --- soc/nordic/nrf54l/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/soc/nordic/nrf54l/CMakeLists.txt b/soc/nordic/nrf54l/CMakeLists.txt index d986fe9c20d..d84330bffa6 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -7,10 +7,12 @@ zephyr_library_sources( ) zephyr_include_directories(.) +dt_nodelabel(kmu_push_area_node NODELABEL nrf_kmu_reserved_push_area) + # We need a buffer in memory in a static location which can be used by # the KMU peripheral. The KMU has a static destination address, we chose # this address to be 0x20000000, which is the first address in the SRAM. -if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND CONFIG_XIP) +if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND NOT kmu_push_area_node) # Exclamation mark is printable character with the lowest number in ASCII table. # We are sure that this file will be included first. zephyr_linker_sources(RAM_SECTIONS SORT_KEY ! kmu_push_area_section.ld) From e94c80d1a38b6261b6fe37b26784f1d1dadc37ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Mon, 18 Aug 2025 14:25:53 +0200 Subject: [PATCH 869/881] [nrf noup] tests: crypto: Add ENTROPY_GENERATOR in overlays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ENTROPY_GENERATOR=y in overlays for l series devices. This fixes an error where a trng source is not included in ncs. Signed-off-by: Dag Erik Gjørvad (cherry picked from commit 6997770e93b3fc57c5325b430fb806f13d345f40) --- .../mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ++++++ 5 files changed, 30 insertions(+) create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf new file mode 100644 index 00000000000..70c601183dd --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf new file mode 100644 index 00000000000..70c601183dd --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 00000000000..70c601183dd --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf new file mode 100644 index 00000000000..70c601183dd --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf new file mode 100644 index 00000000000..70c601183dd --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y From 5aa5f8da588209e7a8d32c06910d6fb05cc8b2e9 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Mon, 11 Aug 2025 12:08:09 +0200 Subject: [PATCH 870/881] [nrf fromlist] tests: zms: Minor improvements Upstream PR #: 94330 * Explicitly skip tests that depend on CONFIG_ZMS_LOOKUP_CACHE. * In `testcase.yaml`, use `extra_configs` instead of `extra_args` for setting Kconfigs. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 664645d0256abc6f5ab40a7b617775ce83d7ccb4) --- tests/subsys/fs/zms/src/main.c | 9 ++++++++- tests/subsys/fs/zms/testcase.yaml | 9 +++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/subsys/fs/zms/src/main.c b/tests/subsys/fs/zms/src/main.c index a69a2b00953..15cdf217c04 100644 --- a/tests/subsys/fs/zms/src/main.c +++ b/tests/subsys/fs/zms/src/main.c @@ -752,6 +752,8 @@ ZTEST_F(zms, test_zms_cache_init) num = num_matching_cache_entries(ate_addr, false, &fixture->fs); zassert_equal(num, 1, "invalid cache entry after restart"); +#else + ztest_test_skip(); #endif } @@ -780,6 +782,8 @@ ZTEST_F(zms, test_zms_cache_collission) zassert_equal(err, sizeof(data), "zms_read call failure: %d", err); zassert_equal(data, id, "incorrect data read"); } +#else + ztest_test_skip(); #endif } @@ -829,6 +833,8 @@ ZTEST_F(zms, test_zms_cache_gc) num = num_matching_cache_entries(2ULL << ADDR_SECT_SHIFT, true, &fixture->fs); zassert_equal(num, 2, "invalid cache content after gc"); +#else + ztest_test_skip(); #endif } @@ -886,7 +892,8 @@ ZTEST_F(zms, test_zms_cache_hash_quality) TC_PRINT("Cache occupancy: %u\n", (unsigned int)num); zassert_between_inclusive(num, MIN_CACHE_OCCUPANCY, CONFIG_ZMS_LOOKUP_CACHE_SIZE, "too low cache occupancy - poor hash quality"); - +#else + ztest_test_skip(); #endif } diff --git a/tests/subsys/fs/zms/testcase.yaml b/tests/subsys/fs/zms/testcase.yaml index bdee4529f2a..4949e1be0c6 100644 --- a/tests/subsys/fs/zms/testcase.yaml +++ b/tests/subsys/fs/zms/testcase.yaml @@ -8,20 +8,21 @@ tests: extra_args: DTC_OVERLAY_FILE=boards/qemu_x86_ev_0x00.overlay platform_allow: qemu_x86 filesystem.zms.sim.no_erase: - extra_args: CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n + extra_configs: + - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n platform_allow: qemu_x86 filesystem.zms.sim.corrupt_close: - extra_args: + extra_configs: - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=y - CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y platform_allow: qemu_x86 filesystem.zms.cache: - extra_args: + extra_configs: - CONFIG_ZMS_LOOKUP_CACHE=y - CONFIG_ZMS_LOOKUP_CACHE_SIZE=64 platform_allow: native_sim filesystem.zms.data_crc: - extra_args: + extra_configs: - CONFIG_ZMS_DATA_CRC=y platform_allow: - native_sim From ebfc284a396ff47bf84404965bfe25d9c2a8ee91 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Mon, 11 Aug 2025 12:08:09 +0200 Subject: [PATCH 871/881] [nrf fromlist] zms: Initial support for 64 bit IDs Upstream PR #: 94330 Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t` is added, so that the maximum ID width can be controlled using Kconfig. The current ATE structure is already large enough that it is possible to reserve 64 bits for IDs without increasing its total size (128 bits). This makes the feature a natural, low footprint alternative to Settings, for cases where the supported key namespace must be larger than 32 bit but not arbitrarily large. The ATE format does have to be altered to accommodate larger IDs, but the default "32 bit" format is left as is. Now, the `struct zms_ate` describes one of two supported formats, selected by an `#if` condition. In the future, it may be possible to support multiple ATE formats at runtime, in which case the structure can be turned into a union. In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved into a union, because they are found to be mutually exclusive. With the old format, the same fields are in different locations, but one of them always gets filled with a dummy value, depending on the given ATE type. To cover both cases, a `memset` is used, which should be optimized away by the compiler when appropriate. The only limitation is that the new ATE format has no room for data CRC, but an alternative integrity check can be implemented by the caller. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 019a9ebb2b08eacf2876dd2a10e9b0c6db97f7a1) --- include/zephyr/fs/zms.h | 21 ++++++-- subsys/fs/zms/Kconfig | 11 ++++ subsys/fs/zms/zms.c | 108 +++++++++++++++++++++++++++------------ subsys/fs/zms/zms_priv.h | 35 ++++++++++++- 4 files changed, 135 insertions(+), 40 deletions(-) diff --git a/include/zephyr/fs/zms.h b/include/zephyr/fs/zms.h index 41ba053c93c..cdaa323e3da 100644 --- a/include/zephyr/fs/zms.h +++ b/include/zephyr/fs/zms.h @@ -77,6 +77,17 @@ struct zms_fs { * @{ */ +/** + * @brief ID type used in the ZMS API. + * + * @note The width of this type depends on @kconfig{CONFIG_ZMS_ID_64BIT}. + */ +#if CONFIG_ZMS_ID_64BIT +typedef uint64_t zms_id_t; +#else +typedef uint32_t zms_id_t; +#endif + /** * @brief Mount a ZMS file system onto the device specified in `fs`. * @@ -128,7 +139,7 @@ int zms_clear(struct zms_fs *fs); * @retval -EINVAL if `fs` is NULL or `len` is invalid. * @retval -ENOSPC if no space is left on the device. */ -ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len); +ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len); /** * @brief Delete an entry from the file system @@ -142,7 +153,7 @@ ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len); * @retval -EIO if there is a memory read/write error. * @retval -EINVAL if `fs` is NULL. */ -int zms_delete(struct zms_fs *fs, uint32_t id); +int zms_delete(struct zms_fs *fs, zms_id_t id); /** * @brief Read an entry from the file system. @@ -161,7 +172,7 @@ int zms_delete(struct zms_fs *fs, uint32_t id); * @retval -ENOENT if there is no entry with the given `id`. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len); +ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len); /** * @brief Read a history entry from the file system. @@ -182,7 +193,7 @@ ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len); * @retval -ENOENT if there is no entry with the given `id` and history counter. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt); +ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt); /** * @brief Gets the length of the data that is stored in an entry with a given `id` @@ -198,7 +209,7 @@ ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, ui * @retval -ENOENT if there is no entry with the given id. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id); +ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id); /** * @brief Calculate the available free space in the file system. diff --git a/subsys/fs/zms/Kconfig b/subsys/fs/zms/Kconfig index 9266fada236..f20310a8762 100644 --- a/subsys/fs/zms/Kconfig +++ b/subsys/fs/zms/Kconfig @@ -16,6 +16,15 @@ config ZMS if ZMS +config ZMS_ID_64BIT + bool "64 bit ZMS IDs" + help + When this option is true, the `zms_id_t` values passed to ZMS APIs will be 64 bit, + as opposed to the default 32 bit. + This option will also change the format of allocation table entries (ATEs) in memory + to accommodate larger IDs. Currently, this will make ZMS unable to mount an existing + file system if it has been initialized with a different ATE format. + config ZMS_LOOKUP_CACHE bool "ZMS lookup cache" help @@ -34,6 +43,7 @@ config ZMS_LOOKUP_CACHE_SIZE config ZMS_DATA_CRC bool "ZMS data CRC" + depends on !ZMS_ID_64BIT config ZMS_CUSTOMIZE_BLOCK_SIZE bool "Customize the size of the buffer used internally for reads and writes" @@ -54,6 +64,7 @@ config ZMS_CUSTOM_BLOCK_SIZE config ZMS_LOOKUP_CACHE_FOR_SETTINGS bool "ZMS Storage lookup cache optimized for settings" depends on ZMS_LOOKUP_CACHE && SETTINGS_ZMS + depends on !ZMS_ID_64BIT help Enable usage of lookup cache based on hashes to get, the best ZMS performance, provided that the ZMS is used only for the purpose of providing the settings diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index b4b11aa6923..d3bc9275479 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -29,10 +29,8 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at #ifdef CONFIG_ZMS_LOOKUP_CACHE -static inline size_t zms_lookup_cache_pos(uint32_t id) +static inline size_t zms_lookup_cache_pos(zms_id_t id) { - uint32_t hash = id; - #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS /* * 1. Settings subsystem is storing the name ID and the linked list node ID @@ -52,14 +50,27 @@ static inline size_t zms_lookup_cache_pos(uint32_t id) uint32_t key_value_bit; uint32_t key_value_hash; uint32_t key_value_ll; + uint32_t hash; key_value_bit = (id >> LOG2(ZMS_DATA_ID_OFFSET)) & 1; key_value_hash = (id & ZMS_HASH_MASK) >> (CONFIG_SETTINGS_ZMS_MAX_COLLISIONS_BITS + 1); key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; + +#elif defined(CONFIG_ZMS_ID_64BIT) + /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ + uint64_t hash = id; + + hash ^= hash >> 32; + hash *= 0x42ab4abe4c475039ULL; + hash ^= hash >> 31; + hash *= 0xfa90c4424c537791ULL; + hash ^= hash >> 32; #else /* 32-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ + uint32_t hash = id; + hash ^= hash >> 16; hash *= 0x7feb352dU; hash ^= hash >> 15; @@ -239,7 +250,7 @@ static int zms_flash_ate_wrt(struct zms_fs *fs, const struct zms_ate *entry) goto end; } #ifdef CONFIG_ZMS_LOOKUP_CACHE - /* 0xFFFFFFFF is a special-purpose identifier. Exclude it from the cache */ + /* ZMS_HEAD_ID is a special-purpose identifier. Exclude it from the cache */ if (entry->id != ZMS_HEAD_ID) { fs->lookup_cache[zms_lookup_cache_pos(entry->id)] = fs->ate_wra; } @@ -487,7 +498,7 @@ static bool zms_close_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) /* zms_empty_ate_valid validates an sector empty ate. * A valid sector empty ate should be: * - a valid ate - * - with len = 0xffff and id = 0xffffffff + * - with len = 0xffff and id = ZMS_HEAD_ID * return true if valid, false otherwise */ static bool zms_empty_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) @@ -500,7 +511,7 @@ static bool zms_empty_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) * Valid gc_done_ate: * - valid ate * - len = 0 - * - id = 0xffffffff + * - id = ZMS_HEAD_ID * return true if valid, false otherwise */ static bool zms_gc_done_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) @@ -509,6 +520,18 @@ static bool zms_gc_done_ate_valid(struct zms_fs *fs, const struct zms_ate *entry (entry->id == ZMS_HEAD_ID)); } +/* zms_sector_closed checks whether the current sector is closed, which would imply + * that the empty ATE and close ATE are both valid and have matching cycle counters + * + * return true if closed, false otherwise + */ +static bool zms_sector_closed(struct zms_fs *fs, struct zms_ate *empty_ate, + struct zms_ate *close_ate) +{ + return (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && + (empty_ate->cycle_cnt == close_ate->cycle_cnt)); +} + /* Read empty and close ATE of the sector where belongs address "addr" and * validates that the sector is closed. * retval: 0 if sector is not close @@ -526,8 +549,7 @@ static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct z return rc; } - if (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && - (empty_ate->cycle_cnt == close_ate->cycle_cnt)) { + if (zms_sector_closed(fs, empty_ate, close_ate)) { /* Closed sector validated */ return 1; } @@ -536,7 +558,7 @@ static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct z } /* store an entry in flash */ -static int zms_flash_write_entry(struct zms_fs *fs, uint32_t id, const void *data, size_t len) +static int zms_flash_write_entry(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) { int rc; struct zms_ate entry; @@ -549,13 +571,13 @@ static int zms_flash_write_entry(struct zms_fs *fs, uint32_t id, const void *dat entry.cycle_cnt = fs->sector_cycle; if (len > ZMS_DATA_IN_ATE_SIZE) { - /* only compute CRC if len is greater than 8 bytes */ - if (IS_ENABLED(CONFIG_ZMS_DATA_CRC)) { - entry.data_crc = crc32_ieee(data, len); - } +#ifdef CONFIG_ZMS_DATA_CRC + /* only compute CRC if data is to be stored outside of entry */ + entry.data_crc = crc32_ieee(data, len); +#endif entry.offset = (uint32_t)SECTOR_OFFSET(fs->data_wra); } else if ((len > 0) && (len <= ZMS_DATA_IN_ATE_SIZE)) { - /* Copy data into entry for small data ( < 8B) */ + /* Copy data into entry for small data (at most ZMS_DATA_IN_ATE_SIZE bytes) */ memcpy(&entry.data, data, len); } @@ -688,10 +710,12 @@ static int zms_sector_close(struct zms_fs *fs) struct zms_ate close_ate; struct zms_ate garbage_ate; + /* Initialize all members to 0xff */ + memset(&close_ate, 0xff, sizeof(struct zms_ate)); + close_ate.id = ZMS_HEAD_ID; close_ate.len = 0U; close_ate.offset = (uint32_t)SECTOR_OFFSET(fs->ate_wra + fs->ate_size); - close_ate.metadata = 0xffffffff; close_ate.cycle_cnt = fs->sector_cycle; /* When we close the sector, we must write all non used ATE with @@ -740,11 +764,13 @@ static int zms_add_gc_done_ate(struct zms_fs *fs) { struct zms_ate gc_done_ate; + /* Initialize all members to 0xff */ + memset(&gc_done_ate, 0xff, sizeof(struct zms_ate)); + LOG_DBG("Adding gc done ate at %llx", fs->ate_wra); gc_done_ate.id = ZMS_HEAD_ID; gc_done_ate.len = 0U; gc_done_ate.offset = (uint32_t)SECTOR_OFFSET(fs->data_wra); - gc_done_ate.metadata = 0xffffffff; gc_done_ate.cycle_cnt = fs->sector_cycle; zms_ate_crc8_update(&gc_done_ate); @@ -793,14 +819,17 @@ static int zms_add_empty_ate(struct zms_fs *fs, uint64_t addr) int rc = 0; uint64_t previous_ate_wra; + /* Initialize all members to 0 */ + memset(&empty_ate, 0, sizeof(struct zms_ate)); + addr &= ADDR_SECT_MASK; LOG_DBG("Adding empty ate at %llx", (uint64_t)(addr + fs->sector_size - fs->ate_size)); empty_ate.id = ZMS_HEAD_ID; empty_ate.len = 0xffff; - empty_ate.offset = 0U; - empty_ate.metadata = - FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | ZMS_DEFAULT_VERSION; + empty_ate.metadata = FIELD_PREP(ZMS_VERSION_MASK, ZMS_DEFAULT_VERSION) | + FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | + FIELD_PREP(ZMS_ATE_FORMAT_MASK, ZMS_DEFAULT_ATE_FORMAT); rc = zms_get_sector_cycle(fs, addr, &cycle_cnt); if (rc == -ENOENT) { @@ -893,7 +922,7 @@ static int zms_get_sector_header(struct zms_fs *fs, uint64_t addr, struct zms_at * @retval 1 valid ATE with same ID found * @retval < 0 An error happened */ -static int zms_find_ate_with_id(struct zms_fs *fs, uint32_t id, uint64_t start_addr, +static int zms_find_ate_with_id(struct zms_fs *fs, zms_id_t id, uint64_t start_addr, uint64_t end_addr, struct zms_ate *ate, uint64_t *ate_addr) { int rc; @@ -1044,10 +1073,10 @@ static int zms_gc(struct zms_fs *fs) */ if (wlk_prev_addr == gc_prev_addr) { /* copy needed */ - LOG_DBG("Moving %d, len %d", gc_ate.id, gc_ate.len); + LOG_DBG("Moving %lld, len %d", (long long)gc_ate.id, gc_ate.len); if (gc_ate.len > ZMS_DATA_IN_ATE_SIZE) { - /* Copy Data only when len > 8 + /* Copy Data only when len > ZMS_DATA_IN_ATE_SIZE * Otherwise, Data is already inside ATE */ data_addr = (gc_prev_addr & ADDR_SECT_MASK); @@ -1156,16 +1185,28 @@ static int zms_init(struct zms_fs *fs) for (i = 0; i < fs->sector_count; i++) { addr = zms_close_ate_addr(fs, ((uint64_t)i << ADDR_SECT_SHIFT)); - /* verify if the sector is closed */ - sec_closed = zms_validate_closed_sector(fs, addr, &empty_ate, &close_ate); - if (sec_closed < 0) { - rc = sec_closed; + /* read the header ATEs */ + rc = zms_get_sector_header(fs, addr, &empty_ate, &close_ate); + if (rc) { goto end; } /* update cycle count */ fs->sector_cycle = empty_ate.cycle_cnt; - if (sec_closed == 1) { + /* Check the ATE format indicator so that we know how to validate ATEs. + * The metadata field has the same offset and size in all ATE formats + * (the same is guaranteed for crc8 and cycle_cnt). + * Currently, ZMS can only recognize one of its supported ATE formats + * (the one chosen at build time), so their indicators are defined for + * the possibility of a future extension. + * If this indicator is unknown, then consider the header ATEs invalid, + * because we might not be dealing with ZMS contents at all. + */ + if (ZMS_GET_ATE_FORMAT(empty_ate.metadata) != ZMS_DEFAULT_ATE_FORMAT) { + continue; + } + + if (zms_sector_closed(fs, &empty_ate, &close_ate)) { /* closed sector */ closed_sectors++; /* Let's verify that this is a ZMS storage system */ @@ -1223,7 +1264,8 @@ static int zms_init(struct zms_fs *fs) goto end; } - if (zms_empty_ate_valid(fs, &empty_ate)) { + if ((ZMS_GET_ATE_FORMAT(empty_ate.metadata) == ZMS_DEFAULT_ATE_FORMAT) && + zms_empty_ate_valid(fs, &empty_ate)) { /* Empty ATE is valid, let's verify that this is a ZMS storage system */ if (ZMS_GET_MAGIC_NUMBER(empty_ate.metadata) == ZMS_MAGIC_NUMBER) { zms_magic_exist = true; @@ -1468,7 +1510,7 @@ int zms_mount(struct zms_fs *fs) return 0; } -ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len) +ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) { int rc; size_t data_size; @@ -1613,12 +1655,12 @@ ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len) return rc; } -int zms_delete(struct zms_fs *fs, uint32_t id) +int zms_delete(struct zms_fs *fs, zms_id_t id) { return zms_write(fs, id, NULL, 0); } -ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt) +ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt) { int rc; int prev_found = 0; @@ -1719,7 +1761,7 @@ ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, ui return rc; } -ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len) +ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len) { int rc; @@ -1732,7 +1774,7 @@ ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len) return MIN(rc, len); } -ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id) +ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id) { int rc; diff --git a/subsys/fs/zms/zms_priv.h b/subsys/fs/zms/zms_priv.h index 84f77296f4f..44cfb2f3d28 100644 --- a/subsys/fs/zms/zms_priv.h +++ b/subsys/fs/zms/zms_priv.h @@ -28,7 +28,6 @@ #endif #define ZMS_LOOKUP_CACHE_NO_ADDR GENMASK64(63, 0) -#define ZMS_HEAD_ID GENMASK(31, 0) #define ZMS_VERSION_MASK GENMASK(7, 0) #define ZMS_GET_VERSION(x) FIELD_GET(ZMS_VERSION_MASK, x) @@ -36,14 +35,28 @@ #define ZMS_MAGIC_NUMBER 0x42 /* murmur3a hash of "ZMS" (MSB) */ #define ZMS_MAGIC_NUMBER_MASK GENMASK(15, 8) #define ZMS_GET_MAGIC_NUMBER(x) FIELD_GET(ZMS_MAGIC_NUMBER_MASK, x) +#define ZMS_ATE_FORMAT_MASK GENMASK(19, 16) +#define ZMS_GET_ATE_FORMAT(x) FIELD_GET(ZMS_ATE_FORMAT_MASK, x) #define ZMS_MIN_ATE_NUM 5 #define ZMS_INVALID_SECTOR_NUM -1 -#define ZMS_DATA_IN_ATE_SIZE 8 + +#define ZMS_ATE_FORMAT_ID_32BIT 0 +#define ZMS_ATE_FORMAT_ID_64BIT 1 + +#if !defined(CONFIG_ZMS_ID_64BIT) +#define ZMS_DEFAULT_ATE_FORMAT ZMS_ATE_FORMAT_ID_32BIT +#define ZMS_HEAD_ID GENMASK(31, 0) +#else +#define ZMS_DEFAULT_ATE_FORMAT ZMS_ATE_FORMAT_ID_64BIT +#define ZMS_HEAD_ID GENMASK64(63, 0) +#endif /* CONFIG_ZMS_ID_64BIT */ /** * @ingroup zms_data_structures * ZMS Allocation Table Entry (ATE) structure + * + * @note This structure depends on @kconfig{CONFIG_ZMS_ID_64BIT}. */ struct zms_ate { /** crc8 check of the entry */ @@ -52,6 +65,8 @@ struct zms_ate { uint8_t cycle_cnt; /** data len within sector */ uint16_t len; + +#if ZMS_DEFAULT_ATE_FORMAT == ZMS_ATE_FORMAT_ID_32BIT /** data id */ uint32_t id; union { @@ -75,6 +90,22 @@ struct zms_ate { }; }; }; + +#elif ZMS_DEFAULT_ATE_FORMAT == ZMS_ATE_FORMAT_ID_64BIT + /** data id */ + uint64_t id; + union { + /** data field used to store small sized data */ + uint8_t data[4]; + /** data offset within sector */ + uint32_t offset; + /** Used to store metadata information such as storage version. */ + uint32_t metadata; + }; +#endif /* ZMS_DEFAULT_ATE_FORMAT */ + } __packed; +#define ZMS_DATA_IN_ATE_SIZE SIZEOF_FIELD(struct zms_ate, data) + #endif /* __ZMS_PRIV_H_ */ From 9669c9d3ae1d2a2c50dde61ea4465ae6809acb23 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Mon, 11 Aug 2025 12:08:09 +0200 Subject: [PATCH 872/881] [nrf fromlist] tests: zms: Add test coverage for ZMS_ID_64BIT Upstream PR #: 94330 * Update the "corrupt ATE" tests to work with the new ATE format. * Add a basic test to verify support to 64 bit ZMS IDs. * Add a `testcase.yaml` entry to cover the above points and also run lookup cache tests to evaluate the 64 bit hash function. Signed-off-by: Grzegorz Swiderski (cherry picked from commit d9e38a9c4521e9b4423526e2c8e91b64f15928c7) (cherry picked from commit 9311d969c2e501e2f01249d92304193acc20cedb) --- tests/subsys/fs/zms/src/main.c | 56 +++++++++++++++++++++++++++---- tests/subsys/fs/zms/testcase.yaml | 6 ++++ 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/tests/subsys/fs/zms/src/main.c b/tests/subsys/fs/zms/src/main.c index 15cdf217c04..80e2d9f9c07 100644 --- a/tests/subsys/fs/zms/src/main.c +++ b/tests/subsys/fs/zms/src/main.c @@ -578,17 +578,19 @@ ZTEST_F(zms, test_zms_gc_corrupt_close_ate) int err; Z_TEST_SKIP_IFNDEF(CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES); - close_ate.id = 0xffffffff; + memset(&close_ate, 0xff, sizeof(struct zms_ate)); + close_ate.id = ZMS_HEAD_ID; close_ate.offset = fixture->fs.sector_size - sizeof(struct zms_ate) * 5; close_ate.len = 0; - close_ate.metadata = 0xffffffff; close_ate.cycle_cnt = 1; close_ate.crc8 = 0xff; /* Incorrect crc8 */ - empty_ate.id = 0xffffffff; - empty_ate.offset = 0; + memset(&empty_ate, 0, sizeof(struct zms_ate)); + empty_ate.id = ZMS_HEAD_ID; empty_ate.len = 0xffff; - empty_ate.metadata = 0x4201; + empty_ate.metadata = FIELD_PREP(ZMS_VERSION_MASK, ZMS_DEFAULT_VERSION) | + FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | + FIELD_PREP(ZMS_ATE_FORMAT_MASK, ZMS_DEFAULT_ATE_FORMAT); empty_ate.cycle_cnt = 1; empty_ate.crc8 = crc8_ccitt(0xff, (uint8_t *)&empty_ate + SIZEOF_FIELD(struct zms_ate, crc8), @@ -649,7 +651,7 @@ ZTEST_F(zms, test_zms_gc_corrupt_ate) struct zms_ate close_ate; int err; - close_ate.id = 0xffffffff; + close_ate.id = ZMS_HEAD_ID; close_ate.offset = fixture->fs.sector_size / 2; close_ate.len = 0; close_ate.crc8 = @@ -955,3 +957,45 @@ ZTEST_F(zms, test_zms_input_validation) err = zms_delete(&fixture->fs, 0); zassert_true(err == -EACCES, "zms_delete call before mount fs failure: %d", err); } + +/* + * Test 64 bit ZMS ID support. + */ +ZTEST_F(zms, test_zms_id_64bit) +{ + int err; + ssize_t len; + uint64_t data; + uint64_t filling_id = 0xdeadbeefULL; + + Z_TEST_SKIP_IFNDEF(CONFIG_ZMS_ID_64BIT); + + err = zms_mount(&fixture->fs); + zassert_true(err == 0, "zms_mount call failure: %d", err); + + /* Fill the first sector with writes of different IDs */ + + while (fixture->fs.data_wra + sizeof(data) + sizeof(struct zms_ate) <= + fixture->fs.ate_wra) { + data = filling_id; + len = zms_write(&fixture->fs, (zms_id_t)filling_id, &data, sizeof(data)); + zassert_true(len == sizeof(data), "zms_write failed: %d", len); + + /* Choose the next ID so that its lower 32 bits stay invariant. + * The purpose is to test that ZMS doesn't mistakenly cast the + * 64 bit ID to a 32 bit one somewhere. + */ + filling_id += BIT64(32); + } + + /* Read back the written entries and check that they're all unique */ + + for (uint64_t id = 0xdeadbeefULL; id < filling_id; id += BIT64(32)) { + len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 0); + zassert_true(len == sizeof(data), "zms_read_hist unexpected failure: %d", len); + zassert_equal(data, id, "read unexpected data: %llx instead of %llx", data, id); + + len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 1); + zassert_true(len == -ENOENT, "zms_read_hist unexpected failure: %d", len); + } +} diff --git a/tests/subsys/fs/zms/testcase.yaml b/tests/subsys/fs/zms/testcase.yaml index 4949e1be0c6..14cb7e9c36a 100644 --- a/tests/subsys/fs/zms/testcase.yaml +++ b/tests/subsys/fs/zms/testcase.yaml @@ -27,3 +27,9 @@ tests: platform_allow: - native_sim - qemu_x86 + filesystem.zms.id_64bit: + extra_configs: + - CONFIG_ZMS_ID_64BIT=y + - CONFIG_ZMS_LOOKUP_CACHE=y + - CONFIG_ZMS_LOOKUP_CACHE_SIZE=64 + platform_allow: qemu_x86 From ff483f31e0ad7a83fe1ad327f1ff744595b689d1 Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Tue, 3 Jun 2025 16:07:48 +0200 Subject: [PATCH 873/881] [nrf noup] zms: add lookup cache hash function for legacy ZMS ZMS legacy enabled by CONFIG_SETTINGS_ZMS_LEGACY uses a different lookup cache function that is optimized for Settings subsystem. Signed-off-by: Riadh Ghaddab (cherry picked from commit 476ad665287a8b92e90ba1ec9a1ebd3241018b7a) --- subsys/fs/zms/zms.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index d3bc9275479..babf6d09b60 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -13,8 +13,12 @@ #include #include "zms_priv.h" #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS +#ifdef CONFIG_SETTINGS_ZMS_LEGACY +#include +#else #include #endif +#endif #include LOG_MODULE_REGISTER(fs_zms, CONFIG_ZMS_LOG_LEVEL); @@ -32,6 +36,40 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at static inline size_t zms_lookup_cache_pos(zms_id_t id) { #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS +#ifdef CONFIG_SETTINGS_ZMS_LEGACY + /* + * 1. The ZMS settings backend uses up to (ZMS_NAME_ID_OFFSET - 1) ZMS IDs to + store keys and equal number of ZMS IDs to store values. + * 2. For each key-value pair, the value is stored at ZMS ID greater by exactly + * ZMS_NAME_ID_OFFSET than ZMS ID that holds the key. + * 3. The backend tries to minimize the range of ZMS IDs used to store keys. + * That is, ZMS IDs are allocated sequentially, and freed ZMS IDs are reused + * before allocating new ones. + * + * Therefore, to assure the least number of collisions in the lookup cache, + * the least significant bit of the hash indicates whether the given ZMS ID + * represents a key or a value, and remaining bits of the hash are set to + * the ordinal number of the key-value pair. Consequently, the hash function + * provides the following mapping: + * + * 1st settings key => hash 0 + * 1st settings value => hash 1 + * 2nd settings key => hash 2 + * 2nd settings value => hash 3 + * ... + */ + BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAMECNT_ID), "ZMS_NAMECNT_ID is not power of 2"); + BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAME_ID_OFFSET), "ZMS_NAME_ID_OFFSET is not power of 2"); + + uint32_t key_value_bit; + uint32_t key_value_ord; + uint32_t hash; + + key_value_bit = (id >> LOG2(ZMS_NAME_ID_OFFSET)) & 1; + key_value_ord = id & (ZMS_NAME_ID_OFFSET - 1); + + hash = ((key_value_ord << 1) | key_value_bit); +#else /* * 1. Settings subsystem is storing the name ID and the linked list node ID * with only one bit difference at BIT(0). @@ -57,6 +95,7 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; +#endif /* CONFIG_SETTINGS_ZMS_LEGACY */ #elif defined(CONFIG_ZMS_ID_64BIT) /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ From 4ad30d8493aba825ee9f39c16ba44cd3d9dd87c1 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Thu, 28 Aug 2025 08:26:23 +0200 Subject: [PATCH 874/881] [nrf noup] soc: nrf54h: work around missing power domain handling This patch should be dropped as part of the next upmerge. The upcoming release of IronSide SE no longer disables RETAIN in all GPIO instances on boot, so the application must be able to handle the hardware default state of RETAIN being enabled. The GPIO retention is properly handled by changes that are currently only upstream and will be pulled in by the next upmerge. This patch exists a workaround to be able to integrate IronSide SE before the proper solution is pulled in. Signed-off-by: Jonathan Nilsen (cherry picked from commit 20d89eb11a79ec9ca6ee80372af2a725028765ac) --- soc/nordic/nrf54h/Kconfig | 5 +++++ soc/nordic/nrf54h/soc.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index de88045d32f..eefd11ac82f 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -105,6 +105,11 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT endif # SOC_NRF54H20_CPURAD_ENABLE +config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND + bool "Disable all GPIO pin retention on boot" + default y + depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index fb1c3f426d3..c996bc93e1b 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -14,6 +14,7 @@ #include #endif +#include #include #include #include @@ -173,6 +174,17 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } + + /* This is a workaround for not yet having upstream patches for properly handling + * pin retention. It should be removed as part of the next upmerge. + */ + if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) { + NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST; + + for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) { + nrf_gpio_port_retain_set(gpio_regs[i], 0); + } + } } #if defined(CONFIG_SOC_LATE_INIT_HOOK) From 5018ef7c44b22ebac79721c4ac253c6fa19bc5ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Fri, 29 Aug 2025 15:15:34 +0200 Subject: [PATCH 875/881] [nrf fromlist] tests: drivers: timer: nrf_grtc_timer: wait for coverage dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If test is to be run in coverage mode, wait for output to dump at the end of a failing testcase. Upstream PR #: 95162 Signed-off-by: Michał Stasiak (cherry picked from commit 103b06acfc2bf2d3c1f6414e5c3448e74d477ae6) --- tests/drivers/timer/nrf_grtc_timer/src/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index 9de554256b4..7e2b440a9aa 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -393,6 +393,13 @@ static void grtc_stress_test(bool busy_sim_en) if (counter_dev) { counter_stop(counter_dev); } + +#ifdef CONFIG_COVERAGE + /* Wait a few seconds before exit, giving the test the + * opportunity to dump some output before coverage data gets emitted + */ + k_sleep(K_MSEC(5000)); +#endif } ZTEST(nrf_grtc_timer, test_stress) From 36570e5daa4aeeabcce5843dc95cc283ade218ba Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 2 Sep 2025 10:48:14 +0100 Subject: [PATCH 876/881] [nrf noup] doc: extensions: kconfig: Add SoC sysbuild Kconfigs Allows listing sysbuild Kconfigs for SoCs Signed-off-by: Jamie McCrae (cherry picked from commit 1d73d0e3cb5ff37fd53c103bb49c1e9b92be75c5) --- doc/_extensions/zephyr/kconfig/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index cda7430d7ab..a76ac87f887 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -112,6 +112,9 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d for folder in soc_folders: f.write('source "' + (Path(folder) / 'Kconfig.soc').as_posix() + '"\n') + if "nordic" in folder: + f.write('osource "' + (Path(folder) / 'Kconfig.sysbuild').as_posix() + '"\n') + with open(Path(td) / "soc" / "Kconfig", "w") as f: for folder in soc_folders: f.write('osource "' + (Path(folder) / 'Kconfig').as_posix() + '"\n') From dcf56757feb665c338453571bcd7cbaf6d5713b6 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 28 Aug 2025 15:12:39 +0300 Subject: [PATCH 877/881] [nrf fromlist] manifest: tf-m-tests: bring in fix for TF-M 2.2.0 Fixup to the TF-M 2.2.0 update. Signed-off-by: Tomi Fontanilles Upstream PR #: 94729 Signed-off-by: Tomi Fontanilles (cherry picked from commit b48a1f26ef887cee5f3c20ee04c1b1db7f43f226) --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 04bdd669a92..57ad7affdd1 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -35,7 +35,7 @@ manifest: groups: - optional - name: tf-m-tests - revision: a286347e6a5dd37a9a5e960450ffc0260d63fb27 + revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 path: modules/tee/tf-m/tf-m-tests remote: upstream groups: From 6c285c2a0cf8a3b9d0df2665a15cb05bde4ec5c3 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 10 Sep 2025 09:14:29 +0100 Subject: [PATCH 878/881] [nrf fromlist] scripts: requirements: Add python-dotenv This is needed for any Kconfig processing Upstream PR #: 95771 Signed-off-by: Jamie McCrae (cherry picked from commit 2fc387e0dd4d8292bdf4f0683a7044639a810f65) --- scripts/requirements-actions.in | 1 + scripts/requirements-actions.txt | 4 ++++ scripts/requirements-build-test.txt | 2 ++ scripts/requirements-compliance.txt | 1 + 4 files changed, 8 insertions(+) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 997afed3871..6baf9dc9e3f 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -22,6 +22,7 @@ pykwalify pylint>=3 pyserial pytest +python-dotenv python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" pyyaml diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 8c28b2d22f7..21505203bfa 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -880,6 +880,10 @@ python-debian==1.0.1 \ --hash=sha256:3ada9b83a3d671b58081782c0969cffa0102f6ce433fbbc7cf21275b8b5cc771 \ --hash=sha256:8f137c230c1d9279c2ac892b35915068b2aca090c9fd3da5671ff87af32af12c # via reuse +python-dotenv==1.1.1 \ + --hash=sha256:31f23644fe2602f88ff55e1f5c79ba497e01224ee7737937930c448e4d0e24dc \ + --hash=sha256:a8a6399716257f45be6a007360200409fce5cda2661e3dec71d23dc15f6189ab + # via -r requirements-actions.in python-magic==0.4.27 ; sys_platform != 'win32' \ --hash=sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b \ --hash=sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3 diff --git a/scripts/requirements-build-test.txt b/scripts/requirements-build-test.txt index 2ce1227e3e7..e6264b11ea5 100644 --- a/scripts/requirements-build-test.txt +++ b/scripts/requirements-build-test.txt @@ -19,3 +19,5 @@ mypy # used for JUnit XML parsing in CTest harness junitparser>=3.0.0 + +python-dotenv diff --git a/scripts/requirements-compliance.txt b/scripts/requirements-compliance.txt index 3c3841cf33e..6d90ac4b258 100644 --- a/scripts/requirements-compliance.txt +++ b/scripts/requirements-compliance.txt @@ -8,6 +8,7 @@ junitparser>=4.0.1 lxml>=5.3.0 pykwalify pylint>=3 +python-dotenv python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" ruff==0.11.11 From ebda687fe79baf599f8b365916d2ecfac5c6e84d Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 10 Sep 2025 09:08:10 +0100 Subject: [PATCH 879/881] [nrf fromlist] kconfig: Load Kconfig env file better Loads this file in a better way that means samples and modules should not have to source the file before referencing Kconfig module path variables Upstream PR #: 95771 Signed-off-by: Jamie McCrae (cherry picked from commit 25ced410af6caf6fea810b49ef4cf9b3bcb40b2b) --- Kconfig.zephyr | 1 - cmake/modules/kconfig.cmake | 5 ++++- doc/_extensions/zephyr/kconfig/__init__.py | 6 ++++-- scripts/ci/check_compliance.py | 8 ++++++-- scripts/zephyr_module.py | 18 +++++++++++++++--- share/sysbuild/Kconfig | 2 -- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index d8df86add4d..d758a03baff 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -6,7 +6,6 @@ # SPDX-License-Identifier: Apache-2.0 source "Kconfig.constants" -source "$(KCONFIG_ENV_FILE)" osource "$(APPLICATION_SOURCE_DIR)/VERSION" diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index de87abfdc1d..60667eb6444 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -132,10 +132,13 @@ endif() # APP_DIR: Path to the main image (sysbuild) or synonym for APPLICATION_SOURCE_DIR (non-sysbuild) zephyr_get(APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR) +# Load the module Kconfig file into CMake +include("${KCONFIG_BINARY_DIR}/kconfig_module_dirs.cmake") + set(COMMON_KCONFIG_ENV_SETTINGS PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} - KCONFIG_ENV_FILE=${KCONFIG_BINARY_DIR}/kconfig_module_dirs.env srctree=${ZEPHYR_BASE} + ${kconfig_env_dirs} KERNELVERSION=${KERNELVERSION} APPVERSION=${APP_VERSION_STRING} APP_VERSION_EXTENDED_STRING=${APP_VERSION_EXTENDED_STRING} diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index a76ac87f887..63459a61ade 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -44,6 +44,7 @@ from typing import Any from docutils import nodes +from dotenv import load_dotenv from sphinx.addnodes import pending_xref from sphinx.application import Sphinx from sphinx.builders import Builder @@ -81,7 +82,8 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d sysbuild_kconfig = "" for module in modules: kconfig_module_dirs += zephyr_module.process_kconfig_module_dir(module.project, - module.meta) + module.meta, + False) kconfig += zephyr_module.process_kconfig(module.project, module.meta) sysbuild_kconfig += zephyr_module.process_sysbuildkconfig(module.project, module.meta) @@ -158,7 +160,7 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d os.environ["BOARD"] = "boards" os.environ["KCONFIG_BOARD_DIR"] = str(Path(td) / "boards") - os.environ["KCONFIG_ENV_FILE"] = str(Path(td) / "kconfig_module_dirs.env") + load_dotenv(str(Path(td) / "kconfig_module_dirs.env")) # Sysbuild runs first os.environ["CONFIG_"] = "SB_CONFIG_" diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index d52f9c15878..c9b9b967136 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -23,6 +23,8 @@ import unidiff import yaml +from dotenv import load_dotenv + from yamllint import config, linter from junitparser import TestCase, TestSuite, JUnitXml, Skipped, Error, Failure @@ -730,14 +732,14 @@ def parse_kconfig(self): os.environ["KCONFIG_BINARY_DIR"] = kconfiglib_dir os.environ['DEVICETREE_CONF'] = "dummy" os.environ['TOOLCHAIN_HAS_NEWLIB'] = "y" - os.environ['KCONFIG_ENV_FILE'] = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") + kconfig_env_file = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") # Older name for DEVICETREE_CONF, for compatibility with older Zephyr # versions that don't have the renaming os.environ["GENERATED_DTS_BOARD_CONF"] = "dummy" # For multi repo support - self.get_modules(os.environ['KCONFIG_ENV_FILE'], + self.get_modules(kconfig_env_file, os.path.join(kconfiglib_dir, "Kconfig.modules"), os.path.join(kconfiglib_dir, "Kconfig.sysbuild.modules"), os.path.join(kconfiglib_dir, "settings_file.txt")) @@ -751,6 +753,8 @@ def parse_kconfig(self): # symbols within Kconfig files os.environ["KCONFIG_WARN_UNDEF"] = "y" + load_dotenv(kconfig_env_file) + try: # Note this will both print warnings to stderr _and_ return # them: so some warnings might get printed diff --git a/scripts/zephyr_module.py b/scripts/zephyr_module.py index c214f51704c..6606af52ba0 100755 --- a/scripts/zephyr_module.py +++ b/scripts/zephyr_module.py @@ -386,10 +386,13 @@ def kconfig_snippet(meta, path, kconfig_file=None, blobs=False, taint_blobs=Fals return '\n'.join(snippet) -def process_kconfig_module_dir(module, meta): +def process_kconfig_module_dir(module, meta, cmake_output): module_path = PurePath(module) name_sanitized = meta['name-sanitized'] - return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' + + if cmake_output is False: + return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' + return f'list(APPEND kconfig_env_dirs ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()})\n' def process_kconfig(module, meta): @@ -870,6 +873,7 @@ def main(): args = parser.parse_args() kconfig_module_dirs = "" + kconfig_module_dirs_cmake = "set(kconfig_env_dirs)\n" kconfig = "" cmake = "" sysbuild_kconfig = "" @@ -882,7 +886,8 @@ def main(): args.modules, args.extra_modules) for module in modules: - kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta) + kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta, False) + kconfig_module_dirs_cmake += process_kconfig_module_dir(module.project, module.meta, True) kconfig += process_kconfig(module.project, module.meta) cmake += process_cmake(module.project, module.meta) sysbuild_kconfig += process_sysbuildkconfig( @@ -894,13 +899,20 @@ def main(): if args.kconfig_out or args.sysbuild_kconfig_out: if args.kconfig_out: kconfig_module_dirs_out = PurePath(args.kconfig_out).parent / 'kconfig_module_dirs.env' + kconfig_module_dirs_cmake_out = PurePath(args.kconfig_out).parent / \ + 'kconfig_module_dirs.cmake' elif args.sysbuild_kconfig_out: kconfig_module_dirs_out = PurePath(args.sysbuild_kconfig_out).parent / \ 'kconfig_module_dirs.env' + kconfig_module_dirs_cmake_out = PurePath(args.sysbuild_kconfig_out).parent / \ + 'kconfig_module_dirs.cmake' with open(kconfig_module_dirs_out, 'w', encoding="utf-8") as fp: fp.write(kconfig_module_dirs) + with open(kconfig_module_dirs_cmake_out, 'w', encoding="utf-8") as fp: + fp.write(kconfig_module_dirs_cmake) + if args.kconfig_out: with open(args.kconfig_out, 'w', encoding="utf-8") as fp: fp.write(kconfig) diff --git a/share/sysbuild/Kconfig b/share/sysbuild/Kconfig index 1a9f36ac777..b9cec010dd9 100644 --- a/share/sysbuild/Kconfig +++ b/share/sysbuild/Kconfig @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 -source "$(KCONFIG_ENV_FILE)" - config BOARD string default "$(BOARD)" From a62bca74e58308a301c7c9087d346f6b3d5b0408 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 07:48:52 +0200 Subject: [PATCH 880/881] [nrf noup] dts: Select SoftDevice Controller DTS binding as default The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. The SoftDevice Controller is a default BT controller in nRF Connect SDK context, therefore it should be enabled by default instead of open source link layer. The commit changes the default BT controller for nRF54lm20a SoC. Signed-off-by: Piotr Pryga --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 ----- boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts | 4 ---- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 5 +++++ dts/vendor/nordic/nrf54lm20a.dtsi | 5 +++++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index d6184705899..0ee33f1fd45 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -18,7 +18,6 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; - zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; }; @@ -131,10 +130,6 @@ status = "okay"; }; -&bt_hci_controller { - status = "okay"; -}; - &ieee802154 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index 6dd2c5b2e85..727729600c2 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -18,9 +18,5 @@ }; }; -&bt_hci_controller { - status = "okay"; -}; - /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index dc13fb40d6a..b7c0beed179 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -17,6 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; }; @@ -37,6 +38,10 @@ nvic: &cpuapp_nvic {}; }; }; +&bt_hci_sdc { + status = "okay"; +}; + &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 0601771d496..d1e6d1b0d28 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -277,6 +277,11 @@ /* Note: In the nRF Connect SDK the SoftDevice Controller * is added and set as the default Bluetooth Controller. */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From 4fdd486d2c1333e93a6a1159af0466e58a787505 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 08:00:49 +0200 Subject: [PATCH 881/881] [nrf noup] dts: choose a crypto accelerator for entropy Set PSA as the entropy source for nRF54lm20a target. PSA is the only NCS-supported interface to CRACEN. Signed-off-by: Piotr Pryga --- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index b7c0beed179..d6ad16c7054 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -18,7 +18,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_sdc; - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -29,7 +29,7 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; rng: rng {